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)  

definitions.c File Reference
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "convert.h"
#include "definitions.h"
#include "parser.h"
#include "funct1.h"
#include "util.h"
#include "cfg.h"
#include "counters.h"
Include dependency graph for definitions.c:

Go to the source code of this file.

Macros

#define MAX_DEFINITIONS   200
 
#define MAX_ENVIRONMENTS   20
 
#define MAX_THEOREMS   20
 

Functions

static int strequal (char *a, char *b)
 
static char * expandmacro (char *macro, char *opt_param, int params)
 
int maybeDefinition (char *s, size_t n)
 
int existsDefinition (char *s)
 
void newDefinition (char *name, char *opt_param, char *def, int params)
 
void renewDefinition (char *name, char *opt_param, char *def, int params)
 
char * expandDefinition (int thedef)
 
int existsEnvironment (char *s)
 
int maybeEnvironment (char *s, size_t n)
 
void newEnvironment (char *name, char *opt_param, char *begdef, char *enddef, int params)
 
void renewEnvironment (char *name, char *opt_param, char *begdef, char *enddef, int params)
 
char * expandEnvironment (int thedef, int code)
 
void newTheorem (char *name, char *caption, char *numbered_like, char *within)
 
int existsTheorem (char *s)
 
char * expandTheorem (int i, char *option)
 
void resetTheoremCounter (char *unit)
 

Variables

struct {
   char *   name
 
   char *   opt_param
 
   char *   def
 
   int   params
 
Definitions [200]
 
struct {
   char *   name
 
   char *   opt_param
 
   char *   begname
 
   char *   endname
 
   char *   begdef
 
   char *   enddef
 
   int   params
 
NewEnvironments [20]
 
struct {
   char *   name
 
   char *   numbered_like
 
   char *   caption
 
