Library is done for test and improvements

This commit is contained in:
synt-xerror
2026-02-16 17:01:21 -03:00
parent 5d071bcbfc
commit 9ba4be8a92
11 changed files with 265 additions and 319 deletions

39
src/neocities.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef NEOCITIES_H
#define NEOCITIES_H
#include <stddef.h>
// -------------------------
// Output structs
// -------------------------
typedef struct {
char *sitename;
int hits;
char *created_at;
char *last_updated;
char *domain;
char **tags;
size_t tag_count;
} neocities_info_t;
typedef struct {
char **paths;
size_t count;
} neocities_filelist_t;
// -------------------------
// API functions
// -------------------------
int neocities_info(const char *sitename, neocities_info_t *out);
int neocities_list(const char *user, const char *pass, const char *path, neocities_filelist_t *out);
int neocities_upload(const char *user, const char *pass, const char **local_files, const char **remote_names, size_t count, char **response);
int neocities_delete(const char *user, const char *pass, const char **filenames, size_t count, char **response);
int neocities_get_api_key(const char *user, const char *pass, char **api_key);
// -------------------------
// Free functions
// -------------------------
void neocities_free_info(neocities_info_t *info);
void neocities_free_filelist(neocities_filelist_t *list);
#endif // NEOCITIES_H