[SOLVED] does anyone know what this method of defining a function call is called
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
does anyone know what that is called or can lead me to where I can read up on it or explain it if it is not too involved.
How would one know when to use a NULL in place for the real type of data that is suppose to be in there, and what are the numbers denoting, and why some are zeros and some are a number and when to know what number to use to in place of the real data type that is suppose to be in there?
So I can eliminate some pot shooting until I get it to work, and still not fully understand what I am doing.
Code:
feh_wm_set_bg(NULL, NULL, 1, 0, 0, 0, 1);
the full function call is this.
Code:
static void feh_wm_set_bg_scaled(Pixmap pmap, Imlib_Image im, int use_filelist, int x, int y, int w, int h)
So the NULL would be used for data types that are like a class whereas the others are real types , int and chars?
and why the different numbers?
when, where, and why would one use them(these types of function calls)?
oh yes this is also being used in conjunction with a link list if that has anything to do with it.
The functions aren't being defined; they're being called. The definition is in your third bit of code.
NULL is always used for pointers that point to nothing. Pixmap and Imlib_Image are clearly structures of some kind. You should find them defined in one of the program headers. I would guess that Imlib_Image is probably declared in the header that goes with the imlib/imlib2 library.
Structures are nearly always handled by declaring a pointer to them rather than declaring the structure itself.
I don't know what the integer variable use_filelist stands for, but my guess is that it's a boolean (1 if a file list is used, 0 if it isn't). x,y,w and h are the standard names for the coordinates of windows and other rectangles: x and y coordinate of the top left hand corner, width and height.
The functions aren't being defined; they're being called. The definition is in your third bit of code.
NULL is always used for pointers that point to nothing. Pixmap and Imlib_Image are clearly structures of some kind. You should find them defined in one of the program headers. I would guess that Imlib_Image is probably declared in the header that goes with the imlib/imlib2 library.
Structures are nearly always handled by declaring a pointer to them rather than declaring the structure itself.
I don't know what the integer variable use_filelist stands for, but my guess is that it's a boolean (1 if a file list is used, 0 if it isn't). x,y,w and h are the standard names for the coordinates of windows and other rectangles: x and y coordinate of the top left hand corner, width and height.
Thanks, I'm not in need of it after all, I just found it strikingly interesting. Back when I was in NAM I'd come across some similar code like that and when I had informed the Master General Lieutenant Sargent on post of this , well ... just kidding.
The functions aren't being defined; they're being called. The definition is in your third bit of code.
yeah I need to brush up on my programming jargon, but...
I think I figured it out, finally, while not even looking for it.
Code:
//feh_wm_set_bg(NULL, NULL, 0, 0, 0, 0, 1);
extern void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, int fill, int desktop, int for_screen);
then ints are being used a boolean or enum I haven't looked - but I say enum because they are using 0,1,2 = 3 numbers so that cancels out the first thought being boolean.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.