diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-03-26 11:31:49 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-03-26 11:31:49 -0300 |
| commit | dd3a63c205a97339d8c8aec3cd49941bc10ba45c (patch) | |
| tree | 763c1701607ace52692c8566277c6c70c7895acd /lua.h | |
| parent | cb49b088b61b75b905663a58a2c545de1ffea13a (diff) | |
| download | lua-dd3a63c205a97339d8c8aec3cd49941bc10ba45c.tar.gz lua-dd3a63c205a97339d8c8aec3cd49941bc10ba45c.tar.bz2 lua-dd3a63c205a97339d8c8aec3cd49941bc10ba45c.zip | |
new way to handle `profiles'
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 69 |
1 files changed, 59 insertions, 10 deletions
| @@ -1,9 +1,9 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.90 2001/02/23 17:28:12 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.91 2001/03/09 18:05:05 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
| 5 | ** e-mail: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
| 6 | ** www: http://www.tecgraf.puc-rio.br/lua/ | 6 | ** www: http://www.lua.org |
| 7 | ** See Copyright Notice at the end of this file | 7 | ** See Copyright Notice at the end of this file |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| @@ -17,13 +17,13 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | #define LUA_VERSION l_s("Lua 4.1 (work)") | 20 | #define LUA_VERSION "Lua 4.1 (work)" |
| 21 | #define LUA_COPYRIGHT l_s("Copyright (C) 1994-2000 TeCGraf, PUC-Rio") | 21 | #define LUA_COPYRIGHT "Copyright (C) 1994-2001 TeCGraf, PUC-Rio" |
| 22 | #define LUA_AUTHORS l_s("W. Celes, R. Ierusalimschy & L. H. de Figueiredo") | 22 | #define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | /* name of global variable with error handler */ | 25 | /* name of global variable with error handler */ |
| 26 | #define LUA_ERRORMESSAGE l_s("_ERRORMESSAGE") | 26 | #define LUA_ERRORMESSAGE "_ERRORMESSAGE" |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | /* pre-defined references */ | 29 | /* pre-defined references */ |
| @@ -77,10 +77,16 @@ typedef int (*lua_CFunction) (lua_State *L); | |||
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | /* Lua numerical type */ | 79 | /* Lua numerical type */ |
| 80 | typedef double lua_Number; | 80 | #ifndef LUA_NUMBER |
| 81 | #define LUA_NUMBER double | ||
| 82 | #endif | ||
| 83 | typedef LUA_NUMBER lua_Number; | ||
| 81 | 84 | ||
| 82 | /* Lua character type */ | 85 | /* Lua character type */ |
| 83 | typedef char l_char; | 86 | #ifndef L_CHAR |
| 87 | #define L_CHAR char | ||
| 88 | #endif | ||
| 89 | typedef L_CHAR l_char; | ||
| 84 | 90 | ||
| 85 | 91 | ||
| 86 | /* mark for all API functions */ | 92 | /* mark for all API functions */ |
| @@ -89,7 +95,6 @@ typedef char l_char; | |||
| 89 | #endif | 95 | #endif |
| 90 | 96 | ||
| 91 | 97 | ||
| 92 | |||
| 93 | /* | 98 | /* |
| 94 | ** state manipulation | 99 | ** state manipulation |
| 95 | */ | 100 | */ |
| @@ -227,7 +232,7 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
| 227 | 232 | ||
| 228 | #define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY) | 233 | #define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY) |
| 229 | 234 | ||
| 230 | #define lua_pushliteral(L, s) lua_pushlstring(L, l_s("") s, \ | 235 | #define lua_pushliteral(L, s) lua_pushlstring(L, s, \ |
| 231 | (sizeof(s)/sizeof(l_char))-1) | 236 | (sizeof(s)/sizeof(l_char))-1) |
| 232 | 237 | ||
| 233 | 238 | ||
| @@ -238,6 +243,50 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); | |||
| 238 | 243 | ||
| 239 | 244 | ||
| 240 | 245 | ||
| 246 | /* | ||
| 247 | ** {====================================================================== | ||
| 248 | ** useful definitions for Lua kernel and libraries | ||
| 249 | */ | ||
| 250 | #ifdef LUA_PRIVATE | ||
| 251 | |||
| 252 | /* macro to control type of literal strings */ | ||
| 253 | #ifndef l_s | ||
| 254 | #define l_s(x) x | ||
| 255 | #endif | ||
| 256 | |||
| 257 | /* macro to control type of literal chars */ | ||
| 258 | #ifndef l_c | ||
| 259 | #define l_c(x) x | ||
| 260 | #endif | ||
| 261 | |||
| 262 | /* macro to `unsign' a character */ | ||
| 263 | #ifndef uchar | ||
| 264 | #define uchar(c) ((unsigned char)(c)) | ||
| 265 | #endif | ||
| 266 | |||
| 267 | /* integer type to hold the result of fgetc */ | ||
| 268 | #ifndef l_charint | ||
| 269 | #define l_charint int | ||
| 270 | #endif | ||
| 271 | |||
| 272 | /* function to convert a lua_Number to a string */ | ||
| 273 | #ifndef LUA_NUMBER_FMT | ||
| 274 | #define LUA_NUMBER_FMT "%.16g" | ||
| 275 | #endif | ||
| 276 | #ifndef lua_number2str | ||
| 277 | #define lua_number2str(s,n) sprintf((s), l_s(LUA_NUMBER_FMT), (n)) | ||
| 278 | #endif | ||
| 279 | |||
| 280 | /* function to convert a string to a lua_Number */ | ||
| 281 | #ifndef lua_str2number | ||
| 282 | #define lua_str2number(s,p) strtod((s), (p)) | ||
| 283 | #endif | ||
| 284 | |||
| 285 | #endif | ||
| 286 | /* }====================================================================== */ | ||
| 287 | |||
| 288 | |||
| 289 | |||
| 241 | /****************************************************************************** | 290 | /****************************************************************************** |
| 242 | * Copyright (C) 1994-2000 TeCGraf, PUC-Rio. All rights reserved. | 291 | * Copyright (C) 1994-2000 TeCGraf, PUC-Rio. All rights reserved. |
| 243 | * | 292 | * |
