/*---------------------------------------------------------------------------

  MacAllApps.h

  This header-files is global to the project MacZip standalone.

  ---------------------------------------------------------------------------*/

/*****************************************************************************/
/*  Macros, typedefs                                                         */
/*****************************************************************************/
#define MACOS

#ifndef    TRUE
#define    TRUE 1
#endif	/* TRUE */
#ifndef    FALSE
#define    FALSE 0
#endif	/* FALSE */

#define NAME_MAX    2048

/*****************************************************************************/
/*  Includes standard headers                                                */
/*****************************************************************************/
#include <ansi_prefix.mac.h>
#include <TextUtils.h>
#include <Folders.h>
#include <Aliases.h>
#include <Resources.h>
#include <Gestalt.h>
#include <Traps.h>
#include <Processes.h>
#include <MacWindows.h>
#include <Fonts.h>
#include <ToolUtils.h>
#include <Dialogs.h>
#include <Devices.h>
#include <StandardFile.h>

int macgetch(void);


/*
#define JAPANESE	1


Syslog.h
  This is an implementation of the syslog facilties found in most UNIX systems.
  The code has been written from scratch, and as such should not contain any code
  from UC Berkeley. But the priority defines listed below are taken straight from
  the UNIX syslog.h, so I am inlcuding UC Berkeley's copyright notice at the end
  of this header just in case.
  Version: 1.0
  Copyright: ©1998 Brian Bergstrand (bdb)  */
/*  
#define HAVE_SYSLOG 1



#define MAC_DEBUG  1
*/



#ifdef MAC_DEBUG


#define	LOG_DEBUG	7	/* debug-level messages */
int Print2Syslog(UInt8 priority, const char *format, ...);
#include <ctype.h>


#define Notify(msg)                                       			\
        {                                                           \
        (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", 	\
                     msg, __FILE__, __LINE__);        \
		}                                                                   




#define Assert_it(cond,msg,kind)                                        \
        {                                                               \
	    if (!(cond))                                                    \
	        {     														\
	        (void)Print2Syslog(LOG_DEBUG,"%s failed: [%s] cond: [%s] (file: %s line: %d)", \
	                      kind, msg, #cond, __FILE__, __LINE__);        \
	        }                                                           \
		}                                                                   



#define	AssertBool(b,msg) Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool "))



#define	AssertStr(s,msg)							                \
	{								                                \
	    int s_i = 0;						                        \
	    Assert_it ((s),(msg),("1. AssertStr "));	                \
	    while ((s)[s_i]) {						                    \
	    	Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) ||  \
	    	           ((s)[s_i] == 0x0D)),(s),("2. AssertStr "));	\
	    	s_i++;							                        \
	    }								                            \
	}



#define AssertTime(t,msg)	Assert_it (((t).tm_sec  >=  0) && ((t).tm_sec  < 62) &&   \
				((t).tm_min  >=  0) && ((t).tm_min  < 60) &&   \
				((t).tm_hour >=  0) && ((t).tm_hour < 24) &&   \
				((t).tm_mday >=  1) && ((t).tm_mday < 32) &&   \
				((t).tm_mon  >=  0) && ((t).tm_mon  < 12) &&   \
				((t).tm_wday >=  0) && ((t).tm_wday < 7)  &&   \
				((t).tm_yday >=  0) && ((t).tm_yday < 366),(msg),("AssertStr "))



#define AssertIntRange(myvalue,minimum,maximum, msg)  Assert_it ( \
		((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), msg,("AssertIntRange "))




#define AssertStrNoOverlap(str1,str2,msg)                           \
    {                                                               \
        long s_i = 0;                                               \
        AssertStr((str1),(msg))                                     \
        AssertStr((str2),(msg))                                     \
        if ((str1) < (str2))                                        \
            {                                                       \
            s_i = strlen((str2));                                   \
            Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap "));   \
            }                                                       \
        else                                                        \
            {                                                       \
            s_i = strlen((str1));                                   \
            Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap "));   \
            }                                                       \
    }                                                               \




#else
#define Assert_it(cond,msg,kind)          
#define	AssertBool(b,msg)
#define	AssertStr(s,msg)
#define AssertTime(t,msg)
#define AssertIntRange(myvalue,minimum,maximum,msg)
#define AssertStrNoOverlap(str1,str2,msg)  
#endif

