test_ringbuffer_write.cpp 356 B

123456789101112131415
  1. #include "ringbuffer.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. int main()
  5. {
  6. RingBuffer rb((char*)"ringbuffer.data",5);
  7. char* data = (char*)"VOCALOID_MIKU_LUKA";
  8. rb.write(data,strlen(data));
  9. printf("written %i\n",strlen(data));
  10. fprintf(stderr,"userdata size %i\n",USERDATA_SIZE);
  11. int* tmp = (int*)rb.getUserdata();
  12. *tmp=2007;
  13. }