MCPcopy Index your code
hub / github.com/RsyncProject/rsync / poptArgInfo

Function poptArgInfo

popt/popt.c:1052–1072  ·  view source on GitHub ↗

* Return argInfo field, handling POPT_ARGFLAG_TOGGLE overrides. * @param con context * @param opt option * @return argInfo */

Source from the content-addressed store, hash-verified

1050 * @return argInfo
1051 */
1052static unsigned int poptArgInfo(poptContext con, const struct poptOption * opt)
1053{
1054 unsigned int argInfo = opt->argInfo;
1055
1056 if (con->os->argv != NULL && con->os->next > 0 && opt->longName != NULL)
1057 if (LF_ISSET(TOGGLE)) {
1058 const char * longName = con->os->argv[con->os->next-1];
1059 while (*longName == '-') longName++;
1060 /* XXX almost good enough but consider --[no]nofoo corner cases. */
1061 if (longName[0] != opt->longName[0] || longName[1] != opt->longName[1])
1062 {
1063 if (!LF_ISSET(XOR)) { /* XXX dont toggle with XOR */
1064 /* Toggle POPT_BIT_SET <=> POPT_BIT_CLR. */
1065 if (LF_ISSET(LOGICALOPS))
1066 argInfo ^= (POPT_ARGFLAG_OR|POPT_ARGFLAG_AND);
1067 argInfo ^= POPT_ARGFLAG_NOT;
1068 }
1069 }
1070 }
1071 return argInfo;
1072}
1073
1074/**
1075 * Parse an integer expression.

Callers 2

poptSaveArgFunction · 0.85
poptGetNextOptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected