T168_111\appl\Text\Agfa:第17~18

cg_mutex.txt   ///

/* 
 * Copyright (C) 2005 Monotype Imaging Inc. All rights reserved.
 */

/* $Header:   I:/BULL/URIP/RTS/DEP/cg_mutex.c_v   1.5   Dec 14 2004 15:47:38   galejss  $ */
/* $Log:   I:/BULL/URIP/RTS/DEP/cg_mutex.c_v  $
 * 
 *    Rev 1.5   Dec 14 2004 15:47:38   galejss
 * make all DBG calls 16-bit-compatible
 * 
 *    Rev 1.4   Nov 08 2004 14:36:28   DugganJ
 * Multithreading changes to resolve UNIX compiler errors.
 * 
 * 
 *    Rev 1.3   Oct 26 2004 11:38:16   dugganj
 * Multithreading changes.
 * 
 *    Rev 1.2   Oct 19 2004 13:52:12   galejss
 * remove a double-slash comment
 * 
 *    Rev 1.1   Oct 06 2004 10:46:28   dugganj
 * Conditionally compiled "#include <windows.h>"
 * statement to resolve unix compile error.
 * 
 * 
 *    Rev 1.0   Sep 28 2004 08:59:38   dugganj
 * Initial revision.
 */

#include <stdio.h>

#ifdef VXWORKS
#include "vxWorks.h"
#endif

#include "cgconfig.h"
#if !(defined(_WIN32) && !defined (__MARM_ARMI__))
#include "ufstport.h"
#endif
#if UFST_MULTITHREAD
#if defined(_WIN32) && !defined (__MARM_ARMI__)
#include <windows.h>
#include "ufstport.h"
#elif defined (UFST_UNIX)
#include <unistd.h>
#if (_POSIX_VERSION >= 199506L)
#include <pthread.h>
#include <errno.h>
#endif
#endif
#endif

#if UFST_MULTITHREAD

#include "dbg_ufst.h"
#include "shareinc.h"

/* templates so we can test on windows */
/* NOTE: this code contains some unconditional printfs (for error conditions):
    these should be removed / conditionally-compiled for production code. */

#if defined(_WIN32) && !defined (__MARM_ARMI__)
/**************************************************************************/

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_mutex()
#endif
{
    if_state.mutex_ptr = CreateMutex(NULL,0,NULL);
    if (if_state.mutex_ptr == NULL)
        return ERR_creating_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex created");
#endif    /* THREAD_DUMP */
        return SUCCESS;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_app_mutex()
#endif
{
    if_state.app_mutex_ptr = CreateMutex(NULL,0,NULL);
    if (if_state.app_mutex_ptr == NULL)
        return ERR_creating_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex created");
#endif    /* THREAD_DUMP */
        return SUCCESS;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_mutex()
#endif
{
    SL32 err;

    if (if_state.mutex_ptr == NULL)
        return ERR_MUTEX_GONE;

    /* ask for exclusive access with a 5 second timeout */
#ifdef _DEBUG
    /* but no timeout if we are debugging */
    err = WaitForSingleObject(if_state.mutex_ptr,INFINITE);
#else
    err = WaitForSingleObject(if_state.mutex_ptr,5000);
#endif

    if (err == WAIT_ABANDONED)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_ABANDONED\n");
#endif
        err = ERR_MUTEX_GONE;
        }
    else if (err == WAIT_OBJECT_0)
        {
        /* DBG("*** FS_OpenMutex: WAIT_OBJECT_0\n"); */
        err = SUCCESS;
        }
    else if (err == WAIT_TIMEOUT)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_TIMEOUT\n");
#endif
        err = ERR_MUTEX_TIMEOUT;    /* this is bad -- we timed out */
        }
    else if (err == WAIT_FAILED)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_FAILED\n");
#endif
        err = ERR_MUTEX_CREATE;
        }
    if (err != SUCCESS)
        err = ERR_obtaining_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex obtained");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_app_mutex()
#endif
{
    SL32 err;

    if (if_state.app_mutex_ptr == NULL)
        return ERR_MUTEX_GONE;

    /* ask for exclusive access with a 5 second timeout */
#ifdef _DEBUG
    /* but no timeout if we are debugging */
    err = WaitForSingleObject(if_state.app_mutex_ptr,INFINITE);
#else
    err = WaitForSingleObject(if_state.app_mutex_ptr,5000);
#endif

    if (err == WAIT_ABANDONED)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_ABANDONED\n");
#endif
        err = ERR_MUTEX_GONE;
        }
    else if (err == WAIT_OBJECT_0)
        {
        /* DBG("*** FS_OpenMutex: WAIT_OBJECT_0\n"); */
        err = SUCCESS;
        }
    else if (err == WAIT_TIMEOUT)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_TIMEOUT\n");
#endif
        err = ERR_MUTEX_TIMEOUT;    /* this is bad -- we timed out */
        }
    else if (err == WAIT_FAILED)
        {
#ifdef AGFADEBUG
        DBG("*** FS_OpenMutex: WAIT_FAILED\n");
#endif
        err = ERR_MUTEX_CREATE;
        }
    if (err != SUCCESS)
        err = ERR_obtaining_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex obtained");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_mutex()
#endif
{
    SL32 err;

    err = ReleaseMutex(if_state.mutex_ptr);
    if (err==0)
        {
        PVOID lpMsgBuf;
        FormatMessage( 
            FORMAT_MESSAGE_ALLOCATE_BUFFER | 
            FORMAT_MESSAGE_FROM_SYSTEM | 
            FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,
            err=GetLastError(),
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
            (LPTSTR) &lpMsgBuf,
            0,
            NULL 
            );
#ifdef AGFADEBUG
        DBG2("ReleaseMutex error=%ld: %s\n",err,lpMsgBuf);
#endif
        LocalFree( lpMsgBuf );
        }
    if (err = 0)
        err = ERR_releasing_mutex;
    else
        err = SUCCESS;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex released\n");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_app_mutex()
#endif
{
    SL32 err;

    err = ReleaseMutex(if_state.app_mutex_ptr);
    if (err==0)
        {
        PVOID lpMsgBuf;
        FormatMessage( 
            FORMAT_MESSAGE_ALLOCATE_BUFFER | 
            FORMAT_MESSAGE_FROM_SYSTEM | 
            FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,
            err=GetLastError(),
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
            (LPTSTR) &lpMsgBuf,
            0,
            NULL 
            );
#ifdef AGFADEBUG
        DBG2("ReleaseMutex error=%ld: %s\n",err,lpMsgBuf);
#endif
        LocalFree( lpMsgBuf );
        }
    if (err = 0)
        err = ERR_releasing_mutex;
    else
        err = SUCCESS;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex released\n");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_mutex()
#endif
{
    SL32 err;

    err = CloseHandle(if_state.mutex_ptr);
    if (err == 0)
        err = ERR_deleting_mutex;
    else
        err = SUCCESS;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex deleted\n");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_app_mutex()
#endif
{
    SL32 err;

    err = CloseHandle(if_state.app_mutex_ptr);
    if (err == 0)
        err = ERR_deleting_mutex;
    else
        err = SUCCESS;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex deleted\n");
#endif    /* THREAD_DUMP */
    return err;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY get_thread_id(FSP0)
#else
SL32 CGENTRY get_thread_id()
#endif
{
    return GetCurrentThreadId();
}

#elif defined (UFST_UNIX)
#include <unistd.h>

#if (_POSIX_VERSION >= 199506L)
#include <pthread.h>
#include <errno.h>
#endif

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;
    
    if_state.mutex_ptr = (MUTEX)malloc(sizeof(pthread_mutex_t));
    if (!if_state.mutex_ptr)
    {
        if_state.error = ERR_creating_mutex;
        return if_state.error;
    }
        
    err = pthread_mutex_init((pthread_mutex_t *)if_state.mutex_ptr, NULL);
    if (err)
    {
        if_state.error = ERR_creating_mutex;
        switch (err)
        {
        case EAGAIN  :
#ifdef AGFADEBUG
            DBG("\n System resources (other than memory) are unavailable.");
#endif
            break;

        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Attr does not refer to a valid condition variable attribute object.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex or attr is an invalid pointer.");
#endif
            break;

        case ENOMEM:
#ifdef AGFADEBUG
            DBG("\n Insufficient memory exists to initialize the mutex.");
#endif
            break;

        }
        return if_state.error;
    }
#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex created");
#endif    /* THREAD_DUMP */
    if_state.error = SUCCESS;
#else
#ifdef AGFADEBUG
    DBG("\n FS_create_mutex() error - POSIX threads not supported");
#endif
    if_state.error = ERR_POSIX_THREADS_NOT_SUPP;
#endif
    return if_state.error;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_app_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;
    
    if_state.app_mutex_ptr = (MUTEX)malloc(sizeof(pthread_mutex_t));
    if (!if_state.app_mutex_ptr)
    {
        if_state.error = ERR_creating_mutex;
        return if_state.error;
    }
        
    err = pthread_mutex_init((pthread_mutex_t *)if_state.app_mutex_ptr, NULL);
    if (err)
    {
        if_state.error = ERR_creating_mutex;
        switch (err)
        {
        case EAGAIN  :
#ifdef AGFADEBUG
            DBG("\n System resources (other than memory) are unavailable.");
#endif
            break;

        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Attr does not refer to a valid condition variable attribute object.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex or attr is an invalid pointer.");
#endif
            break;

        case ENOMEM:
#ifdef AGFADEBUG
            DBG("\n Insufficient memory exists to initialize the mutex.");
#endif
            break;

        }
        return if_state.error;
    }
#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex created");
#endif    /* THREAD_DUMP */
    if_state.error = SUCCESS;
#else
#ifdef AGFADEBUG
    DBG("\n CGIFcreate_app_mutex() error - POSIX threads not supported");
#endif
    if_state.error = ERR_POSIX_THREADS_NOT_SUPP;
#endif
    return if_state.error;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    long err;

    err = pthread_mutex_lock((pthread_mutex_t *)if_state.mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EDEADLK:
#ifdef AGFADEBUG
            DBG("\n The mutex type is PTHREAD_MUTEX_ERRORCHECK and an attempt was made to relock the mutex.");
#endif
            break;
        }
    }
    if (err)
        err = ERR_obtaining_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex obtained");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n FS_obtain_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_app_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    long err;

    err = pthread_mutex_lock((pthread_mutex_t *)if_state.app_mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EDEADLK:
#ifdef AGFADEBUG
            DBG("\n The mutex type is PTHREAD_MUTEX_ERRORCHECK and an attempt was made to relock the mutex.");
#endif
            break;
        }
    }
    if (err)
        err = ERR_obtaining_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex obtained");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n CGIFobtain_app_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;

    err = pthread_mutex_unlock((pthread_mutex_t *)if_state.mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EPERM:
#ifdef AGFADEBUG
            DBG("\n The calling thread does not own the mutex.");
#endif
            break;
        }
    }
    if (err)
        err = ERR_releasing_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex released\n");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n FS_release_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_app_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;

    err = pthread_mutex_unlock((pthread_mutex_t *)if_state.app_mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EPERM:
#ifdef AGFADEBUG
            DBG("\n The calling thread does not own the mutex.");
#endif
            break;
        }
    }
    if (err)
        err = ERR_releasing_mutex;

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex released\n");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n CGIFrelease_app_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;

    err = pthread_mutex_destroy((pthread_mutex_t *)if_state.mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EBUSY:
#ifdef AGFADEBUG
            DBG("\n The mutex is locked or in use by another thread.");
#endif
            break;
        }
    }

    if (err)
        err = ERR_deleting_mutex;
    else
    {
        free(if_state.mutex_ptr);
        if_state.mutex_ptr = (MUTEX)0;
    }

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": mutex deleted\n");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n FS_delete_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_app_mutex()
#endif
{
#if (_POSIX_VERSION >= 199506L)
    SL32 err;

    err = pthread_mutex_destroy((pthread_mutex_t *)if_state.app_mutex_ptr);
    if (err)
    {
        switch (err)
        {
        case EINVAL:
#ifdef AGFADEBUG
            DBG("\n Mutex is not an initialized mutex.");
#endif
            break;

        case EFAULT:
#ifdef AGFADEBUG
            DBG("\n Mutex is an invalid pointer.");
#endif
            break;

        case EBUSY:
#ifdef AGFADEBUG
            DBG("\n The mutex is locked or in use by another thread.");
#endif
            break;
        }
    }

    if (err)
        err = ERR_deleting_mutex;
    else
    {
        free(if_state.mutex_ptr);
        if_state.app_mutex_ptr = (MUTEX)0;
    }

#if THREAD_DUMP
    print_current_thread(FSA0);
    printf(": app mutex deleted\n");
#endif    /* THREAD_DUMP */
    return err;
#else
#ifdef AGFADEBUG
    DBG("\n CGIFdelete_app_mutex() error - POSIX threads not supported");
#endif
    return (SL32)ERR_POSIX_THREADS_NOT_SUPP;
#endif
}

