chore: format internal header files

pull/7/head
Jef Roosens 2023-02-02 16:14:26 +01:00 committed by Chewing_Bever
parent 53eb5c1784
commit 8668148e96
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
4 changed files with 38 additions and 14 deletions

5
.editorconfig 100644
View File

@ -0,0 +1,5 @@
root = true
[*.{c,h}]
indent_style = space
indent_size = 2

View File

@ -11,7 +11,8 @@ INC_DIRS ?= include
LIB := $(BUILD_DIR)/$(LIB_FILENAME)
SRCS != find '$(SRC_DIR)' -iname '*.c'
SRCS_H != find $(INC_DIRS) '$(SRC_DIR)' -iname '*.h'
SRCS_H != find $(INC_DIRS) -iname '*.h'
SRCS_H_INTERNAL != find $(SRC_DIR) -iname '*.h'
SRCS_TEST != find '$(TEST_DIR)' -iname '*.c'
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
@ -86,11 +87,11 @@ $(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c
# =====MAINTENANCE=====
.PHONY: lint
lint:
clang-format -n --Werror $(SRCS) $(SRCS_H)
clang-format -n --Werror $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL)
.PHONY: fmt
fmt:
clang-format -i $(SRCS) $(SRCS_H)
clang-format -i $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL)
.PHONY: clean
clean:

View File

@ -1,9 +1,9 @@
#ifndef VIETER_JOB_QUEUE
#define VIETER_JOB_QUEUE
#include <stdint.h>
#include <stdbool.h>
#include "vieter_cron.h"
#include <stdbool.h>
#include <stdint.h>
/*
* The order of these do not imply that they happen in this order. New states
@ -12,21 +12,29 @@
* other things.
*/
typedef enum vieter_job_state {
vieter_job_queued = 0,
vieter_job_dispatched = 1,
vieter_job_finished = 2
vieter_job_state_queued = 0,
vieter_job_state_ready = 1,
vieter_job_state_build_finished = 2
} vieter_job_state;
// This macro should be kept in sync with the above enum
#define VIETER_JOB_STATES 3
typedef struct vieter_job {
int id;
uint64_t next_scheduled_time;
vieter_cron_expression *ce;
bool single;
vieter_job_state state;
uint64_t state_transition_times[VIETER_JOB_STATES];
int id;
uint64_t next_scheduled_time;
vieter_cron_expression *ce;
bool single;
vieter_job_state state;
uint64_t state_transition_times[VIETER_JOB_STATES];
bool dispatched;
void *build_config;
} vieter_job;
typedef struct vieter_job_queue vieter_job_queue;
vieter_job_queue *vieter_job_queue_init();
void vieter_job_queue_insert(int id);
#endif

View File

@ -0,0 +1,10 @@
#ifndef VIETER_JOB_QUEUE_INTERNAL
#define VIETER_JOB_QUEUE_INTERNAL
#include "vieter_tree.h"
struct vieter_job_queue {
vieter_tree *tree;
};
#endif