std_cmdl_local.h

来自「JPEG2000实现的源码」· C头文件 代码 · 共 77 行

H
77
字号
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company                                   */
/* All rights reserved                                                       */
/* File: "std_cmdl_local.h"                                                  */
/* Description: Private definitions for "std_cmdl.c".                        */
/* Author: David Taubman                                                     */
/* Affiliation: Hewlett-Packard and                                          */
/*              The University of New South Wales, Australia                 */
/* Version: VM6.0                                                            */
/* Last Revised: 19 January, 2000                                            */
/*****************************************************************************/
#ifndef STD_CMDL_LOCAL_H
#define STD_CMDL_LOCAL_H

#define CMDL_MEM_KEY "COMMAND-LINE OBJECT MEMORY"

/*****************************************************************************/
/*                                  cmd_list                                 */
/*****************************************************************************/

typedef
  struct cmd_list {
    char *arg;
    int arg_length;
    int tnum;
    int recognized;
    int num_params;
    char **params;
    struct cmd_list *next;
  } cmd_list, *cmd_list_ptr;
  /* This structure is used to build a list of partially parsed command
     line arguments, together with state information to identify whether
     or not the argument has been parsed -- this facilitates the
     identification of unrecognized command-line arguments.  Each element
     in the list contains a single argument, which is any text string
     commencing with a `-' character, followed immediately by an alphabetical
     character.
         This argument string is identified by the `arg' field.
     Note that the string is not dynamically allocated; the field simply
     points into the actual command-line argument list.  Only the first
     `arg_length' characters should be considered part of the argument
     name, which may be fewer than the original argument.  To understand
     this, consider a simple argument such as "-Flev" which identifies the
     number of levels of Wavelet decomposition.  If "-Flev" appears on the
     command-line, the `arg_length' field will be set to 5.  On the other
     hand, one can specify tile-specific arguments using the form,
     "-Flev+<tnum>" where <tnum> is a zero-based tile number.  Thus, the
     number of resolution levels for the third tile may be independently
     specified using "-Flev+2".  In this case, `arg_length' again holds 5,
     i.e. the argument string is considered to be that part of the original
     string which excludes the tile specifier.  The `tnum' field holds the
     tile specifier - 1, i.e. `tnum' is a zero-based tile-index.  A `tnum'
     value of -1 is used for arguments which do not have the tile specifier.
         The `recognized' field indicates whether or not the argument has been
     recognized by some module in the compression/decompression system as
     appropriate.
         Each element in the list also contains a reference to each of the
     argument's parameters.  All entries in the argc/argv list which appear
     between valid argument identifiers are considered to be parameters.
     The `num_params' field indicates the number of parameters and the
     `params' field points into the original argv array to the first
     parameter string -- subsequent parameters are consecutive entries in the
     argv array. */
    
/*****************************************************************************/
/*                                 std_cmdl_obj                              */
/*****************************************************************************/

typedef
  struct std_cmdl_obj {
    cmdl_obj base;
    char *prog_name;
    cmd_list_ptr list;
  } std_cmdl_obj, *std_cmdl_ref;

#endif /* STD_CMDL_LOCAL_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?