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)  

commands.c File Reference
#include <stdlib.h>
#include <string.h>
#include "cfg.h"
#include "main.h"
#include "convert.h"
#include "chars.h"
#include "l2r_fonts.h"
#include "preamble.h"
#include "funct1.h"
#include "tables.h"
#include "equation.h"
#include "letterformat.h"
#include "commands.h"
#include "parser.h"
#include "xref.h"
#include "ignore.h"
#include "lengths.h"
#include "definitions.h"
#include "graphics.h"
Include dependency graph for commands.c:

Go to the source code of this file.

Classes

struct  commandtag
 

Typedefs

typedef struct commandtag CommandArray
 

Functions

bool CallCommandFunc (char *cCommand)
 
void CallParamFunc (char *cCommand, int AddParam)
 
int CurrentEnvironmentCount (void)
 
void PushEnvironment (int code)
 
void PopEnvironment ()
 
void ClearEnvironment ()
 

Variables

static int iEnvCount = 0
 
static CommandArrayEnvironments [100]
 
static int g_par_indent_array [100]
 
static int g_left_indent_array [100]
 
static int g_right_indent_array [100]
 
static CommandArray commands []
 
static CommandArray PreambleCommands []
 
static CommandArray ItemizeCommands []
 
static CommandArray DescriptionCommands []
 
static CommandArray EnumerateCommands []
 
static CommandArray FigureCommands []
 
static CommandArray LetterCommands []
 
static CommandArray GermanModeCommands []
 
static CommandArray CzechModeCommands []
 
static CommandArray FrenchModeCommands []
 
static CommandArray RussianModeCommands []
 
static CommandArray params []
 
static CommandArray hyperlatex []
 
static CommandArray apaciteCommands []
 
static CommandArray natbibCommands []
 

Typedef Documentation

◆ CommandArray

typedef struct commandtag CommandArray

Function Documentation

◆ CallCommandFunc()

bool CallCommandFunc ( char *  cCommand)

purpose: Tries to call the command-function for the commandname params: string with command name returns: success or failure globals: command-functions have side effects or recursive calls

Definition at line 726 of file commands.c.

References CmdIgnoreParameter(), ConvertString(), diagnostics(), Environments, existsDefinition(), expandDefinition(), FALSE, free, commandtag::func, func, i, iEnvCount, j, NULL, param, strcmp(), TRUE, and WARNING__.

Referenced by TranslateCommand().

◆ CallParamFunc()

void CallParamFunc ( char *  cCommand,
int  AddParam 
)

purpose: Try to call the environment-function for the commandname params: cCommand - string with command name AddParam - param "ORed"(||) to the int param of command-funct returns: sucess or not globals: command-functions have side effects or recursive calls

Definition at line 773 of file commands.c.

References assert(), diagnostics(), commandtag::func, func, i, Ignore_Environment(), NULL, ON, param, params, snprintf, strcmp(), and WARNING__.

Referenced by CmdBeginEnd(), and CmdPreambleBeginEnd().

◆ ClearEnvironment()

void ClearEnvironment ( )

purpose: removes all environment-commands lists globals: changes Environment - array of active environments iEnvCount - counter of active environments

Definition at line 929 of file commands.c.

References Environments, iEnvCount, and NULL.

◆ CurrentEnvironmentCount()

int CurrentEnvironmentCount ( void  )

purpose: to eliminate the iEnvCount global variable

Definition at line 803 of file commands.c.

References iEnvCount.

Referenced by diagnostics().

◆ PopEnvironment()

void PopEnvironment ( )

purpose: removes the environment-commands list added by last PushEnvironment; globals: changes Environment - array of active environments iEnvCount - counter of active environments

Definition at line 903 of file commands.c.

References diagnostics(), Environments, g_left_indent_array, g_left_margin_indent, g_par_indent_array, g_right_indent_array, g_right_margin_indent, iEnvCount, NULL, and setLength().

Referenced by CmdLetter(), CmdList(), CmdQuote(), CmdThebibliography(), CmdVerse(), and Environment().

◆ PushEnvironment()

Variable Documentation

◆ apaciteCommands

CommandArray apaciteCommands[]
static

purpose: commands for apacite package

Definition at line 643 of file commands.c.

Referenced by PushEnvironment().

◆ commands

Definition at line 59 of file commands.c.

Referenced by PushEnvironment().

◆ CzechModeCommands

CommandArray CzechModeCommands[]
static
Initial value:
= {
{"uv", CmdCzechAbbrev, 0},
{"", NULL, 0}
}
void CmdCzechAbbrev(int code)
#define NULL
Definition: ftobjs.h:61

Definition at line 443 of file commands.c.

Referenced by PushEnvironment().

◆ DescriptionCommands

CommandArray DescriptionCommands[]
static
Initial value:
= {
{"item", CmdItem, 5 },
{"", NULL, 0}
}
void CmdItem(int code)
Definition: funct1.c:1166

Definition at line 407 of file commands.c.

Referenced by PushEnvironment().

◆ EnumerateCommands

CommandArray EnumerateCommands[]
static
Initial value:
= {
{"item", CmdItem, 4 },
{"", NULL, 0}
}

