kolibri-libc:

[include]
 - ksys.h : fixed sruct name
 - string.h: set memcpy, memset, and memove as static for libtcc
 - stdio.h: added sscanf and ungetc
 - stdint.h: added int64 limits
[stdio]
fixed *scanf functions
added ungetc functon
[lib]
 - upated binaries
 - added libtcc.a for tcc optimization
[crt]
 - removed duplicate files
[samples]
 - added fasm libc.obj example
 - updated old examples 




git-svn-id: svn://kolibrios.org@8718 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2021-05-09 22:12:43 +00:00
parent 611fac2831
commit 1c24cac315
33 changed files with 1154 additions and 1723 deletions

View File

@@ -23,6 +23,10 @@
#define INT64_MIN (-9223372036854775807LL-1LL)
#define INT64_MAX (9223372036854775807LL)
#define UINT64_MAX (18446744073709551615ULL)
#else
#define INT64_MAX 0x7fffffffffffffffLL
#define INT64_MIN (-INT64_MAX - 1LL)
#define UINT64_MAX (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL)
#endif
#endif /* _STDINT_H_*/

View File

@@ -107,11 +107,12 @@ extern int _FUNC(putchar)(int);
extern int _FUNC(puts)(const char *);
extern int _FUNC(scanf)(const char *restrict, ...);
extern char* _FUNC(gets)(char *str);
//extern int _FUNC(ungetc)(int, FILE *);
extern int _FUNC(ungetc)(int, FILE *);
extern int _FUNC(vfprintf)(FILE *restrict, const char *restrict, va_list);
extern int _FUNC(vfscanf)(FILE *restrict, const char *restrict, va_list);
extern int _FUNC(vprintf)(const char *restrict, va_list);
extern int _FUNC(vscanf)(const char *restrict, va_list);
extern int _FUNC(sscanf)(const char*, const char *restrict, ...);
extern int _FUNC(vsscanf)(const char *, const char*, va_list);
extern int _FUNC(remove)(const char *);

View File

@@ -29,13 +29,16 @@ extern void* _FUNC(memccpy)(void *restrict dest, const void *restrict src, int c
area pointed to by s1. If the two areas overlap, behaviour is undefined.
Returns the value of s1.
*/
extern void* _FUNC(memcpy)(void* s1, const void* s2, size_t n);
/* Copy a number of n characters from the memory area pointed to by s2 to the
area pointed to by s1. The two areas may overlap.
Returns the value of s1.
*/
#ifdef __TINYC__
extern void* memcpy(void* s1, const void* s2, size_t n);
extern void* memset(void* s, int c, size_t n);
extern void* memmove(void* s1, const void* s2, size_t n);
#else
extern void* _FUNC(memcpy)(void* s1, const void* s2, size_t n);
extern void* _FUNC(memset)(void* s, int c, size_t n);
extern void* _FUNC(memmove)(void* s1, const void* s2, size_t n);
#endif
/* Copy the character array s2 (including terminating '\0' byte) into the
character array s1.
@@ -160,14 +163,6 @@ extern char* _FUNC(strstr)(const char * s1, const char * s2);
*/
extern char* _FUNC(strtok)(char* s1, const char* s2);
/* Miscellaneous functions */
/* Write the character c (interpreted as unsigned char) to the first n
characters of the memory area pointed to by s.
Returns s.
*/
extern void* _FUNC(memset)(void* s, int c, size_t n);
/* Map an error number to a (locale-specific) error message string. Error
numbers are typically errno values, but any number is mapped to a message.
TODO: PDCLib does not yet support locales.

View File

@@ -152,7 +152,7 @@ typedef struct{
unsigned in_data_size;
void* out_data_ptr;
unsigned out_data_size;
}ksys_drv_ctl_t;
}ksys_ioctl_t;
#pragma pack(pop)
@@ -1028,7 +1028,7 @@ ksys_drv_hand_t _ksys_load_pe_driver(char *driver_path, char *cmd_line)
}
static inline
unsigned _ksys_work_driver(ksys_drv_ctl_t *ioctl)
unsigned _ksys_work_driver(ksys_ioctl_t *ioctl)
{
unsigned status;
asm_inline(