Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/nss_common.h
          +++ new/usr/src/head/nss_common.h
↓ 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   *
  28   30   * NOTE:  The interfaces documented in this file may change in a minor
  29   31   *        release.  It is intended that in the future a stronger committment
  30   32   *        will be made to these interface definitions which will guarantee
  31   33   *        them across minor releases.
  32   34   */
  33   35  
  34   36  #ifndef _NSS_COMMON_H
  35   37  #define _NSS_COMMON_H
  36   38  
  37      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  38      -
  39   39  #include <synch.h>
  40   40  
  41   41  #ifdef  __cplusplus
  42   42  extern "C" {
  43   43  #endif
  44   44  
  45   45  /*
  46   46   * The name-service switch
  47   47   * -----------------------
  48   48   *
↓ open down ↓ 192 lines elided ↑ open up ↑
 241  241          NSS_NISSERVDNS_TRYAGAIN = 4,
 242  242          NSS_TRYLOCAL = 5,
 243  243          NSS_ERROR = 6,
 244  244          NSS_ALTRETRY = 7,
 245  245          NSS_ALTRESET = 8,
 246  246          NSS_NSCD_PRIV = 9
 247  247  } nss_status_t;
 248  248  
 249  249  struct nss_backend;
 250  250  
 251      -#if defined(__STDC__)
 252  251  typedef nss_status_t (*nss_backend_op_t)(struct nss_backend *, void *args);
 253      -#else
 254      -typedef nss_status_t (*nss_backend_op_t)();
 255      -#endif
 256  252  
 257  253  struct nss_backend {
 258  254          nss_backend_op_t        *ops;
 259  255          int                     n_ops;
 260  256  };
 261  257  typedef struct nss_backend      nss_backend_t;
 262  258  typedef int                     nss_dbop_t;
 263  259  
 264  260  #define NSS_DBOP_DESTRUCTOR     0
 265  261  #define NSS_DBOP_ENDENT         1
↓ open down ↓ 22 lines elided ↑ open up ↑
 288  284   * in order to, say, indicate that some backends are "compiled in" with the
 289  285   * frontend.
 290  286   *
 291  287   * Backend-finders return a pointer to a constructor function for the backend.
 292  288   * (or NULL if they can't find the backend).  The switch engine caches these
 293  289   * function pointers;  when it needs to perform step (b), it calls the
 294  290   * constructor function, which returns a pointer to a new instance of the
 295  291   * backend, properly initialized (or returns NULL).
 296  292   */
 297  293  
 298      -#if defined(__STDC__)
 299  294  typedef nss_backend_t           *(*nss_backend_constr_t)(const char *db_name,
 300  295                                                          const char *src_name,
 301  296  /* Hook for (unimplemented) args in nsswitch.conf */    const char *cfg_args);
 302      -#else
 303      -typedef nss_backend_t           *(*nss_backend_constr_t)();
 304      -#endif
 305  297  
 306  298  struct nss_backend_finder {
 307      -#if defined(__STDC__)
 308  299          nss_backend_constr_t    (*lookup)
 309  300                  (void *lkp_priv, const char *, const char *, void **del_privp);
 310  301          void                    (*delete)
 311  302                  (void *del_priv, nss_backend_constr_t);
 312      -#else
 313      -        nss_backend_constr_t    (*lookup)();
 314      -        void                    (*delete)();
 315      -#endif
 316  303          struct nss_backend_finder *next;
 317  304          void                    *lookup_priv;
 318  305  };
 319  306  
 320  307  typedef struct nss_backend_finder nss_backend_finder_t;
 321  308  
 322  309  extern nss_backend_finder_t     *nss_default_finders;
 323  310  
 324  311  /*
 325  312   * Frontend parameters
↓ open down ↓ 42 lines elided ↑ open up ↑
 368  355          unsigned                max_active_per_src;
 369  356          unsigned                max_dormant_per_src;
 370  357          enum nss_dbp_flags      flags;
 371  358          nss_backend_finder_t    *finders;
 372  359          void                    *private;       /* Not used by switch */
 373  360          void                    (*cleanup)(struct nss_db_params *);
 374  361  };
 375  362  
 376  363  typedef struct nss_db_params nss_db_params_t;
 377  364  
 378      -#if defined(__STDC__)
 379  365  typedef void (*nss_db_initf_t)(nss_db_params_t *);
 380      -#else
 381      -typedef void (*nss_db_initf_t)();
 382      -#endif
 383  366  
 384  367  /*
 385  368   * DBD param offsets in NSS2 nscd header.
 386  369   * Offsets are relative to beginning of dbd section.
 387  370   * 32 bit offsets should be sufficient, forever.
 388  371   * 0 offset == NULL
 389  372   * flags == nss_dbp_flags
 390  373   */
 391  374  typedef struct nss_dbd {
 392  375          uint32_t        o_name;
↓ open down ↓ 51 lines elided ↑ open up ↑
 444  427  struct nss_config {
 445  428          char            *name;
 446  429          nss_config_op_t cop;
 447  430          mutex_t         *lock;
 448  431          void            *buffer;
 449  432          size_t          length;
 450  433  };
 451  434  typedef struct nss_config nss_config_t;
 452  435  
 453  436  
 454      -#if defined(__STDC__)
 455  437  extern nss_status_t nss_config(nss_config_t **, int);
 456  438  
 457  439  extern nss_status_t nss_search(nss_db_root_t *, nss_db_initf_t,
 458  440                          int search_fnum, void *search_args);
 459  441  extern nss_status_t nss_getent(nss_db_root_t *, nss_db_initf_t, nss_getent_t *,
 460  442                          void *getent_args);
 461  443  extern void nss_setent(nss_db_root_t *, nss_db_initf_t, nss_getent_t *);
 462  444  extern void nss_endent(nss_db_root_t *, nss_db_initf_t, nss_getent_t *);
 463  445  extern void nss_delete(nss_db_root_t *);
 464  446  
↓ open down ↓ 8 lines elided ↑ open up ↑
 473  455  
 474  456  extern nss_status_t _nsc_search(nss_db_root_t *, nss_db_initf_t,
 475  457                          int search_fnum, void *search_args);
 476  458  extern nss_status_t _nsc_getent_u(nss_db_root_t *, nss_db_initf_t,
 477  459                          nss_getent_t *, void *getent_args);
 478  460  extern nss_status_t _nsc_setent_u(nss_db_root_t *, nss_db_initf_t,
 479  461                          nss_getent_t *);
 480  462  extern nss_status_t _nsc_endent_u(nss_db_root_t *, nss_db_initf_t,
 481  463                          nss_getent_t *);
 482  464  
 483      -#else
 484      -extern nss_status_t nss_config();
 485  465  
 486      -extern nss_status_t nss_search();
 487      -extern nss_status_t nss_getent();
 488      -extern void nss_setent();
 489      -extern void nss_endent();
 490      -extern void nss_delete();
 491      -
 492      -extern int nss_pack();
 493      -extern int nss_pack_ent();
 494      -extern int nss_unpack();
 495      -extern int nss_unpack_ent();
 496      -
 497      -extern nss_status_t _nsc_search();
 498      -extern nss_status_t _nsc_getent_u();
 499      -extern nss_status_t _nsc_setent_u();
 500      -extern nss_status_t _nsc_endent_u();
 501      -#endif
 502      -
 503  466  #ifdef  __cplusplus
 504  467  }
 505  468  #endif
 506  469  
 507  470  #endif /* _NSS_COMMON_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX