~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to connect/ncbi_ansi_ext.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef CONNECT___NCBI_ANSI_EXT__H
2
2
#define CONNECT___NCBI_ANSI_EXT__H
3
3
 
4
 
/*  $Id: ncbi_ansi_ext.h,v 6.13 2005/04/20 18:12:16 lavr Exp $
 
4
/*  $Id: ncbi_ansi_ext.h,v 6.15 2006/03/07 18:14:59 lavr Exp $
5
5
 * ===========================================================================
6
6
 *
7
7
 *                            PUBLIC DOMAIN NOTICE
59
59
#endif /*HAVE_STRDUP*/
60
60
 
61
61
 
 
62
#ifndef HAVE_STRNDUP
 
63
 
 
64
#  ifdef strndup
 
65
#    undef strndup
 
66
#  endif
 
67
#  define strndup     NCBI_strndup
 
68
 
 
69
/* Create a copy of up to "n" first characters of string "str".
 
70
 * Return a malloc'ed and '\0'-terminated string, which must be
 
71
 * explicitly freed by free() when no longer needed.
 
72
 */
 
73
extern NCBI_XCONNECT_EXPORT char* strndup(const char* str, size_t n);
 
74
 
 
75
#endif /*HAVE_STRNDUP*/
 
76
 
 
77
 
62
78
#ifndef HAVE_STRCASECMP
63
79
 
64
80
#  ifdef strcasecmp
87
103
#  undef strupr
88
104
#  undef strlwr
89
105
#endif
90
 
#define strupr NCBI_strupr
91
 
#define strlwr NCBI_strlwr
 
106
#define strupr        NCBI_strupr
 
107
#define strlwr        NCBI_strlwr
92
108
 
93
109
/* Convert a string to uppercase, then return pointer to
94
110
 * the altered string. Because the conversion is made in place, the
106
122
/* Copy not more than "n" characters from string "s2" into "s1"
107
123
 * and return the result, which is always null-terminated.
108
124
 * NOTE: The difference of this function from standard strncpy() is in
109
 
 * that the result is always null-terminated and that the function
110
 
 * does not pad "s1" with null bytes should "s2" be shorter than "n".
 
125
 * that the result is always null-terminated and that the function does not
 
126
 * pad "s1" with null bytes should "s2" be shorter than "n" characters.
111
127
 */
112
128
extern NCBI_XCONNECT_EXPORT char* strncpy0(char* s1, const char* s2, size_t n);
113
129
 
120
136
/*
121
137
 * --------------------------------------------------------------------------
122
138
 * $Log: ncbi_ansi_ext.h,v $
 
139
 * Revision 6.15  2006/03/07 18:14:59  lavr
 
140
 * Formatting
 
141
 *
 
142
 * Revision 6.14  2006/03/07 17:18:52  lavr
 
143
 * +strndup
 
144
 *
123
145
 * Revision 6.13  2005/04/20 18:12:16  lavr
124
146
 * strdup() has got NCBI_XCONNECT_EXPORT
125
147
 *