Print this page
first round of POSIX 2008 stuff

Split Close
Expand all
Collapse all
          --- old/usr/src/head/strings.h
          +++ new/usr/src/head/strings.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright (c) 1995, 1996, by Sun Microsystems, Inc.
  24   24   * All rights reserved.
  25   25   */
  26   26  /*
  27      - * Copyright 2013 Garrett D'Amore <garrett@damore.org>
       27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  28   28   */
  29   29  
  30   30  #ifndef _STRINGS_H
  31   31  #define _STRINGS_H
  32   32  
  33   33  #include <sys/types.h>
  34   34  #include <sys/feature_tests.h>
  35   35  
  36   36  #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
  37   37  #include <string.h>
  38   38  #endif
  39   39  
  40   40  #ifdef  __cplusplus
  41   41  extern "C" {
  42   42  #endif
  43   43  
  44      -#if defined(__STDC__)
  45      -
       44 +/* These symbols were replaced with mem* in XPG7 */
       45 +#if (!defined(_STRICT_SYMBOLS)) || (!defined(_XPG7))
  46   46  extern int bcmp(const void *, const void *, size_t);
  47   47  extern void bcopy(const void *, void *, size_t);
  48   48  extern void bzero(void *, size_t);
  49      -
  50   49  extern char *index(const char *, int);
  51   50  extern char *rindex(const char *, int);
       51 +#endif
  52   52  
  53   53  /*
  54   54   * X/Open System Interfaces and Headers, Issue 4, Version 2, defines
  55   55   * both <string.h> and <strings.h>.  The namespace requirements
  56   56   * do not permit the visibility of anything other than what is
  57   57   * specifically defined for each of these headers.  As a result,
  58   58   * inclusion of <string.h> would result in declarations not allowed
  59   59   * in <strings.h>, and making the following prototypes visible for
  60   60   * anything other than X/Open UNIX Extension would result in
  61   61   * conflicts with what is now in <string.h>.
↓ open down ↓ 5 lines elided ↑ open up ↑
  67   67  #if defined(_XPG7)
  68   68  #ifndef _LOCALE_T
  69   69  #define _LOCALE_T
  70   70  typedef struct _locale *locale_t;
  71   71  #endif
  72   72  extern int strcasecmp_l(const char *, const char *, locale_t);
  73   73  extern int strncasecmp_l(const char *, const char *, size_t, locale_t);
  74   74  #endif  /* defined(_XPG7) */
  75   75  #endif  /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
  76   76  
  77      -#else
  78      -
  79      -extern int bcmp();
  80      -extern void bcopy();
  81      -extern void bzero();
  82      -
  83      -extern char *index();
  84      -extern char *rindex();
  85      -
  86      -#if defined(_XPG4_2) && !defined(__EXTENSIONS__)
  87      -extern int ffs();
  88      -extern int strcasecmp();
  89      -extern int strncasecmp();
  90      -#if defined(_XPG7)
  91      -extern int strcasecmp_l();
  92      -extern int strncasecmp_l();
  93      -#endif
  94      -#endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
  95      -
  96      -#endif  /* __STDC__ */
  97      -
  98   77  #ifdef  __cplusplus
  99   78  }
 100   79  #endif
 101   80  
 102   81  #endif  /* _STRINGS_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX