Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C++

Building a simple C++ script compiler from Scintilla and CINT

Rate me:
Please Sign up or sign in to vote.
4.73/5 (25 votes)
8 Jul 2006CPOL7 min read 153.8K   7.6K   85  
How to build a simple C++ script compiler from Scintilla and CINT.
/* /% C %/ */
/***********************************************************************
 * cint (C/C++ interpreter)
 ************************************************************************
 * Header file lib/pthread/pthd.h
 ************************************************************************
 * Description:
 *  pthread API
 ************************************************************************
 * Copyright(c) 1995~1999  Masaharu Goto (MXJ02154@niftyserve.or.jp)
 *
 * Permission to use, copy, modify and distribute this software and its 
 * documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  The author makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 ************************************************************************/
// Linux2.0 egcs   : g++ -lpthread pthread1.cxx
// HP-UX aCC       : aCC -D_POSIX_C_SOURCE=199506L -lpthread pthread1.cxx

#ifndef G__PTHREADDLL_H
#define G__PTHREADDLL_H

#ifndef __MAKECINT__

#include <pthread.h>

#else /* __MAKECINT__ */

/************************************************************************
 * Types
 *	pthread_t		Used to identify a thread.		*
 *	pthread_attr_t		Used to identify a thread attributes obj*
 *	pthread_mutex_t		Used for mutexes.			*
 *	pthread_mutexattr_t	Used to identify a mutex attributes obj	*
 *	pthread_cond_t		Used for condition variables.		*
 *	pthread_condattr_t	Used to identify a condition attribute	*
 *	pthread_key_t		Used for thread-specific data keys.	*
 *	pthread_once_t		Used for dynamic package initialization.*
 ************************************************************************/
typedef int	pthread_t;
typedef int	pthread_attr_t;

struct pthread_cond ;
typedef struct pthread_cond	pthread_cond_t;
typedef int	pthread_condattr_t;

struct pthread_mutex;
typedef	struct pthread_mutex	pthread_mutex_t;
typedef int	pthread_mutexattr_t;

typedef int	pthread_key_t;

typedef struct 
{
#if 0
	char			po_executing;
	char			po_completed;
	pthread_mutex_t		po_mutex;
	pthread_cond_t		po_executed;
#endif
} 
pthread_once_t;

struct timespec;

/************************************************************************
 * Functions
 ************************************************************************/
int pthread_create(pthread_t *thread,const pthread_attr_t *attr
		  ,void *(*start_routine)(void*),void *arg);
void pthread_exit(void *value_ptr);
int pthread_detach(pthread_t thread);

int pthread_join(pthread_t thread, void **value_ptr);

int pthread_cond_wait(pthread_cond_t *cond,pthread_mutex_t *mutex);
#if 0
int pthread_cond_timewait(pthread_cond_t *cond,pthread_mutex_t *mutex
                         ,const struct timespec *abstime);
#endif

int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);

#endif /* __MAKECINT__ */

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions