Changeset 1230 for branches/4.2/include/napi.h
- Timestamp:
- 14/04/09 18:56:40 (3 years ago)
- File:
-
- 1 edited
-
branches/4.2/include/napi.h (modified) (41 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/include/napi.h
r1206 r1230 27 27 /** \file 28 28 * Documentation for the NeXus-API version 4.2 29 * 2000-2007, the NeXus group 29 * 2000-2007, the NeXus group 30 * \defgroup c_main C API 31 * \defgroup c_types Data Types 32 * \ingroup c_main 33 * \defgroup c_init General Initialisation and shutdown 34 * \ingroup c_main 35 * \defgroup c_readwrite Reading and Writing 36 * \ingroup c_main 37 * \defgroup c_metadata Meta data routines 38 * \ingroup c_main 39 * \defgroup c_linking Linking and Group hierarchy 40 * \ingroup c_main 41 * \defgroup c_memory Memory allocation 42 * \ingroup c_main 43 * \defgroup c_external External linking 44 * \ingroup c_main 45 * \defgroup cpp_main C++ API 30 46 */ 31 47 … … 95 111 96 112 /** \var NeXus data types 113 * \ingroup c_types 97 114 * \li NX_FLOAT32 32 bit float 98 115 * \li NX_FLOAT64 64 nit float == double … … 182 199 183 200 # define NXgetinfo MANGLE(nxigetinfo) 201 # define NXgetrawinfo MANGLE(nxigetrawinfo) 184 202 # define NXgetnextentry MANGLE(nxigetnextentry) 185 203 # define NXgetdata MANGLE(nxigetdata) … … 243 261 * \param pHandle A file handle which will be initialized upon successfull completeion of NXopen. 244 262 * \return NX_OK on success, NX_ERROR in the case of an error. 263 * \ingroup c_init 245 264 */ 246 265 extern NXstatus NXopen(CONSTCHAR * filename, NXaccess access_method, NXhandle* pHandle); 266 247 267 /** 248 268 * close a NeXus file … … 250 270 * call. 251 271 * \return NX_OK on success, NX_ERROR in the case of an error. 272 * \ingroup c_init 252 273 */ 253 274 extern NXstatus NXclose(NXhandle* pHandle); 275 254 276 /** 255 277 * flush data to disk 256 278 * \param pHandle A NeXus file handle as initialized by NXopen. 257 279 * \return NX_OK on success, NX_ERROR in the case of an error. 280 * \ingroup c_readwrite 258 281 */ 259 282 extern NXstatus NXflush(NXhandle* pHandle); … … 266 289 * \param NXclass the class name of the group. Should start with the prefix NX 267 290 * \return NX_OK on success, NX_ERROR in the case of an error. 291 * \ingroup c_init 268 292 */ 269 293 extern NXstatus NXmakegroup (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass); 294 270 295 /** 271 296 * Step into a group. All further access will be within the opened group. … … 274 299 * \param NXclass the class name of the group. Should start with the prefix NX 275 300 * \return NX_OK on success, NX_ERROR in the case of an error. 301 * \ingroup c_init 276 302 */ 277 303 extern NXstatus NXopengroup (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass); 304 278 305 /** 279 306 * Open the NeXus object with the path specified … … 283 310 * Example: /entry1/sample/name 284 311 * \return NX_OK on success, NX_ERROR in the case of an error. 312 * \ingroup c_init 285 313 */ 286 314 extern NXstatus NXopenpath (NXhandle handle, CONSTCHAR *path); 315 287 316 /** 288 317 * Opens the group in which the NeXus object with the specified path exists … … 292 321 * Example: /entry1/sample/name 293 322 * \return NX_OK on success, NX_ERROR in the case of an error. 323 * \ingroup c_readwrite 294 324 */ 295 325 extern NXstatus NXopengrouppath (NXhandle handle, CONSTCHAR *path); 326 296 327 /** 297 328 * Closes the currently open group and steps one step down in the NeXus file 298 329 * hierarchy. 299 330 * \return NX_OK on success, NX_ERROR in the case of an error. 331 * \ingroup c_init 300 332 */ 301 333 extern NXstatus NXclosegroup(NXhandle handle); 334 302 335 /** 303 336 * Create a multi dimensional data array or dataset. The dataset is NOT opened. … … 309 342 * can be NX_UNLIMITED. Data can be appended to such a dimension using NXputslab. 310 343 * \return NX_OK on success, NX_ERROR in the case of an error. 344 * \ingroup c_init 311 345 */ 312 346 extern NXstatus NXmakedata (NXhandle handle, CONSTCHAR* label, int datatype, int rank, int dim[]); 347 313 348 /** 314 349 * Create a compressed dataset. The dataset is NOT opened. Data from this set will automatically be compressed when … … 329 364 * should be the same as the data dimension. If you write it in slabs, this is your preferred slab size. 330 365 * \return NX_OK on success, NX_ERROR in the case of an error. 366 * \ingroup c_init 331 367 */ 332 368 extern NXstatus NXcompmakedata (NXhandle handle, CONSTCHAR* label, int datatype, int rank, int dim[], int comp_typ, int bufsize[]); 369 333 370 /** 334 371 * Switch compression on. This routine is superseeded by NXcompmakedata and thus … … 340 377 * \li NX_COMP_RLE run length encoding (only HDF-4) 341 378 * \li NX_COMP_HUF Huffmann encoding (only HDF-4) 379 * \ingroup c_init 342 380 */ 343 381 extern NXstatus NXcompress (NXhandle handle, int compr_type); 382 344 383 /** 345 384 * Open access to a dataset. After this call it is possible to write and read data or … … 348 387 * \param label The name of the dataset 349 388 * \return NX_OK on success, NX_ERROR in the case of an error. 389 * \ingroup c_init 350 390 */ 351 391 extern NXstatus NXopendata (NXhandle handle, CONSTCHAR* label); 392 352 393 /** 353 394 * Close access to a dataset. 354 395 * \param handle A NeXus file handle as initialized by NXopen. 355 396 * \return NX_OK on success, NX_ERROR in the case of an error. 397 * \ingroup c_readwrite 356 398 */ 357 399 extern NXstatus NXclosedata(NXhandle handle); 400 358 401 /** 359 402 * Write data to a datset which has previouly been opened with NXopendata. … … 363 406 * \param data Pointer to data to write. 364 407 * \return NX_OK on success, NX_ERROR in the case of an error. 408 * \ingroup c_init 365 409 */ 366 410 extern NXstatus NXputdata(NXhandle handle, void* data); 411 367 412 /** 368 413 * Write an attribute. The kind of attribute written depends on the … … 376 421 * \param iType The NeXus data type of the attribute. 377 422 * \return NX_OK on success, NX_ERROR in the case of an error. 423 * \ingroup c_readwrite 378 424 */ 379 425 extern NXstatus NXputattr(NXhandle handle, CONSTCHAR* name, void* data, int iDataLen, int iType); 426 380 427 /** 381 428 * Write a subset of a multi dimensional dataset. … … 385 432 * \param size An array holding the size of the data subset to write in each dimension. 386 433 * \return NX_OK on success, NX_ERROR in the case of an error. 434 * \ingroup c_readwrite 387 435 */ 388 436 extern NXstatus NXputslab(NXhandle handle, void* data, int start[], int size[]); 437 389 438 /** 390 439 * Retrieve link data for a dataset. This link data can later on be used to link this … … 394 443 * for linking. 395 444 * \return NX_OK on success, NX_ERROR in the case of an error. 445 * \ingroup c_readwrite 396 446 */ 397 447 extern NXstatus NXgetdataID(NXhandle handle, NXlink* pLink); 448 398 449 /** 399 450 * Create a link to the group or dataset described by pLink in the currently open … … 403 454 * by either a call to NXgetdataID or NXgetgroupID. 404 455 * \return NX_OK on success, NX_ERROR in the case of an error. 456 * \ingroup c_readwrite 405 457 */ 406 458 extern NXstatus NXmakelink(NXhandle handle, NXlink* pLink); 459 407 460 /** 408 461 * Create a link to the group or dataset described by pLink in the currently open … … 413 466 * by either a call to NXgetdataID or NXgetgroupID. 414 467 * \return NX_OK on success, NX_ERROR in the case of an error. 468 * \ingroup c_linking 415 469 */ 416 470 extern NXstatus NXmakenamedlink(NXhandle handle, CONSTCHAR* newname, NXlink* pLink); 471 417 472 /** 418 473 * Open the source group of a linked group or dataset. Returns an error when the item is … … 420 475 * \param handle A NeXus file handle as initialized by NXopen. 421 476 * \return NX_OK on success, NX_ERROR in the case of an error. 477 * \ingroup c_linking 422 478 */ 423 479 extern NXstatus NXopensourcegroup(NXhandle handle); 480 424 481 /** 425 482 * Read a complete dataset from the currently open dataset into memory. … … 429 486 * and unwelcome ways. 430 487 * \return NX_OK on success, NX_ERROR in the case of an error. 488 * \ingroup c_readwrite 431 489 */ 432 490 extern NXstatus NXgetdata(NXhandle handle, void* data); 491 433 492 /** 434 493 * Retrieve information about the curretly open dataset. … … 440 499 * \param datatype A pointer to an integer which be set to the NeXus data type code for this dataset. 441 500 * \return NX_OK on success, NX_ERROR in the case of an error. 501 * \ingroup c_metadata 442 502 */ 443 503 extern NXstatus NXgetinfo(NXhandle handle, int* rank, int dimension[], int* datatype); 504 444 505 /** 445 506 * Get the next entry in the currently open group. This is for retrieving infromation about the … … 451 512 * \param datatype The NeXus data type if the item is a SDS. 452 513 * \return NX_OK on success, NX_ERROR in the case of an error, NX_EOD when there are no more items. 514 * \ingroup c_readwrite 453 515 */ 454 516 extern NXstatus NXgetnextentry(NXhandle handle, NXname name, NXname nxclass, int* datatype); 517 455 518 /** 456 519 * Read a subset of data from file into memory. … … 461 524 * \param size An array holding the size of the data subset to read for each dimension. 462 525 * \return NX_OK on success, NX_ERROR in the case of an error. 526 * \ingroup c_readwrite 463 527 */ 464 528 extern NXstatus NXgetslab(NXhandle handle, void* data, int start[], int size[]); 529 465 530 /** 466 531 * Iterate over global, group or dataset attributes depending on the currently open group or … … 472 537 * \param iType A pointer to an integer which be set to the NeXus data type of the attribute. 473 538 * \return NX_OK on success, NX_ERROR in the case of an error, NX_EOD when there are no more items. 539 * \ingroup c_readwrite 474 540 */ 475 541 extern NXstatus NXgetnextattr(NXhandle handle, NXname pName, int *iLength, int *iType); 542 476 543 /** 477 544 * Read an attribute. … … 482 549 * \param iType A pointer to an integer which will had been set to the NeXus data type of the attribute. 483 550 * \return NX_OK on success, NX_ERROR in the case of an error. 551 * \ingroup c_readwrite 484 552 */ 485 553 extern NXstatus NXgetattr(NXhandle handle, char* name, void* data, int* iDataLen, int* iType); 554 486 555 /** 487 556 * Get the count of attributes in the currently open dataset, group or global attributes when at root level. … … 489 558 * \param no_items A pointer to an integer which be set to the number of attributes available. 490 559 * \return NX_OK on success, NX_ERROR in the case of an error. 560 * \ingroup c_readwrite 491 561 */ 492 562 extern NXstatus NXgetattrinfo(NXhandle handle, int* no_items); 563 493 564 /** 494 565 * Retrieve link data for the currently open group. This link data can later on be used to link this … … 498 569 * for linking. 499 570 * \return NX_OK on success, NX_ERROR in the case of an error. 571 * \ingroup c_readwrite 500 572 */ 501 573 extern NXstatus NXgetgroupID(NXhandle handle, NXlink* pLink); 574 502 575 /** 503 576 * Retrieve information about the currently open group. … … 509 582 * \param nxclass The NeXus class name of the group. 510 583 * \return NX_OK on success, NX_ERROR in the case of an error. 584 * \ingroup c_readwrite 511 585 */ 512 586 extern NXstatus NXgetgroupinfo(NXhandle handle, int* no_items, NXname name, NXname nxclass); 587 513 588 /** 514 589 * Tests if two link data structures describe the same item. … … 517 592 * \param pSecondID The second link data structure. 518 593 * \return NX_OK when both link data structures describe the same item, NX_ERROR else. 594 * \ingroup c_readwrite 519 595 */ 520 596 extern NXstatus NXsameID(NXhandle handle, NXlink* pFirstID, NXlink* pSecondID); … … 524 600 * \param handle A NeXus file handle as initialized by NXopen. 525 601 * \return NX_OK on success, NX_ERROR in the case of an error. 602 * \ingroup c_readwrite 526 603 */ 527 604 extern NXstatus NXinitgroupdir(NXhandle handle); 605 528 606 /** 529 607 * Resets a pending attribute search to the start again. To be called in a Nxgetnextattr loop when … … 531 609 * \param handle A NeXus file handle as initialized by NXopen. 532 610 * \return NX_OK on success, NX_ERROR in the case of an error. 611 * \ingroup c_readwrite 533 612 */ 534 613 extern NXstatus NXinitattrdir(NXhandle handle); 614 535 615 /** 536 616 * Sets the format for number printing. This call has only an effect when using the XML physical file … … 540 620 * \param format The C-language format string to use for this data type. 541 621 * \return NX_OK on success, NX_ERROR in the case of an error. 622 * \ingroup c_readwrite 542 623 */ 543 624 extern NXstatus NXsetnumberformat(NXhandle handle, int type, char *format); 625 544 626 /** 545 627 * Inquire the filename of the currently open file. FilenameBufferLength of the file name … … 549 631 * \param filenameBufferLength The length of the filename buffer. 550 632 * \return NX_OK on success, NX_ERROR in the case of an error. 633 * \ingroup c_readwrite 551 634 */ 552 635 extern NXstatus NXinquirefile(NXhandle handle, char *filename, int filenameBufferLength); 636 553 637 /** 554 638 * Test if a group is actually pointing to an external file. If so, retrieve the URL of the … … 560 644 * \param urlLen The length of the Url buffer. At maximum urlLen bytes will be copied to url. 561 645 * \return NX_OK when the group is pointing to an external file, NX_ERROR else. 646 * \ingroup c_readwrite 562 647 */ 563 648 extern NXstatus NXisexternalgroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *nxclass, char *url, int urlLen); 649 564 650 /** 565 651 * Create a link to an external file. This works by creating a NeXus group under the current level in … … 572 658 * path to the group in the external file which appears in the first file. 573 659 * \return NX_OK on success, NX_ERROR in the case of an error. 660 * \ingroup c_readwrite 574 661 */ 575 662 extern NXstatus NXlinkexternal(NXhandle handle, CONSTCHAR *name, CONSTCHAR *nxclass, CONSTCHAR *url); 663 576 664 /** 577 665 * Utility function which allocates a suitably sized memory area for the dataset characteristics specified. … … 581 669 * \param datatype The NeXus data type of the data. 582 670 * \return NX_OK when allocation succeeds, NX_ERROR in the case of an error. 671 * \ingroup c_memory 583 672 */ 584 673 extern NXstatus NXmalloc(void** data, int rank, int dimensions[], int datatype); 674 585 675 /** 586 676 * Utility function to release the memory for data. 587 677 * \param data A pointer to a pointer to free. 588 678 * \return NX_OK on success, NX_ERROR in the case of an error. 679 * \ingroup c_memory 589 680 */ 590 681 extern NXstatus NXfree(void** data); … … 594 685 NAPI internals 595 686 ------------------------------------------------------------------------*/ 687 /** 688 * Retrieve information about the currently open dataset. In contrast to the main function below, 689 * this function does not try to find out about the size of strings properly. 690 * \param handle A NeXus file handle as initialized by NXopen. 691 * \param rank A pointer to an integer which will be filled with the rank of 692 * the dataset. 693 * \param dimension An array which will be initialized with the size of the dataset in any of its 694 * dimensions. The array must have at least the size of rank. 695 * \param datatype A pointer to an integer which be set to the NeXus data type code for this dataset. 696 * \return NX_OK on success, NX_ERROR in the case of an error. 697 * \ingroup c_metadata 698 */ 699 extern NXstatus NXgetrawinfo(NXhandle handle, int* rank, int dimension[], int* datatype); 700 596 701 /** \typedef void (*ErrFunc)(void *data, char *text) 597 702 * All NeXus error reporting happens through this special function, the … … 603 708 */ 604 709 typedef void (*ErrFunc)(void *data, char *text); 710 605 711 /** 606 712 * Set an error function. … … 610 716 */ 611 717 extern void NXMSetError(void *pData, ErrFunc newErr); 718 612 719 /** 613 720 * Retrieve the current error display function … … 615 722 */ 616 723 extern ErrFunc NXMGetError(); 724 617 725 /** 618 726 * Suppress error reports from the NeXus-API 619 727 */ 620 728 extern void NXMDisableErrorReporting(); 729 621 730 /** 622 731 * Enable error reports from the NeXus-API
Note: See TracChangeset
for help on using the changeset viewer.
