home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / generic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-16  |  4.0 KB  |  80 lines

  1. #pragma info( none )
  2. #ifndef __CHKHDR__
  3.    #pragma info( none )
  4. #endif
  5. #pragma info( restore )
  6.  
  7. #ifndef __generic_h
  8.    #define __generic_h
  9.  
  10.    /********************************************************************/
  11.    /*  <generic.h> header file                                         */
  12.    /*                                                                  */
  13.    /*  VisualAge for C++ for Windows, Version 3.5                      */
  14.    /*    Licensed Material - Property of IBM                           */
  15.    /*                                                                  */
  16.    /*  5801-ARR and Other Materials                                    */
  17.    /*                                                                  */
  18.    /*  (c) Copyright IBM Corp 1991, 1996. All rights reserved.         */
  19.    /*                                                                  */
  20.    /*                                                                  */
  21.    /*                                                                  */
  22.    /*  Licensed Materials - Property of USL                            */
  23.    /*                                                                  */
  24.    /*  Standard Class Library Version 3.0                              */
  25.    /*  Copyright (C) Unix System Laboratories Inc. 1991.               */
  26.    /*  All rights reserved                                             */
  27.    /*                                                                  */
  28.    /********************************************************************/
  29.  
  30.    /**************************************************************************/
  31.    /*  C++ source for the C++ Language System, Release 3.0.  This product    */
  32.    /*  is a new release of the original cfront developed in the computer     */
  33.    /*  science research center of AT&T Bell Laboratories.                    */
  34.    /*                                                                        */
  35.    /*  Copyright (c) 1991 AT&T and UNIX System Laboratories, Inc.            */
  36.    /*  Copyright (c) 1984, 1989, 1990 AT&T.  All Rights Reserved.            */
  37.    /*                                                                        */
  38.    /*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of AT&T and UNIX System   */
  39.    /*  Laboratories, Inc.  The copyright notice above does not evidence      */
  40.    /*  any actual or intended publication of such source code.               */
  41.    /*                                                                        */
  42.    /*  UNIX is a registered trademark of UNIX System Laboratories, Inc.      */
  43.    /*                                                                        */
  44.    /*  ident "@(#)C++env:incl-master/proto-headers/generic.h 1.1"            */
  45.    /**************************************************************************/
  46.  
  47.    /* macros to paste tokens together to form new names */
  48.  
  49.    /* ANSI C preprocessors will not expand the arguments to a macro;
  50.     * so we need to add a level of indirection to allow macro expansion of
  51.     * arguments.  (Reiser preprocessors allowed the first arg to be expanded;
  52.     * this method will allow both to be expanded, which is better than none.)
  53.     */
  54.    #define name2(a,b)      _name2_aux(a,b)
  55.    #define _name2_aux(a,b)      a##b
  56.    #define name3(a,b,c)    _name3_aux(a,b,c)
  57.    #define _name3_aux(a,b,c)    a##b##c
  58.    #define name4(a,b,c,d)  _name4_aux(a,b,c,d)
  59.    #define _name4_aux(a,b,c,d)  a##b##c##d
  60.  
  61.    #define declare(a,t) name2(a,declare)(t)
  62.    #define implement(a,t) name2(a,implement)(t)
  63.    #define declare2(a,t1,t2) name2(a,declare2)(t1,t2)
  64.    #define implement2(a,t1,t2) name2(a,implement2)(t1,t2)
  65.  
  66.    extern int genericerror(int,char*);
  67.    typedef int (* GPT)(int,char*);
  68.    #define set_handler(generic,type,x) name4(set_,type,generic,_handler)(x)
  69.    #define errorhandler(generic,type) name3(type,generic,handler)
  70.    #define callerror(generic,type,a,b) (*errorhandler(generic,type))(a,b)
  71.  
  72. #endif
  73.  
  74. #pragma info( none )
  75. #ifndef __CHKHDR__
  76.    #pragma info( restore )
  77. #endif
  78. #pragma info( restore )
  79.  
  80.