/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
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
/* FH_REF_FILE only. */
char *file_name; /* File name as provided by user. */
enum fh_mode mode; /* File mode. */
- enum legacy_encoding encoding;/* File encoding. */
+ const char *encoding; /* File encoding. */
/* FH_REF_FILE and FH_REF_INLINE only. */
size_t record_width; /* Length of fixed-format records. */
}
/* Returns the encoding of characters read from HANDLE. */
-enum legacy_encoding
+const char *
fh_get_legacy_encoding (const struct file_handle *handle)
{
assert (handle->referent & (FH_REF_FILE | FH_REF_INLINE));
hash_fh_lock (const void *lock_, const void *aux UNUSED)
{
const struct fh_lock *lock = lock_;
- unsigned int hash = hsh_hash_int ((lock->referent << 3) | lock->access);
+ unsigned int basis;
if (lock->referent == FH_REF_FILE)
- hash ^= fn_hash_identity (lock->u.file);
+ basis = fn_hash_identity (lock->u.file);
else if (lock->referent == FH_REF_SCRATCH)
- hash ^= hsh_hash_int (lock->u.unique_id);
- return hash;
+ basis = lock->u.unique_id;
+ else
+ basis = 0;
+ return hash_int ((lock->referent << 3) | lock->access, basis);
}