No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

42 líneas
1.3 KiB

  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. using System;
  14. using System.Runtime.InteropServices;
  15. using System.Security;
  16. using System.Drawing;
  17. namespace Caca
  18. {
  19. /* Static libcaca stuff that does not fit in any object */
  20. public static class Libcaca
  21. {
  22. [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
  23. SuppressUnmanagedCodeSecurity]
  24. private static extern int caca_rand(int min, int max);
  25. public static int Rand(int min, int max)
  26. {
  27. return caca_rand(min, max);
  28. }
  29. [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl),
  30. SuppressUnmanagedCodeSecurity]
  31. private static extern IntPtr caca_get_version();
  32. public static string getVersion()
  33. {
  34. return Marshal.PtrToStringAnsi(caca_get_version());
  35. }
  36. }
  37. }