mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-06-21 02:18:24 +02:00
Minor: char const *c -> const char *c
This commit is contained in:
parent
d3c5a286c8
commit
03f4da1b46
8
ctpv.c
8
ctpv.c
@ -53,7 +53,7 @@ static void init_previews_v(void)
|
|||||||
init_previews(previews, LEN(previews));
|
init_previews(previews, LEN(previews));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *get_mimetype(char const *path)
|
static const char *get_mimetype(const char *path)
|
||||||
{
|
{
|
||||||
const char *r = magic_file(magic, path);
|
const char *r = magic_file(magic, path);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
@ -64,7 +64,7 @@ static const char *get_mimetype(char const *path)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *get_ext(char const *path)
|
static const char *get_ext(const char *path)
|
||||||
{
|
{
|
||||||
const char *base;
|
const char *base;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ static const char *get_ext(char const *path)
|
|||||||
return &dot[1];
|
return &dot[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_file(char const *f)
|
static int check_file(const char *f)
|
||||||
{
|
{
|
||||||
if (!f) {
|
if (!f) {
|
||||||
print_error("file not given");
|
print_error("file not given");
|
||||||
@ -268,7 +268,7 @@ static int list(void)
|
|||||||
|
|
||||||
static int mime(int argc, char *argv[])
|
static int mime(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char const *f, *mimetype;
|
const char *f, *mimetype;
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++) {
|
for (int i = 0; i < argc; i++) {
|
||||||
f = argv[i];
|
f = argv[i];
|
||||||
|
4
error.c
4
error.c
@ -3,12 +3,12 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
void print_error(char const *error_msg)
|
void print_error(const char *error_msg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: %s\n", program, error_msg);
|
fprintf(stderr, "%s: %s\n", program, error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_errorf(char const *format, ...)
|
void print_errorf(const char *format, ...)
|
||||||
{
|
{
|
||||||
char s[1024];
|
char s[1024];
|
||||||
FORMATTED_STRING(s, format);
|
FORMATTED_STRING(s, format);
|
||||||
|
4
error.h
4
error.h
@ -56,7 +56,7 @@ enum {
|
|||||||
ERR,
|
ERR,
|
||||||
};
|
};
|
||||||
|
|
||||||
void print_error(char const *error_msg);
|
void print_error(const char *error_msg);
|
||||||
void print_errorf(char const *format, ...);
|
void print_errorf(const char *format, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -81,7 +81,7 @@ static void break_mimetype(char *mimetype, char **type, char **subtype)
|
|||||||
|
|
||||||
#define MIMETYPE_MAX 64
|
#define MIMETYPE_MAX 64
|
||||||
|
|
||||||
static Preview *find_preview(char const *mimetype, char const *ext, size_t *i)
|
static Preview *find_preview(const char *mimetype, const char *ext, size_t *i)
|
||||||
{
|
{
|
||||||
Preview *p;
|
Preview *p;
|
||||||
char mimetype_c[MIMETYPE_MAX], *t, *s;
|
char mimetype_c[MIMETYPE_MAX], *t, *s;
|
||||||
|
2
server.c
2
server.c
@ -134,7 +134,7 @@ static void get_fifo_name(char *buf, size_t len, const char *id_s)
|
|||||||
snprintf(buf, len-1, "/tmp/ctpvfifo.%s", id_s);
|
snprintf(buf, len-1, "/tmp/ctpvfifo.%s", id_s);
|
||||||
}
|
}
|
||||||
|
|
||||||
int server_listen(char const *id_s)
|
int server_listen(const char *id_s)
|
||||||
{
|
{
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
|
2
server.h
2
server.h
@ -1,7 +1,7 @@
|
|||||||
#ifndef SERVER_H
|
#ifndef SERVER_H
|
||||||
#define SERVER_H
|
#define SERVER_H
|
||||||
|
|
||||||
int server_listen(char const *id_s);
|
int server_listen(const char *id_s);
|
||||||
int server_set_fifo_var(const char *id_s);
|
int server_set_fifo_var(const char *id_s);
|
||||||
int server_clear(const char *id_s);
|
int server_clear(const char *id_s);
|
||||||
int server_end(const char *id_s);
|
int server_end(const char *id_s);
|
||||||
|
4
utils.c
4
utils.c
@ -70,7 +70,7 @@ int spawn(char *args[], pid_t *cpid, int *exitcode, int (*cfunc)(const void *),
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int strcmpnull(char const *s1, char const *s2)
|
int strcmpnull(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
if (!s1 && !s2)
|
if (!s1 && !s2)
|
||||||
return 0;
|
return 0;
|
||||||
@ -82,7 +82,7 @@ int strcmpnull(char const *s1, char const *s2)
|
|||||||
return strcmp(s1, s2);
|
return strcmp(s1, s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int strlennull(char const *s)
|
int strlennull(const char *s)
|
||||||
{
|
{
|
||||||
return s ? strlen(s) : 0;
|
return s ? strlen(s) : 0;
|
||||||
}
|
}
|
||||||
|
4
utils.h
4
utils.h
@ -28,8 +28,8 @@ int spawn_wait(pid_t pid, int *exitcode);
|
|||||||
int spawn(char *args[], pid_t *cpid, int *exitcode, int (*cfunc)(const void *),
|
int spawn(char *args[], pid_t *cpid, int *exitcode, int (*cfunc)(const void *),
|
||||||
const void *carg);
|
const void *carg);
|
||||||
|
|
||||||
int strcmpnull(char const *s1, char const *s2);
|
int strcmpnull(const char *s1, const char *s2);
|
||||||
int strlennull(char const *s);
|
int strlennull(const char *s);
|
||||||
|
|
||||||
int get_cache_dir(char *buf, size_t len, char *name);
|
int get_cache_dir(char *buf, size_t len, char *name);
|
||||||
int mkpath(char* file_path, mode_t mode);
|
int mkpath(char* file_path, mode_t mode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user