iacrecord.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iacrecord.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #include "frontier.h"
00008 #include "standard.h"
00009 
00010 #include "iacinternal.h"
00011 
00012 
00013 
00014 Boolean IACpushrecordparam (AERecord * val, OSType keyword) {
00015     
00016     return (IACpushrecorditem (IACglobals.event, val, keyword));
00017     } /*IACpushrecordparam*/
00018 
00019 
00020 Boolean IACreturnrecord (AERecord *val) {
00021     
00022     return (IACpushrecorditem (IACglobals.reply, val, keyDirectObject));
00023     } /*IACreturnrecord*/
00024 
00025 
00026 Boolean IACgetrecordparam (OSType keyword, AERecord *val) {
00027     
00028     if (!IACgetrecorditem (IACglobals.event, keyword, val)) {
00029         
00030         IACparamerror (IACglobals.errorcode, "\precord", keyword);
00031         
00032         return (false);
00033         }
00034     
00035     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00036     
00037     return (true);
00038     } /*IACgetrecordparam*/
00039     
00040 
00041 Boolean IACgetrecorditem (AEDescList *list, long n, AERecord *val) {
00042     
00043     OSErr ec;
00044     DescType key;
00045     
00046     if ((*list).descriptorType != typeAEList) {
00047     
00048         ec = AEGetKeyDesc (list, n, typeAERecord, val);
00049         
00050         if (ec != errAEDescNotFound)
00051             goto done;
00052         }
00053 
00054     ec = AEGetNthDesc (list, n, typeAERecord, &key, val);
00055     
00056     done:
00057     
00058     IACglobals.errorcode = ec;
00059     
00060     return (ec == noErr);
00061     } /*IACgetrecorditem*/
00062 
00063 
00064 Boolean IACpushrecorditem (AEDescList *list, AERecord *x, long n) {
00065     
00066     OSErr ec;
00067     
00068     if ((*list).descriptorType != typeAEList)
00069         ec = AEPutKeyDesc (list, n, x);
00070     else
00071         ec = AEPutDesc (list, n, x);
00072     
00073     IACglobals.errorcode = ec;
00074     
00075     if (IACglobals.dontdisposenextparam)
00076         IACglobals.dontdisposenextparam = false;
00077     else
00078         AEDisposeDesc (x);
00079     
00080     (*x).descriptorType = typeNull;
00081     
00082     #if TARGET_API_MAC_CARBON != 1 /*PBS 03/14/02: AE OS X fix.*/
00083     
00084         (*x).dataHandle = NULL;
00085     
00086     #endif
00087     
00088     return (ec == noErr);
00089     } /*IACpushrecorditem*/
00090 
00091 
00092 Boolean IACnewrecord (AERecord *record) {
00093     
00094     OSErr ec;
00095     
00096     ec = AECreateList (NULL, (Size) 0, true, record);
00097     
00098     IACglobals.errorcode = ec;
00099     
00100     return (ec == noErr);
00101     } /*IACnewrecord*/
00102 
00103 
00104 Boolean IACgetiteminfo (AERecord *record, long n, AEKeyword *key, DescType *type, Size *bytes) {
00105 
00106     OSErr ec;
00107     
00108     ec = AEGetNthPtr (record, n, typeWildCard, key, type, NULL, (Size) 0, bytes);
00109     
00110     IACglobals.errorcode = ec;
00111     
00112     return (ec == noErr);
00113     } /*IACgetiteminfo*/
00114 
00115 
00116 

Generated on Wed May 31 18:19:48 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6