YAZ-ASNCOMP(1)

πŸ’– YAZ-ASNCOMP πŸ’–

okay bestie, gather round, because today we're talking about yaz-asncomp from the Commands manual β€” the YAZ ASN.1 compiler, no cap. she's written in Tcl (any version of Tcl works, she's very chill like that) and she is genuinely iconic for what she does. let's get into it ✨


✨ SYNOPSIS ✨

yaz-asncomp [-v] [-c cfile] [-h hfile] [-p pfile] [-d config]
            [-I includeout] [-i includedir] [-m module] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

so yaz-asncomp is an ASN.1 compiler. she reads an ASN.1 specification in filename and, in return, produces C/C++ definitions plus BER encoders/decoders for it. it's giving translator energy. πŸ’…

the produced C/C++ code and header files use the ODR module of YAZ β€” that's the library that encodes/decodes/prints BER packages, iykyk.

yaz-asncomp lets you specify the name of the resulting source via options. alternatively, you can specify a DEFINITIONS file, which provides customized output to many output files β€” super handy if the ASN.1 specification file consists of many modules. 🫢

fr fr, this utility is written in Tcl. any version of Tcl should work. lowkey iconic of her.

πŸ’… OPTIONS πŸ’…

  • -v β€” makes the ASN.1 compiler print more verbose about the various stages of operations. she's a talker and we love that for her. πŸ—£οΈ
  • -c cfile β€” specifies the name of the C/C++ file with encoders/decoders.
  • -h hfile β€” specifies the name of header file with definitions.
  • -p pfile β€” specifies the name of the a private header file with definitions. by default all definitions are put in header file (option -h). bestie, note the default: everything goes in -h unless you say otherwise. 🌸
  • -d dfile β€” specifies the name of a definitions file.
  • -I iout β€” specifies first part of directory in which header files are written.
  • -i idir β€” specifies second part of directory in which header files are written.
  • -m module β€” specifies that ASN.1 compiler should only process the module given. if this option is not specified, all modules in the ASN.1 file are processed. main character energy only when asked. πŸ‘‘

πŸŽ€ DEFINITIONS FILE πŸŽ€

the definitions file is really a Tcl script, but it follows traditional rules for Shell like configuration files. that means:

  • # denotes the beginning of a comment
  • definitions are line oriented

the definitions files usually consist of a series of variable assignments of the form:

set name value

available variables, babes, are:

  • default-prefix β€” sets prefix for names in the produced output. the value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively.
  • prefix(module) β€” this value sets prefix values for module module. the value has same form as default-prefix.
  • filename(module) β€” specifies filename for C/header file for module module.
  • init(module,h) β€” code fragment to be put in first part of public header for module module.
  • body(module,h) β€” code fragment to be put in last part of public header for module module (trailer).
  • init(module,c) β€” code fragment to be put in first part of C based encoder/decoder for module module.
  • body(module,c) β€” code fragment to be put in last part of C based encoder/decoder for module module (trailer).
  • map(module,name) β€” maps ASN.1 type in module module of name to value.
  • membermap(module,name,member) β€” maps member member in SEQUENCE/CHOICE of name in module module to value. the value consists of one or two tokens. first token is name of C preprocessor part. second token is resulting C member name. if second token is omitted the value (one token) is both preprocessor part and C struct,union.
  • unionmap(module,name,member) β€” maps member member in CHOICE of name in module module to value. value consists of two or three tokens. the first token is name of the integer in the union that is used as selector for the union itself. the second token is name of the union. the third token overrides the name of the CHOICE member; if omitted the member name is used.

🌈 FILES 🌈

  • /usr/share/yaz/z39.50/z.tcl
  • /usr/share/yaz/z39.50/*.asn

πŸ‘€ SEE ALSO πŸ‘€

  • yaz(7)
  • Section "The ODR Module" in the YAZ manual.

πŸ’œ AUTHORS πŸ’œ

Index Data


that's the whole page bestie, you ate it up. πŸ“ run her, love her, and remember: this was YAZ 5.38.1, dated 10/16/2026 β€” periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from