refactor: reorganize files
This commit is contained in:
parent
e39003f4cc
commit
af1dcb2bf2
@ -7,18 +7,24 @@ project(tanabata
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
set(CORE_SRC
|
||||
src/core/sasahyou.c
|
||||
src/core/sappyou.c
|
||||
src/core/shoppyou.c)
|
||||
include/core.h
|
||||
core/sasahyou.c
|
||||
core/sappyou.c
|
||||
core/shoppyou.c)
|
||||
|
||||
set(TANABATA_SRC
|
||||
src/tanabata/database.c
|
||||
src/tanabata/sasa.c
|
||||
src/tanabata/tanzaku.c
|
||||
src/tanabata/kazari.c)
|
||||
${CORE_SRC}
|
||||
include/tanabata.h
|
||||
lib/database.c
|
||||
lib/sasa.c
|
||||
lib/tanzaku.c
|
||||
lib/kazari.c)
|
||||
|
||||
# Tanabata shared main lib
|
||||
add_library(tanabata SHARED ${CORE_SRC} ${TANABATA_SRC})
|
||||
set(CLI_SRC
|
||||
cli/cli.c)
|
||||
|
||||
# Tanabata shared lib
|
||||
add_library(tanabata SHARED ${TANABATA_SRC})
|
||||
|
||||
# Tanabata CLI app
|
||||
add_executable(tfm main.c include/core.h ${CORE_SRC} include/tanabata.h ${TANABATA_SRC} include/cli.h src/cli.c)
|
||||
add_executable(tfm ${TANABATA_SRC} ${CLI_SRC})
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "../include/tanabata.h"
|
||||
#include "../include/cli.h"
|
||||
|
||||
// Stylization macros
|
||||
#define TABLE_HEADER(s) "[7;36m"s"[0m"
|
||||
@ -246,7 +245,7 @@ int menu_rem_kazari() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cli(int argc, char **argv) {
|
||||
int main(int argc, char **argv) {
|
||||
if (argc == 1) {
|
||||
fprintf(stderr, ERROR("No options provided\n"));
|
||||
return 1;
|
||||
@ -2,7 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "../../include/core.h"
|
||||
#include "../include/core.h"
|
||||
|
||||
const Tanzaku HOLE_TANZAKU = {HOLE_ID};
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../../include/core.h"
|
||||
#include "../include/core.h"
|
||||
|
||||
const Sasa HOLE_SASA = {HOLE_ID};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "../../include/core.h"
|
||||
#include "../include/core.h"
|
||||
|
||||
const Kazari HOLE_KAZARI = {HOLE_ID};
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
// Tanabata file manager command line interface lib
|
||||
// By Masahiko AMANO aka H1K0
|
||||
|
||||
#ifndef TANABATA_CLI_H
|
||||
#define TANABATA_CLI_H
|
||||
|
||||
// Command Line Interface
|
||||
int cli(int argc, char **argv);
|
||||
|
||||
#endif //TANABATA_CLI_H
|
||||
@ -2,7 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "../../include/tanabata.h"
|
||||
#include "../include/tanabata.h"
|
||||
|
||||
int tanabata_init(Tanabata *tanabata) {
|
||||
if (sasahyou_init(&tanabata->sasahyou) != 0) {
|
||||
@ -1,6 +1,6 @@
|
||||
#include <malloc.h>
|
||||
|
||||
#include "../../include/tanabata.h"
|
||||
#include "../include/tanabata.h"
|
||||
|
||||
int tanabata_kazari_add(Tanabata *tanabata, uint64_t sasa_id, uint64_t tanzaku_id) {
|
||||
if (sasa_id >= tanabata->sasahyou.size) {
|
||||
@ -1,7 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../include/tanabata.h"
|
||||
#include "../include/tanabata.h"
|
||||
|
||||
int tanabata_sasa_add(Tanabata *tanabata, const char *path) {
|
||||
Sasa *current_sasa = tanabata->sasahyou.database;
|
||||
@ -1,5 +1,6 @@
|
||||
#include <string.h>
|
||||
#include "../../include/tanabata.h"
|
||||
|
||||
#include "../include/tanabata.h"
|
||||
|
||||
int tanabata_tanzaku_add(Tanabata *tanabata, const char *name, const char *description) {
|
||||
Tanzaku *current_tanzaku = tanabata->sappyou.database;
|
||||
Loading…
x
Reference in New Issue
Block a user