summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-21 04:28:21 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-21 04:28:21 +0800
commit80d6431f5d2fa48f925712ccd98c1983404e7ee9 (patch)
tree6411ae9d890ba61413664da1f37f468259f4281c /include
parent82664ae2ecc5db24c614f7a625e859975f55a6b5 (diff)
downloadpttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar.gz
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar.bz2
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar.lz
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar.xz
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.tar.zst
pttbbs-80d6431f5d2fa48f925712ccd98c1983404e7ee9.zip
revert cuser from pointer to buffer.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1798 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/perm.h4
-rw-r--r--include/proto.h25
-rw-r--r--include/pttstruct.h2
3 files changed, 14 insertions, 17 deletions
diff --git a/include/perm.h b/include/perm.h
index 93232bdb..2d676bae 100644
--- a/include/perm.h
+++ b/include/perm.h
@@ -49,8 +49,8 @@
#define PERM_FORWARD (PERM_BASIC) /* to do the forwarding */
#define PERM_INTERNET (PERM_LOGINOK) /* 身份認證過關的才能寄信到 Internet */
-#define HAS_PERM(x) ((x) ? cuser->userlevel & (x) : 1)
-#define HAVE_PERM(x) (cuser->userlevel&(x))
+#define HAS_PERM(x) ((x) ? cuser.userlevel & (x) : 1)
+#define HAVE_PERM(x) (cuser.userlevel&(x))
#define PERM_HIDE(u) ((u)->userlevel & PERM_SYSOP && \
(u)->userlevel & PERM_DENYPOST)
diff --git a/include/proto.h b/include/proto.h
index b4bdab92..b3fed5a6 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -45,9 +45,6 @@ int inc_goodsale(int uid, int num);
int inc_badsale(int uid, int num);
void set_assess(int uid, unsigned char num, int type);
-/* bbcall */
-int main_bbcall(void);
-
/* bbs */
void make_blist(void);
int invalid_brdname(char *brd);
@@ -99,7 +96,13 @@ void brc_trunc(int bid, time_t ftime);
void brc_addlist(const char* fname);
/* cache */
-int moneyof(int uid);
+#define demoney(money) deumoney(usernum, money)
+#define search_ulist(uid) search_ulistn(uid, 1)
+#define getbcache(bid) (bcache + bid - 1)
+#define moneyof(uid) SHM->money[uid - 1]
+#define getbtotal(bid) SHM->total[bid - 1]
+#define getbottomtotal(bid) SHM->n_bottom[bid-1]
+
int getuser(char *userid);
void setuserid(int num, char *userid);
int searchuser(char *userid);
@@ -110,7 +113,6 @@ void addbrd_touchcache(void);
void setapath(char *buf, char *boardname);
void setutmpmode(unsigned int mode);
void setadir(char *buf, char *path);
-boardheader_t *getbcache(int bid);
int apply_boards(int (*func)(boardheader_t *));
int haspostperm(char *bname);
void inbtotal(int bid, int add);
@@ -120,7 +122,6 @@ unsigned int safe_sleep(unsigned int seconds);
int apply_ulist(int (*fptr)(userinfo_t *));
userinfo_t *search_ulistn(int uid, int unum);
void purge_utmp(userinfo_t *uentp);
-userinfo_t *search_ulist(int uid);
int count_multi(void);
void resolve_utmp(void);
void attach_uhash(void);
@@ -138,11 +139,8 @@ int count_logins(int uid, int show);
void remove_from_uhash(int n);
void add_to_uhash(int n, char *id);
int setumoney(int uid, int money);
-int getbtotal(int bid);
-int getbottomtotal(int bid);
userinfo_t *search_ulist_pid(int pid);
userinfo_t *search_ulist_userid(char *userid);
-int moneyof(int uid);
void hbflreload(int bid);
int hbflcheck(int bid, int uid);
int updatemdcache(const char *cpath, const char *fpath);
@@ -164,8 +162,7 @@ int give_tax(int money);
int vice(int money, char* item);
int inumoney(char *tuser, int money);
int cal(void);
-#define reload_money() cuser->money=moneyof(usernum)
-int demoney(int money);
+#define reload_money() cuser.money=moneyof(usernum)
int deumoney(int uid, int money);
int lockutmpmode(int unmode, int state);
int unlockutmpmode(void);
@@ -480,6 +477,9 @@ void initscr(void);
void out_lines(char *str, int line);
/* stuff */
+#define isprint2(ch) ((ch & 0x80) || isprint(ch))
+#define not_alpha(ch) (ch < 'A' || (ch > 'Z' && ch < 'a') || ch > 'z')
+#define not_alnum(ch) (ch < '0' || (ch > '9' && ch < 'A') || (ch > 'Z' && ch < 'a') || ch > 'z')
time_t gettime(int line, time_t dt, char* head);
void setcalfile(char *buf, char *userid);
void stand_title(char *title);
@@ -508,20 +508,17 @@ void setbfile(char *buf, char *boardname, char *fname);
void setbnfile(char *buf, char *boardname, char *fname, int n);
int dashl(char *fname);
char *subject(char *title);
-int not_alnum(char ch);
void setdirpath(char *buf, char *direct, char *fname);
int str_checksum(char *str);
void show_help(char *helptext[]);
int belong(char *filelist, char *key);
char *Cdatedate(time_t *clock);
-int isprint2(char ch);
void sethomeman(char *buf, char *userid);
off_t dashs(char *fname);
void cursor_clear(int row, int column);
void cursor_show(int row, int column);
void printdash(char *mesg);
char *Cdatelite(time_t *clock);
-int not_alpha(char ch);
int valid_ident(char *ident);
int userid_is_BM(char *userid, char *list);
int is_uBM(char *list, char *id);
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 48c35d49..80cef86c 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -114,7 +114,7 @@ typedef struct userec_t {
#define WATER_ORIG 0x0
#define WATER_NEW 0x1
#define WATER_OFO 0x2
-#define WATERMODE(mode) ((cuser->uflag2 & WATER_MASK) == mode)
+#define WATERMODE(mode) ((cuser.uflag2 & WATER_MASK) == mode)
#define FAVNOHILIGHT 0x10 /* false if hilight favorite */
#define FAVNEW_FLAG 0x20 /* true if add new board into one's fav */
#define FOREIGN 0x100 /* true if a foreign */