diff options
author | Vincent Ambo <mail@tazj.in> | 2021-09-21T10·03+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-09-21T11·29+0300 |
commit | 43b1791ec601732ac31195df96781a848360a9ac (patch) | |
tree | daae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/urlmatch.h | |
parent | 2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff) |
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping it in sync with cgit would be easier this way, but it has proven not to be a big issue. On the other hand, a vendored copy of git is an annoying maintenance burden. It is much easier to rebase the single (dottime) patch that we have. This removes the vendored copy of git and instead passes the git source code to cgit via `pkgs.srcOnly`, which includes the applied patch so that cgit can continue rendering dottime. Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/urlmatch.h')
-rw-r--r-- | third_party/git/urlmatch.h | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/third_party/git/urlmatch.h b/third_party/git/urlmatch.h deleted file mode 100644 index 6ff42f81b0c1..000000000000 --- a/third_party/git/urlmatch.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef URL_MATCH_H -#define URL_MATCH_H - -#include "string-list.h" - -struct url_info { - /* normalized url on success, must be freed, otherwise NULL */ - char *url; - /* if !url, a brief reason for the failure, otherwise NULL */ - const char *err; - - /* the rest of the fields are only set if url != NULL */ - - size_t url_len; /* total length of url (which is now normalized) */ - size_t scheme_len; /* length of scheme name (excluding final :) */ - size_t user_off; /* offset into url to start of user name (0 => none) */ - size_t user_len; /* length of user name; if user_off != 0 but - user_len == 0, an empty user name was given */ - size_t passwd_off; /* offset into url to start of passwd (0 => none) */ - size_t passwd_len; /* length of passwd; if passwd_off != 0 but - passwd_len == 0, an empty passwd was given */ - size_t host_off; /* offset into url to start of host name (0 => none) */ - size_t host_len; /* length of host name; - * file urls may have host_len == 0 */ - size_t port_off; /* offset into url to start of port number (0 => none) */ - size_t port_len; /* if a portnum is present (port_off != 0), it has - * this length (excluding the leading ':') starting - * from port_off (always 0 for file urls) */ - size_t path_off; /* offset into url to the start of the url path; - * this will always point to a '/' character - * after the url has been normalized */ - size_t path_len; /* length of path portion excluding any trailing - * '?...' and '#...' portion; will always be >= 1 */ -}; - -char *url_normalize(const char *, struct url_info *); - -struct urlmatch_item { - size_t hostmatch_len; - size_t pathmatch_len; - char user_matched; -}; - -struct urlmatch_config { - struct string_list vars; - struct url_info url; - const char *section; - const char *key; - - void *cb; - int (*collect_fn)(const char *var, const char *value, void *cb); - int (*cascade_fn)(const char *var, const char *value, void *cb); - /* - * Compare the two matches, the one just discovered and the existing - * best match and return a negative value if the found item is to be - * rejected or a non-negative value if it is to be accepted. If this - * field is set to NULL, use the default comparison technique, which - * checks to ses if found is better (according to the urlmatch - * specificity rules) than existing. - */ - int (*select_fn)(const struct urlmatch_item *found, const struct urlmatch_item *existing); - /* - * An optional callback to allow e.g. for partial URLs; it shall - * return 1 or 0 depending whether `url` matches or not. - */ - int (*fallback_match_fn)(const char *url, void *cb); -}; - -int urlmatch_config_entry(const char *var, const char *value, void *cb); - -#endif /* URL_MATCH_H */ |