
/* This file was automatically generated by pclu.*/

#include "pclu_err.h"
#include "pclu_sys.h"


extern struct dbg_info* dbg_info__qindexc;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG _qindexc_TRACE
int _qindexc_TRACE;
extern struct OPS *int_ops;
static Vlist1 owns__qindexc = {0, 1,{ {0, 2, "_init", &int_ops}
}
};
extern errcode stringOPsize();
extern errcode intOPle();
extern errcode stringOPfetch();
extern errcode charOPequal();
extern errcode intOPadd();
extern OWN_req string_ownreqs;
extern struct OPS *string_ops;
static int _qindexc_own_init = 0;

/**** BEGIN PROCEDURE _qindexc ****/

errcode _qindexc(c, s, ret_1)
CLUREF c;
CLUREF s;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF z;
        CLUREF i;
        CLUREF cc;
        CLUREF c;
        CLUREF s;
        } locals;
    locals.z.num = UNINIT;
    locals.i.num = UNINIT;
    locals.cc.num = UNINIT;
    locals.c.num = UNINIT;
    locals.s.num = UNINIT;
    locals.DBG_INFO = dbg_info__qindexc;
    locals.c = c;
    locals.s = s;
        if (_qindexc_own_init == 0) {
        _qindexc_own_init = 1;
    }
    enter_proc(3);

  LINE(5);
    {
        {CLUREF T_1_1;
        locals.err = stringOPsize(locals.s, &T_1_1);
        if (locals.err != ERR_ok) goto ex_0;
        locals.z.num = T_1_1.num;
        }
        }

  LINE(6);
    {
        {locals.i.num = 1;
        }
        }

  LINE(7);
    for (;;) {
        CLUREF T_1_1;
        T_1_1.num = (locals.i.num <= locals.z.num)? true : false;
        if (T_1_1.num != true) { break; }

  LINE(8);
        {
            {CLUREF T_2_1;
            locals.err = stringOPfetch(locals.s, locals.i, &T_2_1);
            if (locals.err != ERR_ok) goto ex_0;
            locals.cc.num = T_2_1.num;
            }
            }

  LINE(9);
        {
        CLUREF T_2_1;
        T_2_1.num = (locals.cc.ch == locals.c.ch)? true : false;
        if (T_2_1.num == true) {

  LINE(10);
            {
            {
            ret_1->num = locals.i.num;
            }
            {signal (ERR_ok);}}
            }
        else {
        CLUREF T_2_2;
        CLUREF T_2_3;
        T_2_2.ch = '\\';
        T_2_3.num = (locals.cc.ch == T_2_2.ch)? true : false;
        if (T_2_3.num == true) {

  LINE(12);
            {
            CLUREF T_3_1;
            locals.err = intOPadd(locals.i, CLU_2, &T_3_1);
            if (locals.err != ERR_ok) goto ex_0;
            locals.i.num = T_3_1.num;
            }
            }
        else {

  LINE(13);
            {
            CLUREF T_3_1;
            locals.err = intOPadd(locals.i, CLU_1, &T_3_1);
            if (locals.err != ERR_ok) goto ex_0;
            locals.i.num = T_3_1.num;
            }
            }}}/* end if */
        }
        end_while_1:;

  LINE(15);
    {
    {
    ret_1->num = 0;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE _qindexc ****/

extern struct OPS *char_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist7 *locals;
    Vlist1 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info__qindexc_actual;
static Vlist1 vals__qindexc = {0, 1, { {0, 2, "", &int_ops}}
};
static siglist0 sigs__qindexc = {0, 0};
static Vlist7 locals__qindexc = {0, 7,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "z", &int_ops},  {0, 2, "i", &int_ops},  {0, 2, "cc", &char_ops},  {0, 2, "c", &char_ops},  {0, 2, "s", &string_ops}}
};
static Vlist0 popowns__qindexc = {0, 0};
Slist0 tformals__qindexc = {0, 0};
Slist0 opformals__qindexc = {0, 0};
dbg_info__qindexc_actual dbg_info__qindexc_data = {0, 12, 
    "_qindexc", "/common/pub/dcurtis-temp/pclu/lib/clu/_qindexc.clu", 0, 0, (int)_qindexc, 2, 
    &vals__qindexc, &sigs__qindexc, &locals__qindexc, &owns__qindexc, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info__qindexc = (struct dbg_info*)&dbg_info__qindexc_data;
