Skip to content

Commit a7944b1

Browse files
committed
Merge branch 'master' of https://github.com/fortran-lang/stdlib into hash_functions2
2 parents ae18abc + 01b3fb9 commit a7944b1

21 files changed

+989
-30
lines changed

API-doc-FORD-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extra_mods: iso_fortran_env:https://gcc.gnu.org/onlinedocs/gfortran/ISO_005fFORT
2828
print_creation_date: true
2929
creation_date: %Y-%m-%d %H:%M %z
3030
project_github: https://github.com/fortran-lang/stdlib
31-
project_download: https://github.com/fortran-lang/stdlib/archive/master.zip
31+
project_download: https://github.com/fortran-lang/stdlib/archive/HEAD.zip
3232
project_website: https://stdlib.fortran-lang.org
3333
favicon: doc/media/favicon.ico
3434
license: by-sa
@@ -57,7 +57,7 @@ The documentation for comment markup in source code, running [FORD] and the [FOR
5757

5858
[FORD]: https://github.com/Fortran-FOSS-Programmers/ford#readme
5959
[FORD wiki]: https://github.com/Fortran-FOSS-Programmers/ford/wiki
60-
[FORD project file]: https://github.com/fortran-lang/stdlib/blob/master/API-doc-FORD-file.md
60+
[FORD project file]: https://github.com/fortran-lang/stdlib/blob/HEAD/API-doc-FORD-file.md
6161

6262
Goals and Motivation
6363
====================

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ Features available from the latest git source
1010
- new module `stdlib_version`
1111
[#579](https://github.com/fortran-lang/stdlib/pull/579)
1212
- new procedure `get_stdlib_version`
13+
- update module `stdlib_io`
14+
[597](https://github.com/fortran-lang/stdlib/pull/597)
15+
- new procedure `getline`
1316
- new module `stdlib_io_npy`
1417
[#581](https://github.com/fortran-lang/stdlib/pull/581)
1518
- new procedures `save_npy`, `load_npy`
19+
- update module `stdlib_math`
20+
- new procedures `is_close` and `all_close`
21+
[#488](https://github.com/fortran-lang/stdlib/pull/488)
22+
- new procedures `arg`, `argd` and `argpi`
23+
[#498](https://github.com/fortran-lang/stdlib/pull/498)
1624

1725
Changes to existing modules
1826

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requests.
99

1010
By contributing to *stdlib*, you certify that you own or are allowed to share the
1111
content of your contribution under the
12-
[stdlib license](https://github.com/fortran-lang/stdlib/blob/master/LICENSE).
12+
[stdlib license](https://github.com/fortran-lang/stdlib/blob/HEAD/LICENSE).
1313

1414
* [Style](#style)
1515
* [Reporting a bug](#reporting-a-bug)
@@ -22,7 +22,7 @@ content of your contribution under the
2222
## Style
2323

2424
Please follow the
25-
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md)
25+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/HEAD/STYLE_GUIDE.md)
2626
for any Fortran code that you contribute.
2727
This allows the community to focus on substance rather than style.
2828

@@ -42,7 +42,7 @@ Before opening a bug report:
4242
1. Check if the issue has already been reported
4343
([issues](https://github.com/fortran-lang/stdlib/issues)).
4444
2. Check if it is still an issue or it has been fixed?
45-
Try to reproduce it with the latest version from the master branch.
45+
Try to reproduce it with the latest version from the default branch.
4646
3. Isolate the problem and create a minimal test case.
4747

4848
A good bug report should include all information needed to reproduce the bug.
@@ -74,7 +74,7 @@ It is quite possible we have not considered such solutions yet.
7474
## Workflow
7575

7676
The general workflow is documented in
77-
[this document](https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md)
77+
[this document](https://github.com/fortran-lang/stdlib/blob/HEAD/WORKFLOW.md)
7878

7979
The workflow guide is a living document.
8080
You are welcome to propose changes to the workflow by
@@ -93,7 +93,7 @@ You are welcome to propose changes to the workflow by
9393
[CHANGELOG](https://github.com/fortran-lang/stdlib/blob/master/CHANGELOG.md)
9494
* Be open to constructive criticism and requests for improving your code.
9595
* Again, please follow the
96-
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md).
96+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/HEAD/STYLE_GUIDE.md).
9797

9898

9999
## For new contributors

STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The following two sections are most relevant for contributing new code:
8181

8282
To write the "spec" (specification) for a new proposal, please place it in the
8383
[FORD "pages"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Pages) directory at
84-
[`doc/specs/`](https://github.com/fortran-lang/stdlib/tree/master/doc/specs).
84+
[`doc/specs/`](https://github.com/fortran-lang/stdlib/tree/HEAD/doc/specs).
8585
To get help please see the ["Writing Pages"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Pages)
8686
and ["Writing Documentation"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Documentation) pages
8787
on the [FORD wiki](https://github.com/Fortran-FOSS-Programmers/ford/wiki).

doc/specs/stdlib_io.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,53 @@ program demo_savenpy
223223
call save_npy('example.npy', x)
224224
end program demo_savenpy
225225
```
226+
227+
## `getline`
228+
229+
### Status
230+
231+
Experimental
232+
233+
### Description
234+
235+
Read a whole line from a formatted unit into a string variable
236+
237+
### Syntax
238+
239+
`call [[stdlib_io(module):getline(interface)]] (unit, line[, iostat][, iomsg])`
240+
`call [[stdlib_io(module):getline(interface)]] (line[, iostat][, iomsg])`
241+
242+
### Arguments
243+
244+
`unit`: Formatted input unit.
245+
This argument is `intent(in)`.
246+
If `unit` is not specified standard input is used.
247+
248+
`line`: Deferred length character or `string_type` variable.
249+
This argument is `intent(out)`.
250+
251+
`iostat`: Default integer, contains status of reading from unit, zero in case of success.
252+
It is an optional argument, in case not present the program will halt for non-zero status.
253+
This argument is `intent(out)`.
254+
255+
`iomsg`: Deferred length character value, contains error message in case `iostat` is non-zero.
256+
It is an optional argument, error message will be dropped if not present.
257+
This argument is `intent(out)`.
258+
259+
### Example
260+
261+
```fortran
262+
program demo_getline
263+
use, intrinsic :: iso_fortran_env, only : input_unit, output_unit
264+
use stdlib_io, only: getline
265+
implicit none
266+
character(len=:), allocatable :: line
267+
integer :: stat
268+
269+
call getline(input_unit, line, stat)
270+
do while(stat == 0)
271+
write(output_unit, '(a)') line
272+
call getline(input_unit, line, stat)
273+
end do
274+
end program demo_getline
275+
```

0 commit comments

Comments
 (0)