1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
--- a/tree.h 2023-11-12 00:00:00.000000000 +0000
+++ b/tree.h 2024-01-24 00:00:00.000000000 +0000
@@ -173,12 +173,12 @@
#define SORT_SIZE 8192
/* Comment file parsing (via .info files) */
-struct comment {
+struct tree_comment {
char *filename;
int isdir;
- struct comment *next;
+ struct tree_comment *next;
};
struct _info {
- struct comment *comments;
+ struct tree_comment *comments;
};
/* For ANSI terminals */
@@ -300,7 +300,7 @@
void htmldir(char *dirname, int level, char *newdir);
void html_encode(FILE *fd, char *s);
-struct comment *infocheck(char *path, char *name, int top, int isdir);
+struct tree_comment *infocheck(char *path, char *name, int top, int isdir);
struct _info *getinfo(char *name, struct _info *dir);
void switch_on(char *opt);
void switch_off(char *opt);
--- a/info.c 2023-11-12 00:00:00.000000000 +0000
+++ b/info.c 2024-01-24 00:00:00.000000000 +0000
@@ -31,7 +31,7 @@
* Returns NULL if path/name is not found in the .info file.
* The returned comment structure is in the given cwd _info structure.
*/
-struct comment *infocheck(char *path, char *name, int top, int isdir)
+struct tree_comment *infocheck(char *path, char *name, int top, int isdir)
{
static struct _info cwd = {NULL};
static char *cpath = NULL;
@@ -39,7 +39,7 @@
char *file, *ptr, *ent;
FILE *fp;
size_t flen = 0;
- struct comment *com, *cp, *cpprev = NULL;
+ struct tree_comment *com, *cp, *cpprev = NULL;
bool iscomment = false;
if (cwd.comments != NULL && cpath != NULL && strcmp(path, cpath) == 0) {
@@ -68,7 +68,7 @@
while (getdelim(&file, &flen, '\n', fp) > 0) {
ptr = trim(file);
if (!ptr[0]) continue;
- if (ptr[0] == '#') { if (com) com = (struct comment *)1; continue; }
+ if (ptr[0] == '#') { if (com) com = (struct tree_comment *)1; continue; }
if (ptr[0] == '[') {
char *q = strchr(ptr,']');
if (q) {
@@ -85,7 +85,7 @@
}
com = NULL;
}
- } else if (com == (struct comment *)1) {
+ } else if (com == (struct tree_comment *)1) {
com = xmalloc(sizeof(*com));
com->filename = scopy(ent);
com->isdir = (*ent && ent[strlen(ent)-1] == '/');
|