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

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <ctype.h>
  6. #include <assert.h>
  7.  
  8. #include "data.h"
  9. #include "err.h"
  10.  
  11. /*
  12.  *    引数のチェックルーチン
  13.  */
  14. void    ArgCheck( name, args, buf, type1 )
  15. char        *name ;
  16. int            args ;
  17. DataStruct    *buf ;
  18. int            type1 ;
  19. {
  20.     int        i, *types ;
  21.  
  22.     types = &type1 ;
  23.  
  24.     for( i = 0 ; i < args ; i++ )
  25.     {
  26.         if ( buf->type == TYPE_NOASN )
  27.             ExecError( "引数の数が不正です。( %s )", name );
  28.         if ( ( buf->type & *types ) == 0 )
  29.             ExecError( "%d 番目の引数の型が不正です。( %s )", i+1, name );
  30.         buf++ ;
  31.         types++ ;
  32.     }
  33.     if ( *types != TYPE_NOASN )
  34.         ExecError( "引数の数が不正です。( %s )", name );
  35. }
  36.