Esempio n. 1
0
File: psl.c Progetto: jcajka/libpsl
/**
 * psl_load_free:
 * @psl: PSL context pointer
 *
 * This function frees the the PSL context that has been retrieved via
 * psl_load_fp() or psl_load_file().
 *
 * Returns: Pointer to a PSL context private or %NULL on failure.
 *
 * Since: 0.1
 */
void psl_free(psl_ctx_t *psl)
{
	if (psl && psl != &_builtin_psl) {
		_vector_free(&psl->suffixes);
		_vector_free(&psl->suffix_exceptions);
		free(psl);
	}
}
Esempio n. 2
0
void @TYPE@_vector_select_unique(@TYPE@_vector_type * vector) {
  @TYPE@_vector_assert_writable( vector ); 
  {
    @TYPE@_vector_type * copy = @TYPE@_vector_alloc_copy( vector );
    @TYPE@_vector_sort( copy );
    @TYPE@_vector_reset( vector );
    {
      int i;
      @TYPE@ previous_value = @TYPE@_vector_iget( copy , 0);
      @TYPE@_vector_append( vector , previous_value);
      
      for (i=1; i <  copy->size; i++) {
        @TYPE@ value = @TYPE@_vector_iget( copy , i );
        if (value != previous_value)
          @TYPE@_vector_append( vector , value);
        previous_value = value;
      }
    }
    @TYPE@_vector_free( copy );
  }
}
Esempio n. 3
0
void @TYPE@_vector_free__(void * __vector) {
  @TYPE@_vector_type * vector = (@TYPE@_vector_type *) __vector;
  @TYPE@_vector_free( vector );
}