    /*
     *  call-seq:
     *     term_enum.each {|term, doc_freq| do_something() } -> term_count
     *
     *  Iterates through all the terms in the field, yielding the term and the
     *  document frequency.
     */
    static VALUE
    frt_te_each(VALUE self)
    {
        TermEnum *te = (TermEnum *)DATA_PTR(self);
        char *term;
        int term_cnt = 0;
        VALUE vals = rb_ary_new2(2);
        RARRAY(vals)->len = 2;

        /* each is being called so there will be no current term */
        rb_ivar_set(self, id_term, Qnil);

        while (NULL != (term = te->next(te))) {
            term_cnt++;
            RARRAY(vals)->ptr[0] = rb_str_new(term, te->curr_term_len);
            RARRAY(vals)->ptr[1] = INT2FIX(te->curr_ti.doc_freq);
            rb_yield(vals);
        }
        return INT2FIX(term_cnt);
    }