Commit 2862b43c 2862b43c4d578e7ba0ffd7d58df967e33183198c by Sergey Poznyakoff

(is_atom): New function.

1 parent 8a3fd3b7
...@@ -1279,7 +1279,8 @@ util_run_events (int old_state, int new_state) ...@@ -1279,7 +1279,8 @@ util_run_events (int old_state, int new_state)
1279 ev.new_state = new_state; 1279 ev.new_state = new_state;
1280 1280
1281 mu_list_get_iterator (event_list, &itr); 1281 mu_list_get_iterator (event_list, &itr);
1282 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr)) 1282 for (mu_iterator_first (itr);
1283 !mu_iterator_is_done (itr); mu_iterator_next (itr))
1283 { 1284 {
1284 struct state_event *p; 1285 struct state_event *p;
1285 mu_iterator_current (itr, (void **)&p); 1286 mu_iterator_current (itr, (void **)&p);
...@@ -1298,3 +1299,17 @@ util_chdir (const char *homedir) ...@@ -1298,3 +1299,17 @@ util_chdir (const char *homedir)
1298 mu_error ("Cannot change to home directory `%s': %s", 1299 mu_error ("Cannot change to home directory `%s': %s",
1299 homedir, mu_strerror (errno)); 1300 homedir, mu_strerror (errno));
1300 } 1301 }
1302
1303 int
1304 is_atom (const char *s)
1305 {
1306 if (strpbrk (s, "(){ \t%*\"\\"))
1307 return 0;
1308 for (; *s; s++)
1309 {
1310 if (*(const unsigned char *)s > 127 || iscntrl (*s))
1311 return 0;
1312 }
1313 return 1;
1314 }
1315
......