Lines Matching refs:mime

1004   curl_mime *mime = (curl_mime *) instream;  in mime_subparts_read()  local
1010 curl_mimepart *part = mime->state.ptr; in mime_subparts_read()
1011 switch(mime->state.state) { in mime_subparts_read()
1014 mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, mime->firstpart); in mime_subparts_read()
1018 mime->state.offset += 2; in mime_subparts_read()
1021 sz = readback_bytes(&mime->state, buffer, nitems, STRCONST("\r\n--"), in mime_subparts_read()
1024 mimesetstate(&mime->state, MIMESTATE_BOUNDARY2, part); in mime_subparts_read()
1028 sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary, in mime_subparts_read()
1031 sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary, in mime_subparts_read()
1034 mimesetstate(&mime->state, MIMESTATE_CONTENT, part); in mime_subparts_read()
1039 mimesetstate(&mime->state, MIMESTATE_END, NULL); in mime_subparts_read()
1050 mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart); in mime_subparts_read()
1105 curl_mime *mime = (curl_mime *) instream; in mime_subparts_seek() local
1112 if(mime->state.state == MIMESTATE_BEGIN) in mime_subparts_seek()
1115 for(part = mime->firstpart; part; part = part->nextpart) { in mime_subparts_seek()
1122 mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL); in mime_subparts_seek()
1149 curl_mime *mime = (curl_mime *) ptr; in mime_subparts_free() local
1151 if(mime && mime->parent) { in mime_subparts_free()
1152 mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ in mime_subparts_free()
1153 cleanup_part_content(mime->parent); /* Avoid dangling pointer in part. */ in mime_subparts_free()
1155 curl_mime_free(mime); in mime_subparts_free()
1161 curl_mime *mime = (curl_mime *) ptr; in mime_subparts_unbind() local
1163 if(mime && mime->parent) { in mime_subparts_unbind()
1164 mime->parent->freefunc = NULL; /* Be sure we will not be called again. */ in mime_subparts_unbind()
1165 cleanup_part_content(mime->parent); /* Avoid dangling pointer in part. */ in mime_subparts_unbind()
1166 mime->parent = NULL; in mime_subparts_unbind()
1186 void curl_mime_free(curl_mime *mime) in curl_mime_free() argument
1190 if(mime) { in curl_mime_free()
1191 mime_subparts_unbind(mime); /* Be sure it is not referenced anymore. */ in curl_mime_free()
1192 while(mime->firstpart) { in curl_mime_free()
1193 part = mime->firstpart; in curl_mime_free()
1194 mime->firstpart = part->nextpart; in curl_mime_free()
1198 free(mime); in curl_mime_free()
1205 curl_mime *mime; in Curl_mime_duppart() local
1232 mime = curl_mime_init(data); in Curl_mime_duppart()
1233 res = mime ? curl_mime_subparts(dst, mime) : CURLE_OUT_OF_MEMORY; in Curl_mime_duppart()
1237 d = curl_mime_addpart(mime); in Curl_mime_duppart()
1286 curl_mime *mime; in curl_mime_init() local
1288 mime = (curl_mime *) malloc(sizeof(*mime)); in curl_mime_init()
1290 if(mime) { in curl_mime_init()
1291 mime->parent = NULL; in curl_mime_init()
1292 mime->firstpart = NULL; in curl_mime_init()
1293 mime->lastpart = NULL; in curl_mime_init()
1295 memset(mime->boundary, '-', MIME_BOUNDARY_DASHES); in curl_mime_init()
1297 (unsigned char *) &mime->boundary[MIME_BOUNDARY_DASHES], in curl_mime_init()
1300 free(mime); in curl_mime_init()
1303 mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL); in curl_mime_init()
1306 return mime; in curl_mime_init()
1318 curl_mimepart *curl_mime_addpart(curl_mime *mime) in curl_mime_addpart() argument
1322 if(!mime) in curl_mime_addpart()
1329 part->parent = mime; in curl_mime_addpart()
1331 if(mime->lastpart) in curl_mime_addpart()
1332 mime->lastpart->nextpart = part; in curl_mime_addpart()
1334 mime->firstpart = part; in curl_mime_addpart()
1336 mime->lastpart = part; in curl_mime_addpart()
1629 static curl_off_t multipart_size(curl_mime *mime) in multipart_size() argument
1635 if(!mime) in multipart_size()
1641 for(part = mime->firstpart; part; part = part->nextpart) { in multipart_size()
1769 curl_mime *mime = NULL; in Curl_mime_prepare_headers() local
1810 mime = (curl_mime *) part->arg; in Curl_mime_prepare_headers()
1811 if(mime) in Curl_mime_prepare_headers()
1812 boundary = mime->boundary; in Curl_mime_prepare_headers()
1888 if(part->kind == MIMEKIND_MULTIPART && mime) { in Curl_mime_prepare_headers()
1894 for(subpart = mime->firstpart; subpart; subpart = subpart->nextpart) { in Curl_mime_prepare_headers()
1911 curl_mime *mime = (curl_mime *) part->arg; in mime_unpause() local
1913 if(mime) { in mime_unpause()
1916 for(subpart = mime->firstpart; subpart; subpart = subpart->nextpart) in mime_unpause()
2186 void curl_mime_free(curl_mime *mime) in curl_mime_free() argument
2188 (void) mime; in curl_mime_free()
2191 curl_mimepart *curl_mime_addpart(curl_mime *mime) in curl_mime_addpart() argument
2193 (void) mime; in curl_mime_addpart()