OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / src / Tools / eosMath / eosMathAverage / src / init.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <math.h>
5 #include "../inc/config.h"
6 #include "genUtil.h"
7 #include "eosString.h"
8 #include "File.h"
9 #include "Memory.h"
10
11
12 void
13 init0(eosMathAverageInfo* info)
14 {
15     info->fptIn = NULL;    info->flagIn = 0;
16     info->fptOut = NULL;    info->flagOut = 0;
17     info->Trim = 0.0;    info->flagTrim = 0;
18     info->fptconfigFile = NULL;    info->flagconfigFile = 0;
19     info->mode = 0;    info->flagmode = 0;
20 }
21
22 void
23 init1(eosMathAverageInfo* info)
24 {
25     char s[1024];
26     int i;
27     if(!info->flagIn) {
28         stringGetFromFile(s, "In", stdin, stdout, 0);
29         info->In = stringGetNthWord(s, 1, " ,\t");
30         info->flagIn++;
31     }
32     if(info->flagIn) {
33         info->fptIn = fileOpen(info->In, "r");
34     }
35     
36     if(!info->flagOut) {
37         stringGetFromFile(s, "Out", stdin, stdout, 0);
38         info->Out = stringGetNthWord(s, 1, " ,\t");
39         info->flagOut++;
40     }
41     if(info->flagOut) {
42         info->fptOut = fileOpen(info->Out, "w");
43     }
44     
45     if(info->flagTrim) {
46     }
47     
48     if(info->flagconfigFile) {
49         info->fptconfigFile = fileOpen(info->configFile, "r");
50     }
51     
52     if(info->flagmode) {
53     }
54     
55 }
56 #ifdef KHOROS
57 #include <stdio.h>
58 #include "bootstrap.h"
59 #include "dataserv.h"
60 #include "datamanip.h"
61 extern void func_usage_additions(void);
62 extern void func_free_args(kexit_status status, kaddr client_data);
63 extern void func_get_args(kform* pane);
64
65 void
66 func_usage_additions(void)
67 {
68 }
69 void
70 func_free_args(kexit_status status, kaddr client_data)
71 {
72 }
73 void
74 func_get_args(kform* pane)
75 {
76 }
77 void
78 khorosInit(int argc, char* argv[])
79 {
80     char* eospath;
81     char  panepath[1024];
82     FILE* fpt;
83     
84     eospath = getenv("EOS_HOME");
85     sprintf(panepath, "%s/src/Tools/eosMath/eosMathAverage/src/eosMathAverage.pane", eospath);
86     khoros_initialize(argc, argv, "EOS");
87     fpt = fopen(panepath, "r");    if(NULL!=fpt) {
88         fclose(fpt);
89         kclui_initialize(panepath, KGEN_NONE, "EOS", "eosMathAverage",
90                      func_usage_additions,
91                      func_get_args,
92                      func_free_args);
93     }
94 }
95 #endif /* KHOROS */