diff --git a/docs/html/d0/de2/yiffy__messages_8h.html b/docs/html/d0/de2/yiffy__messages_8h.html index c246eabe..89d232e4 100644 --- a/docs/html/d0/de2/yiffy__messages_8h.html +++ b/docs/html/d0/de2/yiffy__messages_8h.html @@ -132,13 +132,13 @@
- + - + @@ -155,9 +155,10 @@ - - - + + + + @@ -230,7 +231,7 @@  Shows some information when cjson root gives error. More...
  void access_error_msg () - Checks the accessibility to the e621/e926 api. More...
+ Gives message about the accessibility to the e621/e926 api. More...
  void color_comp_error_msg ()  Shows some information about the color compatibility of a terminal. More...
@@ -244,6 +245,9 @@ void post_error_msg ()  Outputs the error when the parsing is faced with an error in the post section. More...
  +void set_credentials_error_msg () + Gives message if the credentials are not set in the credentials file. More...

Detailed Description

+
+ +

◆ set_credentials_error_msg()

+ +
+
+ + + + + + + +
void set_credentials_error_msg ()
+
+ +

Gives message if the credentials are not set in the credentials file.

+ +

Definition at line 16 of file set_credentials_error_msg.c.

+
diff --git a/docs/html/d0/de2/yiffy__messages_8h.js b/docs/html/d0/de2/yiffy__messages_8h.js index d68612fd..ba6d46dd 100644 --- a/docs/html/d0/de2/yiffy__messages_8h.js +++ b/docs/html/d0/de2/yiffy__messages_8h.js @@ -17,6 +17,7 @@ var yiffy__messages_8h = [ "on_off_msg", "d0/de2/yiffy__messages_8h.html#a60eb77988fcf4ce24e3108507945e543", null ], [ "post_error_msg", "d0/de2/yiffy__messages_8h.html#accdcb97e0bdaf97ee30a5d59dc176de6", null ], [ "posts_not_array_error_msg", "d0/de2/yiffy__messages_8h.html#a90abb5c30aae8756dfcd7b5bce9af349", null ], + [ "set_credentials_error_msg", "d0/de2/yiffy__messages_8h.html#aa9576ed018648983c9c2745abf7dde31", null ], [ "system_func_error_msg", "d0/de2/yiffy__messages_8h.html#acc21d14c9f9a59987f07615415759325", null ], [ "unrecognized_arg_msg", "d0/de2/yiffy__messages_8h.html#ae1e70d303bd9115115ecb22cb13459c5", null ], [ "window_create_error_msg", "d0/de2/yiffy__messages_8h.html#aa2139f028bdd1f14dcd7c65eabf8a14f", null ] diff --git a/docs/html/d0/de2/yiffy__messages_8h_source.html b/docs/html/d0/de2/yiffy__messages_8h_source.html index af435ccb..6189cbb8 100644 --- a/docs/html/d0/de2/yiffy__messages_8h_source.html +++ b/docs/html/d0/de2/yiffy__messages_8h_source.html @@ -137,21 +137,23 @@
34void window_create_error_msg();
35void posts_not_array_error_msg();
36void post_error_msg();
-
37
-
38#endif /* YIFFY_MESSAGES_H */
+
37void set_credentials_error_msg();
+
38
+
39#endif /* YIFFY_MESSAGES_H */
argc_error_msg
void argc_error_msg(int argc)
Evaluates the argument count and gives information if not in the requested format.
Definition: argc_error_msg.c:18
json_parse_error_msg
void json_parse_error_msg()
Outputs the error message when application can not parse the JSON content.
Definition: json_parse_error_msg.c:16
no_arg_value_msg
void no_arg_value_msg(char *argument)
Outputs the correct prompt format when there is no argument value.
Definition: no_arg_value_msg.c:18
already_conf_msg
void already_conf_msg(char *option, char *argv)
Shows some information when cjson root gives error.
Definition: already_conf_msg.c:19
no_results_error_msg
void no_results_error_msg()
Outputs the error when there is no response from the API.
Definition: no_results_error_msg.c:16
conf_successful_msg
void conf_successful_msg(char *option, char *argv)
Shows some information when cjson root gives error.
Definition: conf_successful_msg.c:19
-
access_error_msg
void access_error_msg()
Checks the accessibility to the e621/e926 api.
Definition: access_error_msg.c:16
+
access_error_msg
void access_error_msg()
Gives message about the accessibility to the e621/e926 api.
Definition: access_error_msg.c:16
on_off_msg
void on_off_msg(char *argument)
Outputs the correct argument value (on/off) for specified options.
Definition: on_off_msg.c:18
no_json_error_msg
void no_json_error_msg()
Outputs the error when there is no JSON file.
Definition: no_json_error_msg.c:16
file_open_error_msg
void file_open_error_msg()
Shows some information about file permissions when yiffy is not able to read file.
Definition: file_open_error_msg.c:16
malloc_error_msg
void malloc_error_msg()
Shows some information when yiffy cannot allocate memory.
Definition: malloc_error_msg.c:16
posts_not_array_error_msg
void posts_not_array_error_msg()
Outputs the error when the parsing is faced with an error in the posts section.
Definition: posts_not_array_error_msg.c:16
window_create_error_msg
void window_create_error_msg()
Gives information about the window creation error.
Definition: window_create_error_msg.c:16
+
set_credentials_error_msg
void set_credentials_error_msg()
Gives message if the credentials are not set in the credentials file.
Definition: set_credentials_error_msg.c:16
no_home_error_msg
void no_home_error_msg()
Outputs the home not found error when application can not access the $HOME environment variable.
Definition: no_home_error_msg.c:16
extra_arg_error_msg
void extra_arg_error_msg(char *argument)
Outputs the correct format for the prompted option when there is additional invalid argument.
Definition: extra_arg_error_msg.c:18
system_func_error_msg
void system_func_error_msg()
Shows some information when system function not works.
Definition: system_func_error_msg.c:16
diff --git a/docs/html/d1/d14/fetch_8c.html b/docs/html/d1/d14/fetch_8c.html index 7927b91e..753e7512 100644 --- a/docs/html/d1/d14/fetch_8c.html +++ b/docs/html/d1/d14/fetch_8c.html @@ -142,12 +142,6 @@ - - - - - - @@ -180,42 +174,6 @@

Definition at line 17 of file fetch.c.

- - - - -

◆ MAX_BUFFER_SIZE

- -
-
-

Macros

#define MAX_FILE_PATH   256
 This macro is used to set the default size for getting the home directory file. More...
 
#define MAX_BUFFER_SIZE   512
 This macro is used to set the default size for reading the config file. More...
 
#define CONTENT_SIZE   262144
 This macro is used to set the default size for reading the JSON file that comes as a response from the API. More...
 
- - - -
#define MAX_BUFFER_SIZE   512
-
- -

