void XsiExp::WriteConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) { return; } // Write CFG version _putw(CFG_VERSION, cfgStream); fputc(GetIncludeAnim(), cfgStream); fputc(GetIncludeVertexColors(), cfgStream); fputc(GetAlwaysSample(), cfgStream); _putw(GetMeshFrameStep(), cfgStream); _putw(GetKeyFrameStep(), cfgStream); _putw(GetPrecision(), cfgStream); fclose(cfgStream); }
void registrasi_anggota() { int i; if(node_index==0) { reg_input(); awal=temp; temp->next=NULL; akhir=temp; node_index++; baca=fopen("db_akun.dat","w+"); fseek(stdin,0,SEEK_END); fwrite(temp,sizeof(struct akun),1,baca); fclose(baca); baca=fopen("people_index.dat","w+"); fseek(stdin,0,SEEK_END); _putw(node_index,baca); fclose(baca); } else if(node_index>0) { reg_input(); temp->next=NULL; akhir->next=temp; akhir=temp; node_index++; baca=fopen("db_akun.dat","w+"); fseek(stdin,0,SEEK_END); fwrite(temp,sizeof(struct akun),1,baca); fclose(baca); baca=fopen("people_index.dat","w+"); fseek(stdin,0,SEEK_END); _putw(node_index,baca); fclose(baca); } printf("\nMenyimpan data"); for(i=0; i<3; i++) { printf("."); Sleep(900); } printf("\n\nData anda telah disimpan !"); getch(); system("cls"); menu_utama(); }
void AscOut::WriteConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) return; // Write CFG version _putw(CFG_VERSION, cfgStream); _putw(GetPrecision(), cfgStream); fclose(cfgStream); }
void CVDExporter::SaveExporterConfig() { // Open the configuration file for writing TSTR filename = GetConfigFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) return; // Write CFG version _putw(CFG_VERSION, cfgStream); _putw(searchtype, cfgStream); fclose(cfgStream); }
void main() { FILE *fp; int c; fp = fopen( "file", "r" ); if( fp != NULL ) { while( (c = _getw( fp )) != EOF ) _putw( c, stdout ); fclose( fp ); } }
void SkeletonExporter::SaveExporterConfig() { // Open the configuration file for writing TSTR filename = GetConfigFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) return; // Write CFG version _putw(CFG_VERSION, cfgStream); fputc(makeADM, cfgStream); fputc(makeADL, cfgStream); fputc(makeADO, cfgStream); //fputc(makeADD, cfgStream); fputc(makeADP, cfgStream); fputc(makeADS, cfgStream); fputc(makeRAY, cfgStream); fclose(cfgStream); }
void FormatOutputValue( BasicType basicType, DWORD64 length, PVOID pAddress ) { // Format appropriately (assuming it's a 1, 2, or 4 bytes (!!!) if( basicType == btNoType ) { _printf( " = 0x%p (NoType)", (PVOID) pAddress ); } else if( !IsBadReadPtr( (PVOID) pAddress, (UINT_PTR) length ) ) { switch( basicType ) { case btBool: _printf( "%s", ( *(bool*) pAddress ) ? "true" : "false" ); break; case btInt: case btLong: switch( length ) { case 2: _printf( "%d", INT32( *(INT16*) pAddress ) ); break; case 4: _printf( "%d", *(INT32*) pAddress ); break; case 8: _printf( "%ld", *(LONG*) pAddress ); break; default: _printf( "0x%p (Length = %d)", *(PBYTE) pAddress, length ); break; } break; case btUInt: case btULong: switch( length ) { case 2: _printf( "%u", xgc_uint32( *(UINT16*) pAddress ) ); break; case 4: _printf( "%u", *(xgc_uint32*) pAddress ); break; case 8: _printf( "%lu", *(ULONG*) pAddress ); break; default: _printf( "0x%p (Length = %d)", *(PBYTE) pAddress, length ); break; } break; case btFloat: switch( length ) { case 4: _printf( "%f", *(FLOAT*) pAddress ); break; case 8: _printf( "%lf", *(xgc_real64*) pAddress ); break; default: _printf( "0x%p (Length = %d)", *(PBYTE) pAddress, length ); break; } break; case btChar: if( !IsBadReadPtr( (PSTR) pAddress, (UINT_PTR) length ) ) for( int n = 0; n < length && ( (CHAR*) pAddress )[n]; ++n ) { if( ( (CHAR*) pAddress )[n] == '\n' ) _printf( "\\n" ); else if( ( (CHAR*) pAddress )[n] == '\r' ) _printf( "\\r" ); else _putc( ( (CHAR*) pAddress )[n] ); } else _printf( " = 0x%p (Bad String)", *(PDWORD) pAddress ); break; case btWChar: if( !IsBadReadPtr( (PWSTR) pAddress, (UINT_PTR) length ) ) for( int n = 0; n < length / 2 && ( (WCHAR*) pAddress )[n]; ++n ) _putw( ( (WCHAR*) pAddress )[n] ); else _printf( "0x%p (Bad String)", *(PDWORD) pAddress ); break; default: _printf( "0x%p (Length = %d)", (LPVOID) pAddress, length ); break; } } }