1 /* Copyright (C) 2002 Ben Goodwin
2 This file is part of the nss-mysql library.
4 The nss-mysql library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as published
6 by the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 The nss-mysql library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with the nss-mysql library; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #include "nss_mysql.h"
22 #define SETENT(type) \
24 _nss_mysql_set##type (void) \
26 DN ("_nss_mysql_set" #type) \
29 _nss_mysql_reset_ent (&mresult_##type); \
31 DSRETURN (NSS_SUCCESS) \
34 #define ENDENT(type) \
36 _nss_mysql_end##type (void) \
38 DN ("_nss_mysql_end" #type) \
41 _nss_mysql_reset_ent (&mresult_##type); \
43 DSRETURN (NSS_SUCCESS) \
46 #elif defined (HAVE_NSS_COMMON_H)
48 #define SETENT(type) \
50 _nss_mysql_set##type (nss_backend_t *be, void *args) \
52 DN ("_nss_mysql_set" #type) \
55 _nss_mysql_reset_ent (&mresult_##type); \
57 DSRETURN (NSS_SUCCESS) \
60 #define ENDENT(type) \
62 _nss_mysql_end##type (nss_backend_t *be, void *args) \
64 DN ("_nss_mysql_end" #type) \
67 _nss_mysql_reset_ent (&mresult_##type); \
69 DSRETURN (NSS_SUCCESS) \
72 #define CONSTR(type) \
74 _nss_mysql_##type##_constr (const char *db_name, const char *src_name, \
75 const char *cfg_args) \
77 DN ("_nss_mysql_" #type "_constr") \
80 be = (nss_backend_t *) malloc (sizeof (*be)); \
83 be->ops = type##_ops; \
84 be->n_ops = sizeof (type##_ops) / sizeof (nss_backend_op_t); \