<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div id="yiv1030419394"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt;"><div id="yiv1030419394"><div id="yiv1030419394yui_3_13_0_1_1383418127784_5018"><div class="yiv1030419394yui_3_13_0_1_1383418127784_4772" id="yiv1030419394yui_3_13_0_1_1383418127784_5017" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt;">well I have to do a glue layer for it any way because the macro  gets an unidentified alien function  error when I try to call it from a defcfun in lisp...I write alot of glue code for unidentified alien function errors but those are for functions not macros. could you help get me
 started writing a glue layer for this macro i posted so i can call it in a defcfun for c....i have no idea how to type  cast the parameters or how to do a return on them...btw .sorry if i sent  a reply to your mailbox Frank =)<br clear="none"><div id="yiv1030419394yui_3_13_0_7_1383417415645_10"><span><br clear="none"></span></div><div class="yiv1030419394yqt7586838400" id="yiv1030419394yqt58615"><div class="yiv1030419394yqt4602815250" id="yiv1030419394yqt94503"><div class="yiv1030419394yahoo_quoted" id="yiv1030419394yui_3_13_0_7_1383417415645_12" style="display: block;"> <br clear="none"> <br clear="none"> <div class="yiv1030419394yui_3_13_0_1_1383417415645_2645 yiv1030419394yui_3_13_0_1_1383418127784_4774" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt;">
 <div class="yiv1030419394yui_3_13_0_1_1383417415645_2646 yiv1030419394yui_3_13_0_1_1383418127784_4775" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Saturday, November 2, 2013 9:23 AM, Frank Gönninger <frank.goenninger@consequor.de> wrote:<br clear="none"> </font> </div> <blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;margin-top:5px;padding-left:5px;">  <div class="yiv1030419394y_msg_container">This is a simple code generation C macro, so this is simple to be<br clear="none">transcripted into Common Lisp. There are several alternatives to do this.<br clear="none"><br clear="none">Either you write the code explicitly in every use occasion or you write a<br clear="none">Common Lisp macro that does the same.<br clear="none"><br clear="none">(defmacro cv-seq-elem( seq elem_type index )<br clear="none">  `(
 Š <br clear="none"><br clear="none">But why do you what to do this in
 Lisp? I would rather write some glue<br clear="none">layer in C and have much simpler calls from Lisp to C.<br clear="none"><br clear="none">Good luck.<br clear="none"><br clear="none">Frank<br clear="none"><br clear="none"><div class="yiv1030419394yqt4228120253" id="yiv1030419394yqtfd29014"><br clear="none">Am 02.11.13 16:43 schrieb "Joeish W" unter <<a rel="nofollow" shape="rect" ymailto="mailto:joeish80829@yahoo.com" target="_blank" href="mailto:joeish80829@yahoo.com">joeish80829@yahoo.com</a>>:<br clear="none"><br clear="none">><br clear="none">>I'm trying to wrap the GET_SEQ_ELEM  macro below can some one give me<br clear="none">>clues or example how i would go about this easily<br clear="none">><br clear="none">>with a cffi function like defcfun...If there is no clear way i definately<br clear="none">>propose an addendum to cffi for wrapping macros<br clear="none">><br clear="none">><br
 clear="none">>#define  CV_SEQ_ELEM( seq, elem_type, index )   
                 \<br clear="none">><br clear="none">>/* assert gives some guarantee that <seq> parameter is valid */  \<br clear="none">><br clear="none">>(   assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) &&      \<br clear="none">><br clear="none">>    (seq)->elem_size == sizeof(elem_type)),                      \<br clear="none">><br clear="none">>    (elem_type*)((seq)->first && (unsigned)index<br clear="none">> <               \<br clear="none">><br clear="none">>    (unsigned)((seq)->first->count) ?                            \<br clear="none">><br clear="none">>    (seq)->first->data + (index) *
 sizeof(elem_type) :           \<br clear="none">><br clear="none">>    cvGetSeqElem( (CvSeq*)(seq), (index) )))<br clear="none">><br clear="none">>#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq),<br clear="none">>elem_type, (index) )<br clear="none"></div><br clear="none"><br clear="none"></div> </blockquote>  </div> </div>   </div></div></div> </div></div></div></div></div></div></div></body></html>