Lines Matching full:sl
91 StringList *sl, ***svc; in main() local
136 svc = parseservices(fname, sl = sl_init()); in main()
156 add(db, s, port, getprotostr(sl, proto), &cnt, warndup); in main()
163 sl_free(sl, 1); in main()
189 add(DB *db, StringList *sl, size_t port, const char *proto, size_t *cnt, in add() argument
199 (void)printf("add %s %zu %s [ ", sl->sl_str[0], port, proto); in add()
200 for (i = 1; i < sl->sl_cur; i++) in add()
201 (void)printf("%s ", sl->sl_str[i]); in add()
208 sl->sl_str[0], port, proto, mkaliases(sl, abuf, sizeof(abuf))) + 1; in add()
221 for (i = 0; i < sl->sl_cur; i++) { in add()
224 sl->sl_str[i], proto) + 1; in add()
231 sl_free(sl, 1); in add()
235 parseservices(const char *fname, StringList *sl) in parseservices() argument
309 pindex = getprotoindex(sl, proto); in parseservices()
405 getprotoindex(StringList *sl, const char *str) in getprotoindex() argument
410 for (i= 0; i < sl->sl_cur; i++) in getprotoindex()
411 if (strcmp(sl->sl_str[i], str) == 0) in getprotoindex()
419 (void)sl_add(sl, p); in getprotoindex()
424 getprotostr(StringList *sl, size_t i) in getprotostr() argument
426 assert(i < sl->sl_cur); in getprotostr()
427 return sl->sl_str[i]; in getprotostr()
431 mkaliases(StringList *sl, char *buf, size_t len) in mkaliases() argument
436 for (i = 1, pos = 0; i < sl->sl_cur; i++) { in mkaliases()
437 nc = strlcpy(buf + pos, sl->sl_str[i], len); in mkaliases()
450 warn("aliases for `%s' truncated", sl->sl_str[0]); in mkaliases()