# HG changeset patch # User Richard M. Stallman # Date 738481985 0 # Node ID c3c1b1ceab05501af2c8fe80fe3524324a898948 # Parent 2a484b449183e05f263290009bc82c0b48e3a987 (x_get_resource_string): New function. diff -r 2a484b449183 -r c3c1b1ceab05 src/xfns.c --- a/src/xfns.c Thu May 27 05:38:12 1993 +0000 +++ b/src/xfns.c Thu May 27 05:53:05 1993 +0000 @@ -1151,6 +1151,31 @@ return Qnil; } +/* Used when C code wants a resource value. */ + +char * +x_get_resource_string (attribute, class) + char *attribute, *class; +{ + register char *value; + char *name_key; + char *class_key; + + /* Allocate space for the components, the dots which separate them, + and the final '\0'. */ + name_key = (char *) alloca (XSTRING (Vinvocation_name)->size + + strlen (attribute) + 2); + class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + + strlen (class) + 2); + + sprintf (name_key, "%s.%s", + XSTRING (Vinvocation_name)->data, + attribute); + sprintf (class_key, "%s.%s", EMACS_CLASS, class); + + return x_get_string_resource (xrdb, name_key, class_key); +} + #else /* X10 */ DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0,