This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 18th, 2012  |  syntax: C#  |  size: 0.59 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifndef WIN32_LEAN_AND_MEAN
  2. #define WIN32_LEAN_AND_MEAN
  3. #endif
  4.  
  5. #define NOCOMM
  6. #define NOapi
  7.  
  8. #ifdef _WIN32
  9. #define DLLEXPORT __declspec(dllexport)
  10. #else
  11. #define DLLEXPORT
  12. #endif
  13.  
  14. //#include <windows.h>
  15. #include "postgres.h"
  16. #include "fmgr.h"
  17.  
  18. #include <string.h>
  19.  
  20. #ifdef PG_MODULE_MAGIC
  21. PG_MODULE_MAGIC;
  22. #endif
  23.  
  24. /* by value */        
  25. int add_one(int arg)
  26. {
  27.     return arg + 1;
  28. }
  29.  
  30. /* by reference, fixed length */
  31. float8 * add_one_float8(float8 *arg)
  32. {
  33.     float8    *result = (float8 *) palloc(sizeof(float8));
  34.  
  35.     *result = *arg + 1.0;
  36.        
  37.     return result;
  38. }
clone this paste RAW Paste Data