dslinux/user/bitchx/bx-conf Makefile.in ds_cell.c ds_cell.h ds_keys.h file_cpy.c func_pr.h load.c save.c test.h
stsp
stsp at user.in-berlin.de
Sun Jul 2 15:18:32 CEST 2006
Update of /cvsroot/dslinux/dslinux/user/bitchx/bx-conf
In directory antilope:/tmp/cvs-serv9280/bx-conf
Added Files:
Makefile.in ds_cell.c ds_cell.h ds_keys.h file_cpy.c func_pr.h
load.c save.c test.h
Log Message:
Adding pristine copy of BitchX so I can branch from it.
--- NEW FILE: test.h ---
CONNECT_TIMEOUT 20
IRC_PORT 6667
DEFAULT_PING_TYPE 1
DEFAULT_MSGLOG ON
DEFAULT_AUTO_NSLOOKUP OFF
DEFAULT_REASON_TYPE ON
DEFAULT_LLOOK_DELAY 120
DEFAULT_ALWAYS_SPLIT_BIGGEST ON
DEFAULT_AUTO_UNMARK_AWAY OFF
DEFAULT_AUTO_WHOWAS OFF
DEFAULT_BEEP ON
DEFAULT_BEEP_MAX 3
DEFAULT_BEEP_WHEN_AWAY OFF
DEFAULT_BOLD_VIDEO ON
DEFAULT_BLINK_VIDEO ON
DEFAULT_CHANNEL_NAME_WIDTH 10
DEFAULT_CLOCK ON
DEFAULT_CLOCK_24HOUR OFF
DEFAULT_COMMAND_MODE OFF
DEFAULT_COMMENT_HACK ON
DEFAULT_DISPLAY ON
DEFAULT_EIGHT_BIT_CHARACTERS ON
DEFAULT_EXEC_PROTECTION ON
DEFAULT_FULL_STATUS_LINE ON
DEFAULT_HELP_PAGER ON
DEFAULT_HELP_PROMPT ON
DEFAULT_HIGH_BIT_ESCAPE OFF
DEFAULT_HIDE_PRIVATE_CHANNELS OFF
DEFAULT_HISTORY 100
DEFAULT_HOLD_MODE OFF
DEFAULT_HOLD_MODE_MAX 0
DEFAULT_INDENT ON
DEFAULT_INPUT_ALIASES OFF
DEFAULT_INPUT_PROTECTION OFF
DEFAULT_INSERT_MODE ON
DEFAULT_INVERSE_VIDEO ON
DEFAULT_LASTLOG 1000
DEFAULT_LOG OFF
DEFAULT_MAIL 2
DEFAULT_NOTIFY_ON_TERMINATION OFF
DEFAULT_SCROLL_LINES ON
DEFAULT_SEND_IGNORE_MSG OFF
DEFAULT_SHELL_LIMIT 0
DEFAULT_SHOW_AWAY_ONCE ON
DEFAULT_SHOW_CHANNEL_NAMES ON
DEFAULT_SHOW_END_OF_MSGS OFF
DEFAULT_SHOW_NUMERICS OFF
DEFAULT_SHOW_STATUS_ALL OFF
DEFAULT_SHOW_WHO_HOPCOUNT OFF
DEFAULT_META_STATES 5
DEFAULT_IGNORE_TIME 600
DEFAULT_MAX_DEOPS 2
DEFAULT_MAX_IDLEKICKS 2
DEFAULT_NUM_BANMODES 4
DEFAULT_NUM_KICKS 4
DEFAULT_NUM_OF_WHOWAS 4
DEFAULT_NUM_OPMODES 4
DEFAULT_SEND_AWAY_MSG OFF
DEFAULT_SOCKS_PORT 1080
DEFAULT_AUTO_AWAY_TIME 600
DEFAULT_AUTO_RECONNECT ON
DEFAULT_AUTO_UNBAN 600
DEFAULT_DOUBLE_STATUS_LINE ON
DEFAULT_FTP_GRAB OFF
DEFAULT_HARD_UH_NOTIFY ON
DEFAULT_HTTP_GRAB OFF
DEFAULT_HELP_WINDOW OFF
DEFAULT_NICK_COMPLETION ON
DEFAULT_NICK_COMPLETION_LEN 2
DEFAULT_NICK_COMPLETION_TYPE 0
DEFAULT_NOTIFY ON
DEFAULT_MAX_SERVER_RECONNECT 2
DEFAULT_SERVER_GROUPS OFF
DEFAULT_WINDOW_DESTROY_PART OFF
DEFAULT_SUPPRESS_SERVER_MOTD ON
DEFAULT_TAB ON
DEFAULT_TAB_MAX 8
DEFAULT_UNDERLINE_VIDEO ON
DEFAULT_VERBOSE_CTCP ON
DEFAULT_DISPLAY_ANSI ON
DEFAULT_DISPLAY_PC_CHARACTERS 4
DEFAULT_FLOATING_POINT_MATH OFF
DEFAULT_AUTO_AWAY ON
DEFAULT_CONNECT_TIMEOUT 30
DEFAULT_STATUS_NO_REPEAT ON
DEFAULT_DISPATCH_UNKNOWN_COMMANDS OFF
DEFAULT_SCROLLBACK_LINES 512
DEFAULT_SCROLLBACK_RATIO 50
DEFAULT_ND_SPACE_MAX 160
DEFAULT_CPU_SAVER_AFTER 0
DEFAULT_CPU_SAVER_EVERY 0
DEFAULT_NO_FAIL_DISCONNECT OFF
DEFAULT_MAX_URL 20
DEFAULT_OPERVIEW_HIDE 0
DEFAULT_OPER_VIEW OFF
--- NEW FILE: ds_cell.h ---
/*
* Program source is Copyright 1993 Colten Edwards.
* Central Data Services is granted the right to use this source
* in thier product known as Quote Menu. They are also granted the right
* to modify this source in the advent of problems and or new features
* which they may want to add to the program.
*/
#include <stdlib.h>
#include <dirent.h>
#include <ncurses.h>
#define MAXPATH MAXNAMLEN
/* Defines for shadows. Used in the Box rountine. */
#define NO_SHADOW 0
#define SINGLER_SHADOW 1
#define DOUBLER_SHADOW 2
#define SINGLEL_SHADOW 3
#define DOUBLEL_SHADOW 4
#define NO_LINE 0
#define SINGLE_LINE 1
#define DOUBLE_LINE 2
#define SINGLE_TOP 3
#define SINGLE_SIDE 4
#define SOLID_LINES 5
#define TOP_BOT_SLINE 6
#define TOP_BOT_DLINE 7
#define TOP_BOT_SOLID 8
#define NUM_KEYS 80
/* Number of color table entries */
#define MAXC_TABLE 6
/* Number of User Defined Functions */
#define MAXU_FUNCS 10
#define CURCOL 24 /* Starting edit cursor column */
#define WRITE_FILE 0
#define READ_FILE 1
#define CURSOROFF 0x2000
/* A define used for the CONFIG entries on the max. path allowed.*/
#define WILDCARD 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
typedef struct {
char letter;
int return_answer;
} _default;
#define LOC_YN_Y 18
#define LOC_YN_X 24
extern struct _VIDEO {
unsigned char winleft;
unsigned char wintop;
unsigned char winright;
unsigned char winbottom;
unsigned char attribute;
unsigned char normattr;
unsigned char currmode;
unsigned char screenheight;
unsigned char screenwidth;
unsigned char graphics;
unsigned char needcgasync;
char *videobuffer;
} _video;
typedef struct dlistmem *dlistptr;
struct datainforec {
char *option;
char *help;
int other;
char *save;
int (*func)();
int integer;
int type;
#if 0
long act_size;
int volume;
long pos_in_archive;
dev_t dev;
uid_t uid;
gid_t gid;
umode_t mode;
umode_t org_mode;
long size;
time_t atime;
time_t mtime;
time_t ctime;
time_t backup_time;
char name_len;
char compressed;
long checksum;
#endif
int mark;
};
struct dlistmem {
struct datainforec datainfo;
dlistptr nextlistptr;
dlistptr prevlistptr;
};
typedef struct cell
{
/*
* Possible Startup and Exit Procedures to use
*/
int (*ListEntryProc)(struct cell *cell );
int (*ListExitProc)(struct cell *cell);
/*
* What to do on a key and the screen paint routine
* What to do on a special key
*/
int (*ListEventProc)(struct cell *cell);
int (*ListPaintProc)(struct cell *cell);
int (*OtherGetKeyProc)(struct cell *cell);
/* Possible actions to take with a keystroke. */
/*
* The current line we are at.
*/
int (*current_event)(struct cell *cell);
int (*event1)(struct cell *cell);
int (*event2)(struct cell *cell);
int (*UpdateStatusProc)(struct cell *cell);
struct KeyTable *keytable;
struct FuncTable *func_table;
/* These are what start everything off. */
/* start is the start of the list.*/
/* end is the end of the list. */
/* current is the current highlighted line on the screen*/
dlistptr start;
dlistptr current;
dlistptr end;
/*
* Begin and end of the current display list. current should be somewhere
* between these.
*/
dlistptr list_start;
dlistptr list_end;
WINDOW *window; /* WINDOW from ncurses */
int redraw; /* screen needs attention */
int srow; /* window start row cordinate */
int scol; /* Window start Column */
int erow; /* Window Ending Row */
int ecol; /* Window ending column */
int max_cols; /* Max Columns on the screen */
int max_rows; /* Max Rows on the screen */
int save_row; /* save the cursor pos row */
int save_col; /* save the cursor pos col */
int cur_pos; /* current cursor column when using edit*/
int cur_row; /* current cursor row when using edit */
int desc_start; /* Used when editing large fields. */
unsigned int termkey; /* this is cleared on enter, setting it to
* any value other than zero causes the
* function to return. Usually set to the
* key we terminate with.
*/
unsigned int special; /* Holds value for the current item function
* number
*/
unsigned int key; /* Current Keystroke */
unsigned int other_getkey; /* set this to use other get_char routine */
/* if supplied */
unsigned int normcolor; /* Normal Text Screen Color*/
unsigned int barcolor; /* Bar text Screen Color */
int insert_mode; /* Insert/OverWrite Cursor Mode */
int menu_bar; /* Set this if a menu at the bottom
* of the screen is needed
*/
int dest_src;
char *filename;
char **argv;
int argc;
} CELL;
typedef struct KeyTable
{
int key;
int func_num;
char desc[40];
} KEYTABLE;
typedef struct UKeyTable
{
int key;
char desc[40];
char program[MAXPATH+1];
char params[40];
} USERKEYTABLE;
typedef struct FuncTable
{
int key;
int (*func)(struct cell *c);
} FUNC_TABLE ;
struct COLOR {
unsigned char dosborder ;
unsigned char dostext ;
unsigned char background;
unsigned char back_text;
unsigned char menuborder ;
unsigned char menuback ;
unsigned char menutext ;
unsigned char menucursor ;
unsigned char menushadow ;
unsigned char fileborder;
unsigned char filebar;
unsigned char filetext;
};
#define LS_END 0
#define LS_HOME 1
#define LS_PGUP 2
#define LS_PGDN 3
#define CURSOR_UP 4
#define CURSOR_DN 5
#define LS_QUIT 6
#define WRAP_CURSOR_DN 7
#define WRAP_CURSOR_UP 8
#define DO_SHELL 9
#define LS_ENTER 10
#define UPFUNC 11
#define TOGGLE 12
#define PLUS_IT 13
#define MINUS_IT 14
#define LS_CLEAR 15
#define LS_TOGGLE 16
#define RENAME_FILE 17
#define CHANGE_SRC 18
#define CHANGE_DEST 19
#define LS_PLAY 20
--- NEW FILE: load.c ---
void init_default()
{
int i;
for (i = 0; compile_default[i].option; i++)
compile_default[i].integer = 0;
for (i = 0; dcc_default[i].option; i++)
dcc_default[i].integer = 0;
for (i = 0; server_default[i].option; i++)
server_default[i].integer = 0;
for (i = 0; userlist_default[i].option; i++)
userlist_default[i].integer = 0;
for (i = 0; flood_default[i].option; i++)
flood_default[i].integer = 0;
for (i = 0; various_default[i].option; i++)
various_default[i].integer = 0;
}
char def[] = "#define ";
int load_file(char *filename)
{
FILE *out = NULL;
char buf[200];
int dlen = strlen(def);
char *p, *value, *define;
int i, found = 0;
int init = 0;
if (!(out = fopen(filename, "r")))
return 0;
while(!feof(out))
{
found = 0;
if (!(fgets(buf, 100, out)))
break;
if ((p = strchr(buf, '\n')))
*p = 0;
if ((p = strchr(buf, '\r')))
*p = 0;
if (!buf[0])
continue;
if (!init)
{
init_default();
init++;
}
if (strncmp(buf, def, dlen))
continue;
/* got a #define lets break it down. */
define = buf;
if ((p = strchr(buf, ' ')))
*p++ = 0;
define = p;
if ((p = strchr(define, ' ')))
*p++ = 0;
while (p && strchr(" \t", *p))
p++;
value = p;
if (!value || !define || !*define || !*value)
continue;
for (i = 0; compile_default[i].option; i++)
{
if (!strcmp(compile_default[i].out, define))
{
if (isdigit(*value))
compile_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
if (found) continue;
for (i = 0; dcc_default[i].option; i++)
{
if (!strcmp(dcc_default[i].out, define))
{
if (isdigit(*value))
dcc_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
if (found) continue;
for (i = 0; server_default[i].option; i++)
{
if (!strcmp(server_default[i].out, define))
{
if (isdigit(*value))
server_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
if (found) continue;
for (i = 0; userlist_default[i].option; i++)
{
if (!strcmp(userlist_default[i].out, define))
{
if (isdigit(*value))
userlist_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
if (found) continue;
for (i = 0; flood_default[i].option; i++)
{
if (!strcmp(flood_default[i].out, define))
{
if (isdigit(*value))
flood_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
if (found) continue;
for (i = 0; various_default[i].option; i++)
{
if (!strcmp(various_default[i].out, define))
{
if (isdigit(*value))
various_default[i].integer = strtoul(value, NULL, 10);
found++;
break;
}
}
}
fclose(out);
return TRUE;
}
--- NEW FILE: func_pr.h ---
/* BACK_TYP.C 06/05/93 23.13.26 */
int backup_type1 (CELL *c);
int update_back1 (CELL *c);
int update_back (CELL *c);
int select_type (CELL *c);
/* DO_DRIVE.C 06/05/93 23.13.24 */
int update_drive (CELL *c);
int Drive_Entry (CELL *c);
int drive_redraw (CELL *c);
int floppy_drive (CELL *c);
int hard_drive (CELL *c);
int get_drive (CELL *c);
/* DO_SETUP.C 11/05/93 05.57.20 */
int save_user (CELL *c);
int delete_user (CELL *c);
int validkey (long validkey, int input);
int desc_edit (CELL *c);
int eredraw (CELL *c);
int insert_edlist (CELL *c, char *ffblk, int menu_numb);
int eList_Entry (CELL *c);
int edit_user (CELL *c);
/* DO_UPDAT.C 06/05/93 23.13.32 */
int update_func (CELL *c);
/* DS_ATTIB.C 06/05/93 23.13.32 */
void attrib (int strow, int stcol, int edrow, int edcol, int color);
/* DS_BOX.C 06/05/93 23.13.32 */
/*
void box (int strow, int stcol, int edrow, int edcol, int border, int fill, int
lines, int shadow, int shad_color);
void hline (int strow, int stcol, int edrow, int edcol, int border, int lines);
void vline (int strow, int stcol, int edrow, int edcol, int border, int lines);
*/
/* DS_CELL.C 06/05/93 23.13.30 */
int get_current (CELL *c);
int set_list_end (CELL *c);
int wrap_cursor_up (CELL *c);
int wrap_cursor_dn (CELL *c);
int cursor_up (CELL *c);
int cursor_dn (CELL *c);
int ls_pgup (CELL *c);
int ls_pgdn (CELL *c);
int ls_home (CELL *c);
int ls_end (CELL *c);
int ls_dispatch (CELL *c);
int ls_quit (CELL *c);
/* DS_CHAR.C 06/05/93 23.13.30 */
void attrib_ch (int strow, int stcol, int edrow, int edcol, int color, char cha
);
/* DS_CONFI.C 06/05/93 23.13.30 */
void do_color_select (CELL *c);
int do_config_write (char *argv[], int read_write);
void calc_offset (int color, int *r, int *c);
int color_select (CELL *c1, int srow, int scol, int color, char *title);
void color_chart (int srow, int scol);
int update_color (CELL *c);
int select_color (CELL *c);
/* DS_CRIT.C 06/05/93 23.13.30 */
int handle_quiet (int di, int ax, int bp, int si);
int handler (int di, int ax, int bp, int si);
int critical_errorwnd (char *msg);
/* DS_LLIST.C 06/05/93 23.13.30 */
int q_func (CELL *c);
void init_dlist (CELL *c);
int clear_dlist (CELL *c);
char *Display (CELL *c, dlistptr *thisptr);
long insert_dlist (CELL *c, char *ffblk, int menu_numb);
int do_dir (CELL *c);
int List_Entry (CELL *c);
int List_Exit (CELL *c);
int redraw (CELL *c);
void get_args (CELL *c, int argc, char *argv[]);
/* DS_PATCH.C 11/05/93 20.03.50 */
int error_message (CELL *c, int error_code, unsigned char exec_return);
int do_shell (CELL *c);
int swap_it (CELL *c, char *program, char *params, char *exit_pr, int pause,
int do_swap, int command_proc, int verify_flag, int change_dir);
int swap_box (CELL *c, char *program, char *comm_line, int swap_prog, int flags
);
/* DS_SORT.C 06/05/93 23.13.28 */
int comp_name (void *a, void *b);
int sort_buffer (CELL *c);
void *next_item (void *current);
void set_next (void *first, void *second);
void *qsortl (void *list, void * (*getnext)(void *), void (*setnext)(void *,
void *), int (*compare)(void *, void *));
/* DS_VIDEO.C 06/05/93 23.13.28 */
void check_desqv (CELL *c);
/* DS_VREST.C 06/05/93 23.13.28 */
void scr_rest (int strow, int stcol, int edrow, int edcol, char *buffer);
/* DS_VSAVE.C 06/05/93 23.13.28 */
void scr_save (int strow, int stcol, int edrow, int edcol, char *buffer);
/* FILE_CPY.C 11/05/93 19.40.46 */
int delete_dlist (CELL *c);
int change_dir (CELL *c);
int status_update (CELL *c);
int toggle (CELL *c);
int plus_it (CELL *c);
int minus_it (CELL *c);
/*int insert_fdlist (CELL *c, struct ffblk *ff_blk);*/
int File_Entry (CELL *c);
char *pad_name (char *fn);
char *fDisplay (dlistptr *ptr);
int fredraw (CELL *c);
int file_routine (CELL *c);
int change_dest_src (CELL *c);
int update_select (CELL *c);
int dest_src_select (CELL *c);
int file_copyr (char *from, char *to);
int file_settime (char *src, char *dst);
int copy_file (CELL *c);
int delete_file (CELL *c);
int in_default (_default *defaults, char answer);
int do_getyn (char *prompt, _default *defaults, char def_answer, int wrow, int
wcol);
int edit_path (CELL *c);
char *uDisplay (CELL *c, char *str);
int uredraw (CELL *c);
int ueList_Entry (CELL *c);
int setuserpath (CELL *c);
int dosExpandPath (char *path, char *filename, char *new_path);
void dosRelativePath (char *path);
int isDir (char *filename);
int GetUserPath (CELL *c);
int do_getuser (CELL *c, char *buff);
/* FILE_UTI.C 06/05/93 23.13.26 */
int update_file (CELL *c);
int do_file_util (CELL *c);
/* FMT_LONG.C 06/05/93 23.13.26 */
char *fmt_long (unsigned long int val);
void cursor (int x, int y);
void savecursor (unsigned newcursor);
void restorecursor (void);
void rscroll (int updown, int lines, int strow, int stcol, int endrow, int
endcol, int attribute);
void curr_cursor (int *x, int *y);
void set_cursor_type (int t);
void clear_screen (void);
void clear_ch (void);
int vmode (void);
int scroll_lock (void);
void os_version (char *error_str);
void string (int color, int asciichar, int repeats);
void pushkey (int key);
int isxkeybrd (void);
int get_char (CELL *c, int menu);
int get_num_floppy (void);
char *volume_label (void);
int ren_wild (char *old, char *new);
int kb_hit (void);
/* PRNSTR1.C 06/05/93 23.13.26 */
int prnstr (char *text, int row, int col, unsigned color);
/* USER_FUN.C 06/05/93 23.13.26 */
int user_key (CELL *c);
int do_user (CELL *c);
int UList_Entry (CELL *c);
int user_func (CELL *c);
int play_mp3(CELL *c);
--- NEW FILE: Makefile.in ---
SHELL = @SHELL@
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
topdir = @topdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = @oldincludedir@
local_dir = $(HOME)
# Where the BitchX binary will be installed.
# "make install" will compile and install the program.
INSTALL_IRC = @INSTALL_IRC@
# Where the BitchX library will be. Generally this is the place that
# you put the scripts, help pages and translation tables. It is
# very important that you set this correctly.
IRCLIB = @IRCLIB@
CC = @CC@
DEFS = @INCLUDES@
LIBS = @LIBS@
# Tcl library.
TCL_LIBS = @TCL_LIBS@
# These are for Tcl support.
TCL_OBJS = @TCL_OBJS@
# You don't have the following, so you'll want to leave this blank.
TCL_SRCS = @TCL_SRCS@
# Set this to -g if you want to be able to debug the client, otherwise
# use -O to have the compiler do some optimization instead.
CFLAGS = @CFLAGS@
# Set this to -s if you want the binary to be stripped.
LDFLAGS = @LDFLAGS@
# These are for the cd device player.
CD_SRCS = @CD_SRCS@
CD_OBJS = @CD_OBJS@
# This is the executable suffix for the target operating system.
EXEEXT = @EXEEXT@
# Extra files.
DEFAULT_CTOOLZ_DIR = @DEFAULT_CTOOLZ_DIR@
DEFAULT_MSGLOGFILE = @DEFAULT_MSGLOGFILE@
DEFAULT_BITCHX_HELP_FILE = @DEFAULT_BITCHX_HELP_FILE@
DEFAULT_SCRIPT_HELP_FILE = @DEFAULT_SCRIPT_HELP_FILE@
DEFAULT_BITCHX_KICK_FILE = @DEFAULT_BITCHX_KICK_FILE@
DEFAULT_BITCHX_QUIT_FILE = @DEFAULT_BITCHX_QUIT_FILE@
DEFAULT_BITCHX_IRCNAME_FILE = @DEFAULT_BITCHX_IRCNAME_FILE@
# Full path of the directory for BitchX help files.
HELPDIR = @HELPDIR@
# Full path of the directory for the BitchX scripts.
INSTALL_SCRIPT = @INSTALL_SCRIPT@
# Default setting for IRCPATH where BitchX will look for
# its script files if the environment variable is undefined.
# Usually, this should contain the same path as used for INSTALL_SCRIPT in
# the Makefile, but it can contain multiple path elements
# separated by colons. The path MUST lead to an existing directory,
# because the 'global' script is expected to be found there.
IRCPATH = @IRCPATH@
# Path for TRANSLATION variable.
TRANSLATION_PATH = @TRANSLATION_PATH@
# This command will be used to install the BitchX help files. If you don't
# want to install them, replace with the following:
# INSTALL_HELP_CMD = @echo The help files have not been installed.
INSTALL_HELP_CMD = @INSTALL_HELP_CMD@
# This is where the optional plugins will be copied to.
PLUGINDIR = @PLUGINDIR@
# Plugin flags.
SHLIB_LD = @SHLIB_LD@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
# This command will be used to install the BitchX files on Win32/OS2EMX
# systems.
WINNT_INSTALL = @WINNT_INSTALL@
# This program allows you to use screen/xterm's to put new BitchX windows
# on new screen/xterm windows.
INSTALL_WSERV = @INSTALL_WSERV@
# This program allows you to screen BitchX and reattach to it later.
INSTALL_SCRBX = @INSTALL_SCRBX@
# Set gzip and bzip2 options.
GZIP_ENV = @GZIP_ENV@
BZIP2 = @BZIP2@
# Standard programs.
RM = @RM@
LN = @LN_S@
CP = @CP@
MV = @MV@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
VERSION = @VERSION@
_VERSION_ = @_VERSION_@
MAKE_BIN = @MAKE@
MAKE = $(MAKE_BIN) $(MFLAGS)
MFLAGS = \
'local_dir=$(HOME)' \
'INSTALL_IRC=$(INSTALL_IRC)' \
'IRCLIB=$(IRCLIB)' \
'CC=$(CC)' \
'CFLAGS=$(CFLAGS)' \
'HELPDIR=$(HELPDIR)' \
'INSTALL_WSERV=$(INSTALL_WSERV)' \
'IRCPATH=$(IRCPATH)' \
'TRANSLATION_PATH=$(TRANSLATION_PATH)' \
'LDFLAGS=$(LDFLAGS)' \
'LIBS=$(LIBS)' \
'LN=$(LN)' \
'RM=$(RM)' \
'TCL_SRCS=$(TCL_SRCS)' \
'TCL_OBJS=$(TCL_OBJS)' \
'CD_PLAY=$(CD_PLAY)' \
'CD_SRCS=$(CD_SRCS)' \
'CD_OBJS=$(CD_OBJS)' \
'TCL_LIBS=$(TCL_LIBS)' \
'PLUGINDIR=$(PLUGINDIR)' \
'_VERSION_=$(_VERSION_)' \
'VERSION=$(VERSION)' \
'INSTALL_DATA=$(INSTALL_DATA)' \
'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
'EXEEXT=$(EXEEXT)' \
'SHLIB_CFLAGS=$(SHLIB_CFLAGS)' \
'SHLIB_SUFFIX=$(SHLIB_SUFFIX)'
## Makefile starts here.
Makefile: $(srcdir)/Makefile.in
cd $(topdir) \
&& $(SHELL) ./config.status
PROGRAM = $(topdir)/bxconfigure
OBJS = ds_cell.o file_cpy.o
.c.o:
$(CC) $(DEFS) $(CFLAGS) -c $<
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
$(CC) -o $(PROGRAM) $(OBJS) $(LIBS)
clean:
$(RM) $(OBJS) $(PROGRAM) *~
distclean: clean
$(RM) core Makefile
--- NEW FILE: ds_cell.c ---
/*
* Program source is Copyright 1993 Colten Edwards.
* Central Data Services is granted the right to use this source
* in thier product known as Quote Menu. They are also granted the right
* to modify this source in the advent of problems and or new features
* which they may want to add to the program.
*/
#include <stdlib.h>
#include <ctype.h>
#include <ncurses.h>
#ifdef __EMX__
#include <sys/types.h>
#endif
#include "ds_cell.h"
#include "ds_keys.h"
#include "func_pr.h"
/*
* This routine sets the stage for all menu actions except those that are
* specific for a menu.
* Home, PgUp, PgDn, End, Cursor up, Cursor Dn are defined within this source
*/
/* Get the current menu item.
*
* Save the current position, save the start of the list.
* if key was not a enter key then
* Convert character to uppercase
* While double linked list is not NULL
* if entered key is equal to stored key value
* break loop
* else
* get next double linked list item
* set current item equal
*
* if double linked list item is equal to NULL
* restore current item to entry value.
* return to caller with FALSE { didn't find the a valid key}
* Set redraw = TRUE and
* return TRUE to indicate found valid key
*/
int get_current(CELL *c) {
dlistptr x = c->start;
dlistptr y = c->current;
if (c->key != ENTER) {
c->key = toupper(c->key);
while (x)
if (c->key == x->datainfo.other) {
break;
} else
x = x->nextlistptr;
c->current = x;
}
if (x == NULL) {
c->current = y;
return FALSE;
}
if(c->ListPaintProc != NULL)
(*c->ListPaintProc)(c);
return TRUE;
}
/*
* Purpose is set the list start and end values. Main use is for lists that
* stretch longer then the window settings.
*/
int set_list_end(CELL *c) {
register int x = 0;
if (c->current == NULL)
return x;
c->list_end = c->list_start;
while (x < (c->erow - c->srow)) {
if (c->list_end->nextlistptr)
c->list_end = c->list_end->nextlistptr;
else
break;
x++;
}
return x;
}
/*
Move the cursor up a line with wrapping
*/
int wrap_cursor_up (CELL * c)
{
if (!cursor_up (c))
ls_end (c);
return TRUE;
}
/*
Move the cursor down a line with wrapping
*/
int wrap_cursor_dn (CELL * c)
{
if (!cursor_dn (c))
ls_home (c);
return TRUE;
}
/*
Move the cursor up a line.
Returns: TRUE if successful.
FALSE if it fails. Fails because we are already at the
first item of the list.
*/
int cursor_up (CELL * c)
{
c->redraw = TRUE;
if (c->current == NULL)
c->redraw = FALSE;
else {
if (c->current == c->list_start) {
if (c->current->prevlistptr) {
c->current = c->list_start = c->current->prevlistptr;
set_list_end(c);
} else
c->redraw = FALSE;
} else {
if (c->current->prevlistptr)
c->current = c->current->prevlistptr;
else
c->redraw = FALSE;
}
}
c->desc_start = 0;
c->cur_pos = CURCOL;
return c->redraw;
}
/*
Move the cursor down a line.
Returns: TRUE if successful.
FALSE if it fails. Fails because we are already at the
first item of the list.
*/
int cursor_dn (CELL * c)
{
c->redraw = TRUE;
if (c->current == NULL)
c->redraw = FALSE;
else {
if (c->current == c->list_end) {
if (c->list_end->nextlistptr) {
c->list_end = c->current = c->list_end->nextlistptr;
if (c->list_start->nextlistptr)
c->list_start = c->list_start->nextlistptr;
} else
c->redraw = FALSE;
} else {
if (c->current->nextlistptr != NULL)
c->current = c->current->nextlistptr;
else
c->redraw = FALSE;
}
}
c->desc_start = 0;
c->cur_pos = CURCOL;
return c->redraw;
}
/*
* Purpose to pgup through the list values
*/
int ls_pgup (CELL * c)
{
register int pagesize = c->erow - c->srow;
if (c->current == NULL)
return TRUE;
while ((pagesize) && (c->current->prevlistptr != NULL)){
c->current = c->current->prevlistptr;
pagesize--;
}
c->list_start = c->current;
set_list_end(c);
c -> redraw = TRUE;
c->desc_start = 0;
c->cur_pos = CURCOL;
return TRUE;
}
/*
* Purpose to pgdn through the list values
*/
int ls_pgdn (CELL * c)
{
register int pagesize = c->erow - c->srow;
if (c->current == NULL)
return TRUE;
while ((pagesize) && (c->current->nextlistptr != NULL)){
c->current = c->current->nextlistptr;
pagesize--;
}
if (pagesize == 0)
c->list_start = c->current;
set_list_end(c);
c->redraw = TRUE;
c->desc_start = 0;
c->cur_pos = CURCOL;
return TRUE;
}
/*
* purpose to set the home the list.
*/
int ls_home (CELL * c)
{
c->current = c->list_start = c->start;
set_list_end(c);
c->redraw = TRUE;
return TRUE;
}
/*
* Purpose is to go to end of list.
*/
int ls_end (CELL * c)
{
int x = 0;
if (c->current == NULL)
return TRUE;
c->current = c->list_end = c->list_start = c->end;
while (x < (c->erow - c->srow)){
if (c->list_start->prevlistptr)
c->list_start = c->list_start->prevlistptr;
else
break;
x++;
}
c -> redraw = TRUE;
return TRUE;
}
/*
* This is the main routine used throughout.
* Purpose is to be a function despatcher.
* On entry
* set termkey = 0
* if we have a list entry procedure then
* exec that procedure. It usely draws the box and creates the list
* Make sure the list start and end are set so we do not overstep boundries
* While terminate key is equal to 0
* set function hit = false
* if list redraw is TRUE and we have a redraw procedure
* exec redraw procedure. Usually draws only items in the list.
* if we have a UpdateStatusProc
* exec Updatestatusproc. Usually displays counts, Menus, etc.
* if termkey is equal to 0
* if othergetkey is TRUE and othergetkeyproc is not equal to NULL
* exec othergetkeyproc. Used to provide edit functions
* else
* call get char function
* Set special to 0. Indicates which function to call, iff found in list.
* Check menu list until end of list (-1) for a matching key value.
* if key and menu item key match and function is not NULL
* set special equal to special number
* exec function and save returned value in hit.
* hit indicates whether or not we have exec'd a function for a key
* break to end of loop
* if hit is FALSE and current_event is not equal to NULL
* exec current event. This allows us to check for both upper and lower
* case keys.
* loop to top and check termkey.
*
* if termkey was set then
* we clear the list and exit function dispatch.
* return terminate key
*/
int ls_dispatch (CELL * c)
{
long x;
long hit;
c -> termkey = 0;
if ((*c -> ListEntryProc) != NULL)
x = (*c -> ListEntryProc) (c);
/*
if (c->start == NULL) {
return c->termkey;
}
*/
set_list_end(c);
while (c -> termkey == 0/* && c->start*/) {
hit = FALSE;
if (c->redraw && ((*c -> ListPaintProc) != NULL))
(*c -> ListPaintProc) (c);
if (*c -> UpdateStatusProc != NULL)
(*c -> UpdateStatusProc) (c);
if (c -> termkey == 0) {
if ((*c -> OtherGetKeyProc) != NULL && c->other_getkey)
c -> key = (*c->OtherGetKeyProc) (c);
else
c->key = getch();
#if 0
c->key = get_char (c, (int)c->menu_bar);
#endif
}
c->special = 0;
for (x = 0; c ->keytable[x].key != -1; x++)
if ((c -> keytable[x].key == c->key) && ((*c->func_table[c->keytable[x].func_num].func) != NULL)) {
c->special = c->keytable[x].func_num;
hit = (*c->func_table[c->keytable[x].func_num].func)(c);
break;
}
if (hit == FALSE && *c->current_event != NULL)
(*c -> current_event) (c);
}
if (*c -> ListExitProc != NULL)
(*c -> ListExitProc) (c);
return c -> termkey;
}
/*
* Terminate function. Set termkey to the keystroke entered.
*/
int ls_quit (CELL * c)
{
c->termkey = c->key;
return TRUE;
}
--- NEW FILE: save.c ---
int save_file (CELL *c)
{
FILE *out = NULL;
if ((out = fopen(current_path, "w")))
{
int i = 0;
mvwaddstr(c->window, c->erow + 3, c->scol , "Saving file now.......");
fprintf(out, "#define _USE_LOCAL_CONFIG\n");
fprintf(out, "\n\n\n/*\n * Compile Time options\n */\n");
for (i = 0; compile_default[i].option; i++)
{
if (*(compile_default[i].help))
fprintf(out, "/*\n * %s\n */\n", compile_default[i].help);
if (compile_default[i].integer)
fprintf(out, "#define %-50s1\n\n", compile_default[i].out);
else
fprintf(out, "/* #undef %s */\n\n", compile_default[i].out);
}
fprintf(out, "\n\n\n/*\n * Userlist options\n */\n");
for (i = 0; userlist_default[i].option; i++)
{
if (*(userlist_default[i].help))
fprintf(out, "/*\n * %s\n */\n", userlist_default[i].help);
switch(userlist_default[i].type)
{
case STR_TYPE:
break;
default:
fprintf(out, "#define %-50s %d\n\n", userlist_default[i].out, userlist_default[i].integer);
}
}
fprintf(out, "\n\n\n/*\n * Flood options\n */\n");
for (i = 0; flood_default[i].option; i++)
{
if (*(flood_default[i].help))
fprintf(out, "/*\n * %s\n */\n", flood_default[i].help);
switch(flood_default[i].type)
{
case STR_TYPE:
break;
default:
fprintf(out, "#define %-50s %d\n\n", flood_default[i].out, flood_default[i].integer);
}
}
fprintf(out, "\n\n\n/*\n * DCC options\n */\n");
for (i = 0; dcc_default[i].option; i++)
{
if (*(dcc_default[i].help))
fprintf(out, "/*\n * %s\n */\n", dcc_default[i].help);
switch(dcc_default[i].type)
{
case STR_TYPE:
break;
default:
fprintf(out, "#define %-50s %d\n\n", dcc_default[i].out, dcc_default[i].integer);
}
}
fprintf(out, "\n\n\n/*\n * Server options\n */\n");
for (i = 0; server_default[i].option; i++)
{
if (*(server_default[i].help))
fprintf(out, "/*\n * %s\n */\n", server_default[i].help);
switch(server_default[i].type)
{
case STR_TYPE:
break;
default:
fprintf(out, "#define %-50s %d\n\n", server_default[i].out, server_default[i].integer);
}
}
fprintf(out, "\n\n\n/*\n * Misc options\n */\n");
for (i = 0; various_default[i].option; i++)
{
if (*(various_default[i].help))
fprintf(out, "/*\n * %s\n */\n", various_default[i].help);
switch(various_default[i].type)
{
case STR_TYPE:
break;
default:
fprintf(out, "#define %-50s %d\n\n", various_default[i].out, various_default[i].integer);
}
}
fprintf(out, "\n\n\n");
fclose(out);
}
return TRUE;
}
--- NEW FILE: ds_keys.h ---
/*
* Program source is Copyright 1993 Colten Edwards.
* Central Data Services is granted the right to use this source
* in thier product known as Quote Menu. They are also granted the right
* to modify this source in the advent of problems and or new features
* which they may want to add to the program.
*/
/* --------------------- keys.h ----------------------- */
#define SELECTS 516
#define ANY_KEY 512
#define DOS_PATH 517
#define DOS_FILE 518
#define YN 519
#define CR_ESC 520
#define SCR_FRESH 900
#define DEL_LINE 905
#define INSERT_LINE 906
#define DESC_EDIT 907
#define NORM_MENU 908
#define CTRL_MENU 909
#define ALTR_MENU 910
#define SHFT_MENU 911
#define ZIPN_MENU 912
#define ZIPC_MENU 913
#define SPACE 32
#define HT 9
#define TAB 9
#define RUBOUT 8
#define BS 331
#define BELL 7
#define ESC 27
#define SHIFT_HT 143
#define CTRL_ENTER 10
#define GREY_PLUS 43
#define GREY_MINUS 45
#define ESC 27
#define ENTER 13
#define CTRL_ENTER 10
#define SHFT_ENTER 13
#define ALT_ENTER 284
#define UP 328
#define DN 336
#define CTRL_BS 127
#define LEFT 331
#define RIGHT 333
#define FWD 333
#define ALT_MINUS 386
#define ALT_PLUS 387
#define SHFT_HT 271
#define CTRL_FWD 372
#define CTRL_BACK 371
#define CTRL_PGUP 388
#define CTRL_PGDN 374
#define INSERT 338
#define INS 338
#define DELETE 339
#define DEL 339
#define HOME 327
#define END 335
#define PGUP 329
#define PGDN 337
#define C_HOME 375
#define C_END 373
#define C_PGUP 388
#define C_PGDN 374
#define GREY_MINUS 45
#define GREY_PLUS 43
#define ALT_1 376
#define ALT_2 377
#define ALT_3 378
#define ALT_4 379
#define ALT_5 380
#define ALT_6 381
#define ALT_7 382
#define ALT_8 383
#define ALT_9 384
#define ALT_0 385
#define ALT_Q 272
#define ALT_W 273
#define ALT_E 274
#define ALT_R 275
#define ALT_T 276
#define ALT_Y 277
#define ALT_U 278
#define ALT_I 279
#define ALT_O 280
#define ALT_P 281
#define ALT_A 286
#define ALT_S 287
#define ALT_D 288
#define ALT_F 289
#define ALT_G 290
#define ALT_H 291
#define ALT_J 292
#define ALT_K 293
#define ALT_L 294
#define ALT_Z 300
#define ALT_X 301
#define ALT_C 302
#define ALT_V 303
#define ALT_B 304
#define ALT_N 305
#define ALT_M 306
#define ALT_LESS 307
#define ALT_GREAT 308
#define CTRL_Q 17
#define CTRL_W 23
#define CTRL_E 18
#define CTRL_R 18
#define CTRL_T 20
#define CTRL_Y 25
#define CTRL_U 21
#define CTRL_I 9
#define CTRL_O 15
#define CTRL_P 16
#define CTRL_A 1
#define CTRL_S 19
#define CTRL_D 4
#define CTRL_F 6
#define CTRL_G 7
#define CTRL_H 8
#define CTRL_J 10
#define CTRL_K 11
#define CTRL_L 12
#define CTRL_Z 26
#define CTRL_X 24
#define CTRL_C 3
#define F1 315
#define F2 316
#define F3 317
#define F4 318
#define F5 319
#define F6 320
#define F7 321
#define F8 322
#define F9 323
#define F10 324
#define F11 389
#define F12 390
#define AF1 360
#define AF2 361
#define F3 317
#define AF3 362
#define AF4 363
#define AF5 364
#define AF6 365
#define AF7 366
#define AF8 367
#define AF9 368
#define AF10 369
#define AF11 395
#define AF12 396
#define CF1 350
#define CF2 351
#define CF3 352
#define CF4 353
#define CF5 354
#define CF6 355
#define CF7 356
#define CF8 357
#define CF9 358
#define CF10 359
#define CF11 393
#define CF12 394
#define SF1 340
#define SF2 341
#define SF3 342
#define SF4 343
#define SF5 344
#define SF6 345
#define SF7 346
#define SF8 347
#define SF9 348
#define SF10 349
#define SF11 391
#define SF12 392
--- NEW FILE: file_cpy.c ---
/*
* Program source is Copyright 1998 Colten Edwards.
* Written specifically for configuring BitchX config.h
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <signal.h>
#include <ctype.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#ifdef __EMX__
#include <sys/types.h>
#endif
[...1245 lines suppressed...]
leaveok(mainwin, TRUE);
wbkgd(mainwin, COLOR_PAIR(COLOR_MAIN));
wattron(mainwin, COLOR_PAIR(COLOR_MAIN));
werase(mainwin);
refresh();
file_cpy.window = mainwin;
main_dir(&file_cpy);
wbkgd(mainwin, A_NORMAL);
werase(mainwin);
echo();
nocbreak();
noraw();
refresh();
endwin();
return TRUE;
}
More information about the dslinux-commit
mailing list