Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Functions | Variables
cmdopt.h File Reference
#include "target.h"
Include dependency graph for cmdopt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int eval_options (int argc, char **argv, struct target_opts *defaults, const char **exe_opts)
 
char ** split_opt_string (const char *opts)
 
const char * get_target ()
 

Variables

const char * exe_name
 
const char escape_code
 
const char default_path_sep
 
const char suffix_sep
 
const size_t exe_suffix_len
 

Function Documentation

◆ eval_options()

int eval_options ( int  argc,
char **  argv,
struct target_opts *  defaults,
const char **  exe_opts 
)

Parses command line arguments for switches and options.

Parameters
argcnumber of command line arguments.
argvcommand line arguments.
defaultstarget_status structure containing default values.
exe_optshandle to default child process arguments string
Returns
number of command line arguments parsed.

Definition at line 435 of file cmdopt.cpp.

◆ get_target()

const char * get_target ( )

Accessor method for current execution target.

This function is defined in runall.cpp (not cmdopt.cpp).

This value is a pointer into argv[0] of the current target.

Returns
(Base) name of current execution target.

Definition at line 411 of file runall.cpp.

◆ split_opt_string()

char ** split_opt_string ( const char *  opts)

Translates opts into an array that can be passed to exec().

This method malloc ()s two blocks of memory. The first block is the generated argv index array. This is the return value of this method. The second block is the parsed and split string contents the index referenced.
This block is stored in element 1 of the return array. It is the responsibility of the calling method to free () both blocks.

Warning
this logic is UTF-8 unsafe
I/O redirection command piping isn't supported in the parse logic
Parameters
optsoption string to split
Returns
the parsed argv array

Definition at line 678 of file cmdopt.cpp.

Variable Documentation

◆ default_path_sep

const char default_path_sep
extern

Primary path seperator

Definition at line 60 of file cmdopt.cpp.

◆ escape_code

const char escape_code
extern

Escape character used in paths.

Definition at line 59 of file cmdopt.cpp.

◆ exe_name

const char* exe_name
extern

cmdopt.h - Interface declaration for the option parsing subsystem

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

cmdopt.cpp - Definitions of the option parsing subsystem

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. Alias for process argv [0].

Definition at line 55 of file cmdopt.cpp.

◆ exe_suffix_len

const size_t exe_suffix_len
extern

Length of executable suffix.

Definition at line 62 of file cmdopt.cpp.

◆ suffix_sep

const char suffix_sep
extern

File suffix seperator.

Definition at line 61 of file cmdopt.cpp.