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)  

devnag.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for devnag.c:

Go to the source code of this file.

Classes

struct  char_def
 
struct  cons_joins
 
struct  ligs
 
struct  typcom
 

Macros

#define TRUE   1
 
#define FALSE   0
 
#define VIRAAM   94
 
#define SMALLBUF   30
 
#define MEDBUF   512
 
#define MAXBUF   2048
 
#define N_NOLIGS   (sizeof nolig / sizeof nolig[0])
 
#define N_MNOLIGS   (sizeof modnolig / sizeof modnolig[0])
 
#define ill_char   29
 
#define dummy   30
 
#define end_of_file   30
 
#define end_of_line   31
 
#define illegal   0
 
#define cmr   1
 
#define control   2
 
#define dn   3
 
#define numeral   4
 
#define lo_vowel   0
 
#define hi_vowel   1
 
#define consonant   2
 
#define special   3
 
#define LBRACE   273
 
#define RBRACE   264
 
#define RE   263 /* \thinspace on switching from cmr to dn */
 
#define RDT   266 /* raised r-dot (repha + anusvara) */
 
#define RN   265 /* numeral, using cmr or dn as appropriate */
 
#define RS   256 /* \thinspace on switching from dn to cmr */
 
#define DEFAULT_SRC_EXT   ".dn"
 
#define DEFAULT_DEST_EXT   ".tex"
 
#define FOPEN_W_MODE   "w"
 

Functions

int main (int argc, char **argv)
 
void dnproc (void)
 
void put_ch (short code)
 
void sendchar (char c)
 
void put_sym (short code)
 
void put_word (void)
 
void put_syll (void)
 
void tst_half (void)
 
void put_macro (short macro)
 
void err_ill (const char *str)
 
char inp_ch (void)
 
void expand (void)
 
char find_dn (void)
 
int sindex (int i, short t)
 
void fixconj (short *wrong, short *right)
 
char * fgetline (char *buf, int n, FILE *f)
 
int test_command (void)
 
char test_sub_com (void)
 
char comm_double_args (void)
 
char comm_special (void)
 
char comm_opt (void)
 
char comm_chapter (void)
 
char comm_cite (void)
 
char * getsubarg (void)
 
char comm_begin (void)
 
char ignore (void)
 

Variables

const char * version = "2.17"
 
FILEf_in
 
FILEf_out
 
char * p_in
 
int charbuf
 
int wasCR = 0
 
int charpresent = 0
 
int number
 
char symbol
 
char infil [512]
 
char outfil [512]
 
char inbuf [2048]
 
char outbuf [2048]
 
char word [512]
 
short syll [30]
 
int n_halves
 
int buf_idx
 
short half_codes [30]
 
short joincode
 
unsigned char hindi_mode
 
unsigned char mhindi_mode
 
unsigned char dollar_mode
 
unsigned char d_found
 
unsigned char tabs_mode
 
unsigned char no_dn
 
unsigned char wait_syll
 
unsigned char do_hyphen
 
unsigned char do_vconjuncts
 
unsigned char cons_seen
 
unsigned char vow_seen
 
unsigned char front_r
 
unsigned char cmr_mode
 
unsigned char num_mode
 
unsigned char lig_block
 
short chr_idx
 
short cons_code
 
const char * banner
 
int citation
 
int optchapter
 
int linenumber
 
short nolig []
 
short modnolig []
 
short ligidxs []
 
char chset1 []
 
char chset2 [] = {'a','i','u',' '}
 
char chset3 [] = {'n','s',' '}
 
char chset4 [] = {'k','g','c','j','t','d','p','b','R',' '}
 
char chset5 [] = {'A','E','O'}
 
char chset6 [] = {'n','o','a','r','m',' '}
 
struct char_def char_table []
 
struct cons_joins cons_table []
 
struct ligs lig_table []
 
const char * out_string []
 
short r_ligs [6][2]
 
typcom TabCom []
 
typcom TabSubCom []
 
char command [100]
 
int nbchcomm
 
char subcom [1000]
 

Macro Definition Documentation

◆ cmr

#define cmr   1

Definition at line 322 of file devnag.c.

◆ consonant

#define consonant   2

Definition at line 329 of file devnag.c.

