~ubuntu-branches/ubuntu/trusty/gengetopt/trusty

« back to all changes in this revision

Viewing changes to src/skels/c_source.h_skel

  • Committer: Bazaar Package Importer
  • Author(s): Bart Martens
  • Date: 2008-05-07 21:14:14 UTC
  • mfrom: (1.1.6 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080507211414-p2vy66i37h9csmxi
* New upstream release.
* debian/copyright: Updated.
* debian/patches/02info.diff: Updated.
* debian/patches/03gcc43.diff: Removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
  printf("\n");
179
179
 
180
180
  if (strlen(@args_info@_description) > 0)
181
 
    printf("%s\n", @args_info@_description);
 
181
    printf("%s\n\n", @args_info@_description);
182
182
}
183
183
 
184
184
void
310
310
}
311
311
 
312
312
@IF@ (not multiple_options_all_string) and multiple_token_functions @THEN@
 
313
/**
 
314
 * The passed arg parameter is NOT set to 0 from this function
 
315
 */
313
316
static void
314
 
free_multiple_field(unsigned int len, void **arg, char ***orig)
 
317
free_multiple_field(unsigned int len, void *arg, char ***orig)
315
318
{
316
319
  unsigned int i;
317
 
  if (*arg) {
 
320
  if (arg) {
318
321
    for (i = 0; i < len; ++i)
319
322
      {
320
323
        free_string_field(&((*orig)[i]));
321
324
      }
322
325
 
323
 
    free (*arg);
324
 
    *arg = 0;
 
326
    free (arg);
325
327
    free (*orig);
326
328
    *orig = 0;
327
329
  }
584
586
@ENDIF@
585
587
@IF@ multiple_options @THEN@
586
588
static int
587
 
check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, int min, int max, const char *option_desc);
 
589
check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, unsigned int min, unsigned int max, const char *option_desc);
588
590
 
589
591
int
590
 
check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, int min, int max, const char *option_desc)
 
592
check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, unsigned int min, unsigned int max, const char *option_desc)
591
593
{
592
594
  int error = 0;
593
595
 
594
 
  if (option_given && ! (min < 0 && max < 0))
 
596
  if (option_given && (min > 0 || max > 0))
595
597
    {
596
 
      if (min >= 0 && max >= 0)
 
598
      if (min > 0 && max > 0)
597
599
        {
598
600
          if (min == max)
599
601
            {
614
616
              error = 1;
615
617
            }
616
618
        }
617
 
      else if (min >= 0)
 
619
      else if (min > 0)
618
620
        {
619
621
          /* at least check */
620
622
          if (option_given < min)
624
626
              error = 1;
625
627
            }
626
628
        }
627
 
      else if (max >= 0)
 
629
      else if (max > 0)
628
630
        {
629
631
          /* at most check */
630
632
          if (option_given > max)