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. sub new($) {
  21. my $proto = shift;
  22. my $class = ref($proto) || $proto;
  23. my $self = {};
  24. bless ($self, $class);
  25. return $self;
  26. }
  27. sub file($$) {
  28. my $self = shift;
  29. my $file = \${$self->{FILE}};
  30. local $_ = shift;
  31. if(defined($_)) { $$file = $_; }
  32. return $$file;
  33. }
  34. sub debug_channels($$) {
  35. my $self = shift;
  36. my $debug_channels = \${$self->{DEBUG_CHANNELS}};
  37. local $_ = shift;
  38. if(defined($_)) { $$debug_channels = $_; }
  39. return $$debug_channels;
  40. }
  41. sub documentation_line($$) {
  42. my $self = shift;
  43. my $documentation_line = \${$self->{DOCUMENTATION_LINE}};
  44. local $_ = shift;
  45. if(defined($_)) { $$documentation_line = $_; }
  46. return $$documentation_line;
  47. }
  48. sub documentation($$) {
  49. my $self = shift;
  50. my $documentation = \${$self->{DOCUMENTATION}};
  51. local $_ = shift;
  52. if(defined($_)) { $$documentation = $_; }
  53. return $$documentation;
  54. }
  55. sub function_line($$) {
  56. my $self = shift;
  57. my $function_line = \${$self->{FUNCTION_LINE}};
  58. local $_ = shift;
  59. if(defined($_)) { $$function_line = $_; }
  60. return $$function_line;
  61. }
  62. sub linkage($$) {
  63. my $self = shift;
  64. my $linkage = \${$self->{LINKAGE}};
  65. local $_ = shift;
  66. if(defined($_)) { $$linkage = $_; }
  67. return $$linkage;
  68. }
  69. sub return_type($$) {
  70. my $self = shift;
  71. my $return_type = \${$self->{RETURN_TYPE}};
  72. local $_ = shift;
  73. if(defined($_)) { $$return_type = $_; }
  74. return $$return_type;
  75. }
  76. sub calling_convention($$) {
  77. my $self = shift;
  78. my $calling_convention = \${$self->{CALLING_CONVENTION}};
  79. local $_ = shift;
  80. if(defined($_)) { $$calling_convention = $_; }
  81. return $$calling_convention;
  82. }
  83. sub internal_name($$) {
  84. my $self = shift;
  85. my $internal_name = \${$self->{INTERNAL_NAME}};
  86. local $_ = shift;
  87. if(defined($_)) { $$internal_name = $_; }
  88. return $$internal_name;
  89. }
  90. sub argument_types($$) {
  91. my $self = shift;
  92. my $argument_types = \${$self->{ARGUMENT_TYPES}};
  93. local $_ = shift;
  94. if(defined($_)) { $$argument_types = $_; }
  95. return $$argument_types;
  96. }
  97. sub argument_names($$) {
  98. my $self = shift;
  99. my $argument_names = \${$self->{ARGUMENT_NAMES}};
  100. local $_ = shift;
  101. if(defined($_)) { $$argument_names = $_; }
  102. return $$argument_names;
  103. }
  104. sub argument_documentations($$) {
  105. my $self = shift;
  106. my $argument_documentations = \${$self->{ARGUMENT_DOCUMENTATIONS}};
  107. local $_ = shift;
  108. if(defined($_)) { $$argument_documentations = $_; }
  109. return $$argument_documentations;
  110. }
  111. sub statements_line($$) {
  112. my $self = shift;
  113. my $statements_line = \${$self->{STATEMENTS_LINE}};
  114. local $_ = shift;
  115. if(defined($_)) { $$statements_line = $_; }
  116. return $$statements_line;
  117. }
  118. sub statements($$) {
  119. my $self = shift;
  120. my $statements = \${$self->{STATEMENTS}};
  121. local $_ = shift;
  122. if(defined($_)) { $$statements = $_; }
  123. return $$statements;
  124. }
  125. 1;