+
+ /* Case 1: always use temp files (old way) */
+ /* Case 2: use temp files, if more than one (auto) */
+ /* = if this is both the last and the first */
+ /* Case 3: never bother with temp files (new) */
+ temp_policy=2;
+ /* FIXME - will come from config file into zh */
+
+ if ( ( temp_policy ==3 ) || /* always from memory */
+ ( ( temp_policy ==2 ) && /* automatic */
+ (zh->reg->key_file_no == 1) && /* this is first time */
+ (final) ) ) /* and last (=only) time */
+ { /* go directly from memory */
+ zh->reg->key_file_no =0; /* signal not to read files */
+ zebra_index_merge(zh);
+ zh->reg->ptr_i = 0;
+ zh->reg->key_buf_used = 0;
+ return; /*!*/
+ }
+
+ /* Not doing directly from memory, write into a temp file */