1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054
|
/****************************************************************************
* NCSA HDF *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* *
* For conditions of distribution and use, see the accompanying *
* hdf/COPYING file. *
* *
****************************************************************************/
#ifdef RCSID
static char RcsId[] = "@(#)$Revision: 1.4 $";
#endif
/* $Id: mfsdpf.c,v 1.4 1999/04/02 18:37:19 ptlu Exp $ */
/*
mfsdpf.c -- based on mfsdf.c,v 1.26
This file contains the HDF-style C stubs for the multi-file SDS
interface for Fortran PowerStation.
The basic routines called by fortran will be of the form sfxxxx
in mfsdpff.f.
All c stubs in this file are named nscxxxx having the FNAME()
function applied to it.
*/
#ifdef HDF
#include "mfhdf.h"
#ifdef PROTOTYPE
FRETVAL(intf) nscstart(_fcd name, intf *access, intf *namelen);
FRETVAL(intf) nscend(intf *file_id);
FRETVAL(intf) nscendacc(intf *id);
FRETVAL(intf) nscfinfo(intf *file_id, intf *datasets, intf *gattr);
FRETVAL(intf) nscselct(intf *file_id, intf *index);
FRETVAL(intf) nscdimid(intf *id, intf *index);
FRETVAL(intf) nscginfo(intf *id, _fcd name, intf *rank,
intf *dimsizes, intf *nt, intf *nattr, intf *len);
FRETVAL(intf) nscgcal(intf *id, float64 *cal, float64 *cale,
float64 *ioff, float64 *ioffe, intf *nt);
FRETVAL(intf) nscscal(intf *id, float64 *cal, float64 *cale,
float64 *ioff, float64 *ioffe, intf *nt);
FRETVAL(intf) nscsdscale(intf *id, intf *count, intf *nt, VOIDP values);
FRETVAL(intf) nscgdscale(intf *id, VOIDP values);
FRETVAL(intf) nscscfill(intf *id, _fcd val);
FRETVAL(intf) nscgcfill(intf *id, _fcd val);
FRETVAL(intf) nscsfill(intf *id, VOIDP val);
FRETVAL(intf) nscgfill(intf *id, VOIDP val);
FRETVAL(intf) nscgrange(intf *id, VOIDP max, VOIDP min);
FRETVAL(intf) nscsrange(intf *id, VOIDP max, VOIDP min);
FRETVAL(intf) nscn2index(intf *id, _fcd name, intf *namelen);
FRETVAL(intf) nsccreate(intf *id, _fcd name, intf *nt, intf *rank,
intf *dims, intf *namelen);
FRETVAL(intf) nscsdimstr(intf *id, _fcd l, _fcd u, _fcd f, intf *ll,
intf *ul, intf *fl);
FRETVAL(intf) nscsdimname(intf *id, _fcd name, intf *len);
FRETVAL(intf) nscsdatstr(intf *id, _fcd l, _fcd u, _fcd f, _fcd c,
intf *ll, intf *ul, intf *fl, intf *cl);
FRETVAL(intf) nscrcatt(intf *id, intf *index, _fcd buf);
FRETVAL(intf) nscrnatt(intf *id, intf *index, VOIDP buf);
FRETVAL(intf) nscrattr(intf *id, intf *index, VOIDP buf);
FRETVAL(intf) nscrdata(intf *id, intf *start, intf *stride,
intf *end, VOIDP values);
FRETVAL(intf) nscwdata(intf *id, intf *start, intf *stride,
intf *end, VOIDP values);
FRETVAL(intf) nscgdimstrs(intf *dim, _fcd label, _fcd unit,
_fcd format,intf *llabel,intf *lunit,
intf *lformat, intf *mlen);
FRETVAL(intf) nscrcdata(intf *id, intf *start, intf *stride,
intf *end, _fcd values);
FRETVAL(intf) nscwcdata(intf *id, intf *start, intf *stride,
intf *end, _fcd values);
FRETVAL(intf) nscgdatstrs(intf *id, _fcd label, _fcd unit,
_fcd format, _fcd coord, intf *llabel, intf *lunit,
intf *lformat, intf *lcoord, intf *len);
FRETVAL(intf) nscgainfo(intf *id, intf *number, _fcd name, intf *nt,
intf *count, intf *len);
FRETVAL(intf) nscgdinfo(intf *id, _fcd name, intf *sz, intf *nt,
intf *nattr, intf *len);
FRETVAL(intf) nscscatt(intf *id, _fcd name, intf *nt, intf *count,
_fcd data, intf *len);
FRETVAL(intf) nscsnatt(intf *id, _fcd name, intf *nt, intf *count, VOIDP data, intf *len);
FRETVAL(intf) nscsattr(intf *id, _fcd name, intf *nt, intf *count,
VOIDP data, intf *len);
FRETVAL(intf) nscid2ref(intf *id);
FRETVAL(intf) nscr2idx(intf *id, intf *ref);
FRETVAL(intf) nsciscvar(intf *id);
FRETVAL(intf) nscsextf(intf *id, _fcd name, intf *offset,
intf *namelen);
FRETVAL(intf) nscsnbit(intf *id, intf *start_bit, intf *bit_len,
intf *sign_ext, intf *fill_one);
FRETVAL(intf) nscsacct(intf *id, intf *type);
FRETVAL(intf) nscsdmvc(intf *id, intf *compmode);
FRETVAL(intf) nscisdmvc(intf *id);
FRETVAL(intf) nscsflmd(intf *id, intf *fillmode);
FRETVAL (intf) nscgichnk(intf *id, intf *dim_length, intf *flags);
FRETVAL (intf) nscrcchnk(intf *id, intf *start, _fcd char_data);
FRETVAL (intf) nscrchnk(intf *id, intf *start, VOIDP num_data);
FRETVAL (intf) nscscchnk(intf *id, intf *maxcache, intf *flags);
FRETVAL (intf) nscschnk(intf *id, intf *dim_length, intf *comp_type,
intf *comp_prm);
FRETVAL (intf) nscwcchnk(intf *id, intf *start, _fcd char_data);
FRETVAL (intf) nscwchnk(intf *id, intf *start, VOIDP num_data);
FRETVAL (intf) nscscompress(intf *id, intf *comp_type, intf *comp_prm);
FRETVAL(intf) nscisrcrd(intf *id);
FRETVAL(intf) nscsblksz(intf *id, intf *block_size);
#else
FRETVAL(intf) nscstart();
FRETVAL(intf) nscend();
FRETVAL(intf) nscendacc();
FRETVAL(intf) nscfinfo();
FRETVAL(intf) nscselct();
FRETVAL(intf) nscdimid();
FRETVAL(intf) nscginfo();
FRETVAL(intf) nscgcal();
FRETVAL(intf) nscscal();
FRETVAL(intf) nscsdscale();
FRETVAL(intf) nscgdscale();
FRETVAL(intf) nscscfill();
FRETVAL(intf) nscgcfill();
FRETVAL(intf) nscsfill();
FRETVAL(intf) nscgfill();
FRETVAL(intf) nscgrange();
FRETVAL(intf) nscsrange();
FRETVAL(intf) nscn2index();
FRETVAL(intf) nsccreate();
FRETVAL(intf) nscsdimstr();
FRETVAL(intf) nscsdimname();
FRETVAL(intf) nscsdatstr();
FRETVAL(intf) nscrcatt();
FRETVAL(intf) nscrnatt();
FRETVAL(intf) nscrattr();
FRETVAL(intf) nscrdata();
FRETVAL(intf) nscwdata();
FRETVAL(intf) nscgdimstrs();
FRETVAL(intf) nscrcdata();
FRETVAL(intf) nscwcdata();
FRETVAL(intf) nscgdatstrs();
FRETVAL(intf) nscgainfo();
FRETVAL(intf) nscgdinfo();
FRETVAL(intf) nscscatt();
FRETVAL(intf) nscsnatt();
FRETVAL(intf) nscsattr();
FRETVAL(intf) nscid2ref();
FRETVAL(intf) nscr2idx();
FRETVAL(intf) nsciscvar();
FRETVAL(intf) nscsextf();
FRETVAL(intf) nscsnbit();
FRETVAL(intf) nscsacct();
FRETVAL(intf) nscsdmvc();
FRETVAL(intf) nscisdmvc();
FRETVAL(intf) nscsflmd();
FRETVAL(intf) nscgichnk();
FRETVAL(intf) nscrcchnk();
FRETVAL(intf) nscrchnk();
FRETVAL(intf) nscscchnk();
FRETVAL(intf) nscschnk();
FRETVAL(intf) nscwcchnk();
FRETVAL(intf) nscwchnk();
FRETVAL(intf) nscscompress();
FRETVAL(intf) nscisrcrd();
FRETVAL(intf) nscsblksz();
#endif /* PROTOTYPE */
/*-----------------------------------------------------------------------------
* Name: scstart
* Purpose: call SDstart to open HDF file
* Inputs: name: name of file to open
* access: access mode - integer with value DFACC_READ etc.
* namelen: length of name
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscstart(_fcd name, intf *access, intf *namelen)
#else
nscstart(name, access, namelen)
_fcd name;
intf *access;
intf *namelen;
#endif /* PROTOTYPE */
{
char *fn;
intf ret;
fn = HDf2cstring(name, *namelen);
ret = (intf) SDstart(fn, *access);
HDfree((VOIDP)fn);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scend
* Purpose: Call SDend close to close HDF file
* Inputs: file_id: handle to HDF file to close
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscend(intf *file_id)
#else
nscend(file_id)
intf *file_id;
#endif /* PROTOTYPE */
{
return(SDend(*file_id));
}
/*-----------------------------------------------------------------------------
* Name: scendacc
* Purpose: Call SDendaccess close to end access on a dataset
* Inputs: id: id of the data set
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscendacc(intf *id)
#else
nscendacc(id)
intf *id;
#endif /* PROTOTYPE */
{
return(SDendaccess(*id));
}
/*-----------------------------------------------------------------------------
* Name: scfinfo
* Purpose: Call SDfileinfo to get number of datasets and global attrs in the file
* Inputs: file_id: handle to HDF file
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscfinfo(intf *file_id, intf *datasets, intf *gattr)
#else
nscfinfo(file_id, datasets, gattr)
intf *file_id;
intf *datasets;
intf *gattr;
#endif /* PROTOTYPE */
{
int32 dset, nattr, status;
status = SDfileinfo((int32) *file_id, &dset, &nattr);
*datasets = (intf) dset;
*gattr = (intf) nattr;
return (status);
}
/*-----------------------------------------------------------------------------
* Name: scselct
* Purpose: Call SDselect to return a handle to a data set in the given file
* Inputs: file_id: handle to HDF file
* index: number of data set to chose
* Returns: sdsid on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscselct(intf *file_id, intf *index)
#else
nscselct(file_id, index)
intf *file_id;
intf *index;
#endif /* PROTOTYPE */
{
return(SDselect(*file_id, *index));
}
/*-----------------------------------------------------------------------------
* Name: scdimid
* Purpose: Get an id for a dimension of a given data set
* Inputs: id: handle to a data set
* index: number of dimension to chose
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscdimid(intf *id, intf *index)
#else
nscdimid(id, index)
intf *id;
intf *index;
#endif /* PROTOTYPE */
{
int32 rank, nt, dims[100], status, cdim, nattrs;
status = SDgetinfo(*id, NULL, &rank, dims, &nt, &nattrs);
if(status == FAIL) return FAIL;
cdim = rank - (*index) -1;
return(SDgetdimid(*id, cdim));
}
/*-----------------------------------------------------------------------------
* Name: scginfo
* Purpose: Call SDgetinfo to get the basic information about a data set
* Inputs: id: handle to a data set
* Outputs: name: the name of the data set
* rank: the rank
* dimsizes: sizes of the dimensions
* nt: number type
* nattr: number of attributes for this data set
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscginfo(intf *id, _fcd name, intf *rank, intf *dimsizes, intf *nt, intf *nattr, intf *len)
#else
nscginfo(id, name, rank, dimsizes, nt, nattr, len)
intf *id;
_fcd name;
intf *rank, *dimsizes, *nt, *nattr, *len;
#endif /* PROTOTYPE */
{
char *iname;
int32 status;
int32 cdims[100], i;
int32 rank32, nt32, nattr32;
iname = NULL;
if(*len) iname = (char *) HDmalloc((uint32)*len + 1);
status = SDgetinfo((int32) *id, iname, &rank32, cdims, &nt32, &nattr32);
for(i = 0; i < rank32; i++)
dimsizes[i] = cdims[rank32 - i - 1];
HDpackFstring(iname, _fcdtocp(name), *len);
if(iname) HDfree((VOIDP)iname);
*rank = (intf) rank32;
*nt = (intf) nt32;
*nattr = (intf) nattr32;
return(status);
}
/*-----------------------------------------------------------------------------
* Name: scgcal
* Purpose: Call SDgetcal to get the calibration information
* Inputs: id: handle to a data set
* Outputs: cal, cale, ioff, ioffe : calibration factors and error
* nt: number type of data
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgcal(intf *id, float64 *cal, float64 *cale, float64 *ioff, float64 *ioffe, intf *nt)
#else
nscgcal(id, cal, cale, ioff, ioffe, nt)
intf *id;
float64 *cal, *cale, *ioff, *ioffe;
intf *nt;
#endif /* PROTOTYPE */
{
int32 nt32, status;
status = SDgetcal((int32) *id, cal, cale, ioff, ioffe, &nt32);
*nt = (intf) nt32;
return (status);
}
/*-----------------------------------------------------------------------------
* Name: scscal
* Purpose: Call SDsetcal to set the calibration information
* Inputs: id: handle to a data set
* cal, cale, ioff, ioffe : calibration factors and error
* nt: number type of data
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscscal(intf *id, float64 *cal, float64 *cale, float64 *ioff, float64 *ioffe, intf *nt)
#else
nscscal(id, cal, cale, ioff, ioffe, nt)
intf *id;
float64 *cal, *cale, *ioff, *ioffe;
intf *nt;
#endif /* PROTOTYPE */
{
return(SDsetcal(*id, *cal, *cale, *ioff, *ioffe, *nt));
}
/*-----------------------------------------------------------------------------
* Name: scsdscale
* Purpose: Call SDsetdimscale to set the values for a dimension
* Inputs: id: handle to a dimension
* count: size of the dimension
* nt: number type of data
* values: data
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsdscale(intf *id, intf *count, intf *nt, VOIDP values)
#else
nscsdscale(id, count, nt, values)
intf *id;
intf *count, *nt;
VOIDP values;
#endif /* PROTOTYPE */
{
return(SDsetdimscale(*id, *count, *nt, values));
}
/*-----------------------------------------------------------------------------
* Name: scgdscale
* Purpose: Call SDgetdimscale to get the values for a dimension
* Inputs: id: handle to a dimension
* Output values: data
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgdscale(intf *id, VOIDP values)
#else
nscgdscale(id, values)
intf *id;
VOIDP values;
#endif /* PROTOTYPE */
{
return(SDgetdimscale(*id, values));
}
/*----------------------------------------------------------
* Name: scscfill
* Purpose: Call nsfsnfill to set the char fill value
* Inputs: id: handle to a dimension
* val: the fill value
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*----------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscscfill(intf *id, _fcd val)
#else
nscscfill(id, val)
intf *id;
_fcd val;
#endif /* PROTOTYPE */
{
return(nscsfill(id, (VOIDP) _fcdtocp(val)));
}
/*------------------------------------------------------------
* Name: scgcfill
* Purpose: Call sfgfill to get the char fill value
* Inputs: id: handle to a dimension
* Output: val: the fill value
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*-----------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgcfill(intf *id, _fcd val)
#else
nscgcfill(id, val)
intf *id;
_fcd val;
#endif /* PROTOTYPE */
{
return(nscgfill(id, (VOIDP) _fcdtocp(val)));
}
/*---------------------------------------------------------
* Name: scsfill
* Purpose: Call SDsetfillvalue to set the numeric fill value
* Inputs: id: handle to a dimension
* val: the fill value
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsfill(intf *id, VOIDP val)
#else
nscsfill(id, val)
intf *id;
VOIDP val;
#endif /* PROTOTYPE */
{
return(SDsetfillvalue(*id, val));
}
/*----------------------------------------------------------
* Name: scgfill
* Purpose: Call SDgetfillvalue to get the fill value.
* Inputs: id: handle to a dimension
* Output: val: the fill value
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgfill(intf *id, VOIDP val)
#else
nscgfill(id, val)
intf *id;
VOIDP val;
#endif /* PROTOTYPE */
{
return(SDgetfillvalue(*id, val));
}
/*------------------------------------------------------------
* Name: scgrange
* Purpose: Call SDgetrange to get the valid range info
* Inputs: id: handle to a dataset
* Output: min: the min
* max: the max
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgrange(intf *id, VOIDP max, VOIDP min)
#else
nscgrange(id, max, min)
intf *id;
VOIDP max;
VOIDP min;
#endif /* PROTOTYPE */
{
return(SDgetrange(*id, max, min));
}
/*-----------------------------------------------------------------------------
* Name: scsrange
* Purpose: Call SDsetrange to set the valid range info
* Inputs: id: handle to a dataset
* min: the min
* max: the max
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsrange(intf *id, VOIDP max, VOIDP min)
#else
nscsrange(id, max, min)
intf *id;
VOIDP max;
VOIDP min;
#endif /* PROTOTYPE */
{
return(SDsetrange(*id, max, min));
}
/*-----------------------------------------------------------------------------
* Name: scn2index
* Purpose: return the index of a data set with the given name
* Inputs: id: file id
* name: name to look for
* namelen: length of name
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscn2index(intf *id, _fcd name, intf *namelen)
#else
nscn2index(id, name, namelen)
intf *id;
_fcd name;
intf *namelen;
#endif /* PROTOTYPE */
{
char *fn;
intf ret;
fn = HDf2cstring(name, *namelen);
ret = (intf) SDnametoindex(*id, fn);
HDfree((VOIDP)fn);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: sccreate
* Purpose: create a new data set and return its id
* Inputs: id: file id
* name: name of data set
* nt: number type
* rank: rank
* dims: dimension sizes
* namelen: length of name
* Remarks: need to flip the dimensions to account for array ordering
* differences
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nsccreate(intf *id, _fcd name, intf *nt, intf *rank, intf *dims, intf *namelen)
#else
nsccreate(id, name, nt, rank, dims, namelen)
intf *id;
_fcd name;
intf *nt, *rank;
intf *dims;
intf *namelen;
#endif /* PROTOTYPE */
{
char *fn;
intf ret;
int32 * cdims, i;
fn = HDf2cstring(name, *namelen);
cdims = (int32 *) HDmalloc(sizeof(int32) * (*rank));
if(!cdims) return FAIL;
for(i = 0; i < *rank; i++)
cdims[i] = dims[*rank - i - 1];
ret = (intf) SDcreate(*id, fn, *nt, *rank, cdims);
HDfree((VOIDP)fn);
HDfree((VOIDP)cdims);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scsdimstr
* Purpose: set the strings for this dimension
* Inputs: id: dim id
* label, unit and format strings and their lengths
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsdimstr(intf *id, _fcd l, _fcd u, _fcd f, intf *ll, intf *ul, intf *fl)
#else
nscsdimstr(id, l, u, f, ll, ul, fl)
intf *id;
_fcd l;
_fcd u;
_fcd f;
intf *ll, *ul, *fl;
#endif /* PROTOTYPE */
{
char *lstr;
char *ustr;
char *fstr;
intf ret;
if(ll)
lstr = HDf2cstring(l, *ll);
else
lstr = NULL;
if(ul)
ustr = HDf2cstring(u, *ul);
else
ustr = NULL;
if(fl)
fstr = HDf2cstring(f, *fl);
else
fstr = NULL;
ret = (intf) SDsetdimstrs(*id, lstr, ustr, fstr);
if(ll) HDfree((VOIDP)lstr);
if(ul) HDfree((VOIDP)ustr);
if(fl) HDfree((VOIDP)fstr);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scsdimname
* Purpose: set the name of this dimension
* Inputs: id: dim id
* name and its length
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsdimname(intf *id, _fcd name, intf *len)
#else
nscsdimname(id, name, len)
intf *id;
_fcd name;
intf *len;
#endif /* PROTOTYPE */
{
char *nstr;
intf ret;
if(len)
nstr = HDf2cstring(name, *len);
else
nstr = NULL;
ret = (intf) SDsetdimname(*id, nstr);
if(len) HDfree((VOIDP)nstr);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scsdatstr
* Purpose: set the strings for this dimension
* Inputs: id: dim id
* label, unit and format strings and their lengths
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsdatstr(intf *id, _fcd l, _fcd u, _fcd f, _fcd c, intf *ll, intf *ul, intf *fl, intf *cl)
#else
nscsdatstr(id, l, u, f, c, ll, ul, fl, cl)
intf *id;
_fcd l;
_fcd u;
_fcd f;
_fcd c;
intf *ll, *ul, *fl, *cl;
#endif /* PROTOTYPE */
{
char *lstr;
char *ustr;
char *fstr;
char *cstr;
intf ret;
if(ll)
lstr = HDf2cstring(l, *ll);
else
lstr = NULL;
if(ul)
ustr = HDf2cstring(u, *ul);
else
ustr = NULL;
if(fl)
fstr = HDf2cstring(f, *fl);
else
fstr = NULL;
if(cl)
cstr = HDf2cstring(c, *cl);
else
cstr = NULL;
ret = (intf) SDsetdatastrs(*id, lstr, ustr, fstr, cstr);
if(ll) HDfree((VOIDP)lstr);
if(ul) HDfree((VOIDP)ustr);
if(fl) HDfree((VOIDP)fstr);
if(cl) HDfree((VOIDP)cstr);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scrcatt
* Purpose: Call sfrnatt to get the contents of a char attribute
* Inputs: id: handle to a dataset
* index: index of the attribute to read
* buf: space to hold info
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscrcatt(intf *id, intf *index, _fcd buf)
#else
nscrcatt(id, index, buf)
intf *id;
intf *index;
_fcd buf;
#endif /* PROTOTYPE */
{
return(nscrnatt(id, index, (VOIDP) _fcdtocp(buf)));
}
/*-----------------------------------------------------------------------------
* Name: scrnatt
* Purpose: Call SDreadattr to get the contents of a numeric attribute
* Inputs: id: handle to a dataset
* index: index of the attribute to read
* buf: space to hold info
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscrnatt(intf *id, intf *index, VOIDP buf)
#else
nscrnatt(id, index, buf)
intf *id;
intf *index;
VOIDP buf;
#endif /* PROTOTYPE */
{
return(SDreadattr(*id, *index, buf));
}
/*-----------------------------------------------------------------------------
* Name: scrattr
* Purpose: Call SDreadattr to get the contents of an attribute
* Inputs: id: handle to a dataset
* index: index of the attribute to read
* buf: space to hold info
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscrattr(intf *id, intf *index, VOIDP buf)
#else
nscrattr(id, index, buf)
intf *id;
intf *index;
VOIDP buf;
#endif /* PROTOTYPE */
{
return(nscrnatt(id, index, buf));
}
/*------------------------------------------------------------
* Name: scrdata
* Purpose: read a section of numeric data
* Inputs: id: dataset id
* start: start location
* stride: stride along each dimension
* end: number of values along each dim to read
* values: data
* Remarks: need to flip the dimensions to account for array ordering
* differences
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscrdata(intf *id, intf *start, intf *stride, intf *end, VOIDP values)
#else
nscrdata(id, start, stride, end, values)
intf *id;
intf *start, *stride, *end;
VOIDP values;
#endif /* PROTOTYPE */
{
intf ret;
int32 i, rank, dims[100], nt, nattrs, status;
int32 cstart[100], cstride[100], cend[100];
int nostride;
status = SDgetinfo(*id, NULL, &rank, dims, &nt, &nattrs);
if(status == FAIL) return FAIL;
nostride = TRUE;
for(i = 0; i < rank; i++) {
cstart[i] = start[rank - i - 1];
cend[i] = end[rank - i - 1];
if((cstride[i] = stride[rank - i - 1]) != 1) nostride = FALSE;
}
ret = (intf) SDreaddata(*id, cstart, (nostride? NULL : cstride), cend, values);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scwdata
* Purpose: write a section of data
* Inputs: id: dataset id
* start: start location
* stride: stride along each dimension
* end: number of values along each dim to write
* values: data
* Remarks: need to flip the dimensions to account for array ordering
* differences
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscwdata(intf *id, intf *start, intf *stride, intf *end, VOIDP values)
#else
nscwdata(id, start, stride, end, values)
intf *id;
intf *start, *stride, *end;
VOIDP values;
#endif /* PROTOTYPE */
{
intf ret;
int32 i, rank, dims[100], nt, nattrs, status;
int32 cstart[100], cstride[100], cend[100];
intn nostride;
status = SDgetinfo(*id, NULL, &rank, dims, &nt, &nattrs);
if(status == FAIL) return FAIL;
nostride = TRUE;
for(i = 0; i < rank; i++) {
cstart[i] = start[rank - i - 1];
cend[i] = end[rank - i - 1];
if((cstride[i] = stride[rank - i - 1]) != 1) nostride = FALSE;
}
ret = (intf) SDwritedata(*id, cstart, (nostride? NULL : cstride), cend, values);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scgdmstrs
* Purpose: Return the "dimension strings"
* Inputs: label, unit, format: strings to return attributes in
* Returns: 0 on success, -1 on failure with DFerror set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgdimstrs(intf *dim, _fcd label, _fcd unit, _fcd format, intf *llabel,
intf *lunit, intf *lformat, intf *mlen)
#else
nscgdimstrs(dim, label, unit, format, llabel, lunit, lformat, mlen)
intf *dim;
_fcd label, unit, format;
intf *llabel, *lunit, *lformat;
int *mlen;
#endif /* PROTOTYPE */
{
char *ilabel, *iunit, *iformat;
intf ret;
iunit = ilabel = iformat = NULL;
if(*llabel) ilabel = (char *) HDmalloc((uint32)*llabel + 1);
if(*lunit) iunit = (char *) HDmalloc((uint32)*lunit + 1);
if(*lformat) iformat = (char *) HDmalloc((uint32)*lformat + 1);
ret = (intf)SDgetdimstrs(*dim, ilabel, iunit, iformat, *mlen);
HDpackFstring(ilabel, _fcdtocp(label), *llabel);
HDpackFstring(iunit, _fcdtocp(unit), *lunit);
HDpackFstring(iformat, _fcdtocp(format), *lformat);
if(ilabel) HDfree((VOIDP)ilabel);
if(iunit) HDfree((VOIDP)iunit);
if(iformat) HDfree((VOIDP)iformat);
return ret;
}
/*--------------------------------------------------------
* Name: scrcdata
* Purpose: read a section of char data
* Inputs: id: dataset id
* start: start location
* stride: stride along each dimension
* end: number of values along each dim to read
* values: data
* Remarks: need to flip the dimensions to account for array ordering
* differences
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscrcdata(intf *id, intf *start, intf *stride, intf *end, _fcd values)
#else
nscrcdata(id, start, stride, end, values)
intf *id;
intf *start, *stride, *end;
_fcd values;
#endif /* PROTOTYPE */
{
return(nscrdata(id, start, stride, end, (VOIDP) _fcdtocp(values)));
}
/*--------------------------------------------------------
* Name: scwcdata
* Purpose: write a section of char data
* Inputs: id: dataset id
* start: start location
* stride: stride along each dimension
* end: number of values along each dim to read
* values: data
* Remarks: need to flip the dimensions to account for array ordering
* differences
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscwcdata(intf *id, intf *start, intf *stride, intf *end, _fcd values)
#else
nscwcdata(id, start, stride, end, values)
intf *id;
intf *start, *stride, *end;
_fcd values;
#endif /* PROTOTYPE */
{
return(nscwdata(id, start, stride, end, (VOIDP) _fcdtocp(values)));
}
/*-----------------------------------------------------------------------------
* Name: scgdtstrs
* Purpose: Return the "data strings"
* Inputs: label, unit, format coord: strings to return attributes in
* Returns: 0 on success, -1 on failure with DFerror set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgdatstrs(intf *id, _fcd label, _fcd unit, _fcd format, _fcd coord,
intf *llabel, intf *lunit, intf *lformat, intf *lcoord, intf *len)
#else
nscgdatstrs(id, label, unit, format, coord, llabel, lunit, lformat, lcoord, len)
intf *id;
_fcd label, unit, format, coord;
intf *llabel, *lunit, *lformat, *lcoord;
intf *len;
#endif /* PROTOTYPE */
{
char *ilabel, *iunit, *iformat, *icoord;
intf ret;
iunit = ilabel = iformat = NULL;
if(*llabel) ilabel = (char *) HDmalloc((uint32)*llabel + 1);
if(*lunit) iunit = (char *) HDmalloc((uint32)*lunit + 1);
if(*lformat) iformat = (char *) HDmalloc((uint32)*lformat + 1);
if(*lcoord) icoord = (char *) HDmalloc((uint32)*lcoord + 1);
ret = (intf)SDgetdatastrs(*id, ilabel, iunit, iformat, icoord, *len);
HDpackFstring(ilabel, _fcdtocp(label), *llabel);
HDpackFstring(iunit, _fcdtocp(unit), *lunit);
HDpackFstring(iformat, _fcdtocp(format), *lformat);
HDpackFstring(icoord, _fcdtocp(coord), *lcoord);
if(ilabel) HDfree((VOIDP)ilabel);
if(iunit) HDfree((VOIDP)iunit);
if(iformat) HDfree((VOIDP)iformat);
if(icoord) HDfree((VOIDP)icoord);
return ret;
}
/*-----------------------------------------------------------------------------
* Name: scgainfo
* Purpose: Call SDattrinfo to get the basic information about an attribute
* Inputs: id: handle to a data set
* Outputs: name: the name of the data set
* count: the size
* nt: number type
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgainfo(intf *id, intf *number, _fcd name, intf *nt, intf *count, intf *len)
#else
nscgainfo(id, number, name, nt, count, len)
intf *id, *number;
_fcd name;
intf *count, *len, *nt;
#endif /* PROTOTYPE */
{
char * iname;
intn status;
int32 nt32;
int32 cnt32;
iname = NULL;
if(*len) iname = (char *) HDmalloc((uint32)*len + 1);
status = SDattrinfo(*id, *number, iname, &nt32, &cnt32);
HDpackFstring(iname, _fcdtocp(name), *len);
if(iname) HDfree((VOIDP)iname);
*nt = (intf) nt32;
*count = (intf) cnt32;
return((intf)status);
}
/*-----------------------------------------------------------------------------
* Name: scgdinfo
* Purpose: Call SDdiminfo to get the basic information about a dimension
* Inputs: id: handle to a dimension
* Outputs: name: the name of the dimension
* count: the size
* nt: number type
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscgdinfo(intf *id, _fcd name, intf *sz, intf *nt, intf *nattr, intf *len)
#else
nscgdinfo(id, name, sz, nt, nattr, len)
intf *id;
_fcd name;
intf *sz, *nattr, *len, *nt;
#endif /* PROTOTYPE */
{
char *iname;
int32 status;
int32 sz32, nt32, nattr32;
iname = NULL;
if(*len) iname = (char *) HDmalloc((uint32)*len + 1);
status = SDdiminfo(*id, iname, &sz32, &nt32, &nattr32);
HDpackFstring(iname, _fcdtocp(name), *len);
if(iname) HDfree((VOIDP)iname);
*nt = (intf) nt32;
*sz = (intf) sz32;
*nattr = (intf) nattr32;
return(status);
}
/*-----------------------------------------------------------------------------
* Name: scscatt
* Purpose: calls scsnatt to create a new char attribute (or modify an existing one)
* Inputs: id: id (file or data set)
* name: name of attribute
* nt: number type
* count: number of values
* data: where the values are
* len: length of name
* Remarks:
* Returns: 0 on success, -1 on failure with error set
*--------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscscatt(intf *id, _fcd name, intf *nt, intf *count, _fcd data, intf *len)
#else
nscscatt(id, name, nt, count, data, len)
intf *id;
_fcd name;
intf *nt, *count;
_fcd data;
intf *len;
#endif /* PROTOTYPE */
{
return(nscsnatt(id, name, nt, count, (VOIDP) _fcdtocp(data), len));
}
/*-------------------------------------------------------------
* Name: scsnatt
* Purpose: create a new numeric attribute (or modify an existing one)
* Inputs: id: id (file or data set)
* name: name of attribute
* nt: number type
* count: number of values
* data: where the values are
* len: length of name
* Remarks: This routine and scscattr are used to replace scsattr
* Returns: 0 on success, -1 on failure with error set
*--------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsnatt(intf *id, _fcd name, intf *nt, intf *count, VOIDP data, intf *len)
#else
nscsnatt(id, name, nt, count, data, len)
intf *id;
_fcd name;
intf *nt, *count;
VOIDP data;
intf *len;
#endif /* PROTOTYPE */
{
char *an;
intf ret;
an = HDf2cstring(name, *len);
ret = (intf) SDsetattr(*id, an, *nt, *count, data);
HDfree((VOIDP)an);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scsattr
* Purpose: for backward compatibility. Calls SDsetattr to create
* or modify an existing attribute
* Inputs: id: id (file or data set)
* name: name of attribute
* nt: number type
* count: number of values
* data: where the values are
* namelen: length of name
* Returns: 0 on success, -1 on failure with error set
* Remarks: This routine and sfsattr should be phased out.
* sfsattr declairs data as char *, scscatt assumes
* data as VOIDP. This causes problems on VMS and T3D.
*--------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsattr(intf *id, _fcd name, intf *nt, intf *count, VOIDP data, intf *len)
#else
nscsattr(id, name, nt, count, data, len)
intf *id;
_fcd name;
intf *nt, *count;
VOIDP data;
intf *len;
#endif /* PROTOTYPE */
{
char *an;
intf ret;
an = HDf2cstring(name, *len);
ret = (intf) SDsetattr(*id, an, *nt, *count, data);
HDfree((VOIDP)an);
return(ret);
}
/*---------------------------------------------------------------------
* Name: scfattr
* Purpose: call SDfindattr to find an attribute
* Inputs: id: object to look at
* name: name of attribute to find
* Returns: attribute id on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscfattr(intf *id, _fcd name, intf *namelen)
#else
nscfattr(id, name, namelen)
_fcd name;
intf *id;
intf *namelen;
#endif /* PROTOTYPE */
{
char *fn;
intf ret;
fn = HDf2cstring(name, *namelen);
ret = (intf) SDfindattr(*id, fn);
HDfree((VOIDP)fn);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scid2ref
* Purpose: call SDidtoref to map an id to ref
* Inputs: id: variable id
* Returns: reference number of a NDG representing this dataset
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscid2ref(intf *id)
#else
nscid2ref(id)
intf *id;
#endif /* PROTOTYPE */
{
return((intf) SDidtoref(*id));
}
/*-----------------------------------------------------------------------------
* Name: scfr2idx
* Purpose: call SDreftoindex to map a reference number to an index of a
* dataset
* Inputs: id: file id
* ref: reference number to look up
* Returns: index of a NDG representing this dataset
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscr2idx(intf *id, intf *ref)
#else
nscr2idx(id, ref)
intf *id;
intf *ref;
#endif /* PROTOTYPE */
{
return((intf) SDreftoindex(*id, (int32) *ref));
}
/*-----------------------------------------------------------------------------
* Name: sciscvar
* Purpose: call SDiscoordvar to see if a dataset is a coordinate variable
* dataset
* Inputs: id: sds id
* Returns: TRUE/FALSE
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nsciscvar(intf *id)
#else
nsciscvar(id)
intf *id;
#endif /* PROTOTYPE */
{
return((intf) SDiscoordvar(*id));
}
/*-----------------------------------------------------------------------------
* Name: scsextf
* Purpose: store data in an external file
* Inputs: id: sds id
* name: name of external file
* offset: Number of bytes from the beginning of the
* external file to where the data starts
* namelen: length of name
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsextf(intf *id, _fcd name, intf *offset, intf *namelen)
#else
nscsextf(id, name, offset, namelen)
intf *id;
_fcd name;
intf *offset;
intf *namelen;
#endif /* PROTOTYPE */
{
char *fn;
intf ret;
fn = HDf2cstring(name, *namelen);
if (!fn) return(FAIL);
ret = (intf) SDsetexternalfile(*id, fn, *offset);
HDfree((VOIDP)fn);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scsnbit
* Purpose: store data in n-bit data element
* Inputs: id: sds id
* start_bit: starting bit offset
* bit_len: # of bits to write
* sign_ext: whether to use the top bit as a sign extender
* fill_one: whether to fill the "background bits" with ones
* Returns: 0 on success, -1 on failure with error set
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsnbit(intf *id, intf *start_bit, intf *bit_len, intf *sign_ext, intf *fill_one)
#else
nscsnbit(id, start_bit, bit_len, sign_ext, fill_one)
intf *id;
intf *start_bit;
intf *bit_len;
intf *sign_ext;
intf *fill_one;
#endif /* PROTOTYPE */
{
return((intf)SDsetnbitdataset((int32)*id,(intn)*start_bit,(intn)*bit_len,
(intn)*sign_ext,(intn)*fill_one));
}
/*-----------------------------------------------------------------------------
* Name: scsacct
* Purpose: Call SDsetaccesstype to set the access type
* Inputs: id: sds id
* type: the access type
* Returns: 0 on success, FAIL on failure with error set
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsacct(intf *id, intf *type)
#else
nscsacct(id, type)
intf *id;
intf *type;
#endif /* PROTOTYPE */
{
return((intf) SDsetaccesstype(*id, *type));
}
/*-----------------------------------------------------------------------------
* Name: scsdmvc
* Purpose: Call SDsetdimval_comp to set the dim value backward
* compatibility type
* Inputs: id: dim id
* compmode: backward compatibility:
* SD_DIMVAL_BW_COMP -- compatible (in mfhdf.h)
* SD_DIMVAL_BW_INCOMP -- incompatible.
*
* Returns: SUCCESS on success, FAIL on failure
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsdmvc(intf *id, intf *compmode)
#else
nscsdmvc(id, compmode)
intf *id;
intf *compmode;
#endif /* PROTOTYPE */
{
return((intf) SDsetdimval_comp(*id, *compmode));
}
/*-----------------------------------------------------------------------------
* Name: scisdmvc
* Purpose: Call SDisdimval_bwcomp to get the dim value backward
* compatibility
* Inputs: id: dim id
*
* Returns: SD_DIMVAL_BW_COMP (1) if dimval is backward compatible;
SD_DIMVAL_BW_INCOMP (0) for not compatible; (in mfhdf.h)
FAIL (-1) for error.
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscisdmvc(intf *id)
#else
nscisdmvc(id)
intf *id;
#endif /* PROTOTYPE */
{
return((intf) SDisdimval_bwcomp(*id));
}
/*-----------------------------------------------------------------------------
* Name: scsflmd
* Purpose: Call SDsetfillmode to set for the file fill mode
* as fill or nofill
* Inputs: id: file id
* fillmode: Desired fill mode for the file,
* either SD_FILL or SD_NOFILL.
* SD_FILL is the default mode.
*
* Returns: The current (before the new mode is set) fill mode;
* FAIL (-1) for error.
* Users: HDF Fortran programmers
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsflmd(intf *id, intf *fillmode)
#else
nscsflmd(id, fillmode)
intf *id, *fillmode;
#endif /* PROTOTYPE */
{
return((intf) SDsetfillmode(*id, *fillmode));
}
/*-------------------------------------------------------------------------
* Name: scgichnk
* Puporse: Call SDgetchunkinfo
* Inputs: id: SDS access id
* Outputs: dim_length: chunk dimensions
* flags: -1 - SDS is nonchunked
* 0 - SDS is chunked, no compression
* 1 - SDS is chunked and compressed
* with RLE, SKPHUFF and GZIP
* 2 - SDS is chunked and compressed with NBIT
* Actual parameters are not returned. Will be fixed after HDF41r.2
* comp_prm[0] = nbit_sign_ext,
* comp_prm[1] = nbit_fill_one,
* comp_prm[2] = nbit_start_bit,
* comp_prm[3] = nbit_bit_len: NBIT compression parametes
*
* comp_prm[0] = skphuff_skp_size: size of individual elements for
* Adaptive Huffman compression algorithm
* comp_prm[0] = deflate_level: GZIP compression parameter
* Returns: 0 on success, -1 on failure with error set
* Users: HDF Fortran programmers
*-------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscgichnk(intf *id, intf *dim_length, intf *flags)
#else
nscgichnk( id, dim_length, flags)
intf *id;
intf *dim_length;
intf *flags;
#endif /* PROTOTYPE */
{
HDF_CHUNK_DEF chunk_def; /* Chunk definition set */
int32 sdsid; /* SDS id */
comp_info cinfo; /* compression info */
int i;
int32 rank, status, cflags, comp_type;
intf ret;
int32 cdims[100], nt32, nattr32;
sdsid = *id;
/* Get SDS rank */
status = SDgetinfo(sdsid, NULL, &rank, cdims, &nt32, &nattr32 );
if(status == FAIL) return FAIL;
/* Get SDS info */
status = SDgetchunkinfo(sdsid, &chunk_def, &cflags);
if(status == FAIL) return FAIL;
switch (cflags)
{
case HDF_NONE: /* Non-chunked SDS */
*flags = -1;
ret = 0;
return(ret);
case HDF_CHUNK: /* Chunked, noncompressed SDS */
*flags = 0;
for (i=0; i < rank; i++)
dim_length[rank-i-1] = chunk_def.chunk_lengths[i];
ret = 0;
return(ret);
case (HDF_CHUNK | HDF_COMP): /* Chunked and compressed SDS
RLE, SKPHUFF or GZIP only */
*flags = 1;
for (i=0; i < rank; i++)
dim_length[rank-i-1] = chunk_def.comp.chunk_lengths[i];
ret = 0;
return(ret);
case (HDF_CHUNK | HDF_NBIT): /* Chunked and NBIT compressed SDS */
*flags = 2;
for (i=0; i < rank; i++)
dim_length[rank-i-1] = chunk_def.nbit.chunk_lengths[i];
ret = 0;
return(ret);
default:
return FAIL;
}
}
/*-----------------------------------------------------------------------------
* Name: scrcchnk
* Purpose: read the specified chunk of CHARACTER data to the buffer
* Inputs: id - data set ID
* start - origin of chunk to read
* Outputs: char_data - buffer the data will be read into
* Calls: scrchnk
* Reamrks: dimensions will be flipped in scrchnk function
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscrcchnk(intf *id, intf *start, _fcd char_data)
#else
nscrcchnk(id, start, char_data)
intf *id;
intf *start;
_fcd char_data;
#endif /* PROTOTYPE */
{
intf ret;
ret = nscrchnk(id, start, (VOIDP) _fcdtocp(char_data));
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scrchnk
* Purpose: read the specified chunk of NUMERIC data to the buffer
* Inputs: id - data set ID
* start - origin of chunk to read
* Outputs: num_data - buffer the data will be read into
* Calls: SDreadchunk
* Remarks: need to flip the dimensions to account for array ordering
* differencies (start --> cstart)
* If performance becomes an issue, use static cstart
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPEi
nscrchnk(intf *id, intf *start, VOIDP num_data)
#else
nscrchnk(id, start, num_data)
intf *id;
intf *start;
VOIDP num_data;
#endif /* PROTOTYPE */
{
intf ret;
int32 rank, status, i;
int32 *cstart;
int32 cdims[100], nt32, nattr32;
/* Get rank of SDS */
status = SDgetinfo(*id, NULL, &rank, cdims, &nt32, &nattr32);
if(status == FAIL) return FAIL;
/* Allocate memory for cstart array; use static array, if performance
becomes an issue */
cstart = (int32 *) HDmalloc(sizeof(int32) * rank);
if(!cstart) return FAIL;
/* Flip an array to account for array odering in Fortran and C */
for ( i=0; i < rank; i++)
cstart[i] = start[rank-i-1] - 1;
/* Call SDreadChunk function to read the data */
ret = SDreadchunk(*id, cstart, num_data);
/* Free memory */
HDfree((VOIDP)cstart);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scscchnk
* Purpose: set the maximum number of chunks to cache
* Inputs: id - data set ID
* maxcache - max number of chunks to cache
* flags - flags= 0, HDF_CACHEALL
* Currently only 0 can be passed
* Calls: SDsetchunkcache
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscscchnk(intf *id, intf *maxcache, intf *flags)
#else
nscscchnk(id, maxcache, flags)
intf *id;
intf *maxcache;
intf *flags;
#endif /* PROTOTYPE */
{
intf ret;
ret = SDsetchunkcache(*id, *maxcache, *flags);
return(ret);
}
/*-------------------------------------------------------------------------
* Name: scschnk
* Puporse: Call SDsetchunk
* Inputs: id: SDS access id
* dim_length: chunk dimensions
* comp_type: type of compression
* COMP_CODE_NONE (0)
* COMP_CODE_RLE (1)
* COMP_CODE_NBIT (2)
* COMP_CODE_SKPHUFF (3)
* COMP_CODE_DEFLATE (4)
* COMP_CODE_INVALID (5)
* comp_prm[0] = nbit_sign_ext,
* comp_prm[1] = nbit_fill_one,
* comp_prm[2] = nbit_start_bit,
* comp_prm[3] = nbit_bit_len: NBIT compression parametes
*
* comp_prm[0] = skphuff_skp_size: size of individual elements for
* Adaptive Huffman compression algorithm
* comp_prm[0] = deflate_level: GZIP compression parameter
* Returns: 0 on success, -1 on failure with error set
* Users: HDF Fortran programmers
*-------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscschnk(intf *id, intf *dim_length, intf *comp_type,
intf *comp_prm)
#else
nscschnk( id, dim_length, comp_type,
comp_prm)
intf *id;
intf *dim_length;
intf *comp_type;
intf *comp_prm;
#endif /* PROTOTYPE */
{
HDF_CHUNK_DEF chunk_def; /* Chunk definition set */
int32 sdsid; /* SDS id */
int32 cflags; /* chunk flags */
comp_info cinfo; /* compression info */
int i, CASE;
int32 rank, status;
intf ret;
int32 cdims[100], nt32, nattr32;
/* Get rank of SDS */
status = SDgetinfo((int32) *id, NULL , &rank, cdims, &nt32, &nattr32);
if(status == FAIL) return FAIL;
CASE = *comp_type;
sdsid = *id;
cflags = HDF_CHUNK | HDF_COMP;
switch (CASE) {
case 0: /* No compression */
cflags = HDF_CHUNK;
for (i=0; i < rank; i++)
chunk_def.chunk_lengths[i] = dim_length[rank-i-1];
break;
case 1: /* RLE compression */
cflags = HDF_CHUNK | HDF_COMP;
for (i=0; i < rank; i++)
chunk_def.comp.chunk_lengths[i] = dim_length[rank-i-1];
chunk_def.comp.comp_type = COMP_CODE_RLE;
break;
case 2: /* N-bit encoding */
cflags = HDF_CHUNK | HDF_NBIT;
for (i=0; i < rank; i++)
chunk_def.nbit.chunk_lengths[i] = dim_length[rank-i-1];
chunk_def.nbit.sign_ext = comp_prm[0];
chunk_def.nbit.fill_one = comp_prm[1];
chunk_def.nbit.start_bit = comp_prm[2];
chunk_def.nbit.bit_len = comp_prm[3];
break;
case 3: /* Skipping Huffman encoding */
cflags = HDF_CHUNK | HDF_COMP;
for (i=0; i < rank; i++)
chunk_def.comp.chunk_lengths[i] = dim_length[rank-i-1];
chunk_def.comp.comp_type = COMP_CODE_SKPHUFF;
chunk_def.comp.cinfo.skphuff.skp_size = comp_prm[0];
break;
case 4: /* GZIP compression */
cflags = HDF_CHUNK | HDF_COMP;
for (i=0; i < rank; i++)
chunk_def.comp.chunk_lengths[i] = dim_length[rank-i-1];
chunk_def.comp.comp_type = COMP_CODE_DEFLATE;
chunk_def.comp.cinfo.deflate.level = comp_prm[0];
break;
default:
return FAIL;
}
ret = SDsetchunk(sdsid, chunk_def, cflags);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scwcchnk
* Purpose: write the specified chunk of CHARACTER data to the SDS
* Inputs: id - data set ID
* start - origin of chunk to read
* Outputs: char_data - buffer the data will be read into
* Calls: scwchnk
* Reamrks: dimensions will be flipped in scrchnk function
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscwcchnk(intf *id, intf *start, _fcd char_data)
#else
nscwcchnk(id, start, char_data)
intf *id;
intf *start;
_fcd char_data;
#endif /* PROTOTYPE */
{
intf ret;
ret = nscwchnk(id, start, (VOIDP) _fcdtocp(char_data));
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scwchnk
* Purpose: write the specified chunk of NUMERIC data to the SDS
* Inputs: id - data set ID
* start - origin of chunk to write
* num_data - buffer for data
* Calls: SDwritechunk
* Remarks: need to flip the dimensions to account for array ordering
* differencies (start --> cstart)
* If performance becomes an issue, use static cstart
* Returns: 0 on success, -1 on failure with error set
*----------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscwchnk(intf *id, intf *start, VOIDP num_data)
#else
nscwchnk(id, start, num_data)
intf *id;
intf *start;
VOIDP num_data;
#endif /* PROTOTYPE */
{
intf ret;
int32 rank, status, i;
int32 *cstart;
int32 cdims[100], nt32, nattr32;
/* Get rank of SDS */
status = SDgetinfo(*id, NULL, &rank, cdims, &nt32, &nattr32);
if(status == FAIL) return FAIL;
/* Allocate memory for cstart array; use static array, if performance
becomes an issue */
cstart = (int32 *) HDmalloc(sizeof(int32) * rank);
if(!cstart) return FAIL;
/* Flip an array */
for ( i=0; i < rank; i++)
cstart[i] = start[rank-i-1] - 1;
/* Call SDwriteChunk function to write the data */
ret = SDwritechunk(*id, cstart, num_data);
/* Free memory */
HDfree((VOIDP)cstart);
return(ret);
}
/*-------------------------------------------------------------------------
* Name: scscompress
* Puporse: Call SDsetcompress
* Inputs: id: SDS access id
* comp_type: type of compression
* COMP_CODE_NONE = 0
* COMP_CODE_RLE = 1
* COMP_CODE_SKPHUFF = 3
* COMP_CODE_DEFLATE = 4
* comp_prm[0] = skphuff_skp_size: size of individual elements for
* Adaptive Huffman compression algorithm
* comp_prm[0] = deflate_level: GZIP compression parameter
* Returns: 0 on success, -1 on failure with error set
* Users: HDF Fortran programmers
*-------------------------------------------------------------------------*/
FRETVAL (intf)
#ifdef PROTOTYPE
nscscompress(intf *id, intf *comp_type, intf *comp_prm)
#else
nscscompress( id, comp_type, comp_prm)
intf *id;
intf *comp_type;
intf *comp_prm;
#endif /* PROTOTYPE */
{
int32 sdsid; /* SDS id */
comp_info c_info; /* compression info */
int32 c_type; /* compression type definition */
int i, CASE;
intf ret;
CASE = *comp_type;
sdsid = *id;
switch (CASE) {
case COMP_CODE_NONE: /* No compression */
c_type = COMP_CODE_NONE;
break;
case COMP_CODE_RLE: /* RLE compression */
c_type = COMP_CODE_RLE;
break;
case COMP_CODE_SKPHUFF: /* Skipping Huffman encoding */
c_type = COMP_CODE_SKPHUFF;
c_info.skphuff.skp_size = comp_prm[0];
break;
case COMP_CODE_DEFLATE: /* GZIP compression */
c_type = COMP_CODE_DEFLATE;
c_info.deflate.level = comp_prm[0];
break;
default:
return FAIL;
}
ret = SDsetcompress(sdsid, c_type, &c_info);
return(ret);
}
/*-----------------------------------------------------------------------------
* Name: scisrcrd
* Purpose: call SDisrecord to see if a dataset is a record variable
* Inputs: id: sds id
* Returns: TRUE/FALSE (1/0))
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nsfisrcrd(intf *id)
#else
nscisrcrd(id)
intf *id;
#endif /* PROTOTYPE */
{
return((intf) SDisrecord(*id));
}
/*-----------------------------------------------------------------------------
* Name: scsblsz
* Purpose: call SDsetblocksize
* Inputs: id: sd id
block_size: block size in bytes
* Returns: SUCCEED/FAIL (0/-1)
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscsblsz(intf *id, intf *block_size)
#else
nscsblsz(id, block_size)
intf *id;
intf *block_size;
#endif /* PROTOTYPE */
{
return((intf) SDsetblocksize(*id, *block_size));
}
#endif /* HDF */
/*-----------------------------------------------------------------------------
* Name: scchempty
* Purpose: call SDcheckempty
* Inputs: id: sd id
flag: TRUE/FALSE flag
* Returns: SUCCEED/FAIL (0/-1)
*---------------------------------------------------------------------------*/
FRETVAL(intf)
#ifdef PROTOTYPE
nscchempty(intf *id, intf *flag)
#else
nscchempty(id, flag)
intf *id;
intf *flag;
#endif /* PROTOTYPE */
{
intn flag_c;
intf status;
status = SDcheckempty(*id, &flag_c);
*flag = flag_c;
return(status);
}
|