char map_path[MAXPATHLEN];
char map_path[1024];
get_local_ordernum(domain,map,lordernum)char *domain;char *map;u_long *lordernum;{	char map_path[MAXPATHLEN];	char order_key[] = YP_LAST_KEY;	char order[MAX_LAST_LEN+1];	struct stat finfo;	DBM *db;	datum k,v;	int status;	/* This routine returns YPPUSH_SUCC or YPPUSH_NODOM */		status = YPPUSH_SUCC;		snprintf(map_path, sizeof map_path, "%s/%s",YP_DB_PATH,domain);	if (!((stat(map_path, &finfo) == 0) &&	      ((finfo.st_mode & S_IFMT) == S_IFDIR))) {		fprintf(stderr, "%s: domain %s not found locally\n",		    __progname, domain);		status = YPPUSH_NODOM;	}	if(status > 0) {				snprintf(map_path, sizeof map_path, "%s/%s/%s%s",		    YP_DB_PATH,domain,map,YPDB_SUFFIX);		if(!(stat(map_path, &finfo) == 0)) {			status = YPPUSH_NOMAP;		}	}		if(status > 0) {				snprintf(map_path, sizeof map_path, "%s/%s/%s",		    YP_DB_PATH,domain,map);		db = ypdb_open(map_path, O_RDONLY, 0444);		if(db == NULL) {			status = YPPUSH_DBM;		}			}			if(status > 0) {				k.dptr = (char *) &order_key;		k.dsize = YP_LAST_LEN;		v = ypdb_fetch(db,k);		ypdb_close(db);				if (v.dptr == NULL) {			*lordernum = 0;		} else {	        	strncpy(order, v.dptr, v.dsize);			order[v.dsize] = '\0';			*lordernum = (u_long) atol((char *) &order);		}	}	if((status == YPPUSH_NOMAP) || (status == YPPUSH_DBM)) {		*lordernum = 0;		status = YPPUSH_SUCC;	}	return(status);}