- /* TODO: Error handling. */
- srd_init();
- register_pds(NULL, opt_pds);
+ if (srd_init() != SRD_OK) {
+ printf("Failed to initialize sigrokdecode\n");
+ return 1;
+ }
+ if (register_pds(NULL, opt_pds) != 0) {
+ printf("Failed to register protocol decoders\n");
+ return 1;
+ }
+ if (srd_register_callback(SRD_OUTPUT_ANNOTATION,
+ show_pd_annotation) != SRD_OK) {
+ printf("Failed to register protocol decoder callback\n");
+ return 1;
+ }