]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
Mark several functions/variables static
[ps-cgit] / ui-shared.c
index 1a28dce668ca67b30fb222ccb73e0f8e422eea0c..63a7116c4a60e1863e1667d239054e2e0c595256 100644 (file)
@@ -103,25 +103,25 @@ const char *cgit_repobasename(const char *reponame)
        int p;
        const char *rv;
        strncpy(rvbuf, reponame, sizeof(rvbuf));
        int p;
        const char *rv;
        strncpy(rvbuf, reponame, sizeof(rvbuf));
-       if(rvbuf[sizeof(rvbuf)-1])
+       if (rvbuf[sizeof(rvbuf)-1])
                die("cgit_repobasename: truncated repository name '%s'", reponame);
        p = strlen(rvbuf)-1;
        /* strip trailing slashes */
                die("cgit_repobasename: truncated repository name '%s'", reponame);
        p = strlen(rvbuf)-1;
        /* strip trailing slashes */
-       while(p && rvbuf[p] == '/') rvbuf[p--] = 0;
+       while (p && rvbuf[p] == '/') rvbuf[p--] = 0;
        /* strip trailing .git */
        /* strip trailing .git */
-       if(p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
+       if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
                p -= 3; rvbuf[p--] = 0;
        }
        /* strip more trailing slashes if any */
                p -= 3; rvbuf[p--] = 0;
        }
        /* strip more trailing slashes if any */
-       while( p && rvbuf[p] == '/') rvbuf[p--] = 0;
+       while ( p && rvbuf[p] == '/') rvbuf[p--] = 0;
        /* find last slash in the remaining string */
        rv = strrchr(rvbuf,'/');
        /* find last slash in the remaining string */
        rv = strrchr(rvbuf,'/');
-       if(rv)
+       if (rv)
                return ++rv;
        return rvbuf;
 }
 
                return ++rv;
        return rvbuf;
 }
 
-char *cgit_currurl()
+static char *cgit_currurl()
 {
        if (!ctx.cfg.virtual_root)
                return ctx.cfg.script_name;
 {
        if (!ctx.cfg.virtual_root)
                return ctx.cfg.script_name;
@@ -433,8 +433,8 @@ void cgit_stats_link(const char *name, const char *title, const char *class,
        reporevlink("stats", name, title, class, head, NULL, path);
 }
 
        reporevlink("stats", name, title, class, head, NULL, path);
 }
 
-void cgit_self_link(char *name, const char *title, const char *class,
-                   struct cgit_context *ctx)
+static void cgit_self_link(char *name, const char *title, const char *class,
+                          struct cgit_context *ctx)
 {
        if (!strcmp(ctx->qry.page, "repolist"))
                return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort,
 {
        if (!strcmp(ctx->qry.page, "repolist"))
                return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort,
@@ -512,8 +512,8 @@ void cgit_object_link(struct object *obj)
        reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
 }
 
        reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
 }
 
-struct string_list_item *lookup_path(struct string_list *list,
-                                    const char *path)
+static struct string_list_item *lookup_path(struct string_list *list,
+                                           const char *path)
 {
        struct string_list_item *item;
 
 {
        struct string_list_item *item;
 
@@ -576,7 +576,7 @@ void cgit_print_date(time_t secs, const char *format, int local_time)
 
        if (!secs)
                return;
 
        if (!secs)
                return;
-       if(local_time)
+       if (local_time)
                time = localtime(&secs);
        else
                time = gmtime(&secs);
                time = localtime(&secs);
        else
                time = gmtime(&secs);
@@ -716,16 +716,16 @@ void cgit_print_docend()
        html("</body>\n</html>\n");
 }
 
        html("</body>\n</html>\n");
 }
 
-int print_branch_option(const char *refname, const unsigned char *sha1,
-                       int flags, void *cb_data)
+static int print_branch_option(const char *refname, const unsigned char *sha1,
+                              int flags, void *cb_data)
 {
        char *name = (char *)refname;
        html_option(name, name, ctx.qry.head);
        return 0;
 }
 
 {
        char *name = (char *)refname;
        html_option(name, name, ctx.qry.head);
        return 0;
 }
 
-int print_archive_ref(const char *refname, const unsigned char *sha1,
-                      int flags, void *cb_data)
+static int print_archive_ref(const char *refname, const unsigned char *sha1,
+                            int flags, void *cb_data)
 {
        struct tag *tag;
        struct taginfo *info;
 {
        struct tag *tag;
        struct taginfo *info;