4 * Copyright 2002 Ove Kaaven
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 static int indentation
= 0;
40 static void indent(int delta
)
43 if (delta
< 0) indentation
+= delta
;
44 for (c
=0; c
<indentation
; c
++) fprintf(header
, " ");
45 if (delta
> 0) indentation
+= delta
;
48 int is_attr(attr_t
*a
, enum attr_type t
)
51 if (a
->type
== t
) return 1;
57 void *get_attrp(attr_t
*a
, enum attr_type t
)
60 if (a
->type
== t
) return a
->u
.pval
;
66 unsigned long get_attrv(attr_t
*a
, enum attr_type t
)
69 if (a
->type
== t
) return a
->u
.ival
;
75 int is_void(type_t
*t
, var_t
*v
)
77 if (v
&& v
->ptr_level
) return 0;
78 if (!t
->type
&& !t
->ref
) return 1;
82 static void write_pident(FILE *h
, var_t
*v
)
85 for (c
=0; c
<v
->ptr_level
; c
++) {
88 if (v
->name
) fprintf(h
, "%s", v
->name
);
91 void write_name(FILE *h
, var_t
*v
)
93 if (is_attr( v
->attrs
, ATTR_PROPGET
))
95 else if (is_attr( v
->attrs
, ATTR_PROPPUT
))
97 fprintf(h
, "%s", v
->name
);
100 char* get_name(var_t
*v
)
105 static void write_array(FILE *h
, expr_t
*v
, int field
)
108 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
112 fprintf(h
, "%ld", v
->cval
); /* statically sized array */
114 if (field
) fprintf(h
, "1"); /* dynamically sized array */
122 static void write_field(FILE *h
, var_t
*v
)
127 write_type(h
, v
->type
, NULL
, v
->tname
);
133 /* not all C/C++ compilers support anonymous structs and unions */
134 switch (v
->type
->type
) {
136 case RPC_FC_CVSTRUCT
:
137 case RPC_FC_CPSTRUCT
:
140 case RPC_FC_BOGUS_STRUCT
:
141 case RPC_FC_ENCAPSULATED_UNION
:
142 fprintf(h
, " DUMMYSTRUCTNAME");
144 case RPC_FC_NON_ENCAPSULATED_UNION
:
145 fprintf(h
, " DUMMYUNIONNAME");
152 write_array(h
, v
->array
, 1);
157 static void write_fields(FILE *h
, var_t
*v
)
161 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
164 if (v
== first
) break;
169 static void write_enums(FILE *h
, var_t
*v
)
172 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
179 write_expr(h
, v
->eval
);
189 void write_type(FILE *h
, type_t
*t
, var_t
*v
, char *n
)
193 if (n
) fprintf(h
, "%s", n
);
195 if (t
->is_const
) fprintf(h
, "const ");
197 if (t
->sign
> 0) fprintf(h
, "signed ");
198 else if (t
->sign
< 0) fprintf(h
, "unsigned ");
201 if (t
->ref
) fprintf(h
, t
->ref
->name
);
202 else fprintf(h
, "byte");
205 if (t
->ref
) fprintf(h
, t
->ref
->name
);
206 else fprintf(h
, "char");
209 fprintf(h
, "wchar_t");
213 if (t
->ref
) fprintf(h
, t
->ref
->name
);
214 else fprintf(h
, "short");
218 if (t
->ref
) fprintf(h
, t
->ref
->name
);
219 else fprintf(h
, "long");
222 if (t
->ref
) fprintf(h
, t
->ref
->name
);
223 else fprintf(h
, "hyper");
229 fprintf(h
, "double");
233 if (t
->defined
&& !t
->written
) {
234 if (t
->name
) fprintf(h
, "enum %s {\n", t
->name
);
235 else fprintf(h
, "enum {\n");
238 write_enums(h
, t
->fields
);
242 else fprintf(h
, "enum %s", t
->name
);
244 case RPC_FC_ERROR_STATUS_T
:
245 if (t
->ref
) fprintf(h
, t
->ref
->name
);
246 else fprintf(h
, "error_status_t");
249 if (t
->ref
) fprintf(h
, t
->ref
->name
);
250 else fprintf(h
, "handle_t");
253 case RPC_FC_CVSTRUCT
:
254 case RPC_FC_CPSTRUCT
:
257 case RPC_FC_BOGUS_STRUCT
:
258 case RPC_FC_ENCAPSULATED_UNION
:
259 if (t
->defined
&& !t
->written
) {
260 if (t
->name
) fprintf(h
, "struct %s {\n", t
->name
);
261 else fprintf(h
, "struct {\n");
264 write_fields(h
, t
->fields
);
268 else fprintf(h
, "struct %s", t
->name
);
270 case RPC_FC_NON_ENCAPSULATED_UNION
:
271 if (t
->defined
&& !t
->written
) {
272 if (t
->name
) fprintf(h
, "union %s {\n", t
->name
);
273 else fprintf(h
, "union {\n");
276 write_fields(h
, t
->fields
);
280 else fprintf(h
, "union %s", t
->name
);
283 fprintf(h
, "(unknown-type:%d)", t
->type
);
288 write_type(h
, t
->ref
, NULL
, t
->name
);
290 else fprintf(h
, "void");
294 for (c
=0; c
<v
->ptr_level
; c
++) {
300 void write_typedef(type_t
*type
, var_t
*names
)
302 char *tname
= names
->tname
;
304 while (NEXT_LINK(names
)) names
= NEXT_LINK(names
);
306 fprintf(header
, "typedef ");
307 write_type(header
, type
, NULL
, tname
);
308 fprintf(header
, " ");
310 write_pident(header
, names
);
311 if (PREV_LINK(names
))
312 fprintf(header
, ", ");
313 names
= PREV_LINK(names
);
315 fprintf(header
, ";\n");
317 if (get_attrp(type
->attrs
, ATTR_WIREMARSHAL
)) {
320 char *name
= get_name(names
);
321 fprintf(header
, "unsigned long __RPC_USER %s_UserSize (unsigned long *, unsigned long, %s *);\n", name
, name
);
322 fprintf(header
, "unsigned char * __RPC_USER %s_UserMarshal (unsigned long *, unsigned char *, %s *);\n", name
, name
);
323 fprintf(header
, "unsigned char * __RPC_USER %s_UserUnmarshal(unsigned long *, unsigned char *, %s *);\n", name
, name
);
324 fprintf(header
, "void __RPC_USER %s_UserFree (unsigned long *, %s *);\n", name
, name
);
325 if (PREV_LINK(names
))
326 fprintf(header
, ", ");
327 names
= PREV_LINK(names
);
331 fprintf(header
, "\n");
334 static void do_write_expr(FILE *h
, expr_t
*e
, int p
)
340 fprintf(h
, "%ld", e
->u
.lval
);
343 fprintf(h
, "0x%lx", e
->u
.lval
);
345 case EXPR_IDENTIFIER
:
346 fprintf(h
, "%s", e
->u
.sval
);
350 do_write_expr(h
, e
->ref
, 1);
354 do_write_expr(h
, e
->ref
, 1);
358 do_write_expr(h
, e
->ref
, 1);
362 write_type(h
, e
->u
.tref
->ref
, NULL
, e
->u
.tref
->name
);
364 do_write_expr(h
, e
->ref
, 1);
367 fprintf(h
, "sizeof(");
368 write_type(h
, e
->u
.tref
->ref
, NULL
, e
->u
.tref
->name
);
379 if (p
) fprintf(h
, "(");
380 do_write_expr(h
, e
->ref
, 1);
382 case EXPR_SHL
: fprintf(h
, " << "); break;
383 case EXPR_SHR
: fprintf(h
, " >> "); break;
384 case EXPR_MUL
: fprintf(h
, " * "); break;
385 case EXPR_DIV
: fprintf(h
, " / "); break;
386 case EXPR_ADD
: fprintf(h
, " + "); break;
387 case EXPR_SUB
: fprintf(h
, " - "); break;
388 case EXPR_AND
: fprintf(h
, " & "); break;
389 case EXPR_OR
: fprintf(h
, " | "); break;
392 do_write_expr(h
, e
->u
.ext
, 1);
393 if (p
) fprintf(h
, ")");
396 if (p
) fprintf(h
, "(");
397 do_write_expr(h
, e
->ref
, 1);
399 do_write_expr(h
, e
->u
.ext
, 1);
401 do_write_expr(h
, e
->ext2
, 1);
402 if (p
) fprintf(h
, ")");
407 void write_expr(FILE *h
, expr_t
*e
)
409 do_write_expr(h
, e
, 0);
412 void write_constdef(var_t
*v
)
414 fprintf(header
, "#define %s (", get_name(v
));
415 write_expr(header
, v
->eval
);
416 fprintf(header
, ")\n\n");
419 void write_externdef(var_t
*v
)
421 fprintf(header
, "extern const ");
422 write_type(header
, v
->type
, NULL
, v
->tname
);
424 fprintf(header
, " ");
425 write_pident(header
, v
);
427 fprintf(header
, ";\n\n");
431 var_t
* get_explicit_handle_var(func_t
* func
)
439 while (NEXT_LINK(var
)) var
= NEXT_LINK(var
);
442 if (var
->type
->type
== RPC_FC_IGNORE
)
445 var
= PREV_LINK(var
);
452 /********** INTERFACES **********/
454 int is_object(attr_t
*a
)
457 if (a
->type
== ATTR_OBJECT
|| a
->type
== ATTR_ODL
) return 1;
463 int is_local(attr_t
*a
)
465 return is_attr(a
, ATTR_LOCAL
);
468 var_t
*is_callas(attr_t
*a
)
470 return get_attrp(a
, ATTR_CALLAS
);
473 static int write_method_macro(type_t
*iface
, char *name
)
476 func_t
*cur
= iface
->funcs
;
478 if (iface
->ref
) idx
= write_method_macro(iface
->ref
, name
);
481 if (!cur
) return idx
;
482 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
484 fprintf(header
, "/*** %s methods ***/\n", iface
->name
);
486 var_t
*def
= cur
->def
;
487 if (!is_callas(def
->attrs
)) {
488 var_t
*arg
= cur
->args
;
492 arg
= NEXT_LINK(arg
);
496 fprintf(header
, "#define %s_", name
);
497 write_name(header
,def
);
498 fprintf(header
, "(p");
499 for (c
=0; c
<argc
; c
++)
500 fprintf(header
, ",%c", c
+'a');
501 fprintf(header
, ") ");
503 fprintf(header
, "(p)->lpVtbl->");
504 write_name(header
, def
);
505 fprintf(header
, "(p");
506 for (c
=0; c
<argc
; c
++)
507 fprintf(header
, ",%c", c
+'a');
508 fprintf(header
, ")\n");
509 if (cur
->idx
== -1) cur
->idx
= idx
;
510 else if (cur
->idx
!= idx
) yyerror("BUG: method index mismatch in write_method_macro");
513 cur
= PREV_LINK(cur
);
518 void write_args(FILE *h
, var_t
*arg
, char *name
, int method
, int do_indent
)
522 while (NEXT_LINK(arg
))
523 arg
= NEXT_LINK(arg
);
530 } else fprintf(h
, " ");
533 fprintf(h
, "%s* This", name
);
536 if (arg
== NULL
&& method
== 0) {
545 if (h
== header
) indent(0);
546 else fprintf(h
, " ");
548 else fprintf(h
, ",");
550 write_type(h
, arg
->type
, arg
, arg
->tname
);
553 fprintf(h
, " (STDMETHODCALLTYPE *");
556 write_args(h
, arg
->args
, NULL
, 0, FALSE
);
564 write_array(h
, arg
->array
, 0);
565 arg
= PREV_LINK(arg
);
568 if (do_indent
&& h
== header
) indentation
--;
571 static void write_cpp_method_def(type_t
*iface
)
573 func_t
*cur
= iface
->funcs
;
576 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
578 var_t
*def
= cur
->def
;
579 if (!is_callas(def
->attrs
)) {
581 fprintf(header
, "virtual ");
582 write_type(header
, def
->type
, def
, def
->tname
);
583 fprintf(header
, " STDMETHODCALLTYPE ");
584 write_name(header
, def
);
585 fprintf(header
, "(\n");
586 write_args(header
, cur
->args
, iface
->name
, 2, TRUE
);
587 fprintf(header
, ") = 0;\n");
588 fprintf(header
, "\n");
590 cur
= PREV_LINK(cur
);
594 static void do_write_c_method_def(type_t
*iface
, char *name
)
596 func_t
*cur
= iface
->funcs
;
598 if (iface
->ref
) do_write_c_method_def(iface
->ref
, name
);
601 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
603 fprintf(header
, "/*** %s methods ***/\n", iface
->name
);
605 var_t
*def
= cur
->def
;
606 if (!is_callas(def
->attrs
)) {
608 write_type(header
, def
->type
, def
, def
->tname
);
609 fprintf(header
, " (STDMETHODCALLTYPE *");
610 write_name(header
, def
);
611 fprintf(header
, ")(\n");
612 write_args(header
, cur
->args
, name
, 1, TRUE
);
613 fprintf(header
, ");\n");
614 fprintf(header
, "\n");
616 cur
= PREV_LINK(cur
);
620 static void write_c_method_def(type_t
*iface
)
622 do_write_c_method_def(iface
, iface
->name
);
625 static void write_c_disp_method_def(type_t
*iface
)
627 do_write_c_method_def(iface
->ref
, iface
->name
);
630 static void write_method_proto(type_t
*iface
)
632 func_t
*cur
= iface
->funcs
;
635 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
637 var_t
*def
= cur
->def
;
638 var_t
*cas
= is_callas(def
->attrs
);
639 if (!is_local(def
->attrs
)) {
640 /* proxy prototype */
641 write_type(header
, def
->type
, def
, def
->tname
);
642 fprintf(header
, " CALLBACK %s_", iface
->name
);
643 write_name(header
, def
);
644 fprintf(header
, "_Proxy(\n");
645 write_args(header
, cur
->args
, iface
->name
, 1, TRUE
);
646 fprintf(header
, ");\n");
648 fprintf(header
, "void __RPC_STUB %s_", iface
->name
);
649 write_name(header
,def
);
650 fprintf(header
, "_Stub(\n");
651 fprintf(header
, " struct IRpcStubBuffer* This,\n");
652 fprintf(header
, " struct IRpcChannelBuffer* pRpcChannelBuffer,\n");
653 fprintf(header
, " PRPC_MESSAGE pRpcMessage,\n");
654 fprintf(header
, " DWORD* pdwStubPhase);\n");
657 func_t
*m
= iface
->funcs
;
658 while (m
&& strcmp(get_name(m
->def
), cas
->name
))
661 var_t
*mdef
= m
->def
;
662 /* proxy prototype - use local prototype */
663 write_type(header
, mdef
->type
, mdef
, mdef
->tname
);
664 fprintf(header
, " CALLBACK %s_", iface
->name
);
665 write_name(header
, mdef
);
666 fprintf(header
, "_Proxy(\n");
667 write_args(header
, m
->args
, iface
->name
, 1, TRUE
);
668 fprintf(header
, ");\n");
669 /* stub prototype - use remotable prototype */
670 write_type(header
, def
->type
, def
, def
->tname
);
671 fprintf(header
, " __RPC_STUB %s_", iface
->name
);
672 write_name(header
, mdef
);
673 fprintf(header
, "_Stub(\n");
674 write_args(header
, cur
->args
, iface
->name
, 1, TRUE
);
675 fprintf(header
, ");\n");
678 yywarning("invalid call_as attribute (%s -> %s)\n", get_name(def
), cas
->name
);
682 cur
= PREV_LINK(cur
);
686 static void write_function_proto(type_t
*iface
)
688 int explicit_handle
= is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
);
689 var_t
* explicit_handle_var
;
691 func_t
*cur
= iface
->funcs
;
692 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
694 var_t
*def
= cur
->def
;
696 /* check for a defined binding handle */
697 explicit_handle_var
= get_explicit_handle_var(cur
);
698 if (explicit_handle
) {
699 if (!explicit_handle_var
) {
700 error("%s() does not define an explicit binding handle!\n", def
->name
);
704 if (explicit_handle_var
) {
705 error("%s() must not define a binding handle!\n", def
->name
);
710 /* FIXME: do we need to handle call_as? */
711 write_type(header
, def
->type
, def
, def
->tname
);
712 fprintf(header
, " ");
713 write_name(header
, def
);
714 fprintf(header
, "(\n");
715 write_args(header
, cur
->args
, iface
->name
, 0, TRUE
);
716 fprintf(header
, ");\n");
718 cur
= PREV_LINK(cur
);
722 void write_forward(type_t
*iface
)
724 /* C/C++ forwards should only be written for object interfaces, so if we
725 * have a full definition we only write one if we find [object] among the
726 * attributes - however, if we don't have a full definition at this point
727 * (i.e. this is an IDL forward), then we also assume that it is an object
728 * interface, since non-object interfaces shouldn't need forwards */
729 if ((!iface
->defined
|| is_object(iface
->attrs
) || is_attr(iface
->attrs
, ATTR_DISPINTERFACE
))
730 && !iface
->written
) {
731 fprintf(header
,"#ifndef __%s_FWD_DEFINED__\n", iface
->name
);
732 fprintf(header
,"#define __%s_FWD_DEFINED__\n", iface
->name
);
733 fprintf(header
, "typedef struct %s %s;\n", iface
->name
, iface
->name
);
734 fprintf(header
, "#endif\n\n" );
735 iface
->written
= TRUE
;
739 void write_guid(const char *guid_prefix
, const char *name
, UUID
*uuid
)
742 fprintf(header
, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
743 guid_prefix
, name
, uuid
->Data1
, uuid
->Data2
, uuid
->Data3
, uuid
->Data4
[0], uuid
->Data4
[1],
744 uuid
->Data4
[2], uuid
->Data4
[3], uuid
->Data4
[4], uuid
->Data4
[5], uuid
->Data4
[6], uuid
->Data4
[7]);
747 void write_iface_guid(type_t
*iface
)
749 UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
750 write_guid("IID", iface
->name
, uuid
);
753 void write_dispiface_guid(type_t
*iface
)
755 UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
756 write_guid("DIID", iface
->name
, uuid
);
759 void write_coclass_guid(class_t
*cocl
)
761 UUID
*uuid
= get_attrp(cocl
->attrs
, ATTR_UUID
);
762 write_guid("CLSID", cocl
->name
, uuid
);
765 void write_com_interface(type_t
*iface
)
767 if (!iface
->funcs
&& !iface
->ref
) {
768 yywarning("%s has no methods", iface
->name
);
772 fprintf(header
, "/*****************************************************************************\n");
773 fprintf(header
, " * %s interface\n", iface
->name
);
774 fprintf(header
, " */\n");
775 fprintf(header
,"#ifndef __%s_INTERFACE_DEFINED__\n", iface
->name
);
776 fprintf(header
,"#define __%s_INTERFACE_DEFINED__\n\n", iface
->name
);
777 write_iface_guid(iface
);
778 write_forward(iface
);
780 fprintf(header
, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
783 fprintf(header
, "struct %s : public %s\n", iface
->name
, iface
->ref
->name
);
784 fprintf(header
, "{\n");
786 write_cpp_method_def(iface
);
788 fprintf(header
, "};\n");
792 fprintf(header
, "struct %s\n", iface
->name
);
793 fprintf(header
, "{\n");
794 fprintf(header
, " BEGIN_INTERFACE\n");
795 fprintf(header
, "\n");
797 write_cpp_method_def(iface
);
799 fprintf(header
, " END_INTERFACE\n");
800 fprintf(header
, "};\n");
802 fprintf(header
, "#else\n");
804 fprintf(header
, "typedef struct %sVtbl %sVtbl;\n", iface
->name
, iface
->name
);
805 fprintf(header
, "struct %s {\n", iface
->name
);
806 fprintf(header
, " const %sVtbl* lpVtbl;\n", iface
->name
);
807 fprintf(header
, "};\n");
808 fprintf(header
, "struct %sVtbl {\n", iface
->name
);
810 fprintf(header
, " BEGIN_INTERFACE\n");
811 fprintf(header
, "\n");
812 write_c_method_def(iface
);
814 fprintf(header
, " END_INTERFACE\n");
815 fprintf(header
, "};\n");
816 fprintf(header
, "\n");
817 fprintf(header
, "#ifdef COBJMACROS\n");
818 write_method_macro(iface
, iface
->name
);
819 fprintf(header
, "#endif\n");
820 fprintf(header
, "\n");
821 fprintf(header
, "#endif\n");
822 fprintf(header
, "\n");
823 write_method_proto(iface
);
824 fprintf(header
,"\n#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface
->name
);
827 void write_rpc_interface(type_t
*iface
)
829 unsigned long ver
= get_attrv(iface
->attrs
, ATTR_VERSION
);
830 char *var
= get_attrp(iface
->attrs
, ATTR_IMPLICIT_HANDLE
);
832 if (!iface
->funcs
) return;
834 fprintf(header
, "/*****************************************************************************\n");
835 fprintf(header
, " * %s interface (v%d.%d)\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
836 fprintf(header
, " */\n");
837 write_iface_guid(iface
);
840 fprintf(header
, "extern handle_t %s;\n", var
);
842 fprintf(header
, "extern RPC_IF_HANDLE %s_v%d_%d_c_ifspec;\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
843 fprintf(header
, "extern RPC_IF_HANDLE %s_v%d_%d_s_ifspec;\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
844 write_function_proto(iface
);
845 fprintf(header
, "\n");
847 /* FIXME: server/client code */
850 void write_interface(type_t
*iface
)
852 if (is_object(iface
->attrs
))
853 write_com_interface(iface
);
855 write_rpc_interface(iface
);
858 void write_dispinterface(type_t
*iface
)
860 fprintf(header
, "/*****************************************************************************\n");
861 fprintf(header
, " * %s dispinterface\n", iface
->name
);
862 fprintf(header
, " */\n");
863 fprintf(header
,"#ifndef __%s_DISPINTERFACE_DEFINED__\n", iface
->name
);
864 fprintf(header
,"#define __%s_DISPINTERFACE_DEFINED__\n\n", iface
->name
);
865 write_dispiface_guid(iface
);
866 write_forward(iface
);
868 fprintf(header
, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
869 fprintf(header
, "struct %s : public %s\n", iface
->name
, iface
->ref
->name
);
870 fprintf(header
, "{\n");
871 fprintf(header
, "};\n");
872 fprintf(header
, "#else\n");
874 fprintf(header
, "typedef struct %sVtbl %sVtbl;\n", iface
->name
, iface
->name
);
875 fprintf(header
, "struct %s {\n", iface
->name
);
876 fprintf(header
, " const %sVtbl* lpVtbl;\n", iface
->name
);
877 fprintf(header
, "};\n");
878 fprintf(header
, "struct %sVtbl {\n", iface
->name
);
880 fprintf(header
, " BEGIN_INTERFACE\n");
881 fprintf(header
, "\n");
882 write_c_disp_method_def(iface
);
884 fprintf(header
, " END_INTERFACE\n");
885 fprintf(header
, "};\n");
886 fprintf(header
, "\n");
887 fprintf(header
, "#ifdef COBJMACROS\n");
888 write_method_macro(iface
->ref
, iface
->name
);
889 fprintf(header
, "#endif\n");
890 fprintf(header
, "\n");
891 fprintf(header
, "#endif\n");
892 fprintf(header
, "\n");
893 fprintf(header
,"#endif /* __%s_DISPINTERFACE_DEFINED__ */\n\n", iface
->name
);
896 void write_coclass(class_t
*cocl
)
898 fprintf(header
, "/*****************************************************************************\n");
899 fprintf(header
, " * %s coclass\n", cocl
->name
);
900 fprintf(header
, " */\n\n");
901 write_coclass_guid(cocl
);
902 fprintf(header
, "\n");