home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / pseudoDoc / ExampleHeaders / typedefTest.h < prev   
Encoding:
C/C++ Source or Header  |  2001-06-23  |  4.4 KB  |  107 lines

  1. /*! @header TypeDefTest.h
  2.     @discussion This header tests the supported types of typedef declarations, along with their corresponding HeaderDoc tags.    
  3. */
  4.  
  5. /*!
  6.     @typedef TypedefdSimpleStruct
  7.     @abstract Abstract for this API.
  8.     @discussion Discussion that applies to the entire typedef'd simple struct.
  9.     @field firstField Description of first field
  10.     @field secondField Description of second field
  11. */
  12.  
  13. typedef struct _structTag {
  14.     short firstField;
  15.     unsigned long secondField
  16. } TypedefdSimpleStruct;
  17.  
  18. /*!
  19.     @typedef TypedefdEnum
  20.     @abstract Abstract for this API.
  21.     @discussion Discussion that applies to the entire typedef'd enum.
  22.     @constant kCFCompareLessThan Description of first constant.
  23.     @constant kCFCompareEqualTo Description of second constant.
  24.     @constant kCFCompareGreaterThan Description of third constant.
  25. */
  26.  
  27. typedef enum {
  28.     kCFCompareLessThan = -1,
  29.     kCFCompareEqualTo = 0,
  30.     kCFCompareGreaterThan = 1
  31. } TypedefdEnum;
  32.  
  33.  
  34. /*!
  35.     @typedef simpleCallback
  36.     @abstract Abstract for this API.
  37.     @discussion Discussion that applies to the entire callback.
  38.     @param inFirstParameter Description of the callback's first parameter.
  39.     @param outSecondParameter Description of the callback's second parameter.
  40.     @result Returns what it can when it is possible to do so.
  41. */
  42. typedef long (*simpleCallback)(short inFirstParameter, unsigned long long *outSecondParameter);
  43.  
  44.  
  45. /*! @typedef TypedefdStructWithCallbacks
  46.     @abstract Abstract for this API.
  47.     @discussion Defines the basic interface for Command DescriptorBlock (CDB) commands, which you use
  48.     to control SCSI Architectural Model (SAM) devices, including ATAPI, Firewire SBP2, and SCSI devices.
  49.         
  50.     @field firstField Description of first field.
  51.     @callback setPointers Specifies the location of the data buffer for an I/O command, 
  52.     as well as the maximum data transfer count and data transfer direction.
  53.     
  54.     The setPointers function has the following parameters:
  55.     @param cmd A pointer to the CDB command interface instance for the current command.
  56.     You must always pass this reference.
  57.  
  58.     @param sgList A pointer to a scatter/gather list (scatter for reading, gather for writing)
  59.     containing one or more records that specify the ranges of virtual memory in the command's
  60.     I/O buffer. Each element in a scatter/gather list describes the location and size of one buffer,
  61.     allowing you to group multiple buffers of any size into a single virtual buffer for an
  62.     I/O transaction. You can pass NULL for this parameter (for a command that doesn't require
  63.     a data buffer).
  64.     
  65.     @result An IOReturn structure which returns the return value in the structure returned.  
  66.  
  67.     @callback getPointers Gets the location of the data buffer for an I/O command. The buffer
  68.     can be in one or more, possibly discontiguous, locations.
  69.     
  70.     The getPointers function has the following parameters:
  71.     @param cmd A pointer to the CDB command interface instance for the current command.
  72.     You must always pass this reference.
  73.  
  74.     @param outSGList A pointer to a pointer to a scatter/gather list (scatter for reading, gather for writing)
  75.     containing one or more records that specify the ranges of virtual memory in the command's
  76.     I/O buffer. Each element in a scatter/gather list describes the location and size of one buffer,
  77.     allowing you to group multiple buffers of any size into a single virtual buffer for an
  78.     I/O transaction. On return, the list specifies the I/O buffer for the command.
  79.  
  80.     @param outSGEntries On return, specifies the number of records in the scatter/gather list pointed to
  81.     by the outSGList parameter.
  82.  
  83.     @param outTransferCount On return, the maximum data transfer count in bytes for the
  84.     command.
  85.  
  86.     @param outIsWrite On return, specifies whether the command is a write command (true),
  87.     or a read command (false)
  88.  
  89.     @field lastField Description of the struct's last field.
  90. */
  91. typedef struct _someTag {
  92.     IUNKNOWN_C_GUTS;
  93.     short firstField;
  94.  
  95.     /* Set the data pointers */
  96.     IOReturn (*setPointers)(void *cmd,
  97.                             IOVirtualRange *sgList);
  98.     void (*getPointers)(void *cmd,
  99.                         IOVirtualRange **outSGList,
  100.                         int *outSGEntries,
  101.                         UInt32 *outTransferCount,
  102.                         Boolean *outIsWrite);
  103.  
  104.     unsigned long lastField
  105. } TypedefdStructWithCallbacks;
  106.  
  107.