コード例 #1
0
ファイル: checkdir.c プロジェクト: authorNari/panda
static	void
DumpDBG(
	char		*name,
	DBG_Struct	*dbg,
	void		*dummy)
{
	int		i;

	printf("name     = [%s]\n",dbg->name);fflush(stdout);
	printf("\ttype    = [%s]\n",dbg->type);fflush(stdout);
	printf("\tnServer = [%d]\n",dbg->nServer);fflush(stdout);
	for	( i = 0 ; i < dbg->nServer ; i ++ ) {
		if		(  dbg->server[i].port  !=  NULL  ) {
			printf("\t\thost     = [%s]\n",IP_HOST(dbg->server[i].port));fflush(stdout);
			printf("\t\tport     = [%s]\n",IP_PORT(dbg->server[i].port));fflush(stdout);
		}
		printf("\t\tDB name  = [%s]\n",dbg->server[i].dbname);
		printf("\t\tDB user  = [%s]\n",dbg->server[i].user);
		printf("\t\tDB pass  = [%s]\n",dbg->server[i].pass);
		printf("\t\tDB sslmode = [%s]\n",dbg->server[i].sslmode);
		fflush(stdout);
	}
	printf("\tDB locale= [%s]\n",dbg->coding);
	if		(  dbg->file  !=  NULL  ) {
		printf("\tlog file = [%s]\n",dbg->file);
	}
	if		(  dbg->redirect  !=  NULL  ) {
		while	(  dbg->redirect  !=  NULL  ) {
			dbg = dbg->redirect;
		}
		printf("\tredirect = [%s]\n",dbg->name);
	}
}
コード例 #2
0
ファイル: dbgroup.c プロジェクト: montsuqi/panda
extern char *GetDB_Host(DBG_Struct *dbg) {
  char *host;

  if (DB_Host != NULL) {
    host = DB_Host;
  } else {
    if ((host = GetMONDB_ENV(dbg, "HOST")) == NULL) {
      host = IP_HOST((GetDB_Port(dbg)));
    }
  }
  return (host);
}
コード例 #3
0
ファイル: monitor.c プロジェクト: montsuqi/panda
static Bool HerePort(Port *port) {
  Bool ret;
  char *host;

  if (port == NULL) {
    ret = FALSE;
  } else {
    switch (port->type) {
    case PORT_IP:
      if ((host = IP_HOST(port)) != NULL) {
        ret = (strcmp(host, MyHost) == 0) ? TRUE : TRUE; // what meaning?
      } else {
        ret = FALSE;
      }
      break;
    case PORT_UNIX:
      ret = TRUE;
      break;
    default:
      ret = FALSE;
    }
  }
  return (ret);
}