Rev 23 | Rev 52 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 23 | Rev 45 | ||
---|---|---|---|
Line 119... | Line 119... | ||
119 | // if(c == EOF) alertuser("end of file"); |
119 | // if(c == EOF) alertuser("end of file"); |
120 | 120 | ||
121 | return res; |
121 | return res; |
122 | } |
122 | } |
123 | 123 | ||
124 | Boolean readPARM(Ptr p,PARM_T *pparm,char **reasonstr){ |
124 | Boolean readPARM(Ptr p,PARM_T *pparm,char **reasonstr,int fromwin){ |
125 | Boolean res = false; |
125 | Boolean res = false; |
126 | int i; |
126 | int i; |
127 | 127 | ||
128 | memcpy(pparm,p,sizeof(PARM_T)); |
128 | memcpy(pparm,p,sizeof(PARM_T)); |
- | 129 | ||
129 | #ifdef WIN_ENV |
130 | if(fromwin){ |
130 | /* Windows PARM resource stores C strings - convert to Pascal strings */ |
131 | /* Windows PARM resource stores C strings - convert to Pascal strings */ |
131 | myc2pstr((char*)pparm->category); |
132 | myc2pstr((char*)pparm->category); |
132 | myc2pstr((char*)pparm->title); |
133 | myc2pstr((char*)pparm->title); |
133 | myc2pstr((char*)pparm->copyright); |
134 | myc2pstr((char*)pparm->copyright); |
134 | myc2pstr((char*)pparm->author); |
135 | myc2pstr((char*)pparm->author); |
135 | for(i=0;i<4;++i) |
136 | for(i=0;i<4;++i) |
136 | myc2pstr((char*)pparm->map[i]); |
137 | myc2pstr((char*)pparm->map[i]); |
137 | for(i=0;i<8;++i) |
138 | for(i=0;i<8;++i) |
138 | myc2pstr((char*)pparm->ctl[i]); |
139 | myc2pstr((char*)pparm->ctl[i]); |
139 | #endif |
140 | } |
140 | 141 | ||
141 | for(i=0;i<4;++i){ |
142 | for(i=0;i<4;++i){ |
142 | if(expr[i]) free(expr[i]); |
143 | if(expr[i]) free(expr[i]); |
143 | expr[i] = my_strdup(pparm->formula[i]); |
144 | expr[i] = my_strdup(pparm->formula[i]); |
144 | //dbg(expr[i]); |
- | |
145 | } |
145 | } |
146 | 146 | ||
147 | for(i=0;i<8;++i) |
147 | for(i=0;i<8;++i) |
148 | slider[i] = pparm->val[i]; |
148 | slider[i] = pparm->val[i]; |
149 | 149 | ||
150 | res = true; |
- | |
151 | //dbg("read pparm ok"); |
- | |
152 | - | ||
153 | return res; |
150 | return true; |
154 | } |
151 | } |
155 | 152 | ||
156 | Handle readfileintohandle(FILEREF r){ |
153 | Handle readfileintohandle(FILEREF r){ |
157 | long n; |
154 | long n; |
158 | Handle h; |
155 | Handle h; |
159 | Ptr p; |
156 | Ptr p; |
160 | 157 | ||
161 | if( !GetEOF(r,&n) && (h = PINEWHANDLE(n)) ){ |
158 | if( !GetEOF(r,&n) && (h = PINEWHANDLE(n)) ){ |
162 | p = PILOCKHANDLE(h,false); |
159 | p = PILOCKHANDLE(h,false); |
163 | if(!FSRead(r,&n,p)){ |
160 | if(!SetFPos(r,fsFromStart,0) && !FSRead(r,&n,p)){ |
164 | PIUNLOCKHANDLE(h); |
161 | PIUNLOCKHANDLE(h); |
165 | return h; |
162 | return h; |
166 | } |
163 | } |
167 | PIDISPOSEHANDLE(h); |
164 | PIDISPOSEHANDLE(h); |
168 | } |
165 | } |