示例#1
0
int     verify_dir(char *s)
{
    if (!s)
        error_exit("error t_dir code");
    if (*s != DIRECT_CHAR)
        return (0);
    s++;
    if (!s)
        error_exit("error t_dir");
    if ((*s >= '0' && *s <= '9') || *s == '-')
    {
        s = (*s == '-') ? s + 1 : s;
        iter_str(s, error_num);
        return (T_DIR);
    }
    if (*s == LABEL_CHAR)
    {
        s++;
        iter_str(s, error_label);
        return (T_DIR);
    }
    return (0);
}
示例#2
0
int
length_str (const char *str)
{
  int count = 0;

  void
  increment (char c)
  {
    /* Here with COUNT, we can test that GDB can read a non-local variable even
       though it's not directly in the upper stack frame.  */
    count += 1; /* STOP */
  }

  iter_str (str, &increment);
  return count;
}