diff --git a/spinner.h b/spinner.h index 5f2be9e..3914ab7 100644 --- a/spinner.h +++ b/spinner.h @@ -29,6 +29,7 @@ #define _SPINNER_H #include +#include #include /* @@ -42,73 +43,83 @@ /* * char_sets is the collection of spinners. */ -extern char *char_sets[][MAX_CHARS]; +extern char* char_sets[][MAX_CHARS]; /* * spinner_t maintains the state of the spinner * and allows for control. */ -typedef struct { - uint8_t char_set_id; - uint64_t delay; - pthread_mutex_t mu; - FILE *output_dst; - char *prefix; - char *suffix; - char *final_msg; - char *last_output; - int active; - int reversed; +typedef struct +{ + uint8_t char_set_id; + uint64_t delay; + pthread_mutex_t mu; + FILE* output_dst; + char* prefix; + char* suffix; + char* final_msg; + char* last_output; + int active; + int reversed; } spinner_t; /* * spinner_new creates a new pointer to a spinner_t * struct and sets sane defaults for immediate use. */ -spinner_t *spinner_new(int id); +spinner_t* +spinner_new(int id); /* - * spinner_free frees the used memory of the + * spinner_free frees the used memory of the * spinner_t pointer. */ -void spinner_free(spinner_t *s); +void +spinner_free(spinner_t* s); /* * spinner_start starts the spinner. */ -void spinner_start(spinner_t *s); +void +spinner_start(spinner_t* s); /* * spinner_stop stops the spinner. */ -void spinner_stop(spinner_t *s); +void +spinner_stop(spinner_t* s); /* * spinner_restart will restart the spinner. */ -void spinner_restart(spinner_t *s); +void +spinner_restart(spinner_t* s); /* * spinner_char_set_update updates the character * set with the new given one. */ -void spinner_char_set_update(spinner_t *s, const int id); +void +spinner_char_set_update(spinner_t* s, const int id); /* * spinner_update_speed updates the speed at which * the spinner is spinning. */ -void spinner_update_speed(spinner_t *s, const uint64_t delay); +void +spinner_update_speed(spinner_t* s, const uint64_t delay); /* - * spinner_set_output_dest sets the file descriptor to + * spinner_set_output_dest sets the file descriptor to * write spinner output to. */ -void spinner_set_output_dest(spinner_t *s, FILE *fd); +void +spinner_set_output_dest(spinner_t* s, FILE* fd); /* * spinner_reverse reverses the direction of the spinner. */ -void spinner_reverse(spinner_t *s); +void +spinner_reverse(spinner_t* s); #endif diff --git a/tests/tests.c b/tests/tests.c index 7f2ccb1..315af33 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -1,4 +1,3 @@ -#include #include #include #include