aboutsummaryrefslogtreecommitdiff
path: root/doc/oscl_html/oscl__uuid__utils_8h_source.html
blob: ff2b134dfce08a3d11294ab60a18fa4fb099f3e6 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>oscl: oscl_uuid_utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>oscl_uuid_utils.h</h1><a href="oscl__uuid__utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef OSCL_UUID_UTILS_H_INCLUDED</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_UUID_UTILS_H_INCLUDED</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef OSCL_STRING_UTILS_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__string__utils_8h.html" title="Utilities to parse and convert strings.">oscl_string_utils.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#endif</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef OSCL_STDSTRING_H_INCLUDED</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="oscl__stdstring_8h.html" title="This file provides standard string operations such as strlen, strncpy, etc. ANSI...">oscl_stdstring.h</a>&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#endif</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a><a class="code" href="oscl__uuid__utils_8h.html#a3db93c2fbb5c6029c2f75c87d37eb93f">00016</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="oscl__uuid__utils_8h.html#a3db93c2fbb5c6029c2f75c87d37eb93f">PV_CHAR_CLOSE_BRACKET</a> = <span class="charliteral">&#39;)&#39;</span>;
<a name="l00017"></a><a class="code" href="oscl__uuid__utils_8h.html#acadd7c3a722f6b8d81bfaafa08efeeb1">00017</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="oscl__uuid__utils_8h.html#acadd7c3a722f6b8d81bfaafa08efeeb1">PV_CHAR_COMMA</a> = <span class="charliteral">&#39;,&#39;</span>;
<a name="l00018"></a>00018 <span class="keyword">static</span> <span class="keywordtype">void</span> SetOsclUuid(<a class="code" href="structOsclUuid.html">OsclUuid</a>&amp; uuid, <span class="keyword">const</span> <span class="keywordtype">char</span>* aUuidString)
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020     <span class="comment">//Initialize all data members to 0 to begin with</span>
<a name="l00021"></a>00021     uuid.<a class="code" href="structOsclUuid.html#a68cb5c474b86e133282108a37e54fdee">data1</a> = uuid.<a class="code" href="structOsclUuid.html#ae4d0cdf81939ab966fdeb9bcf469d04d">data2</a> = uuid.<a class="code" href="structOsclUuid.html#a12e846b1da686cc871517192f7dad43a">data3</a> = 0;
<a name="l00022"></a>00022 
<a name="l00023"></a>00023     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> ii = 0; ii &lt; 8; ++ii)
<a name="l00024"></a>00024     {
<a name="l00025"></a>00025         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[ii] = 0;
<a name="l00026"></a>00026     }
<a name="l00027"></a>00027 
<a name="l00028"></a>00028     <span class="keywordflow">if</span> (!aUuidString)
<a name="l00029"></a>00029     {
<a name="l00030"></a>00030         <span class="keywordflow">return</span>;
<a name="l00031"></a>00031     }
<a name="l00032"></a>00032     <span class="keywordtype">int</span> uuidStrLen = <a class="code" href="group__osclbase.html#ga7a69d1e37d0d89889020234ddab938a1">oscl_strlen</a>(aUuidString);
<a name="l00033"></a>00033 
<a name="l00034"></a>00034     <span class="keywordflow">if</span> (uuidStrLen != 0)
<a name="l00035"></a>00035     {
<a name="l00036"></a>00036         <span class="keyword">const</span> <span class="keywordtype">char</span>* sptr = <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>, *eptr = <a class="code" href="group__osclbase.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="The NULL_TERM_CHAR is used to terminate c-style strings.">NULL</a>;
<a name="l00037"></a>00037         <span class="keywordtype">int</span> commaval = 0;
<a name="l00038"></a>00038         sptr = aUuidString;
<a name="l00039"></a>00039         ++sptr; <span class="comment">//Increment over the starting parantheses &#39;(&#39;</span>
<a name="l00040"></a>00040         eptr = sptr;
<a name="l00041"></a>00041         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; uuidStrLen - 1 ; ++i)
<a name="l00042"></a>00042         {
<a name="l00043"></a>00043             <span class="keywordflow">if</span> ((*eptr != <a class="code" href="oscl__uuid__utils_8h.html#acadd7c3a722f6b8d81bfaafa08efeeb1">PV_CHAR_COMMA</a>) &amp;&amp; (*eptr != <a class="code" href="oscl__uuid__utils_8h.html#a3db93c2fbb5c6029c2f75c87d37eb93f">PV_CHAR_CLOSE_BRACKET</a>)) <span class="comment">//Increment the pointer unless you get to the &quot;,&quot;</span>
<a name="l00044"></a>00044             {                               <span class="comment">//The comma signifies the beginning of the new OsclUuid parameter</span>
<a name="l00045"></a>00045                 ++eptr;
<a name="l00046"></a>00046             }
<a name="l00047"></a>00047             <span class="keywordflow">else</span>
<a name="l00048"></a>00048             {
<a name="l00049"></a>00049                 sptr = sptr + 2;<span class="comment">//Move over the 0x characters in the beginning of the hex value;</span>
<a name="l00050"></a>00050                 ++commaval;
<a name="l00051"></a>00051                 <span class="keywordflow">switch</span> (commaval)
<a name="l00052"></a>00052                 {
<a name="l00053"></a>00053                     <span class="keywordflow">case</span> 1:
<a name="l00054"></a>00054                     {
<a name="l00055"></a>00055                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, eptr - sptr, uuid.<a class="code" href="structOsclUuid.html#a68cb5c474b86e133282108a37e54fdee">data1</a>);
<a name="l00056"></a>00056                         <span class="keywordflow">break</span>;
<a name="l00057"></a>00057                     }
<a name="l00058"></a>00058                     <span class="keywordflow">case</span> 2:
<a name="l00059"></a>00059                     {
<a name="l00060"></a>00060                         uint32 tempdata2 = 0;
<a name="l00061"></a>00061                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata2);
<a name="l00062"></a>00062                         uuid.<a class="code" href="structOsclUuid.html#ae4d0cdf81939ab966fdeb9bcf469d04d">data2</a> = (uint16)tempdata2;
<a name="l00063"></a>00063                         <span class="keywordflow">break</span>;
<a name="l00064"></a>00064                     }
<a name="l00065"></a>00065                     <span class="keywordflow">case</span> 3:
<a name="l00066"></a>00066                     {
<a name="l00067"></a>00067                         uint32 tempdata3 = 0;
<a name="l00068"></a>00068                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata3);
<a name="l00069"></a>00069                         uuid.<a class="code" href="structOsclUuid.html#a12e846b1da686cc871517192f7dad43a">data3</a> = (uint16)tempdata3;
<a name="l00070"></a>00070                         <span class="keywordflow">break</span>;
<a name="l00071"></a>00071                     }
<a name="l00072"></a>00072                     <span class="keywordflow">case</span> 4:
<a name="l00073"></a>00073                     {
<a name="l00074"></a>00074                         uint32 tempdata4_0 = 0;
<a name="l00075"></a>00075                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_0);
<a name="l00076"></a>00076                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[0] = (uint8)tempdata4_0;
<a name="l00077"></a>00077                         <span class="keywordflow">break</span>;
<a name="l00078"></a>00078                     }
<a name="l00079"></a>00079                     <span class="keywordflow">case</span> 5:
<a name="l00080"></a>00080                     {
<a name="l00081"></a>00081                         uint32 tempdata4_1 = 0;
<a name="l00082"></a>00082                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_1);
<a name="l00083"></a>00083                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[1] = (uint8)tempdata4_1;
<a name="l00084"></a>00084                         <span class="keywordflow">break</span>;
<a name="l00085"></a>00085                     }
<a name="l00086"></a>00086                     <span class="keywordflow">case</span> 6:
<a name="l00087"></a>00087                     {
<a name="l00088"></a>00088                         uint32 tempdata4_2 = 0;
<a name="l00089"></a>00089                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_2);
<a name="l00090"></a>00090                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[2] = (uint8)tempdata4_2;
<a name="l00091"></a>00091                         <span class="keywordflow">break</span>;
<a name="l00092"></a>00092                     }
<a name="l00093"></a>00093                     <span class="keywordflow">case</span> 7:
<a name="l00094"></a>00094                     {
<a name="l00095"></a>00095                         uint32 tempdata4_3 = 0;
<a name="l00096"></a>00096                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_3);
<a name="l00097"></a>00097                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[3] = (uint8)tempdata4_3;
<a name="l00098"></a>00098                         <span class="keywordflow">break</span>;
<a name="l00099"></a>00099                     }
<a name="l00100"></a>00100                     <span class="keywordflow">case</span> 8:
<a name="l00101"></a>00101                     {
<a name="l00102"></a>00102                         uint32 tempdata4_4 = 0;
<a name="l00103"></a>00103                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_4);
<a name="l00104"></a>00104                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[4] = (uint8)tempdata4_4;
<a name="l00105"></a>00105                         <span class="keywordflow">break</span>;
<a name="l00106"></a>00106                     }
<a name="l00107"></a>00107                     <span class="keywordflow">case</span> 9:
<a name="l00108"></a>00108                     {
<a name="l00109"></a>00109                         uint32 tempdata4_5 = 0;
<a name="l00110"></a>00110                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_5);
<a name="l00111"></a>00111                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[5] = (uint8)tempdata4_5;
<a name="l00112"></a>00112                         <span class="keywordflow">break</span>;
<a name="l00113"></a>00113                     }
<a name="l00114"></a>00114                     <span class="keywordflow">case</span> 10:
<a name="l00115"></a>00115                     {
<a name="l00116"></a>00116                         uint32 tempdata4_6 = 0;
<a name="l00117"></a>00117                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr , <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_6);
<a name="l00118"></a>00118                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[6] = (uint8)tempdata4_6;
<a name="l00119"></a>00119                         <span class="keywordflow">break</span>;
<a name="l00120"></a>00120                     }
<a name="l00121"></a>00121                     <span class="keywordflow">case</span> 11:
<a name="l00122"></a>00122                     {
<a name="l00123"></a>00123                         uint32 tempdata4_7 = 0;
<a name="l00124"></a>00124                         <a class="code" href="group__osclutil.html#ga95d18be7779bbb9cd14d2a1f563809ef">PV_atoi</a>(sptr, <span class="charliteral">&#39;x&#39;</span>, (eptr - sptr), tempdata4_7);
<a name="l00125"></a>00125                         uuid.<a class="code" href="structOsclUuid.html#ae6837a75d61886a71c74d8a4446fc89e">data4</a>[7] = (uint8)tempdata4_7;
<a name="l00126"></a>00126                         <span class="keywordflow">break</span>;
<a name="l00127"></a>00127                     }
<a name="l00128"></a>00128                 }
<a name="l00129"></a>00129                 <span class="keywordflow">if</span> (*eptr == <a class="code" href="oscl__uuid__utils_8h.html#a3db93c2fbb5c6029c2f75c87d37eb93f">PV_CHAR_CLOSE_BRACKET</a>) <span class="comment">//Break from the loop on finding</span>
<a name="l00130"></a>00130                 {
<a name="l00131"></a>00131                     <span class="keywordflow">break</span>;
<a name="l00132"></a>00132                 }
<a name="l00133"></a>00133                 ++eptr;
<a name="l00134"></a>00134                 sptr = eptr;
<a name="l00135"></a>00135             }
<a name="l00136"></a>00136         }
<a name="l00137"></a>00137     }
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139 <span class="preprocessor">#endif</span>
<a name="l00140"></a>00140 <span class="preprocessor"></span>
<a name="l00141"></a>00141 
</pre></div></div>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: CORE_9.004.1.1 </small>
</small></address>
</body>
</html>