1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
/*****
* misc.h : routines shared by a number of the example programs
*
* This file Version $Revision$
*
* Creation date: Sun Nov 2 22:17:14 GMT+0100 1997
* Last modification: $Date$
* By: $Author$
* Current State: $State$
*
* Author: newt
*
* Copyright (C) 1994-1997 by Ripley Software Development
* All Rights Reserved
*
* This file is part of the XmHTML Widget Library
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****/
/*****
* $Source$
*****/
/*****
* ChangeLog
* $Log$
*****/
#ifndef _misc_h_
#define _misc_h_
/* mime types getMimeType knows about */
typedef enum{
MIME_HTML = 0, /* text/html */
MIME_HTML_PERFECT, /* text/html-perfect */
MIME_IMAGE, /* image/whatever */
MIME_PLAIN, /* text/plain/unknown */
MIME_IMG_UNSUP, /* unsupported image type */
MIME_ERR /* some error occured */
}mimeType;
/* determine the mime type of the given file */
extern mimeType getMimeType(String file);
/*****
* Load a file and return it's contents. Return value must be freed by the
* caller. Returns a mime-description string in mime_type
*****/
extern String loadFile(String filename, String *mime_type);
/* copy and possibly collapse a URL to a string with at most 50 chars */
String collapseURL(String url);
/* Returns True if filename is a symbolic link */
extern Boolean followSymLinks(String filename);
/*****
* Display a Busy cursor when state is True and removes it when state is
* False
*****/
extern void setBusy(Widget w, Boolean state);
/* display a messagebox with the string msg */
extern void XMessage(Widget widget, String msg);
/* Decompose a Unix file name into a file name and a path */
int parseFilename(char *fullname, char *filename, char *pathname);
/* Don't add anything after this endif! */
#endif /* _misc_h_ */
|