/*
  Description: Collection of routines providing a C interface to Midas
               Fortran library routines.

  Author: JGS

  $Revision: 1.8 $
  $Modtime:   12 Jun 1997 09:14:04  $
  Modifications:  CJB 21-Jun-04 - DR #503401 - Intrinsic m_send_msgl is
  		  missing an arguement (using C) - added mode parameter
		  to m_send_msgl function

  @version $Id: mjackets.c,v 1.8 2012/04/27 13:18:58 lsn Exp $
*/

#include "mjackets.h"
#include <stdio.h> /* for stderr in warnNotImplemented() */

/** Prints out a warning message about an unsupported function. */
static void warnNotImplemented(char *func) {
  fprintf(stderr,"XBC: %s is not supported in XBC.",func);
}

#if _VMS

/*
VAX FORTRAN passes strings by creating a string descriptor structure and
passing this structure by reference.
*/

typedef struct {
  unsigned short length;
  char dtype,class;
  char *c;
} VAXstr;

#define C2VAXSTR(STR,LEN,V) \
  V.c = STR; V.length = LEN; \
  V.dtype = DSC$K_DTYPE_T; V.class = DSC$K_CLASS_S

#endif

/* CMDLINE functions */

#if _UNIX
#define m$ppick 		m$ppick_
#define m$upick 		m$upick_
#define m$apick 		m$apick_
#define m$uapick 		m$uapick_
#define m$dpick 		m$dpick_
#define m$fpick 		m$fpick_
#define m$lpick 		m$lpick_
#define m$ipick 		m$ipick_
#define m$bpick 		m$bpick_
#define m$_pick 		m$_pick_
#define m$spick 		m$spick_
#define m$tpick 		m$tpick_
#define m$cpick 		m$cpick_
#define m$qpick 		m$qpick_
#define m$pick 			m$pick_
#define m$get_switch		m$get_switch_
#define m$get_pswitch		m$get_pswitch_
#define m$get_uswitch		m$get_uswitch_
#define m$get_sswitch		m$get_sswitch_
#define m$get_dswitch		m$get_dswitch_
#define m$get_switch_def	m$get_switch_def_
#define m$get_sswitch_def	m$get_sswitch_def_
#define m$get_dswitch_def	m$get_dswitch_def_
#endif


#if !_FDS
int_4 m$ppick(const int_4 *);
int_4 m_ppick(const int_4 n)
{
  return m$ppick(&n);
}

