FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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)
 
#define TEST_D2STR(value, expected)
 

Functions

int main (void)
 

Macro Definition Documentation

#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);
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
Definition: avstring.c:295
#define av_free(p)

Referenced by main().

#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); \
}
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:69
if(ret< 0)
Definition: vf_mcdeint.c:279

Referenced by main().

#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); \
}
#define NULL
Definition: coverity.c:32
char * av_strireplace(const char *str, const char *from, const char *to)
Locale-independent strings replace.
Definition: avstring.c:234
if(ret< 0)
Definition: vf_mcdeint.c:279
#define av_free(p)

Referenced by main().

#define TEST_D2STR (   value,
  expected 
)
Value:
if((ptr = av_d2str(value)) == NULL){ \
printf("error, received null pointer!\n"); \
} else { \
if(strcmp(ptr, expected) != 0) \
printf( "expected: %s, received: %s\n", expected, ptr); \
av_free(ptr); \
}
#define NULL
Definition: coverity.c:32
char * av_d2str(double d)
Convert a number to an av_malloced string.
Definition: avstring.c:139
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
if(ret< 0)
Definition: vf_mcdeint.c:279
#define av_free(p)

Referenced by main().

Function Documentation

int main ( void  )

Definition at line 25 of file avstring.c.