drivers/accessibility/speakup/makemapdata.c

Source file repositories/reference/linux-study-clean/drivers/accessibility/speakup/makemapdata.c

File Facts

System
Linux kernel
Corpus path
drivers/accessibility/speakup/makemapdata.c
Extension
.c
Size
2783 bytes
Lines
128
Domain
Driver Families
Bucket
drivers/accessibility
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (strlen(def_val) > 5) {
			//if (def_val[0] == '(')
			//	def_val++;
			cp = strchr(def_val, '+');
			if (!cp)
				continue;
			if (cp[-1] == ' ')
				cp[-1] = '\0';
			*cp++ = '\0';
			this = find_key(def_val);
			while (*cp == ' ')
				cp++;
			if (!this || *cp < '0' || *cp > '9')
				continue;
			value = this->value+atoi(cp);
		} else if (!strncmp(def_val, "0x", 2))
			sscanf(def_val+2, "%x", &value);
		else if (*def_val >= '0' && *def_val <= '9')
			value = atoi(def_val);
		else
			continue;
		add_key(def_name, value, is_spk);
	}

	printf("struct st_key_init init_key_data[] = {\n");
	for (i = 0; i < HASHSIZE; i++) {
		this = &key_table[i];
		if (!this->name)
			continue;
		do {
			printf("\t{ \"%s\", %d, %d, },\n", this->name, this->value, this->shift);
			this = this->next;
		} while (this);
	}
	printf("\t{ \".\", 0, 0 }\n};\n");

	exit(0);
}

Annotation

Implementation Notes