OSDN Git Service

Add a new command:
[eos/hostdependX86LINUX64.git] / src / Tools / mrcImage / mrcImageStack / 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 "String.h"
8 #include "File.h"
9 #include "Memory.h"
10
11
12 void
13 init0(mrcImageStackInfo* info)
14 {
15     info->fptIn     = stdin;    info->fptInList = stdin;    info->flagIn = 0;
16     info->fptOut = NULL;    info->flagOut = 0;
17     info->fptconfigFile = NULL;    info->flagconfigFile = 0;
18     info->mode = 0;    info->flagmode = 0;
19 }
20
21 void
22 init1(mrcImageStackInfo* info)
23 {
24     char s[1024];
25     int i;
26     if(info->flagIn) {
27         info->fptInList = fileOpen(info->InList, "r");
28         fseek(info->fptInList, 0L, SEEK_SET);
29         i=0;
30         while(NULL!=stringGetFromFile(s, "", info->fptInList, stdout, 1)) {
31             i++;
32         }
33         info->fptIn = (FILE**)memoryAllocate(i*sizeof(FILE*), "in init1");
34         info->In    = (char**)memoryAllocate(i*sizeof(char*), "in init1");
35         info->flagIn = i;
36         fseek(info->fptInList, 0L, SEEK_SET);
37         i=0;
38         while(NULL!=stringGetFromFile(s, "", info->fptInList, stdout, 1)) {
39             info->In[i] = stringGetNthWord(s, 1, " ,\t");
40             i++;
41         }
42     }
43     
44     if(!info->flagOut) {
45         stringGetFromFile(s, "Out", stdin, stdout, 0);
46         info->Out = stringGetNthWord(s, 1, " ,\t");
47         info->flagOut++;
48     }
49     if(info->flagOut) {
50         info->fptOut = fileOpen(info->Out, "w");
51     }
52     
53     if(info->flagconfigFile) {
54         info->fptconfigFile = fileOpen(info->configFile, "r");
55     }
56     
57     if(info->flagmode) {
58     }
59     
60 }
61 #ifdef KHOROS
62 #include <stdio.h>
63 #include "bootstrap.h"
64 #include "dataserv.h"
65 #include "datamanip.h"
66 extern void func_usage_additions(void);
67 extern void func_free_args(kexit_status status, kaddr client_data);
68 extern void func_get_args(kform* pane);
69
70 void
71 func_usage_additions(void)
72 {
73 }
74 void
75 func_free_args(kexit_status status, kaddr client_data)
76 {
77 }
78 void
79 func_get_args(kform* pane)
80 {
81 }
82 void
83 khorosInit(int argc, char* argv[])
84 {
85     char* eospath;
86     char  panepath[1024];
87     FILE* fpt;
88     
89     eospath = getenv("EOS_HOME");
90     sprintf(panepath, "%s/src/Tools/mrcImage/mrcImageStack/src/mrcImageStack.pane", eospath);
91     khoros_initialize(argc, argv, "EOS");
92     fpt = fopen(panepath, "r");    if(NULL!=fpt) {
93         fclose(fpt);
94         kclui_initialize(panepath, KGEN_NONE, "EOS", "mrcImageStack",
95                      func_usage_additions,
96                      func_get_args,
97                      func_free_args);
98     }
99 }
100 #endif /* KHOROS */