glib2 3.1.8-x86-mingw32 → 3.1.9-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -4
  3. data/ext/glib2/rbglib.h +1 -1
  4. data/lib/2.2/glib2.so +0 -0
  5. data/lib/2.3/glib2.so +0 -0
  6. data/lib/2.4/glib2.so +0 -0
  7. data/lib/gnome2/rake/external-package.rb +5 -0
  8. data/lib/gnome2/rake/windows-binary-build-task.rb +82 -12
  9. data/test/run-test.rb +1 -1
  10. data/vendor/local/bin/asn1Coding.exe +0 -0
  11. data/vendor/local/bin/asn1Decoding.exe +0 -0
  12. data/vendor/local/bin/asn1Parser.exe +0 -0
  13. data/vendor/local/bin/envsubst.exe +0 -0
  14. data/vendor/local/bin/gdbus-codegen +10 -6
  15. data/vendor/local/bin/gdbus.exe +0 -0
  16. data/vendor/local/bin/gettext.exe +0 -0
  17. data/vendor/local/bin/gio-querymodules.exe +0 -0
  18. data/vendor/local/bin/gio.exe +0 -0
  19. data/vendor/local/bin/glib-compile-resources.exe +0 -0
  20. data/vendor/local/bin/glib-compile-schemas.exe +0 -0
  21. data/vendor/local/bin/glib-genmarshal +1056 -0
  22. data/vendor/local/bin/glib-gettextize +1 -1
  23. data/vendor/local/bin/glib-mkenums +694 -579
  24. data/vendor/local/bin/gobject-query.exe +0 -0
  25. data/vendor/local/bin/gresource.exe +0 -0
  26. data/vendor/local/bin/gsettings.exe +0 -0
  27. data/vendor/local/bin/gspawn-win32-helper-console.exe +0 -0
  28. data/vendor/local/bin/gspawn-win32-helper.exe +0 -0
  29. data/vendor/local/bin/iconv.exe +0 -0
  30. data/vendor/local/bin/idn.exe +0 -0
  31. data/vendor/local/bin/libasprintf-0.dll +0 -0
  32. data/vendor/local/bin/libcharset-1.dll +0 -0
  33. data/vendor/local/bin/libffi-6.dll +0 -0
  34. data/vendor/local/bin/libgio-2.0-0.dll +0 -0
  35. data/vendor/local/bin/libglib-2.0-0.dll +0 -0
  36. data/vendor/local/bin/libgmodule-2.0-0.dll +0 -0
  37. data/vendor/local/bin/libgmp-10.dll +0 -0
  38. data/vendor/local/bin/libgnutls-30.dll +0 -0
  39. data/vendor/local/bin/libgobject-2.0-0.dll +0 -0
  40. data/vendor/local/bin/libgthread-2.0-0.dll +0 -0
  41. data/vendor/local/bin/libhogweed-4-2.dll +0 -0
  42. data/vendor/local/bin/libiconv-2.dll +0 -0
  43. data/vendor/local/bin/libidn-11.dll +0 -0
  44. data/vendor/local/bin/libintl-8.dll +0 -0
  45. data/vendor/local/bin/libnettle-6-2.dll +0 -0
  46. data/vendor/local/bin/libp11-kit-0.dll +0 -0
  47. data/vendor/local/bin/libpcre-1.dll +0 -0
  48. data/vendor/local/bin/libpcrecpp-0.dll +0 -0
  49. data/vendor/local/bin/libpcreposix-0.dll +0 -0
  50. data/vendor/local/bin/libtasn1-6.dll +0 -0
  51. data/vendor/local/bin/nettle-hash.exe +0 -0
  52. data/vendor/local/bin/nettle-lfib-stream.exe +0 -0
  53. data/vendor/local/bin/nettle-pbkdf2.exe +0 -0
  54. data/vendor/local/bin/ngettext.exe +0 -0
  55. data/vendor/local/bin/p11-kit.exe +0 -0
  56. data/vendor/local/bin/pcregrep.exe +0 -0
  57. data/vendor/local/bin/pcretest.exe +0 -0
  58. data/vendor/local/bin/pkcs1-conv.exe +0 -0
  59. data/vendor/local/bin/sexp-conv.exe +0 -0
  60. data/vendor/local/bin/trust.exe +0 -0
  61. data/vendor/local/include/gio-win32-2.0/gio/gwin32inputstream.h +1 -1
  62. data/vendor/local/include/gio-win32-2.0/gio/gwin32outputstream.h +1 -1
  63. data/vendor/local/include/glib-2.0/gio/gaction.h +4 -4
  64. data/vendor/local/include/glib-2.0/gio/gactiongroup.h +4 -4
  65. data/vendor/local/include/glib-2.0/gio/gactiongroupexporter.h +4 -4
  66. data/vendor/local/include/glib-2.0/gio/gactionmap.h +4 -4
  67. data/vendor/local/include/glib-2.0/gio/gappinfo.h +1 -1
  68. data/vendor/local/include/glib-2.0/gio/gapplication.h +4 -4
  69. data/vendor/local/include/glib-2.0/gio/gapplicationcommandline.h +4 -4
  70. data/vendor/local/include/glib-2.0/gio/gasyncinitable.h +2 -2
  71. data/vendor/local/include/glib-2.0/gio/gasyncresult.h +1 -1
  72. data/vendor/local/include/glib-2.0/gio/gbufferedinputstream.h +1 -1
  73. data/vendor/local/include/glib-2.0/gio/gbufferedoutputstream.h +1 -1
  74. data/vendor/local/include/glib-2.0/gio/gbytesicon.h +1 -1
  75. data/vendor/local/include/glib-2.0/gio/gcancellable.h +1 -1
  76. data/vendor/local/include/glib-2.0/gio/gcharsetconverter.h +1 -1
  77. data/vendor/local/include/glib-2.0/gio/gcontenttype.h +1 -1
  78. data/vendor/local/include/glib-2.0/gio/gconverter.h +1 -1
  79. data/vendor/local/include/glib-2.0/gio/gconverterinputstream.h +1 -1
  80. data/vendor/local/include/glib-2.0/gio/gconverteroutputstream.h +1 -1
  81. data/vendor/local/include/glib-2.0/gio/gcredentials.h +1 -1
  82. data/vendor/local/include/glib-2.0/gio/gdatagrambased.h +1 -1
  83. data/vendor/local/include/glib-2.0/gio/gdatainputstream.h +1 -1
  84. data/vendor/local/include/glib-2.0/gio/gdataoutputstream.h +1 -1
  85. data/vendor/local/include/glib-2.0/gio/gdbusactiongroup.h +4 -4
  86. data/vendor/local/include/glib-2.0/gio/gdbusaddress.h +1 -1
  87. data/vendor/local/include/glib-2.0/gio/gdbusauthobserver.h +1 -1
  88. data/vendor/local/include/glib-2.0/gio/gdbusconnection.h +1 -1
  89. data/vendor/local/include/glib-2.0/gio/gdbuserror.h +1 -1
  90. data/vendor/local/include/glib-2.0/gio/gdbusinterface.h +1 -1
  91. data/vendor/local/include/glib-2.0/gio/gdbusinterfaceskeleton.h +1 -1
  92. data/vendor/local/include/glib-2.0/gio/gdbusintrospection.h +1 -1
  93. data/vendor/local/include/glib-2.0/gio/gdbusmenumodel.h +4 -4
  94. data/vendor/local/include/glib-2.0/gio/gdbusmessage.h +1 -1
  95. data/vendor/local/include/glib-2.0/gio/gdbusmethodinvocation.h +1 -1
  96. data/vendor/local/include/glib-2.0/gio/gdbusnameowning.h +1 -1
  97. data/vendor/local/include/glib-2.0/gio/gdbusnamewatching.h +1 -1
  98. data/vendor/local/include/glib-2.0/gio/gdbusobject.h +1 -1
  99. data/vendor/local/include/glib-2.0/gio/gdbusobjectmanager.h +1 -1
  100. data/vendor/local/include/glib-2.0/gio/gdbusobjectmanagerclient.h +1 -1
  101. data/vendor/local/include/glib-2.0/gio/gdbusobjectmanagerserver.h +1 -1
  102. data/vendor/local/include/glib-2.0/gio/gdbusobjectproxy.h +1 -1
  103. data/vendor/local/include/glib-2.0/gio/gdbusobjectskeleton.h +1 -1
  104. data/vendor/local/include/glib-2.0/gio/gdbusproxy.h +1 -1
  105. data/vendor/local/include/glib-2.0/gio/gdbusserver.h +1 -1
  106. data/vendor/local/include/glib-2.0/gio/gdbusutils.h +1 -1
  107. data/vendor/local/include/glib-2.0/gio/gdrive.h +1 -1
  108. data/vendor/local/include/glib-2.0/gio/gdtlsclientconnection.h +1 -1
  109. data/vendor/local/include/glib-2.0/gio/gdtlsconnection.h +1 -1
  110. data/vendor/local/include/glib-2.0/gio/gdtlsserverconnection.h +1 -1
  111. data/vendor/local/include/glib-2.0/gio/gemblem.h +1 -1
  112. data/vendor/local/include/glib-2.0/gio/gemblemedicon.h +1 -1
  113. data/vendor/local/include/glib-2.0/gio/gfile.h +1 -1
  114. data/vendor/local/include/glib-2.0/gio/gfileattribute.h +1 -1
  115. data/vendor/local/include/glib-2.0/gio/gfileenumerator.h +1 -1
  116. data/vendor/local/include/glib-2.0/gio/gfileicon.h +1 -1
  117. data/vendor/local/include/glib-2.0/gio/gfileinfo.h +1 -1
  118. data/vendor/local/include/glib-2.0/gio/gfileinputstream.h +1 -1
  119. data/vendor/local/include/glib-2.0/gio/gfileiostream.h +1 -1
  120. data/vendor/local/include/glib-2.0/gio/gfilemonitor.h +1 -1
  121. data/vendor/local/include/glib-2.0/gio/gfilenamecompleter.h +1 -1
  122. data/vendor/local/include/glib-2.0/gio/gfileoutputstream.h +1 -1
  123. data/vendor/local/include/glib-2.0/gio/gfilterinputstream.h +1 -1
  124. data/vendor/local/include/glib-2.0/gio/gfilteroutputstream.h +1 -1
  125. data/vendor/local/include/glib-2.0/gio/gicon.h +1 -1
  126. data/vendor/local/include/glib-2.0/gio/ginetaddress.h +1 -1
  127. data/vendor/local/include/glib-2.0/gio/ginetaddressmask.h +1 -1
  128. data/vendor/local/include/glib-2.0/gio/ginetsocketaddress.h +1 -1
  129. data/vendor/local/include/glib-2.0/gio/ginitable.h +3 -2
  130. data/vendor/local/include/glib-2.0/gio/ginputstream.h +1 -1
  131. data/vendor/local/include/glib-2.0/gio/gio-autocleanups.h +1 -1
  132. data/vendor/local/include/glib-2.0/gio/gio.h +1 -1
  133. data/vendor/local/include/glib-2.0/gio/gioenums.h +7 -2
  134. data/vendor/local/include/glib-2.0/gio/gioerror.h +1 -1
  135. data/vendor/local/include/glib-2.0/gio/giomodule.h +1 -1
  136. data/vendor/local/include/glib-2.0/gio/gioscheduler.h +1 -1
  137. data/vendor/local/include/glib-2.0/gio/giostream.h +4 -4
  138. data/vendor/local/include/glib-2.0/gio/giotypes.h +1 -1
  139. data/vendor/local/include/glib-2.0/gio/glistmodel.h +1 -1
  140. data/vendor/local/include/glib-2.0/gio/gliststore.h +1 -1
  141. data/vendor/local/include/glib-2.0/gio/gloadableicon.h +1 -1
  142. data/vendor/local/include/glib-2.0/gio/gmemoryinputstream.h +1 -1
  143. data/vendor/local/include/glib-2.0/gio/gmemoryoutputstream.h +1 -1
  144. data/vendor/local/include/glib-2.0/gio/gmenu.h +4 -4
  145. data/vendor/local/include/glib-2.0/gio/gmenuexporter.h +4 -4
  146. data/vendor/local/include/glib-2.0/gio/gmenumodel.h +4 -4
  147. data/vendor/local/include/glib-2.0/gio/gmount.h +1 -1
  148. data/vendor/local/include/glib-2.0/gio/gmountoperation.h +1 -1
  149. data/vendor/local/include/glib-2.0/gio/gnativevolumemonitor.h +1 -1
  150. data/vendor/local/include/glib-2.0/gio/gnetworkaddress.h +1 -1
  151. data/vendor/local/include/glib-2.0/gio/gnetworking.h +3 -3
  152. data/vendor/local/include/glib-2.0/gio/gnetworkmonitor.h +1 -1
  153. data/vendor/local/include/glib-2.0/gio/gnetworkservice.h +1 -1
  154. data/vendor/local/include/glib-2.0/gio/gnotification.h +1 -1
  155. data/vendor/local/include/glib-2.0/gio/goutputstream.h +1 -1
  156. data/vendor/local/include/glib-2.0/gio/gpermission.h +1 -1
  157. data/vendor/local/include/glib-2.0/gio/gpollableinputstream.h +1 -1
  158. data/vendor/local/include/glib-2.0/gio/gpollableoutputstream.h +1 -1
  159. data/vendor/local/include/glib-2.0/gio/gpollableutils.h +1 -1
  160. data/vendor/local/include/glib-2.0/gio/gpropertyaction.h +4 -4
  161. data/vendor/local/include/glib-2.0/gio/gproxy.h +1 -1
  162. data/vendor/local/include/glib-2.0/gio/gproxyaddress.h +1 -1
  163. data/vendor/local/include/glib-2.0/gio/gproxyaddressenumerator.h +1 -1
  164. data/vendor/local/include/glib-2.0/gio/gproxyresolver.h +1 -1
  165. data/vendor/local/include/glib-2.0/gio/gremoteactiongroup.h +4 -4
  166. data/vendor/local/include/glib-2.0/gio/gresolver.h +1 -1
  167. data/vendor/local/include/glib-2.0/gio/gresource.h +1 -1
  168. data/vendor/local/include/glib-2.0/gio/gseekable.h +1 -1
  169. data/vendor/local/include/glib-2.0/gio/gsettings.h +1 -1
  170. data/vendor/local/include/glib-2.0/gio/gsettingsbackend.h +1 -1
  171. data/vendor/local/include/glib-2.0/gio/gsettingsschema.h +1 -1
  172. data/vendor/local/include/glib-2.0/gio/gsimpleaction.h +4 -4
  173. data/vendor/local/include/glib-2.0/gio/gsimpleactiongroup.h +4 -4
  174. data/vendor/local/include/glib-2.0/gio/gsimpleasyncresult.h +1 -1
  175. data/vendor/local/include/glib-2.0/gio/gsimpleiostream.h +4 -4
  176. data/vendor/local/include/glib-2.0/gio/gsimplepermission.h +1 -1
  177. data/vendor/local/include/glib-2.0/gio/gsimpleproxyresolver.h +1 -1
  178. data/vendor/local/include/glib-2.0/gio/gsocket.h +1 -1
  179. data/vendor/local/include/glib-2.0/gio/gsocketaddress.h +1 -1
  180. data/vendor/local/include/glib-2.0/gio/gsocketaddressenumerator.h +1 -1
  181. data/vendor/local/include/glib-2.0/gio/gsocketclient.h +4 -4
  182. data/vendor/local/include/glib-2.0/gio/gsocketconnectable.h +1 -1
  183. data/vendor/local/include/glib-2.0/gio/gsocketconnection.h +4 -4
  184. data/vendor/local/include/glib-2.0/gio/gsocketcontrolmessage.h +4 -4
  185. data/vendor/local/include/glib-2.0/gio/gsocketlistener.h +4 -4
  186. data/vendor/local/include/glib-2.0/gio/gsocketservice.h +4 -4
  187. data/vendor/local/include/glib-2.0/gio/gsrvtarget.h +1 -1
  188. data/vendor/local/include/glib-2.0/gio/gsubprocess.h +1 -1
  189. data/vendor/local/include/glib-2.0/gio/gsubprocesslauncher.h +1 -1
  190. data/vendor/local/include/glib-2.0/gio/gtask.h +1 -1
  191. data/vendor/local/include/glib-2.0/gio/gtcpconnection.h +4 -4
  192. data/vendor/local/include/glib-2.0/gio/gtcpwrapperconnection.h +4 -4
  193. data/vendor/local/include/glib-2.0/gio/gtestdbus.h +1 -1
  194. data/vendor/local/include/glib-2.0/gio/gthemedicon.h +1 -1
  195. data/vendor/local/include/glib-2.0/gio/gthreadedsocketservice.h +4 -4
  196. data/vendor/local/include/glib-2.0/gio/gtlsbackend.h +1 -1
  197. data/vendor/local/include/glib-2.0/gio/gtlscertificate.h +1 -1
  198. data/vendor/local/include/glib-2.0/gio/gtlsclientconnection.h +1 -1
  199. data/vendor/local/include/glib-2.0/gio/gtlsconnection.h +1 -1
  200. data/vendor/local/include/glib-2.0/gio/gtlsdatabase.h +1 -1
  201. data/vendor/local/include/glib-2.0/gio/gtlsfiledatabase.h +4 -4
  202. data/vendor/local/include/glib-2.0/gio/gtlsinteraction.h +1 -1
  203. data/vendor/local/include/glib-2.0/gio/gtlspassword.h +1 -1
  204. data/vendor/local/include/glib-2.0/gio/gtlsserverconnection.h +1 -1
  205. data/vendor/local/include/glib-2.0/gio/gvfs.h +1 -1
  206. data/vendor/local/include/glib-2.0/gio/gvolume.h +1 -1
  207. data/vendor/local/include/glib-2.0/gio/gvolumemonitor.h +1 -1
  208. data/vendor/local/include/glib-2.0/gio/gzlibcompressor.h +1 -1
  209. data/vendor/local/include/glib-2.0/gio/gzlibdecompressor.h +1 -1
  210. data/vendor/local/include/glib-2.0/glib-object.h +1 -1
  211. data/vendor/local/include/glib-2.0/glib-unix.h +5 -5
  212. data/vendor/local/include/glib-2.0/glib.h +1 -1
  213. data/vendor/local/include/glib-2.0/glib/deprecated/gallocator.h +1 -1
  214. data/vendor/local/include/glib-2.0/glib/deprecated/gcache.h +1 -1
  215. data/vendor/local/include/glib-2.0/glib/deprecated/gcompletion.h +1 -1
  216. data/vendor/local/include/glib-2.0/glib/deprecated/gmain.h +1 -1
  217. data/vendor/local/include/glib-2.0/glib/deprecated/grel.h +1 -1
  218. data/vendor/local/include/glib-2.0/glib/deprecated/gthread.h +1 -1
  219. data/vendor/local/include/glib-2.0/glib/galloca.h +1 -1
  220. data/vendor/local/include/glib-2.0/glib/garray.h +10 -1
  221. data/vendor/local/include/glib-2.0/glib/gasyncqueue.h +1 -1
  222. data/vendor/local/include/glib-2.0/glib/gatomic.h +4 -4
  223. data/vendor/local/include/glib-2.0/glib/gbacktrace.h +1 -1
  224. data/vendor/local/include/glib-2.0/glib/gbase64.h +5 -5
  225. data/vendor/local/include/glib-2.0/glib/gbitlock.h +1 -1
  226. data/vendor/local/include/glib-2.0/glib/gbookmarkfile.h +4 -4
  227. data/vendor/local/include/glib-2.0/glib/gbytes.h +1 -1
  228. data/vendor/local/include/glib-2.0/glib/gcharset.h +1 -1
  229. data/vendor/local/include/glib-2.0/glib/gchecksum.h +5 -5
  230. data/vendor/local/include/glib-2.0/glib/gconvert.h +1 -31
  231. data/vendor/local/include/glib-2.0/glib/gdataset.h +1 -1
  232. data/vendor/local/include/glib-2.0/glib/gdate.h +1 -1
  233. data/vendor/local/include/glib-2.0/glib/gdir.h +1 -15
  234. data/vendor/local/include/glib-2.0/glib/genviron.h +1 -17
  235. data/vendor/local/include/glib-2.0/glib/gerror.h +1 -1
  236. data/vendor/local/include/glib-2.0/glib/gfileutils.h +1 -28
  237. data/vendor/local/include/glib-2.0/glib/ggettext.h +1 -1
  238. data/vendor/local/include/glib-2.0/glib/ghash.h +1 -1
  239. data/vendor/local/include/glib-2.0/glib/ghmac.h +5 -5
  240. data/vendor/local/include/glib-2.0/glib/ghook.h +1 -1
  241. data/vendor/local/include/glib-2.0/glib/ghostutils.h +1 -1
  242. data/vendor/local/include/glib-2.0/glib/gi18n-lib.h +1 -1
  243. data/vendor/local/include/glib-2.0/glib/gi18n.h +1 -1
  244. data/vendor/local/include/glib-2.0/glib/giochannel.h +1 -12
  245. data/vendor/local/include/glib-2.0/glib/gkeyfile.h +1 -1
  246. data/vendor/local/include/glib-2.0/glib/glib-autocleanups.h +1 -1
  247. data/vendor/local/include/glib-2.0/glib/glist.h +1 -1
  248. data/vendor/local/include/glib-2.0/glib/gmacros.h +1 -1
  249. data/vendor/local/include/glib-2.0/glib/gmain.h +5 -5
  250. data/vendor/local/include/glib-2.0/glib/gmappedfile.h +1 -1
  251. data/vendor/local/include/glib-2.0/glib/gmarkup.h +1 -1
  252. data/vendor/local/include/glib-2.0/glib/gmem.h +1 -1
  253. data/vendor/local/include/glib-2.0/glib/gmessages.h +8 -1
  254. data/vendor/local/include/glib-2.0/glib/gnode.h +1 -1
  255. data/vendor/local/include/glib-2.0/glib/goption.h +6 -6
  256. data/vendor/local/include/glib-2.0/glib/gpattern.h +1 -1
  257. data/vendor/local/include/glib-2.0/glib/gpoll.h +6 -6
  258. data/vendor/local/include/glib-2.0/glib/gprimes.h +1 -1
  259. data/vendor/local/include/glib-2.0/glib/gprintf.h +1 -1
  260. data/vendor/local/include/glib-2.0/glib/gqsort.h +1 -1
  261. data/vendor/local/include/glib-2.0/glib/gquark.h +1 -1
  262. data/vendor/local/include/glib-2.0/glib/gqueue.h +1 -1
  263. data/vendor/local/include/glib-2.0/glib/grand.h +1 -1
  264. data/vendor/local/include/glib-2.0/glib/gscanner.h +1 -1
  265. data/vendor/local/include/glib-2.0/glib/gsequence.h +1 -1
  266. data/vendor/local/include/glib-2.0/glib/gshell.h +1 -1
  267. data/vendor/local/include/glib-2.0/glib/gslice.h +1 -1
  268. data/vendor/local/include/glib-2.0/glib/gslist.h +1 -1
  269. data/vendor/local/include/glib-2.0/glib/gspawn.h +1 -54
  270. data/vendor/local/include/glib-2.0/glib/gstdio.h +1 -1
  271. data/vendor/local/include/glib-2.0/glib/gstrfuncs.h +48 -1
  272. data/vendor/local/include/glib-2.0/glib/gstring.h +1 -1
  273. data/vendor/local/include/glib-2.0/glib/gstringchunk.h +1 -1
  274. data/vendor/local/include/glib-2.0/glib/gtestutils.h +1 -1
  275. data/vendor/local/include/glib-2.0/glib/gthread.h +4 -4
  276. data/vendor/local/include/glib-2.0/glib/gthreadpool.h +1 -1
  277. data/vendor/local/include/glib-2.0/glib/gtimer.h +1 -1
  278. data/vendor/local/include/glib-2.0/glib/gtimezone.h +4 -4
  279. data/vendor/local/include/glib-2.0/glib/gtrashstack.h +1 -1
  280. data/vendor/local/include/glib-2.0/glib/gtree.h +1 -1
  281. data/vendor/local/include/glib-2.0/glib/gtypes.h +1 -1
  282. data/vendor/local/include/glib-2.0/glib/gunicode.h +12 -2
  283. data/vendor/local/include/glib-2.0/glib/gurifuncs.h +1 -1
  284. data/vendor/local/include/glib-2.0/glib/gutils.h +1 -1
  285. data/vendor/local/include/glib-2.0/glib/gvariant.h +1 -1
  286. data/vendor/local/include/glib-2.0/glib/gvarianttype.h +5 -4
  287. data/vendor/local/include/glib-2.0/glib/gversion.h +1 -1
  288. data/vendor/local/include/glib-2.0/glib/gversionmacros.h +25 -1
  289. data/vendor/local/include/glib-2.0/glib/gwin32.h +1 -20
  290. data/vendor/local/include/glib-2.0/gmodule.h +15 -15
  291. data/vendor/local/include/glib-2.0/gobject/gbinding.h +1 -1
  292. data/vendor/local/include/glib-2.0/gobject/gboxed.h +1 -1
  293. data/vendor/local/include/glib-2.0/gobject/gclosure.h +1 -1
  294. data/vendor/local/include/glib-2.0/gobject/genums.h +7 -1
  295. data/vendor/local/include/glib-2.0/gobject/glib-types.h +1 -1
  296. data/vendor/local/include/glib-2.0/gobject/gobject-autocleanups.h +2 -1
  297. data/vendor/local/include/glib-2.0/gobject/gobject.h +17 -2
  298. data/vendor/local/include/glib-2.0/gobject/gobjectnotifyqueue.c +1 -1
  299. data/vendor/local/include/glib-2.0/gobject/gparam.h +3 -1
  300. data/vendor/local/include/glib-2.0/gobject/gparamspecs.h +1 -1
  301. data/vendor/local/include/glib-2.0/gobject/gsignal.h +1 -1
  302. data/vendor/local/include/glib-2.0/gobject/gsourceclosure.h +1 -1
  303. data/vendor/local/include/glib-2.0/gobject/gtype.h +15 -3
  304. data/vendor/local/include/glib-2.0/gobject/gtypemodule.h +1 -1
  305. data/vendor/local/include/glib-2.0/gobject/gtypeplugin.h +1 -1
  306. data/vendor/local/include/glib-2.0/gobject/gvalue.h +1 -1
  307. data/vendor/local/include/glib-2.0/gobject/gvaluearray.h +1 -1
  308. data/vendor/local/include/glib-2.0/gobject/gvaluecollector.h +1 -1
  309. data/vendor/local/include/glib-2.0/gobject/gvaluetypes.h +1 -1
  310. data/vendor/local/lib/gio/modules/libgiognutls.a +0 -0
  311. data/vendor/local/lib/gio/modules/libgiognutls.dll +0 -0
  312. data/vendor/local/lib/gio/modules/libgiognutls.dll.a +0 -0
  313. data/vendor/local/lib/glib-2.0/include/glibconfig.h +2 -2
  314. data/vendor/local/lib/libasprintf.dll.a +0 -0
  315. data/vendor/local/lib/libcharset.dll.a +0 -0
  316. data/vendor/local/lib/libffi.dll.a +0 -0
  317. data/vendor/local/lib/libgio-2.0.dll.a +0 -0
  318. data/vendor/local/lib/libgio-2.0.la +3 -3
  319. data/vendor/local/lib/libglib-2.0.dll.a +0 -0
  320. data/vendor/local/lib/libglib-2.0.la +3 -3
  321. data/vendor/local/lib/libgmodule-2.0.dll.a +0 -0
  322. data/vendor/local/lib/libgmodule-2.0.la +3 -3
  323. data/vendor/local/lib/libgmp.dll.a +0 -0
  324. data/vendor/local/lib/libgnutls.dll.a +0 -0
  325. data/vendor/local/lib/libgobject-2.0.dll.a +0 -0
  326. data/vendor/local/lib/libgobject-2.0.la +3 -3
  327. data/vendor/local/lib/libgthread-2.0.dll.a +0 -0
  328. data/vendor/local/lib/libgthread-2.0.la +3 -3
  329. data/vendor/local/lib/libhogweed.dll.a +0 -0
  330. data/vendor/local/lib/libiconv.dll.a +0 -0
  331. data/vendor/local/lib/libidn.dll.a +0 -0
  332. data/vendor/local/lib/libintl.dll.a +0 -0
  333. data/vendor/local/lib/libnettle.dll.a +0 -0
  334. data/vendor/local/lib/libp11-kit.dll.a +0 -0
  335. data/vendor/local/lib/libpcre.dll.a +0 -0
  336. data/vendor/local/lib/libpcrecpp.dll.a +0 -0
  337. data/vendor/local/lib/libpcreposix.dll.a +0 -0
  338. data/vendor/local/lib/libtasn1.dll.a +0 -0
  339. data/vendor/local/lib/p11-kit/p11-kit-remote.exe +0 -0
  340. data/vendor/local/lib/pkcs11/p11-kit-trust.dll +0 -0
  341. data/vendor/local/lib/pkcs11/p11-kit-trust.dll.a +0 -0
  342. data/vendor/local/lib/pkgconfig/gio-2.0.pc +1 -1
  343. data/vendor/local/lib/pkgconfig/gio-windows-2.0.pc +1 -1
  344. data/vendor/local/lib/pkgconfig/glib-2.0.pc +1 -1
  345. data/vendor/local/lib/pkgconfig/gmodule-2.0.pc +1 -1
  346. data/vendor/local/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
  347. data/vendor/local/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
  348. data/vendor/local/lib/pkgconfig/gobject-2.0.pc +1 -1
  349. data/vendor/local/lib/pkgconfig/gthread-2.0.pc +1 -1
  350. data/vendor/local/share/gdb/auto-load/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/lib/{libglib-2.0.so.0.5200.3-gdb.py → libglib-2.0.so.0.5400.1-gdb.py} +0 -0
  351. data/vendor/local/share/gdb/auto-load/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/lib/{libgobject-2.0.so.0.5200.3-gdb.py → libgobject-2.0.so.0.5400.1-gdb.py} +0 -0
  352. data/vendor/local/share/glib-2.0/codegen/__init__.py +1 -1
  353. data/vendor/local/share/glib-2.0/codegen/__init__.pyc +0 -0
  354. data/vendor/local/share/glib-2.0/codegen/__init__.pyo +0 -0
  355. data/vendor/local/share/glib-2.0/codegen/codegen.py +11 -11
  356. data/vendor/local/share/glib-2.0/codegen/codegen.pyc +0 -0
  357. data/vendor/local/share/glib-2.0/codegen/codegen.pyo +0 -0
  358. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.py +1 -1
  359. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyc +0 -0
  360. data/vendor/local/share/glib-2.0/codegen/codegen_docbook.pyo +0 -0
  361. data/vendor/local/share/glib-2.0/codegen/codegen_main.py +1 -1
  362. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyc +0 -0
  363. data/vendor/local/share/glib-2.0/codegen/codegen_main.pyo +0 -0
  364. data/vendor/local/share/glib-2.0/codegen/config.py +2 -5
  365. data/vendor/local/share/glib-2.0/codegen/config.pyc +0 -0
  366. data/vendor/local/share/glib-2.0/codegen/config.pyo +0 -0
  367. data/vendor/local/share/glib-2.0/codegen/dbustypes.py +1 -1
  368. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyc +0 -0
  369. data/vendor/local/share/glib-2.0/codegen/dbustypes.pyo +0 -0
  370. data/vendor/local/share/glib-2.0/codegen/parser.py +1 -1
  371. data/vendor/local/share/glib-2.0/codegen/parser.pyc +0 -0
  372. data/vendor/local/share/glib-2.0/codegen/parser.pyo +0 -0
  373. data/vendor/local/share/glib-2.0/codegen/utils.py +1 -1
  374. data/vendor/local/share/glib-2.0/codegen/utils.pyc +0 -0
  375. data/vendor/local/share/glib-2.0/codegen/utils.pyo +0 -0
  376. data/vendor/local/share/glib-2.0/schemas/gschemas.compiled +0 -0
  377. data/vendor/local/share/glib-2.0/valgrind/glib.supp +10 -0
  378. data/vendor/local/share/gtk-doc/html/gio/GApplication.html +1 -1
  379. data/vendor/local/share/gtk-doc/html/gio/GAsyncInitable.html +12 -5
  380. data/vendor/local/share/gtk-doc/html/gio/GDBusInterfaceSkeleton.html +1 -1
  381. data/vendor/local/share/gtk-doc/html/gio/GDBusObject.html +3 -2
  382. data/vendor/local/share/gtk-doc/html/gio/GDataInputStream.html +8 -8
  383. data/vendor/local/share/gtk-doc/html/gio/GFile.html +9 -7
  384. data/vendor/local/share/gtk-doc/html/gio/GInitable.html +23 -5
  385. data/vendor/local/share/gtk-doc/html/gio/GInputStream.html +6 -4
  386. data/vendor/local/share/gtk-doc/html/gio/GMount.html +2 -2
  387. data/vendor/local/share/gtk-doc/html/gio/GNetworkMonitor.html +4 -2
  388. data/vendor/local/share/gtk-doc/html/gio/GProxyResolver.html +3 -0
  389. data/vendor/local/share/gtk-doc/html/gio/GResource.html +23 -11
  390. data/vendor/local/share/gtk-doc/html/gio/GSettings.html +1 -2
  391. data/vendor/local/share/gtk-doc/html/gio/GSocket.html +3 -3
  392. data/vendor/local/share/gtk-doc/html/gio/GSocketListener.html +4 -4
  393. data/vendor/local/share/gtk-doc/html/gio/GSubprocessLauncher.html +6 -2
  394. data/vendor/local/share/gtk-doc/html/gio/GTlsInteraction.html +1 -1
  395. data/vendor/local/share/gtk-doc/html/gio/api-index-full.html +10 -2
  396. data/vendor/local/share/gtk-doc/html/gio/gdbus.html +38 -0
  397. data/vendor/local/share/gtk-doc/html/gio/gio-D-Bus-Introspection-Data.html +4 -4
  398. data/vendor/local/share/gtk-doc/html/gio/gio-D-Bus-Utilities.html +5 -1
  399. data/vendor/local/share/gtk-doc/html/gio/gio-Extension-Points.html +1 -1
  400. data/vendor/local/share/gtk-doc/html/gio/gio-GIOError.html +2 -0
  401. data/vendor/local/share/gtk-doc/html/gio/gio-GWin32RegistryKey.html +4 -4
  402. data/vendor/local/share/gtk-doc/html/gio/gio-Owning-Bus-Names.html +8 -0
  403. data/vendor/local/share/gtk-doc/html/gio/gio-Unix-Mounts.html +138 -64
  404. data/vendor/local/share/gtk-doc/html/gio/gio-hierarchy.html +3 -1
  405. data/vendor/local/share/gtk-doc/html/gio/gio.devhelp2 +7 -4
  406. data/vendor/local/share/gtk-doc/html/gio/gresource-tool.html +1 -1
  407. data/vendor/local/share/gtk-doc/html/gio/index.html +1 -1
  408. data/vendor/local/share/gtk-doc/html/glib/annotation-glossary.html +2 -2
  409. data/vendor/local/share/gtk-doc/html/glib/api-index-full.html +24 -0
  410. data/vendor/local/share/gtk-doc/html/glib/glib-Arrays.html +5 -2
  411. data/vendor/local/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html +10 -1
  412. data/vendor/local/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html +1 -1
  413. data/vendor/local/share/gtk-doc/html/glib/glib-Error-Reporting.html +7 -3
  414. data/vendor/local/share/gtk-doc/html/glib/glib-GVariant.html +11 -10
  415. data/vendor/local/share/gtk-doc/html/glib/glib-GVariantType.html +5 -4
  416. data/vendor/local/share/gtk-doc/html/glib/glib-Hash-Tables.html +5 -2
  417. data/vendor/local/share/gtk-doc/html/glib/glib-IO-Channels.html +9 -7
  418. data/vendor/local/share/gtk-doc/html/glib/glib-Message-Logging.html +30 -5
  419. data/vendor/local/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html +43 -29
  420. data/vendor/local/share/gtk-doc/html/glib/glib-Pointer-Arrays.html +146 -1
  421. data/vendor/local/share/gtk-doc/html/glib/glib-Sequences.html +38 -19
  422. data/vendor/local/share/gtk-doc/html/glib/glib-Singly-Linked-Lists.html +4 -1
  423. data/vendor/local/share/gtk-doc/html/glib/glib-Spawning-Processes.html +103 -13
  424. data/vendor/local/share/gtk-doc/html/glib/glib-String-Utility-Functions.html +254 -1
  425. data/vendor/local/share/gtk-doc/html/glib/glib-UNIX-specific-utilities-and-integration.html +1 -1
  426. data/vendor/local/share/gtk-doc/html/glib/glib-URI-Functions.html +1 -1
  427. data/vendor/local/share/gtk-doc/html/glib/glib-Unicode-Manipulation.html +34 -1
  428. data/vendor/local/share/gtk-doc/html/glib/glib-Version-Information.html +2 -2
  429. data/vendor/local/share/gtk-doc/html/glib/glib-running.html +6 -7
  430. data/vendor/local/share/gtk-doc/html/glib/glib.devhelp2 +13 -0
  431. data/vendor/local/share/gtk-doc/html/glib/glib.html +1 -1
  432. data/vendor/local/share/gtk-doc/html/glib/gvariant-format-strings.html +94 -39
  433. data/vendor/local/share/gtk-doc/html/glib/index.html +1 -1
  434. data/vendor/local/share/gtk-doc/html/gobject/api-index-full.html +20 -0
  435. data/vendor/local/share/gtk-doc/html/gobject/glib-genmarshal.html +81 -14
  436. data/vendor/local/share/gtk-doc/html/gobject/gobject-Enumeration-and-Flag-Types.html +95 -0
  437. data/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html +191 -3
  438. data/vendor/local/share/gtk-doc/html/gobject/gobject.devhelp2 +7 -2
  439. data/vendor/local/share/gtk-doc/html/gobject/gtype-non-instantiable-classed.html +2 -2
  440. data/vendor/local/share/gtk-doc/html/gobject/howto-interface-prerequisite.html +1 -1
  441. data/vendor/local/share/gtk-doc/html/gobject/howto-interface.html +1 -1
  442. data/vendor/local/share/gtk-doc/html/gobject/index.html +1 -1
  443. data/vendor/local/share/gtk-doc/html/gobject/signal.html +1 -1
  444. data/vendor/local/share/license/glib/COPYING +118 -98
  445. data/vendor/local/share/locale/be/LC_MESSAGES/glib-networking.mo +0 -0
  446. data/vendor/local/share/locale/bg/LC_MESSAGES/glib-networking.mo +0 -0
  447. data/vendor/local/share/locale/ca/LC_MESSAGES/glib-networking.mo +0 -0
  448. data/vendor/local/share/locale/ca/LC_MESSAGES/glib20.mo +0 -0
  449. data/vendor/local/share/locale/cs/LC_MESSAGES/glib-networking.mo +0 -0
  450. data/vendor/local/share/locale/cs/LC_MESSAGES/glib20.mo +0 -0
  451. data/vendor/local/share/locale/da/LC_MESSAGES/glib-networking.mo +0 -0
  452. data/vendor/local/share/locale/da/LC_MESSAGES/glib20.mo +0 -0
  453. data/vendor/local/share/locale/de/LC_MESSAGES/glib-networking.mo +0 -0
  454. data/vendor/local/share/locale/de/LC_MESSAGES/glib20.mo +0 -0
  455. data/vendor/local/share/locale/eo/LC_MESSAGES/glib-networking.mo +0 -0
  456. data/vendor/local/share/locale/eo/LC_MESSAGES/glib20.mo +0 -0
  457. data/vendor/local/share/locale/es/LC_MESSAGES/glib-networking.mo +0 -0
  458. data/vendor/local/share/locale/es/LC_MESSAGES/glib20.mo +0 -0
  459. data/vendor/local/share/locale/eu/LC_MESSAGES/glib-networking.mo +0 -0
  460. data/vendor/local/share/locale/eu/LC_MESSAGES/glib20.mo +0 -0
  461. data/vendor/local/share/locale/fi/LC_MESSAGES/glib20.mo +0 -0
  462. data/vendor/local/share/locale/fr/LC_MESSAGES/glib-networking.mo +0 -0
  463. data/vendor/local/share/locale/fr/LC_MESSAGES/glib20.mo +0 -0
  464. data/vendor/local/share/locale/fur/LC_MESSAGES/glib-networking.mo +0 -0
  465. data/vendor/local/share/locale/fur/LC_MESSAGES/glib20.mo +0 -0
  466. data/vendor/local/share/locale/gl/LC_MESSAGES/glib-networking.mo +0 -0
  467. data/vendor/local/share/locale/gl/LC_MESSAGES/glib20.mo +0 -0
  468. data/vendor/local/share/locale/he/LC_MESSAGES/glib20.mo +0 -0
  469. data/vendor/local/share/locale/hr/LC_MESSAGES/glib-networking.mo +0 -0
  470. data/vendor/local/share/locale/hu/LC_MESSAGES/glib-networking.mo +0 -0
  471. data/vendor/local/share/locale/hu/LC_MESSAGES/glib20.mo +0 -0
  472. data/vendor/local/share/locale/id/LC_MESSAGES/glib-networking.mo +0 -0
  473. data/vendor/local/share/locale/id/LC_MESSAGES/glib20.mo +0 -0
  474. data/vendor/local/share/locale/it/LC_MESSAGES/glib-networking.mo +0 -0
  475. data/vendor/local/share/locale/it/LC_MESSAGES/glib20.mo +0 -0
  476. data/vendor/local/share/locale/kk/LC_MESSAGES/glib-networking.mo +0 -0
  477. data/vendor/local/share/locale/kk/LC_MESSAGES/glib20.mo +0 -0
  478. data/vendor/local/share/locale/ko/LC_MESSAGES/glib-networking.mo +0 -0
  479. data/vendor/local/share/locale/ko/LC_MESSAGES/glib20.mo +0 -0
  480. data/vendor/local/share/locale/lt/LC_MESSAGES/glib-networking.mo +0 -0
  481. data/vendor/local/share/locale/lt/LC_MESSAGES/glib20.mo +0 -0
  482. data/vendor/local/share/locale/lv/LC_MESSAGES/glib-networking.mo +0 -0
  483. data/vendor/local/share/locale/lv/LC_MESSAGES/glib20.mo +0 -0
  484. data/vendor/local/share/locale/ml/LC_MESSAGES/glib-networking.mo +0 -0
  485. data/vendor/local/share/locale/ne/LC_MESSAGES/glib-networking.mo +0 -0
  486. data/vendor/local/share/locale/ne/LC_MESSAGES/glib20.mo +0 -0
  487. data/vendor/local/share/locale/nl/LC_MESSAGES/glib-networking.mo +0 -0
  488. data/vendor/local/share/locale/pl/LC_MESSAGES/glib-networking.mo +0 -0
  489. data/vendor/local/share/locale/pl/LC_MESSAGES/glib20.mo +0 -0
  490. data/vendor/local/share/locale/pt_BR/LC_MESSAGES/glib-networking.mo +0 -0
  491. data/vendor/local/share/locale/pt_BR/LC_MESSAGES/glib20.mo +0 -0
  492. data/vendor/local/share/locale/ro/LC_MESSAGES/glib20.mo +0 -0
  493. data/vendor/local/share/locale/sk/LC_MESSAGES/glib-networking.mo +0 -0
  494. data/vendor/local/share/locale/sl/LC_MESSAGES/glib-networking.mo +0 -0
  495. data/vendor/local/share/locale/sl/LC_MESSAGES/glib20.mo +0 -0
  496. data/vendor/local/share/locale/sr/LC_MESSAGES/glib-networking.mo +0 -0
  497. data/vendor/local/share/locale/sr/LC_MESSAGES/glib20.mo +0 -0
  498. data/vendor/local/share/locale/sr@latin/LC_MESSAGES/glib-networking.mo +0 -0
  499. data/vendor/local/share/locale/sr@latin/LC_MESSAGES/glib20.mo +0 -0
  500. data/vendor/local/share/locale/sv/LC_MESSAGES/glib-networking.mo +0 -0
  501. data/vendor/local/share/locale/sv/LC_MESSAGES/glib20.mo +0 -0
  502. data/vendor/local/share/locale/tr/LC_MESSAGES/glib-networking.mo +0 -0
  503. data/vendor/local/share/locale/tr/LC_MESSAGES/glib20.mo +0 -0
  504. data/vendor/local/share/locale/zh_TW/LC_MESSAGES/glib-networking.mo +0 -0
  505. data/vendor/local/share/man/man1/gapplication.1 +1 -1
  506. data/vendor/local/share/man/man1/gdbus-codegen.1 +1 -1
  507. data/vendor/local/share/man/man1/gdbus.1 +66 -1
  508. data/vendor/local/share/man/man1/gio-querymodules.1 +1 -1
  509. data/vendor/local/share/man/man1/gio.1 +1 -1
  510. data/vendor/local/share/man/man1/glib-compile-resources.1 +1 -1
  511. data/vendor/local/share/man/man1/glib-compile-schemas.1 +1 -1
  512. data/vendor/local/share/man/man1/glib-genmarshal.1 +99 -19
  513. data/vendor/local/share/man/man1/glib-gettextize.1 +1 -1
  514. data/vendor/local/share/man/man1/glib-mkenums.1 +1 -1
  515. data/vendor/local/share/man/man1/gobject-query.1 +1 -1
  516. data/vendor/local/share/man/man1/gresource.1 +2 -2
  517. data/vendor/local/share/man/man1/gsettings.1 +1 -1
  518. data/vendor/local/share/man/man1/gtester-report.1 +1 -1
  519. data/vendor/local/share/man/man1/gtester.1 +1 -1
  520. metadata +9 -7
  521. data/vendor/local/bin/glib-genmarshal.exe +0 -0
