From 94f34439dcebb126473979dd859a4f9dea3c2fce Mon Sep 17 00:00:00 2001 From: synt-xerror <169557594+synt-xerror@users.noreply.github.com> Date: Thu, 19 Feb 2026 02:20:52 -0300 Subject: [PATCH] update readme --- README.md | 69 ++++--------------------------------------------------- 1 file changed, 5 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index f53b9d1..b5bb0a9 100755 --- a/README.md +++ b/README.md @@ -51,12 +51,10 @@ If you're coding a CLI or application, you must provide the key at runtime (env ## API Overview -Just an overview. For more detailed information, see: [[Function-Guide.md]] - ### Info (public) ```c -int neocities_info(const char *sitename, neocities_info_t *out); +int neocities_info(const char *sitename, char **out); ``` Fetch metadata about a site. @@ -66,9 +64,7 @@ Fetch metadata about a site. ### List files ```c -int neocities_list(const char *api_key, - const char *path, - neocities_filelist_t *out); +int neocities_list(const char *api_key, const char *path, char** out); ``` List files at a path. @@ -78,11 +74,7 @@ List files at a path. ### Upload ```c -int neocities_upload(const char *api_key, - const char **local_files, - const char **remote_names, - size_t count, - char **response); +int neocities_upload(const char *api_key, const char **local_files, const char **remote_names, size_t count, char **response); ``` Uploads multiple files. @@ -95,10 +87,7 @@ Uploads multiple files. ### Delete ```c -int neocities_delete(const char *api_key, - const char **filenames, - size_t count, - char **response); +int neocities_delete(const char *api_key, const char **filenames, size_t count, char **response); ``` Deletes files from the site. @@ -111,46 +100,9 @@ For security reasons, you should get the API key via Neocities settings. This fu --- -## Memory Management - -Always free parsed outputs: - -```c -void neocities_free_info(neocities_info_t *info); -void neocities_free_filelist(neocities_filelist_t *list); -``` - -`response` returned by upload/delete must also be freed by caller. - ---- - ## Example Usage -### List files - -```c -neocities_filelist_t list; - -if (neocities_list(api_key, "/", &list) == 0) { - for (size_t i = 0; i < list.count; i++) - printf("%s\n", list.paths[i]); - - neocities_free_filelist(&list); -} -``` - ---- - -### Upload - -```c -const char *local[] = {"index.html"}; -const char *remote[] = {"index.html"}; -char *resp; - -neocities_upload(api_key, local, remote, 1, &resp); -free(resp); -``` +See [[example.c]] --- @@ -176,17 +128,6 @@ Recommended: --- -## Future Extensions (Optional) - -Possible areas to explore: - -* Structured responses for upload/delete -* JSON passthrough mode -* Streaming uploads -* Error codes standardization - ---- - ## License [MIT](LICENSE)