Mercurial > hg > Applications > mh
comparison uip/mhn.c @ 12:441a2190cfae
Lion fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 21 Apr 2012 13:10:49 +0900 |
parents | a6481689f99c |
children | 3c5835cca094 |
comparison
equal
deleted
inserted
replaced
11:5cf052bee63d | 12:441a2190cfae |
---|---|
1 /* mhn.c - multi-media MH */ | 1 /* mhn.c - multi-media MH */ |
2 #ifndef lint | 2 #ifndef lint |
3 static char ident[] = "@(#)$Id$"; | 3 static char ident[] = "@(#)$Id: mhn.c,v 1.2 2006/12/05 18:18:13 kono Exp $"; |
4 #endif /* lint */ | 4 #endif /* lint */ |
5 | 5 |
6 #include "../h/mh.h" | 6 #include "../h/mh.h" |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <errno.h> | 8 #include <errno.h> |
1940 empty (ci -> ci_comment), empty (ci -> ci_magic)); | 1940 empty (ci -> ci_comment), empty (ci -> ci_magic)); |
1941 #endif /* JAPAN */ | 1941 #endif /* JAPAN */ |
1942 for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++) | 1942 for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++) |
1943 fprintf (stderr, " parameter %s=\"%s\"\n", *ap, *ep); | 1943 fprintf (stderr, " parameter %s=\"%s\"\n", *ap, *ep); |
1944 fprintf (stderr, | 1944 fprintf (stderr, |
1945 " type 0x%x subtype 0x%x params 0x%x\n", | 1945 " type 0x%lx subtype 0x%lx params 0x%lx\n", |
1946 ct -> c_type, ct -> c_subtype, ct -> c_ctparams); | 1946 (long)ct -> c_type, (long)ct -> c_subtype, (long)ct -> c_ctparams); |
1947 | 1947 |
1948 fprintf (stderr, " showproc \"%s\"\n", empty (ct -> c_showproc)); | 1948 fprintf (stderr, " showproc \"%s\"\n", empty (ct -> c_showproc)); |
1949 fprintf (stderr, " termproc \"%s\"\n", empty (ct -> c_termproc)); | 1949 fprintf (stderr, " termproc \"%s\"\n", empty (ct -> c_termproc)); |
1950 fprintf (stderr, " storeproc \"%s\"\n", empty (ct -> c_storeproc)); | 1950 fprintf (stderr, " storeproc \"%s\"\n", empty (ct -> c_storeproc)); |
1951 | 1951 |
1952 if (ct -> c_celine) | 1952 if (ct -> c_celine) |
1953 fprintf (stderr, " %s:%s", ENCODING_FIELD, ct -> c_celine); | 1953 fprintf (stderr, " %s:%s", ENCODING_FIELD, ct -> c_celine); |
1954 fprintf (stderr, " encoding 0x%x params 0x%x\n", | 1954 fprintf (stderr, " encoding 0x%lx params 0x%lx\n", |
1955 ct -> c_encoding, ct -> c_ceparams); | 1955 (long)ct -> c_encoding, (long)ct -> c_ceparams); |
1956 | 1956 |
1957 if (ct -> c_id) | 1957 if (ct -> c_id) |
1958 fprintf (stderr, " %s:%s", ID_FIELD, ct -> c_id); | 1958 fprintf (stderr, " %s:%s", ID_FIELD, ct -> c_id); |
1959 if (ct -> c_descr) { | 1959 if (ct -> c_descr) { |
1960 #ifdef JAPAN | 1960 #ifdef JAPAN |
1963 #else /* JAPAN */ | 1963 #else /* JAPAN */ |
1964 fprintf (stderr, " %s:%s", DESCR_FIELD, ct -> c_descr); | 1964 fprintf (stderr, " %s:%s", DESCR_FIELD, ct -> c_descr); |
1965 #endif /* JAPAN */ | 1965 #endif /* JAPAN */ |
1966 } | 1966 } |
1967 | 1967 |
1968 fprintf (stderr, " fp 0x%x file \"%s\" begin %d end %d\n", | 1968 fprintf (stderr, " fp 0x%lx file \"%s\" begin %d end %d\n", |
1969 ct -> c_fp, empty (ct -> c_file), ct -> c_begin, ct -> c_end); | 1969 (long)ct -> c_fp, empty (ct -> c_file), ct -> c_begin, ct -> c_end); |
1970 | 1970 |
1971 if (ct -> c_celistfnx) | 1971 if (ct -> c_celistfnx) |
1972 (void) (*ct -> c_celistfnx) (ct); | 1972 (void) (*ct -> c_celistfnx) (ct); |
1973 | 1973 |
1974 return OK; | 1974 return OK; |
4689 register CT ct; | 4689 register CT ct; |
4690 { | 4690 { |
4691 register struct cefile *ce = (struct cefile *) ct -> c_ceparams; | 4691 register struct cefile *ce = (struct cefile *) ct -> c_ceparams; |
4692 | 4692 |
4693 if (ce) | 4693 if (ce) |
4694 fprintf (stderr, " decoded fp 0x%x file \"%s\"\n", ce -> ce_fp, | 4694 fprintf (stderr, " decoded fp 0x%lx file \"%s\"\n", (long)ce -> ce_fp, |
4695 ce -> ce_file ? ce -> ce_file : ""); | 4695 ce -> ce_file ? ce -> ce_file : ""); |
4696 | 4696 |
4697 return OK; | 4697 return OK; |
4698 } | 4698 } |
4699 | 4699 |
4899 if (skip | 4899 if (skip |
4900 || (*cp & 0x80) | 4900 || (*cp & 0x80) |
4901 || (value = b642nib[*cp & 0x7f]) > 0x3f) { | 4901 || (value = b642nib[*cp & 0x7f]) > 0x3f) { |
4902 if (debugsw) | 4902 if (debugsw) |
4903 fprintf (stderr, | 4903 fprintf (stderr, |
4904 "*cp=0x%x pos=%ld skip=%d\n", *cp, | 4904 "*cp=0x%lx pos=%ld skip=%d\n", (long)*cp, |
4905 (long) lseek (fd, (off_t)0, 1) - (ep - cp), | 4905 (long) lseek (fd, (off_t)0, 1) - (ep - cp), |
4906 skip); | 4906 skip); |
4907 content_error (NULLCP, ct, | 4907 content_error (NULLCP, ct, |
4908 "invalid BASE64 encoding -- continuing"); | 4908 "invalid BASE64 encoding -- continuing"); |
4909 continue; | 4909 continue; |
5150 dp = "expecting character in range [!..~]"; | 5150 dp = "expecting character in range [!..~]"; |
5151 | 5151 |
5152 invalid_encoding: ; | 5152 invalid_encoding: ; |
5153 i = strlen (invo_name) + 2; | 5153 i = strlen (invo_name) + 2; |
5154 content_error (NULLCP, ct, | 5154 content_error (NULLCP, ct, |
5155 "invalid QUOTED-PRINTABLE encoding -- %s,\n%*.*sbut got char 0x%x", | 5155 "invalid QUOTED-PRINTABLE encoding -- %s,\n%*.*sbut got char 0x%lx", |
5156 dp, i, i, "", *cp); | 5156 dp, i, i, "", *cp); |
5157 goto clean_up; | 5157 goto clean_up; |
5158 } | 5158 } |
5159 /* and fall...*/ | 5159 /* and fall...*/ |
5160 case ' ': | 5160 case ' ': |
6052 } | 6052 } |
6053 else | 6053 else |
6054 if (partno > 0xff) | 6054 if (partno > 0xff) |
6055 clock++, partno = 0; | 6055 clock++, partno = 0; |
6056 | 6056 |
6057 (void) sprintf (mapname, "%08x%04x%02x", clock & 0xffffffff, | 6057 (void) sprintf (mapname, "%08lx%04x%02x", (long)clock /*0xffffffff*/ |
6058 pid & 0xffff, partno++ & 0xff); | 6058 pid & 0xffff, partno++ & 0xff); |
6059 if (debugsw) | 6059 if (debugsw) |
6060 fprintf (stderr, "creating mapping %s -> %s\n", mapname, id); | 6060 fprintf (stderr, "creating mapping %s -> %s\n", mapname, id); |
6061 | 6061 |
6062 (void) make_intermediates (mapfile); | 6062 (void) make_intermediates (mapfile); |
7924 invalid_digest: ; | 7924 invalid_digest: ; |
7925 if (debugsw) { | 7925 if (debugsw) { |
7926 while (*cp) | 7926 while (*cp) |
7927 cp++; | 7927 cp++; |
7928 fprintf (stderr, "invalid MD5 digest (got %d octets)\n", | 7928 fprintf (stderr, "invalid MD5 digest (got %d octets)\n", |
7929 cp - bp); | 7929 (int)(cp - bp)); |
7930 } | 7930 } |
7931 | 7931 |
7932 return NOTOK; | 7932 return NOTOK; |
7933 } | 7933 } |
7934 | 7934 |