Last change
on this file since 2082 was 1079, checked in by Bruno Cornec, 18 years ago |
merge -r1045:1078 £SVN_M/branches/stable
|
-
Property svn:eol-style
set to
native
|
File size:
889 bytes
|
Rev | Line | |
---|
[531] | 1 | /*
|
---|
| 2 | * Test file to test the configuration file handling
|
---|
| 3 | *
|
---|
| 4 | * $Id$
|
---|
| 5 | *
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include <stdio.h>
|
---|
[1079] | 9 | #include <stdlib.h>
|
---|
| 10 |
|
---|
[768] | 11 | #include "mr_conf.h"
|
---|
[900] | 12 | #include "mr_mem.h"
|
---|
[531] | 13 |
|
---|
| 14 | int g_main_pid = 0;
|
---|
| 15 | int g_buffer_pid = 0;
|
---|
| 16 |
|
---|
[1079] | 17 | int main(void) {
|
---|
[531] | 18 | int ret = 0;
|
---|
| 19 | int i = 0;
|
---|
| 20 | double f = 0.0;
|
---|
| 21 | char *s = NULL;
|
---|
| 22 |
|
---|
[768] | 23 | if ((ret = mr_conf_open("mondo.conf")) != 0) {
|
---|
[531] | 24 | fprintf(stderr,"Unable to open conf file (%d)\n",ret);
|
---|
| 25 | exit(-1);
|
---|
| 26 | }
|
---|
[768] | 27 | if ((i = mr_conf_iread("testinteger")) == 0) {
|
---|
[531] | 28 | fprintf(stderr,"Unable to get integer\n");
|
---|
| 29 | exit(-1);
|
---|
| 30 | }
|
---|
| 31 | fprintf(stdout, "Integer : ***%d***\n",i);
|
---|
[768] | 32 | if ((f = mr_conf_fread("testfloat")) == 0.0) {
|
---|
[531] | 33 | fprintf(stderr,"Unable to get float\n");
|
---|
| 34 | exit(-1);
|
---|
| 35 | }
|
---|
| 36 | fprintf(stdout, "Float : ***%f***\n",f);
|
---|
[768] | 37 | if (! (s = mr_conf_sread("teststring"))) {
|
---|
[531] | 38 | fprintf(stderr,"Unable to get string\n");
|
---|
| 39 | exit(-1);
|
---|
| 40 | }
|
---|
| 41 | fprintf(stdout, "String : ***%s***\n",s);
|
---|
[900] | 42 | mr_free(s);
|
---|
[768] | 43 | mr_conf_close();
|
---|
[531] | 44 | exit(0);
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.