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)  

utility.c File Reference
#include "p2c.h"
#include "utility.h"
#include "strings.h"
Include dependency graph for utility.c:

Go to the source code of this file.

Classes

struct  LOC_grep
 

Macros

#define UTILITY_G
 
#define blank   ' '
 
#define dummy   '\0'
 

Functions

short wordCount (char *s)
 
char * GetNextWord (char *Result, char *s, char Delim, char Term)
 
char * NextWord (char *Result, char *s_, char Delim, char Term)
 
char * plural (char *Result, short n)
 
short curtail (char *s, char c)
 
char * toString (char *Result, short n)
 
short digit (char c)
 
boolean equalsIgnoreCase (char *s1_, char *s2_)
 
boolean startsWithIgnoreCase (char *s1_, char *s2_)
 
boolean startsWithBracedWord (char *P_)
 
void trim (char *s)
 
boolean endsWith (char *s1_, char *s2)
 
static void remember (short s1, short s2, struct LOC_grep *LINK)
 
static void matchnum (struct LOC_grep *LINK)
 
static void matchmeta (struct LOC_grep *LINK)
 
static void subgrep (struct LOC_grep *LINK)
 
void grep (char *source_, char *pattern_, char *target)
 
boolean match (char *source_, char *pattern_)
 
char * translate (char *Result, char *source_, char *pattern_, char *target_)
 

Macro Definition Documentation

◆ blank

#define blank   ' '

Definition at line 17 of file utility.c.

◆ dummy

#define dummy   '\0'

Definition at line 18 of file utility.c.

◆ UTILITY_G

#define UTILITY_G

Definition at line 8 of file utility.c.

Function Documentation

◆ curtail()

short curtail ( char *  s,
char  c 
)

◆ digit()

short digit ( char  c)

Definition at line 105 of file utility.c.

References c.

Referenced by grep().

◆ endsWith()

boolean endsWith ( char *  s1_,
char *  s2 
)

Definition at line 158 of file utility.c.

References predelete(), s1, s2, strcmp(), strcpy(), and strlen().

Referenced by doCommand(), isControlParagraph(), lyrTranslate(), and output().

◆ equalsIgnoreCase()

boolean equalsIgnoreCase ( char *  s1_,
char *  s2_ 
)

Definition at line 111 of file utility.c.

References s1, s2, strcmp(), strcpy(), and toUpper().

Referenced by applyStyle(), featureNamed(), and findCommand().

◆ GetNextWord()

◆ grep()

void grep ( char *  source_,
char *  pattern_,
char *  target 
)

Definition at line 292 of file utility.c.

References digit(), j, reg, sprintf, STR2, strcpy(), strlen(), subgrep(), substr_(), t, target, and V.

Referenced by match(), and translate().

◆ match()

boolean match ( char *  source_,
char *  pattern_ 
)

Definition at line 338 of file utility.c.

References grep(), strcpy(), and target.

◆ matchmeta()

static void matchmeta ( struct LOC_grep LINK)
static

Definition at line 235 of file utility.c.

References LOC_grep::matching, LOC_grep::p, LOC_grep::pattern, LOC_grep::s, LOC_grep::source, and strlen().

Referenced by subgrep().

◆ matchnum()

static void matchnum ( struct LOC_grep LINK)
static

◆ NextWord()

char* NextWord ( char *  Result,
char *  s_,
char  Delim,
char  Term 
)

◆ plural()

◆ remember()

static void remember ( short  s1,
short  s2,
struct LOC_grep LINK 
)
static

Definition at line 181 of file utility.c.

References _Escape(), LOC_grep::index, LOC_grep::p1, LOC_grep::p2, LOC_grep::s, s1, and s2.

Referenced by matchnum(), and subgrep().

◆ startsWithBracedWord()

boolean startsWithBracedWord ( char *  P_)

Definition at line 135 of file utility.c.

References blank, GetNextWord(), P, P_, strcpy(), strlen(), and w.

Referenced by doMusic().

◆ startsWithIgnoreCase()

boolean startsWithIgnoreCase ( char *  s1_,
char *  s2_ 
)

Definition at line 123 of file utility.c.

References s1, s2, startsWith(), strcpy(), and toUpper().

Referenced by analyzeParagraph(), findStyle(), obliterate(), readParagraph(), setOnly(), and thisCase().

◆ subgrep()

static void subgrep ( struct LOC_grep LINK)
static

◆ toString()

◆ translate()

char* translate ( char *  Result,
char *  source_,
char *  pattern_,
char *  target_ 
)

Definition at line 351 of file utility.c.

References grep(), strcpy(), and target.

◆ trim()

void trim ( char *  s)

Definition at line 146 of file utility.c.

References blank, k, posNot(), predelete(), and s.

◆ wordCount()

short wordCount ( char *  s)