Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 16829) +++ trunk/src/main.c (revision 16830) @@ -291,6 +291,7 @@ NULL, "-dump-actions", "DumpActions()", "Print all available actions (script readable) and exit", NULL, NULL, "-dump-plugins", "DumpPlugins()", "Print all available plugins (script readable) and exit", NULL, NULL, "-dump-plugindirs", "DumpPluginDirs()", "Print directories plugins might be loaded from and exit", NULL, + NULL, "-dump-oflags", "DumpObjFlags()", "Print object flags and exit", NULL, NULL, "-show-paths", "PrintPaths()", "Print all configured paths and exit", NULL, NULL, "-dump-config", "dumpconf(native,1)", "Print the config tree and exit", "Config dump not available - make sure you have configured pcb-rnd with --buildin-diag", "V", "-version", "PrintVersion()", "Print version info and exit", NULL, Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 16829) +++ trunk/src/main_act.c (revision 16830) @@ -47,6 +47,8 @@ #include "plugins.h" #include "build_run.h" #include "safe_fs.h" +#include "flag_str.h" +#include "obj_common.h" /* --------------------------------------------------------------------------- */ @@ -320,6 +322,28 @@ return 0; } +static const char pcb_acts_DumpObjFlags[] = "DumpObjFlags()"; +static const char pcb_acth_DumpObjFlags[] = "Print a script processable digest of all flags, per object type"; +static void dumpoflg(void *ctx, unsigned long flg, const char *name) +{ + printf(" %lx %s\n", flg, name); +} + +int pcb_act_DumpObjFlags(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) +{ + unsigned long ot, max = (1l<<31); + + for(ot = 1; ot < max; ot <<= 1) { + const char *name = pcb_obj_type_name(ot); + + if (*name == '<') + continue; + printf("%s\n", name); + pcb_strflg_map(0x7fffffff, ot, NULL, dumpoflg); + } + return 0; +} + static const char pcb_acts_System[] = "System(shell_cmd)"; static const char pcb_acth_System[] = "Run shell command"; int pcb_act_System(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) @@ -366,6 +390,9 @@ {"DumpPluginDirs", 0, pcb_act_DumpPluginDirs, pcb_acth_DumpPluginDirs, pcb_acts_DumpPluginDirs} , + {"DumpObjFlags", 0, pcb_act_DumpObjFlags, + pcb_acth_DumpObjFlags, pcb_acts_DumpObjFlags} + , {"System", 0, pcb_act_System, pcb_acth_System, pcb_acts_System} };