Format headers as well.

indent(1) does a weird thing with prototype functions, but it's good
enough for me, as long as it's consistent.
This commit is contained in:
Jordan Bancino 2022-07-25 15:25:06 -04:00
parent aabb2a0203
commit 3437c5db2c
9 changed files with 94 additions and 86 deletions

View file

@ -74,7 +74,7 @@ recipe_clean() {
}
recipe_format() {
find src -name '*.c' | while IFS= read -r src; do
find src -name '*.c' -or -name '*.h' | while IFS= read -r src; do
echo "indent $src"
indent -bad -bap -bbb -nbc -bl -c36 -cd36 -ncdb -nce \
-ci8 -cli1 -d0 -di1 -ndj -ei -fc1 -i4 -ip -l72 \

View file

@ -22,4 +22,3 @@ extern int
Base64Pad(char **base64Ptr, size_t length);
#endif

View file

@ -1,7 +1,8 @@
#ifndef TELODENDRIA_HTTP_H
#define TELODENDRIA_HTTP_H
typedef enum HttpRequestMethod {
typedef enum HttpRequestMethod
{
HTTP_GET,
HTTP_HEAD,
HTTP_POST,
@ -13,7 +14,8 @@ typedef enum HttpRequestMethod {
HTTP_PATCH
} HttpRequestMethod;
typedef enum HttpStatus {
typedef enum HttpStatus
{
/* Informational responses */
HTTP_CONTINUE = 100,
HTTP_SWITCHING_PROTOCOLS = 101,
@ -74,11 +76,13 @@ typedef enum HttpStatus {
HTTP_NETWORK_AUTH_REQUIRED = 511
} HttpStatus;
struct HttpRequest {
struct HttpRequest
{
HttpRequestMethod method;
};
struct HttpResponse {
struct HttpResponse
{
HttpStatus status;
};

View file

@ -4,7 +4,8 @@
#include <HashMap.h>
#include <Array.h>
typedef enum JsonType {
typedef enum JsonType
{
JSON_OBJECT,
JSON_ARRAY,
JSON_STRING,
@ -14,9 +15,11 @@ typedef enum JsonType {
JSON_NULL
} JsonType;
typedef struct JsonValue {
typedef struct JsonValue
{
JsonType type;
union as {
union as
{
HashMap *object;
Array *array;
char *string;

View file

@ -4,7 +4,8 @@
#include <stdio.h>
#include <stddef.h>
typedef enum LogLevel {
typedef enum LogLevel
{
LOG_ERROR,
LOG_WARNING,
LOG_TASK,
@ -12,7 +13,8 @@ typedef enum LogLevel {
LOG_DEBUG
} LogLevel;
typedef enum LogFlag {
typedef enum LogFlag
{
LOG_FLAG_COLOR = (1 << 0)
} LogFlag;