mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
96 lines
1.5 KiB
JavaScript
96 lines
1.5 KiB
JavaScript
clite.libs.data = function() {
|
|
|
|
clite.libs.load('libio','stdio',function(io,env) {
|
|
|
|
return Object.create({
|
|
|
|
types:clite.io.types,
|
|
|
|
creat:function(path,type) {
|
|
return clite.io.creat(path,type);
|
|
},
|
|
|
|
open:function(path,cb,open_link) {
|
|
return clite.io.open(path,cb,open_link);
|
|
},
|
|
|
|
close:function(fd) {
|
|
return clite.io.close(fd);
|
|
},
|
|
|
|
read:function(fd,cb) {
|
|
return clite.io.read(fd,cb);
|
|
},
|
|
|
|
readLine:function(fd,cb) {
|
|
return clite.io.readLine(fd,cb);
|
|
},
|
|
|
|
readAll:function(fd) {
|
|
return clite.io.readAll(fd);
|
|
},
|
|
|
|
write:function(fd,data) {
|
|
return clite.io.write(fd,data);
|
|
},
|
|
|
|
ftruncate:function(fd,len) {
|
|
return clite.io.ftruncate(fd,len);
|
|
},
|
|
|
|
truncate:function(path,len) {
|
|
return clite.io.truncate(path,len);
|
|
},
|
|
|
|
seek:function(fd,pos) {
|
|
return clite.io.seek(fd,pos);
|
|
},
|
|
|
|
remove:function(path) {
|
|
return clite.io.remove(path);
|
|
},
|
|
|
|
link:function(path,target) {
|
|
return clite.io.link(path,target);
|
|
},
|
|
|
|
stat:function(path) {
|
|
return clite.io.stat(path);
|
|
},
|
|
|
|
fstat:function(fd) {
|
|
return clite.io.fstat(fd);
|
|
},
|
|
|
|
chmod:function(path,mode) {
|
|
return clite.io.chmod(path,mode);
|
|
},
|
|
|
|
fchmod:function(fd,mode) {
|
|
return clite.io.fchmod(fd,mode);
|
|
},
|
|
|
|
isatty:function(fd) {
|
|
return clite.io.isatty(fd);
|
|
},
|
|
|
|
vfprintf:function(fd,fmt,args) {
|
|
return clite.io.vfprintf(fd,fmt,args);
|
|
},
|
|
|
|
fprintf:function(fd,fmt) {
|
|
var args = [];
|
|
return clite.io.vfprintf(fd,fmt,args);
|
|
},
|
|
|
|
printf:function(fmt) {
|
|
var args = [];
|
|
return clite.io.vfprintf(io.stdout,fmt,args);
|
|
}
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|