diff options
| author | Juanma Barranquero | 2003-03-06 13:00:04 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-03-06 13:00:04 +0000 |
| commit | c13a8a91d70ee03182bf0a4deb47a58749680606 (patch) | |
| tree | fe57ed5eb1c1ecf8e31592f1d8b88f8ec6dcdc83 /src | |
| parent | 7114765394405bc9f6a7af47691e9c8048c2665e (diff) | |
| download | emacs-c13a8a91d70ee03182bf0a4deb47a58749680606.tar.gz emacs-c13a8a91d70ee03182bf0a4deb47a58749680606.zip | |
(w32_make_rdb): New function.
(w32_term_init): Use it to initialize xrdb member of w32_display_info struct.
Delete leftover code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 70 |
1 files changed, 57 insertions, 13 deletions
diff --git a/src/w32term.c b/src/w32term.c index 23929905334..c74eb90cdfc 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -11134,6 +11134,61 @@ w32_initialize_display_info (display_name) | |||
| 11134 | 11134 | ||
| 11135 | } | 11135 | } |
| 11136 | 11136 | ||
| 11137 | /* Create an xrdb-style database of resources to supercede registry settings. | ||
| 11138 | The database is just a concatenation of C strings, finished by an additional | ||
| 11139 | \0. The string are submitted to some basic normalization, so | ||
| 11140 | |||
| 11141 | [ *]option[ *]:[ *]value... | ||
| 11142 | |||
| 11143 | becomes | ||
| 11144 | |||
| 11145 | option:value... | ||
| 11146 | |||
| 11147 | but any whitespace following value is not removed. */ | ||
| 11148 | |||
| 11149 | static char * | ||
| 11150 | w32_make_rdb (xrm_option) | ||
| 11151 | char *xrm_option; | ||
| 11152 | { | ||
| 11153 | char *buffer = xmalloc (strlen (xrm_option) + 2); | ||
| 11154 | char *current = buffer; | ||
| 11155 | char ch; | ||
| 11156 | int in_option = 1; | ||
| 11157 | int before_value = 0; | ||
| 11158 | |||
| 11159 | do { | ||
| 11160 | ch = *xrm_option++; | ||
| 11161 | |||
| 11162 | if (ch == '\n') | ||
| 11163 | { | ||
| 11164 | *current++ = '\0'; | ||
| 11165 | in_option = 1; | ||
| 11166 | before_value = 0; | ||
| 11167 | } | ||
| 11168 | else if (ch != ' ') | ||
| 11169 | { | ||
| 11170 | *current++ = ch; | ||
| 11171 | if (in_option && (ch == ':')) | ||
| 11172 | { | ||
| 11173 | in_option = 0; | ||
| 11174 | before_value = 1; | ||
| 11175 | } | ||
| 11176 | else if (before_value) | ||
| 11177 | { | ||
| 11178 | before_value = 0; | ||
| 11179 | } | ||
| 11180 | } | ||
| 11181 | else if (!(in_option || before_value)) | ||
| 11182 | { | ||
| 11183 | *current++ = ch; | ||
| 11184 | } | ||
| 11185 | } while (ch); | ||
| 11186 | |||
| 11187 | *current = '\0'; | ||
| 11188 | |||
| 11189 | return buffer; | ||
| 11190 | } | ||
| 11191 | |||
| 11137 | struct w32_display_info * | 11192 | struct w32_display_info * |
| 11138 | w32_term_init (display_name, xrm_option, resource_name) | 11193 | w32_term_init (display_name, xrm_option, resource_name) |
| 11139 | Lisp_Object display_name; | 11194 | Lisp_Object display_name; |
| @@ -11151,23 +11206,12 @@ w32_term_init (display_name, xrm_option, resource_name) | |||
| 11151 | w32_initialized = 1; | 11206 | w32_initialized = 1; |
| 11152 | } | 11207 | } |
| 11153 | 11208 | ||
| 11154 | { | ||
| 11155 | int argc = 0; | ||
| 11156 | char *argv[3]; | ||
| 11157 | |||
| 11158 | argv[0] = ""; | ||
| 11159 | argc = 1; | ||
| 11160 | if (xrm_option) | ||
| 11161 | { | ||
| 11162 | argv[argc++] = "-xrm"; | ||
| 11163 | argv[argc++] = xrm_option; | ||
| 11164 | } | ||
| 11165 | } | ||
| 11166 | |||
| 11167 | w32_initialize_display_info (display_name); | 11209 | w32_initialize_display_info (display_name); |
| 11168 | 11210 | ||
| 11169 | dpyinfo = &one_w32_display_info; | 11211 | dpyinfo = &one_w32_display_info; |
| 11170 | 11212 | ||
| 11213 | dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL; | ||
| 11214 | |||
| 11171 | /* Put this display on the chain. */ | 11215 | /* Put this display on the chain. */ |
| 11172 | dpyinfo->next = x_display_list; | 11216 | dpyinfo->next = x_display_list; |
| 11173 | x_display_list = dpyinfo; | 11217 | x_display_list = dpyinfo; |