[slang-users] USIng the LIST inside of C ...

Ben Duncan linux4ms at aim.com
Mon Jun 11 08:40:46 EDT 2007


Thanks ... would something MORE abbreviated like the following Work?

Sample:
/*
    Abbreviated C source for get_multivalues
*/

void get_multivalues (int Attribute)
{
   int idx, MV_CNT ;
   char *Buffer;

   /* Gimme a COUNT of Multi values in EACH attribute ... */
   MV_CNT = db_stat( dp->di_apgn, Attribute, -1 ) ;

   (void) SLang_start_arg_list ();
   for (idx = 1 ; idx <= MV_CNT ; idx++ )
     {
        Buffer = str_extract ( dp->di_apgn, Attribute, idx ); 

        (void) SLang_push_string (Buffer)
        free ( Buffer );
     }

   (void) SLang_end_arg_list ();
}

---------------------------------------------------------------------
% SLANG Code Base:
% Gimme ALL the MV strings on Attribute 33 ...

get_mutlivalues( 33 ) ;
MyList = __pop_args (_NARGS);




davis at space.mit.edu wrote:
> 
> I have not yet created an API to access the slang interpreter list
> functions from C.  Until then, you can should be able to call the
> interpreter from C and have it create the list for you.  Consider this
> slang function:
> 

<SNIP>

-- 
Ben Duncan   - Business Network Solutions, Inc. 336 Elton Road  Jackson MS, 
39212
"Never attribute to malice, that which can be adequately explained by stupidity"
        - Hanlon's Razor


More information about the slang-users-l mailing list