| 1 |
/* EJG - 02-Jul-1996 */ |
| 2 |
/* fix processing of filter qualifier */ |
| 3 |
/* add secure qualifier */ |
| 4 |
/* add oddpages qualifier */ |
| 5 |
/* add evenpages qualifier */ |
| 6 |
/* set sendcontrold only if qualifier present, not if merely negated */ |
| 7 |
/* check for setting or resetting disablecomments was cli$_negated in both cases - fix */ |
| 8 |
/* add downloadps (as PK) fonts qualifier */ |
| 9 |
/* add hyperps qualifier */ |
| 10 |
/* EJG - 07-Jul-1996 */ |
| 11 |
/* test for INC_COM was looking for negated in both cases, so fixed */ |
| 12 |
#ifdef __GNUC__ |
| 13 |
#include "ssdef.h" |
| 14 |
#else |
| 15 |
#include ssdef |
| 16 |
#endif |
| 17 |
/* this code is included into dvips.c; don't compile it separately. */ |
| 18 |
int vmscli() |
| 19 |
{long int k,scnt; |
| 20 |
int length,status,maxdrift,jext; |
| 21 |
float offset,conversion; |
| 22 |
char *u; |
| 23 |
static char dummy[100],prtr[20]; |
| 24 |
static $DESCRIPTOR(qual1,"copies"); |
| 25 |
static $DESCRIPTOR(qual2,"debug"); |
| 26 |
static $DESCRIPTOR(qual3,"maxdrift"); |
| 27 |
static $DESCRIPTOR(qual4,"filter"); |
| 28 |
static $DESCRIPTOR(qual5,"last"); |
| 29 |
static $DESCRIPTOR(qual6,"manual"); |
| 30 |
static $DESCRIPTOR(qual7,"number"); |
| 31 |
static $DESCRIPTOR(qual8,"output"); |
| 32 |
static $DESCRIPTOR(qual9,"start"); |
| 33 |
static $DESCRIPTOR(qual10,"quiet"); |
| 34 |
static $DESCRIPTOR(qual11,"reverse"); |
| 35 |
static $DESCRIPTOR(qual12,"sav_res"); |
| 36 |
static $DESCRIPTOR(qual13,"mode"); |
| 37 |
static $DESCRIPTOR(qual14,"magnification"); |
| 38 |
static $DESCRIPTOR(qual15,"collate"); |
| 39 |
static $DESCRIPTOR(qual16,"dpi"); |
| 40 |
static $DESCRIPTOR(qual17,"ctrld"); |
| 41 |
static $DESCRIPTOR(qual18,"inc_com"); |
| 42 |
static $DESCRIPTOR(qual19,"comment"); |
| 43 |
static $DESCRIPTOR(qual20,"vm_save"); |
| 44 |
static $DESCRIPTOR(qual21,"h_dpi"); |
| 45 |
static $DESCRIPTOR(qual22,"v_dpi"); |
| 46 |
static $DESCRIPTOR(qual23,"compress"); |
| 47 |
static $DESCRIPTOR(qual24,"printer"); |
| 48 |
static $DESCRIPTOR(qual25,"header"); |
| 49 |
static $DESCRIPTOR(qual26,"absolute"); |
| 50 |
static $DESCRIPTOR(qual27,"epsf"); |
| 51 |
static $DESCRIPTOR(qual28,"prescan"); |
| 52 |
static $DESCRIPTOR(qual29,"pagecopies"); |
| 53 |
static $DESCRIPTOR(qual30,"separate"); |
| 54 |
static $DESCRIPTOR(qual31,"cropmarks"); |
| 55 |
static $DESCRIPTOR(qual32,"sec_size"); |
| 56 |
static $DESCRIPTOR(qual33,"help"); |
| 57 |
static $DESCRIPTOR(qual34,"makefont"); |
| 58 |
static $DESCRIPTOR(qual35,"psize"); |
| 59 |
static $DESCRIPTOR(qual36,"poffset"); |
| 60 |
static $DESCRIPTOR(qual37,"secure"); /* EJG 02-Jul-1996 */ |
| 61 |
static $DESCRIPTOR(qual38,"oddpages"); /* EJG 02-Jul-1996 */ |
| 62 |
static $DESCRIPTOR(qual39,"evenpages"); /* EJG 02-Jul-1996 */ |
| 63 |
static $DESCRIPTOR(qual40,"downloadps"); /* EJG 02-Jul-1996 */ |
| 64 |
static $DESCRIPTOR(qual41,"hyperps"); /* EJG 02-Jul-1996 */ |
| 65 |
static $DESCRIPTOR(dumdum,dummy); |
| 66 |
static $DESCRIPTOR(dvi_file,"dvifile"); |
| 67 |
static $DESCRIPTOR(input_file,infnme); |
| 68 |
scnt=0; |
| 69 |
status = cli$present(&dvi_file); |
| 70 |
|
| 71 |
if(status == CLI$_PRESENT) |
| 72 |
{status = cli$get_value(&dvi_file,&input_file,&jext); |
| 73 |
length=0; |
| 74 |
for(k=0;k<252;k++) |
| 75 |
{ if(infnme[k] == ':' || infnme[k] == ']') |
| 76 |
scnt=k+1; |
| 77 |
} |
| 78 |
for(k=scnt;k<252;k++) |
| 79 |
{if(infnme[k]=='.') |
| 80 |
{length=k; |
| 81 |
jext=k; |
| 82 |
} |
| 83 |
else |
| 84 |
{if(infnme[k]=='/' || infnme[k]==' ' || infnme[k]=='\0') |
| 85 |
infnme[k]='\0'; |
| 86 |
} |
| 87 |
} |
| 88 |
if(length==0) |
| 89 |
{jext= strlen(infnme); |
| 90 |
strcat(infnme,".DVI");} |
| 91 |
|
| 92 |
iname = &infnme[0] ; |
| 93 |
length = 0; /* Initialize length...VAX C bug? */ |
| 94 |
|
| 95 |
} |
| 96 |
status = cli$present(&qual1); |
| 97 |
|
| 98 |
if(status == CLI$_PRESENT | status == CLI$_DEFAULTED) |
| 99 |
{status = cli$get_value(&qual1,&dumdum,&length); |
| 100 |
|
| 101 |
if(sscanf(&dummy[0],"%d",&numcopies) == 0) |
| 102 |
error("!Bad copies option"); |
| 103 |
} |
| 104 |
#ifdef DEBUG |
| 105 |
status = cli$present(&qual2); |
| 106 |
|
| 107 |
if(status == CLI$_PRESENT) |
| 108 |
{ |
| 109 |
status = cli$get_value(&qual2,&dumdum,&length); |
| 110 |
|
| 111 |
if(sscanf(&dummy[0],"%d",&debug_flag) == 0) |
| 112 |
error("!Bad debug option"); |
| 113 |
} |
| 114 |
#else |
| 115 |
error("not compiled in debug mode"); |
| 116 |
#endif |
| 117 |
status = cli$present(&qual3); |
| 118 |
|
| 119 |
if(status == CLI$_PRESENT) |
| 120 |
{status = cli$get_value(&qual3,&dumdum,&length); |
| 121 |
|
| 122 |
if(sscanf(&dummy[0],"%d",&maxdrift) == 0 ||maxdrift <0) |
| 123 |
error("bad maxdrift option"); |
| 124 |
vmaxdrift=maxdrift; |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
status = cli$present(&qual5); |
| 129 |
|
| 130 |
if(status == CLI$_PRESENT) |
| 131 |
{status = cli$get_value(&qual5,&dumdum,&length); |
| 132 |
|
| 133 |
#ifdef SHORTINT |
| 134 |
switch(sscanf(&dummy[0], "%ld.%ld", &lastpage, &lastseq)) { |
| 135 |
#else /* ~SHORTINT */ |
| 136 |
switch(sscanf(&dummy[0], "%ld.%ld", &lastpage, &lastseq)) { |
| 137 |
#endif /* ~SHORTINT */ |
| 138 |
case 1: lastseq = 0 ; |
| 139 |
case 2: break ; |
| 140 |
default: |
| 141 |
error("! Bad last page option.") ; |
| 142 |
} |
| 143 |
notlast = 1 ; |
| 144 |
} |
| 145 |
status = cli$present(&qual6); |
| 146 |
|
| 147 |
if(status == CLI$_PRESENT) |
| 148 |
manualfeed=1; |
| 149 |
else |
| 150 |
if(status == CLI$_NEGATED) |
| 151 |
manualfeed=0; |
| 152 |
|
| 153 |
status = cli$present(&qual7); |
| 154 |
if(status == CLI$_PRESENT) |
| 155 |
{status = cli$get_value(&qual7,&dumdum,&length); |
| 156 |
#ifdef SHORTINT |
| 157 |
if (sscanf(&dummy[0], "%ld", &maxpages)==0) |
| 158 |
#else /* ~SHORTINT */ |
| 159 |
if (sscanf(&dummy[0], "%d", &maxpages)==0) |
| 160 |
#endif /* ~SHORTINT */ |
| 161 |
error("! Bad number of pages option.") ; |
| 162 |
} |
| 163 |
|
| 164 |
status = cli$present(&qual8); |
| 165 |
if(status == CLI$_PRESENT) |
| 166 |
{status = cli$get_value(&qual8,&dumdum,&length); |
| 167 |
sscanf(&dummy[0],"%s",ofnme); |
| 168 |
} |
| 169 |
else |
| 170 |
{for(k=scnt;k<jext;k++)ofnme[k-scnt]=infnme[k]; |
| 171 |
strcat(ofnme,".PS");} |
| 172 |
oname = &ofnme[0] ; |
| 173 |
|
| 174 |
status = cli$present(&qual4); |
| 175 |
|
| 176 |
if(status == CLI$_PRESENT) |
| 177 |
{oname=""; |
| 178 |
filter=1; /* EJG 02-Jul-1996 */ |
| 179 |
noenv=(1==1); |
| 180 |
} |
| 181 |
else /* EJG 02-Jul-1996 */ |
| 182 |
filter=0; /* EJG 02-Jul-1996 */ |
| 183 |
|
| 184 |
status = cli$present(&qual9); |
| 185 |
if(status == CLI$_PRESENT) |
| 186 |
{status = cli$get_value(&qual9,&dumdum,&length); |
| 187 |
#ifdef SHORTINT |
| 188 |
switch(sscanf(&dummy[0], "%ld.%ld", &firstpage, &firstseq)) { |
| 189 |
#else /* ~SHORTINT */ |
| 190 |
switch(sscanf(&dummy[0], "%ld.%ld", &firstpage, &firstseq)) { |
| 191 |
#endif /* ~SHORTINT */ |
| 192 |
case 1: firstseq = 0 ; |
| 193 |
case 2: break ; |
| 194 |
default: |
| 195 |
error("! Bad first page option.") ; |
| 196 |
} |
| 197 |
notfirst = 1 ; |
| 198 |
} |
| 199 |
|
| 200 |
status = cli$present(&qual10); |
| 201 |
|
| 202 |
if(status == CLI$_PRESENT) |
| 203 |
quiet=(1==1); |
| 204 |
else |
| 205 |
if(status == CLI$_NEGATED) |
| 206 |
quiet=(1==0); |
| 207 |
|
| 208 |
status = cli$present(&qual11); |
| 209 |
|
| 210 |
if(status == CLI$_PRESENT) |
| 211 |
reverse=1; |
| 212 |
else |
| 213 |
if(status == CLI$_NEGATED) |
| 214 |
reverse=0; |
| 215 |
|
| 216 |
status = cli$present(&qual12); |
| 217 |
|
| 218 |
if(status == CLI$_PRESENT) |
| 219 |
safetyenclose=1; |
| 220 |
else |
| 221 |
if(status == CLI$_NEGATED) |
| 222 |
safetyenclose=0; |
| 223 |
|
| 224 |
status = cli$present(&qual13); |
| 225 |
if(status == CLI$_PRESENT | status == CLI$_DEFAULTED) |
| 226 |
{status = cli$get_value(&qual13,&dumdum,&length); |
| 227 |
sscanf(&dummy[0],"%s",pap); |
| 228 |
if (strcmp(&pap[0], "landscape") == 0) |
| 229 |
{ if (hpapersize || vpapersize) |
| 230 |
error( "both landscape and papersize specified; ignoring landscape") ; |
| 231 |
else |
| 232 |
landscape = 1 ; |
| 233 |
/* The following lines have been added by G.Bonacci */ |
| 234 |
if ((status=cli$get_value(&qual13,&dumdum,&length))==1) |
| 235 |
{ |
| 236 |
sscanf(&dummy[0],"%s",pap); |
| 237 |
|
| 238 |
paperfmt = &pap[0] ; |
| 239 |
} |
| 240 |
/* end G.Bonacci 20.3.92 */ |
| 241 |
} |
| 242 |
else |
| 243 |
paperfmt = &pap[0] ; |
| 244 |
} |
| 245 |
|
| 246 |
status = cli$present(&qual14); |
| 247 |
|
| 248 |
if(status == CLI$_PRESENT) |
| 249 |
{status = cli$get_value(&qual14,&dumdum,&length); |
| 250 |
|
| 251 |
if(sscanf(&dummy[0],"%d",&mag) == 0 || mag < 10 || mag >100000) |
| 252 |
error("!Bad magnification parameter."); |
| 253 |
overridemag=1; |
| 254 |
} |
| 255 |
status = cli$present(&qual15); |
| 256 |
|
| 257 |
if(status == CLI$_PRESENT | status == CLI$_DEFAULTED) |
| 258 |
{status = cli$get_value(&qual15,&dumdum,&length); |
| 259 |
|
| 260 |
if(sscanf(&dummy[0],"%d",&collatedcopies) == 0) |
| 261 |
error("!Bad number of collated copies"); |
| 262 |
} |
| 263 |
status = cli$present(&qual16); |
| 264 |
|
| 265 |
if(status == CLI$_PRESENT | status == CLI$_DEFAULTED) |
| 266 |
{status = cli$get_value(&qual16,&dumdum,&length); |
| 267 |
|
| 268 |
if(sscanf(&dummy[0],"%d",&actualdpi) == 0 || |
| 269 |
actualdpi < 10 || actualdpi >10000) |
| 270 |
error("!Bad dpi parameter."); |
| 271 |
vactualdpi=actualdpi; |
| 272 |
} |
| 273 |
|
| 274 |
status = cli$present(&qual17); |
| 275 |
|
| 276 |
if(status == CLI$_PRESENT) /* EJG 02-Jul-1996 */ |
| 277 |
sendcontrolD =1; |
| 278 |
else |
| 279 |
if(status == CLI$_NEGATED | status==CLI$_DEFAULTED) /* EJG 02-Jul-1996 */ |
| 280 |
sendcontrolD =0; |
| 281 |
|
| 282 |
status = cli$present(&qual18); |
| 283 |
|
| 284 |
if(status == CLI$_PRESENT) /* EJG 07-Jul-1996 */ |
| 285 |
removecomments =0; |
| 286 |
else |
| 287 |
if(status == CLI$_NEGATED) |
| 288 |
removecomments =1; |
| 289 |
|
| 290 |
status = cli$present(&qual19); |
| 291 |
|
| 292 |
if(status == CLI$_PRESENT) /* EJG 02-JUL-1996 */ |
| 293 |
disablecomments = 0; |
| 294 |
else |
| 295 |
if(status == CLI$_NEGATED) |
| 296 |
disablecomments = 1; |
| 297 |
|
| 298 |
status = cli$present(&qual20); |
| 299 |
|
| 300 |
if(status == CLI$_PRESENT) |
| 301 |
nosmallchars=1; |
| 302 |
else |
| 303 |
if(status == CLI$_NEGATED) |
| 304 |
nosmallchars=0; |
| 305 |
|
| 306 |
status = cli$present(&qual21); |
| 307 |
|
| 308 |
if(status == CLI$_PRESENT) |
| 309 |
{status = cli$get_value(&qual21,&dumdum,&length); |
| 310 |
|
| 311 |
if(sscanf(&dummy[0],"%d",&actualdpi) == 0 || |
| 312 |
actualdpi < 10 || actualdpi >10000) |
| 313 |
error("!Bad dpi parameter in X."); |
| 314 |
} |
| 315 |
|
| 316 |
status = cli$present(&qual22); |
| 317 |
|
| 318 |
if(status == CLI$_PRESENT) |
| 319 |
{status = cli$get_value(&qual22,&dumdum,&length); |
| 320 |
|
| 321 |
if(sscanf(&dummy[0],"%d",&vactualdpi) == 0 || |
| 322 |
vactualdpi < 10 || vactualdpi >10000) |
| 323 |
error("!Bad dpi parameter in Y."); |
| 324 |
} |
| 325 |
|
| 326 |
status = cli$present(&qual23); |
| 327 |
|
| 328 |
if(status == CLI$_PRESENT) |
| 329 |
compressed=1; |
| 330 |
else |
| 331 |
if(status == CLI$_NEGATED) |
| 332 |
compressed=0; |
| 333 |
|
| 334 |
status = cli$present(&qual24); |
| 335 |
if(status == CLI$_PRESENT) |
| 336 |
{status = cli$get_value(&qual24,&dumdum,&length); |
| 337 |
sscanf(&dummy[0],"%s",prtr); |
| 338 |
u = &dummy[0] ; |
| 339 |
strcpy(u,"config."); |
| 340 |
strcat(u,&prtr[0]); |
| 341 |
getdefaults(""); |
| 342 |
noenv=1; |
| 343 |
getdefaults(u); |
| 344 |
} |
| 345 |
|
| 346 |
status = cli$present(&qual25); |
| 347 |
if(status == CLI$_PRESENT) { |
| 348 |
while (status != SS$_NORMAL) { |
| 349 |
status = cli$get_value(&qual25,&dumdum,&length); |
| 350 |
dummy[length] = '\0'; |
| 351 |
if (strcmp(dummy, "-") == 0) |
| 352 |
headers_off = 1; |
| 353 |
else |
| 354 |
(void)add_header(dummy) ; |
| 355 |
} |
| 356 |
} |
| 357 |
else { |
| 358 |
if(status == CLI$_NEGATED) |
| 359 |
headers_off = 1; |
| 360 |
} |
| 361 |
|
| 362 |
status = cli$present(&qual26); |
| 363 |
if(status == CLI$_PRESENT) abspage = 1; |
| 364 |
|
| 365 |
status = cli$present(&qual27); |
| 366 |
if(status == CLI$_PRESENT | status==CLI$_DEFAULTED) tryepsf = 1; |
| 367 |
else |
| 368 |
if(status == CLI$_NEGATED) tryepsf = 0; |
| 369 |
|
| 370 |
status = cli$present(&qual28); |
| 371 |
if(status == CLI$_PRESENT | status==CLI$_DEFAULTED) dopprescan = 1; |
| 372 |
else |
| 373 |
if(status == CLI$_NEGATED) dopprescan = 0; |
| 374 |
|
| 375 |
status = cli$present(&qual29); |
| 376 |
|
| 377 |
if(status == CLI$_PRESENT | status == CLI$_DEFAULTED) |
| 378 |
{status = cli$get_value(&qual29,&dumdum,&length); |
| 379 |
|
| 380 |
if(sscanf(&dummy[0],"%d",&pagecopies) == 0) |
| 381 |
error("!Bad number of page copies option /PAGECOPIES"); |
| 382 |
if (pagecopies < 1 || pagecopies > 1000) |
| 383 |
error("! can only print one to a thousand page copies") ; |
| 384 |
} |
| 385 |
|
| 386 |
status = cli$present(&qual30); |
| 387 |
if(status == CLI$_PRESENT | status==CLI$_DEFAULTED) sepfiles = 1; |
| 388 |
else |
| 389 |
if(status == CLI$_NEGATED) sepfiles = 0; |
| 390 |
|
| 391 |
status = cli$present(&qual31); |
| 392 |
if(status == CLI$_PRESENT | status==CLI$_DEFAULTED) cropmarks = 1; |
| 393 |
else |
| 394 |
if(status == CLI$_NEGATED) cropmarks = 0; |
| 395 |
|
| 396 |
status = cli$present(&qual32); |
| 397 |
if(status == CLI$_PRESENT) |
| 398 |
{status = cli$get_value(&qual32,&dumdum,&length); |
| 399 |
#ifdef SHORTINT |
| 400 |
if (sscanf(&dummy[0], "%ld", &maxsecsize)==0) |
| 401 |
#else /* ~SHORTINT */ |
| 402 |
if (sscanf(&dummy[0], "%d", &maxsecsize)==0) |
| 403 |
#endif /* ~SHORTINT */ |
| 404 |
error("! Bad section size arg (/SEC_SIZE).") ; |
| 405 |
} |
| 406 |
|
| 407 |
status = cli$present(&qual33); |
| 408 |
if(status == CLI$_PRESENT) |
| 409 |
{ (void)fprintf(stderr, banner) ; |
| 410 |
help() ; |
| 411 |
} |
| 412 |
|
| 413 |
status = cli$present(&qual34); |
| 414 |
if(status == CLI$_NEGATED) dontmakefont = 1; |
| 415 |
/*----------------------------------------------------------------------- |
| 416 |
* Currently one uses /PSIZE="5mm,10mm" This way CASE is preserved |
| 417 |
* Should I convert the PSIZE to allow a LIST => /PSIZE=(5mm,10mm) and |
| 418 |
* convert the case back to lowercase in here. |
| 419 |
*-----------------------------------------------------------------------*/ |
| 420 |
status = cli$present(&qual35); |
| 421 |
if(status == CLI$_PRESENT) { |
| 422 |
status = cli$get_value(&qual35,&dumdum,&length); |
| 423 |
dummy[length] = '\0'; |
| 424 |
handlepapersize(&dummy[0], &hpapersize, &vpapersize) ; |
| 425 |
if (landscape) { |
| 426 |
error("both landscape and papersize specified; ignoring landscape") ; |
| 427 |
landscape = 0 ; |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
status = cli$present(&qual36); |
| 432 |
if(status == CLI$_PRESENT) { |
| 433 |
status = cli$get_value(&qual36,&dumdum,&length); |
| 434 |
dummy[length] = '\0'; |
| 435 |
handlepapersize(&dummy[0], &hoff, &voff) ; |
| 436 |
} |
| 437 |
|
| 438 |
status = cli$present(&qual37); /* EJG 02-Jul-1996 */ |
| 439 |
if(status == CLI$_PRESENT) secure = 1; /* EJG 02-Jul-1996 */ |
| 440 |
else /* EJG 02-Jul-1996 */ |
| 441 |
if(status == CLI$_NEGATED | status == CLI$_DEFAULTED) secure = 0; /* EJG 02-Jul-1996 */ |
| 442 |
|
| 443 |
status = cli$present(&qual38); /* EJG 02-Jul-1996 */ |
| 444 |
if(status == CLI$_PRESENT) oddpages = 1; /* EJG 02-Jul-1996 */ |
| 445 |
else /* EJG 02-Jul-1996 */ |
| 446 |
if(status == CLI$_NEGATED | status == CLI$_DEFAULTED) oddpages = 0; /* EJG 02-Jul-1996 */ |
| 447 |
|
| 448 |
status = cli$present(&qual39); /* EJG 02-Jul-1996 */ |
| 449 |
if(status == CLI$_PRESENT) evenpages = 1; /* EJG 02-Jul-1996 */ |
| 450 |
else /* EJG 02-Jul-1996 */ |
| 451 |
if(status == CLI$_NEGATED | status == CLI$_DEFAULTED) evenpages = 0; /* EJG 02-Jul-1996 */ |
| 452 |
|
| 453 |
status = cli$present(&qual40); /* EJG 02-Jul-1996 */ |
| 454 |
if(status == CLI$_PRESENT) downloadpspk = 1; /* EJG 02-Jul-1996 */ |
| 455 |
else /* EJG 02-Jul-1996 */ |
| 456 |
if(status == CLI$_NEGATED | status == CLI$_DEFAULTED) downloadpspk = 0; /* EJG 02-Jul-1996 */ |
| 457 |
|
| 458 |
#ifdef HPS /* EJG 02-Jul-1996 */ |
| 459 |
|
| 460 |
status = cli$present(&qual41); /* EJG 02-Jul-1996 */ |
| 461 |
if(status == CLI$_PRESENT) HPS_FLAG = 1; /* EJG 02-Jul-1996 */ |
| 462 |
else /* EJG 02-Jul-1996 */ |
| 463 |
if(status == CLI$_NEGATED | status == CLI$_DEFAULTED) HPS_FLAG = 0; /* EJG 02-Jul-1996 */ |
| 464 |
#endif /* EJG 02-Jul-1996 */ |
| 465 |
|
| 466 |
} |