~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to lib/tsconfig/TsConfigTypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# if ! defined(TS_CONFIG_TYPES_HEADER)
 
2
# define TS_CONFIG_TYPES_HEADER
 
3
 
 
4
/** @file
 
5
 
 
6
    Basic types for configuration parsing.
 
7
 
 
8
    Copyright 2010 Network Geographics, Inc.
 
9
 
 
10
    Licensed under the Apache License, Version 2.0 (the "License");
 
11
    you may not use this file except in compliance with the License.
 
12
    You may obtain a copy of the License at
 
13
 
 
14
       http://www.apache.org/licenses/LICENSE-2.0
 
15
 
 
16
    Unless required by applicable law or agreed to in writing, software
 
17
    distributed under the License is distributed on an "AS IS" BASIS,
 
18
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
19
    See the License for the specific language governing permissions and
 
20
    limitations under the License.
 
21
 */
 
22
 
 
23
# if defined(_MSC_VER)
 
24
#   include <stddef.h>
 
25
# else
 
26
#   include <unistd.h>
 
27
# endif
 
28
 
 
29
# if defined(__cplusplus)
 
30
namespace ts { namespace config {
 
31
# endif
 
32
 
 
33
/** A location in the source stream.
 
34
    @internal At some point we may need to add stream information,
 
35
    e.g. file name, once includes are supported. Or should that
 
36
    be the caller's responsibility?
 
37
 */
 
38
struct Location {
 
39
    int _col; ///< Column.
 
40
    int _line; ///< Line.
 
41
};
 
42
 
 
43
/** A token from the source stream.
 
44
    @internal We should use ts::Buffer here, but because this
 
45
    has to work in C as well, it's less painful to do it by hand.
 
46
 */
 
47
struct Token {
 
48
  char* _s; ///< Text of token.
 
49
  size_t _n; ///< Text length.
 
50
  int _type; ///< Type of token.
 
51
  struct Location _loc; ///< Location of token.
 
52
};
 
53
 
 
54
# if defined(__cplusplus)
 
55
}} // namespace ts::config
 
56
# define YYSTYPE ts::config::Token
 
57
# else
 
58
# define YYSTYPE struct Token
 
59
#endif
 
60
 
 
61
 
 
62
# endif // TS_CONFIG_TYPES_HEADER