Simplified the get_dir function, and now we have directories and files ready :)

This commit is contained in:
synt-xerror
2026-02-14 20:49:52 -03:00
parent 7b829fde21
commit a73b97101f
3 changed files with 57 additions and 50 deletions

27
task.c
View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "toybox.h"
// IDEAS
@@ -7,14 +8,30 @@
// - Sincronização via ADB
// - Organização por prioridade
// - Data limite
// --- Global values - Don't use it, them is just for easy edits ---
// directories (begin with nothing)
char* DATA_DIR = ".local/share/task-cli";
char* CONFIG_DIR = ".config/task-cli";
// files
char* TASK_FILE = "task.txt";
int main()
{
const char* TASK_DIR = get_dir(home(), ".local/share", "task");
char* DEF_DATA_DIR = get_dir(home(), DATA_DIR);
char* DEF_CONFIG_DIR = get_dir(home(), CONFIG_DIR);
printf("[DEBUG]: Tentando imprimir...\n");
printf("%s", TASK_DIR);
char* DEF_TASK_FILE = get_file(DEF_DATA_DIR, TASK_FILE);
printf("DEF_DATA_DIR: %s\n", DEF_DATA_DIR);
printf("DEF_CONFIG_DIR: %s\n", DEF_CONFIG_DIR);
printf("DEF_TASK_FILE: %s\n", DEF_TASK_FILE);
free(TASK_DIR);
free(DEF_DATA_DIR);
free(DEF_CONFIG_DIR);
free(DEF_TASK_FILE);
return 0;
}