.TH LC_CTX_GETKEY 3 2023-07-31 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME lc_ctx_getkey, lc_ctx_setkey, lc_channel_getkey, lc_channel_setkey - set Librecast channel encoding options .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "int lc_ctx_getkey(lc_ctx_t " *ctx ", lc_key_t " *key ", int " type ");" .BI "int lc_ctx_setkey(lc_ctx_t " *ctx ", lc_key_t " *key ", int " type ");" .BI "int lc_channel_getkey(lc_channel_t " *chan ", lc_key_t " *key ", int " type ");" .BI "int lc_channel_setkey(lc_channel_t " *chan ", lc_key_t " *key ", int " type ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION These functions get or set keys for a Librecast context .IR ctx or channel .IR chan . .PP .IR is a pointer to an lc_key_t structure. The set functions will use this to set the key on the context or channel, and the set functions will return a copy of the current key in this structure. .PP The .I type argument must be one of the following options: .TP .B LC_CODE_SYMM Symmetric key. .TP .B LC_CODE_PUBK Public key. .PP .SH RETURN VALUE These functions return zero on success. On error, -1 is returned and .BR errno is set to indicate the error. .SH ERRORS .TP .BR EINVAL Invalid argument. .PP .SH SEE ALSO .BR lc_ctx_coding_set (3), .BR lc_channel_new (3), .BR lc_channel_close (3), .BR lc_channel_coding_set (3), .BR lc_channel_send (3), .BR lc_channel_set_sym_key (3), .BR lc_ctx_new (3), .BR lc_socket_setopt (3), .BR lc_socket_recv (3)