File: test_api_seap_string.c

package info (click to toggle)
openscap 1.0.9-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 129,588 kB
  • ctags: 26,325
  • sloc: xml: 611,156; ansic: 90,367; sh: 26,693; makefile: 2,463; python: 804; perl: 445; cpp: 123
file content (32 lines) | stat: -rw-r--r-- 609 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

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <sexp.h>
#include <string.h>

int main (void)
{
        SEXP_t *s_exp;
        char   *s1, *s2;

        s1 = "Hello, world!";
        s2 = "abcdefghijklmnopqrstuvwxyz";

        setbuf (stdout, NULL);
        
        s_exp = SEXP_string_new (s1, strlen (s1));
        SEXP_fprintfa (stdout, s_exp);
        putc ('\n', stdout);

        SEXP_free (s_exp);
        
        s_exp = SEXP_string_newf ("s2=%s", s2);
        SEXP_fprintfa (stdout, s_exp);
        putc ('\n', stdout);
        
        SEXP_free (s_exp);
        
        return (0);
}