From 975c8f9d43d4026bf1d669b08646e9d29a9d02e4 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Sat, 24 Nov 2001 02:01:26 +0000 Subject: run make indent --- w3mbookmark.c | 65 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'w3mbookmark.c') diff --git a/w3mbookmark.c b/w3mbookmark.c index 2d0191c..49adff4 100644 --- a/w3mbookmark.c +++ b/w3mbookmark.c @@ -1,4 +1,4 @@ -/* $Id: w3mbookmark.c,v 1.4 2001/11/21 16:29:47 ukai Exp $ */ +/* $Id: w3mbookmark.c,v 1.5 2001/11/24 02:01:26 ukai Exp $ */ #ifdef __EMX__ #include #endif @@ -13,13 +13,12 @@ #if LANG == JA static char *bkmark_src1 = "Bookmark Registration\n\ -

ブックマークの登録

\n\n" -"
\n\n" -"\n\ +

ブックマークの登録

\n\n" "\n\n" "\n\ \n\ \n"; -static char *bkmark_src2 = "\n\ +static char *bkmark_src2 = + "\n\ \n\ \n\ \n\ @@ -30,13 +29,12 @@ static char *bkmark_src2 = "
New Section:
New Section:
URL:
Title:
New Section:\n\n" -"\n\ +

Register to my bookmark

\n\n" "\n\n" "\n\ \n\ \n"; -static char *bkmark_src2 = "\n\ +static char *bkmark_src2 = + "\n\ \n\ \n\ \n\ @@ -50,7 +48,8 @@ static char *default_section = "Miscellaneous"; #define FALSE 0 #define T 1 -static char end_section[] = "\n"; +static char end_section[] = + "\n"; char *Local_cookie; @@ -66,28 +65,30 @@ print_bookmark_panel(char *bmark, char *url, char *title) if ((f = fopen(bmark, "r")) != NULL) { printf("
New Section:
New Section:
URL:
Title:
Section:\n"); } - printf(bkmark_src2, html_quote(url), html_quote(title),Local_cookie); + printf(bkmark_src2, html_quote(url), html_quote(title), Local_cookie); } /* create new bookmark */ static int -create_new_bookmark(char *bmark, char *section, char *title, char *url, char *mode) +create_new_bookmark(char *bmark, char *section, char *title, char *url, + char *mode) { FILE *f; f = fopen(bmark, mode); if (f == NULL) { - printf("\nCan't open bookmark %s\n",bmark); + printf("\nCan't open bookmark %s\n", bmark); return FALSE; } else { @@ -118,10 +119,9 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) if (section == NULL || *section == '\0') section = tag_get_value(data, "section"); if (section == NULL || *section == '\0') - section = default_section; + section = default_section; - if (url == NULL || *url == '\0' || - title == NULL || *title == '\0') { + if (url == NULL || *url == '\0' || title == NULL || *title == '\0') { /* Bookmark not added */ return FALSE; } @@ -131,7 +131,7 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) f = fopen(bmark, "r"); if (f == NULL) - return create_new_bookmark(bmark,section,title,url,"w"); + return create_new_bookmark(bmark, section, title, url, "w"); section_tmp = Sprintf("

%s

\n", section); for (;;) { @@ -140,19 +140,22 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) break; if (Strcasecmp(tmp, section_tmp) == 0) section_found = 1; - if (section_found && !bmark_added) { - Strremovefirstspaces(tmp); - if (Strcmp_charp(tmp, end_section) == 0) { - pushText(tl, Sprintf("
  • %s\n", url, title)->ptr); - bmark_added = 1; - } + if (section_found && !bmark_added) { + Strremovefirstspaces(tmp); + if (Strcmp_charp(tmp, end_section) == 0) { + pushText(tl, + Sprintf("
  • %s\n", url, + title)->ptr); + bmark_added = 1; + } } if (!bmark_added && Strcasecmp_charp(tmp, "\n") == 0) { pushText(tl, Sprintf("

    %s

    \n
      \n", section)->ptr); - pushText(tl, Sprintf("
    • %s\n", url, title)->ptr); + pushText(tl, + Sprintf("
    • %s\n", url, title)->ptr); pushText(tl, end_section); pushText(tl, "
    \n"); - bmark_added = 1; + bmark_added = 1; } pushText(tl, tmp->ptr); } @@ -160,7 +163,7 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) if (!bmark_added) { /* Bookmark not added; perhaps the bookmark file is ill-formed */ /* In this case, a new bookmark is appeneded after the bookmark file */ - return create_new_bookmark(bmark,section,title,url,"a"); + return create_new_bookmark(bmark, section, title, url, "a"); } f = fopen(bmark, "w"); while (tl->nitem) { @@ -196,11 +199,11 @@ MAIN(int argc, char *argv[], char **envp) if (bmark == NULL || url == NULL) { /* incomplete request */ printf("Content-Type: text/plain\n\n"); - printf("Incomplete Request: QUERY_STRING=%s\n",qs); + printf("Incomplete Request: QUERY_STRING=%s\n", qs); exit(1); } Local_cookie = getenv("LOCAL_COOKIE"); - sent_cookie = tag_get_value(cgiarg,"cookie"); + sent_cookie = tag_get_value(cgiarg, "cookie"); if (Local_cookie == NULL) { /* Local cookie not provided: maybe illegal invocation */ Local_cookie = ""; @@ -213,7 +216,7 @@ MAIN(int argc, char *argv[], char **envp) else if (mode && !strcmp(mode, "register")) { printf("Content-Type: text/plain\n"); if (sent_cookie == NULL || Local_cookie[0] == '\0' || - strcmp(sent_cookie,Local_cookie) != 0) { + strcmp(sent_cookie, Local_cookie) != 0) { /* local cookie doesn't match: It may be an illegal invocation */ printf("\nBookmark not added: local cookie doesn't match\n"); } -- cgit v1.2.3