예제 #1
0
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();
}
예제 #2
0
int
entry_init(void)
{
	ldap_pvt_thread_mutex_init( &entry2str_mutex );
	ldap_pvt_thread_mutex_init( &entry_mutex );
	return attr_init();
}
예제 #3
0
파일: sync.c 프로젝트: bendst/cu
/* ####################################### */
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;
}
예제 #4
0
파일: init.c 프로젝트: CecilHarvey/netmaj
void
setup ()
{
  root_widget = widget_init (xwidth, xheight);

  attr_init ();
  read_pixmaps ();
  read_adigit_pixmap ();
  read_bdigit_pixmap ();
  pai2pix_init ();
  auto_init ();
}
예제 #5
0
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;
}
예제 #6
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;
}