From e7520597df65866686abb630e5dcf7fad250d722 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Mon, 27 Oct 2014 11:39:38 -0700 Subject: [PATCH] hds: Move v4 code to its own directory and it just builds the C library now. The Fortran wrapper is handled elsewhere. dat_par.h is now a fixed file and not dynamically generated. It is also not installed. Care must be taken to ensure that the constants are the same in all HDS implementations. DAT__SZLOC is only really used by the Fortran wrapper and is a fixed size. --- libraries/hds-v4/.gitignore | 10 + libraries/hds-v4/Makefile.am | 130 ++ libraries/hds-v4/bootstrap | 134 ++ libraries/hds-v4/component.xml | 51 + libraries/hds-v4/component.xml.in | 51 + libraries/hds-v4/configure.ac | 128 ++ libraries/{hds => hds-v4}/dat1.h | 24 +- libraries/{hds => hds-v4}/dat1_alloc_lcp.c | 0 libraries/{hds => hds-v4}/dat1_annul_lcp.c | 0 libraries/{hds => hds-v4}/dat1_check_mode.c | 0 libraries/{hds => hds-v4}/dat1_check_type.c | 0 libraries/{hds => hds-v4}/dat1_cvt_format.c | 0 libraries/{hds => hds-v4}/dat1_cvt_order.c | 0 libraries/{hds => hds-v4}/dat1_decoy.c | 0 libraries/{hds => hds-v4}/dat1_free_hdsloc.c | 0 libraries/{hds => hds-v4}/dat1_get_ncomp.c | 0 libraries/{hds => hds-v4}/dat1_get_odl.c | 0 libraries/{hds => hds-v4}/dat1_getenv.c | 0 libraries/{hds => hds-v4}/dat1_import_loc.c | 0 libraries/{hds => hds-v4}/dat1_init.c | 0 libraries/{hds => hds-v4}/dat1_init_ndr.c | 0 libraries/{hds => hds-v4}/dat1_intune.c | 0 libraries/{hds => hds-v4}/dat1_locate_name.c | 0 libraries/{hds => hds-v4}/dat1_pack_crv.c | 0 libraries/{hds => hds-v4}/dat1_pack_odl.c | 0 libraries/{hds => hds-v4}/dat1_pack_srv.c | 0 libraries/{hds => hds-v4}/dat1_put_ncomp.c | 0 libraries/{hds => hds-v4}/dat1_put_odl.c | 0 libraries/{hds => hds-v4}/dat1_show_ndr.c | 0 libraries/{hds => hds-v4}/dat1_unpack_crv.c | 0 libraries/{hds => hds-v4}/dat1_unpack_odl.c | 0 libraries/{hds => hds-v4}/dat1_unpack_srv.c | 0 libraries/{hds => hds-v4}/dat1_unpack_type.c | 0 libraries/{hds => hds-v4}/dat1emsSetBigi.c | 0 libraries/{hds => hds-v4}/dat1emsSetBigu.c | 0 libraries/{hds => hds-v4}/dat1emsSetHdsdim.c | 0 libraries/{hds => hds-v4}/datChscn.c | 0 libraries/{hds => hds-v4}/datClen.c | 0 libraries/{hds => hds-v4}/datCopy.c | 0 libraries/{hds => hds-v4}/datDrep.c | 0 libraries/{hds => hds-v4}/datErmsg.c | 0 libraries/{hds => hds-v4}/datGet1C.c | 0 libraries/{hds => hds-v4}/datGetVC.c | 0 libraries/{hds => hds-v4}/datMapN.c | 0 libraries/{hds => hds-v4}/datMsg.c | 0 libraries/{hds => hds-v4}/datParen.c | 0 libraries/{hds => hds-v4}/datPrec.c | 0 libraries/{hds => hds-v4}/datPrmry.c | 0 libraries/{hds => hds-v4}/datPut1C.c | 0 libraries/{hds => hds-v4}/datPutVC.c | 0 libraries/{hds => hds-v4}/datRef.c | 0 libraries/{hds => hds-v4}/datRefct.c | 0 libraries/{hds => hds-v4}/datWhere.c | 0 libraries/hds-v4/dat_err.msg | 56 + libraries/hds-v4/dat_par.h | 85 ++ libraries/{hds => hds-v4}/datalter.c | 0 libraries/{hds => hds-v4}/datannul.c | 0 libraries/{hds => hds-v4}/datccopy.c | 0 libraries/{hds => hds-v4}/daterase.c | 0 libraries/{hds => hds-v4}/datfinind.c | 0 libraries/{hds => hds-v4}/datget.c | 0 libraries/{hds => hds-v4}/datget0x.c | 0 libraries/{hds => hds-v4}/datinq.c | 0 libraries/{hds => hds-v4}/datlocops.c | 0 libraries/{hds => hds-v4}/datmap.c | 0 libraries/{hds => hds-v4}/datmove.c | 0 libraries/{hds => hds-v4}/datnew.c | 0 libraries/{hds => hds-v4}/datnew0.c | 0 libraries/{hds => hds-v4}/datput.c | 0 libraries/{hds => hds-v4}/datput0x.c | 0 libraries/{hds => hds-v4}/dattemp.c | 0 libraries/{hds => hds-v4}/daucheck.c | 0 libraries/{hds => hds-v4}/daucnv.c | 0 libraries/{hds => hds-v4}/daucopy.c | 0 libraries/{hds => hds-v4}/dauflush.c | 0 libraries/{hds => hds-v4}/dauloc.c | 0 libraries/{hds => hds-v4}/daumove.c | 0 libraries/{hds => hds-v4}/dauscatgath.c | 0 libraries/{hds => hds-v4}/daushape.c | 0 libraries/{hds => hds-v4}/dautypes.c | 0 libraries/hds-v4/hds-v4.news | 63 + libraries/hds-v4/hds.h | 1117 +++++++++++++++++ libraries/{hds => hds-v4}/hds1.h | 0 libraries/{hds => hds-v4}/hds1_cleanup.c | 0 libraries/{hds => hds-v4}/hds1_exit.c | 0 libraries/{hds => hds-v4}/hds2.h | 0 libraries/{hds => hds-v4}/hdsCopy.c | 0 libraries/{hds => hds-v4}/hdsEwild.c | 0 libraries/{hds => hds-v4}/hdsGtune.c | 0 libraries/{hds => hds-v4}/hdsInfoI.c | 0 libraries/{hds => hds-v4}/hdsState.c | 0 libraries/{hds => hds-v4}/hdsStop.c | 0 libraries/hds-v4/hdsTest.c | 486 +++++++ libraries/{hds => hds-v4}/hdsTune.c | 0 libraries/{hds => hds-v4}/hdsWild.c | 0 libraries/{hds => hds-v4}/hds_dev/hdsdump.c | 0 libraries/{hds => hds-v4}/hds_globals.c | 0 libraries/{hds => hds-v4}/hds_machine.c | 0 libraries/{hds => hds-v4}/hds_start.c | 0 libraries/{hds => hds-v4}/hds_test_prm.c | 0 libraries/hds-v4/hds_v4.h | 1114 ++++++++++++++++ libraries/hds-v4/hds_v4_map.h | 154 +++ libraries/{hds => hds-v4}/hdserase.c | 0 libraries/{hds => hds-v4}/hdsgroup.c | 0 libraries/{hds => hds-v4}/hdslock.c | 0 libraries/{hds => hds-v4}/hdsnew.c | 0 libraries/{hds => hds-v4}/hdsnull.c | 0 libraries/{hds => hds-v4}/hdsopclos.c | 0 libraries/{hds => hds-v4}/hdstools.c | 0 libraries/hds-v4/make-hds-types.c | 373 ++++++ libraries/{hds => hds-v4}/rec.h | 0 libraries/{hds => hds-v4}/rec1.h | 0 libraries/{hds => hds-v4}/rec1_alloc_frame.c | 0 libraries/{hds => hds-v4}/rec1_clear_cbm.c | 0 libraries/{hds => hds-v4}/rec1_close_file.c | 0 libraries/{hds => hds-v4}/rec1_close_slot.c | 0 libraries/{hds => hds-v4}/rec1_create_file.c | 0 libraries/{hds => hds-v4}/rec1_deall_frame.c | 0 libraries/{hds => hds-v4}/rec1_extend_file.c | 0 libraries/{hds => hds-v4}/rec1_extend_frame.c | 0 libraries/{hds => hds-v4}/rec1_find_file.c | 0 libraries/{hds => hds-v4}/rec1_flush_block.c | 0 libraries/{hds => hds-v4}/rec1_fmsg.c | 0 libraries/{hds => hds-v4}/rec1_get_fid.c | 0 libraries/{hds => hds-v4}/rec1_get_path.c | 0 libraries/{hds => hds-v4}/rec1_getcwd.c | 0 libraries/{hds => hds-v4}/rec1_locate_hcb.c | 0 libraries/{hds => hds-v4}/rec1_lock_slot.c | 0 libraries/{hds => hds-v4}/rec1_map_frame.c | 0 libraries/{hds => hds-v4}/rec1_open_file.c | 0 libraries/{hds => hds-v4}/rec1_pack_chain.c | 0 libraries/{hds => hds-v4}/rec1_pack_hcb.c | 0 libraries/{hds => hds-v4}/rec1_pack_ncomp.c | 0 libraries/{hds => hds-v4}/rec1_pack_rcl.c | 0 libraries/{hds => hds-v4}/rec1_read_file.c | 0 libraries/{hds => hds-v4}/rec1_save_addr.c | 0 libraries/{hds => hds-v4}/rec1_scan_cbm.c | 0 libraries/{hds => hds-v4}/rec1_set_cbm.c | 0 libraries/{hds => hds-v4}/rec1_shell.c | 0 libraries/{hds => hds-v4}/rec1_test_cbm.c | 0 libraries/{hds => hds-v4}/rec1_unlock_slot.c | 0 libraries/{hds => hds-v4}/rec1_unmap_frame.c | 0 libraries/{hds => hds-v4}/rec1_unpack_chain.c | 0 libraries/{hds => hds-v4}/rec1_unpack_hcb.c | 0 libraries/{hds => hds-v4}/rec1_unpack_ncomp.c | 0 libraries/{hds => hds-v4}/rec1_unpack_rcl.c | 0 libraries/{hds => hds-v4}/rec1_update_free.c | 0 libraries/{hds => hds-v4}/rec1_write_file.c | 0 libraries/{hds => hds-v4}/rec_adopt_record.c | 0 libraries/{hds => hds-v4}/rec_alloc_mem.c | 0 libraries/{hds => hds-v4}/rec_alloc_xmem.c | 0 libraries/{hds => hds-v4}/rec_attach_file.c | 0 libraries/{hds => hds-v4}/rec_close_file.c | 0 libraries/{hds => hds-v4}/rec_count_files.c | 0 libraries/{hds => hds-v4}/rec_create_record.c | 0 libraries/{hds => hds-v4}/rec_deall_mem.c | 0 libraries/{hds => hds-v4}/rec_deall_xmem.c | 0 libraries/{hds => hds-v4}/rec_delete_record.c | 0 libraries/{hds => hds-v4}/rec_end_wild.c | 0 libraries/{hds => hds-v4}/rec_extend_record.c | 0 libraries/{hds => hds-v4}/rec_get_handle.c | 0 libraries/{hds => hds-v4}/rec_get_rcl.c | 0 libraries/{hds => hds-v4}/rec_get_rid.c | 0 libraries/{hds => hds-v4}/rec_list_files.c | 0 libraries/{hds => hds-v4}/rec_locate_block.c | 0 libraries/{hds => hds-v4}/rec_locate_data.c | 0 libraries/{hds => hds-v4}/rec_locate_fns.c | 0 libraries/{hds => hds-v4}/rec_lock.c | 0 libraries/{hds => hds-v4}/rec_mark_delete.c | 0 libraries/{hds => hds-v4}/rec_reall_mem.c | 0 libraries/{hds => hds-v4}/rec_refcnt.c | 0 libraries/{hds => hds-v4}/rec_release_block.c | 0 libraries/{hds => hds-v4}/rec_release_data.c | 0 libraries/{hds => hds-v4}/rec_reset_record.c | 0 libraries/{hds => hds-v4}/rec_same_file.c | 0 libraries/{hds => hds-v4}/rec_shrink_record.c | 0 libraries/{hds => hds-v4}/rec_start.c | 0 libraries/{hds => hds-v4}/rec_stop.c | 0 libraries/{hds => hds-v4}/rec_unlock.c | 0 libraries/{hds => hds-v4}/rec_where.c | 0 libraries/{hds => hds-v4}/rec_wild_file.c | 0 libraries/{hds => hds-v4}/rtl_fixups.c | 0 libraries/{hds => hds-v4}/str.h | 0 libraries/{hds => hds-v4}/win_fixups.c | 0 libraries/{hds => hds-v4}/win_fixups.h | 0 libraries/hds/dat_par_h.c | 196 --- 186 files changed, 3956 insertions(+), 216 deletions(-) create mode 100644 libraries/hds-v4/.gitignore create mode 100644 libraries/hds-v4/Makefile.am create mode 100755 libraries/hds-v4/bootstrap create mode 100644 libraries/hds-v4/component.xml create mode 100644 libraries/hds-v4/component.xml.in create mode 100644 libraries/hds-v4/configure.ac rename libraries/{hds => hds-v4}/dat1.h (93%) rename libraries/{hds => hds-v4}/dat1_alloc_lcp.c (100%) rename libraries/{hds => hds-v4}/dat1_annul_lcp.c (100%) rename libraries/{hds => hds-v4}/dat1_check_mode.c (100%) rename libraries/{hds => hds-v4}/dat1_check_type.c (100%) rename libraries/{hds => hds-v4}/dat1_cvt_format.c (100%) rename libraries/{hds => hds-v4}/dat1_cvt_order.c (100%) rename libraries/{hds => hds-v4}/dat1_decoy.c (100%) rename libraries/{hds => hds-v4}/dat1_free_hdsloc.c (100%) rename libraries/{hds => hds-v4}/dat1_get_ncomp.c (100%) rename libraries/{hds => hds-v4}/dat1_get_odl.c (100%) rename libraries/{hds => hds-v4}/dat1_getenv.c (100%) rename libraries/{hds => hds-v4}/dat1_import_loc.c (100%) rename libraries/{hds => hds-v4}/dat1_init.c (100%) rename libraries/{hds => hds-v4}/dat1_init_ndr.c (100%) rename libraries/{hds => hds-v4}/dat1_intune.c (100%) rename libraries/{hds => hds-v4}/dat1_locate_name.c (100%) rename libraries/{hds => hds-v4}/dat1_pack_crv.c (100%) rename libraries/{hds => hds-v4}/dat1_pack_odl.c (100%) rename libraries/{hds => hds-v4}/dat1_pack_srv.c (100%) rename libraries/{hds => hds-v4}/dat1_put_ncomp.c (100%) rename libraries/{hds => hds-v4}/dat1_put_odl.c (100%) rename libraries/{hds => hds-v4}/dat1_show_ndr.c (100%) rename libraries/{hds => hds-v4}/dat1_unpack_crv.c (100%) rename libraries/{hds => hds-v4}/dat1_unpack_odl.c (100%) rename libraries/{hds => hds-v4}/dat1_unpack_srv.c (100%) rename libraries/{hds => hds-v4}/dat1_unpack_type.c (100%) rename libraries/{hds => hds-v4}/dat1emsSetBigi.c (100%) rename libraries/{hds => hds-v4}/dat1emsSetBigu.c (100%) rename libraries/{hds => hds-v4}/dat1emsSetHdsdim.c (100%) rename libraries/{hds => hds-v4}/datChscn.c (100%) rename libraries/{hds => hds-v4}/datClen.c (100%) rename libraries/{hds => hds-v4}/datCopy.c (100%) rename libraries/{hds => hds-v4}/datDrep.c (100%) rename libraries/{hds => hds-v4}/datErmsg.c (100%) rename libraries/{hds => hds-v4}/datGet1C.c (100%) rename libraries/{hds => hds-v4}/datGetVC.c (100%) rename libraries/{hds => hds-v4}/datMapN.c (100%) rename libraries/{hds => hds-v4}/datMsg.c (100%) rename libraries/{hds => hds-v4}/datParen.c (100%) rename libraries/{hds => hds-v4}/datPrec.c (100%) rename libraries/{hds => hds-v4}/datPrmry.c (100%) rename libraries/{hds => hds-v4}/datPut1C.c (100%) rename libraries/{hds => hds-v4}/datPutVC.c (100%) rename libraries/{hds => hds-v4}/datRef.c (100%) rename libraries/{hds => hds-v4}/datRefct.c (100%) rename libraries/{hds => hds-v4}/datWhere.c (100%) create mode 100644 libraries/hds-v4/dat_err.msg create mode 100644 libraries/hds-v4/dat_par.h rename libraries/{hds => hds-v4}/datalter.c (100%) rename libraries/{hds => hds-v4}/datannul.c (100%) rename libraries/{hds => hds-v4}/datccopy.c (100%) rename libraries/{hds => hds-v4}/daterase.c (100%) rename libraries/{hds => hds-v4}/datfinind.c (100%) rename libraries/{hds => hds-v4}/datget.c (100%) rename libraries/{hds => hds-v4}/datget0x.c (100%) rename libraries/{hds => hds-v4}/datinq.c (100%) rename libraries/{hds => hds-v4}/datlocops.c (100%) rename libraries/{hds => hds-v4}/datmap.c (100%) rename libraries/{hds => hds-v4}/datmove.c (100%) rename libraries/{hds => hds-v4}/datnew.c (100%) rename libraries/{hds => hds-v4}/datnew0.c (100%) rename libraries/{hds => hds-v4}/datput.c (100%) rename libraries/{hds => hds-v4}/datput0x.c (100%) rename libraries/{hds => hds-v4}/dattemp.c (100%) rename libraries/{hds => hds-v4}/daucheck.c (100%) rename libraries/{hds => hds-v4}/daucnv.c (100%) rename libraries/{hds => hds-v4}/daucopy.c (100%) rename libraries/{hds => hds-v4}/dauflush.c (100%) rename libraries/{hds => hds-v4}/dauloc.c (100%) rename libraries/{hds => hds-v4}/daumove.c (100%) rename libraries/{hds => hds-v4}/dauscatgath.c (100%) rename libraries/{hds => hds-v4}/daushape.c (100%) rename libraries/{hds => hds-v4}/dautypes.c (100%) create mode 100644 libraries/hds-v4/hds-v4.news create mode 100644 libraries/hds-v4/hds.h rename libraries/{hds => hds-v4}/hds1.h (100%) rename libraries/{hds => hds-v4}/hds1_cleanup.c (100%) rename libraries/{hds => hds-v4}/hds1_exit.c (100%) rename libraries/{hds => hds-v4}/hds2.h (100%) rename libraries/{hds => hds-v4}/hdsCopy.c (100%) rename libraries/{hds => hds-v4}/hdsEwild.c (100%) rename libraries/{hds => hds-v4}/hdsGtune.c (100%) rename libraries/{hds => hds-v4}/hdsInfoI.c (100%) rename libraries/{hds => hds-v4}/hdsState.c (100%) rename libraries/{hds => hds-v4}/hdsStop.c (100%) create mode 100644 libraries/hds-v4/hdsTest.c rename libraries/{hds => hds-v4}/hdsTune.c (100%) rename libraries/{hds => hds-v4}/hdsWild.c (100%) rename libraries/{hds => hds-v4}/hds_dev/hdsdump.c (100%) rename libraries/{hds => hds-v4}/hds_globals.c (100%) rename libraries/{hds => hds-v4}/hds_machine.c (100%) rename libraries/{hds => hds-v4}/hds_start.c (100%) rename libraries/{hds => hds-v4}/hds_test_prm.c (100%) create mode 100644 libraries/hds-v4/hds_v4.h create mode 100644 libraries/hds-v4/hds_v4_map.h rename libraries/{hds => hds-v4}/hdserase.c (100%) rename libraries/{hds => hds-v4}/hdsgroup.c (100%) rename libraries/{hds => hds-v4}/hdslock.c (100%) rename libraries/{hds => hds-v4}/hdsnew.c (100%) rename libraries/{hds => hds-v4}/hdsnull.c (100%) rename libraries/{hds => hds-v4}/hdsopclos.c (100%) rename libraries/{hds => hds-v4}/hdstools.c (100%) create mode 100644 libraries/hds-v4/make-hds-types.c rename libraries/{hds => hds-v4}/rec.h (100%) rename libraries/{hds => hds-v4}/rec1.h (100%) rename libraries/{hds => hds-v4}/rec1_alloc_frame.c (100%) rename libraries/{hds => hds-v4}/rec1_clear_cbm.c (100%) rename libraries/{hds => hds-v4}/rec1_close_file.c (100%) rename libraries/{hds => hds-v4}/rec1_close_slot.c (100%) rename libraries/{hds => hds-v4}/rec1_create_file.c (100%) rename libraries/{hds => hds-v4}/rec1_deall_frame.c (100%) rename libraries/{hds => hds-v4}/rec1_extend_file.c (100%) rename libraries/{hds => hds-v4}/rec1_extend_frame.c (100%) rename libraries/{hds => hds-v4}/rec1_find_file.c (100%) rename libraries/{hds => hds-v4}/rec1_flush_block.c (100%) rename libraries/{hds => hds-v4}/rec1_fmsg.c (100%) rename libraries/{hds => hds-v4}/rec1_get_fid.c (100%) rename libraries/{hds => hds-v4}/rec1_get_path.c (100%) rename libraries/{hds => hds-v4}/rec1_getcwd.c (100%) rename libraries/{hds => hds-v4}/rec1_locate_hcb.c (100%) rename libraries/{hds => hds-v4}/rec1_lock_slot.c (100%) rename libraries/{hds => hds-v4}/rec1_map_frame.c (100%) rename libraries/{hds => hds-v4}/rec1_open_file.c (100%) rename libraries/{hds => hds-v4}/rec1_pack_chain.c (100%) rename libraries/{hds => hds-v4}/rec1_pack_hcb.c (100%) rename libraries/{hds => hds-v4}/rec1_pack_ncomp.c (100%) rename libraries/{hds => hds-v4}/rec1_pack_rcl.c (100%) rename libraries/{hds => hds-v4}/rec1_read_file.c (100%) rename libraries/{hds => hds-v4}/rec1_save_addr.c (100%) rename libraries/{hds => hds-v4}/rec1_scan_cbm.c (100%) rename libraries/{hds => hds-v4}/rec1_set_cbm.c (100%) rename libraries/{hds => hds-v4}/rec1_shell.c (100%) rename libraries/{hds => hds-v4}/rec1_test_cbm.c (100%) rename libraries/{hds => hds-v4}/rec1_unlock_slot.c (100%) rename libraries/{hds => hds-v4}/rec1_unmap_frame.c (100%) rename libraries/{hds => hds-v4}/rec1_unpack_chain.c (100%) rename libraries/{hds => hds-v4}/rec1_unpack_hcb.c (100%) rename libraries/{hds => hds-v4}/rec1_unpack_ncomp.c (100%) rename libraries/{hds => hds-v4}/rec1_unpack_rcl.c (100%) rename libraries/{hds => hds-v4}/rec1_update_free.c (100%) rename libraries/{hds => hds-v4}/rec1_write_file.c (100%) rename libraries/{hds => hds-v4}/rec_adopt_record.c (100%) rename libraries/{hds => hds-v4}/rec_alloc_mem.c (100%) rename libraries/{hds => hds-v4}/rec_alloc_xmem.c (100%) rename libraries/{hds => hds-v4}/rec_attach_file.c (100%) rename libraries/{hds => hds-v4}/rec_close_file.c (100%) rename libraries/{hds => hds-v4}/rec_count_files.c (100%) rename libraries/{hds => hds-v4}/rec_create_record.c (100%) rename libraries/{hds => hds-v4}/rec_deall_mem.c (100%) rename libraries/{hds => hds-v4}/rec_deall_xmem.c (100%) rename libraries/{hds => hds-v4}/rec_delete_record.c (100%) rename libraries/{hds => hds-v4}/rec_end_wild.c (100%) rename libraries/{hds => hds-v4}/rec_extend_record.c (100%) rename libraries/{hds => hds-v4}/rec_get_handle.c (100%) rename libraries/{hds => hds-v4}/rec_get_rcl.c (100%) rename libraries/{hds => hds-v4}/rec_get_rid.c (100%) rename libraries/{hds => hds-v4}/rec_list_files.c (100%) rename libraries/{hds => hds-v4}/rec_locate_block.c (100%) rename libraries/{hds => hds-v4}/rec_locate_data.c (100%) rename libraries/{hds => hds-v4}/rec_locate_fns.c (100%) rename libraries/{hds => hds-v4}/rec_lock.c (100%) rename libraries/{hds => hds-v4}/rec_mark_delete.c (100%) rename libraries/{hds => hds-v4}/rec_reall_mem.c (100%) rename libraries/{hds => hds-v4}/rec_refcnt.c (100%) rename libraries/{hds => hds-v4}/rec_release_block.c (100%) rename libraries/{hds => hds-v4}/rec_release_data.c (100%) rename libraries/{hds => hds-v4}/rec_reset_record.c (100%) rename libraries/{hds => hds-v4}/rec_same_file.c (100%) rename libraries/{hds => hds-v4}/rec_shrink_record.c (100%) rename libraries/{hds => hds-v4}/rec_start.c (100%) rename libraries/{hds => hds-v4}/rec_stop.c (100%) rename libraries/{hds => hds-v4}/rec_unlock.c (100%) rename libraries/{hds => hds-v4}/rec_where.c (100%) rename libraries/{hds => hds-v4}/rec_wild_file.c (100%) rename libraries/{hds => hds-v4}/rtl_fixups.c (100%) rename libraries/{hds => hds-v4}/str.h (100%) rename libraries/{hds => hds-v4}/win_fixups.c (100%) rename libraries/{hds => hds-v4}/win_fixups.h (100%) delete mode 100644 libraries/hds/dat_par_h.c diff --git a/libraries/hds-v4/.gitignore b/libraries/hds-v4/.gitignore new file mode 100644 index 00000000000..6744e40fd87 --- /dev/null +++ b/libraries/hds-v4/.gitignore @@ -0,0 +1,10 @@ +/hds1_types.h +/hds_machine +/hds_machine.txt +/hds_types.h +/hdsdump_v4 +/make-hds-types +/hdsTest +/hds_test +/hds_test_prm +/sun92.pdf diff --git a/libraries/hds-v4/Makefile.am b/libraries/hds-v4/Makefile.am new file mode 100644 index 00000000000..d9662dac0d9 --- /dev/null +++ b/libraries/hds-v4/Makefile.am @@ -0,0 +1,130 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = hdsdump_v4 +noinst_PROGRAMS = hds_machine make-hds-types +starhelp_DATA = hds_machine.txt + +lib_LTLIBRARIES = libhds_v4.la + +TESTS = hdsTest hds_test_prm +check_PROGRAMS = hdsTest hds_test_prm + +libhds_v4_la_SOURCES = \ + $(PUBLIC_INCLUDES) \ + $(PUBLIC_CINCLUDES) \ + $(noinst_MESSAGES) \ + $(PRIVATE_INCLUDES) \ + $(C_ROUTINES) + +libhds_v4_la_LIBADD = `starmem_link` `ems_link` + +# Make all library code position independent. This is handy for creating +# shareable libraries from the static ones (Java JNI libraries). +if !NOPIC +libhds_v4_la_CFLAGS = $(AM_CFLAGS) -prefer-pic +endif + +hds_machine_SOURCES = hds_machine.c +hds_machine_LDADD = libhds_v4.la + +make_hds_types_SOURCES = make-hds-types.c + +hdsdump_v4_SOURCES = hds_dev/hdsdump.c +hdsdump_v4_LDADD = libhds_v4.la + +hdsTest_SOURCES = hdsTest.c +hdsTest_LDADD = libhds_v4.la + +hds_test_prm_SOURCES = hds_test_prm.c +hds_test_prm_LDADD = libhds_v4.la + +cincludedir = $(includedir)/star +cinclude_HEADERS = $(PUBLIC_CINCLUDES) +noinst_MESSAGES = dat_err.h + +# dat_par.h was previously released so must go in the root include dir +PUBLIC_CINCLUDES = hds_v4.h hds_types.h + +PRIVATE_INCLUDES = \ + dat_par.h hds.h \ + dat1.h hds1.h hds2.h hds1_types.h \ + rec.h rec1.h str.h \ + win_fixups.h \ + $(noinst_MESSAGES) + +C_ROUTINES = \ + dat1_alloc_lcp.c dat1_annul_lcp.c dat1_check_mode.c \ + dat1_check_type.c dat1_cvt_format.c dat1_cvt_order.c \ + dat1_decoy.c dat1_get_ncomp.c dat1_get_odl.c dat1_getenv.c \ + dat1_import_loc.c dat1_init.c dat1_init_ndr.c dat1_intune.c \ + dat1_locate_name.c dat1_pack_crv.c dat1_pack_odl.c \ + dat1_pack_srv.c dat1_put_ncomp.c dat1_put_odl.c \ + dat1_show_ndr.c dat1_unpack_crv.c dat1_unpack_odl.c \ + dat1_unpack_srv.c dat1_unpack_type.c \ + dat1_free_hdsloc.c \ + datClen.c datCopy.c datMsg.c datRef.c \ + datDrep.c datErmsg.c datParen.c datPrec.c datPrmry.c datRefct.c \ + datWhere.c datalter.c datannul.c datccopy.c daterase.c datfinind.c \ + datget.c datget0x.c datinq.c datlocops.c datmap.c datmove.c datnew.c \ + datnew0.c datMapN.c datPut1C.c datPutVC.c datGet1C.c datGetVC.c \ + datChscn.c \ + datput.c datput0x.c dattemp.c daucheck.c daucnv.c daucopy.c \ + dauflush.c \ + dauloc.c daumove.c dauscatgath.c daushape.c dautypes.c \ + hds1_cleanup.c \ + hds1_exit.c hdsCopy.c hdsEwild.c hds_globals.c hdsGtune.c \ + hdsState.c hdsStop.c hdsTune.c \ + hdsWild.c hdserase.c hdsgroup.c hdslock.c hdsnew.c hdsnull.c \ + hdsopclos.c hdstools.c hdsInfoI.c \ + dat1emsSetBigi.c dat1emsSetBigu.c dat1emsSetHdsdim.c \ + rec1_alloc_frame.c rec1_clear_cbm.c rec1_close_file.c \ + rec1_close_slot.c rec1_create_file.c rec1_deall_frame.c \ + rec1_extend_file.c rec1_extend_frame.c rec1_find_file.c \ + rec1_flush_block.c rec1_fmsg.c rec1_get_fid.c rec1_get_path.c \ + rec1_getcwd.c rec1_locate_hcb.c rec1_lock_slot.c \ + rec1_map_frame.c rec1_open_file.c rec1_pack_chain.c \ + rec1_pack_hcb.c rec1_pack_ncomp.c rec1_pack_rcl.c \ + rec1_read_file.c rec1_save_addr.c rec1_scan_cbm.c \ + rec1_set_cbm.c rec1_shell.c rec1_test_cbm.c rec1_unlock_slot.c \ + rec1_unmap_frame.c rec1_unpack_chain.c rec1_unpack_hcb.c \ + rec1_unpack_ncomp.c rec1_unpack_rcl.c rec1_update_free.c \ + rec1_write_file.c \ + \ + rec_adopt_record.c rec_alloc_mem.c rec_alloc_xmem.c \ + rec_attach_file.c rec_close_file.c rec_create_record.c \ + rec_count_files.c \ + rec_deall_mem.c rec_deall_xmem.c rec_delete_record.c \ + rec_end_wild.c rec_extend_record.c rec_get_handle.c \ + rec_get_rcl.c rec_get_rid.c rec_list_files.c \ + rec_locate_block.c rec_locate_data.c rec_locate_fns.c \ + rec_lock.c rec_mark_delete.c rec_reall_mem.c rec_refcnt.c \ + rec_release_block.c rec_release_data.c rec_reset_record.c \ + rec_same_file.c rec_shrink_record.c rec_start.c rec_stop.c \ + rec_unlock.c rec_where.c rec_wild_file.c \ + rtl_fixups.c \ + win_fixups.c \ + hds_start.c + +hds_types.h: make-hds-types$(EXEEXT) + ./make-hds-types + +hds1_types.h: make-hds-types$(EXEEXT) + ./make-hds-types + +hds_machine.txt: hds_machine$(EXEEXT) + echo "Machine characteristics, as determined by HDS" >$@ + echo "" >>$@ + ./hds_machine >>$@ + +# Have to make sure that hds_types appears before DAT_PAR so that +# the include file generation routines are built in the correct order +BUILT_SOURCES = hds_types.h hds1_types.h \ + $(include_MESSAGES) $(noinst_MESSAGES) + +CLEANFILES = hds_machine.txt DAT_ERR dat_err.h \ + hds_types.h hds1_types.h + +dist_starnews_DATA = hds-v4.news + +EXTRA_DIST = dat_err.msg + diff --git a/libraries/hds-v4/bootstrap b/libraries/hds-v4/bootstrap new file mode 100755 index 00000000000..b1b79e9efd6 --- /dev/null +++ b/libraries/hds-v4/bootstrap @@ -0,0 +1,134 @@ +#! /bin/sh - +# original bootstrap file, installed by starconf 1.3, rnum=1003000 +# If you _need_ to change this file, delete `original' in the line above, +# or else starconf may overwrite it with an updated version. +# +# bootstrap.installed. Generated from bootstrap.installed.in by configure. +# +# Bootstrap a checked-out component of the Starlink software tree. +# Run this script in a freshly checked-out directory to bring the +# system to the point where you can just type ./configure;make +# +# Usage: +# ./bootstrap + + +# This script should be installed, by starconf, in all `component +# directories'. A `component directory' is a directory which has a +# component.xml.in file in it. All component directories will have a +# manifest file created and installed in .../manifests; non-component +# directories will not have manifest files. Everything that's +# installed should be installed as part of some component +# or other. +# +# The ./bootstrap scripts will stop recursing when they find a +# component.xml.in file. They'll warn if they find a component.xml.in +# file in any AC_CONFIG_SUBDIRS directory, but ignore it, and exit +# with an error if they do not find a component.xml.in file and there +# are no AC_CONFIG_SUBDIRS directories in which to search further. +# That is, the tree of directories which the top-level bootstrap +# traverses should have component.xml.in files at or above all its +# leaves. + + +# The starconf below might update bootstrap, if a newer version is +# available. Unfortunately, this confuses sh, which appears _not_ to +# keep open the script it's reading, but to reopen it afresh, or reseek +# within the file, for each line (or something like that!?). +# So rewrite this script to a temporary file and exec it. +tempfile="${TMP-/tmp}/$0-$$.tmp" +rm -f $tempfile +echo "trap 'rm -f $tempfile' 0" >$tempfile # remove temporary at exit +sed '1,/^--TRAMPOLINE--/d' $0 >>$tempfile # strip out the trampoline +exec /bin/sh $tempfile # exec the temporary +--TRAMPOLINE-- + + +echo "Bootstrapping `pwd` ..." + +if test ! -f configure.ac; then + echo "bootstrap: No configure.ac in directory `pwd`" >&2 + exit 1 +fi + +subdirs=`autoconf --trace=AC_CONFIG_SUBDIRS:$% configure.ac` + +if test -f component.xml.in; then + + if starconf --show buildsupport >/dev/null 2>&1; then + + # starconf is in the path + echo "...using starconf in " `starconf --show buildsupport` + starconf || exit 1 + + else + + # The temptation here is to use ./starconf.status to find the + # starconf that it came from and invoke that explicitly. Don't do + # this, however: we don't want to be too clever, and it's better + # to be consistent with the way the autotools behave (the first + # one in your path is the one that works, and they don't have this + # sort of `phone home' cleverness in them). + + echo "bootstrap error: The starconf application is not in your path" + + # This doesn't stop us being helpful, however. + if test -f ./starconf.status; then + starconf_home=`./starconf.status --show buildsupport` + echo "This directory was last bootstrapped with $starconf_home/bin/starconf" + fi + + exit 1 + fi + + # Check that there are no component.xml.in files in any subdirectories + if test -n "$subdirs"; then + for d in $subdirs + do + if test -d "$d" && test -f "$d/component.xml.in"; then + echo "bootstrap: warning: ignoring child $d/component.xml.in" >&2 + fi + done + fi + + # If STAR_SUPPRESS_AUTORECONF is true in the environment, then we + # suppress the call of `autoreconf'. This is here _only_ so that + # the top-level bootstrap file can suppress multiple calls of this + # in bootstrap scripts in its children. This mechanism must not + # be used by users, as it is likely to change without warning. + if ${STAR_SUPPRESS_AUTORECONF-false}; then + echo "Suppressing autoreconf in" `pwd` + else + echo autoreconf --install --symlink + autoreconf --install --symlink || exit 1 + fi + +else + + # This is not a component directory, so simply recurse into the children. + + # ...if there are any, that is. + if test -z "$subdirs"; then + echo "bootstrap: error: non-component directory `pwd` has no subdirs" >&2 + exit 1 + fi + + # Bootstrap the child directories mentioned in AC_CONFIG_SUBDIRS. + # These bootstrap files must exist. + for d in $subdirs + do + if test -d "$d"; then + echo "Bootstrapping $d..." + if test -f $d/bootstrap; then + # good... + (cd $d; /bin/sh ./bootstrap) + else + echo "bootstrap: no file $d/bootstrap" >&2 + exit 1 + fi + fi + done + +fi + +exit 0 diff --git a/libraries/hds-v4/component.xml b/libraries/hds-v4/component.xml new file mode 100644 index 00000000000..4e9a47d2f0d --- /dev/null +++ b/libraries/hds-v4/component.xml @@ -0,0 +1,51 @@ + + + + + + 5.1-1 + libraries/hds-v4 + Hierarchical Data System Version 4 + +

