mirror of
https://github.com/UberGames/rpgxEF.git
synced 2024-11-10 07:11:34 +00:00
Multiple changes
- updated documentation - corrected data type for two list_append calls
This commit is contained in:
parent
f2e72ef75f
commit
cc5b7d27ce
3 changed files with 46 additions and 16 deletions
|
@ -7458,7 +7458,7 @@ void addShaderToList(list_p list, char *shader) {
|
|||
}
|
||||
}
|
||||
|
||||
list_append(list, s, LT_DATA, strlen(s)+1);
|
||||
list_append(list, s, LT_STRING, strlen(s)+1);
|
||||
}
|
||||
|
||||
extern target_alert_Shaders_s alertShaders;
|
||||
|
|
|
@ -960,7 +960,7 @@ static void G_LoadTimedMessages(void) {
|
|||
continue;
|
||||
}
|
||||
|
||||
list_append(level.timedMessages, token, LT_DATA, strlen(token)+1);
|
||||
list_append(level.timedMessages, token, LT_STRING, strlen(token)+1);
|
||||
} else {
|
||||
if(token[0] == '}') {
|
||||
break;
|
||||
|
|
|
@ -30,6 +30,10 @@ Can be used as a LIFO stack of FIFO queue. */
|
|||
#define LIST_FRONT 0
|
||||
#define LIST_BACK 1
|
||||
|
||||
/**
|
||||
* Possible type the data in a container may have.
|
||||
* LT_DATA means that a custom struct was added.
|
||||
*/
|
||||
typedef enum {
|
||||
LT_BOOLEAN,
|
||||
LT_CHAR,
|
||||
|
@ -46,38 +50,64 @@ typedef enum {
|
|||
LT_MAX
|
||||
} dataType_t;
|
||||
|
||||
/**
|
||||
* Container for data added to the list.
|
||||
* Use of a container allows to add standard c types to the list
|
||||
* without the need to embed them into a struct.
|
||||
*/
|
||||
struct container {
|
||||
void* data;
|
||||
size_t size;
|
||||
dataType_t type;
|
||||
int pointer;
|
||||
void* data; /*!< pointer to the data */
|
||||
size_t size; /*!< size of the data */
|
||||
dataType_t type; /*!< type of the data */
|
||||
char pointer; /*!< determin if the data is a pointer */
|
||||
} container;
|
||||
|
||||
/**
|
||||
* Type for a pointer to a container.
|
||||
*/
|
||||
typedef struct container* container_p;
|
||||
|
||||
/**
|
||||
* Node for a double linked list.
|
||||
*/
|
||||
struct linked_node {
|
||||
container_p cont;
|
||||
struct linked_node* next;
|
||||
struct linked_node* prev;
|
||||
container_p cont; /*!< cointainer with the data */
|
||||
struct linked_node* next; /*!< next list element */
|
||||
struct linked_node* prev; /*!< previous list element */
|
||||
};
|
||||
|
||||
/**
|
||||
* Type for a pointer to a node.
|
||||
*/
|
||||
typedef struct linked_node* lnode_p;
|
||||
|
||||
/**
|
||||
* Struct describing a list.
|
||||
*/
|
||||
struct list{
|
||||
int length;
|
||||
lnode_p first;
|
||||
lnode_p last;
|
||||
void (*destructor)(void*);
|
||||
int length; /*!< count of elements in the list */
|
||||
lnode_p first; /*!< first element of the list */
|
||||
lnode_p last; /*!< last element of the list */
|
||||
void (*destructor)(void*); /*!< pointer to destructor for data. Default is free. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Type for a pointer to a list.
|
||||
*/
|
||||
typedef struct list * list_p;
|
||||
|
||||
/**
|
||||
* Struct describing a list iterator.
|
||||
*/
|
||||
struct list_iter{
|
||||
list_p list;
|
||||
lnode_p current;
|
||||
char started;
|
||||
list_p list; /*!< the list */
|
||||
lnode_p current; /*!< current node */
|
||||
char started; /*!< has iteration started */
|
||||
};
|
||||
|
||||
/**
|
||||
* Type for a pointer to a list iterator.
|
||||
*/
|
||||
typedef struct list_iter * list_iter_p;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue