cdk_params(3)

πŸ“¦
version 5.0.20260119 Β· 3 versions
, in debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 given argc/argv command-line, with the options passed to getopt()'s 3rd parameter. yes, that getopt(), 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 πŸŒŸπŸ’…πŸ¦‹