File: input.h

package info (click to toggle)
bladerf 0.2017.12~rc1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,620 kB
  • sloc: ansic: 50,123; vhdl: 12,873; python: 1,062; tcl: 1,060; xml: 1,017; makefile: 657; sh: 589; csh: 18; cpp: 9
file content (61 lines) | stat: -rw-r--r-- 1,969 bytes parent folder | download | duplicates (6)
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
/**
 * @file input.h
 *
 * @brief Functions to be provided by input mode implementatoins
 *
 * This file is part of the bladeRF project
 *
 * Copyright (C) 2013 Nuand LLC
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
#ifndef INPUT_H_
#define INPUT_H_

#include <libbladeRF.h>
#include "common.h"
#include "str_queue.h"

/**
 * Interactive mode or script execution 'main loop'
 *
 * @param   s           CLI state
 * @param   interactive Enter interactive mode after completing script or
 *                      commands provided via the command line
 * @param   exec_list   Commands to executue prior to scripts or interactive
 *                      mode
 *
 * @return  0 on success, CLI_RET_* on failure
 */
int input_loop(struct cli_state *s, bool interactive);

/**
 * Expand a file path using the input mode support backend
 *
 * @post Heap-allocated memory is used to return the expanded path. The caller
 *       is responsible for calling free().
 *
 * @return Expanded path on success, NULL on failure.
 */
char * input_expand_path(const char *path);

/**
 * Notify input support that we caught CTRL-C. This is necessary if
 * the underlying support doesn't catch signals, such as the simple fgets-based
 * implementation.
 */
void input_ctrlc(void);

#endif  /* INTERACTICE_H__ */