Exit with error message if e16 is too old.

SVN revision: 43136
master
Kim Woelders 13 years ago
parent fbeb930643
commit af9c2f6b8b
  1. 34
      viewer.c

@ -22,6 +22,8 @@
#define DEBUG 0
#define VER(maj, min, mic) (10000 * (maj) + 100 * (min) + (mic))
extern GtkTooltips *tooltips;
extern GtkAccelGroup *accel_group;
@ -867,6 +869,36 @@ receive_ipc_msg(gchar * msg)
gtk_main_quit();
}
static void
check_e16_version(void)
{
char *msg;
const char *s;
int ver, major, minor, micro;
ver = major = minor = micro = 0;
CommsSend("ver");
msg = wait_for_ipc_msg();
if (!msg)
return 0;
s = msg;
while (*s && *s != '.')
s++;
s--;
sscanf(s, "%d.%d.%d", &major, &minor, &micro);
ver = VER(major, minor, micro);
free(msg);
if (ver < VER(1, 0, 1))
{
printf("Sorry, e16 version >= 1.0.1 is required.\n");
exit(1);
}
}
static void
load_actions(void)
{
@ -1006,6 +1038,8 @@ main(int argc, char *argv[])
"it remotely.");
#endif
check_e16_version();
load_actions();
lister = create_list_window();

Loading…
Cancel
Save