35 #define REGISTRY_FILENAME ".omxregister" 37 #ifdef ANDROID_COMPILATION 38 #define TMP_DATA_DIRECTORY "/data/omx/" 40 #define TMP_DATA_DIRECTORY "/tmp/" 47 char *omxregistryfile = NULL;
50 buffer=getenv(
"OMX_BELLAGIO_REGISTRY");
51 if(buffer!=NULL&&*buffer!=
'\0') {
52 omxregistryfile = strdup(buffer);
53 return omxregistryfile;
56 buffer=getenv(
"XDG_DATA_HOME");
57 if(buffer!=NULL&&*buffer!=
'\0') {
59 strcpy(omxregistryfile, buffer);
60 strcat(omxregistryfile,
"/");
62 return omxregistryfile;
65 buffer=getenv(
"HOME");
66 if(buffer!=NULL&&*buffer!=
'\0') {
68 strcpy(omxregistryfile, buffer);
69 strcat(omxregistryfile,
"/");
76 return omxregistryfile;
88 char *omxregistryfile = NULL;
91 buffer=getenv(
"XDG_DATA_HOME");
92 if(buffer!=NULL&&*buffer!=
'\0') {
93 omxregistryfile = malloc(strlen(buffer) + strlen(registry_name) + 2);
94 strcpy(omxregistryfile, buffer);
95 strcat(omxregistryfile,
"/");
96 strcat(omxregistryfile, registry_name);
97 return omxregistryfile;
100 buffer=getenv(
"HOME");
101 if(buffer!=NULL&&*buffer!=
'\0') {
102 omxregistryfile = malloc(strlen(buffer) + strlen(registry_name) + 3);
103 strcpy(omxregistryfile, buffer);
104 strcat(omxregistryfile,
"/");
105 strcat(omxregistryfile, registry_name);
109 strcat(omxregistryfile, registry_name);
111 return omxregistryfile;
124 buffer = strdup(newdir);
125 len = strlen(buffer);
131 if (buffer[len-1] ==
'/') {
132 buffer[len-1] =
'\0';
135 err = mkdir(buffer, 0755);
136 if (
err == 0 || ((
err == -1) && (errno == EEXIST))) {
145 while(*p && *p !=
'\\' && *p !=
'/')
149 if ((mkdir(buffer, 0755) == -1) && (errno == ENOENT)) {
164 if ((file = fopen(fname,
"r")))
173 int main (
int argc,
char*argv[]) {
char * loadersRegistryGetFilename(char *registry_name)
#define REGISTRY_FILENAME
char * componentsRegistryGetFilename()
Get registry filename This function returns the name of the registry file for the components loaded w...
int exists(const char *fname)
int main(int argc, char *argv[])
execution of registration function
#define TMP_DATA_DIRECTORY
int makedir(const char *newdir)