f77-fcn.c

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1996-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include <stdlib.h>
00028 #include <string.h>
00029 
00030 #include "f77-fcn.h"
00031 #include "quit.h"
00032 #include "lo-error.h"
00033 
00034 /* All the STOP statements in the Fortran routines have been replaced
00035    with a call to XSTOPX.
00036 
00037    XSTOPX jumps back to the entry point for the Fortran function that
00038    called us.  Then the calling function should do whatever cleanup
00039    is necessary.  */
00040 
00041 F77_RET_T
00042 #if defined (F77_USES_CRAY_CALLING_CONVENTION)
00043 F77_FUNC (xstopx, XSTOPX) (octave_cray_ftn_ch_dsc desc)
00044 #elif defined (F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION)
00045 F77_FUNC (xstopx, XSTOPX) (const char *s, int slen)
00046 #else
00047 F77_FUNC (xstopx, XSTOPX) (const char *s, long slen)
00048 #endif
00049 {
00050 #if defined (F77_USES_CRAY_CALLING_CONVENTION)
00051   const char *s = desc.const_ptr = ptr_arg;
00052   unsigned long slen = desc.mask.len;
00053 #endif
00054 
00055   f77_exception_encountered = 1;
00056 
00057   /* Skip printing message if it is just a single blank character.  */
00058   if (s && slen > 0 && ! (slen == 1 && *s == ' '))
00059     (*current_liboctave_error_handler) ("%.*s", slen, s);
00060 
00061   octave_jump_to_enclosing_context ();
00062 
00063   F77_RETURN (0)
00064 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines