--- title: "Exit the Library" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/exit-the-library-c-library" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/exit-the-library-c-library.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/exit-the-library-c-library" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # Exit the Library [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/exit-the-library-c-library.md) Exit the library before you turn the POS off. The call and the callback are asynchronous to prevent the call from blocking the calling thread. ## Implement the library\_shutdown\_CB Implement the `library_shutdown_CB` callback function, pass a pointer of `library_shutdown_CB` to the `exit_library function.` For more information on how to do this, see [Implement callbacks](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/calls-and-callbacks-c-library/implement-callbacks). ### Code example The callback function declaration is: ```cpp void library_shutdown_CB(void* none, void * echo_struct); ``` ## exit\_task function | Name | Description | | ------------ | ----------------------------------------------------------------------- | | `exit_task`  | Exits the library when called with the `library_shutdown_CB` parameter. | ### Code example ```cpp ADYEN_RESULT exit_result = exit_task(library_shutdown_CB, &state); ``` ### Parameters | Name | Description | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ADYEN_RESULT exit_result` | An enum that indicates if the Adyen payments platform has successfully received the request.This is not the final result of the call. The final result of the call is in a callback returned by the system to the library initialization call.Result of the call to exit the library. Should be  `ADYEN_OK` , if this is not the case, something has gone wrong. In this case, check the input to the call and if it cannot be resolved, log the result and contact our  [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml). | | `library_shutdown_CB` | Pointer to the callback function in the POS that is called with the results of the exit call. | | `echo_struct` | Pointer to a POS defined struct that can be set by the POS that is echoed back in the callback, it can be used to share a POS data struct between the call to the library and the callback from the library in response to the call. | ## Handle the callback The POS must wait until the system returns the `library_shutdown_cb` before continuing with other functions. This confirms that the library has been successfully discarded and all related resources are destroyed. ## Logs The SDK package contains a folder **documentation/log\_files/documentation**. This folder contains log files of actual test runs that relate to the items discussed in this manual. The `exit_task.log` file that shows a live example of the library exit call and the related callback.