56 const char *table = (
char *) 0;
60 unsigned long no = 0L;
63 const char *ret = (
char *) 0;
65 if (!flagsql || (ret =
opensql(dbname,&table))) {
66 if (flagsql && *ret)
logmsg(
WHO,111,FATAL,ret);
69 if (!stralloc_catb(&
fn,
"/subscribers/?",15))
die_nomem();
76 fn.s[hashpos] = 64 + i;
85 if (getln(&
bi,&line,&
match,
'\0') == -1)
98 if (!stralloc_copys(&line,
"SELECT address FROM "))
die_nomem();
99 if (!stralloc_cats(&line,table))
die_nomem();
100 if (!stralloc_cats(&line,
" WHERE hash BETWEEN "))
die_nomem();
102 if (!stralloc_cats(&line,
" AND "))
die_nomem();
106 result = PQexec(
pgsql,line.s);
110 if (PQresultStatus(result) != PGRES_TUPLES_OK)
111 logmsg(
WHO,111,FATAL,PQresultErrorMessage(result));
116 for (row_nr = 0; row_nr < PQntuples(result); row_nr++) {
117 length = PQgetlength(result,row_nr,0);
118 row = PQgetvalue(result,row_nr,0);
unsigned long putsubs(const char *dbname, unsigned long hash_lo, unsigned long hash_hi, int subwrite(), int flagsql)
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)