+ cmd_tbl_t *cp1 = *(cmd_tbl_t **) p1;
+ cmd_tbl_t *cp2 = *(cmd_tbl_t **) p2;
+ cmd_tbl_t *top1 = get_cmd_tbl_parent(*(cmd_tbl_t **) p1);
+ cmd_tbl_t *top2 = get_cmd_tbl_parent(*(cmd_tbl_t **) p2);
+ int res;
+
+ if (top1 && top2) {
+ res = strcmp_PP(top1->name, top2->name);
+ if (res == 0)
+ res = strcmp_PP(cp1->name, cp2->name);
+ return res;
+ }
+ if (top1) {
+ res = strcmp_PP(top1->name, cp2->name);
+ if (res == 0)
+ res = strcmp_PP(cp1->name, cp2->name);
+ return res;
+ }
+ if (top2) {
+ res = strcmp_PP(cp1->name, top2->name);
+ if (res == 0)
+ res = strcmp_PP(cp1->name, cp2->name);
+ return res;
+ }
+ return strcmp_PP(cp1->name, cp2->name);
+}
+#endif
+
+/****************************************************************************/
+
+/*
+ * find command table entry for a command
+ */