LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Can't find a function in a program's source code (https://www.linuxquestions.org/questions/programming-9/cant-find-a-function-in-a-programs-source-code-506692/)

2.718281828 12-01-2006 07:00 PM

Can't find a function in a program's source code
 
I downloaded aterm 1.0.0 and compiled it, but the background image (used to do fake transparency) doesn't always update when it should. I was looking through the source and I think the problem happens at line 993 in pixmap.c:
Code:

BG.trgPixmap = ScalePixmap( BG.srcPixmap,
BG.Width, BG.Height,
width, height, gc, SHADING );

The thing is, I can't find the function ScalePixmap anywhere. I did
Code:

grep ScalePixmap -rl *
from the top directory of the source, but only pixmap.c matches, and it doesn't have the function. It calls the function three times, but doesn't define it anywhere that I can find.

I then found every #include statement in every file, used locate to find all of those files, and searched them for ScalePixmap but still didn't find anything. Where could this function be? In aterm 0.4.2 (which doesn't have the problem with drawing the background image, by the way), pixmap.c has a ScalePixmap function, but in version 1.0.0, I can't find it. Any ideas?

matthewg42 12-01-2006 07:32 PM

ScalePixmap appears to be provided by the AfterImage library. Look up in the pixmap.c file a little and you'll see that the call to ScalePixmap is in a block of code which is only compiled if AfterImage is available:
Code:

#ifdef HAVE_AFTERIMAGE
    ...
    BG.trgPixmap = ScalePixmap(...


2.718281828 12-01-2006 07:37 PM

Aha, I hadn't noticed that before. It turns out that the block of code that I want comes a bit later. Thanks.


All times are GMT -5. The time now is 12:25 AM.