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)  

common.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <utime.h>
#include <unistd.h>
#include <png.h>
#include <pngstruct.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagIMAGE
 

Macros

#define MKDIR(d, m)   mkdir(d,m)
 
#define PATHDELIM   '/'
 
#define IsPathDelim(c)   ((c)==PATHDELIM)
 
#define IsOptChar(c)   ((c)=='-')
 
#define IsDBCSLead(c)   (0)
 

Typedefs

typedef char CHAR
 
typedef unsigned char BYTE
 
typedef short SHORT
 
typedef unsigned short WORD
 
typedef int INT
 
typedef unsigned int UINT
 
typedef long LONG
 
typedef unsigned long DWORD
 
typedef png_color PALETTE
 
typedef struct tagIMAGE IMAGE
 

Enumerations

enum  BOOL { FALSE = 0 , TRUE = 1 }
 

Functions

void xxprintf (char *,...)
 
void set_status (char *,...)
 
void feed_line (void)
 
void init_progress_meter (png_structp, png_uint_32, png_uint_32)
 
void row_callback (png_structp, png_uint_32, int)
 
void png_my_error (png_structp, png_const_charp)
 
void png_my_warning (png_structp, png_const_charp)
 
BOOL imgbuf_alloc (IMAGE *)
 
void imgbuf_free (IMAGE *)
 
void imgbuf_init (IMAGE *)
 
int parsearg (int *, char **, int, char **, char *)
 
char ** envargv (int *, char ***, char *)
 
int tokenize (char *, char *)
 
int makedir (char *)
 
int renbak (char *)
 
int cpyftime (char *, char *)
 
FILEbinary_stdio (int)
 
char * suffix (char *)
 
char * basname (char *)
 
char * addslash (char *)
 
char * delslash (char *)
 
char * path_skiproot (char *)
 
char * path_nextslash (char *)
 

Variables

int quietmode
 
int errorlog
 
char errlogfile []
 

Macro Definition Documentation

◆ IsDBCSLead

#define IsDBCSLead (   c)    (0)

Definition at line 137 of file common.h.

◆ IsOptChar

#define IsOptChar (   c)    ((c)=='-')

Definition at line 136 of file common.h.

◆ IsPathDelim

#define IsPathDelim (   c)    ((c)==PATHDELIM)

Definition at line 135 of file common.h.

◆ MKDIR

#define MKDIR (   d,
  m 
)    mkdir(d,m)

Definition at line 64 of file common.h.

◆ PATHDELIM

#define PATHDELIM   '/'

Definition at line 134 of file common.h.

Typedef Documentation

◆ BYTE

typedef unsigned char BYTE

Definition at line 141 of file common.h.

◆ CHAR

typedef char CHAR

Definition at line 140 of file common.h.

◆ DWORD

typedef unsigned long DWORD

Definition at line 147 of file common.h.

◆ IMAGE

typedef struct tagIMAGE IMAGE

◆ INT

typedef int INT

Definition at line 144 of file common.h.

◆ LONG

typedef long LONG

Definition at line 146 of file common.h.

◆ PALETTE

typedef png_color PALETTE

Definition at line 150 of file common.h.

◆ SHORT

typedef short SHORT

Definition at line 142 of file common.h.

◆ UINT

typedef unsigned int UINT

Definition at line 145 of file common.h.

◆ WORD

typedef unsigned short WORD

Definition at line 143 of file common.h.

Enumeration Type Documentation

◆ BOOL

enum BOOL
Enumerator
FALSE 
TRUE 

Definition at line 148 of file common.h.

Function Documentation

◆ addslash()

char* addslash ( char *  path)

Definition at line 649 of file common.c.

References p, path_nextslash(), path_skiproot(), PATHDELIM, and q.

Referenced by main().

◆ basname()

char* basname ( char *  path)

Definition at line 633 of file common.c.

References p, path_nextslash(), path_skiproot(), and q.

Referenced by main(), read_bmp(), read_png(), suffix(), usage_exit(), write_bmp(), and write_png().

◆ binary_stdio()

FILE* binary_stdio ( int  fd)

Definition at line 590 of file common.c.

References fdopen(), FILE, fp, NULL, O_BINARY, setmode(), and fc-lang::stdout.

Referenced by read_bmp(), read_png(), write_bmp(), and write_png().

◆ cpyftime()

int cpyftime ( char *  srcf,
char *  dstf 
)

Definition at line 573 of file common.c.

References stat(), and utime.

Referenced by main().

◆ delslash()

char* delslash ( char *  path)

