-Definition at line 28 of file search.c.
+Definition at line 26 of file search.c.
diff --git a/docs/html/dc/dec/search_8c.js b/docs/html/dc/dec/search_8c.js
index 53124c4..8e1a6bd 100644
--- a/docs/html/dc/dec/search_8c.js
+++ b/docs/html/dc/dec/search_8c.js
@@ -1,8 +1,6 @@
var search_8c =
[
[ "CONTENT_SIZE", "dc/dec/search_8c.html#aff9b7f6d81297248bf0ad06d725c8cbb", null ],
- [ "MAX_BUFFER_SIZE", "dc/dec/search_8c.html#ad4d796b98c583d49e83adabd74a63bf6", null ],
- [ "MAX_FILE_PATH", "dc/dec/search_8c.html#a263efd24d550124313df51247f07457a", null ],
[ "search", "dc/dec/search_8c.html#ab899bd069f8d6db7339eba31c3ad7a02", null ],
[ "controls", "dc/dec/search_8c.html#af0d0e693c574c3bfb0fcdcca37cbd745", null ],
[ "controls_window", "dc/dec/search_8c.html#ac105778d4687c921d3749c0e825d529d", null ],
diff --git a/docs/html/dc/dec/search_8c_source.html b/docs/html/dc/dec/search_8c_source.html
index 02dce75..2fb11a5 100644
--- a/docs/html/dc/dec/search_8c_source.html
+++ b/docs/html/dc/dec/search_8c_source.html
@@ -115,190 +115,135 @@
- 15#define MAX_FILE_PATH 256
- 16#define MAX_BUFFER_SIZE 512
- 17#define CONTENT_SIZE 524288
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 37static int posts_panel_height;
-
-
-
-
-
-
-
-
+ 15#define CONTENT_SIZE 524288
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 32static int posts_panel_height;
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 51 char *home_path = getenv(
"HOME");
+
+
-
-
+
+ 54 FILE *posts_json_file = fopen(
"posts.json",
"r");
- 56 if (home_path == NULL)
+ 56 if (posts_json_file == NULL)
-
-
+
+
- 62 sprintf(config_path,
"%s/.yiffy/yiffy-config.txt", home_path);
+
-
- 65 FILE *config = fopen(config_path,
"r");
+
+ 65 fclose(posts_json_file);
-
-
-
-
-
-
-
- 74 buffer[config_bytes] =
'\0';
+
+ 68 cJSON *json = cJSON_Parse(json_string);
+
+
+
+
+
+
-
-
-
- 79 char *token = strtok(
buffer,
":");
-
-
-
- 83 if (strcmp(token,
"nsfw") == 0)
-
-
-
-
-
- 89 token = strtok(NULL,
":");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 105 FILE *posts_json_file = fopen(
"posts.json",
"r");
-
- 107 if (posts_json_file == NULL)
-
-
-
-
-
-
-
-
- 116 fclose(posts_json_file);
+
+ 77 cJSON *posts = cJSON_GetObjectItem(json,
"posts");
+
+ 79 if (!cJSON_IsArray(posts))
+
+
+
+
+
+
+
+
+
+ 89 for (
size_t i = 0; i < cJSON_GetArraySize(posts); i++)
+
+
+ 92 cJSON *post = cJSON_GetArrayItem(posts, i);
+
+
+
+
+
+
+
+
+ 101 cJSON *file_object = cJSON_GetObjectItem(post,
"file");
+
+ 103 if (file_object == NULL)
+
+ 105 fprintf(stderr,
"File object not found in post %d\n", i);
+
+
+
+
+ 110 cJSON *url = cJSON_GetObjectItem(file_object,
"url");
+
+ 112 if (url != NULL && cJSON_IsString(url) && post_i != posts_panel_height - 2)
+
+
+
+
-
- 119 cJSON *json = cJSON_Parse(json_string);
-
-
-
-
-
-
-
-
- 128 cJSON *posts = cJSON_GetObjectItem(json,
"posts");
-
- 130 if (!cJSON_IsArray(posts))
-
-
-
-
-
-
-
-
-
- 140 for (
size_t i = 0; i < cJSON_GetArraySize(posts); i++)
-
-
- 143 cJSON *post = cJSON_GetArrayItem(posts, i);
-
-
-
-
-
-
-
-
- 152 cJSON *file_object = cJSON_GetObjectItem(post,
"file");
-
- 154 if (file_object == NULL)
-
- 156 fprintf(stderr,
"File object not found in post %d\n", i);
-
-
-
-
- 161 cJSON *url = cJSON_GetObjectItem(file_object,
"url");
-
- 163 if (url != NULL && cJSON_IsString(url) && post_i != posts_panel_height - 2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
-
void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls)
Creates a new window to display the controls and adds it to the specified position.
void create_post_tags_window(WINDOW *window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
void create_posts_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display posts and adds it to the specified position.
-void create_top_window(WINDOW *window, bool is_nsfw)
Creates a new top window to display the title and SFW/NSFW status.
-void file_open_error_msg()
Shows some information about file permissions when yiffy is not able to read file.
+void create_top_window(WINDOW *window)
Creates a new top window to display the title and SFW/NSFW status.
void init_ncurses()
Initializes the ncurses library and sets up the terminal UI.
void json_parse_error_msg()
Outputs the error message when application can not parse the JSON content.
-void no_home_error_msg()
Outputs the home not found error when application can not access the $HOME environment variable.
void no_json_error_msg()
Outputs the error when there is no JSON file.
void post_error_msg()
Outputs the error when the parsing is faced with an error in the post section.
void posts_not_array_error_msg()
Outputs the error when the parsing is faced with an error in the posts section.
-WINDOW * post_tags_window
-#define MAX_FILE_PATH
This macro is used to set the default size for getting the home directory file.
-
-
-void search(char *tags)
Creates a ncurses-based user interface to show, download, search and travel the e621/e926 by using cu...
-
-#define MAX_BUFFER_SIZE
This macro is used to set the default size for reading the config file.
-
-#define CONTENT_SIZE
This macro is used to set the default size for reading the JSON file that comes as a response from th...
+WINDOW * post_tags_window
+
+
+void search(char *tags)
Creates a ncurses-based user interface to show, download, search and travel the e621/e926 by using cu...
+
+
+#define CONTENT_SIZE
This macro is used to set the default size for reading the JSON file that comes as a response from th...
Stores the control name and key for displaying in the controls panel.
void write_post(WINDOW *window, size_t post_i, cJSON *url)
Writes posts to the posts window.
diff --git a/docs/html/dd/d93/create__top__window_8c.html b/docs/html/dd/d93/create__top__window_8c.html
index 3f18b50..c20d87f 100644
--- a/docs/html/dd/d93/create__top__window_8c.html
+++ b/docs/html/dd/d93/create__top__window_8c.html
@@ -108,6 +108,7 @@
@@ -141,11 +142,20 @@
Go to the source code of this file.
This file is used to create a new top window to display the title and SFW/NSFW status.
@@ -153,29 +163,56 @@
- Date
- 23/05/2024
Definition in file create_top_window.c.
-
-
-
-
-
18 window = newwin(3, COLS, 0, 0);
-
+
+
14#define BUFFER_SIZE 512
+
+
16static char *home_directory;
+
+
+
-
-
-
-
24 wattron(window, A_STANDOUT);
-
-
-
27 mvwprintw(window, 1, 1,
" NSFW [E621.NET] - ASCII-IMAGE-CONVERTER ");
-
-
-
-
31 mvwprintw(window, 1, 1,
" SFW [E926.NET] - ASCII-IMAGE-CONVERTER ");
-
-
33 wattroff(window, A_STANDOUT);
-
-
-
-
-
void create_top_window(WINDOW *window, bool is_nsfw)
Creates a new top window to display the title and SFW/NSFW status.
+
+
+
+
+
+
+
30 home_directory = getenv(
"HOME");
+
+
32 if (home_directory == NULL)
+
+
+
+
+
+
+
39 sprintf(file_path,
"%s/.yiffy/yiffy-config.txt", home_directory);
+
+
41 FILE *config_file = fopen(file_path,
"r");
+
+
43 if (config_file == NULL)
+
+
+
+
+
+
+
+
51 if (strcmp(
buffer,
"IS_NSFW=YES\n") == 0)
+
+
+
+
+
+
+
+
+
+
61 window = newwin(3, COLS, 0, 0);
+
+
+
+
+
+
67 wattron(window, A_STANDOUT);
+
+
+
70 mvwprintw(window, 1, 1,
" NSFW [E621.NET] - ASCII-IMAGE-CONVERTER ");
+
+
+
+
74 mvwprintw(window, 1, 1,
" SFW [E926.NET] - ASCII-IMAGE-CONVERTER ");
+
+
76 wattroff(window, A_STANDOUT);
+
+
+
+
+
+
void create_top_window(WINDOW *window)
Creates a new top window to display the title and SFW/NSFW status.
+
#define BUFFER_SIZE
This macro is used to set the default size for reading the config file.
+
#define FILE_PATH
This macro is used to set the default size for getting the home directory file.
+
void file_open_error_msg()
Shows some information about file permissions when yiffy is not able to read file.
+
void no_home_error_msg()
Outputs the home not found error when application can not access the $HOME environment variable.
void set_window_title(WINDOW *window, const char *title)
Writes a title to the top-left corner of the specified window.
This header file is used to handle the fetching and searching system.
diff --git a/docs/html/de/d29/yiffy__search_8h.html b/docs/html/de/d29/yiffy__search_8h.html
index bb4846e..179609b 100644
--- a/docs/html/de/d29/yiffy__search_8h.html
+++ b/docs/html/de/d29/yiffy__search_8h.html
@@ -176,9 +176,9 @@