lint: apply new style

This commit is contained in:
2025-06-06 20:46:55 +02:00
parent d6a348c543
commit 7d76687833
19 changed files with 259 additions and 273 deletions

View File

@@ -6,7 +6,10 @@
#include "config.h"
#include "sessions.h"
bool launch(char *user, char *passwd, struct session session, void (*cb)(void),
struct behavior *behavior);
bool launch(char* user,
char* passwd,
struct session session,
void (*cb)(void),
struct behavior* behavior);
#endif

View File

@@ -20,6 +20,6 @@ int chvt(int n);
* @param str virtual terminal number (string)
* @return int non-negative value on success
*/
int chvt_str(char *str);
int chvt_str(char* str);
#endif

View File

@@ -10,32 +10,32 @@
// should be ansi escape codes under \x1b[...m
// if not prepared accordingly, it might break
struct theme_colors {
char *bg;
char *fg;
char *err;
char *s_wayland;
char *s_xorg;
char *s_shell;
char *e_hostname;
char *e_date;
char *e_box;
char *e_header;
char *e_user;
char *e_passwd;
char *e_badpasswd;
char *e_key;
char* bg;
char* fg;
char* err;
char* s_wayland;
char* s_xorg;
char* s_shell;
char* e_hostname;
char* e_date;
char* e_box;
char* e_header;
char* e_user;
char* e_passwd;
char* e_badpasswd;
char* e_key;
};
// even if they're multiple bytes long
// they should only take up 1 char size on display
struct theme_chars {
char *hb;
char *vb;
char* hb;
char* vb;
char *ctl;
char *ctr;
char *cbl;
char *cbr;
char* ctl;
char* ctr;
char* cbl;
char* cbr;
};
struct theme {
@@ -50,14 +50,14 @@ struct functions {
};
struct strings {
char *f_poweroff;
char *f_reboot;
char *f_refresh;
char *e_user;
char *e_passwd;
char *s_wayland;
char *s_xorg;
char *s_shell;
char* f_poweroff;
char* f_reboot;
char* f_refresh;
char* e_user;
char* e_passwd;
char* s_wayland;
char* s_xorg;
char* s_shell;
};
struct behavior {
@@ -74,9 +74,10 @@ struct config {
};
bool line_parser(
FILE *fd, ssize_t *blksize,
u_char (*cb)(char *key,
char *value)); // might use this for parsing .desktop files too
struct config *parse_config(char *path);
FILE* fd,
ssize_t* blksize,
u_char (*cb)(char* key,
char* value)); // might use this for parsing .desktop files too
struct config* parse_config(char* path);
#endif

View File

@@ -10,9 +10,9 @@ struct editable_field {
char content[255];
};
struct editable_field field_new(char *);
void field_trim(struct editable_field *, u_char);
void field_update(struct editable_field *, char *);
bool field_seek(struct editable_field *, char);
struct editable_field field_new(char*);
void field_trim(struct editable_field*, u_char);
void field_update(struct editable_field*, char*);
bool field_seek(struct editable_field*, char);
#endif

View File

@@ -34,7 +34,7 @@ enum keys {
PAGE_DOWN,
};
static const char *const key_names[] = {
static const char* const key_names[] = {
[ESC] = "ESC",
[F1] = "F1",
[F2] = "F2",
@@ -67,7 +67,7 @@ static const char *const key_names[] = {
struct key_mapping {
enum keys key;
const char *sequences[3];
const char* sequences[3];
};
static const struct key_mapping key_mappings[] = {

View File

@@ -12,9 +12,9 @@ enum session_type {
};
struct session {
char *name;
char *exec;
char *tryexec;
char* name;
char* exec;
char* tryexec;
enum session_type type;
};

View File

@@ -5,8 +5,8 @@
#include "util.h"
void setup(struct config);
int load(struct Vector *users, struct Vector *sessions);
void print_err(const char *);
void print_errno(const char *);
int load(struct Vector* users, struct Vector* sessions);
void print_err(const char*);
void print_errno(const char*);
#endif

View File

@@ -6,9 +6,9 @@
#include "util.h"
struct user {
char *shell;
char *username;
char *display_name;
char* shell;
char* username;
char* display_name;
};
struct Vector get_human_users();

View File

@@ -8,26 +8,26 @@
#include "keys.h"
enum keys find_keyname(char *);
enum keys find_ansi(char *);
void read_press(u_char *, char *);
void strcln(char **dest, const char *source);
enum keys find_keyname(char*);
enum keys find_ansi(char*);
void read_press(u_char*, char*);
void strcln(char** dest, const char* source);
struct Vector {
uint32_t length;
uint32_t capacity;
void **pages;
void** pages;
};
struct Vector vec_new();
int vec_resize(struct Vector *, size_t size);
int vec_reserve(struct Vector *, size_t size);
int vec_reserve_exact(struct Vector *, size_t size);
int vec_push(struct Vector *, void *item);
void vec_free(struct Vector *);
void vec_clear(struct Vector *);
void vec_reset(struct Vector *);
void *vec_pop(struct Vector *); // won't free it, nor shrink vec list space
void *vec_get(struct Vector *, size_t index);
int vec_resize(struct Vector*, size_t size);
int vec_reserve(struct Vector*, size_t size);
int vec_reserve_exact(struct Vector*, size_t size);
int vec_push(struct Vector*, void* item);
void vec_free(struct Vector*);
void vec_clear(struct Vector*);
void vec_reset(struct Vector*);
void* vec_pop(struct Vector*); // won't free it, nor shrink vec list space
void* vec_get(struct Vector*, size_t index);
#endif