~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to libgeis/geis_backend_token.c

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file geis_backend_token.c
 
3
 * @brief internal GEIS back end token implementation
 
4
 *
 
5
 * Copyright 2011 Canonical Ltd.
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or modify it under
 
8
 * the terms of the GNU Lesser General Public License as published by the Free
 
9
 * Software Foundation; either version 3 of the License, or (at your option) any
 
10
 * later version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful, but WITHOUT
 
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
14
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 
15
 * details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
#include "geis_backend_token.h"
 
21
 
 
22
#include "geis_backend_protected.h"
 
23
#include "geis_logging.h"
 
24
 
 
25
 
 
26
/*
 
27
 * Clones a new backend token.
 
28
 */
 
29
GeisBackendToken
 
30
geis_backend_token_clone(GeisBackendToken token)
 
31
{
 
32
  return token->vtbl->clone(token);
 
33
}
 
34
 
 
35
 
 
36
/*
 
37
 * Destroys a backend token.
 
38
 */
 
39
void
 
40
geis_backend_token_delete(GeisBackendToken token)
 
41
{
 
42
  token->vtbl->finalize(token);
 
43
}
 
44
 
 
45
 
 
46
/*
 
47
 * Composes two backend tokens into a new backend token.
 
48
 */
 
49
void
 
50
geis_backend_token_compose(GeisBackendToken lhs,
 
51
                           GeisBackendToken rhs)
 
52
{
 
53
  lhs->vtbl->compose(lhs, rhs);
 
54
}
 
55
 
 
56
 
 
57
/*
 
58
 * Activates a token in the back end.
 
59
 */
 
60
GeisStatus
 
61
geis_backend_token_activate(GeisBackendToken token,
 
62
                            GeisSubscription subscription)
 
63
{
 
64
  geis_debug("called");
 
65
  return token->vtbl->activate(token, subscription);
 
66
}
 
67
 
 
68
 
 
69
/**
 
70
 * Deactivates a token in the back end.
 
71
 */
 
72
GeisStatus
 
73
geis_backend_token_deactivate(GeisBackendToken token,
 
74
                              GeisSubscription subscription)
 
75
{
 
76
  geis_debug("called");
 
77
  return token->vtbl->deactivate(token, subscription);
 
78
}
 
79
 
 
80