mathematical 0.3.1 → 0.4.0
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.
- checksums.yaml +4 -4
- data/Rakefile +12 -0
- data/ext/mathematical/extconf.rb +12 -2
- data/ext/mathematical/{itex2MML.h → itexToMML/itex2MML.h} +0 -0
- data/ext/mathematical/{lex.yy.c → itexToMML/lex.yy.c} +0 -0
- data/ext/mathematical/{y.tab.c → itexToMML/y.tab.c} +0 -0
- data/ext/mathematical/{y.tab.h → itexToMML/y.tab.h} +0 -0
- data/ext/mathematical/lasem/itex2mml/itex2MML.h +63 -0
- data/ext/mathematical/{lasemrender.c → lasem/src/lasemrender.c} +27 -21
- data/ext/mathematical/{lsm.c → lasem/src/lsm.c} +0 -0
- data/ext/mathematical/{lsm.h → lasem/src/lsm.h} +0 -0
- data/ext/mathematical/{lsmattributes.c → lasem/src/lsmattributes.c} +0 -0
- data/ext/mathematical/{lsmattributes.h → lasem/src/lsmattributes.h} +0 -0
- data/ext/mathematical/{lsmcairo.c → lasem/src/lsmcairo.c} +0 -0
- data/ext/mathematical/{lsmcairo.h → lasem/src/lsmcairo.h} +0 -0
- data/ext/mathematical/{lsmdebug.c → lasem/src/lsmdebug.c} +2 -0
- data/ext/mathematical/{lsmdebug.h → lasem/src/lsmdebug.h} +3 -3
- data/ext/mathematical/{lsmdom.h → lasem/src/lsmdom.h} +0 -0
- data/ext/mathematical/{lsmdomcharacterdata.c → lasem/src/lsmdomcharacterdata.c} +0 -0
- data/ext/mathematical/{lsmdomcharacterdata.h → lasem/src/lsmdomcharacterdata.h} +0 -0
- data/ext/mathematical/{lsmdomdocument.c → lasem/src/lsmdomdocument.c} +0 -0
- data/ext/mathematical/{lsmdomdocument.h → lasem/src/lsmdomdocument.h} +0 -0
- data/ext/mathematical/{lsmdomdocumentfragment.c → lasem/src/lsmdomdocumentfragment.c} +0 -0
- data/ext/mathematical/{lsmdomdocumentfragment.h → lasem/src/lsmdomdocumentfragment.h} +0 -0
- data/ext/mathematical/{lsmdomelement.c → lasem/src/lsmdomelement.c} +0 -0
- data/ext/mathematical/{lsmdomelement.h → lasem/src/lsmdomelement.h} +0 -0
- data/ext/mathematical/{lsmdomentities.c → lasem/src/lsmdomentities.c} +0 -0
- data/ext/mathematical/{lsmdomentities.h → lasem/src/lsmdomentities.h} +0 -0
- data/ext/mathematical/{lsmdomimplementation.c → lasem/src/lsmdomimplementation.c} +0 -0
- data/ext/mathematical/{lsmdomimplementation.h → lasem/src/lsmdomimplementation.h} +0 -0
- data/ext/mathematical/{lsmdomnamednodemap.c → lasem/src/lsmdomnamednodemap.c} +0 -0
- data/ext/mathematical/{lsmdomnamednodemap.h → lasem/src/lsmdomnamednodemap.h} +0 -0
- data/ext/mathematical/{lsmdomnode.c → lasem/src/lsmdomnode.c} +0 -0
- data/ext/mathematical/{lsmdomnode.h → lasem/src/lsmdomnode.h} +0 -0
- data/ext/mathematical/{lsmdomnodelist.c → lasem/src/lsmdomnodelist.c} +0 -0
- data/ext/mathematical/{lsmdomnodelist.h → lasem/src/lsmdomnodelist.h} +0 -0
- data/ext/mathematical/{lsmdomparser.c → lasem/src/lsmdomparser.c} +78 -16
- data/ext/mathematical/{lsmdomparser.h → lasem/src/lsmdomparser.h} +7 -7
- data/ext/mathematical/{lsmdomtext.c → lasem/src/lsmdomtext.c} +0 -0
- data/ext/mathematical/{lsmdomtext.h → lasem/src/lsmdomtext.h} +0 -0
- data/ext/mathematical/{lsmdomtypes.h → lasem/src/lsmdomtypes.h} +0 -0
- data/ext/mathematical/{lsmdomview.c → lasem/src/lsmdomview.c} +1 -0
- data/ext/mathematical/{lsmdomview.h → lasem/src/lsmdomview.h} +0 -0
- data/ext/mathematical/{lsmitex.c → lasem/src/lsmitex.c} +4 -4
- data/ext/mathematical/{lsmitex.h → lasem/src/lsmitex.h} +1 -1
- data/ext/mathematical/{lsmmathml.h → lasem/src/lsmmathml.h} +0 -0
- data/ext/mathematical/{lsmmathmlactionelement.c → lasem/src/lsmmathmlactionelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlactionelement.h → lasem/src/lsmmathmlactionelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlaligngroupelement.c → lasem/src/lsmmathmlaligngroupelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlaligngroupelement.h → lasem/src/lsmmathmlaligngroupelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlalignmarkelement.c → lasem/src/lsmmathmlalignmarkelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlalignmarkelement.h → lasem/src/lsmmathmlalignmarkelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlattributes.c → lasem/src/lsmmathmlattributes.c} +0 -0
- data/ext/mathematical/{lsmmathmlattributes.h → lasem/src/lsmmathmlattributes.h} +0 -0
- data/ext/mathematical/{lsmmathmldocument.c → lasem/src/lsmmathmldocument.c} +2 -2
- data/ext/mathematical/{lsmmathmldocument.h → lasem/src/lsmmathmldocument.h} +1 -1
- data/ext/mathematical/{lsmmathmlelement.c → lasem/src/lsmmathmlelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlelement.h → lasem/src/lsmmathmlelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlenums.c → lasem/src/lsmmathmlenums.c} +0 -0
- data/ext/mathematical/{lsmmathmlenums.h → lasem/src/lsmmathmlenums.h} +0 -0
- data/ext/mathematical/{lsmmathmlerrorelement.c → lasem/src/lsmmathmlerrorelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlerrorelement.h → lasem/src/lsmmathmlerrorelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlfencedelement.c → lasem/src/lsmmathmlfencedelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlfencedelement.h → lasem/src/lsmmathmlfencedelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlfractionelement.c → lasem/src/lsmmathmlfractionelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlfractionelement.h → lasem/src/lsmmathmlfractionelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlglyphtableams.c → lasem/src/lsmmathmlglyphtableams.c} +0 -0
- data/ext/mathematical/{lsmmathmlglyphtableams.h → lasem/src/lsmmathmlglyphtableams.h} +0 -0
- data/ext/mathematical/{lsmmathmlitexelement.c → lasem/src/lsmmathmlitexelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlitexelement.h → lasem/src/lsmmathmlitexelement.h} +0 -0
- data/ext/mathematical/{lsmmathmllayoututils.c → lasem/src/lsmmathmllayoututils.c} +0 -0
- data/ext/mathematical/{lsmmathmllayoututils.h → lasem/src/lsmmathmllayoututils.h} +0 -0
- data/ext/mathematical/{lsmmathmlmathelement.c → lasem/src/lsmmathmlmathelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlmathelement.h → lasem/src/lsmmathmlmathelement.h} +0 -0
- data/ext/mathematical/{lsmmathmloperatordictionary.c → lasem/src/lsmmathmloperatordictionary.c} +0 -0
- data/ext/mathematical/{lsmmathmloperatordictionary.h → lasem/src/lsmmathmloperatordictionary.h} +0 -0
- data/ext/mathematical/{lsmmathmloperatorelement.c → lasem/src/lsmmathmloperatorelement.c} +0 -0
- data/ext/mathematical/{lsmmathmloperatorelement.h → lasem/src/lsmmathmloperatorelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlpaddedelement.c → lasem/src/lsmmathmlpaddedelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlpaddedelement.h → lasem/src/lsmmathmlpaddedelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlphantomelement.c → lasem/src/lsmmathmlphantomelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlphantomelement.h → lasem/src/lsmmathmlphantomelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlpresentationcontainer.c → lasem/src/lsmmathmlpresentationcontainer.c} +0 -0
- data/ext/mathematical/{lsmmathmlpresentationcontainer.h → lasem/src/lsmmathmlpresentationcontainer.h} +0 -0
- data/ext/mathematical/{lsmmathmlpresentationtoken.c → lasem/src/lsmmathmlpresentationtoken.c} +0 -0
- data/ext/mathematical/{lsmmathmlpresentationtoken.h → lasem/src/lsmmathmlpresentationtoken.h} +0 -0
- data/ext/mathematical/{lsmmathmlradicalelement.c → lasem/src/lsmmathmlradicalelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlradicalelement.h → lasem/src/lsmmathmlradicalelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlrowelement.c → lasem/src/lsmmathmlrowelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlrowelement.h → lasem/src/lsmmathmlrowelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlscriptelement.c → lasem/src/lsmmathmlscriptelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlscriptelement.h → lasem/src/lsmmathmlscriptelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlsemanticselement.c → lasem/src/lsmmathmlsemanticselement.c} +0 -0
- data/ext/mathematical/{lsmmathmlsemanticselement.h → lasem/src/lsmmathmlsemanticselement.h} +0 -0
- data/ext/mathematical/{lsmmathmlspaceelement.c → lasem/src/lsmmathmlspaceelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlspaceelement.h → lasem/src/lsmmathmlspaceelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlstringelement.c → lasem/src/lsmmathmlstringelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlstringelement.h → lasem/src/lsmmathmlstringelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlstyle.c → lasem/src/lsmmathmlstyle.c} +0 -0
- data/ext/mathematical/{lsmmathmlstyle.h → lasem/src/lsmmathmlstyle.h} +0 -0
- data/ext/mathematical/{lsmmathmlstyleelement.c → lasem/src/lsmmathmlstyleelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlstyleelement.h → lasem/src/lsmmathmlstyleelement.h} +0 -0
- data/ext/mathematical/{lsmmathmltablecellelement.c → lasem/src/lsmmathmltablecellelement.c} +0 -0
- data/ext/mathematical/{lsmmathmltablecellelement.h → lasem/src/lsmmathmltablecellelement.h} +0 -0
- data/ext/mathematical/{lsmmathmltableelement.c → lasem/src/lsmmathmltableelement.c} +0 -0
- data/ext/mathematical/{lsmmathmltableelement.h → lasem/src/lsmmathmltableelement.h} +0 -0
- data/ext/mathematical/{lsmmathmltablerowelement.c → lasem/src/lsmmathmltablerowelement.c} +0 -0
- data/ext/mathematical/{lsmmathmltablerowelement.h → lasem/src/lsmmathmltablerowelement.h} +0 -0
- data/ext/mathematical/{lsmmathmltraits.c → lasem/src/lsmmathmltraits.c} +0 -0
- data/ext/mathematical/{lsmmathmltraits.h → lasem/src/lsmmathmltraits.h} +0 -0
- data/ext/mathematical/{lsmmathmltypes.h → lasem/src/lsmmathmltypes.h} +0 -0
- data/ext/mathematical/{lsmmathmlunderoverelement.c → lasem/src/lsmmathmlunderoverelement.c} +0 -0
- data/ext/mathematical/{lsmmathmlunderoverelement.h → lasem/src/lsmmathmlunderoverelement.h} +0 -0
- data/ext/mathematical/{lsmmathmlutils.c → lasem/src/lsmmathmlutils.c} +0 -0
- data/ext/mathematical/{lsmmathmlutils.h → lasem/src/lsmmathmlutils.h} +0 -0
- data/ext/mathematical/{lsmmathmlview.c → lasem/src/lsmmathmlview.c} +0 -0
- data/ext/mathematical/{lsmmathmlview.h → lasem/src/lsmmathmlview.h} +0 -0
- data/ext/mathematical/{lsmproperties.c → lasem/src/lsmproperties.c} +0 -0
- data/ext/mathematical/{lsmproperties.h → lasem/src/lsmproperties.h} +0 -0
- data/ext/mathematical/{lsmstr.c → lasem/src/lsmstr.c} +0 -0
- data/ext/mathematical/{lsmstr.h → lasem/src/lsmstr.h} +0 -0
- data/ext/mathematical/{lsmsvg.h → lasem/src/lsmsvg.h} +0 -0
- data/ext/mathematical/{lsmsvgaelement.c → lasem/src/lsmsvgaelement.c} +0 -0
- data/ext/mathematical/{lsmsvgaelement.h → lasem/src/lsmsvgaelement.h} +0 -0
- data/ext/mathematical/{lsmsvgattributes.h → lasem/src/lsmsvgattributes.h} +0 -0
- data/ext/mathematical/{lsmsvgcircleelement.c → lasem/src/lsmsvgcircleelement.c} +0 -0
- data/ext/mathematical/{lsmsvgcircleelement.h → lasem/src/lsmsvgcircleelement.h} +0 -0
- data/ext/mathematical/{lsmsvgclippathelement.c → lasem/src/lsmsvgclippathelement.c} +0 -0
- data/ext/mathematical/{lsmsvgclippathelement.h → lasem/src/lsmsvgclippathelement.h} +0 -0
- data/ext/mathematical/{lsmsvgcolors.c → lasem/src/lsmsvgcolors.c} +0 -0
- data/ext/mathematical/{lsmsvgcolors.h → lasem/src/lsmsvgcolors.h} +0 -0
- data/ext/mathematical/{lsmsvgdefselement.c → lasem/src/lsmsvgdefselement.c} +0 -0
- data/ext/mathematical/{lsmsvgdefselement.h → lasem/src/lsmsvgdefselement.h} +0 -0
- data/ext/mathematical/{lsmsvgdocument.c → lasem/src/lsmsvgdocument.c} +0 -0
- data/ext/mathematical/{lsmsvgdocument.h → lasem/src/lsmsvgdocument.h} +0 -0
- data/ext/mathematical/{lsmsvgelement.c → lasem/src/lsmsvgelement.c} +0 -0
- data/ext/mathematical/{lsmsvgelement.h → lasem/src/lsmsvgelement.h} +0 -0
- data/ext/mathematical/{lsmsvgellipseelement.c → lasem/src/lsmsvgellipseelement.c} +0 -0
- data/ext/mathematical/{lsmsvgellipseelement.h → lasem/src/lsmsvgellipseelement.h} +0 -0
- data/ext/mathematical/{lsmsvgenums.c → lasem/src/lsmsvgenums.c} +0 -0
- data/ext/mathematical/{lsmsvgenums.h → lasem/src/lsmsvgenums.h} +0 -0
- data/ext/mathematical/{lsmsvgfilterblend.c → lasem/src/lsmsvgfilterblend.c} +0 -0
- data/ext/mathematical/{lsmsvgfilterblend.h → lasem/src/lsmsvgfilterblend.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltercomposite.c → lasem/src/lsmsvgfiltercomposite.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltercomposite.h → lasem/src/lsmsvgfiltercomposite.h} +0 -0
- data/ext/mathematical/{lsmsvgfilterelement.c → lasem/src/lsmsvgfilterelement.c} +0 -0
- data/ext/mathematical/{lsmsvgfilterelement.h → lasem/src/lsmsvgfilterelement.h} +0 -0
- data/ext/mathematical/{lsmsvgfilterflood.c → lasem/src/lsmsvgfilterflood.c} +0 -0
- data/ext/mathematical/{lsmsvgfilterflood.h → lasem/src/lsmsvgfilterflood.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltergaussianblur.c → lasem/src/lsmsvgfiltergaussianblur.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltergaussianblur.h → lasem/src/lsmsvgfiltergaussianblur.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltermerge.c → lasem/src/lsmsvgfiltermerge.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltermerge.h → lasem/src/lsmsvgfiltermerge.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltermergenode.c → lasem/src/lsmsvgfiltermergenode.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltermergenode.h → lasem/src/lsmsvgfiltermergenode.h} +0 -0
- data/ext/mathematical/{lsmsvgfilteroffset.c → lasem/src/lsmsvgfilteroffset.c} +0 -0
- data/ext/mathematical/{lsmsvgfilteroffset.h → lasem/src/lsmsvgfilteroffset.h} +0 -0
- data/ext/mathematical/{lsmsvgfilterprimitive.c → lasem/src/lsmsvgfilterprimitive.c} +0 -0
- data/ext/mathematical/{lsmsvgfilterprimitive.h → lasem/src/lsmsvgfilterprimitive.h} +0 -0
- data/ext/mathematical/{lsmsvgfilterspecularlighting.c → lasem/src/lsmsvgfilterspecularlighting.c} +0 -0
- data/ext/mathematical/{lsmsvgfilterspecularlighting.h → lasem/src/lsmsvgfilterspecularlighting.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltersurface.c → lasem/src/lsmsvgfiltersurface.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltersurface.h → lasem/src/lsmsvgfiltersurface.h} +0 -0
- data/ext/mathematical/{lsmsvgfiltertile.c → lasem/src/lsmsvgfiltertile.c} +0 -0
- data/ext/mathematical/{lsmsvgfiltertile.h → lasem/src/lsmsvgfiltertile.h} +0 -0
- data/ext/mathematical/{lsmsvggelement.c → lasem/src/lsmsvggelement.c} +0 -0
- data/ext/mathematical/{lsmsvggelement.h → lasem/src/lsmsvggelement.h} +0 -0
- data/ext/mathematical/{lsmsvggradientelement.c → lasem/src/lsmsvggradientelement.c} +0 -0
- data/ext/mathematical/{lsmsvggradientelement.h → lasem/src/lsmsvggradientelement.h} +0 -0
- data/ext/mathematical/{lsmsvgimageelement.c → lasem/src/lsmsvgimageelement.c} +0 -0
- data/ext/mathematical/{lsmsvgimageelement.h → lasem/src/lsmsvgimageelement.h} +0 -0
- data/ext/mathematical/{lsmsvglength.c → lasem/src/lsmsvglength.c} +0 -0
- data/ext/mathematical/{lsmsvglength.h → lasem/src/lsmsvglength.h} +0 -0
- data/ext/mathematical/{lsmsvglineargradientelement.c → lasem/src/lsmsvglineargradientelement.c} +0 -0
- data/ext/mathematical/{lsmsvglineargradientelement.h → lasem/src/lsmsvglineargradientelement.h} +0 -0
- data/ext/mathematical/{lsmsvglineelement.c → lasem/src/lsmsvglineelement.c} +0 -0
- data/ext/mathematical/{lsmsvglineelement.h → lasem/src/lsmsvglineelement.h} +0 -0
- data/ext/mathematical/{lsmsvgmarkerelement.c → lasem/src/lsmsvgmarkerelement.c} +0 -0
- data/ext/mathematical/{lsmsvgmarkerelement.h → lasem/src/lsmsvgmarkerelement.h} +0 -0
- data/ext/mathematical/{lsmsvgmaskelement.c → lasem/src/lsmsvgmaskelement.c} +0 -0
- data/ext/mathematical/{lsmsvgmaskelement.h → lasem/src/lsmsvgmaskelement.h} +0 -0
- data/ext/mathematical/{lsmsvgmatrix.c → lasem/src/lsmsvgmatrix.c} +0 -0
- data/ext/mathematical/{lsmsvgmatrix.h → lasem/src/lsmsvgmatrix.h} +0 -0
- data/ext/mathematical/{lsmsvgpathelement.c → lasem/src/lsmsvgpathelement.c} +0 -0
- data/ext/mathematical/{lsmsvgpathelement.h → lasem/src/lsmsvgpathelement.h} +0 -0
- data/ext/mathematical/{lsmsvgpatternelement.c → lasem/src/lsmsvgpatternelement.c} +0 -0
- data/ext/mathematical/{lsmsvgpatternelement.h → lasem/src/lsmsvgpatternelement.h} +0 -0
- data/ext/mathematical/{lsmsvgpolygonelement.c → lasem/src/lsmsvgpolygonelement.c} +0 -0
- data/ext/mathematical/{lsmsvgpolygonelement.h → lasem/src/lsmsvgpolygonelement.h} +0 -0
- data/ext/mathematical/{lsmsvgpolylineelement.c → lasem/src/lsmsvgpolylineelement.c} +0 -0
- data/ext/mathematical/{lsmsvgpolylineelement.h → lasem/src/lsmsvgpolylineelement.h} +0 -0
- data/ext/mathematical/{lsmsvgradialgradientelement.c → lasem/src/lsmsvgradialgradientelement.c} +0 -0
- data/ext/mathematical/{lsmsvgradialgradientelement.h → lasem/src/lsmsvgradialgradientelement.h} +0 -0
- data/ext/mathematical/{lsmsvgrectelement.c → lasem/src/lsmsvgrectelement.c} +0 -0
- data/ext/mathematical/{lsmsvgrectelement.h → lasem/src/lsmsvgrectelement.h} +0 -0
- data/ext/mathematical/{lsmsvgstopelement.c → lasem/src/lsmsvgstopelement.c} +0 -0
- data/ext/mathematical/{lsmsvgstopelement.h → lasem/src/lsmsvgstopelement.h} +0 -0
- data/ext/mathematical/{lsmsvgstyle.c → lasem/src/lsmsvgstyle.c} +0 -14
- data/ext/mathematical/{lsmsvgstyle.h → lasem/src/lsmsvgstyle.h} +0 -0
- data/ext/mathematical/{lsmsvgsvgelement.c → lasem/src/lsmsvgsvgelement.c} +0 -0
- data/ext/mathematical/{lsmsvgsvgelement.h → lasem/src/lsmsvgsvgelement.h} +0 -0
- data/ext/mathematical/{lsmsvgswitchelement.c → lasem/src/lsmsvgswitchelement.c} +0 -0
- data/ext/mathematical/{lsmsvgswitchelement.h → lasem/src/lsmsvgswitchelement.h} +0 -0
- data/ext/mathematical/{lsmsvgsymbolelement.c → lasem/src/lsmsvgsymbolelement.c} +0 -0
- data/ext/mathematical/{lsmsvgsymbolelement.h → lasem/src/lsmsvgsymbolelement.h} +0 -0
- data/ext/mathematical/{lsmsvgtextelement.c → lasem/src/lsmsvgtextelement.c} +0 -0
- data/ext/mathematical/{lsmsvgtextelement.h → lasem/src/lsmsvgtextelement.h} +0 -0
- data/ext/mathematical/{lsmsvgtraits.c → lasem/src/lsmsvgtraits.c} +0 -0
- data/ext/mathematical/{lsmsvgtraits.h → lasem/src/lsmsvgtraits.h} +0 -0
- data/ext/mathematical/{lsmsvgtransformable.c → lasem/src/lsmsvgtransformable.c} +0 -0
- data/ext/mathematical/{lsmsvgtransformable.h → lasem/src/lsmsvgtransformable.h} +0 -0
- data/ext/mathematical/{lsmsvgtspanelement.c → lasem/src/lsmsvgtspanelement.c} +0 -0
- data/ext/mathematical/{lsmsvgtspanelement.h → lasem/src/lsmsvgtspanelement.h} +0 -0
- data/ext/mathematical/{lsmsvgtypes.h → lasem/src/lsmsvgtypes.h} +0 -0
- data/ext/mathematical/{lsmsvguseelement.c → lasem/src/lsmsvguseelement.c} +0 -0
- data/ext/mathematical/{lsmsvguseelement.h → lasem/src/lsmsvguseelement.h} +0 -0
- data/ext/mathematical/{lsmsvgview.c → lasem/src/lsmsvgview.c} +2 -1
- data/ext/mathematical/{lsmsvgview.h → lasem/src/lsmsvgview.h} +0 -0
- data/ext/mathematical/{lsmtraits.c → lasem/src/lsmtraits.c} +0 -0
- data/ext/mathematical/{lsmtraits.h → lasem/src/lsmtraits.h} +0 -0
- data/ext/mathematical/{lsmtypes.h → lasem/src/lsmtypes.h} +0 -0
- data/ext/mathematical/{lsmutils.c → lasem/src/lsmutils.c} +0 -0
- data/ext/mathematical/{lsmutils.h → lasem/src/lsmutils.h} +0 -0
- data/ext/mathematical/lasem/tests/dom.c +272 -0
- data/ext/mathematical/lasem/tests/lsmtest.c +597 -0
- data/ext/mathematical/lasem/tests/str.c +48 -0
- data/ext/mathematical/lasem/tests/suite.c +125 -0
- data/ext/mathematical/lasem/tools/generate-entity-array.c +2136 -0
- data/ext/mathematical/mathematical.c +38 -34
- data/lib/mathematical/render.rb +5 -4
- data/lib/mathematical/version.rb +1 -1
- data/test/mathematical/maliciousness_test.rb +27 -1
- metadata +242 -242
- data/ext/mathematical/lsmdomenumtypes.c +0 -99
- data/ext/mathematical/lsmdomenumtypes.h +0 -26
- data/ext/mathematical/lsmmathmlenumtypes.c +0 -666
- data/ext/mathematical/lsmmathmlenumtypes.h +0 -90
- data/ext/mathematical/lsmsvgenumtypes.c +0 -1083
- data/ext/mathematical/lsmsvgenumtypes.h +0 -111
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76b035ec15c5544af7d23d6f576db7bc631f1a99
|
|
4
|
+
data.tar.gz: d05835bb988ace6708c9c96f5b08e3af123f9e79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39d975bf3099679edf52fb1ab277f7e655482ed206a26de3a5e8ae2d93abc904bc5d0735f11789fc1c9c7378d038ba6842036b65565449bf4ad5d638e03612cd
|
|
7
|
+
data.tar.gz: 6e2a815f25d40bb1e3cea90f626f9a3669979b8ffbc847d7ade2549a123168fb35466d682009033521ce7058e5b4da1be608a5be212e66a773c66bfdb9113d62
|
data/Rakefile
CHANGED
|
@@ -20,6 +20,10 @@ end
|
|
|
20
20
|
Gem::PackageTask.new(spec) do |pkg|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
Rake::Task["compile"].enhance do
|
|
24
|
+
Rake::Task["destroy_copies"].invoke
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
Rake::Task[:test].prerequisites << :compile
|
|
24
28
|
|
|
25
29
|
task :default => [:test]
|
|
@@ -54,3 +58,11 @@ task :publish do
|
|
|
54
58
|
system "echo yolo"
|
|
55
59
|
end
|
|
56
60
|
end
|
|
61
|
+
|
|
62
|
+
task :destroy_copies do
|
|
63
|
+
ext_dir = File.join(File.dirname(__FILE__), "ext", "mathematical")
|
|
64
|
+
Dir.glob("#{ext_dir}/*").select { |f| File.file?(f) }.each do |f|
|
|
65
|
+
next if f =~ /extconf.rb/ || f =~ /mathematical.c/
|
|
66
|
+
File.delete(f)
|
|
67
|
+
end
|
|
68
|
+
end
|
data/ext/mathematical/extconf.rb
CHANGED
|
@@ -2,6 +2,9 @@ require 'mkmf'
|
|
|
2
2
|
require 'rbconfig'
|
|
3
3
|
host_os = RbConfig::CONFIG['host_os']
|
|
4
4
|
|
|
5
|
+
LASEM_DIR = File.join(File.dirname(__FILE__), "lasem", "src")
|
|
6
|
+
ITEX_DIR = File.join(File.dirname(__FILE__), "itexToMML")
|
|
7
|
+
|
|
5
8
|
if host_os =~ /darwin|mac os/
|
|
6
9
|
ENV['PKG_CONFIG_PATH'] = "/opt/X11/lib/pkgconfig:#{ENV['PKG_CONFIG_PATH']}"
|
|
7
10
|
end
|
|
@@ -12,9 +15,16 @@ find_header("libxml/parser.h", "/usr/include/libxml2", "/usr/local/include/libxm
|
|
|
12
15
|
find_header("libxml/xpath.h", "/usr/include/libxml2", "/usr/local/include/libxml2")
|
|
13
16
|
find_header("libxml/xpathInternals.h", "/usr/include/libxml2", "/usr/local/include/libxml2")
|
|
14
17
|
|
|
18
|
+
# TODO: this is so frakkin' stupid. but I can't seem to get subdirs to compile any other way
|
|
19
|
+
# the `destroy_copies` task, immediately after `compile`, will destroy these files
|
|
20
|
+
FileUtils.cp_r(Dir.glob("#{LASEM_DIR}/*"), File.dirname(__FILE__))
|
|
21
|
+
File.delete(File.join(File.dirname(__FILE__), "lasemrender.c"))
|
|
22
|
+
|
|
23
|
+
FileUtils.cp_r(Dir.glob("#{ITEX_DIR}/*"), File.dirname(__FILE__))
|
|
24
|
+
|
|
15
25
|
have_library("pangocairo-1.0")
|
|
16
26
|
|
|
17
|
-
$LDFLAGS += " #{`pkg-config --static --libs glib-2.0 gdk-pixbuf-2.0 cairo pango
|
|
18
|
-
$CFLAGS += " #{`pkg-config --cflags glib-2.0 gdk-pixbuf-2.0 cairo pango
|
|
27
|
+
$LDFLAGS += " #{`pkg-config --static --libs glib-2.0 gdk-pixbuf-2.0 cairo pango`.chomp}"
|
|
28
|
+
$CFLAGS += " #{`pkg-config --cflags glib-2.0 gdk-pixbuf-2.0 cairo pango`.chomp} -I#{LASEM_DIR} -I#{ITEX_DIR}"
|
|
19
29
|
|
|
20
30
|
create_makefile("mathematical/mathematical")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* itex2MML 1.4.5
|
|
2
|
+
* itex2MML.h last modified 10/2/2010
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#ifndef ITEX2MML_H
|
|
6
|
+
#define ITEX2MML_H
|
|
7
|
+
|
|
8
|
+
#define ITEX2MML_VERSION "1.4.5"
|
|
9
|
+
|
|
10
|
+
#ifdef __cplusplus
|
|
11
|
+
extern "C" {
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
/* Step 1. Parse a buffer with itex source; return value is mathml, or 0 on failure (e.g., parse error).
|
|
15
|
+
*/
|
|
16
|
+
extern char * itex2MML_parse (const char * buffer, unsigned long length);
|
|
17
|
+
|
|
18
|
+
/* Step 2. Free the string from Step 1.
|
|
19
|
+
*/
|
|
20
|
+
extern void itex2MML_free_string (char * str);
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/* Alternatively, to filter generic source and converting embedded equations, use:
|
|
24
|
+
*/
|
|
25
|
+
extern int itex2MML_filter (const char * buffer, unsigned long length);
|
|
26
|
+
|
|
27
|
+
extern int itex2MML_html_filter (const char * buffer, unsigned long length);
|
|
28
|
+
extern int itex2MML_strict_html_filter (const char * buffer, unsigned long length);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/* To change output methods:
|
|
32
|
+
*
|
|
33
|
+
* Note: If length is 0, then buffer is treated like a string; otherwise only length bytes are written.
|
|
34
|
+
*/
|
|
35
|
+
extern void (*itex2MML_write) (const char * buffer, unsigned long length); /* default writes to stdout */
|
|
36
|
+
extern void (*itex2MML_write_mathml) (const char * mathml); /* default calls itex2MML_write(mathml,0) */
|
|
37
|
+
extern void (*itex2MML_error) (const char * msg); /* default writes to stderr */
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/* Other stuff:
|
|
41
|
+
*/
|
|
42
|
+
extern void itex2MML_setup (const char * buffer, unsigned long length);
|
|
43
|
+
|
|
44
|
+
extern void itex2MML_restart (void);
|
|
45
|
+
|
|
46
|
+
extern char * itex2MML_copy_string (const char * str);
|
|
47
|
+
extern char * itex2MML_copy_string_extra (const char * str, unsigned extra);
|
|
48
|
+
extern char * itex2MML_copy2 (const char * first, const char * second);
|
|
49
|
+
extern char * itex2MML_copy3 (const char * first, const char * second, const char * third);
|
|
50
|
+
extern char * itex2MML_copy_escaped (const char * str);
|
|
51
|
+
|
|
52
|
+
extern char * itex2MML_empty_string;
|
|
53
|
+
|
|
54
|
+
extern int itex2MML_lineno;
|
|
55
|
+
|
|
56
|
+
extern int itex2MML_rowposn;
|
|
57
|
+
extern int itex2MML_displaymode;
|
|
58
|
+
|
|
59
|
+
#ifdef __cplusplus
|
|
60
|
+
}
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#endif /* ! ITEX2MML_H */
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
#include <cairo-pdf.h>
|
|
33
33
|
#include <cairo-svg.h>
|
|
34
34
|
#include <cairo-ps.h>
|
|
35
|
+
#include <../config.h>
|
|
35
36
|
|
|
36
|
-
#include
|
|
37
|
+
#include <../itex2mml/itex2MML.h>
|
|
37
38
|
|
|
38
39
|
static char *option_debug_domains = NULL;
|
|
39
40
|
static char *option_output_file_format = NULL;
|
|
@@ -75,7 +76,7 @@ static const GOptionEntry entries[] =
|
|
|
75
76
|
{ NULL }
|
|
76
77
|
};
|
|
77
78
|
|
|
78
|
-
int
|
|
79
|
+
int main(int argc, char **argv)
|
|
79
80
|
{
|
|
80
81
|
LsmDomDocument *document;
|
|
81
82
|
LsmDomView *view;
|
|
@@ -89,41 +90,46 @@ int mainbar(int argc, char **argv)
|
|
|
89
90
|
double height_pt, width_pt;
|
|
90
91
|
unsigned int height, width;
|
|
91
92
|
|
|
93
|
+
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
|
|
94
|
+
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
95
|
+
textdomain (GETTEXT_PACKAGE);
|
|
96
|
+
|
|
97
|
+
#if !GLIB_CHECK_VERSION(2,36,0)
|
|
92
98
|
g_type_init ();
|
|
99
|
+
#endif
|
|
93
100
|
|
|
94
101
|
context = g_option_context_new (NULL);
|
|
95
102
|
g_option_context_add_main_entries (context, entries, NULL);
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
if (!g_option_context_parse (context, &argc, &argv, &error))
|
|
105
|
+
{
|
|
106
|
+
g_option_context_free (context);
|
|
107
|
+
g_print (_("Option parsing failed: %s\n"), error->message);
|
|
108
|
+
return EXIT_FAILURE;
|
|
109
|
+
}
|
|
103
110
|
|
|
104
111
|
g_option_context_free (context);
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
if (option_zoom < 0.0) {
|
|
114
|
+
g_print (_("Invalid zoom value"));
|
|
115
|
+
return EXIT_FAILURE;
|
|
116
|
+
}
|
|
110
117
|
|
|
111
118
|
lsm_debug_enable (option_debug_domains);
|
|
112
119
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// option_input_filenames = ;
|
|
120
|
+
if (option_input_filenames == NULL || g_strv_length (option_input_filenames) > 1) {
|
|
121
|
+
g_print (_("One input file name is required\n"));
|
|
122
|
+
return EXIT_FAILURE;
|
|
123
|
+
}
|
|
118
124
|
|
|
119
|
-
input_filename =
|
|
125
|
+
input_filename = option_input_filenames[0];
|
|
120
126
|
|
|
121
127
|
if (option_output_file_format != NULL) {
|
|
122
128
|
for (format = 0; format < G_N_ELEMENTS(file_formats) - 1; format++)
|
|
123
129
|
if (g_ascii_strcasecmp (option_output_file_format, file_formats[format]) == 0)
|
|
124
130
|
break;
|
|
125
131
|
if (FORMAT_UNKNOWN == format) {
|
|
126
|
-
g_print (_("Unknown format
|
|
132
|
+
g_print (_("Unknown format: %s\n"), option_output_file_format);
|
|
127
133
|
return EXIT_FAILURE;
|
|
128
134
|
}
|
|
129
135
|
} else
|
|
@@ -180,12 +186,12 @@ int mainbar(int argc, char **argv)
|
|
|
180
186
|
if (document != NULL) {
|
|
181
187
|
if (lsm_debug_check (&lsm_debug_category_dom, LSM_DEBUG_LEVEL_LOG)) {
|
|
182
188
|
void *buffer;
|
|
183
|
-
|
|
189
|
+
gsize size;
|
|
184
190
|
|
|
185
191
|
lsm_dom_document_save_to_memory (document, &buffer, &size, NULL);
|
|
186
192
|
|
|
187
193
|
if (buffer != NULL) {
|
|
188
|
-
g_printf ("%*s\n", size, (char *) buffer);
|
|
194
|
+
g_printf ("%*s\n", (int) size, (char *) buffer);
|
|
189
195
|
g_free (buffer);
|
|
190
196
|
}
|
|
191
197
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
#include <glib/gprintf.h>
|
|
26
26
|
#include <stdlib.h>
|
|
27
27
|
|
|
28
|
+
static void lsm_debug_with_level (LsmDebugCategory *category, LsmDebugLevel level, const char *format, va_list args) G_GNUC_PRINTF(3,0);
|
|
29
|
+
|
|
28
30
|
struct _LsmDebugCategory {
|
|
29
31
|
char *name;
|
|
30
32
|
LsmDebugLevel level;
|
|
@@ -60,9 +60,9 @@ extern LsmDebugCategory lsm_debug_category_viewport;
|
|
|
60
60
|
#define lsm_log_render(...) lsm_log (&lsm_debug_category_render, __VA_ARGS__)
|
|
61
61
|
#define lsm_warning_render(...) lsm_warning (&lsm_debug_category_render, __VA_ARGS__)
|
|
62
62
|
|
|
63
|
-
void lsm_warning (LsmDebugCategory *category, const char *format, ...);
|
|
64
|
-
void lsm_debug (LsmDebugCategory *category, const char *format, ...);
|
|
65
|
-
void lsm_log (LsmDebugCategory *category, const char *format, ...);
|
|
63
|
+
void lsm_warning (LsmDebugCategory *category, const char *format, ...) G_GNUC_PRINTF(2,3);
|
|
64
|
+
void lsm_debug (LsmDebugCategory *category, const char *format, ...) G_GNUC_PRINTF(2,3);
|
|
65
|
+
void lsm_log (LsmDebugCategory *category, const char *format, ...) G_GNUC_PRINTF(2,3);
|
|
66
66
|
|
|
67
67
|
gboolean lsm_debug_check (LsmDebugCategory *category, LsmDebugLevel level);
|
|
68
68
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Lasem
|
|
2
2
|
*
|
|
3
|
-
* Copyright © 2007-
|
|
3
|
+
* Copyright © 2007-2014 Emmanuel Pacaud
|
|
4
4
|
*
|
|
5
5
|
* This library is free software; you can redistribute it and/or
|
|
6
6
|
* modify it under the terms of the GNU Lesser General Public
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
#include <libxml/parser.h>
|
|
31
31
|
#include <gio/gio.h>
|
|
32
32
|
#include <string.h>
|
|
33
|
-
#include
|
|
33
|
+
#include <../itex2mml/itex2MML.h>
|
|
34
34
|
|
|
35
35
|
typedef enum {
|
|
36
36
|
STATE
|
|
@@ -202,7 +202,7 @@ lsm_dom_parser_warning (void *user_data, const char *msg, ...)
|
|
|
202
202
|
va_list args;
|
|
203
203
|
|
|
204
204
|
va_start(args, msg);
|
|
205
|
-
lsm_warning_dom (msg);
|
|
205
|
+
lsm_warning_dom ("%s", msg);
|
|
206
206
|
va_end(args);
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -212,7 +212,7 @@ lsm_dom_parser_error (void *user_data, const char *msg, ...)
|
|
|
212
212
|
va_list args;
|
|
213
213
|
|
|
214
214
|
va_start(args, msg);
|
|
215
|
-
lsm_warning_dom (msg);
|
|
215
|
+
lsm_warning_dom ("%s", msg);
|
|
216
216
|
va_end(args);
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -222,7 +222,7 @@ lsm_dom_parser_fatal_error (void *user_data, const char *msg, ...)
|
|
|
222
222
|
va_list args;
|
|
223
223
|
|
|
224
224
|
va_start(args, msg);
|
|
225
|
-
lsm_warning_dom (msg);
|
|
225
|
+
lsm_warning_dom ("%s", msg);
|
|
226
226
|
va_end(args);
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -259,7 +259,7 @@ typedef enum {
|
|
|
259
259
|
|
|
260
260
|
static LsmDomDocument *
|
|
261
261
|
_parse_memory (LsmDomDocument *document, LsmDomNode *node,
|
|
262
|
-
const void *buffer,
|
|
262
|
+
const void *buffer, gsize size, GError **error)
|
|
263
263
|
{
|
|
264
264
|
static LsmDomSaxParserState state;
|
|
265
265
|
|
|
@@ -269,7 +269,7 @@ _parse_memory (LsmDomDocument *document, LsmDomNode *node,
|
|
|
269
269
|
else
|
|
270
270
|
state.current_node = LSM_DOM_NODE (document);
|
|
271
271
|
|
|
272
|
-
if (size <
|
|
272
|
+
if (size < 1)
|
|
273
273
|
size = strlen (buffer);
|
|
274
274
|
|
|
275
275
|
if (xmlSAXUserParseMemory (&sax_handler, &state, buffer, size) < 0) {
|
|
@@ -293,18 +293,18 @@ _parse_memory (LsmDomDocument *document, LsmDomNode *node,
|
|
|
293
293
|
* @document: a #LsmDomDocument
|
|
294
294
|
* @node: a #LsmDomNode
|
|
295
295
|
* @buffer: a memory buffer holding xml data
|
|
296
|
-
* @size: size of the xml data, in bytes
|
|
296
|
+
* @size: size of the xml data, in bytes, 0 if unknown
|
|
297
297
|
* @error: an error placeholder
|
|
298
298
|
*
|
|
299
299
|
* Append a chunk of xml tree to an existing document. The resulting nodes will be appended to
|
|
300
300
|
* @node, or to @document if @node == NULL.
|
|
301
301
|
*
|
|
302
|
-
* Size set to
|
|
302
|
+
* Size set to 0 indicates an unknow xml data size.
|
|
303
303
|
*/
|
|
304
304
|
|
|
305
305
|
void
|
|
306
306
|
lsm_dom_document_append_from_memory (LsmDomDocument *document, LsmDomNode *node,
|
|
307
|
-
const void *buffer,
|
|
307
|
+
const void *buffer, gsize size, GError **error)
|
|
308
308
|
{
|
|
309
309
|
g_return_if_fail (LSM_IS_DOM_DOCUMENT (document));
|
|
310
310
|
g_return_if_fail (LSM_IS_DOM_NODE (node) || node == NULL);
|
|
@@ -313,14 +313,30 @@ lsm_dom_document_append_from_memory (LsmDomDocument *document, LsmDomNode *node,
|
|
|
313
313
|
_parse_memory (document, node, buffer, size, error);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
/**
|
|
317
|
+
* lsm_dom_document_new_from_memory:
|
|
318
|
+
* @buffer: xml data
|
|
319
|
+
* @size: size of the data, in bytes, 0 if unknown
|
|
320
|
+
* @error: an error placeholder
|
|
321
|
+
*
|
|
322
|
+
* Create a new document from a memory data buffer.
|
|
323
|
+
*/
|
|
324
|
+
|
|
316
325
|
LsmDomDocument *
|
|
317
|
-
lsm_dom_document_new_from_memory (const void *buffer,
|
|
326
|
+
lsm_dom_document_new_from_memory (const void *buffer, gsize size, GError **error)
|
|
318
327
|
{
|
|
319
328
|
g_return_val_if_fail (buffer != NULL, NULL);
|
|
320
329
|
|
|
321
|
-
return _parse_memory (NULL, NULL, buffer, size, error);
|
|
330
|
+
return _parse_memory (NULL, NULL, buffer, size, error);
|
|
322
331
|
}
|
|
323
332
|
|
|
333
|
+
/**
|
|
334
|
+
* lsm_dom_document_new_from_file:
|
|
335
|
+
* @file: a #GFile
|
|
336
|
+
* @error: an error placeholder
|
|
337
|
+
*
|
|
338
|
+
* Create a new document from a #GFile.
|
|
339
|
+
*/
|
|
324
340
|
|
|
325
341
|
static LsmDomDocument *
|
|
326
342
|
lsm_dom_document_new_from_file (GFile *file, GError **error)
|
|
@@ -339,6 +355,14 @@ lsm_dom_document_new_from_file (GFile *file, GError **error)
|
|
|
339
355
|
return document;
|
|
340
356
|
}
|
|
341
357
|
|
|
358
|
+
/**
|
|
359
|
+
* lsm_dom_document_new_from_path:
|
|
360
|
+
* @path: a file path
|
|
361
|
+
* @error: an error placeholder
|
|
362
|
+
*
|
|
363
|
+
* Create a new document from the data stored in @path.
|
|
364
|
+
*/
|
|
365
|
+
|
|
342
366
|
LsmDomDocument *
|
|
343
367
|
lsm_dom_document_new_from_path (const char *path, GError **error)
|
|
344
368
|
{
|
|
@@ -359,6 +383,14 @@ lsm_dom_document_new_from_path (const char *path, GError **error)
|
|
|
359
383
|
return document;
|
|
360
384
|
}
|
|
361
385
|
|
|
386
|
+
/**
|
|
387
|
+
* lsm_dom_document_new_from_url:
|
|
388
|
+
* @url: a file url
|
|
389
|
+
* @error: an error placeholder
|
|
390
|
+
*
|
|
391
|
+
* Create a new document from the data stored at @url.
|
|
392
|
+
*/
|
|
393
|
+
|
|
362
394
|
LsmDomDocument *
|
|
363
395
|
lsm_dom_document_new_from_url (const char *url, GError **error)
|
|
364
396
|
{
|
|
@@ -384,6 +416,8 @@ lsm_dom_document_new_from_url (const char *url, GError **error)
|
|
|
384
416
|
* @document: a #LsmDomDocument
|
|
385
417
|
* @stream: stream to save to
|
|
386
418
|
* @error: an error placeholder
|
|
419
|
+
*
|
|
420
|
+
* Save @document as an xml representation into @stream.
|
|
387
421
|
*/
|
|
388
422
|
|
|
389
423
|
void
|
|
@@ -395,8 +429,18 @@ lsm_dom_document_save_to_stream (LsmDomDocument *document, GOutputStream *stream
|
|
|
395
429
|
lsm_dom_node_write_to_stream (LSM_DOM_NODE (document), stream, error);
|
|
396
430
|
}
|
|
397
431
|
|
|
432
|
+
/**
|
|
433
|
+
* lsm_dom_document_save_to_memory:
|
|
434
|
+
* @document: a #LsmDomDocument
|
|
435
|
+
* @buffer: placeholder for a pointer to the resulting data buffer
|
|
436
|
+
* @size: placeholder for the data size
|
|
437
|
+
* @error: placeholder for a #GError
|
|
438
|
+
*
|
|
439
|
+
* Save @document as an xml representation into @buffer.
|
|
440
|
+
*/
|
|
441
|
+
|
|
398
442
|
void
|
|
399
|
-
lsm_dom_document_save_to_memory (LsmDomDocument *document, void **buffer,
|
|
443
|
+
lsm_dom_document_save_to_memory (LsmDomDocument *document, void **buffer, gsize *size, GError **error)
|
|
400
444
|
{
|
|
401
445
|
GOutputStream *stream;
|
|
402
446
|
|
|
@@ -426,6 +470,15 @@ lsm_dom_document_save_to_memory (LsmDomDocument *document, void **buffer, int *s
|
|
|
426
470
|
g_object_unref (stream);
|
|
427
471
|
}
|
|
428
472
|
|
|
473
|
+
/**
|
|
474
|
+
* lsm_dom_document_save_to_path:
|
|
475
|
+
* @document: a #LsmDomDocument
|
|
476
|
+
* @path: a file path
|
|
477
|
+
* @error: placeholder for a #GError
|
|
478
|
+
*
|
|
479
|
+
* Save @document as an xml representation to a file, replacing the already existing file if needed.
|
|
480
|
+
*/
|
|
481
|
+
|
|
429
482
|
void
|
|
430
483
|
lsm_dom_document_save_to_path (LsmDomDocument *document, const char *path, GError **error)
|
|
431
484
|
{
|
|
@@ -443,15 +496,24 @@ lsm_dom_document_save_to_path (LsmDomDocument *document, const char *path, GErro
|
|
|
443
496
|
g_object_unref (file);
|
|
444
497
|
}
|
|
445
498
|
|
|
499
|
+
/**
|
|
500
|
+
* lsm_dom_document_save_to_url:
|
|
501
|
+
* @document: a #LsmDomDocument
|
|
502
|
+
* @url: an url
|
|
503
|
+
* @error: placeholder for a #GError
|
|
504
|
+
*
|
|
505
|
+
* Save @document as an xml representation to @url, replacing the already existing file if needed.
|
|
506
|
+
*/
|
|
507
|
+
|
|
446
508
|
void
|
|
447
|
-
lsm_dom_document_save_to_url (LsmDomDocument *document, const char *
|
|
509
|
+
lsm_dom_document_save_to_url (LsmDomDocument *document, const char *url, GError **error)
|
|
448
510
|
{
|
|
449
511
|
GFile *file;
|
|
450
512
|
GFileOutputStream *stream;
|
|
451
513
|
|
|
452
|
-
g_return_if_fail (
|
|
514
|
+
g_return_if_fail (url != NULL);
|
|
453
515
|
|
|
454
|
-
file = g_file_new_for_uri (
|
|
516
|
+
file = g_file_new_for_uri (url);
|
|
455
517
|
stream = g_file_create (file, G_FILE_CREATE_REPLACE_DESTINATION, NULL, error);
|
|
456
518
|
if (stream != NULL) {
|
|
457
519
|
lsm_dom_document_save_to_stream (document, G_OUTPUT_STREAM (stream), error);
|