-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fake Win32API::Registry to test under linux
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package Win32API::Registry; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my @Types = qw( | ||
REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD REG_DWORD_BIG_ENDIAN | ||
REG_LINK REG_MULTI_SZ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR | ||
REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD | ||
); | ||
|
||
my $constant_index = 0 ; | ||
my %constants = map { $_ => $constant_index++ } @Types; | ||
|
||
sub constant { | ||
my ($constant) = @_ ; | ||
|
||
return $constants{$constant} if exists($constants{$constant}); | ||
} | ||
|
||
1; |