1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-21 00:25:37 +00:00

[cache] const in redirect_cache

This commit is contained in:
Witold Filipczyk 2022-02-21 17:13:14 +01:00
parent b64753d214
commit a576245561
10 changed files with 13 additions and 13 deletions

2
src/cache/cache.c vendored
View File

@ -700,7 +700,7 @@ normalize_cache_entry(struct cache_entry *cached, off_t truncate_length)
struct uri *
redirect_cache(struct cache_entry *cached, char *location,
redirect_cache(struct cache_entry *cached, const char *location,
int get, int incomplete)
{
char *uristring;

2
src/cache/cache.h vendored
View File

@ -140,7 +140,7 @@ void delete_cache_entry(struct cache_entry *cached);
* Returns the URI being redirected to or NULL if allocation failed.
*/
struct uri *
redirect_cache(struct cache_entry *cached, char *location,
redirect_cache(struct cache_entry *cached, const char *location,
int get, int incomplete);
/* The garbage collector trigger. If @whole is zero, remove unused cache

View File

@ -96,7 +96,7 @@ static const struct protocol_backend protocol_backends[] = {
* links). */
protocol_T
get_protocol(char *name, int namelen)
get_protocol(const char *name, int namelen)
{
/* These are really protocol_T values but can take on negative
* values and since 0 <= -1 for enum values it's better to use clean

View File

@ -64,7 +64,7 @@ protocol_external_handler_T *get_protocol_external_handler(struct terminal *, st
/* Resolves the given protocol @name with length @namelen to a known protocol,
* PROTOCOL_UNKOWN or PROTOCOL_INVALID if no protocol part could be identified.
* User defined protocols (configurable via protocol.user) takes precedence. */
protocol_T get_protocol(char *name, int namelen);
protocol_T get_protocol(const char *name, int namelen);
extern struct module protocol_module;

View File

@ -877,10 +877,10 @@ transform_file_url(struct uri *uri, const char *cwd)
return uri;
}
static char *translate_url(char *url, char *cwd);
static char *translate_url(const char *url, char *cwd);
char *
join_urls(struct uri *base, char *rel)
join_urls(struct uri *base, const char *rel)
{
char *uristring, *path;
int add_slash = 0;
@ -1083,7 +1083,7 @@ find_uri_protocol(char *newurl)
/* Returns an URI string that can be used internally. Adding protocol prefix,
* missing slashes etc. */
static char *
translate_url(char *url, char *cwd)
translate_url(const char *url, char *cwd)
{
char *newurl;
struct uri uri;

View File

@ -339,7 +339,7 @@ char *get_extension_from_uri(struct uri *uri);
/* Resolves a @relative URI to absolute form using @base URI.
* Example: if @base is http://elinks.cz/ and @relative is #news
* the outcome would be http://elinks.cz/#news */
char *join_urls(struct uri *base, char *relative);
char *join_urls(struct uri *base, const char *relative);
/* Return position if end of string @s matches a known tld or -1 if not.
* If @slen < 0, then string length will be obtained by a strlen() call,

View File

@ -93,7 +93,7 @@ struct module user_protocol_module = struct_module(
char *
get_user_program(struct terminal *term, char *progid, int progidlen)
get_user_program(struct terminal *term, const char *progid, int progidlen)
{
struct option *opt;
int xwin = term ? term->environment & ENV_XWIN : 0;

View File

@ -12,7 +12,7 @@ extern "C" {
extern struct module user_protocol_module;
extern protocol_external_handler_T user_protocol_handler;
char *get_user_program(struct terminal *, char *, int);
char *get_user_program(struct terminal *, const char *, int);
#ifdef __cplusplus
}

View File

@ -95,7 +95,7 @@ get_filename_position(char *filename)
}
char *
expand_tilde(char *filename)
expand_tilde(const char *filename)
{
struct string file;
@ -112,7 +112,7 @@ expand_tilde(char *filename)
#ifdef HAVE_GETPWNAM
} else {
struct passwd *passwd = NULL;
char *user = filename + 1;
char *user = (char *)(filename + 1);
int userlen = 0;
while (user[userlen] && !dir_sep(user[userlen]))

View File

@ -38,7 +38,7 @@ char *get_filename_position(char *filename);
/** Tilde is only expanded for the current users homedir (~/).
* The returned file name is allocated. */
char *expand_tilde(char *filename);
char *expand_tilde(const char *filename);
/*! @brief Generate a unique file name by trial and error based on the
* @a fileprefix by adding suffix counter (e.g. '.42').