OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 /* | 6 /* |
7 ** prtrace.c -- NSPR Trace Instrumentation | 7 ** prtrace.c -- NSPR Trace Instrumentation |
8 ** | 8 ** |
9 ** Implement the API defined in prtrace.h | 9 ** Implement the API defined in prtrace.h |
10 ** | 10 ** |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 if (!PR_CLIST_IS_EMPTY( &qNameList )) | 215 if (!PR_CLIST_IS_EMPTY( &qNameList )) |
216 { | 216 { |
217 qnp = (QName *) PR_LIST_HEAD( &qNameList ); | 217 qnp = (QName *) PR_LIST_HEAD( &qNameList ); |
218 do { | 218 do { |
219 if ( strcmp(qnp->name, qName) == 0) | 219 if ( strcmp(qnp->name, qName) == 0) |
220 { | 220 { |
221 matchQname = PR_TRUE; | 221 matchQname = PR_TRUE; |
222 break; | 222 break; |
223 } | 223 } |
224 qnp = (QName *)PR_NEXT_LINK( &qnp->link ); | 224 qnp = (QName *)PR_NEXT_LINK( &qnp->link ); |
225 } while( qnp != (QName *)PR_LIST_HEAD( &qNameList )); | 225 } while( qnp != (QName *)&qNameList ); |
226 } | 226 } |
227 /* | 227 /* |
228 ** If we did not find a matching QName, | 228 ** If we did not find a matching QName, |
229 ** allocate one and initialize it. | 229 ** allocate one and initialize it. |
230 ** link it onto the qNameList. | 230 ** link it onto the qNameList. |
231 ** | 231 ** |
232 */ | 232 */ |
233 if ( matchQname != PR_TRUE ) | 233 if ( matchQname != PR_TRUE ) |
234 { | 234 { |
235 qnp = PR_NEWZAP( QName ); | 235 qnp = PR_NEWZAP( QName ); |
236 PR_ASSERT( qnp != NULL ); | 236 PR_ASSERT( qnp != NULL ); |
237 PR_INIT_CLIST( &qnp->link ); | 237 PR_INIT_CLIST( &qnp->link ); |
238 PR_INIT_CLIST( &qnp->rNameList ); | 238 PR_INIT_CLIST( &qnp->rNameList ); |
239 strcpy( qnp->name, qName ); | 239 strcpy( qnp->name, qName ); |
240 PR_APPEND_LINK( &qnp->link, &qNameList ); | 240 PR_APPEND_LINK( &qnp->link, &qNameList ); |
241 } | 241 } |
242 | 242 |
243 /* Do we already have a matching RName? */ | 243 /* Do we already have a matching RName? */ |
244 if (!PR_CLIST_IS_EMPTY( &qnp->rNameList )) | 244 if (!PR_CLIST_IS_EMPTY( &qnp->rNameList )) |
245 { | 245 { |
246 rnp = (RName *) PR_LIST_HEAD( &qnp->rNameList ); | 246 rnp = (RName *) PR_LIST_HEAD( &qnp->rNameList ); |
247 do { | 247 do { |
248 /* | 248 /* |
249 ** No duplicate RNames are allowed within a QName | 249 ** No duplicate RNames are allowed within a QName |
250 ** | 250 ** |
251 */ | 251 */ |
252 PR_ASSERT( strcmp(rnp->name, rName)); | 252 PR_ASSERT( strcmp(rnp->name, rName)); |
253 rnp = (RName *)PR_NEXT_LINK( &rnp->link ); | 253 rnp = (RName *)PR_NEXT_LINK( &rnp->link ); |
254 } while( rnp != (RName *)PR_LIST_HEAD( &qnp->rNameList )); | 254 } while( rnp != (RName *)&qnp->rNameList ); |
255 } | 255 } |
256 | 256 |
257 /* Get a new RName structure; initialize its members */ | 257 /* Get a new RName structure; initialize its members */ |
258 rnp = PR_NEWZAP( RName ); | 258 rnp = PR_NEWZAP( RName ); |
259 PR_ASSERT( rnp != NULL ); | 259 PR_ASSERT( rnp != NULL ); |
260 PR_INIT_CLIST( &rnp->link ); | 260 PR_INIT_CLIST( &rnp->link ); |
261 strcpy( rnp->name, rName ); | 261 strcpy( rnp->name, rName ); |
262 strcpy( rnp->desc, description ); | 262 strcpy( rnp->desc, description ); |
263 rnp->lock = PR_NewLock(); | 263 rnp->lock = PR_NewLock(); |
264 rnp->state = Running; | 264 rnp->state = Running; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 879 |
880 *found = copied; | 880 *found = copied; |
881 rc = ( fetchLostData == PR_TRUE )? 1 : 0; | 881 rc = ( fetchLostData == PR_TRUE )? 1 : 0; |
882 fetchLostData = PR_FALSE; | 882 fetchLostData = PR_FALSE; |
883 | 883 |
884 PR_Unlock( traceLock ); | 884 PR_Unlock( traceLock ); |
885 return rc; | 885 return rc; |
886 } /* end PR_GetTraceEntries() */ | 886 } /* end PR_GetTraceEntries() */ |
887 | 887 |
888 /* end prtrace.c */ | 888 /* end prtrace.c */ |
OLD | NEW |