bind c_fputs for writing to popen'd pipes
- SHA
3132484cccb98e99437b678c479f80427bd2bcd2- Parents
-
3ab40b8 - Tree
419ae57
3132484
3132484cccb98e99437b678c479f80427bd2bcd23ab40b8
419ae57| Status | File | + | - |
|---|---|---|---|
| M |
src/system/interface.f90
|
10 | 1 |
src/system/interface.f90modified@@ -450,7 +450,16 @@ module system_interface | |||
| 450 | type(c_ptr), value :: stream | 450 | type(c_ptr), value :: stream |
| 451 | type(c_ptr) :: c_fgets | 451 | type(c_ptr) :: c_fgets |
| 452 | end function | 452 | end function |
| 453 | - | 453 | + |
| 454 | + ! Write a null-terminated string to a stream (shift phase Sprint 5: | ||
| 455 | + ! used to pipe text into clipboard tools like pbcopy via popen("w")). | ||
| 456 | + function c_fputs(s, stream) bind(C, name="fputs") | ||
| 457 | + import :: c_ptr, c_int | ||
| 458 | + type(c_ptr), value :: s | ||
| 459 | + type(c_ptr), value :: stream | ||
| 460 | + integer(c_int) :: c_fputs | ||
| 461 | + end function | ||
| 462 | + | ||
| 454 | subroutine c_exit(status) bind(C, name="exit") | 463 | subroutine c_exit(status) bind(C, name="exit") |
| 455 | import :: c_int | 464 | import :: c_int |
| 456 | integer(c_int), value :: status | 465 | integer(c_int), value :: status |