#ifndef AFTERSTEP_LIB_HEADER_FILE_INCLUDED
#define AFTERSTEP_LIB_HEADER_FILE_INCLUDED

#include <X11/Xlib.h>
#ifdef I18N
#include <X11/Xlocale.h>
#endif
#include <stdio.h>

#ifdef NEWLOOK
typedef struct gradient_t
  {
    int from[3];
    int to[3];
  }
gradient_t;
#endif /* NEWLOOK */

#include "general.h" /* because misc.h is already taken */
#include "font.h"
#include "timer.h"
#include "balloon.h"

/* from getcolor.c */
unsigned long GetColor(char *);
unsigned long GetShadow (unsigned long);
unsigned long GetHilite (unsigned long);

int mystrcasecmp (const char *, const char *);
int mystrncasecmp (const char *, const char *, int);
char* mystrdup (const char*);
char* mystrndup (const char*, int);
char *CatString3 (const char *, const char *, const char *);
int mygethostname (char *, int);
void SendText (int *, char *, unsigned long);
void SendInfo (int *, char *, unsigned long);
char *safemalloc (int);

/* from findiconfile.c */
char *findIconFile (const char *, const char *, int);

void replaceEnvVar (char **);
int ReadASPacket (int, unsigned long *, unsigned long **);
void CopyString (char **, char *);
void sleep_a_little (int);
int GetFdWidth (void);
int CheckFile (const char *);
int CheckDir (const char *);
char *CheckOrShare (const char *, const char *, const char *, const int);
char *PutHome (const char *);
int HomeCreate (const char *);
int CheckOrCreate (const char *);
int CheckOrCreateFile (const char *);

/* #define DEBUG_ALLOCS */
#ifdef DEBUG_ALLOCS
#define safemalloc(a) countmalloc(__FUNCTION__, __LINE__, a)
#define calloc(a, b) countcalloc(__FUNCTION__, __LINE__, a, b)
#define realloc(a, b) countrealloc(__FUNCTION__, __LINE__, a, b)
#define free(a) countfree(__FUNCTION__, __LINE__, a)
void *countmalloc (char *fname, int line, int length);
void *countcalloc (char *fname, int line, int nrecords, int length);
void *countrealloc (char *fname, int line, void *ptr, int length);
void countfree (char *fname, int line, void *ptr);
void print_unfreed_mem (void);
#endif /*DEBUG_ALLOCS */

#endif /* #ifndef AFTERSTEP_LIB_HEADER_FILE_INCLUDED */
