Skip to content

Commit

Permalink
Updated all function declarations to be stdcall.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiei committed Mar 29, 2010
1 parent 3f85b20 commit a73e538
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions yajl_common.pas
Expand Up @@ -24,9 +24,9 @@ interface
typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, unsigned int sz);
}

Tyajl_malloc_func = function(context: pointer; sizeOf: Cardinal): Pointer of object;
Tyajl_free_func = procedure(context: pointer; ptr: pointer) of object;
Tyajl_realloc_func = function(context: pointer; ptr: pointer; sizeOf: cardinal): Pointer of object;
Tyajl_malloc_func = function(context: pointer; sizeOf: Cardinal): Pointer of object; stdcall;
Tyajl_free_func = procedure(context: pointer; ptr: pointer) of object; stdcall;
Tyajl_realloc_func = function(context: pointer; ptr: pointer; sizeOf: cardinal): Pointer of object; stdcall;

{/** A structure which can be passed to yajl_*_alloc routines to allow the
* client to specify memory allocation functions to be used. */}
Expand Down
28 changes: 14 additions & 14 deletions yajl_gen.pas
Expand Up @@ -61,12 +61,12 @@ yajl_gen_config = record
}

Tyajl_gen_alloc = function (const config: Pyajl_gen_config;
allocFuncs: Pyajl_alloc_funcs): Tyajl_gen; cdecl;
allocFuncs: Pyajl_alloc_funcs): Tyajl_gen; stdcall;

{ /** free a generator handle */
void YAJL_API yajl_gen_free(yajl_gen handle); }

Tyajl_gen_free = procedure (handle: Tyajl_gen); cdecl;
Tyajl_gen_free = procedure (handle: Tyajl_gen); stdcall;
{
yajl_gen_status YAJL_API yajl_gen_integer(yajl_gen hand, long int number);
yajl_gen_status YAJL_API yajl_gen_double(yajl_gen hand, double number);
Expand All @@ -83,20 +83,20 @@ yajl_gen_config = record
yajl_gen_status YAJL_API yajl_gen_array_open(yajl_gen hand);
yajl_gen_status YAJL_API yajl_gen_array_close(yajl_gen hand); }

Tyajl_gen_integer = function (hand: Tyajl_gen; number: LongInt): yajl_gen_status; cdecl;
Tyajl_gen_double = function (hand: Tyajl_gen; number: Double): yajl_gen_status; cdecl;
Tyajl_gen_integer = function (hand: Tyajl_gen; number: LongInt): yajl_gen_status; stdcall;
Tyajl_gen_double = function (hand: Tyajl_gen; number: Double): yajl_gen_status; stdcall;
Tyajl_gen_number = function (hand: Tyajl_gen;
num: PChar;
len: Cardinal): yajl_gen_status; cdecl;
len: Cardinal): yajl_gen_status; stdcall;
Tyajl_gen_string = function (hand: Tyajl_gen;
str: PChar;
len: Cardinal): yajl_gen_status; cdecl;
Tyajl_gen_null = function (hand: Tyajl_gen): yajl_gen_status; cdecl;
Tyajl_gen_bool = function (hand: Tyajl_gen; bool: integer): yajl_gen_status; cdecl;
Tyajl_gen_map_open = function (hand: Tyajl_gen): yajl_gen_status; cdecl;
Tyajl_gen_map_close = function (hand: Tyajl_gen): yajl_gen_status; cdecl;
Tyajl_gen_array_open = function (hand: Tyajl_gen): yajl_gen_status; cdecl;
Tyajl_gen_array_close = function (hand: Tyajl_gen): yajl_gen_status; cdecl;
len: Cardinal): yajl_gen_status; stdcall;
Tyajl_gen_null = function (hand: Tyajl_gen): yajl_gen_status; stdcall;
Tyajl_gen_bool = function (hand: Tyajl_gen; bool: integer): yajl_gen_status; stdcall;
Tyajl_gen_map_open = function (hand: Tyajl_gen): yajl_gen_status; stdcall;
Tyajl_gen_map_close = function (hand: Tyajl_gen): yajl_gen_status; stdcall;
Tyajl_gen_array_open = function (hand: Tyajl_gen): yajl_gen_status; stdcall;
Tyajl_gen_array_close = function (hand: Tyajl_gen): yajl_gen_status; stdcall;
{
/** access the null terminated generator buffer. If incrementally
* outputing JSON, one should call yajl_gen_clear to clear the
Expand All @@ -109,13 +109,13 @@ yajl_gen_config = record

Tyajl_gen_get_buf = function (handle: Tyajl_gen;
var buf: PByte;
len: Cardinal): yajl_gen_status; cdecl;
len: Cardinal): yajl_gen_status; stdcall;
{/** clear yajl's output buffer, but maintain all internal generation
* state. This function will not "reset" the generator state, and is
* intended to enable incremental JSON outputing. */
void YAJL_API yajl_gen_clear(yajl_gen hand);}

Tyajl_gen_clear = procedure (handle: Tyajl_gen); cdecl;
Tyajl_gen_clear = procedure (handle: Tyajl_gen); stdcall;

implementation

Expand Down
12 changes: 6 additions & 6 deletions yajl_parse.pas
Expand Up @@ -98,14 +98,14 @@ yajl_parser_config = record
Tyajl_alloc = function(const callbacks: Pyajl_callbacks;
const config: Pyajl_parser_config;
const allocFuncs: Pyajl_alloc_funcs;
context: pointer): yajl_handle; cdecl;
context: pointer): yajl_handle; stdcall;

{
/** free a parser handle */
void YAJL_API yajl_free(yajl_handle handle);
}

Tyajl_free = procedure(handle: yajl_handle); cdecl;
Tyajl_free = procedure(handle: yajl_handle); stdcall;

{
/** Parse some json!
Expand All @@ -120,7 +120,7 @@ yajl_parser_config = record

Tyajl_parse = function(handle: yajl_handle;
const jsonText: PChar;
const jsonTextLegnth: Integer): yajl_status; cdecl;
const jsonTextLegnth: Integer): yajl_status; stdcall;

{
/** Parse any remaining buffered json.
Expand All @@ -136,7 +136,7 @@ yajl_parser_config = record
}


Tyajl_parse_complete = function(handle: yajl_handle): yajl_status; cdecl;
Tyajl_parse_complete = function(handle: yajl_handle): yajl_status; stdcall;
{
/** get an error string describing the state of the
* parse.
Expand All @@ -156,14 +156,14 @@ yajl_parser_config = record
Tyajl_get_error = function(handle: yajl_handle;
verbose: integer;
jsonText: PChar;
jsonTextLegnth: Cardinal): PChar; cdecl;
jsonTextLegnth: Cardinal): PChar; stdcall;
{
/** free an error returned from yajl_get_error */
void YAJL_API yajl_free_error(yajl_handle hand, unsigned char * str);
}

Tyajl_free_error = procedure(handle: yajl_handle; str: PChar); cdecl;
Tyajl_free_error = procedure(handle: yajl_handle; str: PChar); stdcall;
implementation

end.

0 comments on commit a73e538

Please sign in to comment.