summaryrefslogtreecommitdiff
path: root/main/src/control/ivug-uuid.c
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-06-08 14:54:16 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-06-08 14:54:16 +0900
commit8b42d4bb33943903b7160bb963bf7e7c6824e9ef (patch)
tree021a596daee9f7e379b8914aad343a2342528e47 /main/src/control/ivug-uuid.c
parent7164c202e81bc53033dce636367d92b93265b915 (diff)
downloadug-image-viewer-efl-8b42d4bb33943903b7160bb963bf7e7c6824e9ef.tar.gz
ug-image-viewer-efl-8b42d4bb33943903b7160bb963bf7e7c6824e9ef.tar.bz2
ug-image-viewer-efl-8b42d4bb33943903b7160bb963bf7e7c6824e9ef.zip
apply FSL(Flora Software License)
Diffstat (limited to 'main/src/control/ivug-uuid.c')
-rwxr-xr-xmain/src/control/ivug-uuid.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/main/src/control/ivug-uuid.c b/main/src/control/ivug-uuid.c
new file mode 100755
index 0000000..b2c8eeb
--- /dev/null
+++ b/main/src/control/ivug-uuid.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "ivug-uuid.h"
+
+UUID uuid_assign(UUID id)
+{
+#ifdef _USE_MEDIAINFO_STRINGID_
+ if ( id == NULL )
+ return NULL;
+
+ return strdup(id);
+#else
+ return id;
+#endif
+}
+
+
+void uuid_free(UUID id)
+{
+#ifdef _USE_MEDIAINFO_STRINGID_
+ if ( id != NULL )
+ free((void *)id);
+#endif
+}
+
+
+int uuid_compare(UUID id1, UUID id2)
+{
+#ifdef _USE_MEDIAINFO_STRINGID_
+ return strcmp(id1, id2);
+#else
+ return id1 - id2;
+#endif
+}
+
+const char *uuid_getchar(UUID id)
+{
+#ifdef _USE_MEDIAINFO_STRINGID_
+ if ( id == NULL )
+ {
+ return "NULL";
+ }
+
+ return id;
+#else
+ {
+ static char buffer[255];
+
+ sprintf(buffer, "%d", id);
+
+ return buffer;
+ }
+#endif
+
+}
+
+
+UUID uuid_getuuid(const char *szID)
+{
+ if ( szID == NULL )
+ {
+ return INVALID_UUID;
+ }
+
+#ifdef _USE_MEDIAINFO_STRINGID_
+ return strdup(szID);
+#else
+ return atoi(szID);
+#endif
+
+}
+
+bool uuid_is_valid(UUID id)
+{
+ return (id != INVALID_UUID) ? true : false;
+}
+
+
+