This macro is used to set the default size for reading the config file.

- -

Definition at line 16 of file fetch.c.

- -
- - -

◆ MAX_FILE_PATH

- -
-
- - - - -
#define MAX_FILE_PATH   256
-
- -

This macro is used to set the default size for getting the home directory file.

-

Definition at line 15 of file fetch.c.

@@ -263,7 +221,7 @@

Definition at line 32 of file fetch.c.

+

Definition at line 30 of file fetch.c.

diff --git a/docs/html/d1/d14/fetch_8c.js b/docs/html/d1/d14/fetch_8c.js index a17090b4..02b0f5f4 100644 --- a/docs/html/d1/d14/fetch_8c.js +++ b/docs/html/d1/d14/fetch_8c.js @@ -1,7 +1,5 @@ var fetch_8c = [ [ "CONTENT_SIZE", "d1/d14/fetch_8c.html#aff9b7f6d81297248bf0ad06d725c8cbb", null ], - [ "MAX_BUFFER_SIZE", "d1/d14/fetch_8c.html#ad4d796b98c583d49e83adabd74a63bf6", null ], - [ "MAX_FILE_PATH", "d1/d14/fetch_8c.html#a263efd24d550124313df51247f07457a", null ], [ "fetch", "d1/d14/fetch_8c.html#a41f382b6bd05c9776641fb4bc5024afa", null ] ]; \ No newline at end of file diff --git a/docs/html/d1/d14/fetch_8c_source.html b/docs/html/d1/d14/fetch_8c_source.html index 720810c7..fe2f7e95 100644 --- a/docs/html/d1/d14/fetch_8c_source.html +++ b/docs/html/d1/d14/fetch_8c_source.html @@ -111,193 +111,144 @@
Go to the documentation of this file.
1
-
15#define MAX_FILE_PATH 256
-
16#define MAX_BUFFER_SIZE 512
-
17#define CONTENT_SIZE 262144
+
15#define CONTENT_SIZE 262144
+
16
+
17#include "yiffy_fetch.h"
18
-
19#include "yiffy_fetch.h"
+
19static void output(char *json_content, char *command);
20
-
21static void output(char *json_content, char *command);
+
21static int total_downloads = 0;
22
-
23static int total_downloads = 0;
-
24
-
32void fetch(char *tags, int page, char *command)
-
33{
-
34 char config_path[MAX_FILE_PATH];
- -
36
-
37 bool is_nsfw = false;
-
38
-
39 char *home = getenv("HOME");
-
40
-
41 if (home == NULL)
-
42 {
- -
44 exit(EXIT_FAILURE);
-
45 }
+
30void fetch(char *tags, int page, char *command)
+
31{
+
32 /* Download the JSON response. */
+
33 aria2_download(tags, page, 20);
+
34
+
35 /* Check if the JSON response downloaded. */
+
36 FILE *response_json = fopen("posts.json", "r");
+
37
+
38 if (response_json == NULL)
+
39 {
+ +
41 exit(EXIT_FAILURE);
+
42 }
+
43
+
44 /* Allocate memory to store the JSON response content. */
+
45 char *posts_json = (char*)malloc(CONTENT_SIZE * sizeof(char));
46
-
47 sprintf(config_path, "%s/.yiffy/yiffy-config.txt", home);
-
48
-
49 /* Read the configuration file (home/user/.yiffy/yiffy-config.txt) to execute the wanted process. */
-
50 FILE *config = fopen(config_path, "r");
-
51
-
52 if (config == NULL)
-
53 {
- -
55 exit(EXIT_FAILURE);
-
56 }
+
47 if (posts_json == NULL)
+
48 {
+ +
50 exit(EXIT_FAILURE);
+
51 }
+
52
+
53 size_t bytes_read = fread(posts_json, 1, CONTENT_SIZE - 1, response_json);
+
54 posts_json[bytes_read] = '\0';
+
55
+
56 fclose(response_json);
57
-
58 size_t config_bytes = fread(buffer, 1, MAX_BUFFER_SIZE - 1, config);
-
59 buffer[config_bytes] = '\0';
-
60
-
61 fclose(config);
-
62
-
63 char *token = strtok(buffer, ":");
-
64
-
65 while (token != NULL)
-
66 {
-
67 if (strcmp(token, "nsfw") == 0)
-
68 {
-
69 is_nsfw = true;
-
70 break;
-
71 }
+
58 /* Check if the JSON response is empty. */
+
59 if (strcmp(posts_json, "{\"posts\":[]}") == 0)
+
60 {
+
61 if (total_downloads == 0)
+
62 {
+ +
64 }
+
65
+
66 free(posts_json);
+
67
+
68 remove("posts.json");
+
69
+
70 exit(EXIT_FAILURE);
+
71 }
72
-
73 token = strtok(NULL, ":");
-
74 }
-
75
-
76 /* Download the JSON response. */
-
77 aria2_download(tags, page, is_nsfw, 20);
-
78
-
79 /* Check if the JSON response downloaded. */
-
80 FILE *response_json = fopen("posts.json", "r");
-
81
-
82 if (response_json == NULL)
-
83 {
- -
85 exit(EXIT_FAILURE);
-
86 }
+
73 /* Output the URLs by using the current JSON file. */
+
74 output(posts_json, command);
+
75}
+
76
+
83static void output(char *json_content, char *command)
+
84{
+
85 /* Parse the JSON response data. */
+
86 cJSON *root = cJSON_Parse(json_content);
87
-
88 /* Allocate memory to store the JSON response content. */
-
89 char *json_control_content = (char*)malloc(CONTENT_SIZE * sizeof(char));
-
90
-
91 if (json_control_content == NULL)
-
92 {
- -
94 exit(EXIT_FAILURE);
-
95 }
-
96
-
97 size_t bytes_read = fread(json_control_content, 1, CONTENT_SIZE - 1, response_json);
-
98 json_control_content[bytes_read] = '\0';
-
99
-
100 fclose(response_json);
-
101
-
102 /* Check if the JSON response is empty. */
-
103 if (strcmp(json_control_content, "{\"posts\":[]}") == 0)
-
104 {
-
105 if (total_downloads == 0)
-
106 {
- -
108 }
-
109
-
110 free(json_control_content);
-
111
-
112 remove("posts.json");
-
113
-
114 exit(EXIT_FAILURE);
-
115 }
-
116
-
117 /* Output the URLs by using the current JSON file. */
-
118 output(json_control_content, command);
-
119}
+
88 free(json_content);
+
89
+
90 if (root == NULL)
+
91 {
+
92 const char *error_ptr = cJSON_GetErrorPtr();
+
93
+
94 if (error_ptr != NULL)
+
95 {
+
96 cjson_error_msg(error_ptr);
+
97 }
+
98
+ +
100 cJSON_Delete(root);
+
101 exit(EXIT_FAILURE);
+
102 }
+
103
+
104 /* Navigate to the posts array. */
+
105 cJSON *posts_array = cJSON_GetObjectItemCaseSensitive(root, "posts");
+
106
+
107 if (cJSON_IsArray(posts_array))
+
108 {
+
109 int total_posts = cJSON_GetArraySize(posts_array);
+
110
+
111 // Iterate through the posts array.
+
112 for (size_t i = 0; i < total_posts; i++)
+
113 {
+
114 cJSON *post = cJSON_GetArrayItem(posts_array, i);
+
115 cJSON *file = cJSON_GetObjectItemCaseSensitive(post, "file") ;
+
116
+
117 if (cJSON_IsObject(file))
+
118 {
+
119 cJSON *file_url_obj = cJSON_GetObjectItemCaseSensitive(file, "url");
120
-
127static void output(char *json_content, char *command)
-
128{
-
129 /* Parse the JSON response data. */
-
130 cJSON *root = cJSON_Parse(json_content);
-
131
-
132 free(json_content);
+
121 /* Check if the url field exists and is a string. */
+
122 if (cJSON_IsString(file_url_obj))
+
123 {
+
124 const char *file_url = file_url_obj->valuestring;
+
125
+
126 fprintf(stdout, "%s\n", file_url);
+
127
+
128 /* If the command is --dfetch download the fetched URLs. */
+
129 if (strcmp(command, "--dfetch") == 0)
+
130 {
+
131 /* Alloc for downloading process. */
+
132 char *download_command = (char*)malloc(256 * sizeof(char));
133
-
134 if (root == NULL)
-
135 {
-
136 const char *error_ptr = cJSON_GetErrorPtr();
-
137
-
138 if (error_ptr != NULL)
-
139 {
-
140 cjson_error_msg(error_ptr);
-
141 }
-
142
- -
144 cJSON_Delete(root);
-
145 exit(EXIT_FAILURE);
-
146 }
-
147
-
148 /* Navigate to the posts array. */
-
149 cJSON *posts_array = cJSON_GetObjectItemCaseSensitive(root, "posts");
-
150
-
151 if (cJSON_IsArray(posts_array))
-
152 {
-
153 int total_posts = cJSON_GetArraySize(posts_array);
-
154
-
155 // Iterate through the posts array.
-
156 for (size_t i = 0; i < total_posts; i++)
-
157 {
-
158 cJSON *post = cJSON_GetArrayItem(posts_array, i);
-
159 cJSON *file = cJSON_GetObjectItemCaseSensitive(post, "file") ;
-
160
-
161 if (cJSON_IsObject(file))
-
162 {
-
163 cJSON *file_url_obj = cJSON_GetObjectItemCaseSensitive(file, "url");
-
164
-
165 /* Check if the url field exists and is a string. */
-
166 if (cJSON_IsString(file_url_obj))
-
167 {
-
168 const char *file_url = file_url_obj->valuestring;
-
169
-
170 fprintf(stdout, "%s\n", file_url);
-
171
-
172 /* If the command is --dfetch download the fetched URLs. */
-
173 if (strcmp(command, "--dfetch") == 0)
-
174 {
-
175 /* Alloc for downloading process. */
-
176 char *download_command = (char*)malloc(256 * sizeof(char));
-
177
-
178 sprintf(download_command, "aria2c %s >/dev/null 2>&1", file_url);
-
179
-
180 int download_success = system(download_command);
-
181
-
182 if (download_success == BAD_SYSTEM_FUNC_CALL)
-
183 {
-
184 free(download_command);
-
185 exit(EXIT_FAILURE);
-
186 }
-
187
-
188 free(download_command);
-
189 }
-
190
-
191 /* Increase the total downloads, this is used to control if any posts downloaded. */
-
192 total_downloads++;
-
193 }
-
194 }
-
195 }
-
196 }
-
197
-
198 /* Clean up cJSON object. */
-
199 cJSON_Delete(root);
-
200
-
201 /* Delete posts.json file. */
-
202 remove("posts.json");
-
203}
-
void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
downloads the API response by using aria2c, works with a system call
-
char * buffer
Definition: cjson.h:170
+
134 sprintf(download_command, "aria2c %s >/dev/null 2>&1", file_url);
+
135
+
136 int download_success = system(download_command);
+
137
+
138 if (download_success == BAD_SYSTEM_FUNC_CALL)
+
139 {
+
140 free(download_command);
+
141 exit(EXIT_FAILURE);
+
142 }
+
143
+
144 free(download_command);
+
145 }
+
146
+
147 /* Increase the total downloads, this is used to control if any posts downloaded. */
+
148 total_downloads++;
+
149 }
+
150 }
+
151 }
+
152 }
+
153
+
154 /* Clean up cJSON object. */
+
155 cJSON_Delete(root);
+
156
+
157 /* Delete posts.json file. */
+
158 remove("posts.json");
+
159}
+
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
void cjson_error_msg(const char *ptr_error)
Shows some information when cjson root gives error.
-
#define MAX_FILE_PATH
This macro is used to set the default size for getting the home directory file.
Definition: fetch.c:15
-
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:32
-
#define MAX_BUFFER_SIZE
This macro is used to set the default size for reading the config file.
Definition: fetch.c:16
-
#define CONTENT_SIZE
This macro is used to set the default size for reading the JSON file that comes as a response from th...
Definition: fetch.c:17
-
void file_open_error_msg()
Shows some information about file permissions when yiffy is not able to read file.
+
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:30
+
#define CONTENT_SIZE
This macro is used to set the default size for reading the JSON file that comes as a response from th...
Definition: fetch.c:15
void json_parse_error_msg()
Outputs the error message when application can not parse the JSON content.
void malloc_error_msg()
Shows some information when yiffy cannot allocate memory.
-
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 no_results_error_msg()
Outputs the error when there is no response from the API.
Definition: cjson.h:111
diff --git a/docs/html/d3/d70/set__credentials__error__msg_8c__incl.map b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.map new file mode 100644 index 00000000..de849d58 --- /dev/null +++ b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/html/d3/d70/set__credentials__error__msg_8c__incl.md5 b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.md5 new file mode 100644 index 00000000..152d2574 --- /dev/null +++ b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.md5 @@ -0,0 +1 @@ +15e44d65b382b92f0e091df2f113b2bb \ No newline at end of file diff --git a/docs/html/d3/d70/set__credentials__error__msg_8c__incl.png b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.png new file mode 100644 index 00000000..ed5e8f1d Binary files /dev/null and b/docs/html/d3/d70/set__credentials__error__msg_8c__incl.png differ diff --git a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.map b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.map index 23fae116..611b9ba0 100644 --- a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.map +++ b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.map @@ -1,11 +1,11 @@ - + - + @@ -22,9 +22,10 @@ - - - + + + + diff --git a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.md5 b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.md5 index 5c43d150..ec4108ef 100644 --- a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.md5 +++ b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.md5 @@ -1 +1 @@ -14fedfc08a8b26aacec7db65f97da576 \ No newline at end of file +980dd0cf6c5d9928bcbab8f17d4e37d5 \ No newline at end of file diff --git a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.png b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.png index 2ce2d9ae..c4193eb1 100644 Binary files a/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.png and b/docs/html/d4/dd5/yiffy__messages_8h__dep__incl.png differ diff --git a/docs/html/d5/d05/yiffy__fetch_8h.html b/docs/html/d5/d05/yiffy__fetch_8h.html index 27ce8806..26f9cc7c 100644 --- a/docs/html/d5/d05/yiffy__fetch_8h.html +++ b/docs/html/d5/d05/yiffy__fetch_8h.html @@ -174,8 +174,9 @@ void fetch (char *tags, int page, char *command)  Reads the configuration file, sets the options and sends a request to e621-e926. After taking the response, it calls the output function to show the URLs. More...
  -void aria2_download (char *tags, int page, bool is_nsfw, int lim) -  +void aria2_download (char *tags, int page, int lim) + downloads the API response by using aria2c, works with a system call More...

