Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
openFile.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <string.h>
6
#include <
util/exit.h
>
7
8
static
inline
FILE *
openFile
(
const
char
*argv0,
const
char
*name,
9
const
char
*
mode
) {
10
FILE *fp = fopen(name,
mode
);
11
if
(fp ==
NULL
) {
12
const
char
*modestr = strcmp(
mode
,
"r"
) == 0 ?
"reading"
:
"writing"
;
13
fprintf(stderr,
"%s: could not open file %s for %s\n"
, argv0, name,
14
modestr);
15
perror(name);
16
graphviz_exit
(EXIT_FAILURE);
17
}
18
return
fp;
19
}
mode
mode
Definition
cvtgxl.c:33
exit.h
graphviz_exit
static NORETURN void graphviz_exit(int status)
Definition
exit.h:23
NULL
node NULL
Definition
grammar.y:163
openFile
static FILE * openFile(const char *argv0, const char *name, const char *mode)
Definition
openFile.h:8
cmd
tools
openFile.h
Generated by
1.9.8