Lines Matching defs:string
26 * allocated string or NULL if an error occurred. */
42 char *curl_escape(const char *string, int inlength)
44 return curl_easy_escape(NULL, string, inlength);
48 char *curl_unescape(const char *string, int length)
50 return curl_easy_unescape(NULL, string, length, NULL);
53 /* Escapes for URL the given unescaped string of given length.
56 char *curl_easy_escape(struct Curl_easy *data, const char *string,
68 length = (inlength?(size_t)inlength:strlen(string));
73 unsigned char in = *string++; /* treat the characters unsigned */
105 * Curl_urldecode() URL decodes the given string.
107 * Returns a pointer to a malloced string in *ostring with length given in
108 * *olen. If length == 0, the length is assumed to be strlen(string).
120 CURLcode Curl_urldecode(const char *string, size_t length,
127 DEBUGASSERT(string);
130 alloc = (length?length:strlen(string));
136 /* store output string */
140 unsigned char in = *string;
142 ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
144 in = (unsigned char)(onehex2dec(string[1]) << 4) | onehex2dec(string[2]);
146 string += 3;
150 string++;
172 * Unescapes the given URL escaped string of given length. Returns a
173 * pointer to a malloced string with length given in *olen.
174 * If length == 0, the length is assumed to be strlen(string).
178 char *curl_easy_unescape(struct Curl_easy *data, const char *string,
186 CURLcode res = Curl_urldecode(string, inputlen, &str, &outputlen,