FFmpeg
Macros | Functions
avstring.c File Reference
#include <stdio.h>
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/avstring.h"

Go to the source code of this file.

Macros

#define TEST_APPEND_PATH_COMPONENT(path, component, expected)
 
#define TEST_STRNSTR(haystack, needle, hay_length, expected)
 
#define TEST_STRIREPLACE(haystack, needle, expected)
 

Functions

int main (void)
 

Macro Definition Documentation

◆ TEST_APPEND_PATH_COMPONENT

#define TEST_APPEND_PATH_COMPONENT (   path,
  component,
  expected 
)
Value:
fullpath = av_append_path_component((path), (component)); \
printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
av_free(fullpath);

◆ TEST_STRNSTR

#define TEST_STRNSTR (   haystack,
  needle,
  hay_length,
  expected 
)
Value:
ptr = av_strnstr(haystack, needle, hay_length); \
if (ptr != expected){ \
printf("expected: %p, received %p\n", expected, ptr); \
}

◆ TEST_STRIREPLACE

#define TEST_STRIREPLACE (   haystack,
  needle,
  expected 
)
Value:
ptr = av_strireplace(haystack, needle, "instead"); \
if (ptr == NULL) { \
printf("error, received null pointer!\n"); \
} else { \
if (strcmp(ptr, expected) != 0) \
printf( "expected: %s, received: %s\n", expected, ptr); \
av_free(ptr); \
}

Function Documentation

◆ main()

int main ( void  )

Definition at line 25 of file avstring.c.

av_append_path_component
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
Definition: avstring.c:307
NULL
#define NULL
Definition: coverity.c:32
av_strireplace
char * av_strireplace(const char *str, const char *from, const char *to)
Locale-independent strings replace.
Definition: avstring.c:240
av_strnstr
char * av_strnstr(const char *haystack, const char *needle, size_t hay_length)
Locate the first occurrence of the string needle in the string haystack where not more than hay_lengt...
Definition: avstring.c:72