Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
cornett committed Jun 30, 2019
1 parent 535b6a7 commit 0117d61
Show file tree
Hide file tree
Showing 5 changed files with 1,753 additions and 1,855 deletions.
5 changes: 1 addition & 4 deletions afl/smiles/smiles.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#include <stdio.h>

#include "coho.h"


int
main(void)
int main(void)
{
struct coho_smiles smi;
char *line = NULL;
Expand Down
112 changes: 56 additions & 56 deletions coho.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,97 +15,97 @@
*/

enum coho_status {
COHO_OK,
COHO_ERROR,
COHO_NOMEM,
COHO_OK,
COHO_ERROR,
COHO_NOMEM,
};

/* Compatibility functions {{{
*/

#undef strlcpy
size_t strlcpy(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);

#undef reallocarray
void *reallocarray(void *, size_t, size_t);
void *reallocarray(void *, size_t, size_t);

/* }}} */

/* SMILES parsing {{{
*/
enum {
COHO_SMILES_BOND_UNSPECIFIED = 0,
COHO_SMILES_BOND_SINGLE = 1,
COHO_SMILES_BOND_DOUBLE = 2,
COHO_SMILES_BOND_TRIPLE = 3,
COHO_SMILES_BOND_QUAD = 4,
COHO_SMILES_BOND_AROMATIC = 5,
COHO_SMILES_BOND_UNSPECIFIED = 0,
COHO_SMILES_BOND_SINGLE = 1,
COHO_SMILES_BOND_DOUBLE = 2,
COHO_SMILES_BOND_TRIPLE = 3,
COHO_SMILES_BOND_QUAD = 4,
COHO_SMILES_BOND_AROMATIC = 5,
};

enum {
COHO_SMILES_BOND_STEREO_UNSPECIFIED,
COHO_SMILES_BOND_STEREO_UP,
COHO_SMILES_BOND_STEREO_DOWN,
COHO_SMILES_BOND_STEREO_UNSPECIFIED,
COHO_SMILES_BOND_STEREO_UP,
COHO_SMILES_BOND_STEREO_DOWN,
};

struct coho_smiles_atom {
int atomic_number;
char symbol[4];
int isotope;
int charge;
int hydrogen_count;
int implicit_hydrogen_count;
int is_bracket;
int is_organic;
int is_aromatic;
char chirality[8];
int atom_class;
int position;
int length;
int atomic_number;
char symbol[4];
int isotope;
int charge;
int hydrogen_count;
int implicit_hydrogen_count;
int is_bracket;
int is_organic;
int is_aromatic;
char chirality[8];
int atom_class;
int position;
int length;
};

struct coho_smiles_bond {
int atom0;
int atom1;
int order;
int stereo;
int is_implicit;
int is_ring;
int position;
int length;
int atom0;
int atom1;
int order;
int stereo;
int is_implicit;
int is_ring;
int position;
int length;
};

struct coho_smiles_paren {
int position;
struct coho_smiles_bond bond;
int position;
struct coho_smiles_bond bond;
};

struct coho_smiles {
const char *smiles;
int position;
int end;
char error[32];
int error_position;
const char *smiles;
int position;
int end;
char error[32];
int error_position;

int atom_count;
int bond_count;
int atom_count;
int bond_count;

struct coho_smiles_atom *atoms;
size_t atoms_capacity;
struct coho_smiles_atom *atoms;
size_t atoms_capacity;

struct coho_smiles_bond *bonds;
size_t bonds_capacity;
struct coho_smiles_bond *bonds;
size_t bonds_capacity;

struct coho_smiles_bond ring_bonds[100];
size_t open_ring_closures;
struct coho_smiles_bond ring_bonds[100];
size_t open_ring_closures;

struct coho_smiles_paren *paren_stack;
int paren_stack_count;
size_t paren_stack_capacity;
struct coho_smiles_paren *paren_stack;
int paren_stack_count;
size_t paren_stack_capacity;
};

void coho_smiles_free(struct coho_smiles *);
void coho_smiles_init(struct coho_smiles *);
int coho_smiles_parse(struct coho_smiles *, const char *, size_t);
void coho_smiles_free(struct coho_smiles *);
void coho_smiles_init(struct coho_smiles *);
int coho_smiles_parse(struct coho_smiles *, const char *, size_t);

/* }}} */
54 changes: 27 additions & 27 deletions python/coho/smiles.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,37 @@ cdef extern from "coho.h":
COHO_SMILES_BOND_STEREO_DOWN

struct coho_smiles_atom:
int atomic_number
char symbol[4]
int isotope
int charge
int hydrogen_count
int implicit_hydrogen_count
int is_bracket
int is_organic
int is_aromatic
char chirality[8]
int atom_class
int position
int length
int atomic_number
char symbol[4]
int isotope
int charge
int hydrogen_count
int implicit_hydrogen_count
int is_bracket
int is_organic
int is_aromatic
char chirality[8]
int atom_class
int position
int length

struct coho_smiles_bond:
int atom0
int atom1
int order
int is_implicit
int is_ring
int stereo
int position
int length
int atom0
int atom1
int order
int is_implicit
int is_ring
int stereo
int position
int length

struct coho_smiles:
int atom_count
int bond_count
coho_smiles_atom *atoms
coho_smiles_bond *bonds
char error[32]
int error_position
int atom_count
int bond_count
coho_smiles_atom *atoms
coho_smiles_bond *bonds
char error[32]
int error_position

void coho_smiles_free(coho_smiles *)
int coho_smiles_init(coho_smiles *)
Expand Down
Loading

0 comments on commit 0117d61

Please sign in to comment.