xref: /minix3/external/bsd/nvi/dist/common/nothread.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: nothread.c,v 1.3 2014/01/26 21:43:45 christos Exp $	*/
284d9c625SLionel Sambuc /*-
384d9c625SLionel Sambuc  * Copyright (c) 2000
484d9c625SLionel Sambuc  *	Sven Verdoolaege.  All rights reserved.
584d9c625SLionel Sambuc  *
684d9c625SLionel Sambuc  * See the LICENSE file for redistribution information.
784d9c625SLionel Sambuc  */
884d9c625SLionel Sambuc 
984d9c625SLionel Sambuc #include "config.h"
1084d9c625SLionel Sambuc 
11*0a6a1f1dSLionel Sambuc #include <sys/cdefs.h>
12*0a6a1f1dSLionel Sambuc #if 0
1384d9c625SLionel Sambuc #ifndef lint
1484d9c625SLionel Sambuc static const char sccsid[] = "Id: nothread.c,v 1.4 2000/07/22 14:52:37 skimo Exp  (Berkeley) Date: 2000/07/22 14:52:37 ";
1584d9c625SLionel Sambuc #endif /* not lint */
16*0a6a1f1dSLionel Sambuc #else
17*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: nothread.c,v 1.3 2014/01/26 21:43:45 christos Exp $");
18*0a6a1f1dSLionel Sambuc #endif
1984d9c625SLionel Sambuc 
2084d9c625SLionel Sambuc #include <sys/types.h>
2184d9c625SLionel Sambuc #include <sys/queue.h>
2284d9c625SLionel Sambuc 
2384d9c625SLionel Sambuc #include <bitstring.h>
2484d9c625SLionel Sambuc #include <ctype.h>
2584d9c625SLionel Sambuc #include <errno.h>
2684d9c625SLionel Sambuc #include <stdio.h>
2784d9c625SLionel Sambuc #include <stdlib.h>
2884d9c625SLionel Sambuc #include <string.h>
2984d9c625SLionel Sambuc #include <unistd.h>
3084d9c625SLionel Sambuc 
3184d9c625SLionel Sambuc #include "../common/common.h"
3284d9c625SLionel Sambuc 
3384d9c625SLionel Sambuc static int vi_nothread_run __P((WIN *wp, void *(*fun)(void*), void *data));
3484d9c625SLionel Sambuc static int vi_nothread_lock __P((WIN *, void **));
3584d9c625SLionel Sambuc 
3684d9c625SLionel Sambuc /*
3784d9c625SLionel Sambuc  * thread_init
3884d9c625SLionel Sambuc  *
3984d9c625SLionel Sambuc  * PUBLIC: void thread_init __P((GS *gp));
4084d9c625SLionel Sambuc  */
4184d9c625SLionel Sambuc void
thread_init(GS * gp)4284d9c625SLionel Sambuc thread_init(GS *gp)
4384d9c625SLionel Sambuc {
4484d9c625SLionel Sambuc 	gp->run = vi_nothread_run;
4584d9c625SLionel Sambuc 	gp->lock_init = vi_nothread_lock;
4684d9c625SLionel Sambuc 	gp->lock_end = vi_nothread_lock;
4784d9c625SLionel Sambuc 	gp->lock_try = vi_nothread_lock;
4884d9c625SLionel Sambuc 	gp->lock_unlock = vi_nothread_lock;
4984d9c625SLionel Sambuc }
5084d9c625SLionel Sambuc 
5184d9c625SLionel Sambuc static int
vi_nothread_run(WIN * wp,void * (* fun)(void *),void * data)5284d9c625SLionel Sambuc vi_nothread_run(WIN *wp, void *(*fun)(void*), void *data)
5384d9c625SLionel Sambuc {
5484d9c625SLionel Sambuc 	fun(data);
5584d9c625SLionel Sambuc 	return 0;
5684d9c625SLionel Sambuc }
5784d9c625SLionel Sambuc 
5884d9c625SLionel Sambuc static int
vi_nothread_lock(WIN * wp,void ** lp)5984d9c625SLionel Sambuc vi_nothread_lock (WIN * wp, void **lp)
6084d9c625SLionel Sambuc {
6184d9c625SLionel Sambuc 	return 0;
6284d9c625SLionel Sambuc }
63