w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

plain2.c File Reference
#include <stdio.h>
#include <ctype.h>
#include "plain2.h"
#include "macro.h"
Include dependency graph for plain2.c:

Go to the source code of this file.

Macros

#define PLAIN2MAIN
 
#define PLAIN2_USAGE_1   "\usage: plain2 [options] [files ...]\n\ ---- parser options ---- ---- output options ----(default)\n\-table=dd: table factor [0-100](def=50) -roff: troff output\n\-exam=dd: example factor[0-100](def=50) -ms/-mm: troff macro (mm)\n\-indsec: sections can be indented -tex: tex output\n\-ktable:enable JIS keisen table -tstyle=ss:tex style\n\-ref: figure/picture reference -renum: renumbering only\n\ -[no]listd:list decoration (on)\n\ ---- Others ---- -[no]space:spacing (on)\n\-v: verbose output -[no]pre: preamble block (on)\n\-dLevel: debug level -[no]acursec: section numbers (off)\n\ ----- experimental ---- -raw: quote special chars(off)\n\-pt=Size: font size -jis: JIS code output\n\ -sjis: Shift-JIS code input/output\n\ -f file: output customization\n"
 
#define VERSION   "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST"
 
#define nttSty(s)   styleConv(s, 1)
 
#define asciiSty(s)   styleConv(s, 0)
 
#define OUTPUT_OPTION(opt)
 
#define MAX_ARGC   32
 

Functions

char * getenv ()
 
 main (int argc, char **argv)
 
char * styleConv (char *s, int nttflag)
 
 doPlain2 ()
 
 freeAll ()
 
 getOption (int xargc, char **xargv)
 
 optionLine (char *s)
 
 envOption ()
 
 saveParseDefaults ()
 
 restoreParseDefaults ()
 

Variables

char * optarg
 
int optind
 
struct macDefs roffMacros []
 
struct macDefs roffMsMacros []
 
struct macDefs texMacros []
 
int tableEnabled = 1
 
int jisTableEnabled = 0
 
int indentedSecnum = 0
 
int tableFactor = 50
 
int examFactor = 50
 
int removePaging = 0
 
int crossRefer = 0
 
int inlineHint = 1
 
int roffMacro = 1
 
int renumber = 0
 
int pageWidth = 820
 
int rawOutput = 0
 
int halfCooked = 0
 
int inputCode = 0
 
int outputCode = 0
 
int preamble = 1
 
int accurateSecnum = 0
 
int listDecor = 1
 
int reflectSpace = 1
 
int texQuote = 0
 
int fontSize = 10
 
int fontSpecified = 0
 
int verbose = 0
 
char * plain2Lib = NULL
 
char * macroName = NULL
 
char * texStyle = ""
 
struct outDevput = &roffPut
 
int useJverb = 0
 
FILEinFile
 
struct text ** texts
 
struct texttextTop
 
struct textBlockpageBp
 
int textLines
 
int textBegin
 
int rightMargin
 
int japaneseText
 
int titleStyle
 
int anySection = 0
 
char * fname
 
int acceptOutOption
 
int stflag = 1
 
static int defJapaneseText
 
static int defTableEnabled
 
static int defJisTableEnabled
 
static int defIndentedSecnum
 
static int defRawOutput
 
static int defTableFactor
 
static int defExamFactor
 

Macro Definition Documentation

◆ asciiSty

#define asciiSty (   s)    styleConv(s, 0)

Definition at line 251 of file plain2.c.

◆ MAX_ARGC

#define MAX_ARGC   32

Definition at line 628 of file plain2.c.

◆ nttSty

#define nttSty (   s)    styleConv(s, 1)

Definition at line 250 of file plain2.c.

◆ OUTPUT_OPTION

#define OUTPUT_OPTION (   opt)
Value:
{\
if (!acceptOutOption) {\
illegopt=opt;\
goto dontOutOpt;\
}\
}\
int acceptOutOption
Definition: plain2.c:122

Definition at line 387 of file plain2.c.

◆ PLAIN2_USAGE_1

