~ubuntu-branches/ubuntu/raring/libnotify/raring

« back to all changes in this revision

Viewing changes to tests/test-server-info.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-06-29 07:27:38 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100629072738-prk3l3rnruq2lx1x
Tags: 0.5.0-1
* New upstream release:
  + debian/rules,
    debian/compat,
    debian/control.in,
    debian/source/format,
    debian/patches/*:
    - Update to debhelper compat level 7.
    - Update to source format 3.0 (quilt).
    - Update to Standards-Version 3.8.4.
  + debian/control:
    - Update build dependencies.
  + debian/rules:
    - Update shlibs version to 0.5.0 because of new API.
  + debian/patches/01_hurd-path-max.patch:
    - Dropped, fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
2
3
 * @file tests/test-server-info.c Retrieves the server info and caps
3
4
 *
4
5
 * @Copyright (C) 2004 Mike Hearn <mike@navi.cx>
24
25
#include <stdlib.h>
25
26
 
26
27
int
27
 
main(int argc, char **argv)
 
28
main (int argc, char **argv)
28
29
{
29
 
        GList *l, *caps;
30
 
        char *name, *vendor, *version, *spec_version;
31
 
 
32
 
        notify_init("TestCaps");
33
 
 
34
 
        if (!notify_get_server_info(&name, &vendor, &version, &spec_version))
35
 
        {
36
 
                fprintf(stderr, "Failed to receive server info.\n");
37
 
                exit(1);
38
 
        }
39
 
 
40
 
        printf("Name:         %s\n", name);
41
 
        printf("Vendor:       %s\n", vendor);
42
 
        printf("Version:      %s\n", version);
43
 
        printf("Spec Version: %s\n", spec_version);
44
 
        printf("Capabilities:\n");
45
 
 
46
 
        caps = notify_get_server_caps();
47
 
 
48
 
        if (caps == NULL)
49
 
        {
50
 
                fprintf(stderr, "Failed to receive server caps.\n");
51
 
                exit(1);
52
 
        }
53
 
 
54
 
        for (l = caps; l != NULL; l = l->next)
55
 
                printf("\t%s\n", (char *)l->data);
56
 
 
57
 
        g_list_foreach(caps, (GFunc)g_free, NULL);
58
 
        g_list_free(caps);
59
 
 
60
 
        return 0;
 
30
        GList          *l, *caps;
 
31
        char           *name, *vendor, *version, *spec_version;
 
32
 
 
33
        notify_init ("TestCaps");
 
34
 
 
35
        if (!notify_get_server_info (&name, &vendor, &version, &spec_version)) {
 
36
                fprintf (stderr, "Failed to receive server info.\n");
 
37
                exit (1);
 
38
        }
 
39
 
 
40
        printf ("Name:         %s\n", name);
 
41
        printf ("Vendor:       %s\n", vendor);
 
42
        printf ("Version:      %s\n", version);
 
43
        printf ("Spec Version: %s\n", spec_version);
 
44
        printf ("Capabilities:\n");
 
45
 
 
46
        caps = notify_get_server_caps ();
 
47
 
 
48
        if (caps == NULL) {
 
49
                fprintf (stderr, "Failed to receive server caps.\n");
 
50
                exit (1);
 
51
        }
 
52
 
 
53
        for (l = caps; l != NULL; l = l->next)
 
54
                printf ("\t%s\n", (char *) l->data);
 
55
 
 
56
        g_list_foreach (caps, (GFunc) g_free, NULL);
 
57
        g_list_free (caps);
 
58
 
 
59
        return 0;
61
60
}