Yahoo Web Search

Search results

  1. Dictionary
    opaque
    /ə(ʊ)ˈpeɪk/

    adjective

    noun

    • 1. an opaque thing.

    More definitions, origin and scrabble points

  2. I've seen both of the following two styles of declaring opaque types in C APIs. What are the various ways to declare opaque structs/pointers in C? Is there any clear advantage to using one style ov...

  3. In my understanding, opaque types are those which allow you to hold a handle (i.e., a pointer) to an structure, but not modify or view its contents directly (if you are allowed to at all, you do so through helper functions which understand the internal structure). Opaque types are, in part, a way to make C more object-oriented.

  4. Oct 10, 2009 · Not knowing anything about the structure is the name of the game so you're probably going to have to define some functions to manipulate them. Most C libraries that declare opaque structures often has accessor and modification functions. One example is from Lua (obviously a Lua state is an single use structure but it's the idea):

  5. Apr 16, 2019 · The problem working with opaque type is needed. Opaque struct is declared in header file with some other functions. But each function is supposed to have its own .c file and here comes the question. What should I do or where should I define the opaque struct so my functions can work with that? I have files like:

  6. Jun 24, 2019 · @ChrisW I don't think any of the other branded type questions reference opaque so it might be useful to add an answer to improve search-ability ... I'll add one once I'm out of a meeting – Titian Cernicova-Dragomir

  7. Dec 31, 2021 · If more than one file needs access to the internals of the opaque type, then you can have a public header which declares the opaque type and a private header which defines the structure. Privileged code includes the private header; unprivileged code uses the facilities declared in the public header, which must provide whatever access general users need to the actual data in the opaque type.

  8. According to the Rust FFI documentation, the choice would be defined as an opaque type pub enum UserAttr {}. However, I found that Rust is unable to copy its value, e.g. why does the address of an object change across methods. What's the right way in Rust to define such an opaque pointer, so that its value (as a pointer) gets copied across methods?

  9. Sep 26, 2011 · Opaque as the name suggests is something we can’t see through. E.g. wood is opaque. Opaque pointer is a pointer which points to a data structure whose contents are not exposed at the time of its definition. Example: struct STest* pSTest; It is safe to assign NULL to an opaque pointer. pSTest = NULL;

  10. Jun 29, 2013 · Opaque is also being used to mean hidden, which is perhaps where the confusion comes in. The term opaque type has a specific meaning in C/C++, where it refers to a type that has been declared but not yet defined. In both cases, I think people are using these terms to express a lack of visibility.

  11. Nov 1, 2015 · struct trytag_opaque { char data[sizeof(int)*2]; }; if you wanted to be more opaque than that, you could calculate the maximum size of the structure required across any supported platform, and use: struct trytag_opaque { char data[MAX_TRYTAG_SIZE]; }; Then your api.h function declarations would look like: int try_a(struct trytag_opaque *t)