CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
object_print_util.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2008 Search Solution Corporation
3
* Copyright 2016 CUBRID Corporation
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
/*
20
* object_print_util.cpp
21
*/
22
23
#include "
object_print_util.hpp
"
24
25
#include "
work_space.h
"
26
27
#include <assert.h>
28
29
/*
30
* obj_print_free_strarray() - Most of the help functions build an array of
31
* strings that contains the descriptions
32
* of the object
33
* return: none
34
* strs(in) : array of strings
35
*
36
* Note :
37
* This function frees the array when it is no longer necessary.
38
*/
39
void
object_print::free_strarray
(
char
**strs)
40
{
41
int
i
;
42
43
if
(strs ==
NULL
)
44
{
45
return
;
46
}
47
48
for
(i = 0; strs[
i
] !=
NULL
; i++)
49
{
50
free_and_init
(strs[i]);
51
}
52
53
free_and_init
(strs);
54
}
55
56
/*
57
* obj_print_copy_string() - Copies a string, allocating space with malloc
58
* return: new string
59
* source(in) : string to copy
60
*/
61
char
*
object_print::copy_string
(
const
char
*source)
62
{
63
char
*new_str =
NULL
;
64
65
if
(source !=
NULL
)
66
{
67
new_str = (
char
*) malloc (
strlen
(source) + 1);
68
if
(new_str !=
NULL
)
69
{
70
strcpy (new_str, source);
71
}
72
}
73
74
return
new_str;
75
}
object_print::copy_string
char * copy_string(const char *source)
Definition:
object_print_util.cpp:61
work_space.h
NULL
#define NULL
Definition:
freelistheap.h:34
object_print::free_strarray
void free_strarray(char **strs)
Definition:
object_print_util.cpp:39
free_and_init
#define free_and_init(ptr)
Definition:
memory_alloc.h:147
strlen
#define strlen(s1)
Definition:
intl_support.c:43
object_print_util.hpp
i
int i
Definition:
dynamic_load.c:954
src
object
object_print_util.cpp
Generated by
1.8.11