Definition at line 676 of file common.c.

References p, path_nextslash(), path_skiproot(), q, and s.

Referenced by makedir().

◆ envargv()

char** envargv ( int argcp,
char ***  argvp,
char *  envn 
)

Definition at line 404 of file common.c.

References argc, argv, free, getenv(), i, malloc, NULL, strcpy(), strlen(), and tokenize().

Referenced by main().

◆ feed_line()

void feed_line ( void  )

Definition at line 135 of file common.c.

References fflush, progbar_pos, progbar_scale, and quietmode.

Referenced by write_bmp(), and write_png().

◆ imgbuf_alloc()

◆ imgbuf_free()

void imgbuf_free ( IMAGE img)

Definition at line 330 of file common.c.

References tagIMAGE::bmpbits, free, tagIMAGE::palette, and tagIMAGE::rowptr.

Referenced by imgbuf_alloc(), read_bmp(), read_png(), write_bmp(), and write_png().

◆ imgbuf_init()

void imgbuf_init ( IMAGE img)

Definition at line 341 of file common.c.

References tagIMAGE::bmpbits, NULL, tagIMAGE::palette, and tagIMAGE::rowptr.

Referenced by imgbuf_alloc(), read_bmp(), and read_png().

◆ init_progress_meter()

void init_progress_meter ( png_structp  png_ptr,
png_uint_32  width,
png_uint_32  height 
)

◆ makedir()

int makedir ( char *  path)

Definition at line 516 of file common.c.

References c, delslash(), dir, MKDIR, p, path_nextslash(), path_skiproot(), r, S_IFDIR, S_IFMT, stat(), and strcpy().

Referenced by main().

◆ parsearg()

int parsearg ( int opt,
char **  arg,
int  argc,
char **  argv,
char *  aopts 
)

Definition at line 358 of file common.c.

References argc, argv, c, i, isoption, NULL, p, and strchr.

Referenced by main().

◆ path_nextslash()

char* path_nextslash ( char *  path)

Definition at line 709 of file common.c.

References c, IsDBCSLead, and IsPathDelim.

Referenced by addslash(), basname(), delslash(), and makedir().

◆ path_skiproot()

char* path_skiproot ( char *  path)

Definition at line 698 of file common.c.

References isalpha, and IsPathDelim.

Referenced by addslash(), basname(), delslash(), and makedir().

◆ png_my_error()

void png_my_error ( png_structp  png_ptr,
png_const_charp  message 
)

Definition at line 258 of file common.c.

References message, png_get_error_ptr(), png_jmpbuf, png_ptr, and xxprintf().

Referenced by read_png(), and write_png().

◆ png_my_warning()

void png_my_warning ( png_structp  png_ptr,
png_const_charp  message 
)

Definition at line 269 of file common.c.

References message, png_get_error_ptr(), png_ptr, and xxprintf().

Referenced by read_png(), and write_png().

◆ renbak()

int renbak ( char *  path)

Definition at line 544 of file common.c.

References i, rename, sprintf, stat(), strcpy(), strlen(), and suffix().

Referenced by main().

◆ row_callback()

void row_callback ( png_structp  png_ptr,
png_uint_32  row,
int  pass 
)

Definition at line 234 of file common.c.

References barlen, counter, maxcount, row, and update_progress_bar().

Referenced by read_png(), and write_png().

◆ set_status()

void set_status ( char *  fmt,
  ... 
)

Definition at line 122 of file common.c.

References ap, fmt, print_status(), quietmode, status_msg, va_end, and va_start.

Referenced by read_bmp(), read_png(), write_bmp(), and write_png().

◆ suffix()

char* suffix ( char *  path)

Definition at line 617 of file common.c.

References basname(), c, p, q, and r.

Referenced by renbak().

◆ tokenize()

int tokenize ( char *  buf,
char *  str 
)

Definition at line 447 of file common.c.

References buf, c, i, num, QUOTE, str, and STR.

Referenced by envargv().

◆ xxprintf()

void xxprintf ( char *  fmt,
  ... 
)

Variable Documentation

◆ errlogfile

char errlogfile[]
extern

Definition at line 35 of file bmp2png.c.

Referenced by usage_exit(), and xxprintf().

◆ errorlog

int errorlog
extern

Definition at line 44 of file common.c.

Referenced by main(), and xxprintf().

◆ quietmode

int quietmode
extern

Definition at line 43 of file common.c.

Referenced by clear_line(), feed_line(), init_progress_bar(), main(), set_status(), and update_progress_bar().