home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks96
/
troz.cgi.sit
/
troz.cgi
/
MyConfiguration.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-22
|
11KB
|
303 lines
#pragma once
/*****
*
* MyConfiguration.h
*
* You will want to modify the constants in this header file to
* set the code to compile with the particular options you want.
* Use 1 (one) to turn an option on, 0 (zero) to turn it off.
*
* I've marked recent additions to this file with
* •new•
* in a comment.
*
* This is a support file for "Grant's CGI Framework".
* Please see the license agreement that accompanies the distribution package
* for licensing details.
*
* Copyright ©1995,1996 by Grant Neufeld
* grant@acm.com
* http://arpp.carleton.ca/grant/
*
*****/
#include "constants.h"
/*** CONFIGURATION OPTIONS ***/
/** THREADS **/
/* if off, the thread manager must be present for the app to run */
#define kCompileWithThreadsOptional 0
/* if on, all Apple Events (including the CGI sdoc event) will be
spawned off as separate threads. If off, you are on your own for
threading the CGI events. */
#define kCompileWithThreadedAppleEvents 0
/* number of threads to preallocate; used by startupThreads.
If you've turned off kCompileWithThreadedAppleEvents and make no
calls to the MyNewThreadFromPool function, you'll probably want to
set this to zero */
#define kStartupThreadsPreallocate 0
/** QUITTING **/
/* if on, app will try to quit after a set time of idling */
#define kCompileWithQuitOnLongIdle 0
/* the amount of idle time, in ticks (60ths of a second), before
the application self quits. 60*60 is one minute in ticks. */
#define kIdleTimeToQuit (5 * kOneMinuteInTicks)
/* if on, app will not quit on idle if it was opened with no special
event - starts off by receiving an OpenApplication AppleEvent */
#define kCompileWithIdleQuitOnOpenApp 0
/* if memory gets 'precariously' low, the application will be set to quit.
This _may_ (note: untested) speed up the application. Needs profiling */
#define kCompileWithQuitOnLowMemory 1
/** Modules (CGI/ListSTAR) **/
/* the following determine which modules are compiled */
/* CGI */
#define kCompileWithCGICode 1
/* ListSTAR */
#define kCompileWithListSTARCode 0
/** CGI Support **/
/* Send-partial event support (cgiAESendPartial).
Also includes the connection field of the CGIRecord. */
#define kCompileWithCGISendPartial 0
/* Form handling code (all the CGIFormFields... functions).
If you turn this off, the formFields and totalFields will not
be available in the CGIHandles. */
#define kCompileWithCGIFormHandling 0
/* automatically format form data before calling MyCGIProcess. */
#define kCompileWithCGIFormAutoProcess 0
/* automatically decode parameters (convert %xx values, and special chars)
Parameters affected: path_args, http_search_args */
#define kCompileWithCGIAutoDecode 0
/* Used for backwards compatibility - if you have old code that
uses the responseData field of the CGIRecord (CGIHdl) structure as
a 'char *', turn off this flag (set to zero). Otherwise, just leave
it on (set to 1). If you update your old code to use responseData as
a Handle, then set this on. */
#define kCompileWithCGIResponseDataAsHandle 1
/* •new•15 if this is option is set, the framework will generate an
http error header if you do not set responseData in the CGIHdl.
Turning this option off is really only useful if you want to build
a Preprocessor CGI which will need to return no data if it wishes
to indicate to the server that the preprocessor did not handle the
cgi event, and that that event should be passed along to normal
processing. */
#define kCompileWithCGINoDataHTTPError 0
/* support use as a user defined action */
#define kCompileWithCGIActionSupport 0
/** CGI Parameters **/
/* If you want to link your own data into the CGIHdl, use the
'refCon' field (a long value) to store custom data. */
#define kCompileWithCGIRefCon 0
/* '----' path_args */
#define kCompileWithCGIpath_args 0
/* 'kfor' http_search_args */
#define kCompileWithCGIhttp_search_args 0
/* 'user' username */
#define kCompileWithCGIusername 0
/* 'pass' password */
#define kCompileWithCGIpassword 0
/* 'frmu' from_user */
#define kCompileWithCGIfrom_user 0
/* 'addr' client_address */
#define kCompileWithCGIclient_address 0
/* 'post' post_args */
#define kCompileWithCGIpost_args 0
/* 'meth' method */
#define kCompileWithCGImethod 1
/* 'svnm' server_name */
#define kCompileWithCGIserver_name 1
/* 'svpt' server_port */
#define kCompileWithCGIserver_port 0
/* 'scnm' script_name */
#define kCompileWithCGIscript_name 1
/* 'ctyp' content_type */
#define kCompileWithCGIcontent_type 0
/* •new•15 'CLen' content_length */
#define kCompileWithCGIcontent_length 0
/* 'refr' referer */
#define kCompileWithCGIreferer 0
/* 'Agnt' user_agent */
#define kCompileWithCGIuser_agent 0
/* 'Kcip' client_ip */
#define kCompileWithCGIclient_ip 0
/* 'Kfrq' full_request */
#define kCompileWithCGIfull_request 0
#if kCompilingForWSAPI
/* these fields are only available to WSAPI plug-ins */
/* •new•15 */
#define kCompileWithCGIfileMIMEType 0
/* •new•15 */
#define kCompileWithCGIserverField 0
/* •new•15 */
#define kCompileWithCGIserverDirectoryPath 0
/* •new•15 */
#define kCompileWithCGIurlPhysicalPath 0
/* •new•15 */
#define kCompileWithCGIifModifiedSince 0
/* •new•15 */
#define kCompileWithCGIcurrentRealm 0
#endif /* kCompilingForWSAPI */
//• this isn't actually a parameter of the CGI event, so I've removed it
///* 'Pvrs' version */
//#define kCompileWithCGIversion 0
/** INTERFACE **/
/* setting this to off will create a background only application with
no user interface. The application won't show up in the
application menu. */
#define kCompileWithForeground 1
#if kCompileWithForeground /* only allow the options below if foreground */
/* setting this on will allow user interface elements such as error
dialogs to pop up. Turn it off if you want the application to be able
to run without requiring any user interaction. User interface elements
such as menus will still be available (providing CompileWithForeground
is on). */
#define kCompileWithFullUserInterface 0
/* display the splash screen on startup */
#define kCompileWithSplashScreen 1
/* application uses modeless dialogs - required if you are supporting
url clicking in your about box */
#define kCompileWithModelessDialogs 1
/* application uses custom windows */
#define kCompileWithApplicationWindows 0
/* application handles custom keyboard entry */
#define kCompileWithKeyboardEvents 0
/* support drag and drop manager */
#define kCompileWithDragNDrop 0
/* •new• support url clicking for download in the about box */
#define kCompileWithAboutURL 1
#endif /* kCompileWithForeground */
/*** PROCESS / APPLICATION ***/
/* If this is defined, the application will have a global 'gProcessFSSpec'
that is automatically, during startup, set to be the application's
file spec. */
#define kCompileWithProcessFileSpec 1
/* default setting for the sleep time passed to functions such as
WaitNextEvent */
#define kSleepTicks (2 * kOneSecondInTicks)
/* default setting for the sleep time passed to functions such as
WaitNextEvent when the application is busy with tasks */
#define kSleepTicksWhenBusy 5
/* •new•15 set this on if you want to support the CustomPeriodicTask
function which allows you to have tasks processed, outside of
CGI events, on a periodic basis. */
#define kCompileWithPeriodicTask 0
/* •new•15 amount of time to suggest for inbetween periodic tasks */
#define kSleepTimeForPeriodicTask (60 * kOneSecondInTicks)
/* •new•15 set this on if you want to support the CustomDeferredTask
function which allows you to have tasks processed when the
application is less busy */
#define kCompileWithDeferredTask 0
/*** MEMORY CONFIGURATION ***/
/* You will need to estimate your memory requirements here */
/* 'comfort' zone of free memory. This must be big enough to allow
any essential functions to be called.
This is used as an 'emergency' reserve of memory to be
deallocated if seriously needed.
Named kMemCushion in IM-Memory: 1-43, 1-36 */
#define kMemCushionSize 16535L /* 16k */
/* for pre-allocation of master pointers.
Used in initAppMemory "Main.c"
IM-Memory: 1-42 */
#define kMoreMasterCalls 4
/* minimum free space needed (in bytes) for application to be able to run.
Should probably be a multiple of 1024.
Should be bigger than kMemChusionSize */
#define kMinSegSize 32768L /* 32k */
/** COMPILING **/
/* if you don't want to support the old function names that began
with 'My', then turn this option on. The names were changed because
people were wanting to keep the 'My' namespace for their custom code */
#define kCompileWithout_MY_Names 1
/** PROFILER support **/
/* max 21 chars in length.
End result will be something like "\p<name>-68K.prof" or "...-PPC.prof" */
#define kProfileNameStr "troz.cgi"
/** LOGGING */
#define kCompileWithLogSupport 0
/** DEBUGGING Support **/
#if kCompileWithLogSupport /* logging required for these options */
/* cgi will log a number of actions to the log file */
#define kCompileWithDebugLogging 0
/* cgi will log error messages to the log file */
#define kCompileWithErrorLogging 0
#else /* don't change these two lines */
#define kCompileWithDebugLogging 0 /* always off if logging off */
#define kCompileWithErrorLogging 0 /* always off if logging off */
#endif
/* if you are debugging your code, you should set assertions on (1).
If you are shipping your application, you should turn assertions off (0). */
#define kCompileWithAssertions 1
/** MISCELLANEOUS **/
/* If you are using Pascal for the custom functions (mixing C
and Pascal source files in a project) the C functions need to be
defined to support Pascal calling conventions. Set this option on
for Pascal calling conventions to be used (allowing you to call some
of the functions in the C source files from Pascal files. */
#define kCompileWithPascalSupport 0
/* •new• set this to be your application creator type */
#define kMyCreatorType 'troZ'
/* •new•15 max 31 char. Must be a unique ID for your CGI/plug-in */
#define kMyCGIName "TROZ"
/*** PRIVATE SETTINGS ***/
/* !!! Please don't touch anything in this section */
#if (kStartupThreadsPreallocate < 1) && kCompileWithDeferredTask
#error /* you must have at least one preallocated thread if you are going to use deferred tasks */
#endif
#if kCompileWithPascalSupport
#define p_export pascal
#else
#define p_export
#endif
/*** EOF ***/