klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

klisp.h (2407B)


      1 /*
      2 ** klisp.h
      3 ** klisp - An interpreter for the Kernel Programming Language.
      4 ** See Copyright Notice at the end of this file
      5 */
      6 
      7 #ifndef klisp_h
      8 #define klisp_h
      9 
     10 #include <stdlib.h>
     11 
     12 /*
     13 ** SOURCE NOTE: This is mostly from Lua.
     14 */
     15 
     16 #define KLISP_VERSION	"klisp 0.3"
     17 #define KLISP_RELEASE	"klisp 0.3"
     18 #define KLISP_VERSION_NUM	3
     19 #define KLISP_COPYRIGHT	"Copyright (C) 2011-2012 Andres Navarro, Oto Havle"
     20 #define KLISP_AUTHORS 	"Andres Navarro, Oto Havle"
     21 
     22 typedef struct klisp_State klisp_State;
     23 
     24 /*
     25 ** prototype for memory-allocation functions
     26 */
     27 typedef void * (*klisp_Alloc) 
     28     (void *ud, void *ptr, size_t osize, size_t nsize);
     29 
     30 /*
     31 ** prototype for underlying c functions of continuations &
     32 ** operatives
     33 */
     34 typedef void (*klisp_CFunction) (struct klisp_State *K);
     35 
     36 /*
     37 ** state manipulation
     38 */
     39 klisp_State *klisp_newstate(klisp_Alloc f, void *ud);
     40 void klisp_close(klisp_State *K);
     41 klisp_State *klisp_newthread(klisp_State *K);
     42 
     43 /******************************************************************************
     44  * Copyright (C) 2011-2012 Andres Navarro, Oto Havle.
     45  * Lua parts: Copyright (C) 1994-2010 Lua.org, PUC-Rio.
     46  * IMath Parts: Copyright (C) 2002-2007 Michael J. Fromberger.
     47  * srfi-78: Copyright (C) 2005-2006 Sebastian Egner.
     48  *
     49  * Permission is hereby granted, free of charge, to any person obtaining
     50  * a copy of this software and associated documentation files (the
     51  * "Software"), to deal in the Software without restriction, including
     52  * without limitation the rights to use, copy, modify, merge, publish,
     53  * distribute, sublicense, and/or sell copies of the Software, and to
     54  * permit persons to whom the Software is furnished to do so, subject to
     55  * the following conditions:
     56  *
     57  * The above copyright notice and this permission notice shall be
     58  * included in all copies or substantial portions of the Software.
     59  *
     60  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     61  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     62  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     63  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     64  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     65  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     66  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     67  ******************************************************************************/
     68 
     69 #endif