register.c (519B)
1 #include <stdlib.h> 2 #include <string.h> 3 4 #include "common.h" 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 extern struct Format *supercop_formats; 11 12 void __attribute__ ((constructor)) fmt_0x00_register() { 13 struct Format *fmt = calloc(1, sizeof(struct Format)); 14 fmt->next = supercop_formats; 15 fmt->name = calloc(1,5); 16 fmt->detect = fmt_0x00_detect; 17 fmt->encode = fmt_0x00_encode; 18 fmt->decode = fmt_0x00_decode; 19 supercop_formats = fmt; 20 strcpy(fmt->name, "0x00"); 21 } 22 23 #ifdef __cplusplus 24 } // extern "C" 25 #endif