cdk_params(3)
β¨ cdk_params β Cdk command-line parsing β¨
okay bestie, pull up a chair π«Ά this is the cdk_params page from the Library calls section of the Cdk manual, and it's literally the β¨command-line glow-upβ¨ for every Cdk utility and demo program out there. no cap.
πΈ NAME πΈ
cdk_params β Cdk command-line parsing π
π SYNOPSIS π
so first you gotta link it, like:
cc [ flag ... ] file ... -lcdk [ library ... ]
then include the header, obviously:
#include <cdk.h>
and here's the whole friend group of functions π:
int CDKparamNumber (
CDK_PARAMS *params,
int option);
int CDKparamNumber2 (
CDK_PARAMS *params,
int option,
int missing);
char * CDKparamString (
CDK_PARAMS *params,
int option);
char * CDKparamString2 (
CDK_PARAMS *params,
int option,
const char *missing);
void CDKparseParams (
int argc,
char **argv,
CDK_PARAMS *params,
const char *options);
int CDKparsePosition (
char *string);
int CDKparamValue (
CDK_PARAMS * params,
int option,
int missing);
π¦ DESCRIPTION π¦
so these are a set of functions used to implement the command-line utilities and demonstration programs for Cdk. the way that they don't just set the programs' options at initialization β instead they construct a simple database which holds the common parameters using CDKparseParams(). it's giving organized. it's giving main character energy. π
π AVAILABLE FUNCTIONS π
CDKparamNumberβ retrieves an integer (or boolean) option value from the parsed command-line. slay, a number, just for you β¨CDKparamNumber2β retrieves an optional integer (or boolean) value from the parsed command-line. if the command line option is not present, the missing value is used. bestie's got a backup plan π«ΆCDKparamStringβ retrieves a string option value from the parsed command-line. words! iconic πCDKparamString2β retrieve an optional string option value from the parsed command-line. πCDKparamValueβ retrieve an integer (or boolean) option value from the parsed command-line. π₯CDKparseParamsβ parse the givenargc/argvcommand-line, with the options passed togetopt()'s 3rd parameter. yes, thatgetopt(), iykyk πCDKparsePositionβ parse the string as one of CDK's positioning keywords, or an actual position. πΈ
π SEE ALSO π
okay that's the whole page, no notes π ngl this one's short but it ate. this was the cdk_params page, dated 2024-03-28, straight from the cdk_params(3) manual β go forth and parse those params, bestie, you got this ππ
π¦
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- nixos 26.05: cdk 5.0-20260119
- nixpkgs unstable: cdk 5.0-20260119
- ubuntu questing: libcdk5-dev 5.0.20250116-1
- ubuntu resolute: libcdk5-dev 5.0.20251014-1 Β· BSD-4-Clause
- ubuntu stonking: libcdk5-dev 5.0.20260119-1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms