92 ver = g_strdup_printf (
"%%\n%% project file v-%1d.%1d\n%%\n", i, j);
100 if (fwrite (& this_proj -> tfile,
sizeof(this_proj -> tfile), 1,
fp) != 1)
return ERROR_PROJECT;
101 if (this_proj -> tfile > -1)
105 if (this_proj -> bondfile != NULL)
117 if (fwrite (& this_proj -> nspec,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
118 if (fwrite (& this_proj -> natomes,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
119 if (fwrite (& this_proj -> steps,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
120 if (fwrite (& this_proj -> cell.pbc,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
121 if (fwrite (& this_proj -> cell.frac,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
122 if (fwrite (& this_proj -> cell.ltype,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
123 i = (this_proj -> cell.npt) ? this_proj -> steps : 1;
129 if (fwrite (this_proj -> cell.box[j].vect[k],
sizeof(
double), 3,
fp) != 3)
return ERROR_PROJECT;
131 if (fwrite (this_proj -> cell.box[j].param[0],
sizeof(
double), 3,
fp) != 3)
return ERROR_PROJECT;
132 if (fwrite (this_proj -> cell.box[j].param[1],
sizeof(
double), 3,
fp) != 3)
return ERROR_PROJECT;
134 if (fwrite (& this_proj -> cell.crystal,
sizeof(gboolean), 1,
fp) != 1)
return ERROR_PROJECT;
135 if (this_proj -> cell.sp_group)
137 if (fwrite (& this_proj -> cell.sp_group ->
id,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
148 if (fwrite (& this_proj -> run,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
149 if (fwrite (& this_proj -> initgl,
sizeof(gboolean), 1,
fp) != 1)
return ERROR_PROJECT;
150 if (fwrite (this_proj -> modelgl -> pixels,
sizeof(
int), 2,
fp) != 2)
return ERROR_PROJECT;
153 if (fwrite (this_proj -> rsearch,
sizeof(
int), 2,
fp) != 2)
return ERROR_PROJECT;
156 if (fwrite (this_proj -> rsparam[i],
sizeof(
int), 6,
fp) != 6)
return ERROR_PROJECT;
157 if (fwrite (this_proj -> rsdata[i],
sizeof(
double), 5,
fp) != 5)
return ERROR_PROJECT;
160 if (fwrite (this_proj -> csparam,
sizeof(
int), 7,
fp) != 7)
return ERROR_PROJECT;
161 if (fwrite (this_proj -> csdata,
sizeof(
double), 2,
fp) != 2)
return ERROR_PROJECT;
164 if (fwrite (& this_proj -> tunit,
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
165 if (this_proj -> natomes != 0 && this_proj -> nspec != 0)
167 for (i=0; i<this_proj -> nspec; i++)
172 if (fwrite (this_proj ->
chemistry -> nsps,
sizeof(
int), this_proj -> nspec,
fp) != this_proj -> nspec)
return ERROR_PROJECT;
173 if (fwrite (this_proj ->
chemistry -> formula,
sizeof(
int), this_proj -> nspec,
fp) != this_proj -> nspec)
return ERROR_PROJECT;
176 if (fwrite (this_proj ->
chemistry -> chem_prop[i],
sizeof(
double), this_proj -> nspec,
fp) != this_proj -> nspec)
return ERROR_PROJECT;
179 for (i=0; i<this_proj -> nspec; i++)
181 if (fwrite (this_proj ->
chemistry -> cutoffs[i],
sizeof(
double), this_proj -> nspec,
fp) != this_proj -> nspec)
return ERROR_PROJECT;
183 for (i=0; i<this_proj -> steps; i++)
185 for (j=0; j<this_proj -> natomes; j++)
190 if (this_proj -> run)
195 for (j=0; j<this_proj -> numc[i]; j++)
197 if (this_proj -> curves[i][j] -> ndata != 0)
206 if (fwrite (& this_proj -> numc[
SP],
sizeof(
int), 1,
fp) != 1)
return ERROR_PROJECT;
207 if (this_proj -> numc[
SP])
209 for (i=0; i<this_proj -> numc[
SP]; i++)
216 for (j=0; j<this_proj -> numc[i]; j++)
218 if (this_proj -> curves[i][j] -> ndata != 0)
225 if (this_proj -> initgl)
227 if (fwrite (& this_proj -> modelgl ->
bonding,
sizeof(gboolean), 1,
fp) != 1)
return ERROR_COORD;
228 if (fwrite (this_proj -> modelgl -> adv_bonding,
sizeof(gboolean), 2,
fp) != 2)
return ERROR_COORD;
229 if (fwrite (this_proj -> coord -> totcoord,
sizeof(
int), 10,
fp) != 10)
return ERROR_COORD;
231 if ((this_proj -> natomes >
ATOM_LIMIT || this_proj -> steps >
STEP_LIMIT) && this_proj -> modelgl -> adv_bonding[1])
239 if (i !=
OK)
return i;
242 if (i !=
OK)
return i;
244 if (i !=
OK)
return i;
249 if (j !=
OK)
return j;
254 if (j !=
OK)
return j;