Exemplo n.º 1
0
Failable_string* failable_string_create(failableID id) {
    Failable_string* this =
        alloct(Failable_string); /// this [+1]

    bag_add(
        failable_config.strings_bag,
        id,
        this
    );


    ref(this, this->dependents = lvector_create()); /// this->dependents+ +
    release(this->dependents); /// this->dependents-

    ref(this, this->hooks = wtree_create()); /// this->hooks+ +
    release(this->hooks); /// this->hooks-

    this->hooksum = 0;

    ref(this, this->flag = tflag_create()); /// this->flag+ +
    release(this->flag); /// this->flag-


    return this; /// this [+1]
}
Exemplo n.º 2
0
Arquivo: spool.c Projeto: i12345/LLLL
Spool* spool_create(
		int maxnumberofconcurrenttasks,
		KernelOp_Responder* kernelop_responder
	) {
	Spool* this =
		alloct(Spool); /// this+

	ref(this, this->taskqueue = cqueue_create(maxnumberofconcurrenttasks)); /// this->taskqueue^+
	release(this->taskqueue); /// this->taskqueue-

	ref(this, this->prioritytaskqueue = cqueue_create(maxnumberofconcurrenttasks)); /// this->prioritytaskqueue^+
	release(this->prioritytaskqueue); /// this->prioritytaskqueue-

	this->maxnumberofconcurrenttasks = maxnumberofconcurrenttasks;

	ref(this, this->kernelop_responder = kernelop_responder); /// this->kernelop_responder^

	this->tasksrunningnow = 0;

	this->instancesnotwaitingfortermination = 0;

	ref(this, this->terminationsemaphore = tflag_create()); /// this->terminationsemaphore^+
	release(this->terminationsemaphore); /// this->terminatiosemaphore-

	return this;
}
Exemplo n.º 3
0
Source_multi_or* parse_source_multi_or(
		char** input,
		ParserState* state
	) {
	Source* operands[PARSER_BUFFER_SIZE];
	int i = 0;


	if (**input != '(')
		return 0;
	*input += 1;


	do {
		if (i == PARSER_BUFFER_SIZE)
			break;

		operands[i] =
			parse_source(
				input,
				state
				);

		if (**input != ';')
			break;

		*input += 1; // sizeof(char)
	} while (operands[i++]);

	if (i == 0)
		return 0;


	if (**input != ')')
		return 0;
	*input += 1;


	Source_multi_or* retval =
		alloct(Source_multi_or); /// retval+

	String* ns =
		string_create(operands, sizeof(Source*) * i); /// ns+

	source_multi_or_init(
			retval,
			ns
		);

	release(ns); /// ns-

	return retval;
}
Exemplo n.º 4
0
Arquivo: bucket.c Projeto: i12345/LLLL
Bucket* bucket_create(
		Mailbin* mailbin,
		valueID unallocatedvalueids_start,
		valueID unallocatedvalueids_end,
		fileID bucketfileID
	) {
	Bucket* this =
		alloct(Bucket);
	

	this->unallocatedvalueids_start =
		unallocatedvalueids_start;
	
	this->unallocatedvalueids_end =
		unallocatedvalueids_end;


	this->unallocatedvalueids_flag =
		tflag_create(); /// this->un..flag+
	ref(this, this->unallocatedvalueids_flag); /// this->un..flag+
	release(this->unallocatedvalueids_flag); /// this->un..flag-

	this->rocks =
		bag_create(
				rock_serialize,
				rock_deserialize,
				bucketfileID
			); /// this->rocks+
	ref(this, this->rocks); /// this->rocks+
	release(this->rocks); /// this->rocks-


	this->mailman_mirrorrock =
		mailbin_allocate_mailman(
				mailbin,
				MESSAGE_TYPE_MIRROR_ROCKS,
				this,
				message_mirrorrocks_process
			);/// this->mailman_mirrorrock+
	ref(this, this->mailman_mirrorrock); /// this->mailman_mirrorrock+
	release(this->mailman_mirrorrock); /// this->mailman_mirrorrock-

	
	return this;
}
Exemplo n.º 5
0
int readlines(char *lines[], int max) {
    int i, c;
    char line[MAXSIZE];
    char *p;
    i = 0;
    while ( (c = getlinet(line, MAXSIZE) ) != 0 && i <= max) {
        if ( ( p = alloct(c)) != 0 ) {
            /* line[c-1] = '\0'; */
            strcpyt(line, p);
            
            lines[i++] = p; 
        }
        else {
            return i;
        }
    }
    return i;
}
Exemplo n.º 6
0
Template_multi_and* parse_template_multi_and(
    char** input,
    ParserState* state
) {
    Template* operands[PARSER_BUFFER_SIZE];
    int i = 0;

    do {
        if (i == PARSER_BUFFER_SIZE)
            break;

        operands[i] =
            parse_source(
                input,
                state
            );

        if (**input != ' ')
            break;

        *input += 1; // sizeof(char)
    } while (operands[i++]);

    if (i == 0)
        return 0;



    Template_multi_and* retval =
        alloct(Template_multi_and); /// retval+

    String* ns =
        string_create(operands, sizeof(Template*) * i); /// ns+

    template_multi_and_init(
        retval,
        ns
    );

    release(ns); /// ns-

    return retval;
}
Exemplo n.º 7
0
Arquivo: parser.c Projeto: i12345/LLLL
ParserState* parserstate_create() {
	ParserState* this =
		alloct(ParserState);

	ref(this, this->flag = tflag_create()); /// this->flag+ +
	release(this->flag); /// this->flag-

	this->nextsetID_exclusive = 2;
	this->nextsetID_nonexclusive = 1;


	ref(this, this->namedictionary = namedictionary_create()); /// this->namedictionary+ +
	release(this->namedictionary); /// this->namedictionary-


	this->incrementalsearchID = 1;


	this->decrementalhookID = (hookID)0xFFFFFFFFFFFFFFFF;


	return this;
}
Exemplo n.º 8
0
Arquivo: outbox.c Projeto: i12345/LLLL
Outbox* outbox_create(
		nodeID localnodeID,
		Stamps* stamps,
		Wtree* serializers
	) {
	Outbox* this =
		alloct(Outbox); /// this+


	ref(this, this->receiverqueues = wtree_create()); /// this->receiverqueues^+
	release(this->receiverqueues); /// this->receiverqueues-

	
	ref(this, this->receivernodeIDs = lvector_create()); /// this->receivernodeIDs^+
	release(this->receivernodeIDs); /// this->receivernodeIDs-


	ref(this, this->idlequeue = cqueue_create(OUTBOX_QUEUE_SIZE)); /// this->idlequeue^+
	release(this->idlequeue); /// this->idlequeue- 


	ref(this, this->treeflag = tflag_create()); /// this->treeflag^+
	release(this->treeflag); /// this->treeflag-

	
	ref(this, this->serializers = serializers); /// this->serializers^


	this->localnodeID = localnodeID;


	ref(this, this->stamps = stamps); /// this->stamps^


	return this;
}
Exemplo n.º 9
0
Arquivo: outbox.c Projeto: i12345/LLLL

	wtree_add(
			this->receiverqueues,
			recipientnodeID,
			directedmessagesqueue
		);

	lvector_add(
			this->receivernodeIDs,
			(ptr)recipientnodeID
		);


	outbox_addrecipient_a1* state =
		alloct(outbox_addrecipient_a1); /// state+

	ref(state, state->directedmessagesqueue = directedmessagesqueue); /// state->directedmessagesqueue^

	ref(state, state->outbox = this); /// state->outbox^
	
	state->recipientnodeID = recipientnodeID;
	ref(state, state->connectionstring = connectionstring); /// state->connectionstring^


	Task* task =
		task_create(
				outbox_addrecipient_m1,
				state
			); /// task+, state^