~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/pack.h

  • Committer: Monty Taylor
  • Date: 2010-08-20 15:05:54 UTC
  • mfrom: (1720.1.7 build)
  • Revision ID: mordred@inaugust.com-20100820150554-fuwf8zs8qpzhpx6y
Added libdrizzle to the tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Drizzle Client & Protocol Library
 
3
 *
 
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
 
5
 * All rights reserved.
 
6
 *
 
7
 * Use and distribution licensed under the BSD license.  See
 
8
 * the COPYING file in this directory for full text.
 
9
 */
 
10
 
 
11
/**
 
12
 * @file
 
13
 * @brief Packing Declarations
 
14
 */
 
15
 
 
16
#ifndef __DRIZZLE_PACK_H
 
17
#define __DRIZZLE_PACK_H
 
18
 
 
19
#ifdef __cplusplus
 
20
extern "C" {
 
21
#endif
 
22
 
 
23
/**
 
24
 * @addtogroup drizzle_pack Packing Declarations
 
25
 *
 
26
 * These functions are used internally to pack various parts of the protocol.
 
27
 * Not all functions are defined in pack.c, they are in the most appropriate
 
28
 * source file (for example, handshake.c for drizzle_pack_client_handshake).
 
29
 * @{
 
30
 */
 
31
 
 
32
/**
 
33
 * Pack length-encoded number.
 
34
 */
 
35
DRIZZLE_API
 
36
uint8_t *drizzle_pack_length(uint64_t number, uint8_t *ptr);
 
37
 
 
38
/**
 
39
 * Unpack length-encoded number.
 
40
 */
 
41
DRIZZLE_API
 
42
uint64_t drizzle_unpack_length(drizzle_con_st *con, drizzle_return_t *ret_ptr);
 
43
 
 
44
/**
 
45
 * Pack length-encoded string.
 
46
 */
 
47
DRIZZLE_API
 
48
uint8_t *drizzle_pack_string(char *string, uint8_t *ptr);
 
49
 
 
50
/**
 
51
 * Unpack length-encoded string.
 
52
 */
 
53
DRIZZLE_API
 
54
drizzle_return_t drizzle_unpack_string(drizzle_con_st *con, char *buffer,
 
55
                                       uint64_t max_size);
 
56
 
 
57
/**
 
58
 * Pack user, scramble, and db.
 
59
 */
 
60
DRIZZLE_API
 
61
uint8_t *drizzle_pack_auth(drizzle_con_st *con, uint8_t *ptr,
 
62
                           drizzle_return_t *ret_ptr);
 
63
 
 
64
/** @} */
 
65
 
 
66
#ifdef __cplusplus
 
67
}
 
68
#endif
 
69
 
 
70
#endif /* __DRIZZLE_PACK_H */