1
1
/*****************************************************************************
3
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
3
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
290
290
#endif /* !UNIV_HOTBACKUP */
292
292
/**********************************************************************//**
293
Frees a memory block allocated with ut_malloc. */
293
Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
486
489
return(src_size);
489
/**********************************************************************//**
490
Make a quoted copy of a NUL-terminated string. Leading and trailing
491
quotes will not be included; only embedded quotes will be escaped.
492
See also ut_strlenq() and ut_memcpyq().
493
@return pointer to end of dest */
498
char* dest, /*!< in: output buffer */
499
char q, /*!< in: the quote character */
500
const char* src) /*!< in: null-terminated string */
503
if ((*dest++ = *src++) == q) {
511
/**********************************************************************//**
512
Make a quoted copy of a fixed-length string. Leading and trailing
513
quotes will not be included; only embedded quotes will be escaped.
514
See also ut_strlenq() and ut_strcpyq().
515
@return pointer to end of dest */
520
char* dest, /*!< in: output buffer */
521
char q, /*!< in: the quote character */
522
const char* src, /*!< in: string to be quoted */
523
ulint len) /*!< in: length of src */
525
const char* srcend = src + len;
527
while (src < srcend) {
528
if ((*dest++ = *src++) == q) {
536
492
#ifndef UNIV_HOTBACKUP
537
493
/**********************************************************************//**
538
494
Return the number of times s2 occurs in s1. Overlapping instances of s2