2008-12-08 23:30:19 +00:00
|
|
|
/* -------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* bin_helper: ErlDrvBinary helper functions
|
|
|
|
* Copyright (c) 2008 The Hive. All rights reserved.
|
|
|
|
*
|
|
|
|
* ------------------------------------------------------------------- */
|
|
|
|
#ifndef _BIN_HELPER
|
|
|
|
#define _BIN_HELPER
|
|
|
|
|
|
|
|
#include "erl_driver.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ErlDrvBinary* bin;
|
|
|
|
unsigned int offset;
|
|
|
|
} BinHelper;
|
|
|
|
|
2008-12-17 21:45:39 +00:00
|
|
|
void bin_helper_init(BinHelper* bh);
|
2008-12-08 23:30:19 +00:00
|
|
|
void bin_helper_push_byte(BinHelper* bh, int value);
|
|
|
|
void bin_helper_push_int32(BinHelper* bh, int value);
|
|
|
|
void bin_helper_push_string(BinHelper* bh, const char* string);
|
|
|
|
|
|
|
|
#endif
|