#define PLAIN2_USAGE_1   "\usage: plain2 [options] [files ...]\n\ ---- parser options ---- ---- output options ----(default)\n\-table=dd: table factor [0-100](def=50) -roff: troff output\n\-exam=dd: example factor[0-100](def=50) -ms/-mm: troff macro (mm)\n\-indsec: sections can be indented -tex: tex output\n\-ktable:enable JIS keisen table -tstyle=ss:tex style\n\-ref: figure/picture reference -renum: renumbering only\n\ -[no]listd:list decoration (on)\n\ ---- Others ---- -[no]space:spacing (on)\n\-v: verbose output -[no]pre: preamble block (on)\n\-dLevel: debug level -[no]acursec: section numbers (off)\n\ ----- experimental ---- -raw: quote special chars(off)\n\-pt=Size: font size -jis: JIS code output\n\ -sjis: Shift-JIS code input/output\n\ -f file: output customization\n"

Definition at line 43 of file plain2.c.

◆ PLAIN2MAIN

#define PLAIN2MAIN

Definition at line 15 of file plain2.c.

◆ VERSION

#define VERSION   "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST"

Definition at line 59 of file plain2.c.

Function Documentation

◆ doPlain2()

◆ envOption()

envOption ( )

Definition at line 662 of file plain2.c.

References buf, exit(), fclose, fgets, FILE, fopen, fprintf, getenv(), iskanji1(), MAX_LINE_LEN, NULL, optionLine(), p, PLAIN2_ENV, strcpy(), and void.

Referenced by main().

◆ freeAll()

freeAll ( )

Definition at line 368 of file plain2.c.

References body(), free, i, cutout::l, textBlock::rend, textLines, and texts.

Referenced by doPlain2().

◆ getenv()

char* getenv ( )

Referenced by envOption(), and main().

◆ getOption()

◆ main()

◆ optionLine()

optionLine ( char *  s)

Definition at line 629 of file plain2.c.

References fprintf, getOption(), isspace, MAX_ARGC, optind, s, void, xargc, and xargv.

Referenced by envOption(), and getTitleBlock().

◆ restoreParseDefaults()

◆ saveParseDefaults()

◆ styleConv()

char* styleConv ( char *  s,
int  nttflag 
)

Definition at line 215 of file plain2.c.

References buf, exit(), fprintf, isspace, malloc, NULL, p, s, strcpy(), strlen(), strncpy(), and useJverb.

Variable Documentation

◆ acceptOutOption

int acceptOutOption

Definition at line 122 of file plain2.c.

Referenced by main().

◆ accurateSecnum

int accurateSecnum = 0

Definition at line 94 of file plain2.c.

Referenced by getOption(), and outputBlock().

◆ anySection

int anySection = 0

Definition at line 120 of file plain2.c.

Referenced by main(), and outputBlock().

◆ crossRefer

int crossRefer = 0

Definition at line 81 of file plain2.c.

Referenced by getOption(), htmlFTitle(), outputBlock(), and texFTitle().

◆ defExamFactor

int defExamFactor
static

Definition at line 715 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defIndentedSecnum

int defIndentedSecnum
static

Definition at line 712 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defJapaneseText

int defJapaneseText
static

Definition at line 709 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defJisTableEnabled

int defJisTableEnabled
static

Definition at line 711 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defRawOutput

int defRawOutput
static

Definition at line 713 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defTableEnabled

int defTableEnabled
static

Definition at line 710 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ defTableFactor

int defTableFactor
static

Definition at line 714 of file plain2.c.

Referenced by restoreParseDefaults(), and saveParseDefaults().

◆ examFactor

int examFactor = 50

Definition at line 79 of file plain2.c.

Referenced by ExampleCheck(), getOption(), restoreParseDefaults(), and saveParseDefaults().

◆ fname

char* fname

Definition at line 121 of file plain2.c.

