static __inline__ LogDomainEntry * lookup_domain( const char *name, bool sub ) { LogDomainEntry *entry; direct_list_foreach (entry, domains) { if (! direct_strcasecmp( entry->name, name )) return entry; } /* * If the domain being registered contains a slash, but didn't exactly match an entry * in directfbrc, check to see if the domain is descended from an entry in directfbrc * (e.g. 'ui/field/messages' matches 'ui' or 'ui/field') */ if (sub && strchr(name, '/')) { int passed_name_len = strlen( name ); direct_list_foreach (entry, domains) { int entry_len = strlen( entry->name ); if ((passed_name_len > entry_len) && (name[entry_len] == '/') && (! direct_strncasecmp( entry->name, name, entry_len))) { return entry; } }
static DFBBoolean parse_option( const char *arg, DFBWindowOptions *_o ) { int i = 0; while (options_names[i].option != DWOP_NONE) { if (!direct_strncasecmp( arg, options_names[i].name, strlen(arg) )) { *_o |= options_names[i].option; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid options specified!\n\n" ); return DFB_FALSE; }
static DFBBoolean parse_caps( const char *arg, DFBWindowCapabilities *_c ) { int i = 0; while (caps_names[i].capability != DWCAPS_NONE) { if (!direct_strncasecmp( arg, caps_names[i].name, strlen(arg) )) { *_c |= caps_names[i].capability; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid caps specified!\n\n" ); return DFB_FALSE; }
static DFBBoolean parse_test( const char *arg, bool sub ) { int i; for (i=0; i<D_ARRAY_SIZE(m_tests); i++) { if (!direct_strncasecmp( arg, m_tests[i].name, strlen(arg) )) { if (sub) m_tests[i].run_sub = true; else m_tests[i].run_top = true; return DFB_TRUE; } } fprintf (stderr, "\nInvalid test specified!\n\n" ); return DFB_FALSE; }