netcdf/ 000775 001750 001750 00000000000 12717334101 013066 5 ustar 00abarth abarth 000000 000000 netcdf/src/ 000775 001750 001750 00000000000 12717334101 013655 5 ustar 00abarth abarth 000000 000000 netcdf/src/netcdf_constants.awk 000664 001750 001750 00000004354 12717333737 017744 0 ustar 00abarth abarth 000000 000000 # Copyright (C) 2013 Alexander Barth
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; If not, see .
# Generate the list of NetCDF constants based on the header file netcdf.h
BEGIN {
print "// generated by netcdf_constants.awk";
}
/\#define[ \t]+NC_[0-9a-zA-Z_]*[ \t]+/ {
constant=$2;
ov = constant;
# NC_INDEPENDENT and NC_COLLECTIVE are no longer defined
# in netcdf 4.3.1
if ($0 ~ /.*internally.*/ || \
constant == "NC_TURN_OFF_LOGGING" || \
constant == "NC_INDEPENDENT" || \
constant == "NC_COLLECTIVE" \
) {
next;
}
if (constant ~ /NC_.*_BYTE/) {
ov = "octave_int8(" constant ")";
}
else if (constant ~ /NC_.*_UBYTE/) {
ov = "octave_uint8(" constant ")";
}
else if (constant ~ /NC_.*_SHORT/) {
ov = "octave_int16(" constant ")";
}
else if (constant ~ /NC_.*_USHORT/) {
ov = "octave_uint16(" constant ")";
}
else if (constant ~ /NC_.*_INT/) {
ov = "octave_int32(" constant ")";
}
else if (constant ~ /NC_.*_UINT/) {
ov = "octave_uint32(" constant ")";
}
else if (constant ~ /NC_.*_INT64/) {
ov = "octave_int64(" constant ")";
}
else if (constant ~ /NC_.*_UINT64/) {
ov = "octave_uint64(" constant ")";
}
else if (constant ~ /NC_.*_CHAR/) {
ov = "(char)" constant;
}
else if (constant ~ /NC_.*_STRING/) {
ov = "std::string(" constant ")";
}
else if (constant ~ /NC_.*_FLOAT/) {
ov = "(float)" constant;
}
else if (constant ~ /NC_.*_STRING/) {
ov = "(double)" constant;
}
printf " netcdf_constants[\"%s\"] = octave_value(%s);\n",constant,ov;
}
netcdf/src/PKG_ADD.sh 000664 001750 001750 00000002725 12717333737 015326 0 ustar 00abarth abarth 000000 000000 #!/bin/sh
# Copyright (C) 2013 Alexander Barth
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; If not, see .
netcdf_functions=$(awk -F'[(,]' '/DEFUN_DLD/ { print $2 } ' __netcdf__.cc)
outfile=../PKG_ADD
outfile_del=../PKG_DEL
importfile=../inst/import_netcdf.m
rm -f $outfile $outfile_del $importfile
echo '% File automatically generated by PKG_ADD.sh' > $importfile
echo '% File automatically generated by PKG_ADD.sh' > $outfile
for i in $netcdf_functions; do
echo ${i#netcdf_}
cat >> $outfile <> $importfile < $outfile_del
for i in $netcdf_functions; do
echo ${i#netcdf_}
cat >> $outfile_del <