Skip to content

Commit

Permalink
move all c stdlib files to c-stdlib directory
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Sep 7, 2023
1 parent 48069fd commit c41aec1
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lualib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix

LUA_A= liblua.a
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o lstrlib.o ltablib.o lutf8lib.o linit.o mocked_stdio.o mocked_math.o stdlib.o
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o lstrlib.o ltablib.o lutf8lib.o linit.o stdlib.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)

LUA_T= lua
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions lualib/mocked_stdio.h → lualib/c-stdlib/mocked_stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdint.h>

#include "../include/ckb_cell_fs.h"
#include "../../include/ckb_cell_fs.h"

#define BUFSIZ 512
#define EOF (-1)
Expand Down Expand Up @@ -53,15 +53,11 @@ int sprintf(char *__s, const char *__format, ...);

int vfprintf(FILE *__s, const char *__format, ...);

int vprintf(const char *__format, ...);

int vsprintf(char *__s, const char *__format, ...);

int snprintf(char *__s, size_t __maxlen, const char *__format, ...);
int snprintf_(char *__s, size_t __maxlen, const char *__format, ...);

int vsnprintf(char *__s, size_t __maxlen, const char *__format, ...);

int fscanf(FILE *__stream, const char *__format, ...);

int scanf(const char *__format, ...);
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions lualib/c-stdlib/src/impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include "printf_impl.h"
#include "malloc_impl.h"
#include "mocked_stdio.c"
#include "mocked_math.c"

#define CKB_SS (sizeof(size_t))
#define CKB_ALIGN (sizeof(size_t) - 1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lualib/mocked_math.c → lualib/c-stdlib/src/mocked_math.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "mocked_math.h"
#include "../mocked_math.h"
#include <stdint.h>

#include "math_pow.c"
Expand Down
12 changes: 1 addition & 11 deletions lualib/mocked_stdio.c → lualib/c-stdlib/src/mocked_stdio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

#include "mocked_stdio.h"
#include "../mocked_stdio.h"

#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -151,19 +150,10 @@ int fprintf(FILE *__stream, const char *__format, ...) {
return 0;
}

int sprintf(char *__s, const char *__format, ...) {
NOT_IMPL(sprintf);
return 0;
}

int vfprintf(FILE *__s, const char *__format, ...) {
NOT_IMPL(vfprintf);
return 0;
}
int vprintf(const char *__format, ...) {
NOT_IMPL(vprintf);
return 0;
}
int vsprintf(char *__s, const char *__format, ...) {
NOT_IMPL(vsprintf);
return 0;
Expand Down

0 comments on commit c41aec1

Please sign in to comment.