cansmi.c |
#include <stdio.h>
#include <string.h>
#include "dt_smiles.h"
int main(int argc, char *argv[])
{
dt_Handle mol;
int lencan;
char *cansmi, line[1000];
while (gets(line)) {
mol = dt_smilin(strlen(line), line);
if (mol == NULL_OB)
fprintf(stderr, "ERROR: Can't parse \"%s\"\n", line);
else {
cansmi = dt_cansmiles(&lencan, mol, 0);
if (cansmi && (lencan > 0))
printf("%.*s\n", lencan, cansmi);
else
fprintf(stderr, "ERROR: Can't make unique SMILES for \"%s\"\n", line);
dt_dealloc(mol);
}
}
return 0;
}
|
cansmi.cpp |
#include <stdio.h>
#include <string.h>
#include "dt_smiles.h"
#define _cplusplus
int main(int argc, char *argv[])
{
dt_Handle mol;
int lencan;
char *cansmi, line[1000];
while (gets(line)) {
mol = dt_smilin(strlen(line), line);
if (mol == NULL_OB)
fprintf(stderr, "ERROR: Can't parse \"%s\"\n", line);
else {
cansmi = dt_cansmiles(&lencan, mol, 0);
if (cansmi && (lencan > 0))
printf("%.*s\n", lencan, cansmi);
else
fprintf(stderr, "ERROR: Can't make unique SMILES for \"%s\"\n", line);
dt_dealloc(mol);
}
}
return 0;
}
|