Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "ctx" mean?

Tags:

c

abbreviation

I have seen it used twice already in different libraries as an abbreviation, but I can't wrap my head around what it should mean.

For example here:

static int reformat_string(void * ctx, const unsigned char * stringVal,                          size_t stringLen)   {       yajl_gen g = (yajl_gen) ctx;       return yajl_gen_status_ok == yajl_gen_string(g, stringVal, stringLen);   }   

As far as I can tell, it is usually used for structs.

like image 570
Blub Avatar asked May 25 '11 07:05

Blub


People also ask

What does CTX stand for in Texas?

INTRODUCTION. The Central Texas Commercial Information Exchange (CTXCIE) has adopted these Rules and Regulations to govern the operation of its Commercial Information Exchange, being marketed as CTXCIE.

What does CTC stand for?

CTC is an acronym for "cost to company." It is a term used in human resources to refer to the total cost of an employee to an organization. This includes salary, benefits, and other associated costs.

What drug is abbreviated as CTX?

CTX is a type of alkylating agent. Also called cyclophosphamide.

Does CTX mean chemotherapy?

Chemotherapy (CTX) remains an effective treatment against cancer, especially with sarcoma, which usually requires an interdisciplinary approach that combines multiple methods, not just CTX.


1 Answers

It typically stands for "context". Usually this is some structure that gets passed around to functions in a library, used to maintain state (i.e., the context of the function call).

It's a preferable alternative to using global variables.

like image 162
jamesdlin Avatar answered Sep 30 '22 23:09

jamesdlin