/* MX LIBRARY FUNCTION: mxip_image_s_ok_f1 * * PURPOSE: Is a mxip_image_s structure OK? * * AUTHOR: K. J. Mighell (mighell@noao.edu) * * LANGUAGE: ANSI C * * DOCUMENTATION: http://www.noao.edu/staff/mighell/mx * * DATE: 20000313 * * MOD: 3 * * Copyleft (L) 2000 Kenneth John Mighell */ #include "mx.h" int mxip_image_s_ok_f1( struct mxip_image_s *image ) { char mxfunc[] = "mxip_image_s_ok_f1"; int status; int npx; if ((struct mxip_image_s *)NULL==image) { status = 1; sprintf (MX.tmpmsg, "# image==(struct mxip_image_s *)NULL\n"); goto error; } if (MX_OPENED!=(image->openedi)) { status = 2; sprintf (MX.tmpmsg, "# image->opened!=MX_OPENED\n"); goto error; } if ((double **)NULL==(image->matrixd)) { status = 3; sprintf (MX.tmpmsg, "# image->matrixd==(double **)NULL\n"); goto error; } if ((double *)NULL==(image->vectord)) { status = 4; sprintf (MX.tmpmsg, "# image->vectord==(double *)NULL\n"); goto error; } if (1>(image->nxi)) { status = 5; sprintf (MX.tmpmsg, "# image->nxi=%d < 1\n", (image->nxi)); goto error; } if (1>(image->nyi)) { status = 6; sprintf (MX.tmpmsg, "# image->nyi=%d < 1\n", (image->nyi)); goto error; } if (1>(image->npxi)) { status = 7; sprintf (MX.tmpmsg, "# image->npxi=%d < 1\n", (image->npxi)); goto error; } npx = (image->nxi) * (image->nyi); if (npx!=(image->npxi)) { status = 8; sprintf ( MX.tmpmsg, "# image->npxi=%d != < (image->nxi=%d)*(image->nyi=%d) !\n", (image->npxi), (image->nxi), (image->nyi) ); goto error; } ok: status = 0; goto bye; error: mxp_errmsg_set_f3 (mxfunc, status, MX.tmpmsg); goto bye; bye: return (status); } /* end-of-file */