File: locus.h

package info (click to toggle)
aoeui 1.4-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 440 kB
  • ctags: 574
  • sloc: ansic: 6,005; makefile: 76; sh: 11
file content (27 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright 2007, 2008 Peter Klausler.  See COPYING for license. */
#ifndef LOCUS_H
#define LOCUS_H

/* A locus is a fixed point in a view, an offset that get adjusted
 * when insertions and deletions occur before its position.
 */

typedef unsigned locus_t;

/* loci in all views */
#define CURSOR 0
#define MARK 1
#define NO_LOCUS (~0u)
#define DEFAULT_LOCI (MARK+1)

#define UNSET (~0)

struct view;

locus_t locus_create(struct view *, position_t);
void locus_destroy(struct view *, locus_t);
position_t locus_get(struct view *, locus_t);
position_t locus_set(struct view *, locus_t, position_t);
void loci_adjust(struct view *, position_t, int delta);

#endif