diff options
author | Benji Dial <benji6283@gmail.com> | 2021-01-24 12:00:11 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-01-24 12:00:11 -0500 |
commit | bce944d1498eaa3b6940ee234c863b3548a66b37 (patch) | |
tree | ea40c087ab4f0f236aee8d158cf68550f5209f72 /src/user/highway/vars.c | |
parent | ca731aa747214919df7b3dfe3478dbe787ce5b68 (diff) | |
download | portland-os-bce944d1498eaa3b6940ee234c863b3548a66b37.tar.gz |
graphics!
Diffstat (limited to 'src/user/highway/vars.c')
-rw-r--r-- | src/user/highway/vars.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/user/highway/vars.c b/src/user/highway/vars.c index 6090b76..5f56621 100644 --- a/src/user/highway/vars.c +++ b/src/user/highway/vars.c @@ -1,6 +1,10 @@ +#include <terminal/terminal.h> + +#include <knob/format.h> #include <knob/block.h> #include <knob/heap.h> -#include <knob/user.h> + +#include <pland/pcrt.h> struct no_null_sn { char *data; @@ -73,26 +77,6 @@ void del_var(struct no_null_sn name) { void dump_vars() { for (struct var_dict_node *node = var_dict_start; node; node = node->next) { - tell_user_sz("$"); - - char *buf = get_block(node->name.length + 1); - blockcpy(buf, node->name.data, node->name.length); - buf[node->name.length] = '\0'; - - tell_user_sz(buf); - - free_block(buf); - - tell_user_sz("$ = "); - - buf = get_block(node->value.length + 1); - blockcpy(buf, node->value.data, node->value.length); - buf[node->value.length] = '\0'; - - tell_user_sz(buf); - - free_block(buf); - - tell_user_sz("\n"); + term_addf_no_ww("$%ns$ = %ns\n", node->name.length, node->name.data, node->value.length, node->value.data); } }
\ No newline at end of file |