require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_QUEUE_H_)) {
    eval 'sub _SYS_QUEUE_H_ () {1;}' unless defined(&_SYS_QUEUE_H_);
    if(defined(&QUEUE_MACRO_DEBUG)) {
	eval 'sub _Q_INVALIDATE {
	    my($a) = @_;
    	    eval q(($a) = (( &void *)-1));
	}' unless defined(&_Q_INVALIDATE);
    } else {
	eval 'sub _Q_INVALIDATE {
	    my($a) = @_;
    	    eval q();
	}' unless defined(&_Q_INVALIDATE);
    }
    eval 'sub SLIST_HEAD {
        my($name, $type) = @_;
	    eval q(\'struct name\' { \'struct type\' * &slh_first; });
    }' unless defined(&SLIST_HEAD);
    eval 'sub SLIST_HEAD_INITIALIZER {
        my($head) = @_;
	    eval q({  &NULL });
    }' unless defined(&SLIST_HEAD_INITIALIZER);
    eval 'sub SLIST_ENTRY {
        my($type) = @_;
	    eval q(\'struct struct\' { \'struct type\' * &sle_next; });
    }' unless defined(&SLIST_ENTRY);
    eval 'sub SLIST_FIRST {
        my($head) = @_;
	    eval q((($head)-> &slh_first));
    }' unless defined(&SLIST_FIRST);
    eval 'sub SLIST_END {
        my($head) = @_;
	    eval q( &NULL);
    }' unless defined(&SLIST_END);
    eval 'sub SLIST_EMPTY {
        my($head) = @_;
	    eval q(( &SLIST_FIRST($head) ==  &SLIST_END($head)));
    }' unless defined(&SLIST_EMPTY);
    eval 'sub SLIST_NEXT {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{sle_next})));
    }' unless defined(&SLIST_NEXT);
    eval 'sub SLIST_FOREACH {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &SLIST_FIRST($head); ($var) !=  &SLIST_END($head); ($var) =  &SLIST_NEXT($var, $field)));
    }' unless defined(&SLIST_FOREACH);
    eval 'sub SLIST_FOREACH_PREVPTR {
        my($var, $varp, $head, $field) = @_;
	    eval q( &for (($varp) =  &SLIST_FIRST(($head)); (($var) = *($varp)) !=  &SLIST_END($head); ($varp) =  &SLIST_NEXT(($var), $field)));
    }' unless defined(&SLIST_FOREACH_PREVPTR);
    eval 'sub SLIST_INIT {
        my($head) = @_;
	    eval q({  &SLIST_FIRST($head) =  &SLIST_END($head); });
    }' unless defined(&SLIST_INIT);
    eval 'sub SLIST_INSERT_AFTER {
        my($slistelm, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{sle_next}) = ($slistelm)-> ($field->{sle_next}); ($slistelm)-> ($field->{sle_next}) = ($elm); }  &while (0));
    }' unless defined(&SLIST_INSERT_AFTER);
    eval 'sub SLIST_INSERT_HEAD {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{sle_next}) = ($head)-> &slh_first; ($head)-> &slh_first = ($elm); }  &while (0));
    }' unless defined(&SLIST_INSERT_HEAD);
    eval 'sub SLIST_REMOVE_NEXT {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{sle_next}) = ($elm)-> ($field->{sle_next}->{field}->{sle_next}); }  &while (0));
    }' unless defined(&SLIST_REMOVE_NEXT);
    eval 'sub SLIST_REMOVE_HEAD {
        my($head, $field) = @_;
	    eval q( &do { ($head)-> &slh_first = ($head)-> ($slh_first->{field}->{sle_next}); }  &while (0));
    }' unless defined(&SLIST_REMOVE_HEAD);
    eval 'sub SLIST_REMOVE {
        my($head, $elm, $type, $field) = @_;
	    eval q( &do {  &if (($head)-> &slh_first == ($elm)) {  &SLIST_REMOVE_HEAD(($head), $field); }  &else { \'struct type\' * &curelm = ($head)-> &slh_first;  &while ( ($curelm->{field}->{sle_next}) != ($elm))  &curelm =  ($curelm->{field}->{sle_next});  ($curelm->{field}->{sle_next}) =  ($curelm->{field}->{sle_next}->{field}->{sle_next});  &_Q_INVALIDATE(($elm)-> ($field->{sle_next})); } }  &while (0));
    }' unless defined(&SLIST_REMOVE);
    eval 'sub LIST_HEAD {
        my($name, $type) = @_;
	    eval q(\'struct name\' { \'struct type\' * &lh_first; });
    }' unless defined(&LIST_HEAD);
    eval 'sub LIST_HEAD_INITIALIZER {
        my($head) = @_;
	    eval q({  &NULL });
    }' unless defined(&LIST_HEAD_INITIALIZER);
    eval 'sub LIST_ENTRY {
        my($type) = @_;
	    eval q(\'struct struct\' { \'struct type\' * &le_next; \'struct type\' ** &le_prev; });
    }' unless defined(&LIST_ENTRY);
    eval 'sub LIST_FIRST {
        my($head) = @_;
	    eval q((($head)-> &lh_first));
    }' unless defined(&LIST_FIRST);
    eval 'sub LIST_END {
        my($head) = @_;
	    eval q( &NULL);
    }' unless defined(&LIST_END);
    eval 'sub LIST_EMPTY {
        my($head) = @_;
	    eval q(( &LIST_FIRST($head) ==  &LIST_END($head)));
    }' unless defined(&LIST_EMPTY);
    eval 'sub LIST_NEXT {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{le_next})));
    }' unless defined(&LIST_NEXT);
    eval 'sub LIST_FOREACH {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &LIST_FIRST($head); ($var)!=  &LIST_END($head); ($var) =  &LIST_NEXT($var, $field)));
    }' unless defined(&LIST_FOREACH);
    eval 'sub LIST_INIT {
        my($head) = @_;
	    eval q( &do {  &LIST_FIRST($head) =  &LIST_END($head); }  &while (0));
    }' unless defined(&LIST_INIT);
    eval 'sub LIST_INSERT_AFTER {
        my($listelm, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{le_next}) = ($listelm)-> ($field->{le_next})) !=  &NULL) ($listelm)-> ($field->{le_next}->{field}->{le_prev}) = ($elm)-> ($field->{le_next}); ($listelm)-> ($field->{le_next}) = ($elm); ($elm)-> ($field->{le_prev}) = ($listelm)-> ($field->{le_next}); }  &while (0));
    }' unless defined(&LIST_INSERT_AFTER);
    eval 'sub LIST_INSERT_BEFORE {
        my($listelm, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{le_prev}) = ($listelm)-> ($field->{le_prev}); ($elm)-> ($field->{le_next}) = ($listelm); *($listelm)-> ($field->{le_prev}) = ($elm); ($listelm)-> ($field->{le_prev}) = ($elm)-> ($field->{le_next}); }  &while (0));
    }' unless defined(&LIST_INSERT_BEFORE);
    eval 'sub LIST_INSERT_HEAD {
        my($head, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{le_next}) = ($head)-> &lh_first) !=  &NULL) ($head)-> ($lh_first->{field}->{le_prev}) = ($elm)-> ($field->{le_next}); ($head)-> &lh_first = ($elm); ($elm)-> ($field->{le_prev}) = ($head)-> &lh_first; }  &while (0));
    }' unless defined(&LIST_INSERT_HEAD);
    eval 'sub LIST_REMOVE {
        my($elm, $field) = @_;
	    eval q( &do {  &if (($elm)-> ($field->{le_next}) !=  &NULL) ($elm)-> ($field->{le_next}->{field}->{le_prev}) = ($elm)-> ($field->{le_prev}); *($elm)-> ($field->{le_prev}) = ($elm)-> ($field->{le_next});  &_Q_INVALIDATE(($elm)-> ($field->{le_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{le_next})); }  &while (0));
    }' unless defined(&LIST_REMOVE);
    eval 'sub LIST_REPLACE {
        my($elm, $elm2, $field) = @_;
	    eval q( &do {  &if ((($elm2)-> ($field->{le_next}) = ($elm)-> ($field->{le_next})) !=  &NULL) ($elm2)-> ($field->{le_next}->{field}->{le_prev}) = ($elm2)-> ($field->{le_next}); ($elm2)-> ($field->{le_prev}) = ($elm)-> ($field->{le_prev}); *($elm2)-> ($field->{le_prev}) = ($elm2);  &_Q_INVALIDATE(($elm)-> ($field->{le_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{le_next})); }  &while (0));
    }' unless defined(&LIST_REPLACE);
    eval 'sub SIMPLEQ_HEAD {
        my($name, $type) = @_;
	    eval q(\'struct name\' { \'struct type\' * &sqh_first; \'struct type\' ** &sqh_last; });
    }' unless defined(&SIMPLEQ_HEAD);
    eval 'sub SIMPLEQ_HEAD_INITIALIZER {
        my($head) = @_;
	    eval q({  &NULL, ($head). &sqh_first });
    }' unless defined(&SIMPLEQ_HEAD_INITIALIZER);
    eval 'sub SIMPLEQ_ENTRY {
        my($type) = @_;
	    eval q(\'struct struct\' { \'struct type\' * &sqe_next; });
    }' unless defined(&SIMPLEQ_ENTRY);
    eval 'sub SIMPLEQ_FIRST {
        my($head) = @_;
	    eval q((($head)-> &sqh_first));
    }' unless defined(&SIMPLEQ_FIRST);
    eval 'sub SIMPLEQ_END {
        my($head) = @_;
	    eval q( &NULL);
    }' unless defined(&SIMPLEQ_END);
    eval 'sub SIMPLEQ_EMPTY {
        my($head) = @_;
	    eval q(( &SIMPLEQ_FIRST($head) ==  &SIMPLEQ_END($head)));
    }' unless defined(&SIMPLEQ_EMPTY);
    eval 'sub SIMPLEQ_NEXT {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{sqe_next})));
    }' unless defined(&SIMPLEQ_NEXT);
    eval 'sub SIMPLEQ_FOREACH {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &SIMPLEQ_FIRST($head); ($var) !=  &SIMPLEQ_END($head); ($var) =  &SIMPLEQ_NEXT($var, $field)));
    }' unless defined(&SIMPLEQ_FOREACH);
    eval 'sub SIMPLEQ_INIT {
        my($head) = @_;
	    eval q( &do { ($head)-> &sqh_first =  &NULL; ($head)-> &sqh_last = ($head)-> &sqh_first; }  &while (0));
    }' unless defined(&SIMPLEQ_INIT);
    eval 'sub SIMPLEQ_INSERT_HEAD {
        my($head, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{sqe_next}) = ($head)-> &sqh_first) ==  &NULL) ($head)-> &sqh_last = ($elm)-> ($field->{sqe_next}); ($head)-> &sqh_first = ($elm); }  &while (0));
    }' unless defined(&SIMPLEQ_INSERT_HEAD);
    eval 'sub SIMPLEQ_INSERT_TAIL {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{sqe_next}) =  &NULL; *($head)-> &sqh_last = ($elm); ($head)-> &sqh_last = ($elm)-> ($field->{sqe_next}); }  &while (0));
    }' unless defined(&SIMPLEQ_INSERT_TAIL);
    eval 'sub SIMPLEQ_INSERT_AFTER {
        my($head, $listelm, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{sqe_next}) = ($listelm)-> ($field->{sqe_next})) ==  &NULL) ($head)-> &sqh_last = ($elm)-> ($field->{sqe_next}); ($listelm)-> ($field->{sqe_next}) = ($elm); }  &while (0));
    }' unless defined(&SIMPLEQ_INSERT_AFTER);
    eval 'sub SIMPLEQ_REMOVE_HEAD {
        my($head, $field) = @_;
	    eval q( &do {  &if ((($head)-> &sqh_first = ($head)-> ($sqh_first->{field}->{sqe_next})) ==  &NULL) ($head)-> &sqh_last = ($head)-> &sqh_first; }  &while (0));
    }' unless defined(&SIMPLEQ_REMOVE_HEAD);
    eval 'sub TAILQ_HEAD {
        my($name, $type) = @_;
	    eval q(\'struct name\' { \'struct type\' * &tqh_first; \'struct type\' ** &tqh_last; });
    }' unless defined(&TAILQ_HEAD);
    eval 'sub TAILQ_HEAD_INITIALIZER {
        my($head) = @_;
	    eval q({  &NULL, ($head). &tqh_first });
    }' unless defined(&TAILQ_HEAD_INITIALIZER);
    eval 'sub TAILQ_ENTRY {
        my($type) = @_;
	    eval q(\'struct struct\' { \'struct type\' * &tqe_next; \'struct type\' ** &tqe_prev; });
    }' unless defined(&TAILQ_ENTRY);
    eval 'sub TAILQ_FIRST {
        my($head) = @_;
	    eval q((($head)-> &tqh_first));
    }' unless defined(&TAILQ_FIRST);
    eval 'sub TAILQ_END {
        my($head) = @_;
	    eval q( &NULL);
    }' unless defined(&TAILQ_END);
    eval 'sub TAILQ_NEXT {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{tqe_next})));
    }' unless defined(&TAILQ_NEXT);
    eval 'sub TAILQ_LAST {
        my($head, $headname) = @_;
	    eval q((*(((($head)-> &tqh_last))-> &tqh_last)));
    }' unless defined(&TAILQ_LAST);
    eval 'sub TAILQ_PREV {
        my($elm, $headname, $field) = @_;
	    eval q((*(((($elm)-> ($field->{tqe_prev})))-> &tqh_last)));
    }' unless defined(&TAILQ_PREV);
    eval 'sub TAILQ_EMPTY {
        my($head) = @_;
	    eval q(( &TAILQ_FIRST($head) ==  &TAILQ_END($head)));
    }' unless defined(&TAILQ_EMPTY);
    eval 'sub TAILQ_FOREACH {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &TAILQ_FIRST($head); ($var) !=  &TAILQ_END($head); ($var) =  &TAILQ_NEXT($var, $field)));
    }' unless defined(&TAILQ_FOREACH);
    eval 'sub TAILQ_FOREACH_REVERSE {
        my($var, $head, $headname, $field) = @_;
	    eval q( &for(($var) =  &TAILQ_LAST($head, $headname); ($var) !=  &TAILQ_END($head); ($var) =  &TAILQ_PREV($var, $headname, $field)));
    }' unless defined(&TAILQ_FOREACH_REVERSE);
    eval 'sub TAILQ_INIT {
        my($head) = @_;
	    eval q( &do { ($head)-> &tqh_first =  &NULL; ($head)-> &tqh_last = ($head)-> &tqh_first; }  &while (0));
    }' unless defined(&TAILQ_INIT);
    eval 'sub TAILQ_INSERT_HEAD {
        my($head, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{tqe_next}) = ($head)-> &tqh_first) !=  &NULL) ($head)-> ($tqh_first->{field}->{tqe_prev}) = ($elm)-> ($field->{tqe_next});  &else ($head)-> &tqh_last = ($elm)-> ($field->{tqe_next}); ($head)-> &tqh_first = ($elm); ($elm)-> ($field->{tqe_prev}) = ($head)-> &tqh_first; }  &while (0));
    }' unless defined(&TAILQ_INSERT_HEAD);
    eval 'sub TAILQ_INSERT_TAIL {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{tqe_next}) =  &NULL; ($elm)-> ($field->{tqe_prev}) = ($head)-> &tqh_last; *($head)-> &tqh_last = ($elm); ($head)-> &tqh_last = ($elm)-> ($field->{tqe_next}); }  &while (0));
    }' unless defined(&TAILQ_INSERT_TAIL);
    eval 'sub TAILQ_INSERT_AFTER {
        my($head, $listelm, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{tqe_next}) = ($listelm)-> ($field->{tqe_next})) !=  &NULL) ($elm)-> ($field->{tqe_next}->{field}->{tqe_prev}) = ($elm)-> ($field->{tqe_next});  &else ($head)-> &tqh_last = ($elm)-> ($field->{tqe_next}); ($listelm)-> ($field->{tqe_next}) = ($elm); ($elm)-> ($field->{tqe_prev}) = ($listelm)-> ($field->{tqe_next}); }  &while (0));
    }' unless defined(&TAILQ_INSERT_AFTER);
    eval 'sub TAILQ_INSERT_BEFORE {
        my($listelm, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{tqe_prev}) = ($listelm)-> ($field->{tqe_prev}); ($elm)-> ($field->{tqe_next}) = ($listelm); *($listelm)-> ($field->{tqe_prev}) = ($elm); ($listelm)-> ($field->{tqe_prev}) = ($elm)-> ($field->{tqe_next}); }  &while (0));
    }' unless defined(&TAILQ_INSERT_BEFORE);
    eval 'sub TAILQ_REMOVE {
        my($head, $elm, $field) = @_;
	    eval q( &do {  &if ((($elm)-> ($field->{tqe_next})) !=  &NULL) ($elm)-> ($field->{tqe_next}->{field}->{tqe_prev}) = ($elm)-> ($field->{tqe_prev});  &else ($head)-> &tqh_last = ($elm)-> ($field->{tqe_prev}); *($elm)-> ($field->{tqe_prev}) = ($elm)-> ($field->{tqe_next});  &_Q_INVALIDATE(($elm)-> ($field->{tqe_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{tqe_next})); }  &while (0));
    }' unless defined(&TAILQ_REMOVE);
    eval 'sub TAILQ_REPLACE {
        my($head, $elm, $elm2, $field) = @_;
	    eval q( &do {  &if ((($elm2)-> ($field->{tqe_next}) = ($elm)-> ($field->{tqe_next})) !=  &NULL) ($elm2)-> ($field->{tqe_next}->{field}->{tqe_prev}) = ($elm2)-> ($field->{tqe_next});  &else ($head)-> &tqh_last = ($elm2)-> ($field->{tqe_next}); ($elm2)-> ($field->{tqe_prev}) = ($elm)-> ($field->{tqe_prev}); *($elm2)-> ($field->{tqe_prev}) = ($elm2);  &_Q_INVALIDATE(($elm)-> ($field->{tqe_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{tqe_next})); }  &while (0));
    }' unless defined(&TAILQ_REPLACE);
    eval 'sub CIRCLEQ_HEAD {
        my($name, $type) = @_;
	    eval q(\'struct name\' { \'struct type\' * &cqh_first; \'struct type\' * &cqh_last; });
    }' unless defined(&CIRCLEQ_HEAD);
    eval 'sub CIRCLEQ_HEAD_INITIALIZER {
        my($head) = @_;
	    eval q({  &CIRCLEQ_END($head),  &CIRCLEQ_END($head) });
    }' unless defined(&CIRCLEQ_HEAD_INITIALIZER);
    eval 'sub CIRCLEQ_ENTRY {
        my($type) = @_;
	    eval q(\'struct struct\' { \'struct type\' * &cqe_next; \'struct type\' * &cqe_prev; });
    }' unless defined(&CIRCLEQ_ENTRY);
    eval 'sub CIRCLEQ_FIRST {
        my($head) = @_;
	    eval q((($head)-> &cqh_first));
    }' unless defined(&CIRCLEQ_FIRST);
    eval 'sub CIRCLEQ_LAST {
        my($head) = @_;
	    eval q((($head)-> &cqh_last));
    }' unless defined(&CIRCLEQ_LAST);
    eval 'sub CIRCLEQ_END {
        my($head) = @_;
	    eval q((( &void *)($head)));
    }' unless defined(&CIRCLEQ_END);
    eval 'sub CIRCLEQ_NEXT {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{cqe_next})));
    }' unless defined(&CIRCLEQ_NEXT);
    eval 'sub CIRCLEQ_PREV {
        my($elm, $field) = @_;
	    eval q((($elm)-> ($field->{cqe_prev})));
    }' unless defined(&CIRCLEQ_PREV);
    eval 'sub CIRCLEQ_EMPTY {
        my($head) = @_;
	    eval q(( &CIRCLEQ_FIRST($head) ==  &CIRCLEQ_END($head)));
    }' unless defined(&CIRCLEQ_EMPTY);
    eval 'sub CIRCLEQ_FOREACH {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &CIRCLEQ_FIRST($head); ($var) !=  &CIRCLEQ_END($head); ($var) =  &CIRCLEQ_NEXT($var, $field)));
    }' unless defined(&CIRCLEQ_FOREACH);
    eval 'sub CIRCLEQ_FOREACH_REVERSE {
        my($var, $head, $field) = @_;
	    eval q( &for(($var) =  &CIRCLEQ_LAST($head); ($var) !=  &CIRCLEQ_END($head); ($var) =  &CIRCLEQ_PREV($var, $field)));
    }' unless defined(&CIRCLEQ_FOREACH_REVERSE);
    eval 'sub CIRCLEQ_INIT {
        my($head) = @_;
	    eval q( &do { ($head)-> &cqh_first =  &CIRCLEQ_END($head); ($head)-> &cqh_last =  &CIRCLEQ_END($head); }  &while (0));
    }' unless defined(&CIRCLEQ_INIT);
    eval 'sub CIRCLEQ_INSERT_AFTER {
        my($head, $listelm, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{cqe_next}) = ($listelm)-> ($field->{cqe_next}); ($elm)-> ($field->{cqe_prev}) = ($listelm);  &if (($listelm)-> ($field->{cqe_next}) ==  &CIRCLEQ_END($head)) ($head)-> &cqh_last = ($elm);  &else ($listelm)-> ($field->{cqe_next}->{field}->{cqe_prev}) = ($elm); ($listelm)-> ($field->{cqe_next}) = ($elm); }  &while (0));
    }' unless defined(&CIRCLEQ_INSERT_AFTER);
    eval 'sub CIRCLEQ_INSERT_BEFORE {
        my($head, $listelm, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{cqe_next}) = ($listelm); ($elm)-> ($field->{cqe_prev}) = ($listelm)-> ($field->{cqe_prev});  &if (($listelm)-> ($field->{cqe_prev}) ==  &CIRCLEQ_END($head)) ($head)-> &cqh_first = ($elm);  &else ($listelm)-> ($field->{cqe_prev}->{field}->{cqe_next}) = ($elm); ($listelm)-> ($field->{cqe_prev}) = ($elm); }  &while (0));
    }' unless defined(&CIRCLEQ_INSERT_BEFORE);
    eval 'sub CIRCLEQ_INSERT_HEAD {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{cqe_next}) = ($head)-> &cqh_first; ($elm)-> ($field->{cqe_prev}) =  &CIRCLEQ_END($head);  &if (($head)-> &cqh_last ==  &CIRCLEQ_END($head)) ($head)-> &cqh_last = ($elm);  &else ($head)-> ($cqh_first->{field}->{cqe_prev}) = ($elm); ($head)-> &cqh_first = ($elm); }  &while (0));
    }' unless defined(&CIRCLEQ_INSERT_HEAD);
    eval 'sub CIRCLEQ_INSERT_TAIL {
        my($head, $elm, $field) = @_;
	    eval q( &do { ($elm)-> ($field->{cqe_next}) =  &CIRCLEQ_END($head); ($elm)-> ($field->{cqe_prev}) = ($head)-> &cqh_last;  &if (($head)-> &cqh_first ==  &CIRCLEQ_END($head)) ($head)-> &cqh_first = ($elm);  &else ($head)-> ($cqh_last->{field}->{cqe_next}) = ($elm); ($head)-> &cqh_last = ($elm); }  &while (0));
    }' unless defined(&CIRCLEQ_INSERT_TAIL);
    eval 'sub CIRCLEQ_REMOVE {
        my($head, $elm, $field) = @_;
	    eval q( &do {  &if (($elm)-> ($field->{cqe_next}) ==  &CIRCLEQ_END($head)) ($head)-> &cqh_last = ($elm)-> ($field->{cqe_prev});  &else ($elm)-> ($field->{cqe_next}->{field}->{cqe_prev}) = ($elm)-> ($field->{cqe_prev});  &if (($elm)-> ($field->{cqe_prev}) ==  &CIRCLEQ_END($head)) ($head)-> &cqh_first = ($elm)-> ($field->{cqe_next});  &else ($elm)-> ($field->{cqe_prev}->{field}->{cqe_next}) = ($elm)-> ($field->{cqe_next});  &_Q_INVALIDATE(($elm)-> ($field->{cqe_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{cqe_next})); }  &while (0));
    }' unless defined(&CIRCLEQ_REMOVE);
    eval 'sub CIRCLEQ_REPLACE {
        my($head, $elm, $elm2, $field) = @_;
	    eval q( &do {  &if ((($elm2)-> ($field->{cqe_next}) = ($elm)-> ($field->{cqe_next})) ==  &CIRCLEQ_END($head)) ($head). &cqh_last = ($elm2);  &else ($elm2)-> ($field->{cqe_next}->{field}->{cqe_prev}) = ($elm2);  &if ((($elm2)-> ($field->{cqe_prev}) = ($elm)-> ($field->{cqe_prev})) ==  &CIRCLEQ_END($head)) ($head). &cqh_first = ($elm2);  &else ($elm2)-> ($field->{cqe_prev}->{field}->{cqe_next}) = ($elm2);  &_Q_INVALIDATE(($elm)-> ($field->{cqe_prev}));  &_Q_INVALIDATE(($elm)-> ($field->{cqe_next})); }  &while (0));
    }' unless defined(&CIRCLEQ_REPLACE);
}
1;
