static void init_commands(void) { attr_init(); bmap_init(); fadvise_init(); file_init(); freeze_init(); fsync_init(); getrusage_init(); help_init(); imap_init(); inject_init(); madvise_init(); mincore_init(); mmap_init(); open_init(); parent_init(); pread_init(); prealloc_init(); fiemap_init(); pwrite_init(); quit_init(); resblks_init(); sendfile_init(); shutdown_init(); truncate_init(); }
int entry_init(void) { ldap_pvt_thread_mutex_init( &entry2str_mutex ); ldap_pvt_thread_mutex_init( &entry_mutex ); return attr_init(); }
/* ####################################### */ inline thread_t cu_thread_new(void *(*handle)(), void *args) { thread_t thread; if (handle == NULL) { fprintf(stderr, "handle is not a valid function\n"); exit(EXIT_FAILURE); } thread.handle = handle; thread.args = args; attr_init(&thread.attr); memset(&thread.thread, 0, sizeof(pthread_t)); return thread; }
void setup () { root_widget = widget_init (xwidth, xheight); attr_init (); read_pixmaps (); read_adigit_pixmap (); read_bdigit_pixmap (); pai2pix_init (); auto_init (); }
static int silk_clone(const struct ast_format *src, struct ast_format *dst) { struct silk_attr *original = ast_format_get_attribute_data(src); struct silk_attr *attr = ast_malloc(sizeof(*attr)); if (!attr) { return -1; } if (original) { *attr = *original; } else { attr_init(attr); } ast_format_set_attribute_data(dst, attr); return 0; }
static struct ast_format *silk_getjoint(const struct ast_format *format1, const struct ast_format *format2) { struct silk_attr *attr1 = ast_format_get_attribute_data(format1); struct silk_attr *attr2 = ast_format_get_attribute_data(format2); struct ast_format *jointformat; struct silk_attr *attr_res; if (ast_format_get_sample_rate(format1) != ast_format_get_sample_rate(format2)) { return NULL; } jointformat = ast_format_clone(format1); if (!jointformat) { return NULL; } attr_res = ast_format_get_attribute_data(jointformat); if (!attr1 || !attr2) { attr_init(attr_res); } else { /* Take the lowest max bitrate */ attr_res->maxbitrate = MIN(attr1->maxbitrate, attr2->maxbitrate); /* Only do dtx if both sides want it. DTX is a trade off between * computational complexity and bandwidth. */ attr_res->dtx = attr1->dtx && attr2->dtx ? 1 : 0; /* Only do FEC if both sides want it. If a peer specifically requests not * to receive with FEC, it may be a waste of bandwidth. */ attr_res->fec = attr1->fec && attr2->fec ? 1 : 0; /* Use the maximum packetloss percentage between the two attributes. This affects how * much redundancy is used in the FEC. */ attr_res->packetloss_percentage = MAX(attr1->packetloss_percentage, attr2->packetloss_percentage); } return jointformat; }