4int array_find(uint8_t byte, CData array, int ofs, int end)
6 void * data = array->data + ofs;
7 void * result = memchr(data, (int) byte, (size_t) (end - ofs));
14 return (result - data);
18void array_realloc(int size, CData array)
20 array->data = realloc(array->data, (size_t) size);
23CData array_alloc(int size)
25 return cdata_allocate((size_t) size, free);
28uint8_t array_peek(int ofs, CData array)
30 return ((uint8_t *) array->data)[ofs];
33void array_poke(int ofs, uint8_t byte, CData array)
35 ((uint8_t *) array->data)[ofs] = byte;
38int array_peek_int(int ofs, CData array)
40 return *((int *) (array->data + ofs));
43void array_poke_int(int ofs, int val, CData array)
45 *((int *) (array->data + ofs)) = val;
48void array_copy(CData src, int src_ofs, CData dst, int dst_ofs, int count)
50 // memmove rather than memcpy in case the areas overlap
51 memmove(dst->data + dst_ofs, src->data + src_ofs, count);
54void array_fill(int ofs, int count, uint8_t byte, CData array)
56 memset(array->data + ofs, byte, count);
59int array_compare(CData l, int lofs, CData r, int rofs, int count)
61 return memcmp(l->data + lofs, r->data + rofs, count);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list