home *** CD-ROM | disk | FTP | other *** search
- /* c4dtok.c Conversion Routines
- (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.
- */
-
- #include <string.h>
- #include "d4all.h"
- #include "p4misc.h"
-
- /* Conversion from Double to format suitable for Index File Search
-
- Parameters:
-
- index_ref - A reference to the Index File
- doub_val - The key to search for.
- key_val - A pointer to a character buffer to store the converted
- result. The buffer length should be greater than the
- index file key length. (32 characters should do it !) .
- */
-
- #ifdef CLIPPER
- extern INDEX *v4index ;
- #endif
-
- /* Not used for dBASE */
- c4dtok( int index_ref, double doub_val, char *key_val )
- {
- #ifdef CLIPPER
- INDEX *index_ptr ;
- char *ptr ;
- index_ptr = v4index + index_ref ;
- if ( index_ptr->key_len > 31 ) return -1 ;
- ptr = c4dtoa( doub_val, index_ptr->key_len, index_ptr->key_dec ) ;
- memcpy( key_val, ptr, (size_t) index_ptr->key_len ) ;
- c4clip( key_val, index_ptr->key_len ) ;
- #endif
- return 0 ;
- }
-
-
-