- * Checks wether 'name' is a valid API name.
- * @return 1 if valid, 0 otherwise
- */
-int afb_apiset_valid_name(const char *name)
-{
- unsigned char c;
-
- c = (unsigned char)*name;
- if (c == 0)
- /* empty names aren't valid */
- return 0;
-
- do {
- if (c < (unsigned char)'\x80') {
- switch(c) {
- default:
- if (c > ' ')
- break;
- case '"':
- case '#':
- case '%':
- case '&':
- case '\'':
- case '/':
- case '?':
- case '`':
- case '\\':
- case '\x7f':
- return 0;
- }
- }
- c = (unsigned char)*++name;
- } while(c != 0);
- return 1;
-}
-