Macro Definition Documentation

@@ -195,8 +196,8 @@

Function Documentation

- -

◆ aria2_download()

+ +

◆ aria2_download()

@@ -277,7 +284,7 @@

Definition at line 32 of file fetch.c.

+

Definition at line 30 of file fetch.c.

diff --git a/docs/html/d5/d05/yiffy__fetch_8h.js b/docs/html/d5/d05/yiffy__fetch_8h.js index f08071b7..57eaa579 100644 --- a/docs/html/d5/d05/yiffy__fetch_8h.js +++ b/docs/html/d5/d05/yiffy__fetch_8h.js @@ -1,6 +1,6 @@ var yiffy__fetch_8h = [ [ "BAD_SYSTEM_FUNC_CALL", "d5/d05/yiffy__fetch_8h.html#acbd50aa1f19ce68034a26b45b0aaed69", null ], - [ "aria2_download", "d5/d05/yiffy__fetch_8h.html#a5d6732ce337f794d14f9f2b835a0d2ef", null ], + [ "aria2_download", "d5/d05/yiffy__fetch_8h.html#a7b3f8210580125356d3487d53f345cbf", null ], [ "fetch", "d5/d05/yiffy__fetch_8h.html#a41f382b6bd05c9776641fb4bc5024afa", null ] ]; \ No newline at end of file diff --git a/docs/html/d5/d05/yiffy__fetch_8h_source.html b/docs/html/d5/d05/yiffy__fetch_8h_source.html index c43883dd..db6354c4 100644 --- a/docs/html/d5/d05/yiffy__fetch_8h_source.html +++ b/docs/html/d5/d05/yiffy__fetch_8h_source.html @@ -128,11 +128,11 @@
25#define BAD_SYSTEM_FUNC_CALL -1
26
27void fetch(char *tags, int page, char *command);
-
28void aria2_download(char *tags, int page, bool is_nsfw, int lim);
+
28void aria2_download(char *tags, int page, int lim);
29
30#endif /* YIFFY_SEARCH_H */
-
fetch
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:32
-
aria2_download
void aria2_download(char *tags, int page, bool is_nsfw, int lim)
+
fetch
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:30
+
aria2_download
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
Definition: aria2_download.c:36
diff --git a/docs/html/d6/d60/aria2__download_8c.html b/docs/html/d6/d60/aria2__download_8c.html index e55cecfe..df21f8d9 100644 --- a/docs/html/d6/d60/aria2__download_8c.html +++ b/docs/html/d6/d60/aria2__download_8c.html @@ -108,6 +108,7 @@
+Macros | Functions
aria2_download.c File Reference
@@ -139,11 +140,25 @@

