// -*- C++ -*-

#ifndef XM_MIDASLIB_H_

// C++ jackets for the non-graphical, non-datastreams X-Midas library
// routines, the bulk of which are written in FORTRAN.


// This file was generated by $XMAREA/util/cpjackets.py
// with the following arguments:
//
// python cpjackets.py -j ../lib/fjackets.cc midaslib.fllib midaslib.h LINX

#include <string>

#include "cdefs.h"
#include "fcinterface.h"
#include "mtypes.h"
#include "complex_n.h"

#include "headers.h"
#include "queue.h"
#include "type5000.h"
#include <packetdef.h>
#include "aop.h"

// m$__key INTERNAL
// m$_keydata INTERNAL
// m$_keyword INTERNAL

// func A1 m$_pick <I4 >A1024 >R8
extern "C" void m$_pick_ (char*, midas::fstring_len_t, const int_4&, char[], real_8&, midas::fstring_len_t);
inline char m__pick (int_4 a0, fstring_buf a1, real_8& a2)
{
  char rtnval;
  if (!a1.buf) a1.allocate(1024);
  m$_pick_(&rtnval, 1, a0, a1.buf, a2, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$a2d <A >R8

extern "C" int_4 m$a2d_ (const char[], real_8&, midas::fstring_len_t);
inline int_4 m_a2d (const std::string& a0, real_8& a1)
{
  return m$a2d_(a0.data(), a1, a0.length());
}

// m$a2d_n INTERNAL
// m$a2d_p INTERNAL
// m$a2d_r INTERNAL
// m$a2d_s INTERNAL

// cfunc I4 m$accept_client >I4 >*[<m_ptr]

extern "C" int_4 m_accept_client (int_4&, void*);

// m$add_ds_struct INTERNAL ! DS support not yet implemented

// func I4 m$add_read_aux <I4 <I4

extern "C" int_4 m$add_read_aux_ (const int_4&, const int_4&);
inline int_4 m_add_read_aux (int_4 a0, int_4 a1)
{
  return m$add_read_aux_(a0, a1);
}

// sub m$addcomp >header <A4 <A2 <I4 <I4

extern "C" void m$addcomp_ (HEADER&, const char[], const char[], const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_addcomp (HEADER& a0, const std::string& a1, const std::string& a2, int_4 a3, int_4 a4)
{
  m$addcomp_(a0, a1.data(), a2.data(), a3, a4, a1.length(), a2.length());
}

// sub m$addsrec >header <A4 <A2

extern "C" void m$addsrec_ (HEADER&, const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline void m_addsrec (HEADER& a0, const std::string& a1, const std::string& a2)
{
  m$addsrec_(a0, a1.data(), a2.data(), a1.length(), a2.length());
}

// sub m$addsubr >header <A4 <A2

extern "C" void m$addsubr_ (HEADER&, const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline void m_addsubr (HEADER& a0, const std::string& a1, const std::string& a2)
{
  m$addsubr_(a0, a1.data(), a2.data(), a1.length(), a2.length());
}

// sub m$addt6srec >header <A24 <A2 <R8 <R8 <I4 <I4 <I4

extern "C" void m$addt6srec_ (HEADER&, const char[], const char[], const real_8&, const real_8&, const int_4&, const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_addt6srec (HEADER& a0, const std::string& a1, const std::string& a2, real_8 a3, real_8 a4, int_4 a5, int_4 a6, int_4 a7)
{
  m$addt6srec_(a0, a1.data(), a2.data(), a3, a4, a5, a6, a7, a1.length(), a2.length());
}

// sub m$addt6subr >header <A24 <A2 <R8 <R8 <I4 <I4 <I4

extern "C" void m$addt6subr_ (HEADER&, const char[], const char[], const real_8&, const real_8&, const int_4&, const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_addt6subr (HEADER& a0, const std::string& a1, const std::string& a2, real_8 a3, real_8 a4, int_4 a5, int_4 a6, int_4 a7)
{
  m$addt6subr_(a0, a1.data(), a2.data(), a3, a4, a5, a6, a7, a1.length(), a2.length());
}

// sub m$advisory <A

extern "C" void m$advisory_ (const char[], midas::fstring_len_t);
inline void m_advisory (const std::string& a0)
{
  m$advisory_(a0.data(), a0.length());
}

// sub m$align >header >header <I4 >R8 >R8

extern "C" void m$align_ (HEADER&, HEADER&, const int_4&, real_8&, real_8&);
inline void m_align (HEADER& a0, HEADER& a1, int_4 a2, real_8& a3, real_8& a4)
{
  m$align_(a0, a1, a2, a3, a4);
}

// sub m$allocate >header

extern "C" void m$allocate_ (HEADER&);
inline void m_allocate (HEADER& a0)
{
  m$allocate_(a0);
}

// m$ansic_exit INTERNAL
// m$aop INTERNAL
// m$aop_addr INTERNAL

// sub m$aop_error <I4 <I4

extern "C" void m$aop_error_ (const int_4&, const int_4&);
inline void m_aop_error (int_4 a0, int_4 a1)
{
  m$aop_error_(a0, a1);
}


// func I4 m$aop_find <aopstruct <A <A <A1

extern "C" int_4 m$aop_find_ (const AOPSTRUCT&, const char[], const char[], const char&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_aop_find (const AOPSTRUCT& a0, const std::string& a1, const std::string& a2, char a3)
{
  return m$aop_find_(a0, a1.data(), a2.data(), a3, a1.length(), a2.length(), 1);
}


// func I4 m$aopf >* <I4 >* >I4 >* >I4 >* >I4 >* >I4

extern "C" int_4 m$aopf_ (void*, const int_4&, void*, int_4&, void*, int_4&, void*, int_4&, void*, int_4&);
inline int_4 m_aopf (void* a0, int_4 a1, void* a2, int_4& a3, void* a4, int_4& a5, void* a6, int_4& a7, void* a8, int_4& a9)
{
  return m$aopf_(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
}

// func A(L_max_ascii) m$apick <I4

#if _PFC
extern "C" char* m$apick_ (const int_4&);
inline std::string m_apick (int_4 a0)
{
  const char* rtnval = m$apick_(a0);
  return strf2cpp(rtnval, L_max_ascii);
}
#else
extern "C" void m$apick_ (char*, midas::fstring_len_t, const int_4&);
inline std::string m_apick (int_4 a0)
{
  fstring<L_max_ascii> rtnval;
  m$apick_(rtnval.buf, L_max_ascii, a0);
  return rtnval;
}
#endif

// m$apick_post INTERNAL

// XM4x/C++    CXXsub m$arslt <A <A
// XBC            sub m$arslt <A <A
extern "C" void m$arslt_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline void m_arslt (const std::string& a0, const std::string& a1)
{
  m$arslt_(a0.data(), a1.data(), a0.length(), a1.length());
}

// m$assign_arguments INTERNAL

// sub m$beep <I4 <R4

extern "C" void m$beep_ (const int_4&, const real_4&);
inline void m_beep (int_4 a0, real_4 a1)
{
  m$beep_(a0, a1);
}

// func I4 m$between <A >A <I4 <I4

extern "C" int_4 m$between_ (const char[], char[], const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_between (const std::string& a0, fstring_buf a1, int_4 a2, int_4 a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$between_(a0.data(), a1.buf, a2, a3, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$bfclose INTERNAL
// m$bferrmsg INTERNAL
// m$bflush INTERNAL
// m$bfopen INTERNAL
// m$bfread INTERNAL
// m$bfwrite INTERNAL
// m$bit2byte INTERNAL

// sub m$bitshift >* <I4 <I4 <B

extern "C" void m$bitshift_ (void*, const int_4&, const int_4&, const int_1&);
inline void m_bitshift (void* a0, int_4 a1, int_4 a2, int_1 a3)
{
  m$bitshift_(a0, a1, a2, a3);
}

// m$block_close INTERNAL
// m$block_open INTERNAL
// m$block_read INTERNAL
// m$block_ropen INTERNAL
// m$block_socket INTERNAL Unix only
// m$block_write INTERNAL

// sub m$blue2gold >header <I4

extern "C" void m$blue2gold_ (HEADER&, const int_4&);
inline void m_blue2gold (HEADER& a0, int_4 a1)
{
  m$blue2gold_(a0, a1);
}

// m$bourne INTERNAL

// XM4x/C++  CXXfunc I4 m$bpa <A2
// XBC          func I4 m$bpa <A2
extern "C" int_4 m$bpa_ (const char[], midas::fstring_len_t);
inline int_4 m_bpa (const std::string& a0)
{
  return m$bpa_(a0.data(), a0.length());
}

// XM4x/C++  CXXfunc I4 m$bpe <header
// XBC          func I4 m$bpe <header
extern "C" int_4 m$bpe_ (const HEADER&);
inline int_4 m_bpe (const HEADER& a0)
{
  return m$bpe_(a0);
}

// XM44/C++  CXXfunc I4 m$bytes_reqd <I4 <I4
extern int_4 m_bytes_reqd (int_4, int_4);

// func B m$bpick <I4

extern "C" int_1 m$bpick_ (const int_4&);
inline int_1 m_bpick (int_4 a0)
{
  return m$bpick_(a0);
}

// XM4x/C++  CXXfunc I4 m$bps <A2
// XBC          func I4 m$bps <A2
extern "C" int_4 m$bps_ (const char[], midas::fstring_len_t);
inline int_4 m_bps (const std::string& a0)
{
  return m$bps_(a0.data(), a0.length());
}

// sub m$brdg_except >header

extern "C" void m$brdg_except_ (HEADER&);
inline void m_brdg_except (HEADER& a0)
{
  m$brdg_except_(a0);
}

// m$broadcast_bits INTERNAL

// XM4x/C++  CXXsub m$brslt <A <B
// XBC          sub m$brslt <A <B
extern "C" void m$brslt_ (const char[], const int_1&, midas::fstring_len_t);
inline void m_brslt (const std::string& a0, int_1 a1)
{
  m$brslt_(a0.data(), a1, a0.length());
}


// Cfunc I4 m$buffer_server >*[>m_ptr] <A <U4[<I4]

extern "C" int_4 m_buffer_server (void*, const char*, int_u4);
inline int_4 m_buffer_server (void* a0, const std::string& a1, int_u4 a2)
{
  return m_buffer_server(a0, a1.c_str(), a2);
}

// Cfunc I4 m$buffer_socket <I4 <A2 <U4[<I4]

extern "C" int_4 m_buffer_socket (int_4, const char*, int_u4);
inline int_4 m_buffer_socket (int_4 a0, const std::string& a1, int_u4 a2)
{
  return m_buffer_socket(a0, a1.c_str(), a2);
}

// m$calc INTERNAL

// sub m$car_to_geo >1d-R8 <I4 <I4

extern "C" void m$car_to_geo_ (real_8[], const int_4&, const int_4&);
inline void m_car_to_geo (real_8 a0[], int_4 a1, int_4 a2)
{
  m$car_to_geo_(a0, a1, a2);
}

// sub m$car_to_sph >1d-R8 <I4 <I4

extern "C" void m$car_to_sph_ (real_8[], const int_4&, const int_4&);
inline void m_car_to_sph (real_8 a0[], int_4 a1, int_4 a2)
{
  m$car_to_sph_(a0, a1, a2);
}

// sub m$cfft >1d-C8 <I4 <I4

extern "C" void m$cfft_ (complex_8[], const int_4&, const int_4&);
inline void m_cfft (complex_8 a0[], int_4 a1, int_4 a2)
{
  m$cfft_(a0, a1, a2);
}

// m$cfftm INTERNAL
// m$cfile INTERNAL
// m$cfile_map INTERNAL
// m$cfile_next INTERNAL
// m$cfile_open INTERNAL
// m$cformat INTERNAL
// m$chdir INTERNAL
// m$check_for_xcontrol INTERNAL

// func I4 m$chk <* <* <I4

extern "C" int_4 m$chk_ (const void*, const void*, const int_4&);
inline int_4 m_chk (const void* a0, const void* a1, int_4 a2)
{
  return m$chk_(a0, a1, a2);
}

// sub m$chk_pkt_flags <header <A1 >L4

extern "C" void m$chk_pkt_flags_ (const HEADER&, const char&, bool_4&, midas::fstring_len_t);
inline void m_chk_pkt_flags (const HEADER& a0, char a1, bool_4& a2)
{
  m$chk_pkt_flags_(a0, a1, a2, 1);
}

// sub m$chk_pkt_type >header <I4

extern "C" void m$chk_pkt_type_ (HEADER&, const int_4&);
inline void m_chk_pkt_type (HEADER& a0, int_4 a1)
{
  m$chk_pkt_type_(a0, a1);
}

// func I4 m$clean <A >A

extern "C" int_4 m$clean_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_clean (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$clean_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$clear_read_auxlist

extern "C" void m$clear_read_auxlist_ ();
inline void m_clear_read_auxlist ()
{
  m$clear_read_auxlist_();
}

// XM4x/C++  CXXsub m$close >header
// XBC          sub m$close >header
extern "C" void m$close_ (HEADER&);
inline void m_close (HEADER& a0)
{
  m$close_(a0);
}

// m$close_ext_header INTERNAL
// m$close_shellfile INTERNAL

// csub m$close_socket <I4

extern "C" void m_close_socket (int_4);

// m$command_entry INTERNAL
// m$command_exit INTERNAL

// XM4x/C++  CXXfunc A9 m$comptype_name <I4
// XBC          func A9 m$comptype_name <I4
extern "C" void m$comptype_name_ (char*, midas::fstring_len_t, const int_4&);
inline std::string m_comptype_name (int_4 a0)
{
  fstring<9> rtnval;
  m$comptype_name_(rtnval.buf, 9, a0);
  return rtnval;
}

// Cfunc I4 m$connect_to_socket >I4 <A <I4

extern "C" int_4 m_connect_to_socket (int_4&, const char*, int_4);
inline int_4 m_connect_to_socket (int_4& a0, const std::string& a1, int_4 a2)
{
  return m_connect_to_socket(a0, a1.c_str(), a2);
}

// m$control_panel_to_file INTERNAL

// sub m$conversion_factor <I4 <I4 >R8

extern "C" void m$conversion_factor_ (const int_4&, const int_4&, real_8&);
inline void m_conversion_factor (int_4 a0, int_4 a1, real_8& a2)
{
  m$conversion_factor_(a0, a1, a2);
}

// XM4x/C++  CXXsub m$convert <A >* <A1 <I4
// XBC          sub m$convert <A4 >* <A1 <I4
extern "C" void m$convert_ (const char[], void*, const char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_convert (const std::string& a0, void* a1, char a2, int_4 a3)
{
  m$convert_(a0.data(), a1, a2, a3, a0.length(), 1);
}

// sub m$convert_header >header

extern "C" void m$convert_header_ (HEADER&);
inline void m_convert_header (HEADER& a0)
{
  m$convert_header_(a0);
}

// sub m$convert_header_to >header

extern "C" void m$convert_header_to_ (HEADER&);
inline void m_convert_header_to (HEADER& a0)
{
  m$convert_header_to_(a0);
}

// sub m$convert_pkt_rep >header <A4

extern "C" void m$convert_pkt_rep_ (HEADER&, const char[], midas::fstring_len_t);
inline void m_convert_pkt_rep (HEADER& a0, const std::string& a1)
{
  m$convert_pkt_rep_(a0, a1.data(), a1.length());
}

// XM4x/C++  CXXsub m$convert_to <A >* <A1 <I4
// XBC          sub m$convert_to <A4 >* <A1 <I4
extern "C" void m$convert_to_ (const char[], void*, const char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_convert_to (const std::string& a0, void* a1, char a2, int_4 a3)
{
  m$convert_to_(a0.data(), a1, a2, a3, a0.length(), 1);
}

// sub m$convert_units <I4 <I4 >I4

extern "C" void m$convert_units_ (const int_4&, const int_4&, int_4&);
inline void m_convert_units (int_4 a0, int_4 a1, int_4& a2)
{
  m$convert_units_(a0, a1, a2);
}

// func C16 m$cpick <I4

complex_16 m$cpick_ (const int_4&);
inline complex_16 m_cpick (int_4 a0)
{
  return m$cpick_(a0);
}

// sub m$cray2blue >header

extern "C" void m$cray2blue_ (HEADER&);
inline void m_cray2blue (HEADER& a0)
{
  m$cray2blue_(a0);
}

// cfunc I4 m$create_dbl_socket >I4 >I4 <I4

extern "C" int_4 m_create_dbl_socket (int_4&, int_4&, int_4);

// cfunc I4 m$create_mlt_socket <I4 >1d-I4 <I4

extern "C" int_4 m_create_mlt_socket (int_4, int_4[], int_4);

// cfunc I4 m$create_semaphore <A <I4

extern "C" int_4 m_create_semaphore (const char[], int_4, midas::fstring_len_t);
inline int_4 m_create_semaphore (const std::string& a0, int_4 a1)
{
  return m_create_semaphore(a0.data(), a1, a0.length());
}

// cfunc I4 m$create_server >**{m_ptr}[>m_ptr] <I4 <I4

extern "C" int_4 m_create_server (void**, int_4, int_4);
inline int_4 m_create_server (void*& a0, int_4 a1, int_4 a2)
{
  return m_create_server(&a0, a1, a2);
}

// cfunc I4 m$create_socket >I4 <I4

extern "C" int_4 m_create_socket (int_4&, int_4);

// m$create_tcrtime INTERNAL

// sub m$crf_to_crf >1d-R8 <I4 <I4 <1d-R8 <1d-R8

extern "C" void m$crf_to_crf_ (real_8[], const int_4&, const int_4&, const real_8[], const real_8[]);
inline void m_crf_to_crf (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[], const real_8 a4[])
{
  m$crf_to_crf_(a0, a1, a2, a3, a4);
}

// sub m$crf_to_ecr >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$crf_to_ecr_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_crf_to_ecr (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$crf_to_ecr_(a0, a1, a2, a3);
}

// sub m$crvmul <* <* >* <I4

extern "C" void m$crvmul_ (const void*, const void*, void*, const int_4&);
inline void m_crvmul (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$crvmul_(a0, a1, a2, a3);
}

// m$ctag INTERNAL
// m$ctrlc INTERNAL
// m$ctrlc_enable INTERNAL

// sub m$cvblk <* >* <I4 <I4

extern "C" void m$cvblk_ (const void*, void*, const int_4&, const int_4&);
inline void m_cvblk (const void* a0, void* a1, int_4 a2, int_4 a3)
{
  m$cvblk_(a0, a1, a2, a3);
}

// sub m$cvconj <* >* <I4

extern "C" void m$cvconj_ (const void*, void*, const int_4&);
inline void m_cvconj (const void* a0, void* a1, int_4 a2)
{
  m$cvconj_(a0, a1, a2);
}

// sub m$cvmag <* >* <I4

extern "C" void m$cvmag_ (const void*, void*, const int_4&);
inline void m_cvmag (const void* a0, void* a1, int_4 a2)
{
  m$cvmag_(a0, a1, a2);
}

// sub m$cvmag2 <* >* <I4

extern "C" void m$cvmag2_ (const void*, void*, const int_4&);
inline void m_cvmag2 (const void* a0, void* a1, int_4 a2)
{
  m$cvmag2_(a0, a1, a2);
}

// sub m$cvmov <* <I4 >* <I4 <I4

extern "C" void m$cvmov_ (const void*, const int_4&, void*, const int_4&, const int_4&);
inline void m_cvmov (const void* a0, int_4 a1, void* a2, int_4 a3, int_4 a4)
{
  m$cvmov_(a0, a1, a2, a3, a4);
}

// sub m$cvmul <* <* >* <I4 <I4

extern "C" void m$cvmul_ (const void*, const void*, void*, const int_4&, const int_4&);
inline void m_cvmul (const void* a0, const void* a1, void* a2, int_4 a3, int_4 a4)
{
  m$cvmul_(a0, a1, a2, a3, a4);
}

// sub m$cvnorm <* >* <I4

extern "C" void m$cvnorm_ (const void*, void*, const int_4&);
inline void m_cvnorm (const void* a0, void* a1, int_4 a2)
{
  m$cvnorm_(a0, a1, a2);
}

// sub m$cvpha <* >* <I4

extern "C" void m$cvpha_ (const void*, void*, const int_4&);
inline void m_cvpha (const void* a0, void* a1, int_4 a2)
{
  m$cvpha_(a0, a1, a2);
}

// sub m$cvphad <* >* <I4

extern "C" void m$cvphad_ (const void*, void*, const int_4&);
inline void m_cvphad (const void* a0, void* a1, int_4 a2)
{
  m$cvphad_(a0, a1, a2);
}

// sub m$cvrphad <* >* <I4 <I4

extern "C" void m$cvrphad_ (const void*, void*, const int_4&, const int_4&);
inline void m_cvrphad (const void* a0, void* a1, int_4 a2, int_4 a3)
{
  m$cvrphad_(a0, a1, a2, a3);
}

// sub m$cvsadd <* <* >* <I4

extern "C" void m$cvsadd_ (const void*, const void*, void*, const int_4&);
inline void m_cvsadd (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$cvsadd_(a0, a1, a2, a3);
}

// sub m$cvsmul <* <* >* <I4

extern "C" void m$cvsmul_ (const void*, const void*, void*, const int_4&);
inline void m_cvsmul (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$cvsmul_(a0, a1, a2, a3);
}

// sub m$cvsum <* >* <I4

extern "C" void m$cvsum_ (const void*, void*, const int_4&);
inline void m_cvsum (const void* a0, void* a1, int_4 a2)
{
  m$cvsum_(a0, a1, a2);
}

// sub m$cvsums <* >* >* <I4

extern "C" void m$cvsums_ (const void*, void*, void*, const int_4&);
inline void m_cvsums (const void* a0, void* a1, void* a2, int_4 a3)
{
  m$cvsums_(a0, a1, a2, a3);
}

// m$cvt_date2doy INTERNAL

// func I4 m$d2a <R8 >A

extern "C" int_4 m$d2a_ (const real_8&, char[], midas::fstring_len_t);
inline int_4 m_d2a (real_8 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$d2a_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$d2a_form <R8 >A <A

extern "C" int_4 m$d2a_form_ (const real_8&, char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_d2a_form (real_8 a0, fstring_buf a1, const std::string& a2)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$d2a_form_(a0, a1.buf, a2.data(), a1.nchar, a2.length());
  a1.flush();
  return rtnval;
}

// sub m$d2f <R8 >R4

extern "C" void m$d2f_ (const real_8&, real_4&);
inline void m_d2f (real_8 a0, real_4& a1)
{
  m$d2f_(a0, a1);
}

// func I4 m$define_aux <I4 <A

extern "C" int_4 m$define_aux_ (const int_4&, const char[], midas::fstring_len_t);
inline int_4 m_define_aux (int_4 a0, const std::string& a1)
{
  return m$define_aux_(a0, a1.data(), a1.length());
}

// func I4 m$deg2dm <R8 >A

extern "C" int_4 m$deg2dm_ (const real_8&, char[], midas::fstring_len_t);
inline int_4 m_deg2dm (real_8 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$deg2dm_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$deg2dms <R8 >A

extern "C" int_4 m$deg2dms_ (const real_8&, char[], midas::fstring_len_t);
inline int_4 m_deg2dms (real_8 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$deg2dms_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$del_keydata >header <A <I4

extern "C" int_4 m$del_keydata_ (HEADER&, const char[], const int_4&, midas::fstring_len_t);
inline int_4 m_del_keydata (HEADER& a0, const std::string& a1, int_4 a2)
{
  return m$del_keydata_(a0, a1.data(), a2, a1.length());
}

// func I4 m$del_keyword >header <A

extern "C" int_4 m$del_keyword_ (HEADER&, const char[], midas::fstring_len_t);
inline int_4 m_del_keyword (HEADER& a0, const std::string& a1)
{
  return m$del_keyword_(a0, a1.data(), a1.length());
}

// func I4 m$del_read_aux <I4

extern "C" int_4 m$del_read_aux_ (const int_4&);
inline int_4 m_del_read_aux (int_4 a0)
{
  return m$del_read_aux_(a0);
}

// XM4x/C      Cfunc I4 m$del_result <A <U1[<I4]
// XM46/C++  CXXfunc I4 m$del_result <A <I4
// XBC          func I4 m$del_result <A <I4
extern "C" int_4 m$del_result_ (const char[], const int_4&, midas::fstring_len_t);
inline int_4 m_del_result (const std::string& a0, int_4& a1)
{
  return m$del_result_(a0.data(), a1, a0.length());
}

// func I4 m$delete >A

extern "C" int_4 m$delete_ (char[], midas::fstring_len_t);
inline int_4 m_delete (fstring_buf a0)
{
  if (!a0.buf) a0.allocate(256);
  int_4 rtnval = m$delete_(a0.buf, a0.nchar);
  a0.flush();
  return rtnval;
}

// cfunc I4 m$delete_semaphore <I4

extern "C" int_4 m_delete_semaphore (int_4);

// func L4 m$deq <R8 <R8

extern "C" bool_4 m$deq_ (const real_8&, const real_8&);
inline bool_4 m_deq (real_8 a0, real_8 a1)
{
  return m$deq_(a0, a1);
}

// func L4 m$deqt <R8 <R8 <R4

extern "C" bool_4 m$deqt_ (const real_8&, const real_8&, const real_4&);
inline bool_4 m_deqt (real_8 a0, real_8 a1, real_4 a2)
{
  return m$deqt_(a0, a1, a2);
}

// csub m$destroy_server >*[>m_ptr]

extern "C" void m_destroy_server (void*);

// m$dictionary_append INTERNAL
// m$dictionary_fetch INTERNAL
// m$dictionary_filter INTERNAL
// m$dictionary_formtext INTERNAL
// m$dictionary_info INTERNAL
// m$dictionary_init INTERNAL
// m$dictionary_load INTERNAL
// m$dictionary_lookup INTERNAL
// m$dictionary_rehash INTERNAL
// m$dictionary_save INTERNAL
// m$dictionary_text INTERNAL
// m$dictionary_textentry INTERNAL

// sub m$didnt <I4

extern "C" void m$didnt_ (const int_4&);
inline void m_didnt (int_4 a0)
{
  m$didnt_(a0);
}

// sub m$directory <A >A <A

extern "C" void m$directory_ (const char[], char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline void m_directory (const std::string& a0, fstring_buf a1, const std::string& a2)
{
  if (!a1.buf) a1.allocate(256);
  m$directory_(a0.data(), a1.buf, a2.data(), a0.length(), a1.nchar, a2.length());
  a1.flush();
}

// XM4x/C      Cfunc I4 m$diskunx_dev <A >A
// XBC          func I4 m$diskunx_dev <A >A
extern "C" int_4 m$diskunx_dev_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_diskunx_dev (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$diskunx_dev_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$dispatch <A <I4 <I4

extern "C" void m$dispatch_ (const char[], const int_4&, const int_4&, midas::fstring_len_t);
inline void m_dispatch (const std::string& a0, int_4 a1, int_4 a2)
{
  m$dispatch_(a0.data(), a1, a2, a0.length());
}

// sub m$disp_pkt_map

extern "C" void m$disp_pkt_map_ ();
inline void m_disp_pkt_map ()
{
  m$disp_pkt_map_();
}

// func I4 m$dms2deg <A >R8

extern "C" int_4 m$dms2deg_ (const char[], real_8&, midas::fstring_len_t);
inline int_4 m_dms2deg (const std::string& a0, real_8& a1)
{
  return m$dms2deg_(a0.data(), a1, a0.length());
}

// func L4 m$do <I4 >I4

extern "C" bool_4 m$do_ (const int_4&, int_4&);
inline bool_4 m_do (int_4 a0, int_4& a1)
{
  return m$do_(a0, a1);
}

// func R8 m$dpick <I4

extern "C" real_8 m$dpick_ (const int_4&);
inline real_8 m_dpick (int_4 a0)
{
  return m$dpick_(a0);
}

// XM4x/C++  CXXsub m$drslt <A <R8
// XBC          sub m$drslt <A <R8
extern "C" void m$drslt_ (const char[], const real_8&, midas::fstring_len_t);
inline void m_drslt (const std::string& a0, real_8 a1)
{
  m$drslt_(a0.data(), a1, a0.length());
}

// func I4 m$dsengineid <A

extern "C" int_4 m$dsengineid_ (const char[], midas::fstring_len_t);
inline int_4 m_dsengineid (const std::string& a0)
{
  return m$dsengineid_(a0.data(), a0.length());
}

// sub m$dvadd >1d-R8 <I4 <R8 <I4

extern "C" void m$dvadd_ (real_8[], const int_4&, const real_8&, const int_4&);
inline void m_dvadd (real_8 a0[], int_4 a1, real_8 a2, int_4 a3)
{
  m$dvadd_(a0, a1, a2, a3);
}

// sub m$dvscale >1d-R8 <I4 <R8 <I4

extern "C" void m$dvscale_ (real_8[], const int_4&, const real_8&, const int_4&);
inline void m_dvscale (real_8 a0[], int_4 a1, real_8 a2, int_4 a3)
{
  m$dvscale_(a0, a1, a2, a3);
}

// func I4 m$dwget <I4 >R8

extern "C" int_4 m$dwget_ (const int_4&, real_8&);
inline int_4 m_dwget (int_4 a0, real_8& a1)
{
  return m$dwget_(a0, a1);
}

// func I4 m$dwinit <A <R8 <R8 <R8 <R8

extern "C" int_4 m$dwinit_ (const char[], const real_8&, const real_8&, const real_8&, const real_8&, midas::fstring_len_t);
inline int_4 m_dwinit (const std::string& a0, real_8 a1, real_8 a2, real_8 a3, real_8 a4)
{
  return m$dwinit_(a0.data(), a1, a2, a3, a4, a0.length());
}

// sub m$dwput <I4 <R8

extern "C" void m$dwput_ (const int_4&, const real_8&);
inline void m_dwput (int_4 a0, real_8 a1)
{
  m$dwput_(a0, a1);
}

// sub m$dwputu <I4 <R8 >I4

extern "C" void m$dwputu_ (const int_4&, const real_8&, int_4&);
inline void m_dwputu (int_4 a0, real_8 a1, int_4& a2)
{
  m$dwputu_(a0, a1, a2);
}

// sub m$dynlib_close <A

extern "C" void m$dynlib_close_ (const char[], midas::fstring_len_t);
inline void m_dynlib_close (const std::string& a0)
{
  m$dynlib_close_(a0.data(), a0.length());
}

// sub m$dynlib_open <A <A >m_ptr

extern "C" void m$dynlib_open_ (const char[], const char[], M_PTR&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_dynlib_open (const std::string& a0, const std::string& a1, void*& a2)
{
  M_PTR a2mptr; a2mptr.p = reinterpret_cast<unsigned long>(a2);
  m$dynlib_open_(a0.data(), a1.data(), a2mptr, a0.length(), a1.length());
  a2 = reinterpret_cast<void*>(static_cast<unsigned long>(a2mptr.p));
}

// sub m$dynlib_run <m_ptr <1d-m_ptr

extern "C" void m$dynlib_run_ (const M_PTR&, const void*[]);
inline void m_dynlib_run (const void* a0, const void* a1[])
{
  M_PTR a0mptr; a0mptr.p = reinterpret_cast<unsigned long>(a0);
  m$dynlib_run_(a0mptr, a1);
}

// sub m$eci_to_ecr >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$eci_to_ecr_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_eci_to_ecr (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$eci_to_ecr_(a0, a1, a2, a3);
}

// m$ecl60_send INTERNAL
// m$ecl60_send_ INTERNAL

// sub m$ecr_to_crf >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$ecr_to_crf_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_ecr_to_crf (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$ecr_to_crf_(a0, a1, a2, a3);
}

// sub m$ecr_to_eci >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$ecr_to_eci_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_ecr_to_eci (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$ecr_to_eci_(a0, a1, a2, a3);
}

// sub m$ecr_to_top >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$ecr_to_top_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_ecr_to_top (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$ecr_to_top_(a0, a1, a2, a3);
}

// func I4 m$element <A >A <I4 <A

extern "C" int_4 m$element_ (const char[], char[], const int_4&, const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_element (const std::string& a0, fstring_buf a1, int_4 a2, const std::string& a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$element_(a0.data(), a1.buf, a2, a3.data(), a0.length(), a1.nchar, a3.length());
  a1.flush();
  return rtnval;
}

// sub m$emergency <A

extern "C" void m$emergency_ (const char[], midas::fstring_len_t);
inline void m_emergency (const std::string& a0)
{
  m$emergency_(a0.data(), a0.length());
}

// func L4 m$endswith <A <A
extern "C" int_4 m$endswith_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline bool_4 m_endswith (const std::string& a0, const std::string& a1)
{
  return m$endswith_(a0.data(), a1.data(), a0.length(), a1.length());
}

// func I4 m$env <A >* <I4 >A1 <I4

extern "C" int_4 m$env_ (const char[], void*, const int_4&, char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_env (const std::string& a0, void* a1, int_4 a2, char& a3, int_4 a4)
{
  return m$env_(a0.data(), a1, a2, a3, a4, a0.length(), 1);
}

// sub m$epoch_hour_angle <R8 >R8 >R8 >R8

extern "C" void m$epoch_hour_angle_ (const real_8&, real_8&, real_8&, real_8&);
inline void m_epoch_hour_angle (real_8 a0, real_8& a1, real_8& a2, real_8& a3)
{
  m$epoch_hour_angle_(a0, a1, a2, a3);
}

// sub m$error <A

extern "C" void m$error_ (const char[], midas::fstring_len_t);
inline void m_error (const std::string& a0)
{
  m$error_(a0.data(), a0.length());
}

// sub m$exec_trap <I4 >I4

extern "C" void m$exec_trap_ (const int_4&, int_4&);
inline void m_exec_trap (int_4 a0, int_4& a1)
{
  m$exec_trap_(a0, a1);
}

// XM44/C++  CXXsub m$execute_command_str <A
// XBC          sub m$execute_command_str <A INTERNAL
//extern "C" void m$execute_command_str_ (const char[], midas::fstring_len_t);
//inline void m_execute_command_str (const std::string& a0) {
//  m$execute_command_str_(a0.data(), a0.length());
//}

// m$execute_jump INTERNAL

// sub m$existence >header <I4

extern "C" void m$existence_ (HEADER&, const int_4&);
inline void m_existence (HEADER& a0, int_4 a1)
{
  m$existence_(a0, a1);
}

// m$exit INTERNAL

// sub m$expand_htype <A >I4 <I4 >I4 >A1 >I4

extern "C" void m$expand_htype_ (const char[], int_4&, const int_4&, int_4&, char&, int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_expand_htype (const std::string& a0, int_4& a1, int_4 a2, int_4& a3, char& a4, int_4& a5)
{
  m$expand_htype_(a0.data(), a1, a2, a3, a4, a5, a0.length(), 1);
}

// sub m$expand_iotypes >A >I4

extern "C" void m$expand_iotypes_ (char[], int_4&, midas::fstring_len_t);
inline void m_expand_iotypes (fstring_buf a0, int_4& a1)
{
  if (!a0.buf) a0.allocate(256);
  m$expand_iotypes_(a0.buf, a1, a0.nchar);
  a0.flush();
}

// func I4 m$export <A <A

extern "C" int_4 m$export_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_export (const std::string& a0, const std::string& a1)
{
  return m$export_(a0.data(), a1.data(), a0.length(), a1.length());
}

// func I4 m$ext <A >A

extern "C" int_4 m$ext_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_ext (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$ext_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$external_entry INTERNAL

// func I4 m$f2a <R4 >A

extern "C" int_4 m$f2a_ (const real_4&, char[], midas::fstring_len_t);
inline int_4 m_f2a (real_4 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$f2a_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$f2d <R4 >R8

extern "C" void m$f2d_ (const real_4&, real_8&);
inline void m_f2d (real_4 a0, real_8& a1)
{
  m$f2d_(a0, a1);
}

// sub m$fclose <header

extern "C" void m$fclose_ (const HEADER&);
inline void m_fclose (const HEADER& a0)
{
  m$fclose_(a0);
}

// sub m$fcreate >header

extern "C" void m$fcreate_ (HEADER&);
inline void m_fcreate (HEADER& a0)
{
  m$fcreate_(a0);
}

// sub m$feof >header

extern "C" void m$feof_ (HEADER&);
inline void m_feof (HEADER& a0)
{
  m$feof_(a0);
}

// m$fft INTERNAL NMFFT only

// func I4 m$fftflags <A

extern "C" int_4 m$fftflags_ (const char[], midas::fstring_len_t);
inline int_4 m_fftflags (const std::string& a0)
{
  return m$fftflags_(a0.data(), a0.length());
}

// m$fftprep INTERNAL

// func I4 m$fftsize <I4 <I4 <I4

extern "C" int_4 m$fftsize_ (const int_4&, const int_4&, const int_4&);
inline int_4 m_fftsize (int_4 a0, int_4 a1, int_4 a2)
{
  return m$fftsize_(a0, a1, a2);
}

// func I4 m$fftsize_best <I4 <I4 <I4

extern "C" int_4 m$fftsize_best_ (const int_4&, const int_4&, const int_4&);
inline int_4 m_fftsize_best (int_4 a0, int_4 a1, int_4 a2)
{
  return m$fftsize_best_(a0, a1, a2);
}

// sub m$filad >header >* <I4

extern "C" void m$filad_ (HEADER&, void*, const int_4&);
inline void m_filad (HEADER& a0, void* a1, int_4 a2)
{
  m$filad_(a0, a1, a2);
}

// func I4 m$file <A <I4 >A

extern "C" int_4 m$file_ (const char[], const int_4&, char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_file (const std::string& a0, int_4 a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$file_(a0.data(), a1, a2.buf, a0.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// m$file_deal INTERNAL

// func I4 m$filename <A <A <A >A

extern "C" int_4 m$filename_ (const char[], const char[], const char[], char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_filename (const std::string& a0, const std::string& a1, const std::string& a2, fstring_buf a3)
{
  if (!a3.buf) a3.allocate(256);
  int_4 rtnval = m$filename_(a0.data(), a1.data(), a2.data(), a3.buf, a0.length(), a1.length(), a2.length(), a3.nchar);
  a3.flush();
  return rtnval;
}

// XM4x/C++  CXXfunc I4 m$filenameopt <A <A <A >A <A
// XBC          func I4 m$filenameopt <A <A <A >A <A
extern "C" int_4 m$filenameopt_ (const char[], const char[], const char[], char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_filenameopt (const std::string& a0, const std::string& a1, const std::string& a2, fstring_buf a3fbuf, const std::string& a4)
{
  std::string a3(a3fbuf.str());
  int_4 rtnval = m_filenameopt(a0, a1, a2, a3, a4);
  a3fbuf = a3;
  return rtnval;
}

// m$filtered_fetch INTERNAL

// func L4 m$find_command <A >I4 >A

extern "C" bool_4 m$find_command_ (const char[], int_4&, char[], midas::fstring_len_t, midas::fstring_len_t);
inline bool_4 m_find_command (const std::string& a0, int_4& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  bool_4 rtnval = m$find_command_(a0.data(), a1, a2.buf, a0.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// m$find_dictacct INTERNAL
// m$find_dictentry INTERNAL
// m$find_key INTERNAL
// m$find_key4 INTERNAL

// func I4 m$find_keydata >header >A >m_ptr >I4 <I4 >A1

extern "C" int_4 m$find_keydata_ (HEADER&, char[], M_PTR&, int_4&, const int_4&, char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_find_keydata (HEADER& a0, fstring_buf a1, void*& a2, int_4& a3, int_4 a4, char& a5)
{
  if (!a1.buf) a1.allocate(256);
  M_PTR a2mptr; a2mptr.p = reinterpret_cast<unsigned long>(a2);
  int_4 rtnval = m$find_keydata_(a0, a1.buf, a2mptr, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  a2 = reinterpret_cast<void*>(static_cast<unsigned long>(a2mptr.p));
  return rtnval;
}

// m$find_switch INTERNAL

// sub m$finterp >header <I4 <R8 <R8 >2d-R4 >I4 <I4 >I4

extern "C" void m$finterp_ (HEADER&, const int_4&, const real_8&, const real_8&, real_4[], int_4&, const int_4&, int_4&);
inline void m_finterp (HEADER& a0, int_4 a1, real_8 a2, real_8 a3, real_4 a4[], int_4& a5, int_4 a6, int_4& a7)
{
  m$finterp_(a0, a1, a2, a3, a4, a5, a6, a7);
}

// sub m$finterpd >header <I4 <R8 <R8 >2d-R8 >I4 <I4 >I4

extern "C" void m$finterpd_ (HEADER&, const int_4&, const real_8&, const real_8&, real_8[], int_4&, const int_4&, int_4&);
inline void m_finterpd (HEADER& a0, int_4 a1, real_8 a2, real_8 a3, real_8 a4[], int_4& a5, int_4 a6, int_4& a7)
{
  m$finterpd_(a0, a1, a2, a3, a4, a5, a6, a7);
}

// sub m$fopen >header

extern "C" void m$fopen_ (HEADER&);
inline void m_fopen (HEADER& a0)
{
  m$fopen_(a0);
}

// sub m$force1000 >header

extern "C" void m$force1000_ (HEADER&);
inline void m_force1000 (HEADER& a0)
{
  m$force1000_(a0);
}

// sub m$force2000 >header <I4

extern "C" void m$force2000_ (HEADER&, const int_4&);
inline void m_force2000 (HEADER& a0, int_4 a1)
{
  m$force2000_(a0, a1);
}

// m$form_detach_name INTERNAL

// func I4 m$form_path <I4 <A >A

extern "C" int_4 m$form_path_ (const int_4&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_form_path (int_4 a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$form_path_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// XM4x/C++  CXXfunc A30 m$format_name <A2
// XBC          func A30 m$format_name <A2
extern "C" void m$format_name_ (char *, midas::fstring_len_t, const char[], midas::fstring_len_t);
inline std::string m_format_name (const std::string& a0) {
  fstring<30> rtnval;
  m$format_name_(rtnval.buf, 30, a0.data(), a0.length());
  return rtnval;
}

// func R4 m$fpick <I4

extern "C" real_4 m$fpick_ (const int_4&);
inline real_4 m_fpick (int_4 a0)
{
  return m$fpick_(a0);
}

// sub m$fread >header >* <R8 <I4 >I4

extern "C" void m$fread_ (HEADER&, void*, const real_8&, const int_4&, int_4&);
inline void m_fread (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4)
{
  m$fread_(a0, a1, a2, a3, a4);
}

// sub m$free <m_ptr

extern "C" void m$free_ (const M_PTR&);
inline void m_free (const void* a0)
{
  M_PTR a0mptr; a0mptr.p = reinterpret_cast<unsigned long>(a0);
  m$free_(a0mptr);
}

// sub m$freeall

extern "C" void m$freeall_ ();
inline void m_freeall ()
{
  m$freeall_();
}

// XM4x/C++  CXXsub m$frslt <A <R4
// XBC          sub m$frslt <A <R4
extern "C" void m$frslt_ (const char[], const real_4&, midas::fstring_len_t);
inline void m_frslt (const std::string& a0, real_4 a1)
{
  m$frslt_(a0.data(), a1, a0.length());
}

// func I4 m$fwget <I4 >R4

extern "C" int_4 m$fwget_ (const int_4&, real_4&);
inline int_4 m_fwget (int_4 a0, real_4& a1)
{
  return m$fwget_(a0, a1);
}

// func I4 m$fwinit <A <R4 <R4 <R4 <R4

extern "C" int_4 m$fwinit_ (const char[], const real_4&, const real_4&, const real_4&, const real_4&, midas::fstring_len_t);
inline int_4 m_fwinit (const std::string& a0, real_4 a1, real_4 a2, real_4 a3, real_4 a4)
{
  return m$fwinit_(a0.data(), a1, a2, a3, a4, a0.length());
}

// sub m$fwput <I4 <R4

extern "C" void m$fwput_ (const int_4&, const real_4&);
inline void m_fwput (int_4 a0, real_4 a1)
{
  m$fwput_(a0, a1);
}

// sub m$fwrite >header >* <R8 <I4 >I4

extern "C" void m$fwrite_ (HEADER&, void*, const real_8&, const int_4&, int_4&);
inline void m_fwrite (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4)
{
  m$fwrite_(a0, a1, a2, a3, a4);
}

// m$genradix INTERNAL
// m$gentab INTERNAL

// sub m$geo_to_car >1d-R8 <I4 <I4

extern "C" void m$geo_to_car_ (real_8[], const int_4&, const int_4&);
inline void m_geo_to_car (real_8 a0[], int_4 a1, int_4 a2)
{
  m$geo_to_car_(a0, a1, a2);
}

// func I4 m$get_aux_path <I4 >A

extern "C" int_4 m$get_aux_path_ (const int_4&, char[], midas::fstring_len_t);
inline int_4 m_get_aux_path (int_4 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$get_aux_path_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// XM4x/C      cfunc I4 m$get_avail <I4
// XBC          func I4 m$get_avail <I4
extern "C" int_4 m$get_avail_ (const int_4&);
inline int_4 m_get_avail (int_4 a0)
{
  return m$get_avail_(a0);
}

// m$get_command INTERNAL

// XM44/C++  CXXsub m$get_command_str >A
// XBC          sub m$get_command_str >A TBD: INTERNAL?
//void m_get_command_str (std::string&);
//inline void m_get_command_str (fstring_buf a0fbuf)
//{
//  std::string a0(a0fbuf.str());
//  m_get_command_str(a0);
//  a0fbuf = a0;
//}

// func I4 m$get_default >A

extern "C" int_4 m$get_default_ (char[], midas::fstring_len_t);
inline int_4 m_get_default (fstring_buf a0)
{
  if (!a0.buf) a0.allocate(256);
  int_4 rtnval = m$get_default_(a0.buf, a0.nchar);
  a0.flush();
  return rtnval;
}

// func R8 m$get_dswitch <A

extern "C" real_8 m$get_dswitch_ (const char[], midas::fstring_len_t);
inline real_8 m_get_dswitch (const std::string& a0)
{
  return m$get_dswitch_(a0.data(), a0.length());
}

// func R8 m$get_dswitch_def <A <R8

extern "C" real_8 m$get_dswitch_def_ (const char[], const real_8&, midas::fstring_len_t);
inline real_8 m_get_dswitch_def (const std::string& a0, real_8 a1)
{
  return m$get_dswitch_def_(a0.data(), a1, a0.length());
}

// sub m$get_epoch <header >R8 >R8

extern "C" void m$get_epoch_ (const HEADER&, real_8&, real_8&);
inline void m_get_epoch (const HEADER& a0, real_8& a1, real_8& a2)
{
  m$get_epoch_(a0, a1, a2);
}

// XM4x/C++  CXXsub m$get_history >A <I4 >I4
// XBC          sub m$get_history >A <I4 >I4
extern "C" void m$get_history_ (char[], const int_4&, int_4&, midas::fstring_len_t);
inline void m_get_history (std::string& a0, int_4 a1, int_4& a2)
{
  fstring_buf a0b(a0, a0.length());
  m$get_history_(a0b.buf, a1, a2, a0b.nchar);
  a0b.flush();
}
inline void m_get_history (fstring_buf a0fbuf, int_4 a1, int_4& a2)
{
  std::string a0(a0fbuf.str());
  m_get_history(a0, a1, a2);
  a0fbuf = a0;
}

// XM4x/C++  CXXfunc I4 m$get_input <A >A >I4
// XBC          func I4 m$get_input <A >A >I4 TBD: INTERNAL?
extern "C" int_4 m$get_input_ (const char[], char[], int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_input (const std::string& a0, std::string& a1, int_4& a2)
{
  fstring_buf a1b(a1, a1.length());
  int_4 rtnval = m$get_input_(a0.data(), a1b.buf, a2, a0.length(), a1b.nchar);
  a1b.flush();
  return rtnval;
}
inline int_4 m_get_input (const std::string& a0, fstring_buf a1fbuf, int_4& a2)
{
  int_4 rtnval = m$get_input_(a0.data(), a1fbuf.buf, a2, a0.length(), a1fbuf.nchar);
  a1fbuf.flush();
  return rtnval;
}

// func I4 m$get_keydata >header >A >* <I4 <I4 >A1

extern "C" int_4 m$get_keydata_ (HEADER&, char[], void*, const int_4&, const int_4&, char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_keydata (HEADER& a0, fstring_buf a1, void* a2, int_4 a3, int_4 a4, char& a5)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$get_keydata_(a0, a1.buf, a2, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  return rtnval;
}

// func I4 m$get_keyword >header <A >A

extern "C" int_4 m$get_keyword_ (HEADER&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_keyword (HEADER& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$get_keyword_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// m$get_macro_name INTERNAL
// m$get_message DEPRECATED use m_get_msgl() or m_get_msg()

// func I4 m$get_msg >mq_header >* <I4 <R4 <I4

extern "C" int_4 m$get_msg_ (MQ_HEADER&, void*, const int_4&, const real_4&, const int_4&);
inline int_4 m_get_msg (MQ_HEADER& a0, void* a1, int_4 a2, real_4 a3, int_4 a4)
{
  return m$get_msg_(a0, a1, a2, a3, a4);
}

// func I4 m$get_msgl >A8 >I4 >I4 >I4 >I4 >I4 >A86 >* <I4 <R4 <I4

extern "C" int_4 m$get_msgl_ (char[], int_4&, int_4&, int_4&, int_4&, int_4&, char[], void*, const int_4&, const real_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_msgl (fstring_buf a0, int_4& a1, int_4& a2, int_4& a3, int_4& a4, int_4& a5, fstring_buf a6, void* a7, int_4 a8, real_4 a9, int_4 a10)
{
  if (!a0.buf) a0.allocate(8);
  if (!a6.buf) a6.allocate(86);
  int_4 rtnval = m$get_msgl_(a0.buf, a1, a2, a3, a4, a5, a6.buf, a7, a8, a9, a10, a0.nchar, a6.nchar);
  a0.flush();
  a6.flush();
  return rtnval;
}

// sub m$get_pkt <header >pkdstruct

extern "C" void m$get_pkt_ (const HEADER&, PKDSTRUCT&);
inline void m_get_pkt (const HEADER& a0, PKDSTRUCT& a1)
{
  m$get_pkt_(a0, a1);
}

// m$get_pause_time INTERNAL

// func L4 m$get_pswitch <A

extern "C" bool_4 m$get_pswitch_ (const char[], midas::fstring_len_t);
inline bool_4 m_get_pswitch (const std::string& a0)
{
  return m$get_pswitch_(a0.data(), a0.length());
}

// func I4 m$get_qualifier <header <A

extern "C" int_4 m$get_qualifier_ (const HEADER&, const char[], midas::fstring_len_t);
inline int_4 m_get_qualifier (const HEADER& a0, const std::string& a1)
{
  return m$get_qualifier_(a0, a1.data(), a1.length());
}

// func I4 m$get_result <A >* <I4 <I4 >A1 >I4

extern "C" int_4 m$get_result_ (const char[], void*, const int_4&, const int_4&, char&, int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_result (const std::string& a0, void* a1, int_4 a2, int_4 a3, char& a4, int_4& a5)
{
  return m$get_result_(a0.data(), a1, a2, a3, a4, a5, a0.length(), 1);
}

// func L4 m$get_sswitch <A

extern "C" bool_4 m$get_sswitch_ (const char[], midas::fstring_len_t);
inline bool_4 m_get_sswitch (const std::string& a0)
{
  return m$get_sswitch_(a0.data(), a0.length());
}

// func L4 m$get_sswitch_def <A <I4

extern "C" bool_4 m$get_sswitch_def_ (const char[], const int_4&, midas::fstring_len_t);
inline bool_4 m_get_sswitch_def (const std::string& a0, int_4 a1)
{
  return m$get_sswitch_def_(a0.data(), a1, a0.length());
}

// func I4 m$get_switch <A

extern "C" int_4 m$get_switch_ (const char[], midas::fstring_len_t);
inline int_4 m_get_switch (const std::string& a0)
{
  return m$get_switch_(a0.data(), a0.length());
}

// func I4 m$get_switch_def <A <I4

extern "C" int_4 m$get_switch_def_ (const char[], const int_4&, midas::fstring_len_t);
inline int_4 m_get_switch_def (const std::string& a0, int_4 a1)
{
  return m$get_switch_def_(a0.data(), a1, a0.length());
}

// sub m$get_t6subrecord >header <I4 >t6subr_struct
// NTN not supported in XBC
//extern "C" void m$get_t6subrecord_ (HEADER&, const int_4&, T6SUBR_STRUCT&);
//inline void m_get_t6subrecord (HEADER& a0, int_4 a1, T6SUBR_STRUCT& a2)
//{
//  m$get_t6subrecord_(a0, a1, a2);
//}

// func I4 m$get_uqualifier <header <A >A

extern "C" int_4 m$get_uqualifier_ (const HEADER&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_uqualifier (const HEADER& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$get_uqualifier_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$get_uswitch <A >A

extern "C" int_4 m$get_uswitch_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_get_uswitch (const std::string& a0, std::string& a1)
{
  fstring_out_buf a1b(a1,256);
  int_4 rtnlen = m$get_uswitch_(a0.data(), a1b.buf, a0.length(), a1b.nchar);
  addnullterminator(a1b.buf, a1b.nchar, rtnlen, FLAG_IGNORE_ZERO_POS); // BUG 2287
  // strf2c(a1b.buf, a1b.nchar, a1b.buf, a1b.nchar, F2C_TRIM); // slower alternate fix for BUG 2287 for 2.8.2 and prior
  a1b.flush(); // flush changes back to a1 (string)
  return rtnlen;
}
inline int_4 m_get_uswitch (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) { a1.allocate(256); }
  int_4 rtnlen = m$get_uswitch_(a0.data(), a1.buf, a0.length(), a1.nchar);
  addnullterminator(a1.buf, a1.nchar, rtnlen, FLAG_IGNORE_ZERO_POS); // BUG 2287
  // strf2c(a1.buf, a1.nchar, a1.buf, a1.nchar, F2C_TRIM); // slower alternate fix for BUG 2287 for 2.8.2 and prior
  a1.flush();
  return rtnlen;
}

// func I4 m$getlog <A >A

extern "C" int_4 m$getlog_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_getlog (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$getlog_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$getw_message DEPRECATED use m_get_msgl() or m_get_msg()

// sub m$gold2blue >header

extern "C" void m$gold2blue_ (HEADER&);
inline void m_gold2blue (HEADER& a0)
{
  m$gold2blue_(a0);
}

// sub m$goldrep <header >A4

extern "C" void m$goldrep_ (const HEADER&, char[], midas::fstring_len_t);
inline void m_goldrep (const HEADER& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(4);
  m$goldrep_(a0, a1.buf, a1.nchar);
  a1.flush();
}

// m$goto INTERNAL

// sub m$grab >header >* <R8 <I4 >I4

extern "C" void m$grab_ (HEADER&, void*, const real_8&, const int_4&, int_4&);
inline void m_grab (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4)
{
  m$grab_(a0, a1, a2, a3, a4);
}

// sub m$grab5n >header >* <R8 <I4 >I4 <A

extern "C" void m$grab5n_ (HEADER&, void*, const real_8&, const int_4&, int_4&, const char[], midas::fstring_len_t);
inline void m_grab5n (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4, const std::string& a5)
{
  m$grab5n_(a0, a1, a2, a3, a4, a5.data(), a5.length());
}

// sub m$grabt >header >* <R8 <I4 >I4 <header

extern "C" void m$grabt_ (HEADER&, void*, const real_8&, const int_4&, int_4&, const HEADER&);
inline void m_grabt (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4, const HEADER& a5)
{
  m$grabt_(a0, a1, a2, a3, a4, a5);
}

// sub m$grabx >header >* >I4

extern "C" void m$grabx_ (HEADER&, void*, int_4&);
inline void m_grabx (HEADER& a0, void* a1, int_4& a2)
{
  m$grabx_(a0, a1, a2);
}

// sub m$grabxp >header >* <I4 <I4 >I4

extern "C" void m$grabxp_ (HEADER&, void*, const int_4&, const int_4&, int_4&);
inline void m_grabxp (HEADER& a0, void* a1, int_4 a2, int_4 a3, int_4& a4)
{
  m$grabxp_(a0, a1, a2, a3, a4);
}

// sub m$grabxt >header >* >I4 <header

extern "C" void m$grabxt_ (HEADER&, void*, int_4&, const HEADER&);
inline void m_grabxt (HEADER& a0, void* a1, int_4& a2, const HEADER& a3)
{
  m$grabxt_(a0, a1, a2, a3);
}

// sub m$grabxz >header >* <R8 <I4 >I4 >I4

extern "C" void m$grabxz_ (HEADER&, void*, const real_8&, const int_4&, int_4&, int_4&);
inline void m_grabxz (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4, int_4& a5)
{
  m$grabxz_(a0, a1, a2, a3, a4, a5);
}

// func I4 m$gsub <A >A <A <A

extern "C" int_4 m$gsub_ (const char[], char[], const char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_gsub (const std::string& a0, fstring_buf a1, const std::string& a2, const std::string& a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$gsub_(a0.data(), a1.buf, a2.data(), a3.data(), a0.length(), a1.nchar, a2.length(), a3.length());
  a1.flush();
  return rtnval;
}

// func I4 m$gsubl <A <I4 >A <A <I4 <A <I4

extern "C" int_4 m$gsubl_ (const char[], const int_4&, char[], const char[], const int_4&, const char[], const int_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_gsubl (const std::string& a0, int_4 a1, fstring_buf a2, const std::string& a3, int_4 a4, const std::string& a5, int_4 a6)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$gsubl_(a0.data(), a1, a2.buf, a3.data(), a4, a5.data(), a6, a0.length(), a2.nchar, a3.length(), a5.length());
  a2.flush();
  return rtnval;
}

// sub m$hcbfunc >header <I4 >1d-I4

extern "C" void m$hcbfunc_ (HEADER&, const int_4&, int_4[]);
inline void m_hcbfunc (HEADER& a0, int_4 a1, int_4 a2[])
{
  m$hcbfunc_(a0, a1, a2);
}

// func I4 m$head <A >A

extern "C" int_4 m$head_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_head (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$head_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$hibernate INTERNAL

// sub m$hm_flag >header

extern "C" void m$hm_flag_ (HEADER&);
inline void m_hm_flag (HEADER& a0)
{
  m$hm_flag_(a0);
}

// sub m$hw_getinfo >A >A >A >A

extern "C" void m$hw_getinfo_ (char[], char[], char[], char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline void m_hw_getinfo (fstring_buf a0, fstring_buf a1, fstring_buf a2, fstring_buf a3)
{
  if (!a0.buf) a0.allocate(256);
  if (!a1.buf) a1.allocate(256);
  if (!a2.buf) a2.allocate(256);
  if (!a3.buf) a3.allocate(256);
  m$hw_getinfo_(a0.buf, a1.buf, a2.buf, a3.buf, a0.nchar, a1.nchar, a2.nchar, a3.nchar);
  a0.flush();
  a1.flush();
  a2.flush();
  a3.flush();
}

// sub m$hw_menu <A

extern "C" void m$hw_menu_ (const char[], midas::fstring_len_t);
inline void m_hw_menu (const std::string& a0)
{
  m$hw_menu_(a0.data(), a0.length());
}

// func I4 m$hwf_alias >header <A >A

extern "C" int_4 m$hwf_alias_ (HEADER&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_hwf_alias (HEADER& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$hwf_alias_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$hwf_close >header

extern "C" int_4 m$hwf_close_ (HEADER&);
inline int_4 m_hwf_close (HEADER& a0)
{
  return m$hwf_close_(a0);
}

// func I4 m$hwf_command >header <A >A

extern "C" int_4 m$hwf_command_ (HEADER&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_hwf_command (HEADER& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$hwf_command_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$hwf_open >header

extern "C" int_4 m$hwf_open_ (HEADER&);
inline int_4 m_hwf_open (HEADER& a0)
{
  return m$hwf_open_(a0);
}

// func I4 m$import <A >A

extern "C" int_4 m$import_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_import (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$import_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$inactive <A

extern "C" void m$inactive_ (const char[], midas::fstring_len_t);
inline void m_inactive (const std::string& a0)
{
  m$inactive_(a0.data(), a0.length());
}

// sub m$index <header <I4 >R8 >R8

extern "C" void m$index_ (const HEADER&, const int_4&, real_8&, real_8&);
inline void m_index (const HEADER& a0, int_4 a1, real_8& a2, real_8& a3)
{
  m$index_(a0, a1, a2, a3);
}

// sub m$info <A

extern "C" void m$info_ (const char[], midas::fstring_len_t);
inline void m_info (const std::string& a0)
{
  m$info_(a0.data(), a0.length());
}

// XM4x/C++  CXXsub m$init >header <A <A <A <1d-I4
// XBC          sub m$init >header <A <A <A <1d-I4
extern "C" void m$init_ (HEADER&, const char[], const char[], const char[], const int_4[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline void m_init (HEADER& a0, const std::string& a1, const std::string& a2, const std::string& a3, const int_4 a4[])
{
  m$init_(a0, a1.data(), a2.data(), a3.data(), a4, a1.length(), a2.length(), a3.length());
}

// m$init_aux_table INTERNAL
// m$init_dll INTERNAL

// sub m$init_msg <I4

extern "C" void m$init_msg_ (const int_4&);
inline void m_init_msg (int_4 a0)
{
  m$init_msg_(a0);
}

// m$init_primitive INTERNAL
// m$init_signals INTERNAL

// sub m$init_timer

extern "C" void m$init_timer_ ();
inline void m_init_timer ()
{
  m$init_timer_();
}

// sub m$initialize >header

extern "C" void m$initialize_ (HEADER&);
inline void m_initialize (HEADER& a0)
{
  m$initialize_(a0);
}

// sub m$inok >header

extern "C" void m$inok_ (HEADER&);
inline void m_inok (HEADER& a0)
{
  m$inok_(a0);
}

// sub m$inokw >header

extern "C" void m$inokw_ (HEADER&);
inline void m_inokw (HEADER& a0)
{
  m$inokw_(a0);
}

// sub m$interp <I4 <R8 <R8 <2d-R4 <I4 <R8 <R8 >2d-R4 <I4 <I4 >I4

extern "C" void m$interp_ (const int_4&, const real_8&, const real_8&, const real_4[], const int_4&, const real_8&, const real_8&, real_4[], const int_4&, const int_4&, int_4&);
inline void m_interp (int_4 a0, real_8 a1, real_8 a2, const real_4 a3[], int_4 a4, real_8 a5, real_8 a6, real_4 a7[], int_4 a8, int_4 a9, int_4& a10)
{
  m$interp_(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
}

// sub m$interpd <I4 <R8 <R8 <2d-R8 <I4 <R8 <R8 >2d-R8 <I4 <I4 >I4

extern "C" void m$interpd_ (const int_4&, const real_8&, const real_8&, const real_8[], const int_4&, const real_8&, const real_8&, real_8[], const int_4&, const int_4&, int_4&);
inline void m_interpd (int_4 a0, real_8 a1, real_8 a2, const real_8 a3[], int_4 a4, real_8 a5, real_8 a6, real_8 a7[], int_4 a8, int_4 a9, int_4& a10)
{
  m$interpd_(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
}

// m$inxform INTERNAL

// func I4 m$io_close <I4 <I4 <1d-m_ptr

extern "C" int_4 m$io_close_ (const int_4&, const int_4&, const void*[]);
inline int_4 m_io_close (int_4 a0, int_4 a1, const void* a2[])
{
  return m$io_close_(a0, a1, a2);
}

// func I4 m$io_open >I4 <I4 <1d-m_ptr

extern "C" int_4 m$io_open_ (int_4&, const int_4&, const void*[]);
inline int_4 m_io_open (int_4& a0, int_4 a1, const void* a2[])
{
  return m$io_open_(a0, a1, a2);
}

// func I4 m$io_purge <I4

extern "C" int_4 m$io_purge_ (const int_4&);
inline int_4 m_io_purge (int_4 a0)
{
  return m$io_purge_(a0);
}

// func I4 m$io_read <I4 >* <I4 <I4 <1d-m_ptr

extern "C" int_4 m$io_read_ (const int_4&, void*, const int_4&, const int_4&, const void*[]);
inline int_4 m_io_read (int_4 a0, void* a1, int_4 a2, int_4 a3, const void* a4[])
{
  return m$io_read_(a0, a1, a2, a3, a4);
}

// m$io_samnetinfo INTERNAL

// func I4 m$io_sync <I4 >* <I4

extern "C" int_4 m$io_sync_ (const int_4&, void*, const int_4&);
inline int_4 m_io_sync (int_4 a0, void* a1, int_4 a2)
{
  return m$io_sync_(a0, a1, a2);
}

// func I4 m$io_time >R4 <R4

extern "C" int_4 m$io_time_ (real_4&, const real_4&);
inline int_4 m_io_time (real_4& a0, real_4 a1)
{
  return m$io_time_(a0, a1);
}

// func I4 m$io_write <I4 <* <I4 <I4 <1d-m_ptr

extern "C" int_4 m$io_write_ (const int_4&, const void*, const int_4&, const int_4&, const void*[]);
inline int_4 m_io_write (int_4 a0, const void* a1, int_4 a2, int_4 a3, const void* a4[])
{
  return m$io_write_(a0, a1, a2, a3, a4);
}

// func I2 m$ipick <I4

extern "C" int_2 m$ipick_ (const int_4&);
inline int_2 m_ipick (int_4 a0)
{
  return m$ipick_(a0);
}

// XMx4/C++ CXXsub m$irslt <A <I2
// XBC         sub m$irslt <A <I2
extern "C" void m$irslt_ (const char[], const int_2&, midas::fstring_len_t);
inline void m_irslt (const std::string& a0, int_2 a1) {
  m$irslt_(a0.data(), a1, a0.length());
}

// m$keyhdr_pack INTERNAL
// m$keyhdr_unpack INTERNAL

// func I4 m$l2a <I4 >A

extern "C" int_4 m$l2a_ (const int_4&, char[], midas::fstring_len_t);
inline int_4 m_l2a (int_4 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$l2a_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$ldirectory <A <A <A >A >I4 >I4 >I4

extern "C" int_4 m$ldirectory_ (const char[], const char[], const char[], char[], int_4&, int_4&, int_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_ldirectory (const std::string& a0, const std::string& a1, const std::string& a2, fstring_buf a3, int_4& a4, int_4& a5, int_4& a6)
{
  if (!a3.buf) a3.allocate(256);
  int_4 rtnval = m$ldirectory_(a0.data(), a1.data(), a2.data(), a3.buf, a4, a5, a6, a0.length(), a1.length(), a2.length(), a3.nchar);
  a3.flush();
  return rtnval;
}

// func I4 m$length <A

extern "C" int_4 m$length_ (const char[], midas::fstring_len_t);
inline int_4 m_length (const std::string& a0)
{
  return m$length_(a0.data(), a0.length());
}

// func I4 m$lengthd <A

extern "C" int_4 m$lengthd_ (const char[], midas::fstring_len_t);
inline int_4 m_lengthd (const std::string& a0)
{
  return m$lengthd_(a0.data(), a0.length());
}

// func I4 m$lengthq <A

extern "C" int_4 m$lengthq_ (const char[], midas::fstring_len_t);
inline int_4 m_lengthq (const std::string& a0)
{
  return m$lengthq_(a0.data(), a0.length());
}

// m$load_bitmasks INTERNAL
// m$load_macro INTERNAL

// func I4 m$lock <I4 <I4 <I4

extern "C" int_4 m$lock_ (const int_4&, const int_4&, const int_4&);
inline int_4 m_lock (int_4 a0, int_4 a1, int_4 a2)
{
  return m$lock_(a0, a1, a2);
}

// cfunc I4 m$lock_semaphore <I4

extern "C" int_4 m_lock_semaphore (int_4);

// func I4 m$logical <A <I4

extern "C" int_4 m$logical_ (const char[], const int_4&, midas::fstring_len_t);
inline int_4 m_logical (const std::string& a0, int_4 a1)
{
  return m$logical_(a0.data(), a1, a0.length());
}

// XM4x/C++ CXXsub m$lowercase >A
// XBC         sub m$lowercase >A
// TODO: should change ">A" to "=A" (= for In/Out) in future to match XM46+
extern "C" void m$lowercase_ (char*, midas::fstring_len_t);
inline void m_lowercase (std::string& a0)
{
  fstring_buf a0b(a0, a0.length());
  m$lowercase_(a0b.buf, a0b.nchar);
  a0b.flush();
}
inline void m_lowercase (fstring_buf a0fbuf)
{
  std::string a0(a0fbuf.str());
  m_lowercase(a0);
  a0fbuf = a0;
}

// func I4 m$lpick <I4

extern "C" int_4 m$lpick_ (const int_4&);
inline int_4 m_lpick (int_4 a0)
{
  return m$lpick_(a0);
}

// XM4x/C++  CXXsub m$lrslt <A <I4
// XBC          sub m$lrslt <A <I4
extern "C" void m$lrslt_ (const char[], const int_4&, midas::fstring_len_t);
inline void m_lrslt (const std::string& a0, int_4 a1)
{
  m$lrslt_(a0.data(), a1, a0.length());
}

// func I4 m$lwget <I4 >I4

extern "C" int_4 m$lwget_ (const int_4&, int_4&);
inline int_4 m_lwget (int_4 a0, int_4& a1)
{
  return m$lwget_(a0, a1);
}

// func I4 m$lwinit <A <I4 <I4 <I4 <I4

extern "C" int_4 m$lwinit_ (const char[], const int_4&, const int_4&, const int_4&, const int_4&, midas::fstring_len_t);
inline int_4 m_lwinit (const std::string& a0, int_4 a1, int_4 a2, int_4 a3, int_4 a4)
{
  return m$lwinit_(a0.data(), a1, a2, a3, a4, a0.length());
}

// sub m$lwput <I4 <I4

extern "C" void m$lwput_ (const int_4&, const int_4&);
inline void m_lwput (int_4 a0, int_4 a1)
{
  m$lwput_(a0, a1);
}

// m$macro_return INTERNAL
// m$make_key INTERNAL
// m$make_key4 INTERNAL

// sub m$malloc <I4 >m_ptr

extern "C" void m$malloc_ (const int_4&, M_PTR&);
inline void m_malloc (int_4 a0, void*& a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$malloc_(a0, a1mptr);
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

inline void* m_malloc (int_4 nbytes)
{
  void* ptr; m_malloc(nbytes, ptr); return ptr;
}

// sub m$malloc64 <I8 >m_ptr

extern "C" void m$malloc64_ (const int_8&, M_PTR&);
inline void m_malloc64 (int_8 a0, void*& a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$malloc64_(a0, a1mptr);
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

// sub m$map_buffer <I4

extern "C" void m$map_buffer_ (const int_4&);
inline void m_map_buffer (int_4 a0)
{
  m$map_buffer_(a0);
}

// m$map_ds_structs INTERNAL
// m$map_macro_stack INTERNAL
// m$map_section INTERNAL

// cfunc I4 m$map_shm <A <I4 <I4 <I4 >I4

extern "C" int_4 m_map_shm (const char[], int_4, int_4, int_4, int_4&, midas::fstring_len_t);
inline int_4 m_map_shm (const std::string& a0, int_4 a1, int_4 a2, int_4 a3, int_4& a4)
{
  return m_map_shm(a0.data(), a1, a2, a3, a4, a0.length());
}

// sub m$matrix_cpy <transmatrix >transmatrix

extern "C" void m$matrix_cpy_ (const TRANSMATRIX&, TRANSMATRIX&);
inline void m_matrix_cpy (const TRANSMATRIX& a0, TRANSMATRIX& a1)
{
  m$matrix_cpy_(a0, a1);
}

// sub m$matrix_dump <transmatrix

extern "C" void m$matrix_dump_ (const TRANSMATRIX&);
inline void m_matrix_dump (const TRANSMATRIX& a0)
{
  m$matrix_dump_(a0);
}

// sub m$matrix_idn >transmatrix

extern "C" void m$matrix_idn_ (TRANSMATRIX&);
inline void m_matrix_idn (TRANSMATRIX& a0)
{
  m$matrix_idn_(a0);
}

// sub m$matrix_inv <transmatrix >transmatrix

extern "C" void m$matrix_inv_ (const TRANSMATRIX&, TRANSMATRIX&);
inline void m_matrix_inv (const TRANSMATRIX& a0, TRANSMATRIX& a1)
{
  m$matrix_inv_(a0, a1);
}

// sub m$matrix_mul <transmatrix <transmatrix >transmatrix

extern "C" void m$matrix_mul_ (const TRANSMATRIX&, const TRANSMATRIX&, TRANSMATRIX&);
inline void m_matrix_mul (const TRANSMATRIX& a0, const TRANSMATRIX& a1, TRANSMATRIX& a2)
{
  m$matrix_mul_(a0, a1, a2);
}

// sub m$matrix_mula <transmatrix >1d-R8 <I4 <I4

extern "C" void m$matrix_mula_ (const TRANSMATRIX&, real_8[], const int_4&, const int_4&);
inline void m_matrix_mula (const TRANSMATRIX& a0, real_8 a1[], int_4 a2, int_4 a3)
{
  m$matrix_mula_(a0, a1, a2, a3);
}

// sub m$matrix_mulab <transmatrix >1d-R8 <I4 <I4

extern "C" void m$matrix_mulab_ (const TRANSMATRIX&, real_8[], const int_4&, const int_4&);
inline void m_matrix_mulab (const TRANSMATRIX& a0, real_8 a1[], int_4 a2, int_4 a3)
{
  m$matrix_mulab_(a0, a1, a2, a3);
}

// sub m$matrix_mulpva <transmatrix >1d-R8 <I4 <I4

extern "C" void m$matrix_mulpva_ (const TRANSMATRIX&, real_8[], const int_4&, const int_4&);
inline void m_matrix_mulpva (const TRANSMATRIX& a0, real_8 a1[], int_4 a2, int_4 a3)
{
  m$matrix_mulpva_(a0, a1, a2, a3);
}

// sub m$matrix_rot >transmatrix <R8 <I4

extern "C" void m$matrix_rot_ (TRANSMATRIX&, const real_8&, const int_4&);
inline void m_matrix_rot (TRANSMATRIX& a0, real_8 a1, int_4 a2)
{
  m$matrix_rot_(a0, a1, a2);
}

// sub m$matrix_top2ecr >transmatrix <1d-R8

extern "C" void m$matrix_top2ecr_ (TRANSMATRIX&, const real_8[]);
inline void m_matrix_top2ecr (TRANSMATRIX& a0, const real_8 a1[])
{
  m$matrix_top2ecr_(a0, a1);
}

// sub m$matrix_trn >transmatrix

extern "C" void m$matrix_trn_ (TRANSMATRIX&);
inline void m_matrix_trn (TRANSMATRIX& a0)
{
  m$matrix_trn_(a0);
}

// m$mcr_attach INTERNAL
// m$mcr_bound INTERNAL
// m$mcr_fetch INTERNAL
// m$mcr_fetch_next INTERNAL
// m$meminit INTERNAL

// sub m$message <A <A

extern "C" void m$message_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline void m_message (const std::string& a0, const std::string& a1)
{
  m$message_(a0.data(), a1.data(), a0.length(), a1.length());
}

// sub m$mfree <I4 <m_ptr

extern "C" void m$mfree_ (const int_4&, const M_PTR&);
inline void m_mfree (int_4 a0, const void* a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$mfree_(a0, a1mptr);
}

// sub m$mjd2ydy <I4 >I4 >I4

extern "C" void m$mjd2ydy_ (const int_4&, int_4&, int_4&);
inline void m_mjd2ydy (int_4 a0, int_4& a1, int_4& a2)
{
  m$mjd2ydy_(a0, a1, a2);
}

// sub m$mjd2ymd <I4 >I4 >I4 >I4

extern "C" void m$mjd2ymd_ (const int_4&, int_4&, int_4&, int_4&);
inline void m_mjd2ymd (int_4 a0, int_4& a1, int_4& a2, int_4& a3)
{
  m$mjd2ymd_(a0, a1, a2, a3);
}

// m$mjdconversions_ INTERNAL
// m$modify_pipe_name INTERNAL

// XM4x/C++  CXXfunc I4 m$more <A
// XBC          func I4 m$more <A
extern "C" int_4 m$more_ (const char [], midas::fstring_len_t);
inline int_4 m_more (const std::string& a0)
{
  int_4 rtnval = m$more_(a0.data(), a0.length());
  return rtnval;
}

// sub m$move <* >* <I4

extern "C" void m$move_ (const void*, void*, const int_4&);
inline void m_move (const void* a0, void* a1, int_4 a2)
{
  m$move_(a0, a1, a2);
}

// func I8 m$msgfunc <I4 <I4

extern "C" int_8 m$msgfunc_ (const int_4&, const int_4&);
inline int_8 m_msgfunc (int_4 a0, int_4 a1)
{
  return m$msgfunc_(a0, a1);
}

// sub m$msglog <A <I4

extern "C" void m$msglog_ (const char[], const int_4&, midas::fstring_len_t);
inline void m_msglog (const std::string& a0, int_4 a1)
{
  m$msglog_(a0.data(), a1, a0.length());
}

// m$mtag INTERNAL

// func I4 m$mwget <I4 >I4

extern "C" int_4 m$mwget_ (const int_4&, int_4&);
inline int_4 m_mwget (int_4 a0, int_4& a1)
{
  return m$mwget_(a0, a1);
}

// func I4 m$mwinit <A <I4 <A

extern "C" int_4 m$mwinit_ (const char[], const int_4&, const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_mwinit (const std::string& a0, int_4 a1, const std::string& a2)
{
  return m$mwinit_(a0.data(), a1, a2.data(), a0.length(), a2.length());
}

// sub m$mwput <I4 <I4

extern "C" void m$mwput_ (const int_4&, const int_4&);
inline void m_mwput (int_4 a0, int_4 a1)
{
  m$mwput_(a0, a1);
}

// func I4 m$nelements <A <A

extern "C" int_4 m$nelements_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_nelements (const std::string& a0, const std::string& a1)
{
  return m$nelements_(a0.data(), a1.data(), a0.length(), a1.length());
}

// m$next_key INTERNAL
// m$next_key4 INTERNAL
// m$next_file_lu INTERNAL

// func I4 m$next_msg >* >mq_header <I4

extern "C" int_4 m$next_msg_ (void*, MQ_HEADER&, const int_4&);
inline int_4 m_next_msg (void* a0, MQ_HEADER& a1, int_4 a2)
{
  return m$next_msg_(a0, a1, a2);
}

// func I4 m$nextline <I4 >A1024 <L4

extern "C" int_4 m$nextline_ (const int_4&, char[], const bool_4&, midas::fstring_len_t);
inline int_4 m_nextline (int_4 a0, fstring_buf a1, bool_4 a2)
{
  if (!a1.buf) a1.allocate(1024);
  int_4 rtnval = m$nextline_(a0, a1.buf, a2, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$nextline_source <I4 >A1024 <L4 >I4

extern "C" int_4 m$nextline_source_ (const int_4&, char[], const bool_4&, int_4&, midas::fstring_len_t);
inline int_4 m_nextline_source (int_4 a0, fstring_buf a1, bool_4 a2, int_4& a3)
{
  if (!a1.buf) a1.allocate(1024);
  int_4 rtnval = m$nextline_source_(a0, a1.buf, a2, a3, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$nformat <A <A >A

extern "C" int_4 m$nformat_ (const char[], const char[], char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_nformat (const std::string& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$nformat_(a0.data(), a1.data(), a2.buf, a0.length(), a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$nsearch <A <A <I4

extern "C" int_4 m$nsearch_ (const char[], const char[], const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_nsearch (const std::string& a0, const std::string& a1, int_4 a2)
{
  return m$nsearch_(a0.data(), a1.data(), a2, a0.length(), a1.length());
}

// m$nice INTERNAL

// sub m$now >R8 >R8

extern "C" void m$now_ (real_8&, real_8&);
inline void m_now (real_8& a0, real_8& a1)
{
  m$now_(a0, a1);
}

// XM4x/C++  CXXfunc I4 m$npt <A1
// XBC          func I4 m$npt <A1
extern "C" int_4 m$npt_ (const char&, midas::fstring_len_t);
inline int_4 m_npt (char a0)
{
  int_4 rtnval = m$npt_(a0, 1);
  return rtnval;
}

// XM44/C++  CXXfunc I4 m$npm <A1
// XBC          func I4 m$npm <A1
extern "C" int_4 m$npm_ (const char&, midas::fstring_len_t);
inline int_4 m_npm (char a0)
{
  int_4 rtnval = m$npm_(a0, 1);
  return rtnval;
}

// XM44/C++  CXXfunc I4 m$number_parameters
// XBC          func I4 m$number_parameters
extern "C" int_4 m$number_parameters_ ();
inline int_4 m_number_parameters ()
{
  int_4 rtnval = m$number_parameters_();
  return rtnval;
}

// sub m$open >header <I4

extern "C" void m$open_ (HEADER&, const int_4&);
inline void m_open (HEADER& a0, int_4 a1)
{
  m$open_(a0, a1);
}

// m$open_ext_header INTERNAL
// m$open_shellfile INTERNAL

// sub m$open_t6subrecords >header

extern "C" void m$open_t6subrecords_ (HEADER&);
inline void m_open_t6subrecords (HEADER& a0)
{
  m$open_t6subrecords_(a0);
}

// m$osenv_util INTERNAL

// func I4 m$parse <A <I4 >A

extern "C" int_4 m$parse_ (const char[], const int_4&, char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_parse (const std::string& a0, int_4 a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$parse_(a0.data(), a1, a2.buf, a0.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// m$parse_command INTERNAL

// XM44/C++  CXXsub m$parse_command_str <A >A >A1 >A
// XBC          sub m$parse_command_str <A >A >A1 >A INTERNAL
//extern "C" void m$parse_command_str_ (const char[], char[], char&, chsr[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
//inline void m_parse_command_str (const std::string&, std::string&, char&, std::string&)
//{
//}
//inline void m_parse_command_str (const std::string& a0, fstring_buf a1fbuf, char& a2, fstring_buf a3fbuf)
//{
//  std::string a1(a1fbuf.str());
//  std::string a3(a3fbuf.str());
//  m_parse_command_str(a0, a1, a2, a3);
//  a3fbuf = a3;
//  a1fbuf = a1;
//}

// m$parsefilename INTERNAL

// sub m$pause <R4

extern "C" void m$pause_ (const real_4&);
inline void m_pause (real_4 a0)
{
  m$pause_(a0);
}

// m$pcreate INTERNAL
// m$pheadloc INTERNAL

// func I4 m$pick <I4 >* <I4 <I4 >A1

extern "C" int_4 m$pick_ (const int_4&, void*, const int_4&, const int_4&, char&, midas::fstring_len_t);
inline int_4 m_pick (int_4 a0, void* a1, int_4 a2, int_4 a3, char& a4)
{
  return m$pick_(a0, a1, a2, a3, a4, 1);
}

// XM46/C++  CXXfunc L4 m$filename_is_pipe <A
extern bool_4 m_filename_is_pipe (const std::string&);

// m$pindices INTERNAL
// m$pipe_prep INTERNAL
// m$pipe_set INTERNAL

// sub m$pkt_except <A >A >I4 >I4

extern "C" void m$pkt_except_ (const char[], char[], int_4&, int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_pkt_except (const std::string& a0, fstring_buf a1, int_4& a2, int_4& a3)
{
  if (!a1.buf) a1.allocate(256);
  m$pkt_except_(a0.data(), a1.buf, a2, a3, a0.length(), a1.nchar);
  a1.flush();
}

// sub m$pkt_file_reg >header

extern "C" void m$pkt_file_reg_ (HEADER&);
inline void m_pkt_file_reg (HEADER& a0)
{
  m$pkt_file_reg_(a0);
}

// sub m$pkt_hdrmod >header

extern "C" void m$pkt_hdrmod_ (HEADER&);
inline void m_pkt_hdrmod (HEADER& a0)
{
  m$pkt_hdrmod_(a0);
}

// sub m$pkt_init >header

extern "C" void m$pkt_init_ (HEADER&);
inline void m_pkt_init (HEADER& a0)
{
  m$pkt_init_(a0);
}

// sub m$pkt_map_resolve

extern "C" void m$pkt_map_resolve_ ();
inline void m_pkt_map_resolve ()
{
  m$pkt_map_resolve_();
}

// sub m$pkt_map_search <A >m_ptr >I4

extern "C" void m$pkt_map_search_ (const char[], M_PTR&, int_4&, midas::fstring_len_t);
inline void m_pkt_map_search (const std::string& a0, void*& a1, int_4& a2)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$pkt_map_search_(a0.data(), a1mptr, a2, a0.length());
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

// sub m$pkt_propagate <header >header

extern "C" void m$pkt_propagate_ (const HEADER&, HEADER&);
inline void m_pkt_propagate (const HEADER& a0, HEADER& a1)
{
  m$pkt_propagate_(a0, a1);
}

// sub m$pkt_register <header >header

extern "C" void m$pkt_register_ (const HEADER&, HEADER&);
inline void m_pkt_register (const HEADER& a0, HEADER& a1)
{
  m$pkt_register_(a0, a1);
}

// sub m$pkt_show_reg <header

extern "C" void m$pkt_show_reg_ (const HEADER&);
inline void m_pkt_show_reg (const HEADER& a0)
{
  m$pkt_show_reg_(a0);
}

// m$pname_add INTERNAL
// m$pname_check INTERNAL
// m$pname_cleanup_check INTERNAL
// m$pname_clear_cmd INTERNAL
// m$pname_get_entry INTERNAL

// sub m$pname_kill <A32

extern "C" void m$pname_kill_ (const char[], midas::fstring_len_t);
inline void m_pname_kill (const std::string& a0)
{
  m$pname_kill_(a0.data(), a0.length());
}

// m$pname_kill_all INTERNAL

// sub m$pname_kill_pid <I4

extern "C" void m$pname_kill_pid_ (const int_4&);
inline void m_pname_kill_pid (int_4 a0)
{
  m$pname_kill_pid_(a0);
}

// m$pname_remove INTERNAL
// m$pname_set_cmd INTERNAL

// sub m$pname_stop_all <I4

extern "C" void m$pname_stop_all_ (const int_4&);
inline void m_pname_stop_all (int_4 a0)
{
  m$pname_stop_all_(a0);
}

// m$pop_macro_stack INTERNAL
// m$popen INTERNAL

// func I4 m$power2ge <I4

extern "C" int_4 m$power2ge_ (const int_4&);
inline int_4 m_power2ge (int_4 a0)
{
  return m$power2ge_(a0);
}

// func I4 m$power2le <I4

extern "C" int_4 m$power2le_ (const int_4&);
inline int_4 m_power2le (int_4 a0)
{
  return m$power2le_(a0);
}

// m$pp_acq_time INTERNAL
// m$pp_break INTERNAL
// m$pp_check_sync INTERNAL

// func I4 m$pp_close <I4

extern "C" int_4 m$pp_close_ (const int_4&);
inline int_4 m_pp_close (int_4 a0)
{
  return m$pp_close_(a0);
}

// func I4 m$pp_delay <I4 <I4

extern "C" int_4 m$pp_delay_ (const int_4&, const int_4&);
inline int_4 m_pp_delay (int_4 a0, int_4 a1)
{
  return m$pp_delay_(a0, a1);
}

// func I4 m$pp_dump <I4 >A66

extern "C" int_4 m$pp_dump_ (const int_4&, char[], midas::fstring_len_t);
inline int_4 m_pp_dump (int_4 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(66);
  int_4 rtnval = m$pp_dump_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$pp_go <I4

extern "C" int_4 m$pp_go_ (const int_4&);
inline int_4 m_pp_go (int_4 a0)
{
  return m$pp_go_(a0);
}

// m$pp_id INTERNAL
// m$pp_init_sync INTERNAL
// m$pp_last_time INTERNAL

// func I4 m$pp_macro <I4 <A <I4 <I4 <I4

extern "C" int_4 m$pp_macro_ (const int_4&, const char[], const int_4&, const int_4&, const int_4&, midas::fstring_len_t);
inline int_4 m_pp_macro (int_4 a0, const std::string& a1, int_4 a2, int_4 a3, int_4 a4)
{
  return m$pp_macro_(a0, a1.data(), a2, a3, a4, a1.length());
}

// func I4 m$pp_macro_form >A66 <A <I4 <I4 <I4

extern "C" int_4 m$pp_macro_form_ (char[], const char[], const int_4&, const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_pp_macro_form (fstring_buf a0, const std::string& a1, int_4 a2, int_4 a3, int_4 a4)
{
  if (!a0.buf) a0.allocate(66);
  int_4 rtnval = m$pp_macro_form_(a0.buf, a1.data(), a2, a3, a4, a0.nchar, a1.length());
  a0.flush();
  return rtnval;
}

// func I4 m$pp_macro_send <I4 <A66

extern "C" int_4 m$pp_macro_send_ (const int_4&, const char[], midas::fstring_len_t);
inline int_4 m_pp_macro_send (int_4 a0, const std::string& a1)
{
  return m$pp_macro_send_(a0, a1.data(), a1.length());
}

// m$pp_macro_send_old INTERNAL

// func I4 m$pp_open >I4 <A

extern "C" int_4 m$pp_open_ (int_4&, const char[], midas::fstring_len_t);
inline int_4 m_pp_open (int_4& a0, const std::string& a1)
{
  return m$pp_open_(a0, a1.data(), a1.length());
}

// func I4 m$pp_port_name >header <A >A

extern "C" int_4 m$pp_port_name_ (HEADER&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_pp_port_name (HEADER& a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$pp_port_name_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// m$pp_queue INTERNAL

// func I4 m$pp_reboot <I4

extern "C" int_4 m$pp_reboot_ (const int_4&);
inline int_4 m_pp_reboot (int_4 a0)
{
  return m$pp_reboot_(a0);
}

// m$pp_reboot_old INTERNAL

// sub m$pp_sam_set_sync <I4

extern "C" void m$pp_sam_set_sync_ (const int_4&);
inline void m_pp_sam_set_sync (int_4 a0)
{
  m$pp_sam_set_sync_(a0);
}

// sub m$pp_sam_sync >I4 >I4 >I4

extern "C" void m$pp_sam_sync_ (int_4&, int_4&, int_4&);
inline void m_pp_sam_sync (int_4& a0, int_4& a1, int_4& a2)
{
  m$pp_sam_sync_(a0, a1, a2);
}

// func I4 m$pp_send <I4 <A >A

extern "C" int_4 m$pp_send_ (const int_4&, const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_pp_send (int_4 a0, const std::string& a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$pp_send_(a0, a1.data(), a2.buf, a1.length(), a2.nchar);
  a2.flush();
  return rtnval;
}

// sub m$pp_set_pp_done

extern "C" void m$pp_set_pp_done_ ();
inline void m_pp_set_pp_done ()
{
  m$pp_set_pp_done_();
}

// sub m$pp_setup_pps <header <A >I4 <A >I4 <A >I4 <I4 <I4 <I4 <I4 <A <A <L4 <L4 <m_ptr <I4

extern "C" void m$pp_setup_pps_ (const HEADER&, const char[], int_4&, const char[], int_4&, const char[], int_4&, const int_4&, const int_4&, const int_4&, const int_4&, const char[], const char[], const bool_4&, const bool_4&, const M_PTR&, const int_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline void m_pp_setup_pps (const HEADER& a0, const std::string& a1, int_4& a2, const std::string& a3, int_4& a4, const std::string& a5, int_4& a6, int_4 a7, int_4 a8, int_4 a9, int_4 a10, const std::string& a11, const std::string& a12, bool_4 a13, bool_4 a14, const void* a15, int_4 a16)
{
  M_PTR a15mptr; a15mptr.p = reinterpret_cast<unsigned long>(a15);
  m$pp_setup_pps_(a0, a1.data(), a2, a3.data(), a4, a5.data(), a6, a7, a8, a9, a10, a11.data(), a12.data(), a13, a14, a15mptr, a16, a1.length(), a3.length(), a5.length(), a11.length(), a12.length());
}

// m$pp_skip INTERNAL

// func I4 m$pp_stop <I4

extern "C" int_4 m$pp_stop_ (const int_4&);
inline int_4 m_pp_stop (int_4 a0)
{
  return m$pp_stop_(a0);
}

// sub m$pp_stop_pp

extern "C" void m$pp_stop_pp_ ();
inline void m_pp_stop_pp ()
{
  m$pp_stop_pp_();
}

// func I4 m$pp_stop_stat <I4 >I4 >I4 >I4

extern "C" int_4 m$pp_stop_stat_ (const int_4&, int_4&, int_4&, int_4&);
inline int_4 m_pp_stop_stat (int_4 a0, int_4& a1, int_4& a2, int_4& a3)
{
  return m$pp_stop_stat_(a0, a1, a2, a3);
}

// func I4 m$pp_sync <I4 <* >* <I4

extern "C" int_4 m$pp_sync_ (const int_4&, const void*, void*, const int_4&);
inline int_4 m_pp_sync (int_4 a0, const void* a1, void* a2, int_4 a3)
{
  return m$pp_sync_(a0, a1, a2, a3);
}

// m$pp_tc_trigger INTERNAL

// func I4 m$pp_wait <I4 <I4

extern "C" int_4 m$pp_wait_ (const int_4&, const int_4&);
inline int_4 m_pp_wait (int_4 a0, int_4 a1)
{
  return m$pp_wait_(a0, a1);
}

// m$pp_write_sync INTERNAL

// func L4 m$ppick <I4

extern "C" bool_4 m$ppick_ (const int_4&);
inline bool_4 m_ppick (int_4 a0)
{
  return m$ppick_(a0);
}

// m$pread INTERNAL

// sub m$prep_pkt >header <pks >pkdstruct <I4 <I4

extern "C" void m$prep_pkt_ (HEADER&, const PKS&, PKDSTRUCT&, const int_4&, const int_4&);
inline void m_prep_pkt (HEADER& a0, const PKS& a1, PKDSTRUCT& a2, int_4 a3, int_4 a4)
{
  m$prep_pkt_(a0, a1, a2, a3, a4);
}

// sub m$presync <I4

extern "C" void m$presync_ (const int_4&);
inline void m_presync (int_4 a0)
{
  m$presync_(a0);
}

// m$print_ds_structs INTERNAL ! DS support not yet implemented

// XM4x/C++  CXXfunc A2 m$promote_format <A2 <A2 <A
// XBC          func A2 m$promote_format <A2 <A2 <A
extern "C" void m$promote_format_ (char*, midas::fstring_len_t, const char[], const char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline std::string m_promote_format (const std::string& a0, const std::string& a1, const std::string& a2)
{
  fstring<2> rtnval;
  m$promote_format_(rtnval.buf, 2, a0.data(), a1.data(), a2.data(), a0.length(), a1.length(), a2.length());
  return rtnval;
}

// XM4x/C++  CXXfunc A1 m$promote_type <A1 <A1
// XBC          func A1 m$promote_type <A1 <A1
extern "C" void m$promote_type_ (char*, midas::fstring_len_t, const char&, const char&, midas::fstring_len_t, midas::fstring_len_t);
inline char m_promote_type (char a0, char a1)
{
  char rtnval;
  m$promote_type_(&rtnval, 1, a0, a1, 1, 1);
  return rtnval;
}

// XM4x/C++  CXXfunc A1 m$promote_type3 <A1 <A1 <A
// XBC          func A1 m$promote_type3 <A1 <A1 <A
extern "C" void m$promote_type3_ (char*, midas::fstring_len_t, const char&, const char&, const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline char m_promote_type3 (char a0, char a1, const std::string& a2)
{
  char rtnval;
  m$promote_type3_(&rtnval, 1, a0, a1, a2.data(), 1, 1, a2.length());
  return rtnval;
}

// sub m$propagate <header >header

extern "C" void m$propagate_ (const HEADER&, HEADER&);
inline void m_propagate (const HEADER& a0, HEADER& a1)
{
  m$propagate_(a0, a1);
}

// sub m$prop_except >header

extern "C" void m$prop_except_ (HEADER&);
inline void m_prop_except (HEADER& a0)
{
  m$prop_except_(a0);
}

// m$purge_socket INTERNAL
// m$push_macro_stack INTERNAL

// sub m$put_epoch >header <R8 <R8 <L4

extern "C" void m$put_epoch_ (HEADER&, const real_8&, const real_8&, const bool_4&);
inline void m_put_epoch (HEADER& a0, real_8 a1, real_8 a2, bool_4 a3)
{
  m$put_epoch_(a0, a1, a2, a3);
}

// CXXsub m$put_history <A  INTERNAL
// void m_put_history (const std::string&);

// func I4 m$put_keydata >header >A >* <I4 <I4 <A1

extern "C" int_4 m$put_keydata_ (HEADER&, char[], void*, const int_4&, const int_4&, const char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_put_keydata (HEADER& a0, fstring_buf a1, void* a2, int_4 a3, int_4 a4, char a5)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$put_keydata_(a0, a1.buf, a2, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  return rtnval;
}

// func I4 m$put_keyword >header <A <A

extern "C" int_4 m$put_keyword_ (HEADER&, const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_put_keyword (HEADER& a0, const std::string& a1, const std::string& a2)
{
  return m$put_keyword_(a0, a1.data(), a2.data(), a1.length(), a2.length());
}

// func I4 m$put_result <A <* <I4 <I4 <A1 <I4

extern "C" int_4 m$put_result_ (const char[], const void*, const int_4&, const int_4&, const char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_put_result (const std::string& a0, const void* a1, int_4 a2, int_4 a3, char a4, int_4 a5)
{
  return m$put_result_(a0.data(), a1, a2, a3, a4, a5, a0.length(), 1);
}

// sub m$put_t6subrecord >header <I4 <t6subr_struct
// NTN not supported in XBC
//extern "C" void m$put_t6subrecord_ (HEADER&, const int_4&, const T6SUBR_STRUCT&);
//inline void m_put_t6subrecord (HEADER& a0, int_4 a1, const T6SUBR_STRUCT& a2)
//{
//  m$put_t6subrecord_(a0, a1, a2);
//}

// m$putenv INTERNAL

// func I4 m$qpick >A

extern "C" int_4 m$qpick_ (char[], midas::fstring_len_t);
inline int_4 m_qpick (fstring_buf a0)
{
  if (!a0.buf) a0.allocate(256);
  int_4 rtnval = m$qpick_(a0.buf, a0.nchar);
  a0.flush();
  return rtnval;
}

// func I4 m$range <A >A <I4 <I4

extern "C" int_4 m$range_ (const char[], char[], const int_4&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_range (const std::string& a0, fstring_buf a1, int_4 a2, int_4 a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$range_(a0.data(), a1.buf, a2, a3, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$rassign DEPRECATED use m_str2result()

// func I4 m$rattr_mask2str <I4 >A

extern "C" int_4 m$rattr_mask2str_ (const int_4&, char[], midas::fstring_len_t);
inline int_4 m_rattr_mask2str (int_4 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$rattr_mask2str_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$rattr_str2mask <A >I4

extern "C" int_4 m$rattr_str2mask_ (const char[], int_4&, midas::fstring_len_t);
inline int_4 m_rattr_str2mask (const std::string& a0, int_4& a1)
{
  return m$rattr_str2mask_(a0.data(), a1, a0.length());
}

// func I4 m$rattributes <A <I4 <I4

extern "C" int_4 m$rattributes_ (const char[], const int_4&, const int_4&, midas::fstring_len_t);
inline int_4 m_rattributes (const std::string& a0, int_4 a1, int_4 a2)
{
  return m$rattributes_(a0.data(), a1, a2, a0.length());
}

// sub m$rcast <A1 <A <R8

extern "C" void m$rcast_ (const char&, const char[], const real_8&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_rcast (char a0, const std::string& a1, real_8 a2)
{
  m$rcast_(a0, a1.data(), a2, 1, a1.length());
}

// m$rcompact INTERNAL
// m$rconfig INTERNAL
// m$rdel DEPRECATED use m_del_result()

// func A1 m$rdisp <A <I4

#if _PFC
extern "C" char* m$rdisp_ (const char[], const int_4&, midas::fstring_len_t);
inline char m_rdisp (const std::string& a0, int_4 a1)
{
  return *m$rdisp_(a0.data(), a1, a0.length());
}
#else
extern "C" void m$rdisp_ (char*, midas::fstring_len_t, const char[], const int_4&, midas::fstring_len_t);
inline char m_rdisp (const std::string& a0, int_4 a1)
{
  char rtnval;
  m$rdisp_(&rtnval, 1, a0.data(), a1, a0.length());
  return rtnval;
}
#endif

// m$read_offset INTERNAL

// cfunc I4 m$read_socket <I4 >* <I4

extern "C" int_4 m_read_socket (int_4, void*, int_4);

// m$read_term INTERNAL

// XM4x/C++  CXXfunc I4 m$recast <* <A1 <I4 >* >A1 <I4
// XBC          func I4 m$recast <* <A1 <I4 >* >A1 <I4
extern "C" int_4 m$recast_ (const void*, const char&, const int_4&, void *, char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_recast (const void* a0, char a1, int_4 a2, void* a3, char& a4, int_4 a5)
{
  int_4 rtnval = m$recast_(a0, a1, a2, a3, a4, a5, 1, 1);
  return rtnval;
}

// XM4x/C++  CXXsub m$reformat <* <A2 >* <A1 <I4
// XBC          sub m$reformat <* <A2 >* <A1 <I4
extern "C" void m$reformat_ (const void*, const char[], void*, const char&, const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_reformat (const void* a0, const std::string& a1, void* a2, char a3, int_4 a4)
{
  m$reformat_(a0, a1.data(), a2, a3, a4, a1.length(), 1);
}

// m$reformat_off INTERNAL
// m$register_cleanup_func INTERNAL
// m$register_macro INTERNAL
// m$register_pipe INTERNAL
// m$register_xcall INTERNAL
// m$register_xcontrol INTERNAL

// sub m$remalloc <I4 >m_ptr

extern "C" void m$remalloc_ (const int_4&, M_PTR&);
inline void m_remalloc (int_4 a0, void*& a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$remalloc_(a0, a1mptr);
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

// sub m$remalloc64 <I8 >m_ptr

extern "C" void m$remalloc64_ (const int_8&, M_PTR&);
inline void m_remalloc64 (int_8 a0, void*& a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$remalloc64_(a0, a1mptr);
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

// func I4 m$remote_name <A >A <I4 >I4

extern "C" int_4 m$remote_name_ (const char[], char[], const int_4&, int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_remote_name (const std::string& a0, fstring_buf a1, int_4 a2, int_4& a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$remote_name_(a0.data(), a1.buf, a2, a3, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$rename >A >A

extern "C" int_4 m$rename_ (char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_rename (fstring_buf a0, fstring_buf a1)
{
  if (!a0.buf) a0.allocate(256);
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$rename_(a0.buf, a1.buf, a0.nchar, a1.nchar);
  a0.flush();
  a1.flush();
  return rtnval;
}

// func I4 m$repl_keyword >header <A <A

extern "C" int_4 m$repl_keyword_ (HEADER&, const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_repl_keyword (HEADER& a0, const std::string& a1, const std::string& a2)
{
  return m$repl_keyword_(a0, a1.data(), a2.data(), a1.length(), a2.length());
}

// m$reset INTERNAL
// m$resget INTERNAL
// m$resput INTERNAL
// m$return INTERNAL

// XM4x/C++  CXXsub m$retype <* <I4 >* <I4 <I4
// XBC          sub m$retype <* <I4 >* <I4 <I4
extern "C" void m$retype_ (const void*, const int_4&, void*, const int_4&, const int_4&);
inline void m_retype (const void* a0, int_4 a1, void* a2, int_4 a3, int_4 a4)
{
  m$retype_(a0, a1, a2, a3, a4);
}

// sub m$rfft >1d-R4 <I4 <I4

extern "C" void m$rfft_ (real_4[], const int_4&, const int_4&);
inline void m_rfft (real_4 a0[], int_4 a1, int_4 a2)
{
  m$rfft_(a0, a1, a2);
}

// m$rfftm INTERNAL

// XM4x/C      Cfunc I4 m$rfilter <A >A >A1 >U1[>I4] >* <I4 >U4[>I4]
// XBC          func I4 m$rfilter <A >A >A1 >U1[>I4] >* <I4 >U4[>I4] (not implemented)
extern "C" int_4 m$rfilter_ (const char [], char[], const char&, int_4&, void*, const int_4&, int_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_rfilter (const std::string& a0, fstring_buf a1, char& a2, int_u1& a3, void* a4, int_4 a5, int_u4& a6)
{
  if (!a1.buf) a1.allocate(256);
  int_4 p3 = a3, p6 = a6; // special cast for int_u1 (C++) to int_4 (Fortran) for 4th arg (attrmask) and 7th arg (offset)
  int_4 rtnval = m$rfilter_(a0.data(), a1.buf, a2, p3, a4, a5, p6, a0.length(), a1.nchar, 1);
  a3 = p3; a6 = p6;       // copy results of p3 and p6 back into a3 and a6, respectively
  a1.flush();
  return rtnval;
}

// func A1 m$rfind <A >A >R8

#if _PFC
extern "C" char* m$rfind_ (const char[], char[], real_8&, midas::fstring_len_t, midas::fstring_len_t);
inline char m_rfind (const std::string& a0, fstring_buf a1, real_8& a2)
{
  if (!a1.buf) a1.allocate(256);
  const char* rtnval = m$rfind_(a0.data(), a1.buf, a2, a0.length(), a1.nchar);
  a1.flush();
  return *rtnval;
}
#else
extern "C" void m$rfind_ (char*, midas::fstring_len_t, const char[], char[], real_8&, midas::fstring_len_t, midas::fstring_len_t);
inline char m_rfind (const std::string& a0, fstring_buf a1, real_8& a2)
{
  char rtnval;
  if (!a1.buf) a1.allocate(256);
  m$rfind_(&rtnval, 1, a0.data(), a1.buf, a2, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}
#endif

// m$rget DEPRECATED use m_get_result()

// func L4 m$rgood <A >A1 >I4 >I4

extern "C" bool_4 m$rgood_ (const char[], char&, int_4&, int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline bool_4 m_rgood (const std::string& a0, char& a1, int_4& a2, int_4& a3)
{
  return m$rgood_(a0.data(), a1, a2, a3, a0.length(), 1);
}

// m$rinit INTERNAL
// m$rmap INTERNAL
// m$rmark_mlevel INTERNAL
// m$rmark_smlevel INTERNAL
// m$rmarked_mlevel INTERNAL
// m$rnext INTERNAL

// func I4 m$root <A >A

extern "C" int_4 m$root_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_root (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$root_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$rput DEPRECATED use m_put_result()
// m$run_bg INTERNAL
// m$run_ds INTERNAL
// m$run_dsef INTERNAL

// sub m$run_dsm <I4

extern "C" void m$run_dsm_ (const int_4&);
inline void m_run_dsm (int_4 a0)
{
  m$run_dsm_(a0);
}

// m$run_intrinsic INTERNAL
// m$run_macro INTERNAL
// m$run_os INTERNAL
// m$run_primitive INTERNAL
// m$run_remote INTERNAL

// XM4x/C++  CXXsub m$save_history
// XBC          sub m$save_history
extern "C" void m$save_history_ ();
inline void m_save_history ()
{
  m$save_history_();
}

// func I4 m$scope_keyword >header <A

extern "C" int_4 m$scope_keyword_ (HEADER&, const char[], midas::fstring_len_t);
inline int_4 m_scope_keyword (HEADER& a0, const std::string& a1)
{
  return m$scope_keyword_(a0, a1.data(), a1.length());
}

// func I4 m$scope_keyword_quiet >header <A

extern "C" int_4 m$scope_keyword_quiet_ (HEADER&, const char[], midas::fstring_len_t);
inline int_4 m_scope_keyword_quiet (HEADER& a0, const std::string& a1)
{
  return m$scope_keyword_quiet_(a0, a1.data(), a1.length());
}

// XM4x/C++  CXXfunc I4 m$search <A <A
// XBC          func I4 m$search <A <A
extern "C" int_4 m$search_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_search (const std::string& a0, const std::string& a1)
{
  int_4 rtnval = m$search_(a0.data(), a1.data(), a0.length(), a1.length());
  return rtnval;
}

// XM4x/C++  CXXfunc I4 m$searchb <A <A
// XBC          func I4 m$searchb <A <A
extern "C" int_4 m$searchb_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_searchb (const std::string& a0, const std::string& a1)
{
  int_4 rtnval = m$searchb_(a0.data(), a1.data(), a0.length(), a1.length());
  return rtnval;
}

// func I4 m$sec2tod <R8 >A

extern "C" int_4 m$sec2tod_ (const real_8&, char[], midas::fstring_len_t);
inline int_4 m_sec2tod (real_8 a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$sec2tod_(a0, a1.buf, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$sec2tspec <R8 >A <I4

extern "C" int_4 m$sec2tspec_ (const real_8&, char[], const int_4&, midas::fstring_len_t);
inline int_4 m_sec2tspec (real_8 a0, fstring_buf a1, int_4 a2)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$sec2tspec_(a0, a1.buf, a2, a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$secnds <R4 >R4

extern "C" void m$secnds_ (const real_4&, real_4&);
inline void m_secnds (real_4 a0, real_4& a1)
{
  m$secnds_(a0, a1);
}

// sub m$seek >header <R8

extern "C" void m$seek_ (HEADER&, const real_8&);
inline void m_seek (HEADER& a0, real_8 a1)
{
  m$seek_(a0, a1);
}

// m$send_message DEPRECATED use m_send_msgl() or m_send_msg()

// sub m$send_msg >mq_header <* <I4 <I4

extern "C" void m$send_msg_ (MQ_HEADER&, const void*, const int_4&, const int_4&);
inline void m_send_msg (MQ_HEADER& a0, const void* a1, int_4 a2, int_4 a3)
{
  m$send_msg_(a0, a1, a2, a3);
}

// func I4 m$send_msge >mq_header <* <I4 <I4 <I4 <R4 <I4

extern "C" int_4 m$send_msge_ (MQ_HEADER&, const void*, const int_4&, const int_4&, const int_4&, const real_4&, const int_4&);
inline int_4 m_send_msge (MQ_HEADER& a0, const void* a1, int_4 a2, int_4 a3, int_4 a4, real_4 a5, int_4 a6)
{
  return m$send_msge_(a0, a1, a2, a3, a4, a5, a6);
}

// sub m$send_msgl <A8 <I4 <I4 <I4 <I4 <I4 <A <* <I4

extern "C" 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&, midas::fstring_len_t, midas::fstring_len_t);
inline void m_send_msgl (const std::string& a0, int_4 a1, int_4 a2, int_4 a3, int_4 a4, int_4 a5, const std::string& a6, const void* a7, int_4 a8)
{
  m$send_msgl_(a0.data(), a1, a2, a3, a4, a5, a6.data(), a7, a8, a0.length(), a6.length());
}

// sub m$send_pkt >header <pks >pkdstruct <I4 <I4

extern "C" void m$send_pkt_ (HEADER&, const PKS&, PKDSTRUCT&, const int_4&, const int_4&);
inline void m_send_pkt (HEADER& a0, const PKS& a1, PKDSTRUCT& a2, int_4 a3, int_4 a4)
{
  m$send_pkt_(a0, a1, a2, a3, a4);
}

// cfunc I4 m$set_linger <I4 <I4 <I4

extern "C" int_4 m_set_linger (int_4, int_4, int_4);

// csub m$set_pause_time <R4

extern "C" void m_set_pause_time (real_4);

// csub m$set_reuseaddr <I4

extern "C" void m_set_reuseaddr (int_4);

// m$setpgid INTERNAL
// m$setpriority INTERNAL
// m$shell INTERNAL
// m$shell_run INTERNAL

// sub m$shove >header >* <R8 <I4 >I4

extern "C" void m$shove_ (HEADER&, void*, const real_8&, const int_4&, int_4&);
inline void m_shove (HEADER& a0, void* a1, real_8 a2, int_4 a3, int_4& a4)
{
  m$shove_(a0, a1, a2, a3, a4);
}

// sub m$shovex >header >* <I4

extern "C" void m$shovex_ (HEADER&, void*, const int_4&);
inline void m_shovex (HEADER& a0, void* a1, int_4 a2)
{
  m$shovex_(a0, a1, a2);
}

// sub m$show_timer >A

extern "C" void m$show_timer_ (char[], midas::fstring_len_t);
inline void m_show_timer (fstring_buf a0)
{
  if (!a0.buf) a0.allocate(256);
  m$show_timer_(a0.buf, a0.nchar);
  a0.flush();
}

// csub m$socket_check_break <I4

extern "C" void m_socket_check_break (int_4);

// XM4x/C++  CXXfunc I4 m$spa <A2
// XBC          func I4 m$spa <A2
extern "C" int_4 m$spa_ (const char[], midas::fstring_len_t);
inline int_4 m_spa (const std::string& a0)
{
  int_4 rtnval = m$spa_(a0.data(), a0.length());
  return rtnval;
}

// sub m$spawn <I4

extern "C" void m$spawn_ (const int_4&);
inline void m_spawn (int_4 a0)
{
  m$spawn_(a0);
}

// sub m$sph_to_car >1d-R8 <I4 <I4

extern "C" void m$sph_to_car_ (real_8[], const int_4&, const int_4&);
inline void m_sph_to_car (real_8 a0[], int_4 a1, int_4 a2)
{
  m$sph_to_car_(a0, a1, a2);
}

// func L4 m$spick <I4

extern "C" bool_4 m$spick_ (const int_4&);
inline bool_4 m_spick (int_4 a0)
{
  return m$spick_(a0);
}

// func L4 m$startswith <A <A
extern "C" int_4 m$startswith_ (const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline bool_4 m_startswith (const std::string& a0, const std::string& a1)
{
  return m$startswith_(a0.data(), a1.data(), a0.length(), a1.length());
}

// sub m$stmalloc <I4 >m_ptr

extern "C" void m$stmalloc_ (const int_4&, M_PTR&);
inline void m_stmalloc (int_4 a0, void*& a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$stmalloc_(a0, a1mptr);
  a1 = reinterpret_cast<void*>(static_cast<unsigned long>(a1mptr.p));
}

// sub m$stmfree <I4 <m_ptr

extern "C" void m$stmfree_ (const int_4&, const M_PTR&);
inline void m_stmfree (int_4 a0, const void* a1)
{
  M_PTR a1mptr; a1mptr.p = reinterpret_cast<unsigned long>(a1);
  m$stmfree_(a0, a1mptr);
}

// func I4 m$str2result <A <A <I4

extern "C" int_4 m$str2result_ (const char[], const char[], const int_4&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_str2result (const std::string& a0, const std::string& a1, int_4 a2)
{
  return m$str2result_(a0.data(), a1.data(), a2, a0.length(), a1.length());
}

// func I4 m$strim <A >A

extern "C" int_4 m$strim_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_strim (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$strim_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// m$strpack INTERNAL
// m$strparse INTERNAL

// sub m$stype <A1

extern "C" void m$stype_ (const char&, midas::fstring_len_t);
inline void m_stype (char a0)
{
  m$stype_(a0, 1);
}

// sub m$stypeq >A1

extern "C" void m$stypeq_ (char&, midas::fstring_len_t);
inline void m_stypeq (char& a0)
{
  m$stypeq_(a0, 1);
}

// func I4 m$subs <A >A <A <A

extern "C" int_4 m$subs_ (const char[], char[], const char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_subs (const std::string& a0, fstring_buf a1, const std::string& a2, const std::string& a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$subs_(a0.data(), a1.buf, a2.data(), a3.data(), a0.length(), a1.nchar, a2.length(), a3.length());
  a1.flush();
  return rtnval;
}

// func I4 m$subsl <A <I4 >A <A <I4 <A <I4

extern "C" int_4 m$subsl_ (const char[], const int_4&, char[], const char[], const int_4&, const char[], const int_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_subsl (const std::string& a0, int_4 a1, fstring_buf a2, const std::string& a3, int_4 a4, const std::string& a5, int_4 a6)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$subsl_(a0.data(), a1, a2.buf, a3.data(), a4, a5.data(), a6, a0.length(), a2.nchar, a3.length(), a5.length());
  a2.flush();
  return rtnval;
}

// func I4 m$sub_find <header <A4

extern "C" int_4 m$sub_find_ (const HEADER&, const char[], midas::fstring_len_t);
inline int_4 m_sub_find (const HEADER& a0, const std::string& a1)
{
  return m$sub_find_(a0, a1.data(), a1.length());
}

// func A2 m$sub_format <header <I4

#if _PFC
extern "C" char* m$sub_format_ (const HEADER&, const int_4&);
inline std::string m_sub_format (const HEADER& a0, int_4 a1)
{
  const char* rtnval = m$sub_format_(a0, a1);
  return strf2cpp(rtnval, 2);
}
#else
extern "C" void m$sub_format_ (char*, midas::fstring_len_t, const HEADER&, const int_4&);
inline std::string m_sub_format (const HEADER& a0, int_4 a1)
{
  fstring<2> rtnval;
  m$sub_format_(rtnval.buf, 2, a0, a1);
  return rtnval;
}
#endif

// func A24 m$sub_name <header <I4

#if _PFC
extern "C" char* m$sub_name_ (const HEADER&, const int_4&);
inline std::string m_sub_name (const HEADER& a0, int_4 a1)
{
  const char* rtnval = m$sub_name_(a0, a1);
  return strf2cpp(rtnval, 24);
}
#else
extern "C" void m$sub_name_ (char*, midas::fstring_len_t, const HEADER&, const int_4&);
inline std::string m_sub_name (const HEADER& a0, int_4 a1)
{
  fstring<24> rtnval;
  m$sub_name_(rtnval.buf, 24, a0, a1);
  return rtnval;
}
#endif

// func I4 m$sub_offset <header <I4

extern "C" int_4 m$sub_offset_ (const HEADER&, const int_4&);
inline int_4 m_sub_offset (const HEADER& a0, int_4 a1)
{
  return m$sub_offset_(a0, a1);
}

// m$suspendmode INTERNAL

// sub m$sync

extern "C" void m$sync_ ();
inline void m_sync ()
{
  m$sync_();
}

// sub m$syscon <A

extern "C" void m$syscon_ (const char[], midas::fstring_len_t);
inline void m_syscon (const std::string& a0)
{
  m$syscon_(a0.data(), a0.length());
}

// sub m$system <A <I4 <1d-I4

extern "C" void m$system_ (const char[], const int_4&, const int_4[], midas::fstring_len_t);
inline void m_system (const std::string& a0, int_4 a1, const int_4 a2[])
{
  m$system_(a0.data(), a1, a2, a0.length());
}

// func I4 m$tail <A >A

extern "C" int_4 m$tail_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_tail (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$tail_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// sub m$talign >header >header >R8 >R8 >R8

extern "C" void m$talign_ (HEADER&, HEADER&, real_8&, real_8&, real_8&);
inline void m_talign (HEADER& a0, HEADER& a1, real_8& a2, real_8& a3, real_8& a4)
{
  m$talign_(a0, a1, a2, a3, a4);
}

// XM4x/C++  CXXfunc A2 m$test_format <A <A
// XBC          func A2 m$test_format <A <A
extern "C" void m$test_format_ (char*, midas::fstring_len_t, const char[], const char[], midas::fstring_len_t, midas::fstring_len_t);
inline std::string m_test_format (const std::string& a0, const std::string& a1)
{
  fstring<2> rtnval;
  m$test_format_(rtnval.buf, 2, a0.data(), a1.data(), a0.length(), a1.length());
  return rtnval;
}

// func I4 m$time_format <A <A1 >A >R8 >R8 <L4

extern "C" int_4 m$time_format_ (const char[], const char&, char[], real_8&, real_8&, const bool_4&, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_time_format (const std::string& a0, char a1, fstring_buf a2, real_8& a3, real_8& a4, bool_4 a5)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$time_format_(a0.data(), a1, a2.buf, a3, a4, a5, a0.length(), 1, a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$times2str <R8 <R8 <A1 >A

extern "C" int_4 m$times2str_ (const real_8&, const real_8&, const char&, char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_times2str (real_8 a0, real_8 a1, char a2, fstring_buf a3)
{
  if (!a3.buf) a3.allocate(256);
  int_4 rtnval = m$times2str_(a0, a1, a2, a3.buf, 1, a3.nchar);
  a3.flush();
  return rtnval;
}

// func I4 m$times2tod <R8 <R8 >A

extern "C" int_4 m$times2tod_ (const real_8&, const real_8&, char[], midas::fstring_len_t);
inline int_4 m_times2tod (real_8 a0, real_8 a1, fstring_buf a2)
{
  if (!a2.buf) a2.allocate(256);
  int_4 rtnval = m$times2tod_(a0, a1, a2.buf, a2.nchar);
  a2.flush();
  return rtnval;
}

// func I4 m$tod2sec <A >R8

extern "C" int_4 m$tod2sec_ (const char[], real_8&, midas::fstring_len_t);
inline int_4 m_tod2sec (const std::string& a0, real_8& a1)
{
  return m$tod2sec_(a0.data(), a1, a0.length());
}

// func I4 m$tod2times <A >R8 >R8

extern "C" int_4 m$tod2times_ (const char[], real_8&, real_8&, midas::fstring_len_t);
inline int_4 m_tod2times (const std::string& a0, real_8& a1, real_8& a2)
{
  return m$tod2times_(a0.data(), a1, a2, a0.length());
}

// sub m$todo <R8

extern "C" void m$todo_ (const real_8&);
inline void m_todo (real_8 a0)
{
  m$todo_(a0);
}

// sub m$top_to_ecr >1d-R8 <I4 <I4 <1d-R8

extern "C" void m$top_to_ecr_ (real_8[], const int_4&, const int_4&, const real_8[]);
inline void m_top_to_ecr (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[])
{
  m$top_to_ecr_(a0, a1, a2, a3);
}

// sub m$top_to_top >1d-R8 <I4 <I4 <1d-R8 <1d-R8

extern "C" void m$top_to_top_ (real_8[], const int_4&, const int_4&, const real_8[], const real_8[]);
inline void m_top_to_top (real_8 a0[], int_4 a1, int_4 a2, const real_8 a3[], const real_8 a4[])
{
  m$top_to_top_(a0, a1, a2, a3, a4);
}

// func I4 m$tpick <I4 >R8 >R8

extern "C" int_4 m$tpick_ (const int_4&, real_8&, real_8&);
inline int_4 m_tpick (int_4 a0, real_8& a1, real_8& a2)
{
  return m$tpick_(a0, a1, a2);
}

// sub m$transfer <* <* <* >* <I4 <I4

extern "C" void m$transfer_ (const void*, const void*, const void*, void*, const int_4&, const int_4&);
inline void m_transfer (const void* a0, const void* a1, const void* a2, void* a3, int_4 a4, int_4 a5)
{
  m$transfer_(a0, a1, a2, a3, a4, a5);
}

// sub m$transform >header <A <A <A <A

extern "C" void m$transform_ (HEADER&, const char[], const char[], const char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline void m_transform (HEADER& a0, const std::string& a1, const std::string& a2, const std::string& a3, const std::string& a4)
{
  m$transform_(a0, a1.data(), a2.data(), a3.data(), a4.data(), a1.length(), a2.length(), a3.length(), a4.length());
}

// m$trim INTERNAL

// func I4 m$trims <A >A <A <A

extern "C" int_4 m$trims_ (const char[], char[], const char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_trims (const std::string& a0, fstring_buf a1, const std::string& a2, const std::string& a3)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$trims_(a0.data(), a1.buf, a2.data(), a3.data(), a0.length(), a1.nchar, a2.length(), a3.length());
  a1.flush();
  return rtnval;
}

// func I4 m$trim_quotes <A >A

extern "C" int_4 m$trim_quotes_ (const char[], char[], midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_trim_quotes (const std::string& a0, fstring_buf a1)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$trim_quotes_(a0.data(), a1.buf, a0.length(), a1.nchar);
  a1.flush();
  return rtnval;
}

// XM4x/C++  CXXsub m$trslt <A <R8 <R8
// XBC          sub m$trslt <A <R8 <R8
extern "C" void m$trslt_ (const char[], const real_8&, const real_8&, midas::fstring_len_t);
inline void m_trslt (const std::string& a0, real_8 a1, real_8 a2)
{
  m$trslt_(a0.data(), a1, a2, a0.length());
}

// XM4x/C++  CXXfunc I4 m$type <A
// XBC          func I4 m$type <A
extern "C" int_4 m$type_ (const char[], midas::fstring_len_t);
inline int_4 m_type (const std::string& a0)
{
  int_4 rtnval = m$type_(a0.data(), a0.length());
  return rtnval;
}

// func I4 m$uapick <I4 >A <I4

extern "C" int_4 m$uapick_ (const int_4&, char[], const int_4&, midas::fstring_len_t);
inline int_4 m_uapick (int_4 a0, fstring_buf a1, int_4 a2)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$uapick_(a0, a1.buf, a2, a1.nchar);
  a1.flush();
  return rtnval;
}

// cfunc I4 m$unblock_server >*[>m_ptr] <I4

extern "C" int_4 m_unblock_server (void*, int_4);

// cfunc I4 m$unblock_socket <I4 <I4

extern "C" int_4 m_unblock_socket (int_4, int_4);

// XM4x/C++  CXXfunc A35 m$units_name <I4
// XBC          func A35 m$units_name <I4
extern "C" void m$units_name_ (char*, midas::fstring_len_t, const int_4&);
inline std::string m_units_name (int_4 a0)
{
  fstring<35> rtnval;
  m$units_name_(rtnval.buf, 35, a0);
  return rtnval;
}

// m$unixexec INTERNAL

// cfunc I4 m$unlock_semaphore <I4

extern "C" int_4 m_unlock_semaphore (int_4);

// csub m$unmap_shm <I4

extern "C" void m_unmap_shm (int_4);

// m$unregister_macro INTERNAL
// m$unregister_pipe INTERNAL
// m$unregister_xcall INTERNAL
// m$unregister_xcontrol INTERNAL

// cfunc I4 m$untangle_sockets <I4 >I4 >I4

extern "C" int_4 m_untangle_sockets (int_4, int_4&, int_4&);

// m$update_ext_header INTERNAL

// sub m$update_header >header

extern "C" void m$update_header_ (HEADER&);
inline void m_update_header (HEADER& a0)
{
  m$update_header_(a0);
}

// sub m$update_t6subrecords >header

extern "C" void m$update_t6subrecords_ (HEADER&);
inline void m_update_t6subrecords (HEADER& a0)
{
  m$update_t6subrecords_(a0);
}

// m$update_xcontrol INTERNAL

// func A(L_max_ascii) m$upick <I4

#if _PFC
extern "C" char* m$upick_ (const int_4&);
inline std::string m_upick (int_4 a0)
{
  const char* rtnval = m$upick_(a0);
  return strf2cpp(rtnval, L_max_ascii);
}
#else
extern "C" void m$upick_ (char*, midas::fstring_len_t, const int_4&);
inline std::string m_upick (int_4 a0)
{
  fstring<L_max_ascii> rtnval;
  m$upick_(rtnval.buf, L_max_ascii, a0);
  return rtnval;
}
#endif

// XM4x/C++  CXXsub m$uppercase >A
// XBC          sub m$uppercase >A
extern "C" void m$uppercase_ (char[], midas::fstring_len_t);
inline void m_uppercase (std::string& a0)
{
  fstring_buf a0b(a0, a0.length());
  m$uppercase_(a0b.buf, a0b.nchar);
  a0b.flush();
}
inline void m_uppercase (fstring_buf a0fbuf)
{
  std::string a0(a0fbuf.str());
  m_uppercase(a0);
  a0fbuf = a0;
}

// sub m$vadd <* <* >* <I4

extern "C" void m$vadd_ (const void*, const void*, void*, const int_4&);
inline void m_vadd (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vadd_(a0, a1, a2, a3);
}

// func I4 m$valid_aux <I4

extern "C" int_4 m$valid_aux_ (const int_4&);
inline int_4 m_valid_aux (int_4 a0)
{
  return m$valid_aux_(a0);
}

// sub m$vblk <* >* <I4 <I4

extern "C" void m$vblk_ (const void*, void*, const int_4&, const int_4&);
inline void m_vblk (const void* a0, void* a1, int_4 a2, int_4 a3)
{
  m$vblk_(a0, a1, a2, a3);
}

// m$vectorlib INTERNAL
// m$vectorlib2 INTERNAL
// m$verify INTERNAL
// m$verror INTERNAL

// sub m$vfill >* <* <I4

extern "C" void m$vfill_ (void*, const void*, const int_4&);
inline void m_vfill (void* a0, const void* a1, int_4 a2)
{
  m$vfill_(a0, a1, a2);
}

// sub m$vinit

extern "C" void m$vinit_ ();
inline void m_vinit ()
{
  m$vinit_();
}

// sub m$vlog10 <* <* >* <I4

extern "C" void m$vlog10_ (const void*, const void*, void*, const int_4&);
inline void m_vlog10 (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vlog10_(a0, a1, a2, a3);
}

// sub m$vmov <* <I4 >* <I4 <I4

extern "C" void m$vmov_ (const void*, const int_4&, void*, const int_4&, const int_4&);
inline void m_vmov (const void* a0, int_4 a1, void* a2, int_4 a3, int_4 a4)
{
  m$vmov_(a0, a1, a2, a3, a4);
}

// sub m$vmovn <* <I4 >* <I4 <I4 <I4

extern "C" void m$vmovn_ (const void*, const int_4&, void*, const int_4&, const int_4&, const int_4&);
inline void m_vmovn (const void* a0, int_4 a1, void* a2, int_4 a3, int_4 a4, int_4 a5)
{
  m$vmovn_(a0, a1, a2, a3, a4, a5);
}

// sub m$vmovnb <* <I4 >* <I4 <I4 <I4

extern "C" void m$vmovnb_ (const void*, const int_4&, void*, const int_4&, const int_4&, const int_4&);
inline void m_vmovnb (const void* a0, int_4 a1, void* a2, int_4 a3, int_4 a4, int_4 a5)
{
  m$vmovnb_(a0, a1, a2, a3, a4, a5);
}

// sub m$vmul <* <* >* <I4

extern "C" void m$vmul_ (const void*, const void*, void*, const int_4&);
inline void m_vmul (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vmul_(a0, a1, a2, a3);
}

// sub m$vmxmn <* >* >* >I4 >I4 <I4

extern "C" void m$vmxmn_ (const void*, void*, void*, int_4&, int_4&, const int_4&);
inline void m_vmxmn (const void* a0, void* a1, void* a2, int_4& a3, int_4& a4, int_4 a5)
{
  m$vmxmn_(a0, a1, a2, a3, a4, a5);
}

// sub m$vnorm <* >* <I4

extern "C" void m$vnorm_ (const void*, void*, const int_4&);
inline void m_vnorm (const void* a0, void* a1, int_4 a2)
{
  m$vnorm_(a0, a1, a2);
}

// func A1 m$vpromote <A1 <A1

#if _PFC
extern "C" char* m$vpromote_ (const char&, const char&, midas::fstring_len_t, midas::fstring_len_t);
inline char m_vpromote (char a0, char a1)
{
  return *m$vpromote_(a0, a1, 1, 1);
}
#else
extern "C" void m$vpromote_ (char*, midas::fstring_len_t, const char&, const char&, midas::fstring_len_t, midas::fstring_len_t);
inline char m_vpromote (char a0, char a1)
{
  char rtnval;
  m$vpromote_(&rtnval, 1, a0, a1, 1, 1);
  return rtnval;
}
#endif

// sub m$vrand >I4 >* <I4

extern "C" void m$vrand_ (int_4&, void*, const int_4&);
inline void m_vrand (int_4& a0, void* a1, int_4 a2)
{
  m$vrand_(a0, a1, a2);
}

// m$vrb_ INTERNAL
// m$vrb__ INTERNAL

// func I4 m$vrbclr >vrb <I4

extern "C" int_4 m$vrbclr_ (VRB&, const int_4&);
inline int_4 m_vrbclr (VRB& a0, int_4 a1)
{
  return m$vrbclr_(a0, a1);
}

// func I4 m$vrbcpy <vrb >vrb <I4

extern "C" int_4 m$vrbcpy_ (const VRB&, VRB&, const int_4&);
inline int_4 m_vrbcpy (const VRB& a0, VRB& a1, int_4 a2)
{
  return m$vrbcpy_(a0, a1, a2);
}

// func I4 m$vrbdel >vrb >A <I4

extern "C" int_4 m$vrbdel_ (VRB&, char[], const int_4&, midas::fstring_len_t);
inline int_4 m_vrbdel (VRB& a0, fstring_buf a1, int_4 a2)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$vrbdel_(a0, a1.buf, a2, a1.nchar);
  a1.flush();
  return rtnval;
}

// func I4 m$vrbfind >vrb >A >m_ptr >I4 <I4 >A1

extern "C" int_4 m$vrbfind_ (VRB&, char[], M_PTR&, int_4&, const int_4&, char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_vrbfind (VRB& a0, fstring_buf a1, void*& a2, int_4& a3, int_4 a4, char& a5)
{
  if (!a1.buf) a1.allocate(256);
  M_PTR a2mptr; a2mptr.p = reinterpret_cast<unsigned long>(a2);
  int_4 rtnval = m$vrbfind_(a0, a1.buf, a2mptr, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  a2 = reinterpret_cast<void*>(static_cast<unsigned long>(a2mptr.p));
  return rtnval;
}

// func I4 m$vrbfree >vrb <I4

extern "C" int_4 m$vrbfree_ (VRB&, const int_4&);
inline int_4 m_vrbfree (VRB& a0, int_4 a1)
{
  return m$vrbfree_(a0, a1);
}

// sub m$vrbfunc >header >vrb <I4 >R8 <I4

extern "C" void m$vrbfunc_ (HEADER&, VRB&, const int_4&, real_8&, const int_4&);
inline void m_vrbfunc (HEADER& a0, VRB& a1, int_4 a2, real_8& a3, int_4 a4)
{
  m$vrbfunc_(a0, a1, a2, a3, a4);
}

// func I4 m$vrbget >vrb >A >* <I4 <I4 >A1

extern "C" int_4 m$vrbget_ (VRB&, char[], void*, const int_4&, const int_4&, char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_vrbget (VRB& a0, fstring_buf a1, void* a2, int_4 a3, int_4 a4, char& a5)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$vrbget_(a0, a1.buf, a2, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  return rtnval;
}

// m$vrbhdr_pack INTERNAL
// m$vrbhdr_unpack INTERNAL

// func I4 m$vrbinit >vrb <I4 <I4

extern "C" int_4 m$vrbinit_ (VRB&, const int_4&, const int_4&);
inline int_4 m_vrbinit (VRB& a0, int_4 a1, int_4 a2)
{
  return m$vrbinit_(a0, a1, a2);
}

// func I4 m$vrbput >vrb >A >* <I4 <I4 <A1

extern "C" int_4 m$vrbput_ (VRB&, char[], void*, const int_4&, const int_4&, const char&, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_vrbput (VRB& a0, fstring_buf a1, void* a2, int_4 a3, int_4 a4, char a5)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$vrbput_(a0, a1.buf, a2, a3, a4, a5, a1.nchar, 1);
  a1.flush();
  return rtnval;
}

// m$vresargs INTERNAL
// m$vresatom INTERNAL
// m$vresget INTERNAL
// m$vreshcb INTERNAL
// m$vresparen INTERNAL
// m$vresput INTERNAL

// sub m$vsadd <* <* >* <I4

extern "C" void m$vsadd_ (const void*, const void*, void*, const int_4&);
inline void m_vsadd (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vsadd_(a0, a1, a2, a3);
}

// sub m$vsmul <* <* >* <I4

extern "C" void m$vsmul_ (const void*, const void*, void*, const int_4&);
inline void m_vsmul (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vsmul_(a0, a1, a2, a3);
}

// sub m$vstype <A1

extern "C" void m$vstype_ (const char&, midas::fstring_len_t);
inline void m_vstype (char a0)
{
  m$vstype_(a0, 1);
}

// sub m$vsub <* <* >* <I4

extern "C" void m$vsub_ (const void*, const void*, void*, const int_4&);
inline void m_vsub (const void* a0, const void* a1, void* a2, int_4 a3)
{
  m$vsub_(a0, a1, a2, a3);
}

// sub m$vsum <* >* <I4

extern "C" void m$vsum_ (const void*, void*, const int_4&);
inline void m_vsum (const void* a0, void* a1, int_4 a2)
{
  m$vsum_(a0, a1, a2);
}

// sub m$vsums <* >* >* <I4

extern "C" void m$vsums_ (const void*, void*, void*, const int_4&);
inline void m_vsums (const void* a0, void* a1, void* a2, int_4 a3)
{
  m$vsums_(a0, a1, a2, a3);
}

// sub m$vtype <A1

extern "C" void m$vtype_ (const char&, midas::fstring_len_t);
inline void m_vtype (char a0)
{
  m$vtype_(a0, 1);
}

// sub m$vtypeq >A1

extern "C" void m$vtypeq_ (char&, midas::fstring_len_t);
inline void m_vtypeq (char& a0)
{
  m$vtypeq_(a0, 1);
}

// m$wait_pid INTERNAL

// sub m$warning <A

extern "C" void m$warning_ (const char[], midas::fstring_len_t);
inline void m_warning (const std::string& a0)
{
  m$warning_(a0.data(), a0.length());
}

// func I4 m$wgetid <I4

extern "C" int_4 m$wgetid_ (const int_4&);
inline int_4 m_wgetid (int_4 a0)
{
  return m$wgetid_(a0);
}

// func I4 m$window >1d-R4 <A <I4

extern "C" int_4 m$window_ (real_4[], const char[], const int_4&, midas::fstring_len_t);
inline int_4 m_window (real_4 a0[], const std::string& a1, int_4 a2)
{
  return m$window_(a0, a1.data(), a2, a1.length());
}

// sub m$window_by_id >1d-R4 <I4 <I4

extern "C" void m$window_by_id_ (real_4[], const int_4&, const int_4&);
inline void m_window_by_id (real_4 a0[], int_4 a1, int_4 a2)
{
  m$window_by_id_(a0, a1, a2);
}

// XM4x/C++  CXXfunc I4 m$window_columns
// XBC          func I4 m$window_columns INTERNAL
// int_4 m_window_columns ();

// func I4 m$window_id <A4

extern "C" int_4 m$window_id_ (const char[], midas::fstring_len_t);
inline int_4 m_window_id (const std::string& a0)
{
  return m$window_id_(a0.data(), a0.length());
}

// XM4x/C++ CXXfunc I4 m$window_rows
// XBC         func I4 m$window_rows INTERNAL
// int_4 m_window_rows ();

// m$wmap INTERNAL

// func I4 m$word <A >A <A

extern "C" int_4 m$word_ (const char[], char[], const char[], midas::fstring_len_t, midas::fstring_len_t, midas::fstring_len_t);
inline int_4 m_word (const std::string& a0, fstring_buf a1, const std::string& a2)
{
  if (!a1.buf) a1.allocate(256);
  int_4 rtnval = m$word_(a0.data(), a1.buf, a2.data(), a0.length(), a1.nchar, a2.length());
  a1.flush();
  return rtnval;
}

// sub m$wordwrap <A <I4 <I4 <L4 >I4 >I4

extern "C" void m$wordwrap_ (const char[], const int_4&, const int_4&, const bool_4&, int_4&, int_4&, midas::fstring_len_t);
inline void m_wordwrap (const std::string& a0, int_4 a1, int_4 a2, bool_4 a3, int_4& a4, int_4& a5)
{
  m$wordwrap_(a0.data(), a1, a2, a3, a4, a5, a0.length());
}

// sub m$wrapnextlines <I4 <A

extern "C" void m$wrapnextlines_ (const int_4&, const char[], midas::fstring_len_t);
inline void m_wrapnextlines (int_4 a0, const std::string& a1)
{
  m$wrapnextlines_(a0, a1.data(), a1.length());
}

// cfunc I4 m$write_socket <I4 <* <I4

extern "C" int_4 m_write_socket (int_4, const void*, int_4);

// m$writemlevel INTERNAL

// func I4 m$xfer_length <I4 <I4

extern "C" int_4 m$xfer_length_ (const int_4&, const int_4&);
inline int_4 m_xfer_length (int_4 a0, int_4 a1)
{
  return m$xfer_length_(a0, a1);
}

// XM44/C++  CXXsub m$xrslt <A <I8
// XBC          sub m$xrslt <A <I8 (not implemented)
// void m_xrslt (const std::string&, int_8);

// sub m$ydy2ymd <I4 <I4 >I4 >I4

extern "C" void m$ydy2ymd_ (const int_4&, const int_4&, int_4&, int_4&);
inline void m_ydy2ymd (int_4 a0, int_4 a1, int_4& a2, int_4& a3)
{
  m$ydy2ymd_(a0, a1, a2, a3);
}

// sub m$ymd2mjd <I4 <I4 <I4 >I4

extern "C" void m$ymd2mjd_ (const int_4&, const int_4&, const int_4&, int_4&);
inline void m_ymd2mjd (int_4 a0, int_4 a1, int_4 a2, int_4& a3)
{
  m$ymd2mjd_(a0, a1, a2, a3);
}

/// Returns the J1950 seconds corresponding to the current utc time of day.
// CXXsub m$utc >R8 >R8
extern void m_utc (real_8&, real_8&);


#define XM_MIDASLIB_H_
#endif // XM_MIDASLIB_H_
