dis_sql/src/esql.cxx
/* The following function adds a single path specification to the list
 * specified by the "head" and "tail" parameters.  The "text" argument
 * is assumed to be malloced and will be freed by init_include_paths.
 * The arguments is assumed to have no leading blanks, but trailing
 * blanks are truncated here.
 */
The following function adds a single path specification to the list
specified by the "head" and "tail" parameters.  The "text" argument
is assumed to be malloced and will be freed by init_include_paths.
The arguments is assumed to have no leading blanks, but trailing
blanks are truncated here.
The following function adds a single path specification to the list specified by the " head " and " tail " parameters . The " text " argument is assumed to be malloced and will be freed by init_include_paths . The arguments is assumed to have no leading blanks but trailing blanks are truncated here .
static void add_path(path** head, path** tail, char* text) {
    size_t len = strlen(text);
    path* p;
    int i;
    for (i = len - 1; i >= 0 && text[i] == ' '; i--) {
	text[i] = 0;
    }
    if (i < 0) {
#ifdef ISO_CPP_HEADERS
        std::free(text);
#else
        free(text);
#endif
    }
    else {
#ifdef ISO_CPP_HEADERS
        p = (path*) std::malloc(sizeof(path));
#else
        p = (path*) malloc(sizeof(path));
#endif
        p->next = 0;
        p->text = text;
        if (*tail) {
            (*tail)->next = p;
        }
        else *head = p;
        *tail = p;
    }
}
static void add_path ( path * * head , path * * tail , char * text ) { size_t len = strlen ( text ) ; path * p ; int i ; for ( i = len - 1 ; i >= 0 && text [ i ] == ' ' ; i -- ) { text [ i ] = 0 ; } if ( i < 0 ) { #ifdef ISO_CPP_HEADERS std :: free ( text ) ; #else free ( text ) ; #endif } else { #ifdef ISO_CPP_HEADERS p = ( path * ) std :: malloc ( sizeof ( path ) ) ; #else p = ( path * ) malloc ( sizeof ( path ) ) ; #endif p -> next = 0 ; p -> text = text ; if ( * tail ) { ( * tail ) -> next = p ; } else * head = p ; * tail = p ; } }
The following function adds a single path specification to the list
 specified by the "head" and "tail" parameters.
The following function adds a single path specification to the list specified by the " head " and " tail " parameters .
/* empty specification */