Fold conv package into fmt

Both packages had nearly identical dependency requirements, so merging
them should help reduce the complexity of the build graph.
This commit is contained in:
Justine Tunney 2020-12-09 15:04:54 -08:00
parent 978b7858f9
commit 1fc91f3580
203 changed files with 352 additions and 563 deletions

View file

@ -1,55 +0,0 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/itoa.h"
#include "libc/runtime/runtime.h"
/**
* Debugs super low-level stuff, e.g.
*
* void GOT_HERE(int);
* INITIALIZER(100, _init_got_here_100, GOT_HERE(100));
* INITIALIZER(200, _init_got_here_200, GOT_HERE(200));
* INITIALIZER(300, _init_got_here_300, GOT_HERE(300));
* INITIALIZER(400, _init_got_here_400, GOT_HERE(400));
* INITIALIZER(500, _init_got_here_500, GOT_HERE(500));
* INITIALIZER(600, _init_got_here_600, GOT_HERE(600));
* INITIALIZER(700, _init_got_here_700, GOT_HERE(700));
* INITIALIZER(800, _init_got_here_800, GOT_HERE(800));
*
*/
privileged interruptfn void GOT_HERE(long num) {
size_t len;
char msg[48];
len = 0;
msg[len++] = 'g';
msg[len++] = 'o';
msg[len++] = 't';
msg[len++] = ' ';
msg[len++] = 'h';
msg[len++] = 'e';
msg[len++] = 'r';
msg[len++] = 'e';
msg[len++] = ' ';
len += int64toarray_radix10(num, &msg[len]);
msg[len++] = '\r';
msg[len++] = '\n';
msg[len] = '\0';
__print(msg, len);
}

View file

@ -20,7 +20,7 @@
#include "libc/assert.h"
#include "libc/bits/bits.h"
#include "libc/bits/weaken.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"

View file

@ -28,11 +28,17 @@ program_invocation_short_name:
.previous
.init.start 400,_init_program_invocation_short_name
push %rdi
push %rsi
mov (%r13),%rdi
call basename
mov (%r13),%rsi
mov %rsi,%rcx
1: lodsb
cmp $'/,%al
cmoveq %rsi,%rcx
cmp $'\\,%al
cmoveq %rsi,%rcx
test %al,%al
jnz 1b
xchg %rcx,%rax
pop %rsi
pop %rdi
stosq
.init.end 400,_init_program_invocation_short_name

View file

@ -34,15 +34,11 @@ LIBC_RUNTIME_A_CHECKS = \
$(LIBC_RUNTIME_A_HDRS:%=o/$(MODE)/%.ok)
LIBC_RUNTIME_A_DIRECTDEPS = \
LIBC_BITS \
LIBC_CALLS \
LIBC_CONV \
LIBC_TINYMATH \
LIBC_ELF \
LIBC_FMT \
LIBC_NEXGEN32E \
LIBC_NT_KERNELBASE \
LIBC_RAND \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \