MCPcopy Create free account
hub / github.com/boostorg/build / var_edit_parse

Function var_edit_parse

v2/engine/function.c:644–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642 */
643
644static int var_edit_parse( char const * mods, VAR_EDITS * edits, int havezeroed
645 )
646{
647 while ( *mods )
648 {
649 PATHPART * fp;
650
651 switch ( *mods++ )
652 {
653 case 'L': edits->downshift = 1; continue;
654 case 'U': edits->upshift = 1; continue;
655 case 'P': edits->parent = edits->filemods = 1; continue;
656 case 'E': fp = &edits->empty; goto strval;
657 case 'J': fp = &edits->join; goto strval;
658 case 'G': fp = &edits->f.f_grist; goto fileval;
659 case 'R': fp = &edits->f.f_root; goto fileval;
660 case 'D': fp = &edits->f.f_dir; goto fileval;
661 case 'B': fp = &edits->f.f_base; goto fileval;
662 case 'S': fp = &edits->f.f_suffix; goto fileval;
663 case 'M': fp = &edits->f.f_member; goto fileval;
664 case 'T': edits->to_slashes = 1; continue;
665 case 'W': edits->to_windows = 1; continue;
666 default:
667 continue; /* Should complain, but so what... */
668 }
669
670 fileval:
671 /* Handle :CHARS, where each char (without a following =) selects a
672 * particular file path element. On the first such char, we deselect all
673 * others (by setting ptr = "", len = 0) and for each char we select
674 * that element (by setting ptr = 0).
675 */
676 edits->filemods = 1;
677
678 if ( *mods != '=' )
679 {
680 if ( !havezeroed++ )
681 {
682 int i;
683 for ( i = 0; i < 6; ++i )
684 {
685 edits->f.part[ i ].len = 0;
686 edits->f.part[ i ].ptr = "";
687 }
688 }
689
690 fp->ptr = 0;
691 continue;
692 }
693
694 strval:
695 /* Handle :X=value, or :X */
696 if ( *mods != '=' )
697 {
698 fp->ptr = "";
699 fp->len = 0;
700 }
701 else

Callers 1

expand_modifiersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected