summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-16 13:05:46 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-16 13:05:46 +0800
commita805d1b009a55b7be52a605b1b09b14f8a7c6b8c (patch)
treeff8befd937cf77e0df33ec569469c0cc9058ddd4
parentc4456f1c3aa1f21235559aef7b38820a75cde7a9 (diff)
downloadpttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar.gz
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar.bz2
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar.lz
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar.xz
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.tar.zst
pttbbs-a805d1b009a55b7be52a605b1b09b14f8a7c6b8c.zip
Use Vector and namecomplete2
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4362 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/friend.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index aa0a28bf..b30bbd01 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -442,6 +442,7 @@ friend_edit(int type)
int count, column, dirty;
FILE *fp;
char genbuf[PATHLEN];
+ struct Vector namelist;
if (type == FRIEND_SPECIAL)
friend_special();
@@ -461,7 +462,7 @@ friend_edit(int type)
move(0, 40);
prints("(¦W³æ¤W­­: %d ¤H)", friend_max[type]);
count = 0;
- CreateNameList();
+ Vector_init(&namelist, IDLEN + 1);
if ((fp = fopen(fpath, "r"))) {
move(3, 0);
@@ -472,7 +473,7 @@ friend_edit(int type)
continue;
space = strpbrk(genbuf, str_space);
if (space) *space = '\0';
- AddNameList(genbuf);
+ Vector_add(&namelist, genbuf);
prints("%-13s", genbuf);
count++;
if (++column > 5) {
@@ -491,7 +492,7 @@ friend_edit(int type)
if (uident[0] == 'a') {
move(1, 0);
usercomplete(msg_uid, uident);
- if (uident[0] && searchuser(uident, uident) && !InNameList(uident)) {
+ if (uident[0] && searchuser(uident, uident) && !Vector_search(&namelist, uident)) {
friend_add(uident, type, NULL);
dirty = 1;
}
@@ -507,14 +508,14 @@ friend_edit(int type)
dirty = 1;
} else if (uident[0] == 'e' && count) {
move(1, 0);
- namecomplete(msg_uid, uident);
- if (uident[0] && InNameList(uident)) {
+ namecomplete2(&namelist, msg_uid, uident);
+ if (uident[0] && Vector_search(&namelist, uident)) {
friend_editdesc(uident, type);
}
} else if (uident[0] == 'd' && count) {
move(1, 0);
- namecomplete(msg_uid, uident);
- if (uident[0] && InNameList(uident)) {
+ namecomplete2(&namelist, msg_uid, uident);
+ if (uident[0] && Vector_search(&namelist, uident)) {
friend_delete(uident, type);
dirty = 1;
}