Ejemplo n.º 1
0
IRAPIStream* rapi_stream_new()/*{{{*/
{
  IRAPIStream* stream = calloc(1, sizeof(IRAPIStream));

  if (stream)
  {
    stream->context = rapi_context_new();
  }

  return stream;
}/*}}}*/
RapiContext* rapi_context_current()/*{{{*/
{
	/* TODO: make thread-safe version of this with thread private variables */

	if (!current_context)
	{
		rapi_context_set(rapi_context_new());
	}

	return current_context;
}/*}}}*/
Ejemplo n.º 3
0
RapiContext* rapi_context_current()/*{{{*/
{
	RapiContext *context = NULL;

	context = get_current_context();

	/* If the current context is not initialized, setup
	    a new one and return it
	 */
	if (!context)
	{
		RapiContext *new_context = rapi_context_new();
		set_current_context(new_context);
		context = get_current_context();
	}
	
	return context;

}/*}}}*/