1 /*
2  * SNOOPY LOGGER
3  *
4  * File: snoopy/datasource/snoopy_literal.c
5  *
6  * Copyright (c) 2014-2015 Bostjan Skufca <bostjan@a2o.si>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  */
22 
23 
24 
25 /*
26  * Includes order: from local to global
27  */
28 #include "snoopy_literal.h"
29 
30 #include "snoopy.h"
31 
32 #include <stdio.h>
33 
34 
35 
36 /*
37  * SNOOPY DATA SOURCE: snoopy_literal
38  *
39  * Description:
40  *     Dummy data source that returns literal string that is passed to it as argument.
41  *
42  * Params:
43  *     result: pointer to string, to write result into
44  *     arg:    (ignored)
45  *
46  * Return:
47  *     number of characters in the returned string, or SNOOPY_DATASOURCE_FAILURE
48  */
snoopy_datasource_snoopy_literal(char * const result,char const * const arg)49 int snoopy_datasource_snoopy_literal (char * const result, char const * const arg)
50 {
51     return snprintf(result, SNOOPY_DATASOURCE_MESSAGE_MAX_SIZE, "%s", arg);
52 }
53