2 * uxstore.c: Unix-specific implementation of the interface defined
15 * For the moment, the only existing Unix utility is pterm and that
16 * has no GUI configuration at all, so our write routines need do
17 * nothing. Eventually I suppose these will read and write an rc
18 * file somewhere or other.
21 void *open_settings_w(char *sessionname
)
26 void write_setting_s(void *handle
, char *key
, char *value
)
30 void write_setting_i(void *handle
, char *key
, int value
)
34 void close_settings_w(void *handle
)
39 * Reading settings, for the moment, is done by retrieving X
40 * resources from the X display. When we introduce disk files, I
41 * think what will happen is that the X resources will override
42 * PuTTY's inbuilt defaults, but that the disk files will then
43 * override those. This isn't optimal, but it's the best I can
44 * immediately work out.
47 static Display
*display
;
49 void *open_settings_r(char *sessionname
)
51 static int thing_to_return_an_arbitrary_non_null_pointer_to
;
52 display
= GDK_DISPLAY();
56 return &thing_to_return_an_arbitrary_non_null_pointer_to
;
59 char *read_setting_s(void *handle
, char *key
, char *buffer
, int buflen
)
61 char *val
= XGetDefault(display
, app_name
, key
);
65 strncpy(buffer
, val
, buflen
);
66 buffer
[buflen
-1] = '\0';
71 int read_setting_i(void *handle
, char *key
, int defvalue
)
73 char *val
= XGetDefault(display
, app_name
, key
);
80 void close_settings_r(void *handle
)
84 void del_settings(char *sessionname
)
88 void *enum_settings_start(void)
93 char *enum_settings_next(void *handle
, char *buffer
, int buflen
)
98 void enum_settings_finish(void *handle
)
102 int verify_host_key(char *hostname
, int port
, char *keytype
, char *key
)
104 return 1; /* key does not exist in registry */
107 void store_host_key(char *hostname
, int port
, char *keytype
, char *key
)
111 void read_random_seed(noise_consumer_t consumer
)
115 void write_random_seed(void *data
, int len
)
119 void cleanup_all(void)