Debian Codegraph @

src/null.c

raw
1 /*
2 * cwdaemon - morse sounding daemon for the parallel or serial port
3 * Copyright (C) 2002 - 2005 Joop Stakenborg <[email protected]>
4 * and many authors, see the AUTHORS file.
5 * Copyright (C) 2012 - 2015 Kamil Ignacak <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 #include "config.h"
24
25 #if HAVE_STRING_H
26 # if !STDC_HEADERS && HAVE_MEMORY_H
27 # include <memory.h>
28 # endif
29 # include <string.h>
30 #endif
31
32 #include "cwdaemon.h"
33
34 /**
35 \file null.c - null port functions
36
37 The functions do, well, nothing, except for provide convenient
38 placeholder.
39 */
40
41 /**
42 \brief Check to see whether \p fname is a null type device.
43 */
44 int dev_get_null(const char *fname)
45 {
46 if (strcmp(fname, "null") != 0) {
47 return -1;
48 } else {
49 return 0;
50 }
51 }
52
53 int null_init(cwdevice *dev, int fd)
54 {
55 dev->fd = fd;
56 return 0;
57 }
58
59 int null_free(__attribute__((unused)) cwdevice *dev)
60 {
61 return 0;
62 }
63
64 int null_reset(__attribute__((unused)) cwdevice *dev)
65 {
66 return 0;
67 }
68
69 int null_cw(__attribute__((unused)) cwdevice *dev, __attribute__((unused)) int onoff)
70 {
71 return 0;
72 }
73
74 int null_ptt(__attribute__((unused)) cwdevice *dev, __attribute__((unused)) int onoff)
75 {
76 return 0;
77 }