iacshort.c

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

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