watlib.h

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 361 行 · 第 1/2 页

H
361
字号
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


// WATLIB.H -- definitions for WATCOM Library
//
// 88/12/12 -- J.W.Welch        -- defined
// 89/09/27 -- J.W.Welch        -- added _FARD for optional TSR support
// 90/05/11 -- J.W.Welch        -- added optional definition for
//                                 __SMALL_DATA__ to indicate a small data
//                                 model
// 90/06/29 -- J.W.Welch        -- added ptr_to_FARD macro
// 91/04/18 -- J.W.Welch        -- add BORLAND support

#if defined( __BORLANDC__ )
    #include "bc_defn.h"
#endif

#include <stdlib.h>
#include <stddef.h>

#if defined( __386__ )
  #undef far
  #undef near
  #define far
  #define near
#endif

#define TRUE  1
#define FALSE 0

#if defined(__SMALL__) || defined(__MEDIUM__)
 #define __SMALL_DATA__
#endif

#if defined( TSR )
        #define _FAR        far
        #define _FARD       far
        #define _NR( text ) (void near *)text
        #if defined( __SMALL_DATA__ )
            #define ptr_to_FARD( ptr ) near_to_far( ptr )
        #else
            #define ptr_to_FARD( ptr ) ( ptr )
        #endif
#else
        #define _FAR
        #define _FARD
        #define _NR( text ) text
        #define ptr_to_FARD( ptr ) ( ptr )
#endif

void        BreakDisable(                               // disable breaks
              void );
void        BreakEnable(                                // enable breaks
              void );
void        cr_err_enable(                              // enable crit. errs
              void );
void        cr_err_disable(                             // disable crit. errs
              void );
void        display_messages(                           // display msg.s
              char _FARD * _FARD * msg_vector );        // - vector of msg.s
void        farmove(                                    // MOVE A FAR AREA
              void far *tgt,                            // - target
              const void far *src,                      // - source
              unsigned size );                          // - size
const void far *_fscan_over_black_space(    // SCAN OVER FAR BLACK SPACE
              const void far *src );        // - source ptr
const void far *_fscan_over_white_space(    // SCAN OVER FAR WHITE SPACE
              const void far *src );        // - source ptr
int         file_pattern_match(                         // IS FILE IN PATTERN?
              char _FARD *file,                         // - filename
              char _FARD *file_pattern );               // - file pattern
void       *_get_environ_begin                          // INIT. _get_environ
              ( void );
void        _get_environ_end(                           // FINI. _get_environ
              void  *env_var );                         // - environ pointer
char       *_get_environ_next(                          // GET NEXT ENV. VAR.
              char  *  *curr );                         // - current
int         inside_unsigned(                            // TEST FOR INCLUSION
              unsigned value,                           // - test value
              unsigned b_1,                             // - bound[1]
              unsigned b_2 );                           // - bound[2]
int         isblank(                                    // test if blank vect.
              const char _FARD *vector,                 // - vector
              unsigned vector_size );                   // - vector size
void        _llist_walk(                                // TRAVERSE LINK-LIST
              void _FARD * _FARD *list_hdr,             // - list hdr.
              void (_FAR *walker)(                      // - walking routine
                    void _FARD *element ) );            // - - passed element
int         maximum(                                    // max. function
              int v1,                                   // - arg[1]
              int v2 );                                 // - arg[2]
#if defined( __SMALL_DATA__ )
    void far *memcpy_fn(                                // COPY NEAR TO FAR
        void far *tgt,                                  // - target
        const void *src,                                // - source
        unsigned size );                                // - size of source
    void *memcpy_nf(                                    // COPY FAR TO NEAR
        void *tgt,                                      // - target
        const void far *src,                            // - source
        unsigned size );                                // - size of source
#else
    #define memcpy_fn memcpy
    #define memcpy_nf memcpy
#endif
void        memory_check(                               // CHECK MEMORY
                void );
int         memsamechar(                                // test if filled
              const void _FARD *block,                  // - memory block
              int test_char,                            // - fill character
              unsigned size );                          // - size of block
int         minimum(                                    // min. function
              int v1,                                   // - arg[1]
              int v2 );                                 // - arg[2]
int         msgerr(                                     // DISPLAY ERR MSG
              const char _FARD *error_message );        // - error message
int         msgerr_count(                               // GET # ERRORS
              void );
int         msgerr_list(                                // DISPLAY ERR MSG
              const char _FARD *frag, ... );            // - message fragments
void        msgerr_return(                              // SET RETURN FOR ERR
              int return_code );                        // - return code
int         msgerr_vlist(                               // DISPLAY ERROR MSG.
              const char _FARD * _FARD *frags );        // - fragments list
void        msgbare(                                    // DISPLAY BARE MSG
              const char _FARD *bare_message );         // - error message
void        msgbare_list(                               // DISPLAY BARE MSG
              const char _FARD *frag, ... );            // - message fragments
void        msgbare_vlist(                              // DISPLAY BARE MSG.
              const char _FARD * _FARD *frags );        // - fragments list
void        msgnote(                                    // DISPLAY NOTE MSG
              const char _FARD *error_message );        // - error message
void        msgnote_list(                               // DISPLAY NOTE MSG
              const char _FARD *frag, ... );            // - message fragments
void        msgnote_vlist(                              // DISPLAY NOTE MSG.
              const char _FARD * _FARD *frags );        // - fragments list
void        msg_progname(                               // SET MSG. PGM. NAME
              const char _FARD *name );                 // - program name
void        msgwarn(                                    // DISPLAY WARN MSG
              const char _FARD *error_message );        // - error message
void        msgwarn_list(                               // DISPLAY WARN MSG
              const char _FARD *frag, ... );            // - message fragments
void        msgwarn_vlist(                              // DISPLAY WARN MSG.
              const char _FARD * _FARD *frags );        // - fragments list
void far *  near_to_far(                                // NEAR TO FAR POINTER
              void near *ptr );                         // - the near pointer
char _FARD *pgm_directory(                              // GET LOAD DIRECTORY
              char _FARD *dir );                        // - directory
void        _ring_add(                                  // add element to ring
              void _FARD * _FARD * _FARD *header,       // - addr( ring hdr. )
              void _FARD * _FARD * new_element );       // - element
void _FARD *_FARD * _ring_alloc(                        // allocate ring elem.
              void _FARD * _FARD * _FARD *header,       // - addr( ring hdr. )

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?