The R Project SVN R

Rev

Rev 35572 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35572 Rev 71308
1
public class getsp {
1
public class getsp {
2
    public static void main(String[] args) {
2
    public static void main(String[] args) {
3
	if (args!=null && args.length>0) {
3
	if (args!=null && args.length>0) {
4
	    if (args[0].compareTo("-test")==0) {
4
	    if (args[0].compareTo("-test")==0) {
5
		System.out.println("Test1234OK");
5
		System.out.println("Test1234OK");
6
	    } else
6
	    } else
7
	    if (args[0].compareTo("-libs")==0) {
7
	    if (args[0].compareTo("-libs")==0) {
8
		String prefix="-L";
8
		String prefix="-L";
9
		if (args.length>1) prefix=args[1];
9
		if (args.length>1) prefix=args[1];
10
		String lp=System.getProperty("java.library.path");
10
		String lp=System.getProperty("java.library.path");
11
		// we're not using StringTokenizer in case the JVM is very crude
11
		// we're not using StringTokenizer in case the JVM is very crude
12
		int i=0,j,k=0;
12
		int i=0,j,k=0;
13
		String r=null;
13
		String r=null;
14
		String pss=System.getProperty("path.separator");
14
		String pss=System.getProperty("path.separator");
15
		char ps=':';
15
		char ps=':';
16
		if (pss!=null && pss.length()>0) ps=pss.charAt(0);
16
		if (pss!=null && pss.length()>0) ps=pss.charAt(0);
17
		j=lp.length();
17
		j=lp.length();
18
		while (i<=j) {
18
		while (i<=j) {
19
		    if (i==j || lp.charAt(i)==ps) {
19
		    if (i==j || lp.charAt(i)==ps) {
20
			String lib=lp.substring(k,i);
20
			String lib=lp.substring(k,i);
21
			k=i+1;
21
			k=i+1;
22
			if (lib.compareTo(".")!=0)
22
			if (lib.compareTo(".")!=0)
23
			    r=(r==null)?(prefix+lib):(r+" "+prefix+lib);
23
			    r=(r==null)?(prefix+lib):(r+" "+prefix+lib);
24
		    }
24
		    }
25
		    i++;
25
		    i++;
26
		}
26
		}
27
		if (r!=null) System.out.println(r);
27
		if (r!=null) System.out.println(r);
28
	    } else
28
	    } else
29
		System.out.println(System.getProperty(args[0]));
29
		System.out.println(System.getProperty(args[0]));
30
	}
30
	}
31
    }
31
    }
32
}
32
}