url.h 557 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __URL_H__
  2. #define __URL_H__
  3. #pragma once
  4. #include "config.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. TOOLKIT_API char* urlencode(unsigned char *string);
  9. TOOLKIT_API unsigned char* urldecode(char *string);
  10. TOOLKIT_API char* util_skipline(char *text);
  11. TOOLKIT_API char* util_getline(char *text);
  12. typedef struct {
  13. char *scheme;
  14. char *host;
  15. int port;
  16. char *path;
  17. } url_fields;
  18. TOOLKIT_API int url_parse(char *url, url_fields *uf);
  19. TOOLKIT_API void url_free_fields(url_fields *uf);
  20. #ifdef __cplusplus
  21. } // extern "C" {
  22. #endif
  23. #endif //__URL_H__