libcsem
0.2
|
00001 /* 00002 * $Id: csem__url_8h_source.html,v 1.1 2013-04-22 20:16:24 hitoshi Exp $ 00003 * See Copyright for the status of this software. 00004 * uchida@w3.org 00005 */ 00006 #ifndef CSEM_URL_H 00007 #define CSEM_URL_H 00008 00009 #ifdef __cplusplus 00010 #define CSEM_NS_C_BEGIN extern "C" { 00011 #define CSEM_NS_C_END } 00012 #else 00013 #define CSEM_NS_C_BEGIN 00014 #define CSEM_NS_C_END 00015 #endif 00016 00017 CSEM_NS_C_BEGIN 00018 00019 #include "csem_common.h" 00020 00022 typedef struct CSEM_Url { 00023 char *scheme; 00024 char *hostname; 00025 char *port; 00026 char *path; 00027 char *query; 00028 char *fragment; 00029 } CSEM_Url; 00030 00034 CSEM_Url *CSEM_URL_Create(); 00039 void CSEM_URL_Dispose(CSEM_Url *url); 00046 CSEM_Error CSEM_URL_Parse(const char *urlstring, CSEM_Url **url); 00053 CSEM_Error CSEM_URL_Serialize(const CSEM_Url *url, char **urlstring); 00061 CSEM_Error CSEM_URL_Merge(const CSEM_Url *base, const CSEM_Url *relative, CSEM_Url **merged); 00068 CSEM_Error CSEM_URL_Copy(const CSEM_Url *src, CSEM_Url **dist); 00075 CSEM_Bool CSEM_URL_Equal(const CSEM_Url *u1, const CSEM_Url *u2); 00076 /* 00077 * Get hash code of the URL. 00078 * @param url [in]url 00079 * @param hash [out]hash code 00080 * @return error code 00081 */ 00082 CSEM_Error CSEM_URL_Hash(const CSEM_Url *url, int *hash); 00083 00084 CSEM_NS_C_END 00085 00086 #endif /* CSEM_URL_H */