58 #define SAFESTR(s) ((s) != NULL? s: "") 74 while( *s && isspace((
int)*s))
88 while( (t > s) && isspace((
int)*t))
109 int main(
int argc,
char *argv[])
116 printf(
"Uniform Resource Indentifier Example.\n");
117 printf(
" (enter 'quit' to quit programe)\n\n");
122 printf(
"enter uri> ");
125 if( !fgets(buf, (
int)
sizeof(buf), stdin) )
133 if( (*sCmd ==
'\0') || (*sCmd ==
'\n') )
138 else if( !strcmp(sCmd,
"quit") )
146 printf(
"UriParseNew() ->\n");
151 printf(
" m_nPortNum = %d\n", pUri->
m_nPortNum);
157 printf(
"UriStrNew() -> \"%s\"\n",
SAFESTR(sUri));
161 printf(
"UriDelete() -> deleted\n");
static char * strip(char *s)
Strip leading and trailing white space.
Uniform Resource Identifier (URI) parsing utilities declarations.
Memory allocation and deallocation declarations.
char * m_sPath
absolute file path
void UriDelete(Uri_T *pUri)
Delete the URI compenent structure.
int main(int argc, char *argv[])
Example main.
char * m_sUserInfo
user info
#define SAFESTR(s)
Make a safe string.
RoadNarrows Robotics common configuration file.
char * UriStrNew(const Uri_T *pUri)
Construct a new URI string from the given URI components.
char * m_sHostName
host name (domain or address)
int m_nPortNum
port number
Uri_T * UriParseNew(const char *sUri)
Parse a URI string.