Re: File Descriptor Input



>1) I have checked the referece documents, it just says
>a function. And I have type casted it to what is
>needed. I cannot think of a different prototype.

that's not what it says. it says:

gint        gdk_input_add                   (gint source,
                                             GdkInputCondition condition,
                                             GdkInputFunction function,
                                             gpointer data);

void        (*GdkInputFunction)             (gpointer data,
                                             gint source,
                                             GdkInputCondition condition);



>2)Data reading is the next stage. In the first stage,
>at least the function should get invoked. Later, when
>I have arrived in the function then I can think of
>reading the data.

you can't do this. if you don't read the data, then your function will
be called again immediately, because there is still data to be read.

>3) I think, when we do not use FALSE/TRUE the function
>automatically assumes a FALSE.

this is completely wrong. i think you need a little experience with C
programming. if you do not return a value from a function, the return
value is generally that of the last evaluated expression, although i
believe that this may be compiler/implementation dependent. if a
function is required to return a value, it must do so. you can make no
assumptions about any "default", because there is none.

--p




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]