[mod-xhtml-neg-cvs] mod_xhtml_neg-2.0 mod_xhtml_neg.c,1.26,1.27
Brought to you by:
run2000
From: <ru...@us...> - 2004-04-15 13:57:17
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21978 Modified Files: mod_xhtml_neg.c Log Message: Turned mod_xhtml_strempty into a macro. Index: mod_xhtml_neg.c =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/mod_xhtml_neg.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mod_xhtml_neg.c 13 Apr 2004 13:21:23 -0000 1.26 --- mod_xhtml_neg.c 15 Apr 2004 13:57:06 -0000 1.27 *************** *** 146,149 **** --- 146,159 ---- /** + * Test whether a string is empty without having to do a full scan of the + * string just to return a length, as per strlen. + * + * @param str a string pointer, possibly NULL, to be tested + * @return non-zero if the pointer is NULL, or points to a zero-length + * string, otherwise zero + */ + #define mod_xhtml_strempty(str) ((((str) == NULL) || (*(str) == '\0')) ? 1 : 0) + + /** * Enumeration for determining whether processing should be enabled for * this module. By default, we set the directory config state to *************** *** 227,244 **** /** - * Test whether a string is empty without having to do a full scan of the - * string just to return a length, as per strlen. - * - * @param str a string pointer, possibly NULL, to be tested - * @return non-zero if the pointer is NULL, or points to a zero-length - * string, otherwise zero - * @todo could macro-ise this function. - */ - - static int mod_xhtml_strempty( const char *str ) { - return (( str == NULL ) || ( str[0] == '\0' )) ? 1 : 0; - } - - /** * Calculate the length of the given string. The pointer may be NULL. * --- 237,240 ---- *************** *** 1143,1147 **** accept_profile = content_accept->profile; ! if( mod_xhtml_strempty( accept_profile ) ) { /* Accept profile is specified in the request. */ if( ! mod_xhtml_strempty( content_profile )) { --- 1139,1143 ---- accept_profile = content_accept->profile; ! if( mod_xhtml_strempty( accept_profile )) { /* Accept profile is specified in the request. */ if( ! mod_xhtml_strempty( content_profile )) { |