iaclong.c

Go to the documentation of this file.
00001 
00002 /*  $Id: iaclong.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 IACpushlongparam (long val, OSType keyword) {
00015 
00016     return (IACpushlongitem (IACglobals.event, val, keyword));
00017     } /*IACpushlongparam*/
00018 
00019 
00020 Boolean IACreturnlong (long x) {
00021     
00022     return (IACpushlongitem (IACglobals.reply, x, keyDirectObject));
00023     } /*IACreturnlong*/
00024 
00025 
00026 Boolean IACgetlongparam (OSType keyword, long *val) {
00027 
00028     if (!IACgetlongitem (IACglobals.event, keyword, val)) {
00029 
00030         IACparamerror (IACglobals.errorcode, "\plong", keyword);
00031         
00032         return (false);
00033         }
00034     
00035     IACglobals.nextparamoptional = false; /*must be reset for each param*/
00036     
00037     return (true);
00038     } /*IACgetlongparam*/
00039     
00040     
00041 Boolean IACgetlongitem (AEDescList *list, long n, long *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, typeLongInteger, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
00051 
00052         if (ec != errAEDescNotFound)
00053             goto done;
00054         }
00055 
00056     ec = AEGetNthPtr (list, n, typeLongInteger, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
00057     
00058     done:
00059     
00060     IACglobals.errorcode = ec;
00061     
00062     return (ec == noErr);
00063     } /*IACgetlongitem*/
00064 
00065 
00066 Boolean IACpushlongitem (AEDescList *list, long val, long n) {
00067     
00068     OSErr ec;
00069     
00070     if ((*list).descriptorType != typeAEList)
00071         ec = AEPutKeyPtr (list, n, typeLongInteger, (Ptr)&val, sizeof (val));
00072     else
00073         ec = AEPutPtr (list, n, typeLongInteger, (Ptr)&val, sizeof (val));
00074     
00075     IACglobals.errorcode = ec;
00076     
00077     return (ec == noErr);
00078     } /*IACpushlongitem*/
00079 
00080 

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