Definition at line 412 of file commands.c.

Referenced by PushEnvironment().

◆ Environments

CommandArray* Environments[100]
static

Definition at line 54 of file commands.c.

Referenced by CallCommandFunc(), ClearEnvironment(), PopEnvironment(), and PushEnvironment().

◆ FigureCommands

CommandArray FigureCommands[]
static
Initial value:
= {
{"caption", CmdCaption, 0},
{"center", CmdAlign, 1 },
{"", NULL, 0}
}
void CmdAlign(int code)
Definition: funct1.c:514
void CmdCaption(int code)
Definition: funct1.c:907

Definition at line 417 of file commands.c.

Referenced by PushEnvironment().

◆ FrenchModeCommands

CommandArray FrenchModeCommands[]
static

Definition at line 448 of file commands.c.

Referenced by PushEnvironment().

◆ g_left_indent_array

int g_left_indent_array[100]
static

Definition at line 56 of file commands.c.

Referenced by PopEnvironment(), and PushEnvironment().

◆ g_par_indent_array

int g_par_indent_array[100]
static

Definition at line 55 of file commands.c.

Referenced by PopEnvironment(), and PushEnvironment().

◆ g_right_indent_array

int g_right_indent_array[100]
static

Definition at line 57 of file commands.c.

Referenced by PopEnvironment(), and PushEnvironment().

◆ GermanModeCommands

CommandArray GermanModeCommands[]
static
Initial value:
= {
{"ck", GermanPrint, 1 },
{"glqq", GermanPrint, 2 },
{"glq", GermanPrint, 3 },
{"grq", GermanPrint, 4 },
{"grqq", GermanPrint, 5 },
{"", NULL, 0}
}
void GermanPrint(int code)
Definition: funct1.c:1500

Definition at line 434 of file commands.c.

Referenced by PushEnvironment().

◆ hyperlatex

CommandArray hyperlatex[]
static
Initial value:
= {
{"link", CmdLink, 0},
{"xlink", CmdLink, 0},
{"Cite", CmdLabel, 4 },
{"Ref", CmdLabel, 2 },
{"Pageref", CmdLabel, 6 },
{"S", CmdColsep, 0},
{"", NULL, 0}
}
void CmdColsep(int code)
Definition: funct1.c:1875
void CmdLink(int code)
Definition: funct1.c:1697
void CmdLabel(int code)
Definition: xref.c:398

purpose: commands for hyperlatex package

Definition at line 630 of file commands.c.

Referenced by PushEnvironment().

◆ iEnvCount

int iEnvCount = 0
static

◆ ItemizeCommands

CommandArray ItemizeCommands[]
static
Initial value:
= {
{"item", CmdItem, 3 },
{"", NULL, 0}
}

Definition at line 402 of file commands.c.

Referenced by PushEnvironment().

◆ LetterCommands

CommandArray LetterCommands[]
static
Initial value:
= {
{"opening", CmdOpening, 0},
{"closing", CmdClosing, 0},
{"address", CmdAddress, 0},
{"signature", CmdSignature, 0},
{"ps", CmdPs, 1 },
{"cc", CmdPs, 2 },
{"encl", CmdPs, 3 },
{"", NULL, 0}
}
void CmdPs(int code)
Definition: letterformat.c:154
void CmdAddress(int code)
Definition: letterformat.c:54
void CmdSignature(int code)
Definition: letterformat.c:42
void CmdOpening(int code)
Definition: letterformat.c:83
void CmdClosing(int code)
Definition: letterformat.c:120

Definition at line 423 of file commands.c.

Referenced by PushEnvironment().

◆ natbibCommands

CommandArray natbibCommands[]
static
Initial value:
= {
{"citet", CmdCite, 16 },
{"citet*", CmdCite, 17 },
{"citep", CmdCite, 18 },
{"citep*", CmdCite, 19 },
{"citealt", CmdCite, 20 },
{"citealp", CmdCite, 21 },
{"citealt*", CmdCite, 22 },
{"citealp*", CmdCite, 23 },
{"citetext", CmdCite, 24 },
{"citeauthor", CmdCite, 25 },
{"citeauthor*", CmdCite, 26 },
{"citeyear", CmdCite, 13 },
{"citeyearpar", CmdCite, 27 },
{"Citet", CmdCite, 16 },
{"Citep", CmdCite, 18 },
{"Citealt", CmdCite, 20 },
{"Citealp", CmdCite, 21 },
{"Citeauthor", CmdCite, 25 },
{"", NULL, 0}
}
void CmdCite(int code)
Definition: xref.c:586

purpose: commands for apacite package

Definition at line 703 of file commands.c.

Referenced by PushEnvironment().

◆ params

CommandArray params[]
static

Definition at line 559 of file commands.c.

Referenced by CallParamFunc().

◆ PreambleCommands

CommandArray PreambleCommands[]
static

commands found in the preamble of the LaTeX file

Definition at line 332 of file commands.c.

Referenced by PushEnvironment().

◆ RussianModeCommands

CommandArray RussianModeCommands[]
static

Definition at line 487 of file commands.c.

Referenced by PushEnvironment().