~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/include/buffer.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-02-05 10:07:38 UTC
  • mfrom: (1.1.7) (0.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120205100738-00s0bxx93mamy8tk
Tags: 0.41-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#ifndef CEPH_BUFFER_H
16
16
#define CEPH_BUFFER_H
17
17
 
 
18
#if defined(__linux__)
18
19
#include <linux/types.h>
 
20
#elif defined(__FreeBSD__)
 
21
#include <sys/types.h>
 
22
#include "include/inttypes.h"
 
23
#endif
19
24
 
20
25
#ifndef _XOPEN_SOURCE
21
26
# define _XOPEN_SOURCE 600
34
39
void    *valloc(size_t);
35
40
#endif
36
41
 
37
 
 
38
 
 
39
 
#else
40
 
 
 
42
#endif
 
43
 
 
44
#if defined(__linux__)  // For malloc(2).
41
45
#include <malloc.h>
42
46
#endif
 
47
 
43
48
#include <stdint.h>
 
49
#include <stdio.h>      // snprintf
44
50
#include <string.h>
45
51
 
46
52
#ifndef __CYGWIN__
162
168
    bool at_buffer_head() const { return _off == 0; }
163
169
    bool at_buffer_tail() const;
164
170
 
165
 
    bool is_page_aligned() const { return ((long)c_str() & ~PAGE_MASK) == 0; }
166
 
    bool is_n_page_sized() const { return (length() & ~PAGE_MASK) == 0; }
 
171
    bool is_page_aligned() const { return ((long)c_str() & ~CEPH_PAGE_MASK) == 0; }
 
172
    bool is_n_page_sized() const { return (length() & ~CEPH_PAGE_MASK) == 0; }
167
173
 
168
174
    // accessors
169
175
    raw *get_raw() const { return _raw; }