From ced56ce1dcec7b5cb264010fd272b4ca9d82208d Mon Sep 17 00:00:00 2001 From: didg Date: Sun, 8 Nov 2009 22:08:04 +0000 Subject: [PATCH] better layout for struct vol --- include/atalk/logger.h | 2 +- include/atalk/uam.h | 15 ++++---- include/atalk/util.h | 4 +-- include/atalk/volume.h | 77 ++++++++++++++++++++++++------------------ 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/include/atalk/logger.h b/include/atalk/logger.h index 0ad267bc..e2cbbbca 100644 --- a/include/atalk/logger.h +++ b/include/atalk/logger.h @@ -159,7 +159,7 @@ void set_processname(const char *processname); */ /* LOG macro func no.1: log the message to file */ -void make_log_entry(enum loglevels loglevel, enum logtypes logtype, const char *file, int line, char *message, ...); +__attribute__ ((visibility("default"))) void make_log_entry(enum loglevels loglevel, enum logtypes logtype, const char *file, int line, char *message, ...); /* Note: diff --git a/include/atalk/uam.h b/include/atalk/uam.h index f54a5d31..f32eb7f2 100644 --- a/include/atalk/uam.h +++ b/include/atalk/uam.h @@ -15,7 +15,7 @@ #endif /* TRU64 */ /* just a label for exported bits */ -#define UAM_MODULE_EXPORT +#define UAM_MODULE_EXPORT __attribute__ ((visibility("default"))) /* type of uam */ #define UAM_MODULE_SERVER 1 @@ -78,17 +78,18 @@ struct session_info { }; /* register and unregister uams with these functions */ -extern int uam_register (const int, const char *, const char *, ...); -extern void uam_unregister (const int, const char *); +extern UAM_MODULE_EXPORT int uam_register (const int, const char *, const char *, ...); +extern UAM_MODULE_EXPORT void uam_unregister (const int, const char *); /* helper functions */ -extern struct passwd *uam_getname (void*, char *, const int); -extern int uam_checkuser (const struct passwd *); +extern UAM_MODULE_EXPORT struct passwd *uam_getname (void*, char *, const int); +extern UAM_MODULE_EXPORT int uam_checkuser (const struct passwd *); /* afp helper functions */ -extern int uam_afp_read (void *, char *, size_t *, +extern UAM_MODULE_EXPORT int uam_afp_read (void *, char *, size_t *, int (*)(void *, void *, const int)); -extern int uam_afpserver_option (void *, const int, void *, size_t *); +extern UAM_MODULE_EXPORT int uam_afpserver_option (void *, const int, void *, size_t *); + #ifdef TRU64 extern void uam_afp_getcmdline (int *, char ***); extern int uam_sia_validate_user (sia_collect_func_t *, int, char **, diff --git a/include/atalk/util.h b/include/atalk/util.h index 670a7439..69a87556 100644 --- a/include/atalk/util.h +++ b/include/atalk/util.h @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.13 2009-11-05 14:38:08 franklahm Exp $ + * $Id: util.h,v 1.14 2009-11-08 22:08:04 didg Exp $ */ #ifndef _ATALK_UTIL_H @@ -42,7 +42,7 @@ extern void fault_setup (void (*fn)(void *)); #define server_unlock(x) (unlink(x)) #ifndef HAVE_STRLCPY -size_t strlcpy (char *, const char *, size_t); +__attribute__ ((visibility("default"))) size_t strlcpy (char *, const char *, size_t); #endif #ifndef HAVE_STRLCAT diff --git a/include/atalk/volume.h b/include/atalk/volume.h index c265829f..254e5053 100644 --- a/include/atalk/volume.h +++ b/include/atalk/volume.h @@ -1,5 +1,5 @@ /* - * $Id: volume.h,v 1.2 2009-10-29 13:06:19 franklahm Exp $ + * $Id: volume.h,v 1.3 2009-11-08 22:08:04 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -22,35 +22,28 @@ struct vol { struct vol *v_next; - char *v_localname; /* as defined in AppleVolumes.default */ - ucs2_t *v_u8mname; /* converted to utf8-mac in ucs2 */ - ucs2_t *v_macname; /* mangled to legacy longname in ucs2 */ - ucs2_t *v_name; /* either v_u8mname or v_macname */ + u_int16_t v_vid; + int v_flags; + char *v_path; struct dir *v_dir, *v_root; hash_t *v_hash; - int v_flags; -#ifdef __svr4__ - int v_qfd; -#endif /*__svr4__*/ - char *v_gvs; time_t v_mtime; - time_t v_ctime; /* volume creation date, not unix ctime */ - u_int16_t v_vid; - void *v_nfsclient; - int v_nfs; - + charset_t v_volcharset; + charset_t v_maccharset; + struct charset_functions *v_mac; + int v_casefold; size_t max_filename; - char *v_password; char *v_veto; - char *v_cnidscheme; - char *v_dbpath; - dev_t v_dev; /* Unix volume device */ + int v_adouble; /* default adouble format */ + int v_ad_options; /* adouble option NODEV, NOCACHE, etc.. */ + char *(*ad_path)(const char *, int); + struct _cnid_db *v_cdb; char v_stamp[ADEDLEN_PRIVSYN]; mode_t v_umask; @@ -63,19 +56,42 @@ struct vol { char *v_forcegid; #endif + /* adouble indirection */ + struct vfs_ops *vfs; /* pointer to vfs_master_funcs for chaining */ + const struct vfs_ops *vfs_modules[4]; + int v_vfs_ea; /* The AFPVOL_EA_xx flag */ + + ucs2_t *v_u8mname; /* converted to utf8-mac in ucs2 */ + ucs2_t *v_macname; /* mangled to legacy longname in ucs2 */ + ucs2_t *v_name; /* either v_u8mname or v_macname */ + + /* get/set volparams */ + time_t v_ctime; /* volume creation date, not unix ctime */ + + dev_t v_dev; /* Unix volume device, Set but not used */ + +#ifdef __svr4__ + int v_qfd; +#endif /*__svr4__*/ + char *v_gvs; + 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; - charset_t v_volcharset; - struct charset_functions *v_vol; - char *v_maccodepage; - charset_t v_maccharset; - struct charset_functions *v_mac; + char *v_maccodepage; + + char *v_password; + + char *v_cnidscheme; + char *v_dbpath; - int v_deleted; /* volume open but deleted in new config file */ int v_hide; /* new volume wait until old volume is closed */ int v_new; /* volume deleted but there's a new one with the same name */ - int v_adouble; /* default adouble format */ - int v_ad_options; /* adouble option NODEV, NOCACHE, etc.. */ - + int v_deleted; /* volume open but deleted in new config file */ char *v_root_preexec; char *v_preexec; @@ -85,11 +101,6 @@ struct vol { int v_root_preexec_close; int v_preexec_close; - /* adouble indirection */ - struct vfs_ops *vfs; /* pointer to vfs_master_funcs for chaining */ - const struct vfs_ops *vfs_modules[4]; - int v_vfs_ea; /* The AFPVOL_EA_xx flag */ - char *(*ad_path)(const char *, int); }; #ifdef NO_LARGE_VOL_SUPPORT -- 2.39.2