summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Cross <patchdev@fat-dragon.org>2018-12-03 14:27:59 +0000
committerAndrew Pamment <apamment@yandex.com>2018-12-04 10:55:10 +1000
commitb3b07bf13c761111d4ee20159e6ce57d22f02f70 (patch)
treef47594735333e4a44d2f47480351fbf55359f37c
parentefc181ac1bd639a77644f22f6f046bd4041c6776 (diff)
Whitespace cleanups.
Run clang-format and trim whitespace from the ends of lines. Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
-rw-r--r--src/bluewave.c6
-rw-r--r--src/files.c2
-rw-r--r--src/lua_glue.c34
-rw-r--r--src/mail_menu.c76
-rw-r--r--src/settings.c2
-rw-r--r--src/www_blog.c5
-rw-r--r--src/www_email.c9
-rw-r--r--src/www_files.c3
-rw-r--r--src/www_last10.c3
-rw-r--r--src/www_msgs.c13
-rw-r--r--src/www_tree.c325
11 files changed, 228 insertions, 250 deletions
diff --git a/src/bluewave.c b/src/bluewave.c
index 0b46d8c..8e6e8f6 100644
--- a/src/bluewave.c
+++ b/src/bluewave.c
@@ -700,12 +700,12 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
jsf.DatLen = strlen(conf.bwave_name);
jsf.Buffer = (char *)conf.bwave_name;
JAM_PutSubfield(jsp, &jsf);
-
+
if (conf.external_address != NULL) {
uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
- snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
+ snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0;
@@ -1098,7 +1098,7 @@ void bwave_upload_reply() {
upl_hdr.reader_tear, tagline, mc->maginode);
} else if (mc->nettype == NETWORK_QWK) {
snprintf(originlinebuffer, sizeof originlinebuffer, "\r---\r * MagickaBBS * %s\r",
- tagline);
+ tagline);
} else {
snprintf(originlinebuffer, sizeof originlinebuffer, "\r");
}
diff --git a/src/files.c b/src/files.c
index 85a3113..445285b 100644
--- a/src/files.c
+++ b/src/files.c
@@ -504,7 +504,7 @@ int do_download(struct user_record *user, char *file) {
--blen;
continue;
}
-
+
size_t alen = 0;
if (*p == 'f') {
strlcpy(b, file, blen);
diff --git a/src/lua_glue.c b/src/lua_glue.c
index 901830f..ff27c99 100644
--- a/src/lua_glue.c
+++ b/src/lua_glue.c
@@ -480,15 +480,15 @@ int l_postMessage(lua_State *L) {
if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
- mc->fidoaddr->zone,
- mc->fidoaddr->net,
- mc->fidoaddr->node,
- mc->fidoaddr->point);
+ mc->fidoaddr->zone,
+ mc->fidoaddr->net,
+ mc->fidoaddr->node,
+ mc->fidoaddr->point);
} else {
snprintf(buffer, sizeof buffer, "%d:%d/%d",
- mc->fidoaddr->zone,
- mc->fidoaddr->net,
- mc->fidoaddr->node);
+ mc->fidoaddr->zone,
+ mc->fidoaddr->net,
+ mc->fidoaddr->node);
}
jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0;
@@ -497,11 +497,11 @@ int l_postMessage(lua_State *L) {
JAM_PutSubfield(jsp, &jsf);
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
- mc->fidoaddr->zone,
- mc->fidoaddr->net,
- mc->fidoaddr->node,
- mc->fidoaddr->point,
- generate_msgid());
+ mc->fidoaddr->zone,
+ mc->fidoaddr->net,
+ mc->fidoaddr->node,
+ mc->fidoaddr->point,
+ generate_msgid());
jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0;
@@ -527,7 +527,7 @@ int l_postMessage(lua_State *L) {
} else if (mc->nettype == NETWORK_QWK) {
uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
- snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
+ snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0;
@@ -566,13 +566,13 @@ int l_postMessage(lua_State *L) {
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point);
}
- } else if (mc->nettype == NETWORK_MAGI) {
+ } else if (mc->nettype == NETWORK_MAGI) {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (@%d)\r",
- VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
- mc->maginode);
+ VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
+ mc->maginode);
} else if (mc->nettype == NETWORK_QWK) {
snprintf(buffer, sizeof buffer, "\r---\r * MagickaBBS * %s\r",
- tagline);
+ tagline);
} else {
snprintf(buffer, sizeof buffer, "\r");
}
diff --git a/src/mail_menu.c b/src/mail_menu.c
index bd1572c..cdddf1a 100644
--- a/src/mail_menu.c
+++ b/src/mail_menu.c
@@ -609,7 +609,7 @@ char *editor(struct user_record *user, char *quote, int quotelen, char *from, in
mc->maginode);
} else if (mc->nettype == NETWORK_QWK && !email) {
snprintf(buffer, sizeof buffer, "\r---\r * MagickaBBS * %s\r",
- tagline);
+ tagline);
} else {
strlcpy(buffer, "\r", sizeof buffer);
}
@@ -793,7 +793,7 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len, int dopi
int ansi;
int tab;
int pipec;
-
+
line_at = 1;
char_at = 1;
@@ -804,16 +804,16 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len, int dopi
state = 1;
continue;
} else if (body[i] == '|' && dopipe == 1) {
- if (body[i+1] == '|') {
+ if (body[i + 1] == '|') {
i++;
char_at++;
while (char_at > 80) {
line_at++;
char_at -= 80;
- }
+ }
continue;
} else {
- i+=2;
+ i += 2;
continue;
}
} else {
@@ -969,7 +969,7 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len, int dopi
state = 1;
continue;
} else if (body[i] == '|' && dopipe == 1) {
- if (body[i+1] == '|') {
+ if (body[i + 1] == '|') {
i++;
if (line_at > line_count) line_at = line_count;
fake_screen[line_at - 1][char_at - 1]->c = body[i];
@@ -981,81 +981,81 @@ void unmangle_ansi(char *body, int len, char **body_out, int *body_len, int dopi
char_at -= 80;
}
} else {
- if (body[i+1] >= '0' && body[i+1] <= '9' && body[i+2] >= '0' && body[i+2] <= '9') {
- pipec = ((body[i+1] - '0') * 10) + (body[i+2] - '0');
- i+=2;
+ if (body[i + 1] >= '0' && body[i + 1] <= '9' && body[i + 2] >= '0' && body[i + 2] <= '9') {
+ pipec = ((body[i + 1] - '0') * 10) + (body[i + 2] - '0');
+ i += 2;
switch (pipec) {
case 0:
fg = 0x00;
break;
case 1:
- fg = 0x01;//D_BLUE;
+ fg = 0x01; //D_BLUE;
break;
case 2:
- fg = 0x02;//D_GREEN;
+ fg = 0x02; //D_GREEN;
break;
case 3:
- fg = 0x03;//D_CYAN
+ fg = 0x03; //D_CYAN
break;
case 4:
- fg = 0x04;//D_RED
+ fg = 0x04; //D_RED
break;
case 5:
- fg = 0x05;//D_MAGENTA
+ fg = 0x05; //D_MAGENTA
break;
case 6:
- fg = 0x06;//D_YELLOW
+ fg = 0x06; //D_YELLOW
break;
case 7:
- fg = 0x07;//D_WHITE
+ fg = 0x07; //D_WHITE
break;
case 8:
fg = 0x08; //B_BLACK
break;
case 9:
- fg = 0x09;//B_BLUE
+ fg = 0x09; //B_BLUE
break;
case 10:
- fg = 0x0A;//B_GREEN
+ fg = 0x0A; //B_GREEN
break;
case 11:
- fg = 0x0B;//B_CYAN
+ fg = 0x0B; //B_CYAN
break;
case 12:
- fg = 0x0C;//B_RED;
+ fg = 0x0C; //B_RED;
break;
case 13:
- fg = 0x0D;//B_MAGENTA;
+ fg = 0x0D; //B_MAGENTA;
break;
case 14:
- fg = 0x0E;//B_YELLOW;
+ fg = 0x0E; //B_YELLOW;
break;
case 15:
- fg = 0x0F;//B_WHITE;
+ fg = 0x0F; //B_WHITE;
break;
case 16:
- bg = 0x00;//D_BLACK
+ bg = 0x00; //D_BLACK
break;
case 17:
- bg = 0x01;//D_BLUE
+ bg = 0x01; //D_BLUE
break;
case 18:
- bg = 0x02;// D_GREEN
+ bg = 0x02; // D_GREEN
break;
case 19:
- bg = 0x03;// D_CYAN
+ bg = 0x03; // D_CYAN
break;
case 20:
- bg = 0x04;// D_RED
+ bg = 0x04; // D_RED
break;
case 21:
- bg = 0x05;// D_MAGENTA
+ bg = 0x05; // D_MAGENTA
break;
case 22:
- bg = 0x06;// D_YELLOW
+ bg = 0x06; // D_YELLOW
break;
case 23:
- bg = 0x07;// D_WHITE
+ bg = 0x07; // D_WHITE
break;
}
} else {
@@ -1691,7 +1691,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
}
// PAGE DOWN
position = position + 15;
- while(position + 15 >= ptr_vector_len(&msg_lines)) {
+ while (position + 15 >= ptr_vector_len(&msg_lines)) {
position--;
}
}
@@ -1864,7 +1864,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
if (conf.external_address != NULL) {
uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
- snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
+ snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0;
@@ -2061,9 +2061,9 @@ int read_new_msgs(struct user_record *user, struct msg_headers *msghs) {
free(jb);
if (all_unread == 0) {
k = jlr.HighReadMsg;
- for (i = msghs->msg_count-1; i>=0; i--) {
+ for (i = msghs->msg_count - 1; i >= 0; i--) {
if (msghs->msgs[i]->msg_h->MsgNum == k) {
- i+=2;
+ i += 2;
break;
} else if (msghs->msgs[i]->msg_h->MsgNum < k) {
i++;
@@ -2335,14 +2335,14 @@ void post_message(struct user_record *user) {
if (conf.external_address != NULL) {
uuid_generate(qwk_msgid);
uuid_unparse_lower(qwk_msgid, qwkuuid);
- snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
+ snprintf(buffer, sizeof buffer, "<%s@%s>", qwkuuid, conf.external_address);
jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0;
jsf.DatLen = strlen(buffer);
jsf.Buffer = (char *)buffer;
JAM_PutSubfield(jsp, &jsf);
- }
+ }
}
} else if (ma->type == TYPE_NETMAIL_AREA) {
jmh.Attribute |= JAM_MSG_TYPENET;
@@ -3147,7 +3147,7 @@ int count_msgs_above_msgno(struct msg_headers *msghs, int highmsgno) {
int i;
int highmsg = 0;
- for (i=msghs->msg_count-1; i>=0;i--) {
+ for (i = msghs->msg_count - 1; i >= 0; i--) {
if (msghs->msgs[i]->msg_no < highmsgno) break;
highmsg++;
}
diff --git a/src/settings.c b/src/settings.c
index 3b54771..6568356 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -161,7 +161,7 @@ void settings_menu(struct user_record *user) {
case 'i': {
user->dopipe = !user->dopipe;
save_user(user);
- } break;
+ } break;
case 'q':
dosettings = 1;
break;
diff --git a/src/www_blog.c b/src/www_blog.c
index c2c55a9..a55ade1 100644
--- a/src/www_blog.c
+++ b/src/www_blog.c
@@ -29,7 +29,6 @@ char *www_blog() {
www_tag_add_child(cur_tag, www_tag_new(NULL, "No Entries"));
www_tag_add_child(page, cur_tag);
-
return www_tag_unwravel(page);
}
for (size_t i = 0; i < ptr_vector_len(&entries); i++) {
@@ -102,12 +101,12 @@ char *www_blog() {
if (blog_body.s != NULL) {
child_child_tag = www_tag_new(NULL, blog_body.s);
free(blog_body.s);
- www_tag_add_child(child_tag, child_child_tag);
+ www_tag_add_child(child_tag, child_child_tag);
blog_body = EMPTY_STRALLOC;
child_tag = www_tag_new("p", NULL);
www_tag_add_child(cur_tag, child_tag);
}
- ++p;
+ ++p;
}
}
diff --git a/src/www_email.c b/src/www_email.c
index d626a57..478f1b9 100644
--- a/src/www_email.c
+++ b/src/www_email.c
@@ -9,7 +9,7 @@
#include "bbs.h"
extern struct bbs_config conf;
-extern struct www_tag * aha(char *input, struct www_tag *parent);
+extern struct www_tag *aha(char *input, struct www_tag *parent);
int www_email_delete(struct user_record *user, int id) {
char buffer[PATH_MAX];
@@ -91,7 +91,7 @@ int www_send_email(struct user_record *user, char *recipient, char *subject, cha
uname(&name);
for (char *p = ibody; *p != '\0'; ++p) {
- if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
+ if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
stralloc_append1(&sa, ' ');
p++;
} else if (*p != '\n') {
@@ -183,7 +183,6 @@ char *www_new_email() {
child_tag = www_tag_new("br", NULL);
www_tag_add_child(cur_tag, child_tag);
-
child_tag = www_tag_new(NULL, "Subject : ");
www_tag_add_child(cur_tag, child_tag);
@@ -544,7 +543,6 @@ char *www_email_summary(struct user_record *user) {
www_tag_add_attrib(cur_tag, "class", "div-table");
www_tag_add_child(page, cur_tag);
-
while (sqlite3_step(res) == SQLITE_ROW) {
char datebuf[32];
++msgid;
@@ -605,7 +603,6 @@ char *www_email_summary(struct user_record *user) {
child_child_child_tag = www_tag_new(NULL, from);
www_tag_add_child(child_child_tag, child_child_child_tag);
-
child_child_tag = www_tag_new("div", NULL);
www_tag_add_attrib(child_child_tag, "class", "email-date");
www_tag_add_child(child_tag, child_child_tag);
@@ -633,10 +630,8 @@ char *www_email_summary(struct user_record *user) {
www_tag_add_attrib(child_child_child_tag, "class", "email-delete");
www_tag_add_child(child_child_tag, child_child_child_tag);
-
child_child_child_child_tag = www_tag_new(NULL, "");
www_tag_add_child(child_child_child_tag, child_child_child_child_tag);
-
}
sqlite3_finalize(res);
diff --git a/src/www_files.c b/src/www_files.c
index 07cd901..23e5207 100644
--- a/src/www_files.c
+++ b/src/www_files.c
@@ -12,7 +12,7 @@
extern struct bbs_config conf;
extern struct user_record *gUser;
-extern struct www_tag * aha(char *input, struct www_tag *parent);
+extern struct www_tag *aha(char *input, struct www_tag *parent);
static int digit2nibble(int digit) {
static const char *const hex = "0123456789abcdef";
@@ -318,7 +318,6 @@ char *www_files_display_listing(int dir, int sub) {
struct file_sub *fsub = ptr_vector_get(&fdir->file_subs, sub);
assert(fsub != NULL);
-
cur_tag = www_tag_new("div", NULL);
www_tag_add_attrib(cur_tag, "class", "content-header");
www_tag_add_child(page, cur_tag);
diff --git a/src/www_last10.c b/src/www_last10.c
index 9d1b911..567d865 100644
--- a/src/www_last10.c
+++ b/src/www_last10.c
@@ -20,7 +20,6 @@ char *www_last10() {
struct www_tag *child_child_tag;
struct www_tag *child_child_child_tag;
-
snprintf(last10_path, PATH_MAX, "%s/last10v2.dat", conf.bbs_path);
FILE *fptr = fopen(last10_path, "rb");
@@ -61,7 +60,6 @@ char *www_last10() {
child_child_child_tag = www_tag_new(NULL, callers[i].name);
www_tag_add_child(child_child_tag, child_child_child_tag);
-
child_child_tag = www_tag_new("div", NULL);
www_tag_add_attrib(child_child_tag, "class", "last10-location");
www_tag_add_child(child_tag, child_child_tag);
@@ -87,7 +85,6 @@ char *www_last10() {
www_tag_add_attrib(child_child_tag, "class", "last10-new");
www_tag_add_child(child_tag, child_child_tag);
-
stralloc url = EMPTY_STRALLOC;
stralloc_copys(&url, conf.www_url);
diff --git a/src/www_msgs.c b/src/www_msgs.c
index 7d5cbd7..ac31817 100644
--- a/src/www_msgs.c
+++ b/src/www_msgs.c
@@ -19,7 +19,7 @@
#define IN 0
#define OUT 1
extern struct bbs_config conf;
-extern struct www_tag * aha(char *input, struct www_tag *parent, int dopipe);
+extern struct www_tag *aha(char *input, struct www_tag *parent, int dopipe);
static char *www_wordwrap(char *content, int cutoff);
/*
char *www_sanitize(char *inp) {
@@ -216,7 +216,6 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i
}
www_tag_add_child(cur_tag, child_tag);
-
child_child_tag = www_tag_new("div", NULL);
www_tag_add_attrib(child_child_tag, "class", "msg-summary-id");
www_tag_add_child(child_tag, child_child_tag);
@@ -280,7 +279,6 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i
free(to);
free(from);
free(subject);
-
}
if (skip + 50 <= mhrs->msg_count) {
cur_tag = www_tag_new("div", NULL);
@@ -645,7 +643,6 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
aha(aha_text, cur_tag, user->dopipe);
free(aha_text);
-
if (ma->write_sec_level <= user->sec_level && ma->type != TYPE_NETMAIL_AREA) {
cur_tag = www_tag_new("div", NULL);
www_tag_add_attrib(cur_tag, "class", "msg-reply-form");
@@ -657,7 +654,6 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i
child_child_tag = www_tag_new(NULL, "Reply");
www_tag_add_child(child_tag, child_child_tag);
-
child_tag = www_tag_new("form", NULL);
url = EMPTY_STRALLOC;
stralloc_cats(&url, conf.www_url);
@@ -1155,10 +1151,9 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
char *p = body;
stralloc unhtmlized = EMPTY_STRALLOC;
-
// remove nbsp
while (*p != '\0') {
- if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
+ if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
stralloc_append1(&unhtmlized, ' ');
p++;
} else {
@@ -1180,8 +1175,6 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
return 0;
}
-
-
body3 = str2dup(body2, buffer);
if (body3 == NULL) {
free(body2);
@@ -1253,7 +1246,6 @@ char *www_new_msg(struct user_record *user, int conference, int area) {
child_child_tag = www_tag_new(NULL, "New Message");
www_tag_add_child(child_tag, child_child_tag);
-
cur_tag = www_tag_new("form", NULL);
stralloc url = EMPTY_STRALLOC;
@@ -1326,7 +1318,6 @@ char *www_new_msg(struct user_record *user, int conference, int area) {
child_child_tag = www_tag_new(NULL, "");
www_tag_add_child(child_tag, child_child_tag);
-
child_tag = www_tag_new("br", NULL);
www_tag_add_child(cur_tag, child_tag);
diff --git a/src/www_tree.c b/src/www_tree.c
index 7db1df2..725a520 100644
--- a/src/www_tree.c
+++ b/src/www_tree.c
@@ -17,94 +17,94 @@ static char *www_tag_sanatize(char *data, int isdata) {
case '>':
stralloc_cats(&str, "&gt;");
break;
- case '\x01':
+ case '\x01':
stralloc_cats(&str, "&#x263A;");
break;
- case '\x02':
+ case '\x02':
stralloc_cats(&str, "&#x263B;");
break;
- case '\x03':
+ case '\x03':
stralloc_cats(&str, "&#x2665;");
break;
- case '\x04':
+ case '\x04':
stralloc_cats(&str, "&#x2666;");
break;
- case '\x05':
+ case '\x05':
stralloc_cats(&str, "&#x2663;");
break;
- case '\x06':
+ case '\x06':
stralloc_cats(&str, "&#x2660;");
break;
- case '\x07':
+ case '\x07':
stralloc_cats(&str, "&#x2022;");
break;
- case '\x08':
+ case '\x08':
stralloc_cats(&str, "&#x25D8;");
break;
- case '\x09':
+ case '\x09':
stralloc_cats(&str, "&#x25CB;");
break;
- case '\x0b':
+ case '\x0b':
stralloc_cats(&str, "&#x2642;");
break;
- case '\x0c':
+ case '\x0c':
stralloc_cats(&str, "&#x2640;");
break;
- case '\x0e':
+ case '\x0e':
stralloc_cats(&str, "&#x266B;");
break;
- case '\x0f':
+ case '\x0f':
stralloc_cats(&str, "&#x263C;");
break;
- case '\x10':
+ case '\x10':
stralloc_cats(&str, "&#x25B8;");
break;
- case '\x11':
+ case '\x11':
stralloc_cats(&str, "&#x25C2;");
break;
- case '\x12':
+ case '\x12':
stralloc_cats(&str, "&#x2195;");
break;
- case '\x13':
+ case '\x13':
stralloc_cats(&str, "&#x203C;");
break;
- case '\x14':
+ case '\x14':
stralloc_cats(&str, "&#x00B6;");
break;
- case '\x15':
+ case '\x15':
stralloc_cats(&str, "&#x00A7;");
break;
- case '\x16':
+ case '\x16':
stralloc_cats(&str, "&#x25AC;");
break;
- case '\x17':
+ case '\x17':
stralloc_cats(&str, "&#x21A8;");
break;
- case '\x18':
+ case '\x18':
stralloc_cats(&str, "&#x2191;");
break;
- case '\x19':
+ case '\x19':
stralloc_cats(&str, "&#x2193;");
break;
- case '\x1a':
+ case '\x1a':
stralloc_cats(&str, "&#x2192;");
break;
- case '\x1b':
+ case '\x1b':
stralloc_cats(&str, "&#x2190;");
break;
- case '\x1c':
+ case '\x1c':
stralloc_cats(&str, "&#x221F;");
break;
- case '\x1d':
+ case '\x1d':
stralloc_cats(&str, "&#x2194;");
break;
- case '\x1e':
+ case '\x1e':
stralloc_cats(&str, "&#x25B4;");
break;
- case '\x1f':
+ case '\x1f':
stralloc_cats(&str, "&#x25BE;");
break;
-/*
+ /*
case '\x21':
stralloc_cats(&str, "&#x0021;");
break;
@@ -136,396 +136,396 @@ static char *www_tag_sanatize(char *data, int isdata) {
stralloc_cats(&str, "&#x002C;");
break;
*/
- case '\x7f':
+ case '\x7f':
stralloc_cats(&str, "&#x2302;");
break;
- case '\x80':
+ case '\x80':
stralloc_cats(&str, "&#x00C7;");
break;
- case '\x81':
+ case '\x81':
stralloc_cats(&str, "&#x00FC;");
break;
- case '\x82':
+ case '\x82':
stralloc_cats(&str, "&#x00E9;");
break;
- case '\x83':
+ case '\x83':
stralloc_cats(&str, "&#x00E2;");
break;
- case '\x84':
+ case '\x84':
stralloc_cats(&str, "&#x00E4;");
break;
- case '\x85':
+ case '\x85':
stralloc_cats(&str, "&#x00E0;");
break;
- case '\x86':
+ case '\x86':
stralloc_cats(&str, "&#x00E5;");
break;
- case '\x87':
+ case '\x87':
stralloc_cats(&str, "&#x00E7;");
break;
- case '\x88':
+ case '\x88':
stralloc_cats(&str, "&#x00EA;");
break;
- case '\x89':
+ case '\x89':
stralloc_cats(&str, "&#x00EB;");
break;
- case '\x8a':
+ case '\x8a':
stralloc_cats(&str, "&#x00E8;");
break;
- case '\x8b':
+ case '\x8b':
stralloc_cats(&str, "&#x00EF;");
break;
- case '\x8c':
+ case '\x8c':
stralloc_cats(&str, "&#x00EE;");
break;
- case '\x8d':
+ case '\x8d':
stralloc_cats(&str, "&#x00EC;");
break;
- case '\x8e':
+ case '\x8e':
stralloc_cats(&str, "&#x00C4;");
break;
- case '\x8f':
+ case '\x8f':
stralloc_cats(&str, "&#x00C5;");
break;
- case '\x90':
+ case '\x90':
stralloc_cats(&str, "&#x00C9;");
break;
- case '\x91':
+ case '\x91':
stralloc_cats(&str, "&#x00E6;");
break;
- case '\x92':
+ case '\x92':
stralloc_cats(&str, "&#x00C6;");
break;
- case '\x93':
+ case '\x93':
stralloc_cats(&str, "&#x00F4;");
break;
- case '\x94':
+ case '\x94':
stralloc_cats(&str, "&#x00F6;");
break;
- case '\x95':
+ case '\x95':
stralloc_cats(&str, "&#x00F2;");
break;
- case '\x96':
+ case '\x96':
stralloc_cats(&str, "&#x00FB;");
break;
- case '\x97':
+ case '\x97':
stralloc_cats(&str, "&#x00F9;");
break;
- case '\x98':
+ case '\x98':
stralloc_cats(&str, "&#x00FF;");
break;
- case '\x99':
+ case '\x99':
stralloc_cats(&str, "&#x00D6;");
break;
- case '\x9a':
+ case '\x9a':
stralloc_cats(&str, "&#x00DC;");
break;
- case '\x9b':
+ case '\x9b':
stralloc_cats(&str, "&#x00A2;");
break;
- case '\x9c':
+ case '\x9c':
stralloc_cats(&str, "&#x00A3;");
break;
- case '\x9d':
+ case '\x9d':
stralloc_cats(&str, "&#x00A5;");
break;
- case '\x9e':
+ case '\x9e':
stralloc_cats(&str, "&#x20A7;");
break;
- case '\x9f':
+ case '\x9f':
stralloc_cats(&str, "&#x0192;");
break;
- case '\xa0':
+ case '\xa0':
stralloc_cats(&str, "&#x00E1;");
break;
- case '\xa1':
+ case '\xa1':
stralloc_cats(&str, "&#x00ED;");
break;
- case '\xa2':
+ case '\xa2':
stralloc_cats(&str, "&#x00F3;");
break;
- case '\xa3':
+ case '\xa3':
stralloc_cats(&str, "&#x00FA;");
break;
- case '\xa4':
+ case '\xa4':
stralloc_cats(&str, "&#x00F1;");
break;
- case '\xa5':
+ case '\xa5':
stralloc_cats(&str, "&#x00D1;");
break;
- case '\xa6':
+ case '\xa6':
stralloc_cats(&str, "&#x00AA;");
break;
- case '\xa7':
+ case '\xa7':
stralloc_cats(&str, "&#x00BA;");
break;
- case '\xa8':
+ case '\xa8':
stralloc_cats(&str, "&#x00BF;");
break;
- case '\xa9':
+ case '\xa9':
stralloc_cats(&str, "&#x2310;");
break;
- case '\xaa':
+ case '\xaa':
stralloc_cats(&str, "&#x00AC;");
break;
- case '\xab':
+ case '\xab':
stralloc_cats(&str, "&#x00BD;");
break;
- case '\xac':
+ case '\xac':
stralloc_cats(&str, "&#x00BC;");
break;
- case '\xad':
+ case '\xad':
stralloc_cats(&str, "&#x00A1;");
break;
- case '\xae':
+ case '\xae':
stralloc_cats(&str, "&#x00AB;");
break;
- case '\xaf':
+ case '\xaf':
stralloc_cats(&str, "&#x00BB;");
break;
- case '\xb0':
+ case '\xb0':
stralloc_cats(&str, "&#x2591;");
break;
- case '\xb1':
+ case '\xb1':
stralloc_cats(&str, "&#x2592;");
break;
- case '\xb2':
+ case '\xb2':
stralloc_cats(&str, "&#x2593;");
break;
- case '\xb3':
+ case '\xb3':
stralloc_cats(&str, "&#x2502;");
break;
- case '\xb4':
+ case '\xb4':
stralloc_cats(&str, "&#x2524;");
break;
- case '\xb5':
+ case '\xb5':
stralloc_cats(&str, "&#x2561;");
break;
- case '\xb6':
+ case '\xb6':
stralloc_cats(&str, "&#x2562;");
break;
- case '\xb7':
+ case '\xb7':
stralloc_cats(&str, "&#x2556;");
break;
- case '\xb8':
+ case '\xb8':
stralloc_cats(&str, "&#x2555;");
break;
- case '\xb9':
+ case '\xb9':
stralloc_cats(&str, "&#x2563;");
break;
- case '\xba':
+ case '\xba':
stralloc_cats(&str, "&#x2551;");
break;
- case '\xbb':
+ case '\xbb':
stralloc_cats(&str, "&#x2557;");
break;
- case '\xbc':
+ case '\xbc':
stralloc_cats(&str, "&#x255D;");
break;
- case '\xbd':
+ case '\xbd':
stralloc_cats(&str, "&#x255C;");
break;
- case '\xbe':
+ case '\xbe':
stralloc_cats(&str, "&#x255B;");
break;
- case '\xbf':
+ case '\xbf':
stralloc_cats(&str, "&#x2510;");
break;
- case '\xc0':
+ case '\xc0':
stralloc_cats(&str, "&#x2514;");
break;
- case '\xc1':
+ case '\xc1':
stralloc_cats(&str, "&#x2534;");
break;
- case '\xc2':
+ case '\xc2':
stralloc_cats(&str, "&#x252C;");
break;
- case '\xc3':
+ case '\xc3':
stralloc_cats(&str, "&#x251C;");
break;
- case '\xc4':
+ case '\xc4':
stralloc_cats(&str, "&#x2500;");
break;
- case '\xc5':
+ case '\xc5':
stralloc_cats(&str, "&#x253C;");
break;
- case '\xc6':
+ case '\xc6':
stralloc_cats(&str, "&#x255E;");
break;
- case '\xc7':
+ case '\xc7':
stralloc_cats(&str, "&#x255F;");
break;
- case '\xc8':
+ case '\xc8':
stralloc_cats(&str, "&#x255A;");
break;
- case '\xc9':
+ case '\xc9':
stralloc_cats(&str, "&#x2554;");
break;
- case '\xca':
+ case '\xca':
stralloc_cats(&str, "&#x2569;");
break;
- case '\xcb':
+ case '\xcb':
stralloc_cats(&str, "&#x2566;");
break;
- case '\xcc':
+ case '\xcc':
stralloc_cats(&str, "&#x2560;");
break;
- case '\xcd':
+ case '\xcd':
stralloc_cats(&str, "&#x2550;");
break;
- case '\xce':
+ case '\xce':
stralloc_cats(&str, "&#x256C;");
break;
- case '\xcf':
+ case '\xcf':
stralloc_cats(&str, "&#x2567;");
break;
- case '\xd0':
+ case '\xd0':
stralloc_cats(&str, "&#x2568;");
break;
- case '\xd1':
+ case '\xd1':
stralloc_cats(&str, "&#x2564;");
break;
- case '\xd2':
+ case '\xd2':
stralloc_cats(&str, "&#x2565;");
break;
- case '\xd3':
+ case '\xd3':
stralloc_cats(&str, "&#x2559;");
break;
- case '\xd4':
+ case '\xd4':
stralloc_cats(&str, "&#x255B;");
break;
- case '\xd5':
+ case '\xd5':
stralloc_cats(&str, "&#x2552;");
break;
- case '\xd6':
+ case '\xd6':
stralloc_cats(&str, "&#x2553;");
break;
- case '\xd7':
+ case '\xd7':
stralloc_cats(&str, "&#x256B;");
break;
- case '\xd8':
+ case '\xd8':
stralloc_cats(&str, "&#x256A;");
break;
- case '\xd9':
+ case '\xd9':
stralloc_cats(&str, "&#x2518;");
break;
- case '\xda':
+ case '\xda':
stralloc_cats(&str, "&#x250C;");
break;
- case '\xdb':
+ case '\xdb':
stralloc_cats(&str, "&#x2588;");
break;
- case '\xdc':
+ case '\xdc':
stralloc_cats(&str, "&#x2584;");
break;
- case '\xdd':
+ case '\xdd':
stralloc_cats(&str, "&#x258C;");
break;
- case '\xde':
+ case '\xde':
stralloc_cats(&str, "&#x2590;");
break;
- case '\xdf':
+ case '\xdf':
stralloc_cats(&str, "&#x2580;");
break;
- case '\xe0':
+ case '\xe0':
stralloc_cats(&str, "&#x03B1;");
break;
- case '\xe1':
+ case '\xe1':
stralloc_cats(&str, "&#x03B2;");
break;
- case '\xe2':
+ case '\xe2':
stralloc_cats(&str, "&#x0393;");
break;
- case '\xe3':
+ case '\xe3':
stralloc_cats(&str, "&#x03C0;");
break;
- case '\xe4':
+ case '\xe4':
stralloc_cats(&str, "&#x03A3;");
break;
- case '\xe5':
+ case '\xe5':
stralloc_cats(&str, "&#x03C3;");
break;
- case '\xe6':
+ case '\xe6':
stralloc_cats(&str, "&#x00B5;");
break;
- case '\xe7':
+ case '\xe7':
stralloc_cats(&str, "&#x03C4;");
break;
- case '\xe8':
+ case '\xe8':
stralloc_cats(&str, "&#x03A6;");
break;
- case '\xe9':
+ case '\xe9':
stralloc_cats(&str, "&#x0398;");
break;
- case '\xea':
+ case '\xea':
stralloc_cats(&str, "&#x03A9;");
break;
- case '\xeb':
+ case '\xeb':
stralloc_cats(&str, "&#x03B4;");
break;
- case '\xec':
+ case '\xec':
stralloc_cats(&str, "&#x221E;");
break;
- case '\xed':
+ case '\xed':
stralloc_cats(&str, "&#x2205;");
break;
- case '\xee':
+ case '\xee':
stralloc_cats(&str, "&#x2208;");
break;
- case '\xef':
+ case '\xef':
stralloc_cats(&str, "&#x2229;");
break;
- case '\xf0':
+ case '\xf0':
stralloc_cats(&str, "&#x2261;");
break;
- case '\xf1':
+ case '\xf1':
stralloc_cats(&str, "&#x00B1;");
break;
- case '\xf2':
+ case '\xf2':
stralloc_cats(&str, "&#x2265;");
break;
- case '\xf3':
+ case '\xf3':
stralloc_cats(&str, "&#x2264;");
break;
- case '\xf4':
+ case '\xf4':
stralloc_cats(&str, "&#x2320;");
break;
- case '\xf5':
+ case '\xf5':
stralloc_cats(&str, "&#x2321;");
break;
- case '\xf6':
+ case '\xf6':
stralloc_cats(&str, "&#x00F7;");
break;
- case '\xf7':
+ case '\xf7':
stralloc_cats(&str, "&#x2248;");
break;
- case '\xf8':
+ case '\xf8':
stralloc_cats(&str, "&#x00B0;");
break;
- case '\xf9':
+ case '\xf9':
stralloc_cats(&str, "&#x2219;");
break;
- case '\xfa':
+ case '\xfa':
stralloc_cats(&str, "&#x00B7;");
break;
- case '\xfb':
+ case '\xfb':
stralloc_cats(&str, "&#x221A;");
break;
- case '\xfc':
+ case '\xfc':
stralloc_cats(&str, "&#x207F;");
break;
- case '\xfd':
+ case '\xfd':
stralloc_cats(&str, "&#x00B2;");
break;
- case '\xfe':
+ case '\xfe':
stralloc_cats(&str, "&#x25AA;");
break;
case ' ':
if (isdata) {
- if (*(p+1) == ' ') {
+ if (*(p + 1) == ' ') {
stralloc_cats(&str, "&nbsp;");
} else {
- if (p > data && (*(p-1) == ' ' || *(p-1) == '\n')) {
+ if (p > data && (*(p - 1) == ' ' || *(p - 1) == '\n')) {
stralloc_cats(&str, "&nbsp;");
} else if (data == p) {
stralloc_cats(&str, "&nbsp;");
@@ -550,7 +550,6 @@ static char *www_tag_sanatize(char *data, int isdata) {
struct www_tag *www_tag_new(char *tag, char *data) {
struct www_tag *new_tag = malloz(sizeof(struct www_tag));
-
new_tag->attribs = EMPTY_PTR_VECTOR;
new_tag->values = EMPTY_PTR_VECTOR;
new_tag->children = EMPTY_PTR_VECTOR;
@@ -575,7 +574,7 @@ struct www_tag *www_tag_new(char *tag, char *data) {
struct www_tag *www_tag_duplicate(struct www_tag *oldtag) {
struct www_tag *newtag = www_tag_new(oldtag->tag, oldtag->data);
- for (int i=0;i<oldtag->attribs.len;i++) {
+ for (int i = 0; i < oldtag->attribs.len; i++) {
www_tag_add_attrib(newtag, strdup(ptr_vector_get(&oldtag->attribs, i)), strdup(ptr_vector_get(&oldtag->values, i)));
}
return newtag;
@@ -622,7 +621,6 @@ char *www_tag_unwravel(struct www_tag *tag) {
stralloc_append1(&thedata, '\"');
}
-
stralloc_append1(&thedata, '>');
}
char *data = www_tag_unwravel(child);
@@ -660,7 +658,6 @@ char *www_tag_unwravel(struct www_tag *tag) {
}
}
destroy_ptr_vector(&child->children);
-
}
stralloc_0(&thedata);