Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 16262) +++ trunk/config.h.in (revision 16263) @@ -187,7 +187,11 @@ #define PCB_VERSION "@/local/version@" #define PCB_REVISION "@/local/revision@" +/* Format: abccrrrrr where a, b and c are pcb-rnd version numbers and r is + the svn revision number (optional) */ +#define PCB_API_VER "@/local/apiver@" + /* Define to 1 if you have the `dmalloc' library (-ldmalloc); (memory debugging without valgrind) */ @] Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 16262) +++ trunk/scconfig/Rev.h (revision 16263) @@ -1 +1 @@ -static const int myrev = 16233; +static const int myrev = 16263; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 16262) +++ trunk/scconfig/Rev.tab (revision 16263) @@ -1,3 +1,4 @@ +16263 configure introducing pcb api ver 16233 configure retire hid_srv_ws: we are not going to use websockets for the web variant 16155 configure rewrite route style anchored menu to be central 16109 configure split off grid code from crosshair code and move gui-specific part out from core Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 16262) +++ trunk/scconfig/hooks.c (revision 16263) @@ -839,18 +839,31 @@ /* Runs after detection hooks, should generate the output (Makefiles, etc.) */ int hook_generate() { - char *rev = "non-svn", *tmp; + char *next, *rev = "non-svn", *curr, *tmp; int generr = 0; int res = 0; + char apiver[32]; + long r = 0; + int v1, v2, v3; tmp = svn_info(0, "../src", "Revision:"); if (tmp != NULL) { + r = strtol(tmp, NULL, 10); rev = str_concat("", "svn r", tmp, NULL); free(tmp); } + strcpy(apiver, version); + curr = apiver; next = strchr(curr, '.'); *next = '\n'; + v1 = atoi(curr); + curr = next+1; next = strchr(curr, '.'); *next = '\n'; + v2 = atoi(curr); + v3 = atoi(next+1); + sprintf(apiver, "%01d%01d%02d%05d", v1, v2, v3, r); + logprintf(0, "scconfig generate version info: version='%s' rev='%s'\n", version, rev); put("/local/revision", rev); put("/local/version", version); + put("/local/apiver", apiver); put("/local/pup/sccbox", "../../scconfig/sccbox"); printf("Generating Makefile.conf (%d)\n", generr |= tmpasm("..", "Makefile.conf.in", "Makefile.conf")); Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 16262) +++ trunk/src/hid.h (revision 16263) @@ -12,6 +12,11 @@ #include "layer.h" #include "layer_grp.h" +/* core's version stored in hid_actions.o */ +extern unsigned long pcb_api_ver; + +#define PCB_API_VER_MATCH (PCB_API_VER == pcb_hid_ver) + /* attribute dialog properties */ typedef enum pcb_hat_property_e { PCB_HATP_GLOBAL_CALLBACK, Index: trunk/src/hid_actions.c =================================================================== --- trunk/src/hid_actions.c (revision 16262) +++ trunk/src/hid_actions.c (revision 16263) @@ -12,6 +12,8 @@ #include "compat_misc.h" #include "compat_nls.h" +unsigned long pcb_api_ver = PCB_API_VER; + static htsp_t *all_actions = NULL; const pcb_hid_action_t *pcb_current_action = NULL;