From d9835c1ecffabddbb4dd51648fabbe2a5774414f Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 26 Dec 2019 09:55:34 +0300 Subject: [PATCH] move atofq.v to a separate module --- vlib/builtin/builtin.v | 24 ++++++++++++++++++++++++ vlib/strconv/{ => atofq}/atofq.v | 0 2 files changed, 24 insertions(+) rename vlib/strconv/{ => atofq}/atofq.v (100%) diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index efe067491d..789dc2f2a4 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -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) +} +*/ + + diff --git a/vlib/strconv/atofq.v b/vlib/strconv/atofq/atofq.v similarity index 100% rename from vlib/strconv/atofq.v rename to vlib/strconv/atofq/atofq.v