type
stringclasses
5 values
content
stringlengths
9
163k
functions
tb_object_ref_t tb_oc_number_init_from_sint32(tb_sint32_t value) { // make tb_oc_number_t* number = tb_oc_number_init_base(); tb_assert_and_check_return_val(number, tb_null); // init value number->type = TB_OC_NUMBER_TYPE_SINT32; number->v.s32 = value; // ok return (tb_object_ref_t)num...
functions
tb_object_ref_t tb_oc_number_init_from_uint64(tb_uint64_t value) { // make tb_oc_number_t* number = tb_oc_number_init_base(); tb_assert_and_check_return_val(number, tb_null); // init value number->type = TB_OC_NUMBER_TYPE_UINT64; number->v.u64 = value; // ok return (tb_object_ref_t)num...
functions
tb_object_ref_t tb_oc_number_init_from_sint64(tb_sint64_t value) { // make tb_oc_number_t* number = tb_oc_number_init_base(); tb_assert_and_check_return_val(number, tb_null); // init value number->type = TB_OC_NUMBER_TYPE_SINT64; number->v.s64 = value; // ok return (tb_object_ref_t)num...
functions
tb_object_ref_t tb_oc_number_init_from_float(tb_float_t value) { // make tb_oc_number_t* number = tb_oc_number_init_base(); tb_assert_and_check_return_val(number, tb_null); // init value number->type = TB_OC_NUMBER_TYPE_FLOAT; number->v.f = value; // ok return (tb_object_ref_t)number; ...
functions
tb_object_ref_t tb_oc_number_init_from_double(tb_double_t value) { // make tb_oc_number_t* number = tb_oc_number_init_base(); tb_assert_and_check_return_val(number, tb_null); // init value number->type = TB_OC_NUMBER_TYPE_DOUBLE; number->v.d = value; // ok return (tb_object_ref_t)numbe...
functions
tb_size_t tb_oc_number_type(tb_object_ref_t object) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, TB_OC_NUMBER_TYPE_NONE); // type return number->type; }
functions
tb_uint8_t tb_oc_number_uint8(tb_object_ref_t object) { return (tb_uint8_t)tb_oc_number_uint64(object); }
functions
tb_sint8_t tb_oc_number_sint8(tb_object_ref_t object) { return (tb_sint8_t)tb_oc_number_sint64(object); }
functions
tb_uint16_t tb_oc_number_uint16(tb_object_ref_t object) { return (tb_uint16_t)tb_oc_number_uint64(object); }
functions
tb_sint16_t tb_oc_number_sint16(tb_object_ref_t object) { return (tb_sint16_t)tb_oc_number_sint64(object); }
functions
tb_uint32_t tb_oc_number_uint32(tb_object_ref_t object) { return (tb_uint32_t)tb_oc_number_uint64(object); }
functions
tb_sint32_t tb_oc_number_sint32(tb_object_ref_t object) { return (tb_sint32_t)tb_oc_number_sint64(object); }
functions
tb_uint64_t tb_oc_number_uint64(tb_object_ref_t object) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, 0); // uint64 switch (number->type) { case TB_OC_NUMBER_TYPE_UINT64: return number->v.u64; case TB_OC_NUMBER_TYPE_SINT64:...
functions
tb_sint64_t tb_oc_number_sint64(tb_object_ref_t object) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, 0); // sint64 switch (number->type) { case TB_OC_NUMBER_TYPE_UINT64: return number->v.u64; case TB_OC_NUMBER_TYPE_SINT64:...
functions
tb_float_t tb_oc_number_float(tb_object_ref_t object) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, 0); // float switch (number->type) { case TB_OC_NUMBER_TYPE_FLOAT: return number->v.f; case TB_OC_NUMBER_TYPE_DOUBLE: ...
functions
tb_double_t tb_oc_number_double(tb_object_ref_t object) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, 0); // double switch (number->type) { case TB_OC_NUMBER_TYPE_DOUBLE: return number->v.d; case TB_OC_NUMBER_TYPE_FLOAT: ...
functions
tb_bool_t tb_oc_number_uint8_set(tb_object_ref_t object, tb_uint8_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_UINT8; number->v.u8 = value; // ok return tb_tru...
functions
tb_bool_t tb_oc_number_sint8_set(tb_object_ref_t object, tb_sint8_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_SINT8; number->v.s8 = value; // ok return tb_tru...
functions
tb_bool_t tb_oc_number_uint16_set(tb_object_ref_t object, tb_uint16_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_UINT16; number->v.u16 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_sint16_set(tb_object_ref_t object, tb_sint16_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_SINT16; number->v.s16 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_uint32_set(tb_object_ref_t object, tb_uint32_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_UINT32; number->v.u32 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_sint32_set(tb_object_ref_t object, tb_sint32_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_SINT32; number->v.s32 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_uint64_set(tb_object_ref_t object, tb_uint64_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_UINT64; number->v.u64 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_sint64_set(tb_object_ref_t object, tb_sint64_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_SINT64; number->v.s64 = value; // ok return tb...
functions
tb_bool_t tb_oc_number_float_set(tb_object_ref_t object, tb_float_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_FLOAT; number->v.f = value; // ok return tb_true...
functions
tb_bool_t tb_oc_number_double_set(tb_object_ref_t object, tb_double_t value) { // check tb_oc_number_t* number = tb_oc_number_cast(object); tb_assert_and_check_return_val(number, tb_false); // init value number->type = TB_OC_NUMBER_TYPE_DOUBLE; number->v.d = value; // ok return tb_t...
includes
#include <config.h>
includes
#include <vips/intl.h>
includes
#include <stdio.h>
includes
#include <string.h>
includes
#include <vips/vips.h>
includes
#include <pango/pango.h>
includes
#include <pango/pangoft2.h>
functions
void vips_text_dispose( GObject *gobject ) { VipsText *text = (VipsText *) gobject; VIPS_UNREF( text->layout ); VIPS_UNREF( text->context ); VIPS_FREE( text->bitmap.buffer ); G_OBJECT_CLASS( vips_text_parent_class )->dispose( gobject ); }
functions
int vips_text_build( VipsObject *object ) { VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); VipsCreate *create = VIPS_CREATE( object ); VipsText *text = (VipsText *) object; PangoRectangle logical_rect; int left; int top; int width; int height; int y; if( VIPS_OBJECT_CLASS( vips_text_parent_class ...
functions
void vips_text_class_init( VipsTextClass *class ) { GObjectClass *gobject_class = G_OBJECT_CLASS( class ); VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); static GOnce once = G_ONCE_INIT; (void) g_once( &once, vips_text_make_lock, NULL ); gobject_class->dispose = vips_text_dispose; gobject_class->...
functions
void vips_text_init( VipsText *text ) { text->align = VIPS_ALIGN_LOW; text->dpi = 72; text->bitmap.buffer = NULL; }
functions
int vips_text( VipsImage **out, const char *text, ... ) { va_list ap; int result; va_start( ap, text ); result = vips_call_split( "text", ap, out, text ); va_end( ap ); return( result ); }
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <unistd.h>
includes
#include <math.h>
includes
#include <float.h>
includes
#include <pthread.h>
includes
#include <time.h>
includes
#include <mpi.h>
includes
#include <omp.h>
includes
#include <complex.h>
includes
#include <fftw3.h>
defines
#define ENGINE_FLAGS engine_flag_none
defines
#define CPU_TPS 2.67e+9
functions
HAVE_OPENMP if ( argc > 1 ) { nr_runners = atoi( argv[1] ); omp_set_num_threads( nr_runners ); }
functions
steps for ( i = 0 ; i < nr_steps ; i++ ) { // take a step tic = getticks(); if ( engine_step( &e ) != 0 ) { printf("main: engine_step failed with engine_err=%i.\n",engine_err); errs_dump(stdout); return 1; }
functions
velocities if ( i < 10000 ) { #pragma omp parallel for schedule(static,100), private(cid,pid,k), reduction(+:epot,ekin) for ( cid = 0 ; cid < e.s.nr_cells ; cid++ ) { for ( pid = 0 ; pid < e.s.cells[cid].count ; pid++ ) { for ( k = 0 ; k < 3 ; k++ ) ...
main
int main ( int argc , char *argv[] ) { const double origin[3] = { 0.0 , 0.0 , 0.0 }
includes
#include <assert.h>
includes
#include <dlfcn.h>
includes
#include <errno.h>
includes
#include <libintl.h>
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <unistd.h>
includes
#include <sys/mman.h>
includes
#include <sys/param.h>
includes
#include <bits/libc-lock.h>
includes
#include <ldsodefs.h>
includes
#include <caller.h>
includes
#include <sysdep-cancel.h>
includes
#include <tls.h>
includes
#include <stap-probe.h>
includes
#include <atomic.h>
includes
#include <dl-dst.h>
defines
#define SCOPE_ELEMS(imap) \
structs
struct dl_open_args { const char *file; int mode; /* This is the caller of the dlopen() function. */ const void *caller_dlopen; /* This is the caller of _dl_open(). */ const void *caller_dl_open; struct link_map *map; /* Namespace ID. */ Lmid_t nsid; /* Original parameters to the program and the ...
functions
int add_to_global (struct link_map *new) { struct link_map **new_global; unsigned int to_add = 0; unsigned int cnt; /* Count the objects we have to put in the global scope. */ for (cnt = 0; cnt < new->l_searchlist.r_nlist; ++cnt) if (new->l_searchlist.r_list[cnt]->l_global == 0) ++to_add; /* Th...
functions
else if (ns->_ns_main_searchlist->r_nlist + to_add > ns->_ns_global_scope_alloc) { /* We have to extend the existing array of link maps in the main map. */ struct link_map **old_global = GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list; size_t new_nalloc = ((ns->_ns_global_scope_alloc + to...
functions
void dl_open_worker (void *a) { struct dl_open_args *args = a; const char *file = args->file; int mode = args->mode; struct link_map *call_map = NULL; /* Check whether _dl_open() has been called from a valid DSO. */ if (__check_caller (args->caller_dl_open, allow_libc|allow_libdl|allow_ldso) != 0)...
functions
void _dl_show_scope (struct link_map *l, int from) { _dl_debug_printf ("object=%s [%lu]\n", DSO_FILENAME (l->l_name), l->l_ns); if (l->l_scope != NULL) for (int scope_cnt = from; l->l_scope[scope_cnt] != NULL; ++scope_cnt) { _dl_debug_printf (" scope %u:", scope_cnt); for (unsigned int cnt = 0; c...
includes
#include <glib.h>
includes
#include <stdio.h>
functions
void testTccScritLifecycle(void) { void *sm = NULL; yeInitMem(); g_assert(!ysTccInit()); g_assert(!ysTccGetType()); sm = ysNewManager(NULL, 0); g_assert(sm); g_assert(!ysRegistreFunc(sm, "addPtr", addPtr)); g_assert((long)ysCall(sm, "addPtr", 2, 1, 2) == 3); g_assert(!ysLoadString(sm, "void *test()...
functions
void testTccTestsMacros(void) { void *sm = NULL; yeInitMem(); g_assert(!ysTccInit()); g_assert(!ysTccGetType()); sm = ysNewManager(NULL, 0); g_assert(sm); g_assert(!ysLoadString(sm, "void *test(){return (void *)5;}
functions
void testTccAddDefine(void) { GameConfig cfg; g_assert(!ygInitGameConfig(&cfg, NULL, NONE)); g_assert(!ygInit(&cfg)); ygCleanGameConfig(&cfg); g_assert(!ysLoadString(ygGetTccManager(), "#include <yirl/game.h>" "void *test(){" "return (void *)ygAddDefine(\"TEST\", \"28\");" "}
includes
#include <video/window.h>
includes
#include <video/font.h>
includes
#include <kernel/libkern.h>
includes
#include <assert.h>
includes
#include <string.h>
includes
#include <phantom_libc.h>
functions
int _bpc(const drv_video_font_t *font) { return font->ysize * (1 + ((font->xsize-1) / 8)); }
functions
int w_font_draw_char( window_handle_t win, const drv_video_font_t *font, char c, rgba_t color, rgba_t bg, int x, int y ) { bool p = FONT_FLAG_PROP...
functions
fonts for(; bc >= 0; bc-- ) { #if 0 int xc = 0; for( ; xc < xe; xc++ ) { if( 0x80 & ((*fp) << xc) ) *wp = color; wp++; }
functions
void w_font_draw_string( window_handle_t win, const drv_video_font_t *font, const char *s, const rgba_t color, const rgba_t bg, int x, int y ) ...
functions
void w_font_scroll_line( window_handle_t win, const drv_video_font_t *font, rgba_t color ) { w_scroll_up( win, font->ysize, color ); }
functions
void w_font_tty_string( window_handle_t win, const drv_video_font_t *font, const char *s, const rgba_t _color, ...
functions
else if( *s == '\r' ) { *x = 0; s++; continue; }
functions
else if( *s == '\t' ) { (*x)++; // or else \t\t == \t while( *x % 8 ) (*x)++; s++; continue; }
functions
void font_reverse_x(drv_video_font_t *font) { if(font->xsize > 0) return; font->xsize = -font->xsize; //printf("reverse font x\n"); int bpcx = 1 + ((font->xsize-1) / 8); int bcount = bpcx * font->ysize; char *fc = font->font; while(bcount--) { unsigned char ic = *fc...
functions
void enable_tracking(Body *b) { b->track = 1; b->history = malloc(N_TRACK*sizeof(Vector)); b->n_stored = 0; b->index = 0; b->start = 0; }