Thread: another bug

Started: 2005-11-04 19:09:05
Last activity: 2005-11-15 01:32:41
Topics: SAC Developers
Brian Savage
2005-11-04 19:09:05

I am trying to write a simple program in C using the sacio.a library. I
was doing this to provide an exmaple bit of code people could use as a
base to start from. I am running into problems.

I read in a file using rsac1, mutiply the data by 10 and then use wsac1
to write it out to a differnet file name. If the infile file exists and
the output file does not exist, everything works as fine. If both the
input and output files exist, then a output file is written with a one
less character in the filename.

Looking into the code, it appears that this is a bug in the index[a,b]
code. I can see this as being a big problem, espically if your input in
tmp and output is tmp2. In this case your input is overwritten.

The index[a,b] code finds the position of a character in a string. I
think this bug may be a result from the C to fortran conversion. This
may take a while to fix as I am not sure how many other routines rely on
these functions.

Any insight would be great.


  • Brian Savage
    2005-11-15 01:32:41
    As a proof of concept (or test to see if it could be done), I have
    migrated most of the user interface from Xlib to the GTK. Some feedback
    about if this would be appreciated to see if this is an appropriate step
    for the SAC code base to take. People have requested a much nicer
    interface and a way to smooth the learning curve for SAC. I have a
    feeling this will be a step in both those directions.

    * Menus, Toolbars, Statusbars, ....
    * Other Windows for sac headers, sac data files, filter construction...
    * Improved Mouse / Cursor Handling
    * "Simplified" internal code for drawing
    * Much prettier (Can be)

    * Introduces a number of dependencies
    * May not work on older machines, but could be compiled to use older
    code base

    Screenshot -
    Look for the menu at top and gray statusbar at the bottom

    This was compiled against GTK+2.4 which is available on Linux, OSX, and
    Solaris. The interesting part is GTK will run on top of Windows as
    well, whereas the older Xlib interface would not.

    More Information:
    GTK -
    Xlib -


08:08:11 v.ad6b513c