Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
63522122
Commit
63522122
authored
Jan 10, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jan 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for the help* attributes on type libraries.
parent
5d303100
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
7 deletions
+71
-7
parser.l
tools/widl/parser.l
+4
-0
parser.y
tools/widl/parser.y
+6
-1
widltypes.h
tools/widl/widltypes.h
+4
-0
write_msft.c
tools/widl/write_msft.c
+57
-6
No files found.
tools/widl/parser.l
View file @
63522122
...
...
@@ -226,7 +226,11 @@ static struct keyword {
{"handle", tHANDLE},
{"handle_t", tHANDLET},
/* ... */
{"helpcontext", tHELPCONTEXT},
{"helpfile", tHELPFILE},
{"helpstring", tHELPSTRING},
{"helpstringcontext", tHELPSTRINGCONTEXT},
{"helpstringdll", tHELPSTRINGDLL},
/* ... */
{"hidden", tHIDDEN},
{"hyper", tHYPER},
...
...
tools/widl/parser.y
View file @
63522122
...
...
@@ -142,7 +142,8 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tFLOAT
%token tHANDLE
%token tHANDLET
%token tHELPSTRING
%token tHELPCONTEXT tHELPFILE
%token tHELPSTRING tHELPSTRINGCONTEXT tHELPSTRINGDLL
%token tHIDDEN
%token tHYPER tID tIDEMPOTENT
%token tIIDIS
...
...
@@ -358,7 +359,11 @@ attribute:
| tENTRY '(' aSTRING ')' { $$ = make_attrp(ATTR_ENTRY_STRING, $3); }
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY_ORDINAL, $3); }
| tHANDLE { $$ = make_attr(ATTR_HANDLE); }
| tHELPCONTEXT '(' expr_const ')' { $$ = make_attrp(ATTR_HELPCONTEXT, $3); }
| tHELPFILE '(' aSTRING ')' { $$ = make_attrp(ATTR_HELPFILE, $3); }
| tHELPSTRING '(' aSTRING ')' { $$ = make_attrp(ATTR_HELPSTRING, $3); }
| tHELPSTRINGCONTEXT '(' expr_const ')' { $$ = make_attrp(ATTR_HELPSTRINGCONTEXT, $3); }
| tHELPSTRINGDLL '(' aSTRING ')' { $$ = make_attrp(ATTR_HELPSTRINGDLL, $3); }
| tHIDDEN { $$ = make_attr(ATTR_HIDDEN); }
| tID '(' expr_const ')' { $$ = make_attrp(ATTR_ID, $3); }
| tIDEMPOTENT { $$ = make_attr(ATTR_IDEMPOTENT); }
...
...
tools/widl/widltypes.h
View file @
63522122
...
...
@@ -70,7 +70,11 @@ enum attr_type
ATTR_ENTRY_STRING
,
ATTR_ENTRY_ORDINAL
,
ATTR_HANDLE
,
ATTR_HELPCONTEXT
,
ATTR_HELPFILE
,
ATTR_HELPSTRING
,
ATTR_HELPSTRINGCONTEXT
,
ATTR_HELPSTRINGDLL
,
ATTR_HIDDEN
,
ATTR_ID
,
ATTR_IDEMPOTENT
,
...
...
tools/widl/write_msft.c
View file @
63522122
...
...
@@ -91,6 +91,8 @@ typedef struct _msft_typelib_t
INT
*
typelib_namehash_segment
;
INT
*
typelib_guidhash_segment
;
INT
help_string_dll_offset
;
struct
_msft_typeinfo_t
*
typeinfos
;
struct
_msft_typeinfo_t
*
last_typeinfo
;
}
msft_typelib_t
;
...
...
@@ -1460,10 +1462,54 @@ static void set_doc_string(msft_typelib_t *typelib)
static
void
set_help_file_name
(
msft_typelib_t
*
typelib
)
{
int
offset
;
offset
=
ctl2_alloc_string
(
typelib
,
"help file name"
);
if
(
offset
==
-
1
)
return
;
typelib
->
typelib_header
.
helpfile
=
offset
;
typelib
->
typelib_header
.
varflags
|=
0x10
;
attr_t
*
attr
;
for
(
attr
=
typelib
->
typelib
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
if
(
attr
->
type
==
ATTR_HELPFILE
)
{
offset
=
ctl2_alloc_string
(
typelib
,
attr
->
u
.
pval
);
if
(
offset
==
-
1
)
return
;
typelib
->
typelib_header
.
helpfile
=
offset
;
typelib
->
typelib_header
.
varflags
|=
0x10
;
}
}
return
;
}
static
void
set_help_context
(
msft_typelib_t
*
typelib
)
{
attr_t
*
attr
;
for
(
attr
=
typelib
->
typelib
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
if
(
attr
->
type
==
ATTR_HELPCONTEXT
)
{
expr_t
*
expr
=
(
expr_t
*
)
attr
->
u
.
pval
;
typelib
->
typelib_header
.
helpcontext
=
expr
->
cval
;
}
}
return
;
}
static
void
set_help_string_dll
(
msft_typelib_t
*
typelib
)
{
int
offset
;
attr_t
*
attr
;
for
(
attr
=
typelib
->
typelib
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
if
(
attr
->
type
==
ATTR_HELPSTRINGDLL
)
{
offset
=
ctl2_alloc_string
(
typelib
,
attr
->
u
.
pval
);
if
(
offset
==
-
1
)
return
;
typelib
->
help_string_dll_offset
=
offset
;
typelib
->
typelib_header
.
varflags
|=
0x100
;
}
}
return
;
}
static
void
set_help_string_context
(
msft_typelib_t
*
typelib
)
{
attr_t
*
attr
;
for
(
attr
=
typelib
->
typelib
->
attrs
;
attr
;
attr
=
NEXT_LINK
(
attr
))
{
if
(
attr
->
type
==
ATTR_HELPSTRINGCONTEXT
)
{
expr_t
*
expr
=
(
expr_t
*
)
attr
->
u
.
pval
;
typelib
->
typelib_header
.
helpstringcontext
=
expr
->
cval
;
}
}
return
;
}
...
...
@@ -1570,6 +1616,7 @@ static int save_all_changes(msft_typelib_t *typelib)
if
(
fd
==
-
1
)
return
retval
;
filepos
=
sizeof
(
MSFT_Header
)
+
sizeof
(
MSFT_SegDir
);
if
(
typelib
->
typelib_header
.
varflags
&
0x100
)
filepos
+=
4
;
/* helpstringdll */
filepos
+=
typelib
->
typelib_header
.
nrtypeinfos
*
4
;
filepos
+=
ctl2_finalize_segment
(
typelib
,
filepos
,
MSFT_SEG_TYPEINFO
);
...
...
@@ -1589,6 +1636,7 @@ static int save_all_changes(msft_typelib_t *typelib)
ctl2_finalize_typeinfos
(
typelib
,
filepos
);
if
(
!
ctl2_write_chunk
(
fd
,
&
typelib
->
typelib_header
,
sizeof
(
typelib
->
typelib_header
)))
return
retval
;
if
(
!
ctl2_write_chunk
(
fd
,
&
typelib
->
help_string_dll_offset
,
sizeof
(
typelib
->
help_string_dll_offset
)))
return
retval
;
if
(
!
ctl2_write_chunk
(
fd
,
typelib
->
typelib_typeinfo_offsets
,
typelib
->
typelib_header
.
nrtypeinfos
*
4
))
return
retval
;
if
(
!
ctl2_write_chunk
(
fd
,
&
typelib
->
typelib_segdir
,
sizeof
(
typelib
->
typelib_segdir
)))
return
retval
;
if
(
!
ctl2_write_segment
(
typelib
,
fd
,
MSFT_SEG_TYPEINFO
))
return
retval
;
...
...
@@ -1649,12 +1697,15 @@ int create_msft_typelib(typelib_t *typelib)
set_lib_flags
(
msft
);
set_lcid
(
msft
);
/* set_help_file_name(msft);*/
set_help_file_name
(
msft
);
set_doc_string
(
msft
);
set_guid
(
msft
);
set_version
(
msft
);
set_name
(
msft
);
set_help_context
(
msft
);
set_help_string_dll
(
msft
);
set_help_string_context
(
msft
);
typelib_idx
=
0
;
for
(
entry
=
typelib
->
entry
;
NEXT_LINK
(
entry
);
entry
=
NEXT_LINK
(
entry
))
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment