use clang-format to format code

This commit is contained in:
Rongsong Shen 2025-11-25 14:58:09 +08:00
parent 2bad284582
commit de090dce35
58 changed files with 8745 additions and 7237 deletions

View file

@ -2,13 +2,13 @@
#define XCECD_CONF_H
#include <cyaml/cyaml.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdint.h>
#define DEFAULT_CONFIG_PATH "/opt/xce/conf/worker.yaml"
#define MAX_HOSTNAME_LEN 256
#define MAX_PATH_LEN 512
#define MAX_LOG_LEVEL_LEN 16
#define MAX_HOSTNAME_LEN 256
#define MAX_PATH_LEN 512
#define MAX_LOG_LEVEL_LEN 16
typedef enum {
CONFIG_SUCCESS = 0,
@ -20,28 +20,28 @@ typedef enum {
} config_error_t;
typedef struct {
char *hostname;
char* hostname;
} management_host_t;
typedef struct {
management_host_t *management_list;
uint32_t management_list_count;
uint16_t controller_port;
char *log_level;
char *log_dir;
management_host_t* management_list;
uint32_t management_list_count;
uint16_t controller_port;
char* log_level;
char* log_dir;
} worker_config_t;
typedef struct {
config_error_t error_code;
char error_message[512];
worker_config_t *config;
config_error_t error_code;
char error_message[512];
worker_config_t* config;
} config_result_t;
config_result_t* config_load(const char *config_path);
config_result_t* config_load(const char* config_path);
config_result_t* config_load_default(void);
void config_free(config_result_t *result);
const char* config_error_string(config_error_t error);
void config_print(const worker_config_t *config);
int level_to_int(const char *level);
void config_free(config_result_t* result);
const char* config_error_string(config_error_t error);
void config_print(const worker_config_t* config);
int level_to_int(const char* level);
#endif // XCECD_CONF_H