Help for this page

Select Code to Download


  1. or download this
    char *strstr( char *haystack, char *needle ) {
        char *hp;
    ...
        }
        return 0;                                    // Got here means we 
    +hit the terminating null of the haystack; no match; return null.
    }
    
  2. or download this
    U64 nextQuad( U64 **p, U8 o ) {                  // p: pointer to poin
    +ter to the 'current' quad; o: value of the unused bits at the beginni
    +ng.
        U64 hi = *( ++*p )                           // increment the poin
    +ter at *p, and set hi to the value it points at.
          , lo = *( *p+1 );                          // and lo to the valu
    +e + 1 it points at
        return __shiftleft128( lo, hi, o );          // return the value f
    +rom the higher location with o bits from lo shifted in from the right
    +.
    }
    
  3. or download this
    U64 nextBit( U64 **p, U8 *o ) {                  // p: pointer to poin
    +ter to current quad; o: pointer to current offset
        U64 hi, lo;
    ...
        lo = *( *p + 1 );                             // And the next
        return __shiftleft128( lo, hi, *o );          // return the value 
    +from the higher location with *o bits from lo shifted in from the rig
    +ht.
    }