mescc: Add getenv.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 17 Apr 2017 00:24:20 +0000 (02:24 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 17 Apr 2017 00:24:20 +0000 (02:24 +0200)
commit996c449a81848fc540a8af1fd17155d6892cb53e
tree654444bbbe42a63dfcc1045c6b1cba29afdf6547
parentd47f0f65c51e0eb32da867c8668694a57df983dd
mescc: Add getenv.

* module/mes/libc-i386.mes (i386:_start): Push environment pointer.
* module/mes/libc.mes (g_environment): New global.
  (_env): New function.
  (_start): Use it to set g_environment.
  (getenv): New function.
* lib/mlibc.c (strncmp): New function.
  (getenv): Implement.
* lib/mstart.c (_start): Set g_environment.
* module/mes/libc.mes (strncmp): New function.
  (libc): Add it.
* scaffold/t.c: (array_ref): Test it.
16 files changed:
GNUmakefile
libc/mlibc.c
libc/mstart.c
module/language/c99/compiler.mes
module/mes/libc-i386.mes
module/mes/libc.mes
scaffold/cons-mes.c
scaffold/hello.c
scaffold/m.c
scaffold/micro-mes.c
scaffold/mini-mes.c
scaffold/scaffold.make
scaffold/t.c
scaffold/tiny-mes.c
src/mes.c
src/posix.c