From cdfee65492c5328682844dfd1cff87c80ef24a07 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 2 Jan 2000 14:51:54 +0000 Subject: New variable. 2000-01-02 Martin Baulig * c_types.pl ($demarshal_funcs): New variable. --- scripts/ChangeLog | 4 ++++ scripts/c_types.pl | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'scripts') diff --git a/scripts/ChangeLog b/scripts/ChangeLog index b3f9673d..d7e3d033 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2000-01-02 Martin Baulig + + * c_types.pl ($demarshal_funcs): New variable. + 1999-11-28 Martin Baulig * c_types.pl: New file. diff --git a/scripts/c_types.pl b/scripts/c_types.pl index 49a1923a..bd568efe 100644 --- a/scripts/c_types.pl +++ b/scripts/c_types.pl @@ -23,6 +23,23 @@ my $c_marshal_func = sub { return $code; }; +my $c_demarshal_func = sub { + my ($type, $param, $indent) = @_; + + my $code = ''; + $code .= sprintf ("%s_LIBGTOP_demarshal_%s = _LIBGTOP_DATA_ptr;\n", + $indent, $param); + $code .= sprintf ("%sif (_LIBGTOP_TEMP_len) --_LIBGTOP_TEMP_len;\n", + $indent); + $code .= sprintf ("%s*(_LIBGTOP_DATA_ptr + _LIBGTOP_TEMP_len) = 0;\n", + $indent); + + $need_temp_len = 1; + + return $code; +}; + + # Typeinfo array fields: # --------------------- @@ -46,4 +63,7 @@ $sizeof_funcs = {'string' => $c_strlen_func, $marshal_funcs = {'string' => $c_marshal_func, }; +$demarshal_funcs = {'string' => $c_demarshal_func, + }; + 1; -- cgit v1.2.1