Add function prototypes.
Change the way functions are called and either alter their declaration
order or predeclare them so perl can check the prototypes.

diff --git a/tools/winapi/function.pm b/tools/winapi/function.pm
index fbc3475..78a7670 100644
--- a/tools/winapi/function.pm
+++ b/tools/winapi/function.pm
@@ -20,7 +20,7 @@
 
 use strict;
 
-sub new {
+sub new($) {
     my $proto = shift;
     my $class = ref($proto) || $proto;
     my $self  = {};
@@ -29,7 +29,7 @@
     return $self;
 }
 
-sub file {
+sub file($$) {
     my $self = shift;
     my $file = \${$self->{FILE}};
 
@@ -40,7 +40,7 @@
     return $$file;
 }
 
-sub debug_channels {
+sub debug_channels($$) {
     my $self = shift;
     my $debug_channels = \${$self->{DEBUG_CHANNELS}};
 
@@ -51,7 +51,7 @@
     return $$debug_channels;
 }
 
-sub documentation_line {
+sub documentation_line($$) {
     my $self = shift;
     my $documentation_line = \${$self->{DOCUMENTATION_LINE}};
 
@@ -62,7 +62,7 @@
     return $$documentation_line;
 }
 
-sub documentation {
+sub documentation($$) {
     my $self = shift;
     my $documentation = \${$self->{DOCUMENTATION}};
 
@@ -73,7 +73,7 @@
     return $$documentation;
 }
 
-sub function_line {
+sub function_line($$) {
     my $self = shift;
     my $function_line = \${$self->{FUNCTION_LINE}};
 
@@ -84,7 +84,7 @@
     return $$function_line;
 }
 
-sub linkage {
+sub linkage($$) {
     my $self = shift;
     my $linkage = \${$self->{LINKAGE}};
 
@@ -95,7 +95,7 @@
     return $$linkage;
 }
 
-sub return_type {
+sub return_type($$) {
     my $self = shift;
     my $return_type = \${$self->{RETURN_TYPE}};
 
@@ -106,7 +106,7 @@
     return $$return_type;
 }
 
-sub calling_convention {
+sub calling_convention($$) {
     my $self = shift;
     my $calling_convention = \${$self->{CALLING_CONVENTION}};
 
@@ -117,7 +117,7 @@
     return $$calling_convention;
 }
 
-sub internal_name {
+sub internal_name($$) {
     my $self = shift;
     my $internal_name = \${$self->{INTERNAL_NAME}};
 
@@ -128,7 +128,7 @@
     return $$internal_name;
 }
 
-sub argument_types {
+sub argument_types($$) {
     my $self = shift;
     my $argument_types = \${$self->{ARGUMENT_TYPES}};
 
@@ -139,7 +139,7 @@
     return $$argument_types;
 }
 
-sub argument_names {
+sub argument_names($$) {
     my $self = shift;
     my $argument_names = \${$self->{ARGUMENT_NAMES}};
 
@@ -150,7 +150,7 @@
     return $$argument_names;
 }
 
-sub argument_documentations {
+sub argument_documentations($$) {
     my $self = shift;
     my $argument_documentations = \${$self->{ARGUMENT_DOCUMENTATIONS}};
 
@@ -161,7 +161,7 @@
     return $$argument_documentations;
 }
 
-sub statements_line {
+sub statements_line($$) {
     my $self = shift;
     my $statements_line = \${$self->{STATEMENTS_LINE}};
 
@@ -172,7 +172,7 @@
     return $$statements_line;
 }
 
-sub statements {
+sub statements($$) {
     my $self = shift;
     my $statements = \${$self->{STATEMENTS}};