summaryrefslogtreecommitdiff
path: root/libmscgen/mscgen_api.h
blob: 43a1bf84407de1c4c120abad81991f7361dcc335 (plain)
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
#ifndef MSCGEN_API_H
#define MSCGEN_API_H

#ifdef __cplusplus
extern "C" {
#endif

#define MSCGEN_OK                   ( 0)
#define MSCGEN_FILE_ERROR           (-1)
#define MSCGEN_INPUT_FORMAT_ERROR   (-2)
#define MSCGEN_OUTPUT_CONTEXT_ERROR (-3)

/** The supported image formats */
typedef enum
{
  mscgen_format_png, /**< PNG bitmap image file */
  mscgen_format_eps, /**< Encapsulated PostScript file */
  mscgen_format_svg, /**< Scalable Vector Graphics file */
  mscgen_format_pngmap, /**< Image map for a bitmap file */
  mscgen_format_svgmap  /**< Image map for a SVG file */
} mscgen_format_t;

/** generate an image file for a given .msc file.
 *  @param inputFile the name of the MSC file to process.
 *  @param outputFile the name of the image file to generate.
 *  @param format the format of the image file to generate.
 *  @return 0 on success, a non zero error code on failure.
 */
int mscgen_generate(const char *inputFile,
                    const char *outputFile,
                    mscgen_format_t format
                   );

/** Translates the error code returned by mscgen_generate into a string */
const char *mscgen_error2str(int code);

#ifdef __cplusplus
}
#endif

#endif // MSCGEN_API_H