![]() |
naev 0.10.4
|
Handles a log/journal of the player's playthrough. More...
#include "shiplog.h"Go to the source code of this file.
Data Structures | |
| struct | ShipLogEntry |
| struct | ShipLog |
Functions | |
| static ShipLogEntry * | shiplog_removeEntry (ShipLogEntry *e) |
| removes an entry from the log More... | |
| int | shiplog_create (const char *idstr, const char *logname, const char *type, int overwrite, int maxLen) |
| Creates a new log with given title of given type. More... | |
| int | shiplog_append (const char *idstr, const char *msg) |
| Appends to the log file. More... | |
| int | shiplog_appendByID (int logid, const char *msg) |
| Adds to the log file. More... | |
| void | shiplog_delete (int logid) |
| Deletes a log (e.g. a cancelled mission may wish to do this, or the user might). More... | |
| void | shiplog_setRemove (int logid, ntime_t when) |
| Sets the remove flag for a log - it will be removed once time increases, eg after a player takes off. More... | |
| void | shiplog_deleteType (const char *type) |
| Deletes all logs of given type. More... | |
| void | shiplog_clear (void) |
| Clear the shiplog. More... | |
| void | shiplog_new (void) |
| Set up the shiplog. More... | |
| int | shiplog_save (xmlTextWriterPtr writer) |
| int | shiplog_load (xmlNodePtr parent) |
| Loads the logfiile. More... | |
| void | shiplog_listTypes (int *ntypes, char ***logTypes, int includeAll) |
| void | shiplog_listLogsOfType (const char *type, int *nlogs, char ***logsOut, int **logIDs, int includeAll) |
| Lists matching logs (which haven't expired via "removeAfter") into the provided arrays. More... | |
| int | shiplog_getIdOfLogOfType (const char *type, int selectedLog) |
| void | shiplog_listLog (int logid, const char *type, int *nentries, char ***logentries, int incempty) |
| Get all log entries matching logid, or if logid==LOG_ID_ALL, matching type, or if type==NULL, all. More... | |
| int | shiplog_getID (const char *idstr) |
| Checks to see if the log family exists. More... | |
Variables | |
| static ShipLog | shipLog |
Handles a log/journal of the player's playthrough.
Definition in file shiplog.c.
| int shiplog_append | ( | const char * | idstr, |
| const char * | msg | ||
| ) |
| int shiplog_appendByID | ( | int | logid, |
| const char * | msg | ||
| ) |
| int shiplog_create | ( | const char * | idstr, |
| const char * | logname, | ||
| const char * | type, | ||
| int | overwrite, | ||
| int | maxLen | ||
| ) |
Creates a new log with given title of given type.
| idstr | ID string for this logset, or NULL if an ID string not required. |
| logname | Name of the log (title) |
| type | Type of the log, e.g. travel, shipping, etc |
| overwrite | Whether to overwrite an existing log of this type and logname (if 1), or all logs of this type (if 2). |
| maxLen | Maximum number of entries for this log (longer ones will be purged). |
| void shiplog_delete | ( | int | logid | ) |
| void shiplog_deleteType | ( | const char * | type | ) |
| int shiplog_getID | ( | const char * | idstr | ) |
| int shiplog_getIdOfLogOfType | ( | const char * | type, |
| int | selectedLog | ||
| ) |
| void shiplog_listLog | ( | int | logid, |
| const char * | type, | ||
| int * | nentries, | ||
| char *** | logentries, | ||
| int | incempty | ||
| ) |
| void shiplog_listLogsOfType | ( | const char * | type, |
| int * | nlogs, | ||
| char *** | logsOut, | ||
| int ** | logIDs, | ||
| int | includeAll | ||
| ) |
Lists matching logs (which haven't expired via "removeAfter") into the provided arrays.
| type | The log-type to match (or NULL to match any type). | |
| [out] | nlogs | Number of logs emitted. |
| [out] | logsOut | Matching log-names. Will be reallocated as needed. Emitted strings must be freed. |
| [out] | logIDs | Matching log ID lists. Will be reallocated as needed. Emitted lists are owned by the shipLog. |
| includeAll | Whether to include the special "All" log. |
| void shiplog_listTypes | ( | int * | ntypes, |
| char *** | logTypes, | ||
| int | includeAll | ||
| ) |
| int shiplog_load | ( | xmlNodePtr | parent | ) |
|
static |
| void shiplog_setRemove | ( | int | logid, |
| ntime_t | when | ||
| ) |
Sets the remove flag for a log - it will be removed once time increases, eg after a player takes off.
| logid | the ID of the log |
| when | the time at which to remove. If 0, uses current time, if <0, adds abs to current time, if >0, uses as the time to remove. Rationale: Allows a player to review the log while still landed, and then clears it up once takes off. |