fnum.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Implementation of the FNUM intrinsics.
  2. Copyright (C) 2004-2022 Free Software Foundation, Inc.
  3. Contributed by Steven G. Kargl <kargls@comcast.net>.
  4. This file is part of the GNU Fortran 95 runtime library (libgfortran).
  5. Libgfortran is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public
  7. License as published by the Free Software Foundation; either
  8. version 3 of the License, or (at your option) any later version.
  9. Libgfortran 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
  12. GNU General Public License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #include "libgfortran.h"
  21. /* FUNCTION FNUM(UNIT)
  22. INTEGER FNUM
  23. INTEGER, INTENT(IN), :: UNIT */
  24. extern GFC_INTEGER_4 fnum_i4 (GFC_INTEGER_4 *);
  25. export_proto(fnum_i4);
  26. GFC_INTEGER_4
  27. fnum_i4 (GFC_INTEGER_4 *unit)
  28. {
  29. return unit_to_fd (*unit);
  30. }
  31. extern GFC_INTEGER_8 fnum_i8 (GFC_INTEGER_8 *);
  32. export_proto(fnum_i8);
  33. GFC_INTEGER_8
  34. fnum_i8 (GFC_INTEGER_8 * unit)
  35. {
  36. return unit_to_fd (*unit);
  37. }