DEADSOFTWARE

Mirror gpcp-32255
[gpcp-linux.git] / libs / java / CPmain.java
1 //
2 // Body of CPmain interface.
3 // This file implements the code of the CPmain.cp file.
4 // kjg November 1998.
6 package CP.CPmain;
8 public class CPmain
9 {
10 /*
11 * Now empty. Methods have moved to ProgArgs.
12 */
13 public static String[] args;
15 public static void PutArgs(String[] a)
16 // This method is known to the CPascal compiler, but is
17 // unknown to CPascal source programs. An initialization
18 // call to this method is the first thing in the synthetic
19 // main method of any module which imports CPmain.
20 {
21 args = a;
22 }
24 public static int ArgNumber()
25 {
26 return args.length;
27 }
29 public static void GetArg(int num, char[] str)
30 {
31 int i;
32 for (i = 0; i < str.length && i < args[num].length(); i++) {
33 str[i] = args[num].charAt(i);
34 }
35 if (i == str.length)
36 i--;
37 str[i] = '\0';
38 }
39 } // end of public class CPmain