home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / POLYEDIT.LZH / ML / CLASS.C < prev    next >
C/C++ Source or Header  |  1994-05-28  |  720b  |  41 lines

  1. /*
  2.  *        クラス制御
  3.  *
  4.  *        T.Kobayashi        1994.5.21
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include <stdlib.h>
  10. #include <assert.h>
  11.  
  12. #include "data.h"
  13. #include "err.h"
  14.  
  15. #include "inlib.h"
  16.  
  17. Class    ClassList[MAX_CLASS] ;
  18.  
  19. /*    クラス登録    */
  20. int        ObjectSetClass( name, funcs, parent )
  21. char    *name ;    /*    クラス名            */
  22. int        funcs ;    /*    メンバ関数の最大値    */
  23. int        parent ;
  24. {
  25.     int        i ;
  26.  
  27.     for( i = 0 ; i < MAX_CLASS ; i++ )
  28.     {
  29.         if ( ClassList[i].name == NULL )
  30.         {
  31.             ClassList[i].name = name ;
  32.             ClassList[i].funcs = funcs ;
  33.             ClassList[i].parent = parent ;
  34.             ClassList[i].func = FunctionAlloc( funcs );
  35.             return i ;
  36.         }
  37.     }
  38.     ParseFatal( "新しいクラスが登録できません。" );
  39.     return -1 ;
  40. }
  41.