iacdate.c

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

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