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)  

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

Go to the source code of this file.

Macros

#define MAX_COUNTERS   50
 

Functions

static int existsCounter (char *s)
 
static void newCounter (char *s, int n)
 
void incrementCounter (char *s)
 
void setCounter (char *s, int n)
 
int getCounter (char *s)
 

Variables

struct {
   char *   name
 
   int   number
 
Counters [50]
 
static int iCounterCount = 0
 

Macro Definition Documentation

◆ MAX_COUNTERS

#define MAX_COUNTERS   50

Definition at line 28 of file counters.c.

Function Documentation

◆ existsCounter()

static int existsCounter ( char *  s)
static

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

Definition at line 38 of file counters.c.

References Counters, i, iCounterCount, name, NULL, s, and strstr().

Referenced by getCounter(), incrementCounter(), and setCounter().

◆ getCounter()

int getCounter ( char *  s)

purpose: retrieves a named TeX counter

Definition at line 108 of file counters.c.

References Counters, existsCounter(), fprintf, i, and s.

Referenced by CmdCaption(), CmdCounter(), CmdEquation(), CmdSection(), CmdSlashSlash(), expandTheorem(), FinishRtfEquation(), FormatUnitNumber(), SaveEquationAsFile(), and WritePageSize().

◆ incrementCounter()

void incrementCounter ( char *  s)

purpose: increments a TeX counter (or initializes to 1)

Definition at line 78 of file counters.c.

References Counters, existsCounter(), i, newCounter(), and s.

Referenced by CmdCaption(), CmdSection(), CmdSlashSlash(), expandTheorem(), and FinishRtfEquation().

◆ newCounter()

static void newCounter ( char *  s,
int  n 
)
static

purpose: allocates and initializes a named TeX counter

Definition at line 56 of file counters.c.

References Counters, exit(), fprintf, iCounterCount, MAX_COUNTERS, n, name, NULL, s, and strdup.

Referenced by incrementCounter(), and setCounter().

◆ setCounter()

void setCounter ( char *  s,
int  n 
)

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

Definition at line 93 of file counters.c.

References Counters, existsCounter(), i, n, newCounter(), and s.

Referenced by CmdCounter(), CmdEquation(), CmdSection(), InitializeLatexLengths(), newTheorem(), and resetTheoremCounter().

Variable Documentation

◆ 

Counters[ 50 ] { ... } struct

◆ iCounterCount

int iCounterCount = 0
static

Definition at line 35 of file counters.c.

Referenced by existsCounter(), and newCounter().

◆ name

char* name

Definition at line 31 of file counters.c.

Referenced by existsCounter(), and newCounter().

◆ number

int number

Definition at line 32 of file counters.c.