Content deleted Content added
Kiamlaluno (talk | contribs) |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 14:
If it should be as simple as possible, we should use something like this:
<
using GLib;
Line 20:
print ("Hello World\n");
}
</syntaxhighlight>
However, it would be useful to have a second example, then, that shows a bit more of the syntax.
[[User:Juergbi|Juergbi]] ([[User talk:Juergbi|talk]]) 14:14, 22 June 2008 (UTC)
::If it were to be as simple as possible you could drop the glib import and just have the one-liner:
<blockquote><blockquote><
void main() { print("Hello World\n"); }
</
::[[Special:Contributions/24.243.3.27|24.243.3.27]] ([[User talk:24.243.3.27|talk]]) 09:53, 19 October 2008 (UTC)
Line 64:
:Ps. As an example of how easy it is to wrap C libraries, one can copy the default glib-2.0.vapi somewhere and edit it to wrap g_chdir by putting the following code under the DirUtils namespace, then compiling with the switch --vapidir=/path/to/modified/vapi:
<blockquote><
[CCode (cname = "g_chdir")]
public static int chdir (string pathname);
</
:Which then be used from Vala code:
<blockquote><
DirUtils.chdir( "/foo/bar" );
</
:[[Special:Contributions/24.243.3.27|24.243.3.27]] ([[User talk:24.243.3.27|talk]]) 08:00, 22 September 2008 (UTC)
|