File: errtrig.h

package info (click to toggle)
gensio 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,776 kB
  • sloc: ansic: 45,195; python: 2,718; cpp: 1,129; sh: 586; makefile: 420
file content (31 lines) | stat: -rw-r--r-- 620 bytes parent folder | download
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
/*
 *  gensio - A library for abstracting stream I/O
 *  Copyright (C) 2020  Corey Minyard <minyard@acm.org>
 *
 *  SPDX-License-Identifier: LGPL-2.1-only
 */

/*
 * Test code to trigger errors at specific counts.  See errtrig.c for details.
 */
#ifndef _GENSIO_ERRTRIG_H
#define _GENSIO_ERRTRIG_H

#include "config.h"

#include <stdlib.h>
#include <stdbool.h>

#ifdef ENABLE_INTERNAL_TRACE
#define ENABLE_ERRTRIG_TEST
#endif

#ifdef ENABLE_ERRTRIG_TEST
bool do_errtrig(void);
void errtrig_exit(int rv);
#else
#define do_errtrig() false
#define errtrig_exit(rv) do {} while(false)
#endif

#endif /* _GENSIO_ERRTRIG_H */