home *** CD-ROM | disk | FTP | other *** search
-
- #include "make.h"
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <mach/mach.h>
- #include <servers/netname.h>
- #include <sys/param.h>
-
- void
- make_support (type, name, file, line, msg, arg1, arg2, arg3)
- int type;
- char *name;
- char *file;
- int line;
- char *msg;
- int arg1;
- int arg2;
- int arg3;
- {
- static port_t port = PORT_NULL;
- static int already_tried = 0;
- static char directory[MAXPATHLEN];
- char message[1000];
-
- if (port == PORT_NULL && already_tried == 0)
- {
- char *port_name = getenv ("MAKEPORT");
- char *host_name = getenv ("MAKEHOST");
-
- already_tried = 1;
-
- if (port_name == NULL)
- return;
-
- if (host_name == NULL)
- host_name = "";
-
- netname_look_up (name_server_port, host_name, port_name, &port);
-
- if (port == PORT_NULL)
- return;
-
- getwd (directory);
- }
-
- if (name == NULL)
- name = "";
-
- if (file == NULL)
- file = "";
-
- if (msg == NULL)
- message[0] = '\0';
- else
- sprintf (message, msg, arg1, arg2, arg3);
-
- make_alert (port,
- type,
- name, strlen (name) + 1,
- file, strlen (file) + 1,
- directory, strlen (directory) + 1,
- line,
- message, strlen (message) + 1);
- }
-