1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00
picom/src/string_utils.c
Yuxuan Shui baeb4572ff
Move rendering related functions out of compton.c
Moved:
* Blur kernel related functions to kernel.c
* Vsync related functions to vsync.c
* paint related functions to render.c

This will make the `split-backend` branch easier to rebase.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-16 00:50:46 +00:00

43 lines
888 B
C

// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#include <string.h>
#include "compiler.h"
#include "string_utils.h"
#include "utils.h"
/**
* Allocate the space and join two strings.
*/
char *mstrjoin(const char *src1, const char *src2) {
auto str = ccalloc(strlen(src1)+strlen(src2)+1, char);
strcpy(str, src1);
strcat(str, src2);
return str;
}
/**
* Allocate the space and join two strings;
*/
char *
mstrjoin3(const char *src1, const char *src2, const char *src3) {
auto str = ccalloc(strlen(src1)+strlen(src2)+strlen(src3)+1, char);
strcpy(str, src1);
strcat(str, src2);
strcat(str, src3);
return str;
}
/**
* Concatenate a string on heap with another string.
*/
void mstrextend(char **psrc1, const char *src2) {
*psrc1 = crealloc(*psrc1, (*psrc1 ? strlen(*psrc1) : 0)+strlen(src2)+1);
strcat(*psrc1, src2);
}