Add spreadsheet program

This commit is contained in:
Ole Morud
2022-12-25 16:06:34 +01:00
committed by Ole Morud
commit 2712a1bf3e
24 changed files with 1314 additions and 0 deletions

38
src/cell.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef CELL_H
#define CELL_H
#include <stddef.h>
#include <stdint.h>
#include <time.h>
#include "common.h"
enum cell_type {
Text,
Integer,
Floating,
Date
};
struct cell_list {
struct cell *cell;
struct cell_list *next;
};
struct cell {
struct cell_list *referenced_by;
size_t x_pos;
size_t y_pos;
char *text;
enum cell_type type;
union {
int64_t integer;
double floating;
time_t date;
} value;
};
void cell_init(struct cell *c, size_t x_pos, size_t y_pos, enum cell_type type);
void cell_delete(struct cell *c);
void cell_set_type(struct cell *cell);
#endif