slang-users mailing list

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

[slang-users] Seq Fault on Variable ...


Ok, I have a C program that has the following definitions:
>>>>>>>>>

static char Var_ts_heading [32] ;
int Var_ts_count ;
char Var_ts_status ;

int  Var_tli_lineid ;
char Var_tli_displayname [32] ;
char Var_tli_type [32] ;
char Var_tli_program [32] ;

char *Var_heading_ptr = Var_ts_heading ;
char *Var_displayname_ptr = Var_tli_displayname ;
char *Var_type_ptr = Var_tli_type ;
char *Var_program_ptr= Var_tli_program ;

SLang_Intrin_Var_Type Module_Variables [] = {


  MAKE_VARIABLE("Var_Ts_Heading", &Var_heading_ptr, SLANG_STRING_TYPE, 1),
  MAKE_VARIABLE("Var_Ts_Count", &Var_ts_count, SLANG_INT_TYPE, 0),

  MAKE_VARIABLE("Var_Tli_Lineid", &Var_tli_lineid, SLANG_INT_TYPE, 0),
  MAKE_VARIABLE("Var_Tli_displayname", &Var_displayname_ptr, SLANG_STRING_TYPE, 1),
  MAKE_VARIABLE("Var_Tli_Type", &Var_type_ptr, SLANG_STRING_TYPE, 1),
  MAKE_VARIABLE("Var_Tli_Program", &Var_program_ptr, SLANG_STRING_TYPE, 1),

  SLANG_END_INTRIN_VAR_TABLE

};

When accessing it via a Slang script I get a seg fault on Var_Ts_Count:


Creating the structure
Getting the STATUS data
Printing the STATUS data
Var_Ts_Heading  is |ORIGNAL                       |
Var_Tli_Displayname  is |ORIGNAL                       |
Printing the COUNT data
Segmentation fault

test.sl program:


% A TEst menu Case
% Add traceback Debug Flags
_debug_info = 1;
_traceback = 1;

import ("testmmt", "Global") ;

fprintf (stdout, "Creating the structure \n" ) ;
variable MyStruct = CreateStruct ( ) ;
fprintf (stdout, "Getting the STATUS data \n" ) ;
StatusStruct ( MyStruct ) ;
fprintf (stdout, "Printing the STATUS data \n" ) ;

fprintf (stdout, "Var_Ts_Heading  is |%-s| \n", Var_Ts_Heading ) ;
fprintf (stdout, "Var_Tli_Displayname  is |%-s| \n", Var_Tli_displayname ) ;
fprintf (stdout, "Printing the COUNT data \n" ) ;
fprintf (stdout, "Var_Ts_Count    is %d \n", Var_Ts_Count ) ;
fprintf (stdout, "ALL DONE \n" ) ;


Any ideas on what is going on ?

Thanks ..

--
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



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