view examples/myfunc.c @ 18151:91a3858ef8cf stable

invoke versioned binaries from octave driver program (bug #40957) * main.in.cc (OCTAVE_VERSION): New macro. (main) Append OCTAVE_VERSION to exec file name. Always set new_argv[0] to full name of file that is executed. * Makefile.am (octave-cli-$(version), octave-gui-$(version), all-local): New rules. (OCTAVE_VERSION_LINKS): New variable. (CLEANFILES): Include $(OCTAVE_VERSION_LINKS) in the list.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Dec 2013 15:24:28 -0500
parents 224e76250443
children
line wrap: on
line source

#include "mex.h"

void
mexFunction (int nlhs, mxArray *plhs[],
             int nrhs, const mxArray *prhs[])
{
  const char *nm;

  nm = mexFunctionName ();
  mexPrintf ("You called function: %s\n", nm);
  if (strcmp (nm, "myfunc") == 0)
    mexPrintf ("This is the principal function\n", nm);

  return;
}