Print this page
    
remove support for non-ANSI compilation
    
      
        | Split | Close | 
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/head/nsswitch.h
          +++ new/usr/src/head/nsswitch.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  
    | ↓ open down ↓ | 11 lines elided | ↑ open up ↑ | 
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       23 + *
  22   24   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   25   * Use is subject to license terms.
  24   26   */
  25   27  
  26   28  /*
  27   29   * nsswitch.h
  28   30   *
  29   31   * Low-level interface to the name-service switch.  The interface defined
  30   32   * in <nss_common.h> should be used in preference to this.
  31   33   *
  32   34   * This is a Project Private interface.  It may change in future releases.
  33   35   */
  34   36  
  35   37  #ifndef _NSSWITCH_H
  36   38  #define _NSSWITCH_H
  37   39  
  38      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  39      -
  40   40  #ifdef  __cplusplus
  41   41  extern "C" {
  42   42  #endif
  43   43  
  44   44  #ifndef __NSW_CONFIG_FILE
  45   45  #define __NSW_CONFIG_FILE       "/etc/nsswitch.conf"
  46   46  #endif
  47   47  #define __NSW_DEFAULT_FILE      "/etc/default/nss"
  48   48  
  49   49  #define __NSW_HOSTS_DB          "hosts"
  50   50  #define __NSW_PASSWD_DB         "passwd"
  51   51  #define __NSW_GROUP_DB          "group"
  52   52  #define __NSW_NETGROUP_DB       "netgroup"
  53   53  #define __NSW_NETWORKS_DB       "networks"
  54   54  #define __NSW_PROTOCOLS_DB      "protocols"
  55   55  #define __NSW_RPC_DB            "rpc"
  56   56  #define __NSW_SERVICES_DB       "services"
  57   57  #define __NSW_ETHERS_DB         "ethers"
  58   58  #define __NSW_BOOTPARAMS_DB     "bootparams"
  59   59  #define __NSW_NETMASKS_DB       "netmasks"
  60   60  #define __NSW_BROADCASTADDRS_DB "broadcastaddrs"
  61   61  #define __NSW_MAIL_ALIASES_DB   "aliases"
  62   62  #define __NSW_AUDITUSER_DB      "audit_user"
  63   63  #define __NSW_AUTHATTR_DB       "auth_attr"
  64   64  #define __NSW_EXECATTR_DB       "exec_attr"
  65   65  #define __NSW_PROFATTR_DB       "prof_attr"
  66   66  #define __NSW_USERATTR_DB       "user_attr"
  67   67  #define __NSW_PROJECT_DB        "project"
  68   68  
  69   69  #define __NSW_STD_ERRS  4       /* number of reserved errors that follow */
  70   70  
  71   71  #define __NSW_SUCCESS   0       /* found the required data */
  72   72  #define __NSW_NOTFOUND  1       /* the naming service returned lookup failure */
  73   73  #define __NSW_UNAVAIL   2       /* could not call the naming service */
  74   74  #define __NSW_TRYAGAIN  3       /* bind error to suggest a retry */
  75   75  
  76   76  typedef unsigned char action_t;
  77   77  #define __NSW_CONTINUE  0       /* the action is to continue to next service */
  78   78  #define __NSW_RETURN    1       /* the action is to return to the user */
  79   79  
  80   80  #define __NSW_STR_RETURN        "return"
  81   81  #define __NSW_STR_CONTINUE      "continue"
  82   82  #define __NSW_STR_SUCCESS       "success"
  83   83  #define __NSW_STR_NOTFOUND      "notfound"
  84   84  #define __NSW_STR_UNAVAIL       "unavail"
  85   85  #define __NSW_STR_TRYAGAIN      "tryagain"
  86   86  
  87   87  /* prefix for all switch shared objects */
  88   88  #define __NSW_LIB       "nsw"
  89   89  
  90   90  enum __nsw_parse_err {
  91   91          __NSW_CONF_PARSE_SUCCESS = 0,   /* parser found the required policy */
  92   92          __NSW_CONF_PARSE_NOFILE = 1,    /* the policy files does not exist */
  93   93          __NSW_CONF_PARSE_NOPOLICY = 2,  /* the required policy is not set */
  94   94                                          /* in the file */
  95   95          __NSW_CONF_PARSE_SYSERR = 3     /* system error in the parser */
  96   96  };
  97   97  
  98   98  
  99   99  struct __nsw_long_err {
 100  100          int nsw_errno;
 101  101          action_t action;
 102  102          struct __nsw_long_err *next;
 103  103  };
 104  104  
 105  105  struct __nsw_lookup {
 106  106          char *service_name;
 107  107          action_t actions[__NSW_STD_ERRS];
 108  108          struct __nsw_long_err *long_errs;
 109  109          struct __nsw_lookup *next;
 110  110  };
 111  111  
 112  112  struct __nsw_switchconfig {
 113  113          int vers;
 114  114          char *dbase;
 115  115          int num_lookups;
 116  116          struct __nsw_lookup *lookups;
 117  117  };
  
    | ↓ open down ↓ | 68 lines elided | ↑ open up ↑ | 
 118  118  
 119  119  #define __NSW_ACTION(lkp, err)  \
 120  120          ((lkp)->next == NULL ? \
 121  121                  __NSW_RETURN \
 122  122          : \
 123  123                  ((err) >= 0 && (err) < __NSW_STD_ERRS ? \
 124  124                          (lkp)->actions[err] \
 125  125                  : \
 126  126                          __nsw_extended_action(lkp, err)))
 127  127  
 128      -#ifdef __STDC__
 129      -
 130  128  struct __nsw_switchconfig *__nsw_getconfig
 131  129          (const char *, enum __nsw_parse_err *);
 132  130  int __nsw_freeconfig(struct __nsw_switchconfig *);
 133  131  action_t __nsw_extended_action(struct __nsw_lookup *, int);
 134  132  
 135      -#else
 136      -
 137      -struct __nsw_switchconfig *__nsw_getconfig();
 138      -int __nsw_freeconfig();
 139      -action_t __nsw_extended_action();
 140      -
 141      -#endif /* __STDC__ */
 142      -
 143  133  #ifdef  __cplusplus
 144  134  }
 145  135  #endif
 146  136  
 147  137  #endif /* _NSSWITCH_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX