Advertisement
Danack

HashTableCheck

Sep 3rd, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. void dumpHashTable(HashTable *ht) {
  2.  
  3. Bucket *p = ht->pListHead;
  4. int outputType = 0;
  5.  
  6. while ( p != 0 ){
  7. // set $i = $ind
  8. // while $i > 0
  9. // printf " "
  10. // set $i = $i - 1
  11. // end
  12.  
  13. if (p->nKeyLength > 0) {
  14. php_printf("arKey %x nKeyLength %d", p->arKey, p->nKeyLength);
  15. php_printf(" => ");
  16. }
  17. else {
  18. php_printf("h %d => ", p->h);
  19. }
  20.  
  21. switch(outputType) {
  22.  
  23. case(0):{
  24. php_printf("%p\n", (void*)p->pData);
  25. break;
  26. }
  27. case(1):{
  28. // set $zval = *(zval **)$p->pData
  29. // ____printzv $zval 1
  30. break;
  31. }
  32. case(2):{
  33. //printf "%s\n", (char*)$p->pData
  34. break;
  35. }
  36. }
  37.  
  38.  
  39. // if (lcnamel > 40) {
  40. // char *debugPosition = (char*)position;
  41. //
  42. // php_printf("\nscan chars: ");
  43. //
  44. // for (i=0 ; i<lcnamel ; i++) {
  45. // php_printf("%c", debugPosition[i]);
  46. // }
  47. //
  48. // php_printf("\nscan hex: ");
  49. // for (i=0 ; i<lcnamel ; i++) {
  50. // php_printf("%x", debugPosition[i]);
  51. // }
  52. // }
  53.  
  54.  
  55.  
  56. p = p->pListNext;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement