move atofq.v to a separate module

pull/3222/head
Alexander Medvednikov 2019-12-26 09:55:34 +03:00
parent 8d9f89e728
commit d9835c1ecf
2 changed files with 24 additions and 0 deletions

View File

@ -172,3 +172,27 @@ pub fn is_atty(fd int) int {
}
}
/*
fn C.va_start()
fn C.va_end()
fn C.vsnprintf() int
fn C.vsprintf() int
pub fn str2_(fmt charptr, ...) string {
argptr := C.va_list{}
C.va_start(argptr, fmt)
len := C.vsnprintf(0, 0, fmt, argptr) + 1
C.va_end(argptr)
buf := malloc(len)
C.va_start(argptr, fmt)
C.vsprintf(charptr(buf), fmt, argptr)
C.va_end(argptr)
//#ifdef DEBUG_ALLOC
// puts("_STR:");
// puts(buf);
//#endif
return tos2(buf)
}
*/