Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: mojo/public/c/docs/bindings/TUTORIAL.md

Issue 2238373002: Initial docs on the internals of the C bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: link to INTERNALS.md in TUTORIAL.md Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/c/docs/bindings/INTERNALS.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # C bindings guide 1 # C bindings guide
2 2
3 The Mojo C bindings are a way to talk the Mojom protocol, the canonical protocol 3 The Mojo C bindings are a way to talk the Mojom protocol, the canonical protocol
4 for communication between Mojo programs. The library under `bindings/` provides 4 for communication between Mojo programs. The library under `bindings/` provides
5 functionality for encoding, decoding and other computation, so it needs to be 5 functionality for encoding, decoding and other computation, so it needs to be
6 linked together with C code generated from .mojom files. These C bindings are 6 linked together with C code generated from .mojom files. These C bindings are
7 lower-level than the C++ bindings (or any other language, for that matter), 7 lower-level than the C++ bindings (or any other language, for that matter),
8 are more error-prone, and require some knowledge of the C Mojo API and the 8 are more error-prone, and require some knowledge of the C Mojo API and the
9 mojom encoding format. This document assumes the reader knows about (or knows 9 mojom encoding format. This document assumes the reader knows about (or knows
10 how to look up) this relevant information. Consequently, C bindings can also 10 how to look up) this relevant information. Consequently, C bindings can also
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 as the number of bytes (minus the header). By convention, mojom strings are not 361 as the number of bytes (minus the header). By convention, mojom strings are not
362 null-terminated. 362 null-terminated.
363 363
364 ## Maps 364 ## Maps
365 365
366 Maps on the wire are mojom structs with two arrays; one for the keys, and one 366 Maps on the wire are mojom structs with two arrays; one for the keys, and one
367 for the values. The `i`th element in the keys array corresponds to the `i`th 367 for the values. The `i`th element in the keys array corresponds to the `i`th
368 element in the values array. As such, both arrays must have the same number 368 element in the values array. As such, both arrays must have the same number
369 of elements, and neither may be null. 369 of elements, and neither may be null.
370 370
371 # Numbers on generated bindings. 371 # Additional Readings
372 372 * [Internals of the generated bindings](INTERNALS.md)
373 TODO(vardhan): Probably as a separate doc?
OLDNEW
« no previous file with comments | « mojo/public/c/docs/bindings/INTERNALS.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698