diff options
Diffstat (limited to 'gnu/usr.sbin/sendmail/include/sm/string.h')
-rw-r--r-- | gnu/usr.sbin/sendmail/include/sm/string.h | 88 |
1 files changed, 33 insertions, 55 deletions
diff --git a/gnu/usr.sbin/sendmail/include/sm/string.h b/gnu/usr.sbin/sendmail/include/sm/string.h index 5cf078a1303..508ca1c0a8c 100644 --- a/gnu/usr.sbin/sendmail/include/sm/string.h +++ b/gnu/usr.sbin/sendmail/include/sm/string.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Sendmail: string.h,v 1.36 2001/06/17 21:31:11 ca Exp $ + * $Sendmail: string.h,v 1.38 2003/10/10 17:56:57 ca Exp $ */ /* @@ -24,25 +24,30 @@ #define SPACELEFT(buf, ptr) (sizeof buf - ((ptr) - buf)) extern int PRINTFLIKE(3, 4) -sm_snprintf __P(( - char *, - size_t, - const char *, - ...)); +sm_snprintf __P((char *, size_t, const char *, ...)); extern bool -sm_match __P(( - const char *_str, - const char *_pattern)); +sm_match __P((const char *_str, const char *_pattern)); extern char * -sm_strdup __P(( - char *)); +sm_strdup __P((char *)); extern char * -sm_strndup_x __P(( - const char *_str, - size_t _len)); +sm_strndup_x __P((const char *_str, size_t _len)); + +#if DO_NOT_USE_STRCPY +/* for "normal" data (free'd before end of process) */ +extern char * +sm_strdup_x __P((const char *_str)); + +/* for data that is supposed to be persistent. */ +extern char * +sm_pstrdup_x __P((const char *_str)); + +extern char * +sm_strdup_tagged_x __P((const char *str, char *file, int line, int group)); + +#else /* DO_NOT_USE_STRCPY */ /* for "normal" data (free'd before end of process) */ # define sm_strdup_x(str) strcpy(sm_malloc_x(strlen(str) + 1), str) @@ -52,35 +57,22 @@ sm_strndup_x __P(( # define sm_strdup_tagged_x(str, file, line, group) \ strcpy(sm_malloc_tagged_x(strlen(str) + 1, file, line, group), str) +#endif /* DO_NOT_USE_STRCPY */ extern char * -sm_stringf_x __P(( - const char *_fmt, - ...)); +sm_stringf_x __P((const char *_fmt, ...)); extern char * -sm_vstringf_x __P(( - const char *_fmt, - va_list _ap)); +sm_vstringf_x __P((const char *_fmt, va_list _ap)); extern size_t -sm_strlcpy __P(( - char *_dst, - const char *_src, - ssize_t _len)); +sm_strlcpy __P((char *_dst, const char *_src, ssize_t _len)); extern size_t -sm_strlcat __P(( - char *_dst, - const char *_src, - ssize_t _len)); +sm_strlcat __P((char *_dst, const char *_src, ssize_t _len)); extern size_t -sm_strlcat2 __P(( - char *, - const char *, - const char *, - ssize_t)); +sm_strlcat2 __P((char *, const char *, const char *, ssize_t)); extern size_t #ifdef __STDC__ @@ -94,40 +86,26 @@ sm_strlcpyn __P((char *, # if !HASSTRERROR extern char * -strerror __P(( - int _errno)); +strerror __P((int _errno)); # endif /* !HASSTRERROR */ extern int -sm_strrevcmp __P(( - const char *, - const char *)); +sm_strrevcmp __P((const char *, const char *)); extern int -sm_strrevcasecmp __P(( - const char *, - const char *)); +sm_strrevcasecmp __P((const char *, const char *)); extern int -sm_strcasecmp __P(( - const char *, - const char *)); +sm_strcasecmp __P((const char *, const char *)); extern int -sm_strncasecmp __P(( - const char *, - const char *, - size_t)); +sm_strncasecmp __P((const char *, const char *, size_t)); extern LONGLONG_T -sm_strtoll __P(( - const char *, - char**, int)); +sm_strtoll __P((const char *, char**, int)); extern ULONGLONG_T -sm_strtoull __P(( - const char *, - char**, int)); +sm_strtoull __P((const char *, char**, int)); extern void stripquotes __P((char *)); |