◆ control

#define control   2

Definition at line 323 of file devnag.c.

◆ DEFAULT_DEST_EXT

#define DEFAULT_DEST_EXT   ".tex"

Definition at line 342 of file devnag.c.

◆ DEFAULT_SRC_EXT

#define DEFAULT_SRC_EXT   ".dn"

Definition at line 341 of file devnag.c.

◆ dn

#define dn   3

Definition at line 324 of file devnag.c.

◆ dummy

#define dummy   30

Definition at line 313 of file devnag.c.

◆ end_of_file

#define end_of_file   30

Definition at line 314 of file devnag.c.

◆ end_of_line

#define end_of_line   31

Definition at line 315 of file devnag.c.

◆ FALSE

#define FALSE   0

Definition at line 305 of file devnag.c.

◆ FOPEN_W_MODE

#define FOPEN_W_MODE   "w"

◆ hi_vowel

#define hi_vowel   1

Definition at line 328 of file devnag.c.

◆ ill_char

#define ill_char   29

Definition at line 312 of file devnag.c.

◆ illegal

#define illegal   0

Definition at line 321 of file devnag.c.

◆ LBRACE

#define LBRACE   273

Definition at line 333 of file devnag.c.

◆ lo_vowel

#define lo_vowel   0

Definition at line 327 of file devnag.c.

◆ MAXBUF

#define MAXBUF   2048

Definition at line 309 of file devnag.c.

◆ MEDBUF

#define MEDBUF   512

Definition at line 308 of file devnag.c.

◆ N_MNOLIGS

#define N_MNOLIGS   (sizeof modnolig / sizeof modnolig[0])

Definition at line 311 of file devnag.c.

◆ N_NOLIGS

#define N_NOLIGS   (sizeof nolig / sizeof nolig[0])

Definition at line 310 of file devnag.c.

◆ numeral

#define numeral   4

Definition at line 325 of file devnag.c.

◆ RBRACE

#define RBRACE   264

Definition at line 334 of file devnag.c.

◆ RDT

#define RDT   266 /* raised r-dot (repha + anusvara) */

Definition at line 336 of file devnag.c.

◆ RE

#define RE   263 /* \thinspace on switching from cmr to dn */

Definition at line 335 of file devnag.c.

◆ RN

#define RN   265 /* numeral, using cmr or dn as appropriate */

Definition at line 337 of file devnag.c.

◆ RS

#define RS   256 /* \thinspace on switching from dn to cmr */

Definition at line 338 of file devnag.c.

◆ SMALLBUF

#define SMALLBUF   30

Definition at line 307 of file devnag.c.

◆ special

#define special   3

Definition at line 330 of file devnag.c.

◆ TRUE

#define TRUE   1

Definition at line 304 of file devnag.c.

◆ VIRAAM

#define VIRAAM   94

Definition at line 306 of file devnag.c.

Function Documentation

◆ comm_begin()

char comm_begin ( void  )

Definition at line 1202 of file devnag.c.

References free, getsubarg(), i, ignore(), inp_ch(), sendchar(), strcmp(), subcom, symbol, TabSubCom, and typcom::Typ_Com.

Referenced by dnproc().

◆ comm_chapter()

char comm_chapter ( void  )

Definition at line 1162 of file devnag.c.

References inp_ch(), optchapter, sendchar(), and symbol.

Referenced by dnproc().

◆ comm_cite()

char comm_cite ( void  )

Definition at line 1175 of file devnag.c.

References citation, inp_ch(), sendchar(), symbol, and test_sub_com().

Referenced by dnproc().

◆ comm_double_args()

char comm_double_args ( void  )

Definition at line 1102 of file devnag.c.

References ignore(), inp_ch(), sendchar(), subcom, and symbol.

Referenced by dnproc().

◆ comm_opt()

char comm_opt ( void  )

Definition at line 1151 of file devnag.c.

References inp_ch(), sendchar(), subcom, and symbol.

Referenced by dnproc().

◆ comm_special()

char comm_special ( void  )

Definition at line 1129 of file devnag.c.

References inp_ch(), sendchar(), subcom, and symbol.

Referenced by dnproc().

◆ dnproc()

◆ err_ill()

void err_ill ( const char *  str)