HDS is a file-based hierarchical data system designed for the + storage of a wide variety of information. It is particularly + suited to the storage of large multi-dimensional arrays (with + their ancillary data) where efficient access is needed.

+

HDS organises data into hierarchies, broadly similar to the + directory structure of a hierarchical filing system, but + contained within a single HDS container file. The + structures stored in these files are self-describing and + flexible; HDS supports modification and extension of structures + previously created, as well as deletion, copying, renaming, etc..

+

All information stored in HDS files is portable between the + machines on which HDS is implemented. Thus, there are no format + conversion problems when moving between machines.

+

The routines in this package may be used to perform operations + on any HDS data. In addition, HDS forms a toolkit for the + construction of higher level (more specialised) data structures + and the software which accesses them. HDS routines are + therefore invoked indirectly by many other items of Starlink + software.

+

This library handles HDS files version 4 and below.

+
+ + saechrcnfemsstarmemchrcnfemsstarmemchrcnfemsprmstarmemmessgen + + + + R. F. Warren-Smith + + + M. D. Lawden + + + Brian McIlwrath + bkm + B.K.McIlwrath@rl.ac.uk + owner + + + + starlink@jiscmail.ac.uk + +
diff --git a/libraries/hds-v4/component.xml.in b/libraries/hds-v4/component.xml.in new file mode 100644 index 00000000000..b908a86102c --- /dev/null +++ b/libraries/hds-v4/component.xml.in @@ -0,0 +1,51 @@ + + + + + + @PACKAGE_VERSION@ + libraries/hds-v4 + Hierarchical Data System Version 4 + +

