#define SCHEMA_ID "org.gnu.emacs.defaults"
#define PATH_FOR_CLASS_TYPE "/org/gnu/emacs/defaults-by-class/"
#define PATH_PREFIX_FOR_NAME_TYPE "/org/gnu/emacs/defaults-by-name/"
+#define PATH_MAX_LEN \
+ (sizeof PATH_FOR_CLASS_TYPE > sizeof PATH_PREFIX_FOR_NAME_TYPE ? \
+ sizeof PATH_FOR_CLASS_TYPE : sizeof PATH_PREFIX_FOR_NAME_TYPE)
static inline int
pgtk_is_lower_char (int c)
static GSettings *
parse_resource_key (const char *res_key, char *setting_key)
{
- char path[32 + RESOURCE_KEY_MAX_LEN];
+ char path[PATH_MAX_LEN + RESOURCE_KEY_MAX_LEN];
const char *sp = res_key;
char *dp;
/* generate path */
if (pgtk_is_upper_char (*sp))
{
- /* First letter is upper case. It should be "Emacs",
+ /* First letter is upper case. It should be "Emacs",
* but don't care.
*/
strcpy (path, PATH_FOR_CLASS_TYPE);
#undef SCHEMA_ID
#undef PATH_FOR_CLASS_TYPE
#undef PATH_PREFIX_FOR_NAME_TYPE
+#undef PATH_MAX_LEN
#else /* not HAVE_GSETTINGS */