FreeBSD/contrib/subversion/subversion/svnfsfs/load-index-cmd.c
/* Reverse lookup in ITEM_TYPE_STR: Set *TYPE to the index that contains STR.
 * Return an error for invalid strings. */
Reverse lookup in ITEM_TYPE_STR: Set *TYPE to the index that contains STR.
Return an error for invalid strings.
Reverse lookup in ITEM_TYPE_STR : Set * TYPE to the index that contains STR . Return an error for invalid strings .
static svn_error_t *
str_to_item_type(unsigned *type,
                 const char *str)
{
  unsigned i;
  for (i = 0; i < sizeof(item_type_str) / sizeof(item_type_str[0]); ++i)
    if (strcmp(item_type_str[i], str) == 0)
      {
        *type = i;
        return SVN_NO_ERROR;
      }
  return svn_error_createf(SVN_ERR_BAD_TOKEN, NULL,
                           _("Unknown item type '%s'"), str);
}
static svn_error_t * str_to_item_type ( unsigned * type , const char * str ) { unsigned i ; for ( i = 0 ; i < sizeof ( item_type_str ) / sizeof ( item_type_str [ 0 ] ) ; ++ i ) if ( strcmp ( item_type_str [ i ] , str ) == 0 ) { * type = i ; return SVN_NO_ERROR ; } return svn_error_createf ( SVN_ERR_BAD_TOKEN , NULL , _ ( " " ) , str ) ; }
Reverse lookup in ITEM_TYPE_STR: Set *TYPE to the index that contains STR.
Reverse lookup in ITEM_TYPE_STR : Set * TYPE to the index that contains STR .