struct.c File Reference
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
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 isp2 |
( |
x |
|
) |
((x) > 0 && ((x) & ((x) - 1)) == 0) |
#define MAXALIGN (PADDING > sizeof(int) ? PADDING : sizeof(int)) |
#define PADDING (sizeof(struct cD) - sizeof(double)) |
Typedef Documentation
Function Documentation
static int b_pack |
( |
lua_State * |
L |
) |
[static] |
static int b_size |
( |
lua_State * |
L |
) |
[static] |
static int b_unpack |
( |
lua_State * |
L |
) |
[static] |
static int b_unpack_table |
( |
lua_State * |
L |
) |
[static] |
static void commoncases |
( |
lua_State * |
L, |
|
|
int |
opt, |
|
|
const char ** |
fmt, |
|
|
Header * |
h | |
|
) |
| | [static] |
static void correctbytes |
( |
char * |
b, |
|
|
int |
size, |
|
|
int |
endian | |
|
) |
| | [static] |
static lua_Number getinteger |
( |
const char * |
buff, |
|
|
int |
endian, |
|
|
int |
issigned, |
|
|
int |
size | |
|
) |
| | [static] |
static size_t getnum |
( |
const char ** |
fmt, |
|
|
size_t |
df | |
|
) |
| | [static] |
static int gettoalign |
( |
size_t |
len, |
|
|
Header * |
h, |
|
|
int |
opt, |
|
|
size_t |
size | |
|
) |
| | [static] |
LUALIB_API int luaopen_struct |
( |
lua_State * |
L |
) |
|
static size_t optsize |
( |
lua_State * |
L, |
|
|
char |
opt, |
|
|
const char ** |
fmt | |
|
) |
| | [static] |
static void putinteger |
( |
lua_State * |
L, |
|
|
luaL_Buffer * |
b, |
|
|
int |
arg, |
|
|
int |
endian, |
|
|
int |
size | |
|
) |
| | [static] |
Variable Documentation
Initial value:
Definition at line 485 of file struct.c.