Referenced by CL::CommandLine::addFilename(), HtmlPage::addImage(), area_split_name(), arrayRead(), batch_file_with_spaces(), btestin(), codegen(), FileSystem::collect(), comp_bfname(), DVIToSVG::convert(), TemporaryFile::create(), PsSpecialHandler::createImageNode(), createstdfile(), doPlain2(), emit_fold(), emit_lib(), emtex_dir_find(), ensure_suffix(), err_argmsg(), error_with_perror(), FileSystem::exists(), ff_apply_afmfile(), ff_apply_featurefile(), fhmtautogen(), file_timestamp_cons(), Font::filename(), FilePath::filename(), filename_suffix(), FileSystem::filesize(), find1(), find_file(), MiKTeXCom::findFile(), FileFinder::findFile(), FileFinder::findMappedFile(), fmorphautogen(), FontCache::fontinfo(), func_call(), gbasename(), Generate_Font(), genPathname(), get_libgs(), get_list(), getenv_(), getfigFontnumber(), getservername(), getSortedPathnamesInDirectory(), getTitleBlock(), GFGlyphTracer::GFGlyphTracer(), GFileBuildName(), GFileReplaceName(), gp_open_scratch_file(), handle_script(), PsSpecialHandler::image(), PsSpecialHandler::imgfile(), PsSpecialHandler::initialize(), io_file_open(), FileSystem::isDirectory(), FileSystem::isFile(), jbAddPages(), jbDataRead(), k_find_file(), kpathsea_db_insert(), kpathsea_in_name_ok(), kpathsea_in_name_ok_silent(), kpathsea_name_ok(), kpathsea_out_name_ok(), kpathsea_out_name_ok_1(), kpathsea_out_name_ok_silent(), lj_cf_dofile(), lj_cf_io_open(), lj_cf_io_popen(), lj_cf_loadfile(), FileFinder::lookup(), FileFinder::lookupExecutable(), luaB_dofile(), luaB_loadfile(), luaL_fileresult(), luaL_findtable(), luaL_getsubtable(), luaopen_lua(), luatex_dofile(), luatex_loadfile(), luatex_open_input(), luatex_open_output(), macroFile(), macroFopen(), main(), main_body(), match_subf(), FileFinder::mktex(), mktexupd(), mplib_char_dimension(), mplib_find_file(), mrb_cloexec_open(), mrb_kpse_in_name_ok(), mrb_kpse_out_name_ok(), open_in_or_pipe(), open_input(), open_input_with_dirname(), open_out_or_pipe(), open_output(), open_tfm_file(), Files::open_tmpnam(), open_vf_file(), opencheck(), opendir(), openfont(), openin(), openout(), MapLine::parseFilenameOptions(), PSInterpreter::pdfPageBox(), PSInterpreter::pdfPageCount(), pixHtmlViewer(), ppstream_info(), PsSpecialHandler::preprocess(), PdfSpecialHandler::preprocessMapfile(), PsSpecialHandler::process(), CMapReader::read(), TrueTypeFont::read(), FontMap::read(), FontCache::read(), read_config_file(), read_file(), util::read_file_contents(), ReadCfg(), FontMap::readdir(), FileSystem::remove(), remove_path(), GFGlyphTracer::reset(), FileSystem::rmdir(), S_close(), poppler::document::save(), poppler::document::save_a_copy(), scan_line(), scope_finish(), searchscr1(), searchscr2(), selaRead(), selaWrite(), select_file_name(), HtmlPage::setDocName(), SetErrorTrap(), GlyphTracerMessages::setFont(), FontEngine::setFont(), SetupCollectQuantStats(), SetupWriteDistortions(), FormWidgetSignature::signDocument(), HtmlOutputDev::startPage(), subst_subf(), synctex_record_input(), PhysicalFontImpl::tidy(), tmpfile2(), treatstackoption(), TrueTypeFont::TrueTypeFont(), Files::try_dir(), u_GFileBuildName(), u_GFileReplaceName(), XMLElement::write(), and write_xbb().

◆ fontSize

◆ fontSpecified

int fontSpecified = 0

Definition at line 99 of file plain2.c.

Referenced by getOption().

◆ halfCooked

int halfCooked = 0

Definition at line 90 of file plain2.c.

Referenced by doPlain2(), and getOption().

◆ indentedSecnum

int indentedSecnum = 0

Definition at line 77 of file plain2.c.

Referenced by appendix(), getOption(), lineAtrListSec(), restoreParseDefaults(), and saveParseDefaults().

◆ inFile

◆ inlineHint

int inlineHint = 1

Definition at line 82 of file plain2.c.

Referenced by getOption(), and textOuput().

◆ inputCode

int inputCode = 0

Definition at line 91 of file plain2.c.

Referenced by getOption().

◆ japaneseText

◆ jisTableEnabled

int jisTableEnabled = 0

Definition at line 76 of file plain2.c.

