Click
Loading...
Searching...
No Matches
userutils.hh
1// -*- c-basic-offset: 2; related-file-name: "../../lib/userutils.cc" -*-
2#ifndef CLICK_USERUTILS_HH
3#define CLICK_USERUTILS_HH
4#include <click/archive.hh>
5#include <stdio.h>
6CLICK_DECLS
7class ErrorHandler;
8
9inline bool glob_match(const String &string, const String &pattern) {
10 return string.glob_match(pattern);
11}
12
13String percent_substitute(const String &string, int format1, ...);
14
39int click_strcmp(const String &a, const String &b);
40
48void click_signal(int signum, void (*handler)(int), bool resethand);
49
50const char *filename_landmark(const char *, bool file_is_expr = false);
51
52String file_string(FILE *, ErrorHandler * = 0);
53String file_string(String, ErrorHandler * = 0);
54
55
56void file_read_lines(FILE*, Vector<String>&);
57int file_read_lines(String, Vector<String>&, ErrorHandler * = 0);
58
59String unique_tmpnam(const String &, ErrorHandler * = 0);
60void remove_file_on_exit(const String &);
61bool path_allows_default_path(String path);
62String click_mktmpdir(ErrorHandler * = 0);
63
64const char *clickpath();
65void set_clickpath(const char *);
66
67String clickpath_find_file(const String& filename, const char *subdir,
68 String default_path, ErrorHandler * = 0);
69void clickpath_expand_path(const char* subdir, const String& default_path, Vector<String>&);
70
71void parse_tabbed_lines(const String &, Vector<String> *, ...);
72
73ArchiveElement init_archive_element(const String &, int);
74
75String shell_quote(const String &, bool quote_tilde = false);
76String shell_command_output_string(String command_line, const String &command_stdin, ErrorHandler *);
77
78
87bool compressed_data(const unsigned char *buf, int len);
88
89FILE *open_uncompress_pipe(const String &filename, const unsigned char *buf,
90 int len, ErrorHandler *errh);
91
92int compressed_filename(const String &filename);
93FILE *open_compress_pipe(const String &filename, ErrorHandler *);
94
95uint64_t bit_extractor(const uint64_t &number, const unsigned short &k, const unsigned short &p);
96String number_to_binary_str(const uint64_t &number, const unsigned &bits_nb = 32);
97
98#if HAVE_DYNAMIC_LINKING
99int clickdl_load_package(String, ErrorHandler *);
100void clickdl_load_requirement(String, const Vector<ArchiveElement> *archive, ErrorHandler *);
101#endif
102
103CLICK_ENDDECLS
104#endif
Class for handling 'ar' archives.
Error reporting class.
Definition error.hh:90
A string of characters.
Definition string.hh:22
Vector template.
Definition vector.hh:111
Member of an 'ar' archive.
Definition archive.hh:21