|
libclosedcaption 1.0.3
Extração de closed caption ISDB-Tb/SBTVD de arquivos MPEG-TS
|
Headers padrão e macros utilitárias usadas por toda a biblioteca. Mais...
#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <stdarg.h>#include <stdbool.h>#include <string.h>#include <ctype.h>#include <assert.h>#include <errno.h>

Ir para o código-fonte desse arquivo.
Definições e Macros | |
| #define | _GNU_SOURCE |
| #define | is_latin_iso8859_15(x) (((x) >= 0x20 && (x) <= 0x7e) || ((x) >= 0xa1 && (x) <= 0xfe)) |
| #define | ARRAY_SIZE(x) ((unsigned)(sizeof(x)/sizeof((x)[0]))) |
| #define | PRINT_BOOL(x) (((x) == TRUE)?"TRUE":(((x) == FALSE)?"FALSE":"UNKNOWN")) |
| #define | UNUSED(x) x __attribute__ ((__unused__)) |
| #define | FALSE 0 |
| #define | TRUE 1 |
| #define | IS_PRINTABLE(a) ((a) >= 33 && (a) <= 126) |
| #define | DTV_DEBUG(fmt, ...) helper_print("DEBUG", __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__) |
| #define | DTV_HEXDUMP(buff, buffLen) helper_hexdump("DEBUG", __FILE__, __func__, __LINE__, #buff, #buffLen, (const char*)(buff), (buffLen)) |
Funções | |
| void | helper_hexdump (const char *platform, const char *fileFull, const char *func, uint32_t fileLine, const char *namebuff, const char *namebufflen, const char *buff, size_t buffLen) |
| void | helper_print (const char *platform, const char *fileFull, const char *func, uint32_t line, const char *format,...) __attribute__((format(printf |
Headers padrão e macros utilitárias usadas por toda a biblioteca.
Depuração
Compilando com -DDEBUG_CLOSEDCAPTION, as macros DTV_DEBUG e DTV_HEXDUMP passam a imprimir mensagens e dumps hexadecimais no stdout. Sem essa flag, elas não geram código.
Definição no arquivo caption-common.h.
| #define _GNU_SOURCE |
Habilita as extensões GNU da libc (ex: declaração de funções POSIX/GNU).
Definição na linha 18 do arquivo caption-common.h.
| #define is_latin_iso8859_15 | ( | x | ) | (((x) >= 0x20 && (x) <= 0x7e) || ((x) >= 0xa1 && (x) <= 0xfe)) |
Verifica se x é um caractere imprimível do ISO-8859-15, ou seja, se está nas faixas GL (0x20 a 0x7e) ou GR (0xa1 a 0xfe) da tabela de caracteres.
Definição na linha 35 do arquivo caption-common.h.
| #define ARRAY_SIZE | ( | x | ) | ((unsigned)(sizeof(x)/sizeof((x)[0]))) |
Quantidade de elementos de um vetor estático.
Definição na linha 41 do arquivo caption-common.h.
Converte um valor booleano em texto, para mensagens de depuração.
Definição na linha 44 do arquivo caption-common.h.
| #define UNUSED | ( | x | ) | x __attribute__ ((__unused__)) |
Marca um parâmetro como não utilizado, evitando o warning do compilador.
Definição na linha 48 do arquivo caption-common.h.
| #define FALSE 0 |
Falso. Mantido por compatibilidade; equivale a false.
Definição na linha 52 do arquivo caption-common.h.
| #define TRUE 1 |
Verdadeiro. Mantido por compatibilidade; equivale a true.
Definição na linha 57 do arquivo caption-common.h.
| #define IS_PRINTABLE | ( | a | ) | ((a) >= 33 && (a) <= 126) |
Caractere ASCII visível (sem o espaço), usado no dump hexadecimal.
Definição na linha 63 do arquivo caption-common.h.
| #define DTV_DEBUG | ( | fmt, | |
| ... | |||
| ) | helper_print("DEBUG", __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__) |
Imprime uma mensagem de depuração, no formato do printf(), com o arquivo, a linha e a função de origem. Só existe com -DDEBUG_CLOSEDCAPTION.
Definição na linha 70 do arquivo caption-common.h.
| #define DTV_HEXDUMP | ( | buff, | |
| buffLen | |||
| ) | helper_hexdump("DEBUG", __FILE__, __func__, __LINE__, #buff, #buffLen, (const char*)(buff), (buffLen)) |
Imprime o dump hexadecimal de um buffer. Só existe com -DDEBUG_CLOSEDCAPTION.
Definição na linha 79 do arquivo caption-common.h.
| void helper_hexdump | ( | const char * | platform, |
| const char * | fileFull, | ||
| const char * | func, | ||
| uint32_t | fileLine, | ||
| const char * | namebuff, | ||
| const char * | namebufflen, | ||
| const char * | buff, | ||
| size_t | buffLen | ||
| ) |
Imprime o dump hexadecimal de um buffer. Use a macro DTV_HEXDUMP.
| platform | Prefixo da mensagem (não utilizado). |
| fileFull | Arquivo de origem (__FILE__). |
| func | Função de origem (__func__). |
| fileLine | Linha de origem (__LINE__). |
| namebuff | Nome da variável do buffer. |
| namebufflen | Nome da variável do tamanho. |
| buff | Buffer. |
| buffLen | Tamanho do buffer; acima de 8192 bytes o conteúdo não é impresso. |
| void helper_print | ( | const char * | platform, |
| const char * | fileFull, | ||
| const char * | func, | ||
| uint32_t | line, | ||
| const char * | format, | ||
| ... | |||
| ) |
Imprime uma mensagem de depuração. Use a macro DTV_DEBUG.
| platform | Prefixo da mensagem (não utilizado). |
| fileFull | Arquivo de origem (__FILE__). |
| func | Função de origem (__func__). |
| line | Linha de origem (__LINE__). |
| format | Formato, como no printf(). |