Создание библиотеки модулей

This commit is contained in:
Aren 2023-11-17 21:09:26 +03:00
parent 8a32d4070e
commit 25b77bb8bb
2 changed files with 40 additions and 0 deletions

18
modlib/lib/modstd.c Normal file
View File

@ -0,0 +1,18 @@
/**
* modstd.c
* Стандартная библиотека модулей
*
* Вспомогательные функции для работы с модулями
*
*/
#include <modstd.h>
int m_strcmp(const char *s1, const char *s2) {
while (*s1 == *s2) {
if (*s1 == '\0') { return 0; }
s1++;
s2++;
}
return *s1 - *s2;
}

22
modlib/modstd.h Normal file
View File

@ -0,0 +1,22 @@
/**
* modstd.h
* Стандартная библиотека для модулей
*
* Заголовочный файл содержащий определения стандартной библиотеки модулей
*
*/
#ifndef MODSTD_H
#define MODSTD_H
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
#endif // modstd.h