#include "nsswitch.h"
/* Prototypes for the local functions. */
-static void *nss_lookup_function (service_user *ni, const char *fct_name);
-static name_database *nss_parse_file (const char *fname);
-static name_database_entry *nss_getline (char *line);
-static service_user *nss_parse_service_list (const char *line);
+static void *nss_lookup_function (service_user *ni, const char *fct_name)
+ internal_function;
+static name_database *nss_parse_file (const char *fname) internal_function;
+static name_database_entry *nss_getline (char *line) internal_function;
+static service_user *nss_parse_service_list (const char *line)
+ internal_function;
static service_library *nss_new_service (name_database *database,
- const char *name);
+ const char *name) internal_function;
/* Declare external database variables. */
static void *
+internal_function
nss_lookup_function (service_user *ni, const char *fct_name)
{
void **found, *result;
extern void _nss_##h##_get##nm##_r (void);
# define DEFINE_GETBY(h,nm,ky) \
extern void _nss_##h##_get##nm##by##ky##_r (void);
-# include "functions.def"
+# include "function.def"
# undef DEFINE_ENT
# undef DEFINE_GET
# undef DEFINE_GETBY
# define DEFINE_ENT(h,nm) \
- { #h"_get"#nm"ent_r", _nss_##h##_get##nm##ent_r }, \
- { #h"_end"#nm"ent", _nss_##h##_end##nm##ent }, \
+ { #h"_get"#nm"ent_r", _nss_##h##_get##nm##ent_r }, \
+ { #h"_end"#nm"ent", _nss_##h##_end##nm##ent }, \
{ #h"_set"#nm"ent", _nss_##h##_set##nm##ent },
# define DEFINE_GET(h,nm) \
{ #h"_get"#nm"_r", _nss_##h##_get##nm##_r },
{ #h"_get"#nm"by"#ky"_r", _nss_##h##_get##nm##by##ky##_r },
static struct fct_tbl { const char *fname; void *fp; } *tp, tbl[] =
{
-# include "functions.def"
+# include "function.def"
{ NULL, NULL }
};
size_t namlen = (5 + strlen (ni->library->name) + 1
static name_database *
+internal_function
nss_parse_file (const char *fname)
{
FILE *fp;
`( <source> ( "[" "!"? (<status> "=" <action> )+ "]" )? )*'
*/
static service_user *
+internal_function
nss_parse_service_list (const char *line)
{
service_user *result = NULL, **nextp = &result;
free (new_service);
return result;
}
- memcpy (source, name, line - name);
- source[line - name] = '\0';
+ *((char *) __mempcpy (source, name, line - name)) = '\0';
new_service->name = source;
}
}
static name_database_entry *
+internal_function
nss_getline (char *line)
{
const char *name;
static service_library *
+internal_function
nss_new_service (name_database *database, const char *name)
{
service_library **currentp = &database->library;