summaryrefslogtreecommitdiffstats
path: root/mbbsd/name.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-12 00:42:45 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-12 00:42:45 +0800
commit57a5be6e350c332dbb60f48f3d040171e6918277 (patch)
tree92bd33c603c1c5aa49db128564331972bbd621c9 /mbbsd/name.c
parent8d3b776476b6446d59e4a36275e924d14371906e (diff)
downloadpttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar.gz
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar.bz2
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar.lz
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar.xz
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.tar.zst
pttbbs-57a5be6e350c332dbb60f48f3d040171e6918277.zip
generalnamecomplete,
userlist complete git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@161 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/name.c')
-rw-r--r--mbbsd/name.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/mbbsd/name.c b/mbbsd/name.c
index aafac786..a16e89e6 100644
--- a/mbbsd/name.c
+++ b/mbbsd/name.c
@@ -1,4 +1,4 @@
-/* $Id: name.c,v 1.3 2002/05/10 19:34:51 in2 Exp $ */
+/* $Id: name.c,v 1.4 2002/05/11 16:42:45 in2 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -9,8 +9,11 @@
#include "pttstruct.h"
#include "common.h"
#include "proto.h"
+#include "perm.h"
extern struct bcache_t *brdshm;
+extern struct utmpfile_t *utmpshm;
+extern userec_t cuser;
extern char *str_space;
extern int p_lines; /* a Page of Screen line numbers: tlines-4 */
extern int b_lines; /* Screen bottom line number: t_lines-1 */
@@ -645,6 +648,7 @@ void generalnamecomplete(char *prompt, char *data, int len, size_t nmemb,
}
}
+/* general complete functions (brdshm) */
int completeboard_compar(int where, char *str, int len)
{
return strncasecmp(brdshm->sorted[0][where]->brdname, str, len);
@@ -660,3 +664,21 @@ char *completeboard_getname(int where)
return brdshm->sorted[0][where]->brdname;
}
+/* general complete functions (utmpshm) */
+int completeutmp_compar(int where, char *str, int len)
+{
+ return strncasecmp(utmpshm->sorted[utmpshm->currsorted][0][where]->userid,
+ str, len);
+}
+
+int completeutmp_permission(int where)
+{
+ return (HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK) ||
+ !utmpshm->sorted[utmpshm->currsorted][0][where]->invisible);
+}
+
+char *completeutmp_getname(int where)
+{
+ return utmpshm->sorted[utmpshm->currsorted][0][where]->userid;
+}
+