#include "config.h"
#endif /* HAVE_CONFIG_H */
-#include <netatalk/endian.h>
+#include <arpa/inet.h>
#include <string.h>
#include <inttypes.h>
#include <sys/param.h>
-#include <sys/cdefs.h>
#include <db.h>
#include <atalk/unicode.h>
-#include <atalk/volinfo.h>
#include <atalk/logger.h>
#include <atalk/cnid_dbd_private.h>
+#include <atalk/volume.h>
#include "pack.h"
-/* in main.c for `cnid_dbd` or cmd_dbd.c for `dbd` */
-extern struct volinfo volinfo;
+static const struct vol *volume;
/* --------------- */
/*
uint16_t flags = CONV_TOLOWER;
memset(skey, 0, sizeof(DBT));
- if (convert_charset(volinfo.v_volcharset,
- volinfo.v_volcharset,
- volinfo.v_maccharset,
+ if (convert_charset(volume->v_volcharset,
+ volume->v_volcharset,
+ volume->v_maccharset,
(char *)pdata->data + CNID_NAME_OFS,
strlen((char *)pdata->data + CNID_NAME_OFS),
buffer,
return (0);
}
+void pack_setvol(const struct vol *vol)
+{
+ volume = vol;
+}
+
/* The equivalent to make_cnid_data in the cnid library. Non re-entrant. We
differ from make_cnid_data in that we never return NULL, rqst->name cannot
ever cause start[] to overflow because name length is checked in libatalk. */