[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accessing a mac array of records



I'm sure that there must already be an undocumented macro or function
to do this (hence my original question), but I thought I'd post the 
macro that I've been using. If there is an "offical" way to do this, 
let me know.

;; To access an array of mac structures

(defmacro %get-array-struct (macptr record-type &optional (index 0 index-p))
  "Returns a macptr pointing to the begining of the structure. Used to \
access a predefined array of mac structures"
  (if index-p
  `(%int-to-ptr (+ (%ptr-to-int ,macptr) 
                   (* ,index (record-length ,record-type))))
  `,macptr))

         Jeffrey


======================================
Jeffrey Kane, MD
Kane Biomedical Systems
Boston, MA

Internet    jbk@world.std.com
Compuserve  74206,640
AppleLink   D0738

[Don't take life too seriously... it's not like anyone gets out of it alive.]