Home | History | Annotate | Download | only in android

Lines Matching full:line

21  * 1. An empty line (containing no characters, or only space or tab
23 * 2. A comment line (begins with '#')
24 * 3. A type section line (begins with '[')
25 * 4. Character map line, formatted as such:
45 /* Maximum length of a line expected in .kcm file. */
48 /* Maximum length of a token in a key map line. */
60 /* Result of parsing a line in a .kcm file. */
62 /* Line format was bad. */
65 /* Line had been skipped (an empty line, or a comment, etc.). */
68 /* Line represents an entry in the key map. */
271 /* Checks if a character represents an end of the line.
335 * line - String to get token from. End of the string should be
343 * a pointer to the line string, advanced past the found token.
346 kcm_get_token(const char* line, char* token, size_t max_token_len) {
348 const char* token_starts = kcm_skip_spaces(line);
433 /* Gets first token for the line and calculates its value.
434 * line - Line to get token's value from.
436 * value represented by the first token in the line.
437 * returns NULL on error, or a pointer to the line string,
441 kcm_get_char_or_hex_token_value(const char* line, unsigned short* val) {
443 line = kcm_get_token(line, token, KCM_MAX_TOKEN_LEN);
444 if (NULL != line) {
451 return line;
454 /* Parses a line in .kcm file extracting key information.
455 * line - Line in .kcm file to parse.
456 * line_index - Index of the parsing line in .kcm file.
458 * the line.
459 * kcm_file_path - Path to the charmap file, where paresed line was taken from.
460 * returns BAD_FORMAT if line format was not recognized, SKIP_LINE if line
462 * if key information was successfuly extracted from the line.
465 kcm_parse_line(const char* line,
472 // Get first token, and see if it's an empty, or a comment line.
473 line = kcm_get_token(line, token, KCM_MAX_TOKEN_LEN);
474 if ((NULL == line) || kcm_is_token_comment(token)) {
475 // Empty line, or a comment.
487 derror("Invalid format of charmap file %s. Unknown key %s in line %d",
493 line = kcm_get_char_or_hex_token_value(line, &disp);
494 if (NULL == line) {
495 derror("Invalid format of charmap file %s. Invalid display value in line %d",
501 line = kcm_get_char_or_hex_token_value(line, &key_entry->number);
502 if (NULL == line) {
503 derror("Invalid format of charmap file %s. Invalid number value in line %d",
509 line = kcm_get_char_or_hex_token_value(line, &key_entry->base);
510 if (NULL == line) {
511 derror("Invalid format of charmap file %s. Invalid base value in line %d",
517 line = kcm_get_char_or_hex_token_value(line, &key_entry->caps);
518 if (NULL == line) {
519 derror("Invalid format of charmap file %s. Invalid caps value in line %d",
525 line = kcm_get_char_or_hex_token_value(line, &key_entry->fn);
526 if (NULL == line) {
527 derror("Invalid format of charmap file %s. Invalid fn value in line %d",
533 line = kcm_get_char_or_hex_token_value(line, &key_entry->caps_fn);
534 if (NULL == line) {
535 derror("Invalid format of charmap file %s. Invalid caps_fn value in line %d",
540 // Make sure that line doesn't contain anything else,
542 line = kcm_get_token(line, token, KCM_MAX_TOKEN_LEN);
543 if ((NULL == line) || kcm_is_token_comment(token)) {
546 derror("Invalid format of charmap file %s in line %d",
604 * Note that line length in .kcm file should not exceed 1024 characters,
614 // A line read from .kcm file.
615 char line[KCM_MAX_LINE_LEN];
618 // Number of the currently parsed line.
641 // Line by line parse the file.
642 for (; 0 != fgets(line, sizeof(line), kcm_file); cur_line++) {
645 kcm_parse_line(line, cur_line, &key_entry, kcm_file_path);