stringlist.c (249801) | stringlist.c (249802) |
---|---|
1/* 2 * Copyright (c) 1994 Christos Zoulas 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#if defined(LIBC_SCCS) && !defined(lint) 30static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $"; 31#endif /* LIBC_SCCS and not lint */ 32#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1994 Christos Zoulas 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#if defined(LIBC_SCCS) && !defined(lint) 30static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $"; 31#endif /* LIBC_SCCS and not lint */ 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/lib/libc/gen/stringlist.c 249801 2013-04-23 13:03:01Z eadler $"); | 33__FBSDID("$FreeBSD: head/lib/libc/gen/stringlist.c 249802 2013-04-23 13:03:03Z eadler $"); |
34 35#include "namespace.h" 36#include <stdio.h> 37#include <string.h> 38#include <err.h> 39#include <stdlib.h> 40#include <stringlist.h> 41#include "un-namespace.h" --- 57 unchanged lines hidden (view full) --- 99 free(sl); 100} 101 102 103/* 104 * sl_find(): Find a name in the string list 105 */ 106char * | 34 35#include "namespace.h" 36#include <stdio.h> 37#include <string.h> 38#include <err.h> 39#include <stdlib.h> 40#include <stringlist.h> 41#include "un-namespace.h" --- 57 unchanged lines hidden (view full) --- 99 free(sl); 100} 101 102 103/* 104 * sl_find(): Find a name in the string list 105 */ 106char * |
107sl_find(StringList *sl, char *name) | 107sl_find(StringList *sl, const char *name) |
108{ 109 size_t i; 110 111 for (i = 0; i < sl->sl_cur; i++) 112 if (strcmp(sl->sl_str[i], name) == 0) 113 return sl->sl_str[i]; 114 115 return NULL; 116} | 108{ 109 size_t i; 110 111 for (i = 0; i < sl->sl_cur; i++) 112 if (strcmp(sl->sl_str[i], name) == 0) 113 return sl->sl_str[i]; 114 115 return NULL; 116} |