*
**********************************************************************/
-/* Revised 1999 June 13 to run in DLL form */
-
-#ifdef _WINDOWS
-#define NOCOMM
-#define NOSOUND
-#define NODRIVERS
-#define STRICT
-#include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-#include <setjmp.h>
-
-#ifdef _WINDOWS
-// We must define MYLIBAPI as __declspec(dllexport) before including
-// dvipsone.h, then dvipsone.h will see that we have already
-// defined MYLIBAPI and will not (re)define it as __declspec(dllimport)
-#define MYLIBAPI __declspec(dllexport)
-// #include "dvipsone.h"
-#endif
-
#include "dvipsone.h"
-#ifdef _WINDOWS
-#pragma warning(disable:4100) // unreferenced formal variable
-#endif
-
-#pragma warning(disable:4996)
-#pragma warning(disable:4127) // conditional expression is constant
-
-#pragma hdrstop
-
-#include <io.h> /* for _access */
+#include <io.h> /* for _access */
/* for _findfirst, _findnext, _findclose */
/* #define DEBUGALIAS */
logdo_putsub(ureadtwo(infile));
}
-#ifdef IGNORED
-void logdo_put2(FILE *infile)
-{
- unsigned int c;
- c = ureadtwo(infile);
- if (skipflag == 0) {
-/* if (ff < 0) invalidset((int) c); */
- if (ff == BLANKFONT) invalidset((int) c);
- else if (c < 256) {
-/* if (bRemapControl && c < MAXREMAP) c = remaptable[c]; */
- if (bRemapControl || bRemapFont) {
- if (c < MAXREMAP) c = remaptable[c];
-#if MAXREMAP < 128
- else if (c == 32) c = 195;
- else if (c == 127) c = 196;
-#endif
- }
- else if (bRemapSpace && c <= 32) { /* 1995/Oct/17 */
- if (c == 32) c = 195; /* not 160 */
- else if (c == 13) c = 176; /* 1996/June/4 */
- else if (c == 10) c = 173; /* 1996/June/4 */
- else if (c == 9) c = 170; /* 1996/June/4 */
- else if (c == 0) c = 161;
- }
- currentfont[c] = 1;
- }
- }
-}
-#endif
-
void logdo_put3(FILE *infile)
{
logdo_putsub(ureadthree(infile));
/* returns zero if page is to be printed */ /* non-zero if to be skipped */
-int skipthispage(long pageno)
+int skip_this_page(long pageno)
{
int k;
/* int hitrange=0; */
/* skipflag = 0; */
if (countzeroflag != 0) pageno = counter[0];
else pageno = (long) pagenumber;
- skipflag = skipthispage(pageno); /* figure out if skipped */
+ skipflag = skip_this_page(pageno); /* figure out if skipped */
/* if (beginpage != -LINFINITY && pageno < beginpage) skipflag++;
if (endpage != LINFINITY && pageno > endpage) skipflag++; */
/* following is the logic for two-sided printing */
(void) getc(infile); (void) getc(infile);
}
-void logswitchfont(int fn, FILE *infile) /* switching to other font */
+void log_switch_font(int fn, FILE *infile) /* switching to other font */
{
int c;
ff = fn; /* set state */
/* fn = ureadone(infile); */
fn = getc(infile);
/* if (skipflag == 0) */
- logswitchfont(fn, infile);
+ log_switch_font(fn, infile);
}
void logdo_fnt2(FILE *infile) /* switch fonts */
fn = ureadtwo(infile);
/* if (skipflag == 0) */
if (fn >= MAXFONTNUMBERS) fn = MAXFONTNUMBERS-1;
- logswitchfont((int) fn, infile);
+ log_switch_font((int) fn, infile);
}
void logdo_fntsub(unsigned long fn, FILE *infile) /* switch fonts */
{
/* if (skipflag == 0) */
if (fn >= MAXFONTNUMBERS) fn = MAXFONTNUMBERS-1;
- logswitchfont((int) fn, infile);
+ log_switch_font((int) fn, infile);
}
void logdo_fnt3(FILE *infile) /* switch fonts */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-void getheadername (FILE *infile) /* new version 95/Aug/30 */
+void get_header_name (FILE *infile) /* new version 95/Aug/30 */
{
char fname[FNAMELEN]; /* buffer to get token into */
char *s;
-/* if (gettoken(infile, headerfile, FNAMELEN) == 0) {*/
- if (gettoken(infile, fname, sizeof(fname)) == 0) { /* FNAMELEN */
+/* if (get_token(infile, headerfile, FNAMELEN) == 0) {*/
+ if (get_token(infile, fname, sizeof(fname)) == 0) { /* FNAMELEN */
showline(" Can't find header\n", 1);
errcount(0);
return;
/* get name of file with DSC header comments */ /* only one allowed */
-void getcustomname (FILE *infile)
+void get_custom_name (FILE *infile)
{
/* int n=0; */
errcount(0);
return;
}
-/* if (gettoken(infile, line, MAXLINE) == 0) { */
- if (gettoken(infile, line, sizeof(line)) == 0) { /* MAXLINE */
+/* if (get_token(infile, line, MAXLINE) == 0) { */
+ if (get_token(infile, line, sizeof(line)) == 0) { /* MAXLINE */
showline(" Can't find header\n", 1);
errcount(0);
}
/* accumulate verbatim PS header text for prolog */
-void getheadertext (FILE *infile) /* new 1993/Dec/29 */
+void get_header_text (FILE *infile) /* new 1993/Dec/29 */
{
char *headernew;
char *u;
headernew = realloc (headertext, n);
if (headernew == NULL) {
showline(" Unable to allocate memory\n", 1);
-/* flushspecial(infile); */
+/* flush_special(infile); */
/* errcount(0); */
/* return; */
checkexit(1); /* 1995/July/15 */
/* accumulate command line args for DVIPSONE - passed through DVI file */
-void getcommandspec (FILE *infile) // 99/Sept/6
+void get_command_spec (FILE *infile) // 99/Sept/6
{
char *commandnew;
char *u;
/* accumulate verbatim PS header text for prolog */
-void getcustomtext (FILE *infile) /* new 1995/July/15 */
+void get_custom_text (FILE *infile) /* new 1995/July/15 */
{
int c, n, needpercent=0;
char *customnew;
customnew = realloc (dsccustom, n);
if (customnew == NULL) {
showline(" Unable to allocate memory\n", 1);
-/* flushspecial(infile); */
+/* flush_special(infile); */
/* errcount(0); */
/* return; */
checkexit(1); /* 1995/July/15 */
*u++ = '\n'; *u++ = '\0'; /* terminating linefeed and \0 */
}
-void getbbox (FILE *infile) /* Use for CropBox pdfmark not tested */
+void get_bbox (FILE *infile) /* Use for CropBox pdfmark not tested */
{
/* Right now this is in PS coordinates, should be in TeX coordinates */
- if (gettoken(infile, line, sizeof(line)) != 0) { /* MAXLINE */
+ if (get_token(infile, line, sizeof(line)) != 0) { /* MAXLINE */
sscanf(line, "%d", &BBxll);
}
- if (gettoken(infile, line, sizeof(line)) != 0) { /* MAXLINE */
+ if (get_token(infile, line, sizeof(line)) != 0) { /* MAXLINE */
sscanf(line, "%d", &BByll);
}
- if (gettoken(infile, line, sizeof(line)) != 0) { /* MAXLINE */
+ if (get_token(infile, line, sizeof(line)) != 0) { /* MAXLINE */
sscanf(line, "%d", &BBxur);
}
- if (gettoken(infile, line, sizeof(line)) != 0) { /* MAXLINE */
+ if (get_token(infile, line, sizeof(line)) != 0) { /* MAXLINE */
sscanf(line, "%d", &BByur);
}
}
/* accumulate Keywords for DOCINFO pdfmark */
-void getkeywords (FILE *infile) /* 1996/May/10 */
+void get_keywords (FILE *infile) /* 1996/May/10 */
{
char *keywordsnew;
char *u;
keywordsnew = realloc (keywords, n);
if (keywordsnew == NULL) {
showline(" Unable to allocate memory\n", 1);
-/* flushspecial(infile); */
+/* flush_special(infile); */
/* errcount(0); */
/* return; */
checkexit(1); /* 1995/July/15 */
*u++ = '\0'; /* terminating \0 */
}
-// void getcommonstring (FILE *infile, char *newstring)
-char *getcommonstring (FILE *infile)
+// void get_common_string (FILE *infile, char *newstring)
+char *get_common_string (FILE *infile)
{
char *u;
- char *newstring = malloc ((size_t) (nspecial+1));
+ char *newstring = (char *)malloc ((size_t) (nspecial+1));
if (newstring == NULL) {
showline(" Unable to allocate memory\n", 1);
checkexit(1);
// unadvertized ability to change Creator fieldin DocInfo
-void getcreator (FILE *infile)
+void get_creator (FILE *infile)
{
if (creatorstring != NULL) return; /* ignore all but first */
// creatorstring = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, creatorstring);
- creatorstring = getcommonstring(infile);
+// get_common_string(infile, creatorstring);
+ creatorstring = get_common_string(infile);
}
-void gettitle (FILE *infile)
+void get_title (FILE *infile)
{
if (titlestring != NULL) return; /* ignore all but first */
// titlestring = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, titlestring);
- titlestring = getcommonstring(infile);
+// get_common_string(infile, titlestring);
+ titlestring = get_common_string(infile);
}
-void getsubject (FILE *infile)
+void get_subject (FILE *infile)
{
if (subjectstring != NULL) return; /* ignore all but first */
// subjectstring = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, subjectstring);
- subjectstring = getcommonstring(infile);
+// get_common_string(infile, subjectstring);
+ subjectstring = get_common_string(infile);
}
-void getauthor (FILE *infile)
+void get_author (FILE *infile)
{
if (authorstring != NULL) return; /* ignore all but first */
// authorstring = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, authorstring);
- authorstring = getcommonstring(infile);
+// get_common_string(infile, authorstring);
+ authorstring = get_common_string(infile);
}
void getbase (FILE *infile)
{
if (basestring != NULL) return; /* ignore all but first */
// basestring = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, basestring);
- basestring = getcommonstring(infile);
+// get_common_string(infile, basestring);
+ basestring = get_common_string(infile);
}
-void getpagemode (FILE *infile)
+void get_page_mode (FILE *infile)
{
if (pagemode != NULL) return; /* ignore all but first */
// pagemode = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, pagemode);
- pagemode = getcommonstring(infile);
+// get_common_string(infile, pagemode);
+ pagemode = get_common_string(infile);
}
/* example \special{papersize=5.04in,3.751in} */
-void getpapersize (FILE *infile)
+void get_paper_size (FILE *infile)
{
// if (strcmp(papersize,"") != 0) return; /* ignore all but first */
if (papersize != NULL) return;
// papersize = malloc ((size_t) (nspecial+1));
-// getcommonstring(infile, papersize);
- papersize = getcommonstring(infile);
+// get_common_string(infile, papersize);
+ papersize = get_common_string(infile);
}
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
if (bBackGroundFlag == 0)
{
- flushspecial(infile);
+ flush_special(infile);
return;
}
s = line + strlen(line);
if (c > 0) *s++ = (char) c; /* stick in terminator */
*s = '\0'; /* just in case */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
if (traceflag)
{
if (bIgnoreSpecials)
{
- flushspecial(infile);
+ flush_special(infile);
return;
}
nspecialsav = nspecial; /* 99/Feb/21 */
c = getc(infile); /* peek ahead for ! */
ungetc (c, infile);
if (c == 0 && bFirstNull) { /* is first byte null ? 96/Aug/29 */
- flushspecial(infile);
+ flush_special(infile);
return;
}
if (c == '!') {
/* if (verbatimflag != 0) { */ /* flushed 97/Mar/9 */
c = getc(infile); nspecial--;
- getheadertext(infile);
+ get_header_text(infile);
/* } */
- flushspecial(infile);
+ flush_special(infile);
return;
}
-/* c = getalphatoken(infile, line, MAXLINE); */
- c = getalphatoken(infile, line, sizeof(line)); /* MAXLINE */
+/* c = get_alpha_token(infile, line, MAXLINE); */
+ c = get_alpha_token(infile, line, sizeof(line)); /* MAXLINE */
#ifdef TPIC
/* check whether maybe a TPIC \special */
if (allowtpic != 0 && needtpic == 0 && (c == ' ' || c == 0)) {
}
}
/* check whether a special calling for a header or prolog file */
-/* if(c == '=' && strcmp(line, "header") == 0) getheadername(infile); */
+/* if(c == '=' && strcmp(line, "header") == 0) get_header_name(infile); */
/* Separator is `=' */
if(c == '=') { /* extended 93/Dec/29 */
-/* if (strcmp(line, "header") == 0) getheadername(infile); */
- if (_strcmpi(line, "header") == 0) getheadername(infile);
-/* else if (strcmp(line, "headertext") == 0) getheadertext(infile); */
- else if (_strcmpi(line, "headertext") == 0) getheadertext(infile);
+/* if (strcmp(line, "header") == 0) get_header_name(infile); */
+ if (_strcmpi(line, "header") == 0) get_header_name(infile);
+/* else if (strcmp(line, "headertext") == 0) get_header_text(infile); */
+ else if (_strcmpi(line, "headertext") == 0) get_header_text(infile);
/* following added in 1995 July */
- else if (strcmp(line, "DSCheader") == 0) getcustomname(infile);
- else if (strcmp(line, "DSCtext") == 0) getcustomtext(infile);
- else if (strcmp(line, "papersize") == 0) getpapersize(infile);
- else if (strcmp(line, "DVIPSONE") == 0) getcommandspec(infile);
- else if (strcmp(line, "DVIWindo") == 0) flushspecial(infile);
+ else if (strcmp(line, "DSCheader") == 0) get_custom_name(infile);
+ else if (strcmp(line, "DSCtext") == 0) get_custom_text(infile);
+ else if (strcmp(line, "papersize") == 0) get_paper_size(infile);
+ else if (strcmp(line, "DVIPSONE") == 0) get_command_spec(infile);
+ else if (strcmp(line, "DVIWindo") == 0) flush_special(infile);
/* else complain ??? */
}
/* else if (c == ':' && strcmp(line, "dvitops") == 0) { */
/* Separator is `:' */
else if (c == ':') {
if (strcmp(line, "dvitops") == 0) {
-/* (void) getalphatoken(infile, line, MAXLINE); */
- (void) getalphatoken(infile, line, sizeof(line)); /* MAXLINE */
- if (strcmp(line, "prolog") == 0) getheadername(infile);
+/* (void) get_alpha_token(infile, line, MAXLINE); */
+ (void) get_alpha_token(infile, line, sizeof(line)); /* MAXLINE */
+ if (strcmp(line, "prolog") == 0) get_header_name(infile);
}
else if (strcmp(line, "PDF") == 0) { /* 1996/July/4 */
- c = getalphatoken(infile, line, sizeof(line)); /* MAXLINE */
+ c = get_alpha_token(infile, line, sizeof(line)); /* MAXLINE */
if (c == ' ' || c == '=') {
- if (_strcmpi(line, "Keywords") == 0) getkeywords(infile);
- else if (strcmp(line, "BBox") == 0) getbbox(infile);
- else if (_strcmpi(line, "Creator") == 0) getcreator(infile);
- else if (_strcmpi(line, "Title") == 0) gettitle(infile);
- else if (_strcmpi(line, "Subject") == 0) getsubject(infile);
- else if (_strcmpi(line, "Author") == 0) getauthor(infile);
+ if (_strcmpi(line, "Keywords") == 0) get_keywords(infile);
+ else if (strcmp(line, "BBox") == 0) get_bbox(infile);
+ else if (_strcmpi(line, "Creator") == 0) get_creator(infile);
+ else if (_strcmpi(line, "Title") == 0) get_title(infile);
+ else if (_strcmpi(line, "Subject") == 0) get_subject(infile);
+ else if (_strcmpi(line, "Author") == 0) get_author(infile);
else if (_strcmpi(line, "Base") == 0) getbase(infile);
- else if (_strcmpi(line, "PageMode") == 0) getpagemode(infile);
+ else if (_strcmpi(line, "PageMode") == 0) get_page_mode(infile);
}
}
/* check whether TIFF image inserted re level2 features 96/Dec/20 */
else if (strcmp(line, "insertimage") == 0) bInsertImage++;
}
- flushspecial(infile);
+ flush_special(infile);
}
void logdo_xxxi(FILE *infile, unsigned int n)
}
else if (c >= 171 && c <= 234) { /* switch to font (c - 171) */
fn = (c - 171);
- logswitchfont(fn, fp_in);
+ log_switch_font(fn, fp_in);
}
else {
switch(c) {
*
**********************************************************************/
-/* Revised 1999 June 13 to run in DLL form */
-
-#ifdef _WINDOWS
-#define NOCOMM
-#define NOSOUND
-#define NODRIVERS
-#define STRICT
-#include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-#include <setjmp.h>
-
-#ifdef _WINDOWS
- // We must define MYLIBAPI as __declspec(dllexport) before including
- // dvipsone.h, then dvipsone.h will see that we have already
- // defined MYLIBAPI and will not (re)define it as __declspec(dllimport)
- #define MYLIBAPI __declspec(dllexport)
- // #include "dvipsone.h"
-#endif
-
#include "dvipsone.h"
-#ifdef _WINDOWS
- #pragma warning(disable:4100) // unreferenced formal variable
-#endif
-
-#pragma warning(disable:4996)
-#pragma warning(disable:4127) // conditional expression is constant
-
-#pragma hdrstop
-
-#include <time.h>
-#include <signal.h>
-#include <direct.h> /* for _getcwd(); */
-
-#ifndef _WINDOWS
- #pragma warning(disable:4032) // different type when promoted
- #include <conio.h>
- #pragma warning(default:4032) // different type when promoted
-#endif
-
-#ifdef _WINDOWS
- #pragma message("DLL Version")
-#else
- #pragma message("EXE Version")
-#endif
-
-#ifdef _WINDOWS
-// int (* PScallback) (const char *) = NULL; // callback for PS strings
- int (* PScallback) (const char *, int) = NULL; // callback for PS strings
-#endif
-
#define NEEDATMINI
#define CONTROLBREAK /* handle control break */
/* newmagic is the old hexmagic string with 8 preliminary bytes added */
/* four are the author signature, four are the serial number * REEXEC */
-long serialnumber=0;
-
-#define hexmagic (newmagic+8) /* start of encrypted owner etc */
-
/* now required by packdatetime for PDFmark 95/Feb/25 */
char *months="JanFebMarAprMayJunJulAugSepOctNovDec"; /* 1994/June/8 */
long postposition; /* position of post op in DVI */
int badpathwarn=0; /* warned yet about bad path in search ? */
-#ifdef _WINDOWS
-int usecallbackflag=0; // nonzero -> use callback rather than file output
-#endif
-
-#ifdef ALLOWDEMO
-int bDemoFlag = 0; /* non-zero => DEMO version */
- /* as determined by user string DEMO */
-time_t dtime=0; /* seconds since customized, now global */
-#define oneday (86400) /* one day in seconds */
-#define onemonth (86400 * 31) /* one month in seconds */
-#endif
-
int textures=0; /* non-zero => textures style DVI file */
/* int flipflag=0; */ /* non-zero => flip horizontally */
int makeepsf=0; /* non-zero => output intended as EPS file */
/* added A2 and B3 1994/Dec/10 */
-char *papertypes[] = {
-"letter", "note", "legal", "folio", "ledger", "tabloid", "executive",
-"a2", "a3", "a4", "a5",
-"b3", "b4", "b5", "quarto", ""};
+char *papertypes[] =
+{
+ "letter", "note", "legal", "folio", "ledger", "tabloid", "executive",
+ "a2", "a3", "a4", "a5", "b3", "b4", "b5", "quarto", ""
+};
-double pagewidths[] = { /* in inches */
- 8.5, 8.5, 8.5, 8.5, 11, 11, 7.25,
-420/25.4, 297/25.4, 210/25.4, 148/25.4,
-354/25.4, 250/25.4, 176/25.4, 215/25.4, 1};
+/* in inches */
+double pagewidths[] =
+{
+ 8.5, 8.5, 8.5, 8.5, 11, 11, 7.25,
+ 420/25.4, 297/25.4, 210/25.4, 148/25.4,
+ 354/25.4, 250/25.4, 176/25.4, 215/25.4, 1
+};
-double pageheights[] = { /* in inches */
- 11, 11, 14, 13, 17, 17, 10.5,
-594/25.4, 420/25.4, 297/25.4, 210/25.4,
-500/25.4, 354/25.4, 250/25.4, 275/25.4, 1};
+/* in inches */
+double pageheights[] =
+{
+ 11, 11, 14, 13, 17, 17, 10.5,
+ 594/25.4, 420/25.4, 297/25.4, 210/25.4,
+ 500/25.4, 354/25.4, 250/25.4, 275/25.4, 1
+};
/* `statement' 5 1/2 x 8 1/2 */
//"it under the terms of the GNU General Public License as published by\n"
//"the Free Software Foundation; either version 2 of the License, or\n"
//"(at your option) any later version.\n\n";
-/* #define COPYHASH 8075316 */
-/* #define COPYHASH 12093609 */
-/* #define COPYHASH 12526110 */
-/* #define COPYHASH 12958611 */
-/* #define COPYHASH 8401139 */
-#define COPYHASH 7034257
+
/* char *company="Y&&Y, Inc. USA"; */ /* double percent for Acrobat Info */
/* char *company="Y&Y, Inc. USA"; */ /* 97/Jan/30 */
char *company = "Y&Y, Inc."; /* 97/Apr/29 */
-char *phone = "(978) 371-3286"; /* for Acrobat Info */
char *URL = ""; /* string in binary ... */
char *filenamex=NULL; /* remember full file name here */
char fn_in[FNAMELEN], fn_out[FNAMELEN]; /* 1994/Mar/1 */
-/****************************************************************************/
-
-#ifdef _WINDOWS
-// int ShowLine(char *, int);
-void ShowLine(char *, int);
-#endif
-
-/* Output to screen - stdout or errout - and optionally logfile 99/Apr/23 */
-
-/************************************************************************/
-
void perrormod (char *s)
{
sprintf(logline, "`%s': %s\n", s, strerror(errno));
int useatmini = 1; /* use [Setup] section in `atm.ini' */
/* reset if setup of atm.ini file fails */
-// char *atmini = ""; /* full file name for atm.ini, with path */
char *atmini=NULL; /* full file name for atm.ini, with path */
int useatmreg=1; /* use ATMREG.ATM for %%IncludeFont */
/* reset if setup of ATMREG.ATM file fails */
int usepsfontname=1; /* allow use of PS FontName in DVI TFM */
-// char *szATMRegAtm=""; /* full file name for ATMREG.ATM, with path */
char *szATMRegAtm=NULL; /* full file name for ATMREG.ATM, with path */
int useatmfontsmap=1; /* zero if tried and failed to find atmfonts.map */
-// char *atmfontsmap=""; /* file name and path to ATMFONTS.MAP */
- char *atmfontsmap=NULL; /* file name and path to ATMFONTS.MAP */
-
-// char *atmininame = "atm.ini"; /* name of ini file we are looking for */
+char *atmfontsmap=NULL; /* file name and path to ATMFONTS.MAP */
char *atmsection="[Setup]"; /* ATM.INI section */
void extension (char *fname, char *ext)
{
char *s, *t;
- if ((s = strrchr(fname, '.')) == NULL ||
- ((t = strrchr(fname, '\\')) != NULL && s < t))
+
+ if ((s = strrchr(fname, '.')) == NULL || ((t = strrchr(fname, '\\')) != NULL && s < t))
{
strcat(fname, ".");
strcat(fname, ext);
void forceexten (char *fname, char *ext)
{
char *s, *t;
- if ((s = strrchr(fname, '.')) == NULL ||
- ((t = strrchr(fname, '\\')) != NULL && s < t))
+
+ if ((s = strrchr(fname, '.')) == NULL || ((t = strrchr(fname, '\\')) != NULL && s < t))
{
strcat(fname, ".");
strcat(fname, ext);
}
else
- strcpy(s+1, ext); /* give it default extension */
+ strcpy(s + 1, ext); /* give it default extension */
}
/* remove extension if present */
void showusage (char *program)
{
int k;
- char *s=logline;
+ char *s = logline;
-// abortflag++;
sprintf(s, "%s [-{vrgh}] [-b=<begin>] [-e=<end>]\n"
"[-m=<mag>] [-o=<orient>] [-x=<xoff>] [-y=<yoff>] [-c=<num>]\n"
"[-f=<fontpath>] [-i=<epspath>] [-s=<sub>] [-l=<paper>]\n"
if (! detailflag)
{
- return; // 2000 June 18
+ return;
}
// s += strlen(s);
sprintf(s, ""
switch(c) {
case '?': detailflag = 1; return 0;
case 'q': quietflag++; return 0;
-/* case 'v': verboseflag = (1 - verboseflag); return 0; */
case 'v': changeflag(&verboseflag, toggle, 0); return 0;
-/* case 'V': showflag = (1 - showflag); return 0; */
case 'V': changeflag(&showfontflag, toggle, 0); return 0;
-/* case 'r': reverseflag = (1 - reverseflag); return 0;*/
case 'r': changeflag(&reverseflag, toggle, 0); return 0;
-/* case 'g': oddpageflag = (1 - oddpageflag); return 0;*/
case 'g': changeflag(&oddpageflag, toggle, 0); return 0;
-/* case 'h': evenpageflag = (1 - evenpageflag); */
-/* reverseflag = (1 - reverseflag); return 0; */
case 'h': changeflag(&evenpageflag, toggle, 0);
changeflag(&reverseflag, toggle, 0); return 0;
-/* case 'z': makeepsf = (1 - makeepsf); return 0;*/
case 'z': changeflag(&makeepsf, toggle, 0); return 0;
/* case 'k': forcereside = (1 - forcereside); return 0;*/
case 'k': changeflag(&forcereside, toggle, 0); return 0;
void abortjob (void)
{
-#ifdef _WINDOWS
- showline("ABORTJOB", 1); // debugging only - can't happen
-#endif
cleanup();
checkexit(3);
// return -1;
/* PS letter, note, legal, ledger ? */
/* use table for neatness */
-/* void analpapertype(char *papertype) { */ /* 94/May/6 */
int analpapertype (char *papertype, double *pagewidth, double *pageheight)
{
int k;
// Have to make copy of comma separated headerfile list
// because strtok messes it up, and the list is needed again later
-void prologcomments (char *headerfile, FILE *outfile) /* 1993/Nov/15 */
+void prolog_comments (char *headerfile, FILE *outfile) /* 1993/Nov/15 */
{
char *s;
char filename[MAXLINE]; /* need to work on copy since modify */
for (k = 0; k < prologfileindex; k++) /* 1993/Dec/21 */
{
- prologcomments (prologfile[k], outfile);
+ prolog_comments (prologfile[k], outfile);
}
/* should have version and revision? */
if (headerfile != NULL)
- prologcomments(headerfile, outfile); /* 1993/Nov/15 */
+ prolog_comments(headerfile, outfile); /* 1993/Nov/15 */
if (missing != 0) /* not reliable - may be non-zero yet nothing? */
{
*t = '\0';
}
-/* problem: wants void (__cdecl *)(int); */
-/* gets #define SIG_IGN (void (__cdecl *)(int))1 */
-
#undef SIG_IGN
#define SIG_IGN (void (__cdecl *)(int))1L
if (makeepsf == 0)
{
-/* replaceletter(fn_in, '\\', '/'); */ /* backslash to slash ? */
-/* must avoid backslash in string ... */ /* fn_in */
-/* Note: fn_in may still contain a colon! */
-/* which is not good when jobname is sent back over link */
-/* since assumed syntax of such messages if key: value; */
-/* fprintf(output, "statusdict /jobname\n(%s SN %ld %s ",
- programversion, serialnumber/REEXEC, filename); */
-// fputs("statusdict /jobname\n(DVIPSONE ", output);
PSputs("statusdict /jobname\n(DVIPSONE ", output);
-/* fprintf(output, "0.%d.%d SN %ld ", */
sprintf(logline, "%d.%d.%d ", version, revision, subrevision);
PSputs(logline, output);
-// if (subrevision != 0) fprintf(output, ".%d", subrevision);
-// sprintf(logline, " SN %ld ", serialnumber/REEXEC);
-// PSputs(logline, output);
-// fputs(filename, output);
PSputs(filename, output);
-// putc(' ', output);
PSputc(' ', output);
/* not clear need to really avoid jobname setting in EPS mode... */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-void setupremap (void)
+void setup_remap (void)
{
int k;
#if MAXREMAP > 32
int flag=1;
- setupremap (); /* may as well always do this 95/Oct/15 */
+ setup_remap (); /* may as well always do this 95/Oct/15 */
if (xmagnification == 0.0)
xmagnification = 1.0;
if (expandpageranges() < 0)
return -1;
-// for (k = 0; k < maxranges; k++) { /* install defaults */
-// beginpages[k] = -LINFINITY;
-// endpages[k] = LINFINITY;
-// pagerangeseq[k] = -1; /* 94/March/15 */
-// }
-
prologfileindex = 0; /* 1993/Dec/21 */
readcommands(dvipsonecmd); /* dvipsone.cmd file *first* if any */
*s = '\0';
}
-// debugging checks -- no longer significant
-#ifdef IGNORED
-#ifdef _WINDOWS
- if (outputfile != NULL && strcmp(outputfile, "PASSBACK") != 0)
- {
- if (usecallbackflag)
- {
- sprintf(logline, "INCONSISTENT: -d=%s passback=%d\n", outputfile, usecallbackflag);
- showline(logline, 0);
- }
- }
- else
- {
- if (usecallbackflag == 0)
- {
- sprintf(logline, "INCONSISTENT: -d=%s passback=%d\n",
- (outputfile == NULL) ? "<absent>" : outputfile, usecallbackflag);
- showline(logline, 0);
- }
- }
-#endif
-#endif
-
-#ifdef _WINDOWS
-// May need to do something if -d=PASSBACK specified from DVIWindo ???
- if (outputfile != NULL && strcmp(outputfile, "PASSBACK") == 0)
- {
- if (usecallbackflag == 0)
- {
- outputfile = NULL; // 2000/Feb/14 ???
- }
- }
-#endif
-
/* if output file specified, open only ONCE (for all input files) */
/* also, don't force extension if an extension was specified */
/* also, try and figure out if going direct to a printer */
#endif
}
-////////////////////////////////////////////////////////////////////////////
-
-#ifdef _WINDOWS
-
-// stuff to buffer up PS code to avoid calling too often
-// assumes null terminated strings
-// may want to use both for EXE and DLL version ...
-
-unsigned int psbufpos=0; // index to next available in psbuffer
-
-char psbuffer[PSBUFLEN]=""; // for buffering up PS output
-
-// Modified to pass actual length (rather than null terminate) 2000/Feb/14
-
-void sendpsbuffer (FILE *output)
-{
- unsigned int k;
-
-// if (psbufpos == 0) return;
-// if (output == NULL) return;
- psbuffer[psbufpos] = '\0'; // terminate - just in case
-
- if (usecallbackflag)
- {
- if (PScallback(psbuffer, psbufpos) != 0)
- {
- sprintf(logline, "PScallback failed %s %d", psbuffer, psbufpos);
- showline(logline, 1); // debugging only
- uexit(1);
- }
- }
- else if (output != NULL) // printing to FILE from DLL
- {
- if (strlen(psbuffer) == psbufpos)
- fputs(psbuffer, output); // no embedded nulls
- else
- {
- for (k = 0; k < psbufpos; k++)
- putc(psbuffer[k], output);
- }
- }
- psbufpos = 0; // reset buffer
-// *psbuffer = '\0';
-}
-
-void psputs (char *str, FILE *output)
-{
- int nlen = strlen(str);
-
-// if (PScallback == NULL) return; // sanity check
- if (*str == '\0') // special case clean out buffer
- {
- sendpsbuffer(output);
- return;
- }
-
-// if new stuff won't fit in buffer, clear the buffer first
- if (psbufpos+nlen+2 >= PSBUFLEN)
- sendpsbuffer(output);
-
-// if new stuff won't fit in buffer, send it directly
- if (nlen+2 >= PSBUFLEN)
- {
- if (usecallbackflag)
- {
- if (PScallback(str, nlen) != 0)
- {
- sprintf(logline, "PScallback failed %s %d", str, nlen);
- showline(logline, 1); // debugging only
- uexit(1);
- }
- }
- else if (output != NULL) // sanity check
- fputs(str, output);
- }
- else
- {
-// else append it to the buffer --- and send if it ends in newline
- strcpy(psbuffer+psbufpos, str);
- psbufpos += nlen;
- if (psbuffer[psbufpos-1] == '\n')
- sendpsbuffer(output);
- }
-}
-
-// psputc done as macro in order to gain some speed
-
-// void psputc (int c) {
-// do{psbuffer[psbufpos++] = (char) chr; \
-// if ((psbufpos+2 >= PSBUFLEN) || (chr == '\n')) sendpsbuffer(output);}while(0)
-// }
-
-#endif
-
-// Here follows the new stuff for the DLL version
-
-#ifdef _WINDOWS
-
-#define WHITESPACE " \t\n\r"
-
-HINSTANCE hInstanceDLL=NULL; /* remember for this DLL */
-
-/* This is the callback function for the EDITTEXT Control in CONSOLETEXT */
-
-#define GET_WM_COMMAND_CMD(wParam, lParam) (HIWORD(wParam))
-#define GET_WM_COMMAND_ID(wParam, lParam) (LOWORD(wParam))
-#define GET_WM_COMMAND_HWND(wParam, lParam) ((HWND)lParam)
-
-HWND hConsoleWnd=NULL; /* Console Text Window Handle passed from DVIWindo */
-
-// In DLL version, this is what "showline" (lc) calls ...
-
-// int ShowLine (char *line, int errflag) /* 99/June/11 */
-void ShowLine (char *line, int errflag) { /* 99/June/11 */
- int ret;
-
- if (IsWindow(hConsoleWnd) == 0) { // in case the other end died
- sprintf(line, "NO CONSOLE WINDOW? %08X %s", hConsoleWnd, line);
- ret = MessageBox(NULL, line, "DVIPSONE",
- MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
- hConsoleWnd = NULL;
-// abortflag++; // kill job in this case ???
- return;
- }
-
-// if (showlineinx > 0) ClearShowBuffer();
-
- if (hConsoleWnd != NULL)
- SendMessage(hConsoleWnd, ICN_ADDTEXT, (WPARAM) line, 0L);
-
- if (errflag) {
- errlevel++;
- ret = MessageBox(NULL, line, "DVIPSONE",
- MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
- if (ret == IDCANCEL && jumpused == 0) {
-// abortflag++;
- uexit(1); // dangerous reentry possibility ?
- }
- }
-}
-
-void winshow (char *line)
-{
- (void) MessageBox(NULL, line, "DVIPSONE",
- MB_ICONINFORMATION | MB_OK | MB_TASKMODAL);
-}
-
-void winerror (char *line)
-{
- int ret;
- ret = MessageBox(NULL, line, "DVIPSONE",
- MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
- if (ret == IDCANCEL && jumpused == 0) {
-// abortflag++;
- uexit(1);
- }
-}
-
-// argument info constructed from command line
-
-int argc;
-
-char **argv=NULL;
-
-// Need to be careful here because of quoted args with spaces in them
-// e.g. -d="G:\Program Files\Adobe\Acrobat\*.pdf"
-// needs to be counted as one argument only,
-// and needs to have " stripped out
-
-// int makecommandargs (char *line)
-int makecommandargs (unsigned char *line)
-{
- int argc=0;
-// char *s, *t;
- unsigned char *s, *t; // fixed 2000 June 18
-
- if (line == NULL) return -1; /* sanity check */
-
-// first figure out how many arguments are on command line
- s = line;
- while (*s != '\0') {
- while (*s <= 32 && *s > 0) s++; // step over white space
- if (*s == '\0') break; // hit the end
- t = s;
- while (*t > 32 && *t != '\"') t++; // step over argument
- if (*t == '\"') { // if "... delimited
- t++;
- while (*t > 0 && *t != '\"') t++; // search for ..."
- if (*t == '\0') break; // hit the end
- t++;
- }
-// argv[argc] = s;
- argc++;
- if (*t == '\0') break;
-// *t = '\0';
- s = t+1; // look for next argument
- }
-
- if (argc == 0) return -1; /* nothing to do */
-
- argv = (char **) malloc(argc * sizeof(char *));
- if (argv == NULL) {
- sprintf(logline, "ERROR: Unable to allocate memory for %s\n", "arguments");
- winerror(logline);
- return -1;
- }
-
-// Now extract argc arguments and put in argv array
- argc = 0;
- s = line;
- while (*s != '\0') {
- while (*s <= ' ' && *s > '\0') s++; // step over white space
- if (*s == '\0') break; // hit the end
- t = s;
- while (*t > ' ' && *t != '\"') t++; // step over argument
- if (*t == '\"') { // if "... delimited
- t++;
-// strcpy(t, t+1); // flush "... 2000 May 27
- while (*t > 0 && *t != '\"') t++; // search for ..."
- if (*t == '\0') break; // hit the end
- t++;
-// strcpy(t, t+1); // flush ..." 2000 May 27
- }
- argv[argc] = s; // next argument
- argc++;
- if (*t == '\0') break;
- *t = '\0';
- s = t+1; // look for next argument
- }
-
-#ifdef DEBUGGING
- s = logline;
- *s = '\0';
- for (k = 0; k < argc; k++) {
- sprintf(s, "%d\t%s\n", k, argv[k]);
- s += strlen(s);
- }
- winshow(logline);
-#endif
- return argc;
-}
-
-// This is the new entry point of DLL called from DVIWindo
-// ARGS: console window to send messages to, command line, callback fun
-// no console window output if hConsole is NULL
-// callback function is NULL if DVIPSONE prints direct to port or file
-// returns -1 if it fails --- returns 0 if it succeeds
-
-// int dvipsone (HWND hConsole, char *line, int (* PScall) (const char *))
-int dvipsone (HWND hConsole, char *line, int (* PScall) (const char *, int))
-{
- int firstarg=0;
- int flag;
-
- abortflag = 0; // redundant
- hConsoleWnd = NULL; // redundant
-
- usecallbackflag = (PScall != NULL);
-
- hConsoleWnd = hConsole; // remember console window handle
- PScallback = PScall; // remember callback function
- psbufpos = 0; // reset buffer
-
-// sprintf(logline, "DVIPSONE %s callbackflag: %d\n", line, usecallbackflag);
-// sprintf(logline, "%s\n", line);
-// showline(logline, 0); // debugging only
-
- argc = makecommandargs(line); // sets up global *argv[]
-
- if (argc < 0) return -1; // sanity check
-
- firstarg = commandline(argc, argv, firstarg); // analyze args
-
- if (firstarg >= argc) {
- sprintf(logline, "ERROR: Too few arguments in %s\n", line);
- winerror(logline);
- return -1;
- }
-
- if (hConsoleWnd != NULL)
- SendMessage(hConsoleWnd, ICN_SETTITLE, (WPARAM) "DVIPSONE", 0L);
-// SendMessage(hConsoleWnd, ICN_RESET, 0, 0L); // if want to clear window
-
- if (usecallbackflag) {
- showline("Passing PS back to Windows from DVIPSONE.DLL\n", 0);
- }
- else {
- showline("Printing directly from DVIPSONE.DLL\n", 0);
- }
-
- (void) main(argc, argv); // now run DVIPSONE proper
-
- if (errlevel > 0 || abortflag > 0)
- {
- sprintf(logline, "ERRORS in Processing (err %d abort %d)\n",
- errlevel, abortflag);
- winerror(logline); // debugging output ?
- }
-
-// if (psbufpos > 0) sendpsbuffer(output); // empty out PS buffer
-// if (psbufpos > 0) PSputs("", output); // output already closed
-
- if (hConsoleWnd != NULL)
- {
- if (errlevel > 0 || abortflag > 0) flag = 1;
- else flag = 0; // pass along error indication
- SendMessage(hConsoleWnd, ICN_DONE, flag, 0); // flush out console buffer
- }
- PScallback = NULL;
- hConsoleWnd = NULL;
-
- if (argv != NULL) free(argv);
- if (abortflag) return -1;
- else return 0;
-}
-
-BOOL WINAPI DllMain (HINSTANCE hInstDll, DWORD fdwReason, LPVOID fImpLoad)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- // The DLL is being mapped into the process's address space
- // place to allocate memory ???
- // return FALSE if this fails
- hInstanceDLL = hInstDll; /* remember it */
- break;
-
- case DLL_THREAD_ATTACH:
- // A thread is being created
- break;
-
- case DLL_THREAD_DETACH:
- // A thread is exiting cleanly
- break;
-
- case DLL_PROCESS_DETACH:
- // The DLL is being unmapped from the process's address space
- // place to free any memory allocated
- // but make sure it in fact *was* allocated
- hInstanceDLL = NULL; /* forget it */
- break;
- }
- return(TRUE); // used only for DLL_PROCESS_ATTACH
-}
-#endif // end of new stuff for DLL version
-
//////////////////////////////////////////////////////////////////////////////
/* Things to do or to worry about: */
/* print /p "%1" */
/* printo /t "%1" "%2" "%3" "%4" */
/* where %1 is the file name */
-/* and %2 %3 %4 are printer, driver, and port presumably */
+/* and %2 %3 %4 are printer, driver, and port presumably */
\ No newline at end of file
02110-1301 USA.
****************************************************************************/
-/* Revised 1999 June 13 to run in DLL form */
-
-#ifdef _WINDOWS
-#define NOCOMM
-#define NOSOUND
-#define NODRIVERS
-#define STRICT
-#include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-#include <setjmp.h>
-
-#ifdef _WINDOWS
- #define MYLIBAPI __declspec(dllexport)
-#endif
-
#include "dvipsone.h"
-#ifdef _WINDOWS
-#pragma warning(disable:4100) // unreferenced formal variable
-#endif
-
-#pragma warning(disable:4996)
-#pragma warning(disable:4127) // conditional expression is constant
-
-#pragma hdrstop
-
-#include <time.h> /* for struct tm etc. */
-#include <sys/types.h>
-#include <sys/stat.h> /* for _stat etc. */
-#include <sys/utime.h> /* for _utimbuf etc. */
-
#define AllowCTM
-/* double convdeg (double angle) { return (angle * 180 / 3.141592653); } */
-
-/* #define CONVDEG(x) (x * 180 / 3.141529865358) */
-
#define PI (3.141592653)
#define CONVDEG(x) ((x) * 180 / 3.141592653)
/* multiply all quantities in DVI file by this to get 10^{-7} meters */
/* in TeX, this is normally set to 25400000/473628672 */
-int psfigstyle=0; /* non-zero if new style DVI2PS special */
-int pstagstyle=0; /* non-zero if new style DVIPS special */
-int pssvbstyle=0; /* non-zero if new style DVIPS special */
+int psfigstyle = 0; /* non-zero if new style DVI2PS special */
+int pstagstyle = 0; /* non-zero if new style DVIPS special */
+int pssvbstyle = 0; /* non-zero if new style DVIPS special */
static char filename[FNAMELEN]; /* name of special file for error message */
char *showbeginning (char *s, char *t, int n)
{
int k;
- for (k=0; k < n; k++) *s++ = *t++;
+
+ for (k=0; k < n; k++)
+ *s++ = *t++;
// fputs("...\n", output);
strcat(s, "..\n");
s += strlen(s);
/* returns 0 if no more tokens found - else returns terminator */
/* what to do if error ? */
-int getalphatoken (FILE *input, char *token, int nmax)
+int get_alpha_token (FILE *input, char *token, int nmax)
{
int c, k = 0;
char *s = token;
*s = '\0'; /* in case we pop out 96/Aug/29 */
if (nspecial <= 0) return 0; /* nothing more in \special */
if (nmax <= 0) { /* 95/Aug/30 */
- flushspecial(input);
+ flush_special(input);
return 0; /* error overflow */
}
c = getc(input); --nspecial;
if (c == 0) {
- flushspecial(input);
+ flush_special(input);
return 0; /* first byte is null 96/Aug/29 */
}
while (c <= ' ' && nspecial > 0) { /* over initial white space */
showline(logline, 1);
// if (logfileflag) showbeginning(logfile, token, nmax/2);
errcount(0); /* ??? */
- flushspecial(input); /* 95/Aug/30 */
+ flush_special(input); /* 95/Aug/30 */
c = 0; /* so we return 0 */ /* 95/Aug/30 */
/* c = getc(input); --nspecial;
while (((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
/* flush rest of special to get back to rest of DVI code */
-void flushspecial(FILE *input)
+void flush_special (FILE *input)
{
int c;
if (nspecial <= 0) return;
/* - either up to white space - or - double quote delimited */
/* returns 0 if no more tokens found - else returns terminator */
-int gettoken (FILE *input, char *buff, int nmax)
+int get_token (FILE *input, char *buff, int nmax)
{
int c, k=0, marker=' '; // end of token marker
char *s=buff;
*s = '\0'; // in case pop out right away
if (nspecial <= 0) return 0; /* nothing more in \special */
if (nmax <= 0) { /* 95/Aug/30 */
- flushspecial(input);
+ flush_special(input);
return 0; /* error overflow */
}
c = getc(input);
showline(logline, 1);
// if (logfileflag) showbeginning(logfile, buff, nmax/2);
errcount(0); /* ??? */
- flushspecial(input); /* 95/Aug/30 */
+ flush_special(input); /* 95/Aug/30 */
c = 0; /* so we return 0 */ /* 95/Aug/30 */
/* c = getc(input); --nspecial;
while (c > ' ' && nspecial > 0) {
/* copy special into line buffer for sscanf */
/* - either double quote delimited - or - up to end of special */
-int scanspecial (FILE *input, char *buff, int nmax)
+int scan_special (FILE *input, char *buff, int nmax)
{
int c, k=0;
char *s=buff;
if (k >= nmax) {
/* showbeginning(errout, buff, nmax/2); */
/* errcount(0); */ /* ??? */
- flushspecial(input);
+ flush_special(input);
return nmax;
}
*s++ = (char) c;
if (k >= nmax) {
/* showbeginning(errout, buff, nmax/2); */
/* errcount(0); */ /* ??? */
- flushspecial(input);
+ flush_special(input);
return nmax;
}
*s++ = (char) c;
/* As above, but do not fiddle with "..." 97/Nov/11 needed for "mark" */
-int scanspecialraw (FILE *input, char *buff, int nmax)
+int scan_special_raw (FILE *input, char *buff, int nmax)
{
int c, k=0;
char *s=buff;
if (k >= nmax) {
/* showbeginning(errout, buff, nmax/2); */
/* errcount(0); */ /* ??? */
- flushspecial(input);
+ flush_special(input);
return nmax;
}
*s++ = (char) c;
}
/* read (short) double-quote-delimited string from special string */
-/* possibly just use scanspecial or gettoken instead ? */
+/* possibly just use scan_special or get_token instead ? */
/* return value seems to be mostly ignored */
-int getstring (FILE *input, char *buff, int nmax)
+int get_string (FILE *input, char *buff, int nmax)
{
int c, k = 0;
char *s=buff;
}
/* skip forward to comma in special string */
-void skiptocomma(FILE *input)
+void skip_to_comma(FILE *input)
{
int c;
if (nspecial <= 0) return;
}
/* skip over double-quote-delimited string in special string */
-void flushstring (FILE *input)
+void flush_string (FILE *input)
{
int c;
if (nspecial <= 0) return;
/* - otherwise copy to end of special */
/* This skips over leading white space */
-/* copystring starts by emitting '\n' */
-/* copystring ends by emitting '\n' when it is done */
+/* copy_string starts by emitting '\n' */
+/* copy_string ends by emitting '\n' when it is done */
-void copystring (FILE *output, FILE *input)
+void copy_string (FILE *output, FILE *input)
{
int c;
int column=0;
/* copy verbatim PostScript - but strip bracket enclosed crap first */
/* global | local | inline | asis | begin | end <user PS> ??? */
-void stripbracket (FILE *output, FILE *input)
+void strip_bracket (FILE *output, FILE *input)
{
int c;
nspecial++;
}
/* putc('\n', output); */ /* 94/Jun/25 */
- copystring(output, input);
+ copy_string(output, input);
/* putc('\n', output); */ /* 1993/June/3 */
}
/* try and find bbox at end of file */
/* the following may inefficiently read stuff several times, but, so what */
-int findbboxatend (FILE *special, char *fname, long pslength)
+int find_bbox_at_end (FILE *special, char *fname, long pslength)
{
int k, foundit = 0;
/* extract bounding box from inserted eps file and offset */
-int readbbox (FILE *special, char *fname, long pslength)
+int read_bbox (FILE *special, char *fname, long pslength)
{
char *s;
int c, k;
/* if (strstr(line, "(at end)") != NULL) */ /* BoundingBox at end */
if (strstr(line, "(atend)") != NULL ||
strstr(line, "(at end)") != NULL) /* 94/Aug/12 */
- k = findbboxatend(special, fname, pslength);
+ k = find_bbox_at_end(special, fname, pslength);
break;
}
if ((k = getline(special, line)) == 0) break; /* EOF */
/* if needshift < 0 then (xll, yur) is at TeX's current point */
/* - last one only used by DVIALW ? */
-void dealwithbbox (FILE *output, FILE *special, char *fname, long pslength, int needshift)
+void deal_with_bbox (FILE *output, FILE *special, char *fname, long pslength, int needshift)
{
- if (readbbox(special, fname, pslength) > 0) {
+ if (read_bbox(special, fname, pslength) > 0) {
/* now perform shift - if asked for it */
if (needshift > 0) {
// fprintf(output, "%lg %lg translate ", -xll, -yll);
/* Emits on stdout the font file name (minus trailing _) unless mmflag set */
-char *fopenfont_sub (FILE *atmfile, char *FontName, char *pfbname,
- int atmflag, int mmflag)
+char *fopenfont_sub (FILE *atmfile, char *FontName, char *pfbname, int atmflag, int mmflag)
{
/* FILE *atmfile; */
/* char atmini[FNAMELEN]; */
/* maybe don't look along PSFONTS path if pfbname contains \ or / ? */
/* changed to look in current directory first 98/Jul/20 */
-FILE *findpfbfile (char *pfbname, char *FileName) /* 1994/Aug/18 */
+FILE * find_pfb_file (char *pfbname, char *FileName)
{
FILE *pfbfile;
- char filename[FNAMELEN]; /* used for PFB file name ? */
+ char filename[FNAMELEN]; /* used for PFB file name ? */
strcpy(filename, pfbname);
extension(filename, "pfb");
- if ((pfbfile = fopen(filename, "rb")) != NULL) {
- strcpy (FileName, filename); /* 1994/Feb/10 */
- return pfbfile; /* we found it */
+ if ((pfbfile = fopen(filename, "rb")) != NULL)
+ {
+ strcpy (FileName, filename);
+ return pfbfile;
}
-/* not found as given */
- if (fontpath == NULL) return NULL;
- if (traceflag) showline(fontpath, 0); /* debugging only */
-/* pfbfile = findandopen(filename, fontpath, NULL, "rb", 0); */
+
+ if (fontpath == NULL)
+ return NULL;
+
+ if (traceflag)
+ showline(fontpath, 0);
+
pfbfile = findandopen(filename, fontpath, NULL, "rb", currentfirst);
- if (pfbfile != NULL) {
+
+ if (pfbfile != NULL)
+ {
strcpy(FileName, filename);
return pfbfile;
}
-/* underscore(filename); */ /* OK, try now with underscores */
- if (underscore(filename)) { /* 95/May/28 */
-/* pfbfile = findandopen(filename, fontpath, NULL, "rb", 0); */
+
+ if (underscore(filename))
+ {
pfbfile = findandopen(filename, fontpath, NULL, "rb", currentfirst);
- if (pfbfile != NULL) {
+
+ if (pfbfile != NULL)
+ {
strcpy(FileName, filename);
return pfbfile;
}
}
- return NULL; /* PFB not found in any of the directories */
+
+ return NULL;
}
#else
-FILE *findpfbfile (char *pfbname, char *FileName)
+FILE *find_pfb_file (char *pfbname, char *FileName)
{
FILE *pfbfile;
char *searchpath;
/* find the atmfonts.map file and get its full path */
-int setupatmfontsmap (void)
+int setup_atm_fonts_map (void)
{
FILE *atmfile=NULL;
char atmfilename[FNAMELEN];
strcpy(FileName, pfbfilename);
return NULL;
} /* special case - font is resident ??? 98/Jan/9 */
- pfbfile = findpfbfile(pfbfilename, FileName); /* look for PFB file */
+ pfbfile = find_pfb_file(pfbfilename, FileName); /* look for PFB file */
return pfbfile; /* NULL if not found */
}
if (traceflag) showline(" STAGE II", 1); /* debugging 95/May/25 */
/* Stage II Stage II Stage II Stage II Stage II Stage II Stage II Stage II */
/* Try and use ATMFONTS.MAP */
- if (useatmfontsmap) setupatmfontsmap();
+ if (useatmfontsmap) setup_atm_fonts_map();
if ((atmfile = fopen(atmfontsmap, "r")) != NULL) {
/* try and find line `FontName=<pfb-file>' - PFB name return in pfbfilename */
if (s != NULL) { /* found in this file ? */
if (strcmp(s, "nul") == 0) /* special case 1994/Feb/17 */
return NULL; /* *resident* ??? */
- pfbfile = findpfbfile(pfbfilename, FileName);
+ pfbfile = find_pfb_file(pfbfilename, FileName);
return pfbfile; /* NULL if not found */
} /* end of pfb file name found in ATMFONTS.MAP */
}
/* Works for CM, AMS, EM, extra LaTeX, MathTime */
strcpy(pfbfilename, FontName);
- pfbfile = findpfbfile(pfbfilename, FileName); /* look for PFB file */
+ pfbfile = find_pfb_file(pfbfilename, FileName); /* look for PFB file */
if (pfbfile != NULL) return pfbfile;
return NULL; /* entry not found in ATM.INI either */
int plainpsflag=0;
if (! bPassEPSF) { /* 1994/Mar/9 */
- flushspecial(special);
+ flush_special(special);
return;
}
int c;
if (! bPassEPSF) { /* 1994/Mar/9 */
- flushspecial(special);
+ flush_special(special);
return 0;
}
if((special = findepsfile(epsfilename, "eps", 0, 0)) == NULL) return 0;
pslength = checkpcform(special, epsfilename);
- readbbox(special, epsfilename, pslength);
+ read_bbox(special, epsfilename, pslength);
fclose(special);
} */
/* fprintf(output, "undscl "); */ /* currentpoint translate ? */
if (needshift) {
pslength = checkpcform(special, filename);
- dealwithbbox(output, special, filename, pslength, needshift);
+ deal_with_bbox(output, special, filename, pslength, needshift);
/* rewind(special); */
}
}
#define MAXCOMPLAIN 127
-void complainspecial (FILE *input) /* list contents and do flushspecial */
+void complainspecial (FILE *input) /* list contents and do flush_special */
{
int c, k=0;
/* long specnow; */
if (quietflag != 0) { /* easy if output suppressed */
- flushspecial(input); return;
+ flush_special(input); return;
}
/* specnow = ftell(input); */ /* save current position */
/* if (complainedaboutj++ > 0) return; */
if (complainedaboutj++ == 0)
showline(" WARNING: verbatim PS - use `j' flag?", 1);
- if (nspecial > 0) flushspecial(input); /* 1999/Mar/18 */
+ if (nspecial > 0) flush_special(input); /* 1999/Mar/18 */
}
/* Textures style include eps file */ /* added "scaled <double>" ? */
double scale=1.0;
char epsname[MAXLINE]="";
-/* c = gettoken(input, line, MAXLINE); */
- c = gettoken(input, line, sizeof(line)); /* MAXLINE */
+/* c = get_token(input, line, MAXLINE); */
+ c = get_token(input, line, sizeof(line)); /* MAXLINE */
colontoslash(epsname, line); /* deal with Mac font names */
startspecial(output);
if (c > 0 && nspecial > 0) { /* anything left in special ? */
/* read next token, see whether perhaps `scaled' or `clip' */
-/* (void) gettoken(input, line, MAXLINE); */
- (void) gettoken(input, line, sizeof(line)); /* MAXLINE */
+/* (void) get_token(input, line, MAXLINE); */
+ (void) get_token(input, line, sizeof(line)); /* MAXLINE */
if (strcmp(line, "scaled") == 0) {
-/* (void) gettoken(input, line, MAXLINE); */
- (void) gettoken(input, line, sizeof(line)); /* MAXLINE */
+/* (void) get_token(input, line, MAXLINE); */
+ (void) get_token(input, line, sizeof(line)); /* MAXLINE */
if(sscanf(line, "%lg", &scale) > 0) {
/* printf(" SCALE %lg ", scale); */
if (scale > 33.333) scale = scale/1000.0;
}
/* else { } */ /* error, can't read the scale */
/* read next token, see whether perhaps `clip' */
-/* if (nspecial > 0) (void) gettoken(input, line, MAXLINE); */
- if (nspecial > 0) (void) gettoken(input, line, sizeof(line));
+/* if (nspecial > 0) (void) get_token(input, line, MAXLINE); */
+ if (nspecial > 0) (void) get_token(input, line, sizeof(line));
}
if (strcmp(line, "clip") == 0) clipflag = 1; /* 1995/July/12 */
}
if ((special = findepsfile(epsname, "eps", 1, 1)) != NULL) {
xll = yll = xur = yur = 0.0;
pslength = checkpcform(special, epsname);
- if (readbbox(special, epsname, pslength) == 0) {
+ if (read_bbox(special, epsname, pslength) == 0) {
sprintf(logline, "BoundingBox not found in %s ", epsname);
showline(logline, 1);
}
} /* end of clipflag code introduced 95/July/12 */
copyepsfile(output, epsname, 1, 1); /* include and shift */
endspecial(output);
- flushspecial(input); /* flush whatever is left */
+ flush_special(input); /* flush whatever is left */
}
/* Textures style "postscript" - direct inclusion of PostScript code */
// fputs("gsave undsclx ", output);
PSputs("gsave undsclx ", output);
}
-/* copystring now inserts a `\n' here */ /* 1994/June/25 */
- copystring(output, input);
+/* copy_string now inserts a `\n' here */ /* 1994/June/25 */
+ copy_string(output, input);
/* putc('\n', output); */ /* 93/June/3 */
/* if (sebastianflag) putc('\n', output); else */
if (rawflag == 0) { /* 94/July/3 */
double scale=1.0;
char epsname[FNAMELEN]="";
-/* (void) gettoken(input, epsname, FNAMELEN); */
- (void) gettoken(input, epsname, sizeof(epsname)); /* FNAMELEN */
-/* if (gettoken(input, line, MAXLINE) != 0 && */
- if (gettoken(input, line, sizeof(line)) != 0 &&
+/* (void) get_token(input, epsname, FNAMELEN); */
+ (void) get_token(input, epsname, sizeof(epsname)); /* FNAMELEN */
+/* if (get_token(input, line, MAXLINE) != 0 && */
+ if (get_token(input, line, sizeof(line)) != 0 &&
strcmp(line, "scaled") == 0 &&
- gettoken(input, line, sizeof(line)) != 0 &&
+ get_token(input, line, sizeof(line)) != 0 &&
sscanf(line, "%lg", &scale) > 0) {
}
/* fprintf(output, "\nsb "); */
fseek(input, specstart, SEEK_SET); /* start over again */
nspecial = nspecialsav; /* restore length */
-/* if (gettoken(input, epsfilename, FNAMELEN) == 0) { */
- if (gettoken(input, epsfilename, sizeof(epsfilename)) == 0) { /* FNAMELEN */
- flushspecial(input);
+/* if (get_token(input, epsfilename, FNAMELEN) == 0) { */
+ if (get_token(input, epsfilename, sizeof(epsfilename)) == 0) { /* FNAMELEN */
+ flush_special(input);
return 0; /* fail, no token following */
}
/* if ((special = findepsfile(epsfilename, 0, "eps")) == NULL) { */
if ((special = findepsfile(epsfilename, "eps", 0, 0)) == NULL) {
- flushspecial(input);
+ flush_special(input);
if (traceflag) { /* debug output 95/July/15 */
sprintf(logline, " can't find %s, or unknown \\special ",
epsfilename); /* 95/June/21 */
startspecial(output);
/* fprintf(output, "undscl "); */ /* currentpoint translate ? */
/* pslength = checkpcform(special, filename); */
-/* dealwithbbox(output, special, filename, pslength, 1); */
+/* deal_with_bbox(output, special, filename, pslength, 1); */
/* -1, 0, or +1 ? */
/* putc('\n', output); */ /* 1994/June/25 */
- copystring(output, input); /* copy rest of special */
+ copy_string(output, input); /* copy rest of special */
/* putc('\n', output); */ /* 1993/June/3 */
/* copyepsfile(output, epsfilename, 1, 0); */
/* copyepsfile(output, epsfilename, 0, 0); */
while (nspecial > 0) { /* gather up information first */
/* if (firsttime != 0) firsttime = 0;
- else if (getalphatoken(input, line, MAXLINE) == 0) break; */
+ else if (get_alpha_token(input, line, MAXLINE) == 0) break; */
if (firsttime == 0)
-/* if (getalphatoken(input, line, MAXLINE) == 0) break; */
- if (getalphatoken(input, line, sizeof(line)) == 0) break;
+/* if (get_alpha_token(input, line, MAXLINE) == 0) break; */
+ if (get_alpha_token(input, line, sizeof(line)) == 0) break;
if (strcmp(line, "language") == 0) {
/* strcmp(line, "LANGUAGE") == 0) { */
- (void) getstring(input, line, MAXLINE);
+ (void) get_string(input, line, MAXLINE);
if (strcmp(line, "PS") == 0 ||
strcmp(line, "PostScript") == 0) {
/* we like PS, so no need to do anything ! */
}
else if (strcmp(line, "include") == 0) {
/* || strcmp(line, "INCLUDE") == 0) { */
- (void) getstring(input, epsfilename, FNAMELEN);
+ (void) get_string(input, epsfilename, FNAMELEN);
includeflag = 1; fileflag = 1;
}
else if (strcmp(line, "overlay") == 0) {
/* || strcmp(line, "OVERLAY") == 0 ) { */
- (void) getstring(input, epsfilename, FNAMELEN);
+ (void) get_string(input, epsfilename, FNAMELEN);
includeflag = 0; fileflag = 1;
}
else if (strcmp(line, "literal") == 0) {
/* || strcmp(line, "LITERAL") == 0) { */
flitpos = ftell(input); /* remember where this was */
nliteral = nspecial;
-/* copystring(output, input); */
+/* copy_string(output, input); */
}
/* GRAPHICS and OPTIONS not yet defined - so flag as errors */
else if (strcmp(line, "boundingbox") == 0) {
/* actually, this may involve TeX dimensions, see decodeunits? */
/* - that seems truly bizarre, so ignore that possibility */
- (void) getstring(input, line, MAXLINE);
+ (void) get_string(input, line, MAXLINE);
if (sscanf(line, "%lg %lg %lg %lg", &xll, &yll, &xur, &yur) == 4)
/* this should override bounding box in eps file if given */
bboxflag = 1;
}
}
else if (strcmp(line, "message") == 0) {
- (void) getstring(input, line, MAXLINE);
+ (void) get_string(input, line, MAXLINE);
/* printf("%s\n", line); */
/* putc(' ', stdout); */ /* 93/June/3 */
showline(" ", 0);
" Unrecognized \\special keyword: %s ", line);
showline(logline, 1);
}
- flushstring(input); /* errcount(0); */
+ flush_string(input); /* errcount(0); */
}
if (nspecial == 0) break;
- else skiptocomma(input); /* look for next key value pair */
+ else skip_to_comma(input); /* look for next key value pair */
if (firsttime != 0) firsttime = 0;
}
fseek(input, flitpos, SEEK_SET); /* go back to where literal was */
nspecial = nliteral; /* reset nspecial */
/* putc('\n', output); */ /* 1994/June/25 */
- copystring(output, input);
+ copy_string(output, input);
/* putc('\n', output); */ /* 1993/June/3 */
fseek(input, fendspec, SEEK_SET); /* back to end of special */
nspecial = 0;
void cantfind (FILE *input, char *s, char *line) { /* complain about missing field */
sprintf(logline, " Can't find `%s' (in `%s') ", s, line);
showline(logline, 1);
- flushspecial(input);
+ flush_special(input);
errcount(0);
}
while (nspecial > 0) { /* gather up parameters */
if (firsttime != 0) firsttime = 0;
-/* else if (getalphatoken(input, line, MAXLINE) == 0) break; */
- else if (getalphatoken(input, line, sizeof(line)) == 0) break;
+/* else if (get_alpha_token(input, line, MAXLINE) == 0) break; */
+ else if (get_alpha_token(input, line, sizeof(line)) == 0) break;
/* deal with new PSFIG DVI2PS style useage */
if (strcmp(line, "pstext") == 0) {
/* || strcmp(line, "PSTEXT") == 0) { */
- if (scanspecial(input, line, MAXLINE) == MAXLINE) {
+ if (scan_special(input, line, MAXLINE) == MAXLINE) {
if (verbatimflag) { /* long pstext= verbatim */
fseek(input, fliteral, SEEK_SET);
nspecial = nliteral;
-/* copystring now emits '\n' here */ /* 1994/June/25 */
- copystring(output, input); /* revscl - forscl PSTEXT */
+/* copy_string now emits '\n' here */ /* 1994/June/25 */
+ copy_string(output, input); /* revscl - forscl PSTEXT */
/* putc('\n', output); */ /* 1993/June/3 */
}
else complainspecial(input); /* TOO DAMN LONG ! */
else if (verbatimflag) verbout(output, line);
else complainjflag(input); /* 1993/Oct/17 */
/* else complainspecial(input); */
- flushspecial(input); /* ignore the rest */
+ flush_special(input); /* ignore the rest */
} /* end of PSTEXT= code */
/* kludge to allow insertion of header information - NO PROTECTION ! */
else if (_strcmpi(line, "header") == 0 ||
strcmp(line, "DVIWindo") == 0 /* 99/Sep/6 */
) {
/* ignore now, already taken care of in dvipslog ! */
- flushspecial(input); /* taken care of in dvipslog */
+ flush_special(input); /* taken care of in dvipslog */
}
/* kludge to change to PS default coordinates - NO PROTECTION ! */
else if (strcmp(line, "verbatim") == 0
PSputc('\n', output); // always on new line ?
PSputs("revsclx ", output);
if (preservefont) PSputs("currentfont ", output);
- copystring(output, input);
+ copy_string(output, input);
if (preservefont) PSputs("setfont ", output);
PSputs("forsclx ", output);
}
/* deal with old PSFIG DVI2PS style useage - case sensitive */
else if (strcmp(line, "psfile") == 0) {
-/* if (gettoken(input, epsfilename, MAXFILENAME) == 0) */
- if (gettoken(input, epsfilename, sizeof(epsfilename)) == 0) /* FNAMELEN */
+/* if (get_token(input, epsfilename, MAXFILENAME) == 0) */
+ if (get_token(input, epsfilename, sizeof(epsfilename)) == 0) /* FNAMELEN */
cantfind(input, line, epsfilename);
else psepsfstyle=0;
}
else if (strcmp(line, "hsize") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &hsize) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "vsize") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &vsize) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "hoffset") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &hoffset) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "voffset") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &voffset) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "hscale") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &hscale) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "vscale") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &vscale) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
else if (strcmp(line, "rotation") == 0
|| strcmp(line, "angle") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &rotation) == 0)
cantfind(input, line, moreline);
else psepsfstyle=0;
}
/* Now for Rokicki EPSF.TEX style --- case sensitive */
else if (strcmp(line, "PSfile") == 0) { /* EPSF style - note uc/lc */
-/* if (gettoken(input, epsfilename, MAXFILENAME) == 0) */
- if (gettoken(input, epsfilename, sizeof(epsfilename)) == 0)
+/* if (get_token(input, epsfilename, MAXFILENAME) == 0) */
+ if (get_token(input, epsfilename, sizeof(epsfilename)) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
else if (strcmp(line, "llx") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &xll) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
else if (strcmp(line, "lly") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &yll) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
else if (strcmp(line, "urx") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &xur) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
else if (strcmp(line, "ury") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &yur) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
else if (strcmp(line, "rwi") == 0) {
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &rwi) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
/* else if (strcmp(line, "rhe") == 0) { */ /* ??? */
else if (strcmp(line, "rhe") == 0 ||
strcmp(line, "rhi") == 0) { /* 1994/Mar/1 */
-/* if (gettoken(input, line, MAXLINE) == 0 || */
- if (gettoken(input, moreline, sizeof(moreline)) == 0 ||
+/* if (get_token(input, line, MAXLINE) == 0 || */
+ if (get_token(input, moreline, sizeof(moreline)) == 0 ||
sscanf(line, "%lg", &rhe) == 0)
cantfind(input, line, moreline);
else psepsfstyle=1;
}
copyepsfile(output, epsfilename, 0, 0);
endspecial(output);
- flushspecial(input);
+ flush_special(input);
}
/* NOW old UNIX DVI2PS (psadobe) ? */
else {
/* the above needs testing ? */
endspecial(output);
}
- flushspecial(input); /* ignore the rest ? */
+ flush_special(input); /* ignore the rest ? */
if (abortflag) return -1;
else return 0;
}
s = line + strlen(line);
*s++ = (char) c; /* stick in terminator */
*s = '\0'; /* just in case */
-/* (void) scanspecial(input, s, MAXLINE); */ /* read rest of line ? */
- (void) scanspecial(input, line, MAXLINE); /* read rest of line */
+/* (void) scan_special(input, s, MAXLINE); */ /* read rest of line ? */
+ (void) scan_special(input, line, MAXLINE); /* read rest of line */
if (traceflag) {
sprintf(logline, "\n(index %d outflag %d) %s ", colorindex, outflag, line); /* debugging */
showline(logline, 0);
int n, flag;
double dx, dy, sx, sy, theta, m11, m12, m21, m22, m31, m32;
- (void) scanspecial(input, line, MAXLINE); /* read rest of line */
+ (void) scan_special(input, line, MAXLINE); /* read rest of line */
s = line;
// putc('\n', output); /* separate from previous */
PSputc('\n', output); /* separate from previous */
s += n; /* step over arguments */
}
/* putc('\n', output); */ /* separate from following */
- flushspecial(input);
+ flush_special(input);
}
#endif
int n, flag, subtract, stroke;
/* if (c == '*') subtract=1; */ /* subtract rather than intersect */
- (void) scanspecial(input, line, MAXLINE); /* read rest of line */
+ (void) scan_special(input, line, MAXLINE); /* read rest of line */
s = line;
/* printf("LINE: %s\n", line); */
/* while (*s != ' ' && *s != '\0') s++; */
FILE *special;
if (pctexflag == 0) { /* if dvitops: check "import" next */
-/* if (getalphatoken(input, line, MAXLINE) == 0) */
- if (getalphatoken(input, line, sizeof(line)) == 0) {
+/* if (get_alpha_token(input, line, MAXLINE) == 0) */
+ if (get_alpha_token(input, line, sizeof(line)) == 0) {
complainspecial(input);
return -1;
}
}
/* if (strcmp(line, "import") == 0) */
if (pctexflag || strcmp(line, "import") == 0) {
-/* if(gettoken(input, epsfilename, FNAMELEN) == 0) */
- if(gettoken(input, epsfilename, sizeof(epsfilename)) == 0) { /* FNAMELEN */
+/* if(get_token(input, epsfilename, FNAMELEN) == 0) */
+ if(get_token(input, epsfilename, sizeof(epsfilename)) == 0) { /* FNAMELEN */
dvitopsmiss();
errcount(0);
- flushspecial(input);
+ flush_special(input);
return -1;
}
/* see if width and height specified in dvitops: import */
- if (scanspecial(input, line, MAXLINE) == MAXLINE) {
+ if (scan_special(input, line, MAXLINE) == MAXLINE) {
complainspecial(input); /* TOO DAMN LONG ! */
}
/* scale specified width and height to PS points */
return -1;
pslength = checkpcform(special, epsfilename); /* ??? */
/* should failure to read BBox be considered OK here ? */
- if (readbbox(special, epsfilename, pslength) == 0) {
+ if (read_bbox(special, epsfilename, pslength) == 0) {
/* may want to suppress error message ? */
/* fprintf(errout, "BBox not found in %s ", epsfilename); */
sprintf(logline, "BoundingBox not found in %s ", epsfilename);
PSputs("currentfont ", output);
}
/* putc('\n', output); */ /* 1994/June/25 */
- copystring(output, input); /* just copy what follows ! */
+ copy_string(output, input); /* just copy what follows ! */
/* putc('\n', output); */ /* 1993/June/3 */
/* if (preservefont) fprintf(output, "setfont "); */
if (preservefont) {
texlandscape(output); /* 1992/Nov/28 */
}
else complainspecial(input);
- flushspecial(input);
+ flush_special(input);
if (abortflag) return -1;
else return 0;
}
char units[3];
int n;
-/* if (getalphatoken(input, line, MAXLINE) == 0) { */
- if (getalphatoken(input, line, sizeof(line)) == 0)
+/* if (get_alpha_token(input, line, MAXLINE) == 0) { */
+ if (get_alpha_token(input, line, sizeof(line)) == 0)
{
complainspecial(input);
return;
{
// putc(' ', stdout);
showline(" ", 0);
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
// fputs(line, stdout);
// PSputs(line, stdout);
showline(line, 0);
}
else if (strcmp(line, "linewidth") == 0) {
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
s = line;
if (sscanf(s, "%lg%n", &linewidth, &n) == 0) {
showline("linewidth not specified", 1); /* used default */
FILE *special;
/* char *s=line; */
-/* if (getalphatoken(input, line, MAXLINE) == 0) {*//* get DVITPS command */
- if (getalphatoken(input, line, sizeof(line)) == 0) { /* get DVITPS command */
+/* if (get_alpha_token(input, line, MAXLINE) == 0) {*//* get DVITPS command */
+ if (get_alpha_token(input, line, sizeof(line)) == 0) { /* get DVITPS command */
complainspecial(input);
return -1;
}
if (strcmp(line, "Include1") == 0) { /* insert figure here */
-/* if(gettoken(input, epsfilename, FNAMELEN) == 0) { */
- if(gettoken(input, epsfilename, sizeof(epsfilename)) == 0) {
+/* if(get_token(input, epsfilename, FNAMELEN) == 0) { */
+ if(get_token(input, epsfilename, sizeof(epsfilename)) == 0) {
/* fputs(" File name missing in DVITPS special ", errout); */
dvitopsmiss();
errcount(0);
- flushspecial(input);
+ flush_special(input);
return -1;
}
/* see if width and height specified in dvitops: import */
- if(scanspecial(input, line, MAXLINE) == MAXLINE) {
+ if(scan_special(input, line, MAXLINE) == MAXLINE) {
complainspecial(input); /* TOO DAMN LONG ! */
}
/* if ((special = findepsfile(epsfilename, 1, "eps")) == NULL) */
if ((special = findepsfile(epsfilename, "eps", 1, 0)) == NULL)
return -1;
pslength = checkpcform(special, epsfilename); /* ??? */
-/* if (readbbox(special, epsfilename, pslength) == 0) {
+/* if (read_bbox(special, epsfilename, pslength) == 0) {
fprintf(errout, "BoundingBox not found in %s ", epsfilename);
} */
copyepsfileaux(output, special, epsfilename);
fclose(special);
}
else if (strcmp(line, "Include0") == 0) { /* read PS header or such */
-/* if(gettoken(input, epsfilename, FNAMELEN) == 0) { */
- if(gettoken(input, epsfilename, sizeof(epsfilename)) == 0) {
+/* if(get_token(input, epsfilename, FNAMELEN) == 0) { */
+ if(get_token(input, epsfilename, sizeof(epsfilename)) == 0) {
dvitopsmiss();
errcount(0);
- flushspecial(input);
+ flush_special(input);
return -1;
}
/* if ((special = findepsfile(epsfilename, 1, "eps")) == NULL) */
}
else if (strcmp(line, "Literal") == 0) {
/* putc('\n', output); */ /* 1994/June/25 */
- copystring(output, input); /* just copy what follows ! */
+ copy_string(output, input); /* just copy what follows ! */
/* putc('\n', output); */ /* 1993/June/3 */
}
else complainspecial(input);
- flushspecial(input);
+ flush_special(input);
if (abortflag) return -1;
else return 0;
}
if (c == ':') { /* a second colon --- deal with ps:: type command */
/* global | local | inline | asis | begin | end <user PS> ??? */
-/* (void) gettoken(input, line, MAXLINE); */
-/* if (verbatimflag) stripbracket(output, intput); */
+/* (void) get_token(input, line, MAXLINE); */
+/* if (verbatimflag) strip_bracket(output, intput); */
fliteral = ftell(input); /* remember where this was */
nliteral = nspecial; /* and how many bytes left */
- if (scanspecial(input, line, MAXLINE) == MAXLINE) {
+ if (scan_special(input, line, MAXLINE) == MAXLINE) {
if (verbatimflag) { /* long ps:: type verbatim */
fseek(input, fliteral, SEEK_SET);
nspecial = nliteral;
- stripbracket(output, input); /* revscl - forscl ??? */
+ strip_bracket(output, input); /* revscl - forscl ??? */
}
/* complainspecial(input); */ /* TOO DAMN LONG ! */
/* else complainspecial(input); */ /* 1993/Jan/23 */
else verbout(output, line); /* 98/Jun/5 */
/* verbatim PostScript --- 1993/Aug/15 */
/* else complainjflag(input); */ /* 98/Jun/5 */
- flushspecial(input); /* flush the rest if any */
+ flush_special(input); /* flush the rest if any */
} /* end of code for ps:: case */
else { /* deal with ps: plotfile or ps: overlay etc */
(void) ungetc(c, input); nspecial++;
fliteral = ftell(input); /* remember where this was */
nliteral = nspecial; /* 1992/Sep/25 */
-/* if (getalphatoken(input, line, MAXLINE) == 0) { */
-/* if (bSciWord) flag = gettoken(input, line, MAXLINE); */
- if (bSciWord) flag = gettoken(input, line, sizeof(line));
-/* else flag = getalphatoken(input, line, MAXLINE); */
- else flag = getalphatoken(input, line, sizeof(line));
+/* if (get_alpha_token(input, line, MAXLINE) == 0) { */
+/* if (bSciWord) flag = get_token(input, line, MAXLINE); */
+ if (bSciWord) flag = get_token(input, line, sizeof(line));
+/* else flag = get_alpha_token(input, line, MAXLINE); */
+ else flag = get_alpha_token(input, line, sizeof(line));
if (flag == 0) { /* 1994/Apr/22 */
showline("Premature end of special\n", 1);
return -1;
}
if (strcmp(line, "plotfile") == 0) { /* deal with plotfile */
-/* while (getalphatoken(input, line, MAXLINE) > 0) { */
+/* while (get_alpha_token(input, line, MAXLINE) > 0) { */
/* deal with filename | global | local | inline | asis ??? */
-/* (void) gettoken(input, epsfilename, FNAMELEN); */ /* file name */
- (void) gettoken(input, epsfilename, sizeof(epsfilename)); /* file name */
+/* (void) get_token(input, epsfilename, FNAMELEN); */ /* file name */
+ (void) get_token(input, epsfilename, sizeof(epsfilename)); /* file name */
if (pstagstyle != 0) { /* only if between [begin] & [end] */
/* actually, now do nothing except copy the file ! */
copyepsfile(output, epsfilename, 1, 0); /* incl & no shift */
}
} /* end of "plotfile" case */
else if (strcmp(line, "overlay") == 0) { /* deal with overlay */
-/* while (getalphatoken(input, line, MAXLINE) > 0) { */
+/* while (get_alpha_token(input, line, MAXLINE) > 0) { */
/* deal with filename | on | off ??? */
-/* (void) gettoken(input, epsfilename, FNAMELEN); */ /* file name */
- (void) gettoken(input, epsfilename, sizeof(epsfilename)); /* file name */
+/* (void) get_token(input, epsfilename, FNAMELEN); */ /* file name */
+ (void) get_token(input, epsfilename, sizeof(epsfilename)); /* file name */
if (pstagstyle != 0) { /* only if between [begin] & [end] */
/* actually, now do nothing except copy the file ! */
/* fprintf(output, "dviso "); ? */
} /* end of "overlay" case */
else if (strcmp(line, "epsfile") == 0) { /* ArborText ? */
/* strcmp(line, "EPSFILE") == 0 */
-/* if(gettoken(input, epsfilename, FNAMELEN) > 0) { */ /* file name */
- if(gettoken(input, epsfilename, sizeof(epsfilename)) > 0) { /* file name */
+/* if(get_token(input, epsfilename, FNAMELEN) > 0) { */ /* file name */
+ if(get_token(input, epsfilename, sizeof(epsfilename)) > 0) { /* file name */
startspecial(output);
/* ArborText scale may be per mille */
-/* if(gettoken(input, line, MAXLINE) > 0) { */ /* scale ? */
- if(gettoken(input, line, sizeof(line)) > 0) { /* scale ? */
+/* if(get_token(input, line, MAXLINE) > 0) { */ /* scale ? */
+ if(get_token(input, line, sizeof(line)) > 0) { /* scale ? */
if(sscanf(line, "%lg", &scale) > 0) {
if (scale > 33.33) scale = scale/1000.0;
sprintf(logline, "%lg dup scale \n", scale);
else complainspecial(input);
} /* end of "epsfile" case */
else if (strcmp(line, "include") == 0) {
-/* if(gettoken(input, epsfilename, FNAMELEN) > 0) { */
- if(gettoken(input, epsfilename, sizeof(epsfilename)) > 0) {
+/* if(get_token(input, epsfilename, FNAMELEN) > 0) { */
+ if(get_token(input, epsfilename, sizeof(epsfilename)) > 0) {
if (pssvbstyle != 0) /* only if after startTexFig */
copyepsfile(output, epsfilename, 0, 0);
/* no inc & no shift */
else if (strcmp(line, "literal") == 0) { /* DVI2PS-SVB */
/* printf(" LITERAL: pssvbstyle %d", pssvbstyle); */
/* if (verbatimflag != 0) {
- copystring(output, input);
+ copy_string(output, input);
} */
- if (scanspecial(input, line, MAXLINE) == MAXLINE) {
+ if (scan_special(input, line, MAXLINE) == MAXLINE) {
if (verbatimflag != 0) { /* long ps: literal verbatim */
fseek(input, fliteral, SEEK_SET);
nspecial = nliteral;
PSputc('\n', output); // always on new line ?
PSputs("revsclx ", output);
if (preservefont) PSputs("currentfont ", output);
- copystring(output, input);
+ copy_string(output, input);
if (preservefont) PSputs("setfont ", output);
PSputs("forsclx ", output);
}
else complainjflag(input); /* 93/Oct/17 */
/* else complainspecial(input); */
/* if (pssvbstyle == 0) fprintf(output, "\nrevscl\n"); */
-/* copystring(output, input); */
+/* copy_string(output, input); */
/* if (pssvbstyle == 0) fprintf(output, "forscl\n"); */
} /* end of "literal" case */
/* could check for presence of : or / here */
/* how does SciWord deal with scaling ? */
else if (bSciWord != 0) { /* just has the EPS file name here */
-/* if (gettoken(input, epsfilename, FNAMELEN) > 0) { */
+/* if (get_token(input, epsfilename, FNAMELEN) > 0) { */
if (strcmp(line, "") != 0 && strlen(line) < sizeof(epsfilename)) {
strcpy(epsfilename, line);
startspecial(output);
fseek(input, fliteral, SEEK_SET);
nspecial = nliteral;
if (bOldDVIPSFlag || bOldDVIPSFlip) { /* the old way */
- copystring(output, input);
+ copy_string(output, input);
}
else { /* new 96/Nov/11 */
- if (scanspecial(input, line, MAXLINE) != MAXLINE) {
+ if (scan_special(input, line, MAXLINE) != MAXLINE) {
t = s = line;
/* precede each `rotate' by `neg' */
while ((s = strstr(t, "rotate")) != NULL) {
else { /* it was too long - so just copy the damn thing */
fseek(input, fliteral, SEEK_SET);
nspecial = nliteral;
- copystring(output, input);
+ copy_string(output, input);
}
}
if (bOldDVIPSFlag) { /* 94/Oct/4 */
}
/* else complainspecial(input); */
}
- flushspecial(input);
+ flush_special(input);
return 0;
}
int lineno=0;
char srcfile[FILENAME_MAX]="";
- (void) scanspecial(input, line, MAXLINE); /* read rest of line */
+ (void) scan_special(input, line, MAXLINE); /* read rest of line */
if (sscanf(line, "%d%s", &lineno, srcfile) > 1) {
if (stripcomment == 0) {
PSputc('\n', output); // always on new line ?
/* Is it one of DVIWINDO's specials ? */ /* colon after `color' 95/June/21 */
else if (strcmp(line, "color") == 0) doColor(output, input, ':', 1);
else if (strcmp(line, "clip") == 0) doClipBox(output, input, ':');
- else if (strcmp(line, "comment") == 0) flushspecial(input); /* 95/June/21*/
- else if (strcmp(line, "PDF") == 0) flushspecial(input); /* 95/July/4 */
+ else if (strcmp(line, "comment") == 0) flush_special(input); /* 95/June/21*/
+ else if (strcmp(line, "PDF") == 0) flush_special(input); /* 95/July/4 */
#ifdef AllowCTM
else if (strcmp(line, "CTM") == 0) doCTM(output, input); /* 95/Oct/10 */
#endif
else if (strcmp(line, "message") == 0) { /* 1995/June/21 */
showline(" ", 0);
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
showline(line, 0);
}
#ifdef TIFF
strcmp(line, "button") == 0 ||
strcmp(line, "mark") == 0 ||
strcmp(line, "insertimage") == 0) {
- flushspecial(input);
+ flush_special(input);
if (quietflag == 0)
showline(" Ignoring DVIWindo \\special", 1);
/* strcmp(line, "insertmf") == 0) {} */ /* error in DVIPSONE */
}
#endif
else if (strcmp(line, "revset") == 0) { /* HP TAG revset: 4pt \special */
- flushspecial(input);
+ flush_special(input);
if (traceflag) showline(" Ignoring revset", 1);
}
else if (strcmp(line, "src") == 0) { /* 98/Nov/4 */
if (stripcomment == 0) DoScr(output, input);
- else flushspecial(input);
+ else flush_special(input);
}
/* Try Andrew Treverrow file inclusion, but only if -j used */
else if (verbatimflag && readandrew(output, input)) { /* try OzTeX ? go south ! */
// Now adds a space at end in case raw PS follows from \special 2000/Feb/16
// On entry contains TPIC command token in line
-// If it takes arguments, scanspecial is used to read in the rest
+// If it takes arguments, scan_special is used to read in the rest
int readtpic (FILE *output, FILE *input)
{
PSputc('\n', output);
if (strcmp(line, "pn") == 0) { /* pn n - set pen width */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
if (sscanf (line, "%lg", &z) < 1) { /* complain if < 1 ? */
}
/* pen width NORMALLY is in milli-inches */
PSputs(logline, output);
}
else if (strcmp(line, "pa") == 0) { /* pa x y - add point to path */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
if (sscanf (line, "%ld %ld", &x, &y) < 2) { /* complain if < 2 ? */
}
#ifdef ALLOWSCALE
else if (strcmp(line, "da") == 0 ||
strcmp(line, "dt") == 0) { /* da/dt l - stroke dashed/dotted */
strcpy(temp, line);
- (void) scanspecial(input, line, MAXLINE); /* complain if < 1 ? */
+ (void) scan_special(input, line, MAXLINE); /* complain if < 1 ? */
if (sscanf (line, "%lg", &z) < 1) {
}
/* dash/dot interval NORMALLY is in inches */
xold = 0; yold = 0; /* reset path */
}
else if (strcmp(line, "sp") == 0) { /* sp [l] - stroke quadratic spline */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
if (sscanf (line, "%lg", &z) > 0) { // has an argument ?
/* dash/dot interval NORMALLY is in inches */
if (z > -MINMILLI && z < MINMILLI) z = z * 1000.0; /* inches */
else if (strcmp(line, "ar") == 0 ||
strcmp(line, "ia") == 0) { /* ar/ia x y xr yr sa ea */
strcpy(temp, line); // either "ar" or "ia"
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
sa = 0.0; ea = 2.0 * PI; /* in case angles omitted */
if (sscanf(line, "%ld %ld %ld %ld %lg %lg",
&x, &y, &xr, &yr, &sa, &ea) < 6) {
}
else if (strcmp(line, "sh") == 0 ||
strcmp(line, "cl") == 0) { /* sh [s] */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
/* deal with color specification using three values ? */
/* grey = 0.5; */
if (sscanf(line, "%lg %lg %lg", &r, &g, &b) < 3) {
PSputs(line, output);
}
else if (strcmp(line, "tx") == 0) { /* tx */
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
/* need to count bits in hexadecimal mask pattern here */
bitsone=0; bitstot=0;
s = line;
}
if (needtpic == 0)
showline(" ERROR: TPIC failure\n", 1); /* debugging */
- flushspecial(input); /* clean out the rest */
+ flush_special(input); /* clean out the rest */
return -1;
}
int c;
if (bIgnoreSpecials != 0) { /* ignore \specials ? */
- flushspecial(input);
+ flush_special(input);
return 0;
}
c = getc(input);
--nspecial;
if (c == 0 && bFirstNull) { /* flush if first byte is null 96/Aug/29 */
- flushspecial(input);
+ flush_special(input);
return 0;
}
PSputs("/showpage{}def ", output); /* 97/Mar/9 */
if (bProtectStack) PSputs("[ ", output); /* 97/Nov/24 */
if (bStoppedContext) PSputs("{ ", output); /* 97/Nov/24 */
- copystring(output, input);
+ copy_string(output, input);
if (bStoppedContext) PSputs(" } stopped", output); /* 97/Nov/24 */
if (bProtectStack) PSputs(" cleartomark", output); /* 97/Nov/24 */
PSputs(" restore", output); /* 93/Oct/17 */
/* support for `literal macros' kludge in dvips - start with ! */
if (c == '!') { /* 94/Jan/28 */
/* ignore now, already taken care of in dvipslog ! as headertext=... */
- flushspecial(input);
+ flush_special(input);
return 0;
}
(void) ungetc(c, input); /* put back the first byte */
nspecial++;
- if ((c = getalphatoken(input, line, sizeof(line))) == 0)
+ if ((c = get_alpha_token(input, line, sizeof(line))) == 0)
{
if (quietflag == 0) showline(" Blank special", 1);
return 0; /* found nothing ! */
if (strncmp(line, "if", 2) == 0) { /* new conditional option 99/July/2 */
if (strcmp(line+2, "print") != 0) { /* ignore all but ifprint */
- flushspecial(input); /* not for DVIPSONE */
+ flush_special(input); /* not for DVIPSONE */
return 0;
}
- else if ((c = getalphatoken(input, line, sizeof(line))) == 0) { /* recurse */
+ else if ((c = get_alpha_token(input, line, sizeof(line))) == 0) { /* recurse */
if (quietflag == 0) showline(" Blank special", 1);
return 0; /* found nothing ! */
}
else if (strcmp(line, "color") == 0) doColor(output, input, c, 1);
else if (strcmp(line, "clip") == 0) doClipBox(output, input, c); /* 98/Sep/12 */
else if (strcmp(line, "background") == 0) /* used only during prescan ? */
- flushspecial(input); /* 98/Jun/30 */
+ flush_special(input); /* 98/Jun/30 */
else if (strcmp(line, "landscape") == 0)
/* texlandscape(output); */ /* no, used only in prescan foils.cls */
- flushspecial(input); /* 99/Apr/5 */
+ flush_special(input); /* 99/Apr/5 */
/* have to do DVIPS / Texture style FIRST, or they get caught by following: */
else if (c == ' ' && nspecial > 0) {
if (allowtpic == 0 || readtpic(output, input) == 0) {
int c;
if (bIgnoreSpecials != 0) { /* ignore \specials ? */
- flushspecial(input);
+ flush_special(input);
return;
}
}
if (c == 0 && bFirstNull) { /* flush if first byte is null 96/Aug/29 */
- flushspecial(input);
+ flush_special(input);
return;
}
/* support for `literal graphics' kludge in dvips - start with " */
if (c == '\"') {
- flushspecial(input);
+ flush_special(input);
return;
}
/* support for `literal macros' kludge in dvips - start with ! */
if (c == '!') {
- flushspecial(input); /* taken care of in dvipslog */
+ flush_special(input); /* taken care of in dvipslog */
return;
}
(void) ungetc(c, input); nspecial++; /* put it back */
- if ((c = getalphatoken(input, line, sizeof(line))) == 0) {
+ if ((c = get_alpha_token(input, line, sizeof(line))) == 0) {
return; /* found nothing ! */
}
if (c == ' ' || c == ':') {
doColor(NULL, input, c, 0); /* no PS output */
}
}
- else flushspecial(input);
+ else flush_special(input);
return;
}
char units[3];
int n;
-/* if (getalphatoken(input, line, MAXLINE) == 0) { */
- if (getalphatoken(input, line, sizeof(line)) == 0) {
+/* if (get_alpha_token(input, line, MAXLINE) == 0) { */
+ if (get_alpha_token(input, line, sizeof(line)) == 0) {
complainspecial(input);
return;
}
if (strcmp(line, "message") == 0) {
showline(" ", 0);
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
showline(line, 0);
}
else if (strcmp(line, "linewidth") == 0) {
- (void) scanspecial(input, line, MAXLINE);
+ (void) scan_special(input, line, MAXLINE);
s = line;
if (sscanf(s, "%lg%n", &linewidth, &n) == 0) {
showline("linewidth not specified", 0); /* used default */