First step for using multiple recvs from mptp.
[swifty.git] / src / libswift / bingrep.cpp
1 #include <stdio.h>
2 #include <string.h>
3 #include "bin.h"
4
5 int main (int argn, char** args) {
6     int lr;
7     unsigned long long of;
8     sscanf(args[1],"%i,%lli",&lr,&of);
9     bin_t target(lr,of);
10     char line[1024];
11     while (gets(line)) {
12         char* br = strchr(line,'(');
13         if (br && 2==sscanf(br,"(%i,%lli)",&lr,&of)) {
14             bin_t found(lr,of);
15             if ( target.contains(found) || found.contains(target))
16                 printf("%s\n",line);
17         }
18     }
19     return 0;
20 }