73 char *s = (
char *)sUri;
200 t = (
char *)sHost + strlen(sHost);
208 n = (size_t)(s - sHost);
217 *pPortNum = (int)strtol(s+1,
NULL, 10);
242 if( (sScheme !=
NULL) && (*sScheme != 0) )
267 if( (sHostName !=
NULL) && (*sHostName != 0) )
308 if( (sPath !=
NULL) && (*sPath != 0) )
324 Uri_T uri = {
"",
"",
"", 0,
"",
""};
325 Uri_T sep = {
"",
"",
"", 0,
"",
""};
356 snprintf(bufPort,
sizeof(bufPort),
"%s%d",
358 bufPort[
sizeof(bufPort)-1] = 0;
382 sprintf(sUri,
"%s%s%s%s%s%s%s%s%s%s",
char * UriStrNew(const Uri_T *pUri)
Construct a new URI string from the given URI components.
char * new_strndup(const char *s, size_t n)
Duplicate not more than n characters of string.
#define NEWSTR(len)
Allocate new string buffer of length len+1.
char * new_strdup(const char *s)
Duplicate a string.
void UriSetScheme(Uri_T *pUri, const char *sScheme)
Set the scheme.
#define URI_SEP_QUERY_LEN
query separator length
void UriSetHostName(Uri_T *pUri, const char *sHostName)
Set the hostname.
#define URI_PORT_MAX_LEN
port max string length (2 bytes)
void UriDelete(Uri_T *pUri)
Delete the URI compenent structure.
Uniform Resource Identifier (URI) parsing utilities declarations.
Memory allocation and deallocation declarations.
char * m_sPath
absolute file path
Uri_T * UriParseNew(const char *sUri)
Parse a URI string.
#define URI_PORT_NONE
no port number
#define URI_SEP_QUERY
query separator
char * m_sUserInfo
user info
#define URI_SEP_SCHEME_LEN
scheme separator length
#define URI_SEP_USER_INFO
user info separator
#define NEW(T)
Allocate new type.
RoadNarrows Robotics common configuration file.
#define URI_SEP_PORT_LEN
port number separator length
#define URI_SEP_USER_INFO_LEN
user info separator length
#define URI_SEP_SCHEME
scheme separator
void UriSetPortNum(Uri_T *pUri, int nPortNum)
Set the port number.
char * UriParseHostNew(const char *sHost, char **pHostName, int *pPortNum)
Parse the host string.
void UriSetPath(Uri_T *pUri, const char *sPath)
Set the file path.
#define URI_SEP_PATH
absolute path separator and start
#define URI_SEP_PORT
port number separator
char * m_sHostName
host name (domain or address)
int m_nPortNum
port number
#define URI_SEP_PATH_LEN
absolute path separator length