naev 0.12.5
news.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include <stdint.h>
7
8#include "ntime.h"
9
10#define NEWS_FOREVER INT64_MAX /* For news that should never get removed. */
11
15typedef struct news_s {
16 int id;
19
20 char *title;
21 char *desc;
22 char *faction;
23 char *tag;
24
25 ntime_t date;
26 ntime_t date_to_rm;
27} news_t;
28
29/*
30 * Create/destroy
31 */
32int news_init( void );
33void news_exit( void );
34
35/*
36 * Display.
37 */
38int *generate_news( int faction );
39void news_widget( unsigned int wid, int x, int y, int w, int h );
40
41/*
42 * News interactions
43 */
44int news_add( const char *title, const char *content, const char *faction,
45 const char *tag, ntime_t date, ntime_t date_to_rm, int priority );
46news_t *news_get( int id );
47void news_rm( int id );
int news_add(const char *title, const char *content, const char *faction, const char *tag, ntime_t date, ntime_t date_to_rm, int priority)
makes a new article and puts it into the list
Definition news.c:94
news_t * news_get(int id)
gets the article with id ID, else NULL
Definition news.c:169
void news_exit(void)
Kills the old news thread.
Definition news.c:139
int * generate_news(int faction)
Generates news from newslist from specific faction AND Generic news.
Definition news.c:202
void news_widget(unsigned int wid, int x, int y, int w, int h)
Creates a news widget.
Definition news.c:273
int news_init(void)
Initiate news linked list with a stack.
Definition news.c:123
Represents a news article.
Definition news.h:15
char * faction
Definition news.h:22
ntime_t date_to_rm
Definition news.h:26
int priority
Definition news.h:17
char * title
Definition news.h:20
int id
Definition news.h:16
ntime_t date
Definition news.h:25
char * tag
Definition news.h:23
char * desc
Definition news.h:21