~noskcaj/ubuntu/trusty/argyll/merge

« back to all changes in this revision

Viewing changes to jcnf/yajl/yajl_common.h

  • Committer: Bazaar Package Importer
  • Author(s): Roland Mas
  • Date: 2009-12-10 17:26:04 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091210172604-pfjrmh0cag9hn0x8
Tags: 1.1.0~rc2-1
* New upstream pre-release.
* Updated location of Bazaar branches in control file.
* The Debian-specific branch now feeds from the "midstream" branch
  rather than the "upstream-releases" branch, to ease collaboration with
  other distributions.  This shouldn't make any difference on the
  package contents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2007, Lloyd Hilaiel.
 
2
 * Copyright 2007-2009, Lloyd Hilaiel.
3
3
 * 
4
4
 * Redistribution and use in source and binary forms, with or without
5
5
 * modification, are permitted provided that the following conditions are
33
33
#ifndef __YAJL_COMMON_H__
34
34
#define __YAJL_COMMON_H__
35
35
 
 
36
#ifdef __cplusplus
 
37
extern "C" {
 
38
#endif    
 
39
 
36
40
#define YAJL_MAX_DEPTH 128
37
41
 
38
 
/* Detect machine/compiler specifics here */
39
 
#if defined(NT)
40
 
#define longlong __int64
41
 
#else   /* !NT, assume standard */
42
 
#define longlong long long
43
 
#endif  /* !NT */
44
 
 
45
42
/* msft dll export gunk.  To build a DLL on windows, you
46
43
 * must define WIN32, YAJL_SHARED, and YAJL_BUILD.  To use a shared
47
44
 * DLL, you must define YAJL_SHARED and WIN32 */
55
52
#  define YAJL_API
56
53
#endif 
57
54
 
 
55
/** pointer to a malloc function, supporting client overriding memory
 
56
 *  allocation routines */
 
57
typedef void * (*yajl_malloc_func)(void *ctx, unsigned int sz);
 
58
 
 
59
/** pointer to a free function, supporting client overriding memory
 
60
 *  allocation routines */
 
61
typedef void (*yajl_free_func)(void *ctx, void * ptr);
 
62
 
 
63
/** pointer to a realloc function which can resize an allocation. */
 
64
typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, unsigned int sz);
 
65
 
 
66
/** A structure which can be passed to yajl_*_alloc routines to allow the
 
67
 *  client to specify memory allocation functions to be used. */
 
68
typedef struct
 
69
{
 
70
    /** pointer to a function that can allocate uninitialized memory */
 
71
    yajl_malloc_func malloc;
 
72
    /** pointer to a function that can resize memory allocations */
 
73
    yajl_realloc_func realloc;
 
74
    /** pointer to a function that can free memory allocated using
 
75
     *  reallocFunction or mallocFunction */
 
76
    yajl_free_func free;
 
77
    /** a context pointer that will be passed to above allocation routines */
 
78
    void * ctx;
 
79
} yajl_alloc_funcs;
 
80
 
 
81
#ifdef __cplusplus
 
82
}
 
83
#endif    
 
84
 
58
85
#endif