1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2024-12-11 21:13:00 +01:00

feat: add types.h

This commit is contained in:
Théo LUDWIG 2023-06-25 15:07:34 +02:00
parent 1ded37b106
commit a0140a6716
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
13 changed files with 26 additions and 5 deletions

View File

@ -4,6 +4,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h"
#define ARRAY_LIST_INITIAL_CAPACITY 10 #define ARRAY_LIST_INITIAL_CAPACITY 10
/** /**

View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "string.h" #include "string.h"
#include "types.h"
/** /**
* @brief Append a character to a string, assuming string points to an array * @brief Append a character to a string, assuming string points to an array

View File

@ -8,6 +8,7 @@
#include "mathematics.h" #include "mathematics.h"
#include "stdbool.h" #include "stdbool.h"
#include "string.h" #include "string.h"
#include "types.h"
/** /**
* @brief Convert a character to a string. * @brief Convert a character to a string.

View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "string.h" #include "string.h"
#include "types.h"
#define DICTIONARY_INITIAL_CAPACITY 10 #define DICTIONARY_INITIAL_CAPACITY 10

View File

@ -6,14 +6,12 @@
#include <fcntl.h> #include <fcntl.h>
#include <pwd.h> #include <pwd.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "string.h" #include "string.h"
#include "types.h"
typedef uint8_t byte_t;
/** /**
* @brief Read the content of a file. * @brief Read the content of a file.

View File

@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "stack.h" #include "stack.h"
#include "types.h"
/** /**
* @brief Linked list data structure. * @brief Linked list data structure.

View File

@ -5,6 +5,8 @@
#include <stdbool.h> #include <stdbool.h>
#include "types.h"
/** /**
* @brief Verify that 2 numbers are equal. * @brief Verify that 2 numbers are equal.
* *

View File

@ -4,6 +4,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h"
/** /**
* @brief Queue structure => FIFO (First In First Out). * @brief Queue structure => FIFO (First In First Out).
* @since v1.0.0 * @since v1.0.0

View File

@ -4,6 +4,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "types.h"
/** /**
* @brief Stack structure => LIFO (Last In First Out). * @brief Stack structure => LIFO (Last In First Out).
* @since v1.0.0 * @since v1.0.0

View File

@ -8,8 +8,7 @@
#include "character.h" #include "character.h"
#include "convert.h" #include "convert.h"
#include "dictionary.h" #include "dictionary.h"
#include "types.h"
typedef char* string_t;
/** /**
* @brief Return the length of a string (excluding '\0'). * @brief Return the length of a string (excluding '\0').

View File

@ -11,6 +11,7 @@
#include "linked_list.h" #include "linked_list.h"
#include "queue.h" #include "queue.h"
#include "stack.h" #include "stack.h"
#include "types.h"
/** /**
* @brief Read a line from stdin. * @brief Read a line from stdin.

10
lib/types.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef __TYPES__
#define __TYPES__
#include <stdint.h>
typedef uint8_t byte_t;
typedef char* string_t;
#endif

View File

@ -12,6 +12,7 @@
#include "lib/stack.h" #include "lib/stack.h"
#include "lib/string.h" #include "lib/string.h"
#include "lib/terminal.h" #include "lib/terminal.h"
#include "lib/types.h"
#include "version.h" #include "version.h"
#endif #endif