Lines Matching refs:ap

70 show_alist(struct attachment *alist, struct attachment *ap)
72 (void)printf("alist=%p ap=%p\n", alist, ap);
73 for (ap = alist; ap; ap = ap->a_flink) {
75 ap, ap->a_flink, ap->a_blink, ap->a_name ? ap->a_name : "<null>");
102 show_attach(const char *prefix, struct attachment *ap)
106 for (/*EMPTY*/; ap; ap = ap->a_flink) {
108 fput_mime_content(stdout, &ap->a_Content);
309 content_encoding(struct attachment *ap, const char *ctype) in content_encoding() argument
311 switch (ap->a_type) { in content_encoding()
313 return content_encoding_by_name(ap->a_name, ctype); in content_encoding()
317 return content_encoding_by_fileno(ap->a_fileno, ctype); in content_encoding()
322 errx(EXIT_FAILURE, "invalid attachment type: %d", ap->a_type); in content_encoding()
417 content_type(struct attachment *ap) in content_type() argument
419 switch (ap->a_type) { in content_type()
421 return content_type_by_name(ap->a_name); in content_type()
431 return content_type_by_fileno(ap->a_fileno); in content_type()
436 errx(EXIT_FAILURE, "invalid attachment type: %d", ap->a_type); in content_type()
446 content_disposition(struct attachment *ap) in content_disposition() argument
448 switch (ap->a_type) { in content_disposition()
452 basename(ap->a_name)); in content_disposition()
464 errx(EXIT_FAILURE, "invalid attachment type: %d", ap->a_type); in content_disposition()
471 content_id(struct attachment *ap __unused) in content_id()
494 get_mime_content(struct attachment *ap, int i) in get_mime_content() argument
498 Cp.C_type = content_type(ap); in get_mime_content()
499 Cp.C_encoding = content_encoding(ap, Cp.C_type); in get_mime_content()
500 Cp.C_disposition = content_disposition(ap); in get_mime_content()
501 Cp.C_id = content_id(ap); in get_mime_content()
502 Cp.C_description = content_description(ap, i); in get_mime_content()
538 fput_attachment(FILE *fo, struct attachment *ap) in fput_attachment() argument
541 struct Content *Cp = &ap->a_Content; in fput_attachment()
543 fput_mime_content(fo, &ap->a_Content); in fput_attachment()
546 switch (ap->a_type) { in fput_attachment()
548 fi = Fopen(ap->a_name, "ref"); in fput_attachment()
550 err(EXIT_FAILURE, "Fopen: %s", ap->a_name); in fput_attachment()
559 fi = Fdopen(ap->a_fileno, "ref"); in fput_attachment()
561 err(EXIT_FAILURE, "Fdopen: %d", ap->a_fileno); in fput_attachment()
585 ap->a_msg->m_size--; /* XXX - remove trailing newline */ in fput_attachment()
587 if (sendmessage(ap->a_msg, fi, forwardtab, NULL, NULL)) in fput_attachment()
589 ap->a_msg->m_size++; in fput_attachment()
598 errx(EXIT_FAILURE, "invalid attachment type: %d", ap->a_type); in fput_attachment()
643 struct attachment *ap; in mime_encode() local
677 for (ap = attach; ap; ap = ap->a_flink) { in mime_encode()
679 fput_attachment(nfo, ap); in mime_encode()
752 attach_one_file(struct attachment *ap, char *filename, int attach_num) in attach_one_file() argument
771 if (ap) { in attach_one_file()
772 for (/*EMPTY*/; ap->a_flink != NULL; ap = ap->a_flink) in attach_one_file()
774 ap->a_flink = nap; in attach_one_file()
775 nap->a_blink = ap; in attach_one_file()
864 struct attachment *ap; in edit_attachlist() local
871 ap = alist; in edit_attachlist()
872 while (ap) { in edit_attachlist()
873 SHOW_ALIST(alist, ap); in edit_attachlist()
875 switch(ap->a_type) { in edit_attachlist()
882 line = get_line(&elm.filec, "filename", ap->a_name, attach_num); in edit_attachlist()
884 if (ap->a_blink) { in edit_attachlist()
886 next_ap = ap->a_flink; in edit_attachlist()
887 ap = ap->a_blink; in edit_attachlist()
888 ap->a_flink = next_ap; in edit_attachlist()
890 next_ap->a_blink = ap; in edit_attachlist()
895 alist = ap->a_flink; in edit_attachlist()
902 if (strcmp(line, ap->a_name) != 0) { /* new filename */ in edit_attachlist()
905 ap->a_name = savestr(canon_name); in edit_attachlist()
906 ap->a_Content = get_mime_content(ap, 0); in edit_attachlist()
909 &ap->a_Content.C_description, attach_num); in edit_attachlist()
910 sget_encoding(&ap->a_Content.C_encoding, ap->a_name, in edit_attachlist()
911 ap->a_Content.C_type, attach_num); in edit_attachlist()
919 ap->a_type); in edit_attachlist()
923 if (alist == NULL || ap->a_flink == NULL) in edit_attachlist()
926 ap = ap->a_flink; in edit_attachlist()
929 ap = alist; in edit_attachlist()
933 SHOW_ALIST(alist, ap); in edit_attachlist()
939 nap = attach_one_file(ap, line, attach_num); in edit_attachlist()
945 ap = nap; in edit_attachlist()
948 &ap->a_Content.C_description, attach_num); in edit_attachlist()
949 sget_encoding(&ap->a_Content.C_encoding, ap->a_name, in edit_attachlist()
950 ap->a_Content.C_type, attach_num); in edit_attachlist()
954 SHOW_ALIST(alist, ap); in edit_attachlist()
965 struct attachment *ap; in mime_attach_files() local
972 for (ap = attach; ap && ap->a_flink; ap = ap->a_flink) in mime_attach_files()
979 ap2 = attach_one_file(ap, argv[i], attach_num); in mime_attach_files()
981 ap = ap2; in mime_attach_files()
983 attach = ap; in mime_attach_files()
1003 struct attachment *ap; in mime_attach_optargs() local
1010 ap = NULL; in mime_attach_optargs()
1039 ap2 = attach_one_file(ap, filename, attach_num); in mime_attach_optargs()
1041 ap = ap2; in mime_attach_optargs()
1043 attach = ap; in mime_attach_optargs()