isindexinfo(S) 6 January 1993 isindexinfo(S) Name isindexinfo - obtain information about an ISAM file Syntax cc . . . -lisam isindexinfo (isfd, buffer, number) int isfd; struct { keydesc | dictinfo } *buffer; int number; Description The information returned by the isindexinfo call can be either dictionary information or index information, depending on the number parameter. You can use the following arguments with this routine: _________________________________________________________________________ Argument Description _________________________________________________________________________ isfd File descriptor identifying the ISAM file for which information is to be obtained. buffer Name of the buffer with structure key- desc or dictinfo into which the informa- tion is placed. keydesc Structure defined in isam.h to hold index information. Use only if number is nonzero. dictinfo Structure defined in isam.h to hold file dictionary information. Use only if number is zero. number Non-negative integer determining what information is obtained. If zero, then the file's dictionary information is put into the buffer. Otherwise, information about the index with that number is put into the buffer. Dictionary information about a file includes the number of indexes defined, the record size, the primary index size, and the number of records in the file. Dictionary information is placed in the buffer by the call when the number parameter is set to zero. The buffer should use the dictinfo structure defined in isam.h as: struct dictinfo { short di_nkeys ; /* number of keys defined */ short di_recsize ; /* data record size */ short di_idxsize ; /* index key size */ long di_nrecords ; /* number of records in file */ }; Index information includes flags (duplicates, compression), number of parts in the key, and the length, type, and location of each key part. Index information is placed in the buffer by the call when the number parameter is set to the number of the index. The buffer should use the keydesc structure defined in isam.h as: struct keypart { short kp_start ; /* starting byte of key part */ short kp_leng ; /* length in bytes */ short kp_type ; /* type of key part */ }; struct keydesc { short k_flags ; /* flags */ short k_nparts ; /* number of parts in key */ struct keypart k_part[NPARTS] ; /* each key part */ }; The number of an index can change when indexes are added or deleted. Use the information in dictinfo about the number of indexes to check all indexes. On success, isindexinfo returns 0. Otherwise, it returns -1 and sets iserrno to indicate the error. Example This example obtains information about the ISAM file: struct dictinfo dictbuffer isindexinfo(bookfd, dictbuffer, 0) ; This example obtains information about the second index: struct keydesc keybuffer isindexinfo(bookfd, keybuffer, 2) ; See also isaddindex(S), isbuild(S) Standards conformance isindexinfo is not part of any currently supported standard; it is an extension of AT&T System V provided by the Santa Cruz Operation.