home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume10
/
contool
/
part01
/
load_icon.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-30
|
2KB
|
64 lines
/************************************************************************/
/* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
/* */
/* Permission to use, copy, modify, and distribute this software */
/* and its documentation for any purpose and without fee is */
/* hereby granted, provided that the above copyright notice */
/* appear in all copies and that both that copyright notice and */
/* this permission notice appear in supporting documentation, and */
/* that the name of Chuck Musciano and Harris Corporation not be */
/* used in advertising or publicity pertaining to distribution */
/* of the software without specific, written prior permission. */
/* Chuck Musciano and Harris Corporation make no representations */
/* about the suitability of this software for any purpose. It is */
/* provided "as is" without express or implied warranty. This */
/* software may not be sold without the prior explicit permission */
/* of Harris Corporation. */
/************************************************************************/
#include <stdio.h>
#include <sys/file.h>
#include <xview/xview.h>
#include <xview/icon_load.h>
#include "manifest.h"
#include "contool.h"
PUBLIC char *getenv();
/************************************************************************/
EXPORT Server_image load_icon(path, message)
char *path;
char *message;
{ char *icon_path, new_path[1024], *p, *q;
if (*path == '/')
return(icon_load_svrim(path, message));
else {
if ((p = getenv("ICON_PATH")) != NULL)
icon_path = strsave(p);
else
icon_path = strsave(ICON_PATH);
for (p = icon_path; *p; ) {
if (q = index(p, ':'))
*q = '\0';
strcpy(new_path, p);
strcat(new_path, "/");
strcat(new_path, path);
if (access(new_path, R_OK) == 0) {
free(icon_path);
return(icon_load_svrim(new_path, message));
}
else if (q != NULL)
p = q + 1;
else
break;
}
free(icon_path);
return(icon_load_svrim(path, message));
}
}