POV-Ray : Newsgroups : povray.binaries.utilities : adding SDL to ctags Server Time: 29 Jan 2020 15:05:30 GMT
  adding SDL to ctags (Message 1 to 2 of 2)  
From: jr
Subject: adding SDL to ctags
Date: 2 Jan 2020 16:05:01
Message: <web.5e0e133572d06ba48c662f470@news.povray.org>
hi,

(if you're not using 'vim', look away now..  :-))

most users of 'vim' will be familiar with 'tags' files and the '^]' key combo.
while 'ctags' does not include PovRay SDL, the support is easy to add.  I've
attached an archive containing a source ('sdl.c') and a "diff" to patch a couple
of files.  this first version is v basic, only recognising macros and declare +
local, but usable.

assuming the source[*] for 'ctags-5.8' in '/tmp/ctags-5.8/', extract the archive
in '/tmp/'.  copy/move 'sdl.c' into the ctags directory, and cd into it.  then
  $ zcat ../add.sdl.diff.gz | patch --verbose -p1

that's it.  then the usual './configure  &&  make' etc.

I've installed my copy in my home path, ie '~/bin/', for now.  testing, so far
so good, hope that (some of) you will provide feedback and suggestions for
improvements etc.

[*] <http://ctags.sourceforge.net/>


enjoy, jr.


Post a reply to this message


Attachments:
Download 'ctagspov.tar' (10 KB)

From: jr
Subject: Re: adding SDL to ctags
Date: 5 Jan 2020 22:10:01
Message: <web.5e125cc33de8e3ea8c662f470@news.povray.org>
hi,

the first version posted would not "see" macros/declares/locals when not the
first item on the line, eg "#if (flag_) #local a_ = 1; #end"  misses the '#local
a_', now corrected.

I find the cross-referencing option too worth having, the output shown is
produced with:

  $ cd /usr/local/share/povray-3.8/include
  $ ctags -x debug.inc
  DEBUG            variable     13 debug.inc        #declare DEBUG = yes;
  DEBUG            variable     19 debug.inc        #macro Set_Debug(Bool)
#declare DEBUG = Bool; #end
  DEBUG_MCR        variable     11 debug.inc        #declare DEBUG_MCR = true;
  Debug            macro        29 debug.inc        #macro Debug(Condition,
Message)
  Debug_Inc_Stack  macro        15 debug.inc        #macro Debug_Inc_Stack()
  Debug_Message    macro        22 debug.inc        #macro Debug_Message(Str)
  Error            macro        39 debug.inc        #macro Error(Condition,
Message)
  Set_Debug        macro        19 debug.inc        #macro Set_Debug(Bool)
#declare DEBUG = Bool; #end
  View_POV_Include_Stack variable     16 debug.inc        #declare
View_POV_Include_Stack = 1;
  Warning          macro        34 debug.inc        #macro Warning(Condition,
Message)


enjoy, jr.


Post a reply to this message


Attachments:
Download 'ctagspov2.tar' (10 KB)

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.