#include <stdio.h>
#include "pkcs11.h"

int main(void) {
    CK_RV rv = C_Initialize(NULL_PTR);
    if (rv != CKR_OK) { fprintf(stderr, "C_Initialize failed: 0x%08lx\n", (unsigned long)rv); return 1; }
    CK_ULONG count = 0;
    rv = C_GetSlotList(CK_TRUE, NULL_PTR, &count);
    if (rv != CKR_OK) { fprintf(stderr, "C_GetSlotList failed: 0x%08lx\n", (unsigned long)rv); C_Finalize(NULL_PTR); return 2; }
    printf("Token-present slots: %lu\n", (unsigned long)count);
    printf("Continue with the approved slot, login, object-search and mechanism profile from the release manifest.\n");
    C_Finalize(NULL_PTR);
    return 0;
}
