Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8730987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:08:08+00:00 2026-06-13T09:08:08+00:00

When reading Enlightenment’s code, I found some things about C I don’t understand. I’ll

  • 0

When reading Enlightenment’s code, I found some things about C I don’t understand. I’ll paste the lines and explain why its not clear to me.

Eina_Bool (*hide)(void *data, Evas_Object *o);
void (*del)(void *data, Evas_Object *o);

On this ones, what do that pointer values between parentheses means just after return value?
Also, notice that the first parameters of both functions is void *data. Does that mean you can pass a pointer to any type of data to the function?

EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj);

Almost all functions on the API starts with EAPI. What does that mean? Is it a kind of namespaces? Where can I find some info about that?

Also notice how they use one of it’s libraries: Elementary.

EAPI_MAIN int elm_main(int argc, char **argv) {
    // CODE
}
ELM_MAIN()

Instead of using a main function, you use that elm_main with again those uppercase flags: EAPI_MAIN.
And just after the function there is that weird ELM_MAIN() without semicolons.

I’ll appreciate if you guys explain me a bit about all this that seemed strange the very first time I saw them.

Note: All of the examples I pasted came from elm_win.h Elementary header.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:08:09+00:00Added an answer on June 13, 2026 at 9:08 am

    The lines that you show here are declarations of function pointer variables.

    A line of the form:

    int (*foo)(int x)
    

    for example declares a variable called foo that can hold (the address of) a function that takes one integer argument (x) and returns an integer. If you declare a function like this:

    int twice( int x )
    {
        return x*2;
    }
    

    you could assign (the address of) that function to the variable foo.

    foo = twice;
    

    and then you could call the function twice through the pointer:

    int result = foo( 3 );
    

    (result would now contain 6)

    The usual reason to so something like this is that you know you want to call some function at a certain point in the code, but exactly what function depends on other code. If you had functions called process_A and process_B you might assign one of them to a function variable:

    int (*process)(int x);
    process = using_b ? process_B : process_A;
    ... more code ...
    result = process( some_value );
    

    here the result is set to the value calculated either by process_A or by process_B, depending on which one was assigned to process

    You could use a conditional at the point of call, of course, but selecting the function and storing it (or rather its address) in a variable leads to more efficient and (more importantly) clearer code.

    As for the EAPI symbol … I don’t know Enlightenment, but I would expect that that is just a macro #defined in a header. It probably changes the calling convention or exports symbols depending on the build options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading jQueryUI dialog code, I've found out, jQuery .attr() method has some undocumented behavior:
Reading some questions here on SO about conversion operators and constructors got me thinking
Reading over some example Objective C code just now. @property (nonatomic, strong) IBOutlet UILabel
Reading the Jon Skeet book, I have found (some time now) the use of
Reading this question I found this as (note the quotation marks) code to solve
Reading the code of the C library's sockets interface, I found this: /* Types
Reading some related questions made me think about the theoretical nature of HTML. I'm
Reading manual about Sling http://sling.apache.org/site/46-line-blog.html added folder blog and blog.html to destination: \launchpad\content\src\main\resources\content\ but
Reading through this excellent article about safe construction techniques by Brain Goetz, I got
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.