mirror of
https://github.com/rkd77/elinks.git
synced 2025-04-18 00:47:36 -04:00
[cache] const in redirect_cache
This commit is contained in:
parent
b64753d214
commit
a576245561
2
src/cache/cache.c
vendored
2
src/cache/cache.c
vendored
@ -700,7 +700,7 @@ normalize_cache_entry(struct cache_entry *cached, off_t truncate_length)
|
|||||||
|
|
||||||
|
|
||||||
struct uri *
|
struct uri *
|
||||||
redirect_cache(struct cache_entry *cached, char *location,
|
redirect_cache(struct cache_entry *cached, const char *location,
|
||||||
int get, int incomplete)
|
int get, int incomplete)
|
||||||
{
|
{
|
||||||
char *uristring;
|
char *uristring;
|
||||||
|
2
src/cache/cache.h
vendored
2
src/cache/cache.h
vendored
@ -140,7 +140,7 @@ void delete_cache_entry(struct cache_entry *cached);
|
|||||||
* Returns the URI being redirected to or NULL if allocation failed.
|
* Returns the URI being redirected to or NULL if allocation failed.
|
||||||
*/
|
*/
|
||||||
struct uri *
|
struct uri *
|
||||||
redirect_cache(struct cache_entry *cached, char *location,
|
redirect_cache(struct cache_entry *cached, const char *location,
|
||||||
int get, int incomplete);
|
int get, int incomplete);
|
||||||
|
|
||||||
/* The garbage collector trigger. If @whole is zero, remove unused cache
|
/* The garbage collector trigger. If @whole is zero, remove unused cache
|
||||||
|
@ -96,7 +96,7 @@ static const struct protocol_backend protocol_backends[] = {
|
|||||||
* links). */
|
* links). */
|
||||||
|
|
||||||
protocol_T
|
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
|
/* 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
|
* values and since 0 <= -1 for enum values it's better to use clean
|
||||||
|
@ -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,
|
/* Resolves the given protocol @name with length @namelen to a known protocol,
|
||||||
* PROTOCOL_UNKOWN or PROTOCOL_INVALID if no protocol part could be identified.
|
* PROTOCOL_UNKOWN or PROTOCOL_INVALID if no protocol part could be identified.
|
||||||
* User defined protocols (configurable via protocol.user) takes precedence. */
|
* 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;
|
extern struct module protocol_module;
|
||||||
|
|
||||||
|
@ -877,10 +877,10 @@ transform_file_url(struct uri *uri, const char *cwd)
|
|||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *translate_url(char *url, char *cwd);
|
static char *translate_url(const char *url, char *cwd);
|
||||||
|
|
||||||
char *
|
char *
|
||||||
join_urls(struct uri *base, char *rel)
|
join_urls(struct uri *base, const char *rel)
|
||||||
{
|
{
|
||||||
char *uristring, *path;
|
char *uristring, *path;
|
||||||
int add_slash = 0;
|
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,
|
/* Returns an URI string that can be used internally. Adding protocol prefix,
|
||||||
* missing slashes etc. */
|
* missing slashes etc. */
|
||||||
static char *
|
static char *
|
||||||
translate_url(char *url, char *cwd)
|
translate_url(const char *url, char *cwd)
|
||||||
{
|
{
|
||||||
char *newurl;
|
char *newurl;
|
||||||
struct uri uri;
|
struct uri uri;
|
||||||
|
@ -339,7 +339,7 @@ char *get_extension_from_uri(struct uri *uri);
|
|||||||
/* Resolves a @relative URI to absolute form using @base URI.
|
/* Resolves a @relative URI to absolute form using @base URI.
|
||||||
* Example: if @base is http://elinks.cz/ and @relative is #news
|
* Example: if @base is http://elinks.cz/ and @relative is #news
|
||||||
* the outcome would be http://elinks.cz/#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.
|
/* 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,
|
* If @slen < 0, then string length will be obtained by a strlen() call,
|
||||||
|
@ -93,7 +93,7 @@ struct module user_protocol_module = struct_module(
|
|||||||
|
|
||||||
|
|
||||||
char *
|
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;
|
struct option *opt;
|
||||||
int xwin = term ? term->environment & ENV_XWIN : 0;
|
int xwin = term ? term->environment & ENV_XWIN : 0;
|
||||||
|
@ -12,7 +12,7 @@ extern "C" {
|
|||||||
extern struct module user_protocol_module;
|
extern struct module user_protocol_module;
|
||||||
extern protocol_external_handler_T user_protocol_handler;
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ get_filename_position(char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
expand_tilde(char *filename)
|
expand_tilde(const char *filename)
|
||||||
{
|
{
|
||||||
struct string file;
|
struct string file;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ expand_tilde(char *filename)
|
|||||||
#ifdef HAVE_GETPWNAM
|
#ifdef HAVE_GETPWNAM
|
||||||
} else {
|
} else {
|
||||||
struct passwd *passwd = NULL;
|
struct passwd *passwd = NULL;
|
||||||
char *user = filename + 1;
|
char *user = (char *)(filename + 1);
|
||||||
int userlen = 0;
|
int userlen = 0;
|
||||||
|
|
||||||
while (user[userlen] && !dir_sep(user[userlen]))
|
while (user[userlen] && !dir_sep(user[userlen]))
|
||||||
|
@ -38,7 +38,7 @@ char *get_filename_position(char *filename);
|
|||||||
|
|
||||||
/** Tilde is only expanded for the current users homedir (~/).
|
/** Tilde is only expanded for the current users homedir (~/).
|
||||||
* The returned file name is allocated. */
|
* 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
|
/*! @brief Generate a unique file name by trial and error based on the
|
||||||
* @a fileprefix by adding suffix counter (e.g. '.42').
|
* @a fileprefix by adding suffix counter (e.g. '.42').
|
||||||
|
Loading…
x
Reference in New Issue
Block a user