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)  

psearch.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include "ctype.h"
#include <stdio.h>
#include "stdlib.h"
#include <stdarg.h>
#include "string.h"
#include "basics.h"
#include "strexpr.h"
#include "filenames.h"
#include "texfiles.h"
Include dependency graph for psearch.c:

Go to the source code of this file.

Macros

#define _POSIX_SOURCE   1
 
#define INT(x)   ((int)(x+0.5))
 

Functions

static void subtilde (char **fn, char **path)
 
char * path (char *deFault, char *env)
 
static char * rsearch (char *path, char *file)
 
int absname (char *name)
 
char * search_file (char *path, char *file, int terminate)
 
static void replace (char *cs, char *pattern, void *value)
 
void substitute (char *str, char *patterns,...)
 
void init_pksearch (int bdpi, char *mode, int margin, char *tolerance)
 
int evaluate (char *expr, int dpi)
 
int nearesthalf (int dpi)
 
char * search_pkfile (char *path, char *texfont, int dpi)
 
char * search_flifile (char *fliname, int(*font)(char *, int))
 
char * search_flipath (char *flipath, int(*font)(char *, int))
 

Variables

static int tilde = 0
 
static char * _mode = 0
 
static int _margin = 0
 
static int _bdpi = -1
 
static char * _tolerance = 0
 

Macro Definition Documentation

◆ _POSIX_SOURCE

#define _POSIX_SOURCE   1

Definition at line 8 of file psearch.c.

◆ INT

#define INT (   x)    ((int)(x+0.5))

Definition at line 368 of file psearch.c.

Function Documentation

◆ absname()

int absname ( char *  name)

Definition at line 211 of file psearch.c.

References DIRSEP, isalpha, and name.

Referenced by search_file().

◆ evaluate()

int evaluate ( char *  expr,
int  dpi 
)

Definition at line 356 of file psearch.c.

References dpi, expr(), fatal, NULL, check-static-inits::result, strcpy(), strexpr(), and substitute().

Referenced by nearesthalf().

◆ init_pksearch()

void init_pksearch ( int  bdpi,
char *  mode,
int  margin,
char *  tolerance 
)

Definition at line 346 of file psearch.c.

References _bdpi, _margin, _mode, _tolerance, margin, mode, and tolerance.

◆ nearesthalf()

int nearesthalf ( int  dpi)

Definition at line 374 of file psearch.c.

References _bdpi, _tolerance, dpi, evaluate(), half, INT, near, and tolerance.

◆ path()

char* path ( char *  deFault,
char *  env 
)

Definition at line 76 of file psearch.c.

References e, fatal, len, malloc, MAXPATHLEN, NULL, p, PATHSEP, q, strcpy(), and strlen().

Referenced by search_file(), and search_pkfile().

◆ replace()

static void replace ( char *  cs,
char *  pattern,
void value 
)
static

Definition at line 260 of file psearch.c.

References len, MAXPATHLEN, p, q, sprintf, strcpy(), strlen(), strstr(), and temp.

Referenced by substitute().

◆ rsearch()

static char* rsearch ( char *  path,
char *  file 
)
static

◆ search_file()

char* search_file ( char *  path,
char *  file,
int  terminate 
)

Definition at line 225 of file psearch.c.

References absname(), fatal, file, fc-lang::fn, MAXPATHLEN, NULL, path(), PATHSEP, rsearch(), stat(), status, subtilde(), and tilde.

Referenced by main().

◆ search_flifile()

char* search_flifile ( char *  fliname,
int(*)(char *, int font 
)

Definition at line 474 of file psearch.c.

References fatal, fclose, FILE, font, fontname, fopen, four, i, int(), len, NULL, one, RB, size, strncmp(), two, and void.

Referenced by search_flipath().

◆ search_flipath()

char* search_flipath ( char *  flipath,
int(*)(char *, int font 
)

Definition at line 529 of file psearch.c.

References DIRSEP, fatal, fc-lang::fn, len, MAXPATHLEN, NULL, PATHSEP, search_flifile(), strcmp(), and strlen().

Referenced by main().

◆ search_pkfile()

char* search_pkfile ( char *  path,
char *  texfont,
int  dpi 
)

◆ substitute()

◆ subtilde()

static void subtilde ( char **  fn,
char **  path 
)
static

Definition at line 67 of file psearch.c.

Referenced by search_file(), and search_pkfile().

Variable Documentation

◆ _bdpi

int _bdpi = -1
static

Definition at line 343 of file psearch.c.

Referenced by init_pksearch(), nearesthalf(), and search_pkfile().

◆ _margin

int _margin = 0
static

Definition at line 343 of file psearch.c.

Referenced by init_pksearch().

◆ _mode

char* _mode = 0
static

Definition at line 342 of file psearch.c.

Referenced by init_pksearch(), search_pkfile(), and FinalRulePart::set().

◆ _tolerance

char* _tolerance = 0
static

Definition at line 344 of file psearch.c.

Referenced by init_pksearch(), and nearesthalf().

◆ tilde

int tilde = 0
static

Definition at line 66 of file psearch.c.

Referenced by search_file(), and search_pkfile().