slang-users mailing list

[2021 Date Index] [2021 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] Slirp questions


Hi
1. I have an ·in· argmap defined in slirprc:

#argmap (in,which=1) (char **items, unsigned long size)
   $2 = ($2_type) $1_dim1;
#end

I would like to #copy it onto different parameter names, namely:

#argmap (in,which=1) (char **data, unsigned long size2)
…
#end

I've skipped the (repeated – what I would want to avoid) map body because I
want to only show onto what parameter names I would like to #copy the
previous map. Is this possible?

2. I would like to #rename that should just remove a prefix from function
names. I currently do this via -rename command line argument, i.e.:

slirp -rc ../slirprc -rename slang_api__ NULL -rename keybind_ NULL
slang_api_functions.h;

Above run of slirp makes the functions from the header to appear in S-Lang
interpreter without the leading slang_api__ and keybind_ prefixes. I cannot
obtain the same effect with #rename, e.g.: the following:

#rename slang_api__ NULL

doesn't treat NULL specially and uses it as the new prefix to the
functions, so that slang_api__hello becomes NULLhello. How to remove a
string via #rename? Is this possible? I've also tried skipping the second
argument to #rename and also "" as it, and it didn't work (error or ""hello
are the effects of such #rename's)…

-- 
Sebastian Gniazdowski

[2021 date index] [2021 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]