type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | STATUS copy(
const char *inFilename,
const char *outFilename
)
{
int inFd;
int outFd;
STATUS status;
/* Get input file descriptor */
if (inFilename != NULL)
{
inFd = open(inFilename, O_RDONLY, 0);
} |
functions | void usrPathCat(
const char *dirname,
const char *filename,
char *result
)
{
*result = EOS;
if ((dirname != NULL) && (dirname[0] != EOS) &&
(strcmp(dirname, ".") != 0))
{
strcpy(result, dirname);
strcat(result, "/");
} |
functions | BOOL nameHasWildcard(
const char *path
)
{
BOOL ret;
if ((strchr(path, '*') != NULL) || (strchr(path, '?') != NULL))
{
ret = TRUE;
} |
functions | BOOL nameIsDir(
const char *path
)
{
BOOL ret;
struct stat st;
if ((path == NULL) || (path[0] == EOS))
{
ret = FALSE;
} |
functions | BOOL dirListPattern(
char *pat,
char *path
)
{
const char matchOne = '?';
const char matchMany = '*';
BOOL ret = TRUE;
char *pPat = pat;
char *pNext;
for (pNext = path; *pNext != EOS; pNext++)
{
if (*pPat == matchOne)
{
pPa... |
functions | else if (*pPat == matchMany)
{
if (pNext[0] == '.')
{
ret = FALSE;
break;
} |
functions | STATUS dirListEntry(
FILE *fp,
char *filename,
struct stat *filestat,
char *prefix,
BOOL doLong
)
{
STATUS status;
char type;
char modbits[10];
char suffix = ' ';
char monthName[3];
time_t now;
struct tm nowDate;
struct tm file... |
functions | else if (prefix != NULL)
{
fprintf(fp, prefix);
} |
functions | STATUS copyStreams(
int inFd,
int outFd
)
{
char *buf;
int nBytes;
size_t bufSize;
int totBytes = 0;
STATUS status = OK;
/* Get buffer size */
if (ioctl(inFd, FIONREAD, (int) bufSize) == ERROR)
{
bufSize = 1024;
} |
defines |
#define INV_LPC_ORD 2979 |
defines | #define X005_Q19 26214 /* 0.05 * (1 << 19) */ |
defines | #define X025_Q15 8192 /* 0.25 * (1 << 15) */ |
defines | #define X1_732_Q14 28377 /* 1.732 * (1 << 14) */ |
defines | #define X12_Q8 3072 /* 12.0 * (1 << 8) */ |
defines | #define X30_Q8 7680 /* 30.0 * (1 << 8) */ |
defines | #define TILT_ORD 1 |
defines | #define SCALEOVER 10 |
defines | #define INV_SCALEOVER_Q18 26214 /* ((1.0/SCALEOVER)*(1 << 18)) */ |
defines | #define PDEL SCALEOVER |
defines | #define BEGIN MIX_ORD |
defines | #define BEGIN DISP_ORD |
defines |
#define ORIGINAL_SYNTH_GAIN FALSE |
defines | #define SYN_GAIN_Q4 16000 /* (1000.0*(1 << 4)) */ |
defines | #define SYN_GAIN_Q4 32000 |
functions | void synthesis(struct melp_param *par, int16_t sp_out[])
{
register int16_t i;
/* Copy previous period of processed speech to output array */
if (syn_begin > 0) {
if (syn_begin > frameSize) { /* impossible */
v_equ(sp_out, sigsave, frameSize);
/* past end: save remainder in sigsave[0] */
v_equ(sigsave, &... |
functions | endif
if (rate == RATE2400) {
par->uv_flag = quant_par.uv_flag[0];
melp_syn(par, sp_out);
} |
functions | void melp_syn(struct melp_param *par, int16_t sp_out[])
{
register int16_t i;
static BOOLEAN firstTime = TRUE;
static int16_t noise_gain = MIN_NOISE_Q8;
static int16_t prev_lpc_gain = ONE_Q15;
static int16_t lpc_del[LPC_ORD]; /* Q0 */
static int16_t prev_tilt;
static int16_t prev_pcof[MIX_ORD + 1], prev_ncof[MIX... |
functions | else if (!erase) {
for (i = 0; i < NUM_GAINFR; i++) {
noise_est(par->gain[i], &noise_gain, UPCONST_Q19,
DOWNCONST_Q17, MIN_NOISE_Q8, MAX_NOISE_Q8);
/* Adjust gain based on noise level (noise suppression) */
noise_sup(&par->gain[i], noise_gain, MAX_NS_SUP_Q8,
MAX_NS_ATT_Q8, NFACT_Q8);
} |
functions | void melp_syn_init()
{
register int16_t i;
int16_t temp;
v_zap(prev_par.gain, NUM_GAINFR);
prev_par.pitch = UV_PITCH_Q7;
temp = 0;
for (i = 0; i < LPC_ORD; i++) {
temp = melpe_add(temp, INV_LPC_ORD);
prev_par.lsf[i] = temp;
} |
includes |
#include <stdio.h> |
includes | #include <stdlib.h> |
includes | #include <stddef.h> |
includes | #include <string.h> |
defines |
#define VERSION "\ |
defines |
#define USAGE "\ |
functions | void
handlereencoding(Font *fnt)
{
int i;
ttfinfo *ti;
char *p;
if (fnt->inencname)
{
fnt->inencoding = readencoding(&(fnt->inencname), fnt, True);
/* reset all pointers in the mapping table */
for (i = 0; i <= 0xFF; i++)
if (NULL != (ti = fnt->inencptrs[i]))
{
ti->incode = ... |
functions | void
assignchars(Font *fnt)
{
register char **p;
register int i, j, k;
register ttfinfo *ti;
int nextfree = 0x80;
/*
* First, we assign all those that match perfectly.
*/
for (i = 0, p = fnt->outencoding->vec; i <= 0xFF; i++, p++)
if ((ti = findmappedadobe(*p, fnt->inencptrs)))
{
if... |
functions | void
version(void)
{
fputs(ident, stdout);
fprintf(stdout, " (%s)\n", TeX_search_version());
fputs(VERSION, stdout);
exit(0);
} |
functions | void
usage(void)
{
fputs("Usage: ttf2tfm FILE[.ttf|.ttc] [OPTION]... [FILE[.tfm]]\n", stdout);
fputs(USAGE, stdout);
exit(0);
} |
functions | void
handle_options(int argc, char *argv[], Font *fnt)
{
register int lastext;
register int i;
size_t l;
int arginc;
char *temp;
char c;
char *vpl_name = NULL;
Boolean have_capheight = 0;
Boolean have_sfd = 0;
int sfd_begin, postfix_begin;
int base_name;
stringlist* sl;
/* scan first whether... |
functions | void
consttfonts(Font *fnt)
{
if (!quiet)
printf("\n");
if (fnt->outname)
printf("%s", fnt->outname);
if (fnt->sfdname)
printf("@%s@", fnt->sfdname);
if (fnt->outname_postfix)
printf("%s", fnt->outname_postfix);
printf(" %s", fnt->ttfname);
if (fnt->slantparam || fnt->efactorparam ||
... |
main | int
main(int argc, char *argv[])
{
Font font;
ttfinfo *ti;
init_font_structure(&font);
TeX_search_init(argv[0], "ttf2tfm", "TTF2TFM");
if (argc == 1)
{
fputs("ttf2tfm: Need at least one file argument.\n", stderr);
fputs("Try `ttf2tfm --help' for more information.\n", stderr);
exit(1);
} |
includes | #include <windows.h> |
defines | #define STRICT
|
defines | #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
|
functions | void print( const gchar *prefix, const gchar *string )
{
g_mutex_lock( log_mutex );
#ifdef WIN32
OutputDebugString( prefix );
OutputDebugString( string );
#else
fputs( prefix, stdout );
fputs( string, stdout );
/*fflush( stdout );*/
#endif
if ( log_file != NULL )
{
fputs( prefix, log_file );
... |
functions | void print_handler( const gchar *string )
{
print( "", string );
} |
functions | void printwarn_handler( const gchar *string )
{
print( "*** ", string );
} |
functions | void printerr_handler( const gchar *string )
{
print( "******* ", string );
} |
functions | void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data )
{
if ( (log_level & G_LOG_FLAG_FATAL) != 0 )
printerr_handler( "FATAL:\n" );
if ( (log_level & (G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL)) != 0 )
printerr_handler( message );
else if ( (log_level... |
functions | endif
if ( my_docs_dir != NULL )
{
char filename[64 /*sizeof("leiads-radiotime_2009-09-16-15-09.logx")+1*/];
time_t timer = time( NULL );
size_t i;
i = strlen( strcpy( filename, basename ) );
strftime( filename + i, sizeof( filename ) - i - strlen( extension ),
"_%Y-%m-%d-%H-%M.", localtime( ... |
functions | void open_logfile( void )
{
#ifndef NOLOGFILE
log_filename = build_logfilename( "leiads", "log" );
if ( log_filename != NULL )
{
log_file = fopen_utf8( log_filename, "w" );
if ( log_file != NULL )
{
#ifdef WIN32
OutputDebugString( NAME " log file: " );
OutputDebugString( log_filename );
... |
functions | void close_logfile( void )
{
#ifndef NOLOGFILE
if ( log_file != NULL )
{
fclose( log_file );
log_file = NULL;
} |
functions | void debug_init()
{
log_mutex = g_mutex_new();
g_set_print_handler( print_handler );
g_set_printerr_handler( printerr_handler );
g_log_set_handler( G_LOG_DOMAIN, (1 << G_LOG_LEVEL_USER_SHIFT)-1, log_handler, NULL );
g_log_set_handler( UPNP_LOG_DOMAIN, (1 << G_LOG_LEVEL_USER_SHIFT)-1, log_handler, NULL );... |
functions | void debug_exit()
{
close_logfile();
g_mutex_free( log_mutex );
log_mutex = NULL;
} |
defines | #define SAMPLED_SA_MODEL_NO 1002ul |
defines | #define GEM_ERROR_SAMPLED_SA_WRONG_MODEL_NO "Sampled-SA error. Wrong Sampled-SA Model %"PRIu64" (Expected model %"PRIu64")" |
functions | void sampled_sa_write(fm_t* const file_manager,sampled_sa_t* const sampled_sa) {
// Write Meta-Data
fm_write_uint64(file_manager,SAMPLED_SA_MODEL_NO);
fm_write_uint64(file_manager,sampled_sa->index_length);
fm_write_uint64(file_manager,sampled_sa->sa_sampling_rate);
fm_write_uint64(file_manager,sampled_sa->te... |
functions | void sampled_sa_delete(sampled_sa_t* const sampled_sa) {
// Free PackedIntegerArray
packed_integer_array_delete(sampled_sa->packed_integer_array);
// Free handler
mm_free(sampled_sa);
} |
functions | Samples
if (generate_raw_sampled_sa) {
sampled_sa->sa_raw_samples_length = DIV_CEIL(index_length,(1<<sa_sampling_rate));
sampled_sa->sa_raw_samples = mm_malloc(sampled_sa->sa_raw_samples_length*UINT64_SIZE);
} |
functions | void sampled_sa_builder_delete_samples(sampled_sa_builder_t* const sampled_sa) {
uint64_t i;
for (i=0;i<sampled_sa->num_chunks;++i) {
packed_integer_array_builder_delete(sampled_sa->array_builder[i]);
} |
functions | void sampled_sa_builder_delete(sampled_sa_builder_t* const sampled_sa) {
mm_free(sampled_sa->sampled_bitmap_mem);
MUTEX_DESTROY(sampled_sa->sampled_bitmap_mutex);
if (sampled_sa->sa_raw_samples) {
mm_free(sampled_sa->sa_raw_samples);
} |
functions | void sampled_sa_builder_set_sample(
sampled_sa_builder_t* const sampled_sa,
const uint64_t chunk_number,
const uint64_t array_position,
const uint64_t sa_value) {
// Store sample
packed_integer_array_builder_store(sampled_sa->array_builder[chunk_number],sa_value);
// Mark Sample
const uint64_t b... |
functions | void sampled_sa_builder_write(
fm_t* const file_manager,
sampled_sa_builder_t* const sampled_sa) {
// Write Meta-Data
fm_write_uint64(file_manager,SAMPLED_SA_MODEL_NO);
fm_write_uint64(file_manager,sampled_sa->index_length);
fm_write_uint64(file_manager,sampled_sa->sa_sampling_rate);
fm_write_uint64(f... |
functions | uint64_t sampled_sa_builder_get_sa_sampling_rate(const sampled_sa_builder_t* const sampled_sa) {
return (1ul<<sampled_sa->sa_sampling_rate);
} |
functions | uint64_t sampled_sa_builder_get_text_sampling_rate(const sampled_sa_builder_t* const sampled_sa) {
return (1ul<<sampled_sa->text_sampling_rate);
} |
functions | uint64_t sampled_sa_get_size(const sampled_sa_t* const sampled_sa) {
return packed_integer_array_get_size(sampled_sa->packed_integer_array);
} |
functions | uint64_t sampled_sa_get_sa_sampling_rate(const sampled_sa_t* const sampled_sa) {
return (1ul<<sampled_sa->sa_sampling_rate);
} |
functions | uint64_t sampled_sa_get_text_sampling_rate(const sampled_sa_t* const sampled_sa) {
return (1ul<<sampled_sa->text_sampling_rate);
} |
functions | void sampled_sa_prefetch_sample(
const sampled_sa_t* const sampled_sa,
const uint64_t array_position) {
packed_integer_array_prefetch(sampled_sa->packed_integer_array,array_position); // Fetch SA position
} |
functions | uint64_t sampled_sa_get_sample(
const sampled_sa_t* const sampled_sa,
const uint64_t array_position) {
return packed_integer_array_load(sampled_sa->packed_integer_array,array_position); // Get SA position
} |
functions | void sampled_sa_set_sample(
sampled_sa_t* const sampled_sa,
const uint64_t array_position,
const uint64_t sa_value) {
packed_integer_array_store(sampled_sa->packed_integer_array,array_position,sa_value); // Store SA position
} |
functions | void sampled_sa_print_(
FILE* const stream,
const uint64_t sa_sampling_rate,
const uint64_t sa_sampling_rate_value,
const uint64_t text_sampling_rate,
const uint64_t text_sampling_rate_value,
const uint64_t index_length,
const uint64_t index_size) {
tab_fprintf(stream,"[GEM]>Sampled-SA\n")... |
functions | void sampled_sa_print(
FILE* const stream,
sampled_sa_t* const sampled_sa) {
// Print Sampled-SA
sampled_sa_print_(stream,
sampled_sa->sa_sampling_rate,sampled_sa_get_sa_sampling_rate(sampled_sa),
sampled_sa->text_sampling_rate,sampled_sa_get_text_sampling_rate(sampled_sa),
sampled_sa->ind... |
functions | void sampled_sa_builder_print(
FILE* const stream,
sampled_sa_builder_t* const sampled_sa) {
// Print Sampled-SA
sampled_sa_print_(stream,
sampled_sa->sa_sampling_rate,sampled_sa_builder_get_sa_sampling_rate(sampled_sa),
sampled_sa->text_sampling_rate,sampled_sa_builder_get_text_sampling_rate(sa... |
defines |
#define lj_gc_c |
defines | #define LUA_CORE |
defines |
#define GCSTEPSIZE 1024u |
defines | #define GCSWEEPMAX 40 |
defines | #define GCSWEEPCOST 10 |
defines | #define GCFINALIZECOST 100 |
defines | #define white2gray(x) ((x)->gch.marked &= (uint8_t)~LJ_GC_WHITES) |
defines | #define gray2black(x) ((x)->gch.marked |= LJ_GC_BLACK) |
defines | #define isfinalized(u) ((u)->marked & LJ_GC_FINALIZED) |
defines | #define gc_marktv(g, tv) \ |
defines | #define gc_markobj(g, o) \ |
defines | #define gc_mark_str(s) ((s)->marked &= (uint8_t)~LJ_GC_WHITES) |
defines | #define gc_traverse_curtrace(g) gc_traverse_trace(g, &G2J(g)->cur) |
defines | #define gc_traverse_curtrace(g) UNUSED(g) |
defines | #define gc_fullsweep(g, p) gc_sweep(g, (p), LJ_MAX_MEM) |
defines | #define TV2MARKED(x) \ |
functions | void gc_mark(global_State *g, GCobj *o)
{
int gct = o->gch.gct;
lua_assert(iswhite(o) && !isdead(g, o));
white2gray(o);
if (LJ_UNLIKELY(gct == ~LJ_TUDATA)) {
GCtab *mt = tabref(gco2ud(o)->metatable);
gray2black(o); /* Userdata are never gray. */
if (mt) gc_markobj(g, mt);
gc_markobj(g, tabref(g... |
functions | else if (gct != ~LJ_TSTR && gct != ~LJ_TCDATA) {
lua_assert(gct == ~LJ_TFUNC || gct == ~LJ_TTAB ||
gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO);
setgcrefr(o->gch.gclist, g->gc.gray);
setgcref(g->gc.gray, o);
} |
functions | void gc_mark_gcroot(global_State *g)
{
ptrdiff_t i;
for (i = 0; i < GCROOT_MAX; i++)
if (gcref(g->gcroot[i]) != NULL)
gc_markobj(g, gcref(g->gcroot[i]));
} |
functions | void gc_mark_start(global_State *g)
{
setgcrefnull(g->gc.gray);
setgcrefnull(g->gc.grayagain);
setgcrefnull(g->gc.weak);
gc_markobj(g, mainthread(g));
gc_markobj(g, tabref(mainthread(g)->env));
gc_marktv(g, &g->registrytv);
gc_mark_gcroot(g);
g->gc.state = GCSpropagate;
} |
functions | void gc_mark_uv(global_State *g)
{
GCupval *uv;
for (uv = uvnext(&g->uvhead); uv != &g->uvhead; uv = uvnext(uv)) {
lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv);
if (isgray(obj2gco(uv)))
gc_marktv(g, uvval(uv));
} |
functions | void gc_mark_mmudata(global_State *g)
{
GCobj *root = gcref(g->gc.mmudata);
GCobj *u = root;
if (u) {
do {
u = gcnext(u);
makewhite(g, u); /* Could be from previous GC. */
gc_mark(g, u);
} |
functions | size_t lj_gc_separateudata(global_State *g, int all)
{
size_t m = 0;
GCRef *p = &mainthread(g)->nextgc;
GCobj *o;
while ((o = gcref(*p)) != NULL) {
if (!(iswhite(o) || all) || isfinalized(gco2ud(o))) {
p = &o->gch.nextgc; /* Nothing to do. */
} |
functions | int gc_traverse_tab(global_State *g, GCtab *t)
{
int weak = 0;
cTValue *mode;
GCtab *mt = tabref(t->metatable);
if (mt)
gc_markobj(g, mt);
mode = lj_meta_fastg(g, mt, MM_mode);
if (mode && tvisstr(mode)) { /* Valid __mode field? */
const char *modestr = strVdata(mode);
int c;
while ((c = *m... |
functions | void gc_traverse_func(global_State *g, GCfunc *fn)
{
gc_markobj(g, tabref(fn->c.env));
if (isluafunc(fn)) {
uint32_t i;
lua_assert(fn->l.nupvalues <= funcproto(fn)->sizeuv);
gc_markobj(g, funcproto(fn));
for (i = 0; i < fn->l.nupvalues; i++) /* Mark Lua function upvalues. */
gc_markobj(g, &gc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.