mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-27 15:01:00 +01:00
47300: Document the EC_NODUP, EC_DUP, EC_DUPTOK triplet.
All uses reviewed; no functional change.
This commit is contained in:
parent
cab21aff93
commit
d4da2c73f0
3 changed files with 32 additions and 3 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2020-08-08 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||||
|
|
||||||
|
* 47300: Src/parse.c, Src/zsh.h: Document the EC_NODUP, EC_DUP,
|
||||||
|
EC_DUPTOK triplet.
|
||||||
|
|
||||||
2020-08-08 Mikael Magnusson <mikachu@gmail.com>
|
2020-08-08 Mikael Magnusson <mikachu@gmail.com>
|
||||||
|
|
||||||
* unposted: Completion/BSD/Command/_kdump,
|
* unposted: Completion/BSD/Command/_kdump,
|
||||||
|
|
|
||||||
|
|
@ -2828,6 +2828,13 @@ freeeprog(Eprog p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* dup is of type 'enum ec_dup_t'.
|
||||||
|
*
|
||||||
|
* If tokflag is not NULL, *tokflag will be set to 1 if the string contains
|
||||||
|
* tokens and to 0 otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
char *
|
char *
|
||||||
ecgetstr(Estate s, int dup, int *tokflag)
|
ecgetstr(Estate s, int dup, int *tokflag)
|
||||||
|
|
|
||||||
23
Src/zsh.h
23
Src/zsh.h
|
|
@ -862,9 +862,26 @@ struct eccstr {
|
||||||
int hashval;
|
int hashval;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EC_NODUP 0
|
/*
|
||||||
#define EC_DUP 1
|
* Values for the "dup" parameter to ecgetstr().
|
||||||
#define EC_DUPTOK 2
|
*/
|
||||||
|
enum ec_dup_t {
|
||||||
|
/*
|
||||||
|
* Make no promises about how the return value is allocated, except that
|
||||||
|
* the caller does not need to explicitly free it. It might be heap allocated,
|
||||||
|
* a static string, or anything in between.
|
||||||
|
*/
|
||||||
|
EC_NODUP = 0,
|
||||||
|
|
||||||
|
/* Allocate the return value from the heap. */
|
||||||
|
EC_DUP = 1,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the string contains tokens (as indicated by the least significant bit
|
||||||
|
* of the wordcode), behave as EC_DUP; otherwise, as EC_NODUP.
|
||||||
|
*/
|
||||||
|
EC_DUPTOK = 2
|
||||||
|
};
|
||||||
|
|
||||||
/* See comment at the top of Src/parse.c for details. */
|
/* See comment at the top of Src/parse.c for details. */
|
||||||
#define WC_CODEBITS 5
|
#define WC_CODEBITS 5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue