Bug with xtags for D

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
Guest

Bug with xtags for D

Post by Guest »

Hi, I'm trying out your IDE for the D language and I spotted the following bug in tag generation. It seems the tag generator cannot read function prototypes as well as reading classes, interfaces, enums, and variables inside blocks. Look at the following:

Code: Select all

module audiere;
private import std.c.windows.com;

extern (Windows)
{
interface RefCounted
{
   void ref();                // int
   void unref();              // int
}

interface File: RefCounted, IUnknown
{
  int read(int pbuffer, int size);      // int
  bool seek(int position, int SeekMode);  // bool
  int tell();                       // int
}

interface SampleBuffer: RefCounted, IUnknown
{
  void getFormat(int channel_count,int sample_rate,int lsample_format);  // void
  int getLength();                                               // int
  int getSamples();                                              // int
  SampleSource openStream();                                              // pSampleSource
}

interface SampleSource: RefCounted, IUnknown
{
  void getFormat(int v,int v);      // void
  int Read(int v, int v);          // int
  void reset();                       // void
  bool isSeekable();                  // bool
  int getLength();                   // int
  void setPosition(int v);           // void
  int getPosition();                 // int
  bool getRepeat();                   // bool
  void setRepeat(int v);             // void
}

interface LoopPointSource: SampleSource, IUnknown
{
  void addLoopPoint(int location,int target, int loopCount);             // void
  void removeLoopPoint(int index);                                  // void
  int getLoopPointCount();                                       // int
  bool getLoopPoint(int index,int plocation,int ptarget,int ploopCount);  // bool
}

interface OutputStream: RefCounted, IUnknown
{
  bool play();
  bool stop();                 // bool
  bool isPlaying();            // bool
  void reset();                // void
  void setRepeat(int v);      // void
  bool getRepeat();            // bool
  void setVolume(float v);     // void
  float getVolume();            // float
  void setPan(float v);        // void
  float getPan();               // float
  void setPitchShift(float v); // void
  float getPitchShift();        // float
  bool isSeekable();           // bool
  int getLength();            // int
  void setPosition(int v);     // void
  int getPosition();          // int
}

interface AudioDevice: RefCounted, IUnknown
{
  void update();                               // void
  OutputStream openStream(SampleSource pSampleSource);            // pAudOutputStream
  OutputStream openBuffer(void* pSamples,int frame_count,int channel_count,int sample_rate,int sample_format);// pAudOutputStream
  char* getName();                              // char.l
}

interface SoundEffect: RefCounted, IUnknown
{
  void play();                          // void
  void stop();                          // void
  void setVolume(float volume);             // void
  float getVolume();                     // float
  void setPan(float pan);                   // void
  float getPan();                        // float
  void setPitchShift(float shift);          // void
  float getPitchShift();                 // float
}
}//End of extern(Windows)

enum SampleFormat
{
  SF_U8,      // unsigned 8-bit integer [0,255]
  SF_S16     // signed 16-bit integer in host endianness [-32768,32767]
}

enum FileFormat
{
  FF_AUTODETECT,
  FF_WAV,
  FF_OGG,
  FF_FLAC,
  FF_MP3,
  FF_MOD,
  FF_AIFF
}

enum SoundEffectType
{
  SINGLE,
  MULTIPLE
}

enum SeekMode
{
  begin,
  current,
  end
}


extern(Windows)
{
char* AdrGetVersion();
alias AdrGetVersion GetVersion;
    /**
     * Returns a formatted string that lists the file formats that Audiere
     * supports.  This function is DLL-safe.
     *
     * It is formatted in the following way:
     *
     * description1:ext1,ext2,ext3;description2:ext1,ext2,ext3
     */
char* AdrGetSupportedFileFormats();
alias AdrGetSupportedFileFormats GetSupportedFileFormats;

    /**
     * Returns a formatted string that lists the audio devices Audiere
     * supports.  This function is DLL-safe.
     *
     * It is formatted in the following way:
     *
     * name1:description1;name2:description2;...
     */
char* AdrGetSupportedAudioDevices();
alias AdrGetSupportedAudioDevices GetSupportedAudioDevices;

int AdrGetSampleSize(SampleFormat format);
alias AdrGetSampleSize GetSampleSize;

AudioDevice AdrOpenDevice(char* name = null, char* parameters = null);
alias AdrOpenDevice OpenDevice;

SampleSource AdrOpenSampleSource(char* filename, FileFormat file_format);
alias AdrOpenSampleSource OpenSampleSource;

SampleSource AdrOpenSampleSourceFromFile(File file, FileFormat file_format);
alias AdrOpenSampleSourceFromFile OpenSampleSourceFromFile;

SampleSource AdrCreateTone(double frequency);
alias AdrCreateTone CreateTone;

SampleSource AdrCreateSquareWave(double frequency);
alias AdrCreateSquareWave CreateSquareWave;

SampleSource AdrCreateWhiteNoise();
alias AdrCreateWhiteNoise CreateWhiteNoise;

SampleSource AdrCreatePinkNoise();
alias AdrCreatePinkNoise CreatePinkNoise;

LoopPointSource AdrCreateLoopPointSource(SampleSource source);
alias AdrCreateLoopPointSource CreateLoopPointSource;

OutputStream AdrOpenSound(AudioDevice device, SampleSource source, bool streaming);
alias AdrOpenSound OpenSound;

SampleBuffer AdrCreateSampleBuffer(void* samples, int frame_count, int channel_count,
      int sample_rate,
      SampleFormat sample_format);
alias AdrCreateSampleBuffer CreateSampleBuffer;

SampleBuffer AdrCreateSampleBufferFromSource(SampleSource source);
alias AdrCreateSampleBufferFromSource CreateSampleBufferFromSource;

SoundEffect AdrOpenSoundEffect(AudioDevice device, SampleSource source, SoundEffectType type);
alias AdrOpenSoundEffect OpenSoundEffect;

File AdrOpenFile(char* name, bool writeable);
alias AdrOpenFile OpenFile;

File AdrCreateMemoryFile(void* buffer, int size);
alias AdrCreateMemoryFile CreateMemoryFile;
}//End extern(Windows)

It will not read the interfaces inside of the extern(Windows) block as well as the function prototypes regardless of them being inside blocks or not.
Guest

Post by Guest »

Hey, it fixes the prototypes bug but now it doesn't show any interfaces, even the ones outside of the code block. That was a quick response though for the fix. Thanks.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The Exuberant Ctags utility has been modified to fix these issues with the D language. The code changes made to the ctags 5.5.4 source code base can be downloaded from here:

http://www.zeusedit.com/z300/ctags_src.zip

The compiled ctags excutable in include as part of the Zeus Version 3.95p installation.

Cheers Jussi
Post Reply