$search

struct.c File Reference

#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
Include dependency graph for struct.c:

Go to the source code of this file.

Classes

struct  cD
struct  Header

Defines

#define BIG   0
#define defaultoptions(h)   ((h)->endian = native.endian, (h)->align = 1)
#define isp2(x)   ((x) > 0 && ((x) & ((x) - 1)) == 0)
#define LITTLE   1
#define MAXALIGN   (PADDING > sizeof(int) ? PADDING : sizeof(int))
#define PADDING   (sizeof(struct cD) - sizeof(double))

Typedefs

typedef struct Header Header

Functions

static int b_pack (lua_State *L)
static int b_size (lua_State *L)
static int b_unpack (lua_State *L)
static int b_unpack_table (lua_State *L)
static void commoncases (lua_State *L, int opt, const char **fmt, Header *h)
static void correctbytes (char *b, int size, int endian)
static lua_Number getinteger (const char *buff, int endian, int issigned, int size)
static size_t getnum (const char **fmt, size_t df)
static int gettoalign (size_t len, Header *h, int opt, size_t size)
LUALIB_API int luaopen_struct (lua_State *L)
static size_t optsize (lua_State *L, char opt, const char **fmt)
static void putinteger (lua_State *L, luaL_Buffer *b, int arg, int endian, int size)

Variables

union {
   int   dummy
   char   endian
native
static struct luaL_reg thislib []

Define Documentation

#define BIG   0

Definition at line 53 of file struct.c.

#define defaultoptions (  )     ((h)->endian = native.endian, (h)->align = 1)

Definition at line 82 of file struct.c.

#define isp2 (  )     ((x) > 0 && ((x) & ((x) - 1)) == 0)

Definition at line 39 of file struct.c.

#define LITTLE   1

Definition at line 54 of file struct.c.

#define MAXALIGN   (PADDING > sizeof(int) ? PADDING : sizeof(int))

Definition at line 49 of file struct.c.

#define PADDING   (sizeof(struct cD) - sizeof(double))

Definition at line 48 of file struct.c.


Typedef Documentation

typedef struct Header Header

Function Documentation

static int b_pack ( lua_State *  L  )  [static]

Definition at line 167 of file struct.c.

static int b_size ( lua_State *  L  )  [static]

Definition at line 249 of file struct.c.

static int b_unpack ( lua_State *  L  )  [static]

Definition at line 328 of file struct.c.

static int b_unpack_table ( lua_State *  L  )  [static]

Definition at line 394 of file struct.c.

static void commoncases ( lua_State *  L,
int  opt,
const char **  fmt,
Header h 
) [static]

Definition at line 117 of file struct.c.

static void correctbytes ( char *  b,
int  size,
int  endian 
) [static]

Definition at line 155 of file struct.c.

static lua_Number getinteger ( const char *  buff,
int  endian,
int  issigned,
int  size 
) [static]

Definition at line 225 of file struct.c.

static size_t getnum ( const char **  fmt,
size_t  df 
) [static]

Definition at line 69 of file struct.c.

static int gettoalign ( size_t  len,
Header h,
int  opt,
size_t  size 
) [static]

Definition at line 110 of file struct.c.

LUALIB_API int luaopen_struct ( lua_State *  L  ) 

Definition at line 494 of file struct.c.

static size_t optsize ( lua_State *  L,
char  opt,
const char **  fmt 
) [static]

Definition at line 86 of file struct.c.

static void putinteger ( lua_State *  L,
luaL_Buffer *  b,
int  arg,
int  endian,
int  size 
) [static]

Definition at line 134 of file struct.c.


Variable Documentation

int dummy

Definition at line 58 of file struct.c.

char endian

Definition at line 59 of file struct.c.

union { ... } native [static]
struct luaL_reg thislib[] [static]
Initial value:
 {
  {"pack", b_pack},
  {"unpack", b_unpack},
  {"unpack_table", b_unpack_table},
  {"size", b_size},
  {NULL, NULL}
}

Definition at line 485 of file struct.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


roslua
Author(s): Tim Niemueller
autogenerated on Tue Mar 5 12:26:19 2013