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)  

libpbm1.c File Reference
#include "pbm.h"
#include "version.h"
#include "../compile.h"
#include "libpbm.h"
#include "shhopt.h"
#include <varargs.h>
#include <string.h>
#include <errno.h>
Include dependency graph for libpbm1.c:

Go to the source code of this file.

Macros

#define PM_BUF_SIZE
 
#define PM_MAX_BUF_INC
 

Functions

char * pm_allocrow (int cols, int size)
 
void pm_freerow (char *itrow)
 
char ** pm_allocarray (int cols, int rows, int size)
 
void pm_freearray (char **its, int rows)
 
int pm_keymatch (char *str, char *keyword, int minchars)
 
void pm_optParseOptions (int *argc, char *argv[], optStruct opt[], int allowNegNum)
 
int pm_maxvaltobits (int maxval)
 
int pm_bitstomaxval (int bits)
 
void pm_init (int *argcP, argv)
 
void pbm_init (int *argcP, argv)
 
void pm_usage (char *usage)
 
void pm_perror (char *reason)
 
void pm_message (unsigned va_alist)
 
void pm_error (unsigned va_alist)
 
FILEpm_openr (char *name)
 
FILEpm_openw (char *name)
 
void pm_close (FILE *f)
 
int pm_readbigshort (FILE *in, short *sP)
 
int pm_writebigshort (FILE *out, short s)
 
int pm_readbiglong (FILE *in, long *lP)
 
int pm_writebiglong (FILE *out, long l)
 
int pm_readlittleshort (FILE *in, short *sP)
 
int pm_writelittleshort (FILE *out, short s)
 
int pm_readlittlelong (FILE *in, long *lP)
 
int pm_writelittlelong (FILE *out, long l)
 
char * pm_read_unknown_size (FILE *file, long *nread)
 

Variables

static char * progname
 
static int showmessages
 

Macro Definition Documentation

◆ PM_BUF_SIZE

#define PM_BUF_SIZE
Value:
16384 /* First try this size of the buffer, then
double this until we reach PM_MAX_BUF_INC */

Definition at line 794 of file libpbm1.c.

◆ PM_MAX_BUF_INC

#define PM_MAX_BUF_INC
Value:
65536 /* Don't allocate more memory in larger blocks
than this. */

Definition at line 796 of file libpbm1.c.

Function Documentation

◆ pbm_init()

void pbm_init ( int argcP,
argv   
)

Definition at line 332 of file libpbm1.c.

References argv, and pm_init().

Referenced by main(), and pgm_init().

◆ pm_allocarray()

char** pm_allocarray ( int  cols,
int  rows,
int  size 
)

Definition at line 52 of file libpbm1.c.

References cols, i, malloc, pm_error(), rows, and size.

Referenced by main(), pcx_256col_to_ppm(), pgm_horizontal_convolve(), and ppm_horizontal_convolve().

◆ pm_allocrow()

◆ pm_bitstomaxval()

int pm_bitstomaxval ( int  bits)

◆ pm_close()

void pm_close ( FILE f)

Definition at line 643 of file libpbm1.c.

References f, fclose, ferror, fflush, pm_message(), and pm_perror().

◆ pm_error()

void pm_error ( unsigned  va_alist)

◆ pm_freearray()

void pm_freearray ( char**  its,
int  rows 
)

Definition at line 71 of file libpbm1.c.

References free.

Referenced by pcx_256col_to_ppm().

◆ pm_freerow()

void pm_freerow ( char*  itrow)

Definition at line 43 of file libpbm1.c.

References free.

◆ pm_init()

void pm_init ( int argcP,
argv   
)

◆ pm_keymatch()

int pm_keymatch ( char*  str,
char*  keyword,
int  minchars 
)

Definition at line 117 of file libpbm1.c.

References c1, c2, isupper, keyword, len, str, strlen(), and tolower.

Referenced by pm_init().

◆ pm_maxvaltobits()

int pm_maxvaltobits ( int  maxval)

Definition at line 160 of file libpbm1.c.

References maxval, and pm_error().

Referenced by colorstobpp(), convertpnm(), direct_to_ppm(), and main().

◆ pm_message()

