mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
get_color_string: Return a pointer to const.
This commit is contained in:
parent
add2a5d1b5
commit
0484f68b69
@ -166,7 +166,7 @@ redir_add(struct option *opt, unsigned char *str)
|
||||
/* Support functions for config file parsing. */
|
||||
|
||||
static void
|
||||
add_optstring_to_string(struct string *s, unsigned char *q, int qlen)
|
||||
add_optstring_to_string(struct string *s, const unsigned char *q, int qlen)
|
||||
{
|
||||
if (!commandline) add_char_to_string(s, '"');
|
||||
add_quoted_to_string(s, q, qlen);
|
||||
@ -364,7 +364,7 @@ color_wr(struct option *opt, struct string *str)
|
||||
{
|
||||
color_T color = opt->value.color;
|
||||
unsigned char hexcolor[8];
|
||||
unsigned char *strcolor = get_color_string(color, hexcolor);
|
||||
const unsigned char *strcolor = get_color_string(color, hexcolor);
|
||||
|
||||
add_optstring_to_string(str, strcolor, strlen(strcolor));
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ l_get_option(LS)
|
||||
{
|
||||
color_T color;
|
||||
unsigned char hexcolor[8];
|
||||
unsigned char *strcolor;
|
||||
const unsigned char *strcolor;
|
||||
|
||||
color = opt->value.color;
|
||||
strcolor = get_color_string(color, hexcolor);
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "util/string.h"
|
||||
|
||||
struct color_spec {
|
||||
char *name;
|
||||
const char *name;
|
||||
color_T rgb;
|
||||
};
|
||||
|
||||
@ -135,7 +135,7 @@ decode_hex_color:
|
||||
return -1; /* Not found */
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
const unsigned char *
|
||||
get_color_string(color_T color, unsigned char hexcolor[8])
|
||||
{
|
||||
struct color_spec *cs;
|
||||
|
@ -17,7 +17,7 @@ int decode_color(unsigned char *str, int slen, color_T *color);
|
||||
|
||||
/* Returns a string containing the color info. If no ``English'' name can be
|
||||
* found the hex color (#rrggbb) is returned in the given buffer. */
|
||||
unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]);
|
||||
const unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]);
|
||||
|
||||
/* Translate rgb color to string in #rrggbb format. str should be a pointer to
|
||||
* a 8 bytes memory space. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user