/*
- * $Id: file.c,v 1.120 2009-11-02 14:35:27 didg Exp $
+ * $Id: file.c,v 1.121 2009-11-08 23:17:39 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
if (aint > 255) /* FIXME safeguard, anyway if no ascii char it's game over*/
aint = 255;
- utf8 = vol->v_mac?htonl(vol->v_mac->kTextEncoding):0; /* htonl(utf8) */
+ utf8 = vol->v_kTextEncoding;
memcpy(data, &utf8, sizeof(utf8));
data += sizeof(utf8);
/*
- * $Id: volume.c,v 1.99 2009-11-06 04:28:25 didg Exp $
+ * $Id: volume.c,v 1.100 2009-11-08 23:17:40 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
char *vol_uname;
char *vol_mname;
char *volname_tmp;
-
+ struct charset_functions *charset;
+
ibuf += 2;
memcpy(&bitmap, ibuf, sizeof( bitmap ));
bitmap = ntohs( bitmap );
goto openvol_err;
}
- if ( NULL == ( volume->v_vol = find_charset_functions(volume->v_volcodepage)) || volume->v_vol->flags & CHARSET_ICONV ) {
+ if ( NULL == (charset = find_charset_functions(volume->v_volcodepage)) || charset->flags & CHARSET_ICONV ) {
LOG (log_warning, logtype_afpd, "WARNING: volume encoding %s is *not* supported by netatalk, expect problems !!!!", volume->v_volcodepage);
}
goto openvol_err;
}
- if ( NULL == ( volume->v_mac = find_charset_functions(volume->v_maccodepage)) || ! (volume->v_mac->flags & CHARSET_CLIENT) ) {
+ if ( NULL == ( charset = find_charset_functions(volume->v_maccodepage)) || ! (charset->flags & CHARSET_CLIENT) ) {
LOG (log_error, logtype_afpd, "Fatal error: mac charset %s not supported", volume->v_maccodepage);
ret = AFPERR_MISC;
goto openvol_err;
- }
+ }
+ volume->v_kTextEncoding = htonl(charset->kTextEncoding);
ret = stat_vol(bitmap, volume, rbuf, rbuflen);
if (ret == AFP_OK) {
/*
- * $Id: volume.h,v 1.3 2009-11-08 22:08:04 didg Exp $
+ * $Id: volume.h,v 1.4 2009-11-08 23:17:40 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
charset_t v_volcharset;
charset_t v_maccharset;
- struct charset_functions *v_mac;
+ long v_kTextEncoding; /* mac charset encoding in network order
+ * XXX should be a u_int32_t ?
+ */
int v_casefold;
size_t max_filename;
void *v_nfsclient;
int v_nfs;
- struct charset_functions *v_vol; /* set but not used */
-
/* only when opening/closing volumes or in error */
char *v_localname; /* as defined in AppleVolumes.default */
char *v_volcodepage;