~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/gd/libgd/gdhelpers.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef GDHELPERS_H
 
2
#define GDHELPERS_H 1
 
3
 
 
4
#include <sys/types.h>
 
5
#include "php.h"
 
6
 
 
7
/* TBB: strtok_r is not universal; provide an implementation of it. */
 
8
 
 
9
extern char *gd_strtok_r(char *s, char *sep, char **state);
 
10
 
 
11
/* These functions wrap memory management. gdFree is
 
12
        in gd.h, where callers can utilize it to correctly
 
13
        free memory allocated by these functions with the
 
14
        right version of free(). */
 
15
#define gdCalloc(nmemb, size)   ecalloc(nmemb, size)
 
16
#define gdMalloc(size)          emalloc(size)
 
17
#define gdRealloc(ptr, size)    erealloc(ptr, size)
 
18
#define gdEstrdup(ptr)          estrdup(ptr)
 
19
#define gdFree(ptr)             efree(ptr)
 
20
#define gdPMalloc(ptr)          pemalloc(ptr, 1)
 
21
#define gdPFree(ptr)            pefree(ptr, 1)
 
22
#define gdPEstrdup(ptr)         pestrdup(ptr, 1)
 
23
 
 
24
#ifdef ZTS
 
25
#define gdMutexDeclare(x) MUTEX_T x
 
26
#define gdMutexSetup(x) x = tsrm_mutex_alloc()
 
27
#define gdMutexShutdown(x) tsrm_mutex_free(x)
 
28
#define gdMutexLock(x) tsrm_mutex_lock(x)
 
29
#define gdMutexUnlock(x) tsrm_mutex_unlock(x)
 
30
#else
 
31
#define gdMutexDeclare(x)
 
32
#define gdMutexSetup(x)
 
33
#define gdMutexShutdown(x)
 
34
#define gdMutexLock(x)
 
35
#define gdMutexUnlock(x)
 
36
#endif
 
37
 
 
38
#endif /* GDHELPERS_H */
 
39