6 |
** $Id$ |
** $Id$ |
7 |
*/ |
*/ |
8 |
|
|
9 |
/* This code is free software; you can redistribute it and/or modify it. |
/* This code is free software; you can redistribute it and/or modify it. |
10 |
** The software provided hereunder is on an "as is" basis, and |
** The software provided hereunder is on an "as is" basis, and |
11 |
** the author has no obligation to provide maintenance, support, updates, |
** the author has no obligation to provide maintenance, support, updates, |
12 |
** enhancements, or modifications. |
** enhancements, or modifications. |
13 |
*/ |
*/ |
14 |
|
|
15 |
#include "tolua.h" |
#include "tolua.h" |
18 |
|
|
19 |
#include <stdio.h> |
#include <stdio.h> |
20 |
|
|
21 |
/* registry fiels used to hold current error info |
/* registry fiels used to hold current error info |
22 |
- tolua_err_narg: number of wrong argument |
- tolua_err_narg: number of wrong argument |
23 |
- tolua_err_provided: provided type |
- tolua_err_provided: provided type |
24 |
- tolua_err_expected: expected type |
- tolua_err_expected: expected type |
25 |
*/ |
*/ |
26 |
|
|
27 |
void toluaI_eh_set |
void toluaI_eh_set |
28 |
(lua_State* L, int narg, const char* provided, const char* expected) |
(lua_State* L, int narg, const char* provided, const char* expected) |
29 |
{ |
{ |
30 |
lua_pushnumber(L,narg); |
lua_pushnumber(L,narg); |
35 |
toluaI_setregistry(L,"tolua_err_expected"); |
toluaI_setregistry(L,"tolua_err_expected"); |
36 |
} |
} |
37 |
|
|
38 |
void tolua_error (lua_State* L, char* msg) |
void tolua_error (lua_State* L, const char* msg) |
39 |
{ |
{ |
40 |
if (msg[0]=='#') |
if (msg[0]=='#') |
41 |
{ |
{ |