iacboolean.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iacboolean.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 #include "aeutils.h"
00012 
00013 
00014 Boolean IACpushbooleanparam (Boolean val, OSType keyword) {
00015 
00016     return (IACpushbooleanitem (IACglobals.event, val, keyword));
00017     } /*IACpushbooleanparam*/
00018 
00019 
00020 Boolean IACreturnboolean (Boolean fl) {
00021 
00022     return (IACpushbooleanitem (IACglobals.reply, fl, keyDirectObject));
00023     } /*IACreturnboolean*/
00024 
00025 
00026 Boolean IACgetbooleanparam (OSType keyword, Boolean *val) {
00027 
00028     if (!IACgetbooleanitem (IACglobals.event, keyword, val)) {
00029         
00030         IACparamerror (IACglobals.errorcode, "\pboolean", keyword);
00031         
00032         return (false);
00033         }
00034     
00035     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00036     
00037     return (true);
00038     } /*IACgetbooleanparam*/
00039     
00040     
00041 Boolean IACgetbooleanitem (AEDescList *list, long n, Boolean *val) {
00042     
00043     OSErr ec;
00044     DescType key;
00045     DescType typeCode;
00046     Size actualSize;
00047     
00048     if ((*list).descriptorType != typeAEList) {
00049 
00050         ec = AEGetKeyPtr (list, n, typeBoolean, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
00051 
00052         if (ec != errAEDescNotFound)
00053             goto done;
00054         }
00055 
00056     ec = AEGetNthPtr (list, n, typeBoolean, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
00057 
00058     done:
00059     
00060     IACglobals.errorcode = ec;
00061     
00062     return (ec == noErr);
00063     } /*IACgetbooleanitem*/
00064 
00065 
00066 Boolean IACpushbooleanitem (AEDescList *list, Boolean val, long n) {
00067     
00068     OSErr ec;
00069     
00070     if (val) /*create a language-independent boolean*/
00071         val = 1;
00072     
00073     if ((*list).descriptorType != typeAEList)
00074         ec = AEPutKeyPtr (list, n, typeBoolean, (Ptr) &val, sizeof (val));
00075     else
00076         ec = AEPutPtr (list, n, typeBoolean, (Ptr) &val, sizeof (val));
00077     
00078     IACglobals.errorcode = ec;
00079     
00080     return (ec == noErr);
00081     } /*IACpushbooleanitem*/
00082 
00083 

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