File: hello.c

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (18 lines) | stat: -rw-r--r-- 308 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <dx/dx.h>


  Error m_Hello(Object *in, Object *out)
{
  char message[30], *greeting;
  
  if (!in[0])
    sprintf(message,"hello world");
  else {
    DXExtractString(in[0],&greeting);
    sprintf(message,"%s %s", "hello", greeting);
  }
  
  out[0] = (Object)DXNewString(message);
  return OK;
}