Definition at line 2417 of file devnag.c.

References exit(), fprintf, inbuf, linenumber, and str.

Referenced by dnproc(), and put_ch().

◆ expand()

void expand ( void  )

Definition at line 2455 of file devnag.c.

References chr_idx, cons_code, r_ligs, RBRACE, and syll.

Referenced by put_ch().

◆ fgetline()

char * fgetline ( char *  buf,
int  n,
FILE f 
)

Definition at line 2560 of file devnag.c.

References buf, charbuf, charpresent, EOF, f, FALSE, fgetc, k, n, NULL, TRUE, and wasCR.

Referenced by inp_ch(), and main().

◆ find_dn()

char find_dn ( void  )

Definition at line 2479 of file devnag.c.

References d_found, dollar_mode, FALSE, inbuf, isalpha, memmove, no_dn, NULL, outbuf, strchr, strlen(), strstr(), and TRUE.

Referenced by main().

◆ fixconj()

void fixconj ( short *  wrong,
short *  right 
)

Definition at line 2544 of file devnag.c.

References chr_idx, i, right, and syll.

Referenced by put_ch().

◆ getsubarg()

char * getsubarg ( void  )

Definition at line 1185 of file devnag.c.

References i, isalpha, j, malloc, check-static-inits::result, strcpy(), strlen(), and subcom.

Referenced by comm_begin().

◆ ignore()

◆ inp_ch()

◆ main()

◆ put_ch()

◆ put_macro()

void put_macro ( short  macro)

Definition at line 2367 of file devnag.c.

References chr_idx, i, LBRACE, macro, RBRACE, sprintf, strlen(), and syll.

Referenced by put_ch().

◆ put_syll()

void put_syll ( void  )

Definition at line 2302 of file devnag.c.

References chr_idx, cons_seen, do_vconjuncts, FALSE, front_r, i, lig_block, out_string, sindex(), syll, vow_seen, and wait_syll.

Referenced by dnproc(), and put_ch().

◆ put_sym()

void put_sym ( short  code)

Definition at line 2275 of file devnag.c.

References out_string.

Referenced by put_ch().

◆ put_word()

void put_word ( void  )

Definition at line 2282 of file devnag.c.

References do_hyphen, memmove, NULL, outbuf, strlen(), and strstr().

Referenced by dnproc(), ignore(), put_ch(), and sendchar().

◆ sendchar()

void sendchar ( char  c)

◆ sindex()

int sindex ( int  i,
short  t 
)

Definition at line 2533 of file devnag.c.

References chr_idx, i, j, and syll.

Referenced by convertNumToPDF(), pixBlendCmap(), pixSetSelectCmap(), pixSetSelectMaskedCmap(), and put_syll().

◆ test_command()

int test_command ( void  )

Definition at line 1069 of file devnag.c.

References i, strcmp(), TabCom, and typcom::Typ_Com.

Referenced by dnproc().

◆ test_sub_com()

char test_sub_com ( void  )

Definition at line 1082 of file devnag.c.

References inp_ch(), sendchar(), subcom, and symbol.

Referenced by comm_cite(), and dnproc().

◆ tst_half()

void tst_half ( void  )

Definition at line 2353 of file devnag.c.

References cons_code, cons_table, half_codes, cons_joins::j_code, joincode, and n_halves.

Referenced by put_ch().

Variable Documentation

◆ banner

const char* banner
Initial value:
=
"Preprocessor for Devanagari for TeX package\n\
Copyright (C) 1991-1998 University of Groningen, The Netherlands\n\
Author : Frans J. Velthuis <velthuis@rc.rug.nl>\n\
Maintainer : Zdenek Wagner <zdenek.wagner@gmail.com>"

Definition at line 373 of file devnag.c.

Referenced by main().

◆ buf_idx

int buf_idx

Definition at line 364 of file devnag.c.

Referenced by dnproc(), inp_ch(), main(), and re_string_translate_buffer().

◆ char_table

struct char_def char_table[]

Definition at line 541 of file devnag.c.

Referenced by parse_encoding(), put_ch(), and t42_parse_encoding().

◆ charbuf

◆ charpresent

int charpresent = 0

Definition at line 357 of file devnag.c.