HDS is a file-based hierarchical data system designed for the + storage of a wide variety of information. It is particularly + suited to the storage of large multi-dimensional arrays (with + their ancillary data) where efficient access is needed.

+

HDS organises data into hierarchies, broadly similar to the + directory structure of a hierarchical filing system, but + contained within a single HDS container file. The + structures stored in these files are self-describing and + flexible; HDS supports modification and extension of structures + previously created, as well as deletion, copying, renaming, etc..

+

All information stored in HDS files is portable between the + machines on which HDS is implemented. Thus, there are no format + conversion problems when moving between machines.

+

The routines in this package may be used to perform operations + on any HDS data. In addition, HDS forms a toolkit for the + construction of higher level (more specialised) data structures + and the software which accesses them. HDS routines are + therefore invoked indirectly by many other items of Starlink + software.

+

This library handles HDS files version 4 and below.

+
+ + @STAR_DEPENDENCIES_CHILDREN@ + + + + R. F. Warren-Smith + + + M. D. Lawden + + + Brian McIlwrath + bkm + B.K.McIlwrath@rl.ac.uk + owner + + + @STAR_DOCUMENTATION@ + @PACKAGE_BUGREPORT@ + +
diff --git a/libraries/hds-v4/configure.ac b/libraries/hds-v4/configure.ac new file mode 100644 index 00000000000..34b0f4a0e57 --- /dev/null +++ b/libraries/hds-v4/configure.ac @@ -0,0 +1,128 @@ +dnl Process this file with autoconf to produce a configure script +AC_REVISION($Revision$) + +dnl Initialisation: package name and version number +AC_INIT([hds-v4],[5.1-1],[starlink@jiscmail.ac.uk]) +AC_CONFIG_AUX_DIR([build-aux]) + +dnl Require autoconf-2.50 at least +AC_PREREQ([2.69]) +dnl Require Starlink automake at least +AM_INIT_AUTOMAKE([1.8.2-starlink subdir-objects]) + +dnl Sanity-check: name a file in the source directory -- if this +dnl isn't found then configure will complain +AC_CONFIG_SRCDIR([hdsState.c]) + +dnl Include defaults for Starlink configurations +STAR_DEFAULTS + +dnl Define _POSIX_C_SOURCE to be used in all routines. This was +dnl declared in the old header file "hds1_feature.h", but we need +dnl to make sure all feature-level defines are included in the autoconf +dnl tests (this is important for large file support under Solaris, which +dnl does not define _LARGEFILE_SOURCE without _POSIX_C_SOURCE). +AC_DEFINE([_POSIX_C_SOURCE], [200112L], [Specify the version of the POSIX +standard we want to work with (should provide POSIX.1, POSIX.2 and POSIX.4, +if available)]) + +dnl Find required versions of the programs we need for configuration +AC_PROG_CC +AC_PROG_FC +LT_INIT + +# If --with-pic=no is set we should honour that. +AM_CONDITIONAL(NOPIC, test x$pic_mode = xno) + +AC_C_BIGENDIAN + +dnl Check for OS features we would like +AC_FUNC_FORK + +dnl The AC_FUNC_MMAP test is broken under Cygwin. +case "$host" in + *cygwin*) + AC_CHECK_FUNCS(mmap) + ;; + *) + AC_FUNC_MMAP + ;; +esac + +STAR_CNF_COMPATIBLE_SYMBOLS + +dnl MinGW doesn't have this one. +AC_CHECK_HEADERS(sys/wait.h) + +dnl Used for dynamic header files +AC_CHECK_HEADERS( time.h ) + +dnl Or file locking. +AC_CHECK_FUNCS(fcntl) + +dnl Or fsync +AC_CHECK_FUNCS(fsync) + +dnl RTL "fixups" +AC_CHECK_FUNCS(atexit) +AC_CHECK_FUNCS(on_exit) +AC_CHECK_FUNCS(memmove) + +AC_CHECK_FUNCS([getwd getcwd]) + +dnl Look for standard headers rather than assuming availability +dnl by operating system +AC_HEADER_STDC +AC_CHECK_HEADERS(stddef.h) +AC_CHECK_HEADERS(unistd.h) +AC_CHECK_HEADERS([sys/param.h]) +AC_CHECK_HEADERS(inttypes.h) + +dnl Look for missing declarations +AC_CHECK_DECLS(confstr) +AC_CHECK_DECLS(getwd) + +dnl fsync is only declared if _POSIX_C_SOURCE isn't!! +AC_CHECK_DECLS(fsync) + +dnl On Darwin access to the _environ symbol is only available to +dnl the linker when building applications, so cannot be used reliably in +dnl shared libraries, so need to use the _NSGetEnviron() function. +AC_CHECK_HEADERS(crt_externs.h) +AC_CHECK_FUNCS(_NSGetEnviron) + +dnl Check for largefile support (various macros and fseeko). +dnl Make sure we don't use the cached version for this (can +dnl be incorrect due to _POSIX_C_SOURCE on Solaris). +$as_unset ac_cv_sys_largefile_source +STAR_LARGEFILE_SUPPORT + +dnl Calculate sizes and types +AC_CHECK_TYPES([long long int,int,long,long long,off_t,int64_t]) +AC_CHECK_TYPES([uint64_t, int32_t, uint32_t, long double, signed char]) + +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) +AC_CHECK_SIZEOF(long double) +AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(size_t) + +dnl Declare the build and use dependencies for this package +STAR_DECLARE_DEPENDENCIES([build], [sae chr cnf ems starmem]) +STAR_DECLARE_DEPENDENCIES([link], [chr cnf ems starmem]) +STAR_DECLARE_DEPENDENCIES([test], [chr cnf ems prm starmem]) + +dnl There are two .msg files in this directory, so we need to specify +dnl the names of them explicitly, rather than them being defaulted from +dnl the package name. +STAR_MESSGEN([dat_err.msg]) + +AM_CONFIG_HEADER(config.h) + +dnl If you wish to configure extra files, you can add them to this +dnl declaration. +AC_CONFIG_FILES(Makefile component.xml) + +dnl This is the bit that does the actual work +AC_OUTPUT diff --git a/libraries/hds/dat1.h b/libraries/hds-v4/dat1.h similarity index 93% rename from libraries/hds/dat1.h rename to libraries/hds-v4/dat1.h index 048626790d7..4390a75bd2e 100644 --- a/libraries/hds/dat1.h +++ b/libraries/hds-v4/dat1.h @@ -18,25 +18,7 @@ /* Global Constants: */ /* ================ */ -/* The following are "public" values. Copies are made available externally */ -/* in the dat_par.h and dat_par(.f) files. */ -#define DAT__MXDIM 7 /* Maximum number of object dimensions */ -#define DAT__NOLOC " "/* Null (invalid) locator value */ -#define DAT__NOWLD 0 /* Null wild-card search context */ -#define DAT__ROOT " "/* Root locator value */ -#define DAT__SZGRP 15 /* Size of group name */ -#define DAT__SZLOC ( ( 15 > (int) sizeof( struct LOC ) ) ? \ - 15 : (int) sizeof( struct LOC ) ) - /* Size of locator string */ -#define DAT__SZMOD 15 /* Size of access mode string */ -#define DAT__SZNAM 15 /* Size of object name */ -#define DAT__SZTYP 15 /* Size of type string */ -#ifdef vms -#define DAT__FLEXT ".SDF" /* Default HDS file extension */ -#else -#define DAT__FLEXT ".sdf" /* Default HDS file extension */ -#endif -#define DAT__SZFLX 4 /* Length of DAT__FLEXT */ +#include "dat_par.h" /* The following are "private" values. These are only used internally. */ #define DAT__CONTAINER 1 /* Container record class */ @@ -407,6 +389,8 @@ if (!_ok(*status))\ int hds1_get_subs( int ndim, HDS_PTYPE *dims, INT_BIG offset, HDS_PTYPE *subs ); - HDSLoc * dat1_import_floc ( const char flocator[DAT__SZLOC], int loc_length, int * status); + int dat1_import_floc ( const char flocator[DAT__SZLOC], + int loc_length, HDSLoc *clocator, + int * status); #endif diff --git a/libraries/hds/dat1_alloc_lcp.c b/libraries/hds-v4/dat1_alloc_lcp.c similarity index 100% rename from libraries/hds/dat1_alloc_lcp.c rename to libraries/hds-v4/dat1_alloc_lcp.c diff --git a/libraries/hds/dat1_annul_lcp.c b/libraries/hds-v4/dat1_annul_lcp.c similarity index 100% rename from libraries/hds/dat1_annul_lcp.c rename to libraries/hds-v4/dat1_annul_lcp.c diff --git a/libraries/hds/dat1_check_mode.c b/libraries/hds-v4/dat1_check_mode.c similarity index 100% rename from libraries/hds/dat1_check_mode.c rename to libraries/hds-v4/dat1_check_mode.c diff --git a/libraries/hds/dat1_check_type.c b/libraries/hds-v4/dat1_check_type.c similarity index 100% rename from libraries/hds/dat1_check_type.c rename to libraries/hds-v4/dat1_check_type.c diff --git a/libraries/hds/dat1_cvt_format.c b/libraries/hds-v4/dat1_cvt_format.c similarity index 100% rename from libraries/hds/dat1_cvt_format.c rename to libraries/hds-v4/dat1_cvt_format.c diff --git a/libraries/hds/dat1_cvt_order.c b/libraries/hds-v4/dat1_cvt_order.c similarity index 100% rename from libraries/hds/dat1_cvt_order.c rename to libraries/hds-v4/dat1_cvt_order.c diff --git a/libraries/hds/dat1_decoy.c b/libraries/hds-v4/dat1_decoy.c similarity index 100% rename from libraries/hds/dat1_decoy.c rename to libraries/hds-v4/dat1_decoy.c diff --git a/libraries/hds/dat1_free_hdsloc.c b/libraries/hds-v4/dat1_free_hdsloc.c similarity index 100% rename from libraries/hds/dat1_free_hdsloc.c rename to libraries/hds-v4/dat1_free_hdsloc.c diff --git a/libraries/hds/dat1_get_ncomp.c b/libraries/hds-v4/dat1_get_ncomp.c similarity index 100% rename from libraries/hds/dat1_get_ncomp.c rename to libraries/hds-v4/dat1_get_ncomp.c diff --git a/libraries/hds/dat1_get_odl.c b/libraries/hds-v4/dat1_get_odl.c similarity index 100% rename from libraries/hds/dat1_get_odl.c rename to libraries/hds-v4/dat1_get_odl.c diff --git a/libraries/hds/dat1_getenv.c b/libraries/hds-v4/dat1_getenv.c similarity index 100% rename from libraries/hds/dat1_getenv.c rename to libraries/hds-v4/dat1_getenv.c diff --git a/libraries/hds/dat1_import_loc.c b/libraries/hds-v4/dat1_import_loc.c similarity index 100% rename from libraries/hds/dat1_import_loc.c rename to libraries/hds-v4/dat1_import_loc.c diff --git a/libraries/hds/dat1_init.c b/libraries/hds-v4/dat1_init.c similarity index 100% rename from libraries/hds/dat1_init.c rename to libraries/hds-v4/dat1_init.c diff --git a/libraries/hds/dat1_init_ndr.c b/libraries/hds-v4/dat1_init_ndr.c similarity index 100% rename from libraries/hds/dat1_init_ndr.c rename to libraries/hds-v4/dat1_init_ndr.c diff --git a/libraries/hds/dat1_intune.c b/libraries/hds-v4/dat1_intune.c similarity index 100% rename from libraries/hds/dat1_intune.c rename to libraries/hds-v4/dat1_intune.c diff --git a/libraries/hds/dat1_locate_name.c b/libraries/hds-v4/dat1_locate_name.c similarity index 100% rename from libraries/hds/dat1_locate_name.c rename to libraries/hds-v4/dat1_locate_name.c diff --git a/libraries/hds/dat1_pack_crv.c b/libraries/hds-v4/dat1_pack_crv.c similarity index 100% rename from libraries/hds/dat1_pack_crv.c rename to libraries/hds-v4/dat1_pack_crv.c diff --git a/libraries/hds/dat1_pack_odl.c b/libraries/hds-v4/dat1_pack_odl.c similarity index 100% rename from libraries/hds/dat1_pack_odl.c rename to libraries/hds-v4/dat1_pack_odl.c diff --git a/libraries/hds/dat1_pack_srv.c b/libraries/hds-v4/dat1_pack_srv.c similarity index 100% rename from libraries/hds/dat1_pack_srv.c rename to libraries/hds-v4/dat1_pack_srv.c diff --git a/libraries/hds/dat1_put_ncomp.c b/libraries/hds-v4/dat1_put_ncomp.c similarity index 100% rename from libraries/hds/dat1_put_ncomp.c rename to libraries/hds-v4/dat1_put_ncomp.c diff --git a/libraries/hds/dat1_put_odl.c b/libraries/hds-v4/dat1_put_odl.c similarity index 100% rename from libraries/hds/dat1_put_odl.c rename to libraries/hds-v4/dat1_put_odl.c diff --git a/libraries/hds/dat1_show_ndr.c b/libraries/hds-v4/dat1_show_ndr.c similarity index 100% rename from libraries/hds/dat1_show_ndr.c rename to libraries/hds-v4/dat1_show_ndr.c diff --git a/libraries/hds/dat1_unpack_crv.c b/libraries/hds-v4/dat1_unpack_crv.c similarity index 100% rename from libraries/hds/dat1_unpack_crv.c rename to libraries/hds-v4/dat1_unpack_crv.c diff --git a/libraries/hds/dat1_unpack_odl.c b/libraries/hds-v4/dat1_unpack_odl.c similarity index 100% rename from libraries/hds/dat1_unpack_odl.c rename to libraries/hds-v4/dat1_unpack_odl.c diff --git a/libraries/hds/dat1_unpack_srv.c b/libraries/hds-v4/dat1_unpack_srv.c similarity index 100% rename from libraries/hds/dat1_unpack_srv.c rename to libraries/hds-v4/dat1_unpack_srv.c diff --git a/libraries/hds/dat1_unpack_type.c b/libraries/hds-v4/dat1_unpack_type.c similarity index 100% rename from libraries/hds/dat1_unpack_type.c rename to libraries/hds-v4/dat1_unpack_type.c diff --git a/libraries/hds/dat1emsSetBigi.c b/libraries/hds-v4/dat1emsSetBigi.c similarity index 100% rename from libraries/hds/dat1emsSetBigi.c rename to libraries/hds-v4/dat1emsSetBigi.c diff --git a/libraries/hds/dat1emsSetBigu.c b/libraries/hds-v4/dat1emsSetBigu.c similarity index 100% rename from libraries/hds/dat1emsSetBigu.c rename to libraries/hds-v4/dat1emsSetBigu.c diff --git a/libraries/hds/dat1emsSetHdsdim.c b/libraries/hds-v4/dat1emsSetHdsdim.c similarity index 100% rename from libraries/hds/dat1emsSetHdsdim.c rename to libraries/hds-v4/dat1emsSetHdsdim.c diff --git a/libraries/hds/datChscn.c b/libraries/hds-v4/datChscn.c similarity index 100% rename from libraries/hds/datChscn.c rename to libraries/hds-v4/datChscn.c diff --git a/libraries/hds/datClen.c b/libraries/hds-v4/datClen.c similarity index 100% rename from libraries/hds/datClen.c rename to libraries/hds-v4/datClen.c diff --git a/libraries/hds/datCopy.c b/libraries/hds-v4/datCopy.c similarity index 100% rename from libraries/hds/datCopy.c rename to libraries/hds-v4/datCopy.c diff --git a/libraries/hds/datDrep.c b/libraries/hds-v4/datDrep.c similarity index 100% rename from libraries/hds/datDrep.c rename to libraries/hds-v4/datDrep.c diff --git a/libraries/hds/datErmsg.c b/libraries/hds-v4/datErmsg.c similarity index 100% rename from libraries/hds/datErmsg.c rename to libraries/hds-v4/datErmsg.c diff --git a/libraries/hds/datGet1C.c b/libraries/hds-v4/datGet1C.c similarity index 100% rename from libraries/hds/datGet1C.c rename to libraries/hds-v4/datGet1C.c diff --git a/libraries/hds/datGetVC.c b/libraries/hds-v4/datGetVC.c similarity index 100% rename from libraries/hds/datGetVC.c rename to libraries/hds-v4/datGetVC.c diff --git a/libraries/hds/datMapN.c b/libraries/hds-v4/datMapN.c similarity index 100% rename from libraries/hds/datMapN.c rename to libraries/hds-v4/datMapN.c diff --git a/libraries/hds/datMsg.c b/libraries/hds-v4/datMsg.c similarity index 100% rename from libraries/hds/datMsg.c rename to libraries/hds-v4/datMsg.c diff --git a/libraries/hds/datParen.c b/libraries/hds-v4/datParen.c similarity index 100% rename from libraries/hds/datParen.c rename to libraries/hds-v4/datParen.c diff --git a/libraries/hds/datPrec.c b/libraries/hds-v4/datPrec.c similarity index 100% rename from libraries/hds/datPrec.c rename to libraries/hds-v4/datPrec.c diff --git a/libraries/hds/datPrmry.c b/libraries/hds-v4/datPrmry.c similarity index 100% rename from libraries/hds/datPrmry.c rename to libraries/hds-v4/datPrmry.c diff --git a/libraries/hds/datPut1C.c b/libraries/hds-v4/datPut1C.c similarity index 100% rename from libraries/hds/datPut1C.c rename to libraries/hds-v4/datPut1C.c diff --git a/libraries/hds/datPutVC.c b/libraries/hds-v4/datPutVC.c similarity index 100% rename from libraries/hds/datPutVC.c rename to libraries/hds-v4/datPutVC.c diff --git a/libraries/hds/datRef.c b/libraries/hds-v4/datRef.c similarity index 100% rename from libraries/hds/datRef.c rename to libraries/hds-v4/datRef.c diff --git a/libraries/hds/datRefct.c b/libraries/hds-v4/datRefct.c similarity index 100% rename from libraries/hds/datRefct.c rename to libraries/hds-v4/datRefct.c diff --git a/libraries/hds/datWhere.c b/libraries/hds-v4/datWhere.c similarity index 100% rename from libraries/hds/datWhere.c rename to libraries/hds-v4/datWhere.c diff --git a/libraries/hds-v4/dat_err.msg b/libraries/hds-v4/dat_err.msg new file mode 100644 index 00000000000..534c61d5646 --- /dev/null +++ b/libraries/hds-v4/dat_err.msg @@ -0,0 +1,56 @@ +.TITLE DAT +.FACILITY DAT,200/PREFIX=DAT__ + + +.SEVERITY INFORMATIONAL + +.BASE 100 +LOCIN +LOCER +TYPIN +NAMIN +MODIN +CONIN +DELIN +DIMIN +FILIN +OBJIN +GRPIN +SUBIN +COMEX +OBJNF +TRUNC +ACCON +CONER +UNSET +VERMM +PRMAP +RELIN +FILCK +FILNF +FILPR +INCHK +FATAL +WEIRD +EXCPA +UNKPA +ISOPN +ERACT +EREXH +NOMAP +ISMAP +STKOF +BOUND +ACTIV +FILCL +FILCR +FILMP +FILND +FILNX +FILRD +FILWR +NOMEM +WLDIN +NOCMP +DTRNC +.END diff --git a/libraries/hds-v4/dat_par.h b/libraries/hds-v4/dat_par.h new file mode 100644 index 00000000000..dc67e0bf9d4 --- /dev/null +++ b/libraries/hds-v4/dat_par.h @@ -0,0 +1,85 @@ +#if !defined( DAT_PAR_INCLUDED ) /* dat_par.h already included? */ +#define DAT_PAR_INCLUDED 1 +/* +*+ +* Name: +* dat_par.h + +* Purpose: +* Define public global constants for the dat_ and hds_ routines. + +* Language: +* ANSI C + +* Type of Module: +* Global constants (macro) include file. + +* Description: +* This file contains macro definitions for global constants which +* are used by the dat_ and hds_ routines within the HDS package and +* which may also be needed by software which calls these routines. + +* Copyright: +* Copyright (C) 1998 Central Laboratory of the Research Councils + +* Authors: +* Generated automatically by the dat_par_h program. +* {enter_new_authors_here} + +* History: +* {enter_changes_here} + +*- +*/ + +/* Remove earlier definitions if clash with private dat1.h version */ +#ifdef DAT__MXDIM +#undef DAT__MXDIM +#endif +#ifdef DAT__NOLOC +#undef DAT__NOLOC +#endif +#ifdef DAT__NOWLD +#undef DAT__NOWLD +#endif +#ifdef DAT__ROOT +#undef DAT__ROOT +#endif +#ifdef DAT__SZGRP +#undef DAT__SZGRP +#endif +#ifdef DAT__SZLOC +#undef DAT__SZLOC +#endif +#ifdef DAT__SZMOD +#undef DAT__SZMOD +#endif +#ifdef DAT__SZNAM +#undef DAT__SZNAM +#endif +#ifdef DAT__SZTYP +#undef DAT__SZTYP +#endif +#ifdef DAT__FLEXT +#undef DAT__FLEXT +#endif +#ifdef DAT__SZFLX +#undef DAT__SZFLX +#endif + +/* Global Constants: */ + +#define DAT__MXDIM 7 /* Maximum number of object dimensions */ +#define DAT__NOLOC " " /* Null (invalid) locator value */ +#define DAT__NOWLD 0 /* Null wild-card search context */ +#define DAT__ROOT " " /* Root locator value */ +#define DAT__SZGRP 15 /* Size of group name */ +#define DAT__SZLOC 16 /* Size of locator */ +#define DAT__SZMOD 15 /* Size of access mode string */ +#define DAT__SZNAM 15 /* Size of object name */ +#define DAT__SZTYP 15 /* Size of type string */ +#define DAT__SZFLX 4 /* Size of file extension DAT__FLEXT */ +#define DAT__FLEXT ".sdf" /* Default HDS file extension */ + +/*. */ +#endif diff --git a/libraries/hds/datalter.c b/libraries/hds-v4/datalter.c similarity index 100% rename from libraries/hds/datalter.c rename to libraries/hds-v4/datalter.c diff --git a/libraries/hds/datannul.c b/libraries/hds-v4/datannul.c similarity index 100% rename from libraries/hds/datannul.c rename to libraries/hds-v4/datannul.c diff --git a/libraries/hds/datccopy.c b/libraries/hds-v4/datccopy.c similarity index 100% rename from libraries/hds/datccopy.c rename to libraries/hds-v4/datccopy.c diff --git a/libraries/hds/daterase.c b/libraries/hds-v4/daterase.c similarity index 100% rename from libraries/hds/daterase.c rename to libraries/hds-v4/daterase.c diff --git a/libraries/hds/datfinind.c b/libraries/hds-v4/datfinind.c similarity index 100% rename from libraries/hds/datfinind.c rename to libraries/hds-v4/datfinind.c diff --git a/libraries/hds/datget.c b/libraries/hds-v4/datget.c similarity index 100% rename from libraries/hds/datget.c rename to libraries/hds-v4/datget.c diff --git a/libraries/hds/datget0x.c b/libraries/hds-v4/datget0x.c similarity index 100% rename from libraries/hds/datget0x.c rename to libraries/hds-v4/datget0x.c diff --git a/libraries/hds/datinq.c b/libraries/hds-v4/datinq.c similarity index 100% rename from libraries/hds/datinq.c rename to libraries/hds-v4/datinq.c diff --git a/libraries/hds/datlocops.c b/libraries/hds-v4/datlocops.c similarity index 100% rename from libraries/hds/datlocops.c rename to libraries/hds-v4/datlocops.c diff --git a/libraries/hds/datmap.c b/libraries/hds-v4/datmap.c similarity index 100% rename from libraries/hds/datmap.c rename to libraries/hds-v4/datmap.c diff --git a/libraries/hds/datmove.c b/libraries/hds-v4/datmove.c similarity index 100% rename from libraries/hds/datmove.c rename to libraries/hds-v4/datmove.c diff --git a/libraries/hds/datnew.c b/libraries/hds-v4/datnew.c similarity index 100% rename from libraries/hds/datnew.c rename to libraries/hds-v4/datnew.c diff --git a/libraries/hds/datnew0.c b/libraries/hds-v4/datnew0.c similarity index 100% rename from libraries/hds/datnew0.c rename to libraries/hds-v4/datnew0.c diff --git a/libraries/hds/datput.c b/libraries/hds-v4/datput.c similarity index 100% rename from libraries/hds/datput.c rename to libraries/hds-v4/datput.c diff --git a/libraries/hds/datput0x.c b/libraries/hds-v4/datput0x.c similarity index 100% rename from libraries/hds/datput0x.c rename to libraries/hds-v4/datput0x.c diff --git a/libraries/hds/dattemp.c b/libraries/hds-v4/dattemp.c similarity index 100% rename from libraries/hds/dattemp.c rename to libraries/hds-v4/dattemp.c diff --git a/libraries/hds/daucheck.c b/libraries/hds-v4/daucheck.c similarity index 100% rename from libraries/hds/daucheck.c rename to libraries/hds-v4/daucheck.c diff --git a/libraries/hds/daucnv.c b/libraries/hds-v4/daucnv.c similarity index 100% rename from libraries/hds/daucnv.c rename to libraries/hds-v4/daucnv.c diff --git a/libraries/hds/daucopy.c b/libraries/hds-v4/daucopy.c similarity index 100% rename from libraries/hds/daucopy.c rename to libraries/hds-v4/daucopy.c diff --git a/libraries/hds/dauflush.c b/libraries/hds-v4/dauflush.c similarity index 100% rename from libraries/hds/dauflush.c rename to libraries/hds-v4/dauflush.c diff --git a/libraries/hds/dauloc.c b/libraries/hds-v4/dauloc.c similarity index 100% rename from libraries/hds/dauloc.c rename to libraries/hds-v4/dauloc.c diff --git a/libraries/hds/daumove.c b/libraries/hds-v4/daumove.c similarity index 100% rename from libraries/hds/daumove.c rename to libraries/hds-v4/daumove.c diff --git a/libraries/hds/dauscatgath.c b/libraries/hds-v4/dauscatgath.c similarity index 100% rename from libraries/hds/dauscatgath.c rename to libraries/hds-v4/dauscatgath.c diff --git a/libraries/hds/daushape.c b/libraries/hds-v4/daushape.c similarity index 100% rename from libraries/hds/daushape.c rename to libraries/hds-v4/daushape.c diff --git a/libraries/hds/dautypes.c b/libraries/hds-v4/dautypes.c similarity index 100% rename from libraries/hds/dautypes.c rename to libraries/hds-v4/dautypes.c diff --git a/libraries/hds-v4/hds-v4.news b/libraries/hds-v4/hds-v4.news new file mode 100644 index 00000000000..9cfaf9b983e --- /dev/null +++ b/libraries/hds-v4/hds-v4.news @@ -0,0 +1,63 @@ +HDS Library +----------- + + Version 5.1-1 + ============= + + Add _INT64 data type corresponding to 64-bit integers + (INTEGER*8 in Fortran and int64_t in C). + + Version 5.0-6 + ============= + + When existing files are overwritten they appear corrupted to + any other processes that have the file open. To avoid this + existing files are now unlinked before creating a new file + with the same name. + + Version 5.0-5 + ============= + + A bug in the HDS_CLOSE routine has been fixed. Previously if you + called this routine just after another HDS routine had returned + an error status it would fail to execute. Note that HDS_CLOSE is + deprecated and you should be using a simple DAT_ANNUL instead. + + Version 5.0-4 + ============= + + * HDSv4 files (64bit) are now created by default. Set HDS_64BIT environment + variable to 0 to revert to old v3 format. + + Version 5.0-3 + ============= + + The hds_link script now correctly links against Fortran EMS. + + A bug which stopped the repeated opening of some files has been + fixed. + + Version 5.0 + =========== + + * Complete rewrite in C to support files larger than 2GB. + * First official C interface to HDS. + * Now possible to link HDS without requiring a Fortran runtime. + * Add HDS_FIND subroutine for obtaining a locator from an HDS path. + * Add datChscn for validating component names + * Add HDS_SPLIT for splitting an HDS path into a filename and components + (used by HDS_FIND but also useful for libraries based on HDS). + * Now uses the starmem library for memory allocation. + + Version 4.3-4 + ============= + + File mapping has been changed to conform with the latest standards. This + resolves corruption problems seen with files mapped over NFS using Linux + kernels 2.6.9 or later. + + Version 4.3-3 + ============= + + This version contains a minor internal change for compatibility + with the latest version of Linux. diff --git a/libraries/hds-v4/hds.h b/libraries/hds-v4/hds.h new file mode 100644 index 00000000000..e5926d57420 --- /dev/null +++ b/libraries/hds-v4/hds.h @@ -0,0 +1,1117 @@ +/* Protect against multiple inclusion */ +#ifndef STAR_HDS_H_INCLUDED +#define STAR_HDS_H_INCLUDED + +#include "dat_par.h" + +/* Enable the v4-specific API */ +#include "hds_v4_map.h" + +/* Relative location of type definitions depends on whether we are + building the library or using the installed version */ +#if HDS_INTERNAL_INCLUDES +# include "hds_types.h" +#else +# include "star/hds_types.h" +#endif + +/*=================================*/ +/* datAlter - Alter size of object */ +/*=================================*/ + +int +datAlter(const HDSLoc *locator, int ndim, const hdsdim dims[], int *status); + +/*==========================*/ +/* datAnnul - Annul locator */ +/*==========================*/ + +int +datAnnul(HDSLoc **locator, int *status); + +/*==============================================*/ +/* datBasic - Map data (in basic machine units) */ +/*==============================================*/ + +int +datBasic(const HDSLoc *locator, const char *mode_c, unsigned char **pntr, size_t *len, int *status); + +/*=====================================*/ +/* datCcopy - copy one structure level */ +/*=====================================*/ + +int +datCcopy(const HDSLoc *locator1, const HDSLoc *locator2, const char *name, HDSLoc **locator3, int *status); + +/*=======================================*/ +/* datCctyp - construct _CHAR*nnn string */ +/*=======================================*/ + +void +datCctyp(size_t size, char type[DAT__SZTYP+1]); + + +/*===========================================*/ +/* datCell - Locate a "cell" (array element) */ +/*===========================================*/ + +int +datCell(const HDSLoc *locator1, int ndim, const hdsdim subs[], HDSLoc **locator2, int *status); + +/*=================================================*/ +/* datChscn - validate the supplied component name */ +/*=================================================*/ + +int +datChscn(const char * name, int *status); + +/*==========================================*/ +/* datClen - Obtain character string length */ +/*==========================================*/ + +int +datClen(const HDSLoc *locator, size_t *clen, int *status); + +/*===========================*/ +/* datClone - clone locator */ +/*===========================*/ + +int +datClone(const HDSLoc *locator1, HDSLoc **locator2, int *status); + +/*================================*/ +/* datCoerc - coerce object shape */ +/*================================*/ + +int +datCoerc(const HDSLoc *locator1, int ndim, HDSLoc **locator2, int *status); + +/*=======================*/ +/* datCopy - copy object */ +/*=======================*/ + +int +datCopy(const HDSLoc *locator1, const HDSLoc *locator2, const char *name_c, int *status); + +/*============================================================*/ +/* datDrep - Obtain primitive data representation information */ +/*============================================================*/ + +int +datDrep(const HDSLoc *locator, char **format_str, char **order_str, int *status); + +/*========================================*/ +/* datErase - Erase object */ +/*========================================*/ + +int +datErase(const HDSLoc *locator, const char *name_str, int *status); + +/*===========================================================*/ +/* datErmsg - Translate a status value into an error message */ +/*===========================================================*/ + +int +datErmsg(int status, size_t *len, char *msg_str); + +/*================================*/ +/* datFind - Find named component */ +/*================================*/ + +int +datFind(const HDSLoc *locator1, const char *name_str, HDSLoc **locator2, int *status); + +/*============================*/ +/* datGet - Read primitive(s) */ +/*============================*/ + +int +datGet(const HDSLoc *locator, const char *type_str, int ndim, const hdsdim dims[], void *values, int *status); + +/*===================================*/ +/* datGetC - Read _CHAR primitive(s) */ +/*===================================*/ + +int +datGetC(const HDSLoc *locator, const int ndim, const hdsdim dims[], char values[], size_t char_len, int *status); + +/*=====================================*/ +/* datGetD - Read _DOUBLE primitive(s) */ +/*=====================================*/ + +int +datGetD(const HDSLoc *locator, int ndim, const hdsdim dims[], double values[], int *status); + +/*======================================*/ +/* datGetI - Read _INTEGER primitive(s) */ +/*======================================*/ + +int +datGetI(const HDSLoc *locator, int ndim, const hdsdim dims[], int values[], int *status); + +/*======================================*/ +/* datGetK - Read _INT64 primitive(s) */ +/*======================================*/ + +int +datGetK(const HDSLoc *locator, int ndim, const hdsdim dims[], int64_t values[], int *status); + +/*===================================*/ +/* datGetW - Read _WORD primitive(s) */ +/*===================================*/ + +int +datGetW(const HDSLoc *locator, int ndim, const hdsdim dims[], short values[], int *status); + +/*===================================*/ +/* datGetUW - Read _UWORD primitive(s) */ +/*===================================*/ + +int +datGetUW(const HDSLoc *locator, int ndim, const hdsdim dims[], unsigned short values[], int *status); + +/*======================================*/ +/* datGetL - Read _LOGICAL primitive(s) */ +/*======================================*/ + +int +datGetL(const HDSLoc *locator, int ndim, const hdsdim dims[], hdsbool_t values[], int *status); + +/*===================================*/ +/* datGetR - Read _REAL primitive(s) */ +/*===================================*/ + +int +datGetR(const HDSLoc *locator, int ndim, const hdsdim dims[], float values[], int *status); + +/*======================================*/ +/* datGet0C - Read scalar string value */ +/*======================================*/ + +int +datGet0C(const HDSLoc * locator, char * value, size_t len, int * status); + +/*======================================*/ +/* datGet0D - Read scalar double value */ +/*======================================*/ + +int +datGet0D(const HDSLoc * locator, double * value, int * status); + +/*=====================================*/ +/* datGet0R - Read scalar float value */ +/*=====================================*/ + +int +datGet0R(const HDSLoc * locator, float * value, int * status); + +/*=======================================*/ +/* datGet0I - Read scalar integer value */ +/*=======================================*/ + +int +datGet0I(const HDSLoc * locator, int * value, int * status); + +/*================================================*/ +/* datGet0K - Read scalar 64-bit integer value */ +/*================================================*/ + +int +datGet0K(const HDSLoc * locator, int64_t * value, int * status); + +/*=============================================*/ +/* datGet0W - Read scalar short integer value */ +/*=============================================*/ + +int +datGet0W(const HDSLoc * locator, short * value, int * status); + +/*=============================================*/ +/* datGet0UW - Read scalar unsigned short integer value */ +/*=============================================*/ + +int +datGet0UW(const HDSLoc * locator, unsigned short * value, int * status); + +/*=======================================*/ +/* datGet0L - Read scalar logical value */ +/*=======================================*/ + +int +datGet0L(const HDSLoc * locator, hdsbool_t * value, int * status); + +/*==================================*/ +/* DAT_GET1C - Read 1D string array */ +/*==================================*/ + +int +datGet1C(const HDSLoc * locator, size_t maxval, size_t bufsize, char *buffer, char *pntrs[], size_t * actval, int * status); + +/*==================================*/ +/* DAT_GET1D - Read 1D Double array */ +/*==================================*/ + +int +datGet1D(const HDSLoc * locator, size_t maxval, double values[], size_t *actval, int * status); + +/*==================================*/ +/* DAT_GET1I - Read 1D Integer array */ +/*==================================*/ + +int +datGet1I(const HDSLoc * locator, size_t maxval, int values[], size_t *actval, int * status); + +/*============================================*/ +/* DAT_GET1K - Read 1D 64-bit Integer array */ +/*============================================*/ + +int +datGet1K(const HDSLoc * locator, size_t maxval, int64_t values[], size_t *actval, int * status); + +/*=========================================*/ +/* DAT_GET1W - Read 1D Short Integer array */ +/*=========================================*/ + +int +datGet1W(const HDSLoc * locator, size_t maxval, short values[], size_t *actval, int * status); + +/*===================================================*/ +/* DAT_GET1UW - Read 1D Unsigned Short Integer array */ +/*===================================================*/ + +int +datGet1UW(const HDSLoc * locator, size_t maxval, unsigned short values[], size_t *actval, int * status); + +/*==================================*/ +/* DAT_GET1R - Read 1D REAL array */ +/*==================================*/ + +int +datGet1R(const HDSLoc * locator, size_t maxval, float values[], size_t *actval, int * status); + +/*==================================*/ +/* DAT_GET1L - Read 1D Logical array */ +/*==================================*/ + +int +datGet1L(const HDSLoc * locator, size_t maxval, hdsbool_t values[], size_t *actval, int * status); + +/*==================================*/ +/* DAT_GETVC - Read vectorized 1D string array */ +/*==================================*/ + +int +datGetVC(const HDSLoc * locator, size_t maxval, size_t bufsize, char *buffer, char *pntrs[], size_t * actval, int * status); + + +/*==========================================*/ +/* DAT_GETVD - Read vectorized Double array */ +/*==========================================*/ + +int +datGetVD(const HDSLoc * locator, size_t maxval, double values[], size_t *actval, int * status); + +/*==========================================*/ +/* DAT_GETVI - Read vectorized Integer array */ +/*==========================================*/ + +int +datGetVI(const HDSLoc * locator, size_t maxval, int values[], size_t *actval, int * status); + +/*==========================================*/ +/* DAT_GETVK - Read vectorized Int64 array */ +/*==========================================*/ + +int +datGetVK(const HDSLoc * locator, size_t maxval, int64_t values[], size_t *actval, int * status); + +/*==========================================*/ +/* DAT_GETVR - Read vectorized REAL array */ +/*==========================================*/ + +int +datGetVR(const HDSLoc * locator, size_t maxval, float values[], size_t *actval, int * status); + +/*==========================================*/ +/* DAT_GETVL - Read vectorized Logical array */ +/*==========================================*/ + +int +datGetVL(const HDSLoc * locator, size_t maxval, hdsbool_t values[], size_t *actval, int * status); + + +/*======================================*/ +/* datIndex - Index into component list */ +/*======================================*/ + +int +datIndex(const HDSLoc *locator1, int index, HDSLoc **locator2, int *status); + +/*===================================*/ +/* datLen - Inquire primitive length */ +/*===================================*/ + +int +datLen(const HDSLoc *locator, size_t *len, int *status); + +/*===========================*/ +/* datMap - Map primitive(s) */ +/*===========================*/ + +int +datMap(const HDSLoc *locator, const char *type_str, const char *mode_str, int ndim, const hdsdim dims[], void **pntr, int *status); + +/*==================================*/ +/* datMapC - Map _CHAR primitive(s) */ +/*==================================*/ + +int +datMapC(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], unsigned char **pntr, int *status); + +/*====================================*/ +/* datMapD - Map _DOUBLE primitive(s) */ +/*====================================*/ + +int +datMapD(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], double **pntr, int *status); + +/*=====================================*/ +/* datMapI - Map _INTEGER primitive(s) */ +/*=====================================*/ + +int +datMapI(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], int **pntr, int *status); + +/*=====================================*/ +/* datMapK - Map _INT64 primitive(s) */ +/*=====================================*/ + +int +datMapK(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], int **pntr, int *status); + +/*=====================================*/ +/* datMapL - Map _LOGICAL primitive(s) */ +/*=====================================*/ + +int +datMapL(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], hdsbool_t **pntr, int *status); + +/*==================================*/ +/* datMapR - Map _REAL primitive(s) */ +/*==================================*/ + +int +datMapR(const HDSLoc *locator, const char *mode_str, int ndim, const hdsdim dims[], float **pntr, int *status); + + +/*========================================*/ +/* datMapN - Map primitive as N-dim array */ +/*========================================*/ + +int +datMapN(const HDSLoc *locator, const char *type_str, const char *mode_str, int ndim, void **pntr, hdsdim dims[], int *status); + +/*==================================*/ +/* datMapV - Map vectorized primitive(s) */ +/*==================================*/ + +int +datMapV(const HDSLoc *locator, const char *type_str, const char *mode_str, void **pntr, size_t *actval, int *status); + + +/*==================================*/ +/* datMould - Alter shape of object */ +/*==================================*/ + +int +datMould(const HDSLoc *locator, int ndim, const hdsdim dims[], int *status); + +/*=======================*/ +/* datMove - Move object */ +/*=======================*/ + +int +datMove(HDSLoc **locator1, const HDSLoc *locator2, const char *name_str, int *status); + +/*======================================*/ +/* datMsg - store filename in EMS token */ +/*======================================*/ + +void +datMsg(const char * token, const HDSLoc * locator); + +/*===============================*/ +/* datName - Enquire object name */ +/*===============================*/ + +int +datName(const HDSLoc *locator, char name_str[DAT__SZNAM+1], int *status); + +/*=========================================*/ +/* datNcomp - Inquire number of components */ +/*=========================================*/ + +int +datNcomp(const HDSLoc *locator, int *ncomp, int *status); + +/*===============================*/ +/* datNew - Create new component */ +/*===============================*/ + +int +datNew(const HDSLoc *locator, const char *name_str, const char *type_str, int ndim, const hdsdim dims[], int *status); + +/*============================================*/ +/* datNewC - Create new _CHAR type component */ +/*============================================*/ + +int +datNewC(const HDSLoc *locator, const char *name_str, size_t len, int ndim, const hdsdim dims[], int *status); + +/*=======================================*/ +/* datNew0 - Create new scalar component */ +/*=======================================*/ + +int +datNew0(const HDSLoc *locator, const char *name_str, const char *type_str, int *status); + +/*===============================================*/ +/* datNew0D - Create new scalar double component */ +/*===============================================*/ + +int +datNew0D(const HDSLoc *locator, const char *name_str, int *status); + +/*================================================*/ +/* datNew0I - Create new scalar integer component */ +/*================================================*/ + +int +datNew0I(const HDSLoc *locator, const char *name_str, int *status); + +/*=========================================================*/ +/* datNew0K - Create new scalar 64-bit integer component */ +/*=========================================================*/ + +int +datNew0K(const HDSLoc *locator, const char *name_str, int *status); + +/*======================================================*/ +/* datNew0W - Create new scalar short integer component */ +/*======================================================*/ + +int +datNew0W(const HDSLoc *locator, const char *name_str, int *status); + +/*================================================================*/ +/* datNew0UW - Create new scalar unsigned short integer component */ +/*================================================================*/ + +int +datNew0UW(const HDSLoc *locator, const char *name_str, int *status); + +/*=============================================*/ +/* datNew0R - Create new scalar real component */ +/*=============================================*/ + +int +datNew0R(const HDSLoc *locator, const char *name_str, int *status); + +/*================================================*/ +/* datNew0L - Create new scalar logical component */ +/*================================================*/ + +int +datNew0L(const HDSLoc *locator, const char *name_str, int *status); + +/*================================================*/ +/* datNew0L - Create new scalar logical component */ +/*================================================*/ + +int +datNew0C(const HDSLoc *locator, const char *name_str, size_t len, int *status); + + + +/*=======================================*/ +/* datNew1 - Create new vector component */ +/*=======================================*/ + +int +datNew1(const HDSLoc *locator, const char *name_str, const char *type_str, size_t len, int *status); + +/*=======================================*/ +/* datNew1C - Create new vector string */ +/*=======================================*/ + +int +datNew1C(const HDSLoc *locator, const char *name_str, size_t len, size_t nelem, int *status); + +/*=======================================*/ +/* datNew1d - Create new vector double */ +/*=======================================*/ + +int +datNew1D(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*=======================================*/ +/* datNew1I - Create new vector integer */ +/*=======================================*/ + +int +datNew1I(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*================================================*/ +/* datNew1K - Create new vector 64-bit integer */ +/*================================================*/ + +int +datNew1K(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*=============================================*/ +/* datNew1W - Create new vector short integer */ +/*=============================================*/ + +int +datNew1W(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*=======================================================*/ +/* datNew1UW - Create new vector unsigned short integer */ +/*=======================================================*/ + +int +datNew1UW(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*=======================================*/ +/* datNew1L - Create new vector logical */ +/*=======================================*/ + +int +datNew1L(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*=======================================*/ +/* datNew1R - Create new vector float */ +/*=======================================*/ + +int +datNew1R(const HDSLoc *locator, const char *name_str, size_t len, int *status); + +/*====================================*/ +/* datParen - Locate parent structure */ +/*====================================*/ + +int +datParen(const HDSLoc *locator1, HDSLoc **locator2, int *status); + + +/*=====================================*/ +/* datPrec - Enquire storage precision */ +/*=====================================*/ + +int +datPrec(const HDSLoc *locator, size_t *nbytes, int *status); + +/*====================================*/ +/* datPrim - Enquire object primitive */ +/*====================================*/ + +int +datPrim(const HDSLoc *locator, hdsbool_t *prim, int *status); + +/*=========================================================*/ +/* datPrmry - Set/Enquire primary/secondary locator status */ +/*=========================================================*/ + +int +datPrmry(int set, HDSLoc **locator, hdsbool_t *prmry, int *status); + +/*==================================*/ +/* datPutC - Write _CHAR primitive */ +/*==================================*/ + +int +datPutC(const HDSLoc *locator, int ndim, const hdsdim dims[], const char string[], size_t string_length, int *status); + +/*====================================*/ +/* datPutD - Write _DOUBLE primitives */ +/*====================================*/ + +int +datPutD(const HDSLoc *locator, int ndim, const hdsdim dims[], const double values[], int *status); + +/*=====================================*/ +/* datPutI - Write _INTEGER primitives */ +/*=====================================*/ + +int +datPutI(const HDSLoc *locator, int ndim, const hdsdim dims[], const int values[], int *status); + +/*=====================================*/ +/* datPutK - Write _INT64 primitives */ +/*=====================================*/ + +int +datPutK(const HDSLoc *locator, int ndim, const hdsdim dims[], const int64_t values[], int *status); + +/*=====================================*/ +/* datPutW - Write _WORD primitives */ +/*=====================================*/ + +int +datPutW(const HDSLoc *locator, int ndim, const hdsdim dims[], const short values[], int *status); + +/*====================================*/ +/* datPutUW - Write _UWORD primitives */ +/*====================================*/ + +int +datPutUW(const HDSLoc *locator, int ndim, const hdsdim dims[], const unsigned short values[], int *status); + +/*==================================*/ +/* datPutR - Write _REAL primitives */ +/*==================================*/ + +int +datPutR(const HDSLoc *locator, int ndim, const hdsdim dims[], const float values[], int *status); + +/*=====================================*/ +/* datPutL - Write _LOGICAL primitives */ +/*=====================================*/ + +int +datPutL(const HDSLoc *locator, int ndim, const hdsdim dims[], const hdsbool_t values[], int *status); + +/*==========================*/ +/* datPut - Write primitive */ +/*==========================*/ + +int +datPut(const HDSLoc *locator, const char *type_str, int ndim, const hdsdim dims[], const void *values, int *status); + +/*=======================================*/ +/* datPut0C - Write scalar string value */ +/*=======================================*/ + +int +datPut0C(const HDSLoc * locator, const char * value, int * status); + +/*=======================================*/ +/* datPut0D - Write scalar double value */ +/*=======================================*/ + +int +datPut0D(const HDSLoc * locator, double value, int * status); + +/*======================================*/ +/* datPut0R - Write scalar float value */ +/*======================================*/ + +int +datPut0R(const HDSLoc * locator, float value, int * status); + +/*========================================*/ +/* datPut0I - Write scalar integer value */ +/*========================================*/ + +int +datPut0I(const HDSLoc * locator, int value, int * status); + +/*========================================*/ +/* datPut0I - Write scalar 64-bit integer value */ +/*========================================*/ + +int +datPut0K(const HDSLoc * locator, int64_t value, int * status); + +/*==============================================*/ +/* datPut0W - Write scalar short integer value */ +/*===============================================*/ + +int +datPut0W(const HDSLoc * locator, short value, int * status); + +/*========================================================*/ +/* datPut0UW - Write scalar unsigned short integer value */ +/*========================================================*/ + +int +datPut0UW(const HDSLoc * locator, unsigned short value, int * status); + +/*========================================*/ +/* datPut0L - Write scalar logical value */ +/*========================================*/ + +int +datPut0L(const HDSLoc * locator, hdsbool_t value, int * status); + +/*========================================*/ +/* datPut1C - Write 1D character array */ +/*========================================*/ + +int +datPut1C(const HDSLoc * locator, size_t nval, const char *values[], int * status); + +/*========================================*/ +/* datPut1D - Write 1D double array */ +/*========================================*/ + +int +datPut1D(const HDSLoc * locator, size_t nval, const double values[], int * status); + +/*========================================*/ +/* datPut1I - Write 1D int array */ +/*========================================*/ + +int +datPut1I(const HDSLoc * locator, size_t nval, const int values[], int * status); + +/*========================================*/ +/* datPut1K - Write 1D 64-bit int array */ +/*========================================*/ + +int +datPut1K(const HDSLoc * locator, size_t nval, const int64_t values[], int * status); + +/*===========================================*/ +/* datPut1W - Write 1D short int array */ +/*===========================================*/ + +int +datPut1W(const HDSLoc * locator, size_t nval, const short values[], int * status); + +/*===============================================*/ +/* datPut1UW - Write 1D unsigned short int array */ +/*===============================================*/ + +int +datPut1UW(const HDSLoc * locator, size_t nval, const unsigned short values[], int * status); + +/*========================================*/ +/* datPut1R - Write 1D double array */ +/*========================================*/ + +int +datPut1R(const HDSLoc * locator, size_t nval, const float values[], int * status); + +/*========================================*/ +/* datPut1L - Write 1D Logical/int array */ +/*========================================*/ + +int +datPut1L(const HDSLoc * locator, size_t nval, const hdsbool_t values[], int * status); + +/*================================================*/ +/* datPutVD - Write vectorized double array */ +/*================================================*/ + +int +datPutVD(const HDSLoc * locator, size_t nval, const double values[], int * status); + +/*================================================*/ +/* datPutVI - Write vectorized int array */ +/*================================================*/ + +int +datPutVI(const HDSLoc * locator, size_t nval, const int values[], int * status); + +/*================================================*/ +/* datPutVI - Write vectorized int64 array */ +/*================================================*/ + +int +datPutVK(const HDSLoc * locator, size_t nval, const int64_t values[], int * status); + +/*================================================*/ +/* datPutVR - Write vectorized REAL/float array */ +/*================================================*/ + +int +datPutVR(const HDSLoc * locator, size_t nval, const float values[], int * status); + +/*================================================*/ +/* datPutVL - Write vectorized Logical array */ +/*================================================*/ + +int +datPutVL(const HDSLoc * locator, size_t nval, const hdsbool_t values[], int * status); + +/*================================================*/ +/* datPutVC - Write vectorized character array */ +/*================================================*/ + +int +datPutVC(const HDSLoc * locator, size_t nval, const char *values[], int * status); + + +/*========================================*/ +/* datRef - Enquire object reference name */ +/*========================================*/ + +int +datRef(const HDSLoc * locator, char * ref, size_t reflen, int *status); + +/*===================================================*/ +/* datRefct - Enquire container file reference count */ +/*===================================================*/ + +int +datRefct(const HDSLoc *locator, int *refct, int *status); + +/*=============================*/ +/* datRenam - Rename an object */ +/*=============================*/ + +int +datRenam(const HDSLoc *locator, const char *name_str, int *status); + +/*================================*/ +/* datReset - Reset object state */ +/*================================*/ + +int +datReset(const HDSLoc *locator, int *status); + +/*================================*/ +/* datRetyp - Change object type */ +/*================================*/ + +int +datRetyp(const HDSLoc *locator, const char *type_str, int *status); + +/*=================================*/ +/* datShape - Enquire object shape */ +/*=================================*/ + +int +datShape(const HDSLoc *locator, int maxdim, hdsdim dims[], int *actdim, int *status); + +/*===============================*/ +/* datSize - Enquire object size */ +/*===============================*/ + +int +datSize(const HDSLoc *locator, size_t *size, int *status); + +/*================================*/ +/* datSlice - Locate object slice */ +/*================================*/ + +int +datSlice(const HDSLoc *locator1, int ndim, const hdsdim lower[], const hdsdim upper[], HDSLoc **locator2, int *status); + +/*=================================*/ +/* datState - Enquire object state */ +/*=================================*/ + +int +datState(const HDSLoc *locator, hdsbool_t *state, int *status); + +/*=====================================*/ +/* datStruc - Enquire object structure */ +/*=====================================*/ + +int +datStruc(const HDSLoc *locator, hdsbool_t *struc, int *status); + +/*===================================*/ +/* datTemp - Create temporary object */ +/*===================================*/ + +int +datTemp(const char *type_str, int ndim, const hdsdim dims[], HDSLoc **locator, int *status); + +/*=========================================*/ +/* datThere - Enquire component existence */ +/*=========================================*/ + +int +datThere(const HDSLoc *locator, const char *name_c, hdsbool_t *there, int *status); + +/*===============================*/ +/* datType - Enquire object type */ +/*===============================*/ + +int +datType(const HDSLoc *locator, char type_str[DAT__SZTYP + 1], int *status); + +/*=========================*/ +/* datUnmap - Unmap object */ +/*=========================*/ + +int +datUnmap(const HDSLoc *locator, int *status); + +/*==================================*/ +/* datValid - Enquire locator valid */ +/*==================================*/ + +int +datValid(const HDSLoc *locator, hdsbool_t *valid, int *status); + +/*===========================*/ +/* datVec - Vectorise object */ +/*===========================*/ + +int +datVec(const HDSLoc *locator1, HDSLoc **locator2, int *status); + +/*================================================*/ +/* datWhere - Find primitive position in HDS file */ +/* Currently not part of the public */ +/* C API */ +/*================================================*/ + +/*==================================================*/ +/* hdsCopy - Copy an object to a new container file */ +/*==================================================*/ + +int +hdsCopy(const HDSLoc *locator, const char *file_str, const char name_str[DAT__SZNAM], int *status); + +/*=================================*/ +/* hdsErase - Erase container file */ +/*=================================*/ + +int +hdsErase(HDSLoc **locator, int *status); + +/*===============================================================*/ +/* hdsEwild - End a wild card search for HDS container files */ +/*===============================================================*/ + +int +hdsEwild(int *iwld, int *status); + +/*================================*/ +/* hdsFlush - Flush locator group */ +/*=================================*/ + +int +hdsFlush(const char *group_str, int *status); + +/*===============================*/ +/* hdsFree - Free container file */ +/*===============================*/ + +int +hdsFree(const HDSLoc *locator, int *status); + +/*==================================*/ +/* hdsGroup - Enquire locator group */ +/*==================================*/ + +int +hdsGroup(const HDSLoc *locator, char group_str[DAT__SZGRP+1], int *status); + +/*=========================================*/ +/* hdsGtune - Get HDS tuning parameter */ +/*=========================================*/ + +int +hdsGtune(const char *param_str, int *value, int *status); + +/*=========================================*/ +/* hdsGtune - Get HDS status integers */ +/*=========================================*/ + +int +hdsInfoI(const HDSLoc* locator, const char *topic_str, const char *extra, int *result, int *status); + +/*=================================*/ +/* hdsLink - Link locator to group */ +/*=================================*/ + +int +hdsLink(const HDSLoc *locator, const char *group_str, int *status); + +/*================================*/ +/* hdsLock - Lock container file */ +/*================================*/ + +int +hdsLock(const HDSLoc *locator, int *status); + +/*====================================*/ +/* hdsNew - Create new container file */ +/*====================================*/ + +int +hdsNew(const char *file_str, const char *name_str, const char *type_str, int ndim, const hdsdim dims[], HDSLoc **locator, int *status); + +/*========================================*/ +/* hdsOpen - Open existing container file */ +/*========================================*/ + +int +hdsOpen(const char *file_str, const char *mode_str, HDSLoc **locator, int *status); + +/*===============================*/ +/* hdsShow - Show HDS statistics */ +/*===============================*/ + +int +hdsShow(const char *topic_str, int *status); + +/*===============================================*/ +/* hdsState - Enquire the current state of HDS */ +/*===============================================*/ + +int +hdsState(hdsbool_t *state, int *status); + +/*============================*/ +/* hdsStop - Close down HDS */ +/*============================*/ + +int +hdsStop(int *status); + +/*==============================*/ +/* hdsTrace - Trace object path */ +/*==============================*/ + +int +hdsTrace(const HDSLoc *locator, int *nlev, char *path_str, char *file_str, int *status, size_t path_length, size_t file_length); + +/*========================================*/ +/* hdsTune - Set HDS tuning parameter */ +/*========================================*/ + +int +hdsTune(const char *param_str, int value, int *status); + +/*=================================================================*/ +/* hdsWild - Perform a wild-card search for HDS container files */ +/*=================================================================*/ + +int +hdsWild(const char *fspec, const char *mode, int *iwld, HDSLoc **locator, int *status); + +/*=================================================================*/ +/* Deprecated routines! */ +/*=================================================================*/ + +/*========================================*/ +/* datConv - Enquire conversion possible? */ +/*========================================*/ + +int +datConv(const HDSLoc *locator, const char *type_str, hdsbool_t *conv, int *status); + +/*=====================================================*/ +/* hdsClose - Close container file (Obsolete routine!) */ +/*=====================================================*/ + +int +hdsClose(HDSLoc **locator, int *status); + + +/*===================================================================*/ +/* hdsFind - Find an object (Fortran routine, requires hdsf library) */ +/*===================================================================*/ +void +hdsFind(const HDSLoc *locator1, const char *name, const char *mode, HDSLoc **locator2, int *status); + + +/* STAR_HDS_H_INCLUDED */ +#endif diff --git a/libraries/hds/hds1.h b/libraries/hds-v4/hds1.h similarity index 100% rename from libraries/hds/hds1.h rename to libraries/hds-v4/hds1.h diff --git a/libraries/hds/hds1_cleanup.c b/libraries/hds-v4/hds1_cleanup.c similarity index 100% rename from libraries/hds/hds1_cleanup.c rename to libraries/hds-v4/hds1_cleanup.c diff --git a/libraries/hds/hds1_exit.c b/libraries/hds-v4/hds1_exit.c similarity index 100% rename from libraries/hds/hds1_exit.c rename to libraries/hds-v4/hds1_exit.c diff --git a/libraries/hds/hds2.h b/libraries/hds-v4/hds2.h similarity index 100% rename from libraries/hds/hds2.h rename to libraries/hds-v4/hds2.h diff --git a/libraries/hds/hdsCopy.c b/libraries/hds-v4/hdsCopy.c similarity index 100% rename from libraries/hds/hdsCopy.c rename to libraries/hds-v4/hdsCopy.c diff --git a/libraries/hds/hdsEwild.c b/libraries/hds-v4/hdsEwild.c similarity index 100% rename from libraries/hds/hdsEwild.c rename to libraries/hds-v4/hdsEwild.c diff --git a/libraries/hds/hdsGtune.c b/libraries/hds-v4/hdsGtune.c similarity index 100% rename from libraries/hds/hdsGtune.c rename to libraries/hds-v4/hdsGtune.c diff --git a/libraries/hds/hdsInfoI.c b/libraries/hds-v4/hdsInfoI.c similarity index 100% rename from libraries/hds/hdsInfoI.c rename to libraries/hds-v4/hdsInfoI.c diff --git a/libraries/hds/hdsState.c b/libraries/hds-v4/hdsState.c similarity index 100% rename from libraries/hds/hdsState.c rename to libraries/hds-v4/hdsState.c diff --git a/libraries/hds/hdsStop.c b/libraries/hds-v4/hdsStop.c similarity index 100% rename from libraries/hds/hdsStop.c rename to libraries/hds-v4/hdsStop.c diff --git a/libraries/hds-v4/hdsTest.c b/libraries/hds-v4/hdsTest.c new file mode 100644 index 00000000000..5d59eaeff04 --- /dev/null +++ b/libraries/hds-v4/hdsTest.c @@ -0,0 +1,486 @@ +/* +*+ +* Name: +* hdsTest + +* Purpose: +* Test the C interface to HDS + +* Language: +* Starlink ANSI C + +* Description: +* This program tests some of the C API to HDS. It is not meant +* to be an exhaustive test of all the API (at least not initially). + +* Copyright: +* Copyright (C) 2005-2006 Particle Physics and Astronomy Research Council. +* All Rights Reserved. + +* Authors: +* TIMJ: Tim Jenness (JAC, Hawaii) +* {enter_new_authors_here} + +* History: +* 04-NOV-2005 (TIMJ): +* Original. +* 20-DEC-2005 (TIMJ): +* No longer requires FC_MAIN +* 25-JAN-2006 (TIMJ): +* Add hdsShow/hdsInfoI +* {enter_further_changes_here} + +* Licence: +* 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, write to the Free +* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301, USA + +* Bugs: +* {note_any_bugs_here} + +*- +*/ + +#if HAVE_CONFIG_H +# include +#endif + +#include "hds1.h" +#include "hds.h" +#include +#include "ems.h" +#include "dat_err.h" +#include +#include + +static void traceme (const HDSLoc * loc, int *status); +static void cmpprec ( const HDSLoc * loc1, const char * name, int * status ); + + +int main (void) { + + /* Local Variables: */ + const char path[] = "hds_ctest"; + int status = DAT__OK; + hdsdim dim[] = { 10, 20 }; + hdsdim dimd[1]; + const char * chararr[] = { "TEST1", "TEST2", "Longish String" }; + char *retchararr[4]; + char buffer[1024]; /* plenty large enough */ + double darr[] = { 4.5, 2.5 }; + double retdarr[2]; + void *mapv; /* Mapped void* */ + double *mapd; /* Mapped _DOUBLE */ + float *mapf; /* Mapped _REAL */ + int *mapi; /* Mapped _INTEGER */ + int64_t *mapi64; /* Mapped _INT64 */ + HDSLoc * loc1 = NULL; + HDSLoc * loc2 = NULL; + HDSLoc * loc3 = NULL; + size_t actval; + size_t nel; + size_t nelt; + size_t nbytes; + size_t i; + int n; + double sumd; + int sumi; + int64_t sumi64; + int64_t test64; + int64_t testin64; + const int64_t VAL__BADK = (-9223372036854775807 - 1); + + emsBegin(&status); + + /* Force 64-bit mode */ + hdsTune( "64BIT", 1, &status ); + + /* Create a new container file */ + hdsNew( path, "HDS_TEST", "NDF", 0, dim, &loc1, &status ); + + { + int gndim; + int i; + hdsdim celldims[] = {1}; + hdsdim gdims[DAT__MXDIM]; + datShape(loc1, DAT__MXDIM, gdims, &gndim, &status); + printf("GROUP NDIMS: %d\n", gndim); + for (i=0; i +#endif + +#if HAVE_TIME_H +# include +#endif + +#include + +#include +#include +#include "f77.h" + +#define INCLUDE_FILE "hds_types.h" +#define PINCLUDE_FILE "hds1_types.h" + +/* Work everything out here */ + +/* Define a "normal integer". Typically use the "int" type, but ensure it */ +/* has at least 4 bytes of precision. */ + +#if ( ( INT_MIN <= -2147483647L ) && ( INT_MAX >= 2147483647L ) ) +# define STD_INT "int" +# define STD_INT_FMT "d" +#else +# define STD_INT "long int" +# define STD_INT_FMT "ld" +#endif + +/* Definitions for 64-bits integers */ +/* Use the standard int64_t if available */ +/* Use 'long' if it is 8 bytes, else use 'long long' */ + +#if HAVE_INT64_T && HAVE_UINT64_T +#define INT_BIG "int64_t" +#define UINT_BIG "uint64_t" +#if __MINGW32__ +#define INT_BIG_S "I64d" +#define INT_BIG_U "I64u" +#else +#define INT_BIG_S "lld" +#define INT_BIG_U "llu" +#endif +#elif SIZEOF_LONG == 8 +#define INT_BIG "long int" +#define UINT_BIG "unsigned long int" +#define INT_BIG_S "ld" +#define INT_BIG_U "lu" +#elif SIZEOF_LONG_LONG == 8 +#define INT_BIG "long long int" +#define UINT_BIG "unsigned long long int" +#if __MINGW32__ +#define INT_BIG_S "I64d" +#define INT_BIG_U "I64u" +#else +#define INT_BIG_S "lld" +#define INT_BIG_U "llu" +#endif +#else +error unable to find an 8 byte integer type +#endif + +/* The internal size of array dimensions within HDS can be either 32 or 64 */ +/* bits. Note that 64 bits is untested and WILL change the file format!!! */ + +/* Can not derive the dim size so we just set it */ +/* We also state whether this is unsigned so that we can compare with + the fortran type and also define the size. The last bit is a bit of + a kluge to prevent sizeof("uint64_t") coming up with 9 */ +#define BIGDIM 0 /* set to 1 if testing 64 bit dims */ +#if BIGDIM +#define DIM_TYPE UINT_BIG +#define SIZEOF_DIM 8 +#define DIM_FORMAT INT_BIG_U +#define DIM_IS_UNSIGNED 1 +#else +#define DIM_TYPE STD_INT +#define SIZEOF_DIM 4 +#define DIM_FORMAT STD_INT_FMT +#define DIM_IS_UNSIGNED 0 +#endif + +/* Good grief. All I want to do is put quotes around the CNF type + for printing */ +#define myxstr(s) mystr(s) +#define mystr(s) #s + +/* Simply state the Fortran type. We could choose a 64bit type here + if we suddenly switched to INTEGER*8. Fortran will normally always + be signed */ +#define FORTRAN_HDS_INDEX_TYPE myxstr(F77_INTEGER_TYPE) +#define FORTRAN_DIM_IS_UNSIGNED 0 + +/* Internal prototypes */ +const char* todaysdate(void); + +/* Main routine */ +int main (int argc, char ** argv ) { + char * progname = argv[0]; + FILE * OutputFile; + FILE * POutputFile; + int copydims; + + /* Open the public output file */ + OutputFile = fopen( INCLUDE_FILE, "w" ); + if (!OutputFile) { + fprintf(stderr, "%s: can't open file %s for output\n", + progname, INCLUDE_FILE ); + return EXIT_FAILURE; + } + + /* Open the public output file */ + POutputFile = fopen( PINCLUDE_FILE, "w" ); + if (!POutputFile) { + fprintf(stderr, "%s: can't open file %s for output\n", + progname, PINCLUDE_FILE ); + return EXIT_FAILURE; + } + + /* Start writing the include file. Begin with the header */ + fprintf(OutputFile, +"#if !defined( HDS_TYPES_INCLUDED ) /* %s already included? */\n" +"#define HDS_TYPES_INCLUDED 1\n" +"/*\n" +"*+\n" +"* Name:\n" +"* %s\n" +"\n" +"* Type of Module:\n" +"* C include file.\n" +"\n" +"* Purpose:\n" +"* Define public HDS-specific data types.\n" +"\n" +"* Description:\n" +"* This file defines the public types that are used in the HDS\n" +"* public API.\n" +"\n" +"* Authors:\n" +"* TIMJ: Tim Jenness (JAC, Hawaii)\n" +"* %s program\n" +"\n" +"* History:\n" +"* 21-Oct-2005 (TIMJ):\n" +"* Original version of C program (via auto-generation).\n" +"* %s (%s):\n" +"* Generated\n" +"* No further changes -- do not edit this file\n" +"\n" +"*-\n" +"*/" +"\n\n", + INCLUDE_FILE, INCLUDE_FILE, progname, todaysdate(), progname); + + /* Start writing the private include file. Begin with the header */ + fprintf(POutputFile, +"#if !defined( HDS1_TYPES_INCLUDED ) /* %s already included? */\n" +"#define HDS1_TYPES_INCLUDED 1\n" +"/*\n" +"*+\n" +"* Name:\n" +"* %s\n" +"\n" +"* Type of Module:\n" +"* C include file.\n" +"\n" +"* Purpose:\n" +"* Define private but derived HDS-specific data types.\n" +"\n" +"* Description:\n" +"* This file defines the private types that are used in the HDS\n" +"* build but have no reason to be public.\n" +"\n" +"* Authors:\n" +"* TIMJ: Tim Jenness (JAC, Hawaii)\n" +"* %s program\n" +"\n" +"* History:\n" +"* 21-Oct-2005 (TIMJ):\n" +"* Original version of C program (via auto-generation).\n" +"* %s (%s):\n" +"* Generated\n" +"* No further changes -- do not edit this file\n" +"\n" +"*-\n" +"*/" +"\n\n", + PINCLUDE_FILE, PINCLUDE_FILE, progname, todaysdate(), progname); + + /* System defines */ +#if HAVE_STDDEF_H + fprintf(POutputFile, "#include \n\n" ); + fprintf(OutputFile, "#include \n\n" ); +#endif +#if HAVE_INTTYPES_H + fprintf(POutputFile, "#include \n\n" ); + fprintf(OutputFile, "#include \n\n" ); +#else +# if HAVE_STDINT_H + fprintf(POutputFile, "#include \n\n" ); +# endif +#endif + + + /* We first need to decide what we are using for a normal hdsint */ + + fprintf(POutputFile, "/* Standard HDS integer type. Only used internally */\n"); + fprintf(POutputFile, "typedef %s hdsi32_t;\n\n", STD_INT ); + + /* 64 bit integer type. Also internal for now */ + fprintf(POutputFile, "/* Standard HDS 64 bit integer (internal) */\n"); + + fprintf(POutputFile, + "typedef %s hdsi64_t;\n" + "typedef %s hdsu64_t;\n" + "#define HDS_INT_BIG_S \"%s\"\n" + "#define HDS_INT_BIG_U \"%s\"\n\n", + INT_BIG, UINT_BIG, INT_BIG_S, INT_BIG_U); + + /* Make sure that int64_t is defined to something */ +#if !HAVE_INT64_T + fprintf(OutputFile, "/* standardise 64-bit integer for API */\n"); + fprintf(OutputFile, "typedef %s int64_t\n\n", INT_BIG ); +#endif + + /* Note that we do not make public a true struct LOC since that would require that + struct LCP is also made public. We simply create a struct that has the same sized + components as an LOC and cast between them internally in HDS */ + + fprintf( OutputFile, + "/* Public type for dealing with HDS locators */\n" + "/* The contents of the struct are private to HDS. The only public */\n" + "/* part is the HDSLoc typedef. Never use 'struct LOC' directly. */\n" + "typedef struct LOC HDSLoc;\n\n"); + + /* Dimensions */ + fprintf( OutputFile, + "/* Public type for specifying HDS dimensions */\n" + "typedef %s hdsdim;\n" + "#define HDS_DIM_FORMAT \"%s\"\n\n", + DIM_TYPE, DIM_FORMAT); + + fprintf( POutputFile, + "/* Private types and sizes relating to dimensions */\n" + "typedef %s FORTRAN_INDEX_TYPE;\n" + "#define SIZEOF_HDSDIM %ld\n" + "#define HDSDIM_IS_UNSIGNED %d\n\n", + FORTRAN_HDS_INDEX_TYPE, + (long)SIZEOF_DIM, DIM_IS_UNSIGNED); + + + /* Need to decide whether fortran dims need to be copied to + C dims. This is required if either the size of signedness + differ */ + + if ( (sizeof(DIM_TYPE) == sizeof(FORTRAN_HDS_INDEX_TYPE)) && + (FORTRAN_DIM_IS_UNSIGNED == DIM_IS_UNSIGNED)) { + copydims = 0; + } else { + copydims = 1; + } + fprintf(POutputFile, + "/* Decide whether Fortran dims should be copied element by element */\n" + "#define HDS_COPY_FORTRAN_DIMS %d\n\n", + copydims); + + /* Logical type -- the C side does not need to be the same as the Fortran + side. */ + fprintf( OutputFile, + "/* Public type for Logical type */\n" + "typedef %s hdsbool_t;\n" + "#define HDS_BOOL_FORMAT \"%s\"\n\n", + "int", "d"); + + fprintf(OutputFile, + "#endif /* _INCLUDED */\n\n"); + fprintf(POutputFile, + "#endif /* _INCLUDED */\n\n"); + + fclose( OutputFile ); + fclose( POutputFile ); + + return EXIT_SUCCESS; +} + + + +/* Stolen from make-prm-par.c */ +const char *todaysdate(void) +{ +#if HAVE_TIME_H + static char s[12]; + time_t t = time(0); + + strftime(s, sizeof(s), "%d-%b-%Y", localtime(&t)); + return s; +#else + return "TODAY"; +#endif +} diff --git a/libraries/hds/rec.h b/libraries/hds-v4/rec.h similarity index 100% rename from libraries/hds/rec.h rename to libraries/hds-v4/rec.h diff --git a/libraries/hds/rec1.h b/libraries/hds-v4/rec1.h similarity index 100% rename from libraries/hds/rec1.h rename to libraries/hds-v4/rec1.h diff --git a/libraries/hds/rec1_alloc_frame.c b/libraries/hds-v4/rec1_alloc_frame.c similarity index 100% rename from libraries/hds/rec1_alloc_frame.c rename to libraries/hds-v4/rec1_alloc_frame.c diff --git a/libraries/hds/rec1_clear_cbm.c b/libraries/hds-v4/rec1_clear_cbm.c similarity index 100% rename from libraries/hds/rec1_clear_cbm.c rename to libraries/hds-v4/rec1_clear_cbm.c diff --git a/libraries/hds/rec1_close_file.c b/libraries/hds-v4/rec1_close_file.c similarity index 100% rename from libraries/hds/rec1_close_file.c rename to libraries/hds-v4/rec1_close_file.c diff --git a/libraries/hds/rec1_close_slot.c b/libraries/hds-v4/rec1_close_slot.c similarity index 100% rename from libraries/hds/rec1_close_slot.c rename to libraries/hds-v4/rec1_close_slot.c diff --git a/libraries/hds/rec1_create_file.c b/libraries/hds-v4/rec1_create_file.c similarity index 100% rename from libraries/hds/rec1_create_file.c rename to libraries/hds-v4/rec1_create_file.c diff --git a/libraries/hds/rec1_deall_frame.c b/libraries/hds-v4/rec1_deall_frame.c similarity index 100% rename from libraries/hds/rec1_deall_frame.c rename to libraries/hds-v4/rec1_deall_frame.c diff --git a/libraries/hds/rec1_extend_file.c b/libraries/hds-v4/rec1_extend_file.c similarity index 100% rename from libraries/hds/rec1_extend_file.c rename to libraries/hds-v4/rec1_extend_file.c diff --git a/libraries/hds/rec1_extend_frame.c b/libraries/hds-v4/rec1_extend_frame.c similarity index 100% rename from libraries/hds/rec1_extend_frame.c rename to libraries/hds-v4/rec1_extend_frame.c diff --git a/libraries/hds/rec1_find_file.c b/libraries/hds-v4/rec1_find_file.c similarity index 100% rename from libraries/hds/rec1_find_file.c rename to libraries/hds-v4/rec1_find_file.c diff --git a/libraries/hds/rec1_flush_block.c b/libraries/hds-v4/rec1_flush_block.c similarity index 100% rename from libraries/hds/rec1_flush_block.c rename to libraries/hds-v4/rec1_flush_block.c diff --git a/libraries/hds/rec1_fmsg.c b/libraries/hds-v4/rec1_fmsg.c similarity index 100% rename from libraries/hds/rec1_fmsg.c rename to libraries/hds-v4/rec1_fmsg.c diff --git a/libraries/hds/rec1_get_fid.c b/libraries/hds-v4/rec1_get_fid.c similarity index 100% rename from libraries/hds/rec1_get_fid.c rename to libraries/hds-v4/rec1_get_fid.c diff --git a/libraries/hds/rec1_get_path.c b/libraries/hds-v4/rec1_get_path.c similarity index 100% rename from libraries/hds/rec1_get_path.c rename to libraries/hds-v4/rec1_get_path.c diff --git a/libraries/hds/rec1_getcwd.c b/libraries/hds-v4/rec1_getcwd.c similarity index 100% rename from libraries/hds/rec1_getcwd.c rename to libraries/hds-v4/rec1_getcwd.c diff --git a/libraries/hds/rec1_locate_hcb.c b/libraries/hds-v4/rec1_locate_hcb.c similarity index 100% rename from libraries/hds/rec1_locate_hcb.c rename to libraries/hds-v4/rec1_locate_hcb.c diff --git a/libraries/hds/rec1_lock_slot.c b/libraries/hds-v4/rec1_lock_slot.c similarity index 100% rename from libraries/hds/rec1_lock_slot.c rename to libraries/hds-v4/rec1_lock_slot.c diff --git a/libraries/hds/rec1_map_frame.c b/libraries/hds-v4/rec1_map_frame.c similarity index 100% rename from libraries/hds/rec1_map_frame.c rename to libraries/hds-v4/rec1_map_frame.c diff --git a/libraries/hds/rec1_open_file.c b/libraries/hds-v4/rec1_open_file.c similarity index 100% rename from libraries/hds/rec1_open_file.c rename to libraries/hds-v4/rec1_open_file.c diff --git a/libraries/hds/rec1_pack_chain.c b/libraries/hds-v4/rec1_pack_chain.c similarity index 100% rename from libraries/hds/rec1_pack_chain.c rename to libraries/hds-v4/rec1_pack_chain.c diff --git a/libraries/hds/rec1_pack_hcb.c b/libraries/hds-v4/rec1_pack_hcb.c similarity index 100% rename from libraries/hds/rec1_pack_hcb.c rename to libraries/hds-v4/rec1_pack_hcb.c diff --git a/libraries/hds/rec1_pack_ncomp.c b/libraries/hds-v4/rec1_pack_ncomp.c similarity index 100% rename from libraries/hds/rec1_pack_ncomp.c rename to libraries/hds-v4/rec1_pack_ncomp.c diff --git a/libraries/hds/rec1_pack_rcl.c b/libraries/hds-v4/rec1_pack_rcl.c similarity index 100% rename from libraries/hds/rec1_pack_rcl.c rename to libraries/hds-v4/rec1_pack_rcl.c diff --git a/libraries/hds/rec1_read_file.c b/libraries/hds-v4/rec1_read_file.c similarity index 100% rename from libraries/hds/rec1_read_file.c rename to libraries/hds-v4/rec1_read_file.c diff --git a/libraries/hds/rec1_save_addr.c b/libraries/hds-v4/rec1_save_addr.c similarity index 100% rename from libraries/hds/rec1_save_addr.c rename to libraries/hds-v4/rec1_save_addr.c diff --git a/libraries/hds/rec1_scan_cbm.c b/libraries/hds-v4/rec1_scan_cbm.c similarity index 100% rename from libraries/hds/rec1_scan_cbm.c rename to libraries/hds-v4/rec1_scan_cbm.c diff --git a/libraries/hds/rec1_set_cbm.c b/libraries/hds-v4/rec1_set_cbm.c similarity index 100% rename from libraries/hds/rec1_set_cbm.c rename to libraries/hds-v4/rec1_set_cbm.c diff --git a/libraries/hds/rec1_shell.c b/libraries/hds-v4/rec1_shell.c similarity index 100% rename from libraries/hds/rec1_shell.c rename to libraries/hds-v4/rec1_shell.c diff --git a/libraries/hds/rec1_test_cbm.c b/libraries/hds-v4/rec1_test_cbm.c similarity index 100% rename from libraries/hds/rec1_test_cbm.c rename to libraries/hds-v4/rec1_test_cbm.c diff --git a/libraries/hds/rec1_unlock_slot.c b/libraries/hds-v4/rec1_unlock_slot.c similarity index 100% rename from libraries/hds/rec1_unlock_slot.c rename to libraries/hds-v4/rec1_unlock_slot.c diff --git a/libraries/hds/rec1_unmap_frame.c b/libraries/hds-v4/rec1_unmap_frame.c similarity index 100% rename from libraries/hds/rec1_unmap_frame.c rename to libraries/hds-v4/rec1_unmap_frame.c diff --git a/libraries/hds/rec1_unpack_chain.c b/libraries/hds-v4/rec1_unpack_chain.c similarity index 100% rename from libraries/hds/rec1_unpack_chain.c rename to libraries/hds-v4/rec1_unpack_chain.c diff --git a/libraries/hds/rec1_unpack_hcb.c b/libraries/hds-v4/rec1_unpack_hcb.c similarity index 100% rename from libraries/hds/rec1_unpack_hcb.c rename to libraries/hds-v4/rec1_unpack_hcb.c diff --git a/libraries/hds/rec1_unpack_ncomp.c b/libraries/hds-v4/rec1_unpack_ncomp.c similarity index 100% rename from libraries/hds/rec1_unpack_ncomp.c rename to libraries/hds-v4/rec1_unpack_ncomp.c diff --git a/libraries/hds/rec1_unpack_rcl.c b/libraries/hds-v4/rec1_unpack_rcl.c similarity index 100% rename from libraries/hds/rec1_unpack_rcl.c rename to libraries/hds-v4/rec1_unpack_rcl.c diff --git a/libraries/hds/rec1_update_free.c b/libraries/hds-v4/rec1_update_free.c similarity index 100% rename from libraries/hds/rec1_update_free.c rename to libraries/hds-v4/rec1_update_free.c diff --git a/libraries/hds/rec1_write_file.c b/libraries/hds-v4/rec1_write_file.c similarity index 100% rename from libraries/hds/rec1_write_file.c rename to libraries/hds-v4/rec1_write_file.c diff --git a/libraries/hds/rec_adopt_record.c b/libraries/hds-v4/rec_adopt_record.c similarity index 100% rename from libraries/hds/rec_adopt_record.c rename to libraries/hds-v4/rec_adopt_record.c diff --git a/libraries/hds/rec_alloc_mem.c b/libraries/hds-v4/rec_alloc_mem.c similarity index 100% rename from libraries/hds/rec_alloc_mem.c rename to libraries/hds-v4/rec_alloc_mem.c diff --git a/libraries/hds/rec_alloc_xmem.c b/libraries/hds-v4/rec_alloc_xmem.c similarity index 100% rename from libraries/hds/rec_alloc_xmem.c rename to libraries/hds-v4/rec_alloc_xmem.c diff --git a/libraries/hds/rec_attach_file.c b/libraries/hds-v4/rec_attach_file.c similarity index 100% rename from libraries/hds/rec_attach_file.c rename to libraries/hds-v4/rec_attach_file.c diff --git a/libraries/hds/rec_close_file.c b/libraries/hds-v4/rec_close_file.c similarity index 100% rename from libraries/hds/rec_close_file.c rename to libraries/hds-v4/rec_close_file.c diff --git a/libraries/hds/rec_count_files.c b/libraries/hds-v4/rec_count_files.c similarity index 100% rename from libraries/hds/rec_count_files.c rename to libraries/hds-v4/rec_count_files.c diff --git a/libraries/hds/rec_create_record.c b/libraries/hds-v4/rec_create_record.c similarity index 100% rename from libraries/hds/rec_create_record.c rename to libraries/hds-v4/rec_create_record.c diff --git a/libraries/hds/rec_deall_mem.c b/libraries/hds-v4/rec_deall_mem.c similarity index 100% rename from libraries/hds/rec_deall_mem.c rename to libraries/hds-v4/rec_deall_mem.c diff --git a/libraries/hds/rec_deall_xmem.c b/libraries/hds-v4/rec_deall_xmem.c similarity index 100% rename from libraries/hds/rec_deall_xmem.c rename to libraries/hds-v4/rec_deall_xmem.c diff --git a/libraries/hds/rec_delete_record.c b/libraries/hds-v4/rec_delete_record.c similarity index 100% rename from libraries/hds/rec_delete_record.c rename to libraries/hds-v4/rec_delete_record.c diff --git a/libraries/hds/rec_end_wild.c b/libraries/hds-v4/rec_end_wild.c similarity index 100% rename from libraries/hds/rec_end_wild.c rename to libraries/hds-v4/rec_end_wild.c diff --git a/libraries/hds/rec_extend_record.c b/libraries/hds-v4/rec_extend_record.c similarity index 100% rename from libraries/hds/rec_extend_record.c rename to libraries/hds-v4/rec_extend_record.c diff --git a/libraries/hds/rec_get_handle.c b/libraries/hds-v4/rec_get_handle.c similarity index 100% rename from libraries/hds/rec_get_handle.c rename to libraries/hds-v4/rec_get_handle.c diff --git a/libraries/hds/rec_get_rcl.c b/libraries/hds-v4/rec_get_rcl.c similarity index 100% rename from libraries/hds/rec_get_rcl.c rename to libraries/hds-v4/rec_get_rcl.c diff --git a/libraries/hds/rec_get_rid.c b/libraries/hds-v4/rec_get_rid.c similarity index 100% rename from libraries/hds/rec_get_rid.c rename to libraries/hds-v4/rec_get_rid.c diff --git a/libraries/hds/rec_list_files.c b/libraries/hds-v4/rec_list_files.c similarity index 100% rename from libraries/hds/rec_list_files.c rename to libraries/hds-v4/rec_list_files.c diff --git a/libraries/hds/rec_locate_block.c b/libraries/hds-v4/rec_locate_block.c similarity index 100% rename from libraries/hds/rec_locate_block.c rename to libraries/hds-v4/rec_locate_block.c diff --git a/libraries/hds/rec_locate_data.c b/libraries/hds-v4/rec_locate_data.c similarity index 100% rename from libraries/hds/rec_locate_data.c rename to libraries/hds-v4/rec_locate_data.c diff --git a/libraries/hds/rec_locate_fns.c b/libraries/hds-v4/rec_locate_fns.c similarity index 100% rename from libraries/hds/rec_locate_fns.c rename to libraries/hds-v4/rec_locate_fns.c diff --git a/libraries/hds/rec_lock.c b/libraries/hds-v4/rec_lock.c similarity index 100% rename from libraries/hds/rec_lock.c rename to libraries/hds-v4/rec_lock.c diff --git a/libraries/hds/rec_mark_delete.c b/libraries/hds-v4/rec_mark_delete.c similarity index 100% rename from libraries/hds/rec_mark_delete.c rename to libraries/hds-v4/rec_mark_delete.c diff --git a/libraries/hds/rec_reall_mem.c b/libraries/hds-v4/rec_reall_mem.c similarity index 100% rename from libraries/hds/rec_reall_mem.c rename to libraries/hds-v4/rec_reall_mem.c diff --git a/libraries/hds/rec_refcnt.c b/libraries/hds-v4/rec_refcnt.c similarity index 100% rename from libraries/hds/rec_refcnt.c rename to libraries/hds-v4/rec_refcnt.c diff --git a/libraries/hds/rec_release_block.c b/libraries/hds-v4/rec_release_block.c similarity index 100% rename from libraries/hds/rec_release_block.c rename to libraries/hds-v4/rec_release_block.c diff --git a/libraries/hds/rec_release_data.c b/libraries/hds-v4/rec_release_data.c similarity index 100% rename from libraries/hds/rec_release_data.c rename to libraries/hds-v4/rec_release_data.c diff --git a/libraries/hds/rec_reset_record.c b/libraries/hds-v4/rec_reset_record.c similarity index 100% rename from libraries/hds/rec_reset_record.c rename to libraries/hds-v4/rec_reset_record.c diff --git a/libraries/hds/rec_same_file.c b/libraries/hds-v4/rec_same_file.c similarity index 100% rename from libraries/hds/rec_same_file.c rename to libraries/hds-v4/rec_same_file.c diff --git a/libraries/hds/rec_shrink_record.c b/libraries/hds-v4/rec_shrink_record.c similarity index 100% rename from libraries/hds/rec_shrink_record.c rename to libraries/hds-v4/rec_shrink_record.c diff --git a/libraries/hds/rec_start.c b/libraries/hds-v4/rec_start.c similarity index 100% rename from libraries/hds/rec_start.c rename to libraries/hds-v4/rec_start.c diff --git a/libraries/hds/rec_stop.c b/libraries/hds-v4/rec_stop.c similarity index 100% rename from libraries/hds/rec_stop.c rename to libraries/hds-v4/rec_stop.c diff --git a/libraries/hds/rec_unlock.c b/libraries/hds-v4/rec_unlock.c similarity index 100% rename from libraries/hds/rec_unlock.c rename to libraries/hds-v4/rec_unlock.c diff --git a/libraries/hds/rec_where.c b/libraries/hds-v4/rec_where.c similarity index 100% rename from libraries/hds/rec_where.c rename to libraries/hds-v4/rec_where.c diff --git a/libraries/hds/rec_wild_file.c b/libraries/hds-v4/rec_wild_file.c similarity index 100% rename from libraries/hds/rec_wild_file.c rename to libraries/hds-v4/rec_wild_file.c diff --git a/libraries/hds/rtl_fixups.c b/libraries/hds-v4/rtl_fixups.c similarity index 100% rename from libraries/hds/rtl_fixups.c rename to libraries/hds-v4/rtl_fixups.c diff --git a/libraries/hds/str.h b/libraries/hds-v4/str.h similarity index 100% rename from libraries/hds/str.h rename to libraries/hds-v4/str.h diff --git a/libraries/hds/win_fixups.c b/libraries/hds-v4/win_fixups.c similarity index 100% rename from libraries/hds/win_fixups.c rename to libraries/hds-v4/win_fixups.c diff --git a/libraries/hds/win_fixups.h b/libraries/hds-v4/win_fixups.h similarity index 100% rename from libraries/hds/win_fixups.h rename to libraries/hds-v4/win_fixups.h diff --git a/libraries/hds/dat_par_h.c b/libraries/hds/dat_par_h.c deleted file mode 100644 index bf5de65d538..00000000000 --- a/libraries/hds/dat_par_h.c +++ /dev/null @@ -1,196 +0,0 @@ -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include "hds1.h" /* Global definitions for HDS */ -#include "rec.h" /* Public rec_ definitions */ -#include "dat1.h" /* Internal dat_ definitions */ - - int main( int argc, char *argv[] ) - { -/* Name: */ -/* dat_par_h */ - -/* Purpose: */ -/* Generate the C dat_par.h public include file for HDS. */ - -/* Type of Module: */ -/* Main Program. */ - -/* Invocation: */ -/* dat_par_h */ - -/* Parameters: */ -/* None. */ - -/* Description: */ -/* This program is used to generate the C public include file dat_par.h */ -/* for use by software which calls HDS routines. This method is used so */ -/* that this file may contain constants whose value is determined by the */ -/* C compiler at compile time, depending on such things as the size of */ -/* internal HDS structures which are not public. The dat_par.h file */ -/* contents are written to the standard output. */ - -/* Copyright: */ -/* Copyright (C) 1998 Central Laroratory of the Research Councils */ - -/* Licence: */ -/* 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, write to the Free */ -/* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, */ -/* MA 02110-1301, USA */ - -/* Authors: */ -/* RFWS: R.F. Warren-Smith (STARLINK, RAL) */ -/* PWD: Peter W. Draper (JAC, Durham University) */ -/* TIMJ: Tim Jenness (JAC, Hawaii) */ -/* {enter_new_authors_here} */ - -/* History: */ -/* 7-JUL-1993 (RFWS): */ -/* Original version. */ -/* 6-OCT-1998 (RFWS): */ -/* Pad string locator values out to correct length with spaces. */ -/* 1-SEP-2005 (PWD): */ -/* Deal with case when lengths of NOLOC and ROOT are greater than */ -/* SZLOC */ -/* 28-DEC-2005 (TIMJ): */ -/* Add DAT__FLEXT and DAT__SZFLX constants */ -/* {enter_changes_here} */ - -/* Bugs: */ -/* {note_any_bugs_here} */ - -/*- */ - -/*. */ - -/* Set up strings to be used to pad string locator values out to the */ -/* correct length (DAT__SZLOC characters). */ - char noloc[DAT__SZLOC + 1]; - char root[DAT__SZLOC + 1]; - int i; - - strncpy( noloc, DAT__NOLOC, DAT__SZLOC ); - for ( i = strlen( noloc ); i < DAT__SZLOC; i++ ) { - noloc[i] = ' '; - } - noloc[DAT__SZLOC] = '\0'; - - strncpy( root, DAT__ROOT, DAT__SZLOC ); - for ( i = strlen( root ); i < DAT__SZLOC; i++ ) { - root[i] = ' '; - } - root[DAT__SZLOC] = '\0'; - -/* Write out the contents of the dat_par.h file, leaving the constant */ -/* values to be filled in. */ - (void) printf( "\ -#if !defined( DAT_PAR_INCLUDED ) /* dat_par.h already included? */\n\ -#define DAT_PAR_INCLUDED 1\n\ -/*\n\ -*+\n\ -* Name:\n\ -* dat_par.h\n\ -\n\ -* Purpose:\n\ -* Define public global constants for the dat_ and hds_ routines.\n\ -\n\ -* Language:\n\ -* ANSI C\n\ -\n\ -* Type of Module:\n\ -* Global constants (macro) include file.\n\ -\n\ -* Description:\n\ -* This file contains macro definitions for global constants which\n\ -* are used by the dat_ and hds_ routines within the HDS package and\n\ -* which may also be needed by software which calls these routines.\n\ -\n\ -* Copyright:\n\ -* Copyright (C) 1998 Central Laboratory of the Research Councils\n\ -\n\ -* Authors:\n\ -* Generated automatically by the dat_par_h program.\n\ -* {enter_new_authors_here}\n\ -\n\ -* History:\n\ -* {enter_changes_here}\n\ -\n\ -*-\n\ -*/\n\ -\n\ -/* Remove earlier definitions if clash with private dat1.h version */\n\ -#ifdef DAT__MXDIM\n\ -#undef DAT__MXDIM\n\ -#endif\n\ -#ifdef DAT__NOLOC\n\ -#undef DAT__NOLOC\n\ -#endif\n\ -#ifdef DAT__NOWLD\n\ -#undef DAT__NOWLD\n\ -#endif\n\ -#ifdef DAT__ROOT\n\ -#undef DAT__ROOT\n\ -#endif\n\ -#ifdef DAT__SZGRP\n\ -#undef DAT__SZGRP\n\ -#endif\n\ -#ifdef DAT__SZLOC\n\ -#undef DAT__SZLOC\n\ -#endif\n\ -#ifdef DAT__SZMOD\n\ -#undef DAT__SZMOD\n\ -#endif\n\ -#ifdef DAT__SZNAM\n\ -#undef DAT__SZNAM\n\ -#endif\n\ -#ifdef DAT__SZTYP\n\ -#undef DAT__SZTYP\n\ -#endif\n\ -#ifdef DAT__FLEXT\n\ -#undef DAT__FLEXT\n\ -#endif\n\ -#ifdef DAT__SZFLX\n\ -#undef DAT__SZFLX\n\ -#endif\n\ -\n\ -/* Global Constants: */\n\ -\n\ -#define DAT__MXDIM %d /* Maximum number of object dimensions */\n\ -#define DAT__NOLOC \"%s\" /* Null (invalid) locator value */\n\ -#define DAT__NOWLD %d /* Null wild-card search context */\n\ -#define DAT__ROOT \"%s\" /* Root locator value */\n\ -#define DAT__SZGRP %d /* Size of group name */\n\ -#define DAT__SZLOC %d /* Size of locator */\n\ -#define DAT__SZMOD %d /* Size of access mode string */\n\ -#define DAT__SZNAM %d /* Size of object name */\n\ -#define DAT__SZTYP %d /* Size of type string */\n\ -#define DAT__SZFLX %d /* Size of file extension DAT__FLEXT */\n\ -#define DAT__FLEXT \"%s\" /* Default HDS file extension */\n\ -\n\ -/*. */\n\ -#endif\n", - -/* Specify the constant values. */ - DAT__MXDIM, noloc, DAT__NOWLD, root, - DAT__SZGRP, DAT__SZLOC, DAT__SZMOD, DAT__SZNAM, DAT__SZTYP, - DAT__SZFLX, DAT__FLEXT); - -/* End of program. */ - exit( 0 ); - return 0; - }