add emacs indentation variables to source files in line with current vim settings
[monky] / src / eve.h
1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2  *
3  * Conky, a system monitor, based on torsmo
4  *
5  * Copyright (c) 2008 Asbjørn Zweidorff Kjær
6  * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
7  *      (see AUTHORS)
8  * All rights reserved.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #define _GNU_SOURCE
25 #define MAXCHARS 4
26 #define EVE_UPDATE_DELAY 60
27
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <unistd.h>
31 #include <string.h>
32
33 #include <time.h>
34
35 typedef struct {
36         char *charid;
37         char *skillname;
38         char *time;
39         char *lastOutput;
40
41         struct tm ends;
42         struct tm cache;
43
44         time_t delay;
45
46         int level;
47         int skill;
48 } Character;
49
50 struct xmlData {
51         char *data;
52         size_t size;
53 };
54
55 char *eve(char *, char *, char *);
56 char *getXmlFromAPI(const char *, const char *, const char *, const char *);
57 char *getSkillname(const char *, int);
58 char *formatTime(struct tm *);
59 int parseTrainingXml(char *, Character *);
60 int parseSkilltreeXml(char *, char *);
61 int isCacheValid(struct tm);
62 int file_exists(const char *);
63 void writeSkilltree(char *, const char *);
64 void init_eve(void);