iaclist.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iaclist.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 Boolean IACpushlistparam (AEDescList *val, OSType keyword) {
00014     
00015     return (IACpushlistitem (IACglobals.event, val, keyword));
00016     } /*IACpushlistparam*/
00017 
00018 
00019 Boolean IACreturnlist (AEDescList *val) {
00020     
00021     return (IACpushlistitem (IACglobals.reply, val, keyDirectObject));
00022     } /*IACreturnlist*/
00023 
00024 
00025 Boolean IACgetlistparam (OSType keyword, AEDescList *val) {
00026     
00027     if (!IACgetlistitem (IACglobals.event, keyword, val)) {
00028         
00029         IACparamerror (IACglobals.errorcode, "\plist", keyword);
00030         
00031         return (false);
00032         }
00033     
00034     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00035     
00036     return (true);
00037     } /*IACgetlistparam*/
00038     
00039 
00040 Boolean IACnewlist (AEDescList *list) {
00041     
00042     OSErr ec;
00043     
00044     ec = AECreateList (NULL, (Size) 0, false, list);
00045     
00046     IACglobals.errorcode = ec;
00047     
00048     return (ec == noErr);
00049     } /*IACnewlist*/
00050 
00051 
00052 Boolean IACgetlistitem (AEDescList *list, long n, AEDescList *val) {
00053     
00054     OSErr ec;
00055     DescType key;
00056     
00057     if ((*list).descriptorType != typeAEList) {
00058     
00059         ec = AEGetKeyDesc (list, n, typeAEList, val);
00060         
00061         if (ec != errAEDescNotFound)
00062             goto done;
00063         }
00064 
00065     ec = AEGetNthDesc (list, n, typeAEList, &key, val);
00066 
00067     done:
00068     
00069     IACglobals.errorcode = ec;
00070     
00071     return (ec == noErr);
00072     } /*IACgetlistitem*/
00073 
00074 
00075 Boolean IACpushlistitem (AEDescList *list, AEDescList *x, long n) {
00076     
00077     OSErr ec;
00078     
00079     if ((*list).descriptorType != typeAEList)
00080         ec = AEPutKeyDesc (list, n, x);
00081     else
00082         ec = AEPutDesc (list, n, x);
00083     
00084     IACglobals.errorcode = ec;
00085     
00086     if (IACglobals.dontdisposenextparam)
00087         IACglobals.dontdisposenextparam = false;
00088     else
00089         AEDisposeDesc (x);
00090     
00091     (*x).descriptorType = typeNull;
00092     
00093     #if TARGET_API_MAC_CARBON != 1 /*PBS 03/14/02: AE OS X fix.*/
00094     
00095         (*x).dataHandle = NULL;
00096     
00097     #endif
00098     
00099     return (ec == noErr);
00100     } /*IACpushlistitem*/
00101 

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