home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Portable Patmos / usr / include / rpcsvc / ypclnt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  3.7 KB  |  87 lines  |  [TEXT/R*ch]

  1. /*
  2.  * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
  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
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. The name of the author may not be used to endorse or promote
  14.  *    products derived from this software without specific prior written
  15.  *    permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
  18.  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  21.  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  *
  29.  *    $Id: ypclnt.h,v 1.3 1993/08/02 17:49:21 mycroft Exp $
  30.  */
  31.  
  32. #ifndef _YPCLNT_H_
  33. #define _YPCLNT_H_
  34.  
  35. #define YPERR_BADARGS    1        /* args to function are bad */
  36. #define YPERR_RPC    2        /* RPC failure */
  37. #define YPERR_DOMAIN    3        /* can't bind to a server for domain */
  38. #define YPERR_MAP    4        /* no such map in server's domain */
  39. #define YPERR_KEY    5        /* no such key in map */
  40. #define YPERR_YPERR    6        /* some internal YP server or client error */
  41. #define YPERR_RESRC    7        /* local resource allocation failure */
  42. #define YPERR_NOMORE    8        /* no more records in map database */
  43. #define YPERR_PMAP    9        /* can't communicate with portmapper */
  44. #define YPERR_YPBIND    10        /* can't communicate with ypbind */
  45. #define YPERR_YPSERV    11        /* can't communicate with ypserv */
  46. #define YPERR_NODOM    12        /* local domain name not set */
  47. #define YPERR_BADDB    13        /* YP data base is bad */
  48. #define YPERR_VERS    14        /* YP version mismatch */
  49. #define YPERR_ACCESS    15        /* access violation */
  50. #define YPERR_BUSY    16        /* database is busy */
  51.  
  52. /*
  53.  * Types of update operations
  54.  */
  55. #define YPOP_CHANGE    1        /* change, do not add */
  56. #define YPOP_INSERT    2        /* add, do not change */
  57. #define YPOP_DELETE    3        /* delete this entry */
  58. #define YPOP_STORE     4        /* add, or change */
  59.  
  60. struct ypall_callback {
  61.     int (*foreach)();    /* return non-0 to stop getting called */
  62.     char *data;        /* opaque pointer for use of callback fn */
  63. };
  64.  
  65. int    yp_bind        __P((char *dom));
  66. int    _yp_dobind    __P((char *dom, struct dom_binding **ypdb));
  67. void    yp_unbind    __P((char *dom));
  68. int    yp_get_default_domain __P((char **domp));
  69. int    yp_match     __P((char *indomain, char *inmap,
  70.                 const char *inkey, int inkeylen, char **outval,
  71.                 int *outvallen));
  72. int    yp_first     __P((char *indomain, char *inmap,
  73.                 char **outkey, int *outkeylen, char **outval,
  74.                 int *outvallen));
  75. int    yp_next        __P((char *indomain, char *inmap,
  76.                 char *inkey, int inkeylen, char **outkey,
  77.                 int *outkeylen, char **outval, int *outvallen));
  78. int    yp_master    __P((char *indomain, char *inmap, char **outname));
  79. int    yp_order    __P((char *indomain, char *inmap, int *outorder));
  80. int    yp_all        __P((char *indomain, char *inmap,
  81.                 struct ypall_callback *incallback));
  82. char *    yperr_string    __P((int incode));
  83. int    ypprot_err    __P((unsigned int incode));
  84.  
  85. #endif /* _YPCLNT_H_ */
  86.  
  87.