chore: format internal header files
parent
53eb5c1784
commit
8668148e96
|
@ -0,0 +1,5 @@
|
|||
root = true
|
||||
|
||||
[*.{c,h}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
7
Makefile
7
Makefile
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue