deps/kb_meme/meme-5.0.1/src/meme-sax.c
/*****************************************************************************
 * Creates the data to be passed to the SAX parser
 ****************************************************************************/
Creates the data to be passed to the SAX parser
Creates the data to be passed to the SAX parser
void* create_meme_io_xml_sax_context(void *user_data, MEME_IO_XML_CALLBACKS_T *callbacks) {
  PS_T *ps;
  CHARBUF_T *buf;
  ps = (PS_T*)mm_malloc(sizeof(PS_T));
  memset(ps, 0, sizeof(PS_T));
  ps->udepth = 0;
  ps->state = PS_START;
  ps->callbacks = callbacks;
  ps->user_data = user_data;
  attrbuf_init(&(ps->attrbuf));
  buf = &(ps->characters);
  buf->buffer = mm_malloc(sizeof(char)*10);
  buf->buffer[0] = '\0';
  buf->size = 10;
  buf->pos = 0;
  ps->letter_id_buf = mm_malloc(sizeof(char)*10);
  ps->letter_id_buf[0] = '\0';
  ps->letter_id_buf_len = 10;
  ps->expected_stack = linklst_create();
  return ps;
}
void * create_meme_io_xml_sax_context ( void * user_data , MEME_IO_XML_CALLBACKS_T * callbacks ) { PS_T * ps ; CHARBUF_T * buf ; ps = ( PS_T * ) mm_malloc ( sizeof ( PS_T ) ) ; memset ( ps , 0 , sizeof ( PS_T ) ) ; ps -> udepth = 0 ; ps -> state = PS_START ; ps -> callbacks = callbacks ; ps -> user_data = user_data ; attrbuf_init ( & ( ps -> attrbuf ) ) ; buf = & ( ps -> characters ) ; buf -> buffer = mm_malloc ( sizeof ( char ) * 10 ) ; buf -> buffer [ 0 ] = ' \0 ' ; buf -> size = 10 ; buf -> pos = 0 ; ps -> letter_id_buf = mm_malloc ( sizeof ( char ) * 10 ) ; ps -> letter_id_buf [ 0 ] = ' \0 ' ; ps -> letter_id_buf_len = 10 ; ps -> expected_stack = linklst_create ( ) ; return ps ; }
Creates the data to be passed to the SAX parser
Creates the data to be passed to the SAX parser
// setup attribute buffer //set up character buffer //set up attribute buffer (needed for an alphabet array value) //set up expected queue