[slang-users] push array structure into slang

Joe Miller lpe540 at yahoo.com
Thu Aug 25 11:44:39 EDT 2005


Mike,

I am using slang 1.4.9. So when I try 

#define SLang_pop_struct        _SLang_pop_struct
extern int _SLang_pop_struct (SLang_Struct_Type **);

and then in the function.

if (-1 == SLang_pop_struct(&st))
    return -1;

I get unresolved symbols when I try to import the
module. 

S-Lang Error: Intrinsic Error: Error linking to
/pool14/jmiller/wlm/chips2-module.so:
/pool14/jmiller/wlm/chips2-module.so: undefined
symbol: _Z17_SLang_pop_structPP18_SLang_Struct_Type

I'm probably doing something obvious here, but I'm
just not seeing it. Any thoughts. 

Thanks.

-joe
 
--- Michael Noble <mnoble at space.mit.edu> wrote:

> Hi Joe,
> 
> >    for (int ww = 0; ww < arg2; ww++){
> >    SLang_push_cstruct((VOID_STAR)&cp[ww],
> SLANG_XY);
> >    SLang_pop_anytype (&any);
> 
> Have you tried popping the structure off as a
> structure,
> instead of an anytype?  E.g. defining at the top
> 
> 	SLang_Struct_Type *st = NULL;
> 
> and then having your loop do
> 
> 	if (-1 == SLang_pop_struct(&st))
> 		return -1;
> 
> In S-Lang1 the struct pop function is quasi-public
> (not declared
> statically, but is not in the public api), so when I
> needed to
> use it I wound up doing something like
> 
> 	#define SLang_pop_struct        _SLang_pop_struct
> 
> and prototyping it myself.  In SLang2 the
> SLang_pop_struct()
> function is public, so you don't need to play those
> games.
> 
> For array creation it would be nice if one could
> create instances
> of SLang_Struct_Type* directly in the C api (roughly
> analogous to
> what SLang_create_mmt does for MMT types).  Then
> arrays of structs
> could be created w/out resorting to using push/pop
> for each element,
> but this was not supported in SLang1, nor does it
> appear to be
> present in the SLang2 api.  I doubt the push/pop
> method, though,
> is a big performance hit.
> 
> HTH,
> -Mike
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the slang-users-l mailing list