2021-09-17 05:21:45 +10:00
|
|
|
#ifndef TIMER_H
|
|
|
|
#define TIMER_H
|
|
|
|
|
2021-09-03 13:41:23 +10:00
|
|
|
#include "display.h"
|
2021-09-17 05:21:45 +10:00
|
|
|
#include "keys.h"
|
2021-09-03 13:41:23 +10:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include "cJSON.h"
|
|
|
|
|
|
|
|
#define NS_PER_S 1000000000
|
|
|
|
|
|
|
|
struct segment
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
int realtimeMS;
|
2021-09-17 05:21:45 +10:00
|
|
|
//int gametimeMS;
|
2021-09-03 13:41:23 +10:00
|
|
|
bool isSkipped;
|
2021-09-17 05:21:45 +10:00
|
|
|
bool isReset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pastseg
|
|
|
|
{
|
|
|
|
int realtimeMS;
|
|
|
|
//int gametimeMS;
|
|
|
|
bool isSkipped;
|
|
|
|
bool isReset;
|
2021-09-03 13:41:23 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
void sub_timespec(struct timespec t1, struct timespec t2, struct timespec* td);
|
|
|
|
void add_timespec(struct timespec t1, struct timespec t2, struct timespec* td);
|
|
|
|
void start();
|
|
|
|
void stop();
|
|
|
|
void split();
|
|
|
|
void tpause();
|
2021-09-17 05:21:45 +10:00
|
|
|
void reset();
|
2021-09-03 13:41:23 +10:00
|
|
|
void loadKeymap();
|
2021-09-05 02:50:19 +10:00
|
|
|
void ftime(char *timestr, bool withMS, int ms);
|
2021-09-03 13:41:23 +10:00
|
|
|
int timespecToMS(struct timespec t);
|
|
|
|
void drawSegments();
|
2021-09-05 02:50:19 +10:00
|
|
|
void drawCurrentSegment();
|
2021-09-03 13:41:23 +10:00
|
|
|
void drawDisplay();
|
|
|
|
void resize(int i);
|
2021-09-17 05:21:45 +10:00
|
|
|
void importSplitsIO(cJSON *splitfile);
|
|
|
|
void calculatePB();
|
|
|
|
void loadFile();
|
|
|
|
void saveFile();
|
2021-09-03 13:41:23 +10:00
|
|
|
int main(int argc, char **argv);
|
|
|
|
|
2021-09-17 05:21:45 +10:00
|
|
|
#endif
|
|
|
|
|