From 3dddfb729195cf5c29130c94c29de02849507710 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 19 Sep 2023 13:53:03 +0900 Subject: [PATCH] Modify README markdown - Fixes typo - Changes '**Note**' to '[!NOTE]' Change-Id: Ia7290c1e680d49ddc0d3659d27e1f3958ce450df Signed-off-by: Hwankyu Jhun --- README.md | 81 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index b1f4bfb..c94e6be 100755 --- a/README.md +++ b/README.md @@ -19,19 +19,19 @@ TIDL is programming language to define interfaces for communicating among apps - [Struct](#struct-1) - [Proxy Interface](#proxy-interface) - [Stub Interface](#stub-interface) - - [Protocol Version 2](#protocol-version-2) - - [Enum Type](#enum-type) - - [Import Another TIDL File](#import-another-tidl-file) - - [Method Privilege](#method-privilege) - - [Map and Set Container Type](#map-and-set-container-type) - - [Marshalling Type Info](#marshalling-type-info) - - [Struct Inheritance](#struct-inheritance) - - [Remote Exception](#remote-exception) - - [Local Execution Mode](#local-execution-mode) - - [Private Sharing](#private-sharing) - - [TIDL Generated Code for Protocol Version 2](#tidl-generated-code-for-protocol-version-2) - - [Proxy Interface](#proxy-interface-1) - - [Stub Interface](#stub-interface-1) + - [Protocol version 2](#protocol-version-2) + - [Enum type](#enum-type) + - [Import another TIDL file](#import-another-tidl-file) + - [Method privilege](#method-privilege) + - [Map and set container type](#map-and-set-container-type) + - [Marshalling type info](#marshalling-type-info) + - [Struct inheritance](#struct-inheritance) + - [Remote exception](#remote-exception) + - [Local execution mode](#local-execution-mode) + - [Private sharing](#private-sharing) + - [TIDL generated code for protocol version 2](#tidl-generated-code-for-protocol-version-2) + - [Proxy interface](#proxy-interface-1) + - [Stub interface](#stub-interface-1) ## TIDLC @@ -549,13 +549,14 @@ class Runnable extends StubBase { ``` -## Protocol Version 2 -**TIDLC** supports 'protocol version 2' since Tizen 8.0. +## Protocol version 2 To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. 'protocol version 2' of **TIDL** supports the following features: + > [!NOTE] + > **TIDLC** supports 'protocol version 2' since Tizen 8.0. -### Enum Type +### Enum type - **'enum'** type is added. - You can declare an **enum** type inside a 'struct' or 'interface' and use it as a member variable or parameter. ```tidl @@ -584,7 +585,7 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. - When using a struct's enum type as a method parameter, it must be specified as **"."**. -### Import Another TIDL File +### Import another TIDL file - **'import'** keyword is added. - You can add and use other TIDL files in the same directory as the current TIDL file using the **'import'** keyword. - During the compilation process, the contents of other TIDL files are integrated and generated as one code. @@ -598,7 +599,7 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. ``` -### Method Privilege +### Method privilege - The protocol version 2 of TIDL supports the method privilege feature. - You can set privileges for each method of an interface by writing them as below: ```tidl @@ -613,10 +614,10 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. int Uninstall(string package); } ``` -- To use the GetPackages method in the example, the client application needs to have the privilege that is "http://tizen.org/privilege/packagemanager.info". +- To use the GetPackages method in the example, the client application needs to have the privilege that is "[http://tizen.org/privilege/packagemanager.info](http://tizen.org/privilege/packagemanager.info){:target="_blank"}". -### Map and Set Container Type +### Map and set container type - You can use map and set container types in TIDL. - The map type is **'map\'**. The set type is **'set\'**. ```tidl @@ -626,33 +627,32 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. set keys; } ``` - > **Note** - > - > The key type of map and set container must be TIDL's builtin types. + > [!NOTE] + > The key type of map and set container must be TIDL's built-in types. -### Marshalling Type Info +### Marshalling type info - From protocol version 2, the type information and variable names of method parameters are also transmitted. - Even if variable names are changed, added, or deleted due to interface modifications, it does not affect communication. - If there are no variables to be passed, they are passed as initial values. - - Example 1. Original tidl code + - The following code is an example of an original TIDL code: ```tidl interface Hello { int GetPackages(out list packages); } ``` - - Example 2. Revised tidl code + - The following code is an example of a revised TIDL code: ```tidl interface Hello { int GetPackages(out list packages, out int size); } `````` -- In the example, the GetPackages() method has an added size parameter. +- In the example, the `GetPackages()` method has an added size parameter. - Even if the stub only returns the existing packages parameter, there is no problem with communication. -### Struct Inheritance +### Struct inheritance - **'struct'** inheritance is supported. - Here is an example that supports **'struct'** inheritance: ```tidl @@ -666,11 +666,10 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. } ``` - In this example, **MessageDerived** inherits **MessageBase**. - > **Note** - > - > The inherited struct MUST not have elements of the base struct." + > [!Note] + > The inherited struct must not have elements of the base struct. -- If the method of the interface is a base struct, communication can be performed using the derived struct that is inherited. (Polymophism) +- If the method of the interface is a base struct, communication can be performed using the derived struct that is inherited. (Polymorphism) ```tidl struct MessageBase { int id; @@ -690,26 +689,26 @@ To use 'protocol version 2', you must fill **'protocol 2'** in the .tidl file. int SendMessage(MessageBase msg); } ``` -- When using the **Message** interface, you can use **Envelope** or **MessageDerived** to call the **SendMessage()** method. +- When using the **Message** interface, you can use **Envelope** or **MessageDerived** to call the **`SendMessage()`** method. -### Remote Exception +### Remote exception - The stub can use **RemoteException** to throw an exception to the proxy. - This feature is available when the method operates synchronously. - When the proxy sends a request and waits for a result, if the stub throws an exception, it is passed to the proxy. -### Local Execution Mode +### Local execution mode - If the stub that the proxy sends a request to is in the same application, a function call occurs instead of RPC. -### Private Sharing -- Since protocol version 2, the file keyword can be used without the '-b' option. +### Private sharing +- Since protocol version 2, the **file** keyword can be used without the '-b' option. - The proxy or the stub can use this to share a specific file in the data directory with the intended recipient for communication. - The recipient who receives the shared file can access it with read-only permission. -### TIDL Generated Code for Protocol Version 2 +### TIDL generated code for protocol version 2 **TIDL** ```tidl @@ -733,11 +732,11 @@ interface Message { int Send(MessageBase message); } ``` -- In the example, the MessageDerived structure inherits from MessageBase. +- In the example above, the **MessageDerived** structure inherits from **MessageBase**. - When calling the Send method of the Message interface, you can use a MessageDerived instance. -#### Proxy Interface +#### Proxy interface **C** ```c @@ -1145,7 +1144,7 @@ namespace Proxy -#### Stub Interface +#### Stub interface **C** ```c -- 2.7.4