aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-27 05:53:05 +0000
committerRichard M. Stallman1993-05-27 05:53:05 +0000
commit3402e1a480f8276aadd6ff136f5547f3d39e8414 (patch)
tree631e9aadfa1b05e15c002916a6cdc57d9c2448a2 /src
parent5d20eba6587bafb6c2020abc7c87e774a0218079 (diff)
downloademacs-3402e1a480f8276aadd6ff136f5547f3d39e8414.tar.gz
emacs-3402e1a480f8276aadd6ff136f5547f3d39e8414.zip
(x_get_resource_string): New function.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 7f8f659bd21..4614b97ba1d 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1151,6 +1151,31 @@ and the class is `Emacs.CLASS.SUBCLASS'.")
1151 return Qnil; 1151 return Qnil;
1152} 1152}
1153 1153
1154/* Used when C code wants a resource value. */
1155
1156char *
1157x_get_resource_string (attribute, class)
1158 char *attribute, *class;
1159{
1160 register char *value;
1161 char *name_key;
1162 char *class_key;
1163
1164 /* Allocate space for the components, the dots which separate them,
1165 and the final '\0'. */
1166 name_key = (char *) alloca (XSTRING (Vinvocation_name)->size
1167 + strlen (attribute) + 2);
1168 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
1169 + strlen (class) + 2);
1170
1171 sprintf (name_key, "%s.%s",
1172 XSTRING (Vinvocation_name)->data,
1173 attribute);
1174 sprintf (class_key, "%s.%s", EMACS_CLASS, class);
1175
1176 return x_get_string_resource (xrdb, name_key, class_key);
1177}
1178
1154#else /* X10 */ 1179#else /* X10 */
1155 1180
1156DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0, 1181DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0,