OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [argtable2/] [argtable2.c] - Diff between revs 1748 and 1751

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1748 Rev 1751
Line 22... Line 22...
/* config.h must be included before anything else */
/* config.h must be included before anything else */
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h"
#endif
#endif
 
 
#ifdef STDC_HEADERS
 
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <ctype.h>
#include <ctype.h>
#endif
 
 
 
#ifdef HAVE_STRINGS_H
#ifdef HAVE_STRINGS_H
#include <strings.h>
#include <strings.h>
#endif
#endif
 
 
Line 91... Line 89...
    int noptions;
    int noptions;
    struct option *options;
    struct option *options;
    };
    };
 
 
#ifndef NDEBUG
#ifndef NDEBUG
static
/* Commented out by JPB for GCC compliance
void dump_longoptions(struct longoptions* longoptions)
static
    {
void dump_longoptions(struct longoptions* longoptions)
    int i;
    {
    printf("getoptval = %d\n", longoptions->getoptval);
    int i;
    printf("noptions  = %d\n", longoptions->noptions);
    printf("getoptval = %d\n", longoptions->getoptval);
    for (i=0; i<longoptions->noptions; i++)
    printf("noptions  = %d\n", longoptions->noptions);
        {
    for (i=0; i<longoptions->noptions; i++)
        printf("options[%d].name    = \"%s\"\n", i, longoptions->options[i].name);
        {
        printf("options[%d].has_arg = %d\n", i, longoptions->options[i].has_arg);
        printf("options[%d].name    = \"%s\"\n", i, longoptions->options[i].name);
        printf("options[%d].flag    = %p\n", i, longoptions->options[i].flag);
        printf("options[%d].has_arg = %d\n", i, longoptions->options[i].has_arg);
        printf("options[%d].val     = %d\n", i, longoptions->options[i].val);
        printf("options[%d].flag    = %p\n", i, longoptions->options[i].flag);
        }
        printf("options[%d].val     = %d\n", i, longoptions->options[i].val);
    }
        }
 
    }
 
*/
#endif
#endif
 
 
static
static
struct longoptions* alloc_longoptions(struct arg_hdr **table)
struct longoptions* alloc_longoptions(struct arg_hdr **table)
    {
    {
Line 940... Line 940...
 *
 *
 * arg_print_formatted( fp, 2, 7, "Some text that doesn't fit." )
 * arg_print_formatted( fp, 2, 7, "Some text that doesn't fit." )
 * will result in the following output:
 * will result in the following output:
 *
 *
 * Some
 * Some
 * _ text
 *   text
 * _ that
 *   that
 * _ doesn'
 *   doesn'
 * _ t fit.
 *   t fit.
 *
 *
 * As you see, the first line is not indented. This enables output of
 * As you see, the first line is not indented. This enables output of
 * lines, which start in a line where output already happened.
 * lines, which start in a line where output already happened.
 *
 *
 * Author: Uli Fouquet
 * Author: Uli Fouquet
Line 966... Line 966...
 
 
    while (line_end-1 > line_start )
    while (line_end-1 > line_start )
        {
        {
        /* Eat leading whitespaces. This is essential because while
        /* Eat leading whitespaces. This is essential because while
           wrapping lines, there will often be a whitespace at beginning
           wrapping lines, there will often be a whitespace at beginning
           of line _*/
           of line  */
        while ( isspace(*(text+line_start)) )
        while ( isspace(*(text+line_start)) )
            { line_start++; }
            { line_start++; }
 
 
        if ((line_end - line_start) > colwidth )
        if ((line_end - line_start) > colwidth )
            { line_end = line_start + colwidth; }
            { line_end = line_start + colwidth; }
Line 1012... Line 1012...
    }
    }
 
 
/**
/**
 * Prints the glossary in strict GNU format.
 * Prints the glossary in strict GNU format.
 * Differences to arg_print_glossary() are:
 * Differences to arg_print_glossary() are:
 * _- wraps lines after 80 chars
 *  - wraps lines after 80 chars
 * _- indents lines without shortops
 *  - indents lines without shortops
 * _- does not accept formatstrings
 *  - does not accept formatstrings
 *
 *
 * Contributed by Uli Fouquet
 * Contributed by Uli Fouquet
 */
 */
void arg_print_glossary_gnu(FILE *fp, void **argtable )
void arg_print_glossary_gnu(FILE *fp, void **argtable )
    {
    {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.