Click here to Skip to main content
15,885,100 members
Articles / Desktop Programming / MFC

FiveLoaves v1.0

Rate me:
Please Sign up or sign in to vote.
3.84/5 (10 votes)
2 Jul 20028 min read 84.7K   4.4K   49  
FiveLoaves is an Internet utility designed to meet the most common needs of internet users - primarily secure connectivity
// --------------------------------------------------------------------------
//					www.UnitedBusinessTechnologies.com
//			  Copyright (c) 1998 - 2002  All Rights Reserved.
//
// Source in this file is released to the public under the following license:
// --------------------------------------------------------------------------
// This toolkit may be used free of charge for any purpose including corporate
// and academic use.  For profit, and Non-Profit uses are permitted.
//
// This source code and any work derived from this source code must retain 
// this copyright at the top of each source file.
// 
// UBT welcomes any suggestions, improvements or new platform ports.
// email to: XMLFoundation@UnitedBusinessTechnologies.com
// --------------------------------------------------------------------------

#ifndef __APP_DEFS_H__
#define __APP_DEFS_H__

#define  MAXPATHNAME		256

// readable typedef's for function pointers
class XMLObject;
typedef XMLObject* (*ObjectFactory)();


#ifdef _WIN32
	#define XML_MUTEX				CRITICAL_SECTION
	#define XML_INIT_MUTEX(m)		InitializeCriticalSection(m);
	#define XML_DESTROY_MUTEX(m)	DeleteCriticalSection(m);
	#define XML_LOCK_MUTEX(m)		EnterCriticalSection(m);
	#define XML_UNLOCK_MUTEX(m)		LeaveCriticalSection(m);
#else
	#define XML_MUTEX				pthread_mutex_t
	#define XML_INIT_MUTEX(m)		pthread_mutex_init(m,0);
	#define XML_DESTROY_MUTEX(m)	pthread_mutex_destroy(m);
	#define XML_LOCK_MUTEX(m)		pthread_mutex_lock(m);
	#define XML_UNLOCK_MUTEX(m)		pthread_mutex_unlock(m);
#endif


//	data state flags describe the state of object members

// The Object memory state does not sync with the original value set by the Object Factory
#define DATA_DIRTY		0x01 
// The member has been set by either the Object or the Object Factory, the value is valid.
#define DATA_NOT_NULL	0x02
// The member has been assigned a value from the Object Factory, implies DATA_NOT_NULL
#define DATA_CACHED		0x04
// The member has never been assigned a value, it should be considered uninitialized
#define DATA_NULL		0x08 
// The member should be included in the xml serialization stream
#define DATA_SERIALIZE	0x10 


//	serialization flags dictate behavior when generating XML from Objects
#define ORDER_MEMBERS_ALBHABETICALLY	0x01
#define RECURSE_OBJECTS_DEEP			0x02
#define FORCE_CLEAN_MEMBERS_OUT			0x04
#define SHORT_TERMINATION				0x08
#define EXCLUDE_MEMBER_ATTRIBUTES		0x10
#define EXCLUDE_OBJECT_ATTRIBUTES		0x20
#define INCLUDE_DOCTYPE_DECLARATION		0x40
#define FORCE_FULL_SERIALIZE			0x80
#define USE_OBJECT_MARKERS				0x100


//
// Platform independant data types, when datasize matters
//
#ifdef _WIN32
	typedef unsigned char       BYTE;  // (always  8 bits)
	typedef unsigned short      WORD;  // (always 16 bits)
	typedef unsigned long       DWORD; // (always 32 bits)
#else
	typedef unsigned char       BYTE;  // (always  8 bits)
	typedef unsigned short      WORD;  // (always 16 bits)
// DB2's <sqlcli.h> defines DWORD as sqlint32
//	typedef unsigned long       DWORD; // (always 32 bits)
#endif


// MSVC & gnu define bool, CSet++ does not
#ifdef _AIX
#ifndef true
	// bool should be 8 bits, but this conflicts with RogueWave
	#define	__int64 long long
	typedef int bool; 
	#define true 1
	#define false 0
#endif
#endif

// support for the GNU compiler
#if defined _LINUX || defined __sun || defined _HPUX
#define	__cdecl
#define	__int64 long long

#endif

#ifndef NOMINMAX

#ifndef ___max
#define ___max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef ___min
#define ___min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

#endif  /* NOMINMAX */



#endif //__APP_DEFS_H__

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Founder United Business Technologies
United States United States
http://about.me/brian.aberle
https://www.linkedin.com/in/brianaberle
http://SyrianRue.org/Brian

Comments and Discussions