The Traffic Server API adheres to the following naming conventions:
The INK
prefix is used for all function
and variable names defined in the Traffic Server API. Examples: INK_EVENT_NONE
, INKMutex
, and INKContCreate
Enumerated values are always written in all uppercase letters.
Examples: INK_EVENT_NONE
and
INK_VC_CLOSE_ABORT
Constant values are all uppercase; enumerated values can be
seen as a subset of constants. Examples:
and
INK_URL_SCHEME_FILE
INK_MIME_FIELD_ACCEPT
The names of defined types are mixed-case. Examples: INKHttpSsn
and
INKHttpTxn
Function names are mixed-case. Examples: INKUrlCreate
and
INKContDestroy
Function names use the following subject-verb naming style:
INK-<subject>-<verb>
, where
<subject>
goes from general to specific. This
makes it easier to determine what a function does by reading its
name. For example: the function to retrieve the password field (the
specific subject) from a URL (the general subject) is INKUrlPasswordGet
.
Common verbs like Create
, Destroy
,
Get
, Set
, Copy
,
Find
, Retrieve
, Insert
,
Remove
, and Delete
are used only when
appropriate.