Referenced by fgetline().

◆ chr_idx

short chr_idx

Definition at line 372 of file devnag.c.

Referenced by expand(), fixconj(), main(), put_ch(), put_macro(), put_syll(), and sindex().

◆ chset1

char chset1[]
Initial value:
= {
'k','t','d','o','n','s','r','g',
'h','a','.','K','T','D','l','L','R','m',' '
}

Definition at line 528 of file devnag.c.

Referenced by dnproc().

◆ chset2

char chset2[] = {'a','i','u',' '}

Definition at line 533 of file devnag.c.

Referenced by dnproc().

◆ chset3

char chset3[] = {'n','s',' '}

Definition at line 535 of file devnag.c.

Referenced by dnproc().

◆ chset4

char chset4[] = {'k','g','c','j','t','d','p','b','R',' '}

Definition at line 537 of file devnag.c.

Referenced by dnproc().

◆ chset5

char chset5[] = {'A','E','O'}

Definition at line 539 of file devnag.c.

Referenced by dnproc().

◆ chset6

char chset6[] = {'n','o','a','r','m',' '}

Definition at line 541 of file devnag.c.

Referenced by dnproc().

◆ citation

int citation

Definition at line 399 of file devnag.c.

Referenced by citation_used(), comm_cite(), and dnproc().

◆ cmr_mode

unsigned char cmr_mode

Definition at line 370 of file devnag.c.

Referenced by main(), and put_ch().

◆ command

◆ cons_code

short cons_code

Definition at line 372 of file devnag.c.

Referenced by expand(), put_ch(), and tst_half().

◆ cons_seen

unsigned char cons_seen

Definition at line 370 of file devnag.c.

Referenced by main(), put_ch(), and put_syll().

◆ cons_table

struct cons_joins cons_table[]

Definition at line 541 of file devnag.c.

Referenced by put_ch(), and tst_half().

◆ d_found

unsigned char d_found

Definition at line 367 of file devnag.c.

Referenced by dnproc(), and find_dn().

◆ do_hyphen

unsigned char do_hyphen

Definition at line 369 of file devnag.c.

Referenced by main(), put_ch(), and put_word().

◆ do_vconjuncts

unsigned char do_vconjuncts

Definition at line 369 of file devnag.c.

Referenced by main(), and put_syll().

◆ dollar_mode

unsigned char dollar_mode

Definition at line 367 of file devnag.c.

Referenced by dnproc(), find_dn(), and main().

◆ f_in

FILE* f_in

Definition at line 355 of file devnag.c.

Referenced by gabc_read_score(), inp_ch(), main(), and trans2dvi().

◆ f_out

FILE * f_out

Definition at line 355 of file devnag.c.

Referenced by dnproc(), main(), and put_ch().

◆ front_r

unsigned char front_r

Definition at line 370 of file devnag.c.

Referenced by main(), put_ch(), and put_syll().

◆ half_codes

short half_codes[30]

Definition at line 365 of file devnag.c.

Referenced by put_ch(), and tst_half().

◆ hindi_mode

unsigned char hindi_mode

Definition at line 367 of file devnag.c.

Referenced by main(), and put_ch().

◆ inbuf

char inbuf[2048]

Definition at line 361 of file devnag.c.

Referenced by dnproc(), err_ill(), find_dn(), inp_ch(), and main().

◆ infil

char infil[512]

Definition at line 360 of file devnag.c.

Referenced by main().

◆ joincode

short joincode

Definition at line 366 of file devnag.c.

Referenced by put_ch(), and tst_half().

◆ lig_block

unsigned char lig_block

Definition at line 371 of file devnag.c.

Referenced by main(), put_ch(), and put_syll().

◆ lig_table

struct ligs lig_table[]

Definition at line 541 of file devnag.c.

Referenced by main(), and put_ch().

◆ ligidxs

short ligidxs[]
Initial value:
= {
0,1,2,3,4,6,7,9,11,12,13,14,118,16,17,18,19,20,21,22,
23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,
42,43,44,45,46,47,48,49,50,52,53,119,54,55,56,58,59,60,
61,62,63,64,65,66,68,69,70,71,72,73,74,75,76,77,78,80,
81,82,84,85,86,87,88,89,90,91,92,93,94,95,96,98,99,100,
101,102,104,117,105,106,107,108,109,110,111,112,113
}

