summaryrefslogblamecommitdiff
path: root/src/common/sysinfo.h
blob: 70f6650711d40ccfb2fbae68caeb0f284b1be29d (plain) (tree)
1
2
3
4
5
6



                                                           

                        








                                                                               
                       






                                  
                                          
                                   


                                  



















                                                  
                    
                            
                       
 
                             
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Base Author: Haru @ http://hercules.ws

#ifndef COMMON_SYSINFO_H
#define COMMON_SYSINFO_H

/**
 * Provides various bits of information about the system Hercules is running on
 * (note: on unix systems, to avoid runtime detection, most of the data is
 * cached at compile time)
 */

#include "../common/cbasetypes.h"

struct sysinfo_private;

/**
 * sysinfo.c interface
 **/
struct sysinfo_interface {
	struct sysinfo_private *p;

#if defined(WIN32) && !defined(__CYGWIN__)
	long (*getpagesize) (void);
#else
	int (*getpagesize) (void);
#endif
	const char *(*platform) (void);
	const char *(*osversion) (void);
	const char *(*cpu) (void);
	int (*cpucores) (void);
	const char *(*arch) (void);
	bool (*is64bit) (void);
	const char *(*compiler) (void);
	const char *(*cflags) (void);
	const char *(*vcstype) (void);
	int (*vcstypeid) (void);
	const char *(*vcsrevision_src) (void);
	const char *(*vcsrevision_scripts) (void);
	void (*vcsrevision_reload) (void);
	bool (*is_superuser) (void);
	void (*init) (void);
	void (*final) (void);
};

struct sysinfo_interface *sysinfo;

#ifdef HERCULES_CORE
void sysinfo_defaults(void);
#endif // HERCULES_CORE

#endif /* COMMON_SYSINFO_H */