~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/ut0mem.ic

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
99
99
}
100
100
 
101
101
/**********************************************************************//**
102
 
Compute strlen(ut_strcpyq(str, q)).
103
 
@return length of the string when quoted */
104
 
UNIV_INLINE
105
 
ulint
106
 
ut_strlenq(
107
 
/*=======*/
108
 
        const char*     str,    /*!< in: null-terminated string */
109
 
        char            q)      /*!< in: the quote character */
110
 
{
111
 
        ulint len;
112
 
 
113
 
        for (len = 0; *str; len++, str++) {
114
 
                if (*str == q) {
115
 
                        len++;
116
 
                }
117
 
        }
118
 
 
119
 
        return(len);
120
 
}
121
 
 
122
 
/**********************************************************************//**
123
102
Converts a raw binary data to a NUL-terminated hex string. The output is
124
103
truncated if there is not enough space in "hex", make sure "hex_size" is at
125
104
least (2 * raw_size + 1) if you do not want this to happen. Returns the