Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

argv.c File Reference


Detailed Description

Process command line arguments passed in to JVM program.

Read command line parameters from,

 main(int argc, char **argv, char **envp) 

These parameters typically are passed from the actual 'C' program entry point. Process these parameters and use a subset to construct the Java command line parameters to pass in to the main Java entry point,

 public static void main(String[] args) 

Part of this process is to read environment settings for JAVA_HOME, CLASSPATH, and BOOTCLASSPATH, which may be overridden from the command line.

The HEAP_INIT() function must have been called before using these functions so the environment variables can be stored into it and not depend on the argument or environment pointers to always be unchanged.

The tmparea_init() function must have been called before these functions so the internal CLASSPATH can be set up properly.

Control

$URL: https://svn.apache.org/path/name/argv.c $ $Id: argv.c 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file argv.c.

#include "arch.h"
#include <stdlib.h>
#include <string.h>
#include "jvmcfg.h"
#include "classfile.h"
#include "classpath.h"
#include "exit.h"
#include "heap.h"
#include "jvm.h"
#include "util.h"

Go to the source code of this file.

Defines

#define LEADING_SPACES   " "

Functions

static void argv_c_dummy (void)
rvoid argv_copyrightmsg (rvoid)
 Show program copyright message to standard output.
rvoid argv_helpmsg (rvoid)
 Show program syntax and usage message to standard output.
rvoid argv_init (int argc, char **argv, char **envp)
 Parse command line.
rvoid argv_licensemsg (rvoid)
 Show program software license message to standard output.
rvoid argv_showmsg (rvoid)
 Show resolution of command line to standard output.
rvoid argv_shutdown (rvoid)
 Clean up from argv[] setup after JVM execution.
rvoid argv_versionmsg (rvoid)
 Show program version message to standard output.

Variables

static char * argv_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/argv.c $ $Id: argv.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Define Documentation

#define LEADING_SPACES   " "
 

Definition at line 475 of file argv.c.


Function Documentation

static void argv_c_dummy void   )  [static]
 

Definition at line 61 of file argv.c.

rvoid argv_init int  argc,
char **  argv,
char **  envp
 

Parse command line.

Retrieve parameters from the program entry point

 main(int argc, char **argv, char **envp) 
and parse them into internal form. Since this program is delivered primarily as a library, these will have to be reported as parameters to from the invoking program.

The syntax for the command line is:

 main_pgm_name [{-Xjh    | -Xjavahome | -Xjava_home}  dir_name]
               [{-cp     | -classpath}                dir_name]
               [{-Xbcp   | -Xbootclasspath}           dir_name]
               [{-Xdebug | -Xdebuglevel | -Xdebug_level} level]

               [-jar any/path/name/jarfilename]
               start.class.name

               [java_arg1 [java_arg2 [...]]]


 main_pgm_name -show
               -version
               -copyright
               -help

If more than one '-<token>' or '-X<token>' option entry is found on the command line for a given token type, the last one wins If one of these tokens is the last parameter on a command line, it is ignored. After the option entries are reviewed, the starting class name is specified, preceded by an optional '-jar' modifier which, if present, indicates that the specified jar file should be read to locate the starting class. Any parameters after the starting class name are passed to the JVM as '(String) args[]'.

Parameters:
argc Number of arguments on command line
argv Argument vector from the command line
envp Environment pointer from command line environ
Returns:
rvoid
< Convenient alias for DML0

< Convenient alias for DML1

< Convenient alias for DML10

Definition at line 123 of file argv.c.

References rjvm::argc, rjvm::argcj, rjvm::argv, rjvm::argv0, rjvm::argv0name, argv_copyrightmsg(), argv_helpmsg(), argv_licensemsg(), argv_showmsg(), argv_versionmsg(), rjvm::argvj, rjvm::bootclasspath, rjvm::classpath, DMLMAX, DMLMIN, DMLOFF, rjvm::envp, EXIT_ARGV_COPYRIGHT, EXIT_ARGV_HELP, EXIT_ARGV_LICENSE, EXIT_ARGV_VERSION, exit_jvm(), HEAP_GET_DATA, rjvm::java_home, jvm_argv_initialized, JVMCFG_BOOTCLASSPATH_ABBREV_PARM, JVMCFG_BOOTCLASSPATH_DEFAULT, JVMCFG_BOOTCLASSPATH_FULL_PARM, JVMCFG_CLASSPATH_ABBREV_PARM, JVMCFG_CLASSPATH_DEFAULT, JVMCFG_CLASSPATH_FULL_PARM, JVMCFG_COMMAND_LINE_COPYRIGHT_PARM, JVMCFG_COMMAND_LINE_HELP_PARM, JVMCFG_COMMAND_LINE_LICENSE_PARM, JVMCFG_COMMAND_LINE_SHOW_PARM, JVMCFG_COMMAND_LINE_VERSION_PARM, JVMCFG_DEBUGMSGLEVEL_ABBREV_PARM, JVMCFG_DEBUGMSGLEVEL_FULL_PARM, JVMCFG_DEBUGMSGLEVEL_MID_PARM, JVMCFG_ENVIRONMENT_VARIABLE_BOOTCLASSPATH, JVMCFG_ENVIRONMENT_VARIABLE_CLASSPATH, JVMCFG_ENVIRONMENT_VARIABLE_JAVA_HOME, JVMCFG_JARFILE_STARTCLASS_PARM, JVMCFG_JAVA_HOME_ABBREV_PARM, JVMCFG_JAVA_HOME_DEFAULT, JVMCFG_JAVA_HOME_FULL_PARM, JVMCFG_JAVA_HOME_MID_PARM, JVMCFG_PATHNAME_DELIMITER_CHAR, jvmutil_set_dml(), pjvm, rfalse, rnull, rtrue, rjvm::startclass, rjvm::startjar, and sysErrMsg().

rvoid argv_versionmsg rvoid   ) 
 

Show program version message to standard output.

Parameters: rvoid

Returns:
rvoid

Definition at line 423 of file argv.c.

Referenced by argv_init().

rvoid argv_copyrightmsg rvoid   ) 
 

Show program copyright message to standard output.

Parameters: rvoid

Returns:
rvoid

Definition at line 442 of file argv.c.

Referenced by argv_init().

rvoid argv_licensemsg rvoid   ) 
 

Show program software license message to standard output.

Parameters: rvoid

Returns:
rvoid

Definition at line 465 of file argv.c.

Referenced by argv_init().

rvoid argv_helpmsg rvoid   ) 
 

Show program syntax and usage message to standard output.

Parameters: rvoid

Returns:
rvoid

Definition at line 487 of file argv.c.

Referenced by argv_init().

rvoid argv_showmsg rvoid   ) 
 

Show resolution of command line to standard output.

Parameters: rvoid

Returns:
rvoid

Definition at line 624 of file argv.c.

Referenced by argv_init().

rvoid argv_shutdown rvoid   ) 
 

Clean up from argv[] setup after JVM execution.

Parameters: rvoid

Returns:
rvoid

Definition at line 681 of file argv.c.


Variable Documentation

char* argv_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/argv.c $ $Id: argv.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 61 of file argv.c.


Generated on Fri Sep 30 18:49:26 2005 by  doxygen 1.4.4