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
39 static int indentation
= 0;
41 static void indent(int delta
)
44 if (delta
< 0) indentation
+= delta
;
45 for (c
=0; c
<indentation
; c
++) fprintf(header
, " ");
46 if (delta
> 0) indentation
+= delta
;
49 int is_attr(attr_t
*a
, enum attr_type t
)
52 if (a
->type
== t
) return 1;
58 void *get_attrp(attr_t
*a
, enum attr_type t
)
61 if (a
->type
== t
) return a
->u
.pval
;
67 unsigned long get_attrv(attr_t
*a
, enum attr_type t
)
70 if (a
->type
== t
) return a
->u
.ival
;
76 int is_void(type_t
*t
, var_t
*v
)
78 if (v
&& v
->ptr_level
) return 0;
79 if (!t
->type
&& !t
->ref
) return 1;
83 void write_guid(const char *guid_prefix
, const char *name
, UUID
*uuid
)
86 fprintf(header
, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
87 "0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
88 guid_prefix
, name
, uuid
->Data1
, uuid
->Data2
, uuid
->Data3
, uuid
->Data4
[0],
89 uuid
->Data4
[1], uuid
->Data4
[2], uuid
->Data4
[3], uuid
->Data4
[4], uuid
->Data4
[5],
90 uuid
->Data4
[6], uuid
->Data4
[7]);
93 static void write_pident(FILE *h
, var_t
*v
)
96 for (c
=0; c
<v
->ptr_level
; c
++) {
99 if (v
->name
) fprintf(h
, "%s", v
->name
);
102 void write_name(FILE *h
, var_t
*v
)
104 if (is_attr( v
->attrs
, ATTR_PROPGET
))
106 else if (is_attr( v
->attrs
, ATTR_PROPPUT
))
108 fprintf(h
, "%s", v
->name
);
111 char* get_name(var_t
*v
)
116 static void write_array(FILE *h
, expr_t
*v
, int field
)
119 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
123 fprintf(h
, "%ld", v
->cval
); /* statically sized array */
125 if (field
) fprintf(h
, "1"); /* dynamically sized array */
133 static void write_field(FILE *h
, var_t
*v
)
138 write_type(h
, v
->type
, NULL
, v
->tname
);
144 /* not all C/C++ compilers support anonymous structs and unions */
145 switch (v
->type
->type
) {
147 case RPC_FC_CVSTRUCT
:
148 case RPC_FC_CPSTRUCT
:
151 case RPC_FC_BOGUS_STRUCT
:
152 case RPC_FC_ENCAPSULATED_UNION
:
153 fprintf(h
, " DUMMYSTRUCTNAME");
155 case RPC_FC_NON_ENCAPSULATED_UNION
:
156 fprintf(h
, " DUMMYUNIONNAME");
163 write_array(h
, v
->array
, 1);
168 static void write_fields(FILE *h
, var_t
*v
)
172 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
175 if (v
== first
) break;
180 static void write_enums(FILE *h
, var_t
*v
)
183 while (NEXT_LINK(v
)) v
= NEXT_LINK(v
);
190 write_expr(h
, v
->eval
);
200 void write_type(FILE *h
, type_t
*t
, var_t
*v
, char *n
)
204 if (n
) fprintf(h
, "%s", n
);
206 if (t
->is_const
) fprintf(h
, "const ");
208 if (t
->sign
> 0) fprintf(h
, "signed ");
209 else if (t
->sign
< 0) fprintf(h
, "unsigned ");
212 if (t
->ref
) fprintf(h
, t
->ref
->name
);
213 else fprintf(h
, "byte");
216 if (t
->ref
) fprintf(h
, t
->ref
->name
);
217 else fprintf(h
, "char");
220 fprintf(h
, "wchar_t");
224 if (t
->ref
) fprintf(h
, t
->ref
->name
);
225 else fprintf(h
, "short");
229 if (t
->ref
) fprintf(h
, t
->ref
->name
);
230 else fprintf(h
, "long");
233 if (t
->ref
) fprintf(h
, t
->ref
->name
);
234 else fprintf(h
, "hyper");
240 fprintf(h
, "double");
244 if (t
->defined
&& !t
->written
) {
245 if (t
->name
) fprintf(h
, "enum %s {\n", t
->name
);
246 else fprintf(h
, "enum {\n");
249 write_enums(h
, t
->fields
);
253 else fprintf(h
, "enum %s", t
->name
);
255 case RPC_FC_ERROR_STATUS_T
:
256 if (t
->ref
) fprintf(h
, t
->ref
->name
);
257 else fprintf(h
, "error_status_t");
259 case RPC_FC_BIND_PRIMITIVE
:
260 if (t
->ref
) fprintf(h
, t
->ref
->name
);
261 else fprintf(h
, "handle_t");
264 case RPC_FC_CVSTRUCT
:
265 case RPC_FC_CPSTRUCT
:
268 case RPC_FC_BOGUS_STRUCT
:
269 case RPC_FC_ENCAPSULATED_UNION
:
270 if (t
->defined
&& !t
->written
) {
271 if (t
->name
) fprintf(h
, "struct %s {\n", t
->name
);
272 else fprintf(h
, "struct {\n");
275 write_fields(h
, t
->fields
);
279 else fprintf(h
, "struct %s", t
->name
);
281 case RPC_FC_NON_ENCAPSULATED_UNION
:
282 if (t
->defined
&& !t
->written
) {
283 if (t
->name
) fprintf(h
, "union %s {\n", t
->name
);
284 else fprintf(h
, "union {\n");
287 write_fields(h
, t
->fields
);
291 else fprintf(h
, "union %s", t
->name
);
294 fprintf(h
, "(unknown-type:%d)", t
->type
);
299 write_type(h
, t
->ref
, NULL
, t
->name
);
301 else fprintf(h
, "void");
305 for (c
=0; c
<v
->ptr_level
; c
++) {
311 void write_typedef(type_t
*type
, var_t
*names
)
313 char *tname
= names
->tname
;
315 while (NEXT_LINK(names
)) names
= NEXT_LINK(names
);
317 fprintf(header
, "typedef ");
318 write_type(header
, type
, NULL
, tname
);
319 fprintf(header
, " ");
321 write_pident(header
, names
);
322 if (PREV_LINK(names
))
323 fprintf(header
, ", ");
324 names
= PREV_LINK(names
);
326 fprintf(header
, ";\n");
328 if (get_attrp(type
->attrs
, ATTR_WIREMARSHAL
)) {
331 char *name
= get_name(names
);
332 fprintf(header
, "unsigned long __RPC_USER %s_UserSize (unsigned long *, unsigned long, %s *);\n", name
, name
);
333 fprintf(header
, "unsigned char * __RPC_USER %s_UserMarshal (unsigned long *, unsigned char *, %s *);\n", name
, name
);
334 fprintf(header
, "unsigned char * __RPC_USER %s_UserUnmarshal(unsigned long *, unsigned char *, %s *);\n", name
, name
);
335 fprintf(header
, "void __RPC_USER %s_UserFree (unsigned long *, %s *);\n", name
, name
);
336 if (PREV_LINK(names
))
337 fprintf(header
, ", ");
338 names
= PREV_LINK(names
);
342 fprintf(header
, "\n");
345 static void do_write_expr(FILE *h
, expr_t
*e
, int p
)
351 fprintf(h
, "%ld", e
->u
.lval
);
354 fprintf(h
, "0x%lx", e
->u
.lval
);
356 case EXPR_IDENTIFIER
:
357 fprintf(h
, "%s", e
->u
.sval
);
361 do_write_expr(h
, e
->ref
, 1);
365 do_write_expr(h
, e
->ref
, 1);
369 do_write_expr(h
, e
->ref
, 1);
373 write_type(h
, e
->u
.tref
->ref
, NULL
, e
->u
.tref
->name
);
375 do_write_expr(h
, e
->ref
, 1);
378 fprintf(h
, "sizeof(");
379 write_type(h
, e
->u
.tref
->ref
, NULL
, e
->u
.tref
->name
);
390 if (p
) fprintf(h
, "(");
391 do_write_expr(h
, e
->ref
, 1);
393 case EXPR_SHL
: fprintf(h
, " << "); break;
394 case EXPR_SHR
: fprintf(h
, " >> "); break;
395 case EXPR_MUL
: fprintf(h
, " * "); break;
396 case EXPR_DIV
: fprintf(h
, " / "); break;
397 case EXPR_ADD
: fprintf(h
, " + "); break;
398 case EXPR_SUB
: fprintf(h
, " - "); break;
399 case EXPR_AND
: fprintf(h
, " & "); break;
400 case EXPR_OR
: fprintf(h
, " | "); break;
403 do_write_expr(h
, e
->u
.ext
, 1);
404 if (p
) fprintf(h
, ")");
407 if (p
) fprintf(h
, "(");
408 do_write_expr(h
, e
->ref
, 1);
410 do_write_expr(h
, e
->u
.ext
, 1);
412 do_write_expr(h
, e
->ext2
, 1);
413 if (p
) fprintf(h
, ")");
418 void write_expr(FILE *h
, expr_t
*e
)
420 do_write_expr(h
, e
, 0);
423 void write_constdef(var_t
*v
)
425 fprintf(header
, "#define %s (", get_name(v
));
426 write_expr(header
, v
->eval
);
427 fprintf(header
, ")\n\n");
430 void write_externdef(var_t
*v
)
432 fprintf(header
, "extern const ");
433 write_type(header
, v
->type
, NULL
, v
->tname
);
435 fprintf(header
, " ");
436 write_pident(header
, v
);
438 fprintf(header
, ";\n\n");
441 void write_library(char *name
, attr_t
*attr
) {
442 UUID
*uuid
= get_attrp(attr
, ATTR_UUID
);
443 fprintf(header
, "\n");
444 write_guid("LIBID", name
, uuid
);
445 fprintf(header
, "\n");
448 /********** INTERFACES **********/
450 int is_object(attr_t
*a
)
453 if (a
->type
== ATTR_OBJECT
|| a
->type
== ATTR_ODL
) return 1;
459 int is_local(attr_t
*a
)
461 return is_attr(a
, ATTR_LOCAL
);
464 var_t
*is_callas(attr_t
*a
)
466 return get_attrp(a
, ATTR_CALLAS
);
469 static int write_method_macro(type_t
*iface
, char *name
)
472 func_t
*cur
= iface
->funcs
;
474 if (iface
->ref
) idx
= write_method_macro(iface
->ref
, name
);
477 if (!cur
) return idx
;
478 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
480 fprintf(header
, "/*** %s methods ***/\n", iface
->name
);
482 var_t
*def
= cur
->def
;
483 if (!is_callas(def
->attrs
)) {
484 var_t
*arg
= cur
->args
;
488 arg
= NEXT_LINK(arg
);
492 fprintf(header
, "#define %s_", name
);
493 write_name(header
,def
);
494 fprintf(header
, "(p");
495 for (c
=0; c
<argc
; c
++)
496 fprintf(header
, ",%c", c
+'a');
497 fprintf(header
, ") ");
499 fprintf(header
, "(p)->lpVtbl->");
500 write_name(header
, def
);
501 fprintf(header
, "(p");
502 for (c
=0; c
<argc
; c
++)
503 fprintf(header
, ",%c", c
+'a');
504 fprintf(header
, ")\n");
505 if (cur
->idx
== -1) cur
->idx
= idx
;
506 else if (cur
->idx
!= idx
) yyerror("BUG: method index mismatch in write_method_macro");
509 cur
= PREV_LINK(cur
);
514 void write_args(FILE *h
, var_t
*arg
, char *name
, int method
, int do_indent
)
518 while (NEXT_LINK(arg
))
519 arg
= NEXT_LINK(arg
);
526 } else fprintf(h
, " ");
529 fprintf(h
, "%s* This", name
);
537 if (h
== header
) indent(0);
538 else fprintf(h
, " ");
540 else fprintf(h
, ",");
542 write_type(h
, arg
->type
, arg
, arg
->tname
);
545 fprintf(h
, " (STDMETHODCALLTYPE *");
548 write_args(h
, arg
->args
, NULL
, 0, FALSE
);
556 write_array(h
, arg
->array
, 0);
557 arg
= PREV_LINK(arg
);
560 if (do_indent
&& h
== header
) indentation
--;
563 static void write_cpp_method_def(type_t
*iface
)
565 func_t
*cur
= iface
->funcs
;
568 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
570 var_t
*def
= cur
->def
;
571 if (!is_callas(def
->attrs
)) {
573 fprintf(header
, "virtual ");
574 write_type(header
, def
->type
, def
, def
->tname
);
575 fprintf(header
, " STDMETHODCALLTYPE ");
576 write_name(header
, def
);
577 fprintf(header
, "(\n");
578 write_args(header
, cur
->args
, iface
->name
, 2, TRUE
);
579 fprintf(header
, ") = 0;\n");
580 fprintf(header
, "\n");
582 cur
= PREV_LINK(cur
);
586 static void do_write_c_method_def(type_t
*iface
, char *name
)
588 func_t
*cur
= iface
->funcs
;
590 if (iface
->ref
) do_write_c_method_def(iface
->ref
, name
);
593 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
595 fprintf(header
, "/*** %s methods ***/\n", iface
->name
);
597 var_t
*def
= cur
->def
;
598 if (!is_callas(def
->attrs
)) {
600 write_type(header
, def
->type
, def
, def
->tname
);
601 fprintf(header
, " (STDMETHODCALLTYPE *");
602 write_name(header
, def
);
603 fprintf(header
, ")(\n");
604 write_args(header
, cur
->args
, name
, 1, TRUE
);
605 fprintf(header
, ");\n");
606 fprintf(header
, "\n");
608 cur
= PREV_LINK(cur
);
612 static void write_c_method_def(type_t
*iface
)
614 do_write_c_method_def(iface
, iface
->name
);
617 static void write_c_disp_method_def(type_t
*iface
)
619 do_write_c_method_def(iface
->ref
, iface
->name
);
622 static void write_method_proto(type_t
*iface
)
624 func_t
*cur
= iface
->funcs
;
627 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
629 var_t
*def
= cur
->def
;
630 var_t
*cas
= is_callas(def
->attrs
);
631 if (!is_local(def
->attrs
)) {
632 /* proxy prototype */
633 write_type(header
, def
->type
, def
, def
->tname
);
634 fprintf(header
, " CALLBACK %s_", iface
->name
);
635 write_name(header
, def
);
636 fprintf(header
, "_Proxy(\n");
637 write_args(header
, cur
->args
, iface
->name
, 1, TRUE
);
638 fprintf(header
, ");\n");
640 fprintf(header
, "void __RPC_STUB %s_", iface
->name
);
641 write_name(header
,def
);
642 fprintf(header
, "_Stub(\n");
643 fprintf(header
, " struct IRpcStubBuffer* This,\n");
644 fprintf(header
, " struct IRpcChannelBuffer* pRpcChannelBuffer,\n");
645 fprintf(header
, " PRPC_MESSAGE pRpcMessage,\n");
646 fprintf(header
, " DWORD* pdwStubPhase);\n");
649 func_t
*m
= iface
->funcs
;
650 while (m
&& strcmp(get_name(m
->def
), cas
->name
))
653 var_t
*mdef
= m
->def
;
654 /* proxy prototype - use local prototype */
655 write_type(header
, mdef
->type
, mdef
, mdef
->tname
);
656 fprintf(header
, " CALLBACK %s_", iface
->name
);
657 write_name(header
, mdef
);
658 fprintf(header
, "_Proxy(\n");
659 write_args(header
, m
->args
, iface
->name
, 1, TRUE
);
660 fprintf(header
, ");\n");
661 /* stub prototype - use remotable prototype */
662 write_type(header
, def
->type
, def
, def
->tname
);
663 fprintf(header
, " __RPC_STUB %s_", iface
->name
);
664 write_name(header
, mdef
);
665 fprintf(header
, "_Stub(\n");
666 write_args(header
, cur
->args
, iface
->name
, 1, TRUE
);
667 fprintf(header
, ");\n");
670 yywarning("invalid call_as attribute (%s -> %s)\n", get_name(def
), cas
->name
);
674 cur
= PREV_LINK(cur
);
678 static void write_function_proto(type_t
*iface
)
680 func_t
*cur
= iface
->funcs
;
681 while (NEXT_LINK(cur
)) cur
= NEXT_LINK(cur
);
683 var_t
*def
= cur
->def
;
684 /* FIXME: do we need to handle call_as? */
685 write_type(header
, def
->type
, def
, def
->tname
);
686 fprintf(header
, " ");
687 write_name(header
, def
);
688 fprintf(header
, "(\n");
690 write_args(header
, cur
->args
, iface
->name
, 0, TRUE
);
692 fprintf(header
, " void");
693 fprintf(header
, ");\n");
695 cur
= PREV_LINK(cur
);
699 void write_forward(type_t
*iface
)
701 /* C/C++ forwards should only be written for object interfaces, so if we
702 * have a full definition we only write one if we find [object] among the
703 * attributes - however, if we don't have a full definition at this point
704 * (i.e. this is an IDL forward), then we also assume that it is an object
705 * interface, since non-object interfaces shouldn't need forwards */
706 if ((!iface
->defined
|| is_object(iface
->attrs
) || is_attr(iface
->attrs
, ATTR_DISPINTERFACE
))
707 && !iface
->written
) {
708 fprintf(header
,"#ifndef __%s_FWD_DEFINED__\n", iface
->name
);
709 fprintf(header
,"#define __%s_FWD_DEFINED__\n", iface
->name
);
710 fprintf(header
, "typedef struct %s %s;\n", iface
->name
, iface
->name
);
711 fprintf(header
, "#endif\n\n" );
712 iface
->written
= TRUE
;
716 void write_iface_guid(type_t
*iface
)
718 UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
719 write_guid("IID", iface
->name
, uuid
);
722 void write_dispiface_guid(type_t
*iface
)
724 UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
725 write_guid("DIID", iface
->name
, uuid
);
728 void write_coclass_guid(class_t
*cocl
)
730 UUID
*uuid
= get_attrp(cocl
->attrs
, ATTR_UUID
);
731 write_guid("CLSID", cocl
->name
, uuid
);
734 void write_com_interface(type_t
*iface
)
736 if (!iface
->funcs
&& !iface
->ref
) {
737 yywarning("%s has no methods", iface
->name
);
741 fprintf(header
, "/*****************************************************************************\n");
742 fprintf(header
, " * %s interface\n", iface
->name
);
743 fprintf(header
, " */\n");
744 fprintf(header
,"#ifndef __%s_INTERFACE_DEFINED__\n", iface
->name
);
745 fprintf(header
,"#define __%s_INTERFACE_DEFINED__\n\n", iface
->name
);
746 write_iface_guid(iface
);
747 write_forward(iface
);
749 fprintf(header
, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
752 fprintf(header
, "struct %s : public %s\n", iface
->name
, iface
->ref
->name
);
753 fprintf(header
, "{\n");
755 write_cpp_method_def(iface
);
757 fprintf(header
, "};\n");
761 fprintf(header
, "struct %s\n", iface
->name
);
762 fprintf(header
, "{\n");
763 fprintf(header
, " BEGIN_INTERFACE\n");
764 fprintf(header
, "\n");
766 write_cpp_method_def(iface
);
768 fprintf(header
, " END_INTERFACE\n");
769 fprintf(header
, "};\n");
771 fprintf(header
, "#else\n");
773 fprintf(header
, "typedef struct %sVtbl %sVtbl;\n", iface
->name
, iface
->name
);
774 fprintf(header
, "struct %s {\n", iface
->name
);
775 fprintf(header
, " const %sVtbl* lpVtbl;\n", iface
->name
);
776 fprintf(header
, "};\n");
777 fprintf(header
, "struct %sVtbl {\n", iface
->name
);
779 fprintf(header
, " BEGIN_INTERFACE\n");
780 fprintf(header
, "\n");
781 write_c_method_def(iface
);
783 fprintf(header
, " END_INTERFACE\n");
784 fprintf(header
, "};\n");
785 fprintf(header
, "\n");
786 fprintf(header
, "#ifdef COBJMACROS\n");
787 write_method_macro(iface
, iface
->name
);
788 fprintf(header
, "#endif\n");
789 fprintf(header
, "\n");
790 fprintf(header
, "#endif\n");
791 fprintf(header
, "\n");
792 write_method_proto(iface
);
793 fprintf(header
,"\n#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface
->name
);
796 void write_rpc_interface(type_t
*iface
)
798 unsigned long ver
= get_attrv(iface
->attrs
, ATTR_VERSION
);
799 char *var
= get_attrp(iface
->attrs
, ATTR_IMPLICIT_HANDLE
);
801 if (!iface
->funcs
) return;
803 fprintf(header
, "/*****************************************************************************\n");
804 fprintf(header
, " * %s interface (v%d.%d)\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
805 fprintf(header
, " */\n");
806 write_iface_guid(iface
);
807 if (var
) fprintf(header
, "extern handle_t %s;\n", var
);
808 fprintf(header
, "extern RPC_IF_HANDLE %s_v%d_%d_c_ifspec;\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
809 fprintf(header
, "extern RPC_IF_HANDLE %s_v%d_%d_s_ifspec;\n", iface
->name
, LOWORD(ver
), HIWORD(ver
));
810 write_function_proto(iface
);
811 fprintf(header
, "\n");
813 /* FIXME: server/client code */
816 void write_interface(type_t
*iface
)
818 if (is_object(iface
->attrs
))
819 write_com_interface(iface
);
821 write_rpc_interface(iface
);
824 void write_dispinterface(type_t
*iface
)
826 fprintf(header
, "/*****************************************************************************\n");
827 fprintf(header
, " * %s dispinterface\n", iface
->name
);
828 fprintf(header
, " */\n");
829 fprintf(header
,"#ifndef __%s_DISPINTERFACE_DEFINED__\n", iface
->name
);
830 fprintf(header
,"#define __%s_DISPINTERFACE_DEFINED__\n\n", iface
->name
);
831 write_dispiface_guid(iface
);
832 write_forward(iface
);
834 fprintf(header
, "#if defined(__cplusplus) && !defined(CINTERFACE)\n");
835 fprintf(header
, "struct %s : public %s\n", iface
->name
, iface
->ref
->name
);
836 fprintf(header
, "{\n");
837 fprintf(header
, "};\n");
838 fprintf(header
, "#else\n");
840 fprintf(header
, "typedef struct %sVtbl %sVtbl;\n", iface
->name
, iface
->name
);
841 fprintf(header
, "struct %s {\n", iface
->name
);
842 fprintf(header
, " const %sVtbl* lpVtbl;\n", iface
->name
);
843 fprintf(header
, "};\n");
844 fprintf(header
, "struct %sVtbl {\n", iface
->name
);
846 fprintf(header
, " BEGIN_INTERFACE\n");
847 fprintf(header
, "\n");
848 write_c_disp_method_def(iface
);
850 fprintf(header
, " END_INTERFACE\n");
851 fprintf(header
, "};\n");
852 fprintf(header
, "\n");
853 fprintf(header
, "#ifdef COBJMACROS\n");
854 write_method_macro(iface
->ref
, iface
->name
);
855 fprintf(header
, "#endif\n");
856 fprintf(header
, "\n");
857 fprintf(header
, "#endif\n");
858 fprintf(header
, "\n");
859 fprintf(header
,"#endif /* __%s_DISPINTERFACE_DEFINED__ */\n\n", iface
->name
);
862 void write_coclass(class_t
*cocl
)
864 fprintf(header
, "/*****************************************************************************\n");
865 fprintf(header
, " * %s coclass\n", cocl
->name
);
866 fprintf(header
, " */\n\n");
867 write_coclass_guid(cocl
);
868 fprintf(header
, "\n");