/[gcl]/gcl/o/structure.c
ViewVC logotype

Diff of /gcl/o/structure.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by camm, Fri Jul 12 22:00:49 2002 UTC revision 1.3 by camm, Sat Jul 20 07:10:56 2002 UTC
# Line 37  Foundation, 675 Mass Ave, Cambridge, MA Line 37  Foundation, 675 Mass Ave, Cambridge, MA
37    
38    
39  bool  bool
40  structure_subtypep(x, y)  structure_subtypep(object x, object y)
 object x, y;  
41  { if (x==y) return 1;  { if (x==y) return 1;
42    if (type_of(x)!= t_structure    if (type_of(x)!= t_structure
43        || type_of(y)!=t_structure)        || type_of(y)!=t_structure)
# Line 49  object x, y; Line 48  object x, y;
48     return 0;     return 0;
49   }}   }}
50    
51  static  static void
52  bad_raw_type()  bad_raw_type(void)
53  {         FEerror("Bad raw struct type",0);}  {         FEerror("Bad raw struct type",0);}
54    
55    
56  object  object
57  structure_ref(x, name, i)  structure_ref(object x, object name, int i)
 object x, name;  
 int i;  
58  {unsigned short *s_pos;  {unsigned short *s_pos;
59   COERCE_DEF(name);   COERCE_DEF(name);
60   if (type_of(x) != t_structure ||   if (type_of(x) != t_structure ||
# Line 86  int i; Line 83  int i;
83    
84    
85  void  void
86  siLstructure_ref1()  siLstructure_ref1(void)
87  {object x=vs_base[0];  {object x=vs_base[0];
88   int n=fix(vs_base[1]);   int n=fix(vs_base[1]);
89   object def;   object def;
# Line 103  siLstructure_ref1() Line 100  siLstructure_ref1()
100    
101    
102  object  object
103  structure_set(x, name, i, v)  structure_set(object x, object name, int i, object v)
 object x, name, v;  
 int i;  
104  {unsigned short *s_pos;  {unsigned short *s_pos;
105    
106   COERCE_DEF(name);   COERCE_DEF(name);
# Line 142  int i; Line 137  int i;
137  }  }
138    
139  void  void
140  siLstructure_subtype_p()  siLstructure_subtype_p(void)
141  {object x,y;  {object x,y;
142   check_arg(2);   check_arg(2);
143   x=vs_base[0];   x=vs_base[0];
# Line 160  siLstructure_subtype_p() Line 155  siLstructure_subtype_p()
155            
156    
157  object  object
158  structure_to_list(x)  structure_to_list(object x)
 object x;  
159  {  {
160          object endp_temp;          object endp_temp;
161    
# Line 184  object x; Line 178  object x;
178  }  }
179    
180  void  void
181  siLmake_structure()  siLmake_structure(void)
182  {  {
183    object x,name,*base;    object x,name,*base;
184    struct s_data *def;    struct s_data *def=NULL;
185    int narg, i,size;    int narg, i,size;
186    base=vs_base;    base=vs_base;
187    if ((narg = vs_top - base) == 0)    if ((narg = vs_top - base) == 0)
# Line 242  siLmake_structure() Line 236  siLmake_structure()
236  }  }
237    
238  void  void
239  siLcopy_structure()  siLcopy_structure(void)
240  {  {
241          object x, y;          object x, y;
242          struct s_data *def;          struct s_data *def;
# Line 261  siLcopy_structure() Line 255  siLcopy_structure()
255  }  }
256    
257  void  void
258  siLstructure_name()  siLstructure_name(void)
259  {  {
260          check_arg(1);          check_arg(1);
261          check_type_structure(vs_base[0]);          check_type_structure(vs_base[0]);
# Line 269  siLstructure_name() Line 263  siLstructure_name()
263  }  }
264    
265  void  void
266  siLstructure_ref()  siLstructure_ref(void)
267  {  {
268          check_arg(3);          check_arg(3);
269          vs_base[0]=structure_ref(vs_base[0],vs_base[1],fix(vs_base[2]));          vs_base[0]=structure_ref(vs_base[0],vs_base[1],fix(vs_base[2]));
# Line 277  siLstructure_ref() Line 271  siLstructure_ref()
271  }  }
272    
273  void  void
274  siLstructure_set()  siLstructure_set(void)
275  {  {
276          check_arg(4);          check_arg(4);
277          structure_set(vs_base[0],vs_base[1],fix(vs_base[2]),vs_base[3]);          structure_set(vs_base[0],vs_base[1],fix(vs_base[2]),vs_base[3]);
# Line 285  siLstructure_set() Line 279  siLstructure_set()
279  }  }
280    
281  void  void
282  siLstructurep()  siLstructurep(void)
283  {  {
284          check_arg(1);          check_arg(1);
285          if (type_of(vs_base[0]) == t_structure)          if (type_of(vs_base[0]) == t_structure)
# Line 294  siLstructurep() Line 288  siLstructurep()
288                  vs_base[0] = Cnil;                  vs_base[0] = Cnil;
289  }  }
290    
291  siLrplaca_nthcdr()  void
292    siLrplaca_nthcdr(void)
293  {  {
294          object endp_temp;          object endp_temp;
295    
# Line 322  siLrplaca_nthcdr() Line 317  siLrplaca_nthcdr()
317          vs_base = vs_base + 2;          vs_base = vs_base + 2;
318  }  }
319    
320  siLlist_nth()  void
321    siLlist_nth(void)
322  {  {
323          object endp_temp;          object endp_temp;
324    
# Line 347  siLlist_nth() Line 343  siLlist_nth()
343          }          }
344    
345          vs_base[0] = l->c.c_car;          vs_base[0] = l->c.c_car;
346          vs_pop;          vs_popp;
347  }  }
348    
349    
350  void  void
351  siLmake_s_data_structure()  siLmake_s_data_structure(void)
352  {object x,y,raw,*base;  {object x,y,raw,*base;
353   int i;   int i;
354   check_arg(5);   check_arg(5);
# Line 376  siLmake_s_data_structure() Line 372  siLmake_s_data_structure()
372  }  }
373    
374  void  void
375  siLstructure_def()  siLstructure_def(void)
376  {check_arg(1);  {check_arg(1);
377   check_type_structure(vs_base[0]);   check_type_structure(vs_base[0]);
378    vs_base[0]=vs_base[0]->str.str_def;    vs_base[0]=vs_base[0]->str.str_def;
# Line 400  sizeof(short)  /* aet_ushort  unsigned s Line 396  sizeof(short)  /* aet_ushort  unsigned s
396    
397    
398  void  void
399  siLsize_of()  siLsize_of(void)
400  { object x= vs_base[0];  { object x= vs_base[0];
401    int i;    int i;
402    i= aet_sizes[fSget_aelttype(x)];    i= aet_sizes[fix(fSget_aelttype(x))];
403    vs_base[0]=make_fixnum(i);    vs_base[0]=make_fixnum(i);
404  }  }
405        
406  void  void
407  siLaet_type()  siLaet_type(void)
408  {vs_base[0]=make_fixnum(fSget_aelttype(vs_base[0]));}  {vs_base[0]=fSget_aelttype(vs_base[0]);}
409    
410    
411  /* Return N such that something of type ARG can be aligned on  /* Return N such that something of type ARG can be aligned on
# Line 417  siLaet_type() Line 413  siLaet_type()
413    
414    
415  void  void
416  siLalignment()  siLalignment(void)
417  {struct {double x; int y; double z;  {struct {double x; int y; double z;
418           float x1; int y1; float z1;}           float x1; int y1; float z1;}
419   joe;   joe;
# Line 435  siLalignment() Line 431  siLalignment()
431    
432  DEF_ORDINARY("S-DATA",sSs_data,SI,"");  DEF_ORDINARY("S-DATA",sSs_data,SI,"");
433    
434  init_structure_function()  void
435    init_structure_function(void)
436  {  {
437    
438    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26