Exemple #1
0
static struct ccl_rpn_node *search_terms2(CCL_parser cclp,
                                          ccl_qualifier_t *qa)
{
    if (KIND == CCL_TOK_LP)
    {
        struct ccl_rpn_node *p;
        ADVANCE;
        if (!(p = find_spec(cclp, qa)))
            return NULL;
        if (KIND != CCL_TOK_RP)
        {
            cclp->error_code = CCL_ERR_RP_EXPECTED;
            ccl_rpn_delete(p);
            return NULL;
        }
        ADVANCE;
        return p;
    }
    else
    {
        static int list[] = {
            CCL_TOK_TERM, CCL_TOK_COMMA,CCL_TOK_EQ,
            CCL_TOK_REL, CCL_TOK_SET, -1};

        return search_term_x(cclp, qa, list, 1);
    }
}
Exemple #2
0
int rprm(const char *format,va_list ap){
 int i/*,k,ind*/,res;
 //struct rparam *next;
 char arr[1000],*str1,*str;


 if(format[0]=='$'){ /* read in current position */
  do{
   ac_formpos=Get_cur_pos();
   str=arr;
   if(get_next_string(str,1)==-1){
    if(stop_on_error>0)fatal_error("End of file reached in file %s",cur_file_name);
    else if(stop_on_error<0)msg_error("End of file reached in file %s",cur_file_name);
    else return -1;
   }
   while(*str==' ' && *str)str++;
  }while(!*str);

  str1=strstr(format,dc);
  if(str1){
   format=str1+1;
   str1=strstr(str,dc);
   if(str1){
    *str1=0;
    strcpy(AcFormat,str);
    str=str1+1;
   }
   else AcFormat[0]='\0';
  }
  else format=format+1;
  i=0;
  ac_helppos=-1; /* no help assumed for current position */
 }
 else str=find_spec(format,arr,&i);

 if(str){
  if(format[i]=='>'){ /* It is very dangerous to use this option without any
                        args in ... !!! */
   //va_start(ap,format);
   str1=va_arg(ap,char *);
   strcpy(str1,str);
   return 1;
  }
  res=vsscanf(str,format+i,ap);
  if(res<0)
    return 0;
  return res;
 }
Exemple #3
0
struct ccl_rpn_node *ccl_parser_find_token(CCL_parser cclp,
                                           struct ccl_token *list)
{
    struct ccl_rpn_node *p;

    cclp->look_token = list;
    p = find_spec(cclp, NULL);
    if (p && KIND != CCL_TOK_EOL)
    {
        if (KIND == CCL_TOK_RP)
            cclp->error_code = CCL_ERR_BAD_RP;
        else
            cclp->error_code = CCL_ERR_OP_EXPECTED;
        ccl_rpn_delete(p);
        p = NULL;
    }
    cclp->error_pos = cclp->look_token->name;
    if (p)
        cclp->error_code = CCL_ERR_OK;
    else
        cclp->error_code = cclp->error_code;
    return p;
}
Exemple #4
0
 std::string format_impl(const std::string &fmt, unsigned pos, unsigned printed){
     return find_spec(fmt, pos, false);
 }