PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
configurable.f90
Go to the documentation of this file.
1 ! Copyright (C) 2004-2014 Alan W. Irwin
2 !
3 ! This file is part of PLplot.
4 !
5 ! PLplot is free software; you can redistribute it and/or modify
6 ! it under the terms of the GNU Library General Public License as
7 ! published by the Free Software Foundation; either version 2 of the
8 ! License, or (at your option) any later version.
9 !
10 ! PLplot is distributed in the hope that it will be useful,
11 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ! GNU Library General Public License for more details.
14 !
15 ! You should have received a copy of the GNU Library General Public
16 ! License along with PLplot; if not, write to the Free Software
17 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19  subroutine plparseopts(mode)
20  use plplot
21  implicit none
22  integer :: mode
23  integer :: maxargs, iargs, numargs, index, maxindex
24  parameter(maxindex = maxlen/4)
25  parameter(maxargs=20)
26  character (len=maxlen) :: arg
27  integer, dimension(maxindex, maxargs) :: iargsarr
28  numargs = command_argument_count()
29  if(numargs.lt.0) then
30 ! This actually happened historically on a badly linked Cygwin platform.
31  write(0,'(a)') 'plparseopts: negative number of arguments'
32  return
33  endif
34  if(numargs+1.gt.maxargs) then
35  write(0,'(a)') 'plparseopts: too many arguments'
36  return
37  endif
38  do 10 iargs = 0, numargs
39  call get_command_argument(iargs, arg)
40  call plstrf2c(trim(arg), string1)
41  s1 = transfer( string1, s1 )
42  do 5 index = 1, maxindex
43  iargsarr(index, iargs+1) = s1(index)
44  5 continue
45  10 continue
46  call plparseopts7(numargs+1, iargsarr, mode, maxindex*4)
47  end subroutine plparseopts