35 #define REGISTRY_FILENAME ".omxregister"
36 #define REGISTRY_DIR "/var/lib/libomxil-bellagio0/"
38 #ifdef ANDROID_COMPILATION
39 #define TMP_DATA_DIRECTORY "/data/omx/"
41 #define TMP_DATA_DIRECTORY "/tmp/"
52 char *omxregistryfile = NULL;
56 buffer=getenv(
"OMX_BELLAGIO_REGISTRY");
57 if(buffer!=NULL&&*buffer!=
'\0') {
58 omxregistryfile = strdup(buffer);
59 if (!check_exists||stat(omxregistryfile, &sb) == 0) {
60 return omxregistryfile;
62 if (omxregistryfile) {
63 free(omxregistryfile);
70 buffer=getenv(
"XDG_DATA_HOME");
71 if(buffer!=NULL&&*buffer!=
'\0') {
73 strcpy(omxregistryfile, buffer);
74 strcat(omxregistryfile,
"/");
76 if (!check_exists||stat(omxregistryfile, &sb) == 0) {
77 return omxregistryfile;
79 if (omxregistryfile) {
80 free(omxregistryfile);
86 buffer=getenv(
"HOME");
87 if(buffer!=NULL&&*buffer!=
'\0') {
89 strcpy(omxregistryfile, buffer);
90 strcat(omxregistryfile,
"/");
97 if (!check_exists||stat(omxregistryfile, &sb) == 0) {
98 return omxregistryfile;
100 if (omxregistryfile) {
101 free(omxregistryfile);
102 omxregistryfile=NULL;
105 omxregistryfile = malloc(strlen(
REGISTRY_DIR) + strlen(
"registry") + 2);
107 strcat(omxregistryfile,
"registry");
108 return omxregistryfile;
120 char *omxregistryfile = NULL;
123 buffer=getenv(
"XDG_DATA_HOME");
124 if(buffer!=NULL&&*buffer!=
'\0') {
125 omxregistryfile = malloc(strlen(buffer) + strlen(registry_name) + 2);
126 strcpy(omxregistryfile, buffer);
127 strcat(omxregistryfile,
"/");
128 strcat(omxregistryfile, registry_name);
129 return omxregistryfile;
132 buffer=getenv(
"HOME");
133 if(buffer!=NULL&&*buffer!=
'\0') {
134 omxregistryfile = malloc(strlen(buffer) + strlen(registry_name) + 3);
135 strcpy(omxregistryfile, buffer);
136 strcat(omxregistryfile,
"/");
137 strcat(omxregistryfile, registry_name);
141 strcat(omxregistryfile, registry_name);
143 return omxregistryfile;
156 buffer = strdup(newdir);
157 len = strlen(buffer);
163 if (buffer[len-1] ==
'/') {
164 buffer[len-1] =
'\0';
167 err = mkdir(buffer, 0755);
168 if (
err == 0 || ((
err == -1) && (errno == EEXIST))) {
177 while(*p && *p !=
'\\' && *p !=
'/')
181 if ((mkdir(buffer, 0755) == -1) && (errno == ENOENT)) {
196 if ((file = fopen(fname,
"r")))
205 int main (
int argc,
char*argv[]) {
#define REGISTRY_FILENAME
char * componentsRegistryGetFilenameCheck(int check_exists)
#define TMP_DATA_DIRECTORY
char * componentsRegistryGetFilename(void)
Get registry filename This function returns the name of the registry file for the components loaded w...
char * loadersRegistryGetFilename(char *registry_name)
int exists(const char *fname)
int makedir(const char *newdir)
int main(int argc, char *argv[])
execution of registration function