Go to the source code of this file.

+ + + + + + + + + + + + +

+Macros

#define FILE_PATH   256
 This macro is used to set the default size for getting the home directory file. More...
 
#define BUFFER_SIZE   512
 This macro is used to set the default size for reading the config file. More...
 
#define HOME_SIZE   512
 This macro is used to set the default size for home string. More...
 
#define CREDENTIAL_SIZE   128
 
- - - + + +

Functions

void aria2_download (char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
 downloads the API response by using aria2c, works with a system call More...
 
void aria2_download (char *tags, int page, int lim)
 downloads the API response by using aria2c, works with a system call More...
 

Detailed Description

Downloads the JSON file by using aria2c, works with the system function.

@@ -152,36 +167,89 @@
Date
28/08/2023

Definition in file aria2_download.c.

-

Function Documentation

- -

◆ aria2_download()

+

Macro Definition Documentation

+ +

◆ BUFFER_SIZE

- - - - + +
void aria2_download (char * tags, #define BUFFER_SIZE   512
+
+ +

This macro is used to set the default size for reading the config file.

+ +

Definition at line 16 of file aria2_download.c.

+ +
+
+ +

◆ CREDENTIAL_SIZE

+ +
+
+ - - - - + +
bool is_nsfw, #define CREDENTIAL_SIZE   128
+
+ +

Definition at line 18 of file aria2_download.c.

+ +
+
+ +

◆ FILE_PATH

+ +
+
+ - - - - + +
char * uname, #define FILE_PATH   256
+
+ +

This macro is used to set the default size for getting the home directory file.

+ +

Definition at line 15 of file aria2_download.c.

+ +
+
+ +

◆ HOME_SIZE

+ +
+
+ - - + + +
#define HOME_SIZE   512
+
+ +

This macro is used to set the default size for home string.

+ +

Definition at line 17 of file aria2_download.c.

+ +
+
+

Function Documentation

+ +

◆ aria2_download()

+ +
+
+ + + + - + @@ -213,7 +281,7 @@

Definition at line 19 of file aria2_download.c.

+

Definition at line 36 of file aria2_download.c.

diff --git a/docs/html/d6/d60/aria2__download_8c.js b/docs/html/d6/d60/aria2__download_8c.js index c9cddc08..0ec32f8a 100644 --- a/docs/html/d6/d60/aria2__download_8c.js +++ b/docs/html/d6/d60/aria2__download_8c.js @@ -1,4 +1,8 @@ var aria2__download_8c = [ - [ "aria2_download", "d6/d60/aria2__download_8c.html#a89f12219462c5d1dd6d1d1dc2896914d", null ] + [ "BUFFER_SIZE", "d6/d60/aria2__download_8c.html#a6b20d41d6252e9871430c242cb1a56e7", null ], + [ "CREDENTIAL_SIZE", "d6/d60/aria2__download_8c.html#a27ad396a87c1bba9a9fe061544824c0c", null ], + [ "FILE_PATH", "d6/d60/aria2__download_8c.html#af783caa0ab3eaa291b0af58fcb59d2b3", null ], + [ "HOME_SIZE", "d6/d60/aria2__download_8c.html#a8312c2c0e4c1ea19c2dd324f623d91e4", null ], + [ "aria2_download", "d6/d60/aria2__download_8c.html#a7b3f8210580125356d3487d53f345cbf", null ] ]; \ No newline at end of file diff --git a/docs/html/d6/d60/aria2__download_8c_source.html b/docs/html/d6/d60/aria2__download_8c_source.html index ddde638a..ce91dbd9 100644 --- a/docs/html/d6/d60/aria2__download_8c_source.html +++ b/docs/html/d6/d60/aria2__download_8c_source.html @@ -113,40 +113,171 @@ Go to the documentation of this file.
1
13#include "yiffy_fetch.h"
14
-
19void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
-
20{
-
21 char *request_string = (char*)malloc(256 * sizeof(char));
-
22
-
23 if (request_string == NULL)
-
24 {
- -
26 exit(EXIT_FAILURE);
-
27 }
+
15#define FILE_PATH 256
+
16#define BUFFER_SIZE 512
+
17#define HOME_SIZE 512
+
18#define CREDENTIAL_SIZE 128
+
19
+
20static char config_file_path[FILE_PATH];
+
21static char credentials_file_path[FILE_PATH];
+
22static char buffer[BUFFER_SIZE];
+
23static char uname[CREDENTIAL_SIZE];
+
24static char api_key[CREDENTIAL_SIZE];
+
25
+
26static FILE *config_file;
+
27static FILE *credentials_file;
28
-
29 /* Set the string for NSFW or SFW option by checking the isNsfw parameter. */
-
30 if (is_nsfw)
-
31 {
-
32 sprintf(request_string, "aria2c \"https://e621.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
-
33 }
-
34 else
-
35 {
-
36 sprintf(request_string, "aria2c \"https://e926.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
-
37 }
-
38
-
39 /* Download the JSON and set a sleep(1) for signals. */
-
40 int success = system(request_string);
-
41 sleep(1);
-
42
-
43 free(request_string);
+
29static bool get_nsfw();
+
30static char *get_credential(char *credential);
+
31
+
36void aria2_download(char *tags, int page, int lim)
+
37{
+
38 /* NSFW option for the API request. */
+
39 bool is_nsfw = get_nsfw();
+
40
+
41 /* Credentials for the API request. */
+
42 strcpy(uname, get_credential("USERNAME"));
+
43 strcpy(api_key, get_credential("API-KEY"));
44
-
45 if (success == BAD_SYSTEM_FUNC_CALL)
-
46 {
- -
48 exit(EXIT_FAILURE);
-
49 }
-
50}
-
void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
downloads the API response by using aria2c, works with a system call
+
45 /* Allocate space for request string. */
+
46 char *request_string = (char*)malloc(256 * sizeof(char));
+
47
+
48 if (request_string == NULL)
+
49 {
+ +
51 exit(EXIT_FAILURE);
+
52 }
+
53
+
54 /* Set the string for NSFW or SFW option by checking the isNsfw parameter. */
+
55 if (is_nsfw)
+
56 {
+
57 sprintf(request_string, "aria2c \"https://e621.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, api_key, lim, page, tags);
+
58 }
+
59 else
+
60 {
+
61 sprintf(request_string, "aria2c \"https://e926.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, api_key, lim, page, tags);
+
62 }
+
63
+
64 /* Download the JSON and set a sleep(1) for signals. */
+
65 int success = system(request_string);
+
66 sleep(1);
+
67
+
68 free(request_string);
+
69
+
70 if (success == BAD_SYSTEM_FUNC_CALL)
+
71 {
+ +
73 exit(EXIT_FAILURE);
+
74 }
+
75}
+
76
+
79static bool get_nsfw()
+
80{
+
81 /* Get the home environment. */
+
82 char *home = getenv("HOME");
+
83
+
84 if (home == NULL)
+
85 {
+ +
87 exit(EXIT_FAILURE);
+
88 }
+
89
+
90 sprintf(config_file_path, "%s/.yiffy/yiffy-config.txt", home);
+
91
+
92 /* Read the configuration file (home/user/.yiffy/yiffy-config.txt) to execute the wanted process. */
+
93 config_file = fopen(config_file_path, "r");
+
94
+
95 if (config_file == NULL)
+
96 {
+ +
98 exit(EXIT_FAILURE);
+
99 }
+
100
+
101 while (fgets(buffer, BUFFER_SIZE - 1, config_file))
+
102 {
+
103 if (strcmp(buffer, "IS_NSFW=YES\n") == 0)
+
104 {
+
105 /* Close the config_file. */
+
106 fclose(config_file);
+
107
+
108 /* Return true if the IS_NSFW is YES. */
+
109 return true;
+
110 }
+
111 }
+
112
+
113 /* Close the config_file. */
+
114 fclose(config_file);
+
115
+
116 /* Return false if the IS_NSFW is NO. */
+
117 return false;
+
118}
+
119
+
123static char *get_credential(char *option)
+
124{
+
125 /* Credential string to return. */
+
126 char *credential;
+
127
+
128 /* Get the home environment. */
+
129 char *home = getenv("HOME");
+
130
+
131 if (home == NULL)
+
132 {
+ +
134 exit(EXIT_FAILURE);
+
135 }
+
136
+
137 sprintf(credentials_file_path, "%s/.yiffy/yiffy-credentials.txt", home);
+
138
+
139 /* Read the credentials file (home/user/.yiffy/yiffy-credentials.txt) to execute the wanted process. */
+
140 credentials_file = fopen(credentials_file_path, "r");
+
141
+
142 if (credentials_file == NULL)
+
143 {
+ +
145 exit(EXIT_FAILURE);
+
146 }
+
147
+
148 /* Read the credential. */
+
149 while (fgets(buffer, BUFFER_SIZE - 1, credentials_file))
+
150 {
+
151 if (strstr(buffer, option))
+
152 {
+
153 /* Get the credential. */
+
154 credential = strstr(buffer, "=");
+
155
+
156 /* Increase the r_credential pointer index by 1 to get rid of equal sign. */
+
157 credential++;
+
158
+
159 break;
+
160 }
+
161 }
+
162
+
163 /* Close the credentials file. */
+
164 fclose(credentials_file);
+
165
+
166 /* If the credential not null, return it. */
+
167 if (strcmp(credential, "NULL\n") != 0)
+
168 {
+
169 /* Set the last \n to \0. */
+
170 credential[strlen(credential) - 1] = '\0';
+
171
+
172 return credential;
+
173 }
+
174 else
+
175 {
+ +
177 exit(EXIT_FAILURE);
+
178 }
+
179}
+
#define CREDENTIAL_SIZE
+
#define BUFFER_SIZE
This macro is used to set the default size for reading the config file.
+
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
+
#define FILE_PATH
This macro is used to set the default size for getting the home directory file.
+
char * buffer
Definition: cjson.h:170
+
void file_open_error_msg()
Shows some information about file permissions when yiffy is not able to read file.
void malloc_error_msg()
Shows some information when yiffy cannot allocate memory.
+
void no_home_error_msg()
Outputs the home not found error when application can not access the $HOME environment variable.
+
void set_credentials_error_msg()
Gives message if the credentials are not set in the credentials file.
void system_func_error_msg()
Shows some information when system function not works.
#define BAD_SYSTEM_FUNC_CALL
Definition: yiffy_fetch.h:25
diff --git a/docs/html/d6/d6e/access__error__msg_8c__incl.map b/docs/html/d6/d6e/access__error__msg_8c__incl.map index 2097b97f..bc9c9505 100644 --- a/docs/html/d6/d6e/access__error__msg_8c__incl.map +++ b/docs/html/d6/d6e/access__error__msg_8c__incl.map @@ -1,5 +1,5 @@ - + diff --git a/docs/html/d6/d6e/access__error__msg_8c__incl.md5 b/docs/html/d6/d6e/access__error__msg_8c__incl.md5 index 36e6a860..e24bced3 100644 --- a/docs/html/d6/d6e/access__error__msg_8c__incl.md5 +++ b/docs/html/d6/d6e/access__error__msg_8c__incl.md5 @@ -1 +1 @@ -c5390bfb93e5e00dda4e63bf18a942ca \ No newline at end of file +3d73ce6ec77cfb71781a75598a8cc3ce \ No newline at end of file diff --git a/docs/html/d8/dbe/set__credentials__error__msg_8c.html b/docs/html/d8/dbe/set__credentials__error__msg_8c.html new file mode 100644 index 00000000..326e063e --- /dev/null +++ b/docs/html/d8/dbe/set__credentials__error__msg_8c.html @@ -0,0 +1,177 @@ + + + + + + + +yiffy: src/msg/set_credentials_error_msg.c File Reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

void aria2_download ( char * apikey, tags,
+ + + + + + +
+
yiffy +  v1.0.0 +
+
e621/e926 tui interface
+
+
+ + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
set_credentials_error_msg.c File Reference
+
+
+ +

This file is used to give message if the credentials are not set in the credentials file. +More...

+
#include "yiffy_messages.h"
+
+Include dependency graph for set_credentials_error_msg.c:
+
+
+ + + + + + +
+
+

Go to the source code of this file.

+ + + + + +

+Functions

void set_credentials_error_msg ()
 Gives message if the credentials are not set in the credentials file. More...
 
+

Detailed Description

+

This file is used to give message if the credentials are not set in the credentials file.

+
Author
Mehmet Mert Gunduz (mertt.nosp@m.gg@g.nosp@m.mail..nosp@m.com)
+
Date
05/06/2024
+ +

Definition in file set_credentials_error_msg.c.

+

Function Documentation

+ +

◆ set_credentials_error_msg()

+ +
+
+ + + + + + + +
void set_credentials_error_msg ()
+
+ +

Gives message if the credentials are not set in the credentials file.

+ +

Definition at line 16 of file set_credentials_error_msg.c.

+ +
+
+
+
+ + + + diff --git a/docs/html/d8/dbe/set__credentials__error__msg_8c.js b/docs/html/d8/dbe/set__credentials__error__msg_8c.js new file mode 100644 index 00000000..4c073566 --- /dev/null +++ b/docs/html/d8/dbe/set__credentials__error__msg_8c.js @@ -0,0 +1,4 @@ +var set__credentials__error__msg_8c = +[ + [ "set_credentials_error_msg", "d8/dbe/set__credentials__error__msg_8c.html#aa9576ed018648983c9c2745abf7dde31", null ] +]; \ No newline at end of file diff --git a/docs/html/d8/dbe/set__credentials__error__msg_8c_source.html b/docs/html/d8/dbe/set__credentials__error__msg_8c_source.html new file mode 100644 index 00000000..d1fde1ce --- /dev/null +++ b/docs/html/d8/dbe/set__credentials__error__msg_8c_source.html @@ -0,0 +1,133 @@ + + + + + + + +yiffy: src/msg/set_credentials_error_msg.c Source File + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
yiffy +  v1.0.0 +
+
e621/e926 tui interface
+
+
+ + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
set_credentials_error_msg.c
+
+
+Go to the documentation of this file.
1
+
11#include "yiffy_messages.h"
+
12
+ +
17{
+
18 fprintf(stderr, "yiffy: credentials are not set.\n");
+
19 fprintf(stderr, "yiffy: please set your credentials to use search/fetch functionalities.\n");
+
20}
+
void set_credentials_error_msg()
Gives message if the credentials are not set in the credentials file.
+
This file is used to handle error and information messages.
+
+
+ + + + diff --git a/docs/html/db/df8/access__error__msg_8c.html b/docs/html/db/df8/access__error__msg_8c.html index b38062a6..79ef2573 100644 --- a/docs/html/db/df8/access__error__msg_8c.html +++ b/docs/html/db/df8/access__error__msg_8c.html @@ -113,7 +113,7 @@
-

This file is used to check the accessibility to the e621/e926 api. +

This file is used to give message about the accessibility to the e621/e926 api. More...

#include "yiffy_messages.h"
@@ -121,7 +121,7 @@
- + @@ -133,11 +133,11 @@

Functions

void access_error_msg () - Checks the accessibility to the e621/e926 api. More...
+ Gives message about the accessibility to the e621/e926 api. More...
 

Detailed Description

-

This file is used to check the accessibility to the e621/e926 api.

+

This file is used to give message about the accessibility to the e621/e926 api.

Author
Mehmet Mert Gunduz (mertt.nosp@m.gg@g.nosp@m.mail..nosp@m.com)
Date
02/10/2023
@@ -158,7 +158,7 @@

-

Checks the accessibility to the e621/e926 api.

+

Gives message about the accessibility to the e621/e926 api.

Definition at line 16 of file access_error_msg.c.

diff --git a/docs/html/db/df8/access__error__msg_8c_source.html b/docs/html/db/df8/access__error__msg_8c_source.html index dbcab3a8..35ed9a5b 100644 --- a/docs/html/db/df8/access__error__msg_8c_source.html +++ b/docs/html/db/df8/access__error__msg_8c_source.html @@ -118,7 +118,7 @@
18 fprintf(stderr, "yiffy: can\'t access the e621/e926 API.\n");
19 fprintf(stderr, "yiffy: please check if the website is down.\n");
20}
-
void access_error_msg()
Checks the accessibility to the e621/e926 api.
+
void access_error_msg()
Gives message about the accessibility to the e621/e926 api.
This file is used to handle error and information messages.

diff --git a/docs/html/dc/d3b/show__config_8c.html b/docs/html/dc/d3b/show__config_8c.html index 05f005c1..689f157f 100644 --- a/docs/html/dc/d3b/show__config_8c.html +++ b/docs/html/dc/d3b/show__config_8c.html @@ -135,12 +135,12 @@ - - - - - - + + + + + +

Macros

#define MAX_FILE_PATH   256
 This macro is used to set the default size for getting the home directory file. More...
 
#define MAX_BUFFER_SIZE   512
 This macro is used to set the default size for reading the config file. More...
 
#define FILE_PATH   256
 This macro is used to set the default size for getting the home directory file. More...
 
#define BUFFER_SIZE   512
 This macro is used to set the default size for reading the config file. More...
 
@@ -164,14 +164,14 @@

Definition in file show_config.c.

Macro Definition Documentation

- -

◆ MAX_BUFFER_SIZE

+ +

◆ BUFFER_SIZE

Functions

- +
#define MAX_BUFFER_SIZE   512#define BUFFER_SIZE   512
@@ -182,14 +182,14 @@

-

◆ MAX_FILE_PATH

+ +

◆ FILE_PATH

- +
#define MAX_FILE_PATH   256#define FILE_PATH   256
diff --git a/docs/html/dc/d3b/show__config_8c.js b/docs/html/dc/d3b/show__config_8c.js index a55ba7cf..2403091a 100644 --- a/docs/html/dc/d3b/show__config_8c.js +++ b/docs/html/dc/d3b/show__config_8c.js @@ -1,7 +1,7 @@ var show__config_8c = [ - [ "MAX_BUFFER_SIZE", "dc/d3b/show__config_8c.html#ad4d796b98c583d49e83adabd74a63bf6", null ], - [ "MAX_FILE_PATH", "dc/d3b/show__config_8c.html#a263efd24d550124313df51247f07457a", null ], + [ "BUFFER_SIZE", "dc/d3b/show__config_8c.html#a6b20d41d6252e9871430c242cb1a56e7", null ], + [ "FILE_PATH", "dc/d3b/show__config_8c.html#af783caa0ab3eaa291b0af58fcb59d2b3", null ], [ "show_config", "dc/d3b/show__config_8c.html#aca4794b6b6172dc0b0e6d6fba2297c58", null ], [ "write_config_and_credentials", "dc/d3b/show__config_8c.html#a1c6d912ba0f7e4be13617b71c82ebe88", null ], [ "write_configuration", "dc/d3b/show__config_8c.html#a8f75d697a10e581b438507be639c796b", null ], diff --git a/docs/html/dc/d3b/show__config_8c_source.html b/docs/html/dc/d3b/show__config_8c_source.html index d73fe0d1..dff6c1de 100644 --- a/docs/html/dc/d3b/show__config_8c_source.html +++ b/docs/html/dc/d3b/show__config_8c_source.html @@ -111,13 +111,13 @@
Go to the documentation of this file.
1
-
11#define MAX_FILE_PATH 256
-
12#define MAX_BUFFER_SIZE 512
+
11#define FILE_PATH 256
+
12#define BUFFER_SIZE 512
13
14static char *home_directory;
15
-
16static char file_path[MAX_FILE_PATH];
-
17static char buffer[MAX_BUFFER_SIZE];
+
16static char file_path[FILE_PATH];
+
17static char buffer[BUFFER_SIZE];
18
19#include "yiffy_text_menus.h"
20
@@ -156,7 +156,7 @@
55 fprintf(stdout, "yiffy configurations (config.txt)\n");
56 fprintf(stdout, "---------------------------------\n");
57
-
58 while (fgets(buffer, MAX_BUFFER_SIZE - 1, config_file))
+
58 while (fgets(buffer, BUFFER_SIZE - 1, config_file))
59 {
60 fprintf(stdout, "- %s", buffer);
61 }
@@ -181,7 +181,7 @@
81 fprintf(stdout, "yiffy credentials (credentials.txt)\n");
82 fprintf(stdout, "-----------------------------------\n");
83
-
84 while (fgets(buffer, MAX_BUFFER_SIZE - 1, credentials_file))
+
84 while (fgets(buffer, BUFFER_SIZE - 1, credentials_file))
85 {
86 fprintf(stdout, "- %s", buffer);
87 }
@@ -201,11 +201,11 @@
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 write_config_and_credentials()
Writes config and credentials and prints a space between them.
Definition: show_config.c:93
-
#define MAX_FILE_PATH
This macro is used to set the default size for getting the home directory file.
Definition: show_config.c:11
void write_credentials()
Reads the credentials file and writes the credentials one by one.
Definition: show_config.c:67
+
#define BUFFER_SIZE
This macro is used to set the default size for reading the config file.
Definition: show_config.c:12
void write_configuration()
Reads the configuration file and writes the configs one by one.
Definition: show_config.c:41
void show_config()
Shows the yiffy configurations to user.
Definition: show_config.c:26
-
#define MAX_BUFFER_SIZE
This macro is used to set the default size for reading the config file.
Definition: show_config.c:12
+
#define FILE_PATH
This macro is used to set the default size for getting the home directory file.
Definition: show_config.c:11
This header file is used to generate text based information menus for yiffy.
diff --git a/docs/html/dc/dc0/yiffy_8c_source.html b/docs/html/dc/dc0/yiffy_8c_source.html index 4a06f9ec..2ec9ab49 100644 --- a/docs/html/dc/dc0/yiffy_8c_source.html +++ b/docs/html/dc/dc0/yiffy_8c_source.html @@ -318,14 +318,14 @@
282 }
283 }
284}
-
void access_error_msg()
Checks the accessibility to the e621/e926 api.
+
void access_error_msg()
Gives message about the accessibility to the e621/e926 api.
void argc_error_msg(int argc)
Evaluates the argument count and gives information if not in the requested format.
void conf_apikey(char *argv)
Configures the api key option.
Definition: conf_apikey.c:31
void conf_img_viewer_command(char *argv)
Configures the image viewer command system, the image viewer command is used to show images on termin...
void conf_nsfw(char *argv)
Configures the nsfw option.
Definition: conf_nsfw.c:29
void conf_uname(char *argv)
Configures the username option.
Definition: conf_uname.c:31
void extra_arg_error_msg(char *argument)
Outputs the correct format for the prompted option when there is additional invalid argument.
-
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:32
+
void fetch(char *tags, int page, char *command)
Reads the configuration file, sets the options and sends a request to e621-e926. After taking the res...
Definition: fetch.c:30
void no_arg_value_msg(char *argument)
Outputs the correct prompt format when there is no argument value.
void on_off_msg(char *argument)
Outputs the correct argument value (on/off) for specified options.
Definition: on_off_msg.c:18
void search(char *tags)
Creates a ncurses-based user interface to show, download, search and travel the e621/e926 by using cu...
Definition: search.c:44
diff --git a/docs/html/dc/dec/search_8c_source.html b/docs/html/dc/dec/search_8c_source.html index f871ab09..02dce758 100644 --- a/docs/html/dc/dec/search_8c_source.html +++ b/docs/html/dc/dec/search_8c_source.html @@ -197,7 +197,7 @@
99 create_controls_window(controls_window, &posts_panel_height, controls, sizeof(controls) / sizeof(controls[0]));
100
101 /* Download the first page of posts with prompted tags. */
-
102 aria2_download(tags, 1, is_nsfw, posts_panel_height);
+
102 aria2_download(tags, 1, posts_panel_height);
103
104 /* Read the posts.json file. */
105 FILE *posts_json_file = fopen("posts.json", "r");
@@ -277,7 +277,7 @@
179 getch();
180 endwin();
181}
-
void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
downloads the API response by using aria2c, works with a system call
+
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
char * buffer
Definition: cjson.h:170
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.
diff --git a/docs/html/dir_92db932c96b71876a62b1386c1d468d9.html b/docs/html/dir_92db932c96b71876a62b1386c1d468d9.html index 7782787b..5e149a74 100644 --- a/docs/html/dir_92db932c96b71876a62b1386c1d468d9.html +++ b/docs/html/dir_92db932c96b71876a62b1386c1d468d9.html @@ -123,7 +123,7 @@

Files

file  access_error_msg.c [code] - This file is used to check the accessibility to the e621/e926 api.
+ This file is used to give message about the accessibility to the e621/e926 api.
  file  already_conf_msg.c [code]  This file is used to show some information when cjson root gives error.
@@ -174,6 +174,9 @@ file  posts_not_array_error_msg.c [code]  This file is used to output the error when the parsing is faced with an error in the posts section.
  +file  set_credentials_error_msg.c [code] + This file is used to give message if the credentials are not set in the credentials file.
+  file  system_func_error_msg.c [code]  This file is used to show some information when system function did not worked.
  diff --git a/docs/html/dir_92db932c96b71876a62b1386c1d468d9.js b/docs/html/dir_92db932c96b71876a62b1386c1d468d9.js index 8f3871b0..fed60975 100644 --- a/docs/html/dir_92db932c96b71876a62b1386c1d468d9.js +++ b/docs/html/dir_92db932c96b71876a62b1386c1d468d9.js @@ -17,6 +17,7 @@ var dir_92db932c96b71876a62b1386c1d468d9 = [ "on_off_msg.c", "d9/d8a/on__off__msg_8c.html", "d9/d8a/on__off__msg_8c" ], [ "post_error_msg.c", "d4/d42/post__error__msg_8c.html", "d4/d42/post__error__msg_8c" ], [ "posts_not_array_error_msg.c", "d0/d05/posts__not__array__error__msg_8c.html", "d0/d05/posts__not__array__error__msg_8c" ], + [ "set_credentials_error_msg.c", "d8/dbe/set__credentials__error__msg_8c.html", "d8/dbe/set__credentials__error__msg_8c" ], [ "system_func_error_msg.c", "dc/d8f/system__func__error__msg_8c.html", "dc/d8f/system__func__error__msg_8c" ], [ "unrecognized_arg_msg.c", "d7/de2/unrecognized__arg__msg_8c.html", "d7/de2/unrecognized__arg__msg_8c" ], [ "window_create_error_msg.c", "d8/d12/window__create__error__msg_8c.html", "d8/d12/window__create__error__msg_8c" ], diff --git a/docs/html/files.html b/docs/html/files.html index 495ce7ec..f4501a86 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -135,7 +135,7 @@  show_version.cThis file is used to show version of the app to the user  yiffy_text_menus.hThis header file is used to generate text based information menus for yiffy   msg - access_error_msg.cThis file is used to check the accessibility to the e621/e926 api + access_error_msg.cThis file is used to give message about the accessibility to the e621/e926 api  already_conf_msg.cThis file is used to show some information when cjson root gives error  argc_error_msg.cThis file is used to evaluate the argument count and give information if not in the requested format  cjson_error_msg.cThis file is used to show some information when cjson root gives error @@ -153,20 +153,21 @@  on_off_msg.cThis file is used to output the correct argument value (on/off) for specified arguments  post_error_msg.cThis file is used to output the error when the parsing is faced with an error in the post section  posts_not_array_error_msg.cThis file is used to output the error when the parsing is faced with an error in the posts section - system_func_error_msg.cThis file is used to show some information when system function did not worked - unrecognized_arg_msg.cThis file is used to give information and output the command prompted by the user when it is not defined as a valid argument - window_create_error_msg.cThis file is used to give information about the window creation error - yiffy_messages.hThis file is used to handle error and information messages -  search - create_controls_window.cThis file is used to create a new window to display the controls and adds it to the specified position - create_post_tags_window.cThis file is used to create a new window to display post tags and adds it to the specified position - create_posts_window.cThis file is used to create a new window to display posts and adds it to the specified position - create_top_window.cThis file is used to create a new top window to display the title and SFW/NSFW status - init_ncurses.cThis file initializes and configures the ncurses library for the needed user interface - search.cThis file is used to interact with the terminal user interface version of yiffy, providing download, list, search, travel, and selected post tags features - set_window_title.cThis file is used to write title to the windows for the user interface - write_post.cThis file is used to write posts to the posts window - yiffy_search.hThis header file is used to handle the fetching and searching system + set_credentials_error_msg.cThis file is used to give message if the credentials are not set in the credentials file + system_func_error_msg.cThis file is used to show some information when system function did not worked + unrecognized_arg_msg.cThis file is used to give information and output the command prompted by the user when it is not defined as a valid argument + window_create_error_msg.cThis file is used to give information about the window creation error + yiffy_messages.hThis file is used to handle error and information messages +  search + create_controls_window.cThis file is used to create a new window to display the controls and adds it to the specified position + create_post_tags_window.cThis file is used to create a new window to display post tags and adds it to the specified position + create_posts_window.cThis file is used to create a new window to display posts and adds it to the specified position + create_top_window.cThis file is used to create a new top window to display the title and SFW/NSFW status + init_ncurses.cThis file initializes and configures the ncurses library for the needed user interface + search.cThis file is used to interact with the terminal user interface version of yiffy, providing download, list, search, travel, and selected post tags features + set_window_title.cThis file is used to write title to the windows for the user interface + write_post.cThis file is used to write posts to the posts window + yiffy_search.hThis header file is used to handle the fetching and searching system

diff --git a/docs/html/globals.html b/docs/html/globals.html index 78a8faea..0b82555d 100644 --- a/docs/html/globals.html +++ b/docs/html/globals.html @@ -114,7 +114,7 @@

- a -

@@ -125,7 +125,7 @@

- b -

@@ -149,7 +149,7 @@

- c -