delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/10/12:21:33

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: djgpp AT delorie DOT com
Date: Thu, 10 Oct 1996 15:49:27 GMT
Subject: Re: A pointer of variable type - is it possible?
Message-ID: <97A818723F@fs2.mt.umist.ac.uk>

  paradox AT direct DOT ca (Wesley Terpstra) wrote:-
> ... I need a pointer of a variable type. ...

My text editor AAEMACS has a variable pointer type of 8 bytes; 4 of the bytes
are a number code saying what is in the other 4 bytes:-
  enum{_unbound=0, _subr=-1, _macro=-2, _char=-3, _keyarray=-4, _buffer=-5,
_int=-6, _keyseq=-7, _rsvword=-8, _unidfname=-9, _call=-10, _bad=-11,
_Subr=-12, _func=-13, _Func=-14, _ref=-15, _type=-16, _float=-17, _label=-18};
class val{public: int n; union{keyarray*k; subr*f; macro*m; char*s; buffer*b;
    int i; struct call_*C; Subr*S; func*fn; Func*Fn; var*v; float x;};
/* n        2nd field use
 > 0           char*s         -> a string of n chars
  0  unbound   char*s         if s==0 or 1, nothing, else empty string
 -1  _subr     subr*f         -> a function void ....(val,val,val)
 -2  _macro    macro*m        -> a macro
 -3  _char     int i          the char i. 256-511 mean 'alt/special key i&255'
 -4  _keyarray keyarray*k     -> an array of val's corresponding to key values
 -5  _buffer   buffer*b       -> a buffer
 -6  _int      int i          the integer i
 -7  _keyseq   char*s         -> a keysequence,kept in chars s[1] to s[s[0]-1]
 ... etc
  The class val must be 8 bytes long, not 6, so djgpp can compile a val type
value to be passed in two 32-bit registers.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019