File: tsp_common.c

package info (click to toggle)
glibc 2.41-9
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 300,164 kB
  • sloc: ansic: 1,050,507; asm: 238,242; makefile: 20,378; python: 13,537; sh: 11,812; cpp: 5,197; awk: 1,795; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (50 lines) | stat: -rw-r--r-- 916 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
 *  Main driver
 */


#define TST_FUNCTION_CALL(func) _TST_FUNCTION_CALL(func)
#define _TST_FUNCTION_CALL(func) tst ##_## func

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <errno.h>
#include <signal.h>

#include "tst_types.h"
#include "tgn_locdef.h"


int
main (int argc, char *argv[])
{
  int ret;
  int debug;

  debug = argc > 1 ? atoi (argv[1]) : 0;

  if (debug)
    {
      fprintf (stdout, "\nTST_MBWC ===> %s ...\n", argv[0]);
    }
  ret = TST_FUNCTION_CALL (TST_FUNCTION) (stdout, debug);

  return (ret != 0);
}

int
result (FILE * fp, char res, const char *func, const char *loc, int rec_no,
	int seq_no, int case_no, const char *msg)
{
  if (fp == NULL)
    fp = stderr;

  if (fprintf (fp, "%s:%s:%d:%d:%d:%c:%s\n", func, loc, rec_no, seq_no,
	       case_no, res, msg) == EOF)
    return 0;

  return 1;
}