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

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

Update my e-mail address everywhere.

  • 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 *  $Id: Caca.cs 4148 2009-12-19 14:38:38Z sam $
8 *
9 *  This library is free software. It comes without any warranty, to
10 *  the extent permitted by applicable law. You can redistribute it
11 *  and/or modify it under the terms of the Do What The Fuck You Want
12 *  To Public License, Version 2, as published by Sam Hocevar. See
13 *  http://sam.zoy.org/wtfpl/COPYING for more details.
14 */
15
16using System;
17using System.Runtime.InteropServices;
18using System.Security;
19using System.Drawing;
20
21namespace Caca
22{
23    /* Static libcaca stuff that does not fit in any object */
24    public static class Libcaca
25    {
26        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
27         SuppressUnmanagedCodeSecurity]
28        private static extern int caca_rand(int min, int max);
29        public static int Rand(int min, int max)
30        {
31            return caca_rand(min, max);
32        }
33
34        [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
35         SuppressUnmanagedCodeSecurity]
36        private static extern IntPtr caca_get_version();
37        public static string getVersion()
38        {
39            return Marshal.PtrToStringAnsi(caca_get_version());
40        }
41    }
42}
43
Note: See TracBrowser for help on using the repository browser.