<blockquote>
<p>Could you write a short document about libctags internal?</p>
</blockquote>
<p>There's not much to write. Basically we just need to:</p>
<ul>
<li>bypass some things from ctags main() which are irrelevant for us (command-line options etc.) - this is done in ctagsInit() inside ctags.api.c</li>
<li>register our custom writer (done inside ctagsInit()) which unlike other writers doesn't write to the MIO (which is NULL in our case) but instead the writeEntry() passes the tag information to Geany</li>
<li>be informed when re-parsing happens so we can invalidate the tags we passed to Geany - this is currently done in a hacky way but it could be nicer if there was a function for it in a writer</li>
<li>be able to initiate parsing by ourselves - either from a file or from a char buffer - see ctagsParse() in ctags-api.c</li>
<li>get some basic information about the registered parsers like kinds they provide etc. - see the rest of ctags-api.c</li>
</ul>
<p>This is basically the main functionality, there are some other diffs where we for instance don't have fnmatch.h or where the parser list order has to correspond to the order specified in Geany which we could maybe change in Geany itself. But that's basically it.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2119#issuecomment-486407307">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7BEMJWQSUBXYQA533PSC5MBANCNFSM4HEAA74Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJ5OAYAFW4DREJW2TD3PSC5MBANCNFSM4HEAA74Q.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@techee in #2119: \u003e Could you write a short document about libctags internal?\r\n\r\nThere's not much to write. Basically we just need to:\r\n\r\n* bypass some things from ctags main() which are irrelevant for us (command-line options etc.) - this is done in ctagsInit() inside ctags.api.c\r\n* register our custom writer (done inside ctagsInit()) which unlike other writers doesn't write to the MIO (which is NULL in our case) but instead the writeEntry() passes the tag information to Geany\r\n* be informed when re-parsing happens so we can invalidate the tags we passed to Geany - this is currently done in a hacky way but it could be nicer if there was a function for it in a writer\r\n* be able to initiate parsing by ourselves - either from a file or from a char buffer - see ctagsParse() in ctags-api.c\r\n* get some basic information about the registered parsers like kinds they provide etc. - see the rest of ctags-api.c\r\n\r\nThis is basically the main functionality, there are some other diffs where we for instance don't have fnmatch.h or where the parser list order has to correspond to the order specified in Geany which we could maybe change in Geany itself. But that's basically it."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/2119#issuecomment-486407307"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2119#issuecomment-486407307",
"url": "https://github.com/geany/geany/issues/2119#issuecomment-486407307",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>