summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-05 09:03:12 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-05 09:03:12 +0800
commit3eced116f16e16fdf08c65c189ac7b2c1cd83232 (patch)
treef1d89dd97ce9a78c9b7034cd1d0d88f66183ef84 /include
parent2e0a596fcdfbb85c327cc2ede3648f10ef113d2b (diff)
downloadpttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar.gz
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar.bz2
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar.lz
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar.xz
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.tar.zst
pttbbs-3eced116f16e16fdf08c65c189ac7b2c1cd83232.zip
use bsearch in login_friend_online()
save cpu but increase SHM_t (sizeof(short) * MAX_ACTIVE) bytes WARNING: SHM_t has been changed git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1212 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/proto.h2
-rw-r--r--include/pttstruct.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/proto.h b/include/proto.h
index a072c5d9..41fa2a7f 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -445,6 +445,8 @@ 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);
+inline int *intbsearch(int key, int *base0, int nmemb);
+int qsort_intcompar(const void *a, const void *b);
#ifndef CRITICAL_MEMORY
#define MALLOC(p) malloc(p)
#define FREE(p) free(p)
diff --git a/include/pttstruct.h b/include/pttstruct.h
index f14317e7..5ec26a57 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -238,6 +238,8 @@ typedef struct userinfo_t {
int from_alias;
char birth; /* 是否是生日 Ptt*/
char tty[11]; /* tty port */
+ short nFriends; /* 下面 friend[] 只用到前幾個,
+ 用來 bsearch */
int friend[MAX_FRIEND];
int friend_online[MAX_FRIEND];/* point到線上好友 utmpshm的位置 */
/* 好友比較的cache 前兩個bit是狀態 */