82 lines
2.4 KiB
C
82 lines
2.4 KiB
C
/*
|
|
* Autodesk Desktop Platform (ADP) Stub Library
|
|
* Provides minimal ADP implementation to prevent "ADP Failed to initialize" error
|
|
*/
|
|
|
|
#define _GNU_SOURCE
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <dlfcn.h>
|
|
|
|
#define DEBUG_LOG 1
|
|
#define LOG(fmt, ...) do { \
|
|
if (DEBUG_LOG) { \
|
|
fprintf(stderr, "[ADP-STUB] " fmt, ##__VA_ARGS__); \
|
|
fflush(stderr); \
|
|
} \
|
|
} while(0)
|
|
|
|
/* ADP Initialization function - return success */
|
|
int __attribute__((visibility("default"))) ADP_Initialize(void) {
|
|
LOG("ADP_Initialize() called - returning success\n");
|
|
return 0; /* Success */
|
|
}
|
|
|
|
void __attribute__((visibility("default"))) ADP_Shutdown(void) {
|
|
LOG("ADP_Shutdown() called\n");
|
|
}
|
|
|
|
/* ADP User/Session functions */
|
|
int __attribute__((visibility("default"))) ADP_IsUserLoggedIn(void) {
|
|
LOG("ADP_IsUserLoggedIn() called - returning true\n");
|
|
return 1; /* Logged in */
|
|
}
|
|
|
|
const char* __attribute__((visibility("default"))) ADP_GetUserName(void) {
|
|
LOG("ADP_GetUserName() called\n");
|
|
return "MayaUser";
|
|
}
|
|
|
|
const char* __attribute__((visibility("default"))) ADP_GetUserId(void) {
|
|
LOG("ADP_GetUserId() called\n");
|
|
return "maya-stub-user-id";
|
|
}
|
|
|
|
/* ADP License functions */
|
|
int __attribute__((visibility("default"))) ADP_IsLicenseValid(void) {
|
|
LOG("ADP_IsLicenseValid() called - returning true\n");
|
|
return 1; /* Valid */
|
|
}
|
|
|
|
int __attribute__((visibility("default"))) ADP_AcquireLicense(const char* product) {
|
|
LOG("ADP_AcquireLicense() called for: %s - returning success\n", product ? product : "unknown");
|
|
return 0; /* Success */
|
|
}
|
|
|
|
void __attribute__((visibility("default"))) ADP_ReleaseLicense(void) {
|
|
LOG("ADP_ReleaseLicense() called\n");
|
|
}
|
|
|
|
/* ADP Cloud/Service functions */
|
|
int __attribute__((visibility("default"))) ADP_IsCloudServiceAvailable(void) {
|
|
LOG("ADP_IsCloudServiceAvailable() called - returning false (offline mode)\n");
|
|
return 0; /* Not available - offline mode */
|
|
}
|
|
|
|
/* Generic success function for any unknown ADP calls */
|
|
int __attribute__((visibility("default"))) ADP_CheckStatus(void) {
|
|
LOG("ADP_CheckStatus() called - returning success\n");
|
|
return 0;
|
|
}
|
|
|
|
__attribute__((constructor))
|
|
void adp_stub_init(void) {
|
|
LOG("=== ADP Stub Library Loaded ===\n");
|
|
LOG("This stub provides minimal ADP functionality to prevent initialization errors\n");
|
|
}
|
|
|
|
__attribute__((destructor))
|
|
void adp_stub_fini(void) {
|
|
LOG("=== ADP Stub Library Unloaded ===\n");
|
|
}
|