@@ -37,7 +37,7 @@ Usage: glib-gettextize [OPTION]... [package-dir]
37
37
  -f, --force force writing of new files even if old exist
38
38
  Report bugs to http://bugzilla.gnome.org/."
39
39
  package=glib
40
- version=2.52.3
40
+ version=2.54.1
41
41
  try_ln_s=:
42
42
 
43
43
  # Directory where the sources are stored.
@@ -1,593 +1,708 @@
1
- #! /usr/bin/perl
2
-
3
- use warnings;
4
- use File::Basename;
5
- use File::Copy "move";
6
- use File::Temp;
7
- use Cwd;
8
- use Safe;
9
-
10
- # glib-mkenums.pl
1
+ #!/usr/bin/env /usr/bin/python
2
+
3
+ # If the code below looks horrible and unpythonic, do not panic.
4
+ #
5
+ # It is.
6
+ #
7
+ # This is a manual conversion from the original Perl script to
8
+ # Python. Improvements are welcome.
9
+ #
10
+ from __future__ import print_function, unicode_literals
11
+
12
+ import argparse
13
+ import os
14
+ import re
15
+ import sys
16
+ import tempfile
17
+ import io
18
+ import errno
19
+ import codecs
20
+ import locale
21
+
22
+ VERSION_STR = '''glib-mkenums version 2.54.1
23
+ glib-genmarshal comes with ABSOLUTELY NO WARRANTY.
24
+ You may redistribute copies of glib-genmarshal under the terms of
25
+ the GNU General Public License which can be found in the
26
+ GLib source package. Sources, examples and contact
27
+ information are available at http://www.gtk.org'''
28
+
29
+ # Python 2 defaults to ASCII in case stdout is redirected.
30
+ # This should make it match Python 3, which uses the locale encoding.
31
+ if sys.stdout.encoding is None:
32
+ output_stream = codecs.getwriter(
33
+ locale.getpreferredencoding())(sys.stdout)
34
+ else:
35
+ output_stream = sys.stdout
36
+
37
+ # pylint: disable=too-few-public-methods
38
+ class Color:
39
+ '''ANSI Terminal colors'''
40
+ GREEN = '\033[1;32m'
41
+ BLUE = '\033[1;34m'
42
+ YELLOW = '\033[1;33m'
43
+ RED = '\033[1;31m'
44
+ END = '\033[0m'
45
+
46
+
47
+ def print_color(msg, color=Color.END, prefix='MESSAGE'):
48
+ '''Print a string with a color prefix'''
49
+ if os.isatty(sys.stderr.fileno()):
50
+ real_prefix = '{start}{prefix}{end}'.format(start=color, prefix=prefix, end=Color.END)
51
+ else:
52
+ real_prefix = prefix
53
+ print('{prefix}: {msg}'.format(prefix=real_prefix, msg=msg), file=sys.stderr)
54
+
55
+
56
+ def print_error(msg):
57
+ '''Print an error, and terminate'''
58
+ print_color(msg, color=Color.RED, prefix='ERROR')
59
+ sys.exit(1)
60
+
61
+
62
+ def print_warning(msg, fatal=False):
63
+ '''Print a warning, and optionally terminate'''
64
+ if fatal:
65
+ color = Color.RED
66
+ prefix = 'ERROR'
67
+ else:
68
+ color = Color.YELLOW
69
+ prefix = 'WARNING'
70
+ print_color(msg, color, prefix)
71
+ if fatal:
72
+ sys.exit(1)
73
+
74
+
75
+ def print_info(msg):
76
+ '''Print a message'''
77
+ print_color(msg, color=Color.GREEN, prefix='INFO')
78
+
79
+
80
+ def write_output(output):
81
+ global output_stream
82
+ print(output, file=output_stream)
83
+
84
+ # glib-mkenums.py
11
85
  # Information about the current enumeration
