aboutsummaryrefslogtreecommitdiff
path: root/zinclib.d/doc/html/ZincInternal_8hpp-source.html
blob: 0d7a8b90dd03ee63bf9bc613080b7ef81240505e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>IntuiKit: ZincInternal.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>ZincInternal.hpp</h1><a href="ZincInternal_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00017 <span class="preprocessor">#include &lt;string&gt;</span>
00018 
00019 <span class="preprocessor">#include "<a class="code" href="ZincObjects_8hpp.html">ZincObjects.hpp</a>"</span>
00020 <span class="preprocessor">#ifndef BAZAR</span>
00021 <span class="preprocessor"></span><span class="preprocessor">#define BAZAR</span>
00022 <span class="preprocessor"></span>
<a name="l00023"></a><a class="code" href="ZincInternal_8hpp.html#a0">00023</a> <span class="preprocessor">#define MAX_NUM_LENGTH 32</span>
00024 <span class="preprocessor"></span>
00025 <span class="comment">// The base name of the TCL function that serve for callbacks</span>
<a name="l00026"></a><a class="code" href="ZincInternal_8hpp.html#a1">00026</a> <span class="preprocessor">#define Z_TCLCB "zincTclCb"</span>
00027 <span class="preprocessor"></span>
00038 <span class="comment">// make a boolean object</span>
<a name="l00039"></a><a class="code" href="ZincInternal_8hpp.html#a2">00039</a> <span class="preprocessor">#define Z_BOO_POOL(no, value) ( Tcl_SetBooleanObj (pool[no], value), pool[no] )</span>
00040 <span class="preprocessor"></span><span class="comment">// make an integer object</span>
<a name="l00041"></a><a class="code" href="ZincInternal_8hpp.html#a3">00041</a> <span class="preprocessor">#define Z_INT_POOL(no, value) ( Tcl_SetIntObj (pool[no], value), pool[no] )</span>
00042 <span class="preprocessor"></span><span class="comment">// make a double object</span>
<a name="l00043"></a><a class="code" href="ZincInternal_8hpp.html#a4">00043</a> <span class="preprocessor">#define Z_DBL_POOL(no, value) ( Tcl_SetDoubleObj (pool[no], value), pool[no] )</span>
00044 <span class="preprocessor"></span><span class="comment">// make a string object</span>
<a name="l00045"></a><a class="code" href="ZincInternal_8hpp.html#a5">00045</a> <span class="preprocessor">#define Z_STR_POOL(no, value, length) ( Tcl_SetStringObj (pool[no],       \</span>
00046 <span class="preprocessor">                                                          value, length), \</span>
00047 <span class="preprocessor">                                        pool[no] )</span>
00048 <span class="preprocessor"></span>
<a name="l00057"></a><a class="code" href="ZincInternal_8hpp.html#a6">00057</a> <span class="preprocessor">#define Z_LST_POOL(no, value, size) ( Tcl_SetListObj (pool[no], size, value),\</span>
00058 <span class="preprocessor">                                      pool[no] )</span>
00059 <span class="preprocessor"></span>
<a name="l00068"></a><a class="code" href="ZincInternal_8hpp.html#a7">00068</a> <span class="preprocessor">#define Z_CLEANLIST(no) Tcl_SetIntObj (pool[no], 0)</span>
00069 <span class="preprocessor"></span>
00070 
00076 <span class="comment">//create an option object (value prefixed by '-')</span>
<a name="l00077"></a><a class="code" href="ZincInternal_8hpp.html#a8">00077</a> <span class="preprocessor">#define Z_DEFINE_ZOPT(string) Tcl_Obj* ZOPT_##string = Tcl_NewStringObj ("-" #string, -1);</span>
00078 <span class="preprocessor"></span><span class="comment">//create a function object</span>
<a name="l00079"></a><a class="code" href="ZincInternal_8hpp.html#a9">00079</a> <span class="preprocessor">#define Z_DEFINE_ZFCT(string) Tcl_Obj* ZFCT_##string = Tcl_NewStringObj (#string, -1);</span>
00080 <span class="preprocessor"></span><span class="comment">//create an item object</span>
<a name="l00081"></a><a class="code" href="ZincInternal_8hpp.html#a10">00081</a> <span class="preprocessor">#define Z_DEFINE_ZITM(string) Tcl_Obj* ZITM_##string = Tcl_NewStringObj (#string, -1);</span>
00082 <span class="preprocessor"></span>
<a name="l00089"></a><a class="code" href="ZincInternal_8hpp.html#a11">00089</a> <span class="preprocessor">#define Z_PARENTGROUP(parentGroup)  \</span>
00090 <span class="preprocessor">  ( (parentGroup != NULL) ? parentGroup-&gt;object : DEFAULT_GROUP_OBJ );</span>
00091 <span class="preprocessor"></span>
<a name="l00097"></a><a class="code" href="ZincInternal_8hpp.html#a12">00097</a> <span class="keyword">inline</span> std::string <a class="code" href="ZincInternal_8hpp.html#a12">itos</a> (<span class="keywordtype">int</span> integer)
00098 {
00099   <span class="keywordtype">char</span> tmp[<a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>];
00100   <span class="comment">// use standard function to convert</span>
00101   <span class="keywordflow">if</span> (snprintf (tmp, <a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>, <span class="stringliteral">"%d"</span>, integer) &lt; 0)
00102   {
00103     <span class="keywordflow">throw</span> <a class="code" href="classZincException.html">ZincException</a> (<span class="stringliteral">"Error converting integer"</span>, __FILE__, __LINE__ );
00104   }
00105   <span class="keywordflow">return</span> std::string (tmp);
00106 }
00107 
<a name="l00113"></a><a class="code" href="ZincInternal_8hpp.html#a13">00113</a> <span class="keyword">inline</span> std::string <a class="code" href="ZincInternal_8hpp.html#a13">ltos</a> (<span class="keywordtype">long</span> l)
00114 {
00115   <span class="keywordtype">char</span> tmp[<a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>];
00116   <span class="comment">// use standard function to convert</span>
00117   <span class="keywordflow">if</span> (snprintf (tmp, <a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>, <span class="stringliteral">"%ld"</span>, l) &lt; 0)
00118   {
00119     <span class="keywordflow">throw</span> <a class="code" href="classZincException.html">ZincException</a> (<span class="stringliteral">"Error converting long"</span>, __FILE__, __LINE__ );
00120   }
00121   <span class="keywordflow">return</span> std::string (tmp);
00122 }
00123 
<a name="l00129"></a><a class="code" href="ZincInternal_8hpp.html#a14">00129</a> <span class="keyword">inline</span> std::string <a class="code" href="ZincInternal_8hpp.html#a14">dtos</a> (<span class="keywordtype">double</span> d)
00130 {
00131   <span class="keywordtype">char</span> tmp[<a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>];
00132   <span class="comment">// use standard function to convert</span>
00133   <span class="keywordflow">if</span> (snprintf (tmp, <a class="code" href="ZincInternal_8hpp.html#a0">MAX_NUM_LENGTH</a>, <span class="stringliteral">"%f"</span>, d) &lt; 0)
00134   {
00135     <span class="keywordflow">throw</span> <a class="code" href="classZincException.html">ZincException</a> (<span class="stringliteral">"Error converting double"</span>, __FILE__, __LINE__ );
00136   }
00137   <span class="keywordflow">return</span> std::string (tmp);
00138 }
00139 
00156 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Apr 18 17:40:44 2005 for IntuiKit by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.3 </small></address>
</body>
</html>