diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-19 02:35:23 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-19 02:35:23 (EST) |
commit | a9f84d9757aad50db3f1d7e11c6e779b920ed96b (patch) | |
tree | 103d2da4d0ed2698e2728dade5f225ccb11730d0 /libsh | |
parent | 5da1775daf87fe38d46dcdeef6ed64c6fac0bd29 (diff) | |
download | eggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.zip eggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.tar.gz eggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.tar.bz2 |
libsh: Use parameter lists instead of aliases
Diffstat (limited to 'libsh')
-rw-r--r-- | libsh/errno.sh | 10 | ||||
-rw-r--r-- | libsh/rand.sh | 13 | ||||
-rw-r--r-- | libsh/stdio.sh | 13 |
3 files changed, 5 insertions, 31 deletions
diff --git a/libsh/errno.sh b/libsh/errno.sh index a0f9648..fc0c884 100644 --- a/libsh/errno.sh +++ b/libsh/errno.sh @@ -26,10 +26,8 @@ static errlist=' EBADF 7 ' -static strerror() +strerror(int errnum) { - local errnum=${1} - eval "msgget \"\${__errsym_${errnum}}\"" } @@ -45,9 +43,3 @@ static init_error_syms() unset IFS } __init ${init_error_syms} - -static errno_alias() -{ - __alias ${strerror} strerror int -} -__init ${errno_alias} diff --git a/libsh/rand.sh b/libsh/rand.sh index 07347d3..7efcc3b 100644 --- a/libsh/rand.sh +++ b/libsh/rand.sh @@ -22,25 +22,16 @@ static x=1 rand_x=1 -static srand() +srand(int s) { - local s="${1}" - x=${s} rand_x=${s} } -static rand() +rand(void) { # Multiplier, increment, and modulus values are those used in glibc. x=$((1103515245 * ${x} + 12345)) x=$((${x} % (${RAND_MAX} + 1))) rand_x=${x} } - -static rand_alias() -{ - __alias ${srand} srand int - __alias ${rand} rand -} -__init ${rand_alias} diff --git a/libsh/stdio.sh b/libsh/stdio.sh index 7d44d12..0d00fa5 100644 --- a/libsh/stdio.sh +++ b/libsh/stdio.sh @@ -44,10 +44,8 @@ static fd_9_set=false fd=0 -static fopen() +fopen(string path, string mode) { - local path="${1}" - local mode="${2}" local mode_r= local mode_w= local i= @@ -97,7 +95,7 @@ static fopen() return 0 } -static fclose() +fclose(int f) { local f=${1} @@ -114,10 +112,3 @@ static fclose() return 0 } - -static stdio_alias() -{ - __alias ${fopen} fopen string string - __alias ${fclose} fclose int -} -__init ${stdio_alias} |