1 /* Copyright (c) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #include <rpcsvc/nis.h>
21 #include <rpcsvc/nislib.h>
22 #include "nis_intern.h"
25 nis_mkdir (const_nis_name dir
, const nis_server
*server
)
32 if ((result
= __do_niscall (NULL
, 0, NIS_MKDIR
, (xdrproc_t
) xdr_nis_name
,
33 (caddr_t
) &dir
, (xdrproc_t
) xdr_nis_error
,
34 (caddr_t
) &res
, 0)) != RPC_SUCCESS
)
36 fprintf (stderr
, _("__do_niscall: Error #%d\n"), result
);
43 if ((result
= __do_niscall (server
, 1, NIS_MKDIR
,
44 (xdrproc_t
) xdr_nis_name
,
45 (caddr_t
) &dir
, (xdrproc_t
) xdr_nis_error
,
46 (caddr_t
) &res
, 0)) != RPC_SUCCESS
)
48 fprintf (stderr
, _("__do_niscall: Error #%d\n"), result
);
57 nis_rmdir (const_nis_name dir
, const nis_server
*server
)
64 if ((result
= __do_niscall (NULL
, 0, NIS_RMDIR
, (xdrproc_t
) xdr_nis_name
,
65 (caddr_t
) &dir
, (xdrproc_t
) xdr_nis_error
,
66 (caddr_t
) &res
, 0)) != RPC_SUCCESS
)
68 fprintf (stderr
, _("__do_niscall: Error #%d\n"), result
);
75 if ((result
= __do_niscall (server
, 1, NIS_RMDIR
,
76 (xdrproc_t
) xdr_nis_name
,
77 (caddr_t
) &dir
, (xdrproc_t
) xdr_nis_error
,
78 (caddr_t
) &res
, 0)) != RPC_SUCCESS
)
80 fprintf (stderr
, _("__do_niscall: Error #%d\n"), result
);
89 nis_servstate (const nis_server
*serv
, const nis_tag
*tags
,
90 const int numtags
, nis_tag
**result
)
95 stub_warning (nis_servstate
)
98 nis_stats (const nis_server
*serv
, const nis_tag
*tags
,
99 const int numtags
, nis_tag
**result
)
101 result
= malloc (sizeof (nis_tag
*));
106 stub_warning (nis_stats
);
109 nis_freetags (nis_tag
*tags
, const int numtags
)
113 for (i
= 0; i
< numtags
; ++i
)
114 free (tags
->tag_val
);
119 nis_getservlist (const_nis_name dir
)
123 serv
= malloc (sizeof (nis_server
*));
129 stub_warning (nis_getservlist
);
132 nis_freeservlist (nis_server
**serv
)
140 while (serv
[i
] != NULL
)
141 nis_free_servers (serv
[i
], 1);