File: vtkParseSystem.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 205,916 kB
  • sloc: cpp: 2,336,565; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 178; javascript: 165; objc: 153; tcl: 59
file content (80 lines) | stat: -rw-r--r-- 2,191 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause

/**
  This file contains routines for accessing the file system.
*/

#ifndef vtkParseSystem_h
#define vtkParseSystem_h

#include "vtkParseDepends.h"
#include "vtkParseString.h"
#include "vtkWrappingToolsModule.h"

#include <stdio.h> /* for FILE* */

/**
 * Contains the paths to all files that have been discovered on the file
 * system. This is used to accelerate searches for header files.
 */
typedef struct SystemInfo_
{
  StringCache* Strings;        /* to accelerate string allocation */
  const char*** FileHashTable; /* paths to all discovered files */
  const char*** DirHashTable;  /* paths to all catalogued directories */
} SystemInfo;

/**
 * An enum to identify the types of discovered files
 */
typedef enum system_filetype_t_
{
  VTK_PARSE_NOFILE = 0,
  VTK_PARSE_ISFILE = 1,
  VTK_PARSE_ISDIR = 2
} system_filetype_t;

#ifdef __cplusplus
extern "C"
{
#endif

  /**
   * Check if a file with the given name exists and return its type:
   * VTK_PARSE_ISDIR, VTK_PARSE_ISFILE, or VTK_PARSE_NOFILE if not found.
   * This will cache results for the entire parent directory in order
   * to accelerate future searches.
   */
  VTKWRAPPINGTOOLS_EXPORT
  system_filetype_t vtkParse_FileExists(SystemInfo* info, const char* name);

  /**
   * Free the memory that the SystemInfo uses to cache the files.
   */
  VTKWRAPPINGTOOLS_EXPORT
  void vtkParse_FreeFileCache(SystemInfo* info);

  /**
   * On Win32, this interprets fname as UTF8 and then calls wfopen().
   * The returned handle must be freed with fclose().
   *
   * This variant does not add a dependency on the passed filename to any
   * dependency tracking.
   */
  VTKWRAPPINGTOOLS_EXPORT
  FILE* vtkParse_FileOpenNoDependency(const char* fname, const char* mode);

  /**
   * On Win32, this interprets fname as UTF8 and then calls wfopen().
   * The returned handle must be freed with fclose().
   */
  VTKWRAPPINGTOOLS_EXPORT
  FILE* vtkParse_FileOpen(const char* fname, const char* mode);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
/* VTK-HeaderTest-Exclude: vtkParseSystem.h */