tChange site styles structure for a more generic one - surf - customized build of surf, the suckless webkit browser
(HTM) git clone git://src.adamsgaard.dk/surf
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d0e3c69e5920eecd7ac7e12c39ccb10e2ca5410d
(DIR) parent 5c527339842fdd06411eaf25547aef0902f96915
(HTM) Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 27 Apr 2017 15:01:54 +0200
Change site styles structure for a more generic one
Diffstat:
M config.def.h | 2 +-
M surf.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/config.def.h b/config.def.h
t@@ -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" },
};
(DIR) diff --git a/surf.c b/surf.c
t@@ -136,9 +136,9 @@ typedef struct {
typedef struct {
char *regex;
- char *style;
+ char *file;
regex_t re;
-} SiteStyle;
+} SiteSpecific;
/* Surf */
static void usage(void);
t@@ -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 {
t@@ -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 "";