PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
strutil.f90
Go to the documentation of this file.
1 ! $Id: strutil.f90 12159 2012-01-27 22:17:33Z airwin $
2 !
3 ! Copyright (C) 2004 Alan W. Irwin
4 !
5 ! This file is part of PLplot.
6 !
7 ! PLplot is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU Library General Public License as published
9 ! by the Free Software Foundation; either version 2 of the License, or
10 ! (at your option) any later version.
11 !
12 ! PLplot is distributed in the hope that it will be useful,
13 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ! GNU Library General Public License for more details.
16 !
17 ! You should have received a copy of the GNU Library General Public License
18 ! along with PLplot; if not, write to the Free Software
19 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
22 
23  implicit none
24 
25 contains
26 
27 !--------------------------------------------------------------------------
28 ! plstrf2c()
29 !
30 ! Converts Fortran string to C format
31 !--------------------------------------------------------------------------
32 
33 subroutine plstrf2c(string1, string2)
34 
35  character(len=*) :: string1, string2
36 
37  integer :: limit
38 
39  string2 = string1
40 ! limit = min(len(string2), len(string1))
41  limit = len_trim(string2)
42  string2(limit+1:limit+1) = char(0)
43 end subroutine plstrf2c
44 
45 
46 !--------------------------------------------------------------------------
47 ! plstrc2f()
48 !
49 ! Converts C string to Fortran conventions
50 !--------------------------------------------------------------------------
51 
52 subroutine plstrc2f(string1, string2)
53 
54  character(len=*) :: string1, string2
55 
56  integer :: limit
57 
58  string2 = string1
59 
60  limit = index( string2, achar(0) )
61  if ( limit > 0 ) then
62  string2(limit:) = ' '
63  endif
64 
65 end subroutine plstrc2f
66 
67 end module plplot_strutils