function.pm 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #
  2. # Copyright 1999, 2000, 2001 Patrik Stridvall
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2.1 of the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. #
  18. package function;
  19. use strict;
  20. use warnings 'all';
  21. sub new($) {
  22. my $proto = shift;
  23. my $class = ref($proto) || $proto;
  24. my $self = {};
  25. bless ($self, $class);
  26. return $self;
  27. }
  28. sub file($$) {
  29. my $self = shift;
  30. my $file = \${$self->{FILE}};
  31. local $_ = shift;
  32. if(defined($_)) { $$file = $_; }
  33. return $$file;
  34. }
  35. sub debug_channels($$) {
  36. my $self = shift;
  37. my $debug_channels = \${$self->{DEBUG_CHANNELS}};
  38. local $_ = shift;
  39. if(defined($_)) { $$debug_channels = $_; }
  40. return $$debug_channels;
  41. }
  42. sub documentation_line($$) {
  43. my $self = shift;
  44. my $documentation_line = \${$self->{DOCUMENTATION_LINE}};
  45. local $_ = shift;
  46. if(defined($_)) { $$documentation_line = $_; }
  47. return $$documentation_line;
  48. }
  49. sub documentation($$) {
  50. my $self = shift;
  51. my $documentation = \${$self->{DOCUMENTATION}};
  52. local $_ = shift;
  53. if(defined($_)) { $$documentation = $_; }
  54. return $$documentation;
  55. }
  56. sub function_line($$) {
  57. my $self = shift;
  58. my $function_line = \${$self->{FUNCTION_LINE}};
  59. local $_ = shift;
  60. if(defined($_)) { $$function_line = $_; }
  61. return $$function_line;
  62. }
  63. sub linkage($$) {
  64. my $self = shift;
  65. my $linkage = \${$self->{LINKAGE}};
  66. local $_ = shift;
  67. if(defined($_)) { $$linkage = $_; }
  68. return $$linkage;
  69. }
  70. sub return_type($$) {
  71. my $self = shift;
  72. my $return_type = \${$self->{RETURN_TYPE}};
  73. local $_ = shift;
  74. if(defined($_)) { $$return_type = $_; }
  75. return $$return_type;
  76. }
  77. sub calling_convention($$) {
  78. my $self = shift;
  79. my $calling_convention = \${$self->{CALLING_CONVENTION}};
  80. local $_ = shift;
  81. if(defined($_)) { $$calling_convention = $_; }
  82. return $$calling_convention;
  83. }
  84. sub internal_name($$) {
  85. my $self = shift;
  86. my $internal_name = \${$self->{INTERNAL_NAME}};
  87. local $_ = shift;
  88. if(defined($_)) { $$internal_name = $_; }
  89. return $$internal_name;
  90. }
  91. sub argument_types($$) {
  92. my $self = shift;
  93. my $argument_types = \${$self->{ARGUMENT_TYPES}};
  94. local $_ = shift;
  95. if(defined($_)) { $$argument_types = $_; }
  96. return $$argument_types;
  97. }
  98. sub argument_names($$) {
  99. my $self = shift;
  100. my $argument_names = \${$self->{ARGUMENT_NAMES}};
  101. local $_ = shift;
  102. if(defined($_)) { $$argument_names = $_; }
  103. return $$argument_names;
  104. }
  105. sub argument_documentations($$) {
  106. my $self = shift;
  107. my $argument_documentations = \${$self->{ARGUMENT_DOCUMENTATIONS}};
  108. local $_ = shift;
  109. if(defined($_)) { $$argument_documentations = $_; }
  110. return $$argument_documentations;
  111. }
  112. sub statements_line($$) {
  113. my $self = shift;
  114. my $statements_line = \${$self->{STATEMENTS_LINE}};
  115. local $_ = shift;
  116. if(defined($_)) { $$statements_line = $_; }
  117. return $$statements_line;
  118. }
  119. sub statements($$) {
  120. my $self = shift;
  121. my $statements = \${$self->{STATEMENTS}};
  122. local $_ = shift;
  123. if(defined($_)) { $$statements = $_; }
  124. return $$statements;
  125. }
  126. 1;