Definition at line 515 of file devnag.c.

Referenced by main().

◆ linenumber

int linenumber

◆ mhindi_mode

unsigned char mhindi_mode

Definition at line 367 of file devnag.c.

Referenced by main().

◆ modnolig

short modnolig[]
Initial value:
= {
0,1,2,3,4,6,7,9,10,11,12,14,16,17,18,19,20,21,22,23,
24,25,26,27,28,29,30,31,32,33,34,35,36,39,40,41,42,43,
44,45,46,47,48,49,50,52,53,54,56,58,59,62,64,65,69,70,
71,72,73,74,75,76,77,78,80,81,82,84,85,86,87,88,89,90,91,
92,93,94,95,98,99,100,101,102,103,104,105,118,119
}

Definition at line 503 of file devnag.c.

Referenced by main().

◆ n_halves

int n_halves

Definition at line 364 of file devnag.c.

Referenced by main(), put_ch(), and tst_half().

◆ nbchcomm

int nbchcomm

Definition at line 1062 of file devnag.c.

Referenced by dnproc().

◆ no_dn

unsigned char no_dn

Definition at line 369 of file devnag.c.

Referenced by dnproc(), and find_dn().

◆ nolig

short nolig[]
Initial value:
= {
2,3,6,7,16,25,27,34,35,39,40,46,47,49,56,58,59,62,65,
78,81,82,84,85,86,87,88,89,90,91,92,93,94,95,98,99,
100,101,105
}

Definition at line 496 of file devnag.c.

Referenced by letter_space_font(), main(), and new_letterspaced_font().

◆ num_mode

unsigned char num_mode

Definition at line 370 of file devnag.c.

Referenced by dnproc(), main(), and put_ch().

◆ number

int number

Definition at line 358 of file devnag.c.

◆ optchapter

int optchapter

Definition at line 400 of file devnag.c.

Referenced by comm_chapter(), and dnproc().

◆ out_string

const char* out_string[]

Definition at line 910 of file devnag.c.

Referenced by put_syll(), and put_sym().

◆ outbuf

char outbuf[2048]

Definition at line 361 of file devnag.c.

Referenced by dnproc(), find_dn(), main(), put_ch(), and put_word().

◆ outfil

char outfil[512]

Definition at line 360 of file devnag.c.

Referenced by main().

◆ p_in

char* p_in

Definition at line 356 of file devnag.c.

Referenced by Do_String_Lookup(), inp_ch(), main(), and TT_GSUB_Add_String().

◆ r_ligs

short r_ligs[6][2]
Initial value:
= {
{0243,1},
{0147,0},
{0144,2},
{0104,0},
{0304,1},
{0130,1}
}

Definition at line 957 of file devnag.c.

Referenced by expand().

◆ subcom

char subcom[1000]

◆ syll

short syll[30]

Definition at line 363 of file devnag.c.

Referenced by expand(), fixconj(), put_ch(), put_macro(), put_syll(), and sindex().

◆ symbol

◆ TabCom

typcom TabCom[]

Definition at line 995 of file devnag.c.

Referenced by test_command().

◆ tabs_mode

unsigned char tabs_mode

Definition at line 368 of file devnag.c.

Referenced by main(), and put_ch().

◆ TabSubCom

typcom TabSubCom[]
Initial value:
= {
{1,"tabular"},
{1,"supertabular"},
{1,"longtable"},
{1,"thebibliography"},
{0,""}
}

Definition at line 1053 of file devnag.c.

Referenced by comm_begin().

◆ version

const char* version ( void  ) = "2.17"

Definition at line 296 of file devnag.c.

Referenced by main().

◆ vow_seen

unsigned char vow_seen

Definition at line 370 of file devnag.c.

Referenced by main(), put_ch(), and put_syll().

◆ wait_syll

unsigned char wait_syll

Definition at line 369 of file devnag.c.

Referenced by main(), put_ch(), and put_syll().

◆ wasCR

int wasCR = 0

Definition at line 357 of file devnag.c.

Referenced by fgetline().

◆ word

char word[512]

Definition at line 362 of file devnag.c.