diff options
author | Ryan Lortie <desrt@desrt.ca> | 2015-05-11 09:25:36 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2015-05-11 09:25:36 -0400 |
commit | 1f83033caba9030b9f5464cfe617431e222bcb3b (patch) | |
tree | 107fe38bf3cf89dc322bf310986c3d951ad65b8a | |
parent | 5c13169e53b30a0f8f78bb01b6655ebe220cd95f (diff) |
randomwip/dfi
-rw-r--r-- | src/dfi-builder.c | 33 | ||||
-rw-r--r-- | src/dfi-string-list.h | 2 | ||||
-rw-r--r-- | src/test/.metadata/mimeinfo.cache | 244 |
3 files changed, 35 insertions, 244 deletions
diff --git a/src/dfi-builder.c b/src/dfi-builder.c index fd5c6c5..36769a8 100644 --- a/src/dfi-builder.c +++ b/src/dfi-builder.c @@ -117,6 +117,21 @@ dfi_builder_write_uint32 (DfiBuilder *builder, return offset; } +static guint +dfi_builder_write_uint64 (DfiBuilder *builder, + guint64 value) +{ + guint offset = dfi_builder_get_offset (builder); + + dfi_builder_check_alignment (builder, sizeof (guint64)); + + value = GUINT64_TO_LE (value); + + g_string_append_len (builder->string, (gpointer) &value, sizeof value); + + return offset; +} + #if 0 static guint dfi_builder_write_raw_string (DfiBuilder *builder, @@ -164,6 +179,20 @@ dfi_builder_write_string_list (DfiBuilder *builder, } static guint +dfi_builder_write_uint64_list (DfiBuilder *builder, + const guint64 *items, + guint n_items) +{ + guint offset = dfi_builder_get_aligned (builder, sizeof (guint64)); + guint i; + + for (i = 0; i < n_items; i++) + dfi_builder_write_uint64 (builder, items[i]); + + return offset; +} + +static guint dfi_builder_write_id (DfiBuilder *builder, DfiStringList *string_list, const gchar *string) @@ -337,6 +366,8 @@ dfi_builder_write_text_index (DfiBuilder *builder, enum { + DFI_ITEM_SUBDIRS, + DFI_ITEM_TIMESTAMPS, DFI_ITEM_APP_NAMES, DFI_ITEM_KEY_NAMES, DFI_ITEM_LOCALE_NAMES, @@ -382,6 +413,8 @@ dfi_builder_serialise (DfiBuilder *builder) * refer to strings in the C locale. */ { + items[DFI_ITEM_SUBDIRS] = dfi_builder_write_string_list (builder, builder->subdirs); + items[DFI_ITEM_TIMESTMAPS] = dfi_builder_write_ items[DFI_ITEM_APP_NAMES] = dfi_builder_write_string_list (builder, builder->app_names); items[DFI_ITEM_KEY_NAMES] = dfi_builder_write_string_list (builder, builder->key_names); items[DFI_ITEM_LOCALE_NAMES] = dfi_builder_write_string_list (builder, builder->locale_names); diff --git a/src/dfi-string-list.h b/src/dfi-string-list.h index ca7900b..fbeaf92 100644 --- a/src/dfi-string-list.h +++ b/src/dfi-string-list.h @@ -38,6 +38,8 @@ void dfi_string_list_convert (DfiStri void dfi_string_list_populate_strings (DfiStringList *string_list, DfiStringTable *string_table); +guint dfi_string_list_get_length (DfiStringList *string_list); + const gchar * const * dfi_string_list_get_strings (DfiStringList *string_list, guint *n_strings); diff --git a/src/test/.metadata/mimeinfo.cache b/src/test/.metadata/mimeinfo.cache deleted file mode 100644 index 94f0ddb..0000000 --- a/src/test/.metadata/mimeinfo.cache +++ /dev/null @@ -1,244 +0,0 @@ -[MIME Cache] -application/mxf=totem.desktop; -application/ogg=totem.desktop; -application/oxps=evince.desktop;evince-previewer.desktop; -application/pdf=evince.desktop;evince-previewer.desktop; -application/pkcs10=gcr-viewer.desktop; -application/pkcs10+pem=gcr-viewer.desktop; -application/pkcs12=gcr-viewer.desktop; -application/pkcs12+pem=gcr-viewer.desktop; -application/pkcs7-mime=gcr-viewer.desktop; -application/pkcs7-mime+pem=gcr-viewer.desktop; -application/pkcs8=gcr-viewer.desktop; -application/pkcs8+pem=gcr-viewer.desktop; -application/pkix-cert=gcr-viewer.desktop; -application/pkix-cert+pem=gcr-viewer.desktop; -application/pkix-crl=gcr-viewer.desktop; -application/pkix-crl+pem=gcr-viewer.desktop; -application/ram=totem.desktop; -application/sdp=totem.desktop; -application/smil=totem.desktop; -application/smil+xml=totem.desktop; -application/vnd.apple.mpegurl=totem.desktop; -application/vnd.ms-cab-compressed=file-roller.desktop; -application/vnd.ms-wpl=totem.desktop; -application/vnd.ms-xpsdocument=evince.desktop;evince-previewer.desktop; -application/vnd.rn-realmedia=totem.desktop; -application/x-7z-compressed=file-roller.desktop; -application/x-7z-compressed-tar=file-roller.desktop; -application/x-ace=file-roller.desktop; -application/x-alz=file-roller.desktop; -application/x-ar=file-roller.desktop; -application/x-archive=file-roller.desktop; -application/x-arj=file-roller.desktop; -application/x-bzip=file-roller.desktop; -application/x-bzip-compressed-tar=file-roller.desktop; -application/x-bzip1=file-roller.desktop; -application/x-bzip1-compressed-tar=file-roller.desktop; -application/x-bzpdf=evince.desktop;evince-previewer.desktop; -application/x-cabinet=file-roller.desktop; -application/x-cb7=evince.desktop;evince-previewer.desktop; -application/x-cbr=evince.desktop;evince-previewer.desktop;file-roller.desktop; -application/x-cbt=evince.desktop;evince-previewer.desktop; -application/x-cbz=evince.desktop;evince-previewer.desktop;file-roller.desktop; -application/x-cd-image=file-roller.desktop; -application/x-compress=file-roller.desktop; -application/x-compressed-tar=file-roller.desktop; -application/x-cpio=file-roller.desktop; -application/x-deb=file-roller.desktop; -application/x-ear=file-roller.desktop; -application/x-extension-m4a=totem.desktop; -application/x-extension-mp4=totem.desktop; -application/x-flac=totem.desktop; -application/x-flash-video=totem.desktop; -application/x-font-otf=gnome-font-viewer.desktop; -application/x-font-pcf=gnome-font-viewer.desktop; -application/x-font-ttf=gnome-font-viewer.desktop; -application/x-font-type1=gnome-font-viewer.desktop; -application/x-glade=glade.desktop; -application/x-gnome-saved-search=nautilus.desktop; -application/x-gtar=file-roller.desktop; -application/x-gzip=file-roller.desktop; -application/x-gzpdf=evince.desktop;evince-previewer.desktop; -application/x-gzpostscript=file-roller.desktop; -application/x-java-archive=file-roller.desktop; -application/x-lha=file-roller.desktop; -application/x-lhz=file-roller.desktop; -application/x-lrzip=file-roller.desktop; -application/x-lrzip-compressed-tar=file-roller.desktop; -application/x-lzip=file-roller.desktop; -application/x-lzip-compressed-tar=file-roller.desktop; -application/x-lzma=file-roller.desktop; -application/x-lzma-compressed-tar=file-roller.desktop; -application/x-lzop=file-roller.desktop; -application/x-lzop-compressed-tar=file-roller.desktop; -application/x-matroska=totem.desktop; -application/x-ms-dos-executable=file-roller.desktop; -application/x-ms-wim=file-roller.desktop; -application/x-netshow-channel=totem.desktop; -application/x-ogg=totem.desktop; -application/x-pem-file=gcr-viewer.desktop; -application/x-pem-key=gcr-viewer.desktop; -application/x-pkcs12=gcr-viewer.desktop; -application/x-pkcs7-certificates=gcr-viewer.desktop; -application/x-quicktime-media-link=totem.desktop; -application/x-quicktimeplayer=totem.desktop; -application/x-rar=file-roller.desktop; -application/x-rar-compressed=file-roller.desktop; -application/x-rpm=file-roller.desktop; -application/x-rzip=file-roller.desktop; -application/x-rzip-compressed-tar=file-roller.desktop; -application/x-shorten=totem.desktop; -application/x-smil=totem.desktop; -application/x-spkac=gcr-viewer.desktop; -application/x-spkac+base64=gcr-viewer.desktop; -application/x-stuffit=file-roller.desktop; -application/x-tar=file-roller.desktop; -application/x-tarz=file-roller.desktop; -application/x-war=file-roller.desktop; -application/x-x509-ca-cert=gcr-viewer.desktop; -application/x-x509-user-cert=gcr-viewer.desktop; -application/x-xz=file-roller.desktop; -application/x-xz-compressed-tar=file-roller.desktop; -application/x-xzpdf=evince.desktop;evince-previewer.desktop; -application/x-zip=file-roller.desktop; -application/x-zip-compressed=file-roller.desktop; -application/x-zoo=file-roller.desktop; -application/xspf+xml=totem.desktop; -application/zip=file-roller.desktop; -audio/3gpp=totem.desktop; -audio/AMR=totem.desktop; -audio/AMR-WB=totem.desktop; -audio/ac3=totem.desktop; -audio/basic=totem.desktop; -audio/flac=totem.desktop; -audio/midi=totem.desktop; -audio/mp2=totem.desktop; -audio/mp4=totem.desktop; -audio/mpeg=totem.desktop; -audio/mpegurl=totem.desktop; -audio/ogg=totem.desktop; -audio/prs.sid=totem.desktop; -audio/vnd.rn-realaudio=totem.desktop; -audio/x-aiff=totem.desktop; -audio/x-ape=totem.desktop; -audio/x-flac=totem.desktop; -audio/x-gsm=totem.desktop; -audio/x-it=totem.desktop; -audio/x-m4a=totem.desktop; -audio/x-matroska=totem.desktop; -audio/x-mod=totem.desktop; -audio/x-mp3=totem.desktop; -audio/x-mpeg=totem.desktop; -audio/x-mpegurl=totem.desktop; -audio/x-ms-asf=totem.desktop; -audio/x-ms-asx=totem.desktop; -audio/x-ms-wax=totem.desktop; -audio/x-ms-wma=totem.desktop; -audio/x-musepack=totem.desktop; -audio/x-pn-aiff=totem.desktop; -audio/x-pn-au=totem.desktop; -audio/x-pn-realaudio=totem.desktop; -audio/x-pn-realaudio-plugin=totem.desktop; -audio/x-pn-wav=totem.desktop; -audio/x-pn-windows-acm=totem.desktop; -audio/x-real-audio=totem.desktop; -audio/x-realaudio=totem.desktop; -audio/x-s3m=totem.desktop; -audio/x-sbc=totem.desktop; -audio/x-scpls=totem.desktop; -audio/x-speex=totem.desktop; -audio/x-stm=totem.desktop; -audio/x-tta=totem.desktop; -audio/x-vorbis=totem.desktop; -audio/x-vorbis+ogg=totem.desktop; -audio/x-wav=totem.desktop; -audio/x-wavpack=totem.desktop; -audio/x-xm=totem.desktop; -image/bmp=eog.desktop; -image/gif=eog.desktop; -image/jpeg=eog.desktop; -image/jpg=eog.desktop; -image/pjpeg=eog.desktop; -image/png=eog.desktop; -image/svg+xml=eog.desktop; -image/svg+xml-compressed=eog.desktop; -image/tiff=eog.desktop;evince.desktop;evince-previewer.desktop; -image/vnd.rn-realpix=totem.desktop; -image/vnd.wap.wbmp=eog.desktop; -image/x-bmp=eog.desktop; -image/x-gray=eog.desktop; -image/x-icb=eog.desktop; -image/x-ico=eog.desktop; -image/x-pcx=eog.desktop; -image/x-pict=totem.desktop; -image/x-png=eog.desktop; -image/x-portable-anymap=eog.desktop; -image/x-portable-bitmap=eog.desktop; -image/x-portable-graymap=eog.desktop; -image/x-portable-pixmap=eog.desktop; -image/x-xbitmap=eog.desktop; -image/x-xpixmap=eog.desktop; -inode/directory=baobab.desktop;nautilus.desktop; -misc/ultravox=totem.desktop; -text/google-video-pointer=totem.desktop; -text/plain=gedit.desktop; -text/x-google-video-pointer=totem.desktop; -video/3gp=totem.desktop; -video/3gpp=totem.desktop; -video/divx=totem.desktop; -video/dv=totem.desktop; -video/fli=totem.desktop; -video/flv=totem.desktop; -video/mp2t=totem.desktop; -video/mp4=totem.desktop; -video/mp4v-es=totem.desktop; -video/mpeg=totem.desktop; -video/msvideo=totem.desktop; -video/ogg=totem.desktop; -video/quicktime=totem.desktop; -video/vivo=totem.desktop; -video/vnd.divx=totem.desktop; -video/vnd.mpegurl=totem.desktop; -video/vnd.rn-realvideo=totem.desktop; -video/vnd.vivo=totem.desktop; -video/webm=totem.desktop; -video/x-anim=totem.desktop; -video/x-avi=totem.desktop; -video/x-flc=totem.desktop; -video/x-fli=totem.desktop; -video/x-flic=totem.desktop; -video/x-flv=totem.desktop; -video/x-m4v=totem.desktop; -video/x-matroska=totem.desktop; -video/x-mpeg=totem.desktop; -video/x-mpeg2=totem.desktop; -video/x-ms-asf=totem.desktop; -video/x-ms-asx=totem.desktop; -video/x-ms-wm=totem.desktop; -video/x-ms-wmv=totem.desktop; -video/x-ms-wmx=totem.desktop; -video/x-ms-wvx=totem.desktop; -video/x-msvideo=totem.desktop; -video/x-nsv=totem.desktop; -video/x-ogm+ogg=totem.desktop; -video/x-theora+ogg=totem.desktop; -video/x-totem-stream=totem.desktop; -x-content/unix-software=nautilus-autorun-software.desktop; -x-content/video-dvd=totem.desktop; -x-content/video-svcd=totem.desktop; -x-content/video-vcd=totem.desktop; -x-scheme-handler/ghelp=yelp.desktop; -x-scheme-handler/help=yelp.desktop; -x-scheme-handler/icy=totem.desktop; -x-scheme-handler/icyx=totem.desktop; -x-scheme-handler/info=yelp.desktop; -x-scheme-handler/man=yelp.desktop; -x-scheme-handler/mms=totem.desktop; -x-scheme-handler/mmsh=totem.desktop; -x-scheme-handler/net=totem.desktop; -x-scheme-handler/pnm=totem.desktop; -x-scheme-handler/rtmp=totem.desktop; -x-scheme-handler/rtp=totem.desktop; -x-scheme-handler/rtsp=totem.desktop; -x-scheme-handler/uvox=totem.desktop; |