source: Daodan/src/BFW_ScriptingLanguage.h@ 443

Last change on this file since 443 was 440, checked in by rossy, 15 years ago

int32rand

File size: 1.2 KB
RevLine 
[439]1#pragma once
2#ifndef BFW_UTILITY_H
3#define BFW_UTILITY_H
4
5#include "Daodan.h"
6
7#include <stdint.h>
8#include <stdbool.h>
9
10typedef enum {
11 sl_int32,
12 sl_str32, /* it's fixed length, 32 bytes. */
13 sl_float,
14 sl_bool, /* Actually int32 0 or 1. */
15 sl_void,
16} sl_type;
17
18typedef struct {
19 sl_type type;
20 union {
[440]21 void* value;
22 int32_t value_int32;
23 char* value_str32;
24 float value_float;
25 bool value_bool;
[439]26 };
27} sl_arg;
28
29typedef uint16_t (ONICALL *sl_func)(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret);
30
31uint16_t ONICALL SLrScript_Command_Register_ReturnType(char* name, char* desc, char* argfmt, sl_type type, sl_func callback);
32uint16_t ONICALL SLrScript_Command_Register_Void(char* name, char* desc, char* argfmt, sl_func callback);
[440]33uint16_t ONICALL SLrGlobalVariable_Register_Int32(char* name, char* desc, int32_t* data);
[439]34uint16_t ONICALL SLrGlobalVariable_Register_Float(char* name, char* desc, float* data);
35uint16_t ONICALL SLrGlobalVariable_Register_Bool(char* name, char* desc, uint32_t* data);
36uint16_t ONICALL SLrGlobalVariable_Register_String(char* name, char* desc, char* data);
37
38#endif
Note: See TracBrowser for help on using the repository browser.