1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Renamed start_case to startcase, lower_case to lowercase and upper_case to uppercase

This commit is contained in:
AlexApps99 2020-01-17 12:47:20 +13:00 committed by Brenden Matthews
parent 12bced05fe
commit f7c15b027a
4 changed files with 18 additions and 15 deletions

View File

@ -3843,7 +3843,7 @@
<varlistentry> <varlistentry>
<term> <term>
<command> <command>
<option>start_case</option> <option>startcase</option>
</command> </command>
<option>text</option> <option>text</option>
</term> </term>
@ -3853,7 +3853,7 @@
<varlistentry> <varlistentry>
<term> <term>
<command> <command>
<option>lower_case</option> <option>lowercase</option>
</command> </command>
<option>text</option> <option>text</option>
</term> </term>
@ -3863,7 +3863,7 @@
<varlistentry> <varlistentry>
<term> <term>
<command> <command>
<option>upper_case</option> <option>uppercase</option>
</command> </command>
<option>text</option> <option>text</option>
</term> </term>

View File

@ -882,15 +882,18 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
#ifdef __x86_64__ #ifdef __x86_64__
END OBJ(freq2, 0) obj->callbacks.print = &print_freq2; END OBJ(freq2, 0) obj->callbacks.print = &print_freq2;
#endif /* __x86_64__ */ #endif /* __x86_64__ */
END OBJ(startcase, 0) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_startcase;
obj->callbacks.free = &gen_free_opaque;
// Deprecated, for compatibility purposes only
END OBJ(start_case, 0) obj->data.s = STRNDUP_ARG; END OBJ(start_case, 0) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_cap; obj->callbacks.print = &print_startcase;
obj->callbacks.free = &gen_free_opaque; obj->callbacks.free = &gen_free_opaque;
END OBJ(lower_case, 0) obj->data.s = STRNDUP_ARG; END OBJ(lowercase, 0) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_lower; obj->callbacks.print = &print_lowercase;
obj->callbacks.free = &gen_free_opaque; obj->callbacks.free = &gen_free_opaque;
END OBJ(upper_case, 0) obj->data.s = STRNDUP_ARG; END OBJ(uppercase, 0) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_upper; obj->callbacks.print = &print_uppercase;
obj->callbacks.free = &gen_free_opaque; obj->callbacks.free = &gen_free_opaque;
END OBJ(catp, 0) obj->data.s = STRNDUP_ARG; END OBJ(catp, 0) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_catp; obj->callbacks.print = &print_catp;

View File

@ -85,7 +85,7 @@ void print_catp(struct text_object *obj, char *p, unsigned int p_max_size) {
delete[] buf; delete[] buf;
} }
void print_cap(struct text_object *obj, char *p, unsigned int p_max_size) { void print_startcase(struct text_object *obj, char *p, unsigned int p_max_size) {
unsigned int x = 0; unsigned int x = 0;
int z = 0; int z = 0;
char buf[DEFAULT_TEXT_BUFFER_SIZE]; char buf[DEFAULT_TEXT_BUFFER_SIZE];
@ -108,7 +108,7 @@ void print_cap(struct text_object *obj, char *p, unsigned int p_max_size) {
snprintf(p, p_max_size, "%s", buf); snprintf(p, p_max_size, "%s", buf);
} }
void print_lower(struct text_object *obj, char *p, unsigned int p_max_size) { void print_lowercase(struct text_object *obj, char *p, unsigned int p_max_size) {
evaluate(obj->data.s, p, p_max_size); evaluate(obj->data.s, p, p_max_size);
for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) { for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) {
p[x] = tolower(p[x]); p[x] = tolower(p[x]);
@ -116,7 +116,7 @@ void print_lower(struct text_object *obj, char *p, unsigned int p_max_size) {
p[p_max_size - 1] = '\0'; p[p_max_size - 1] = '\0';
} }
void print_upper(struct text_object *obj, char *p, unsigned int p_max_size) { void print_uppercase(struct text_object *obj, char *p, unsigned int p_max_size) {
evaluate(obj->data.s, p, p_max_size); evaluate(obj->data.s, p, p_max_size);
for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) { for (unsigned int x = 0; x < p_max_size - 1 && p[x]; x++) {
p[x] = toupper(p[x]); p[x] = toupper(p[x]);

View File

@ -35,8 +35,8 @@
void print_cat(struct text_object *, char *, unsigned int); void print_cat(struct text_object *, char *, unsigned int);
void print_catp(struct text_object *, char *, unsigned int); void print_catp(struct text_object *, char *, unsigned int);
void print_cap(struct text_object *, char *, unsigned int); void print_startcase(struct text_object *, char *, unsigned int);
void print_lower(struct text_object *, char *, unsigned int); void print_lowercase(struct text_object *, char *, unsigned int);
void print_upper(struct text_object *, char *, unsigned int); void print_uppercase(struct text_object *, char *, unsigned int);
long long apply_base_multiplier(const char *, long long int); long long apply_base_multiplier(const char *, long long int);
#endif /* _MISC_H */ #endif /* _MISC_H */