libssh  0.11.0
The SSH library
Loading...
Searching...
No Matches
token.h
1/*
2 * token.h - Tokens list handling
3 *
4 * This file is part of the SSH Library
5 *
6 * Copyright (c) 2019 by Red Hat, Inc.
7 *
8 * Author: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
9 *
10 * The SSH Library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
13 * option) any later version.
14 *
15 * The SSH Library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with the SSH Library; see the file COPYING. If not, write to
22 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 * MA 02111-1307, USA.
24 */
25
26#ifndef TOKEN_H_
27#define TOKEN_H_
28
29struct ssh_tokens_st {
30 char *buffer;
31 char **tokens;
32};
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38struct ssh_tokens_st *ssh_tokenize(const char *chain, char separator);
39
40void ssh_tokens_free(struct ssh_tokens_st *tokens);
41
42char *ssh_find_matching(const char *available_d,
43 const char *preferred_d);
44
45char *ssh_find_all_matching(const char *available_d,
46 const char *preferred_d);
47
48char *ssh_remove_duplicates(const char *list);
49
50char *ssh_append_without_duplicates(const char *list,
51 const char *appended_list);
52char *ssh_prefix_without_duplicates(const char *list,
53 const char *prefixed_list);
54char *ssh_remove_all_matching(const char *list,
55 const char *remove_list);
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* TOKEN_H_ */