From 17bfb0ef0a48330b1d54e61fe3c30d83528d2d90 Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Wed, 25 Jan 2023 20:16:22 +0100
Subject: style: typedef structs, shorter namespaces

I've wanted to do this for a while, and since I've just had a relatively
large refactor commit (pcpy), this is as good of a time as any.

Typedefing structs was mostly inspired by Plan 9's coding style. It makes
some lines of code much shorter at basically no expense.
Everything related to userland kept old-style struct definitions, so as not
to force that style onto other people.

I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase,
but I didn't, just in case that'd be confusing.
---
 src/user/app/shell/builtins.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/user/app/shell/builtins.c')

diff --git a/src/user/app/shell/builtins.c b/src/user/app/shell/builtins.c
index 870a6af..e0f848e 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/user/app/shell/builtins.c
@@ -58,13 +58,13 @@ static void cmd_echo(int argc, char **argv) {
 void cmd_getsize(int argc, char **argv) {
 	if (argc < 2) errx(1, "no arguments");
 	for (int i = 1; i < argc; i++) {
-		handle_t h = camellia_open(argv[i], OPEN_READ);
+		hid_t h = camellia_open(argv[i], OPEN_READ);
 		if (h < 0) {
 			warn("error opening %s", argv[i]);
 			continue;
 		}
-		printf("%s: %d\n", argv[i], (int)_syscall_getsize(h));
-		_syscall_close(h);
+		printf("%s: %d\n", argv[i], (int)_sys_getsize(h));
+		_sys_close(h);
 	}
 }
 
@@ -205,7 +205,7 @@ static void cmd_rm(int argc, char **argv) {
 
 static void cmd_sleep(int argc, char **argv) {
 	if (argc < 2) errx(1, "no arguments");
-	_syscall_sleep(strtol(argv[1], NULL, 0) * 1000);
+	_sys_sleep(strtol(argv[1], NULL, 0) * 1000);
 }
 
 static void cmd_touch(int argc, char **argv) {
-- 
cgit v1.2.3