DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T x

⟦e17e392e1⟧ TextFile

    Length: 1591 (0x637)
    Types: TextFile
    Names: »xsetfp.c«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦8e9e227a9⟧ 
            └─⟦90cbe8196⟧ 
                └─ ⟦this⟧ »./xsetfp.c« 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦8e9e227a9⟧ 
            └─⟦e9895db93⟧ 
                └─ ⟦this⟧ »./xsetfp.c« 

TextFile

/******************************************************************************
 * Description
 *	Connect to a display and set the current font path based on arguments.
 *****************************************************************************/


#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <stdio.h>

#define TRUE  1
#define FALSE 0

char *ProgramName;
Display *dpy;

static char *help_message[] = {
"where options include:",
"    -display host:dpy                X server to use",
NULL};

/******************************************************************************
 * Description
 *	Main routine.  Process command-line arguments, then get the info.
 *****************************************************************************/

main(argc, argv)
int argc;
char **argv;
{
    char	*Paths[1024];
    int		 NPaths = 0;
    char 	*display = NULL;

    /* Process arguments: */

    while (*++argv) {
	if (!strcmp (*argv, "-display")) {
	    display = *++argv;
	} else {
	    Paths[NPaths++] = *argv;
	}
    }

    if (NPaths == 0) {
	char **cpp;

	fprintf (stderr, "usage:  %s [-options] <dirs>\n\n",
		 argv[0]);
	for (cpp = help_message; *cpp; cpp++) {
	    fprintf (stderr, "%s\n", *cpp);
	}
	fprintf (stderr, "\n");
	exit (1);
    }

    if (!(dpy= XOpenDisplay(display))) {
	perror("Cannot open display\n"); 
	exit(-1);
    }

    XSetFontPath( dpy, Paths, NPaths );

    {   int	  	  NPaths;
	char	**FP = XGetFontPath( dpy, &NPaths );
	int		  i;

	for (i = 0; i < NPaths; ++i) {
	    printf( "%s\n", FP[i] );
	}
    }

    XCloseDisplay(dpy);
}