From a9d1a59dae2fe2a7997f7d5bf9eea7fe57dba66a Mon Sep 17 00:00:00 2001 From: wens Date: Mon, 16 Jun 2008 04:35:00 +0000 Subject: ShowNameList() like function for Vector git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4360 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/name.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mbbsd/name.c') diff --git a/mbbsd/name.c b/mbbsd/name.c index c0a7a00f..064985c9 100644 --- a/mbbsd/name.c +++ b/mbbsd/name.c @@ -161,6 +161,30 @@ InNameList(const char *name) return InList(toplev, name); } +void +ShowVector(struct Vector *self, int row, int column, const char *prompt) +{ + int i; + + move(row, column); + clrtobot(); + outs(prompt); + + column = 80; + for (i = 0; i < Vector_length(self); i++) { + const char *p = Vector_get(self, i); + row = strlen(p) + 1; + if (column + row > 76) { + column = row; + outc('\n'); + } else { + column += row; + outc(' '); + } + outs(p); + } +} + void ShowNameList(int row, int column, const char *prompt) { -- cgit v1.2.3