Skip to content

Commit f4b7639

Browse files
committed
Add missing comments to headers and sources
1 parent 5f46a46 commit f4b7639

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/include/main.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
#ifndef MAIN_H_
33
#define MAIN_H_ 1
44

5+
/*
6+
* Compile-time configuration.
7+
*/
58
#define BOARD "g"
69
#define THREADS_URL "https://a.4cdn.org/" BOARD "/threads.json"
710

8-
/* Maximum number of threads to parse and print */
11+
/*
12+
* Maximum number of threads (not posts) to parse and print.
13+
*/
914
#define MAX_THREADS 255
1015

16+
/*
17+
* Entry point of the program.
18+
*/
1119
int main(void);
1220

1321
#endif /* MAIN_H_ */

src/include/util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@
1717
*/
1818
#define STRLEN(STR) (ARRLEN(STR) - 1)
1919

20+
/*
21+
* Move a string to a destination address, allowing buffer overlapping.
22+
*/
2023
#define STRMOVE(DST, STR) memmove(DST, STR, strlen(STR) + 1)
2124

25+
/*
26+
* Print an error and a newline.
27+
*/
2228
#define ERR(...) \
2329
do { \
2430
fprintf(stderr, COL_ERROR "4cli: " COL_WARN); \

src/request.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "include/util.h"
1111
#include "include/main.h"
1212

13+
/*
14+
* Structure representing a buffer of arbitrary size.
15+
*/
1316
typedef struct {
1417
char* data;
1518
size_t sz;

0 commit comments

Comments
 (0)