OSDN Git Service

New Tools:
[eos/base.git] / src / Tools / mrcImage / mrcImageFourierShellCorrelation / 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(mrcImageFourierShellCorrelationInfo* info)
14 {
15     info->fptIn1 = NULL;    info->flagIn1 = 0;
16     info->fptIn2 = NULL;    info->flagIn2 = 0;
17     info->fptOut = NULL;    info->flagOut = 0;
18     info->delta = 0;    info->flagdelta = 0;
19     info->z = 0;    info->flagz = 0;
20     info->L = 0;    info->flagL = 0;
21     info->H = 0;    info->flagH = 0;
22     info->fptconfigFile = NULL;    info->flagconfigFile = 0;
23     info->mode = 0;    info->flagmode = 0;
24     info->mode2 = 0;    info->flagmode2 = 0;
25     info->fptIn1Array     = stdin;    info->fptIn1ArrayList = stdin;    info->flagIn1Array = 0;
26 }
27
28 void
29 init1(mrcImageFourierShellCorrelationInfo* info)
30 {
31     char s[1024];
32     int i;
33     if(info->flagIn1) {
34         info->fptIn1 = fileOpen(info->In1, "r");
35     }
36     
37     if(info->flagIn2) {
38         info->fptIn2 = fileOpen(info->In2, "r");
39     }
40     
41     if(info->flagOut) {
42         info->fptOut = fileOpen(info->Out, "w");
43     }
44     
45     if(info->flagdelta) {
46     }
47     
48     if(info->flagz) {
49     }
50     
51     if(info->flagL) {
52     }
53     
54     if(info->flagH) {
55     }
56     
57     if(info->flagconfigFile) {
58         info->fptconfigFile = fileOpen(info->configFile, "r");
59     }
60     
61     if(info->flagmode) {
62     }
63     
64     if(info->flagmode2) {
65     }
66     
67     if(info->flagIn1Array) {
68         info->fptIn1ArrayList = fileOpen(info->In1ArrayList, "r");
69         fseek(info->fptIn1ArrayList, 0L, SEEK_SET);
70         i=0;
71         while(NULL!=stringGetFromFile(s, "", info->fptIn1ArrayList, stdout, 1)) {
72             i++;
73         }
74         info->fptIn1Array = (FILE**)memoryAllocate(i*sizeof(FILE*), "in init1");
75         info->In1Array    = (char**)memoryAllocate(i*sizeof(char*), "in init1");
76         info->flagIn1Array = i;
77         fseek(info->fptIn1ArrayList, 0L, SEEK_SET);
78         i=0;
79         while(NULL!=stringGetFromFile(s, "", info->fptIn1ArrayList, stdout, 1)) {
80             info->In1Array[i] = stringGetNthWord(s, 1, " ,\t");
81             info->fptIn1Array[i] = fileOpen(info->In1Array[i],"r");
82             i++;
83         }
84     }
85     
86 }
87 #ifdef KHOROS
88 #include <stdio.h>
89 #include "bootstrap.h"
90 #include "dataserv.h"
91 #include "datamanip.h"
92 extern void func_usage_additions(void);
93 extern void func_free_args(kexit_status status, kaddr client_data);
94 extern void func_get_args(kform* pane);
95
96 void
97 func_usage_additions(void)
98 {
99 }
100 void
101 func_free_args(kexit_status status, kaddr client_data)
102 {
103 }
104 void
105 func_get_args(kform* pane)
106 {
107 }
108 void
109 khorosInit(int argc, char* argv[])
110 {
111     char* eospath;
112     char  panepath[1024];
113     FILE* fpt;
114     
115     eospath = getenv("EOS_HOME");
116     sprintf(panepath, "%s/src/Tools/mrcImage/mrcImageFourierShellCorrelation/src/mrcImageFourierShellCorrelation.pane", eospath);
117     khoros_initialize(argc, argv, "EOS");
118     fpt = fopen(panepath, "r");    if(NULL!=fpt) {
119         fclose(fpt);
120         kclui_initialize(panepath, KGEN_NONE, "EOS", "mrcImageFourierShellCorrelation",
121                      func_usage_additions,
122                      func_get_args,
123                      func_free_args);
124     }
125 }
126 #endif /* KHOROS */