first commit

This commit is contained in:
rebane
2016-08-22 11:22:31 +03:00
commit e0d07fd491
12 changed files with 1189 additions and 0 deletions

25
make_array.c Normal file
View File

@@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
int main(){
ssize_t i, l;
uint32_t value;
uint8_t buffer[24];
int started, index;
started = index = 0;
while(1){
l = read(0, buffer, 24);
if(l < 1)break;
if(started)printf(",\n");
started = 1;
printf("\t");
for(i = 0; i < l; i += 4){
value = ((uint32_t)buffer[i + 0] << 0) | ((uint32_t)buffer[i + 1] << 8) | ((uint32_t)buffer[i + 2] << 16) | ((uint32_t)buffer[i + 3] << 24);
if(i)printf(", ");
printf("%d, 0x%08X", index++, (unsigned int)value);
}
}
printf("\n");
}