~ignacio-nin/percona-server/5.1-update-handlersocket-83d8f3af

« back to all changes in this revision

Viewing changes to HandlerSocket-Plugin-for-MySQL/libhsclient/escape.hpp

  • Committer: Ignacio Nin
  • Date: 2012-11-06 21:14:08 UTC
  • Revision ID: ignacio.nin@percona.com-20121106211408-tcfqhbiysi749lyq
Update HandlerSocket by readding it to the version history

HandlerSocket wouldn't build on GCC 4.7, so update it to commit
83d8f3af176e1698acd9eb3ac5174700ace40fe0 to solve this issue.

Also due to having been added independently to the 5.1 and 5.5
branches (different file-ids), the files under HandlerSocket/ and
README.HandlerSocket would conflict when modified in 5.1 and then merged onto
5.5. In order to solve this, we remove and add all related files, and then
merge onto 5.5, so in the future the update process is smoother.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// vim:sw=2:ai
 
3
 
 
4
/*
 
5
 * Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved.
 
6
 * See COPYRIGHT.txt for details.
 
7
 */
 
8
 
 
9
#include <stdint.h>
 
10
 
 
11
#include "string_buffer.hpp"
 
12
#include "string_ref.hpp"
 
13
#include "string_util.hpp"
 
14
 
 
15
#ifndef DENA_ESCAPE_HPP
 
16
#define DENA_ESCAPE_HPP
 
17
 
 
18
namespace dena {
 
19
 
 
20
void escape_string(char *& wp, const char *start, const char *finish);
 
21
void escape_string(string_buffer& ar, const char *start, const char *finish);
 
22
bool unescape_string(char *& wp, const char *start, const char *finish);
 
23
  /* unescaped_string() works even if wp == start */
 
24
bool unescape_string(string_buffer& ar, const char *start, const char *finish);
 
25
 
 
26
uint32_t read_ui32(char *& start, char *finish);
 
27
void write_ui32(string_buffer& buf, uint32_t v);
 
28
void write_ui64(string_buffer& buf, uint64_t v);
 
29
 
 
30
inline bool
 
31
is_null_expression(const char *start, const char *finish)
 
32
{
 
33
  return (finish == start + 1 && start[0] == 0);
 
34
}
 
35
 
 
36
inline void
 
37
read_token(char *& start, char *finish)
 
38
{
 
39
  char *const p = memchr_char(start, '\t', finish - start);
 
40
  if (p == 0) {
 
41
    start = finish;
 
42
  } else {
 
43
    start = p;
 
44
  }
 
45
}
 
46
 
 
47
inline void
 
48
skip_token_delim_fold(char *& start, char *finish)
 
49
{
 
50
  while (start != finish && start[0] == '\t') {
 
51
    ++start;
 
52
  }
 
53
}
 
54
 
 
55
inline void
 
56
skip_one(char *& start, char *finish)
 
57
{
 
58
  if (start != finish) {
 
59
    ++start;
 
60
  }
 
61
}
 
62
 
 
63
};
 
64
 
 
65
#endif
 
66