File: ctxt_as.c

package info (click to toggle)
dosemu-freedos 1%3A0.0.b9r5a%2Betch.1-0etch1
  • links: PTS
  • area: contrib
  • in suites: etch
  • size: 19,744 kB
  • ctags: 23,279
  • sloc: ansic: 143,864; asm: 20,397; makefile: 3,868; perl: 1,106; yacc: 690; sh: 553; pascal: 297; xml: 150; cpp: 67
file content (37 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
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
/* $Id: ctxt_as.c,v 1.1 2001/04/12 00:33:52 skaus Exp $

	Add status entry of a tag into context

	silent

	The status is sizemax encoded like this:
		sizemax | 0x8001
	--> neither of the bytes can become 0

	Return:
		E_None on success
*/

#include "../config.h"

#include <assert.h>

#include "../include/command.h"
#include "../include/context.h"

#if sizeof(unsigned) != 2
#error "sizeof(unsigned) != 2 is not supported"
#endif

int ctxtAddStatus(const Context_Tag tag)
{
	char value[3];

	ctxtCheckInfoTag(tag);

	*(unsigned*)value = CTXT_INFO(tag, sizemax) | 0x8001;
	value[sizeof(unsigned)] = 0;


	return ctxtSet(tag, 0, value);
}