- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
TEST15.C
资源名称:ertos.rar [点击查看]
上传用户:sunrenlu
上传日期:2022-06-13
资源大小:1419k
文件大小:1k
源码类别:
操作系统开发
开发平台:
DOS
- /*
- * Test15 - creates an INI file with three sections
- * - then reads an entry from the middle section
- * - finally demonstrates changing a value 5 times
- */
- #include <stdio.h>
- #include <string.h>
- #include <conio.h>
- #include <rtos.h>
- #include <inifile.h>
- main()
- {
- char *filename = "test15.ini";
- char *t;
- DWORD i, j;
- rt_init(100);
- cprintf("first we making sample config filern");
- /* make 3 sections, and we will later read from middle one */
- SetIniString( filename, "top","topic", "read failed, got top" );
- SetIniString( filename, "mid","topic", "read worked, got middle" );
- SetIniString( filename, "bottom","topic", "read failed, got botom" );
- /* throw in another string to confuse things */
- SetIniString( filename, "mid","topic2", "another key in mid" );
- t = GetIniString( filename, "mid", "topic", NULL );
- cprintf("Searching for mid, topic gets '%s'rn", t ? t : "<empty>");
- SetIniString( filename, "mid","topic", "write worked" );
- t = GetIniString( filename, "mid", "topic", "default" );
- cprintf("Searching for mid, topic gets '%s'rn", t ? t : "<empty>");
- for ( i = 0 ; i < 5 ; ++i ) {
- SetIniDWORD(filename, "mid", "count", i );
- j = GetIniDWORD(filename,"mid", "count", 0xffffffff );
- cprintf(" wrote %lu and read = %lurn", i, j );
- }
- }