Last change
on this file since 768 was 768, checked in by Bruno Cornec, 18 years ago |
mktest generates again good results with the new split of libraries.
|
File size:
868 bytes
|
Rev | Line | |
---|
[531] | 1 | /*
|
---|
| 2 | * Test file to test the configuration file handling
|
---|
| 3 | *
|
---|
| 4 | * $Id$
|
---|
| 5 | *
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include <stdio.h>
|
---|
| 9 | #include "my-stuff.h"
|
---|
[768] | 10 | #include "mr_conf.h"
|
---|
[531] | 11 |
|
---|
| 12 | int g_main_pid = 0;
|
---|
| 13 | int g_buffer_pid = 0;
|
---|
| 14 |
|
---|
| 15 | main() {
|
---|
| 16 | int ret = 0;
|
---|
| 17 | int i = 0;
|
---|
| 18 | double f = 0.0;
|
---|
| 19 | char *s = NULL;
|
---|
| 20 |
|
---|
[768] | 21 | if ((ret = mr_conf_open("mondo.conf")) != 0) {
|
---|
[531] | 22 | fprintf(stderr,"Unable to open conf file (%d)\n",ret);
|
---|
| 23 | exit(-1);
|
---|
| 24 | }
|
---|
[768] | 25 | if ((i = mr_conf_iread("testinteger")) == 0) {
|
---|
[531] | 26 | fprintf(stderr,"Unable to get integer\n");
|
---|
| 27 | exit(-1);
|
---|
| 28 | }
|
---|
| 29 | fprintf(stdout, "Integer : ***%d***\n",i);
|
---|
[768] | 30 | if ((f = mr_conf_fread("testfloat")) == 0.0) {
|
---|
[531] | 31 | fprintf(stderr,"Unable to get float\n");
|
---|
| 32 | exit(-1);
|
---|
| 33 | }
|
---|
| 34 | fprintf(stdout, "Float : ***%f***\n",f);
|
---|
[768] | 35 | if (! (s = mr_conf_sread("teststring"))) {
|
---|
[531] | 36 | fprintf(stderr,"Unable to get string\n");
|
---|
| 37 | exit(-1);
|
---|
| 38 | }
|
---|
| 39 | fprintf(stdout, "String : ***%s***\n",s);
|
---|
| 40 | paranoid_free(s);
|
---|
[768] | 41 | mr_conf_close();
|
---|
[531] | 42 | exit(0);
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.