Lines Matching refs:m
43 struct tool_mime *m = (struct tool_mime *) calloc(1, sizeof(*m)); in tool_mime_new() local
45 if(m) { in tool_mime_new()
46 m->kind = kind; in tool_mime_new()
47 m->parent = parent; in tool_mime_new()
49 m->prev = parent->subparts; in tool_mime_new()
50 parent->subparts = m; in tool_mime_new()
53 return m; in tool_mime_new()
65 struct tool_mime *m = NULL; in tool_mime_new_data() local
69 m = tool_mime_new(parent, TOOLMIME_DATA); in tool_mime_new_data()
70 if(!m) in tool_mime_new_data()
73 m->data = mime_data_copy; in tool_mime_new_data()
75 return m; in tool_mime_new_data()
84 struct tool_mime *m = NULL; in tool_mime_new_filedata() local
91 m = tool_mime_new(parent, TOOLMIME_FILE); in tool_mime_new_filedata()
92 if(!m) in tool_mime_new_filedata()
95 m->data = filedup; in tool_mime_new_filedata()
97 m->kind = TOOLMIME_FILEDATA; in tool_mime_new_filedata()
127 return m; in tool_mime_new_filedata()
136 return m; in tool_mime_new_filedata()
143 m = tool_mime_new(parent, TOOLMIME_STDIN); in tool_mime_new_filedata()
144 if(!m) in tool_mime_new_filedata()
147 m->data = data; in tool_mime_new_filedata()
148 m->origin = origin; in tool_mime_new_filedata()
149 m->size = size; in tool_mime_new_filedata()
150 m->curpos = 0; in tool_mime_new_filedata()
152 m->kind = TOOLMIME_STDINDATA; in tool_mime_new_filedata()
156 return m; in tool_mime_new_filedata()
238 static CURLcode tool2curlparts(CURL *curl, struct tool_mime *m, in tool2curlparts() argument
246 if(m) { in tool2curlparts()
247 ret = tool2curlparts(curl, m->prev, mime); in tool2curlparts()
254 filename = m->filename; in tool2curlparts()
255 switch(m->kind) { in tool2curlparts()
257 ret = tool2curlmime(curl, m, &submime); in tool2curlparts()
266 ret = curl_mime_data(part, m->data, CURL_ZERO_TERMINATED); in tool2curlparts()
271 ret = curl_mime_filedata(part, m->data); in tool2curlparts()
272 if(!ret && m->kind == TOOLMIME_FILEDATA && !filename) in tool2curlparts()
281 ret = curl_mime_data_cb(part, m->size, in tool2curlparts()
284 NULL, m); in tool2curlparts()
295 ret = curl_mime_type(part, m->type); in tool2curlparts()
297 ret = curl_mime_headers(part, m->headers, 0); in tool2curlparts()
299 ret = curl_mime_encoder(part, m->encoder); in tool2curlparts()
301 ret = curl_mime_name(part, m->name); in tool2curlparts()
306 CURLcode tool2curlmime(CURL *curl, struct tool_mime *m, curl_mime **mime) in tool2curlmime() argument
314 ret = tool2curlparts(curl, m->subparts, *mime); in tool2curlmime()
706 #define SET_TOOL_MIME_PTR(m, field) \ argument
709 (m)->field = strdup(field); \
710 if(!(m)->field) \