Mercurial > emacs
comparison src/xfns.c @ 3173:c3c1b1ceab05
(x_get_resource_string): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 27 May 1993 05:53:05 +0000 |
parents | 647229114f47 |
children | 1055aa1b7547 |
comparison
equal
deleted
inserted
replaced
3172:2a484b449183 | 3173:c3c1b1ceab05 |
---|---|
1147 | 1147 |
1148 if (value != (char *) 0) | 1148 if (value != (char *) 0) |
1149 return build_string (value); | 1149 return build_string (value); |
1150 else | 1150 else |
1151 return Qnil; | 1151 return Qnil; |
1152 } | |
1153 | |
1154 /* Used when C code wants a resource value. */ | |
1155 | |
1156 char * | |
1157 x_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); | |
1152 } | 1177 } |
1153 | 1178 |
1154 #else /* X10 */ | 1179 #else /* X10 */ |
1155 | 1180 |
1156 DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0, | 1181 DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0, |