   char *   within
 
NewTheorems [20]
 
static int iDefinitionCount = 0
 
static int iNewEnvironmentCount = 0
 
static int iNewTheoremCount = 0
 

Macro Definition Documentation

◆ MAX_DEFINITIONS

#define MAX_DEFINITIONS   200

Definition at line 34 of file definitions.c.

◆ MAX_ENVIRONMENTS

#define MAX_ENVIRONMENTS   20

Definition at line 35 of file definitions.c.

◆ MAX_THEOREMS

#define MAX_THEOREMS   20

Definition at line 36 of file definitions.c.

Function Documentation

◆ existsDefinition()

int existsDefinition ( char *  s)

purpose: checks to see if a named TeX definition exists returns: the array index of the named TeX definition

Definition at line 205 of file definitions.c.

References Definitions, diagnostics(), i, iDefinitionCount, name, s, and strcmp().

Referenced by CallCommandFunc(), and renewDefinition().

◆ existsEnvironment()

int existsEnvironment ( char *  s)

purpose: checks to see if a user created environment exists returns: the array index of the \newenvironment

Definition at line 332 of file definitions.c.

References diagnostics(), i, iNewEnvironmentCount, n, name, NewEnvironments, s, strequal(), and strlen().

Referenced by CmdBeginEnd(), and renewEnvironment().

◆ existsTheorem()

int existsTheorem ( char *  s)

purpose: checks to see if a user created environment exists returns: the array index of the \newtheorem

Definition at line 512 of file definitions.c.

References diagnostics(), i, iNewTheoremCount, name, NewTheorems, s, and strequal().

Referenced by CmdBeginEnd().

◆ expandDefinition()

char* expandDefinition ( int  thedef)

purpose: retrieves and expands a \newcommand macro

Definition at line 313 of file definitions.c.

References def, Definitions, diagnostics(), expandmacro(), iDefinitionCount, name, NULL, opt_param, and params.

Referenced by CallCommandFunc().

◆ expandEnvironment()

char* expandEnvironment ( int  thedef,
int  code 
)

purpose: retrieves and expands a \newenvironment

Definition at line 457 of file definitions.c.

References begdef, CMD_BEGIN, diagnostics(), enddef, expandmacro(), iNewEnvironmentCount, name, NewEnvironments, NULL, opt_param, and params.

Referenced by CmdBeginEnd().

◆ expandmacro()

static char* expandmacro ( char *  macro,
char *  opt_param,
int  params 
)
static

purpose: retrieves and expands a defined macro

Definition at line 107 of file definitions.c.

References buffer, cs, diagnostics(), free, getBraceParam(), getBracketParam(), i, macro, NULL, opt_param, param, params, strchr, strcpy(), strdup, strlen(), strstr(), and WARNING__.

Referenced by expandDefinition(), and expandEnvironment().

◆ expandTheorem()

char* expandTheorem ( int  i,
char *  option 
)

purpose: retrieves and expands a \newtheorem into a string

Definition at line 532 of file definitions.c.

References caption, FormatUnitNumber(), free, getCounter(), i, incrementCounter(), iNewTheoremCount, NewTheorems, num, numbered_like, s, snprintf, strdup, and within.

Referenced by CmdBeginEnd().

◆ maybeDefinition()

int maybeDefinition ( char *  s,
size_t  n 
)

purpose: checks to see if a named TeX definition possibly exists returns: the array index of the named TeX definition

Definition at line 185 of file definitions.c.

References Definitions, diagnostics(), FALSE, i, iDefinitionCount, n, name, s, strncmp(), and TRUE.

◆ maybeEnvironment()

int maybeEnvironment ( char *  s,
size_t  n 
)

purpose: checks to see if a named TeX environment possibly exists returns: the array index of the named TeX definition

Definition at line 354 of file definitions.c.

References begname, diagnostics(), endname, FALSE, i, iNewEnvironmentCount, n, name, NewEnvironments, s, strncmp(), and TRUE.

◆ newDefinition()

void newDefinition ( char *  name,
char *  opt_param,
char *  def,
int  params 
)

purpose: allocates and initializes a named TeX definition name should not begin with a '\' for example to define \hd, name = "hd"

Definition at line 225 of file definitions.c.

References def, Definitions, diagnostics(), ERROR, iDefinitionCount, MAX_DEFINITIONS, name, NULL, opt_param, params, strcmp(), strdup, and WARNING__.

Referenced by renewDefinition().

◆ newEnvironment()

void newEnvironment ( char *  name,
char *  opt_param,
char *  begdef,
char *  enddef,
int  params 
)

purpose: allocates and initializes a \newenvironment name should not begin with a '\'

Definition at line 378 of file definitions.c.

References begdef, begname, diagnostics(), enddef, endname, ERROR, iNewEnvironmentCount, MAX_ENVIRONMENTS, name, NewEnvironments, NULL, opt_param, params, strdup, strdup_together(), and WARNING__.

Referenced by CmdNewEnvironment(), and renewEnvironment().

◆ newTheorem()

void newTheorem ( char *  name,
char *  caption,
char *  numbered_like,
char *  within 
)

purpose: allocates and initializes a \newtheorem

Definition at line 482 of file definitions.c.

References caption, diagnostics(), iNewTheoremCount, MAX_THEOREMS, name, NewTheorems, NULL, numbered_like, setCounter(), strdup, WARNING__, and within.

Referenced by CmdNewTheorem().

◆ renewDefinition()

void renewDefinition ( char *  name,
char *  opt_param,
char *  def,
int  params 
)

purpose: allocates (if necessary) and sets a named TeX definition

Definition at line 276 of file definitions.c.

References def, Definitions, diagnostics(), ERROR, existsDefinition(), exit(), free, i, name, newDefinition(), NULL, opt_param, params, strdup, and WARNING__.

◆ renewEnvironment()

void renewEnvironment ( char *  name,
char *  opt_param,
char *  begdef,
char *  enddef,
int  params 
)

purpose: allocates and initializes a \renewenvironment

Definition at line 420 of file definitions.c.

References begdef, begname, diagnostics(), enddef, endname, ERROR, existsEnvironment(), free, i, name, newEnvironment(), NewEnvironments, NULL, opt_param, params, strdup, and WARNING__.

Referenced by CmdNewEnvironment().

◆ resetTheoremCounter()

void resetTheoremCounter ( char *  unit)

purpose: resets theorem counters based on unit

Definition at line 564 of file definitions.c.

References i, iNewTheoremCount, NewTheorems, numbered_like, setCounter(), strequal(), and within.

Referenced by CmdSection().

◆ strequal()

static int strequal ( char *  a,
char *  b 
)
static

Definition at line 67 of file definitions.c.

References a, b, and NULL.

Referenced by existsEnvironment(), existsTheorem(), and resetTheoremCounter().

Variable Documentation

◆ begdef

char* begdef

◆ begname

char* begname

Definition at line 48 of file definitions.c.

Referenced by maybeEnvironment(), newEnvironment(), and renewEnvironment().

◆ caption

◆ def

◆ 

Definitions[ 200 ] { ... } struct

◆ enddef

char* enddef

◆ endname

char* endname

Definition at line 49 of file definitions.c.

Referenced by maybeEnvironment(), newEnvironment(), and renewEnvironment().

◆ iDefinitionCount

int iDefinitionCount = 0
static

Definition at line 62 of file definitions.c.

Referenced by existsDefinition(), expandDefinition(), maybeDefinition(), and newDefinition().

◆ iNewEnvironmentCount

int iNewEnvironmentCount = 0
static

◆ iNewTheoremCount

int iNewTheoremCount = 0
static

Definition at line 64 of file definitions.c.

Referenced by existsTheorem(), expandTheorem(), newTheorem(), and resetTheoremCounter().

◆ name

◆ 

NewEnvironments[ 20 ] { ... } struct

◆ 

NewTheorems[ 20 ] { ... } struct

◆ numbered_like

char* numbered_like

Definition at line 57 of file definitions.c.

Referenced by CmdNewTheorem(), expandTheorem(), newTheorem(), and resetTheoremCounter().

◆ opt_param

◆ params

int params
Examples
/dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ktx/libs/freetype/include/freetype/freetype.h, /dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ktx/libs/freetype/include/freetype/ftoutln.h, /dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ptx/libs/freetype/include/freetype/freetype.h, and /dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ptx/libs/freetype/include/freetype/ftoutln.h.

Definition at line 42 of file definitions.c.

Referenced by _cairo_pdf_surface_emit_ccitt_image(), _cairo_ps_form_emit(), _cairo_ps_surface_emit_ccitt_image(), _cairo_ps_surface_emit_eps(), _cairo_ps_surface_emit_form(), _cairo_ps_surface_emit_image(), _cairo_ps_surface_emit_jpeg_image(), _cairo_ps_surface_emit_surface(), _cairo_ps_surface_emit_surface_pattern(), _cairo_ps_surface_paint_surface(), _cairo_ps_surface_use_form(), _pixman_image_set_properties(), Stream::addFilters(), analyze_extent(), BDF_Face_Init(), bits_image_fetch_pixel_convolution(), bits_image_fetch_pixel_separable_convolution(), BrotliBuildMetaBlock(), BrotliCompressBufferQuality10(), BrotliCreateBackwardReferences(), BrotliCreateHqZopfliBackwardReferences(), BrotliCreateZopfliBackwardReferences(), BrotliEncoderInitParams(), BrotliInitDistanceParams(), BrotliSplitBlock(), BrotliStoreMetaBlock(), BrotliStoreMetaBlockFast(), BrotliStoreMetaBlockTrivial(), BrotliZopfliComputeShortestPath(), BrotliZopfliCreateCommands(), PSInterpreter::callActions(), cf2_builder_cubeTo(), cf2_builder_lineTo(), cf2_builder_moveTo(), cf2_glyphpath_pushMove(), cf2_glyphpath_pushPrevElem(), cff_face_init(), CheckForScriptFile(), ChooseContextMode(), ChooseDistanceParams(), ChooseHasher(), cid_face_init(), CmdNewEnvironment(), ComputeLgBlock(), ComputeRbBits(), woff2::ConvertTTFToWOFF2(), create_separable_convolution(), CreateBackwardReferences(), SplashScreen::createMatrix(), ExecuteScriptFile(), expandDefinition(), expandEnvironment(), expandmacro(), fea_ParseParameters(), FindAllMatches(), FNT_Face_Init(), ft_black_render(), ft_open_face_internal(), FT_Outline_Get_Bitmap(), FT_Outline_Render(), ft_raster1_render(), ft_smooth_raster_lcd(), ft_smooth_raster_lcdv(), ft_smooth_raster_overlap(), ft_smooth_render(), EllipticalArc::getCenterParams(), AnnotRichMedia::Instance::getParams(), gray_raster_render(), HasherSize(), HashMemAllocInBytes(), hb_ot_layout_get_size_params(), Initialize(), AnnotRichMedia::Instance::Instance(), LinkLaunch::LinkLaunch(), LiteralSpreeLengthForSparseSearch(), main(), Stream::makeFilter(), MaxMetablockSize(), MaxZopfliCandidates(), MaxZopfliLen(), MediaRendition::MediaRendition(), mplib_init_Ses(), mplib_statistics(), newDefinition(), newEnvironment(), open_face(), OpenForExecution(), parse_transform_cmd(), Matrix::parseSVGTransform(), PCF_Face_Init(), pfr_face_init(), pixman_filter_create_separable_convolution(), pixman_image_set_filter(), png_get_pCAL(), png_handle_pCAL(), png_read_png(), png_set_pCAL(), png_write_pCAL(), png_write_png(), ppstream_decoder(), ppstream_filter_info(), ppstream_predictor(), PapersizeSpecialHandler::preprocess(), renewDefinition(), renewEnvironment(), RingBufferSetup(), Subprocess::run(), RunACommand(), SanitizeParams(), savePageSlice(), PSInterpreter::setImageDevice(), SplashBitmap::setJpegParams(), CairoOutputDev::setMimeDataForCCITTParams(), sfnt_init_face(), sfnt_load_face(), PsSpecialHandler::shfill(), SplashScreen::SplashScreen(), split_paramstr(), SplitByteVector(), T1_Face_Init(), T42_Face_Init(), test_one_file(), tt_face_init(), UpdateNodes(), SplashBitmap::writeImgFile(), WriteMetaBlockInternal(), ZopfliIterate(), and LinkLaunch::~LinkLaunch().

◆ within