File: vt_str.h

package info (click to toggle)
mlterm 3.9.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,340 kB
  • sloc: ansic: 154,713; sh: 5,302; cpp: 2,953; objc: 2,776; java: 2,472; makefile: 2,445; perl: 1,674; xml: 44
file content (36 lines) | stat: -rw-r--r-- 810 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
/* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */

#ifndef __VT_STR_H__
#define __VT_STR_H__

#include <pobl/bl_mem.h> /* alloca */

#include "vt_char.h"

void vt_str_init(vt_char_t *str, u_int size);

#define vt_str_alloca(size) ((vt_char_t*)alloca(sizeof(vt_char_t) * (size)))

vt_char_t *vt_str_new(u_int size);

void vt_str_final(vt_char_t *str, u_int size);

void vt_str_destroy(vt_char_t *str, u_int size);

int vt_str_copy(vt_char_t *dst, vt_char_t *src, u_int size);

u_int vt_str_cols(vt_char_t *chars, u_int len);

u_int vt_str_cols_to_len(vt_char_t *chars, u_int *cols);

int vt_str_equal(vt_char_t *str1, vt_char_t *str2, u_int len);

int vt_str_bytes_equal(vt_char_t *str1, vt_char_t *str2, u_int len);

#ifdef DEBUG

void vt_str_dump(vt_char_t *chars, u_int len);

#endif

#endif