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)  

gdhelpers.h
Go to the documentation of this file.
1 #ifndef GDHELPERS_H
2 #define GDHELPERS_H 1
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8  /* sys/types.h is needed for size_t on Sparc-SunOS-4.1 */
9 #ifndef _WIN32_WCE
10 #include <sys/types.h>
11 #else
12 #include <stdlib.h>
13 #endif /* _WIN32_WCE */
14 
15  /* TBB: strtok_r is not universal; provide an implementation of it. */
16 
17  char * gd_strtok_r (char *s, char *sep, char **state);
18 
19  /* These functions wrap memory management. gdFree is
20  in gd.h, where callers can utilize it to correctly
21  free memory allocated by these functions with the
22  right version of free(). */
23  void *gdCalloc (size_t nmemb, size_t size);
24  void *gdMalloc (size_t size);
25  void *gdRealloc (void *ptr, size_t size);
26  /* The extended version of gdReallocEx will free *ptr if the
27  * realloc fails */
28  void *gdReallocEx (void *ptr, size_t size);
29 
30  /* Returns nonzero if multiplying the two quantities will
31  result in integer overflow. Also returns nonzero if
32  either quantity is negative. By Phil Knirsch based on
33  netpbm fixes by Alan Cox. */
34 
35  int overflow2(int a, int b);
36 
37  /* 2.0.16: portable mutex support for thread safety. */
38 #if defined(CPP_SHARP)
39 # define gdMutexDeclare(x)
40 # define gdMutexSetup(x)
41 # define gdMutexShutdown(x)
42 # define gdMutexLock(x)
43 # define gdMutexUnlock(x)
44 #elif defined(_WIN32)
45  /* 2.0.18: must include windows.h to get CRITICAL_SECTION. */
46 # include <windows.h>
47 # define gdMutexDeclare(x) CRITICAL_SECTION x
48 # define gdMutexSetup(x) InitializeCriticalSection(&x)
49 # define gdMutexShutdown(x) DeleteCriticalSection(&x)
50 # define gdMutexLock(x) EnterCriticalSection(&x)
51 # define gdMutexUnlock(x) LeaveCriticalSection(&x)
52 #elif defined(HAVE_PTHREAD)
53 # include <pthread.h>
54 # define gdMutexDeclare(x) pthread_mutex_t x
55 # define gdMutexSetup(x) pthread_mutex_init(&x, 0)
56 # define gdMutexShutdown(x) pthread_mutex_destroy(&x)
57 # define gdMutexLock(x) pthread_mutex_lock(&x)
58 # define gdMutexUnlock(x) pthread_mutex_unlock(&x)
59 #else
60 # define gdMutexDeclare(x)
61 # define gdMutexSetup(x)
62 # define gdMutexShutdown(x)
63 # define gdMutexLock(x)
64 # define gdMutexUnlock(x)
65 #endif /* _WIN32 || HAVE_PTHREAD */
66 
67 #define DPCM2DPI(dpcm) (unsigned int)((dpcm)*2.54 + 0.5)
68 #define DPM2DPI(dpm) (unsigned int)((dpm)*0.0254 + 0.5)
69 #define DPI2DPCM(dpi) (unsigned int)((dpi)/2.54 + 0.5)
70 #define DPI2DPM(dpi) (unsigned int)((dpi)/0.0254 + 0.5)
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* GDHELPERS_H */
#define b
Definition: jpegint.h:372
#define s
Definition: afcover.h:80
#define a(n)
Definition: gpos-common.c:148
void * gdReallocEx(void *ptr, size_t size)
Definition: gdhelpers.c:85
void * gdMalloc(size_t size)
Definition: gdhelpers.c:73
void * gdCalloc(size_t nmemb, size_t size)
Definition: gdhelpers.c:67
char * gd_strtok_r(char *s, char *sep, char **state)
Definition: gdhelpers.c:18
int overflow2(int a, int b)
Definition: gd_security.c:21
void * gdRealloc(void *ptr, size_t size)
Definition: gdhelpers.c:79
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr
static int size
Definition: ppmlabel.c:24
static char sep[2]
Definition: pdftoppm.cc:115