static void DumpBaseType( TYPEPTR typ, STRCHUNK *pch ) { SYM_ENTRY sym; TYPEPTR obj; for( ; typ->decl_type != TYPE_TYPEDEF && typ->decl_type != TYPE_ENUM; ) { obj = Object( typ ); if( obj == NULL ) break; typ = obj; } SKIP_DUMMY_TYPEDEFS( typ ); if( typ->decl_type == TYPE_TYPEDEF ) { SymGet( &sym, typ->u.typedefn ); ChunkSaveStrWord( pch, SymName( &sym, typ->u.typedefn ) ); } else { if( typ->type_flags & TF2_TYPE_PLAIN_CHAR ) { ChunkSaveStrWord( pch, "char" ); } else { ChunkSaveStrWord( pch, CTypeNames[typ->decl_type] ); } if( typ->decl_type == TYPE_STRUCT || typ->decl_type == TYPE_UNION || typ->decl_type == TYPE_ENUM ) { /* if there is no tag name, then should print out the entire structure or union definition or enum list */ DumpTagName( typ->u.tag->name, pch ); } } }
static void DumpTagName( char *tag_name, STRCHUNK *pch ) { if( *tag_name == '\0' ) { if (do_message_output) tag_name = "{...}"; else tag_name = "_no_name_"; } ChunkSaveStrWord( pch, tag_name ); }
static void DumpParmTags( TYPEPTR *parm, FILE *fp ) { TYPEPTR typ; STRCHUNK chunk; char *result; if( parm != NULL ) { for( ; (typ = *parm) != NULL; ) { typ = TrueType( typ ); if( typ->decl_type == TYPE_STRUCT || typ->decl_type == TYPE_UNION ) { ChunkInit(&chunk); ChunkSaveStrWord( &chunk, CTypeNames[typ->decl_type] ); DumpTagName( typ->u.tag->name, &chunk ); result = ChunkToStr( &chunk ); fprintf( fp, "%s;\n", result ); CMemFree( result ); } ++parm; } } }
static void put_keyword( int keyword, STRCHUNK *pch ) { ChunkSaveStrWord( pch, Tokens[keyword] ); }