~phablet-team/ofono/ofono-bug-updates

« back to all changes in this revision

Viewing changes to gril/parcel.h

  • Committer: Denis Kenzior
  • Author(s): Lucas De Marchi
  • Date: 2011-03-18 23:31:14 UTC
  • Revision ID: git-v1:888e07863b24026413bac8f449de377c879e1044
message: add cancelled state

Based on patch from Yang Gu <gyagp0@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2011 Joel Armstrong <jcarmst@sandia.gov>
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License (`GPL') as published by
6
 
 * the Free Software Foundation; either version 2 of the License, or
7
 
 * (at your option) any later version.
8
 
 
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
 
 *
18
 
 * Based on parcel implementation from https://bitbucket.org/floren/inferno
19
 
 *
20
 
 */
21
 
 
22
 
#ifndef __PARCEL_H
23
 
#define __PARCEL_H
24
 
 
25
 
#include <stdlib.h>
26
 
 
27
 
struct parcel {
28
 
        char *data;
29
 
        size_t offset;
30
 
        size_t capacity;
31
 
        size_t size;
32
 
        int malformed;
33
 
};
34
 
 
35
 
void parcel_init(struct parcel *p);
36
 
void parcel_grow(struct parcel *p, size_t size);
37
 
void parcel_free(struct parcel *p);
38
 
int32_t parcel_r_int32(struct parcel *p);
39
 
int parcel_w_int32(struct parcel *p, int32_t val);
40
 
int parcel_w_string(struct parcel *p, const char *str);
41
 
char *parcel_r_string(struct parcel *p);
42
 
size_t parcel_data_avail(struct parcel *p);
43
 
 
44
 
#endif