Mercurial > hg > octave-nkf
view src/mkbuiltins @ 7948:af10baa63915 ss-3-1-50
3.1.50 snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 18 Jul 2008 17:42:48 -0400 |
parents | 8c32f95c2639 |
children | 5dd06f19e9be |
line wrap: on
line source
#! /bin/sh # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, # 2006, 2007 John W. Eaton # # This file is part of Octave. # # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. # # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. if test $# -ne 1; then echo "usage: mkbuiltins f1" 1>&2 exit 1 fi SED=${SED:-'sed'} DEF_FILES=`cat $1` if test -z "$DEF_FILES"; then echo "mkbuiltins: DEF_FILES is empty!" 1>&2 exit 1 fi cat << \EOF // DO NOT EDIT! Generated automatically by mkbuiltins. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "defun.h" #include "oct-obj.h" #include "variables.h" #include "builtins.h" #if defined (quad) #undef quad #endif #if defined (ENABLE_DYNAMIC_LINKING) #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ is_text_fcn, doc) #else #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ is_text_fcn, doc) \ XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, is_text_fcn, doc) #endif #define XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ extern DECLARE_FUN (name, args_name, nargout_name); \ install_builtin_function (F ## name, #name, doc, is_text_fcn); \ #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, \ is_text_fcn, doc) \ extern DECLARE_FUN (name, args_name, nargout_name); \ install_builtin_function (F ## name, #name, doc, is_text_fcn, false); \ #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, \ is_text_fcn, doc) \ extern DECLARE_FUNX (fname, args_name, nargout_name); \ install_builtin_function (fname, name, doc, is_text_fcn); \ #define XDEFALIAS_INTERNAL(alias, name) \ alias_builtin (#alias, #name); #define XDEFCONST_INTERNAL(name, defn, doc) EOF for file in $DEF_FILES; do fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'` echo "static void" echo "install_${fcn}_fcns (void)" echo "{" cat $file echo "}" echo "" done cat << \EOF void install_builtins (void) { EOF for file in $DEF_FILES; do fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'` echo " install_${fcn}_fcns ();" done cat << \EOF } EOF exit 0