#if defined (ANSI_DEFS)
SL32 CGENTRY get_thread_id(FSP0)
#else
SL32 CGENTRY get_thread_id()
#endif
{
    return (SL32)pthread_self();
}

#else
/**************************************************************************/
/* silly definitions --- just so things compile */
/* these functions are necessarily user supplied */

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_mutex()
#endif
{
    if_state.mutex_ptr = (MUTEX)0;
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFcreate_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFcreate_app_mutex()
#endif
{
    if_state.app_mutex_ptr = (MUTEX)0;
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_mutex()
#endif
{
    return SUCCESS;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFobtain_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFobtain_app_mutex()
#endif
{
    return SUCCESS;
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_mutex()
#endif
{
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFrelease_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFrelease_app_mutex()
#endif
{
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_mutex()
#endif
{
    if_state.mutex_ptr = (MUTEX)0;
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY CGIFdelete_app_mutex(FSP0)
#else
SL32 CGENTRY CGIFdelete_app_mutex()
#endif
{
    if_state.mutex_ptr = (MUTEX)0;
    return SUCCESS;    
}

#if defined (ANSI_DEFS)
SL32 CGENTRY get_thread_id(FSP0)
#else
SL32 CGENTRY get_thread_id()
#endif
{
    return 0;    
}
/**************************************************************************/
#endif /* defined(_WIN32) && !defined (__MARM_ARMI__) */

#endif /* UFST_MULTITHREAD */

cgconfig.h  //

/* 
 * Copyright (C) 2005 Monotype Imaging Inc. All rights reserved.
 */

/* $Header:   I:/BULL/URIP/RTS/INC/CGCONFIG.H_V   1.202   Dec 15 2004 19:01:46   galejss  $ */
/* $Log:   I:/BULL/URIP/RTS/INC/CGCONFIG.H_V  $ 
 * 
 *    Rev 1.202   Dec 15 2004 19:01:46   galejss
 * add block comment about licensing terms
 * 
 *    Rev 1.201   Nov 24 2004 16:40:24   galejss
 * don't allow below-the-line options FCO_PREALLOCATE and USBOUNDBOX to be used at the same time
 * 
 *    Rev 1.200   Nov 15 2004 10:26:16   azimaf
 * removed all references to WTLE_API
 * 
 *    Rev 1.199   Oct 29 2004 15:15:46   dugganj
 * Changed default setting of THREAD_DUMP to 0.
 * 
 * 
 *    Rev 1.198   Oct 26 2004 13:15:02   dugganj
 * Multithreading changes.
 * 
 *    Rev 1.197   Oct 08 2004 12:16:10   galejss
 * enable NC_REWRITE by default
 * 
 *    Rev 1.196   Oct 04 2004 18:43:34   galejss
 * USBOUNDBOX default value should be 0=disabled (new below-the-line option)
 * 
 *    Rev 1.195   Oct 04 2004 15:25:34   jardima
 * Changes to enable unscaled bbox return in MicroType.
 * 
 *    Rev 1.194   Sep 09 2004 13:04:50   galejss
 * add UFST_MULTITHREAD directive (no code yet);
 * add #pragmas for (multithread but not reentrant), (WTLE API without raw glyphs)
 * 
 *    Rev 1.193   Aug 31 2004 11:25:46   azimaf
 * Added API support for WTLE
 * 
 *    Rev 1.192   Aug 10 2004 12:16:54   galejss
 * add WIDTH_NOSYMMAP below-the-line define, USE_ASIAN_CACHE secondary define
 * 
 *    Rev 1.191   Aug 02 2004 13:11:40   azimaf
 * Added NC_REWRITE flag to do Nested
 * Composite processing
 * 
 *    Rev 1.190   Jul 16 2004 14:43:34   galejss
 * UFST_REENTRANT is on by default now; add PS_RESIDENT, USE_PS_ARRAY, USE_PS_SYMSET defines;
 * add #pragmas for illegal combinations of IF_ROM, IF_DISK, and PS_IFPLUG
 * 
 *    Rev 1.189   Apr 26 2004 14:14:02   GalejsS
 * remove NEW_PS_HINTS flag; add IFBITSPLIT flag;
 * replace some automatic resetting of directives with #pragmas
 * 
 *    Rev 1.188   Oct 17 2003 14:17:40   Galejs
 * remove MEM_DUMP_INT option (doesn't compile any more - uses obsolete bucket structure)
 * 
 *    Rev 1.187   Sep 25 2003 16:07:20   Galejs
 * PS_ERRORCHECK should be disabled by default
 * 
 *    Rev 1.186   Sep 25 2003 15:48:36   Galejs
 * rename TYPE2_ERRORCHECK to more-accurate PS_ERRORCHECK
 * 
 *    Rev 1.184   Aug 21 2003 17:10:16   Galejs
 * update copyright notice
 * 
 *    Rev 1.183   Jul 21 2003 18:08:44   Galejs
 * make this the standard place to define / undefine AGFADEBUG
 * 
 *    Rev 1.182   Jul 16 2003 20:15:40   Galejs
 * add new defines GET_VERTICAL_METRICS, DIRECT_TT_TABLE_ACCESS, FCO_PREALLOCATE, TYPE2_ERRORCHECK
 * 
 *    Rev 1.181   Jul 11 2003 11:53:00   Galejs
 * add CACHE_BY_REF define (whether to use original or new caching technique)
 * 
 *    Rev 1.180   Jun 27 2003 17:17:40   Galejs
 * disable LINKED_FONTS in default configuration for now
 * 
 *    Rev 1.179   Jun 27 2003 14:59:34   WuQ
 * Changes for linked fonts
 * 
 *    Rev 1.178   Jun 23 2003 17:56:36   Galejs
 * add NZ_DUMP and CHECK_MEM_EXT debug flags
 * 
 *    Rev 1.177   Jun 19 2003 15:40:12   Galejs
 * Centralize debug flags; get rid of IVPNRUGX and NON_IF_FONT
 * 
 *    Rev 1.176   Dec 11 2002 11:27:14   Galejs
 * standard settings for UFST 4.5 release; move TT_SCREENRES and UFST_REENTRANT above the line
 * 
 *    Rev 1.175   Nov 27 2002 12:18:06   Galejs
 * add below-the-line define ALIGN_TTPCLEO_TABLES 
 * 
 *    Rev 1.174   Oct 17 2002 11:08:56   Joe
 * Added new define UCS4_ENCODING
 * 
 *    Rev 1.173   Oct 01 2002 08:23:50   AOF
 * Enabled CCC to allow processing of Algorithmically Compressed Stroke Fonts.
 * Replaced Tabs with Spaces to improve readability across various platforms.
 * 
 *    Rev 1.172   Sep 26 2002 16:51:00   Joe
 * Added new define SYMBOL_ENCODING.
 * 
 *    Rev 1.171   Sep 25 2002 20:03:00   Galejs
 * add CCC #define (initially disabled) (for qun)
 * 
 *    Rev 1.170   Sep 25 2002 17:37:24   Galejs
 * make it clearer that DIMM_DISK is related to the TT_DISK option
 * 
 *    Rev 1.169   Sep 24 2002 19:55:20   Galejs
 * add FIX_CONTOURS flag (bug # 73) (for awr)
 * 
 *    Rev 1.168   Sep 23 2002 20:19:06   Galejs
 * add DIMM_DISK option (bug # 92) (for awr)
 * 
 *    Rev 1.167   Sep 23 2002 14:00:52   Doolittl
 * Added OPTIMIZE_FCOACCESS (below-the-line) for performance improvements to CGIFfco_Access().
 * 
 *    Rev 1.166   Sep 20 2002 20:17:24   Galejs
 * test for multiple includes (part of bug # 76)
 * 
 *    Rev 1.165   Sep 03 2002 13:49:22   Galejs
 * remove USE_SURFER_API define (bug # 8)
 * 
 *    Rev 1.164   Aug 26 2002 15:20:34   Galejs
 * move MEM_ALIGN to port.h (bug # 16)
 * 
 *    Rev 1.163   Apr 22 2002 17:50:08   Galejs
 * remove obsolete USE_SURFER_API references (UFST bug #8)
 * 
 *    Rev 1.162   Dec 13 2001 15:28:34   AOF
 * Merged Joe's STIK font additions with the 4.3 default configurations.
 * 
 *    Rev 1.161   Jul 17 2001 17:27:50   Galejs
 * move NEW_PS_HINTS below-the-line; reset to (new) standard default values
 * 
 *    Rev 1.160   Jun 28 2001 18:43:30   Galejs
 * don't allow user to use BOLD_P6 or BOLD_HORIZONTAL with WINDCOMP
 * 
 *    Rev 1.159   Jun 18 2001 21:05:00   Galejs
 * disable SPECIAL_EFFECTS for now (until makefiles updated)
 * 
 *    Rev 1.158   Jun 18 2001 15:05:26   LynchR
 * Added special effects.
 * 
 *    Rev 1.157   Jun 18 2001 10:25:58   Paul
 * NEW_PS_HINTS defines
 * 
 *    Rev 1.156   Jun 11 2001 19:36:40   Galejs
 * tighten up definition of PLUGINS
 * 
 *    Rev 1.155   May 25 2001 17:17:24   Galejs
 * restore default settings (DISK modes only)
 * 
 *    Rev 1.154   May 21 2001 20:57:12   Galejs
 * add PST1_RAM option
 * 
 *    Rev 1.153   May 09 2001 20:43:24   Galejs
 * get rid of AGFATOOLS hack
 * 
 *    Rev 1.152   Feb 19 2001 10:59:24   Joe
 * Changed settings again.
 * 
 *    Rev 1.151   Feb 19 2001 10:35:06   Joe
 * Updated settings.
 * 
 *    Rev 1.150   Jan 25 2001 12:46:04   Galejs
 * restore default settings (TT_SCREENRES => 0, BOLD_HORIZONTAL => 0)
 * 
 *    Rev 1.149   Dec 04 2000 16:30:08   Galejs
 * add USE_RAW_GLYPHS directive (for TT fonts)
 * 
 *    Rev 1.148   Nov 29 2000 17:48:28   Galejs
 * remove obsolete options PST1, PCLEO, FCO_TT, CP936/949/950
 * 
 *    Rev 1.147   04 Oct 2000 09:03:58   JOE
 * Added EMBEDDED_BITMAPS.
 * 
 *    Rev 1.146   Apr 26 2000 14:39:06   galejs
 * put back default values (for ks)
 * 
 *    Rev 1.145   10 Feb 2000 15:28:48   AL
 * Removed PST1_ROM
 * 
 *    Rev 1.144   03 Feb 2000 15:30:46   AL
 * Changed SWP799 to WINDCOMP
 * 
 *    Rev 1.143   Feb 02 2000 17:15:52   galejs
 * get rid of SIMULDISKROM define (that was fast...)
 * 
 *    Rev 1.142   Feb 02 2000 13:02:56   galejs
 * add below-the-lines defines SIMULDISKROM and SWP799
 * 
 *    Rev 1.141   28 Jan 2000 08:28:58   JOE
 * Moved NO_SYMSET_MAPPING above dotted line.
 * 
 *    Rev 1.140   Jan 24 2000 10:35:56   galejs
 * delete ASIANVERT* defines (for keb)
 * 
 *    Rev 1.139   Dec 14 1999 13:16:32   galejs
 * get rid of TT_ROM1 define, change ROM & TT_RDR defines accordingly
 * 
 *    Rev 1.138   29 Sep 1999 16:05:14   JOE
 * KS changes (by ks).
 * 
 *    Rev 1.136   Jun 10 1999 15:12:04   galejs
 * add below-the-line option TT_SCREENRES
 * 
 *    Rev 1.135   29 Mar 1999 09:52:44   JOE
 * Set CHAR_HANDLE = 1, CHAR_SIZE = 0 (by ks).
 * 
 *    Rev 1.134   25 Mar 1999 11:14:38   JOE
 * Added below-the-line PSEUDO_HALF_WIDTH option (by keb).
 * 
 *    Rev 1.133   18 Feb 1999 22:46:44   DAVID
 * Reset to Standard Configuration Settings.
 * 
 *    Rev 1.132   18 Feb 1999 18:03:16   DAVID
 * Uncoupled CFF processing from USE_UFST_MAPPING, deleted pragma
 * message regarding previous coupling.
 * 
 *    Rev 1.131   18 Jan 1999 17:12:54   GALEJS
 * fix pragmas to handle 64-bit alignment (MEM_ALIGN=7)
 * 
 *    Rev 1.130   05 Jan 1999 11:32:56   GALEJS
 * add below-the-line option to build UFST as DLL
 * 
 *    Rev 1.129   17 Dec 1998 14:44:40   JOE
 * Added pragma to ensure that both CFF_ROM and PST1_ROM are not set 
 * to 1.
 * 
 *    Rev 1.128   15 Dec 1998 08:36:00   JOE
 * Changed directives to default settings.
 * 
 *    Rev 1.127   14 Dec 1998 08:27:26   JOE
 * Removed extra tabs (by keb).
 * 
 *    Rev 1.126   11 Dec 1998 11:09:48   JOE
 * Added ASIANVERT1 and ASIANVERT2 for use with vertical writing (by keb).
 * 
 *    Rev 1.125   30 Sep 1998 10:03:58   JOE
 * Reset FCO_CURVE_DATA_RELEASE to 1 for release.
 * 
 *    Rev 1.124   10 Sep 1998 16:02:48   MARTIN
 * Set FCO_CURVE_DATA_RELEASE to 0.
 * 
 *    Rev 1.123   10 Sep 1998 14:45:34   MARTIN
 * Moved PCLEO and PST1 below line.
 * 
 *    Rev 1.122   10 Sep 1998 14:28:00   MARTIN
 * Removed PCLEO and PST1 defines, moved FCO_TT below line.
 * 
 *    Rev 1.121   10 Sep 1998 14:20:40   GALEJS
 * add #pragma for Surfer code - must be building for supported target
 * 
 *    Rev 1.120   09 Sep 1998 19:34:04   DAVID
 * Added pragma eror messages for USE_UFST_MAPPING set to 1 when
 * either CFF_DISK or CFF_ROM is set to 1.
 * 
 *    Rev 1.119   03 Sep 1998 02:54:22   MAC
 * Added FCO_CURVE_DATA condition.
 * 
 *    Rev 1.118   24 Aug 1998 16:22:10   JOE
 * Changed "MM2" to "FCO2".
 * 
 *    Rev 1.117   21 Aug 1998 11:16:32   MARTIN
 * Added check for 32-bit alignment and HUGE_POINTER_SUPPORT.
 * 
 *    Rev 1.116   13 Aug 1998 15:08:20   GALEJS
 * oops - put back OLDATA
 * 
 *    Rev 1.115   12 Aug 1998 13:58:06   GALEJS
 * delete obsolete flags MULTICALLER, SEM_ACCESS, OLDATA
 * 
 *    Rev 1.114   06 Aug 1998 16:00:34   AL
 * Turn on PST1_DISK if CFF_DISK is.
 * 
 *    Rev 1.113   15 Jul 1998 16:04:58   JOE
 * MicroType 2 changes (by tbh).
 * 
 *    Rev 1.112   09 Jul 1998 19:20:30   GALEJS
 * fix below-the-line T1MMASTER define again
 * 
 *    Rev 1.111   09 Jul 1998 00:07:16   DAVID
 * Fixed 'below-the-line' conditional define for T1MMASTER.
 * 
 *    Rev 1.110   08 Jul 1998 23:57:02   DAVID
 * Added defines for CFF_DISK and CFF_ROM.  Deleted T1REMASTER.
 * Also added conditional defines 'below-the-line' for CFF handling.
 * 
 *    Rev 1.109   06 Jul 1998 16:29:28   GALEJS
 * add below-the-line FCO_STANDALONE, above-the-line USE_SURFER_API
 * 
 *    Rev 1.108   29 May 1998 15:18:02   GALEJS
 * add below-the-line flag UFST_REENTRANT
 * 
 *    Rev 1.107   27 Mar 1998 14:25:30   JOE
 * Removed comment describing 2 as an option for PS_PLUGINS (by jwd).
 * 
 *    Rev 1.106   03 Mar 1998 16:05:08   JOE
 * Added AGFATOOLS (by dah).
 * 
 *    Rev 1.105   26 Feb 1998 19:07:48   DAVID
 * Added more comments to HP_4000 option.
 * 
 *    Rev 1.104   23 Feb 1998 15:09:26   AL
 * Added ASIANVERT
 * 
 *    Rev 1.103   03 Feb 1998 23:23:04   DAVID
 * Added option HP_4000 for HP4000 emulation.
 * 
 *    Rev 1.102   30 Jan 1998 16:22:10   GALEJS
 * remove obsolete TT plugin modes
 * 
 *    Rev 1.101   28 Jan 1998 13:11:08   AL
 * Added VLCOUTPUT for very large character support
 * 
 *    Rev 1.100   21 Nov 1997 14:37:20   MIKE
 * Define FCO_PLUGINS, FCO_CONVERGENTFONT, FCO_CURVESHARE -- BELOW the line
 * 
 *    Rev 1.99   21 Oct 1997 10:30:30   PVCSADMN
 * Removed control-z character from bottom of file.
 * 
 *    Rev 1.98   03 Oct 1997 11:14:58   JWD
 * Moved BOLD_FCO below the DO NOT CHANGE line.
 * 
 *    Rev 1.97   05 Sep 1997 11:11:14   JOE
 * Moved COMPRESSED_CACHE below the DO NOT CHANGE line.
 * 
 *    Rev 1.96   04 Sep 1997 17:56:52   MARTIN
 * Reset to DISK input as the default.
 * 
 *    Rev 1.95   04 Sep 1997 17:03:58   MARTIN
 * Modified references to AGFA Compressed TrueType (ACT).
 * 
 *    Rev 1.94   31 Jul 1997 13:53:02   MIKE
 * Removed 'Grayscale output methods' code block.
 * 
 *    Rev 1.93   31 Jul 1997 13:05:30   KEB
 * Removed BJG_BOLD_P6.
 * 
 *    Rev 1.92   31 Jul 1997 10:28:16   MIKE
 * Reset to standard options
 * 
 *    Rev 1.91   30 Jul 1997 08:28:16   KEB
 * Added define for SMEAR_BOLD.
 * 
 *    Rev 1.90   15 Jul 1997 11:13:32   AL
 * Pseudo bold via outlines
 * 
 *    Rev 1.89   16 Jun 1997 14:25:46   AL
 * Can have GRAYSCALING without CGBITMAP
 * 
 *    Rev 1.88   04 Jun 1997 14:03:08   DAVID
 * Added defines for WANSUNG_ENCODING and JOHAB_ENCODING to support
 * additional Korean encoded fonts.  Also updated ASIAN_ENCODING define to
 * include WANSUNG and JOHAB.
 * 
 *    Rev 1.87   30 May 1997 10:28:58   MARTIN
 * Reset to most common options.
 * 
 *    Rev 1.86   30 May 1997 09:50:58   MARTIN
 * Added TrueType ROM ACT (compressed random access).
 * 
 *    Rev 1.85   14 May 1997 09:15:06   MIKE
 * Removed previous change (restored rev 1.83)
 * 
 *    Rev 1.84   12 May 1997 14:51:36   MIKE
 * New config parameter: GRAY_DIRECT_OUTPUT
 * 
 *    Rev 1.83   03 Apr 1997 07:55:36   DAVID
 * Changed comments around the Asian Encoding section, and added new
 * comments to make the use of the Encoding and Mapping defines a little
 * clearer.  Also, added defines for 3 Code Page Encoding standards ('below
 * the line').
 * 
 *    Rev 1.82   19 Feb 1997 21:22:34   DAVID
 * Added defines for 3 Asian CODE PAGE encodings for future use.
 * And, to enable testing using 'newtext' and a new 'dot file' generator
 * (makadot).
 * 
 *    Rev 1.81   15 Jan 1997 11:14:12   DAVID
 * Removed PST1_PCLEOI as part of project to trim ufst.
 * 
 *    Rev 1.80   14 Jan 1997 23:07:52   DAVID
 * Removed DRAS_QUAD option as part of project to trim ufst.
 * 
 *    Rev 1.79   14 Jan 1997 17:25:50   DAVID
 * Removed MULTIFORMAT option and associated PRAGMAs as part of
 * project to trim ufst.
 * 
 *    Rev 1.78   13 Jan 1997 16:42:56   DAVID
 * Removed CONVERGENT_FONTS option as part of project to trim ufst.
 * 
 *    Rev 1.77   10 Jan 1997 10:24:50   DAVID
 * Removed SCREEN_FONTS option, and ELASTIC_X, and ELASTIC_Y as part
 * of project to trim ufst.
 * 
 *    Rev 1.76   09 Jan 1997 22:10:46   DAVID
 * Added BIG5_ENCODING and GB_ENCODING to define for UNICODE_IN.
 * 
 *    Rev 1.75   08 Jan 1997 09:25:52   DAVID
 * Deletion of KERN option as part of trimming ufst.
 * 
 *    Rev 1.74   06 Nov 1996 12:05:16   MIKE
 * Added FNT_METRICS #define to enable CGIFfont_metrics()
 * 
 *    Rev 1.73   23 Oct 1996 12:01:14   PVCSADMN
 * Added emboldening for PCL 6 emulation.
 * 
 *    Rev 1.72   23 Sep 1996 14:17:12   PVCSADMN
 * Added GB_ENCODING support to ASIAN_ENCODING define. Modified defaults
 * to work with DEMO.C as it is delivered to OEM's.
 * 
 *    Rev 1.71   29 Aug 1996 11:41:50   MIKE
 * BOLD_FCO becomes official - replaces PSEUDO_BOLD_FCO.
 * 
 *    Rev 1.70   26 Jul 1996 10:17:48   MIKE
 * Settings for UFST Surfer (grayscale, cache, rom fonts (TT, FCO)).
 * 
 *    Rev 1.69   27 Jun 1996 10:36:26   JOE
 * Cleanup (by ka).
 * 
 *    Rev 1.67   19 Mar 1996 19:01:00   MIKE
 * Remove "//"
 * 
 *    Rev 1.66   21 Feb 1996 13:23:26   MERRILL
 * reset settings to Seybold demo requirements.
 * made grayscale auto-select buffering or direct pixel output.
 * 
 *    Rev 1.65   12 Feb 1996 19:38:14   MIKE
 * Added PS_PLUGINS == 2 (PS_MTPLUG) and PS_PLUGINS == 3 (PS_PSPLUG).
 * 
 *    Rev 1.64   24 Jan 1996 17:22:50   AL
 * Cache compression
 * 
 *    Rev 1.63   12 Jan 1996 12:01:18   JC
 * Turn on NON_Z_WIND if GRAYSCALING is on.
 *
 *    Rev 1.62   09 Jan 1996 12:58:32   MERRILL
 * add GR_IMAGE define for beta release
 * 
 *    Rev 1.61   21 Dec 1995 15:12:26   MERRILL
 * spelling change gray
 * 
 *    Rev 1.60   04 Oct 1995 17:18:14   AL
 * Grayscaling
 * 
 *    Rev 1.59   22 Sep 1995 09:54:08   JOE
 * Moved DRAS_QUAD define below the DO NOT CHANGE line.
 * Changed settings to standard settings.
 * 
 *    Rev 1.58   07 Sep 1995 18:17:40   JOE
 * Changed #defines for TT_NOPLUG, TT_IFPLUG, TT_TTPLUG, TT_TTPLUG_IF,
 * TT_TTPLUG_ANY, PS_NOPLUG and PS_IFPLUG by making them independent
 * of FCO_RDR.
 * 
 *    Rev 1.57   24 Jul 1995 18:47:18   MIKE
 * Defined NO_SYMSET_MAPPING 0, below the line.
 * 
 *    Rev 1.55   20 Jul 1995 11:37:38   MIKE
 * Removed #define and #pragmas for NO_SYMSET_MAPPING
 * 
 *    Rev 1.54   18 Apr 1995 16:54:22   JOE
 * Added define and pragmas for NO_SYMSET_MAPPING.
 *
 *    Rev 1.53   07 Apr 1995 08:45:12   LISA
 * Changed copyright from Miles Inc. to Bayer Corp.
 * 
 *    Rev 1.52   31 Mar 1995 11:06:30   JWD
 * Added new define FCOACCESS.
 * 
 *    Rev 1.51   13 Feb 1995 16:07:56   JOE
 * If !ASIAN_ENCODING,, #define ASIAN_ENCODING as 0 to resolve compiler
 * error on some platforms.
 * 
 *    Rev 1.50   25 Jan 1995 17:05:08   JOE
 * Before redefining NON_Z_WIND (if BOLD), undefine NON_Z_WIND
 * to resolve WATCOM compiler error.
 * 
 *    Rev 1.49   13 Jan 1995 18:06:32   ROB
 * Support for > 64KB memory blocks in DOS.
 * 
 *    Rev 1.48   02 Dec 1994 21:00:16   YAN
 * KSC.
 *
 *    Rev 1.47   30 Nov 1994 10:59:32   JOE
 * Changed the defines TT_NOPLUG, TT_IFPLUG, TT_TTPLUG, TT_TTPLUG_IF,
 * TT_TTPLUG_ANY, PS_NOPLUG and PS_IFPLUG based on !FCO_RDR.
 *
 *    Rev 1.46   14 Sep 1994 10:41:44   MIKE
 * Add FCO_RDR to definition of PLUGINS.
 * 
 *    Rev 1.45   02 Aug 1994 18:11:20   MIKE
 * Added FCO changes from 1.37.1.2
 * 
 *    Rev 1.44   11 Jul 1994 14:35:04   JOE
 * Moved #define for K_ENCODING here from TTKAN.C .
 * Expanded #define for ASIAN_ENCODING.
 * 
 *    Rev 1.43   22 Apr 1994 16:42:16   JOE
 * Added pragmas for MULTIFORMAT/CONVERGENT_FONTS.
 * 
 *    Rev 1.42   21 Apr 1994 16:51:00   JOE
 * Changed comment associated with SEGACCESS switch.
 * 
 *    Rev 1.41   21 Apr 1994 15:48:42   LISA
 * Made modifications to copyright/disclaimer notice.
 * 
 *    Rev 1.40   01 Mar 1994 15:48:54   MIKE
 * For CONVERGENT_FONTS, 1 is standard (AWT4), 3 is old format (AWT3).
 * 
 *    Rev 1.39   28 Feb 1994 17:58:20   MIKE
 * CONVERGENT_FONTS must take value 0, 3, or 4. Added #pragma.
 *
 *    Rev 1.38   15 Feb 1994 09:32:30   JOE
 * Changed default settings.
 * 
 *    Rev 1.37   05 Jan 1994 15:28:30   ROB
 * Added #define for "GB" mapping.
 * 
 *    Rev 1.36   17 Dec 1993 17:13:04   JOE
 * Changed the comment associated with MAX_BM_BITS setting for UNIX (max
 * should be 22 not 32).
 * 
 *    Rev 1.35   08 Dec 1993 12:29:22   MAIB
 * Modified Unicode mapping defines
 *
 *    Rev 1.34   07 Dec 1993 12:51:00   MAIB
 * Added literal to allow JIS to Unicode and Unicode to Jis mappings
 * 
 *    Rev 1.33   02 Dec 1993 11:59:22   MIKE
 * Fixed syntax error in #define ASIAN_ENCODING.
 * 
 *    Rev 1.32   01 Dec 1993 08:55:28   JOE
 * Changed KANJI_ENCODING to ASIAN_ENCODING.
 * 
 *    Rev 1.31   30 Nov 1993 14:49:30   ROB
 * Add BIG5 support and TCA hooks.
 * 
 *    Rev 1.29   09 Nov 1993 10:35:34   MIKE
 * Add UNICODE_ENCODING definition; updated KANJI_ENCODING.
 * 
 *    Rev 1.27   23 Sep 1993 13:41:06   MIKE
 * Changed to TT_ROM1.
 * 
 *    Rev 1.26   17 Sep 1993 10:21:58   MIKE
 * Added EXTERN_ENTITY1.
 * 
 *    Rev 1.25   02 Sep 1993 15:09:54   JOE
 * Moved the following #defines above the dotted lines:
 * USE_JUMP_TABLES, DRAS_QUAD, SJIS_ENCODING, JIS_ENCODING, EUC_ENCODING
 * and USE_UFST_MAPPING.
 * 
 *    Rev 1.24   31 Aug 1993 14:15:34   AL
 * Added BOLD == 1 forces NON_Z_WIND to 1
 * 
 *    Rev 1.23   12 Aug 1993 18:13:10   ROB
 * Add 'PST1_SFNTI' to define for 'PST1_RDR'.
 * 
 *    Rev 1.22   02 Aug 1993 14:26:36   MAIB
 * New define to configure semaphore multi-tasking
 * 
 *    Rev 1.21   26 Jul 1993 11:40:32   ROB
 * Add T1REMASTER for type 1 multimaster support.
 * 
 *    Rev 1.19   14 Jul 1993 19:09:32   MIKE
 * Added #defines for CONVERGENT_FONTS and MULTIFORMAT.
 * Added #define TT_PLUGINS 3 option for LJ4 compatible, IF format.
 * 
 *    Rev 1.18   01 Jul 1993 14:23:58   MAIB
 * added new define NON_Z_WIND
 * 
 *    Rev 1.17   25 Jun 1993 14:13:46   ROB
 * Changed default options.
 * 
 *    Rev 1.16   25 Jun 1993 14:11:50   ROB
 * No change.
 * 
 *    Rev 1.15   14 Jun 1993 18:38:56   ROB
 * Change comment on 'USE_UFST_MAPPING' to support type 1 encoding arrays.
 * 
 *    Rev 1.14   10 Jun 1993 10:01:32   ROB
 * Fix typo.
 * 
 *    Rev 1.13   08 Jun 1993 15:59:00   ROB
 * Add support for type 1 multimaster 'T1IMMASTER'.
 * 
 *    Rev 1.12   05 Jun 1993 18:56:06   ROB
 * Add conditional 'PST1_SFNTI' to support generic type 1 downloaded soft fonts.
 * 
 *    Rev 1.11   06 May 1993 15:35:28   JOE
 * FIxed comment regarding IF_DISK.
 * Added pragma stating that BANDING requires CACHE as well as TILE.
 *
 *    Rev 1.10   04 May 1993 16:42:24   ROB
 * Add define 'DRAS_QUAD' for direct rasterization of quadratic beziers.
 * 
 *    Rev 1.9   09 Apr 1993 12:43:44   MIKE
 * Added #define for DYNAMIC_FONTS.
 * 
 *    Rev 1.8   07 Apr 1993 12:05:30   JOE
 * Added new defines for raster line organization support.
 * 
 *    Rev 1.7   29 Mar 1993 10:41:18   ROB
 * Add defines to support KANJI_ENCODING.
 * 
 *    Rev 1.6   04 Feb 1993 10:25:10   MIKE
 * Set FONTBBOX and ALIEN_BITS to 0
 * 
 *    Rev 1.5   04 Feb 1993 09:34:22   MIKE
 * Added #defines for FONTBBOX & ALIEN_BITS
 * 
 *    Rev 1.4   02 Feb 1993 17:01:54   JOE
 * Added #define for BANDING.
 * 
 *    Rev 1.3   29 Jan 1993 09:28:10   JOE
 * Added #define for DU_ESCAPEMENT.
 * 
 *    Rev 1.2   15 Jan 1993 09:35:34   LISA
 * Removed CtrlZ character from end of file
 * 
 *    Rev 1.1   14 Dec 1992 09:41:40   LISA
 * Made change to Log keyword
 * 
 *    Rev 1.0   10 Dec 1992 09:11:10   LISA
 * Initial revision.
*/
/* cgconfig.h */

/* This file should be included in all .c files of the UFST core.          */
/* The setting of defines here determines the functionality options to be  */
/* included in the resulting libraries and executables.                    */
/* These defines are used to conditionally compile code in the core.       */

/* Setting a define to 1 includes that option, 0 excludes it.              */

/* ** When altering settings, make sure to note dependencies specied. **   */

/* Change History:
 *    1-Jan-92  awr Added #define TT_RDR
 *    9-Feb-92  awr Added #define IF_RDR
 *   26-Feb-92  jfd Added comment to explain meaning of OLDATA switch.
 *   18-Mar-92  rs  Add #define PST1_PCLEOI & TT_PCLEOI for UFST pcleo's.
 *                  Add '#error' in addition to '#pragma message'
 *   03-Apr-92  rs  Portability cleanup (see port.h).
 *   06-Apr-92  rs  Change 'FIXED_PITCH' to 'CGFIXED_PITCH' (portability).
 *   06-May-92  jfd Disabled "#error" statements due to problems on SUN
 *   08-May-92  jfd Changed definition for EXTERN_FONT from
 *                  "(PCLEO_RDR || PST1I || TT_RDR)" to
 *                  "(PCLEO_RDR || PST1_PCLEOI || TT_PCLEOI)".
 *   12 May 92  ss  Added NON_IF_FONT define to signify that one or more
 *                  PS/TT options are enabled.
 *   22-May-92  rs  Add #define USE_UFST_MAPPING for all symbol sets w/PS
 *    5 Jun 92  ss  Cleanup and major reorganization of file.
 *   14-Jun-92  awr Added #define INTR_SIZE
 *    3-Jul-92  awr Changed comments and pragma for MULTI_CALLER
 *    8-Jul-92  jfd Changed comment associated with WIDTHS to indicate
 *                  widths for any type of font (IF, PS or TT).
 *   10-Jul-92  jfd Moved #define for "USE_UFST_MAPPING" to fixed defines
 *                  section because it should not be changed.
 *                  Changed MEM_ALIGN from 1 to 3 for SUN/SPARC and added
 *                  pragma warning for DOS users.
 *   20-Jul-92  rs  Create new IF, PS & TT defines for disk, PCLEO & ROM
 *                  input.
 *   30-Jul-92  jfd Removed olsolete pragmas.
 *   21 Aug 92  ss  Added comments about DISK & ROM being mutually exclusive.
 *   27-Sep-92  awr Added DISK_FONTS, a derived define.
 *   10-Oct-92  rs  Implement USE_JUMP_TABLES feature for overlays.
 *   20-Oct-92  jfd Changed "FF_NOPLUG" to "TT_NOPLUG".
 *   22-Jan-93  jfd Added #define for DU_ESCAPEMENT.
 *   01-Feb-93  jfd Added #define for BANDING.
 *   04-Feb-93  mby Added #defines for FONTBBOX & ALIEN_BITS
 *   27-Mar-93  rs  Add #defines for Kanji support - , SJIS_ENCODIING,
 *                  JIS_ENCODING, EUC_ENCODING & KANJI_ENCODING.
 *   07-Apr-93  jfd Added #defines for RASTER_ORG and LEFT_TO_RIGHT_BIT_ORDER
 *                  for raster line organization support.
 *   07-Apr-93  mby Added #define for DYNAMIC_FONTS.
 *   04-May-93  rs  Add define for 'DRAS_QUAD' - direct rasterization of
 *                  quadratic curves.
 *   06-May-93  jfd Fixed comment regarding IF_DISK.
 *                  Added pragma stating that BANDING requires CACHE.
 *   29-May-93  rs  Add conditional 'PST1_SFNTI' for generic type 1
 *                  downloaded soft font support.
 *   06-Jun-93  rs  Add type 1 MultiMaster support 'T1MMASTER'.
 *   14-Jun-93  rs  Change comment for 'USE_UFST_MAPPING'.
 *   01-Jul-93 maib Added new define NON_Z_WIND to specify non-zero
 *                  winding methods for determining transitions.
 *                  Also, disabled error message "#error Can not enable 
 *                  multiple forms of type 1 soft fonts" due to problems
 *                  on SPARC
 *   06-Jul-93 mby  Added #defines for CONVERGENT_FONTS and MULTIFORMAT.
 *   10-Jul-93 mby  Added #define TT_PLUGINS 3 option for LJ4 compatible, IF format.
 *   23-Jul-93 rs   Add 'T1REMASTER' for type 1 multimaster support.
 *   02-Aug-93 maib Added SEM_ACCESS, to configure semaphore multi-tasking
 *   12-Aug-93 rs   Add 'PST1_SFNTI' to define for 'PST1_RDR'.
 *   31-Aug-93 awr  Set NON_Z_WIND to 1 if BOLD == 1.
 *   02-Sep-93 jfd  Moved the following #defines above the dotted line:
 *                  USE_JUMP_TABLES, DRAS_QUAD, SJIS_ENCODING, JIS_ENCODING,
 *                  EUC_ENCODING, and USE_UFST_MAPPING.
 *   13-Sep-93 mby  Added EXTERN_ENTITY1
 *   17-Sep-93 mby  Changed to TT_ROM1.
 *   09-Nov-93 gy/my  Added UNICODE_ENCODING definition. Expanded definition
 *                  of KANJI_ENCODING to include UNICODE_ENCODING.
 *                  Moved JIS, SJIS, EUC, & UNICODE_ENCODING below the line.
 *   23-Nov-93 rs   Add define for "BIG5" & "TCA". Add these to KANJI_ENCODING.
 *   01-Dec-93 jfd  Changed KANJI_ENCODING to ASIAN_ENCODING.
 *   02-Dec-93 mby  Fixed syntax error in #define ASIAN_ENCODING. "\" was
 *                  not the last character in the line.
 *   07-Dec-93 maib Added UNICODE_IN and UNICODE_OUT, moved asian literals
 *                  above the do-not-change line
 *   08-Dec-93 maib Changed the way in which Unicode mappings are determined
 *   17-Dec-93 jfd  Changed the comment associated with MAX_BM_BITS setting
 *                  for UNIX (max should be 22 not 32).
 *   05-Jan-94 rs   Add #define for "GB_ENCODING".
 *   28-Feb-94 mby  Added pragma to constrain CONVERGENT_FONTS to value of
 *                  0, 3 or 4.
 *   01-Mar-94 mby  CONVERGENT_FONTS can be 0, 1, or 3.
 *   20-Apr-94 jfd  Changed comment associated with SEGACCESS switch.
 *   22-Apr-94 jc   Added pragmas for MULTIFORMAT/CONVERGENT_FONTS.
 *   11-Jul-94 jfd  Moved #define for K_ENCODING here from TTKAN.C .
 *                  Expanded #define for ASIAN_ENCODING.
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * FCO Changes from 1.37.1.2:
 *   11-Mar-94 mby  Added FCO_DISK, FCO_ROM, & FCO_RDR configurations.
 *   26-May-94 mby  Added FCO_TT configuration to the data output types to
 *                  generate a TrueType font from an FCO.
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *   14-Sep-94 mby  Add FCO_RDR to definition of PLUGINS.
 *   29-Nov-94 jfd  Changed the defines TT_NOPLUG, TT_IFPLUG, TT_TTPLUG,
 *                  TT_TTPLUG_IF, TT_TTPLUG_ANY, PS_NOPLUG and PS_IFPLUG
 *                  based on !FCO_RDR.
 *   02-Dec-94 yan  Ksc.
 *   09-Jan-95 rob  Implement support for > 64KB memory blocks in DOS.
 *                  Add '#define HUGE_PTR_SUPPORT'.
 *   25-Jan-95 jfd  Before redefining NON_Z_WIND (if BOLD), undefine
 *                  NON_Z_WIND to resolve WATCOM compiler error.
 *   10-Feb-95 jfd  If !ASIAN_ENCODING, #define ASIAN_ENCODING as 0
 *                  to resolve compiler error on some platforms.
 *   31-Mar-95 jwd  Added support for FCO Access function, CGIFfco_Access().
 *                  This function is conditionally compilable based on the
 *                  switch FCOACCESS.
 *   18-Apr-95 jfd  Added #define for NO_SYMSET_MAPPING.
 *                  Added pragmas for NO_SYMSET_MAPPING.
 *   20-Jul-95 mby  Removed #define and #pragmas for NO_SYMSET_MAPPING.
 *   24-Jul-95 mby  Defined NO_SYMSET_MAPPING 0 below the line.
 *   07-Sep-95 jfd  Changed #defines for TT_NOPLUG, TT_IFPLUG, TT_TTPLUG,
 *                  TT_TTPLUG_IF, TT_TTPLUG_ANY, PS_NOPLUG and PS_IFPLUG
 *                  by making them independent of FCO_RDR.
 *   22-Sep-95 jfd  Moved DRAS_QUAD define below the DO NOT CHANGE line.
 *   12-Jan-96 jfd  Turn on NON_Z_WIND if GRAYSCALING is on.
 *   24-Jan-96 awr  Added COMPRESSED_CACHE
 *   12-Feb-96 mby  Added PS_PLUGINS values of 2 and 3; PS_MTPLUG, PS_PSPLUG
 *   20-Aug-96 mby  Replaced PSEUDO_BOLD_FCO (below the line) with BOLD_FCO
 *                  (above the line). This enables emboldening for MicroType.
 *   12-Sep-96 dbk  Added GB_ENCODING support to ASIAN_ENCODING define.
 *   12-Sep-96 dbk  Modified defaults to work with DEMO.C as it is delivered
 *                  to OEM's.
 *   23-Oct-96 bjg  Added emboldening (BOLD_P6) for PCL 6 emulation.
 *   05-Nov-96 mby  Added FNT_METRICS to enable CGIFfont_metrics().
 *   08-Jan-97 dlk  Removed KERNing option as part of project to trim ufst.
 *   09-Jan-97 dlk  Added BIG5_ENCODING and GB_ENCODING to define for
 *                  UNICODE_IN.
 *   10-Jan-97 dlk  Removed SCREEN_FONTS option, and ELASTIC_X, and ELASTIC_Y
 *                  as part of project to trim ufst.
 *   13-Jan-97 dlk  Removed CONVERGENT_FONTS option as part of project to
 *                  trim ufst.
 *   14-Jan-97 dlk  Removed MULTIFORMAT option and associated PRAGMAs as part
 *                  of project to trim ufst.
 *   14-Jan-97 dlk  Removed DRAS_QUAD option as part of project to trim ufst.
 *   15-Jan-97 dlk  Removed PST1_PCLEOI option as part of project to trim ufst.
 *   19-Feb-97 dlk  Added defines for 3 CODE PAGE Asian ENCODINGs to for future
 *                  use.  These are 'below' the DO NOT CHANGE line for now.
 *                  Also added comment lines to help make 'mapping' versus
 *                  'transcoding' clearer for Asian support.
 *   29-May-97 sbm  Add TT_ROM_ACT functionality.
 *   04-Jun-97 dlk  Added defines for WANSUNG_ENCODING and JOHAB_ENCODING.
 *                  These are alternate Korean encodings.  No mapping tables
 *                  to/from UNICODE are available at this time.  Also updated
 *                  ASIAN_ENCODING define to reflect these additional cases.
 *   16-Jun-97 awr  Changed configuration error checking to allow
 *                  GRAYSCALING only (no CGBITMAP or OUTLINE)
 *   15-Jul-97 awr  Pseudo bold via outlines.
 *   30-Jul-97 keb  Added define for SMEAR_BOLD.
 *   31-Jul-97 keb  Removed BJG_BOLD_P6.
 *   31-Jul-97 mby  Removed 'Grayscale output methods' section -- this is
 *                  never used (APP_FUNCTIONS, APP_DEMOGR, APP_BORLANDC).
 *   05-Sep-97 jfd  Moved COMPRESSED_CACHE below the DO NOT CHANGE line.
 *   26-Sep-97 jwd  Moved BOLD_FCO below the DO NOT CHANGE line.
 *   21-Nov-97 mby  For code reduction purposes added new #define's - below
 *                  the line - for FCO_PLUGINS, FCO_CONVERGENTFONT,
 *                  and FCO_CURVESHARE.
 *     30-Jan-98 slg    Remove obsolete plugin options (below the line) = 
 *                    TT_IFPLUG, TT_TTPLUG_IF, TT_TTPLUG_ANY. (Other files
 *                    modified = cgif.c, bucket.c, ix.c, chr_def.c)
 *   03-Feb-98 dlk  Added option HP_4000 for HP4000 emulation (0=OFF, 1=ON).
 *   26-Feb-98 dlk  Added additional comments for HP_4000 option.
 *   03-Mar-98 dah  Added AGFATOOLS flag
 *   27-Mar-98 jwd  Removed comment describing 2 as an option for PS_PLUGINS.
 *     29-May-98 slg  Add below-the-line flag UFST_REENTRANT - this flag will
 *                    control whether UFST is built with one global structure
 *                    "if_state" (declared within maker.c), or whether it uses
 *                    a pointer to an instance of the IF_STATE structure 
 *                    (declared within the application).
 *   06-Jul-98 slg    Add below-the-line flag FCO_STANDALONE - set to 1 only to 
 *                    build "fcodump2", at this time - replaces no-longer-usable
 *                    \rts\fco flag UFST_ON used by "fcodump" utility. 
 *                    Also add above-the-line flag USE_SURFER_API - set to 1 to
 *                    use Surfer (New Media) API code in \surflib, and related
 *                    state variables in "if_state".
 *   08-Jul-98 dlk  Added defines for CFF_DISK and CFF_ROM.  Also addded con-
 *                  ditional defines for CFF_RDR, PST1_RDR, and T1MMASTER to
 *                  be defined (to 1, 'below-the-line') when either CFF_DISK ||
 *                  CFF_ROM is defined.  Deleted T1REMASTER as that code is
 *                  small and will always be compiled in when T1MASTER is ON.
 *                  Also DISK_FONTS, NON_IF_FONT, and ROM are set below-the-
 *                  line when corresponding CFF_DISK or CFF_ROM are set.
 *                  Changed this file's copyright notice dates.
 *   08-Jul-98 dlk  Fixed 'below-the-line' conditional define for T1MMASTER.
 *     09-Jul-98 slg    Fixed T1MMASTER below-the-line define again, to avoid 
 *                    redefine-macro warning messages.
 *   15-Jul-98 tbh  compile switch for Microtype 2 = MM2 (MicroModel)
 *     12-Aug-98 slg    Remove obsolete flags MULTICALLER, SEM_ACCESS; remove
 *                    redundant flag OLDATA (as we have below-the-line OUTLINE);
 *                    change comment for MM2 (as code checks for #if MM2, rather
 *                    than #ifdef MM2, so MM2 should be defined as 0 or 1).
 *     13-Aug-98 slg    Oops - put back OLDATA flag - not redundant.
 *     21-Aug-98 sbm    Added check for 32-bit alignment and HUGE_POINTER_SUPPORT.
 *   24-Aug-98 jfd  Changed all references of MM2 to FCO2.
 *   09-Sep-98 dlk  Added pragma error message for USE_UFST_MAPPING set to 1
 *                  when CFF_DISK or CFF_ROM is set to 1.  Added comments.
 *   10-Sep-98 sbm  Removed PCLEO and PST1 defines, moved FCO_TT below line.
 *   10-Sep-98 sbm  Moved PCLEO and PST1 below line.
 *   10-Sep-98 sbm  Set FCO_CURVE_DATA_RELEASE to 0.
 *   30-Sep-98 jfd  Reset FCO_CURVE_DATA_RELEASE to 1 for release.
 *   11-Dec-98 keb  Added ASIANVERT1 and ASIANVERT2 for use with vertical 
 *                  writing code.
 *     05-Jan-99 slg    Add below-the-line option to build UFST as Windows DLL.
 *     18-Jan-99 slg    Modify #pragmas to handle MEM_ALIGN of 7.
 *   18-Feb-99 dlk  Removed pragma warning relating to CFF_RDR and the setting
 *                  of USE_UFST_MAPPING.  CFF processing now uncoupled from PS
 *                  TYPE 1 encoding array use.  Changed asociated comments.
 *   18-Feb-99 dlk  Reset to Standard Configuration settings.
 *   25-Mar=99 keb  Added below-the-line PSEUDO_HALF_WIDTH option for one customer  
 *   29-Mar-99 ks   Set CHAR_HANDLE = 1, CHAR_SIZE = 0.
 *     10-Jun-99 slg    Add below-the-line TT_SCREENRES flag (for special handling
 *                    of very-low-res TT screen fonts). Also permit Surfer build
 *                    under Visual C++.
 *     17-Jan-00 slg    Delete obsolete ASIANVERT, ASIANVERT1, ASIANVERT2 (for keb)
 *     28-Jan-00 jfd  Moved NO_SYMSET_MAPPING above dotted line.
 *     02-Feb-00 slg    Add two below-the-line defines: SWP799 (to use alternate 
 *                    screen-resolution-optimized rasterizer), SIMULDISKROM
 *                    (to enable simultaneous Disk/ROM access for MicroType).
 *                    Default values for both = DISABLED, initially.
 *     02-Feb-00 slg    Get rid of SIMULDISKROM define - simultaneous Disk/ROM
 *                    access will always be enabled.
 *   03-Feb-00 awr  Changed SWP799 to WINDCOMP
 *   10-Feb-00 awr  Removed PST1_ROM
 *   28-Sep-00 jfd  Added EMBEDDED_BITMAPS.
 *     29-Nov-00 slg  Removed lots of obsolete below-the-line options: PCLEO, 
 *                    PST1, FCO_TT, CP936_ENCODING, CP949_ENCODING, CP950_ENCODING
 *     04-Dec-00 slg    Added USE_RAW_GLYPHS option (for TT only); set ASIAN_ENCODING
 *                    to 1 if USE_RAW_GLYPHS is enabled (because 2-byte charcodes possible)
 *     09-May-01 slg    Got rid of below-the-line AGFATOOLS hack (solved problem
 *                    with better conditional compiles in our test tools)
 *     21-May-01 slg    Add PST1_RAM option to Disk/Rom options; also add PST1_RAM
 *                    to PST1_RDR and ROM defines 
 *   11-Jun-01 slg  Fix up PLUGINS definition: FCO portion of clause is now
 *                    (FCO_RDR && FCO_PLUGINS) rather than FCO_PLUGINS, which is
 *                    always true (as it indicates whether, if using MicroType, 
 *                    you want to use plugins)
 *  14-jun-01 SWP   above the line define's for NEW_PS_HINTS and HINT_DEBUG
 *    17-Jul-01 slg    move NEW_PS_HINTS and HINT_DEBUG below-the-line (since we
 *                    don't want these values to be modified by customers); 
 *                    set all defines to match target out-of-box values
 *  05-Dec-01 jfd   Added new directive STIK (for stick font support).
 *                  Added pragma to display message if STIK without TT_DISK,
 *                  TT_ROM or TT_ROM_ACT.
 *  23-Sep-02 jwd   Added configuration directive OPTIMIZE_FCOACCESS (below-the-line) to
 *                  enable/disable performance optimization in CGIFfco_Access().
 *  15-Aug-02 awr   Added DIMM_DISK
 *  25-Sep-02 jfd     Added new define SYMBOL_ENCODING.
 *  17-Oct-02 jfd     Added new define UCS4_ENCODING.
 *    19-Jun-03 slg    Remove obsolete conditions IVPNRUGX and NON_IF_FONT.
 *                    Centralize many local / semi-local debug flags (SHOWINPUT,
 *                    MEM_DUMP_INT, MEM_TRACE, PRINT_BUCKETS, 
 *                    DISPLAY_STATS, ASIAN_HASH_TRACE, 
 *                    MM_DIMFILE_DEBUG, MMDECODE_DEBUG, 
 *                    GRAYSTATS, GRAYSTATS_1, 
 *                    CHECK_MEMORY_GRAY, CHECK_MEMORY_ACT.
 *    26-Apr-04 slg    Add new (below-the-line) option IFBITSPLIT; remove temporary
 *                    flag NEW_PS_HINTS (new code is now the only option); remove
 *                    FCO_CURVE_DATA_RELEASE flag; replace some automatic setting 
 *                    of directives with #pragma tests (FIX_CONTOURS needs CGBITMAP
 *                    and CHAR_HANDLE; BOLD and GRAYSCALING both need NON_Z_WIND)
 *            
 */

#ifndef __CGCONFIG__
#define __CGCONFIG__

#include "MachMdl.h"

/****************************************************************************

ATTENTION:

Please read the following notice carefully before using this kit in any way. 

You will find evaluation software and fonts provided by Monotype Imaging in
this kit for which your company may not be licensed.

Therefore, you must make sure that you have a valid license to use any of the
software components or fonts. To ensure that you are licensed, or if you have
any questions regarding this notice, please contact your Monotype Imaging 
Business Manager directly. You may also contact us at www.monotypeimaging.com.

Thank you, from Monotype Imaging Inc.

****************************************************************************/


/*-------------------*/
/* Memory Management */
/*-------------------*/

/* Non-CG (external) memory management can be provided outside of the UFST  */
/* core and referenced via extmem.c by setting INT_MEM_MGT==0. C system     */
/* calls malloc & free can be the basis for external memory management.     */
#define INT_MEM_MGT       1  /* CG (Internal) memory management scheme      */
#define HUGE_PTR_SUPPORT  0  /* support > 64 KB memory blocks in 16-bit DOS */
#define DEFUND            0  /* requires INT_MEM_MGT==1                     */

/*  At least one of CACHE, CHAR_SIZE or CHAR_HANDLE must be set to 1        */
#define CACHE             1  /* CG caching of character bitmaps             */
#define CHAR_HANDLE       0  /* Non-caching character generation            */
#define CHAR_SIZE         0  /* char size info and bitmap generation        */

#define CACHE_BY_REF      0    /* if CACHE=1, and CACHE_BY_REF=0, use original caching */
                            /* if CACHE=1, and CACHE_BY_REF=1, use cache-by-reference-count */

/*------------------------*/
/* Floating Point Options */
/*------------------------*/
/* Non-CG (external) floating point processing can be provided outside of  */
/* the UFST core by setting INT_FP==0.  C system calls to floating point   */
/* functions can provide the same functionality.                           */
#define INT_FP            1   /* CG (internal) math package                */


/*---------------------------------*/
/* Bitmap and Outline Output Modes */
/*---------------------------------*/
#define CGBITMAP          1  /* generate bitmaps                            */
#define LINEAR            0  /* Linear outlines                             */
#define QUADRA            0  /* Quadratic outlines                          */
#define CUBIC             0  /* Cubic outlines                              */
#define GRAYSCALING       0  /* graymap output                              */

#define OLDATA            0  /* enable CG outline functions                 */
                             /* required if LINEAR, QUADRA or CUBIC == 1    */

#define TILE              0  /* generate characters in tiles                */

#define SPECIAL_EFFECTS   0  /* Allow generation of special effects, Emboss, Engrave, etc */
                             /* Can NOT be used with TILE or BANDING */

/* Bitmap size limits                                                     */
/* Maximum bitmap size specified as power of 2 (e.g., 16 == 64K-1 bytes)  */
/* For MSDOS, 16 is the recommended limit for MAX_BM_BITS.                */
/* For UNIX,  22 is the limit due the use of this define with long ints.  */
#define MAX_BM_BITS      22


/*------------------*/
/*  Plugin Options  */
/*------------------*/
#define SLIM_FONTS        1  /* Use HQ4 plugins, support HQ4 (S) libraries  */
#define CGFIXED_PITCH     1  /* Include support for Fixed Pitch plugins     */

#define TT_PLUGINS        0  /* TrueType Plugin Option
                              * 0 no plugins
                              * 2 TT plugins (LaserJet 4) -- TT format
                              */
#define PS_PLUGINS        0  /* PostScript: 0 no plugins, 1  IF plugins
                              *   3 PS plugins (Type 1 format)
                              */

/*------------------*/
/* Data Input Types */
/*------------------*/
/* Disk input                                                               */
//#define IF_DISK           1  /* Intellifont disk input                      */
//#define PST1_DISK         1  /* PostScript Type 1 disk input                */
//#define CFF_DISK          1  /* PostScript CFF disk input                   */
//#define TT_DISK           1  /* TrueType disk input                         */
//#define FCO_DISK          1  /* FCO disk input                              */
//#define T1MMASTER         0  /* type 1 multimaster                          */
//
//#define DIMM_DISK         0  /* font in rom uses disk i/o to access data    */
                             /* currently, this only works for TT_DISK mode */

#define IF_DISK           0  /* Intellifont disk input                      */
#define PST1_DISK         0  /* PostScript Type 1 disk input                */
#if defined(AGFA_FS)
#define CFF_DISK          0  /* PostScript CFF disk input                   */
#define TT_DISK           1  /* TrueType disk input                         */
#else
#define CFF_DISK          0  /* PostScript CFF disk input                   */
#define TT_DISK           0  /* TrueType disk input                         */
#endif
#define FCO_DISK          0  /* FCO disk input                              */
#define T1MMASTER         0  /* type 1 multimaster                          */

#define DIMM_DISK         0  /* font in rom uses disk i/o to access data    */
                             /* currently, this only works for TT_DISK mode */

/* FCO2==0: MICROTYPE1 Data Format (Version 0x13 and below); FCO2==1: MICROTYPE2 Data Format */
#define FCO2              1

/* PCLEO formatted input                                                    */
#define IF_PCLEOI         0  /* Intellifont PCLEXO input                    */
/*
NOTE:
   Only 1 form of type 1 downloaded soft font may be active at a time.
   PST1_SFNTI is for the generic downloaded soft fonts.
*/
#define PST1_SFNTI        0  /* PostScript type 1 soft font input           */
#define TT_PCLEOI         0  /* TrueType PCLEXO input                       */

/* ROM input */
#define IF_ROM            0  /* IF ROM input (Plugins, core fonts in ROM)   */
#define PST1_RAM          0  /* PostScript Type 1 RAM input                 */
#define CFF_ROM           0  /* PostScript CFF ROM input                    */
#define TT_ROM            1  /* TrueType ROM input                          */
#define FCO_ROM           1  /* FCO ROM input                               */
#define TT_ROM_ACT        0  /* AGFA Compressed TrueType ROM input          */

/* define NC_REWRITE to activate nested composite processing */
#define NC_REWRITE

/* Embedded bitmap support                                                  */
#define EMBEDDED_BITMAPS  1  /* TT Embedded bitmap input                    */

#define USE_RAW_GLYPHS    0  /* TT raw-glyph-index support (no CMAP table)  */

/*-----------------------*/
/* Miscellaneous Options */
/*-----------------------*/

#define SEGACCESS         0  /* allow independent access to IF segment data
                              * 0 no access
                              * 1 access via font id
                              * 2 access via pathname
                              */

#define FCOACCESS         0  /* allow independent access to FCO segment data
                              * 0 no access
                              * 1 access via pathname & fco_index
                              */

#define WIDTHS            1  /* allow independent access to width data      */
#define BOLD              0  /* allow pseudo emboldening                    */
#define BOLD_P6           0  /* emboldining for PCL 6 emulation             */
#define BOLD_HORIZONTAL   0

#define HP_4000           0  /* allow bucket searching and data scaling
                              * to emulate HP4000 (at 2048 design units).
                              * 0 = NO HP4000 emulation
                              * 1 = enable HP4000 emulation
                              *
                              * For use with FCO_DISK, or FCO_ROM.
                              * Also, DU_ESCAPEMENT should be set to 1.
                              */

#define DYNAMIC_FONTS     0  /* can use IF fonts, that are not in IF.FNT block */
#define NON_Z_WIND        1  /* specify non-zero winding transitions           */

/*--------------------------------*/
/* Scaling Paramater Input Format */
/*--------------------------------*/
/* Set SCALE_MATRIX to 0 for FONTCONTEXT compatible with Version 1.4
 * and earlier. Set to sum of any of the following 4
 * defines for the FONTCONTEXT types you wish to support.
 * Do Not Change the MATRIX types, only change SCALE_MATRIX.
 */
#define TYPO_SCALE_MATRIX    0x0001   /*  typographer                     */
#define MAT0_SCALE_MATRIX    0x0002   /*  matrix from design to output    */
#define MAT1_SCALE_MATRIX    0x0004   /*  matrix world->out and em box    */
#define MAT2_SCALE_MATRIX    0x0008   /*  matrix world->out and pt/size   */

#define SCALE_MATRIX      MAT1_SCALE_MATRIX

#define VLCOUTPUT         0    /* Very Large Character Output */

/*---------------------------*/
/* Raster Line Organizations */
/*---------------------------*/
/*  Character bitmaps produced by UFST are structured as a sequence of
 *  horizontal raster lines from top to bottom of the bitmap. Each raster
 *  line is structured as a sequence of bytes. Applications would like to
 *  retrieve 8, 16, 32 or 64 bit or larger portions of a raster line and 
 *  would like the bit ordering of the bits within these larger (than byte)
 *  portions to be defined by the application. RASTER_ORG controls the
 *  size of the raster "chunk". LEFT_TO_RIGHT_BIT_ORDER contrls the
 *  bit ordering within the "chunk".
 *
 *  Set RASTER_ORG to any of the 4 defines for the "chunk" size you wish to
 *  support. Do Not Change the CHUNK types, only change RASTER_ORG.
 *
 *  Set LEFT_TO_RIGHT_BIT_ORDER to 1 for left-to-right bit ordering, 0
 *  for right-to-left bit ordering.
 */

#define EIGHT_BIT_CHUNK     0x0001   /* 8-bit chunk (default) */
#define SIXTEEN_BIT_CHUNK   0x0002   /* 16-bit chunk          */
#define THIRTYTWO_BIT_CHUNK 0x0004   /* 32-bit chunk          */
#define SIXTYFOUR_BIT_CHUNK 0x0008   /* 64-bit chunk          */

#define RASTER_ORG    EIGHT_BIT_CHUNK
#define LEFT_TO_RIGHT_BIT_ORDER  1   /* 1 = left-to-right bit ordering  */
                                     /* within chunk, 0 = right-to-left */

/*--------------------------------------------*/
/* Scan Conversion and Output Coordinate size */
/*--------------------------------------------*/
/*  INTR_SIZE controls the precision at which Intelifont outlines are
 *  vectorized and scan converted.  It must be set to either 16 or 32.
 *  The operational limits are 999 point at 300dpi when set to 16 and
 *  999 point at 600dpi when set to 32.  If your processor's integer
 *  length is 32, then it is best for performance to set INTR_SIZE at
 *  32 regardless of your output size requirements.
 */

#define INTR_SIZE        32

/*------------------------*/
/* Font Metrics Precision */
/*------------------------*/
/*  If DU_ESCAPEMENT is set to 1, the escapement field of the character
 *  will be in the design units specified in "du_emx" and "du_emy" of the
 *  IFBITMAP/IFOUTLINE data structures. Thus, "escapement/du_emx" is the
 *  fraction of an em to escape. If DU_ESCAPEMENT is set to 0, then the
 *  escapement will be returned in 8782 units per em as is now.
 *
 */
#define DU_ESCAPEMENT     1  /* Escapement design units:                    */
                             /*  0 == use 8782/em, 1 == use native units    */

/*------------------------*/
/* Banding                */
/*------------------------*/
/*  This option will support caching of horizontal bands of character
 *  bitmaps. By a horizontal band, we mean a tile whose width is the
 *  entire width of the character bitmap.
 */
#define BANDING           0

/*------------------------*/
/* Font Bounding Box      */
/*------------------------*/
/*  If set to 1, this option supports the CGIFbound_box() function that
 *  returns an upper bound estimate of the font bounding box in output pixels.
 */
#define FONTBBOX          0

/*------------------------*/
/* Font Metrics           */
/*------------------------*/
/*  If set to 1, this option enables the function CGIFfont_metrics().
 */
#define FNT_METRICS       0

/* If GET_VERTICAL_METRICS is set to 1, vertical metrics (as well as horizontal
 metrics) will be returned in the IFOUTLINE and IFBITMAP structures. */

#define    GET_VERTICAL_METRICS 0

/* If DIRECT_TT_TABLE_ACCESS is set to 1, TrueType tables in ROM/RAM can be accessed 
directly (with memory pointers),by using the CGIFtt_query_direct() call.
 
Note that, even if DIRECT_TT_TABLE_ACCESS is not set, copies of TrueType tables 
can still be obtained by using the CGIFtt_query() call. */

#define DIRECT_TT_TABLE_ACCESS    0        

/*------------------------------*/
/* Application Generated Output */
/*------------------------------*/
/*  If set to 1, this option lets the app integrate its own character
 *  generation into UFST.
 */
#define ALIEN_BITS        0

/*-------------------------------------------------------------------------
USE_JUMP_TABLES was implemented for systems using overlay managers which
can not properly handle indirect calls through pointers. The default is
to use the jump tables by setting this value = 1. Setting the value = 0
will cause all calls to be made directly. The code size will be slightly
larger and the performance slightly faster.
---------------------------------------------------------------------------*/
#define USE_JUMP_TABLES   1


/*-------------------------------------------------------------------------
The USE_UFST_MAPPING options DO NOT apply to CFF processing.
---------------------------------------------------------------------------*/
#define USE_UFST_MAPPING  1     /* 1-PCL sym sets, 0-encoding array, 2-both */


/*
The following group of constants are used for PostScript Type 0 and
TrueType Asian font support.
*/

/*  These indicate the Font Encodings to support                                          */
#define SJIS_ENCODING     0     /* enable Kanji Shift-JIS encoded font support            */
#define JIS_ENCODING      0     /* enable Kanji JIS encoded font support                  */
#define EUC_ENCODING      0     /* enable Kanji EUC encoded font support                  */

#define BIG5_ENCODING     0     /* enable BIG5 encoded font support - Chinese (Hong Kong) */
#define TCA_ENCODING      0     /* enable TCA encoded font support - Taiwanese            */
#define GB_ENCODING       0     /* enable GB encoded font support - Chinese (Mainland)    */
#define K_ENCODING        0     /* enable K encoded font support - Korean (KSC, Wansung)  */
#define WANSUNG_ENCODING  0     /* enable WANSUNG encoded font support - Korean (WANSUNG) */
#define JOHAB_ENCODING    0     /* enable JOHAB encoded font support - Korean (JOHAB)     */

#define UNICODE_ENCODING  1     /* enable Asian UNICODE encoded font support              */

#define SYMBOL_ENCODING   0     /* enable Asian SYMBOL encoded font support               */

#define UCS4_ENCODING     0     /* enable Asian UCS4 encoded font support                    */

/* Transcoding Options */
/* This define indicates which Text Data Stream Encodings can be transcoded    */
/* to UNICODE values when the Text encoding DOES NOT match the Font Encoding   */
/* If any Asian encoding AND UNICODE_ENCODING are both turned on, then reverse */
/* transcoding (UNICODE-to-xxx) is also enabled */

#define UNICODE_MAPPING   0     /* Bits indicating appropriate transcodings
                                 * Set UNICODE_MAPPING to the numeric sum of
                                 * the options you want turned on.
                                 * (decimal values)
                                 *
                                 * 0 - No transcoding
                                 * 1 - JIS To Unicode transcoding
                                 * 2 - Big5 To Unicode transcoding
                                 * 4 - GB To Unicode transcoding
                                 * 8 - KSC To Unicode transcoding
                                 */

/*------------------------*/
/* Symbol Set Mapping     */
/*------------------------*/
#define NO_SYMSET_MAPPING 0     /* 0 - use UFST symbol sets for mapping */


/*------------------------*/
/* Stik font processing   */
/*------------------------*/
#define STIK              0     /* 1 - enable stick font processing */
#define CCC               1     /* 1 - enable CCC font processing   */

/*------------------------*/
/* linked font              */
/*------------------------*/
#define LINKED_FONT          0        /* 1 - enable linked TT fonts */


/*------------------------*/
/*------------------------*/
/* Contour fixing         */
/*------------------------*/
#define FIX_CONTOURS      0     /* 1 - enable fixing of badly wound contours */

#define TT_SCREENRES      0    /* enable special processing for TT at very small screen resolutions?  */

/* The default for UFST_REENTRANT is 0 - this will build UFST in the usual way,
operating on a single global copy of the IF_STATE structure. In order to build
with UFST_REENTRANT on, your application needs to create its own instances of
the IF_STATE structure, and pass a pointer to an instance when calling UFST.
*/ 

#define UFST_REENTRANT    0

/* The default for UFST_MULTITHREAD is 0 - this will build UFST in the usual way,
operating on a single global copy of thte IF_STATE structure. In order to build
with UFST_MULTITHREAD on, your application needs to create its own instances of
the IF_STATE structure, and pass a pointer to an instance when calling UFST.
To get a multi-thread safe version, define the following -- requires UFST_REENTRANT */

#define UFST_MULTITHREAD  0

/**************************************************************************/
/**--**--**              DO NOT CHANGE below this line.          **--**--**/

/***** start of private debug-flag section *****/

/* define to enable hint debugging in PostScript code */
#undef HINT_DEBUG

/* for LOTS of debugging information, define AGFADEBUG here, 
    and set if_state.trace_sw by using the UFST_debug_on() API call. */
#undef AGFADEBUG

/* Note that some of the debug options will only print output if the standard
    debug is enabled (i.e., if AGFADEBUG is defined, and if_state.trace_sw is set
    by using the UFST_debug_on() API call) */

#define SHOWINPUT        0        /* set to 1 to print out Type1 input in t1iscan.c */
#define NZ_DUMP            0        /* set to 1 to dump lists in nzwind.c */

#define CHECK_MEM_EXT    0        /* set to 1 for external-memory overwrite check */
#define MEM_TRACE       0          /* set to 1 to trace MEMalloc() & MEMfree() */
#define PRINT_BUCKETS    0        /* set to 1 to print out all buckets */
#define DISPLAY_STATS   0          /* set to 1 to display linked-list ptrs in dll.c */
                                /* in insert_at_head_of_list(), remove_from_list() */

#define ASIAN_HASH_TRACE  0      /* set to 1 to trace the Asian Hash Table */

#undef MM_DIMFILE_DEBUG            /* define to enable MT debug in fc_da.c */
#undef MMDECODE_DEBUG            /* define to enable MT debug in fc_intf2.c, fc_da.c */
                                /* MMDECODE_DEBUG uses "mmdecode_trace_sw" global vbl */

#define GRAYSTATS   0           /* set to 1 to enable grayscale #-of-pixels stats */
                                /* GRAYSTATS uses externally-defined "char_ct" global vbl */
#define GRAYSTATS_1 0           /* set to 1 to enable grayscale memory stats */
#define CHECK_MEMORY_GRAY 0      /* set to 1 for grayscale memory check in graymap.c */

#undef    CHECK_MEMORY_ACT        /* define for ACT memory check in memory.c */

/***** end of debug-flag section *****/

#define IFBITSPLIT    0        /* split IFBITMAP into 2 structures? (header/bitmap) */

/* define to force align to 32-bit boundaries for global tables in TTPCLEOs */
#define ALIGN_TTPCLEO_TABLES    0

#define PSEUDO_HALF_WIDTH 0

/* should we bring WINDCOMP above-the-line in the next release? */
/* define WINDCOMP to use alternate (screen-resolution-optimized) rasterizer */
#undef WINDCOMP       

#define OPTIMIZE_FCOACCESS 0     /* 02-11-02 jfd/jwd */

#define WIDTH_NOSYMMAP       0    /* currently-unused variant of CGIFwidth function */
                                /* (designed to work with old NO_SYMSET_MAPPING option) */

#define FCO_PREALLOCATE        0    /* performance improvement for MicroType: if set to 1, 
                                    preallocate certain buffers rather than reallocating
                                    them for each character processed    */

#define    PS_ERRORCHECK    0    /* if set to 1, enable additional errorchecking of PostScript 
                                    input (initially, Type1 stackchecking) */

#define USBOUNDBOX     0        /* AJ - 10/04/04 */
#define THREAD_DUMP    0        /* 10-22-04 jfd */

/*-----------------------------*/
/* Dependent and Fixed Defines */
/*-----------------------------*/

#define COMPRESSED_CACHE  0
#define BOLD_FCO          0     /* emboldening for MicroType */

/* Max size of bitmap in bytes. Relies on previously defined MAX_BM_BITS */
#define MAX_BM          (UL32)((1 << (UL32)MAX_BM_BITS) - 1)

#define IF_RDR          (IF_DISK || IF_PCLEOI || IF_ROM)
#define PST1_RDR        (PST1_DISK || PST1_RAM || PST1_SFNTI || CFF_DISK || CFF_ROM)
#define CFF_RDR         (CFF_DISK || CFF_ROM)
#define TT_RDR          (TT_DISK || TT_PCLEOI || TT_ROM || TT_ROM_ACT)
#define FCO_RDR         (FCO_DISK || FCO_ROM)

#define PS_RESIDENT        (PST1_DISK || PST1_RAM || CFF_DISK || CFF_ROM)    

#if CFF_RDR
#undef T1MMASTER
#define T1MMASTER 1
#endif 

/* 1-PCL sym sets, 0-encoding array, 2-both */
#define USE_PS_ARRAY    ((USE_UFST_MAPPING == 0) || (USE_UFST_MAPPING == 2)) 
#define USE_PS_SYMSET    ((USE_UFST_MAPPING == 1) || (USE_UFST_MAPPING == 2))        

#define FCO_PLUGINS        1        /* Default values are ALWAYS 1 */
#define FCO_CONVERGENTFONT 1
#define FCO_CURVESHARE     1


/*
   Curve data compression is a FCO post-process that works for:
      Microtype  I's version 0x13 FCOs ( FCO2 == 0 ), and
      Microtype II's version 0x14 FCOs ( FCO2 == 1 ).
   UFST code can process either version of FCOs with or without
   curve data compression. Although this configuration was used
   during development, it is not suitable for release. The release
   version for Microtype I uses uncompressed FCOs, and the release
   version for Microtype II uses compressed FCOs.
*/

#define COMPRESSED            (0x01)
#define UNCOMPRESSED          (0x10)

#if FCO2
#define FCO_CURVE_DATA  ( COMPRESSED )
#else
#define FCO_CURVE_DATA  ( UNCOMPRESSED )
#endif

#define FCO_STANDALONE    0    /* set this to 1 ONLY if building "fcodump2" */

#define DISK_FONTS      (IF_DISK || PST1_DISK || CFF_DISK || TT_DISK || FCO_DISK)
#define PCLEO_RDR       (IF_PCLEOI || PST1_SFNTI || TT_PCLEOI)
#define ROM             (IF_ROM || PST1_RAM || CFF_ROM || TT_ROM || FCO_ROM || TT_ROM_ACT)

#define PLUGINS         (IF_RDR || TT_PLUGINS || PS_PLUGINS || (FCO_RDR && FCO_PLUGINS))
#define TT_NOPLUG       (TT_PLUGINS == 0)
#define TT_TTPLUG       (TT_PLUGINS == 2)
#define PS_NOPLUG       (PS_PLUGINS == 0)
#define PS_IFPLUG       (PS_PLUGINS == 1)
#define PS_MTPLUG       (PS_PLUGINS == 2)
#define PS_PSPLUG       (PS_PLUGINS == 3)


/* Set OUTLINE if any of the outline options have been specified.         */
#define OUTLINE         (LINEAR || QUADRA || CUBIC)

#define SMEAR_BOLD      (BOLD_P6 || BOLD_HORIZONTAL)

#define ASIAN_ENCODING  \
   (SJIS_ENCODING || JIS_ENCODING || EUC_ENCODING || GB_ENCODING\
    || UNICODE_ENCODING || BIG5_ENCODING || TCA_ENCODING\
    || K_ENCODING || WANSUNG_ENCODING || JOHAB_ENCODING || SYMBOL_ENCODING\
    || UCS4_ENCODING || USE_RAW_GLYPHS)

#if !defined(ASIAN_ENCODING)
#define ASIAN_ENCODING 0
#endif

#define USE_ASIAN_CACHE (ASIAN_ENCODING || NO_SYMSET_MAPPING)

/*
 * Unicode mapping required whenever a variety of encodings
 * are specified.  This turns on the reverse direction transcoding
 * capabilities so that UFST can do UNICODE-to-'XXX', as well as
 * 'XXX'-to-UNICODE transcoding.
 */
#define UNICODE_IN      \
   ((SJIS_ENCODING || JIS_ENCODING  || EUC_ENCODING || K_ENCODING \
                   || BIG5_ENCODING || GB_ENCODING ) && UNICODE_ENCODING)

/*-------------------------------------------------------------------*/
/*       Build-DLL options                                             */
/*-------------------------------------------------------------------*/
/* defines for possible values of UFST_LINK_MODE */
#define UFST_STATIC_LINK    0    /* use this to build static-linked UFST libraries/apps */
#define UFST_BUILD_DLL        1    /* use this to build UFST libraries as DLL */
#define UFST_DLL_CLIENT        2    /* use this to build UFST application to use UFST DLL */

/* "UFST_LINK_MODE" should be set to "UFST_STATIC_LINK", unless you are building
a Windows UFST application that uses UFST as a DLL (for example, in a multi-
threaded application). In that case, you must build the UFST DLL with this flag
set to "UFST_BUILD_DLL", but build the application with it set to "UFST_DLL_CLIENT". */
 
#define UFST_LINK_MODE    UFST_STATIC_LINK

/*-------------------------------------------------------------------*/
/*               Test for invalid switch settings                    */
/*-------------------------------------------------------------------*/

#ifndef SUN        /* no #pragma on standard Sun C compiler   -ss 12/4/91 */

#if (DEFUND && !INT_MEM_MGT)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   INT_MEM_MGT must be 1 if DEFUND is 1!")
#pragma message("   ****************************************************\n")
#endif

#if (DEFUND && CACHE && CACHE_BY_REF)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   CACHE_BY_REF option is incompatible with DEFUND!")
#pragma message("   ****************************************************\n")
#endif

#if (!CACHE && !CHAR_SIZE && !CHAR_HANDLE)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   At least one of CACHE, CHAR_SIZE or CHAR_HANDLE must be 1!")
#pragma message("   ****************************************************\n")
#endif

#if (!CGBITMAP && !OUTLINE && !GRAYSCALING)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   At least one of CGBITMAP, OUTLINE or GRAYSCALING must be 1!")
#pragma message("   ****************************************************\n")
#endif

/*
#error CGCONFIG: MEM_ALIGN must be 0, 1, 3, or 7!
*/

/*
#error CGCONFIG: If MEM_ALIGN = 32-bit or 64-bit alignment, HUGE_POINTER_SUPPORT must be off!
*/

#if ((INTR_SIZE != 16) && (INTR_SIZE != 32))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   INTR_SIZE must be defined as 16 or 32")
#pragma message("   ****************************************************\n")
#endif

#if (BANDING && (!TILE || !CACHE))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   TILE and CACHE must be 1 if BANDING is 1!")
#pragma message("   ****************************************************\n")
#endif

#if (SPECIAL_EFFECTS && (TILE || BANDING))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use SPECIAL_EFFECTS with TILE or BANDING")
#pragma message("   ****************************************************\n")
#endif

#if (defined(WINDCOMP) && SMEAR_BOLD)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use BOLD_P6 or BOLD_HORIZONTAL with WINDCOMP")
#pragma message("   ****************************************************\n")
#endif

#if (STIK && !(TT_DISK || TT_ROM || TT_ROM_ACT))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use STIK without TT_DISK, TT_ROM or TT_ROM_ACT")
#pragma message("   ****************************************************\n")
#endif

#if (LINKED_FONT && !(TT_RDR && UNICODE_ENCODING))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use LINKED FONT without TT_RDR and UNICODE_ENCODING turned on")
#pragma message("   ****************************************************\n")
#endif

#if (FIX_CONTOURS && !(CGBITMAP && CHAR_HANDLE))
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use FIX_CONTOURS without CGBITMAP and CHAR_HANDLE turned on")
#pragma message("   ****************************************************\n")
#endif

#if (BOLD && !NON_Z_WIND)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use BOLD without NON_Z_WIND turned on")
#pragma message("   ****************************************************\n")
#endif

#if (GRAYSCALING && !NON_Z_WIND)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use GRAYSCALING without NON_Z_WIND turned on")
#pragma message("   ****************************************************\n")
#endif

#if (IF_ROM && IF_DISK)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use IF_ROM and IF_DISK options together\n")
#pragma message("   ****************************************************\n")
#endif

#if (DISK_FONTS && ROM && PS_IFPLUG)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use PS_IFPLUG option in a mixed disk/ROM configuration\n")
#pragma message("   ****************************************************\n")
#endif

#if (FCO_PREALLOCATE && USBOUNDBOX)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use FCO_PREALLOCATE and USBOUNDBOX options together (at this time)\n")
#pragma message("   ****************************************************\n")
#endif

#if (UFST_MULTITHREAD && !UFST_REENTRANT)
#pragma message("\n   ****************************************************")
#pragma message("   Configuration error in CGCONFIG.H :")
#pragma message("   Can not use UFST_MULTITHREAD without UFST_REENTRANT")
#pragma message("   ****************************************************\n")
#endif

#endif  /* !SUN  */

#endif    /* __CGCONFIG__ */

  • 10
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值