removed unnecessary conditional compilation directives
This commit is contained in:
parent
ac80876b13
commit
e6ce274447
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS= -g -Wall -Wextra -lgumbo -lcurl -lfuse -lcrypto \
|
CFLAGS= -g -Wall -Wextra -lgumbo -lcurl -lfuse -lcrypto \
|
||||||
-D_FILE_OFFSET_BITS=64 -DHTTPDIRFS_INFO
|
-D_FILE_OFFSET_BITS=64
|
||||||
OBJ = main.o network.o
|
OBJ = main.o network.o
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
|
13
network.c
13
network.c
|
@ -433,10 +433,9 @@ long path_download(const char *path, char *output_buf, size_t size,
|
||||||
buf.size = 0;
|
buf.size = 0;
|
||||||
buf.memory = NULL;
|
buf.memory = NULL;
|
||||||
|
|
||||||
#ifdef HTTPDIRFS_INFO
|
|
||||||
fprintf(stderr, "path_download(%s, %s);\n",
|
fprintf(stderr, "path_download(%s, %s);\n",
|
||||||
path, range_str);
|
path, range_str);
|
||||||
#endif
|
|
||||||
CURL *curl = Link_to_curl(link);
|
CURL *curl = Link_to_curl(link);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&buf);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&buf);
|
||||||
curl_easy_setopt(curl, CURLOPT_RANGE, range_str);
|
curl_easy_setopt(curl, CURLOPT_RANGE, range_str);
|
||||||
|
@ -537,9 +536,7 @@ static void HTML_to_LinkTable(GumboNode *node, LinkTable *linktbl)
|
||||||
|
|
||||||
void Link_get_stat(Link *this_link)
|
void Link_get_stat(Link *this_link)
|
||||||
{
|
{
|
||||||
#ifdef HTTPDIRFS_INFO
|
|
||||||
fprintf(stderr, "Link_get_size(%s);\n", this_link->f_url);
|
fprintf(stderr, "Link_get_size(%s);\n", this_link->f_url);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (this_link->type == LINK_FILE) {
|
if (this_link->type == LINK_FILE) {
|
||||||
CURL *curl = Link_to_curl(this_link);
|
CURL *curl = Link_to_curl(this_link);
|
||||||
|
@ -586,9 +583,8 @@ void LinkTable_fill(LinkTable *linktbl)
|
||||||
|
|
||||||
LinkTable *LinkTable_new(const char *url)
|
LinkTable *LinkTable_new(const char *url)
|
||||||
{
|
{
|
||||||
#ifdef HTTPDIRFS_INFO
|
|
||||||
fprintf(stderr, "LinkTable_new(%s);\n", url);
|
fprintf(stderr, "LinkTable_new(%s);\n", url);
|
||||||
#endif
|
|
||||||
LinkTable *linktbl = calloc(1, sizeof(LinkTable));
|
LinkTable *linktbl = calloc(1, sizeof(LinkTable));
|
||||||
if (!linktbl) {
|
if (!linktbl) {
|
||||||
fprintf(stderr, "LinkTable_new(): calloc failure!\n");
|
fprintf(stderr, "LinkTable_new(): calloc failure!\n");
|
||||||
|
@ -634,7 +630,7 @@ URL: %s, HTTP %ld\n", url, http_resp);
|
||||||
return linktbl;
|
return linktbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HTTPDIRFS_INFO
|
/** \brief print a LinkTable */
|
||||||
void LinkTable_print(LinkTable *linktbl)
|
void LinkTable_print(LinkTable *linktbl)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "--------------------------------------------\n");
|
fprintf(stderr, "--------------------------------------------\n");
|
||||||
|
@ -655,7 +651,6 @@ void LinkTable_print(LinkTable *linktbl)
|
||||||
}
|
}
|
||||||
fprintf(stderr, "--------------------------------------------\n");
|
fprintf(stderr, "--------------------------------------------\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
||||||
{
|
{
|
||||||
|
@ -698,11 +693,9 @@ static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
||||||
if (!(linktbl->links[i]->next_table)) {
|
if (!(linktbl->links[i]->next_table)) {
|
||||||
linktbl->links[i]->next_table = LinkTable_new(
|
linktbl->links[i]->next_table = LinkTable_new(
|
||||||
linktbl->links[i]->f_url);
|
linktbl->links[i]->f_url);
|
||||||
#ifdef HTTPDIRFS_INFO
|
|
||||||
fprintf(stderr, "Created new link table for %s\n",
|
fprintf(stderr, "Created new link table for %s\n",
|
||||||
linktbl->links[i]->f_url);
|
linktbl->links[i]->f_url);
|
||||||
LinkTable_print(linktbl->links[i]->next_table);
|
LinkTable_print(linktbl->links[i]->next_table);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return path_to_Link_recursive(next_path,
|
return path_to_Link_recursive(next_path,
|
||||||
|
|
|
@ -55,9 +55,6 @@ long path_download(const char *path, char *output_buf, size_t size,
|
||||||
/** \brief create a new LinkTable */
|
/** \brief create a new LinkTable */
|
||||||
LinkTable *LinkTable_new(const char *url);
|
LinkTable *LinkTable_new(const char *url);
|
||||||
|
|
||||||
/** \brief print a LinkTable */
|
|
||||||
void LinkTable_print(LinkTable *linktbl);
|
|
||||||
|
|
||||||
/** \brief find the link associated with a path */
|
/** \brief find the link associated with a path */
|
||||||
Link *path_to_Link(const char *path);
|
Link *path_to_Link(const char *path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue