00001
00028 #include <string.h>
00029 #include <stdio.h>
00030 #include <fitsio.h>
00031 #include <malloc.h>
00032
00033 #include "mex.h"
00034 #include "matrix.h"
00035 #include "mfitsio.h"
00036
00047 void
00048 mexFunction (int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[])
00049 {
00050 int buflen, status;
00051 char *filename, *keyword;
00052 mfitsio_header *header;
00053
00054
00055 if (nrhs != 2)
00056 {
00057 mexErrMsgTxt ("Two inputs required.");
00058 }
00059 else if (nlhs > 1)
00060 {
00061 mexErrMsgTxt ("Too many output arguments.");
00062 }
00063 else if (!mxIsChar (prhs[0]) || !mxIsChar (prhs[1]))
00064 {
00065 mexErrMsgTxt ("Inputs must be strings (filename, keyword).");
00066 }
00067 else if (mxGetM (prhs[0]) != 1 || mxGetM (prhs[1]) != 1)
00068 {
00069 mexErrMsgTxt ("Inputs must be a row vector strings (filename, keyword).");
00070 }
00071 buflen = (mxGetM (prhs[0]) * mxGetN (prhs[0])) + 1;
00072 filename = mxCalloc (buflen, sizeof (char));
00073 status = mxGetString (prhs[0], filename, buflen);
00074
00075 buflen = (mxGetM (prhs[1]) * mxGetN (prhs[1])) + 1;
00076 keyword = mxCalloc (buflen, sizeof (char));
00077 status = mxGetString (prhs[1], keyword, buflen);
00078
00079
00080 mfitsio_delete_keyword (filename, keyword);
00081 return;
00082 }