示例#1
0
mo_status mo_dtm_send_text (mo_window *win, char *port, char *url, char *text)
{
    Text *t = (Text *)malloc (sizeof (Text));
    char *title = (char *)malloc (strlen (url) + 16);
    NetPort *inport, *outport;
    int rv;

    sprintf (title, "Mosaic: %s\0", url);
    t->title = title;
    t->id = strdup ("mosaic");
    t->selLeft = t->selRight = t->insertPt = 0;
    t->numReplace = t->dim = strlen (text);
    t->replaceAll = TRUE;
    t->textString = strdup (text);

    NetInit ();
    inport = NetCreateInPort (":0");
    outport = NetInternalCreateOutPort (port, FALSE);

    rv = NetSendText (outport, t, FALSE, "NewText");

    return mo_succeed;
}
示例#2
0
mo_status mo_dtm_send_text (mo_window *win, char *url, char *text)
{
  Text *t;
  char *title;
  int rv;

  if (!mo_dtm_out_active_p ())
    return mo_fail;

  title = (char *)malloc (strlen (url) + 16);
  sprintf (title, "Mosaic: %s\0", url);

  t = (Text *)malloc (sizeof (Text));
  t->title = title;
  t->id = strdup ("Mosaic");
  t->selLeft = t->selRight = t->insertPt = 0;
  t->numReplace = t->dim = strlen (text);
  t->replaceAll = TRUE;
  t->textString = strdup (text);

  rv = NetSendText (NULL, t, FALSE, "NewText");

  return mo_succeed;
}