2006-04-13 20:47:06 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
|
|
|
|
|
|
|
Duke Nukem 3D is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2014-07-20 08:55:56 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
Original Source: 1996 - Todd Replogle
|
|
|
|
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// scriplib.h
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef scriplib_public_h_
|
|
|
|
#define scriplib_public_h_
|
2012-11-05 02:49:08 +00:00
|
|
|
#ifdef EXTERNC
|
|
|
|
{
|
2006-04-13 20:47:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Init
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_Init( char * name );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Free
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
void SCRIPT_Free( int32_t scripthandle );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Load
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_Load ( char * filename );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Save
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
void SCRIPT_Save (int32_t scripthandle, char * filename);
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_NumberSections
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_NumberSections( int32_t scripthandle );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Section
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
char * SCRIPT_Section( int32_t scripthandle, int32_t which );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_NumberEntries
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_NumberEntries( int32_t scripthandle, char * sectionname );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_Entry
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2009-04-26 05:57:42 +00:00
|
|
|
char * SCRIPT_Entry( int32_t scripthandle, char * sectionname, int32_t which );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_GetRaw
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
char * SCRIPT_GetRaw(int32_t scripthandle, char * sectionname, char * entryname);
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_GetString
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2013-03-28 09:04:54 +00:00
|
|
|
int32_t SCRIPT_GetStringPtr
|
|
|
|
(
|
|
|
|
int32_t scripthandle,
|
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
char ** dest
|
|
|
|
);
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_GetString
|
2006-04-13 20:47:06 +00:00
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
char * dest
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_GetDoubleString
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_GetDoubleString
|
2006-04-13 20:47:06 +00:00
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
char * dest1,
|
|
|
|
char * dest2
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_GetNumber
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_GetNumber
|
2006-04-13 20:47:06 +00:00
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2013-02-28 17:30:08 +00:00
|
|
|
const char * sectionname,
|
|
|
|
const char * entryname,
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t * number
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_GetBoolean
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t SCRIPT_GetBoolean
|
2006-04-13 20:47:06 +00:00
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t * boole
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutSection
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-26 05:57:42 +00:00
|
|
|
void SCRIPT_PutSection( int32_t scripthandle, char * sectionname );
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutRaw
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCRIPT_PutRaw
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
char * raw
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutString
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCRIPT_PutString
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
2012-07-01 22:11:33 +00:00
|
|
|
const char * string
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutDoubleString
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCRIPT_PutDoubleString
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
char * string1,
|
|
|
|
char * string2
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutNumber
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCRIPT_PutNumber
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2013-02-28 17:30:08 +00:00
|
|
|
const char * sectionname,
|
|
|
|
const char * entryname,
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t number,
|
|
|
|
int32_t hexadecimal,
|
|
|
|
int32_t defaultvalue
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutBoolean
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCRIPT_PutBoolean
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t boole
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= SCRIPT_PutDouble
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
|
|
|
void SCRIPT_PutDouble
|
|
|
|
(
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t scripthandle,
|
2006-04-13 20:47:06 +00:00
|
|
|
char * sectionname,
|
|
|
|
char * entryname,
|
|
|
|
double number,
|
2009-04-26 05:57:42 +00:00
|
|
|
int32_t defaultvalue
|
2006-04-13 20:47:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
#ifdef EXTERNC
|
2006-04-13 20:47:06 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|