From c5bb2ef34c2c42ed961dfaa42a3cffd1d581d890 Mon Sep 17 00:00:00 2001 From: "Michael D. Reiley" Date: Tue, 13 Jul 2010 12:09:33 -0700 Subject: [PATCH] Readme --- LICENCE | 7 ++++++- README | 11 +++++++++++ src/{stml-stabled.c => interpreter.c} | 0 src/{stml-standalone.c => macro.c} | 0 src/{stml-stabled.c => parser.c} | 0 src/{stml-stabled.c => stabled-extension.c} | 0 src/{stml-stabled.c => stml.c} | 0 src/{stml-stabled.c => table.c} | 0 src/{stml-stabled.c => xml.c} | 0 stabled | 1 - src/stml.h => stml.h | 22 +++++++++++----------- tmp/Table1.xml | 15 +++++++++++++++ tmp/custom.xml | 8 ++++++++ tmp/examples | 16 ++++++++++++++++ 14 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 README copy src/{stml-stabled.c => interpreter.c} (100%) rename src/{stml-standalone.c => macro.c} (100%) copy src/{stml-stabled.c => parser.c} (100%) copy src/{stml-stabled.c => stabled-extension.c} (100%) copy src/{stml-stabled.c => stml.c} (100%) copy src/{stml-stabled.c => table.c} (100%) rename src/{stml-stabled.c => xml.c} (100%) delete mode 160000 stabled rename src/stml.h => stml.h (81%) create mode 100644 tmp/Table1.xml create mode 100644 tmp/custom.xml create mode 100644 tmp/examples diff --git a/LICENCE b/LICENCE index 4b9e05b..b46ea35 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,9 @@ -Copyright (c) 2010, Omega Software Development Group / Michael D. Reiley (Seisatsu) +THIS LICENSE APPLIES TO NONCOMMERCIAL USE ONLY. +FOR COMMERCIAL USE, CONTACT THE OMEGA SOFTWARE DEVELOPMENT GROUP. + +Copyright (c) 2010, Michael D. Reiley (Seisatsu) +AND +Omega Software Development Group Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/README b/README new file mode 100644 index 0000000..d5e14f1 --- /dev/null +++ b/README @@ -0,0 +1,11 @@ +STML is a command language for modifying “status tables”. Status tables are similar to relational databases. However, a status table informs the program utilizing it immediately when a value or “state” has changed. Status tables are kept in memory rather than on disk. They are suitable for real-time operations. + +STML can be used as a simple data manipulation query language, or to command a process with the english-like syntax of a query language. STML supports redefining portions of, or the entire language using XML macro definitions. Status tables can be dumped to and loaded from XML files. + +The STML project includes STableD, or the Status Table Daemon. STableD uses sockets to facilitate Inter-Process Communication, allowing multiple programs to share and modify a single status table. + +STML was inspired by a scene in the Anime "Dennou Coil", where a main character used an english-like command language to control robots. + +STML is released for NONCOMMERCIAL USE ONLY under the ISC License. + +For commercial use, contact the Omega Software Development Group. diff --git a/src/stml-stabled.c b/src/interpreter.c similarity index 100% copy from src/stml-stabled.c copy to src/interpreter.c diff --git a/src/stml-standalone.c b/src/macro.c similarity index 100% rename from src/stml-standalone.c rename to src/macro.c diff --git a/src/stml-stabled.c b/src/parser.c similarity index 100% copy from src/stml-stabled.c copy to src/parser.c diff --git a/src/stml-stabled.c b/src/stabled-extension.c similarity index 100% copy from src/stml-stabled.c copy to src/stabled-extension.c diff --git a/src/stml-stabled.c b/src/stml.c similarity index 100% copy from src/stml-stabled.c copy to src/stml.c diff --git a/src/stml-stabled.c b/src/table.c similarity index 100% copy from src/stml-stabled.c copy to src/table.c diff --git a/src/stml-stabled.c b/src/xml.c similarity index 100% rename from src/stml-stabled.c rename to src/xml.c diff --git a/stabled b/stabled deleted file mode 160000 index fe30604..0000000 --- a/stabled +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fe306044e5aef26ae3245900d7679ee37e26ee09 diff --git a/src/stml.h b/stml.h similarity index 81% rename from src/stml.h rename to stml.h index e6a23c1..aec189f 100644 --- a/src/stml.h +++ b/stml.h @@ -23,7 +23,7 @@ enum STML_STATE_TYPE { /*Types of states*/ typedef struct STML_STATE__ { char* id; /*Identifier of state*/ - int int_id; /*Interrupt ID of state; will always be unique*/ + int int_id; /*Callback ID of state; will always be unique*/ STML_STATE_TYPE type; /*Type of state*/ struct STML_STATE__** parent_data; /*State contains more states*/ bool* bool_data; /*State contains a boolean*/ @@ -44,16 +44,16 @@ typedef struct { /*This is the only struct that the end user needs to care about /* -- FUNCTION SECTION -- */ -/* (*stml_interrupt) -* Function pointer to interrupt the parent program when a change is made. -* Programs can pass a custom interrupt function. +/* (*stml_callback) +* Function pointer to callback the parent program when a change is made. +* Programs can pass a custom callback function. * * Arguments: * -- 1) STML_TABLE* : STML Table to be used -* -- 2) int : Interrupt ID for the modified state. See the manual. +* -- 2) int : Callback ID for the modified state. See the manual. * -- 2) void* : Convenience variable that immediately returns the new state. */ -typedef void (*stml_interrupt) (STML_TABLE* table, int int_id, void* state); +typedef void (*stml_callback) (STML_TABLE* table, int cbid, void* state); /* stml_create_table * Create a new STML table. @@ -80,9 +80,9 @@ void stml_destroy_table (STML_TABLE* table); * -- 1) STML_TABLE* : The table to be used. * -- 2) char* : Command string to be interpreted. * -- 3) void* : Returns data if the command is a query type. -* -- 4) int : If a new state was created, returns a unique interrupt ID. Otherwise, 0. See the manual. +* -- 4) int* : If a new state was created, returns a unique callback ID. Otherwise, 0. See the manual. */ -int stml_command (STML_TABLE* table, char* command, void* data, int* int_id); +int stml_command (STML_TABLE* table, char* command, void* data, int* cbid); /* stml_save * Save a table in XML format. @@ -91,7 +91,7 @@ int stml_command (STML_TABLE* table, char* command, void* data, int* int_id); * -- 1) STML_TABLE* : Table to save. * -- 2) FILE* : File pointer to dump XML data to. */ -void stml_save(STML_TABLE* table, FILE* file); +void stml_save (STML_TABLE* table, FILE* file); /* stml_load * Load a table in XML format. @@ -100,7 +100,7 @@ void stml_save(STML_TABLE* table, FILE* file); * Arguments: * -- 1) FILE* : File pointer to load XML data from. */ -STML_TABLE* stml_load(STML_TABLE* table, FILE* file); +STML_TABLE* stml_load (STML_TABLE* table, FILE* file); /* stml_macro_import * Import a macro definition table into the interpreter. @@ -110,6 +110,6 @@ STML_TABLE* stml_load(STML_TABLE* table, FILE* file); * Arguments: * -- 1) FILE* : File pointer to definition table XML file. */ -int stml_macro_import(FILE* macro_table); +int stml_macro_import (FILE* macro_table); #endif diff --git a/tmp/Table1.xml b/tmp/Table1.xml new file mode 100644 index 0000000..de4e31e --- /dev/null +++ b/tmp/Table1.xml @@ -0,0 +1,15 @@ + + + + + + + 1 + 1 + 0 + + 97 + axe,sword,shield,potion + +
+ diff --git a/tmp/custom.xml b/tmp/custom.xml new file mode 100644 index 0000000..1f2e4e7 --- /dev/null +++ b/tmp/custom.xml @@ -0,0 +1,8 @@ + + + + + TABLE USERS; SET #1.ACCESS.BANNED TRUE; + BAN #1; + + diff --git a/tmp/examples b/tmp/examples new file mode 100644 index 0000000..9b9bb9b --- /dev/null +++ b/tmp/examples @@ -0,0 +1,16 @@ +STML EXAMPLES +#Table "USERS" + +NEW OBJECT @SEISATSU; +NEW STATE TYPE PARENT ID @SEISATSU.ACCESS; +NEW STATE TYPE BOOL ID @SEISATSU.ACCESS.ADMIN VALUE TRUE; +NEW STATE TYPE INT ID @SEISATSU.LEVEL; +ROOT @SEISATSU; #Work inside object "SEISATSU" +NEW STATE TYPE STRING ID ITEMS VALUE "axe,sword,shield,potion"; +ROOT; #Return to top of table + +MODIFY STATE ID @SEISATSU.LEVEL VALUE 97; +QUERY STATE ID @SEISATSU.ACCESS.ADMIN; #Returns "TRUE" +RENAME STATE ID @SEISATSU.ACCESS.ADMIN @SEISATSU.ACCESS.GM; +DELETE STATE ID @SEISATSU.ITEMS; + -- 2.11.4.GIT