Lines Matching refs:form

211   struct FormInfo *first_form, *current_form, *form = NULL;
364 form = AddFormInfo(fname, NULL, current_form);
365 if(!form) {
370 form->value_alloc = TRUE;
371 current_form = form;
372 form = NULL;
435 accepted as a fine form part */
453 form = AddFormInfo(NULL, type, current_form);
454 if(!form) {
459 form->contenttype_alloc = TRUE;
460 current_form = form;
461 form = NULL;
550 for(form = first_form;
551 form != NULL;
552 form = form->more) {
553 if(((!form->name || !form->value) && !post) ||
554 ( (form->contentslength) &&
555 (form->flags & HTTPPOST_FILENAME) ) ||
556 ( (form->flags & HTTPPOST_FILENAME) &&
557 (form->flags & HTTPPOST_PTRCONTENTS) ) ||
559 ( (!form->buffer) &&
560 (form->flags & HTTPPOST_BUFFER) &&
561 (form->flags & HTTPPOST_PTRBUFFER) ) ||
563 ( (form->flags & HTTPPOST_READFILE) &&
564 (form->flags & HTTPPOST_PTRCONTENTS) )
569 if(((form->flags & HTTPPOST_FILENAME) ||
570 (form->flags & HTTPPOST_BUFFER)) &&
571 !form->contenttype) {
572 char *f = (form->flags & HTTPPOST_BUFFER)?
573 form->showfilename : form->value;
582 form->contenttype = strdup(type);
583 if(!form->contenttype) {
587 form->contenttype_alloc = TRUE;
589 if(form->name && form->namelength) {
592 for(i = 0; i < form->namelength; i++)
593 if(!form->name[i]) {
600 if(!(form->flags & HTTPPOST_PTRNAME) &&
601 (form == first_form) ) {
602 /* Note that there's small risk that form->name is NULL here if the
604 if(form->name) {
606 form->name = Curl_memdup0(form->name, form->namelength?
607 form->namelength:
608 strlen(form->name));
610 if(!form->name) {
614 form->name_alloc = TRUE;
616 if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
618 HTTPPOST_CALLBACK)) && form->value) {
620 size_t clen = (size_t) form->contentslength;
622 clen = strlen(form->value) + 1;
624 form->value = Curl_memdup(form->value, clen);
626 if(!form->value) {
630 form->value_alloc = TRUE;
632 post = AddHttpPost(form->name, form->namelength,
633 form->value, form->contentslength,
634 form->buffer, form->bufferlength,
635 form->contenttype, form->flags,
636 form->contentheader, form->showfilename,
637 form->userp,
646 if(form->contenttype)
647 prevtype = form->contenttype;
654 for(ptr = form; ptr != NULL; ptr = ptr->more) {
712 int curl_formget(struct curl_httppost *form, void *arg,
718 Curl_mime_initpart(&toppart); /* default form is empty */
719 result = Curl_getformdata(NULL, &toppart, form, NULL);
721 result = Curl_mime_prepare_headers(NULL, &toppart, "multipart/form-data",
743 * curl_formfree() is an external function to free up a whole form post
746 void curl_formfree(struct curl_httppost *form)
750 if(!form)
751 /* no form to free, just get out of this */
755 next = form->next; /* the following form line */
758 curl_formfree(form->more);
760 if(!(form->flags & HTTPPOST_PTRNAME))
761 free(form->name); /* free the name */
762 if(!(form->flags &
765 free(form->contents); /* free the contents */
766 free(form->contenttype); /* free the content type */
767 free(form->showfilename); /* free the faked file name */
768 free(form); /* free the struct */
769 form = next;
770 } while(form); /* continue */
820 curl_mime *form = NULL;
824 Curl_mime_cleanpart(finalform); /* default form is empty */
829 form = curl_mime_init(data);
830 if(!form)
834 result = curl_mime_subparts(finalform, form);
839 curl_mime *multipart = form;
841 part = curl_mime_addpart(form);
943 int curl_formget(struct curl_httppost *form, void *arg,
946 (void) form;
952 void curl_formfree(struct curl_httppost *form)
954 (void)form;