LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 * t6.c | 2 * t6.c |
3 *· | 3 *· |
4 * width functions, sizes and fonts | 4 * width functions, sizes and fonts |
5 */ | 5 */ |
6 | 6 |
7 #include "tdef.h" | 7 #include "tdef.h" |
8 #include "fns.h" | 8 #include "fns.h" |
9 #include "ext.h" | 9 #include "ext.h" |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 /* these next two functions ought to be the same in troff and nroff, */ | 213 /* these next two functions ought to be the same in troff and nroff, */ |
214 /* but the data structures they search are different. */ | 214 /* but the data structures they search are different. */ |
215 /* silly historical problem. */ | 215 /* silly historical problem. */ |
216 | 216 |
217 | 217 |
218 Tchar t_setch(int c) | 218 Tchar t_setch(int c) |
219 { | 219 { |
| 220 #ifndef UNICODE |
220 int j; | 221 int j; |
| 222 #endif |
221 char temp[50]; | 223 char temp[50]; |
222 char *s; | 224 char *s; |
223 | 225 |
| 226 #ifndef UNICODE |
224 j = 0; | 227 j = 0; |
| 228 #endif |
225 s = temp; | 229 s = temp; |
226 if (c == '(') { /* \(xx */ | 230 if (c == '(') { /* \(xx */ |
227 if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0) | 231 if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0) |
228 return(0); | 232 return(0); |
229 } else { /* \C'...' */ | 233 } else { /* \C'...' */ |
230 c = getach(); | 234 c = getach(); |
231 while ((*s = getach()) != c && *s != 0 && s < temp + sizeof(temp
) - 1) | 235 while ((*s = getach()) != c && *s != 0 && s < temp + sizeof(temp
) - 1) |
232 s++; | 236 s++; |
233 } | 237 } |
234 *s = '\0'; | 238 *s = '\0'; |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 t = (char *) malloc(strlen(s) + 1); | 708 t = (char *) malloc(strlen(s) + 1); |
705 if (t == NULL) | 709 if (t == NULL) |
706 ERROR "out of space in strdupl(%s)", s FATAL; | 710 ERROR "out of space in strdupl(%s)", s FATAL; |
707 strcpy(t, s); | 711 strcpy(t, s); |
708 return t; | 712 return t; |
709 } | 713 } |
710 | 714 |
711 int | 715 int |
712 setfp(int pos, int f, char *truename, int print) /* mount font f at posit
ion pos[0...nfonts] */ | 716 setfp(int pos, int f, char *truename, int print) /* mount font f at posit
ion pos[0...nfonts] */ |
713 { | 717 { |
714 » char pathname[NS], shortname[NS], *sl; | 718 » char pathname[NS], shortname[NS]; |
715 | 719 |
716 » sl = (char*)0; | |
717 zapwcache(0); | 720 zapwcache(0); |
718 if (truename) | 721 if (truename) |
719 strcpy(shortname, truename); | 722 strcpy(shortname, truename); |
720 else | 723 else |
721 strcpy(shortname, (char *) unpair(f)); | 724 strcpy(shortname, (char *) unpair(f)); |
722 if (truename && strrchr(truename, '/')) { /* .fp 1 R dir/file: use
verbatim */ | 725 if (truename && strrchr(truename, '/')) { /* .fp 1 R dir/file: use
verbatim */ |
723 sprintf(pathname, "%s", truename); | 726 sprintf(pathname, "%s", truename); |
724 if (fonts[pos].truename) | 727 if (fonts[pos].truename) |
725 free(fonts[pos].truename); | 728 free(fonts[pos].truename); |
726 fonts[pos].truename = strdupl(truename); | 729 fonts[pos].truename = strdupl(truename); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 | 883 |
881 Uchar *unpair(int i) | 884 Uchar *unpair(int i) |
882 { | 885 { |
883 static Uchar name[3]; | 886 static Uchar name[3]; |
884 | 887 |
885 name[0] = i & SHORTMASK; | 888 name[0] = i & SHORTMASK; |
886 name[1] = (i >> SHORT) & SHORTMASK; | 889 name[1] = (i >> SHORT) & SHORTMASK; |
887 name[2] = 0; | 890 name[2] = 0; |
888 return name; | 891 return name; |
889 } | 892 } |
LEFT | RIGHT |