Referenced by getOption(), restoreParseDefaults(), saveParseDefaults(), and tblKwakuAttr().

◆ listDecor

int listDecor = 1

Definition at line 95 of file plain2.c.

Referenced by getOption(), mmListBlock(), and texListBlock().

◆ macroName

char* macroName = NULL

Definition at line 106 of file plain2.c.

Referenced by getOption(), and main().

◆ optarg

char* optarg
extern

Definition at line 42 of file getopt.c.

Referenced by getOption().

◆ optind

int optind
extern

Definition at line 39 of file getopt.c.

Referenced by getOption(), main(), and optionLine().

◆ outputCode

int outputCode = 0

Definition at line 92 of file plain2.c.

Referenced by codeCvt(), and getOption().

◆ pageBp

struct textBlock* pageBp

Definition at line 114 of file plain2.c.

Referenced by headerFooter(), overwritePaging(), and spacing().

◆ pageWidth

int pageWidth = 820

Definition at line 88 of file plain2.c.

Referenced by DVIReader::cmdPost().

◆ plain2Lib

char* plain2Lib = NULL

Definition at line 105 of file plain2.c.

Referenced by macroFile(), and main().

◆ preamble

int preamble ( void  ) = 1

Definition at line 93 of file plain2.c.

Referenced by doPlain2(), getOption(), and main().

◆ put

◆ rawOutput

int rawOutput = 0

◆ reflectSpace

int reflectSpace = 1

Definition at line 96 of file plain2.c.

Referenced by getOption(), and outputRegion().

◆ removePaging

int removePaging = 0

Definition at line 80 of file plain2.c.

Referenced by doPlain2(), and getOption().

◆ renumber

int renumber = 0

Definition at line 84 of file plain2.c.

Referenced by doPlain2(), and getOption().

◆ rightMargin

int rightMargin

Definition at line 117 of file plain2.c.

Referenced by analyzeLines(), expandListHead(), headerFields(), indType(), isCenter(), and overwritePaging().

◆ roffMacro

int roffMacro = 1

Definition at line 83 of file plain2.c.

Referenced by doPlain2(), getOption(), roffDlistItem(), roffListBlock(), and roffListItem().

◆ roffMacros

struct macDefs roffMacros[]
extern

Definition at line 5 of file roffout.c.

Referenced by doPlain2().

◆ roffMsMacros

struct macDefs roffMsMacros[]

Definition at line 66 of file plain2.c.

Referenced by doPlain2().

◆ stflag

int stflag = 1

Definition at line 131 of file plain2.c.

Referenced by doPlain2(), and getOption().

◆ tableEnabled

int tableEnabled = 1

Definition at line 75 of file plain2.c.

Referenced by doPlain2(), getOption(), restoreParseDefaults(), and saveParseDefaults().

◆ tableFactor

int tableFactor = 50

Definition at line 78 of file plain2.c.

Referenced by getOption(), restoreParseDefaults(), saveParseDefaults(), and tblCheck().

◆ texMacros

struct macDefs texMacros[]
extern

Definition at line 5 of file texout.c.

Referenced by doPlain2().

◆ texQuote

int texQuote = 0

Definition at line 97 of file plain2.c.

Referenced by getOption(), and texTextQuote().

◆ texStyle

char* texStyle = ""

Definition at line 107 of file plain2.c.

Referenced by doPlain2(), and getOption().

◆ textBegin

int textBegin

Definition at line 116 of file plain2.c.

Referenced by doPlain2(), outputDocument(), and prevLine().

◆ textLines

int textLines

Definition at line 115 of file plain2.c.

Referenced by doPlain2(), fixListEnd(), freeAll(), nextLine(), outputDocument(), and readAndStoreFile().

◆ texts

◆ textTop

struct text* textTop

Definition at line 113 of file plain2.c.

Referenced by readAndStoreFile().

◆ titleStyle

int titleStyle

Definition at line 119 of file plain2.c.

Referenced by getTitleBlock(), and outputTitle().

◆ useJverb

int useJverb = 0

Definition at line 109 of file plain2.c.

Referenced by getOption(), main(), outputBlock(), styleConv(), and texTextQuote().

◆ verbose

int verbose = 0

Definition at line 100 of file plain2.c.

Referenced by getOption().