source: libcaca/trunk/caca-sharp/Caca.cs @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 10 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/*
2 *  libcaca       .NET bindings for libcaca
3 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
4 *                2007 Sam Hocevar <sam@@hocevar.net>
5 *                All Rights Reserved
6 *
7 *  This library is free software. It comes without any warranty, to
8 *  the extent permitted by applicable law. You can redistribute it
9 *  and/or modify it under the terms of the Do What The Fuck You Want
10 *  To Public License, Version 2, as published by Sam Hocevar. See
11 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12 */
13
14using System;
15using System.Runtime.InteropServices;
16using System.Security;
17using System.Drawing;
18
19namespace Caca
20{
21    /* Static libcaca stuff that does not fit in any object */
22    public static class Libcaca
23    {
24        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
25         SuppressUnmanagedCodeSecurity]
26        private static extern int caca_rand(int min, int max);
27        public static int Rand(int min, int max)
28        {
29            return caca_rand(min, max);
30        }
31
32        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
33         SuppressUnmanagedCodeSecurity]
34        private static extern IntPtr caca_get_version();
35        public static string getVersion()
36        {
37            return Marshal.PtrToStringAnsi(caca_get_version());
38        }
39    }
40}
41
Note: See TracBrowser for help on using the repository browser.