#if _VMS
void m$upick(VAXstr *,const int_4 *);
char *m_upick(const int_4 n)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(L_max_ascii+1);
  C2VAXSTR(str, L_max_ascii, VRTN);
  m$upick(&VRTN, &n);
  strf2c(str, L_max_ascii, str, L_max_ascii+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$upick(const int_4 *);
char *m_upick(const int_4 n)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(L_max_ascii+1);
  str = m$upick(&n);
  strf2c(str, L_max_ascii, str_ret, L_max_ascii+1, F2C_TRIM);
  return str_ret;
}
#else
void m$upick(char *, fstring_len_t,const int_4 *);
char *m_upick(const int_4 n)
{
  char *str;
  str = (char *) malloc(L_max_ascii+1);
  m$upick(str,L_max_ascii,&n);
  strf2c(str, L_max_ascii, str, L_max_ascii+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$apick(VAXstr *,const int_4 *);
char *m_apick(const int_4 n)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(L_max_ascii+1);
  C2VAXSTR(str, L_max_ascii, VRTN);
  m$apick(&VRTN, &n);
  strf2c(str, L_max_ascii, str, L_max_ascii+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$apick(const int_4 *);
char *m_apick(const int_4 n)
{
  char *str=NULL;
  char *str_ret=NULL;
  str_ret = (char *) malloc(L_max_ascii+1);
  str = m$apick(&n);
  strf2c(str, L_max_ascii, str_ret, L_max_ascii+1, F2C_TRIM);
  return str_ret;
}
#else
void m$apick(char *, fstring_len_t,const int_4 *);
char *m_apick(const int_4 n)
{
  char *str;
  str = (char *) malloc(L_max_ascii+1);
  m$apick(str,L_max_ascii,&n);
  strf2c(str, L_max_ascii, str, L_max_ascii+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
int_4 m$uapick(const int_4 *, VAXstr *, const int_4 *);
int_4 m_uapick(const int_4 n, char *aval, const int_4 flags, int_4 la)
{
  int length;
  VAXstr V;
  C2VAXSTR(aval, la, V);
  length = m$uapick(&n,&V,&flags);
  strf2c(aval, la, aval, la, F2C_TRIM);
  return length;
}
#else
int_4 m$uapick(const int_4 *,char *,const int_4 *,int_4);
int_4 m_uapick(const int_4 n, char *aval, const int_4 flags, int_4 la)
{
  int_4 length;
  length = m$uapick(&n,aval,&flags,la);
  strf2c(aval, la, aval, la, F2C_TRIM);
  return length;
}
#endif

real_8 m$dpick(const int_4 *);
real_8 m_dpick(const int_4 n)
{
  return m$dpick(&n);
}

real_4 m$fpick(const int_4 *);
real_4 m_fpick(const int_4 n)
{
  return m$fpick(&n);
}

int_4 m$lpick(const int_4 *);
int_4 m_lpick(const int_4 n)
{
  return m$lpick(&n);
}

int_2 m$ipick(const int_4 *);
int_2 m_ipick(const int_4 n)
{
  return m$ipick(&n);
}

int_1 m$bpick(const int_4 *);
int_1 m_bpick(const int_4 n)
{
  return m$bpick(&n);
}

#if _VMS
void m$_pick(VAXstr *,int_4 *,VAXstr *,real_8 *);
char m__pick(int_4 n, char *aval, real_8 *dval, int_4 la)
{
  VAXstr V,VRTN;
  char type;
  C2VAXSTR(aval, la, V);
  C2VAXSTR(&type, 1, VRTN);
  m$_pick(&VRTN, &n, &V, dval);
  strf2c(aval, la, aval, la, F2C_TRIM);
  return type;
}
#else
#if _PFC
char *m$_pick(const int_4 *,char *,real_8 *,int_4);
char m__pick(const int_4 n, char *aval, real_8 *dval, int_4 la)
{
  char type;
  type = *(char*) m$_pick(&n,aval,&dval,la);
  strf2c(aval, la, aval, la, F2C_TRIM);
  return type;
}
#else
void m$_pick(char *,int_4,const int_4 *,char *,real_8 *,int_4);
char m__pick(const int_4 n, char *aval, real_8 *dval, int_4 la)
{
  char type;
  m$_pick(&type,1,&n,aval,dval,la);
  strf2c(aval, la, aval, la, F2C_TRIM);
  return type;
}
#endif
#endif

int_u4 m$spick(const int_4 *);
int_u4 m_spick(const int_4 n)
{
  return m$spick(&n);
}

int_4 m$tpick(const int_4 *,real_8 *, real_8 *);
int_4 m_tpick(const int_4 n,real_8 *time1, real_8 *time2)
{
  return m$tpick(&n,time1,time2);
}

complex_16 m$cpick(const int_4 *);
complex_16 m_cpick(const int_4 n)
{
  return m$cpick(&n);
}

#if _VMS
int_4 m$qpick(VAXstr *);
int_4 m_qpick(char *ostr, int_4 los)
{
  int length;
  VAXstr V;
  C2VAXSTR(ostr, los, V);
  length = m$qpick(&V);
  strf2c(ostr, los, ostr, los, F2C_TRIM);
  return length;
}
#else
int_4 m$qpick(char *,int_4);
int_4 m_qpick(char *ostr, int_4 los)
{
  int_4 length;
  length = m$qpick(ostr,los);
  strf2c(ostr, los, ostr, los, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$pick(const int_4 *,void *,const int_4 *,const int_4 *,VAXstr *);
int_4 m_pick(const int_4 n, void *buf, const int_4 buflen, const int_4 mode,
             char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  return m$pick(&n,buf,&buflen,&mode,&V);
}
#else
int_4 m$pick(const int_4 *,void *,const int_4 *,const int_4 *,char *,int_4);
int_4 m_pick(const int_4 n, void *buf, const int_4 buflen, const int_4 mode,
             char *type)
{
  return m$pick(&n,buf,&buflen,&mode,type,1);
}
#endif

#if _VMS
int_4 m$get_switch(VAXstr *);
int_4 m_get_switch(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_switch(&V);
  }
#else
int_4 m$get_switch(const char *,int_4);
int_4 m_get_switch(const char *str)
{
  return m$get_switch(str,strlen(str));
}
#endif

#if _VMS
int_4 m$get_pswitch(VAXstr *);
int_4 m_get_pswitch(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_pswitch(&V);
  }
#else
int_4 m$get_pswitch(const char *,int_4);
int_4 m_get_pswitch(const char *str)
{
  return m$get_pswitch(str,strlen(str));
}
#endif

#if _VMS
int_4 m$get_uswitch(VAXstr *,VAXstr *);
int_4 m_get_uswitch(const char *str, char *ostr, int_4 los)
{
  int length;
  VAXstr V,VRTN;
  C2VAXSTR(str, strlen(str), V);
  C2VAXSTR(ostr, los, VRTN);
  length = m$get_uswitch(&V,&VRTN);
  strf2c(ostr, los, ostr, los, F2C_TRIM);
  return length;
}
#else
int_4 m$get_uswitch(const char *,char *,int_4,int_4);
int_4 m_get_uswitch(const char *str, char *ostr, int_4 los)
{
  int_4 length;
  length = m$get_uswitch(str,ostr,strlen(str),los);
  strf2c(ostr, los, ostr, los, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_u4 m$get_sswitch(VAXstr *);
int_u4 m_get_sswitch(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_sswitch(&V);
  }
#else
int_u4 m$get_sswitch(const char *,int);
int_u4 m_get_sswitch(const char *str)
{
  return m$get_sswitch(str,strlen(str));
}
#endif

#if _VMS
real_8 m$get_dswitch(VAXstr *);
real_8 m_get_dswitch(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_dswitch(&V);
  }
#else
real_8 m$get_dswitch(const char *,int_4);
real_8 m_get_dswitch(const char *str)
{
  return m$get_dswitch(str,strlen(str));
}
#endif

#if _VMS
int_4 m$get_switch_def(VAXstr *,int_4 *);
int_4 m_get_switch_def(const char *str, int_4 def)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_switch_def(&V,&def);
  }
#else
int_4 m$get_switch_def(const char *,int_4 *,int_4);
int_4 m_get_switch_def(const char *str, int_4 def)
{
  return m$get_switch_def(str,&def,strlen(str));
}
#endif

#if _VMS
int_u4 m$get_sswitch_def(VAXstr *,int_4 *);
int_u4 m_get_sswitch_def(const char *str, int_4 def)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_sswitch_def(&V,&def);
  }
#else
int_u4 m$get_sswitch_def(const char *,int_4 *,int_4);
int_u4 m_get_sswitch_def(const char *str, int_4 def)
{
  return m$get_sswitch_def(str,&def,strlen(str));
}
#endif

#if _VMS
real_8 m$get_dswitch_def(VAXstr *,real_8 *);
real_8 m_get_dswitch_def(const char *str, real_8 def)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  return m$get_dswitch_def(&V,&def);
  }
#else
real_8 m$get_dswitch_def(const char *,real_8 *,int_4);
real_8 m_get_dswitch_def(const char *str, real_8 def)
{
  return m$get_dswitch_def(str,&def,strlen(str));
}
#endif
#endif

/* COMMOLINK functions */

#if _UNIX
#define m$pause 		m$pause_
#define m$map_buffer		m$map_buffer_
#define	m$map_section		m$map_section_
#define m$checkin		m$checkin_
#define m$sync			m$sync_
#define m$return		m$return_
#define m$import		m$import_
#define m$beep			m$beep_
#define m$delete		m$delete_
#define m$directory		m$directory_
#define m$file			m$file_
#define m$form_path		m$form_path_
#define m$get_default		m$get_default_
#define m$get_input		m$get_input_
#define m$ldirectory		m$ldirectory_
#define m$remote_name		m$remote_name_
#define m$rename		m$rename_
#define m$spawn 		m$spawn_
#endif

#if _VMS
int_4 m$lock(int_4 *, int_4 , int_4 *);
int_4 m_lock(int_4 lockid, int_4 mode, int_4 wait)
{
  return m$lock(&lockid, &mode, &wait);
}
#endif

void m$pause(const real_4 *);
void m_pause(const real_4 time)
{
  m$pause(&time);
}

#if !_FDS
void m$map_buffer(int_4 *);
void m_map_buffer(int_4 secflag)
{
  m$map_buffer(&secflag);
}

void m$map_section(int_4 *,int_4 *);
void m_map_section(int_4 sec, int_4 flag)
{
  m$map_section(&sec, &flag);
}

/* NTN: as of NeXtMidas 2.7.2, void m_checkin(void) is in xmlibc.c */

void m$sync(void);
void m_sync(void)
{
  m$sync();
}

void m$return(void);
void m_return(void)
{
  m$return();
}

#if _VMS
int_4 m$import(VAXstr *,VAXstr *);
int_4 m_import(const char *symbol, char *content, int_4 slen, int_4 clen)
{
  VAXstr V1, V2;
  C2VAXSTR(symbol, slen, V1);
  C2VAXSTR(content, clen, V2);
  return m$import(&V1,&V2);
}
#else
int_4 m$import(const char *,char *,fstring_len_t, fstring_len_t);
int_4 m_import(const char *symbol, char *content, int_4 slen, int_4 clen)
{
  return m$import(symbol, content, slen, clen);
}
#endif

void m$beep(int_4 *,real_4 *);
void m_beep(int_4 n, real_4 delay)
{
  m$beep(&n,&delay);
}

#if _VMS
int_4 m$delete(VAXstr *);
int_4 m_delete(const char *filespec)
{
  VAXstr V;
  C2VAXSTR(filespec, strlen(filespec), V);
  return m$delete(&V);
}
#else
int_4 m$delete(const char *,fstring_len_t);
int_4 m_delete(const char *filespec)
{
  return m$delete(filespec,strlen(filespec));
}
#endif

#if _VMS
void m$directory(VAXstr *, VAXstr *, VAXstr *);
void m_directory(const char *path, const char *filename, const char *ext)
{
  VAXstr V1,V2,V3;
  C2VAXSTR(path, strlen(path), V1);
  C2VAXSTR(filename, strlen(filename), V2);
  C2VAXSTR(ext, strlen(ext), V3);
  m$directory(&V1,&V2,&V3);
}
#else
void m$directory(const char *,const char *,const char *,fstring_len_t,
		         fstring_len_t, fstring_len_t);
void m_directory(const char *path, const char *filename, const char *ext)
{
  m$directory(path, filename, ext, strlen(path), strlen(filename), strlen(ext));
}
#endif

#if _VMS
int_4 m$file(VAXstr *,int_4 *,VAXstr *);
int_4 m_file(const char *operation, int_4 unit, const char *name)
{
  VAXstr V1,V2;
  C2VAXSTR(operation, strlen(operation), V1);
  C2VAXSTR(name, strlen(name), V2);
  return m$file(&V1,&unit,&V2);
}
#else
int_4 m$file(const char *,int_4 *,const char *,fstring_len_t,fstring_len_t);
int_4 m_file(const char *operation, int_4 unit, const char *name)
{
  return m$file(operation,&unit,name,strlen(operation),strlen(name));
}
#endif

#if _VMS
int_4 m$form_path(int_4 *,VAXstr *, VAXstr *);
int_4 m_form_path(int_4 iaux, const char *id, char *string, int_4 ls)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(id, strlen(id), V1);
  C2VAXSTR(string, ls, V2);
  length = m$form_path(&iaux,&V1,&V2);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#else
int_4 m$form_path(int_4 *,const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_form_path(int_4 iaux, const char *id, char *string, int_4 ls)
{
  int_4 length;
  length = m$form_path(&iaux,id,string,strlen(id),ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$get_default(VAXstr *);
int_4 m_get_default(char *string, int_4 ls)
{
  int_4 length;
  VAXstr V;
  C2VAXSTR(string, ls, V);
  length = m$get_default(&V);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#else
int_4 m$get_default(char *, fstring_len_t);
int_4 m_get_default(char *string, int_4 ls)
{
  int_4 length;
  length = m$get_default(string,ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$get_input(VAXstr *,VAXstr *,int_4);
int_4 m_get_input(const char *prompt, char *string, int_4 *length, int_4 ls)
{
  int_4 stat;
  VAXstr V1,V2;
  C2VAXSTR(prompt, strlen(prompt), V1);
  C2VAXSTR(string, ls, V2);
  stat = m$get_input(&V1,&V2,length);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return stat;
}
#else
int_4 m$get_input(const char *,char *,int_4 *,fstring_len_t,fstring_len_t);
int_4 m_get_input(const char *prompt, char *string, int_4 *length, int_4 ls)
{
  int_4 stat;
  stat = m$get_input(prompt,string,length,strlen(prompt),ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return stat;
}
#endif

#if _VMS
int_4 m$ldirectory(VAXstr *,VAXstr *,VAXstr *,VAXstr *,int_4 *,int_4 *,int_4 *);
int_4 m_ldirectory(const char *path, const char *fname, const char *ext,
                   char *fullname, int_4 *i, int_4 *j, int_4 *k, int_4 lf)
{
  int_4 stat;
  VAXstr V1,V2,V3,V4;
  C2VAXSTR(path, strlen(path), V1);
  C2VAXSTR(fname, strlen(fname), V2);
  C2VAXSTR(ext, strlen(ext), V3);
  C2VAXSTR(fullname, lf, V4);
  stat = m$ldirectory(&V1,&V2,&V3,&V4,i,j,k);
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return stat;
}
#else
int_4 m$ldirectory(const char *,const char *, const char *,char *,
                   int_4 *,int_4 *,int_4 *,fstring_len_t,fstring_len_t,
                   fstring_len_t,fstring_len_t);
int_4 m_ldirectory(const char *path, const char *fname, const char *ext,
                   char *fullname, int_4 *i, int_4 *j, int_4 *k, int_4 lf)
{
  int_4 stat;
  stat = m$ldirectory(path,fname,ext,fullname,i,j,k,
                      strlen(path),strlen(fname),strlen(ext),lf);
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return stat;
}
#endif

#if _VMS
int_4 m$remote_name(VAXstr *,VAXstr *,int_4 *,int_4 *);
int_4 m_remote_name(const char *namein, char *nameout, int_4 engine,
                     int_4 *blksize,int_4 ln)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(namein, strlen(namein), V1);
  C2VAXSTR(nameout, ln, V2);
  length = m$remote_name(&V1,&V2,&engine,blksize);
  strf2c(nameout, ln, nameout, ln, F2C_TRIM);
  return length;
}
#else
int_4 m$remote_name(const char *, char *,int_4 *,int_4 *,fstring_len_t,
		            fstring_len_t);
int_4 m_remote_name(const char *namein, char *nameout, int_4 engine,
                     int_4 *blksize,int_4 ln)
{
  int_4 length;
  length = m$remote_name(namein,nameout,&engine,blksize,strlen(namein),ln);
  strf2c(nameout, ln, nameout, ln, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$rename(VAXstr *,VAXstr *);
int_4 m_rename(const char *filespec1, const char *filespec2)
{
  VAXstr V1,V2;
  C2VAXSTR(filespec1, strlen(filespec1), V1);
  C2VAXSTR(filespec2, strlen(filespec2), V2);
  return m$rename(&V1,&V2);
}
#else
int_4 m$rename(const char *,const char *,fstring_len_t,fstring_len_t);
int_4 m_rename(const char *filespec1, const char *filespec2)
{
  return m$rename(filespec1,filespec2,strlen(filespec1),strlen(filespec2));
}
#endif

int_4 m$spawn(int_4 *);
int_4 m_spawn(int_4 flag)
{
  return m$spawn(&flag);
}

#endif

/* CONTROLS functions*/

#if _UNIX
#define m$do			m$do_
#define m$todo			m$todo_
#define m$didnt 		m$didnt_
#define m$mwinit		m$mwinit_
#define m$lwinit		m$lwinit_
#define m$fwinit		m$fwinit_
#define m$dwinit		m$dwinit_
#define m$mwget 		m$mwget_
#define m$lwget 		m$lwget_
#define m$fwget 		m$fwget_
#define m$dwget 		m$dwget_
#define m$mwput 		m$mwput_
#define m$lwput 		m$lwput_
#define m$fwput 		m$fwput_
#define m$dwput 		m$dwput_
#define m$dwputu		m$dwputu_
#define m$wgetid		m$wgetid_
#endif

#if !_FDS

bool_4 m$do(int_4 *,int_4 *);
bool_4 m_do(int_4 lper, int_4 *ldo)
{
  return m$do(&lper,ldo);
}

void m$todo(real_8 *);
void m_todo(real_8 size)
{
  m$todo(&size);
}

void m$didnt(int_4 *);
void m_didnt(int_4 ldidnt)
{
  m$didnt(&ldidnt);
}

#if _VMS
int_4 m$mwinit(VAXstr *,int_4 *,VAXstr *);
int_4 m_mwinit(const char *name, int_4 init, const char *str)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(str, strlen(str), V2);
  return m$mwinit(&V1,&init,&V2);
}
#else
int_4 m$mwinit(const char *,int_4 *,const char *,fstring_len_t,fstring_len_t);
int_4 m_mwinit(const char *name, int_4 init, const char *str)
{
  return m$mwinit(name,&init,str,strlen(name),strlen(str));
}
#endif

#if _VMS
int_4 m$lwinit(VAXstr *,int_4 *,int_4 *, int_4 *,int_4 *);
int_4 m_lwinit(const char *name, int_4 vdef, int_4 vmin, int_4 vmax, int_4 vinc)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$lwinit(&V,&vdef,&vmin,&vmax,&vinc);
}
#else
int_4 m$lwinit(const char *,int_4 *,int_4 *,int_4 *,int_4 *,fstring_len_t);
int_4 m_lwinit(const char *name, int_4 vdef, int_4 vmin, int_4 vmax, int_4 vinc)
{
  return m$lwinit(name,&vdef,&vmin,&vmax,&vinc,strlen(name));
}
#endif

#if _VMS
int_4 m$fwinit(VAXstr *,real_4 *,real_4 *,real_4 *,real_4 *);
int_4 m_fwinit(const char *name, real_4 vdef, real_4 vmin, real_4 vmax,
               real_4 vinc)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$fwinit(&V,&vdef,&vmin,&vmax,&vinc);
}
#else
int_4 m$fwinit(const char *,real_4 *,real_4 *,real_4 *,real_4 *,fstring_len_t);
int_4 m_fwinit(const char *name, real_4 vdef, real_4 vmin, real_4 vmax,
               real_4 vinc)
{
  return m$fwinit(name,&vdef,&vmin,&vmax,&vinc,strlen(name));
}
#endif

#if _VMS
int_4 m$dwinit(VAXstr *,real_8 *,real_8 *,real_8 *,real_8 *);
int_4 m_dwinit(const char *name, real_8 vdef, real_8 vmin, real_8 vmax,
               real_8 vinc)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$dwinit(&V,&vdef,&vmin,&vmax,&vinc);
}
#else
int_4 m$dwinit(const char *,real_8 *,real_8 *,real_8 *,real_8 *,fstring_len_t);
int_4 m_dwinit(const char *name, real_8 vdef, real_8 vmin, real_8 vmax,
               real_8 vinc)
{
  return m$dwinit(name,&vdef,&vmin,&vmax,&vinc,strlen(name));
}
#endif

int_4 m$mwget(const int_4 *,int_4 *);
int_4 m_mwget(const int_4 id, int_4 *val)
{
  return m$mwget(&id, val);
}

int_4 m$lwget(const int_4 *,int_4 *);
int_4 m_lwget(const int_4 id, int_4 *val)
{
  return m$lwget(&id, val);
}

int_4 m$fwget(const int_4 *,real_4 *);
int_4 m_fwget(const int_4 id, real_4 *val)
{
  return m$fwget(&id, val);
}

int_4 m$dwget(const int_4 *,real_8 *);
int_4 m_dwget(const int_4 id, real_8 *val)
{
  return m$dwget(&id, val);
}

void m$mwput(const int_4 *,const int_4 *);
void m_mwput(const int_4 id, const int_4 val)
{
  m$mwput(&id, &val);
}

void m$lwput(const int_4 *,const int_4 *);
void m_lwput(const int_4 id, const int_4 val)
{
  m$lwput(&id, &val);
}

void m$fwput(const int_4 *,const real_4 *);
void m_fwput(const int_4 id, const real_4 val)
{
  m$fwput(&id, &val);
}

void m$dwput(const int_4 *,const real_8 *);
void m_dwput(const int_4 id, const real_8 val)
{
  m$dwput(&id, &val);
}

void m$dwputu(const int_4 *,const real_8 *);
void m_dwputu(const int_4 id, const real_8 val)
{
  m$dwputu(&id, &val);
}

int_4 m$wgetid(const int_4 *);
int_4 m_wgetid(const int_4 id)
{
  return m$wgetid(&id);
}

#endif

/* CONVERT functions */

#if _UNIX
#define m$convert		m$convert_
#define m$convert_to		m$convert_to_
#endif

#if _VMS
void m$convert(VAXstr *, void *,VAXstr *,int_4 *);
void m_convert(const char *machine, void *buffer, const char *type, int_4 n)
{
  VAXstr V1,V2;
  C2VAXSTR(machine, strlen(machine), V1);
  C2VAXSTR(type, 1, V2);
  m$convert(&V1,buffer,&V2,&n);
}
#else
void m$convert(const char *,void *,const char *,int_4 *,fstring_len_t,
		       fstring_len_t);
void m_convert(const char *machine, void *buffer, const char *type, int_4 n)
{
  m$convert(machine,buffer,type,&n,strlen(machine),1);
}
#endif

#if _VMS
void m$convert_to(VAXstr *, void *,VAXstr *,int_4 *);
void m_convert_to(const char *machine, void *buffer, const char *type, int_4 n)
{
  VAXstr V1,V2;
  C2VAXSTR(machine, strlen(machine), V1);
  C2VAXSTR(type, 1, V2);
  m$convert_to(&V1,buffer,&V2,&n);
}
#else
void m$convert_to(const char *,void *,const char *,int_4 *,fstring_len_t,
		          fstring_len_t);
void m_convert_to(const char *machine, void *buffer, const char *type, int_4 n)
{
  m$convert_to(machine,buffer,type,&n,strlen(machine),1);
}
#endif

/* EASYIO functions */

#if _UNIX
#define m$init			m$init_
#define m$open			m$open_
#define m$close 		m$close_
#define m$grab			m$grab_
#define m$grabx			m$grabx_
#define m$shove 		m$shove_
#define m$filad 		m$filad_
#define m$inok			m$inok_
#define m$inokw			m$inokw_
#define m$existence		m$existence_
#define m$allocate		m$allocate_
#define m$initialize		m$initialize_
#define m$propagate		m$propagate_
#define m$hcbfunc		m$hcbfunc_
#define m$force1000		m$force1000_
#define m$force2000		m$force2000_
#define m$xfer_length		m$xfer_length_
#define m$update_header 	m$update_header_
#define m$get_qualifier 	m$get_qualifier_
#define m$get_uqualifier	m$get_uqualifier_
#define m$seek			m$seek_
#endif

#if !_FDS

#if _VMS
void m$init(HEADER *,VAXstr *,VAXstr *,VAXstr *,int_4 *);
void m_init(HEADER *hcb, const char *name, const char *types,
            const char *formats, int_4 *modifiers,
            int_4 nlen, int_4 tlen, int_4 flen)
{
  VAXstr nstring, tstring, fstring;
  C2VAXSTR(name, nlen, nstring);
  C2VAXSTR(types, tlen, tstring);
  C2VAXSTR(formats, flen, fstring);
  m$init(hcb, &nstring, &tstring, &fstring, modifiers);
}
#else
void m$init(HEADER *,const char *,const char *,const char *,
            int_4 *,fstring_len_t,fstring_len_t,fstring_len_t);
void m_init(HEADER *hcb, const char *name, const char *types,
            const char *formats, int_4 *modifiers)
{
  m$init(hcb, name, types, formats, modifiers, strlen(name), strlen(types), strlen(formats));
}
#endif

void m$open(HEADER *,int_4 *);
void m_open(HEADER *hcb, int_4 funcmask)
{
  m$open(hcb, &funcmask);
}

void m$close(HEADER *);
void m_close(HEADER *hcb)
{
  m$close(hcb);
}

void m$grab(HEADER *,void *,real_8 *,int_4 *,int_4 *);
void m_grab(HEADER *hcb, void *bbuf, real_8 start, int_4 nget, int_4 *ngot)
{
  m$grab(hcb, bbuf, &start, &nget, ngot);
}

void m$grabx(HEADER *,void *,int_4 *);
void m_grabx(HEADER *hcb, void *bbuf, int_4 *ngot)
{
  m$grabx(hcb, bbuf, ngot);
}

void m$shove(HEADER *,void *,real_8 *,int_4 *,int_4 *);
void m_shove(HEADER *hcb, void *bbuf, real_8 start, int_4 ntoput, int_4 *nput)
{
  m$shove(hcb, bbuf, &start, &ntoput, nput);
}

void m$filad(HEADER *,void *,int_4 *);
void m_filad(HEADER *hcb, void *bbuf, int_4 nput)
{
  m$filad(hcb, bbuf, &nput);
}

void m$inok(HEADER *);
void m_inok(HEADER *hcb)
{
  m$inok(hcb);
}

void m$inokw(HEADER *);
void m_inokw(HEADER *hcb)
{
  m$inokw (hcb);
}

void m$existence(HEADER *,int_4 *);
void m_existence(HEADER *hcb,int_4 dir)
{
  m$existence(hcb,&dir);
}

void m$allocate(HEADER *);
void m_allocate(HEADER *hcb)
{
  m$allocate(hcb);
}

void m$initialize(HEADER *);
void m_initialize(HEADER *hcb)
{
  m$initialize(hcb);
}

void m$propagate(const HEADER *,HEADER *);
void m_propagate(const HEADER *hcb1, HEADER *hcb2)
{
  m$propagate(hcb1, hcb2);
}

void m$hcbfunc(HEADER *,int_4 *,int_4 *);
void m_hcbfunc(HEADER *hcb, int_4 func, int_4 *args)
{
  m$hcbfunc(hcb, &func, args);
}

void m$force1000(HEADER *);
void m_force1000(HEADER *hcb)
{
  m$force1000(hcb);
}

void m$force2000(HEADER *,int_4 *);
void m_force2000(HEADER *hcb, int_4 frame)
{
  m$force2000(hcb,&frame);
}

int_4 m$xfer_length(int_4 *,int_4 *);
int_4 m_xfer_length(int_4 bpe, int_4 lbbuf)
{
  return m$xfer_length(&bpe,&lbbuf);
}

void m$update_header(HEADER *);
void m_update_header(HEADER *hcb)
{
  m$update_header(hcb);
}

#if _VMS
int_4 m$get_qualifier(HEADER *,VAXstr *);
int_4 m_get_qualifier(HEADER *hcb, const char *qualifier)
{
  VAXstr V;
  C2VAXSTR(qualifier, strlen(qualifier), V);
  return m$get_qualifier(hcb,&V);
}
#else
int_4 m$get_qualifier(HEADER *,const char *,fstring_len_t);
int_4 m_get_qualifier(HEADER *hcb, const char *qualifier)
{
  return m$get_qualifier(hcb,qualifier,strlen(qualifier));
}
#endif

#if _VMS
int_4 m$get_uqualifier(HEADER *,VAXstr *,VAXstr *);
int_4 m_get_uqualifier(HEADER *hcb, const char *qualifier, char *string,
                       int_4 ls)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(qualifier, strlen(qualifier), V1);
  C2VAXSTR(string, ls, V2);
  length = m$get_uqualifier(hcb,&V1,&V2);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#else
int_4 m$get_uqualifier(HEADER *,const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_get_uqualifier(HEADER *hcb, const char *qualifier, char *string,
                       int_4 ls)
{
  int_4 length;
  length = m$get_uqualifier(hcb,qualifier,string,strlen(qualifier),ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#endif

void m$seek(HEADER *,real_8 *);
void m_seek(HEADER *hcb, real_8 *rseek)
{
  m$seek(hcb,rseek);
  return;
}

#endif

/* HARDIO functions */

#if _UNIX
#define m$fclose		m$fclose_
#define m$fcreate		m$fcreate_
#define m$fopen 		m$fopen_
#define m$fread 		m$fread_
#define m$fwrite		m$fwrite_
#endif

#if !_FDS

void m$fclose(HEADER *);
void m_fclose(HEADER *hcb)
{
  m$fclose(hcb);
}


void m$fcreate(HEADER *);
void m_fcreate(HEADER *hcb)
{
  m$fcreate(hcb);
}

void m$fopen(HEADER *);
void m_fopen(HEADER *hcb)
{
  m$fopen(hcb);
}

void m$fread(HEADER *,void *,real_8 *,int_4 *,int_4 *);
void m_fread(HEADER *hcb, void *bbuf, real_8 offset, int_4 nget, int_4 *ngot)
{
  m$fread(hcb,bbuf,&offset,&nget,ngot);
}

void m$fwrite(HEADER *,void *,real_8 *,int_4 *,int_4 *);
void m_fwrite(HEADER *hcb, void *bbuf, real_8 offset, int_4 nget, int_4 *ngot)
{
  m$fwrite(hcb,bbuf,&offset,&nget,ngot);
}

#endif

/* HWLIB */

#if !_FDS

#if _UNIX
#define m$hw_getinfo		m$hw_getinfo_
#define m$hw_menu		m$hw_menu_
#define m$hwf_alias		m$hwf_alias_
#define m$hwf_close		m$hwf_close_
#define m$hwf_command		m$hwf_command_
#define m$hwf_open		m$hwf_open_
#endif


#if _VMS
void m$hw_getinfo(VAXstr *,VAXstr *, VAXstr *,VAXstr *);
void m_hw_getinfo(char *name, char *type, char *port, char *trans,
                  int_4 L1, int_4 L2, int_4 L3, int_4 L4)
{
  VAXstr V1,V2,V3,V4;
  C2VAXSTR(name, L1, V1);
  C2VAXSTR(type, L2, V2);
  C2VAXSTR(port, L3, V3);
  C2VAXSTR(trans, L4, V4);
  m$hw_getinfo(&V1,&V2,&V3,&V4);
  strf2c(name, L1, name, L1, F2C_TRIM);
  strf2c(type, L2, type, L2, F2C_TRIM);
  strf2c(port, L3, port, L3, F2C_TRIM);
  strf2c(trans, L4, trans, L4, F2C_TRIM);
}
#else
void m$hw_getinfo(char *,char *,char *,char *,fstring_len_t,fstring_len_t,
		          fstring_len_t,fstring_len_t);
void m_hw_getinfo(char *name, char *type, char *port, char *trans,
                  int_4 L1, int_4 L2, int_4 L3, int_4 L4)
{
  m$hw_getinfo(name,type,port,trans,L1,L2,L3,L4);
  strf2c(name, L1, name, L1, F2C_TRIM);
  strf2c(type, L2, type, L2, F2C_TRIM);
  strf2c(port, L3, port, L3, F2C_TRIM);
  strf2c(trans, L4, trans, L4, F2C_TRIM);
}
#endif

#if _VMS
void m$hw_menu(VAXstr *);
void m_hw_menu(const char *name)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  m$hw_menu(&V);
}
#else
void m$hw_menu(const char *,fstring_len_t);
void m_hw_menu(const char *name)
{
  m$hw_menu(name,strlen(name));
}
#endif

#if _VMS
int_4 m$hwf_alias(HEADER *,VAXstr *,VAXstr *);
int_4 m_hwf_alias(HEADER *hcb, const char *key, char *string, int_4 ls)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(string, ls, V2);
  length = m$hwf_alias(hcb,&V1,&V2);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#else
int_4 m$hwf_alias(HEADER *,const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_hwf_alias(HEADER *hcb, const char *key, char *string, int_4 ls)
{
  int_4 length;
  length = m$hwf_alias(hcb,key,string,strlen(key),ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#endif

int_4 m$hwf_close(HEADER *hcb);
int_4 m_hwf_close(HEADER *hcb)
{
  return m$hwf_close(hcb);
}

#if _VMS
int_4 m$hwf_command(HEADER *,VAXstr *,VAXstr *);
int_4 m_hwf_command(HEADER *hcb, const char *key, char *string, int_4 ls)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(string, ls, V2);
  length = m$hwf_command(hcb,&V1,&V2);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#else
int_4 m$hwf_command(HEADER *,const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_hwf_command(HEADER *hcb, const char *key, char *string, int_4 ls)
{
  int_4 length;
  length = m$hwf_command(hcb,key,string,strlen(key),ls);
  strf2c(string, ls, string, ls, F2C_TRIM);
  return length;
}
#endif

int_4 m$hwf_open(HEADER *hcb);
int_4 m_hwf_open(HEADER *hcb)
{
  return m$hwf_open(hcb);
}

#endif

/* KEYWORD functions */

#if _UNIX
#define m$put_keyword		m$put_keyword_
#define m$get_keyword		m$get_keyword_
#define m$del_keyword		m$del_keyword_
#define m$repl_keyword		m$repl_keyword_
#define m$scope_keyword 	m$scope_keyword_
#define m$scope_keyword_quiet 	m$scope_keyword_quiet_
#define m$del_keydata		m$del_keydata_
#define m$find_keydata		m$find_keydata_
#define m$get_keydata		m$get_keydata_
#define m$put_keydata		m$put_keydata_
#endif

#if !_FDS

#if _VMS
int_4 m$put_keyword(HEADER *,VAXstr *,VAXstr *);
int_4 m_put_keyword(HEADER *hcb, const char *key, const char *keystring)
{
  VAXstr V1, V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(keystring, strlen(keystring), V2);
  return m$put_keyword(hcb,&V1,&V2);
}
#else
int_4 m$put_keyword(HEADER *,const char *,const char *,fstring_len_t,
		            fstring_len_t);
int_4 m_put_keyword(HEADER *hcb, const char *key, const char *keystring)
{
  return m$put_keyword(hcb,key,keystring,strlen(key),strlen(keystring));
}
#endif

#if _VMS
int_4 m$get_keyword(HEADER *,VAXstr *,VAXstr *);
int_4 m_get_keyword(HEADER *hcb, const char *key, char *sval,
                    int_4 klen, int_4 slen)
{
  int length;
  VAXstr V1, V2;
  C2VAXSTR(key, klen, V1);
  C2VAXSTR(sval, slen, V2);
  length = m$get_keyword(hcb, &V1, &V2);
  strf2c(sval, slen, sval, slen, F2C_TRIM);
  return length;
}
#else
int_4 m$get_keyword(HEADER *,const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_get_keyword(HEADER *hcb, const char *key, char *sval,
                    int_4 klen, int_4 slen)
{
  int length;
  length = m$get_keyword(hcb, key, sval, klen, slen);
  strf2c(sval, slen, sval, slen, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$del_keyword(HEADER *,VAXstr *);
int_4 m_del_keyword(HEADER *hcb, const char *key)
{
  VAXstr V;
  C2VAXSTR(key, strlen(key), V);
  return m$del_keyword(hcb,&V);
}
#else
int_4 m$del_keyword(HEADER *,const char *,int_4);
int_4 m_del_keyword(HEADER *hcb, const char *key)
{
  return m$del_keyword(hcb,key,strlen(key));
}
#endif

#if _VMS
int_4 m$repl_keyword(HEADER *,VAXstr *,VAXstr *);
int_4 m_repl_keyword(HEADER *hcb, const char *key, const char *keystring)
{
  VAXstr V1, V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(keystring, strlen(keystring), V2);
  return m$repl_keyword(hcb,&V1,&V2);
}
#else
int_4 m$repl_keyword(HEADER *,const char *,const char *,fstring_len_t,
		             fstring_len_t);
int_4 m_repl_keyword(HEADER *hcb, const char *key, const char *keystring)
{
  return m$repl_keyword(hcb,key,keystring,strlen(key),strlen(keystring));
}
#endif

#if _VMS
int_4 m$scope_keyword(HEADER *,VAXstr *);
int_4 m_scope_keyword(HEADER *hcb, const char *tags, int_4 tlen)
{
  VAXstr V;
  C2VAXSTR(tags, tlen, V);
  return m$scope_keyword(hcb, &V);
}
#else
int_4 m$scope_keyword(HEADER *,const char *,fstring_len_t);
int_4 m_scope_keyword(HEADER *hcb, const char *tags, int_4 tlen)
{
  return m$scope_keyword(hcb, tags, tlen);
}
#endif

#if _VMS
int_4 m$scope_keyword_quiet(HEADER *,VAXstr *);
int_4 m_scope_keyword_quiet(HEADER *hcb, const char *tags, int_4 tlen)
{
  VAXstr V;
  C2VAXSTR(tags, tlen, V);
  return m$scope_keyword_quiet(hcb, &V);
}
#else
int_4 m$scope_keyword_quiet(HEADER *,const char *,fstring_len_t);
int_4 m_scope_keyword_quiet(HEADER *hcb, const char *tags, int_4 tlen)
{
  return m$scope_keyword_quiet(hcb, tags, tlen);
}
#endif

#if _VMS
int_4 m$del_keydata(HEADER *,VAXstr *,int_4 *);
int_4 m_del_keydata(HEADER *hcb, const char *key, int_4 mode)
{
  VAXstr V;
  C2VAXSTR(key, strlen(key), V);
  return m$del_keydata(hcb, &V, &mode);
}
#else
int_4 m$del_keydata(HEADER *,const char *,int_4 *,fstring_len_t);
int_4 m_del_keydata(HEADER *hcb, const char *key, int_4 mode)
{
  return m$del_keydata(hcb,key,&mode,strlen(key));
}
#endif

#if _VMS
int_4 m$find_keydata(HEADER *,VAXstr *, void *, int_4 *, int_4 *, VAXstr *);
int_4 m_find_keydata(HEADER *hcb, char *key, void *buf, int_4 *mbuf,
                     int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  VAXstr V1,V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(type, 1, V2);
  size = m$find_keydata(hcb,&V1,buf,mbuf,&mode,&V2);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#else
int_4 m$find_keydata(HEADER *,char *,void *,int_4 *,int_4 *,char *,
		             fstring_len_t,fstring_len_t);
int_4 m_find_keydata(HEADER *hcb, char *key, void *buf, int_4 *mbuf,
                     int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  size = m$find_keydata(hcb,key,buf,mbuf,&mode,type,lk,1);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#endif

#if _VMS
int_4 m$get_keydata(HEADER *,VAXstr *, void *, int_4 *, int_4 *, VAXstr *);
int_4 m_get_keydata(HEADER *hcb, char *key, void *buf, int_4 mbuf,
                    int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  VAXstr V1,V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(type, 1, V2);
  size = m$get_keydata(hcb,&V1,buf,&mbuf,&mode,&V2);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#else
int_4 m$get_keydata(HEADER *,char *,void *,int_4 *,int_4 *,char *,
		            fstring_len_t,fstring_len_t);
int_4 m_get_keydata(HEADER *hcb, char *key, void *buf, int_4 mbuf,
                    int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  size = m$get_keydata(hcb,key,buf,&mbuf,&mode,type,lk,1);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#endif

#if _VMS
int_4 m$put_keydata(HEADER *,VAXstr *, void *, int_4 *, int_4 *, VAXstr *);
int_4 m_put_keydata(HEADER *hcb, char *key, void *buf, int_4 mbuf,
                     int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  VAXstr V1,V2;
  C2VAXSTR(key, strlen(key), V1);
  C2VAXSTR(type, 1, V2);
  size = m$put_keydata(hcb,&V1,buf,&mbuf,&mode,&V2);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#else
int_4 m$put_keydata(HEADER *,char *,void *,int_4 *,int_4 *,char *,
		            fstring_len_t,fstring_len_t);
int_4 m_put_keydata(HEADER *hcb, char *key, void *buf, int_4 mbuf,
                     int_4 mode, char *type, int_4 lk)
{
  int_4 size;
  size = m$put_keydata(hcb,key,buf,&mbuf,&mode,type,lk,1);
  strf2c(key, lk, key, lk, F2C_TRIM);
  return size;
}
#endif

#endif

/* MATH functions */

#if _VMS
int_4 m$calc(VAXstr *, real_8 *, int_4 *,VAXstr *, int_4 *);
int_4 m_calc(const char *string, real_8 *buf, int_4 nbuf,
             const char *type, int_4 mode)
{
  VAXstr V1, V2;
  C2VAXSTR(string, strlen(string), V1);
  C2VAXSTR(type, strlen(type), V2);
  return m$calc(&V1,buf,&nbuf,&V2,&mode);
}
#else
int_4 m$calc(const char *, real_8 *, int_4 *,
             const char *, int_4 *, fstring_len_t, fstring_len_t);
int_4 m_calc(const char *string, real_8 *buf, int_4 nbuf,
             const char *type, int_4 mode)
{
  return m$calc(string,buf,&nbuf,type,&mode,strlen(string),strlen(type));
}
#endif

int_4 m$deq(const real_8 *, const real_8 *);
int_4 m_deq(const real_8 d1, const real_8 d2)
{
  return m$deq(&d1,&d2);
}

int_4 m$deqt(const real_8 *, const real_8 *, const real_4 *);
int_4 m_deqt(const real_8 d1, const real_8 d2, const real_4 tol)
{
  return m$deqt(&d1,&d2,&tol);
}

int_4 m$power2ge(const int_4 *);
int_4 m_power2ge(const int_4 n)
{
  return m$power2ge(&n);
}

int_4 m$power2le(const int_4 *);
int_4 m_power2le(const int_4 n)
{
  return m$power2le(&n);
}

#if _VMS
void m$reformat(void *, VAXstr *, void *, VAXstr *, int_4 *);
void m_reformat(void *bufin, const char *formin, void *bufout,
                const char *typeout, int_4 count)
{
  VAXstr V1, V2;
  C2VAXSTR(formin, strlen(formin), V1);
  C2VAXSTR(typeout, strlen(typeout), V2);
  m$reformat(bufin,&V1,bufout,&V2,&count);
}
#else
void m$reformat(void *, const char *, void *,
                const char *, int_4 *, fstring_len_t , fstring_len_t);
void m_reformat(void *bufin, const char *formin, void *bufout,
                const char *typeout, int_4 count)
{
  m$reformat(bufin,formin,bufout,typeout,&count,strlen(formin),strlen(typeout));
}
#endif

void m$retype(void *, int_4 *, void *, int_4 *, int_4 *);
void m_retype(void *bufin, int_4 typein, void *bufout, int_4 typeout,
              int_4 count)
{
  m$retype(bufin,&typein,bufout,&typeout,&count);
}

#if _VMS
int_4 m$recast(void *, VAXstr *, int_4 *, void *, VAXstr *, int_4);
int_4 m_recast(void *bufin, const char *typein, int_4 lenin, void *bufout,
               char *typeout, int_4 lenout)
{
  VAXstr V1, V2;
  C2VAXSTR(typein, 1, V1);
  C2VAXSTR(typeout, 1, V2);
  return m$recast(bufin,&V1,&lenin,bufout,&V2,&lenout);
}
#else
int_4 m$recast(void *, const char *, int_4 *, void *,
               char *, int_4 *, fstring_len_t, fstring_len_t);
int_4 m_recast(void *bufin, const char *typein, int_4 lenin, void *bufout,
               char *typeout, int_4 lenout)
{
  return m$recast(bufin,typein,&lenin,bufout,typeout,&lenout,1,1);
}
#endif

void m$bitshift(void *, int_4 *, int_4 *, int_1 *);
void m_bitshift(void *buf, int_4 nbits, int_4 nbs, int_1 insert)
{
  m$bitshift(buf,&nbits,&nbs,&insert);
}

#if _VMS
int_4 m$window(real_4 *, VAXstr *, int_4 *);
int_4 m_window(real_4 *buf, const char *name, int_4 npts)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$window(buf,&V,&npts);
}
#else
int_4 m$window(real_4 *, const char *, int_4 *, fstring_len_t);
int_4 m_window(real_4 *buf, const char *name, int_4 npts)
{
  return m$window(buf,name,&npts,strlen(name));
}
#endif

#if _VMS
int_4 m$window_id(VAXstr *);
int_4 m_window_id(const char *name)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$window_id(&V);
}
#else
int_4 m$window_id(const char *, fstring_len_t);
int_4 m_window_id(const char *name)
{
  return m$window_id(name,strlen(name));
}
#endif

void m$window_by_id(real_4 *, int_4 *, int_4 *);
void m_window_by_id(real_4 *buf, int_4 id, int_4 npts)
{
  m$window_by_id(buf,&id,&npts);
}

void m$rfft(real_4 *, int_4 *, int_4 *);
void m_rfft(real_4 *buf, int_4 npts, int_4 flag)
{
  m$rfft(buf,&npts,&flag);
}

void m$cfft(complex_8 *, int_4 *, int_4 *);
void m_cfft(complex_8 *buf, int_4 npts, int_4 flag)
{
  m$cfft(buf,&npts,&flag);
}

int_4 m$fftsize(int_4 *, int_4 *, int_4 *);
int_4 m_fftsize(int_4 nfft, int_4 rcflag, int_4 dir)
{
  return m$fftsize(&nfft,&rcflag,&dir);
}

void m$interp(int_4 *, real_8 *, real_8 *, real_4 *, int_4 *,
              real_8 *, real_8 *, real_4 *, int_4 *, int_4 *, int_4 *);
void m_interp(int_4 nin, real_8 tstri, real_8 tdeli, real_4 *tvin, int_4 nout,
              real_8 tstro, real_8 tdelo, real_4 *tvout, int_4 ncomp,
              int_4 norder, int_4 *nerr)
{
  m$interp(&nin,&tstri,&tdeli,tvin,&nout,&tstro,&tdelo,tvout,
           &ncomp,&norder,nerr);
}

void m$interpd(int_4 *, real_8 *, real_8 *, real_8 *, int_4 *,
               real_8 *, real_8 *, real_8 *, int_4 *, int_4 *, int_4 *);
void m_interpd(int_4 nin, real_8 tstri, real_8 tdeli, real_8 *tvin, int_4 nout,
               real_8 tstro, real_8 tdelo, real_8 *tvout, int_4 ncomp,
               int_4 norder, int_4 *nerr)
{
  m$interpd(&nin,&tstri,&tdeli,tvin,&nout,&tstro,&tdelo,tvout,&ncomp,
            &norder,nerr);
}

void m$finterp(HEADER *, int_4 *, real_8 *, real_8 *,
               real_4 *, int_4 *,int_4 *,int_4 *);
void m_finterp(HEADER *hcb, int_4 nout, real_8 tstro, real_8 tdelo,
               real_4 *tvout, int_4 ncomp, int_4 norder, int_4 *nerr)
{
  m$finterp(hcb,&nout,&tstro,&tdelo,tvout,&ncomp,&norder,nerr);
}

void m$finterpd(HEADER *, int_4 *, real_8 *, real_8 *,
                real_8 *, int_4 *, int_4 *,int_4 *);
void m_finterpd(HEADER *hcb, int_4 nout, real_8 tstro, real_8 tdelo,
                real_8 *tvout, int_4 ncomp, int_4 norder, int_4 *nerr)
{
  m$finterpd(hcb,&nout,&tstro,&tdelo,tvout,&ncomp,&norder,nerr);
}

/* MEMORY functions */

#if JEFF
#if !_FDS
#if _UNIX
#define m$stmalloc		m$stmalloc_
#define m$stmfree		m$stmfree_
#endif

#if _VMS
void m$stmalloc(int_4 *,int_4 *);
void m_stmalloc(int_4 p1, int_4 *p2)
{
  m$stmalloc(&p1, p2);
}

void m$stmfree(int_4 *,int_4 *);
void m_stmfree(int_4 p1, int_4 p2)
{
  m$stmfree(&p1, &p2);
}
#else
void m_stmalloc(const int_4,int_4 *);
void m$stmalloc(const int_4 *p1, int_4 *p2)
{
  m_stmalloc(*p1, p2);
}

void m_stmfree(const int_4,int_4);
void m$stmfree(const int_4 *p1, int_4 *p2)
{
  m_stmfree(*p1, *p2);
}
#endif
#endif
#endif

/* MESSAGES functions */

#if _UNIX
#define m$expand_htype		m$expand_htype_
#define m$get_msg		m$get_msg_
#define m$get_msgl		m$get_msgl_
#define m$init_msg		m$init_msg_
#define m$send_msg		m$send_msg_
#define m$send_msge		m$send_msge_
#define m$send_msgl		m$send_msgl_
#endif

#if _VMS
void m$expand_htype(VAXstr *,int_4 *,int_4 *,int_4 *,VAXstr *,int_4 *);
void m_expand_htype(const char *types, int_4 *index, const int_4 length,
                    int_4 *nelem, char *type, int_4 *bpe)
{
  VAXstr V1,V2;
  C2VAXSTR(types, length, V1);
  C2VAXSTR(type, 1, V2);
  m$expand_htype(&V1,index,&length,nelem,&V2,bpe);
}
#else
void m$expand_htype(const char *,int_4 *,const int_4 *,int_4 *,const char *,
                    int_4 *,fstring_len_t,fstring_len_t);
void m_expand_htype(const char *types, int_4 *index, int_4 length,
                    int_4 *nelem, char *type, int_4 *bpe)
{
  m$expand_htype(types,index,&length,nelem,type,bpe,length,1);
}
#endif

int_4 m$get_msg(void *,void *,int_4 *,real_4 *,int_u4 *);
int_4 m_get_msg(void *mqh, void *buf, int_4 nbuf, real_4 time, int_u4 flag)
{
  return m$get_msg(mqh, buf, &nbuf, &time, &flag);
}

#if _VMS
int_4 m$get_msgl(VAXstr *,int_4 *,int_4 *,int_4 *,int_4 *,VAXstr *,
                 void *,const int_4 *,const real_4 *,const int_4 *);
int_4 m_get_msgl(char *name, int_4 *sid, int_4 *rid, int_4 *info,
                 int_4 *ndata, char *types, void *buf, const int_4 nbuf,
                 const real_4 wait, const int_4 mask, int_4 ln, int_4 lt)
{
  int_4 status;
  VAXstr V1,V2;
  C2VAXSTR(name, ln, V1);
  C2VAXSTR(types, lt, V2);
  status = m$get_msgl(&V1,sid,rid,info,ndata,&V2,buf,&nbuf,&wait,&mask);
  strf2c(name, ln, name, ln, F2C_TRIM);
  strf2c(types, lt, types, lt, F2C_TRIM);
  return status;
}
#else
int_4 m$get_msgl(char *,int_4 *,int_4 *,int_4 *,int_4 *,char *,
                 void *,const int_4 *,const real_4 *,const int_4 *,
                 fstring_len_t,fstring_len_t);
int_4 m_get_msgl(char *name, int_4 *sid, int_4 *rid, int_4 *info,
                 int_4 *ndata, char *types, void *buf, const int_4 nbuf,
                 const real_4 wait, const int_4 mask, int_4 ln, int_4 lt)
{
  int_4 status;
  status = m$get_msgl(name,sid,rid,info,ndata,types,buf,&nbuf,&wait,&mask,
                      ln,lt);
  strf2c(name, ln, name, ln, F2C_TRIM);
  strf2c(types, lt, types, lt, F2C_TRIM);
  return status;
}
#endif

void m$init_msg(int_4 *);
void m_init_msg(int_4 mode)
{
  m$init_msg(&mode);
}

void m$send_msg(void *,void *,int_4 *,int_u4 *);
void m_send_msg(void *mqh, void *buf, int_4 reader, int_u4 flag)
{
  m$send_msg(mqh, buf, &reader, &flag);
}

void m$send_msge(void *,void *,int_4 *,int_u4 *,int_4 *,real_4 *,
                 int_4 *);
void m_send_msge(void *mqh, void *buf, int_4 reader, int_u4 flag,
                 int_4 intrys, real_4 ifwait, int_4 ieflags)
{
  m$send_msge(mqh, buf, &reader, &flag, &intrys, &ifwait, &ieflags);
}



#if _VMS
/* DR #503401 */
void m$send_msgl(VAXstr *,const int_4 *,const int_4 *,const int_4 *,
                 const int_4 *,const int_4 *,VAXstr *,const void *,
		 const int_4 *);
void m_send_msgl(const char *name, const int_4 sid, const int_4 rid,
                 const int_4 info, const int_4 mode, const int_4 ndata,
		 const char *types, const void *buf, const int_4 mask)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(types, strlen(types), V2);
  m$send_msgl(&V1,&sid,&rid,&info,&mode,&ndata,&V2,buf,&mask);
}
#else
void m$send_msgl(const char *,const int_4 *,const int_4 *,const int_4 *,
                 const int_4 *,const int_4 *,const char *,const void *,
                 const int_4 *, int_4,int_4);
void m_send_msgl(const char *name, const int_4 sid, const int_4 rid,
                 const int_4 info, const int_4 mode, const int_4 ndata,
		 const char *types, const void *buf, const int_4 mask)
{
  m$send_msgl(name,&sid,&rid,&info,&mode,&ndata,types,buf,&mask,
              strlen(name),strlen(types));
}
/* DR #503401 */
#endif

/* PACKETIO functions */

#if _UNIX
#define m$prep_pkt		m$prep_pkt_
#define m$get_pkt		m$get_pkt_
#define m$send_pkt		m$send_pkt_
#define m$pkt_show_reg		m$pkt_show_reg_
#define m$disp_pkt_map		m$disp_pkt_map_
#define m$pkt_init		m$pkt_init_
#define m$pkt_propagate 	m$pkt_propagate_
#define m$pkt_file_reg		m$pkt_file_reg_
#define m$pkt_map_resolve	m$pkt_map_resolve_
#define m$pkt_map_search	m$pkt_map_search_
#define m$pkt_register		m$pkt_register_
#define m$pkt_hdrmod		m$pkt_hdrmod_
#define m$chk_pkt_type		m$chk_pkt_type_
#define m$prop_except		m$prop_except_
#define m$brdg_except		m$brdg_except_
#define m$pkt_except		m$pkt_except_
#define m$chk_pkt_flags 	m$chk_pkt_flags_
#define m$hm_flag		m$hm_flag_
#define m$convert_pkt_rep	m$convert_pkt_rep_
#endif

#if !_FDS

void m$prep_pkt(HEADER *,const PKS *,PKDSTRUCT *,const int_4 *,const int_4 *);
void m_prep_pkt(HEADER *hcb, const PKS *pkh, PKDSTRUCT *pkds, const int_4 ovcat,
                const int_4 ovlen)
{
  m$prep_pkt(hcb,pkh,pkds,&ovcat,&ovlen);
}

void m$get_pkt(HEADER *, PKDSTRUCT *);
void m_get_pkt(HEADER *hcb, PKDSTRUCT *pkds)
{
  m$get_pkt(hcb,pkds);
}

void m$send_pkt(HEADER *,PKS *,PKDSTRUCT *,const int_4 *,const int_4 *);
void m_send_pkt(HEADER *hcb, PKS *pkh, PKDSTRUCT *pkds, const int_4 ovcat,
                const int_4 ovlen)
{
  m$send_pkt(hcb,pkh,pkds,&ovcat,&ovlen);
}

void m$pkt_show_reg(HEADER *);
void m_pkt_show_reg(HEADER *hcb)
{
  m$pkt_show_reg(hcb);
}

void m$disp_pkt_map(void);
void m_disp_pkt_map(void)
{
  m$disp_pkt_map();
}

void m$pkt_init(HEADER *);
void m_pkt_init(HEADER *hcb)
{
  m$pkt_init(hcb);
}

void m$pkt_propagate(HEADER *,HEADER *);
void m_pkt_propagate(HEADER *hin, HEADER *hout)
{
  m$pkt_propagate(hin,hout);
}

void m$pkt_file_reg(HEADER *);
void m_pkt_file_reg(HEADER *hcb)
{
  m$pkt_file_reg(hcb);
}

void m$pkt_map_resolve(void);
void m_pkt_map_resolve(void)
{
  m$pkt_map_resolve();
}

#if _VMS
void m$pkt_map_search(VAXstr *,int_4 *,int_4 *);
void m_pkt_map_search(const char *fname, int_4 *addr, int_4 *status)
{
  VAXstr V;
  C2VAXSTR(fname, strlen(fname), V);
  m$pkt_map_search(&V,addr,status);
}
#else
void m$pkt_map_search(const char *,int_4 *,int_4 *,fstring_len_t);
void m_pkt_map_search(const char *fname, int_4 *addr, int_4 *status)
{
  m$pkt_map_search(fname,addr,status,strlen(fname));
}
#endif

void m$pkt_register(HEADER *);
void m_pkt_register(HEADER *hcb)
{
  m$pkt_register(hcb);
}

void m$pkt_hdrmod(HEADER *);
void m_pkt_hdrmod(HEADER *hcb)
{
  m$pkt_hdrmod(hcb);
}

void m$chk_pkt_type(HEADER *hcb,const int_4 *);
void m_chk_pkt_type(HEADER *hcb, const int_4 flag)
{
  m$chk_pkt_type(hcb,&flag);
}

void m$prop_except(HEADER *);
void m_prop_except(HEADER *hcb)
{
  m$prop_except(hcb);
}

void m$brdg_except(HEADER *);
void m_brdg_except(HEADER *hcb)
{
  m$brdg_except(hcb);
}

#if _VMS
void m$pkt_except(VAXstr *,VAXstr *,int_4 *,int_4 *);
void m_pkt_except(const char *string, char *xcmp, int_4 *xv1, int_4 *xv2,
                  int_4 lxcmp)
{
  VAXstr V1,V2;
  C2VAXSTR(string, strlen(string), V1);
  C2VAXSTR(xcmp, lxcmp, V2);
  m$pkt_except(&V1,&V2,xv1,xv2);
  strf2c(xcmp, lxcmp, xcmp, lxcmp, F2C_TRIM);
}
#else
void m$pkt_except(const char *,char *,int_4 *,int_4 *,fstring_len_t,
		          fstring_len_t);
void m_pkt_except(const char *string, char *xcmp, int_4 *xv1, int_4 *xv2,
                  int_4 lxcmp)
{
  m$pkt_except(string,xcmp,xv1,xv2,strlen(string),lxcmp);
  strf2c(xcmp, lxcmp, xcmp, lxcmp, F2C_TRIM);
}
#endif

#if _VMS
void m$chk_pkt_flags(HEADER *,VAXstr *,int_4 *);
void m_chk_pkt_flags(HEADER *hcb, const char *aflag, int_4 *inv_act)
{
  VAXstr V;
  C2VAXSTR(aflag, 1, V);
  m$chk_pkt_flags(hcb,&V,inv_act);
}
#else
void m$chk_pkt_flags(HEADER *,const char *,int_4 *,fstring_len_t);
void m_chk_pkt_flags(HEADER *hcb, const char *aflag, int_4 *inv_act)
{
  m$chk_pkt_flags(hcb,aflag,inv_act,1);
}
#endif

void m$hm_flag(HEADER *);
void m_hm_flag(HEADER *hcb)
{
  m$hm_flag(hcb);
}

#if _VMS
void m$convert_pkt_rep(HEADER *,VAXstr *);
void m_convert_pkt_rep(HEADER *hcb, const char *cvrep)
{
  VAXstr V;
  C2VAXSTR(cvrep, 4, V);
  m$convert_pkt_rep(hcb,&V);
}
#else
void m$convert_pkt_rep(HEADER *,const char *,fstring_len_t);
void m_convert_pkt_rep(HEADER *hcb, const char *cvrep)
{
  m$convert_pkt_rep(hcb,cvrep,4);
}
#endif

#endif


/* PIPEIO functions */
/* NTN: PIPEIO functions are NOT supported in XBC as they are for internal usages only */
int_4 m$pheadloc_ (int_4 * p1) {
  warnNotImplemented("M$PHEADLOC");
  return 0;
}
void m$pindices_ (const HEADER * p1,real_8 * p2,real_8 * p3,real_8 * p4) {
  warnNotImplemented("M$PINDICES");
}

#if _UNIX
#define m$pheadloc		m$pheadloc_
#define m$pindices		m$pindices_
#endif

#if !_FDS

int_4 m$pheadloc(int_4 *);
int_4 m_headloc(int_4 np)
{
  return m$pheadloc(&np);
}

void m$pindices(const HEADER *,real_8 *,real_8 *,real_8 *);
void m_pindices(const HEADER *hcb, real_8 *psize, real_8 *pread, real_8 *pwrite)
{
  m$pindices(hcb, psize, pread, pwrite);
}

#endif

/* RESULTS functions */

#if _UNIX
#define m$arslt 		m$arslt_
#define m$drslt 		m$drslt_
#define m$frslt 		m$frslt_
#define m$lrslt 		m$lrslt_
#define m$irslt 		m$irslt_
#define m$brslt 		m$brslt_
#define m$trslt 		m$trslt_
#define m$get_result		m$get_result_
#define m$put_result		m$put_result_
#define m$rattr_mask2str	m$rattr_mask2str_
#define m$rattr_str2mask 	m$rattr_str2mask_
#define m$rdisp 		m$rdisp_
#define m$rfind 		m$rfind_
#define m$rgood 		m$rgood_
#define m$str2result		m$str2result_
#define m$rcast 		m$rcast_
#endif

#if !_FDS

#if _VMS
void m$arslt(VAXstr *,VAXstr *);
void m_arslt(const char *name, char *aval, int_4 nlen, int_4 alen)
{
  VAXstr V1, V2;
  C2VAXSTR(name, nlen, V1);
  C2VAXSTR(aval, alen, V2);
  m$arslt(&V1, &V2);
}
#else
void m$arslt(const char *,char *,fstring_len_t,fstring_len_t);
void m_arslt(const char *name, char *aval, int_4 nlen, int_4 alen)
{
  m$arslt(name,aval,nlen,alen);
}
#endif

#if _VMS
void m$drslt(VAXstr *,real_8 *);
void m_drslt(const char *name, real_8 dval, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$drslt(&V, &dval);
}
#else
void m$drslt(const char *,real_8 *,fstring_len_t);
void m_drslt(const char *name, real_8 dval, int_4 nlen)
{
  m$drslt(name,&dval,nlen);
}
#endif

#if _VMS
void m$frslt(VAXstr *,real_4 *);
void m_frslt(const char *name, real_4 fval, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$frslt(&V, &fval);
}
#else
void m$frslt(const char *,real_4 *,fstring_len_t);
void m_frslt(const char *name, real_4 fval, int_4 nlen)
{
  m$frslt(name,&fval,nlen);
}
#endif

#if _VMS
void m$lrslt(VAXstr *,int_4 *);
void m_lrslt(const char *name, int_4 lval, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$lrslt(&V, &lval);
}
#else
void m$lrslt(const char *,int_4 *,fstring_len_t);
void m_lrslt(const char *name, int_4 lval, int_4 nlen)
{
  m$lrslt(name,&lval,nlen);
}
#endif

#if _VMS
void m$irslt(VAXstr *,int_2 *);
void m_irslt(const char *name, int_2 ival, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$irslt(&V, &ival);
}
#else
void m$irslt(const char *,int_2 *,fstring_len_t);
void m_irslt(const char *name, int_2 ival, int_4 nlen)
{
  m$irslt(name,&ival,nlen);
}
#endif

#if _VMS
void m$brslt(VAXstr *,int_1 *);
void m_brslt(const char *name, int_1 bval, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$lrslt(&V, &bval);
}
#else
void m$brslt(const char *,int_1 *,fstring_len_t);
void m_brslt(const char *name, int_1 bval, int_4 nlen)
{
  m$brslt(name,&bval,nlen);
}
#endif

#if _VMS
void m$trslt(VAXstr *,real_8 *,real_8 *);
void m_trslt(const char *name, real_8 time1, real_8 time2, int_4 nlen)
{
  VAXstr V;
  C2VAXSTR(name, nlen, V);
  m$trslt(&V,&time1,&time2);
}
#else
void m$trslt(const char *,real_8 *,real_8 *,fstring_len_t);
void m_trslt(const char *name, real_8 time1, real_8 time2, int_4 nlen)
{
  m$trslt(name,&time1,&time2,nlen);
}
#endif

#if _VMS
int_4 m$get_result(VAXstr *,void *,int_4 *,int_4 *,VAXstr *,int_4 *);
int_4 m_get_result(const char *label, void *buf, int_4 buflen, int_4 modemask,
                   char *type, int_4 *attrmask)
{
  VAXstr V1, V2;
  C2VAXSTR(label, strlen(label), V1);
  C2VAXSTR(type, 1, V2);
  return m$get_result(&V1,buf,&buflen,&modemask,&V2,attrmask);
}
#else
int_4 m$get_result(const char *,void *,int_4 *,int_4 *,
                   char *,int_4 *,fstring_len_t,fstring_len_t);
int_4 m_get_result(const char *label, void *buf, int_4 buflen, int_4 modemask,
                   char *type, int_4 *attrmask)
{
  return m$get_result(label,buf,&buflen,&modemask,type,attrmask,strlen(label),1);
}
#endif

#if _VMS
int_4 m$put_result(VAXstr *,void *,int_4 *,int_4 *,VAXstr *,int_4 *);
int_4 m_put_result(const char *label, void *buf, int_4 buflen, int_4 modemask,
                   const char *type, int_4 attrmask)
{
  VAXstr V1, V2;
  C2VAXSTR(label, strlen(label), V1);
  C2VAXSTR(type, 1, V2);
  return m$put_result(&V1,buf,&buflen,&modemask,&V2,&attrmask);
}
#else
int_4 m$put_result(const char *,void *,int_4 *,int_4 *,
                   const char *,int_4 *,fstring_len_t,fstring_len_t);
int_4 m_put_result(const char *label, void *buf, int_4 buflen, int_4 modemask,
                   const char *type, int_4 attrmask)
{
  return m$put_result(label,buf,&buflen,&modemask,type,&attrmask,
                      strlen(label),1);
}
#endif

/* m_del_result defined in cresults.c */

#if _VMS
int_4 m$rattr_mask2str(const int_4 *,VAXstr *);
int_4 m_rattr_mask2str(const int_4 attrmask, char *attrstr, int_4 ls)
{
  int_4 status;
  VAXstr V;
  C2VAXSTR(attrstr, ls, V);
  status = m$rattr_mask2str(&attrmask,&V);
  strf2c(attrstr, ls, attrstr, ls, F2C_TRIM);
  return status;
}
#else
int_4 m$rattr_mask2str(const int_4 *,char *,fstring_len_t);
int_4 m_rattr_mask2str(const int_4 attrmask, char *attrstr, int_4 ls)
{
  int_4 status;
  status = m$rattr_mask2str(&attrmask,attrstr,ls);
  strf2c(attrstr, ls, attrstr, ls, F2C_TRIM);
  return status;
}
#endif

#if _VMS
int_4 m$rattr_str2mask(VAXstr *,int_4 *);
int_4 m_rattr_str2mask(const char *attrstr, int_4 *mask)
{
  VAXstr V;
  C2VAXSTR(attrstr, strlen(attrstr), V);
  return m$rattr_str2mask(&V,mask);
}
#else
int_4 m$rattr_str2mask(const char *,int_4 *,fstring_len_t);
int_4 m_rattr_str2mask(const char *attrstr, int_4 *mask)
{
  return m$rattr_str2mask(attrstr,mask,strlen(attrstr));
}
#endif

#if _VMS
void m$rdisp(VAXstr *,VAXstr *,const int_4 *);
char m_rdisp(const char *name, const int_4 mask)
{
  VAXstr V,VRTN;
  char type;
  C2VAXSTR(name, strlen(name), V);
  C2VAXSTR(&type, 1, VRTN);
  m$rdisp(&VRTN, &V, &mask);
  return type;
}
#else
#if _PFC
char *m$rdisp(const char *,const int_4 *,fstring_len_t);
char m_rdisp(const char *name, const int_4 mask)
{
  char type;
  type = *(char*) m$rdisp(name,&mask,strlen(name));
  return type;
}
#else
void m$rdisp(char *,fstring_len_t,const char *,const int_4 *,fstring_len_t);
char m_rdisp(const char *name, const int_4 mask)
{
  char type;
  m$rdisp(&type,1,name,&mask,strlen(name));
  return type;
}
#endif
#endif

#if _VMS
void m$rfind(VAXstr *,VAXstr *,VAXstr *,real_8 *);
char m_rfind(const char *label, char *aval, real_8 *dval,
             int_4 llen, int_4 alen)
{
  VAXstr V1, V2, VRTN;
  char type;
  C2VAXSTR(label, llen, V1);
  C2VAXSTR(aval, alen, V2);
  C2VAXSTR(&type, 1, VRTN);
  m$rfind(&VRTN, &V1, &V2, dval);
  return type;
}
#else
#if _PFC
char *m$rfind(const char *,char *,real_8 *,fstring_len_t,fstring_len_t);
char m_rfind(const char *label, char *aval, real_8 *dval,
             int_4 llen, int_4 alen)
{
  char type;
  type = *(char*) m$rfind(label,aval,dval,llen,alen);
  return type;
}
#else
void m$rfind(char *,int_4,const char *,char *,real_8 *,int_4,int_4);
char m_rfind(const char *label, char *aval, real_8 *dval,
             int_4 llen, int_4 alen)
{
  char type;
  m$rfind(&type,1,label,aval,dval,llen,alen);
  return type;
}
#endif
#endif

#if _VMS
int_4 m$rgood(VAXstr *,VAXstr *,int_4 *,int_4 *);
int_4 m_rgood(const char *label, char *type, int_4 *iname, int_4 *jname)
{
  VAXstr V1, V2;
  C2VAXSTR(label, strlen(label), V1);
  C2VAXSTR(type, 1, V2);
  return m$rgood(&V1,&V2,iname,jname);
}
#else
int_4 m$rgood(const char *,char *,int_4 *,int_4 *,fstring_len_t,fstring_len_t);
int_4 m_rgood(const char *label, char *type, int_4 *iname, int_4 *jname)
{
  return m$rgood(label,type,iname,jname,strlen(label),1);
}
#endif

#if _VMS
int_4 m$str2result(VAXstr *,VAXstr *,int_4 *);
int_4 m_str2result(const char *label, const char *value_str, int_4 attrmask)
{
  VAXstr V1,V2;
  C2VAXSTR(label, strlen(label), V1);
  C2VAXSTR(value_str, strlen(value_str), V2);
  return m$str2result(&V1,&V2,&attrmask);
}
#else
int_4 m$str2result(const char *,const char *,int_4 *,fstring_len_t,fstring_len_t);
int_4 m_str2result(const char *label, const char *value_str, int_4 attrmask)
{
  return m$str2result(label,value_str,&attrmask,strlen(label),strlen(value_str));
}
#endif

#if _VMS
void m$rcast(VAXstr *,VAXstr *,real_8 *);
void m_rcast(const char *type, const char *name, real_8 value)
{
  VAXstr V1,V2;
  C2VAXSTR(type, 1, V1);
  C2VAXSTR(name, strlen(name), V2);
  m$rcast(&V1,&V2,&value);
}
#else
void m$rcast(const char *,const char *,real_8 *,fstring_len_t,fstring_len_t);
void m_rcast(const char *type, const char *name, real_8 value)
{
  m$rcast(type,name,&value,1,strlen(name));
}
#endif

#endif

/* SHELL */
/* NTN: SHELL functions (m$verify, m$load_bitmasks) are NOT supported under XBC.
        as they are for internal usages only.
 */

/* TYPE 4000 functions */
/* NTN: TYPE 4000 functions are NOT supported in XBC
#if _UNIX
#define m$vrbget		m$vrbget_
#define m$vrbclr		m$vrbclr_
#define m$vrbcpy		m$vrbcpy_
#define m$vrbdel		m$vrbdel_
#define m$vrbfind		m$vrbfind_
#define m$vrbfree		m$vrbfree_
#if !_FDS
#define m$vrbfunc		m$vrbfunc_
#endif
#define m$vrbhdr_pack		m$vrbhdr_pack_
#define m$vrbhdr_unpack 	m$vrbhdr_unpack_
#define m$vrbinit		m$vrbinit_
#define m$vrbput		m$vrbput_
#endif

int_4 m$vrbclr(VRB *,int_4 *);
int_4 m_vrbclr(VRB *vrb,int_4 mode)
{
  return m$vrbclr(vrb,&mode);
}

int_4 m$vrbcpy(VRB *,VRB *,int_4 *);
int_4 m_vrbcpy(VRB *vrb1, VRB *vrb2, int_4 mode)
{
  return m$vrbcpy(vrb1,vrb2,&mode);
}

#if _VMS
int_4 m$vrbfind(VRB *, VAXstr *, void *, int_4 *, int_4 *, VAXstr *);
int_4 m_vrbfind(VRB *vrb, char *key, int_4 lkey, void *lbuf, int_4 mbuf,
                int_4 mode, char *type)
{
  VAXstr Vk,Vt;
  C2VAXSTR(key, lkey, Vk);
  C2VAXSTR(type, 1, Vt);
  return m$vrbfind(vrb,&Vk,lbuf,&mbuf,&mode,&Vt);
}
#else
int_4 m$vrbfind(VRB *,char *, void *,int_4 *,int_4 *, char *,int_4, int_4);
int_4 m_vrbfind(VRB *vrb, char *key, int_4 lkey, void *lbuf, int_4 mbuf,
                int_4 mode, char *type)
{
  return m$vrbfind(vrb,key,lbuf,&mbuf,&mode,type,lkey,1);
}
#endif

int_4 m$vrbfree(VRB *,int_4 *);
int_4 m_vrbfree(VRB *vrb,int_4 mode)
{
  return m$vrbfree(vrb,&mode);
}

#if !_FDS
int_4 m$vrbfunc(HEADER *,VRB *, int_4 *, real_8 *, int_4 *);
int_4 m_vrbfunc(HEADER *hcb, VRB *vrb, int_4 nrec, real_8 offset, int_4 func)
{
  return m$vrbfunc(hcb,vrb,&nrec,&offset,&func);
}
#endif

#if _VMS
int_4 m$vrbget(VRB *,VAXstr *,void *,int_4 *,int_4 *,VAXstr *);
int_4 m_vrbget(VRB *vrb, char *key, int lkey,
               void *data, int_4 bytes, int_4 mode, char *type)
{
  VAXstr Vk,Vt;
  C2VAXSTR(key, lkey, Vk);
  C2VAXSTR(type, 1, Vt);
  return  m$vrbget(vrb, &Vk, data, &bytes, &mode, &Vt);
}
#else
int_4 m$vrbget(VRB *,char *,void *,int_4 *,int_4 *,char *,int_4,int_4);
int_4 m_vrbget(VRB *vrb, char *key, int_4 lkey,
               void *data, int_4 bytes, int_4 mode, char *type)
{
  return m$vrbget(vrb, key, data, &bytes, &mode, type, lkey,1);
}
#endif

#if _VMS
int_4 m$vrbhdr_pack(KEYSTRUCT *,int_4 *,int_4 *,int_4 *,VAXstr *);
int_4 m_vrbhdr_pack(KEYSTRUCT *kh, int_4 lkey, int_4 ltag, int_4 ldata,
                    char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  return m$vrbhdr_pack(kh,&lkey,&ltag,&ldata,&V);
}
#else
int_4 m$vrbhdr_pack(KEYSTRUCT *,int_4 *,int_4 *,int_4 *,char *,int_4);
int_4 m_vrbhdr_pack(KEYSTRUCT *kh, int_4 lkey, int_4 ltag, int_4 ldata,
                    char *type)
{
  return m$vrbhdr_pack(kh,&lkey,&ltag,&ldata,type,1);
}
#endif

#if _VMS
int_4 m$vrbhdr_unpack(KEYSTRUCT *,int_4 *,int_4 *,int_4 *,VAXstr *);
int_4 m_vrbhdr_unpack(KEYSTRUCT *kh, int_4 lkey, int_4 ltag, int_4 ldata,
                      char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  return m$vrbhdr_unpack(kh,&lkey,&ltag,&ldata,&V);
}
#else
int_4 m$vrbhdr_unpack(KEYSTRUCT *,int_4 *,int_4 *,int_4 *,char *,int_4);
int_4 m_vrbhdr_unpack(KEYSTRUCT *kh, int_4 lkey, int_4 ltag, int_4 ldata,
                      char *type)
{
  return m$vrbhdr_unpack(kh,&lkey,&ltag,&ldata,type,1);
}
#endif

int_4 m$vrbinit(VRB *,int_4 *,int_4 *);
int_4 m_vrbinit(VRB *vrb, int_4 mode, int_4 lrec)
{
  return m$vrbinit(vrb,&mode,&lrec);
}

#if _VMS
int_4 m$vrbput(VRB *,VAXstr *,void *,int_4 *,int_4 *,VAXstr *);
int_4 m_vrbput(VRB *vrb, char *key, int_4 lkey, void *data, int_4 bytes,
                int_4 mode, char *type)
{
  VAXstr Vk,Vt;
  C2VAXSTR(key, lkey, Vk);
  C2VAXSTR(type, 1, Vt);
  return  m$vrbput(vrb, &Vk, data, &bytes, &mode, &Vt);
}
#else
int_4 m$vrbput(VRB *,char *,void *,int_4 *,int_4 *,char *,int_4,int_4);
int_4 m_vrbput(VRB *vrb, char *key, int_4 lkey, void *data, int_4 bytes,
                int_4 mode, char *type)
{
  return m$vrbput(vrb, key, data, &bytes, &mode, type, lkey,1);
}
#endif

NTN: end of un-supported functions in XBC
*/

/* TYPE 5000 functions */

#if _UNIX
#define m$addcomp		m$addcomp_
#define m$addsrec		m$addsrec_
#define m$addsubr		m$addsubr_
#if !_FDS
#define m$addt6srec		m$addt6srec_
#define m$addt6subr		m$addt6subr_
#endif
#define m$car_to_geo		m$car_to_geo_
#define m$car_to_sph		m$car_to_sph_
#define m$conversion_factor	m$conversion_factor_
#define m$convert_units 	m$convert_units_
#define m$crf_to_crf		m$crf_to_crf_
#define m$crf_to_ecr		m$crf_to_ecr_
#define m$dvadd 		m$dvadd_
#define m$dvscale		m$dvscale_
#define m$eci_to_ecr		m$eci_to_ecr_
#define m$ecr_to_crf		m$ecr_to_crf_
#define m$ecr_to_eci		m$ecr_to_eci_
#define m$ecr_to_top		m$ecr_to_top_
#define m$epoch_hour_angle	m$epoch_hour_angle_
#define m$geo_to_car		m$geo_to_car_
#define m$grab5n		m$grab5n_
#define m$grabt 		m$grabt_
#define m$grabxt		m$grabxt_
#define m$matrix_cpy		m$matrix_cpy_
#define m$matrix_dump		m$matrix_dump_
#define m$matrix_idn		m$matrix_idn_
#define m$matrix_inv		m$matrix_inv_
#define m$matrix_mul		m$matrix_mul_
#define m$matrix_mula		m$matrix_mula_
#define m$matrix_mulab		m$matrix_mulab_
#define m$matrix_mulpva 	m$matrix_mulpva_
#define m$matrix_rot		m$matrix_rot_
#define m$matrix_top2ecr	m$matrix_top2ecr_
#define m$matrix_trn		m$matrix_trn_
#define m$sph_to_car		m$sph_to_car_
#define m$sub_find		m$sub_find_
#define m$sub_offset		m$sub_offset_
#define m$sub_format		m$sub_format_
#define m$sub_name		m$sub_name_
#define m$top_to_ecr		m$top_to_ecr_
#define m$top_to_top		m$top_to_top_
#define m$transfer		m$transfer_
#define m$transform		m$transform_
#if !_FDS
#define m$open_t6subrecords	m$open_t6subrecords_
#define m$update_t6subrecords	m$update_t6subrecords_
#define m$get_t6subrecord	m$get_t6subrecord_
#define m$put_t6subrecord	m$put_t6subrecord_
#endif
#endif

#if _VMS
void m$addcomp(HEADER *,VAXstr *,VAXstr *,const int_4 *,const int_4 *);
void m_addcomp(HEADER *hcb, const char *name, const char *format,
               const int_4 type, const int_4 units)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(format, strlen(format), V2);
  m$addcomp(hcb,&V1,&V2,&type,&units);
}
#else
void m$addcomp(HEADER *,const char *,const char *,const int_4 *,const int_4 *,
		       fstring_len_t,fstring_len_t);
void m_addcomp(HEADER *hcb, const char *name, const char *format,
               const int_4 type, const int_4 units)
{
  m$addcomp(hcb,name,format,&type,&units,strlen(name),strlen(format));
}
#endif

#if _VMS
void m$addsrec(HEADER *,VAXstr *, VAXstr *);
void m_addsrec(HEADER *hcb, const char *name, const char *format)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(format, strlen(format), V2);
  m$addsrec(hcb,&V1,&V2);
}
#else
void m$addsrec(HEADER *,const char *,const char *,fstring_len_t,fstring_len_t);
void m_addsrec(HEADER *hcb, const char *name, const char *format)
{
  m$addsrec(hcb,name,format,strlen(name),strlen(format));
}
#endif

#if _VMS
void m$addsubr(HEADER *,VAXstr *, VAXstr *);
void m_addsubr(HEADER *hcb, const char *name, const char *format)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(format, strlen(format), V2);
  m$addsubr(hcb,&V1,&V2);
}
#else
void m$addsubr(HEADER *,const char *,const char *,fstring_len_t,fstring_len_t);
void m_addsubr(HEADER *hcb, const char *name, const char *format)
{
  m$addsubr(hcb,name,format,strlen(name),strlen(format));
}
#endif

#if !_FDS
#if _VMS
void m$addt6srec(HEADER *,VAXstr *,VAXstr *,const real_8 *, const real_8 *,
                 const int_4 *,const int_4 *,const int_4 *);
void m_addt6srec(HEADER *hcb, const char *name, const char *format,
                 const real_8 minval, const real_8 maxval, const int_4 nel,
                 const int_4 units, const int_4 uprefix)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(format, strlen(format), V2);
  m$addt6srec(hcb,&V1,&V2,&minval,&maxval,&nel,&units,&uprefix);
}
#else
void m$addt6srec(HEADER *,const char *,const char *,const real_8 *,
                 const real_8 *, const int_4 *,const int_4 *,const int_4 *,
                 fstring_len_t,fstring_len_t);
void m_addt6srec(HEADER *hcb, const char *name, const char *format,
                 const real_8 minval, const real_8 maxval, const int_4 nel,
                 const int_4 units, const int_4 uprefix)
{
  m$addt6srec(hcb,name,format,&minval,&maxval,&nel,&units,&uprefix,
              strlen(name),strlen(format));
}
#endif

#if _VMS
void m$addt6subr(HEADER *,VAXstr *,VAXstr *,const real_8 *, const real_8 *,
                 const int_4 *,const int_4 *,const int_4 *);
void m_addt6subr(HEADER *hcb, const char *name, const char *format,
                 const real_8 minval, const real_8 maxval, const int_4 nel,
                 const int_4 units, const int_4 uprefix)
{
  VAXstr V1,V2;
  C2VAXSTR(name, strlen(name), V1);
  C2VAXSTR(format, strlen(format), V2);
  m$addt6subr(hcb,&V1,&V2,&minval,&maxval,&nel,&units,&uprefix);
}
#else
void m$addt6subr(HEADER *,const char *,const char *,const real_8 *,
                 const real_8 *, const int_4 *,const int_4 *,const int_4 *,
                 fstring_len_t,fstring_len_t);
void m_addt6subr(HEADER *hcb, const char *name, const char *format,
                 const real_8 minval, const real_8 maxval, const int_4 nel,
                 const int_4 units, const int_4 uprefix)
{
  m$addt6subr(hcb,name,format,&minval,&maxval,&nel,&units,&uprefix,
              strlen(name),strlen(format));
}
#endif
#endif

void m$car_to_geo(real_8 *,const int_4 *,const int_4 *);
void m_car_to_geo(real_8 *v, const int_4 mode, const int_4 nrec)
{
  m$car_to_geo(v,&mode,&nrec);
}

void m$car_to_sph(real_8 *,const int_4 *,const int_4 *);
void m_car_to_sph(real_8 *v, const int_4 mode, const int_4 nrec)
{
  m$car_to_sph(v,&mode,&nrec);
}

void m$conversion_factor(const int_4 *,const int_4 *,real_8 *);
void m_conversion_factor(const int_4 units1, const int_4 units2,
                         real_8 *factor)
{
  m$conversion_factor(&units1,&units2,factor);
}

void m$convert_units(const int_4 *,const int_4 *,int_4 *);
void m_convert_units(const int_4 units1, const int_4 type, int_4 *units2)
{
  m$convert_units(&units1,&type,units2);
}

void m$crf_to_crf(real_8 *,const int_4 *,const int_4 *,
                  const real_8 *,const real_8 *);
void m_crf_to_crf(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 a, const real_8 b)
{
  m$crf_to_crf(v,&mode,&nrec,&a,&b);
}

void m$crf_to_ecr(real_8 *,const int_4 *,const int_4 *,const real_8 *);
void m_crf_to_ecr(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 a)
{
  m$crf_to_ecr(v,&mode,&nrec,&a);
}

void m$dvadd(real_8 *,const int_4 *,const real_8 *,const int_4 *);
void m_dvadd(real_8 *a, const int_4 isk, const real_8 add, const int_4 nrec)
{
   m$dvadd(a,&isk,&add,&nrec);
}

void m$dvscale(real_8 *,const int_4 *,const real_8 *,const int_4 *);
void m_dvscale(real_8 *a, const int_4 isk, const real_8 add, const int_4 nrec)
{
  m$dvscale(a,&isk,&add,&nrec);
}

void m$eci_to_ecr(real_8 *,const int_4 *,const int_4 *,real_8 *);
void m_eci_to_ecr(real_8 *v, const int_4 mode, const int_4 nrec, real_8 *gha)
{
  m$eci_to_ecr(v,&mode,&nrec,gha);
}

void m$ecr_to_crf(real_8 *,const int_4 *,const int_4 *,const real_8 *);
void m_ecr_to_crf(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 a)
{
  m$ecr_to_crf(v,&mode,&nrec,&a);
}

void m$ecr_to_eci(real_8 *,const int_4 *,const int_4 *,real_8 *);
void m_ecr_to_eci(real_8 *v, const int_4 mode, const int_4 nrec, real_8 *gha)
{
  m$ecr_to_eci(v,&mode,&nrec,gha);
}

void m$ecr_to_top(real_8 *,const int_4 *,const int_4 *,const real_8 *);
void m_ecr_to_top(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 *a)
{
  m$ecr_to_top(v,&mode,&nrec,a);
}

void m$epoch_hour_angle(const real_8 *,real_8 *,real_8 *,real_8 *);
void m_epoch_hour_angle(const real_8 time, real_8 *year, real_8 *second,
                        real_8 *rag)
{
  m$epoch_hour_angle(&time,year,second,rag);
}

void m$geo_to_car(real_8 *,const int_4 *,const int_4 *);
void m_geo_to_car(real_8 *v, const int_4 mode, const int_4 nrec)
{
  m$geo_to_car(v,&mode,&nrec);
}

#if _VMS
void m$grab5n(HEADER *,void *,const real_8 *,const int_4 *,int_4 *,VAXstr *);
void m_grab5n(HEADER *hcb, void *buf, const real_8 start, const int_4 nget,
              int_4 *ngot, char *list)
{
  VAXstr V;
  C2VAXSTR(list, strlen(list), V);
  m$grab5n(hcb,buf,&start,&nget,ngot,&V);
}
#else
void m$grab5n(HEADER *,void *,const real_8 *,const int_4 *,int_4 *,char *,
		      fstring_len_t);
void m_grab5n(HEADER *hcb, void *buf, const real_8 start, const int_4 nget,
              int_4 *ngot, char *list)
{
  m$grab5n(hcb,buf,&start,&nget,ngot,list,strlen(list));
}
#endif

void m$grabt(HEADER *,void *,const real_8 *,const int_4 *,int_4 *,HEADER *);
void m_grabt(HEADER *hcb, void *buf, const real_8 start, const int_4 nget,
             int_4 *ngot, HEADER *hcbt)
{
  m$grabt(hcb,buf,&start,&nget,ngot,hcbt);
}

void m$grabxt(HEADER *,void *,int_4 *,HEADER *);
void m_grabxt(HEADER *hcb, void *buf, int_4 *ngot, HEADER *hcbt)
{
  m$grabxt(hcb,buf,ngot,hcbt);
}

void m$matrix_cpy(const TRANSMATRIX *,TRANSMATRIX *);
void m_matrix_cpy(const TRANSMATRIX *a, TRANSMATRIX *b)
{
  m$matrix_cpy(a,b);
}

void m$matrix_dump(const TRANSMATRIX *);
void m_matrix_dump(const TRANSMATRIX *a)
{
  m$matrix_dump(a);
}

void m$matrix_idn(TRANSMATRIX *);
void m_matrix_idn(TRANSMATRIX *a)
{
  m$matrix_idn(a);
}

void m$matrix_inv(const TRANSMATRIX *,TRANSMATRIX *);
void m_matrix_inv(const TRANSMATRIX *a, TRANSMATRIX *b)
{
  m$matrix_inv(a,b);
}

void m$matrix_mul(const TRANSMATRIX *,const TRANSMATRIX *,TRANSMATRIX *);
void m_matrix_mul(const TRANSMATRIX *a, const TRANSMATRIX *b, TRANSMATRIX *c)
{
  m$matrix_mul(a,b,c);
}

void m$matrix_mula(const real_8 *,real_8 *,const int_4 *,const int_4 *);
void m_matrix_mula(const real_8 *a, real_8 *b, const int_4 isk,
                   const int_4 nrec)
{
  m$matrix_mula(a,b,&isk,&nrec);
}

void m$matrix_mulab(const real_8 *,real_8 *,const int_4 *,const int_4 *);
void m_matrix_mulab(const real_8 *a, real_8 *b, const int_4 isk,
                    const int_4 nrec)
{
  m$matrix_mulab(a,b,&isk,&nrec);
}

void m$matrix_mulpva(const real_8 *,real_8 *,const int_4 *,const int_4 *);
void m_matrix_mulpva(const real_8 *a, real_8 *b, const int_4 isk,
                     const int_4 nrec)
{
  m$matrix_mulpva(a,b,&isk,&nrec);
}

void m$matrix_rot(TRANSMATRIX *,const real_8 *,const int_4 *);
void m_matrix_rot(TRANSMATRIX *a, const real_8 angle, const int_4 type)
{
  m$matrix_rot(a,&angle,&type);
}

void m$matrix_top2ecr(TRANSMATRIX *,const real_8 *);
void m_matrix_top2ecr(TRANSMATRIX *m, const real_8 *a)
{
  m$matrix_top2ecr(m,a);
}

void m$matrix_trn(TRANSMATRIX *);
void m_matrix_trn(TRANSMATRIX *a)
{
  m$matrix_trn(a);
}

void m$sph_to_car(real_8 *,const int_4 *,const int_4 *);
void m_sph_to_car(real_8 *v, const int_4 mode, const int_4 nrec)
{
  m$sph_to_car(v,&mode,&nrec);
}

#if _VMS
int_4 m$sub_find(HEADER *,VAXstr *);
int_4 m_sub_find(HEADER *hcb, const char *name)
{
  VAXstr V;
  C2VAXSTR(name, strlen(name), V);
  return m$sub_find(hcb,&V);
}
#else
int_4 m$sub_find(HEADER *,const char *,fstring_len_t);
int_4 m_sub_find(HEADER *hcb, const char *name)
{
  return m$sub_find(hcb,name,strlen(name));
}
#endif

int_4 m$sub_offset(HEADER *,const int_4 *);
int_4 m_sub_offset(HEADER *hcb, const int_4 index)
{
  return m$sub_offset(hcb,&index);
}

#if _VMS
void m$sub_format(VAXstr *,HEADER *,const int_4 *);
char *m_sub_format(HEADER *hcb, const int_4 index)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(2+1);
  C2VAXSTR(str, 2, VRTN);
  m$sub_format(&VRTN,hcb,&index);
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$sub_format(HEADER *,const int_4 *);
char *m_sub_format(HEADER *hcb, const int_4 index)
{
  char *str=NULL;
  char *str_ret=NULL;
  str_ret = (char *) malloc(2+1);
  str = m$sub_format(hcb,&index);
  strf2c(str, 2, str_ret, 2+1, F2C_TRIM);
  return str_ret;
}
#else
void m$sub_format(char *,fstring_len_t,HEADER *,const int_4 *);
char *m_sub_format(HEADER *hcb, const int_4 index)
{
  char *str;
  str = (char *) malloc(2+1);
  m$sub_format(str,2,hcb,&index);
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$sub_name(VAXstr *,HEADER *,const int_4 *);
char *m_sub_name(HEADER *hcb, const int_4 index)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(24+1);
  C2VAXSTR(str, 24, VRTN);
  m$sub_name(&VRTN,hcb,&index);
  strf2c(str, 24, str, 24+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$sub_name(HEADER *,const int_4 *);
char *m_sub_name(HEADER *hcb,const int_4 index)
{
  char *str=NULL;
  char *str_ret=NULL;
  str_ret = (char *) malloc(24+1);
  str = m$sub_name(hcb,&index);
  strf2c(str, 24, str_ret, 24+1, F2C_TRIM);
  return str_ret;
}
#else
void m$sub_name(char *,fstring_len_t,HEADER *,const int_4 *);
char *m_sub_name(HEADER *hcb,const int_4 index)
{
  char *str;
  str = (char *) malloc(24+1);
  m$sub_name(str,24,hcb,&index);
  strf2c(str, 24, str, 24+1, F2C_TRIM);
  return str;
}
#endif
#endif

void m$top_to_ecr(real_8 *,const int_4 *,const int_4 *,const real_8 *);
void m_top_to_ecr(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 *a)
{
  m$top_to_ecr(v,&mode,&nrec,a);
}

void m$top_to_top(real_8 *,const int_4 *,const int_4 *,const real_8 *,const real_8 *);
void m_top_to_top(real_8 *v, const int_4 mode, const int_4 nrec,
                  const real_8 *a, const real_8 *b)
{
  m$top_to_top(v,&mode,&nrec,a,b);
}

void m$transfer(HEADER *,void *,HEADER *,void *,const int_4 *,const int_4 *);
void m_transfer(HEADER *ha, void *a, HEADER *hb, void *b,
                const int_4 nrec, const int_4 mode)
{
  m$transfer(ha,a,hb,b,&nrec,&mode);
}

#if _VMS
void m$transform(HEADER *,VAXstr *,VAXstr *,VAXstr *,VAXstr *);
void m_transform(HEADER *hcb, const char *list, const char *frame,
                 const char *coord, const char *units)
{
  VAXstr V1,V2,V3,V4;
  C2VAXSTR(list, strlen(list), V1);
  C2VAXSTR(frame, strlen(frame), V2);
  C2VAXSTR(coord, strlen(coord), V3);
  C2VAXSTR(units, strlen(units), V4);
  m$transform(hcb,&V1,&V2,&V3,&V4);
}
#else
void m$transform(HEADER *,const char *,const char *,const char *,const char *,
		         fstring_len_t,fstring_len_t,fstring_len_t,fstring_len_t);
void m_transform(HEADER *hcb, const char *list, const char *frame,
                 const char *coord, const char *units)
{
  m$transform(hcb,list,frame,coord,units,strlen(list),strlen(frame),
              strlen(coord),strlen(units));
}
#endif

#if !_FDS
void m$open_t6subrecords(HEADER *);
void m_open_t6subrecords(HEADER *hcb)
{
  m$open_t6subrecords(hcb);
}

void m$update_t6subrecords(HEADER *);
void m_update_t6subrecords(HEADER *hcb)
{
  m$update_t6subrecords(hcb);
}

void m$get_t6subrecord(HEADER *, int_4 *, int_4 *);
void m_get_t6subrecord(HEADER *hcb, int_4 n, int_4 t6subr)
{
  m$get_t6subrecord(hcb, &n, &t6subr);
}

void m$put_t6subrecord(HEADER *, int_4 *, int_4 *);
void m_put_t6subrecord(HEADER *hcb, int_4 n, int_4 t6subr)
{
  m$put_t6subrecord(hcb, &n, &t6subr);
}
#endif

/* UTILITIES functions */

#if _UNIX
#define m$search			m$search_
#define m$searchb			m$searchb_
#define m$lengthq			m$lengthq_
#define m$parse 			m$parse_
#define m$trim_quotes			m$trim_quotes_
#define m$lowercase			m$lowercase_
#define m$uppercase			m$uppercase_
#define m$wordwrap			m$wordwrap_
#define m$wrapnextlines 		m$wrapnextlines_
#define m$chk				m$chk_
#define m$d2a				m$d2a_
#define m$d2a_form			m$d2a_form_
#define m$f2a				m$f2a_
#define m$l2a				m$l2a_
#define m$f2d				m$f2d_
#define m$d2f				m$d2f_
#define m$dms2deg			m$dms2deg_
#define m$deg2dm			m$deg2dm_
#define m$deg2dms			m$deg2dms_
#if !_FDS
#define m$a2d				m$a2d_
#define m$logical			m$logical_
#endif
#define m$spa				m$spa_
#define m$bps				m$bps_
#define m$bpa				m$bpa_
#define m$bpe				m$bpe_
#if !_FDS
#define m$msglog			m$msglog_
#define m$message			m$message_
#endif
#define m$error 			m$error_
#define m$warning			m$warning_
#define m$info				m$info_
#define m$advisory			m$advisory_
#define m$inactive			m$inactive_
#define m$syscon			m$syscon_
#define m$emergency			m$emergency_
#define m$type				m$type_
#define m$npt				m$npt_
#if !_FDS
#define m$index 			m$index_
#define m$align 			m$align_
#define m$talign 			m$talign_
#endif
#define m$units_name			m$units_name_
#define m$format_name			m$format_name_
#define m$comptype_name 		m$comptype_name_
#define m$test_format			m$test_format_
#if !_FDS
#define m$promote_format		m$promote_format_
#define m$promote_type			m$promote_type_
#define m$promote_type3			m$promote_type3_
#define m$promote_format_override	m$promote_format_override_
#define m$nextline			m$nextline_
#define m$nextline_source		m$nextline_source_
#define m$expand_iotypes		m$expand_iotypes_
#define m$filenameopt			m$filenameopt_
#define m$filename			m$filename_
#define m$env				m$env_
#define m$dsengineid			m$dsengineid_
#define m$get_epoch			m$get_epoch_
#define m$put_epoch			m$put_epoch_
#define m$time_format			m$time_format_
#define m$secnds			m$secnds_
#define m$now				m$now_
#endif
#define m$tod2sec			m$tod2sec_
#if !_PFC
#define m$tod2times			m$tod2times_
#endif
#define m$sec2tod			m$sec2tod_
#if !_PFC
#define m$times2tod			m$times2tod_
#endif
#define m$times2str			m$times2str_
#define m$ymd2mjd			m$ymd2mjd_
#define m$mjd2ymd			m$mjd2ymd_
#define m$mjd2ydy			m$mjd2ydy_
#define m$ydy2ymd			m$ydy2ymd_
#define m$sec2tspec			m$sec2tspec_
#define m$subs				m$subs_
#define m$subsl 			m$subsl_
#define m$gsub				m$gsub_
#define m$gsubl 			m$gsubl_
#define m$trims 			m$trims_
#define m$strim 			m$strim_
#define m$word				m$word_
#define m$element			m$element_
#define m$nelements			m$nelements_
#define m$nsearch			m$nsearch_
#define m$range 			m$range_
#define m$between			m$between_
#define m$nformat			m$nformat_
#define m$head				m$head_
#define m$tail				m$tail_
#define m$root				m$root_
#define m$ext				m$ext_

#define m$length			m$length_
#define m$lengthd			m$lengthd_
#define m$clean 			m$clean_
#define m$move				m$move_
#endif

#if _VMS
int_4 m$search(VAXstr *,VAXstr *);
int_4 m_search(const char *string, const char *sub)
{
  VAXstr V1,V2;
  C2VAXSTR(string, strlen(string), V1);
  C2VAXSTR(sub, strlen(sub), V2);
  return m$search(&V1,&V2);
}
#else
int_4 m$search(const char *,const char *,fstring_len_t,fstring_len_t);
int_4 m_search(const char *string, const char *sub)
{
  return m$search(string,sub,strlen(string),strlen(sub));
}
#endif

#if _VMS
int_4 m$searchb(VAXstr *,VAXstr *);
int_4 m_searchb(const char *string, const char *sub)
{
  VAXstr V1,V2;
  C2VAXSTR(string, strlen(string), V1);
  C2VAXSTR(sub, strlen(sub), V2);
  return m$searchb(&V1,&V2);
}
#else
int_4 m$searchb(const char *,const char *,fstring_len_t,fstring_len_t);
int_4 m_searchb(const char *string, const char *sub)
{
  return m$searchb(string,sub,strlen(string),strlen(sub));
}
#endif

#if _VMS
int_4 m$lengthq(VAXstr *);
int_4 m_lengthq(const char *string, int_4 length)
{
  VAXstr vstring;
  C2VAXSTR(string, length, vstring);
  return m$lengthq(&vstring);
}
#else
int_4 m$lengthq(const char *,int_4);
int_4 m_lengthq(const char *string, int_4 length)
{
  return m$lengthq(string, length);
}
#endif

#if _VMS
int_4 m$parse(VAXstr *,int_4 *,VAXstr *);
int_4 m_parse(const char *string, int_4 ind, char *ostring, int_4 los)
{
  int length;
  VAXstr V1,V2;
  C2VAXSTR(string, strlen(string), V1);
  C2VAXSTR(ostring, los, V2);
  length = m$parse(&V1,&ind,&V2);
  strf2c(ostring, los, ostring, los, F2C_TRIM);
  return length;
}
#else
int_4 m$parse(const char *,int_4 *,char *,fstring_len_t,fstring_len_t);
int_4 m_parse(const char *string, int_4 ind, char *ostring, int_4 los)
{
  int length;
  length = m$parse(string,&ind,ostring,strlen(string),los);
  strf2c(ostring, los, ostring, los, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$trim_quotes(VAXstr *,VAXstr *);
int_4 m_trim_quotes(const char *sq, char *sr, int_4 lsr)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(sq, strlen(sq), V1);
  C2VAXSTR(sr, lsr, V2);
  length = m$trim_quotes(&V1,&V2);
  strf2c(sr, lsr, sr, lsr, F2C_TRIM);
  return length;
}
#else
int_4 m$trim_quotes(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_trim_quotes(const char *sq, char *sr, int_4 lsr)
{
  int_4 length;
  length = m$trim_quotes(sq,sr,strlen(sq),lsr);
  strf2c(sr, lsr, sr, lsr, F2C_TRIM);
  return length;
}
#endif

#if _VMS
void m$lowercase(VAXstr *);
void m_lowercase(char *string)
{
  VAXstr V;
  C2VAXSTR(string, strlen(string), V);
  m$lowercase(&V);
}
#else
void m$lowercase(char *,fstring_len_t);
void m_lowercase(char *string)
{
  m$lowercase(string,strlen(string));
}
#endif

#if _VMS
void m$uppercase(VAXstr *);
void m_uppercase(char *string)
{
  VAXstr V;
  C2VAXSTR(string, strlen(string), V);
  m$uppercase(&V);
}
#else
void m$uppercase(char *,fstring_len_t);
void m_uppercase(char *string)
{
  m$uppercase(string,strlen(string));
}
#endif

#if _VMS
void m$wordwrap(VAXstr *,int_4 *,int_4 *,int_4 *,int_4 *,int_4 *);
void m_wordwrap(const char *str, int_4 start, int_4 margin, int_4 consume,
                int_4 *wrap, int_4 *new)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  m$wordwrap(&V,&start,&margin,&consume,wrap,new);
}
#else
void m$wordwrap(const char *,int_4 *,int_4 *,int_4 *,int_4 *,int_4 *,int_4);
void m_wordwrap(const char *str, int_4 start, int_4 margin, int_4 consume,
                int_4 *wrap, int_4 *new)
{
  m$wordwrap(str,&start,&margin,&consume,wrap,new,strlen(str));
}
#endif

#if _VMS
void m$wrapnextlines(int_4 *,VAXstr *);
void m_wrapnextlines(int_4 lun, char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  m$wrapnextlines(&lun, &V);
}
#else
void m$wrapnextlines(int_4 *,char *,fstring_len_t);
void m_wrapnextlines(int_4 lun, char *str)
{
  m$wrapnextlines(&lun,str,strlen(str));
}
#endif

int_4 m$chk(const void *,const void *,int_4 *);
int_4 m_chk(const void *m1, const void *m2, int_4 n)
{
  return m$chk(m1,m2,&n);
}

#if _VMS
int_4 m$d2a(real_8 *,VAXstr *);
int_4 m_d2a(real_8 dval, char *string, int_4 length)
{
  int len;
  VAXstr V;
  C2VAXSTR(string, length, V);
  len = m$d2a(&dval, &V);
  return len;
}
#else
int_4 m$d2a(real_8 *,char *,fstring_len_t);
int_4 m_d2a(real_8 dval, char *string, int_4 length)
{
  int len;
  len = m$d2a(&dval, string, length);
  return len;
}
#endif

#if _VMS
int_4 m$d2a_form(real_8 *,VAXstr *,VAXstr *);
int_4 m_d2a_form(real_8 dval, char *string, const char *form,
                 int_4 slen, int_4 flen)
{
  int len;
  VAXstr vstring, fstring;
  C2VAXSTR(string, slen, vstring);
  C2VAXSTR(form, flen, fstring);
  len = m$d2a_form(&dval, &vstring, &fstring);
  return len;
}
#else
int_4 m$d2a_form(real_8 *,char *,const char *,fstring_len_t,fstring_len_t);
int_4 m_d2a_form(real_8 dval, char *string, const char *form,
                 int_4 slen, int_4 flen)
{
  int len;
  len = m$d2a_form(&dval, string, form, slen, flen);
  return len;
}
#endif

#if _VMS
int_4 m$f2a(real_8 *,VAXstr *);
int_4 m_f2a(real_4 fval, char *string, int_4 length)
{
  int len;
  VAXstr vstring;
  C2VAXSTR(string, length, vstring);
  len = m$f2a(&fval, &vstring);
  return len;
}
#else
int_4 m$f2a(real_4 *,char *,fstring_len_t);
int_4 m_f2a(real_4 fval, char *string, int_4 length)
{
  int len;
  len = m$f2a(&fval, string, length);
  return len;
}
#endif

#if _VMS
int_4 m$l2a(int_4 *,VAXstr *);
int_4 m_l2a(int_4 lval, char *string, int_4 length)
{
  int len;
  VAXstr vstring;
  C2VAXSTR(string, length, vstring);
  len = m$l2a(&lval, &vstring);
  return len;
}
#else
int_4 m$l2a(int_4 *,char *,fstring_len_t);
int_4 m_l2a(int_4 lval, char *string, int_4 length)
{
  int len;
  len = m$l2a(&lval, string, length);
  return len;
}
#endif

void m$f2d(real_4 *,real_8 *);
void m_f2d(real_4 *fval, real_8 *dval)
{
  m$f2d(fval,dval);
}

void m$d2f(real_8 *,real_4 *);
void m_d2f(real_8 *dval, real_4 *fval)
{
  m$d2f(dval,fval);
}

#if _VMS
int_4 m$dms2deg(VAXstr *,real_8 *);
int_4 m_dms2deg(const char *dms_str, real_8 *deg, int_4 len)
{
  VAXstr V;
  C2VAXSTR(dms_str, len, V);
  return m$dms2deg(&V,deg);
}
#else
int_4 m$dms2deg(const char *,real_8 *,fstring_len_t);
int_4 m_dms2deg(const char *dms_str, real_8 *deg, int_4 len)
{
  return m$dms2deg(dms_str,deg,len);
}
#endif

#if _VMS
int_4 m$deg2dm(real_8 *,VAXstr *);
int_4 m_deg2dm(real_8 deg, char *dm_str, int_4 len)
{
  int los;
  VAXstr V;
  C2VAXSTR(dm_str, len, V);
  los = m$deg2dm(&deg,&V);
  strf2c(dm_str, len, dm_str, len, F2C_TRIM);
  return los;
}
#else
int_4 m$deg2dm(real_8 *,char *,fstring_len_t);
int_4 m_deg2dm(real_8 deg, char *dm_str, int_4 len)
{
  int los;
  los = m$deg2dm(&deg,dm_str,len);
  strf2c(dm_str, len, dm_str, len, F2C_TRIM);
  return los;
}
#endif

#if _VMS
int_4 m$deg2dms(real_8 *,VAXstr *);
int_4 m_deg2dms(real_8 deg, char *dms_str, int_4 len)
{
  int los;
  VAXstr V;
  C2VAXSTR(dms_str, len, V);
  los = m$deg2dms(&deg,&V);
  strf2c(dms_str, len, dms_str, len, F2C_TRIM);
  return los;
}
#else
int_4 m$deg2dms(real_8 *,char *,fstring_len_t);
int_4 m_deg2dms(real_8 deg, char *dms_str, int_4 len)
{
  int los;
  los = m$deg2dms(&deg,dms_str,len);
  strf2c(dms_str, len, dms_str, len, F2C_TRIM);
  return los;
}
#endif

#if !_FDS
#if _VMS
int_4 m$a2d(VAXstr *,real_8 *);
int_4 m_a2d(const char *prompt, real_8 *dval, int_4 length)
{
  VAXstr vstring;
  C2VAXSTR(prompt, length, vstring);
  return m$a2d(&vstring, dval);
}
#else
int_4 m$a2d(const char *,real_8 *,fstring_len_t);
int_4 m_a2d(const char *string, real_8 *dval, int_4 length)
{
  return m$a2d(string, dval, length);
}
#endif

#if _VMS
int_4 m$logical(VAXstr *,const int_4 *);
int_4 m_logical(const char *expression,const int_4 mode)
{
  VAXstr V;
  C2VAXSTR(expression, strlen(expression), V);
  return m$logical(&V,&mode);
}
#else
int_4 m$logical(const char *,const int_4 *,fstring_len_t);
int_4 m_logical(const char *expression,const int_4 mode)
{
  return m$logical(expression,&mode,strlen(expression));
}
#endif
#endif

#if _VMS
int_4 m$spa(VAXstr *);
int_4 m_spa(const char *format)
{
  VAXstr V;
  C2VAXSTR(format, strlen(format), V);
  return m$spa(&V);
}
#else
int_4 m$spa(const char *,fstring_len_t);
int_4 m_spa(const char *format)
{
  return m$spa(format,strlen(format));
}
#endif

#if _VMS
int_4 m$bps(VAXstr *);
int_4 m_bps(const char *format)
{
  VAXstr V;
  C2VAXSTR(format, strlen(format), V);
  return m$bps(&V);
}
#else
int_4 m$bps(const char *,fstring_len_t);
int_4 m_bps(const char *format)
{
  return m$bps(format,strlen(format));
}
#endif

#if _VMS
int_4 m$bpa(VAXstr *);
int_4 m_bpa(const char *format)
{
  VAXstr V;
  C2VAXSTR(format, strlen(format), V);
  return m$bpa(&V);
}
#else
int_4 m$bpa(const char *,fstring_len_t);
int_4 m_bpa(const char *format)
{
  return m$bpa(format,strlen(format));
}
#endif

int_4 m$bpe(HEADER *);
int_4 m_bpe(HEADER *hcb)
{
  return m$bpe(hcb);
}

#if !_FDS
#if _VMS
void m$msglog(VAXstr *,int_4 *);
void m_msglog(const char *msg, int_4 severity)
{
  VAXstr V;
  C2VAXSTR(msg,strlen(msg),V);
  m$msglog(&V,&severity);
}
#else
void m$msglog(const char *,int_4 *,fstring_len_t);
void m_msglog(const char *msg, int_4 severity)
{
  m$msglog(msg,&severity,strlen(msg));
}
#endif

#if _VMS
void m$message(VAXstr *,VAXstr *);
void m_message(const char *prefix, const char *string)
{
  VAXstr V1,V2;
  C2VAXSTR(prefix,strlen(prefix),V1);
  C2VAXSTR(string,strlen(string),V2);
  m$message(&V1,&V2);
}
#else
void m$message(const char *,const char *,fstring_len_t,fstring_len_t);
void m_message(const char *prefix, const char *string)
{
  m$message(prefix,string,strlen(prefix),strlen(string));
}
#endif
#endif

#if JEFF

#if _VMS
void m$error(VAXstr *);
void m_error(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  m$error(&V);
}
#else
void m$error(const char *,fstring_len_t);
void m_error(const char *str)
{
  m$error(str,strlen(str));
}
#endif

#if _VMS
void m$warning(VAXstr *);
void m_warning(const char *str)
{
  VAXstr V;
  C2VAXSTR(str, strlen(str), V);
  m$warning(&V);
}
#else
void m$warning(const char *,fstring_len_t);
void m_warning(const char *str)
{
  m$warning(str,strlen(str));
}
#endif

#if _VMS
void m$info(VAXstr *);
void m_info(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  m$info(&V);
}
#else
void m$info(const char *,fstring_len_t);
void m_info(const char *str)
{
  m$info(str,strlen(str));
}
#endif

#endif

#if _VMS
void m$advisory(VAXstr *);
void m_advisory(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  m$advisory(&V);
}
#else
void m$advisory(const char *,fstring_len_t);
void m_advisory(const char *str)
{
  m$advisory(str,strlen(str));
}
#endif

#if _VMS
void m$inactive(VAXstr *);
void m_inactive(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  m$inactive(&V);
}
#else
void m$inactive(const char *,fstring_len_t);
void m_inactive(const char *str)
{
  m$inactive(str,strlen(str));
}
#endif

#if _VMS
void m$syscon(VAXstr *);
void m_syscon(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  m$syscon(&V);
}
#else
void m$syscon(const char *,fstring_len_t);
void m_syscon(const char *str)
{
  m$syscon(str,strlen(str));
}
#endif

#if _VMS
void m$emergency(VAXstr *);
void m_emergency(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  m$emergency(&V);
}
#else
void m$emergency(const char *,fstring_len_t);
void m_emergency(const char *str)
{
  m$emergency(str,strlen(str));
}
#endif

#if _VMS
int_4 m$type(VAXstr *);
int_4 m_type(const char *str)
{
  VAXstr V;
  C2VAXSTR(str,strlen(str),V);
  return m$type(&V);
}
#else
int_4 m$type(const char *,fstring_len_t);
int_4 m_type(const char *str)
{
  return m$type(str,strlen(str));
}
#endif

#if _VMS
int_4 m_npt(char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  return m$npt(&V);
}
#else
int_4 m$npt(char *,fstring_len_t);
int_4 m_npt(char *type)
{
  return m$npt(type,1);
}
#endif

#if !_FDS
void m$index(HEADER *,int_4 *,real_8 *,real_8 *);
void m_index(HEADER *hcb, int_4 addressing, real_8 *start, real_8 *end)
{
  m$index(hcb,&addressing,start,end);
}

void m$align(HEADER *,HEADER *,int_4 *,real_8 *, real_8 *);
void m_align(HEADER *hcb1 ,HEADER *hcb2, int_4 addressing, real_8 *size,
             real_8 *start)
{
  m$align(hcb1,hcb2,&addressing,size,start);
}

void m$talign(HEADER *,HEADER *,real_8 *,real_8 *,real_8 *);
void m_talign(HEADER *hcb1 ,HEADER *hcb2, real_8 *astart, real_8 *aoff,
              real_8 *size)
{
  m$talign(hcb1,hcb2,astart,aoff,size);
}
#endif

#if _VMS
void m$units_name(VAXstr *,const int_4 *);
char *m_units_name(const int_4 units)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(35+1);
  C2VAXSTR(str, 35, VRTN);
  m$units_name(&VRTN, &units);
  strf2c(str, 35, str, 35+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$units_name(const int_4 *);
char *m_units_name(const int_4 units)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(35+1);
  str = m$units_name(&units);
  strf2c(str, 35, str_ret, 35+1, F2C_TRIM);
  return str_ret;
}
#else
void m$units_name(char *,fstring_len_t,const int_4 *);
char *m_units_name(const int_4 units)
{
  char *str;
  str = (char *) malloc(35+1);
  m$units_name(str,35,&units);
  strf2c(str, 35, str, 35+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$format_name(VAXstr *,VAXstr *);
char *m_format_name(const char *format)
{
  VAXstr V,VRTN;
  char *str;
  str = (char *) malloc(30+1);
  C2VAXSTR(format, strlen(format), V);
  C2VAXSTR(str, 30, VRTN);
  m$format_name(&VRTN, &V);
  strf2c(str, 30, str, 30+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$format_name(const char *,fstring_len_t);
char *m_format_name(const char *format)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(30+1);
  str = m$format_name(format,strlen(format));
  strf2c(str, 30, str_ret, 30+1, F2C_TRIM);
  return str_ret;
}
#else
void m$format_name(char *,fstring_len_t,const char *,int_4);
char *m_format_name(const char *format)
{
  char *str;
  str = (char *) malloc(30+1);
  m$format_name(str,30,format,strlen(format));
  strf2c(str, 30, str, 30+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$comptype_name(VAXstr *,const int_4 *);
char *m_comptype_name(const int_4 type)
{
  VAXstr VRTN;
  char *str;
  str = (char *) malloc(9+1);
  C2VAXSTR(str, 9, VRTN);
  m$comptype_name(&VRTN, &type);
  strf2c(str, 9, str, 9+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$comptype_name(const int_4 *);
char *m_comptype_name(const int_4 type)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(9+1);
  str = m$comptype_name(&type);
  strf2c(str, 9, str_ret, 9+1, F2C_TRIM);
  return str_ret;
}
#else
void m$comptype_name(char *,fstring_len_t,const int_4 *);
char *m_comptype_name(const int_4 type)
{
  char *str;
  str = (char *) malloc(9+1);
  m$comptype_name(str,9,&type);
  strf2c(str, 9, str, 9+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$test_format(VAXstr *,VAXstr *,VAXstr *);
char *m_test_format(const char *form, const char *form_allow)
{
  VAXstr V1,V2,VRTN;
  char *str;
  str = (char *) malloc(2+1);
  C2VAXSTR(form, strlen(form), V1);
  C2VAXSTR(form_allow, strlen(form_allow), V2);
  C2VAXSTR(str, 2, VRTN);
  m$test_format(&VRTN, &V1, &V2);
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$test_format(const char *,const char *,fstring_len_t,fstring_len_t);
char *m_test_format(const char *form, const char *form_allow)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(2+1);
  str = m$test_format(form,form_allow,strlen(form),strlen(form_allow));
  strf2c(str, 2, str_ret, 2+1, F2C_TRIM);
  return str_ret;
}
#else
void m$test_format(char *,fstring_len_t,const char *,const char *,
		           fstring_len_t,fstring_len_t);
char *m_test_format(const char *form, const char *form_allow)
{
  char *str;
  str = (char *) malloc(2+1);
  m$test_format(str,2,form,form_allow,strlen(form),strlen(form_allow));
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if !_FDS
#if _VMS
void m$promote_format(VAXstr *,VAXstr *,VAXstr *,VAXstr *);
char *m_promote_format(const char *form1, const char *form2, const char *form3)
{
  VAXstr V1,V2,V3,VRTN;
  char *str;
  str = (char *) malloc(2+1);
  C2VAXSTR(form1, strlen(form1), V1);
  C2VAXSTR(form2, strlen(form2), V2);
  C2VAXSTR(form3, strlen(form3), V3);
  C2VAXSTR(str, 2, VRTN);
  m$promote_format(&VRTN, &V1, &V2, &V3);
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$promote_format(const char *,const char *,const char *,
		               fstring_len_t,fstring_len_t,fstring_len_t);
char *m_promote_format(const char *form1, const char *form2, const char *form3)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(2+1);
  str = m$promote_format(form1,form2,form3,
                         strlen(form1),strlen(form2),strlen(form3));
  strf2c(str, 2, str_ret, 2+1, F2C_TRIM);
  return str_ret;
}
#else
void m$promote_format(char *,fstring_len_t,const char *,const char *,
		              const char *,fstring_len_t,fstring_len_t,fstring_len_t);
char *m_promote_format(const char *form1, const char *form2, const char *form3)
{
  char *str;
  str = (char *) malloc(2+1);
  m$promote_format(str,2,form1,form2,form3,
                   strlen(form1),strlen(form2),strlen(form3));
  strf2c(str, 2, str, 2+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$promote_type(VAXstr *,VAXstr *,VAXstr *);
char *m_promote_type(const char *type1, const char *type2)
{
  VAXstr V1,V2,VRTN;
  char *str;
  str = (char *) malloc(1+1);
  C2VAXSTR(type1, strlen(type1), V1);
  C2VAXSTR(type2, strlen(type2), V2);
  C2VAXSTR(str, 1, VRTN);
  m$promote_type(&VRTN, &V1, &V2);
  strf2c(str, 1, str, 1+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$promote_type(const char *,const char *,fstring_len_t,fstring_len_t);
char *m_promote_type(const char *type1, const char *type2)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(1+1);
  str = m$promote_type(type1,type2,strlen(type1),strlen(type2));
  strf2c(str, 1, str_ret, 1+1, F2C_TRIM);
  return str_ret;
}
#else
void m$promote_type(char *,int_4,const char *,const char *,int_4,int_4);
char *m_promote_type(const char *type1, const char *type2)
{
  char *str;
  str = (char *) malloc(2+1);
  m$promote_type(str,1,type1,type2,strlen(type1),strlen(type2));
  strf2c(str, 1, str, 1+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
void m$promote_type3(VAXstr *,VAXstr *,VAXstr *,VAXstr *);
char *m_promote_type3(const char *type1, const char *type2, const char *type3)
{
  VAXstr V1,V2,V3,VRTN;
  char *str;
  str = (char *) malloc(1+1);
  C2VAXSTR(type1, strlen(type1), V1);
  C2VAXSTR(type2, strlen(type2), V2);
  C2VAXSTR(type3, strlen(type3), V2);
  C2VAXSTR(str, 1, VRTN);
  m$promote_type3(&VRTN, &V1, &V2, &V3);
  strf2c(str, 1, str, 1+1, F2C_TRIM);
  return str;
}
#else
#if _PFC
char *m$promote_type3(const char *,const char *,const char *,
		              fstring_len_t,fstring_len_t,fstring_len_t);
char *m_promote_type3(const char *type1, const char *type2, const char *type3)
{
  char *str;
  char *str_ret;
  str_ret = (char *) malloc(1+1);
  str = m$promote_type3(type1,type2,type3,
                        strlen(type1),strlen(type2),strlen(type3));
  strf2c(str, 1, str_ret, 1+1, F2C_TRIM);
  return str_ret;
}
#else
void m$promote_type3(char *,int_4,const char *,const char *,const char *,
		             fstring_len_t,fstring_len_t,fstring_len_t);
char *m_promote_type3(const char *type1, const char *type2, const char *type3)
{
  char *str;
  str = (char *) malloc(1+1);
  m$promote_type3(str,1,type1,type2,type3,
                  strlen(type1),strlen(type2),strlen(type3));
  strf2c(str, 1, str, 1+1, F2C_TRIM);
  return str;
}
#endif
#endif

#if _VMS
int_4 m$promote_format_override(VAXstr *,VAXstr *,VAXstr *,VAXstr *);
int_4 m_promote_format_override(const char *t1, const char *t2,
                                const char *pfostr, char *type)
{
  VAXstr V1,V2,V3,V4;
  C2VAXSTR(t1, 1, V1);
  C2VAXSTR(t2, 1, V2);
  C2VAXSTR(pfostr, strlen(pfostr), V3);
  C2VAXSTR(type, 1, V4);
  return m$promote_format_override(&V1,&V2,&V3,&V4);
}
#else
int_4 m$promote_format_override(const char *,const char *,const char *,
                                const char *,fstring_len_t,fstring_len_t,
                                fstring_len_t,fstring_len_t);
int_4 m_promote_format_override(const char *t1, const char *t2,
                                const char *pfostr, char *type)
{
  return m$promote_format_override(t1,t2,pfostr,type,
                                   1,1,strlen(pfostr),1);
}
#endif

#if _VMS
int_4 m$nextline(int_4 *,VAXstr *,int_4 *);
int_4 m_nextline(int_4 lun, char *str, int_4 verbose, int_4 ls)
{
  int_4 status;
  VAXstr V;
  C2VAXSTR(str, ls, V);
  status = m$nextline(&lun,&V,&verbose);
  strf2c(str, ls, str, ls, F2C_TRIM);
  return status;
}
#else
int_4 m$nextline(int_4 *,char *,int_4 *,fstring_len_t);
int_4 m_nextline(int_4 lun, char *str, int_4 verbose, int_4 ls)
{
  int_4 status;
  status = m$nextline(&lun,str,&verbose,ls);
  strf2c(str, ls, str, ls, F2C_TRIM);
  return status;
}
#endif

#if _VMS
int_4 m$nextline_source(int_4 *,VAXstr *,int_4 *,int_4 *);
int_4 m_nextline_source(int_4 lun, char *str, int_4 verbose, int_4 *srcln,
                        int_4 ls)
{
  int_4 status;
  VAXstr V;
  C2VAXSTR(str, ls, V);
  status = m$nextline_source(&lun,&V,&verbose,srcln);
  strf2c(str, ls, str, ls, F2C_TRIM);
  return status;
}
#else
int_4 m$nextline_source(int_4 *,char *,int_4 *,int_4 *,fstring_len_t);
int_4 m_nextline_source(int_4 lun, char *str, int_4 verbose, int_4 *srcln,
                        int_4 ls)
{
  int_4 status;
  status = m$nextline_source(&lun,str,&verbose,srcln,ls);
  strf2c(str, ls, str, ls, F2C_TRIM);
  return status;
}
#endif

#if _VMS
void m$expand_iotypes(VAXstr *,int_4 *);
void m_expand_iotypes(char *types, int_4 *ntypes, int_4 lt)
{
  VAXstr V;
  C2VAXSTR(types,lt,V);
  m$expand_iotypes(&V,ntypes);
  strf2c(types, lt, types, lt, F2C_TRIM);
}
#else
void m$expand_iotypes(char *,int_4 *,fstring_len_t);
void m_expand_iotypes(char *types, int_4 *ntypes, int_4 lt)
{
  m$expand_iotypes(types,ntypes,lt);
  strf2c(types, lt, types, lt, F2C_TRIM);
}
#endif

#if _VMS
int_4 m$filenameopt(VAXstr *,VAXstr *,VAXstr *,VAXstr *,VAXstr *);
int_4 m_filenameopt(const char *area, const char *name, const char *ext,
                    char *fullname, const char *option, int lf)
{
  int_4 length;
  VAXstr V1,V2,V3,V4,V5;
  C2VAXSTR(area,strlen(area),V1);
  C2VAXSTR(name,strlen(name),V2);
  C2VAXSTR(ext,strlen(ext),V3);
  C2VAXSTR(fullname,lf,V4);
  C2VAXSTR(option,strlen(option),V5);
  length = m$filenameopt(&V1,&V2,&V3,&V4,&V5);
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return length;
}
#else
int_4 m$filenameopt(const char *,const char *,const char *,char *,const char *,
		            fstring_len_t,fstring_len_t,fstring_len_t,fstring_len_t,
		            fstring_len_t);
int_4 m_filenameopt(const char *area, const char *name, const char *ext,
                    char *fullname, const char *option, int lf)
{
  int_4 length;
  length = m$filenameopt(area,name,ext,fullname,option,
                         strlen(area),strlen(name),strlen(ext),
			 lf,strlen(option));
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$filename(VAXstr *,VAXstr *,VAXstr *,VAXstr *);
int_4 m_filename(const char *area, const char *name, const char *ext,
                 char *fullname,int lf)
{
  int_4 length;
  VAXstr V1,V2,V3,V4;
  C2VAXSTR(area,strlen(area),V1);
  C2VAXSTR(name,strlen(name),V2);
  C2VAXSTR(ext,strlen(ext),V3);
  C2VAXSTR(fullname,lf,V4);
  length = m$filename(&V1,&V2,&V3,&V4);
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return length;
}
#else
int_4 m$filename(const char *,const char *,const char *,char *,
		         fstring_len_t,fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_filename(const char *area, const char *name, const char *ext,
                 char *fullname, int lf)
{
  int_4 length;
  length = m$filename(area,name,ext,fullname,
                      strlen(area),strlen(name),strlen(ext),lf);
  strf2c(fullname, lf, fullname, lf, F2C_TRIM);
  return length;
}
#endif

#if _VMS
int_4 m$env(VAXstr *,void *,const int_4 *,VAXstr *,const int_4 *);
int_4 m_env(const char *key, void *buf, const int_4 elemsize, char *type,
            const int_4 mode)
{
  VAXstr V1,V2;
  C2VAXSTR(key,strlen(key),V1);
  C2VAXSTR(type,1,V2);
  return m$env(&V1,buf,&elemsize,&V2,&mode);
}
#else
int_4 m$env(const char *,void *,const int_4 *,char *,const int_4 *,
		    fstring_len_t,fstring_len_t);
int_4 m_env(const char *key, void *buf, const int_4 elemsize, char *type,
            const int_4 mode)
{
  return m$env(key,buf,&elemsize,type,&mode,strlen(key),1);
}
#endif

#if _VMS
int_4 m$dsengineid(VAXstr *);
int_4 m_dsengineid(const char *ceng)
{
  VAXstr V;
  C2VAXSTR(ceng, strlen(ceng), V);
  return m$dsengineid(&V);
}
#else
int_4 m$dsengineid(const char *,fstring_len_t);
int_4 m_dsengineid(const char *ceng)
{
  return m$dsengineid(ceng,strlen(ceng));
}
#endif

void m$get_epoch(HEADER *,real_8 *,real_8 *);
void m_get_epoch(HEADER *hcb, real_8 *sec, real_8 *frac)
{
  m$get_epoch(hcb,sec,frac);
}

void m$put_epoch(HEADER *,real_8 *,real_8 *,int_4 *);
void m_put_epoch(HEADER *hcb, real_8 sec, real_8 frac, int_4 toQuads)
{
  m$put_epoch(hcb,&sec,&frac,&toQuads);
}

#if _VMS
int_4 m$time_format(VAXstr *,VAXstr *,VAXstr *,real_8 *,real_8 *,int_4 *);
int_4 m_time_format(const char *str, const char *type, char *strout,
                    real_8 *time1, real_8 *time2, const int_4 warn, int_4 ln)
{
  int_4 length;
  VAXstr V1,V2,V3;
  C2VAXSTR(str, strlen(str), V1);
  C2VAXSTR(type, 1, V1);
  C2VAXSTR(strout, ln, V1);
  length = m$time_format(&V1,&V2,&V3,time1,time2,&warn);
  strf2c(strout, ln, strout, ln, F2C_TRIM);
  return length;
}
#else
int_4 m$time_format(const char *,const char *,char *,real_8 *,real_8 *,
                    const int_4 *, fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_time_format(const char *str, const char *type, char *strout,
                    real_8 *time1, real_8 *time2, const int_4 warn, int_4 ln)
{
  int_4 length;
  length = m$time_format(str,type,strout,time1,time2,&warn,strlen(str),1,ln);
  strf2c(strout, ln, strout, ln, F2C_TRIM);
  return length;
}
#endif

void m$secnds(real_4 *,real_4 *);
void m_secnds(real_4 ref_time, real_4 *elapsed)
{
  m$secnds(&ref_time, elapsed);
}

void m$now(real_8 *,real_8 *);
void m_now(real_8 *time1, real_8 *time2)
{
  m$now(time1,time2);
}
#endif

#if _VMS
int_4 m$tod2sec(VAXstr *,real_8 *);
int_4 m_tod2sec(const char *tod_str, real_8 *time, int_4 tlen)
{
  VAXstr V;
  C2VAXSTR(tod_str, tlen, V);
  return m$tod2sec(&V, time);
}
#else
int_4 m$tod2sec(const char *,real_8 *,fstring_len_t);
int_4 m_tod2sec(const char *tod_str, real_8 *time, int_4 tlen)
{
  return m$tod2sec(tod_str, time, tlen);
}
#endif

#if _VMS
int_4 m$tod2times(VAXstr *,real_8 *,real_8 *);
int_4 m_tod2times(const char *tod_str, real_8 *sec, real_8 *frac, int_4 tlen)
{
  VAXstr V;
  C2VAXSTR(tod_str, tlen, V);
  return m$tod2times(&V,sec,frac);
}
#else
#if !_PFC
int_4 m$tod2times(const char *,real_8 *,real_8 *,fstring_len_t);
int_4 m_tod2times(const char *tod_str, real_8 *sec, real_8 *frac, int_4 tlen)
{
  return m$tod2times(tod_str,sec,frac,tlen);
}
#endif
#endif

#if _VMS
int_4 m$sec2tod(real_8 *,VAXstr *);
int_4 m_sec2tod(real_8 time, char *tod_str, int_4 tlen)
{
  int len;
  VAXstr V;
  C2VAXSTR(tod_str, tlen, V);
  len = m$sec2tod(&time, &V);
  return len;
}
#else
int_4 m$sec2tod(real_8 *,char *,fstring_len_t);
int_4 m_sec2tod(real_8 time, char *tod_str, int_4 tlen)
{
  int len;
  len = m$sec2tod(&time, tod_str, tlen);
  return len;
}
#endif

#if _VMS
int_4 m$times2tod(real_8 *,real_8 *,VAXstr *);
int_4 m_times2tod(real_8 sec, real_8 frac, char *tod_str, int_4 tlen)
{
  int len;
  VAXstr V;
  C2VAXSTR(tod_str, tlen, V);
  len = m$times2tod(&sec, &frac, &V);
  return len;
}
#else
#if !_PFC
int_4 m$times2tod(real_8 *,real_8 *,char *,fstring_len_t);
int_4 m_times2tod(real_8 sec, real_8 frac, char *tod_str, int_4 tlen)
{
  int len;
  len = m$times2tod(&sec, &frac, tod_str, tlen);
  return len;
}
#endif
#endif

#if _VMS
int_4 m$times2str(const real_8 *,const real_8 *,VAXstr *,VAXstr *);
int_4 m_times2str(const real_8 sec, const real_8 frac, char *type,
                  char *strout, int_4 ln)
{
  int_4 length;
  VAXstr V1,V2;
  C2VAXSTR(type, 1, V1);
  C2VAXSTR(strout, ln, V2);
  length = m$times2str(&sec, &frac, &V1, &V2);
  strf2c(strout, ln, strout, ln, F2C_TRIM);
  return length;
}
#else
int_4 m$times2str(const real_8 *,const real_8 *,char *,char *,fstring_len_t,
		          fstring_len_t);
int_4 m_times2str(const real_8 sec, const real_8 frac, char *type,
                  char *strout, int_4 ln)
{
  int_4 length;
  length = m$times2str(&sec,&frac,type,strout,1,ln);
  strf2c(strout, ln, strout, ln, F2C_TRIM);
  return length;
}
#endif

void m$ymd2mjd(int_4 *,int_4 *,int_4 *,int_4 *);
void m_ymd2mjd(int_4 ny, int_4 nm, int_4 nd, int_4 *mjd)
{
  m$ymd2mjd(&ny,&nm,&nd,mjd);
}

void m$mjd2ymd(int_4 *,int_4 *,int_4 *,int_4 *);
void m_mjd2ymd(int_4 mjd, int_4 *ny, int_4 *nm, int_4 *nd)
{
  m$mjd2ymd(&mjd,ny,nm,nd);
}

void m$mjd2ydy(int_4 *,int_4 *,int_4 *);
void m_mjd2ydy(int_4 mjd, int_4 *ny, int_4 *nd)
{
  m$mjd2ydy(&mjd,ny,nd);
}

void m$ydy2ymd(int_4 *,int_4 *,int_4 *,int_4 *);
void m_ydy2ymd(int_4 ny, int_4 ndoy, int_4 *nm, int_4 *nd)
{
  m$ydy2ymd(&ny,&ndoy,nm,nd);
}

#if _VMS
int_4 m$sec2tspec(real_8 *,VAXstr *,int_4 *);
int_4 m_sec2tspec(real_8 time, char *tspec_str, int_4 mode, int_4 tlen)
{
  int len;
  VAXstr V;
  C2VAXSTR(tspec_str, tlen, V);
  len = m$sec2tspec(&time, &V, &mode);
  strf2c(tspec_str, tlen, tspec_str, tlen, F2C_TRIM);
  return len;
}
#else
int_4 m$sec2tspec(real_8 *,char *,int_4 *,fstring_len_t);
int_4 m_sec2tspec(real_8 time, char *tspec_str, int_4 mode, int_4 tlen)
{
  int len;
  len = m$sec2tspec(&time,tspec_str,&mode,tlen);
  strf2c(tspec_str, tlen, tspec_str, tlen, F2C_TRIM);
  return len;
}
#endif

#if _VMS
int_4 m$subs(VAXstr *,VAXstr *,VAXstr *, VAXstr *);
int_4 m_subs(const char *in_str, char *out_str, const char *string1,
             const char *string2, int_4 lout)
{
  VAXstr V1,V2,V3;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string1, strlen(string1), V2);
  C2VAXSTR(string2, strlen(string2), V3);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$subs(&V1,&VRTN,&V2,&V3);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}

#else
int_4 m$subs(const char *,char *,const char *,const char *,
		     fstring_len_t,fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_subs(const char *in_str, char *out_str, const char *string1,
             const char *string2, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$subs(in_str,out_str,string1,string2,
                   strlen(in_str),lout,strlen(string1),strlen(string2));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$subsl(VAXstr *,const int_4 *,VAXstr *,VAXstr *,const int_4 *,
              VAXstr *,const int_4 *);
int_4 m_subsl(const char *in_str, const int_4 inls, char *out_str,
              const char *string1, const int_4 ls1, const char *string2,
              const int_4 ls2, int_4 lout)
{
  VAXstr V1,V2,V3;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string1, strlen(string1), V2);
  C2VAXSTR(string2, strlen(string2), V3);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$subsl(&V1,&inls,&VRTN,&V2,&ls1,&V3,&ls2);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$subsl(const char *,const int_4 *,char *,const char *,const int_4 *,
              const char *,const int_4 *,fstring_len_t,fstring_len_t,
              fstring_len_t,fstring_len_t);
int_4 m_subsl(const char *in_str, const int_4 inls, char *out_str,
              const char *string1, const int_4 ls1, const char *string2,
              const int_4 ls2, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$subsl(in_str,&inls,out_str,string1,&ls1,string2,&ls2,
                    strlen(in_str),lout,strlen(string1),strlen(string2));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$gsub(VAXstr *,VAXstr *,VAXstr *, VAXstr *);
int_4 m_gsub(const char *in_str, char *out_str, const char *string1,
             const char *string2, int_4 lout)
{
  VAXstr V1,V2,V3;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string1, strlen(string1), V2);
  C2VAXSTR(string2, strlen(string2), V3);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$gsub(&V1,&VRTN,&V2,&V3);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$gsub(const char *,char *,const char *,const char *,
             int_4,int_4,int_4,int_4);
int_4 m_gsub(const char *in_str, char *out_str, const char *string1,
             const char *string2, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$gsub(in_str,out_str,string1,string2,
                   strlen(in_str),lout,strlen(string1),strlen(string2));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$gsubl(VAXstr *,const int_4 *,VAXstr *,VAXstr *,const int_4 *,
              VAXstr *,const int_4 *);
int_4 m_gsubl(const char *in_str, const int_4 inls, char *out_str,
              const char *string1, const int_4 ls1,
              const char *string2, const int_4 ls2, int_4 lout)
{
  VAXstr V1,V2,V3;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string1, strlen(string1), V2);
  C2VAXSTR(string2, strlen(string1), V3);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$gsubl(&V1,&inls,&VRTN,&V2,&ls1,&V3,&ls2);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$gsubl(const char *,const int_4 *,char *,const char *,const int_4 *,
              const char *,const int_4 *,fstring_len_t,fstring_len_t,
              fstring_len_t,fstring_len_t);
int_4 m_gsubl(const char *in_str, const int_4 inls, char *out_str,
              const char *string1, const int_4 ls1,
              const char *string2, const int_4 ls2, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$gsubl(in_str,&inls,out_str,string1,&ls1,string2,&ls2,
                    strlen(in_str),lout,strlen(string1),strlen(string2));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$trims(VAXstr *,VAXstr *,VAXstr *,VAXstr *);
int_4 m_trims(const char *in_str, char *out_str, const char *string1,
              const char *string2, int_4 lout)
{
  VAXstr V1,V2,V3;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string1, strlen(string1), V2);
  C2VAXSTR(string2, strlen(string2), V3);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$trims(&V1,&VRTN,&V2,&V3);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$trims(const char *,char *,const char *,const char *,
		      fstring_len_t,fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_trims(const char *in_str, char *out_str, const char *string1,
              const char *string2, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$trims(in_str,out_str,string1,string2,
                    strlen(in_str),lout,strlen(string1),strlen(string2));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$strim(VAXstr *,VAXstr *);
int_4 m_strim(const char *in_str, char *out_str, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$strim(&V1,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$strim(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_strim(const char *in_str, char *out_str, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$strim(in_str,out_str,strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$word(VAXstr *,VAXstr *,VAXstr *);
int_4 m_word(const char *in_str, char *out_str, const int_4 n,
             const char *string, int_4 lout)
{
  VAXstr V1,V2;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string, strlen(string), V2);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$word(&V1,&VRTN,&V2);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$word(const char *,char *,const int_4 *,const char *,
		     fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_word(const char *in_str, char *out_str, const int_4 n,
             const char *string, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$word(in_str,out_str,&n,string,
                   strlen(in_str),lout,strlen(string));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$element(VAXstr *,VAXstr *,const int_4 *,VAXstr *);
int_4 m_element(const char *in_str, char *out_str, const int_4 n,
                const char *string, int_4 lout)
{
  VAXstr V1,V2;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string, strlen(string), V2);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$element(&V1,&VRTN,&n,&V2);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$element(const char *,char *,const int_4 *,const char *,
		        fstring_len_t,fstring_len_t,fstring_len_t);
int_4 m_element(const char *in_str, char *out_str, const int_4 n,
                const char *string, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$element(in_str,out_str,&n,string,
                      strlen(in_str),lout,strlen(string));
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$nelements(VAXstr *,VAXstr *);
int_4 m_nelements(const char *in_str, const char *string)
{
  VAXstr V1,V2;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string, strlen(string), V2);
  return m$nelements(&V1,&V2);
}
#else
int_4 m$nelements(const char *,const char *,fstring_len_t,fstring_len_t);
int_4 m_nelements(const char *in_str, const char *string)
{
  return m$nelements(in_str,string,strlen(in_str),strlen(string));
}
#endif

#if _VMS
int_4 m$nsearch(VAXstr *,VAXstr *,const int_4 *);
int_4 m_nsearch(const char *in_str, const char *string, const int_4 n)
{
  VAXstr V1,V2;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(string, strlen(string), V2);
  return m$nsearch(&V1,&V2,&n);
}
#else
int_4 m$nsearch(const char *,const char *,const int_4 *,fstring_len_t,
		        fstring_len_t);
int_4 m_nsearch(const char *in_str, const char *string, const int_4 n)
{
  return m$nsearch(in_str,string,&n,strlen(in_str),strlen(string));
}
#endif

#if _VMS
int_4 m$range(VAXstr *,VAXstr *,const int_4 *,const int_4 *);
int_4 m_range(const char *in_str, char *out_str, const int_4 start,
              const int_4 finish, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$range(&V1,&VRTN,&start,&finish);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$range(const char *,char *,const int_4 *,const int_4 *,
		      fstring_len_t,fstring_len_t);
int_4 m_range(const char *in_str, char *out_str, const int_4 start,
              const int_4 finish, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$range(in_str,out_str,&start,&finish,
                    strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$between(VAXstr *,VAXstr *,const int_4 *,const int_4 *);
int_4 m_between(const char *in_str, char *out_str, const int_4 start,
                const int_4 finish, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$between(&V1,&VRTN,&start,&finish);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$between(const char *,char *,const int_4 *,const int_4 *,
		        fstring_len_t, fstring_len_t);
int_4 m_between(const char *in_str, char *out_str, const int_4 start,
                const int_4 finish, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$between(in_str,out_str,&start,&finish,
                      strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$nformat(VAXstr *,VAXstr *,VAXstr *);
int_4 m_nformat(const char *res_name, const char *format_str, char *out_str,
                int_4 lout)
{
  VAXstr V1,V2;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(res_name, strlen(res_name), V1);
  C2VAXSTR(format_str, strlen(format_str), V2);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$nformat(&V1,&V2,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$nformat(const char *,const char*, char *,fstring_len_t,fstring_len_t,
		        fstring_len_t);
int_4 m_nformat(const char *res_name, const char *format_str, char *out_str,
                int_4 lout)
{
  int_4 ret_val;
  ret_val = m$nformat(res_name,format_str,out_str,
                      strlen(res_name),strlen(format_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$head(VAXstr *,VAXstr *);
int_4 m_head(const char *in_str, char *out_str, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$head(&V1,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$head(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_head(const char *in_str, char *out_str, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$head(in_str,out_str,strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$tail(VAXstr *,VAXstr *);
int_4 m_tail(const char *in_str, char *out_str, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$tail(&V1,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$tail(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_tail(const char *in_str, char *out_str, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$tail(in_str,out_str,strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$root(VAXstr *,VAXstr *);
int_4 m_root(const char *in_str, char *out_str, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$root(&V1,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$root(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_root(const char *in_str, char *out_str, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$root(in_str,out_str,strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif

#if _VMS
int_4 m$ext(VAXstr *,VAXstr *);
int_4 m_ext(const char *in_str, char *out_str, int_4 lout)
{
  VAXstr V1;
  VAXstr VRTN;
  int_4 ret_val;
  C2VAXSTR(in_str, strlen(in_str), V1);
  C2VAXSTR(out_str, lout, VRTN);
  ret_val = m$ext(&V1,&VRTN);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#else
int_4 m$ext(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_ext(const char *in_str, char *out_str, int_4 lout)
{
  int_4 ret_val;
  ret_val = m$ext(in_str,out_str,strlen(in_str),lout);
  strf2c(out_str, lout, out_str, lout, F2C_TRIM);
  return ret_val;
}
#endif



#if _VMS
int_4 m$length(VAXstr *);
int_4 m_length(const char *string, int_4 length)
{
  VAXstr vstring;
  C2VAXSTR(string, length, vstring);
  return m$length(&vstring);
}
#else
int_4 m$length(const char *,fstring_len_t);
int_4 m_length(const char *string, int_4 length)
{
  return m$length(string, length);
}
#endif

#if _VMS
int_4 m$lenghtd(VAXstr *);
int_4 m_lengthd(const char *string, int_4 length)
{
  VAXstr vstring;
  C2VAXSTR(string, length, vstring);
  return m$lengthd(&vstring);
}
#else
int_4 m$lengthd(const char *,fstring_len_t);
int_4 m_lengthd(const char *string, int_4 length)
{
  return m$lengthd(string, length);
}
#endif

#if _VMS
int_4 m$clean(VAXstr *,VAXstr *);
int_4 m_clean(const char *string, char *cstring, int_4 ls, int_4 lcs)
{
  VAXstr V1;
  VAXstr V2;
  C2VAXSTR(string, ls, V1);
  C2VAXSTR(cstring, lcs, V2);
  return m$clean(&V1, &V2);
}
#else
int_4 m$clean(const char *,char *,fstring_len_t,fstring_len_t);
int_4 m_clean(const char *string, char *cstring, int_4 ls, int_4 lcs)
{
  return m$clean(string, cstring, ls, lcs);
}
#endif

void m$move(const void *,void *,int_4 *);
void m_move(const void *a, void *b, int_4 n)
{
  m$move(a,b,&n);
}

/* VECTOR functions */

#if _UNIX
#define m$vinit                 m$vinit_
#define m$vstype                m$vstype_
#define m$vtype                 m$vtype_
#define m$vtypeq                m$vtypeq_
#define m$stype                 m$stype_
#define m$stypeq                m$stypeq_
#define m$vpromote              m$vpromote_
#define md$vstype               md$vstype_
#define md$vtype                md$vtype_
#define md$vtypeq               md$vtypeq_
#define md$stype                md$stype_
#define md$stypeq               md$stypeq_
#define md$vpromote             md$vpromote_
#define m$vmov                  m$vmov_
#define m$cvmov                 m$cvmov_
#define m$vmovn                 m$vmovn_
#define m$vmovnb                m$vmovnb_
#define m$vfill                 m$vfill_
#define m$vadd                  m$vadd_
#define m$vsub                  m$vsub_
#define m$vmul                  m$vmul_
#define m$cvmul                 m$cvmul_
#define m$crvmul                m$crvmul_
#define m$vsadd                 m$vsadd_
#define m$cvsadd                m$cvsadd_
#define m$vsmul                 m$vsmul_
#define m$cvsmul                m$cvsmul_
#define m$vsum                  m$vsum_
#define m$cvsum                 m$cvsum_
#define m$vsums                 m$vsums_
#define m$cvsums                m$cvsums_
#define m$vblk                  m$vblk_
#define m$cvblk                 m$cvblk_
#define m$cvpha                 m$cvpha_
#define m$cvphad                m$cvphad_
#define m$cvrphad               m$cvrphad_
#define m$cvmag                 m$cvmag_
#define m$cvmag2                m$cvmag2_
#define m$cvconj                m$cvconj_
#define m$vlog10                m$vlog10_
#define m$vnorm                 m$vnorm_
#define m$cvnorm                m$cvnorm_
#define m$vrand                 m$vrand_
#define m$vmxmn                 m$vmxmn_
#endif

void m$vinit(void);
void m_vinit(void)
{
  m$vinit();
}

#if _VMS
void m$vstype(VAXstr *);
void m_vstype(const char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  m$vstype(&V);
}
#else
void m$vstype(const char *, fstring_len_t);
void m_vstype(const char *type)
{
  m$vstype(type,1);
}
#endif

#if _VMS
void m$vtype(VAXstr *);
void m_vtype(const char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  m$vtype(&V);
}
#else
void m$vtype(const char *, fstring_len_t);
void m_vtype(const char *type)
{
  m$vtype(type,1);
}
#endif

#if _VMS
void m$vtypeq(VAXstr *);
void m_vtypeq(char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  m$vtypeq(&V);
}
#else
void m$vtypeq(char *, fstring_len_t);
void m_vtypeq(char *type)
{
  m$vtypeq(type,1);
}
#endif

#if _VMS
void m$stype(VAXstr *);
void m_stype(const char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  m$stype(&V);
}
#else
void m$stype(const char *, fstring_len_t);
void m_stype(const char *type)
{
  m$stype(type,1);
}
#endif

#if _VMS
void m$stypeq(VAXstr *);
void m_stypeq(char *type)
{
  VAXstr V;
  C2VAXSTR(type, 1, V);
  m$stypeq(&V);
}
#else
void m$stypeq(char *, int_4);
void m_stypeq(char *type)
{
  m$stypeq(type,1);
}
#endif

#if _VMS
char m$vpromote(VAXstr *, VAXstr *, VAXstr *);
char m_vpromote(const char *type1, const char *type2)
{
  VAXstr V1,V2,VRTN;
  char type;
  C2VAXSTR(&type1, 1, V1);
  C2VAXSTR(&type2, 1, V2);
  C2VAXSTR(&type, 1, VRTN);
  m$vpromote(&VRTN,&V1,&V2);
  return type;
}
#else
#if _PFC
char *m$vpromote(const char *type1, const char *type2, fstring_len_t,
		         fstring_len_t);
char m_vpromote(const char *type1, const char *type2)
{
  char type;
  type = *(char*) m$vpromote(type1,type2,1,1);
  return type;
}
#else
void m$vpromote(char *, int_4, const char *, const char *, fstring_len_t,
		        fstring_len_t);
char m_vpromote(const char *type1, const char *type2)
{
  char type;
  m$vpromote(&type,1,type1,type2,1,1);
  return type;
}
#endif
#endif

void md$vstype(const int_4 *);
void md_vstype(const int_4 type)
{
  md$vstype(&type);
}

void md$vtype(const int_4 *);
void md_vtype(const int_4 type)
{
  md$vtype(&type);
}

void md$vtypeq(int_4 *);
void md_vtypeq(int_4 *type)
{
  md$vtypeq(type);
}

void md$stype(const int_4 *);
void md_stype(const int_4 type)
{
  md$stype(&type);
}

void md$stypeq(int_4 *);
void md_stypeq(int_4 *type)
{
  md$stypeq(type);
}

int_4 md$vpromote(const int_4 *, const int_4 *);
int_4 md_vpromote(const int_4 type1, const int_4 type2)
{
  return md$vpromote(&type1,&type2);
}

void m$vmov(void *,const int_4 *,void *,const int_4 *,const int_4 *);
void m_vmov(void *va, const int_4 ka, void *vb, const int_4 kb,
            const int_4 count)
{
  m$vmov(va,&ka,vb,&kb,&count);
}

void m$cvmov(void *,const int_4 *,void *,const int_4 *,const int_4 *);
void m_cvmov(void *va, const int_4 ka, void *vb, const int_4 kb,
             const int_4 count)
{
  m$cvmov(va,&ka,vb,&kb,&count);
}

void m$vmovn(void *,const int_4 *,void *,const int_4 *,
             const int_4 *,const int_4 *);
void m_vmovn(void *va, const int_4 ka, void *vb, const int_4 kb,
             const int_4 count, const int_4 block)
{
  m$vmovn(va,&ka,vb,&kb,&count,&block);
}

void m$vmovnb(void *, const int_4 *, void *, const int_4 *,
              const int_4 *, const int_4 *);
void m_vmovnb(void *va, const int_4 ka, void *vb, const int_4 kb,
              const int_4 count, const int_4 block)
{
  m$vmovnb(va,&ka,vb,&kb,&count,&block);
}

void m$vfill(void *, void *, const int_4 *);
void m_vfill(void *va, void *sb, const int_4 count)
{
  m$vfill(va,sb,&count);
}

void m$vadd(void *, void *, void *, const int_4 *);
void m_vadd(void *va, void *vb, void *vc, const int_4 count)
{
  m$vadd(va,vb,vc,&count);
}

void m$vsub(void *, void *, void *, const int_4 *);
void m_vsub(void *va, void *vb, void *vc, const int_4 count)
{
  m$vsub(va,vb,vc,&count);
}

void m$vmul(void *, void *, void *, const int_4 *);
void m_vmul(void *va, void *vb, void *vc, const int_4 count)
{
  m$vmul(va,vb,vc,&count);
}

void m$cvmul(void *, void *, void *, const int_4 *, const int_4 *);
void m_cvmul(void *va, void *vb, void *vc, const int_4 count, const int_4 flag)
{
  m$cvmul(va,vb,vc,&count,&flag);
}

void m$crvmul(void *, void *, void *, const int_4 *);
void m_crvmul(void *va, void *vb, void *vc, const int_4 count)
{
  m$crvmul(va,vb,vc,&count);
}

void m$vsadd(void *, void *, void *, const int_4 *);
void m_vsadd(void *va, void *sb, void *vc, const int_4 count)
{
  m$vsadd(va,sb,vc,&count);
}

void m$cvsadd(void *, void *, void *, const int_4 *);
void m_cvsadd(void *va, void *sb, void *vc, const int_4 count)
{
  m$cvsadd(va,sb,vc,&count);
}

void m$vsmul(void *, void *, void *, const int_4 *);
void m_vsmul(void *va, void *sb, void *vc, const int_4 count)
{
  m$vsmul(va,sb,vc,&count);
}

void m$cvsmul(void *, void *, void *, const int_4 *);
void m_cvsmul(void *va, void *sb, void *vc, const int_4 count)
{
  m$cvsmul(va,sb,vc,&count);
}

void m$vsum(void *, void *, const int_4 *);
void m_vsum(void *va, void *sb, const int_4 count)
{
  m$vsum(va,sb,&count);
}

void m$cvsum(void *, void *, const int_4 *);
void m_cvsum(void *va, void *sb, const int_4 count)
{
  m$cvsum(va,sb,&count);
}

void m$vsums(void *, void *, void *, const int_4 *);
void m_vsums(void *va, void *sb, void *sc, const int_4 count)
{
  m$vsums(va,sb,sc,&count);
}

void m$cvsums(void *, void *, void *, const int_4 *);
void m_cvsums(void *va, void *sb, void *sc, const int_4 count)
{
  m$cvsums(va,sb,sc,&count);
}

void m$vblk(void *, void *, const int_4 *, const int_4 *);
void m_vblk(void *va, void *vb, const int_4 count, const int_4 block)
{
  m$vblk(va,vb,&count,&block);
}

void m$cvblk(void *, void *, const int_4 *, const int_4 *);
void m_cvblk(void *va, void *vb, const int_4 count, const int_4 block)
{
  m$cvblk(va,vb,&count,&block);
}

void m$cvpha(void *, void *, const int_4 *);
void m_cvpha(void *va, void *vb, const int_4 count)
{
  m$cvpha(va,vb,&count);
}

void m$cvphad(void *, void *, const int_4 *);
void m_cvphad(void *va, void *vb, const int_4 count)
{
  m$cvphad(va,vb,&count);
}

void m$cvrphad(void *, void *, const int_4 *, const int_4 *);
void m_cvrphad(void *va, void *vb, const int_4 count, const int_4 bins)
{
  m$cvrphad(va,vb,&count,&bins);
}

void m$cvmag(void *, void *, const int_4 *);
void m_cvmag(void *va, void *vb, const int_4 count)
{
  m$cvmag(va,vb,&count);
}

void m$cvmag2(void *, void *, const int_4 *);
void m_cvmag2(void *va, void *vb, const int_4 count)
{
  m$cvmag2(va,vb,&count);
}

void m$cvconj(void *, void *, const int_4 *);
void m_cvconj(void *va, void *vb, const int_4 count)
{
  m$cvconj(va,vb,&count);
}

void m$vlog10(void *, void *, void *, const int_4 *);
void m_vlog10(void *va, void *lo_thresh, void *vb, const int_4 count)
{
  m$vlog10(va,lo_thresh,vb,&count);
}

void m$vnorm(void *, void *, const int_4 *);
void m_vnorm(void *va, void *vb, const int_4 count)
{
  m$vnorm(va,vb,&count);
}

void m$cvnorm(void *, void *, const int_4 *);
void m_cvnorm(void *va, void *vb, const int_4 count)
{
  m$cvnorm(va,vb,&count);
}

void m$vrand(int_4 *, void *, const int_4 *);
void m_vrand(int_4 *seed, void *va, const int_4 count)
{
  m$vrand(seed,va,&count);
}

void m$vmxmn(void *, void *, void *, int_4 *, int_4 *, const int_4 *);
void m_vmxmn(void *va, void *sb, void *sc, int_4 *imax, int_4 *imin,
             const int_4 count)
{
  m$vmxmn(va,sb,sc,imax,imin,&count);
}

/* Why is this here? No one should call this routine but the library */

#if _VMS
#if !_FDS
void m$checkin_shell(void);
void m_checkin_shell(void)
{
  m$checkin_shell();
}
#endif
#endif
