/* vifm
* Copyright (C) 2001 Ken Steen.
* Copyright (C) 2011 xaizek.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef VIFM__UTILS__STR_H__
#define VIFM__UTILS__STR_H__
#include <inttypes.h> /* PRIu64 */
#include <stddef.h> /* size_t wchar_t */
#include "macros.h"
#if defined(_WIN32) && !defined(_WIN64)
#ifdef BROKEN_SWPRINTF
#define WPRINTF_WSTR L"s"
#else
#define WPRINTF_WSTR L"ls"
#endif
#define PRINTF_ULL PRIu64
#else
#define WPRINTF_WSTR L"ls"
#define PRINTF_ULL "llu"
#endif
/* Various string functions. */
/* Duplicates a wide-character string. Returns pointer to new string or NULL on
* error. */
wchar_t * vifm_wcsdup(const wchar_t ws[]);
/* Checks whether str starts with the given prefix. Returns non-zero if it's
* so, otherwise zero is returned. */
int starts_with(const char str[], const char prefix[]);
/* Checks whether str starts with the given prefix of specified length. Returns
* non-zero if it's so, otherwise zero is returned. */
int starts_withn(const char str[], const char prefix[], size_t prefix_len);
/* A wrapper of swprintf() functions to make its differences on various
* platforms transparently in other parts of the program. */
int vifm_swprintf(wchar_t str[], size_t len, const wchar_t format[], ...);
/* Copies characters from the string pointed to by str to piece of memory of
* size dst_len pointed to by dst. Ensures that copied string ends with null
* character. Does nothing for zero dst_len. Returns number of characters
* written, including terminating null character. */
size_t copy_str(char dst[], size_t dst_len, const char src[]);
/* Checks if the c is one of characters in the list string. c cannot be '\0'. */
int char_is_one_of(const char *list, char c);
/* Unescapes string in place (removes extra slashes). regexp flag narrows set
* of unescaped characters to "/". */
void unescape(char s[], int regexp);
#endif /* VIFM__UTILS__STR_H__ */
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
/* vim: set cinoptions+=t0 filetype=c : */
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/libvle
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/libvle
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master