naev 0.11.5
shiplog.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
12#include "attributes.h"
13#include "nstring.h"
14#include "ntime.h"
15#include "nxml.h"
16
17#define LOG_ID_INVALID -2
18#define LOG_ID_ALL -1
20/* returns a log ID, for log with specified title. If overwrite set, and
21 title already exists, the log will be cleared and previous log ID
22 returned, otherwise a new log ID will be created. */
23NONNULL( 2, 3 )
24int shiplog_create( const char *idstr, const char *logname, const char *type, int overwrite, int maxLen );
25int shiplog_append( const char *idstr, const char *msg );/* Add a message to the log */
26int shiplog_appendByID( int logid, const char *msg );/* Add a message to the log */
27void shiplog_delete( int logid ); /* Delete a log. Use with care (removes all entries with this ID) */
28void shiplog_setRemove( int logid, ntime_t when ); /* Set a log to be removed once time increases */
29void shiplog_deleteType( const char *type );
30void shiplog_clear (void);
31void shiplog_new (void);
32int shiplog_save( xmlTextWriterPtr writer );
33int shiplog_load( xmlNodePtr parent );
34
35void shiplog_listTypes( int *ntypes, char ***logTypes, int includeAll );
36void shiplog_listLogsOfType( const char *type, int *nlogs, char ***logsOut, int **logIDs, int includeAll );
37int shiplog_getIdOfLogOfType ( const char *type, int selectedLog );
38void shiplog_listLog( int logid, const char *type,int *nentries, char ***logentries,int incempty );
39int shiplog_getID( const char *idstr );