[hackers] [surf] Change site styles structure for a more generic one || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sun, 30 Apr 2017 23:25:10 +0200 (CEST)

commit d0e3c69e5920eecd7ac7e12c39ccb10e2ca5410d
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Thu Apr 27 15:01:54 2017 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Thu Apr 27 15:02:40 2017 +0200

    Change site styles structure for a more generic one

diff --git a/config.def.h b/config.def.h
index dce76f8..712f975 100644
--- a/config.def.h
+++ b/config.def.h
_AT_@ -90,7 +90,7 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
  * The iteration will stop at the first match, beginning at the beginning of
  * the list.
  */
-static SiteStyle styles[] = {
+static SiteSpecific styles[] = {
         /* regexp file in $styledir */
         { ".*", "default.css" },
 };
diff --git a/surf.c b/surf.c
index 9f0c8a1..77e3d6f 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -136,9 +136,9 @@ typedef struct {
 
 typedef struct {
         char *regex;
- char *style;
+ char *file;
         regex_t re;
-} SiteStyle;
+} SiteSpecific;
 
 /* Surf */
 static void usage(void);
_AT_@ -304,8 +304,8 @@ setup(void)
                                         styles[i].regex);
                                 styles[i].regex = NULL;
                         }
- styles[i].style = g_strconcat(styledir, "/",
- styles[i].style, NULL);
+ styles[i].file = g_strconcat(styledir, "/",
+ styles[i].file, NULL);
                 }
                 g_free(styledir);
         } else {
_AT_@ -748,7 +748,7 @@ getstyle(const char *uri)
         for (i = 0; i < LENGTH(styles); ++i) {
                 if (styles[i].regex &&
                     !regexec(&(styles[i].re), uri, 0, NULL, 0))
- return styles[i].style;
+ return styles[i].file;
         }
 
         return "";
Received on Sun Apr 30 2017 - 23:25:10 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 30 2017 - 23:36:23 CEST