/*
 * Alithia Engine
 * Copyright (C) 2009-2010 Kostas Michalopoulos
 *
 * This software is provided 'as-is', without any express or implied
 * warranty.  In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 *    claim that you wrote the original software. If you use this software
 *    in a product, an acknowledgment in the product documentation would be
 *    appreciated but is not required.
 * 2. Altered source versions must be plainly marked as such, and must not be
 *    misrepresented as being the original software.
 * 3. This notice may not be removed or altered from any source distribution.
 *
 * Kostas Michalopoulos <badsector@runtimeterror.com>
 */

#ifndef __SCRIPT_H_INCLUDED__
#define __SCRIPT_H_INCLUDED__

#define OT_NOTHING 0
#define OT_ENTITY 1
#define OT_LIGHT 2
#define OT_MODEL 3
#define OT_TEXTURE 4

#define RVT_INT 0
#define RVT_FLOAT 1
#define RVT_DOUBLE 2
#define RVT_LILVALUE 3

extern lil_t lil;

size_t or_new(int type, void* obj);
void* or_get(int type, size_t idx);
void or_release(size_t idx);
void or_deleted(void* obj);

void script_init(void);
void script_shutdown(void);
void script_eval(const char* code);
void script_run(const char* name);
void script_run_execats(const char* event);
void script_set_int(const char* name, int64_t value);
void script_set_string(const char* name, const char* value);
void script_set_float(const char* name, float value);
void script_reg_var(const char* name, int type, void* ptr);

entity_t* ent_new_by_class(const char* clsname);

#endif
