File: ctxt_set.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 (27 lines) | stat: -rw-r--r-- 565 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
/* $id$

	Changes a context tag item 

	Return: E_None on success
*/

#include "../config.h"

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

int ctxtSet(const Context_Tag tag
	, const unsigned num
	, const char * const value)
{	char name[CTXT_ITEMNAME_LENGTH];
	int rc;

	ctxtMkItemName(name, tag, num);
	if((rc = chgCtxt(tag, name, value)) == 0) {
		/* Update min/max to reflect the added value */
		if(CTXT_INFO(tag, nummin) > num)
			CTXT_INFO(tag, nummin) = num;
		if(CTXT_INFO(tag, nummax) < num)
			CTXT_INFO(tag, nummax) = num;
	}
	return rc;
}