-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuf_handle.h
More file actions
38 lines (28 loc) · 855 Bytes
/
Copy pathbuf_handle.h
File metadata and controls
38 lines (28 loc) · 855 Bytes
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
33
34
35
36
37
38
// Copyright (c) 2014 The Trident Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
//
#ifndef _TRIDENT_BUF_HANDLE_H_
#define _TRIDENT_BUF_HANDLE_H_
namespace trident {
struct BufHandle
{
char* data; // block header
int size; // data size
union {
int capacity; // block capacity, used by WriteBuffer
int offset; // start position in the block, used by ReadBuffer
};
BufHandle(char* _data, int _capacity)
: data(_data)
, size(0)
, capacity(_capacity) {}
BufHandle(char* _data, int _size, int _offset)
: data(_data)
, size(_size)
, offset(_offset) {}
}; // class BufHandle
} // namespace trident
#endif // _TRIDENT_BUF_HANDLE_H_
/* vim: set ts=4 sw=4 sts=4 tw=100 */