/*
  Copyright (c) 2017  Niklas Niehus <niklas.niehus@live.com>
  Copyright (c) 2017  Center for Bioinformatics, University of Hamburg

  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef SEQUENCE_BUFFER_DUST_H
#define SEQUENCE_BUFFER_DUST_H

#include "core/types_api.h"
#include "core/error_api.h"

/* implements dust functionality for the sequence buffer */
typedef struct GtDustMasker GtDustMasker;
typedef struct GtSequenceBuffer GtSequenceBuffer;

GtDustMasker*           gt_dust_masker_new(bool echo, GtUword windowsize,
                                          double threshold, GtUword linker);

void                    gt_dust_masker_delete(GtDustMasker *dust_masker);

/* Fetches next character from <GtSequenceBuffer>.
   This method also always delivers the original character at the current
   reading position, regardless of symbol mappings that may apply.
   Returns 1 if a new character could be read, 0 if all files are exhausted, or
   -1 on error (see the <GtError> object for details). */
int           gt_dust_masker_next_with_original(GtDustMasker* dust_masker,
                                               GtSequenceBuffer* sb,
                                               GtUchar *val, char *orig,
                                               GtError* err);
#endif
