[#BN_GENCB_set]
= BN&lowbar;GENCB&lowbar;set
:mrdocs:

Populate a BN&lowbar;GENCB with a new&hyphen;style progress callback that returns success&sol;failure&period;

== Synopsis

Declared in `&lt;openssl&sol;bn&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
BN&lowbar;GENCB&lowbar;set(
    xref:BN_GENCB.adoc[BN&lowbar;GENCB]* gencb,
    int(* callback)(int, int, xref:BN_GENCB.adoc[BN&lowbar;GENCB]*),
    void* cb&lowbar;arg);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *gencb*
| Callback object from BN&lowbar;GENCB&lowbar;new() (or a stack instance where supported)&period;
| *callback*
| Callback receiving (event, progress, `gencb)&semi;` should return 1 on success or 0 on error&period;
| *cb&lowbar;arg*
| Opaque pointer stored in `gencb` and retrievable via BN&lowbar;GENCB&lowbar;get&lowbar;arg()&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