void pm_message ( unsigned  va_alist)

Definition at line 378 of file libpbm1.c.

References args, format, fprintf, progname, showmessages, va_arg, va_end, va_start, and void.

Referenced by pm_close(), and pm_init().

◆ pm_openr()

static FILE * pm_openr ( char*  name)

Definition at line 600 of file libpbm1.c.

References exit(), f, FILE, fopen, name, NULL, pm_perror(), and strcmp().

Referenced by blit(), main(), optionfile(), pbm_loadfont(), pbm_loadpbmfont(), and readcharacter().

◆ pm_openw()

static FILE * pm_openw ( char*  name)

Definition at line 624 of file libpbm1.c.

References exit(), f, FILE, fopen, name, NULL, and pm_perror().

Referenced by main().

◆ pm_optParseOptions()

void pm_optParseOptions ( int argc,
char *  argv[],
optStruct  opt[],
int  allowNegNum 
)

Definition at line 149 of file libpbm1.c.

References argc, argv, and optParseOptions().

Referenced by parse_command_line().

◆ pm_perror()

void pm_perror ( char*  reason)

Definition at line 351 of file libpbm1.c.

References e, errno, pm_error(), reason, strerror(), and sys_errlist.

Referenced by blit(), getinit(), getline(), main(), pm_close(), pm_openr(), and pm_openw().

◆ pm_read_unknown_size()

char* pm_read_unknown_size ( FILE file,
long*  nread 
)

Definition at line 799 of file libpbm1.c.

References buf, EOF, getc, malloc, NULL, PM_BUF_SIZE, pm_error(), PM_MAX_BUF_INC, realloc, and val.

Referenced by main().

◆ pm_readbiglong()

int pm_readbiglong ( FILE in,
long*  lP 
)

Definition at line 689 of file libpbm1.c.

References c, EOF, getc, and in.

Referenced by get_big_long(), get_image(), get_imghdr(), getinit(), getpix(), main(), and pr_load_header().

◆ pm_readbigshort()

int pm_readbigshort ( FILE in,
short*  sP 
)

Definition at line 658 of file libpbm1.c.

References c, EOF, getc, and in.

Referenced by DoColormap(), get_big_short(), get_image(), getinit(), getpix(), and main().

◆ pm_readlittlelong()

int pm_readlittlelong ( FILE in,
long*  lP 
)

Definition at line 754 of file libpbm1.c.

References c, EOF, getc, and in.

Referenced by GetLong(), getpix(), and getval().

◆ pm_readlittleshort()

int pm_readlittleshort ( FILE in,
short*  sP 
)

Definition at line 723 of file libpbm1.c.

References c, EOF, getc, and in.

Referenced by getinit(), getpix(), GetShort(), and main().

◆ pm_usage()

void pm_usage ( char*  usage)

Definition at line 343 of file libpbm1.c.

References exit(), fprintf, progname, and usage.

Referenced by main().

◆ pm_writebiglong()

int pm_writebiglong ( FILE out,
long  l 
)

Definition at line 711 of file libpbm1.c.

References cutout::l, out, putc, and void.

Referenced by main(), pr_dump(), put_big_long(), and putinit().

◆ pm_writebigshort()

int pm_writebigshort ( FILE out,
short  s 
)

Definition at line 678 of file libpbm1.c.

References out, putc, s, and void.

Referenced by main(), put_big_short(), putinit(), and putitem().

◆ pm_writelittlelong()

int pm_writelittlelong ( FILE out,
long  l 
)

Definition at line 776 of file libpbm1.c.

References cutout::l, out, putc, and void.

Referenced by putitem(), PutLong(), and slideout().

◆ pm_writelittleshort()

int pm_writelittleshort ( FILE out,
short  s 
)

Definition at line 743 of file libpbm1.c.

References out, putc, s, and void.

Referenced by main(), outrun(), putinit(), PutShort(), and slideout().

Variable Documentation

◆ progname

char* progname
static

Definition at line 210 of file libpbm1.c.

Referenced by pm_error(), pm_init(), pm_message(), and pm_usage().

◆ showmessages

int showmessages
static

Definition at line 211 of file libpbm1.c.

Referenced by pm_init(), and pm_message().