## cr-selector

cr-selector

## Synopsis

    struct              CRSelector;
    CRSelector *        cr_selector_append                  (CRSelector *a_this,
                                                             CRSelector *a_new);
    CRSelector *        cr_selector_append_simple_sel       (CRSelector *a_this,
                                                             CRSimpleSel *a_simple_sel);
    void                cr_selector_destroy                 (CRSelector *a_this);
    void                cr_selector_dump                    (CRSelector const *a_this,
                                                             FILE *a_fp);
    CRSelector *        cr_selector_new                     (CRSimpleSel *a_sel_expr);
    CRSelector *        cr_selector_parse_from_buf          (const guchar *a_char_buf,
                                                             enum CREncoding a_enc);
    CRSelector *        cr_selector_prepend                 (CRSelector *a_this,
                                                             CRSelector *a_new);
    void                cr_selector_ref                     (CRSelector *a_this);
    guchar *            cr_selector_to_string               (CRSelector const *a_this);
    gboolean            cr_selector_unref                   (CRSelector *a_this);

## Description

## Details

### struct CRSelector

    struct CRSelector {
    	/**
    	 *A Selection expression.
    	 *It is a list of basic selectors.
    	 *Each basic selector can be either an element
    	 *selector, an id selector, a class selector, an
    	 *attribute selector, an universal selector etc ...
    	 */
    	CRSimpleSel *simple_sel ;

    	/**The next selector list element*/
    	CRSelector *next ;
    	CRSelector *prev ;
    	CRParsingLocation location ;
    	glong ref_count ;
    };

### cr_selector_append ()

    CRSelector *        cr_selector_append                  (CRSelector *a_this,
                                                             CRSelector *a_new);

`a_this`: the current instance of CRSelector. `a_new`: the instance of CRSelector to be appended.

Appends a new instance of CRSelector to the current selector list.

Returns : | the new list.

### cr_selector_append_simple_sel ()

    CRSelector *        cr_selector_append_simple_sel       (CRSelector *a_this,
                                                             CRSimpleSel *a_simple_sel);

`a_this`: the current instance of CRSelector. `a_simple_sel`: the simple selector to append.

append a simple selector to the current CRSelector list.

Returns : | the new list or NULL in case of failure.

### cr_selector_destroy ()

    void                cr_selector_destroy                 (CRSelector *a_this);

`a_this`: the current instance of CRSelector.

Destroys the selector list.

### cr_selector_dump ()

    void                cr_selector_dump                    (CRSelector const *a_this,
                                                             FILE *a_fp);

`a_this`: the current instance of CRSelector. `a_fp`: the destination file.

Serializes the current instance of CRSelector to a file.

### cr_selector_new ()

    CRSelector *        cr_selector_new                     (CRSimpleSel *a_sel_expr);

`a_simple_sel`: the initial simple selector list of the current instance of CRSelector.

Creates a new instance of CRSelector.

Returns : | the newly built instance of CRSelector, or NULL in case of failure.

### cr_selector_parse_from_buf ()

    CRSelector *        cr_selector_parse_from_buf          (const guchar *a_char_buf,
                                                             enum CREncoding a_enc);

### cr_selector_prepend ()

    CRSelector *        cr_selector_prepend                 (CRSelector *a_this,
                                                             CRSelector *a_new);

`a_this`: the current instance of CRSelector list. `a_new`: the instance of CRSelector.

Prepends an element to the CRSelector list.

Returns : | the new list.

### cr_selector_ref ()

    void                cr_selector_ref                     (CRSelector *a_this);

`a_this`: the current instance of CRSelector.

Increments the ref count of the current instance of CRSelector.

### cr_selector_to_string ()

    guchar *            cr_selector_to_string               (CRSelector const *a_this);

### cr_selector_unref ()

    gboolean            cr_selector_unref                   (CRSelector *a_this);

`a_this`: the current instance of CRSelector.

Decrements the ref count of the current instance of CRSelector. If the ref count reaches zero, the current instance of CRSelector is destroyed.

Returns : | TRUE if this function destroyed the current instance of CRSelector, FALSE otherwise.