diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-17 16:49:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-17 16:49:15 -0300 |
commit | 67578ec51f1a3ec2c967f15d370067caf9e0b87b (patch) | |
tree | d77b292ddec33d7e6987bae808fa1db250ebd830 /lua.h | |
parent | c2bb9abceceef125554595e23b7cc18ad3555c7c (diff) | |
download | lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.gz lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.bz2 lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.zip |
several small details
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 43 |
1 files changed, 21 insertions, 22 deletions
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.206 2005/05/05 20:47:02 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.207 2005/05/16 19:21:11 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org |
6 | ** See Copyright Notice at the end of this file | 6 | ** See Copyright Notice at the end of this file |
7 | */ | 7 | */ |
8 | 8 | ||
@@ -55,10 +55,9 @@ typedef int (*lua_CFunction) (lua_State *L); | |||
55 | /* | 55 | /* |
56 | ** functions that read/write blocks when loading/dumping Lua chunks | 56 | ** functions that read/write blocks when loading/dumping Lua chunks |
57 | */ | 57 | */ |
58 | typedef const char * (*lua_Chunkreader) (lua_State *L, void *ud, size_t *sz); | 58 | typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); |
59 | 59 | ||
60 | typedef int (*lua_Chunkwriter) (lua_State *L, const void* p, | 60 | typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); |
61 | size_t sz, void* ud); | ||
62 | 61 | ||
63 | 62 | ||
64 | /* | 63 | /* |
@@ -70,17 +69,17 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); | |||
70 | /* | 69 | /* |
71 | ** basic types | 70 | ** basic types |
72 | */ | 71 | */ |
73 | #define LUA_TNONE (-1) | 72 | #define LUA_TNONE (-1) |
74 | 73 | ||
75 | #define LUA_TNIL 0 | 74 | #define LUA_TNIL 0 |
76 | #define LUA_TBOOLEAN 1 | 75 | #define LUA_TBOOLEAN 1 |
77 | #define LUA_TLIGHTUSERDATA 2 | 76 | #define LUA_TLIGHTUSERDATA 2 |
78 | #define LUA_TNUMBER 3 | 77 | #define LUA_TNUMBER 3 |
79 | #define LUA_TSTRING 4 | 78 | #define LUA_TSTRING 4 |
80 | #define LUA_TTABLE 5 | 79 | #define LUA_TTABLE 5 |
81 | #define LUA_TFUNCTION 6 | 80 | #define LUA_TFUNCTION 6 |
82 | #define LUA_TUSERDATA 7 | 81 | #define LUA_TUSERDATA 7 |
83 | #define LUA_TTHREAD 8 | 82 | #define LUA_TTHREAD 8 |
84 | 83 | ||
85 | 84 | ||
86 | 85 | ||
@@ -147,7 +146,6 @@ LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); | |||
147 | LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); | 146 | LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); |
148 | LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); | 147 | LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); |
149 | LUA_API int (lua_toboolean) (lua_State *L, int idx); | 148 | LUA_API int (lua_toboolean) (lua_State *L, int idx); |
150 | LUA_API const char *(lua_tostring) (lua_State *L, int idx); | ||
151 | LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); | 149 | LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); |
152 | LUA_API size_t (lua_objsize) (lua_State *L, int idx); | 150 | LUA_API size_t (lua_objsize) (lua_State *L, int idx); |
153 | LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); | 151 | LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); |
@@ -202,11 +200,11 @@ LUA_API int (lua_setfenv) (lua_State *L, int idx); | |||
202 | */ | 200 | */ |
203 | LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); | 201 | LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); |
204 | LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); | 202 | LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); |
205 | LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); | 203 | LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); |
206 | LUA_API int (lua_load) (lua_State *L, lua_Chunkreader reader, void *dt, | 204 | LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, |
207 | const char *chunkname); | 205 | const char *chunkname); |
208 | 206 | ||
209 | LUA_API int (lua_dump) (lua_State *L, lua_Chunkwriter writer, void *data); | 207 | LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); |
210 | 208 | ||
211 | 209 | ||
212 | /* | 210 | /* |
@@ -290,7 +288,8 @@ LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); | |||
290 | 288 | ||
291 | #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) | 289 | #define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) |
292 | 290 | ||
293 | 291 | #define lua_Chunkreader lua_Reader | |
292 | #define lua_Chunkwriter lua_Writer | ||
294 | 293 | ||
295 | 294 | ||
296 | 295 | ||
@@ -321,6 +320,8 @@ LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); | |||
321 | 320 | ||
322 | typedef struct lua_Debug lua_Debug; /* activation record */ | 321 | typedef struct lua_Debug lua_Debug; /* activation record */ |
323 | 322 | ||
323 | |||
324 | /* Functions to be called by the debuger in specific events */ | ||
324 | typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); | 325 | typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); |
325 | 326 | ||
326 | 327 | ||
@@ -337,8 +338,6 @@ LUA_API int lua_gethookmask (lua_State *L); | |||
337 | LUA_API int lua_gethookcount (lua_State *L); | 338 | LUA_API int lua_gethookcount (lua_State *L); |
338 | 339 | ||
339 | 340 | ||
340 | #define LUA_IDSIZE 60 | ||
341 | |||
342 | struct lua_Debug { | 341 | struct lua_Debug { |
343 | int event; | 342 | int event; |
344 | const char *name; /* (n) */ | 343 | const char *name; /* (n) */ |
@@ -358,7 +357,7 @@ struct lua_Debug { | |||
358 | 357 | ||
359 | 358 | ||
360 | /****************************************************************************** | 359 | /****************************************************************************** |
361 | * Copyright (C) 1994-2004 Tecgraf, PUC-Rio. All rights reserved. | 360 | * Copyright (C) 1994-2005 Tecgraf, PUC-Rio. All rights reserved. |
362 | * | 361 | * |
363 | * Permission is hereby granted, free of charge, to any person obtaining | 362 | * Permission is hereby granted, free of charge, to any person obtaining |
364 | * a copy of this software and associated documentation files (the | 363 | * a copy of this software and associated documentation files (the |