iacstring4.c

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

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