#include #include #include "structs.h" int istrunc (char *objtype); void detach_trunc (struct fitpars *fpar) { static int high = 0; /* First go to the end */ if (fpar->next != NULL) detach_trunc (fpar->next); if (fpar->high != NULL && high == 0) { high = 1; detach_trunc (fpar->high); high = 0; }; /*****************************************************************\ * The following high order parameters are only pointers to the * * main truncation structure. No space was allocated to them to * * begin with. * \*****************************************************************/ if (high > 0 && istrunc (fpar->objtype)) { fpar->outer = NULL; fpar->inner = NULL; fpar->a = NULL; fpar->sig = NULL; fpar->ia = NULL; fpar->dp = NULL; fpar->high = NULL; /* <== Note that fourier modes and disky/boxyness */ /* are detached wholesale because they were */ /* simply pointers all along. */ }; }