[pacman-dev] alpm_option_set_logcb(), an example of usage

Xavier shiningxc at gmail.com
Wed Aug 13 05:32:27 EDT 2008


On Wed, Aug 13, 2008 at 11:17 AM, Imanol Celaya <archye at pycut.com.ar> wrote:
>> Why not just using grep or whatever :
>> $ grep -r cb_log src/pacman/*.c
>> src/pacman/callback.c:void cb_log(pmloglevel_t level, char *fmt, va_list args)
>> src/pacman/pacman.c:    alpm_option_set_logcb(cb_log);
>>
>> All callbacks (cb) are defined in that callback.c file.
>
> thanks, I didn't know about grep -r

Hmm, in the example above, -r is not needed because I specified a list of files.
$ grep cb_log src/pacman/*.c

-r is needed when running on directories (just like rm) :
$ grep -r cb_log .

But sometimes you get unwanted spam, so it is better to only search
the .c files like above.
Another way :
$ find . -name "*.c" | xargs grep logcb

Finally, a more powerful tool is cscope :
http://cscope.sourceforge.net/
But I didn't manage to get used to this tool yet, I tried it once or
twice then I always forget about it :P



More information about the pacman-dev mailing list