const _char *Tag::findProperty (const _char *pName) { TagAttrList::iterator hx = m_attrList.begin (); while (hx != m_attrList.end ()) { if (_strcasecmp ((*hx).first, pName) == 0) { return (*hx).second; } hx++; } return 0; }
int cmd_irq(int argc, char **argv) { int num; if (argc != 2) { print_help(); return -1; } num = _strtoul(argv[1], NULL, 0); if (num >= __irq_max__) { printf("Only %d IRQs present\n", __irq_max__); return -1; } if (!_strcasecmp(argv[0], "sim")) { printf("Simulating IRQ %d\n", num); irq_stimulate(num); } else if (!_strcasecmp(argv[0], "enable")) { printf("Enabling IRQ %d\n", num); irq_enable(num); } else if (!_strcasecmp(argv[0], "disable")) { printf("Disabling IRQ %d\n", num); irq_disable(num); } else { printf("Unknown command\n"); print_help(); return -1; } return 0; }
const struct scriptic *scriptic_get(const char *name) { struct scriptic *script = NULL; int i; for (i = 0; i < sizeof(scripts) / sizeof(*scripts); i++) { if (!_strcasecmp(name, scripts[i]->name)) { script = scripts[i]; break; } } if (script && script->command_count == 0) script->command_count = sc_command_count(script); return script; }
int EntityStack::locateFromTop (const _char *s) { assert (s); int sz = size (); if (sz <= 0) { return -1; } for (int i = sz - 1; i >= 0; i--) { if (_strcasecmp (s, m_repository[i]) == 0) { return sz - i - 1; } } return -1; }
static int is_command(int argc, char **argv, const char *cmd) { return ((argc > 0) && !_strcasecmp(argv[0], cmd)); }