From: Leon Brocard Date: Tue, 10 Nov 2009 14:42:25 +0000 (+0000) Subject: Implement putenv, getenv X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bd3ecc87765b5a7b5bf49ddcbdab0c6e6de8144;p=sdlgit%2FSDL_perl.git Implement putenv, getenv --- diff --git a/src/SDL.xs b/src/SDL.xs index 56d517c..fa7a7ac 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -329,6 +329,22 @@ linked_version () OUTPUT: RETVAL +int +putenv (variable) + char *variable + CODE: + RETVAL = SDL_putenv(variable); + OUTPUT: + RETVAL + +char* +getenv (name) + char *name + CODE: + RETVAL = SDL_getenv(name); + OUTPUT: + RETVAL + void delay ( ms ) int ms diff --git a/t/core.t b/t/core.t index 7fd06a9..bf30250 100644 --- a/t/core.t +++ b/t/core.t @@ -4,7 +4,7 @@ use SDL; use SDL::Video; use Test::More; -plan ( tests => 9 ); +plan ( tests => 11 ); my @done =qw/ init quit @@ -12,6 +12,8 @@ my @done =qw/ get_error version linked_version + putenv + getenv /; use_ok( 'SDL' ); @@ -29,6 +31,8 @@ SDL::quit(); pass '[quit] SDL quit with out segfaults or errors'; isnt( SDL::was_init( 0 ), SDL_INIT_VIDEO, '[was_init] recognizes turned off flags'); +is(SDL::putenv('PERLSDL_TEST=hello'), 0, '[putenv] returns 0'); +is(SDL::getenv('PERLSDL_TEST'), 'hello', '[getenv] returns hello'); my @left = qw/ init_sub_system @@ -40,7 +44,6 @@ my @left = qw/ load_function unload_fuction unload_object - envvars /; my $why = '[Percentage Completion] '.int( 100 * $#done / ($#done + $#left) ) ."\% implementation. $#done / ".($#done+$#left);