This file is indexed.

/usr/include/ola/io/Serial.h is in libola-dev 0.10.3.nojsmin-2+deb9u1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
81
82
/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * Serial.h
 * Serial IO functions.
 * Copyright (C) 2014 Peter Newman
 */

#ifndef INCLUDE_OLA_IO_SERIAL_H_
#define INCLUDE_OLA_IO_SERIAL_H_

#include <stdint.h>
#include <string>
#include <vector>

#ifdef _WIN32
// Define types and constants to mimic termios.h
#define B9600 9600
#define B19200 19200
#define B38400 38400
#define B57600 57600
#define B115200 115200
#define B230400 230400
typedef unsigned speed_t;
#else
#include <termios.h>
#endif  // _WIN32

namespace ola {
namespace io {

typedef enum {
  BAUD_RATE_9600 = 9600,
  BAUD_RATE_19200 = 19200,
  BAUD_RATE_38400 = 38400,
  BAUD_RATE_57600 = 57600,
  BAUD_RATE_115200 = 115200,
  BAUD_RATE_230400 = 230400,
} baud_rate;

/**
 * @brief Convert an integer baud rate to the termios struct speed_t
 * @param[in] value the baudrate value to convert
 * @param[out] output a pointer where the value will be stored
 * @returns true if the value was converted, false if the baud rate wasn't
 * supported by the method.
 */
bool UIntToSpeedT(uint32_t value, speed_t *output);

/**
 * @brief Try to open the path, respecting UUCP locking.
 * @param path the path to open
 * @param oflag flags passed to open
 * @param[out] fd a pointer to the fd which is returned.
 * @returns true if the open succeeded, false otherwise.
 *
 * This fails-fast, it we can't get the lock immediately, we'll return false.
 */
bool AcquireUUCPLockAndOpen(const std::string &path, int oflag, int *fd);

/**
 * @brief Remove a UUCP lock file for the device.
 * @param path The path to unlock.
 *
 * The lock is only removed if the PID matches.
 */
void ReleaseUUCPLock(const std::string &path);
}  // namespace io
}  // namespace ola
#endif  // INCLUDE_OLA_IO_SERIAL_H_