/////////////////////////////////////////////////////////////////////////////// // Date: Sat Oct 27 00:00:26 CDT 2007 // Author: John Quigley // Revision: $Id$ // // The White Programming Language // Copyright (C) 2007 John Quigley // // This program 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 3 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, see . /////////////////////////////////////////////////////////////////////////////// #ifndef __WHITE_CORE_H__ #define __WHITE_CORE_H__ #include "core/util.h" typedef struct Object Object; typedef struct ObjectData ObjectData; typedef enum BooleanValue BooleanValue; typedef struct Boolean Boolean; typedef struct ListNode ListNode; typedef struct List List; /////////////////////////////////////////////////////////////////////////////// // Object struct ObjectData { List *prototypes; }; struct Object { }; ObjectData *ObjectData_new(void); void ObjectData_delete(ObjectData *object); Boolean *Object_hasPrototype( /* TODO: define what Prototype objects look like */ ); /////////////////////////////////////////////////////////////////////////////// // Boolean enum BooleanValue { False = 0, True = 1 }; struct Boolean { BooleanValue value; ObjectData *objectData; }; Boolean *Boolean_new(void); void Boolean_delete(Boolean *obj); void Boolean_setValue(Boolean *self, BooleanValue); /////////////////////////////////////////////////////////////////////////////// // List struct ListNode { void *data; ListNode *next_node; ListNode *prev_node; }; struct List { int length; Boolean *iterating; ListNode *list_head; ListNode *list_tail; ListNode *iter_node; }; List* List_new(); void List_delete(List *list); int List_getLength(List *self); void* List_iterate(List *self); void List_resetIteration(List *self); void* List_getIndex(List *self, int index); void *List_remove(List *self, int index); Boolean *List_append(List *self, void *data); // TODO: these must be implemented void List_clear(List *self); void *List_head(List *self); List *List_tail(List *self); #endif // __WHITE_CORE_H__ // EOF