12
- my $flags; # Is enumeration a bitmask?
13
- my $option_underscore_name; # Overriden underscore variant of the enum name
14
- # for example to fix the cases we don't get the
15
- # mixed-case -> underscorized transform right.
16
- my $option_lowercase_name; # DEPRECATED. A lower case name to use as part
17
- # of the *_get_type() function, instead of the
18
- # one that we guess. For instance, when an enum
19
- # uses abnormal capitalization and we can not
20
- # guess where to put the underscores.
21
- my $seenbitshift; # Have we seen bitshift operators?
22
- my $enum_prefix; # Prefix for this enumeration
23
- my $enumname; # Name for this enumeration
24
- my $enumshort; # $enumname without prefix
25
- my $enumname_prefix; # prefix of $enumname
26
- my $enumindex = 0; # Global enum counter
27
- my $firstenum = 1; # Is this the first enumeration per file?
28
- my @entries; # [ $name, $val ] for each entry
29
- my $sandbox = Safe->new; # sandbox for safe evaluation of expressions
30
-
31
- my $output; # Filename to write result into
32
-
33
- sub parse_trigraph {
34
- my $opts = shift;
35
- my @opts;
36
-
37
- for $opt (split /\s*,\s*/, $opts) {
38
- $opt =~ s/^\s*//;
39
- $opt =~ s/\s*$//;
40
- my ($key,$val) = $opt =~ /(\w+)(?:=(.+))?/;
41
- defined $val or $val = 1;
42
- push @opts, $key, $val;
43
- }
44
- @opts;
45
- }
46
- sub parse_entries {
47
- my $file = shift;
48
- my $file_name = shift;
49
- my $looking_for_name = 0;
50
-
51
- while (<$file>) {
52
- # read lines until we have no open comments
53
- while (m@/\*([^*]|\*(?!/))*$@) {
54
- my $new;
55
- defined ($new = <$file>) || die "Unmatched comment in $ARGV";
56
- $_ .= $new;
57
- }
58
- # strip comments w/o options
59
- s@/\*(?!<)
60
- ([^*]+|\*(?!/))*
61
- \*/@@gx;
62
-
63
- # strip newlines
64
- s@\n@ @;
65
-
66
- # skip empty lines
67
- next if m@^\s*$@;
68
-
69
- if ($looking_for_name) {
70
- if (/^\s*(\w+)/) {
71
- $enumname = $1;
72
- return 1;
73
- }
74
- }
75
-
76
- # Handle include files
77
- if (/^\#include\s*<([^>]*)>/ ) {
78
- my $file= "../$1";
79
- open NEWFILE, $file or die "Cannot open include file $file: $!\n";
80
-
81
- if (parse_entries (\*NEWFILE, $NEWFILE)) {
82
- return 1;
83
- } else {
84
- next;
85
- }
86
- }
87
-
88
- if (/^\s*\}\s*(\w+)/) {
89
- $enumname = $1;
90
- $enumindex++;
91
- return 1;
92
- }
93
-
94
- if (/^\s*\}/) {
95
- $enumindex++;
96
- $looking_for_name = 1;
97
- next;
98
- }
99
-
100
- if (m@^\s*
86
+ flags = None # Is enumeration a bitmask?
87
+ option_underscore_name = '' # Overriden underscore variant of the enum name
88
+ # for example to fix the cases we don't get the
89
+ # mixed-case -> underscorized transform right.
90
+ option_lowercase_name = '' # DEPRECATED. A lower case name to use as part
91
+ # of the *_get_type() function, instead of the
92
+ # one that we guess. For instance, when an enum
93
+ # uses abnormal capitalization and we can not
94
+ # guess where to put the underscores.
95
+ seenbitshift = 0 # Have we seen bitshift operators?
96
+ enum_prefix = None # Prefix for this enumeration
97
+ enumname = '' # Name for this enumeration
98
+ enumshort = '' # $enumname without prefix
99
+ enumname_prefix = '' # prefix of $enumname
100
+ enumindex = 0 # Global enum counter
101
+ firstenum = 1 # Is this the first enumeration per file?
102
+ entries = [] # [ name, val ] for each entry
103
+ sandbox = None # sandbox for safe evaluation of expressions
104
+
105
+ output = '' # Filename to write result into
106
+
107
+ def parse_trigraph(opts):
108
+ result = {}
109
+
110
+ for opt in re.split(r'\s*,\s*', opts):
111
+ opt = re.sub(r'^\s*', '', opt)
112
+ opt = re.sub(r'\s*$', '', opt)
113
+ m = re.search(r'(\w+)(?:=(.+))?', opt)
114
+ assert m is not None
115
+ groups = m.groups()
116
+ key = groups[0]
117
+ if len(groups) > 1:
118
+ val = groups[1]
119
+ else:
120
+ val = 1
121
+ result[key] = val
122
+ return result
123
+
124
+ def parse_entries(file, file_name):
125
+ global entries, enumindex, enumname, seenbitshift, flags
126
+ looking_for_name = False
127
+
128
+ while True:
129
+ line = file.readline()
130
+ if not line:
131
+ break
132
+
133
+ line = line.strip()
134
+
135
+ # read lines until we have no open comments
136
+ while re.search(r'/\*([^*]|\*(?!/))*$', line):
137
+ line += file.readline()
138
+
139
+ # strip comments w/o options
140
+ line = re.sub(r'''/\*(?!<)
141
+ ([^*]+|\*(?!/))*
142
+ \*/''', '', line, flags=re.X)
143
+
144
+ line = line.rstrip()
145
+
146
+ # skip empty lines
147
+ if len(line.strip()) == 0:
148
+ continue
149
+
150
+ if looking_for_name:
151
+ m = re.match(r'\s*(\w+)', line)
152
+ if m:
153
+ enumname = m.group(1)
154
+ return True
155
+
156
+ # Handle include files
157
+ m = re.match(r'\#include\s*<([^>]*)>', line)
158
+ if m:
159
+ newfilename = os.path.join("..", m.group(1))
160
+ newfile = io.open(newfilename, encoding="utf-8")
161
+
162
+ if not parse_entries(newfile, newfilename):
163
+ return False
164
+ else:
165
+ continue
166
+
167
+ m = re.match(r'\s*\}\s*(\w+)', line)
168
+ if m:
169
+ enumname = m.group(1)
170
+ enumindex += 1
171
+ return 1
172
+
173
+ m = re.match(r'\s*\}', line)
174
+ if m:
175
+ enumindex += 1
176
+ looking_for_name = True
177
+ continue
178
+
179
+ m = re.match(r'''\s*
101
180
  (\w+)\s* # name
102
181
  (?:=( # value
103
- \s*\w+\s*\(.*\)\s* # macro with multiple args
104
- | # OR
182
+ \s*\w+\s*\(.*\)\s* # macro with multiple args
183
+ | # OR
105
184
  (?:[^,/]|/(?!\*))* # anything but a comma or comment
106
185
  ))?,?\s*
107
186
  (?:/\*< # options
108
187
  (([^*]|\*(?!/))*)
109
188
  >\s*\*/)?,?
110
- \s*$
111
- @x) {
112
- my ($name, $value, $options) = ($1,$2,$3);
113
-
114
- if (!defined $flags && defined $value && $value =~ /<</) {
115
- $seenbitshift = 1;
116
- }
117
-
118
- if (defined $options) {
119
- my %options = parse_trigraph($options);
120
- if (!defined $options{skip}) {
121
- push @entries, [ $name, $value, $options{nick} ];
122
- }
123
- } else {
124
- push @entries, [ $name, $value ];
125
- }
126
- } elsif (m@^\s*\#@) {
127
- # ignore preprocessor directives
128
- } else {
129
- print STDERR "$0: $file_name:$.: Failed to parse `$_'\n";
130
- }
131
- }
132
-
133
- return 0;
134
- }
135
-
136
- sub version {
137
- print "glib-mkenums version glib-2.52.3\n";
138
- print "glib-mkenums comes with ABSOLUTELY NO WARRANTY.\n";
139
- print "You may redistribute copies of glib-mkenums under the terms of\n";
140
- print "the GNU General Public License which can be found in the\n";
141
- print "GLib source package. Sources, examples and contact\n";
142
- print "information are available at http://www.gtk.org\n";
143
- exit 0;
144
- }
145
- sub usage {
146
- print "Usage:\n";
147
- print " glib-mkenums [OPTION...] [FILES...]\n\n";
148
- print "Help Options:\n";
149
- print " -h, --help Show this help message\n\n";
150
- print "Utility Options:\n";
151
- print " --identifier-prefix <text> Identifier prefix\n";
152
- print " --symbol-prefix <text> Symbol prefix\n";
153
- print " --fhead <text> Output file header\n";
154
- print " --fprod <text> Per input file production\n";
155
- print " --ftail <text> Output file trailer\n";
156
- print " --eprod <text> Per enum text (produced prior to value iterations)\n";
157
- print " --vhead <text> Value header, produced before iterating over enum values\n";
158
- print " --vprod <text> Value text, produced for each enum value\n";
159
- print " --vtail <text> Value tail, produced after iterating over enum values\n";
160
- print " --comments <text> Comment structure\n";
161
- print " --template file Template file\n";
162
- print " --output file Output file\n";
163
- print " -v, --version Print version informations\n\n";
164
- print "Production text substitutions:\n";
165
- print " \@EnumName\@ PrefixTheXEnum\n";
166
- print " \@enum_name\@ prefix_the_xenum\n";
167
- print " \@ENUMNAME\@ PREFIX_THE_XENUM\n";
168
- print " \@ENUMSHORT\@ THE_XENUM\n";
169
- print " \@ENUMPREFIX\@ PREFIX\n";
170
- print " \@VALUENAME\@ PREFIX_THE_XVALUE\n";
171
- print " \@valuenick\@ the-xvalue\n";
172
- print " \@valuenum\@ the integer value (limited support, Since: 2.26)\n";
173
- print " \@type\@ either enum or flags\n";
174
- print " \@Type\@ either Enum or Flags\n";
175
- print " \@TYPE\@ either ENUM or FLAGS\n";
176
- print " \@filename\@ name of current input file\n";
177
- print " \@basename\@ base name of the current input file (Since: 2.22)\n";
178
- exit 0;
179
- }
189
+ \s*$''', line, flags=re.X)
190
+ if m:
191
+ groups = m.groups()
192
+ name = groups[0]
193
+ value = None
194
+ options = None
195
+ if len(groups) > 1:
196
+ value = groups[1]
197
+ if len(groups) > 2:
198
+ options = groups[2]
199
+ if flags is None and value is not None and '<<' in value:
200
+ seenbitshift = 1
201
+
202
+ if options is not None:
203
+ options = parse_trigraph(options)
204
+ if 'skip' not in options:
205
+ entries.append((name, value, options['nick']))
206
+ else:
207
+ entries.append((name, value))
208
+ elif re.match(r's*\#', line):
209
+ pass
210
+ else:
211
+ print_warning('Failed to parse "{}" in {}'.format(line, file_name))
212
+ return False
213
+
214
+ help_epilog = '''Production text substitutions:
215
+ \u0040EnumName\u0040 PrefixTheXEnum
216
+ \u0040enum_name\u0040 prefix_the_xenum
217
+ \u0040ENUMNAME\u0040 PREFIX_THE_XENUM
218
+ \u0040ENUMSHORT\u0040 THE_XENUM
219
+ \u0040ENUMPREFIX\u0040 PREFIX
220
+ \u0040VALUENAME\u0040 PREFIX_THE_XVALUE
221
+ \u0040valuenick\u0040 the-xvalue
222
+ \u0040valuenum\u0040 the integer value (limited support, Since: 2.26)
223
+ \u0040type\u0040 either enum or flags
224
+ \u0040Type\u0040 either Enum or Flags
225
+ \u0040TYPE\u0040 either ENUM or FLAGS
226
+ \u0040filename\u0040 name of current input file
227
+ \u0040basename\u0040 base name of the current input file (Since: 2.22)
228
+ '''
229
+
180
230
 
181
231
  # production variables:
182
- my $idprefix = ""; # "G", "Gtk", etc
183
- my $symprefix = ""; # "g", "gtk", etc, if not just lc($idprefix)
184
- my $fhead = ""; # output file header
185
- my $fprod = ""; # per input file production
186
- my $ftail = ""; # output file trailer
187
- my $eprod = ""; # per enum text (produced prior to value itarations)
188
- my $vhead = ""; # value header, produced before iterating over enum values
189
- my $vprod = ""; # value text, produced for each enum value
190
- my $vtail = ""; # value tail, produced after iterating over enum values
191
- my $comment_tmpl = ""; # comment template
192
-
193
- sub read_template_file {
194
- my ($file) = @_;
195
- my %tmpl = ('file-header', $fhead,
196
- 'file-production', $fprod,
197
- 'file-tail', $ftail,
198
- 'enumeration-production', $eprod,
199
- 'value-header', $vhead,
200
- 'value-production', $vprod,
201
- 'value-tail', $vtail,
202
- 'comment', $comment_tmpl);
203
- my $in = 'junk';
204
- open (FILE, $file) || die "Can't open $file: $!\n";
205
- while (<FILE>) {
206
- if (/^\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\//) {
207
- if (($in eq 'junk') && ($1 eq 'BEGIN') && (exists($tmpl{$2}))) {
208
- $in = $2;
209
- next;
210
- }
211
- elsif (($in eq $2) && ($1 eq 'END') && (exists($tmpl{$2}))) {
212
- $in = 'junk';
213
- next;
214
- } else {
215
- die "Malformed template file $file\n";
216
- }
217
- }
218
- if (!($in eq 'junk')) {
219
- $tmpl{$in} .= $_;
220
- }
221
- }
222
- close (FILE);
223
- if (!($in eq 'junk')) {
224
- die "Malformed template file $file\n";
225
- }
226
- $fhead = $tmpl{'file-header'};
227
- $fprod = $tmpl{'file-production'};
228
- $ftail = $tmpl{'file-tail'};
229
- $eprod = $tmpl{'enumeration-production'};
230
- $vhead = $tmpl{'value-header'};
231
- $vprod = $tmpl{'value-production'};
232
- $vtail = $tmpl{'value-tail'};
233
- $comment_tmpl = $tmpl{'comment'};
234
-
235
- # default to C-style comments
236
- $comment_tmpl = "/* \@comment\@ */" if $comment_tmpl eq "";
237
- }
238
-
239
- if (!defined $ARGV[0]) {
240
- usage;
241
- }
242
- while ($_=$ARGV[0],/^-/) {
243
- shift;
244
- last if /^--$/;
245
- if (/^--template$/) { read_template_file (shift); }
246
- elsif (/^--identifier-prefix$/) { $idprefix = shift }
247
- elsif (/^--symbol-prefix$/) { $symprefix = shift }
248
- elsif (/^--fhead$/) { $fhead = $fhead . shift }
249
- elsif (/^--fprod$/) { $fprod = $fprod . shift }
250
- elsif (/^--ftail$/) { $ftail = $ftail . shift }
251
- elsif (/^--eprod$/) { $eprod = $eprod . shift }
252
- elsif (/^--vhead$/) { $vhead = $vhead . shift }
253
- elsif (/^--vprod$/) { $vprod = $vprod . shift }
254
- elsif (/^--vtail$/) { $vtail = $vtail . shift }
255
- elsif (/^--comments$/) { $comment_tmpl = shift }
256
- elsif (/^--output$/) { $output = shift }
257
- elsif (/^--help$/ || /^-h$/ || /^-\?$/) { usage; }
258
- elsif (/^--version$/ || /^-v$/) { version; }
259
- else { usage; }
260
- last if not defined($ARGV[0]);
261
- }
262
-
263
- if (defined ($output)) {
264
- my($out_fn, $out_dir, $out_suffix) = fileparse($output, qr{\.\w+$});
265
- if ($out_dir eq '') { $out_dir = cwd(); }
266
-
267
- $out_suffix =~ s/^\./_/; # .foo -> _foo
268
-
269
- $OUTPUT = File::Temp->new("$out_fn$out_suffix\_XXXXXX", DIR => $out_dir, UNLINK => 0);
270
- select $OUTPUT; # Make all print calls from here on go to OUTPUT
271
- }
232
+ idprefix = "" # "G", "Gtk", etc
233
+ symprefix = "" # "g", "gtk", etc, if not just lc($idprefix)
234
+ fhead = "" # output file header
235
+ fprod = "" # per input file production
236
+ ftail = "" # output file trailer
237
+ eprod = "" # per enum text (produced prior to value itarations)
238
+ vhead = "" # value header, produced before iterating over enum values
239
+ vprod = "" # value text, produced for each enum value
240
+ vtail = "" # value tail, produced after iterating over enum values
241
+ comment_tmpl = "" # comment template
242
+
243
+ def read_template_file(file):
244
+ global idprefix, symprefix, fhead, fprod, ftail, eprod, vhead, vprod, vtail, comment_tmpl
245
+ tmpl = {'file-header': fhead,
246
+ 'file-production': fprod,
247
+ 'file-tail': ftail,
248
+ 'enumeration-production': eprod,
249
+ 'value-header': vhead,
250
+ 'value-production': vprod,
251
+ 'value-tail': vtail,
252
+ 'comment': comment_tmpl,
253
+ }
254
+ in_ = 'junk'
255
+
256
+ ifile = io.open(file, encoding="utf-8")
257
+ for line in ifile:
258
+ m = re.match(r'\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\/', line)
259
+ if m:
260
+ if in_ == 'junk' and m.group(1) == 'BEGIN' and m.group(2) in tmpl:
261
+ in_ = m.group(2)
262
+ continue
263
+ elif in_ == m.group(2) and m.group(1) == 'END' and m.group(2) in tmpl:
264
+ in_ = 'junk'
265
+ continue
266
+ else:
267
+ sys.exit("Malformed template file " + file)
268
+
269
+ if in_ != 'junk':
270
+ tmpl[in_] += line
271
+
272
+ if in_ != 'junk':
273
+ sys.exit("Malformed template file " + file)
274
+
275
+ fhead = tmpl['file-header']
276
+ fprod = tmpl['file-production']
277
+ ftail = tmpl['file-tail']
278
+ eprod = tmpl['enumeration-production']
279
+ vhead = tmpl['value-header']
280
+ vprod = tmpl['value-production']
281
+ vtail = tmpl['value-tail']
282
+ comment_tmpl = tmpl['comment']
283
+
284
+ # default to C-style comments
285
+ if comment_tmpl == "":
286
+ comment_tmpl = "/* \u0040comment\u0040 */"
287
+
288
+ parser = argparse.ArgumentParser(epilog=help_epilog,
289
+ formatter_class=argparse.RawDescriptionHelpFormatter)
290
+
291
+ parser.add_argument('--identifier-prefix', default='', dest='idprefix',
292
+ help='Identifier prefix')
293
+ parser.add_argument('--symbol-prefix', default='', dest='symprefix',
294
+ help='symbol-prefix')
295
+ parser.add_argument('--fhead', default=[], dest='fhead', action='append',
296
+ help='Output file header')
297
+ parser.add_argument('--ftail', default=[], dest='ftail', action='append',
298
+ help='Per input file production')
299
+ parser.add_argument('--fprod', default=[], dest='fprod', action='append',
300
+ help='Put out TEXT everytime a new input file is being processed.')
301
+ parser.add_argument('--eprod', default=[], dest='eprod', action='append',
302
+ help='Per enum text (produced prior to value iterations)')
303
+ parser.add_argument('--vhead', default=[], dest='vhead', action='append',
304
+ help='Value header, produced before iterating over enum values')
305
+ parser.add_argument('--vprod', default=[], dest='vprod', action='append',
306
+ help='Value text, produced for each enum value.')
307
+ parser.add_argument('--vtail', default=[], dest='vtail', action='append',
308
+ help='Value tail, produced after iterating over enum values')
309
+ parser.add_argument('--comments', default='', dest='comment_tmpl',
310
+ help='Comment structure')
311
+ parser.add_argument('--template', default='', dest='template',
312
+ help='Template file')
313
+ parser.add_argument('--output', default=None, dest='output')
314
+ parser.add_argument('--version', '-v', default=False, action='store_true', dest='version',
315
+ help='Print version informations')
316
+ parser.add_argument('args', nargs='*')
317
+
318
+ options = parser.parse_args()
319
+
320
+ if options.version:
321
+ print(VERSION_STR)
322
+ sys.exit(0)
323
+
324
+ def unescape_cmdline_args(arg):
325
+ arg = arg.replace('\\n', '\n')
326
+ arg = arg.replace('\\r', '\r')
327
+ return arg.replace('\\t', '\t')
328
+
329
+ if options.template != '':
330
+ read_template_file(options.template)
331
+
332
+ idprefix += options.idprefix
333
+ symprefix += options.symprefix
334
+
335
+ # This is a hack to maintain some semblance of backward compatibility with
336
+ # the old, Perl-based glib-mkenums. The old tool had an implicit ordering
337
+ # on the arguments and templates; each argument was parsed in order, and
338
+ # all the strings appended. This allowed developers to write:
339
+ #
340
+ # glib-mkenums \
341
+ # --fhead ... \
342
+ # --template a-template-file.c.in \
343
+ # --ftail ...
344
+ #
345
+ # And have the fhead be prepended to the file-head stanza in the template,
346
+ # as well as the ftail be appended to the file-tail stanza in the template.
347
+ # Short of throwing away ArgumentParser and going over sys.argv[] element
348
+ # by element, we can simulate that behaviour by ensuring some ordering in
349
+ # how we build the template strings:
350
+ #
351
+ # - the head stanzas are always prepended to the template
352
+ # - the prod stanzas are always appended to the template
353
+ # - the tail stanzas are always appended to the template
354
+ #
355
+ # Within each instance of the command line argument, we append each value
356
+ # to the array in the order in which it appears on the command line.
357
+ fhead = ''.join([unescape_cmdline_args(x) for x in options.fhead]) + fhead
358
+ vhead = ''.join([unescape_cmdline_args(x) for x in options.vhead]) + vhead
359
+
360
+ fprod += ''.join([unescape_cmdline_args(x) for x in options.fprod])
361
+ eprod += ''.join([unescape_cmdline_args(x) for x in options.eprod])
362
+ vprod += ''.join([unescape_cmdline_args(x) for x in options.vprod])
363
+
364
+ ftail = ftail + ''.join([unescape_cmdline_args(x) for x in options.ftail])
365
+ vtail = vtail + ''.join([unescape_cmdline_args(x) for x in options.vtail])
366
+
367
+ if options.comment_tmpl != '':
368
+ comment_tmpl = unescape_cmdline_args(options.comment_tmpl)
369
+
370
+ output = options.output
371
+
372
+ if output is not None:
373
+ (out_dir, out_fn) = os.path.split(options.output)
374
+ out_suffix = '_' + os.path.splitext(out_fn)[1]
375
+ if out_dir == '':
376
+ out_dir = '.'
377
+ fd, filename = tempfile.mkstemp(dir=out_dir)
378
+ os.close(fd)
379
+ tmpfile = io.open(filename, "w", encoding="utf-8")
380
+ output_stream = tmpfile
381
+ else:
382
+ tmpfile = None
272
383
 
273
384
  # put auto-generation comment
274
- {
275
- my $comment = $comment_tmpl;
276
- $comment =~ s/\@comment\@/Generated data (by glib-mkenums)/;
277
- print "\n" . $comment . "\n\n";
278
- }
279
-
280
- if (length($fhead)) {
281
- my $prod = $fhead;
282
- my $base = basename ($ARGV[0]);
283
-
284
- $prod =~ s/\@filename\@/$ARGV[0]/g;
285
- $prod =~ s/\@basename\@/$base/g;
286
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
287
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
288
- chomp ($prod);
289
-
290
- print "$prod\n";
291
- }
292
-
293
- @ARGV = sort @ARGV;
294
-
295
- while (<>) {
296
- if (eof) {
297
- close (ARGV); # reset line numbering
298
- $firstenum = 1; # Flag to print filename at next enum
299
- }
300
-
301
- # read lines until we have no open comments
302
- while (m@/\*([^*]|\*(?!/))*$@) {
303
- my $new;
304
- defined ($new = <>) || die "Unmatched comment in $ARGV";
305
- $_ .= $new;
306
- }
307
- # strip comments w/o options
308
- s@/\*(?!<)
309
- ([^*]+|\*(?!/))*
310
- \*/@@gx;
311
-
312
- # ignore forward declarations
313
- next if /^\s*typedef\s+enum.*;/;
314
-
315
- if (m@^\s*typedef\s+enum\s*
316
- ({)?\s*
317
- (?:/\*<
318
- (([^*]|\*(?!/))*)
319
- >\s*\*/)?
320
- \s*({)?
321
- @x) {
322
- if (defined $2) {
323
- my %options = parse_trigraph ($2);
324
- next if defined $options{skip};
325
- $enum_prefix = $options{prefix};
326
- $flags = $options{flags};
327
- $option_lowercase_name = $options{lowercase_name};
328
- $option_underscore_name = $options{underscore_name};
329
- } else {
330
- $enum_prefix = undef;
331
- $flags = undef;
332
- $option_lowercase_name = undef;
333
- $option_underscore_name = undef;
334
- }
335
- if (defined $option_lowercase_name) {
336
- if (defined $option_underscore_name) {
337
- print STDERR "$0: $ARGV:$.: lowercase_name overriden with underscore_name\n";
338
- $option_lowercase_name = undef;
339
- } else {
340
- print STDERR "$0: $ARGV:$.: lowercase_name is deprecated, use underscore_name\n";
341
- }
342
- }
343
- # Didn't have trailing '{' look on next lines
344
- if (!defined $1 && !defined $4) {
345
- while (<>) {
346
- if (eof) {
347
- die "Hit end of file while parsing enum in $ARGV";
348
- }
349
- if (s/^\s*\{//) {
350
- last;
351
- }
352
- }
353
- }
354
-
355
- $seenbitshift = 0;
356
- @entries = ();
357
-
358
- # Now parse the entries
359
- parse_entries (\*ARGV, $ARGV);
360
-
361
- # figure out if this was a flags or enums enumeration
362
- if (!defined $flags) {
363
- $flags = $seenbitshift;
364
- }
365
-
366
- # Autogenerate a prefix
367
- if (!defined $enum_prefix) {
368
- for (@entries) {
369
- my $nick = $_->[2];
370
- if (!defined $nick) {
371
- my $name = $_->[0];
372
- if (defined $enum_prefix) {
373
- my $tmp = ~ ($name ^ $enum_prefix);
374
- ($tmp) = $tmp =~ /(^\xff*)/;
375
- $enum_prefix = $enum_prefix & $tmp;
376
- } else {
377
- $enum_prefix = $name;
378
- }
379
- }
380
- }
381
- if (!defined $enum_prefix) {
382
- $enum_prefix = "";
383
- } else {
384
- # Trim so that it ends in an underscore
385
- $enum_prefix =~ s/_[^_]*$/_/;
386
- }
387
- } else {
388
- # canonicalize user defined prefixes
389
- $enum_prefix = uc($enum_prefix);
390
- $enum_prefix =~ s/-/_/g;
391
- $enum_prefix =~ s/(.*)([^_])$/$1$2_/;
392
- }
393
-
394
- for $entry (@entries) {
395
- my ($name,$num,$nick) = @{$entry};
396
- if (!defined $nick) {
397
- ($nick = $name) =~ s/^$enum_prefix//;
398
- $nick =~ tr/_/-/;
399
- $nick = lc($nick);
400
- @{$entry} = ($name, $num, $nick);
401
- }
402
- }
403
-
404
-
405
- # Spit out the output
406
- if (defined $option_underscore_name) {
407
- $enumlong = uc $option_underscore_name;
408
- $enumsym = lc $option_underscore_name;
409
- $enumshort = $enumlong;
410
- $enumshort =~ s/^[A-Z][A-Z0-9]*_//;
411
-
412
- $enumname_prefix = $enumlong;
413
- $enumname_prefix =~ s/_$enumshort$//;
414
- } elsif (!$symprefix && !$idprefix) {
415
- # enumname is e.g. GMatchType
416
- $enspace = $enumname;
417
- $enspace =~ s/^([A-Z][a-z]*).*$/$1/;
418
-
419
- $enumshort = $enumname;
420
- $enumshort =~ s/^[A-Z][a-z]*//;
421
- $enumshort =~ s/([^A-Z])([A-Z])/$1_$2/g;
422
- $enumshort =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g;
423
- $enumshort = uc($enumshort);
424
-
425
- $enumname_prefix = $enumname;
426
- $enumname_prefix =~ s/^([A-Z][a-z]*).*$/$1/;
427
- $enumname_prefix = uc($enumname_prefix);
428
-
429
- $enumlong = uc($enspace) . "_" . $enumshort;
430
- $enumsym = lc($enspace) . "_" . lc($enumshort);
431
-
432
- if (defined($option_lowercase_name)) {
433
- $enumsym = $option_lowercase_name;
434
- }
435
- } else {
436
- $enumshort = $enumname;
437
- if ($idprefix) {
438
- $enumshort =~ s/^${idprefix}//;
439
- } else {
440
- $enumshort =~ s/^[A-Z][a-z]*//;
441
- }
442
- $enumshort =~ s/([^A-Z])([A-Z])/$1_$2/g;
443
- $enumshort =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g;
444
- $enumshort = uc($enumshort);
445
-
446
- $enumname_prefix = $symprefix && uc($symprefix) || uc($idprefix);
447
-
448
- $enumlong = $enumname_prefix . "_" . $enumshort;
449
- $enumsym = lc($enumlong);
450
- }
451
-
452
- if ($firstenum) {
453
- $firstenum = 0;
454
-
455
- if (length($fprod)) {
456
- my $prod = $fprod;
457
- my $base = basename ($ARGV);
458
-
459
- $prod =~ s/\@filename\@/$ARGV/g;
460
- $prod =~ s/\@basename\@/$base/g;
461
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
462
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
463
- chomp ($prod);
464
-
465
- print "$prod\n";
466
- }
467
- }
468
-
469
- if (length($eprod)) {
470
- my $prod = $eprod;
471
-
472
- $prod =~ s/\@enum_name\@/$enumsym/g;
473
- $prod =~ s/\@EnumName\@/$enumname/g;
474
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
475
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
476
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
477
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
478
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
479
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
480
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
481
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
482
- chomp ($prod);
483
-
484
- print "$prod\n";
485
- }
486
-
487
- if (length($vhead)) {
488
- my $prod = $vhead;
489
-
490
- $prod =~ s/\@enum_name\@/$enumsym/g;
491
- $prod =~ s/\@EnumName\@/$enumname/g;
492
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
493
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
494
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
495
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
496
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
497
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
498
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
499
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
500
- chomp ($prod);
501
-
502
- print "$prod\n";
503
- }
504
-
505
- if (length($vprod)) {
506
- my $prod = $vprod;
507
- my $next_num = 0;
508
-
509
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
510
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
511
- for (@entries) {
512
- my ($name,$num,$nick) = @{$_};
513
- my $tmp_prod = $prod;
514
-
515
- if ($prod =~ /\@valuenum\@/) {
516
- # only attempt to eval the value if it is requested
517
- # this prevents us from throwing errors otherwise
518
- if (defined $num) {
519
- # use sandboxed perl evaluation as a reasonable
520
- # approximation to C constant folding
521
- $num = $sandbox->reval ($num);
522
-
523
- # make sure it parsed to an integer
524
- if (!defined $num or $num !~ /^-?\d+$/) {
525
- die "Unable to parse enum value '$num'";
526
- }
527
- } else {
528
- $num = $next_num;
529
- }
530
-
531
- $tmp_prod =~ s/\@valuenum\@/$num/g;
532
- $next_num = $num + 1;
533
- }
534
-
535
- $tmp_prod =~ s/\@VALUENAME\@/$name/g;
536
- $tmp_prod =~ s/\@valuenick\@/$nick/g;
537
- if ($flags) { $tmp_prod =~ s/\@type\@/flags/g; } else { $tmp_prod =~ s/\@type\@/enum/g; }
538
- if ($flags) { $tmp_prod =~ s/\@Type\@/Flags/g; } else { $tmp_prod =~ s/\@Type\@/Enum/g; }
539
- if ($flags) { $tmp_prod =~ s/\@TYPE\@/FLAGS/g; } else { $tmp_prod =~ s/\@TYPE\@/ENUM/g; }
540
- chomp ($tmp_prod);
541
-
542
- print "$tmp_prod\n";
543
- }
544
- }
545
-
546
- if (length($vtail)) {
547
- my $prod = $vtail;
548
-
549
- $prod =~ s/\@enum_name\@/$enumsym/g;
550
- $prod =~ s/\@EnumName\@/$enumname/g;
551
- $prod =~ s/\@ENUMSHORT\@/$enumshort/g;
552
- $prod =~ s/\@ENUMNAME\@/$enumlong/g;
553
- $prod =~ s/\@ENUMPREFIX\@/$enumname_prefix/g;
554
- if ($flags) { $prod =~ s/\@type\@/flags/g; } else { $prod =~ s/\@type\@/enum/g; }
555
- if ($flags) { $prod =~ s/\@Type\@/Flags/g; } else { $prod =~ s/\@Type\@/Enum/g; }
556
- if ($flags) { $prod =~ s/\@TYPE\@/FLAGS/g; } else { $prod =~ s/\@TYPE\@/ENUM/g; }
557
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
558
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
559
- chomp ($prod);
560
-
561
- print "$prod\n";
562
- }
563
- }
564
- }
565
-
566
- if (length($ftail)) {
567
- my $prod = $ftail;
568
- my $base = basename ($ARGV);
569
-
570
- $prod =~ s/\@filename\@/$ARGV/g;
571
- $prod =~ s/\@basename\@/$base/g;
572
- $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
573
- $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
574
- chomp ($prod);
575
-
576
- print "$prod\n";
577
- }
385
+ comment = comment_tmpl.replace('\u0040comment\u0040', 'Generated data (by glib-mkenums)')
386
+ write_output("\n" + comment + '\n')
387
+
388
+ def replace_specials(prod):
389
+ prod = prod.replace(r'\\a', r'\a')
390
+ prod = prod.replace(r'\\b', r'\b')
391
+ prod = prod.replace(r'\\t', r'\t')
392
+ prod = prod.replace(r'\\n', r'\n')
393
+ prod = prod.replace(r'\\f', r'\f')
394
+ prod = prod.replace(r'\\r', r'\r')
395
+ prod = prod.rstrip()
396
+ return prod
397
+
398
+ if len(fhead) > 0:
399
+ prod = fhead
400
+ base = os.path.basename(options.args[0])
401
+
402
+ prod = prod.replace('\u0040filename\u0040', options.args[0])
403
+ prod = prod.replace('\u0040basename\u0040', base)
404
+ prod = replace_specials(prod)
405
+ write_output(prod)
406
+
407
+ def process_file(curfilename):
408
+ global entries, flags, seenbitshift, enum_prefix
409
+ firstenum = True
410
+
411
+ try:
412
+ curfile = io.open(curfilename, encoding="utf-8")
413
+ except IOError as e:
414
+ if e.errno == errno.ENOENT:
415
+ print_warning('No file "{}" found.'.format(curfilename))
416
+ return
417
+ raise
418
+
419
+ while True:
420
+ line = curfile.readline()
421
+ if not line:
422
+ break
423
+
424
+ line = line.strip()
425
+
426
+ # read lines until we have no open comments
427
+ while re.search(r'/\*([^*]|\*(?!/))*$', line):
428
+ line += curfile.readline()
429
+
430
+ # strip comments w/o options
431
+ line = re.sub(r'''/\*(?!<)
432
+ ([^*]+|\*(?!/))*
433
+ \*/''', '', line)
434
+
435
+ # ignore forward declarations
436
+ if re.match(r'\s*typedef\s+enum.*;', line):
437
+ continue
438
+
439
+ m = re.match(r'''\s*typedef\s+enum\s*
440
+ ({)?\s*
441
+ (?:/\*<
442
+ (([^*]|\*(?!/))*)
443
+ >\s*\*/)?
444
+ \s*({)?''', line, flags=re.X)
445
+ if m:
446
+ groups = m.groups()
447
+ if len(groups) >= 2 and groups[1] is not None:
448
+ options = parse_trigraph(groups[1])
449
+ if 'skip' in options:
450
+ continue
451
+ enum_prefix = options.get('prefix', None)
452
+ flags = options.get('flags', None)
453
+ if 'flags' in options:
454
+ if flags is None:
455
+ flags = 1
456
+ else:
457
+ flags = int(flags)
458
+ option_lowercase_name = options.get('lowercase_name', None)
459
+ option_underscore_name = options.get('underscore_name', None)
460
+ else:
461
+ enum_prefix = None
462
+ flags = None
463
+ option_lowercase_name = None
464
+ option_underscore_name = None
465
+
466
+ if option_lowercase_name is not None:
467
+ if option_underscore_name is not None:
468
+ print_warning("lowercase_name overriden with underscore_name")
469
+ option_lowercase_name = None
470
+ else:
471
+ print_warning("lowercase_name is deprecated, use underscore_name")
472
+
473
+ # Didn't have trailing '{' look on next lines
474
+ if groups[0] is None and (len(groups) < 4 or groups[3] is None):
475
+ while True:
476
+ line = curfile.readline()
477
+ if re.match(r'\s*\{', line):
478
+ break
479
+
480
+ seenbitshift = 0
481
+ entries = []
482
+
483
+ # Now parse the entries
484
+ parse_entries(curfile, curfilename)
485
+
486
+ # figure out if this was a flags or enums enumeration
487
+ if flags is None:
488
+ flags = seenbitshift
489
+
490
+ # Autogenerate a prefix
491
+ if enum_prefix is None:
492
+ for entry in entries:
493
+ if len(entry) < 3 or entry[2] is None:
494
+ name = entry[0]
495
+ if enum_prefix is not None:
496
+ enum_prefix = os.path.commonprefix([name, enum_prefix])
497
+ else:
498
+ enum_prefix = name
499
+ if enum_prefix is None:
500
+ enum_prefix = ""
501
+ else:
502
+ # Trim so that it ends in an underscore
503
+ enum_prefix = re.sub(r'_[^_]*$', '_', enum_prefix)
504
+ else:
505
+ # canonicalize user defined prefixes
506
+ enum_prefix = enum_prefix.upper()
507
+ enum_prefix = enum_prefix.replace('-', '_')
508
+ enum_prefix = re.sub(r'(.*)([^_])$', r'\1\2_', enum_prefix)
509
+
510
+ fixed_entries = []
511
+ for e in entries:
512
+ name = e[0]
513
+ num = e[1]
514
+ if len(e) < 3 or e[2] is None:
515
+ nick = re.sub(r'^' + enum_prefix, '', name)
516
+ nick = nick.replace('_', '-').lower()
517
+ e = (name, num, nick)
518
+ fixed_entries.append(e)
519
+ entries = fixed_entries
520
+
521
+ # Spit out the output
522
+ if option_underscore_name is not None:
523
+ enumlong = option_underscore_name.upper()
524
+ enumsym = option_underscore_name.lower()
525
+ enumshort = re.sub(r'^[A-Z][A-Z0-9]*_', '', enumlong)
526
+
527
+ enumname_prefix = re.sub('_' + enumshort + '$', '', enumlong)
528
+ elif symprefix == '' and idprefix == '':
529
+ # enumname is e.g. GMatchType
530
+ enspace = re.sub(r'^([A-Z][a-z]*).*$', r'\1', enumname)
531
+
532
+ enumshort = re.sub(r'^[A-Z][a-z]*', '', enumname)
533
+ enumshort = re.sub(r'([^A-Z])([A-Z])', r'\1_\2', enumshort)
534
+ enumshort = re.sub(r'([A-Z][A-Z])([A-Z][0-9a-z])', r'\1_\2', enumshort)
535
+ enumshort = enumshort.upper()
536
+
537
+ enumname_prefix = re.sub(r'^([A-Z][a-z]*).*$', r'\1', enumname).upper()
538
+
539
+ enumlong = enspace.upper() + "_" + enumshort
540
+ enumsym = enspace.lower() + "_" + enumshort.lower()
541
+
542
+ if option_lowercase_name is not None:
543
+ enumsym = option_lowercase_name
544
+ else:
545
+ enumshort = enumname
546
+ if idprefix:
547
+ enumshort = re.sub(r'^' + idprefix, '', enumshort)
548
+ else:
549
+ enumshort = re.sub(r'/^[A-Z][a-z]*', '', enumshort)
550
+
551
+ enumshort = re.sub(r'([^A-Z])([A-Z])', r'\1_\2', enumshort)
552
+ enumshort = re.sub(r'([A-Z][A-Z])([A-Z][0-9a-z])', r'\1_\2', enumshort)
553
+ enumshort = enumshort.upper()
554
+
555
+ if symprefix:
556
+ enumname_prefix = symprefix.upper()
557
+ else:
558
+ enumname_prefix = idprefix.upper()
559
+
560
+ enumlong = enumname_prefix + "_" + enumshort
561
+ enumsym = enumlong.lower()
562
+
563
+ if firstenum:
564
+ firstenum = False
565
+
566
+ if len(fprod) > 0:
567
+ prod = fprod
568
+ base = os.path.basename(curfilename)
569
+
570
+ prod = prod.replace('\u0040filename\u0040', curfilename)
571
+ prod = prod.replace('\u0040basename\u0040', base)
572
+ prod = replace_specials(prod)
573
+
574
+ write_output(prod)
575
+
576
+ if len(eprod) > 0:
577
+ prod = eprod
578
+
579
+ prod = prod.replace('\u0040enum_name\u0040', enumsym)
580
+ prod = prod.replace('\u0040EnumName\u0040', enumname)
581
+ prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
582
+ prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
583
+ prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
584
+ if flags:
585
+ prod = prod.replace('\u0040type\u0040', 'flags')
586
+ else:
587
+ prod = prod.replace('\u0040type\u0040', 'enum')
588
+ if flags:
589
+ prod = prod.replace('\u0040Type\u0040', 'Flags')
590
+ else:
591
+ prod = prod.replace('\u0040Type\u0040', 'Enum')
592
+ if flags:
593
+ prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
594
+ else:
595
+ prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
596
+ prod = replace_specials(prod)
597
+ write_output(prod)
598
+
599
+ if len(vhead) > 0:
600
+ prod = vhead
601
+ prod = prod.replace('\u0040enum_name\u0040', enumsym)
602
+ prod = prod.replace('\u0040EnumName\u0040', enumname)
603
+ prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
604
+ prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
605
+ prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
606
+ if flags:
607
+ prod = prod.replace('\u0040type\u0040', 'flags')
608
+ else:
609
+ prod = prod.replace('\u0040type\u0040', 'enum')
610
+ if flags:
611
+ prod = prod.replace('\u0040Type\u0040', 'Flags')
612
+ else:
613
+ prod = prod.replace('\u0040Type\u0040', 'Enum')
614
+ if flags:
615
+ prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
616
+ else:
617
+ prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
618
+ prod = replace_specials(prod)
619
+ write_output(prod)
620
+
621
+ if len(vprod) > 0:
622
+ prod = vprod
623
+ next_num = 0
624
+
625
+ prod = replace_specials(prod)
626
+ for name, num, nick in entries:
627
+ tmp_prod = prod
628
+
629
+ if '\u0040valuenum\u0040' in prod:
630
+ # only attempt to eval the value if it is requested
631
+ # this prevents us from throwing errors otherwise
632
+ if num is not None:
633
+ # use sandboxed evaluation as a reasonable
634
+ # approximation to C constant folding
635
+ inum = eval(num, {}, {})
636
+
637
+ # make sure it parsed to an integer
638
+ if not isinstance(inum, int):
639
+ sys.exit("Unable to parse enum value '%s'" % num)
640
+ num = inum
641
+ else:
642
+ num = next_num
643
+
644
+ tmp_prod = tmp_prod.replace('\u0040valuenum\u0040', str(num))
645
+ next_num = int(num) + 1
646
+
647
+ tmp_prod = tmp_prod.replace('\u0040VALUENAME\u0040', name)
648
+ tmp_prod = tmp_prod.replace('\u0040valuenick\u0040', nick)
649
+ if flags:
650
+ tmp_prod = tmp_prod.replace('\u0040type\u0040', 'flags')
651
+ else:
652
+ tmp_prod = tmp_prod.replace('\u0040type\u0040', 'enum')
653
+ if flags:
654
+ tmp_prod = tmp_prod.replace('\u0040Type\u0040', 'Flags')
655
+ else:
656
+ tmp_prod = tmp_prod.replace('\u0040Type\u0040', 'Enum')
657
+ if flags:
658
+ tmp_prod = tmp_prod.replace('\u0040TYPE\u0040', 'FLAGS')
659
+ else:
660
+ tmp_prod = tmp_prod.replace('\u0040TYPE\u0040', 'ENUM')
661
+ tmp_prod = tmp_prod.rstrip()
662
+
663
+ write_output(tmp_prod)
664
+
665
+ if len(vtail) > 0:
666
+ prod = vtail
667
+ prod = prod.replace('\u0040enum_name\u0040', enumsym)
668
+ prod = prod.replace('\u0040EnumName\u0040', enumname)
669
+ prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
670
+ prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
671
+ prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
672
+ if flags:
673
+ prod = prod.replace('\u0040type\u0040', 'flags')
674
+ else:
675
+ prod = prod.replace('\u0040type\u0040', 'enum')
676
+ if flags:
677
+ prod = prod.replace('\u0040Type\u0040', 'Flags')
678
+ else:
679
+ prod = prod.replace('\u0040Type\u0040', 'Enum')
680
+ if flags:
681
+ prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
682
+ else:
683
+ prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
684
+ prod = replace_specials(prod)
685
+ write_output(prod)
686
+
687
+ for fname in options.args:
688
+ process_file(fname)
689
+
690
+ if len(ftail) > 0:
691
+ prod = ftail
692
+ base = os.path.basename(options.args[-1]) # FIXME, wrong
693
+
694
+ prod = prod.replace('\u0040filename\u0040', 'ARGV') # wrong too
695
+ prod = prod.replace('\u0040basename\u0040', base)
696
+ prod = replace_specials(prod)
697
+ write_output(prod)
578
698
 
579
699
  # put auto-generation comment
580
- {
581
- my $comment = $comment_tmpl;
582
- $comment =~ s/\@comment\@/Generated data ends here/;
583
- print "\n" . $comment . "\n\n";
584
- }
585
-
586
- if (defined ($output)) {
587
- select STDOUT;
588
- my $tmpfilename = $OUTPUT->filename;
589
- close ($OUTPUT)
590
- || warn "Closing output file $tmpfilename failed: $!";
591
- move ($tmpfilename, $output)
592
- || die "Could not rename $tmpfilename to $output: $!";
593
- }
700
+ comment = comment_tmpl
701
+ comment = comment.replace('\u0040comment\u0040', 'Generated data ends here')
702
+ write_output("\n" + comment + "\n")
703
+
704
+ if tmpfile is not None:
705
+ tmpfilename = tmpfile.name
706
+ tmpfile.close()
707
+ os.unlink(options.output)
708
+ os.rename(tmpfilename, options.output)