~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
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
113
113
        ulint   n);     /*!< in: try to allocate this many bytes */
114
114
#endif /* !UNIV_HOTBACKUP */
115
115
/**********************************************************************//**
116
 
Frees a memory block allocated with ut_malloc. */
 
116
Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
 
117
a nop. */
117
118
UNIV_INTERN
118
119
void
119
120
ut_free(
209
210
        ulint           size);  /*!< in: size of destination buffer */
210
211
 
211
212
/**********************************************************************//**
212
 
Compute strlen(ut_strcpyq(str, q)).
213
 
@return length of the string when quoted */
214
 
UNIV_INLINE
215
 
ulint
216
 
ut_strlenq(
217
 
/*=======*/
218
 
        const char*     str,    /*!< in: null-terminated string */
219
 
        char            q);     /*!< in: the quote character */
220
 
 
221
 
/**********************************************************************//**
222
 
Make a quoted copy of a NUL-terminated string.  Leading and trailing
223
 
quotes will not be included; only embedded quotes will be escaped.
224
 
See also ut_strlenq() and ut_memcpyq().
225
 
@return pointer to end of dest */
226
 
UNIV_INTERN
227
 
char*
228
 
ut_strcpyq(
229
 
/*=======*/
230
 
        char*           dest,   /*!< in: output buffer */
231
 
        char            q,      /*!< in: the quote character */
232
 
        const char*     src);   /*!< in: null-terminated string */
233
 
 
234
 
/**********************************************************************//**
235
 
Make a quoted copy of a fixed-length string.  Leading and trailing
236
 
quotes will not be included; only embedded quotes will be escaped.
237
 
See also ut_strlenq() and ut_strcpyq().
238
 
@return pointer to end of dest */
239
 
UNIV_INTERN
240
 
char*
241
 
ut_memcpyq(
242
 
/*=======*/
243
 
        char*           dest,   /*!< in: output buffer */
244
 
        char            q,      /*!< in: the quote character */
245
 
        const char*     src,    /*!< in: string to be quoted */
246
 
        ulint           len);   /*!< in: length of src */
247
 
 
248
 
/**********************************************************************//**
249
213
Return the number of times s2 occurs in s1. Overlapping instances of s2
250
214
are only counted once.
251
215
@return the number of times s2 occurs in s1 */