iacfilespec.c

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

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