/* Pirate Bulletin Board System Copyright (C) 1990, Edward Luke, lush@Athena.EE.MsState.EDU Eagles Bulletin Board System Copyright (C) 1992, Raymond Rocker, rocker@rock.b11.ingr.com Guy Vega, gtvega@seabass.st.usm.edu Dominic Tynes, dbtynes@seabass.st.usm.edu Firebird Bulletin Board System Copyright (C) 1996, Hsien-Tsung Chang, Smallpig.bbs@bbs.cs.ccu.edu.tw Peng Piaw Foong, ppfoong@csie.ncu.edu.tw Firebird Bulletin Board System -- Version 3.0 series Copyright (C) 1999, Peng Piaw Foong, Harimau.bbs@MSIA.pine.ncu.edu.tw Edward Ping-Da Chuang, edwardc.bbs@bbs.seed.net.tw This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ /* $Id: bbs.h,v 1.9 2001/02/02 15:08:20 edwardc Exp $ */ #ifndef _BBS_H_ #define _BBS_H_ #ifndef BBSIRC /* Global includes, needed in most every source file... */ #include #include #include #include #include #include #include #include #include #include #ifndef BSD44 #include #endif #include #include #include #include #include #include "os_dep.h" /* pre-load OS dependecy define ... */ #include "config.h" /* User-configurable stuff */ #include "permissions.h" #ifdef HAVE_VERSION_H #include "version.h" #endif #include "functions.h" /* you can enable functions that you want */ #ifndef HAVE_VERSION_H #define VERSION_ID "FIREBIRD 3.0" #else #ifdef CVS #define VERSION_ID "FIREBIRD 3.0-CVS" #endif #ifdef RELDATE #define VERSION_ID "FB 3.0-"RELDATE #endif #endif /* if you don't like show version id on logging, just undef VERSION_ID */ /* #undef VERSION_ID */ #ifndef LOCK_EX #define LOCK_EX 2 /* exclusive lock */ #define LOCK_UN 8 /* unlock */ #endif #ifdef XINU extern int errno ; #endif #define randomize() srand((unsigned)time(NULL)) #define YEA (1) /* Booleans (Yep, for true and false) */ #define NA (0) #define DOECHO (1) /* Flags to getdata input function */ #define NOECHO (0) char *bfile() ; extern FILE *ufp ; /* External variable declarations */ extern long ti ; #endif /* BBSIRC */ #define MAXFRIENDS (200) #define MAXREJECTS (32) #define NUMPERMS (30) #define REG_EXPIRED 180 /* 暗ō絋粄戳 */ #define MAXGUEST 16 /* 程 guest 眀腹计 */ #define FILE_BUFSIZE 200 /* max. length of a file in SHM*/ #define FILE_MAXLINE 25 /* max. line of a file in SHM */ #define MAX_WELCOME 15 /* 舧礶计 */ #define MAX_GOODBYE 15 /* 瞒礶计 */ #define MAX_ISSUE 15 /* 程秈礶计 */ #define MAX_DIGEST 1000 /* 程ゅ篕计 */ #define MAX_POSTRETRY 100 #define MAX_EDITROW 750 /* 程絪胯︽计 */ #define MORE_BUFSIZE 4096 #ifdef BIGGER_MOVIE #define MAXMOVIE 8 /* called "MAXnettyLN" previous, "netty" is one of the CCU Firebird's father, but he's no such famous as SmallPig or others .. */ #else #define MAXMOVIE 6 /* lines of standard activity board */ #endif #define ACBOARD_BUFSIZE 150 /* max. length of each line for activity board */ #define ACBOARD_MAXLINE 80 /* max. lines of activity board */ #define STRLEN 80 /* Length of most string data */ #define NAMELEN 40 /* Length of username/realname */ #define IDLEN 12 /* Length of userids */ #ifdef MD5 /* MD5 cryptographic support */ #define ENCPASSLEN 35 #else #define ENCPASSLEN 14 /* Length of encrypted passwd field */ #endif #define PASSLEN 14 /* User's password length (13 chars) */ #ifdef CODE_VALID #define RNDPASSLEN 10 /* 穞絏粄靡穞絏 (続﹜絛瞅 4~10)*/ #endif #define MAXGOPHERITEMS 9999 /* max of gopher items */ #define PASSFILE ".PASSWDS" /* Name of file User records stored in */ #define ULIST_BASE ".UTMP" /* Names of users currently on line */ extern char ULIST[]; #ifndef BBSIRC #define FLUSH ".PASSFLUSH" /* Stores date for user cache flushing */ #define BOARDS ".BOARDS" /* File containing list of boards */ #define DOT_DIR ".DIR" /* Name of Directory file info */ #define THREAD_DIR ".THREAD" /* Name of Thread file info */ #define DIGEST_DIR ".DIGEST" /* Name of Digest file info */ #define QUIT 0x666 /* Return value to abort recursive functions */ #define FILE_READ 0x1 /* Ownership flags used in fileheader structure */ #define FILE_OWND 0x2 /* accessed array */ #define FILE_VISIT 0x4 #define FILE_MARKED 0x8 #define FILE_DIGEST 0x10 /* Digest Mode*/ #define VOTE_FLAG 0x1 #define NOZAP_FLAG 0x2 #define OUT_FLAG 0x4 #define ANONY_FLAG 0x8 #define ZAPPED 0x1 /* For boards...tells if board is Zapped */ /* these are flags in userec.flags[0] */ #define PAGER_FLAG 0x1 /* true if pager was OFF last session */ #define CLOAK_FLAG 0x2 /* true if cloak was ON last session */ #define SIG_FLAG 0x8 /* true if sig was turned OFF last session */ #define BRDSORT_FLAG 0x20 /* true if the boards sorted alphabetical */ #define CURSOR_FLAG 0x80 /* true if the cursor mode open */ #define ACTIVE_BOARD 0x200 /* true if user toggled active movie board on */ #define DEF_VALUE " ⊿裕ら " #define DEF_FILE "etc/whatdate" #define MULTI_LOGINS 3 /* change number if you want, or disable it to not allow multi login */ #define ALL_PAGER 0x1 #define FRIEND_PAGER 0x2 #define ALLMSG_PAGER 0x4 #define FRIENDMSG_PAGER 0x8 #define SHIFTMODE(usernum,mode) ((usernumb)?a:b) /*SREAD Define*/ #define SR_BMBASE (10) #define SR_BMDEL (11) #define SR_BMMARK (12) #define SR_BMDIGEST (13) #define SR_BMIMPORT (14) #define SR_BMTMP (15) /*SREAD Define*/ #ifndef EXTEND_KEY #define EXTEND_KEY #define KEY_TAB 9 #define KEY_ESC 27 #define KEY_UP 0x0101 #define KEY_DOWN 0x0102 #define KEY_RIGHT 0x0103 #define KEY_LEFT 0x0104 #define KEY_HOME 0x0201 #define KEY_INS 0x0202 #define KEY_DEL 0x0203 #define KEY_END 0x0204 #define KEY_PGUP 0x0205 #define KEY_PGDN 0x0206 #endif /* edwardc.990706 move shmkeys from sysconf.ini */ struct _shmkey { char key[16]; int value; }; const static struct _shmkey shmkeys[] = { { "BCACHE_SHMKEY", 30000 }, { "UCACHE_SHMKEY", 30010 }, { "UTMP_SHMKEY", 30020 }, { "ACBOARD_SHMKEY", 30030 }, { "ISSUE_SHMKEY", 30040 }, { "GOODBYE_SHMKEY", 30050 }, { "WELCOME_SHMKEY", 30060 }, { "STAT_SHMKEY", 30070 }, { 0, 0 } }; #define Ctrl(c) ( c & 037 ) #define isprint2(c) ( (c & 0x80) || isprint(c) ) #ifdef SYSV #ifndef bzero #define bzero(tgt, len) memset( tgt, 0, len ) #endif #ifndef bcopy #define bcopy(src, tgt, len) memcpy( tgt, src, len) #endif #ifndef usleep #define usleep(usec) { \ struct timeval t; \ t.tv_sec = usec / 1000000; \ t.tv_usec = usec % 1000000; \ select( 0, NULL, NULL, NULL, &t); \ } #endif #endif /* SYSV */ /* =============== ANSI EDIT ================== */ #define ANSI_RESET "\033[0m" #define ANSI_REVERSE "\033[7m\033[4m" extern int editansi; extern int KEY_ESC_arg; /* ============================================ */ #endif /* of _BBS_H_ */