File: utils-text.h

package info (click to toggle)
libxkbcommon 1.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,344 kB
  • sloc: ansic: 57,807; xml: 8,905; python: 7,451; yacc: 913; sh: 253; makefile: 23
file content (32 lines) | stat: -rw-r--r-- 697 bytes parent folder | download | duplicates (2)
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
/*
 * Copyright © 2024 Pierre Le Marre <dev@wismill.eu>
 * SPDX-License-Identifier: MIT
 */
#pragma once

#include "config.h"

#include <stddef.h>
#include <stdint.h>

char *
strip_lines(const char *input, size_t input_length, const char *prefix);

char *
uncomment(const char *input, size_t input_length, const char *prefix);

struct text_line {
    const char *start;
    size_t length;
};

size_t
split_lines(const char *input, size_t input_length,
            struct text_line *output, size_t output_length);

size_t
concat_lines(struct text_line *lines, size_t length,
             const char *sep, char *output);

size_t
shuffle_lines(struct text_line *lines, size_t length, char *output);